summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-07-31 12:09:49 +0200
committerParménides GV <parmegv@sdf.org>2014-07-31 12:09:49 +0200
commit0393ba6656ce6cf679a2c4663275b3ed0f1a34b9 (patch)
treef000311e97598ab3fc42e2bea23e6cb342ad166c
parentb28eeb08e8ec3baafdd9388cc5b70c6c84db9cf1 (diff)
Updated ics-openvpn to rev 859 + no 2nd notification.
-rw-r--r--app/build.gradle11
-rw-r--r--app/jni/Android.mk6
-rw-r--r--app/jni/Application.mk2
-rw-r--r--app/lzo/B/00README.TXT105
-rw-r--r--app/lzo/B/clean.bat8
-rw-r--r--app/lzo/B/done.bat4
-rw-r--r--app/lzo/B/dos16/bc.bat78
-rw-r--r--app/lzo/B/dos16/bc.rsp134
-rw-r--r--app/lzo/B/dos16/bc_286.bat84
-rw-r--r--app/lzo/B/dos16/bc_pp.bat84
-rw-r--r--app/lzo/B/dos16/dm.bat78
-rw-r--r--app/lzo/B/dos16/mc.bat104
-rw-r--r--app/lzo/B/dos16/mc_qc.bat104
-rw-r--r--app/lzo/B/dos16/qc.bat80
-rw-r--r--app/lzo/B/dos16/sc.bat106
-rw-r--r--app/lzo/B/dos16/tc.bat78
-rw-r--r--app/lzo/B/dos16/vc.bat78
-rw-r--r--app/lzo/B/dos16/vc_qc.bat78
-rw-r--r--app/lzo/B/dos16/wc.bat78
-rw-r--r--app/lzo/B/dos16/wc.rsp134
-rw-r--r--app/lzo/B/dos32/bc_pp.bat84
-rw-r--r--app/lzo/B/dos32/dj2.bat90
-rw-r--r--app/lzo/B/dos32/dj2.opt12
-rw-r--r--app/lzo/B/dos32/dm.bat86
-rw-r--r--app/lzo/B/dos32/emx.bat90
-rw-r--r--app/lzo/B/dos32/highc.bat78
-rw-r--r--app/lzo/B/dos32/highc.rsp152
-rw-r--r--app/lzo/B/dos32/ndp.bat80
-rw-r--r--app/lzo/B/dos32/ndp.rsp134
-rw-r--r--app/lzo/B/dos32/sc.bat102
-rw-r--r--app/lzo/B/dos32/wc.bat78
-rw-r--r--app/lzo/B/dos32/zc.bat102
-rwxr-xr-xapp/lzo/B/generic/build.sh2
-rwxr-xr-xapp/lzo/B/generic/clean.sh2
-rw-r--r--app/lzo/B/os2/emx.bat90
-rw-r--r--app/lzo/B/os2/wc.bat84
-rw-r--r--app/lzo/B/os2/zc.bat102
-rw-r--r--app/lzo/B/os2_16/mc.bat86
-rw-r--r--app/lzo/B/os2_16/wc.bat84
-rw-r--r--app/lzo/B/prepare.bat20
-rw-r--r--app/lzo/B/src.rsp134
-rw-r--r--app/lzo/B/unset.bat20
-rw-r--r--app/lzo/B/win16/bc.bat84
-rw-r--r--app/lzo/B/win16/dm.bat86
-rw-r--r--app/lzo/B/win16/mc.bat112
-rw-r--r--app/lzo/B/win16/sc.bat106
-rw-r--r--app/lzo/B/win16/vc.bat86
-rw-r--r--app/lzo/B/win16/wc.bat84
-rw-r--r--app/lzo/B/win32/bc.bat84
-rw-r--r--app/lzo/B/win32/bc.rsp152
-rw-r--r--app/lzo/B/win32/cygwin.bat90
-rw-r--r--app/lzo/B/win32/cygwin.rsp152
-rw-r--r--app/lzo/B/win32/dm.bat84
-rw-r--r--app/lzo/B/win32/ic.bat84
-rw-r--r--app/lzo/B/win32/lccwin32.bat118
-rw-r--r--app/lzo/B/win32/mingw.bat90
-rw-r--r--app/lzo/B/win32/mwerks.bat84
-rw-r--r--app/lzo/B/win32/pellesc.bat84
-rw-r--r--app/lzo/B/win32/pgi.bat86
-rw-r--r--app/lzo/B/win32/pw32.bat90
-rw-r--r--app/lzo/B/win32/rsxnt.bat90
-rw-r--r--app/lzo/B/win32/sc.bat112
-rw-r--r--app/lzo/B/win32/vc.bat84
-rw-r--r--app/lzo/B/win32/vc.rsp152
-rw-r--r--app/lzo/B/win32/vc_dll.bat84
-rw-r--r--app/lzo/B/win32/vc_dll.def20
-rw-r--r--app/lzo/B/win32/wc.bat78
-rw-r--r--app/lzo/B/win32/wc.rsp152
-rw-r--r--app/lzo/B/win64/ic.bat84
-rw-r--r--app/lzo/B/win64/ic_dll.bat84
-rw-r--r--app/lzo/B/win64/vc.bat84
-rw-r--r--app/lzo/B/win64/vc.rsp134
-rw-r--r--app/lzo/B/win64/vc_dll.bat84
-rw-r--r--app/lzo/B/win64/vc_dll.def2
-rw-r--r--app/lzo/Makefile.am38
-rw-r--r--app/lzo/Makefile.in716
-rw-r--r--app/lzo/NEWS16
-rw-r--r--app/lzo/aclocal.m43695
-rw-r--r--app/lzo/asm/i386/src/enter.ash17
-rw-r--r--app/lzo/asm/i386/src/leave.ash17
-rw-r--r--app/lzo/asm/i386/src/lzo1c_d.ash17
-rw-r--r--app/lzo/asm/i386/src/lzo1c_s1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo1f_d.ash17
-rw-r--r--app/lzo/asm/i386/src/lzo1f_f1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo1x_d.ash17
-rw-r--r--app/lzo/asm/i386/src/lzo1x_f1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo1x_s1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo1y_f1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo1y_s1.S17
-rw-r--r--app/lzo/asm/i386/src/lzo_asm.h17
-rw-r--r--app/lzo/asm/i386/src_gas/all/asm_all.S416
-rw-r--r--app/lzo/asm/i386/src_gas/asminit.def31
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1c_s1.S17
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1f_f1.S17
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1x_f1.S17
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1x_s1.S17
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1y_f1.S17
-rw-r--r--app/lzo/asm/i386/src_gas/lzo1y_s1.S17
-rw-r--r--app/lzo/asm/i386/src_masm/all/asm_all.asm269
-rw-r--r--app/lzo/asm/i386/src_masm/asminit.def17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1c_s1.asm17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1f_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1x_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1x_s1.asm17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1y_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_masm/lzo1y_s1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/all/asm_all.asm420
-rw-r--r--app/lzo/asm/i386/src_nasm/asminit.def72
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1c_s1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1f_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1x_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1x_s1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1y_f1.asm17
-rw-r--r--app/lzo/asm/i386/src_nasm/lzo1y_s1.asm17
-rwxr-xr-xapp/lzo/autoconf/compile123
-rwxr-xr-xapp/lzo/autoconf/config.guess367
-rwxr-xr-xapp/lzo/autoconf/config.rpath20
-rwxr-xr-xapp/lzo/autoconf/config.sub152
-rwxr-xr-xapp/lzo/autoconf/install-sh374
-rw-r--r--app/lzo/autoconf/local.m4130
-rw-r--r--app/lzo/autoconf/ltmain.sh6621
-rwxr-xr-xapp/lzo/autoconf/mdate-sh15
-rwxr-xr-xapp/lzo/autoconf/missing461
-rwxr-xr-xapp/lzo/autoconf/mkinstalldirs4
-rwxr-xr-xapp/lzo/autoconf/py-compile68
-rwxr-xr-xapp/lzo/autoconf/shtool12
-rwxr-xr-xapp/lzo/autoconf/ylwrap196
-rw-r--r--app/lzo/config.hin11
-rwxr-xr-xapp/lzo/configure3632
-rw-r--r--app/lzo/configure.ac18
-rw-r--r--app/lzo/doc/LZO.TXT9
-rw-r--r--app/lzo/doc/LZOAPI.TXT28
-rw-r--r--app/lzo/examples/dict.c71
-rw-r--r--app/lzo/examples/lzopack.c75
-rw-r--r--app/lzo/examples/overlap.c74
-rw-r--r--app/lzo/examples/portab.h82
-rw-r--r--app/lzo/examples/portab_a.h113
-rw-r--r--app/lzo/examples/precomp.c39
-rw-r--r--app/lzo/examples/precomp2.c45
-rw-r--r--app/lzo/examples/simple.c31
-rw-r--r--app/lzo/include/lzo/lzo1.h21
-rw-r--r--app/lzo/include/lzo/lzo1a.h21
-rw-r--r--app/lzo/include/lzo/lzo1b.h23
-rw-r--r--app/lzo/include/lzo/lzo1c.h23
-rw-r--r--app/lzo/include/lzo/lzo1f.h21
-rw-r--r--app/lzo/include/lzo/lzo1x.h27
-rw-r--r--app/lzo/include/lzo/lzo1y.h21
-rw-r--r--app/lzo/include/lzo/lzo1z.h48
-rw-r--r--app/lzo/include/lzo/lzo2a.h19
-rw-r--r--app/lzo/include/lzo/lzo_asm.h33
-rw-r--r--app/lzo/include/lzo/lzoconf.h214
-rw-r--r--app/lzo/include/lzo/lzodefs.h2296
-rw-r--r--app/lzo/include/lzo/lzoutil.h17
-rw-r--r--app/lzo/lzotest/asm.h17
-rw-r--r--app/lzo/lzotest/db.h17
-rw-r--r--app/lzo/lzotest/lzotest.c167
-rw-r--r--app/lzo/lzotest/wrap.h21
-rw-r--r--app/lzo/lzotest/wrapmisc.h17
-rw-r--r--app/lzo/minilzo/Makefile.minilzo29
-rw-r--r--app/lzo/minilzo/README.LZO9
-rw-r--r--app/lzo/minilzo/minilzo.c3756
-rw-r--r--app/lzo/minilzo/minilzo.h21
-rw-r--r--app/lzo/minilzo/testmini.c25
-rw-r--r--app/lzo/src/compr1b.h23
-rw-r--r--app/lzo/src/compr1c.h23
-rw-r--r--app/lzo/src/config1.h17
-rw-r--r--app/lzo/src/config1a.h17
-rw-r--r--app/lzo/src/config1b.h17
-rw-r--r--app/lzo/src/config1c.h17
-rw-r--r--app/lzo/src/config1f.h17
-rw-r--r--app/lzo/src/config1x.h17
-rw-r--r--app/lzo/src/config1y.h17
-rw-r--r--app/lzo/src/config1z.h17
-rw-r--r--app/lzo/src/config2a.h23
-rw-r--r--app/lzo/src/lzo1.c17
-rw-r--r--app/lzo/src/lzo1_99.c21
-rw-r--r--app/lzo/src/lzo1_cm.ch17
-rw-r--r--app/lzo/src/lzo1_d.ch38
-rw-r--r--app/lzo/src/lzo1a.c29
-rw-r--r--app/lzo/src/lzo1a_99.c21
-rw-r--r--app/lzo/src/lzo1a_cm.ch17
-rw-r--r--app/lzo/src/lzo1a_cr.ch23
-rw-r--r--app/lzo/src/lzo1a_de.h17
-rw-r--r--app/lzo/src/lzo1b_1.c17
-rw-r--r--app/lzo/src/lzo1b_2.c17
-rw-r--r--app/lzo/src/lzo1b_3.c17
-rw-r--r--app/lzo/src/lzo1b_4.c17
-rw-r--r--app/lzo/src/lzo1b_5.c17
-rw-r--r--app/lzo/src/lzo1b_6.c17
-rw-r--r--app/lzo/src/lzo1b_7.c17
-rw-r--r--app/lzo/src/lzo1b_8.c17
-rw-r--r--app/lzo/src/lzo1b_9.c17
-rw-r--r--app/lzo/src/lzo1b_99.c17
-rw-r--r--app/lzo/src/lzo1b_9x.c17
-rw-r--r--app/lzo/src/lzo1b_c.ch27
-rw-r--r--app/lzo/src/lzo1b_cc.c17
-rw-r--r--app/lzo/src/lzo1b_cc.h17
-rw-r--r--app/lzo/src/lzo1b_cm.ch17
-rw-r--r--app/lzo/src/lzo1b_cr.ch19
-rw-r--r--app/lzo/src/lzo1b_d.ch46
-rw-r--r--app/lzo/src/lzo1b_d1.c17
-rw-r--r--app/lzo/src/lzo1b_d2.c17
-rw-r--r--app/lzo/src/lzo1b_de.h19
-rw-r--r--app/lzo/src/lzo1b_r.ch23
-rw-r--r--app/lzo/src/lzo1b_rr.c17
-rw-r--r--app/lzo/src/lzo1b_sm.ch17
-rw-r--r--app/lzo/src/lzo1b_tm.ch17
-rw-r--r--app/lzo/src/lzo1b_xx.c17
-rw-r--r--app/lzo/src/lzo1c_1.c17
-rw-r--r--app/lzo/src/lzo1c_2.c17
-rw-r--r--app/lzo/src/lzo1c_3.c17
-rw-r--r--app/lzo/src/lzo1c_4.c17
-rw-r--r--app/lzo/src/lzo1c_5.c17
-rw-r--r--app/lzo/src/lzo1c_6.c17
-rw-r--r--app/lzo/src/lzo1c_7.c17
-rw-r--r--app/lzo/src/lzo1c_8.c17
-rw-r--r--app/lzo/src/lzo1c_9.c17
-rw-r--r--app/lzo/src/lzo1c_99.c17
-rw-r--r--app/lzo/src/lzo1c_9x.c19
-rw-r--r--app/lzo/src/lzo1c_cc.c17
-rw-r--r--app/lzo/src/lzo1c_cc.h17
-rw-r--r--app/lzo/src/lzo1c_d1.c17
-rw-r--r--app/lzo/src/lzo1c_d2.c31
-rw-r--r--app/lzo/src/lzo1c_rr.c17
-rw-r--r--app/lzo/src/lzo1c_xx.c17
-rw-r--r--app/lzo/src/lzo1f_1.c49
-rw-r--r--app/lzo/src/lzo1f_9x.c19
-rw-r--r--app/lzo/src/lzo1f_d.ch45
-rw-r--r--app/lzo/src/lzo1f_d1.c17
-rw-r--r--app/lzo/src/lzo1f_d2.c31
-rw-r--r--app/lzo/src/lzo1x_1.c21
-rw-r--r--app/lzo/src/lzo1x_1k.c21
-rw-r--r--app/lzo/src/lzo1x_1l.c21
-rw-r--r--app/lzo/src/lzo1x_1o.c21
-rw-r--r--app/lzo/src/lzo1x_9x.c31
-rw-r--r--app/lzo/src/lzo1x_c.ch170
-rw-r--r--app/lzo/src/lzo1x_d.ch94
-rw-r--r--app/lzo/src/lzo1x_d1.c17
-rw-r--r--app/lzo/src/lzo1x_d2.c42
-rw-r--r--app/lzo/src/lzo1x_d3.c21
-rw-r--r--app/lzo/src/lzo1x_o.c17
-rw-r--r--app/lzo/src/lzo1x_oo.ch22
-rw-r--r--app/lzo/src/lzo1y_1.c21
-rw-r--r--app/lzo/src/lzo1y_9x.c17
-rw-r--r--app/lzo/src/lzo1y_d1.c17
-rw-r--r--app/lzo/src/lzo1y_d2.c42
-rw-r--r--app/lzo/src/lzo1y_d3.c17
-rw-r--r--app/lzo/src/lzo1y_o.c17
-rw-r--r--app/lzo/src/lzo1z_9x.c17
-rw-r--r--app/lzo/src/lzo1z_d1.c17
-rw-r--r--app/lzo/src/lzo1z_d2.c17
-rw-r--r--app/lzo/src/lzo1z_d3.c17
-rw-r--r--app/lzo/src/lzo2a_9x.c19
-rw-r--r--app/lzo/src/lzo2a_d.ch28
-rw-r--r--app/lzo/src/lzo2a_d1.c17
-rw-r--r--app/lzo/src/lzo2a_d2.c17
-rw-r--r--app/lzo/src/lzo_conf.h288
-rw-r--r--app/lzo/src/lzo_crc.c29
-rw-r--r--app/lzo/src/lzo_dict.h17
-rw-r--r--app/lzo/src/lzo_dll.ch17
-rw-r--r--app/lzo/src/lzo_func.h494
-rw-r--r--app/lzo/src/lzo_init.c188
-rw-r--r--app/lzo/src/lzo_mchw.ch29
-rw-r--r--app/lzo/src/lzo_ptr.c27
-rw-r--r--app/lzo/src/lzo_ptr.h76
-rw-r--r--app/lzo/src/lzo_str.c46
-rw-r--r--app/lzo/src/lzo_supp.h3685
-rw-r--r--app/lzo/src/lzo_swd.ch85
-rw-r--r--app/lzo/src/lzo_util.c31
-rw-r--r--app/lzo/src/stats1a.h17
-rw-r--r--app/lzo/src/stats1b.h17
-rw-r--r--app/lzo/src/stats1c.h17
-rw-r--r--app/lzo/tests/align.c26
-rw-r--r--app/lzo/tests/chksum.c24
-rw-r--r--app/lzo/tests/promote.c33
-rw-r--r--app/lzo/tests/sizes.c33
-rw-r--r--app/lzo/util/check.sh2
-rw-r--r--app/lzo/util/checkasm.sh2
-rw-r--r--app/lzo/util/notime.pl2
-rw-r--r--app/lzo/util/overlap.sh2
-rw-r--r--app/lzo/util/shortf.pl2
-rw-r--r--app/lzo/util/table.pl2
-rw-r--r--app/lzo/util/uncompr.pl2
-rwxr-xr-xapp/misc/fetchtranslations.sh4
-rw-r--r--app/openvpn/README.polarssl4
-rw-r--r--app/openvpn/configure.ac33
-rwxr-xr-xapp/openvpn/distro/rpm/openvpn.init.d.rhel2
-rw-r--r--app/openvpn/distro/rpm/openvpn.init.d.suse2
-rw-r--r--app/openvpn/doc/openvpn.857
-rw-r--r--app/openvpn/openvpn.sln76
-rw-r--r--app/openvpn/sample/sample-config-files/server.conf9
-rw-r--r--app/openvpn/sample/sample-keys/pkcs12.p12bin2685 -> 4756 bytes
-rw-r--r--app/openvpn/src/compat/compat.vcxproj172
-rw-r--r--app/openvpn/src/compat/compat.vcxproj.filters82
-rw-r--r--app/openvpn/src/openvpn/crypto.c96
-rw-r--r--app/openvpn/src/openvpn/crypto.h7
-rw-r--r--app/openvpn/src/openvpn/crypto_backend.h30
-rw-r--r--app/openvpn/src/openvpn/crypto_openssl.c56
-rw-r--r--app/openvpn/src/openvpn/crypto_polarssl.c21
-rw-r--r--app/openvpn/src/openvpn/helper.c6
-rw-r--r--app/openvpn/src/openvpn/init.c15
-rw-r--r--app/openvpn/src/openvpn/manage.c6
-rw-r--r--app/openvpn/src/openvpn/misc.c6
-rw-r--r--app/openvpn/src/openvpn/mudp.c106
-rw-r--r--app/openvpn/src/openvpn/multi.c27
-rw-r--r--app/openvpn/src/openvpn/multi.h2
-rwxr-xr-xapp/openvpn/src/openvpn/openvpn.vcxproj524
-rw-r--r--app/openvpn/src/openvpn/openvpn.vcxproj.filters914
-rw-r--r--app/openvpn/src/openvpn/options.c41
-rw-r--r--app/openvpn/src/openvpn/options.h4
-rw-r--r--app/openvpn/src/openvpn/push.c8
-rw-r--r--app/openvpn/src/openvpn/route.c60
-rw-r--r--app/openvpn/src/openvpn/ssl.c75
-rw-r--r--app/openvpn/src/openvpn/ssl.h9
-rw-r--r--app/openvpn/src/openvpn/ssl_common.h4
-rw-r--r--app/openvpn/src/openvpn/ssl_openssl.c3
-rw-r--r--app/openvpn/src/openvpn/ssl_openssl.h11
-rw-r--r--app/openvpn/src/openvpn/ssl_verify_openssl.c4
-rw-r--r--app/openvpn/src/openvpn/ssl_verify_polarssl.c9
-rw-r--r--app/openvpn/src/openvpn/syshead.h8
-rw-r--r--app/openvpn/src/openvpn/tun.c170
-rw-r--r--app/openvpn/src/openvpnserv/openvpnserv.vcxproj222
-rw-r--r--app/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters68
-rwxr-xr-xapp/openvpn/tests/t_client.sh.in6
-rwxr-xr-xapp/openvpn/tests/t_lpback.sh33
-rwxr-xr-xapp/ovpnlibs/assets/nopievpn.mipsbin5244 -> 5244 bytes
-rwxr-xr-xapp/ovpnlibs/assets/pievpn.mipsbin5180 -> 5180 bytes
-rw-r--r--app/src/main/java/de/blinkt/openvpn/LaunchVPN.java13
-rw-r--r--app/src/main/java/de/blinkt/openvpn/VpnProfile.java92
-rw-r--r--app/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java4
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java14
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java45
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java2
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java19
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java105
-rwxr-xr-xapp/src/main/res/values-cs/strings-icsopenvpn.xml6
-rwxr-xr-xapp/src/main/res/values-hu/strings-icsopenvpn.xml284
-rwxr-xr-xapp/src/main/res/values-in/strings-icsopenvpn.xml285
-rwxr-xr-xapp/src/main/res/values-ja/strings-icsopenvpn.xml7
-rwxr-xr-xapp/src/main/res/values-tr/strings-icsopenvpn.xml2
-rwxr-xr-xapp/src/main/res/values/strings-icsopenvpn.xml7
-rw-r--r--app/src/main/res/values/untranslatable.xml76
-rw-r--r--build.gradle30
-rw-r--r--ics-openvpn-stripped/main/jni/Android.mk73
-rw-r--r--ics-openvpn-stripped/main/jni/Application.mk11
-rw-r--r--ics-openvpn-stripped/main/jni/dummy.cpp8
-rw-r--r--ics-openvpn-stripped/main/jni/jbcrypto.cpp95
-rw-r--r--ics-openvpn-stripped/main/jni/jniglue.c21
-rw-r--r--ics-openvpn-stripped/main/jni/jniglue.h12
-rw-r--r--ics-openvpn-stripped/main/jni/minivpn.c0
-rw-r--r--ics-openvpn-stripped/main/lzo/AUTHORS3
-rw-r--r--ics-openvpn-stripped/main/lzo/Android.mk97
-rw-r--r--ics-openvpn-stripped/main/lzo/B/00README.TXT51
-rw-r--r--ics-openvpn-stripped/main/lzo/B/clean.bat4
-rw-r--r--ics-openvpn-stripped/main/lzo/B/done.bat2
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/bc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/bc.rsp67
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/bc_286.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/bc_pp.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/dm.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/mc.bat52
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/mc_qc.bat52
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/qc.bat40
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/sc.bat53
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/tc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/vc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/vc_qc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/wc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos16/wc.rsp67
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/bc_pp.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/dj2.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/dj2.opt6
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/dm.bat43
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/emx.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/highc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/highc.rsp73
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/ndp.bat40
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/ndp.rsp67
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/sc.bat51
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/wc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/dos32/zc.bat51
-rwxr-xr-xics-openvpn-stripped/main/lzo/B/generic/build.sh69
-rwxr-xr-xics-openvpn-stripped/main/lzo/B/generic/build_freestanding.sh8
-rwxr-xr-xics-openvpn-stripped/main/lzo/B/generic/build_gcc.sh25
-rwxr-xr-xics-openvpn-stripped/main/lzo/B/generic/clean.sh7
-rw-r--r--ics-openvpn-stripped/main/lzo/B/os2/emx.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/os2/wc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/os2/zc.bat51
-rw-r--r--ics-openvpn-stripped/main/lzo/B/os2_16/mc.bat43
-rw-r--r--ics-openvpn-stripped/main/lzo/B/os2_16/wc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/prepare.bat10
-rw-r--r--ics-openvpn-stripped/main/lzo/B/src.rsp67
-rw-r--r--ics-openvpn-stripped/main/lzo/B/unset.bat10
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/bc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/dm.bat43
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/mc.bat56
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/sc.bat53
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/vc.bat43
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win16/wc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/bc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/bc.rsp73
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/cygwin.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/cygwin.rsp73
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/dm.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/ic.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/lccwin32.bat59
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/mingw.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/mwerks.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/pellesc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/pgi.bat43
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/pw32.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/rsxnt.bat45
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/sc.bat56
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/vc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/vc.rsp73
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/vc_dll.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/vc_dll.def7
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/wc.bat39
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win32/wc.rsp73
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/ic.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/ic_dll.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/vc.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/vc.rsp67
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/vc_dll.bat42
-rw-r--r--ics-openvpn-stripped/main/lzo/B/win64/vc_dll.def1
-rw-r--r--ics-openvpn-stripped/main/lzo/BUGS21
-rw-r--r--ics-openvpn-stripped/main/lzo/COPYING339
-rw-r--r--ics-openvpn-stripped/main/lzo/ChangeLog3
-rw-r--r--ics-openvpn-stripped/main/lzo/INSTALL265
-rw-r--r--ics-openvpn-stripped/main/lzo/Makefile.am196
-rw-r--r--ics-openvpn-stripped/main/lzo/Makefile.in1484
-rw-r--r--ics-openvpn-stripped/main/lzo/NEWS279
-rw-r--r--ics-openvpn-stripped/main/lzo/README32
-rw-r--r--ics-openvpn-stripped/main/lzo/README.ANDROID3
-rw-r--r--ics-openvpn-stripped/main/lzo/THANKS14
-rw-r--r--ics-openvpn-stripped/main/lzo/aclocal.m49803
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/00README.TXT45
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/enter.ash77
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/leave.ash102
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_d.ash172
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s1.S49
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s2.S68
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_d.ash164
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f1.S49
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f2.S68
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_d.ash389
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f1.S51
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f2.S70
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s1.S49
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s2.S68
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f1.S53
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f2.S72
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s1.S51
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s2.S70
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src/lzo_asm.h275
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/all/asm_all.S371
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/asminit.def67
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s1.S72
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s2.S98
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f1.S74
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f2.S96
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f1.S82
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f2.S112
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s1.S84
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s2.S115
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f1.S82
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f2.S112
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s1.S84
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s2.S115
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/all/asm_all.asm213
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/asminit.def38
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s1.asm51
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s2.asm77
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f1.asm53
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f2.asm75
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f1.asm61
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f2.asm91
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s1.asm63
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s2.asm94
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f1.asm61
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f2.asm91
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s1.asm63
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s2.asm94
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/all/asm_all.asm366
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/asminit.def99
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s1.asm66
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s2.asm92
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f1.asm68
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f2.asm90
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f1.asm76
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f2.asm106
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s1.asm78
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s2.asm109
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f1.asm76
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f2.asm106
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s1.asm78
-rw-r--r--ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s2.asm109
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/compile347
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/config.guess1420
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/config.rpath684
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/config.sub1794
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/install-sh501
-rw-r--r--ics-openvpn-stripped/main/lzo/autoconf/local.m4637
-rw-r--r--ics-openvpn-stripped/main/lzo/autoconf/ltmain.sh10932
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/mdate-sh224
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/missing215
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/mkinstalldirs162
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/py-compile170
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/shtool4083
-rwxr-xr-xics-openvpn-stripped/main/lzo/autoconf/ylwrap232
-rw-r--r--ics-openvpn-stripped/main/lzo/config.h365
-rw-r--r--ics-openvpn-stripped/main/lzo/config.hin390
-rw-r--r--ics-openvpn-stripped/main/lzo/config.log3482
-rwxr-xr-xics-openvpn-stripped/main/lzo/config.status1475
-rwxr-xr-xics-openvpn-stripped/main/lzo/configure16314
-rw-r--r--ics-openvpn-stripped/main/lzo/configure.ac229
-rw-r--r--ics-openvpn-stripped/main/lzo/doc/LZO.FAQ213
-rw-r--r--ics-openvpn-stripped/main/lzo/doc/LZO.TXT291
-rw-r--r--ics-openvpn-stripped/main/lzo/doc/LZOAPI.TXT261
-rw-r--r--ics-openvpn-stripped/main/lzo/doc/LZOTEST.TXT75
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/dict.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/lzopack.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/overlap.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/precomp.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/precomp2.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/.deps/simple.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/Makefile.am21
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/Makefile.in491
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/dict.c274
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/lzopack.c628
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/overlap.c302
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/portab.h141
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/portab_a.h61
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/precomp.c330
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/precomp2.c382
-rw-r--r--ics-openvpn-stripped/main/lzo/examples/simple.c156
-rw-r--r--ics-openvpn-stripped/main/lzo/include/Makefile.am6
-rw-r--r--ics-openvpn-stripped/main/lzo/include/Makefile.in487
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/Makefile.am10
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/Makefile.in412
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1.h84
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1a.h84
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1b.h148
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1c.h148
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1f.h96
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1x.h165
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1y.h133
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo1z.h109
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo2a.h80
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzo_asm.h140
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzoconf.h444
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzodefs.h2998
-rw-r--r--ics-openvpn-stripped/main/lzo/include/lzo/lzoutil.h61
-rwxr-xr-xics-openvpn-stripped/main/lzo/libtool7520
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/.deps/lzotest.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/Makefile.am15
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/Makefile.in441
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/asm.h70
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/db.h485
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/lzotest.c2095
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/mygetopt.ch698
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/mygetopt.h102
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/wrap.h272
-rw-r--r--ics-openvpn-stripped/main/lzo/lzotest/wrapmisc.h276
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/.deps/minilzo.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/.deps/testmini.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/Makefile.am14
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/Makefile.in442
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/Makefile.minilzo100
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/README.LZO123
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/minilzo.c6037
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/minilzo.h94
-rw-r--r--ics-openvpn-stripped/main/lzo/minilzo/testmini.c150
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1_99.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1a.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1a_99.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_3.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_4.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_5.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_6.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_7.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_8.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_99.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_cc.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_rr.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_xx.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_3.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_4.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_5.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_6.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_7.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_8.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_99.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_cc.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_rr.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_xx.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1k.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1l.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1o.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d3.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_o.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d3.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_o.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d3.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_9x.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d1.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d2.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo_crc.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo_init.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo_ptr.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo_str.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/.deps/lzo_util.Plo1
-rw-r--r--ics-openvpn-stripped/main/lzo/src/Makefile.am68
-rw-r--r--ics-openvpn-stripped/main/lzo/src/Makefile.in600
-rw-r--r--ics-openvpn-stripped/main/lzo/src/compr1b.h69
-rw-r--r--ics-openvpn-stripped/main/lzo/src/compr1c.h69
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1.h49
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1a.h184
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1b.h128
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1c.h133
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1f.h85
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1x.h108
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1y.h54
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config1z.h53
-rw-r--r--ics-openvpn-stripped/main/lzo/src/config2a.h143
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1.c623
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1_99.c118
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1_cm.ch40
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1_d.ch160
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1a.c645
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1a_99.c118
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1a_cm.ch230
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1a_cr.ch116
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1a_de.h146
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_2.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_3.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_4.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_5.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_6.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_7.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_8.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_9.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_99.c37
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_9x.c353
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_c.ch264
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_cc.c155
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_cc.h81
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_cm.ch282
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_cr.ch114
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_d.ch271
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_d2.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_de.h332
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_r.ch105
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_rr.c31
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_sm.ch198
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_tm.ch87
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1b_xx.c86
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_2.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_3.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_4.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_5.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_6.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_7.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_8.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_9.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_99.c37
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_9x.c367
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_cc.c155
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_cc.h81
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_d2.c48
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_rr.c31
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1c_xx.c86
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1f_1.c304
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1f_9x.c333
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1f_d.ch213
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1f_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1f_d2.c48
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_1.c55
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_1k.c55
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_1l.c55
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_1o.c56
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_9x.c870
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_c.ch405
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_d.ch478
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_d2.c59
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_d3.c96
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_o.c33
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1x_oo.ch355
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_1.c55
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_9x.c30
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_d2.c59
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_d3.c33
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1y_o.c33
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1z_9x.c30
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1z_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1z_d2.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo1z_d3.c33
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo2a_9x.c349
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo2a_d.ch177
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo2a_d1.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo2a_d2.c34
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_conf.h390
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_crc.c155
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_dict.h309
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_dll.ch52
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_func.ch122
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_func.h494
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_init.c225
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_mchw.ch225
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_ptr.c78
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_ptr.h125
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_str.c59
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_supp.h3685
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_swd.ch689
-rw-r--r--ics-openvpn-stripped/main/lzo/src/lzo_util.c148
-rw-r--r--ics-openvpn-stripped/main/lzo/src/miniacc.h6922
-rw-r--r--ics-openvpn-stripped/main/lzo/src/stats1a.h125
-rw-r--r--ics-openvpn-stripped/main/lzo/src/stats1b.h130
-rw-r--r--ics-openvpn-stripped/main/lzo/src/stats1c.h49
-rw-r--r--ics-openvpn-stripped/main/lzo/stamp-h11
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/.deps/align.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/.deps/chksum.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/.deps/promote.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/.deps/sizes.Po1
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/Makefile.am17
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/Makefile.in468
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/align.c196
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/chksum.c89
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/promote.c64
-rw-r--r--ics-openvpn-stripped/main/lzo/tests/sizes.c138
-rw-r--r--ics-openvpn-stripped/main/lzo/util/check.sh43
-rw-r--r--ics-openvpn-stripped/main/lzo/util/checkasm.sh46
-rw-r--r--ics-openvpn-stripped/main/lzo/util/notime.pl26
-rw-r--r--ics-openvpn-stripped/main/lzo/util/overlap.sh27
-rw-r--r--ics-openvpn-stripped/main/lzo/util/shortf.pl31
-rw-r--r--ics-openvpn-stripped/main/lzo/util/table.pl360
-rw-r--r--ics-openvpn-stripped/main/lzo/util/uncompr.pl32
-rw-r--r--ics-openvpn-stripped/main/misc/build-native.bat22
-rwxr-xr-xics-openvpn-stripped/main/misc/build-native.sh54
-rwxr-xr-xics-openvpn-stripped/main/misc/fetchtranslations.sh38
-rwxr-xr-xics-openvpn-stripped/main/misc/genFAQ.py118
-rwxr-xr-xics-openvpn-stripped/main/misc/prepareovpn3.sh3
-rw-r--r--ics-openvpn-stripped/main/openvpn/.mailmap1
-rw-r--r--ics-openvpn-stripped/main/openvpn/.svncommitters1
-rw-r--r--ics-openvpn-stripped/main/openvpn/AUTHORS1
-rw-r--r--ics-openvpn-stripped/main/openvpn/Android.mk121
-rw-r--r--ics-openvpn-stripped/main/openvpn/COPYING217
-rw-r--r--ics-openvpn-stripped/main/openvpn/COPYRIGHT.GPL339
-rw-r--r--ics-openvpn-stripped/main/openvpn/ChangeLog4071
-rw-r--r--ics-openvpn-stripped/main/openvpn/INSTALL336
-rw-r--r--ics-openvpn-stripped/main/openvpn/INSTALL-win32.txt77
-rw-r--r--ics-openvpn-stripped/main/openvpn/Makefile.am104
-rw-r--r--ics-openvpn-stripped/main/openvpn/NEWS0
-rw-r--r--ics-openvpn-stripped/main/openvpn/PORTS94
-rw-r--r--ics-openvpn-stripped/main/openvpn/README72
-rw-r--r--ics-openvpn-stripped/main/openvpn/README.IPv656
-rw-r--r--ics-openvpn-stripped/main/openvpn/README.ec35
-rw-r--r--ics-openvpn-stripped/main/openvpn/README.polarssl26
-rw-r--r--ics-openvpn-stripped/main/openvpn/TODO.IPv6215
-rw-r--r--ics-openvpn-stripped/main/openvpn/compat.m475
-rw-r--r--ics-openvpn-stripped/main/openvpn/config-msvc-version.h.in10
-rw-r--r--ics-openvpn-stripped/main/openvpn/config-msvc.h128
-rw-r--r--ics-openvpn-stripped/main/openvpn/config-version.h2
-rw-r--r--ics-openvpn-stripped/main/openvpn/config.h633
-rw-r--r--ics-openvpn-stripped/main/openvpn/configure.ac1208
-rw-r--r--ics-openvpn-stripped/main/openvpn/contrib/OCSP_check/OCSP_check.sh111
-rw-r--r--ics-openvpn-stripped/main/openvpn/contrib/README2
-rw-r--r--ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/README44
-rwxr-xr-xics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.down22
-rwxr-xr-xics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.up49
-rw-r--r--ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.down47
-rw-r--r--ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.up101
-rwxr-xr-xics-openvpn-stripped/main/openvpn/debug/doval4
-rwxr-xr-xics-openvpn-stripped/main/openvpn/debug/dovalns2
-rw-r--r--ics-openvpn-stripped/main/openvpn/debug/valgrind-suppress1182
-rw-r--r--ics-openvpn-stripped/main/openvpn/distro/Makefile.am15
-rw-r--r--ics-openvpn-stripped/main/openvpn/distro/rpm/Makefile.am18
-rwxr-xr-xics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.rhel244
-rw-r--r--ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.suse264
-rw-r--r--ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec248
-rw-r--r--ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec.in248
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/Makefile.am31
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/README.plugins47
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/android.txt76
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_compression.h92
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_processor.h189
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_tls.h105
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_control.h103
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_crypto.h75
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_eventloop.h67
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_external_multiplexer.h46
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_fragmentation.h96
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_internal_multiplexer.h44
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_key_generation.h153
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_mainpage.h162
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_memory_management.h99
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_protocol_overview.h199
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_reliable.h49
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_tunnel_state.h155
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/doxygen/openvpn.doxyfile279
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/management-notes.txt1039
-rw-r--r--ics-openvpn-stripped/main/openvpn/doc/openvpn.86701
-rw-r--r--ics-openvpn-stripped/main/openvpn/include/Makefile.am15
-rw-r--r--ics-openvpn-stripped/main/openvpn/include/openvpn-plugin.h813
-rw-r--r--ics-openvpn-stripped/main/openvpn/m4/.keep0
-rw-r--r--ics-openvpn-stripped/main/openvpn/m4/ax_emptyarray.m440
-rw-r--r--ics-openvpn-stripped/main/openvpn/m4/ax_socklen_t.m465
-rw-r--r--ics-openvpn-stripped/main/openvpn/m4/ax_varargs.m477
-rw-r--r--ics-openvpn-stripped/main/openvpn/m4/pkg.m4159
-rw-r--r--ics-openvpn-stripped/main/openvpn/msvc-build.bat48
-rw-r--r--ics-openvpn-stripped/main/openvpn/msvc-dev.bat26
-rw-r--r--ics-openvpn-stripped/main/openvpn/msvc-env.bat30
-rw-r--r--ics-openvpn-stripped/main/openvpn/openvpn.sln38
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/Makefile.am34
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/README6
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/client.conf123
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-config-files/firewall.sh108
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-config-files/home.up2
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-client25
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-server26
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-config-files/office.up2
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-shutdown.sh5
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-startup.sh34
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/server.conf306
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-home.conf72
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-office.conf69
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-home.conf83
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-office.conf83
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-client-config11
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-server-config25
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/README14
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.crt19
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.key15
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.crt65
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.key15
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/dh1024.pem5
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.crt13
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.key6
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.crt61
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.key6
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.crt61
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.key6
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.crt65
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.key18
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/pkcs12.p12bin0 -> 4756 bytes
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.crt67
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.key15
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/README16
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.c305
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.def6
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/winbuild18
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log.c184
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log_v3.c252
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/winbuild18
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/README16
-rw-r--r--ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.c120
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.def6
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/winbuild18
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/auth-pam.pl97
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-start39
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-stop18
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl11
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/verify-cn64
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-windows/sample.ovpn103
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/Makefile.am15
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/Makefile.am30
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-basename.c50
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-daemon.c100
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-dirname.c119
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-gettimeofday.c131
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_ntop.c76
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_pton.c79
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.c830
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.h205
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat-stdbool.h12
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat.h68
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj87
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj.filters42
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/Makefile.am133
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/base64.c163
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/base64.h40
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/basic.h38
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.cpp29
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.h13
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.c1153
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.h936
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/circ_list.h78
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.c265
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.h65
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/common.h105
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.c194
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.h40
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/comp.c146
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/comp.h180
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/compstub.c118
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/console.c238
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/console.h33
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.c1511
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.h397
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_backend.h530
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.c750
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.h73
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.c682
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.h94
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.c465
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.h7
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.c212
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.h87
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/errlevel.h179
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/error.c919
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/error.h359
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/event.c1064
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/event.h158
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.c78
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.h31
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/forward-inline.h294
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/forward.c1550
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/forward.h242
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.c414
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.h479
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.c221
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.h72
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/helper.c541
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/helper.h38
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.c154
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.h60
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/init.c3825
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/init.h128
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/integer.h114
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/interval.c83
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/interval.h247
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/list.c649
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/list.h196
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.c67
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.h8
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.c258
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.h131
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/manage.c3466
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/manage.h579
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.c175
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.h109
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/memdbg.h114
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/misc.c2118
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/misc.h379
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.c524
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.h212
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mss.c175
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mss.h35
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.c122
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.h51
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.c727
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.h77
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.c296
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.h308
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.c385
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.h71
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/multi.c2892
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/multi.h585
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.c352
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.h11
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/occ-inline.h85
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/occ.c399
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/occ.h95
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.c335
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.h592
-rwxr-xr-xics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj263
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj.filters458
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn_win32_resources.rc43
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/options.c7010
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/options.h779
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/otime.c201
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/otime.h264
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.c606
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.h338
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/perf.c299
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/perf.h82
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pf-inline.h59
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pf.c716
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pf.h102
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ping-inline.h59
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ping.c98
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ping.h47
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.c946
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.h80
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_backend.h75
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_openssl.c192
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_polarssl.c127
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/platform.c316
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/platform.h140
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.c872
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.h211
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pool.c589
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pool.h91
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/proto.c141
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/proto.h237
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.c945
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.h95
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ps.c976
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ps.h59
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/push.c559
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/push.h74
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/pushlist.h42
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.c757
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.h480
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/route.c3110
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/route.h335
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.c659
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.h132
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.c67
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.h86
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.c101
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.h178
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/sig.c400
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/sig.h113
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.c189
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.h39
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/socket.c3530
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/socket.h1175
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/socks.c574
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/socks.h74
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.c3611
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.h513
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_backend.h490
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_common.h512
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.c1452
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.h69
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.c1134
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.h87
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.c1271
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.h241
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_backend.h260
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.c630
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.h76
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.c406
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.h78
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/status.c292
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/status.h99
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/syshead.h719
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/tun.c5624
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/tun.h489
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/win32.c1022
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpn/win32.h275
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/Makefile.am27
-rwxr-xr-xics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.c534
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj112
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters35
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv_resources.rc43
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.c700
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.h139
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.am15
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.in546
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.am28
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.in570
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/README.auth-pam74
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.c806
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.exports4
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.c184
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.h5
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.am24
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.in563
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/down-root/README.down-root29
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.c557
-rw-r--r--ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.exports4
-rw-r--r--ics-openvpn-stripped/main/openvpn/tests/Makefile.am23
-rw-r--r--ics-openvpn-stripped/main/openvpn/tests/t_client.rc-sample93
-rwxr-xr-xics-openvpn-stripped/main/openvpn/tests/t_client.sh.in347
-rwxr-xr-xics-openvpn-stripped/main/openvpn/tests/t_cltsrv-down.sh2
-rwxr-xr-xics-openvpn-stripped/main/openvpn/tests/t_cltsrv.sh91
-rwxr-xr-xics-openvpn-stripped/main/openvpn/tests/t_lpback.sh57
-rw-r--r--ics-openvpn-stripped/main/openvpn/version.m410
-rw-r--r--ics-openvpn-stripped/main/openvpn/version.sh.in4
-rw-r--r--ics-openvpn-stripped/main/ovpn3/Android.mk40
-rw-r--r--ics-openvpn-stripped/main/ovpn3/boostsrc/error_code.cpp430
-rw-r--r--ics-openvpn-stripped/main/snappy/Android.mk35
-rw-r--r--ics-openvpn-stripped/main/snappy/COPYING28
-rw-r--r--ics-openvpn-stripped/main/snappy/conf/config.h129
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-c.cc90
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-c.h138
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-internal.h150
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-sinksource.cc71
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-sinksource.h137
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-stubs-internal.cc42
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-stubs-internal.h491
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-stubs-public.h85
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-stubs-public.h.in85
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-test.cc606
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy-test.h580
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy.cc1119
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy.h163
-rw-r--r--ics-openvpn-stripped/main/snappy/snappy_unittest.cc1164
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java13
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/VpnProfile.java92
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java4
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java14
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java45
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java2
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java19
-rw-r--r--ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java105
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values-cs/strings.xml6
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values-hu/strings.xml284
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values-in/strings.xml285
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values-ja/strings.xml7
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values-tr/strings.xml2
-rwxr-xr-xics-openvpn-stripped/main/src/main/res/values/strings.xml7
1138 files changed, 271859 insertions, 17820 deletions
diff --git a/app/build.gradle b/app/build.gradle
index c4fdc44b..f2ddd9cd 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -144,4 +144,15 @@ task mergeUntranslatable( type: Copy, dependsOn: 'removeDuplicatedStrings') {
delete ics_openvpn_untranslatable
}
+
+task updateIcsOpenVpn( type: Copy, dependsOn: 'mergeUntranslatable') {
+ from('../ics-openvpn-stripped/main') {
+ include 'openvpn/**'
+ include 'lzo/**'
+ include 'jni/**'
+ include 'misc/**'
+ include 'ovpn3/**'
+ include 'snappy/**'
+ } into '.'
+}
//build.dependsOn ':app:mergeUntranslatable' \ No newline at end of file
diff --git a/app/jni/Android.mk b/app/jni/Android.mk
index a3280bd6..0c906f97 100644
--- a/app/jni/Android.mk
+++ b/app/jni/Android.mk
@@ -5,18 +5,18 @@ JNI_DIR := $(call my-dir)
#WITH_POLAR=1
#WITH_OPENVPN3=1
# Build openvpn with polar (OpenVPN3 core is always build with polar)
-USE_BREAKPAD=0
WITH_BREAKPAD=0
+
include lzo/Android.mk
include snappy/Android.mk
include openssl/Android.mk
-ifneq ($(USE_BREAKPAD),0)
+ifneq ($(WITH_BREAKPAD),0)
ifneq ($(TARGET_ARCH),mips)
WITH_BREAKPAD=1
-# include google-breakpad/android/google_breakpad/Android.mk
+ include google-breakpad/android/google_breakpad/Android.mk
else
WITH_BREAKPAD=0
endif
diff --git a/app/jni/Application.mk b/app/jni/Application.mk
index 913e0a98..718e79a8 100644
--- a/app/jni/Application.mk
+++ b/app/jni/Application.mk
@@ -8,4 +8,4 @@ APP_STL:=stlport_shared
#LOCAL_ARM_MODE := arm
-#NDK_TOOLCHAIN_VERSION=clang
+#NDK_TOOLCHAIN_VERSION=clang \ No newline at end of file
diff --git a/app/lzo/B/00README.TXT b/app/lzo/B/00README.TXT
index 45bdf7b8..b5352a86 100644
--- a/app/lzo/B/00README.TXT
+++ b/app/lzo/B/00README.TXT
@@ -1,54 +1,51 @@
-Simple make drivers for DOS, Windows, OS/2 and other systems
-============================================================
-
-This directory contains a bunch of simple build scripts - I've tried
-to make them as foolproof as possible.
-
-To build LZO for your system type 'b\OS\COMPILER' in the base directory,
-e.g. 'b\win32\vc.bat' will build the Win32 Visual C/C++ version.
-
-After building do a basic test by running 'lzotest.exe -mlzo COPYING'.
-util\check.sh is an example of a more thorough test driver.
-
-Please send me your additional/improved versions.
-
-
-Overview:
----------
-
-b\dos32\bc_pp.bat Borland C/C++ (1)
-b\dos32\dj2.bat djgpp v2 + gcc (1)
-b\dos32\dm.bat Digital Mars C/C++ (1)
-b\dos32\emx.bat emx + gcc (1)
-b\dos32\sc.bat Symantec C/C++ (1)
-b\dos32\wc.bat Watcom C/C++ (1)
-
-b\os2\emx.bat emx + gcc (1)
-b\os2\wc.bat Watcom C/C++ (1)
-
-b\win32\bc.bat Borland C/C++ (1)
-b\win32\cygwin.bat Cygwin + gcc (1)
-b\win32\dm.bat Digital Mars C/C++ (1)
-b\win32\ic.bat Intel C/C++ (1)
-b\win32\mingw.bat MinGW + gcc (1)
-b\win32\mwerks.bat Metrowerks CodeWarrior C/C++ (1)
-b\win32\pellesc.bat Pelles C (1)
-b\win32\pgi.bat Portland Group PGI C/C++ (1)
-b\win32\rsxnt.bat rsxnt + gcc (1)
-b\win32\sc.bat Symantec C/C++ (1)
-b\win32\vc.bat Visual C/C++ (1)
-b\win32\vc_dll.bat Visual C/C++ (DLL version) (1)
-b\win32\wc.bat Watcom C/C++ (1)
-
-b\win64\ic.bat Intel C/C++ (Itanium)
-b\win64\ic_dll.bat Intel C/C++ (Itanium) (DLL version)
-b\win64\vc.bat Visual C/C++ (AMD64 or Itanium)
-b\win64\vc_dll.bat Visual C/C++ (AMD64 or Itanium) (DLL version)
-
-Finally, there are also a number of build scripts for obsolete systems
-like dos16 and win16.
-
-
-Notes:
- (1) includes support for i386 assembler versions
-
+Simple make drivers for DOS, Windows, OS/2 and other systems
+============================================================
+
+This directory contains a bunch of simple build scripts - I've tried
+to make them as foolproof as possible.
+
+To build LZO for your system type 'b\OS\COMPILER' in the base directory,
+e.g. 'b\win32\vc.bat' will build the Win32 Visual C/C++ version.
+
+After building do a basic test by running 'lzotest.exe -mlzo COPYING'.
+util\check.sh is an example of a more thorough test driver.
+
+Please send me your additional/improved versions.
+
+
+Overview:
+---------
+
+b\dos32\bc_pp.bat Borland C/C++ (1)
+b\dos32\dj2.bat djgpp v2 + gcc (1)
+b\dos32\dm.bat Digital Mars C/C++ (1)
+b\dos32\emx.bat emx + gcc (1)
+b\dos32\sc.bat Symantec C/C++ (1)
+b\dos32\wc.bat Watcom C/C++ (1)
+
+b\os2\emx.bat emx + gcc (1)
+b\os2\wc.bat Watcom C/C++ (1)
+
+b\win32\bc.bat Borland C/C++ (1)
+b\win32\cygwin.bat Cygwin + gcc (1)
+b\win32\dm.bat Digital Mars C/C++ (1)
+b\win32\ic.bat Intel C/C++ (1)
+b\win32\mingw.bat MinGW + gcc (1)
+b\win32\mwerks.bat Metrowerks CodeWarrior C/C++ (1)
+b\win32\pellesc.bat Pelles C (1)
+b\win32\pgi.bat Portland Group PGI C/C++ (1)
+b\win32\rsxnt.bat rsxnt + gcc (1)
+b\win32\sc.bat Symantec C/C++ (1)
+b\win32\vc.bat Visual C/C++ (1)
+b\win32\vc_dll.bat Visual C/C++ (DLL version) (1)
+b\win32\wc.bat Watcom C/C++ (1)
+
+b\win64\ic.bat Intel C/C++ (Itanium)
+b\win64\ic_dll.bat Intel C/C++ (Itanium) (DLL version)
+b\win64\vc.bat Visual C/C++ (AMD64 or Itanium)
+b\win64\vc_dll.bat Visual C/C++ (AMD64 or Itanium) (DLL version)
+
+
+Notes:
+ (1) includes support for i386 assembler versions
+
diff --git a/app/lzo/B/clean.bat b/app/lzo/B/clean.bat
index 1f7de592..453e9479 100644
--- a/app/lzo/B/clean.bat
+++ b/app/lzo/B/clean.bat
@@ -1,4 +1,4 @@
-@del /q *.def *.err *.exp *.map *.o *.obj *.res *.tds > nul 2> nul
-@del /q liblzo2.a lzo2.a lzo2.dll lzo2.lib > nul 2> nul
-@del /q a.exe a.out dict.exe lzopack.exe precomp.exe precomp2.exe simple.exe > nul 2> nul
-@del /q lzotest.exe testmini.exe > nul 2> nul
+@del /q *.def *.err *.exp *.map *.o *.obj *.res *.tds > nul 2> nul
+@del /q liblzo2.a lzo2.a lzo2.dll lzo2.lib > nul 2> nul
+@del /q a.exe a.out dict.exe lzopack.exe precomp.exe precomp2.exe simple.exe > nul 2> nul
+@del /q lzotest.exe testmini.exe > nul 2> nul
diff --git a/app/lzo/B/done.bat b/app/lzo/B/done.bat
index b9bf6aa0..0ae243d4 100644
--- a/app/lzo/B/done.bat
+++ b/app/lzo/B/done.bat
@@ -1,2 +1,2 @@
-@echo //
-@echo // Building LZO was successful. All done.
+@echo //
+@echo // Building LZO was successful. All done.
diff --git a/app/lzo/B/dos16/bc.bat b/app/lzo/B/dos16/bc.bat
index 292b793a..bfcf38c6 100644
--- a/app/lzo/B/dos16/bc.bat
+++ b/app/lzo/B/dos16/bc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Borland C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc -ml -f-
-set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -f -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -f -ls -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -f-
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/bc.rsp b/app/lzo/B/dos16/bc.rsp
index 8a1d83e4..39b28f9f 100644
--- a/app/lzo/B/dos16/bc.rsp
+++ b/app/lzo/B/dos16/bc.rsp
@@ -1,67 +1,67 @@
-+lzo1.obj &
-+lzo1_99.obj &
-+lzo1a.obj &
-+lzo1a_99.obj &
-+lzo1b_1.obj &
-+lzo1b_2.obj &
-+lzo1b_3.obj &
-+lzo1b_4.obj &
-+lzo1b_5.obj &
-+lzo1b_6.obj &
-+lzo1b_7.obj &
-+lzo1b_8.obj &
-+lzo1b_9.obj &
-+lzo1b_99.obj &
-+lzo1b_9x.obj &
-+lzo1b_cc.obj &
-+lzo1b_d1.obj &
-+lzo1b_d2.obj &
-+lzo1b_rr.obj &
-+lzo1b_xx.obj &
-+lzo1c_1.obj &
-+lzo1c_2.obj &
-+lzo1c_3.obj &
-+lzo1c_4.obj &
-+lzo1c_5.obj &
-+lzo1c_6.obj &
-+lzo1c_7.obj &
-+lzo1c_8.obj &
-+lzo1c_9.obj &
-+lzo1c_99.obj &
-+lzo1c_9x.obj &
-+lzo1c_cc.obj &
-+lzo1c_d1.obj &
-+lzo1c_d2.obj &
-+lzo1c_rr.obj &
-+lzo1c_xx.obj &
-+lzo1f_1.obj &
-+lzo1f_9x.obj &
-+lzo1f_d1.obj &
-+lzo1f_d2.obj &
-+lzo1x_1.obj &
-+lzo1x_1k.obj &
-+lzo1x_1l.obj &
-+lzo1x_1o.obj &
-+lzo1x_9x.obj &
-+lzo1x_d1.obj &
-+lzo1x_d2.obj &
-+lzo1x_d3.obj &
-+lzo1x_o.obj &
-+lzo1y_1.obj &
-+lzo1y_9x.obj &
-+lzo1y_d1.obj &
-+lzo1y_d2.obj &
-+lzo1y_d3.obj &
-+lzo1y_o.obj &
-+lzo1z_9x.obj &
-+lzo1z_d1.obj &
-+lzo1z_d2.obj &
-+lzo1z_d3.obj &
-+lzo2a_9x.obj &
-+lzo2a_d1.obj &
-+lzo2a_d2.obj &
-+lzo_crc.obj &
-+lzo_init.obj &
-+lzo_ptr.obj &
-+lzo_str.obj &
-+lzo_util.obj
++lzo1.obj &
++lzo1_99.obj &
++lzo1a.obj &
++lzo1a_99.obj &
++lzo1b_1.obj &
++lzo1b_2.obj &
++lzo1b_3.obj &
++lzo1b_4.obj &
++lzo1b_5.obj &
++lzo1b_6.obj &
++lzo1b_7.obj &
++lzo1b_8.obj &
++lzo1b_9.obj &
++lzo1b_99.obj &
++lzo1b_9x.obj &
++lzo1b_cc.obj &
++lzo1b_d1.obj &
++lzo1b_d2.obj &
++lzo1b_rr.obj &
++lzo1b_xx.obj &
++lzo1c_1.obj &
++lzo1c_2.obj &
++lzo1c_3.obj &
++lzo1c_4.obj &
++lzo1c_5.obj &
++lzo1c_6.obj &
++lzo1c_7.obj &
++lzo1c_8.obj &
++lzo1c_9.obj &
++lzo1c_99.obj &
++lzo1c_9x.obj &
++lzo1c_cc.obj &
++lzo1c_d1.obj &
++lzo1c_d2.obj &
++lzo1c_rr.obj &
++lzo1c_xx.obj &
++lzo1f_1.obj &
++lzo1f_9x.obj &
++lzo1f_d1.obj &
++lzo1f_d2.obj &
++lzo1x_1.obj &
++lzo1x_1k.obj &
++lzo1x_1l.obj &
++lzo1x_1o.obj &
++lzo1x_9x.obj &
++lzo1x_d1.obj &
++lzo1x_d2.obj &
++lzo1x_d3.obj &
++lzo1x_o.obj &
++lzo1y_1.obj &
++lzo1y_9x.obj &
++lzo1y_d1.obj &
++lzo1y_d2.obj &
++lzo1y_d3.obj &
++lzo1y_o.obj &
++lzo1z_9x.obj &
++lzo1z_d1.obj &
++lzo1z_d2.obj &
++lzo1z_d3.obj &
++lzo2a_9x.obj &
++lzo2a_d1.obj &
++lzo2a_d2.obj &
++lzo_crc.obj &
++lzo_init.obj &
++lzo_ptr.obj &
++lzo_str.obj &
++lzo_util.obj
diff --git a/app/lzo/B/dos16/bc_286.bat b/app/lzo/B/dos16/bc_286.bat
index 025a48ea..e68fd4e2 100644
--- a/app/lzo/B/dos16/bc_286.bat
+++ b/app/lzo/B/dos16/bc_286.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Borland C/C++ + Pharlap 286DOS-Extender
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc286 -ml -2
-set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++ + Pharlap 286DOS-Extender
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc286 -ml -2
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/bc_pp.bat b/app/lzo/B/dos16/bc_pp.bat
index 6c0aac37..2a09ba01 100644
--- a/app/lzo/B/dos16/bc_pp.bat
+++ b/app/lzo/B/dos16/bc_pp.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI16)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc -ml -2 -WX
-set CF=-O1 -d -w -w-sig %CFI% -Iinclude\lzo
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI16)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -2 -WX
+set CF=-O1 -d -w -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/dm.bat b/app/lzo/B/dos16/dm.bat
index 1ec6feca..24335982 100644
--- a/app/lzo/B/dos16/dm.bat
+++ b/app/lzo/B/dos16/dm.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Digital Mars C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=dmc -ml
-set CF=-o -w- %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -ml
+set CF=-o -w- %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/mc.bat b/app/lzo/B/dos16/mc.bat
index 4f34a36f..077401af 100644
--- a/app/lzo/B/dos16/mc.bat
+++ b/app/lzo/B/dos16/mc.bat
@@ -1,52 +1,52 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Microsoft C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -AL
-set CF=-O -Gf -W3 %CFI%
-set LF=/map
-
-@REM %CC% %CF% -c src\*.c
-for %%f in (src\*.c) do %CC% %CF% -c %%f
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-link %LF% dict.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-link %LF% lzopack.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-link %LF% precomp.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-link %LF% precomp2.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-link %LF% simple.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-link %LF% lzotest.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=/map
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/mc_qc.bat b/app/lzo/B/dos16/mc_qc.bat
index 1c2ce940..cb814dd7 100644
--- a/app/lzo/B/dos16/mc_qc.bat
+++ b/app/lzo/B/dos16/mc_qc.bat
@@ -1,52 +1,52 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Microsoft C/C++ (QuickC)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -qc -AL
-set CF=-O -Gf -W3 %CFI%
-set LF=/map
-
-@REM %CC% %CF% -c src\*.c
-for %%f in (src\*.c) do %CC% %CF% -c %%f
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-link %LF% dict.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-link %LF% lzopack.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-link %LF% precomp.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-link %LF% precomp2.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-link %LF% simple.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-link %LF% lzotest.obj,,,%BLIB%;
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft C/C++ (QuickC)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -qc -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=/map
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/qc.bat b/app/lzo/B/dos16/qc.bat
index 82734fd7..e51166ec 100644
--- a/app/lzo/B/dos16/qc.bat
+++ b/app/lzo/B/dos16/qc.bat
@@ -1,40 +1,40 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Microsoft QuickC
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=qcl -nologo -AL
-set CF=-O -Gf -W3 %CFI%
-set LF=%BLIB% -Fm
-
-@REM %CC% %CF% -c src\*.c
-for %%f in (src\*.c) do %CC% %CF% -c %%f
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft QuickC
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=qcl -nologo -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=%BLIB% -Fm
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/sc.bat b/app/lzo/B/dos16/sc.bat
index 056c04a9..52960232 100644
--- a/app/lzo/B/dos16/sc.bat
+++ b/app/lzo/B/dos16/sc.bat
@@ -1,53 +1,53 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Symantec C/C++
-@echo //
-@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=sc -ml
-set CF=-w- %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Symantec C/C++
+@echo //
+@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -ml
+set CF=-w- %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/tc.bat b/app/lzo/B/dos16/tc.bat
index a3c32770..c397ae1b 100644
--- a/app/lzo/B/dos16/tc.bat
+++ b/app/lzo/B/dos16/tc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Turbo C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=tcc -ml -f-
-set CF=-O -G -w -w-rch -w-sig %CFI% -Iinclude\lzo
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c src\*.c
-@if errorlevel 1 goto error
-tlib %BLIB% @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -f -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -f -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Turbo C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=tcc -ml -f-
+set CF=-O -G -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c src\*.c
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/vc.bat b/app/lzo/B/dos16/vc.bat
index b0617859..17ec4ccd 100644
--- a/app/lzo/B/dos16/vc.bat
+++ b/app/lzo/B/dos16/vc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Microsoft Visual C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -AL
-set CF=-O -Gf -Gs -Gy -W3 %CFI%
-set LF=%BLIB% -Fm
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL
+set CF=-O -Gf -Gs -Gy -W3 %CFI%
+set LF=%BLIB% -Fm
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/vc_qc.bat b/app/lzo/B/dos16/vc_qc.bat
index 329b092f..09fc0d3d 100644
--- a/app/lzo/B/dos16/vc_qc.bat
+++ b/app/lzo/B/dos16/vc_qc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Microsoft Visual C/C++ (QuickC)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -qc -AL
-set CF=-O -Gf -Gy -W3 %CFI%
-set LF=%BLIB% -Fm
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft Visual C/C++ (QuickC)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -qc -AL
+set CF=-O -Gf -Gy -W3 %CFI%
+set LF=%BLIB% -Fm
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/wc.bat b/app/lzo/B/dos16/wc.bat
index c92135c0..4effecc6 100644
--- a/app/lzo/B/dos16/wc.bat
+++ b/app/lzo/B/dos16/wc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 16-bit
-@echo // Watcom C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl -zq -ml -bt#dos -l#dos
-set CF=-ox %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -bt#dos -l#dos
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos16/wc.rsp b/app/lzo/B/dos16/wc.rsp
index c8e1c9ff..f36b8cba 100644
--- a/app/lzo/B/dos16/wc.rsp
+++ b/app/lzo/B/dos16/wc.rsp
@@ -1,67 +1,67 @@
-+'lzo1.obj'
-+'lzo1_99.obj'
-+'lzo1a.obj'
-+'lzo1a_99.obj'
-+'lzo1b_1.obj'
-+'lzo1b_2.obj'
-+'lzo1b_3.obj'
-+'lzo1b_4.obj'
-+'lzo1b_5.obj'
-+'lzo1b_6.obj'
-+'lzo1b_7.obj'
-+'lzo1b_8.obj'
-+'lzo1b_9.obj'
-+'lzo1b_99.obj'
-+'lzo1b_9x.obj'
-+'lzo1b_cc.obj'
-+'lzo1b_d1.obj'
-+'lzo1b_d2.obj'
-+'lzo1b_rr.obj'
-+'lzo1b_xx.obj'
-+'lzo1c_1.obj'
-+'lzo1c_2.obj'
-+'lzo1c_3.obj'
-+'lzo1c_4.obj'
-+'lzo1c_5.obj'
-+'lzo1c_6.obj'
-+'lzo1c_7.obj'
-+'lzo1c_8.obj'
-+'lzo1c_9.obj'
-+'lzo1c_99.obj'
-+'lzo1c_9x.obj'
-+'lzo1c_cc.obj'
-+'lzo1c_d1.obj'
-+'lzo1c_d2.obj'
-+'lzo1c_rr.obj'
-+'lzo1c_xx.obj'
-+'lzo1f_1.obj'
-+'lzo1f_9x.obj'
-+'lzo1f_d1.obj'
-+'lzo1f_d2.obj'
-+'lzo1x_1.obj'
-+'lzo1x_1k.obj'
-+'lzo1x_1l.obj'
-+'lzo1x_1o.obj'
-+'lzo1x_9x.obj'
-+'lzo1x_d1.obj'
-+'lzo1x_d2.obj'
-+'lzo1x_d3.obj'
-+'lzo1x_o.obj'
-+'lzo1y_1.obj'
-+'lzo1y_9x.obj'
-+'lzo1y_d1.obj'
-+'lzo1y_d2.obj'
-+'lzo1y_d3.obj'
-+'lzo1y_o.obj'
-+'lzo1z_9x.obj'
-+'lzo1z_d1.obj'
-+'lzo1z_d2.obj'
-+'lzo1z_d3.obj'
-+'lzo2a_9x.obj'
-+'lzo2a_d1.obj'
-+'lzo2a_d2.obj'
-+'lzo_crc.obj'
-+'lzo_init.obj'
-+'lzo_ptr.obj'
-+'lzo_str.obj'
-+'lzo_util.obj'
++'lzo1.obj'
++'lzo1_99.obj'
++'lzo1a.obj'
++'lzo1a_99.obj'
++'lzo1b_1.obj'
++'lzo1b_2.obj'
++'lzo1b_3.obj'
++'lzo1b_4.obj'
++'lzo1b_5.obj'
++'lzo1b_6.obj'
++'lzo1b_7.obj'
++'lzo1b_8.obj'
++'lzo1b_9.obj'
++'lzo1b_99.obj'
++'lzo1b_9x.obj'
++'lzo1b_cc.obj'
++'lzo1b_d1.obj'
++'lzo1b_d2.obj'
++'lzo1b_rr.obj'
++'lzo1b_xx.obj'
++'lzo1c_1.obj'
++'lzo1c_2.obj'
++'lzo1c_3.obj'
++'lzo1c_4.obj'
++'lzo1c_5.obj'
++'lzo1c_6.obj'
++'lzo1c_7.obj'
++'lzo1c_8.obj'
++'lzo1c_9.obj'
++'lzo1c_99.obj'
++'lzo1c_9x.obj'
++'lzo1c_cc.obj'
++'lzo1c_d1.obj'
++'lzo1c_d2.obj'
++'lzo1c_rr.obj'
++'lzo1c_xx.obj'
++'lzo1f_1.obj'
++'lzo1f_9x.obj'
++'lzo1f_d1.obj'
++'lzo1f_d2.obj'
++'lzo1x_1.obj'
++'lzo1x_1k.obj'
++'lzo1x_1l.obj'
++'lzo1x_1o.obj'
++'lzo1x_9x.obj'
++'lzo1x_d1.obj'
++'lzo1x_d2.obj'
++'lzo1x_d3.obj'
++'lzo1x_o.obj'
++'lzo1y_1.obj'
++'lzo1y_9x.obj'
++'lzo1y_d1.obj'
++'lzo1y_d2.obj'
++'lzo1y_d3.obj'
++'lzo1y_o.obj'
++'lzo1z_9x.obj'
++'lzo1z_d1.obj'
++'lzo1z_d2.obj'
++'lzo1z_d3.obj'
++'lzo2a_9x.obj'
++'lzo2a_d1.obj'
++'lzo2a_d2.obj'
++'lzo_crc.obj'
++'lzo_init.obj'
++'lzo_ptr.obj'
++'lzo_str.obj'
++'lzo_util.obj'
diff --git a/app/lzo/B/dos32/bc_pp.bat b/app/lzo/B/dos32/bc_pp.bat
index 7cd86dd4..dbaf460c 100644
--- a/app/lzo/B/dos32/bc_pp.bat
+++ b/app/lzo/B/dos32/bc_pp.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI32)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc32 -WX
-set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI32)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc32 -WX
+set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/dj2.bat b/app/lzo/B/dos32/dj2.bat
index ac493992..02da9232 100644
--- a/app/lzo/B/dos32/dj2.bat
+++ b/app/lzo/B/dos32/dj2.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // djgpp2 + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=lib%BNAME%.a
-set CC=gcc
-set CF=@b/dos32/dj2.opt %CFI% %CFASM%
-set LF=%BLIB% -s
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% @b/win32/cygwin.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -s -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // djgpp2 + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -s -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/dj2.opt b/app/lzo/B/dos32/dj2.opt
index 9cd02cd0..782eda58 100644
--- a/app/lzo/B/dos32/dj2.opt
+++ b/app/lzo/B/dos32/dj2.opt
@@ -1,6 +1,6 @@
--O2
--fomit-frame-pointer
--Wall
--Wcast-align
--Wcast-qual
--Wwrite-strings
+-O2
+-fomit-frame-pointer
+-Wall
+-Wcast-align
+-Wcast-qual
+-Wwrite-strings
diff --git a/app/lzo/B/dos32/dm.bat b/app/lzo/B/dos32/dm.bat
index 0449668c..3328e1f3 100644
--- a/app/lzo/B/dos32/dm.bat
+++ b/app/lzo/B/dos32/dm.bat
@@ -1,43 +1,43 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Digital Mars C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=dmc -mx
-set CF=-o -w- %CFI% %CFASM%
-set LF=%BLIB% x32.lib
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-set LF=x32.lib
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -mx
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB% x32.lib
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=x32.lib
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/emx.bat b/app/lzo/B/dos32/emx.bat
index ceb97e4d..631dceb3 100644
--- a/app/lzo/B/dos32/emx.bat
+++ b/app/lzo/B/dos32/emx.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // emx + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=%BNAME%.a
-set CC=gcc
-set CF=@b/dos32/dj2.opt %CFI% %CFASM%
-set LF=%BLIB% -s
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% @b/win32/cygwin.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // emx + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/highc.bat b/app/lzo/B/dos32/highc.bat
index e3e28a7c..83d4cdc0 100644
--- a/app/lzo/B/dos32/highc.bat
+++ b/app/lzo/B/dos32/highc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // MetaWare High C/C++ (using Pharlap DOS extender)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=hc386
-set CF=-O3 -w4 %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -w1 -c src\*.c
-@if errorlevel 1 goto error
-386lib %BLIB% -nobanner @b\dos32\highc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // MetaWare High C/C++ (using Pharlap DOS extender)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=hc386
+set CF=-O3 -w4 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -w1 -c src\*.c
+@if errorlevel 1 goto error
+386lib %BLIB% -nobanner @b\dos32\highc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/highc.rsp b/app/lzo/B/dos32/highc.rsp
index ef2dc7fa..d17a52ae 100644
--- a/app/lzo/B/dos32/highc.rsp
+++ b/app/lzo/B/dos32/highc.rsp
@@ -1,79 +1,73 @@
--create lzo1.obj
--create lzo1_99.obj
--create lzo1a.obj
--create lzo1a_99.obj
--create lzo1b_1.obj
--create lzo1b_2.obj
--create lzo1b_3.obj
--create lzo1b_4.obj
--create lzo1b_5.obj
--create lzo1b_6.obj
--create lzo1b_7.obj
--create lzo1b_8.obj
--create lzo1b_9.obj
--create lzo1b_99.obj
--create lzo1b_9x.obj
--create lzo1b_cc.obj
--create lzo1b_d1.obj
--create lzo1b_d2.obj
--create lzo1b_rr.obj
--create lzo1b_xx.obj
--create lzo1c_1.obj
--create lzo1c_2.obj
--create lzo1c_3.obj
--create lzo1c_4.obj
--create lzo1c_5.obj
--create lzo1c_6.obj
--create lzo1c_7.obj
--create lzo1c_8.obj
--create lzo1c_9.obj
--create lzo1c_99.obj
--create lzo1c_9x.obj
--create lzo1c_cc.obj
--create lzo1c_d1.obj
--create lzo1c_d2.obj
--create lzo1c_rr.obj
--create lzo1c_xx.obj
--create lzo1f_1.obj
--create lzo1f_9x.obj
--create lzo1f_d1.obj
--create lzo1f_d2.obj
--create lzo1x_1.obj
--create lzo1x_1k.obj
--create lzo1x_1l.obj
--create lzo1x_1o.obj
--create lzo1x_9x.obj
--create lzo1x_d1.obj
--create lzo1x_d2.obj
--create lzo1x_d3.obj
--create lzo1x_o.obj
--create lzo1y_1.obj
--create lzo1y_9x.obj
--create lzo1y_d1.obj
--create lzo1y_d2.obj
--create lzo1y_d3.obj
--create lzo1y_o.obj
--create lzo1z_9x.obj
--create lzo1z_d1.obj
--create lzo1z_d2.obj
--create lzo1z_d3.obj
--create lzo2a_9x.obj
--create lzo2a_d1.obj
--create lzo2a_d2.obj
--create lzo_crc.obj
--create lzo_init.obj
--create lzo_ptr.obj
--create lzo_str.obj
--create lzo_util.obj
--create asm\i386\obj\omf32\lzo1c_s1.obj
--create asm\i386\obj\omf32\lzo1c_s2.obj
--create asm\i386\obj\omf32\lzo1f_f1.obj
--create asm\i386\obj\omf32\lzo1f_f2.obj
--create asm\i386\obj\omf32\lzo1x_f1.obj
--create asm\i386\obj\omf32\lzo1x_f2.obj
--create asm\i386\obj\omf32\lzo1x_s1.obj
--create asm\i386\obj\omf32\lzo1x_s2.obj
--create asm\i386\obj\omf32\lzo1y_f1.obj
--create asm\i386\obj\omf32\lzo1y_f2.obj
--create asm\i386\obj\omf32\lzo1y_s1.obj
--create asm\i386\obj\omf32\lzo1y_s2.obj
+-create lzo1.obj
+-create lzo1_99.obj
+-create lzo1a.obj
+-create lzo1a_99.obj
+-create lzo1b_1.obj
+-create lzo1b_2.obj
+-create lzo1b_3.obj
+-create lzo1b_4.obj
+-create lzo1b_5.obj
+-create lzo1b_6.obj
+-create lzo1b_7.obj
+-create lzo1b_8.obj
+-create lzo1b_9.obj
+-create lzo1b_99.obj
+-create lzo1b_9x.obj
+-create lzo1b_cc.obj
+-create lzo1b_d1.obj
+-create lzo1b_d2.obj
+-create lzo1b_rr.obj
+-create lzo1b_xx.obj
+-create lzo1c_1.obj
+-create lzo1c_2.obj
+-create lzo1c_3.obj
+-create lzo1c_4.obj
+-create lzo1c_5.obj
+-create lzo1c_6.obj
+-create lzo1c_7.obj
+-create lzo1c_8.obj
+-create lzo1c_9.obj
+-create lzo1c_99.obj
+-create lzo1c_9x.obj
+-create lzo1c_cc.obj
+-create lzo1c_d1.obj
+-create lzo1c_d2.obj
+-create lzo1c_rr.obj
+-create lzo1c_xx.obj
+-create lzo1f_1.obj
+-create lzo1f_9x.obj
+-create lzo1f_d1.obj
+-create lzo1f_d2.obj
+-create lzo1x_1.obj
+-create lzo1x_1k.obj
+-create lzo1x_1l.obj
+-create lzo1x_1o.obj
+-create lzo1x_9x.obj
+-create lzo1x_d1.obj
+-create lzo1x_d2.obj
+-create lzo1x_d3.obj
+-create lzo1x_o.obj
+-create lzo1y_1.obj
+-create lzo1y_9x.obj
+-create lzo1y_d1.obj
+-create lzo1y_d2.obj
+-create lzo1y_d3.obj
+-create lzo1y_o.obj
+-create lzo1z_9x.obj
+-create lzo1z_d1.obj
+-create lzo1z_d2.obj
+-create lzo1z_d3.obj
+-create lzo2a_9x.obj
+-create lzo2a_d1.obj
+-create lzo2a_d2.obj
+-create lzo_crc.obj
+-create lzo_init.obj
+-create lzo_ptr.obj
+-create lzo_str.obj
+-create lzo_util.obj
+-create asm\i386\obj\omf32\lzo1c_s1.obj
+-create asm\i386\obj\omf32\lzo1f_f1.obj
+-create asm\i386\obj\omf32\lzo1x_f1.obj
+-create asm\i386\obj\omf32\lzo1x_s1.obj
+-create asm\i386\obj\omf32\lzo1y_f1.obj
+-create asm\i386\obj\omf32\lzo1y_s1.obj
diff --git a/app/lzo/B/dos32/ndp.bat b/app/lzo/B/dos32/ndp.bat
index 64b04ed4..c2c1beba 100644
--- a/app/lzo/B/dos32/ndp.bat
+++ b/app/lzo/B/dos32/ndp.bat
@@ -1,40 +1,40 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Microway NDP C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=mx486
-set CF=-ansi -on %CFI%
-set LF=%BLIB% -bind -map
-
-@REM %CC% %CF% -Isrc -c src\*.c
-for %%f in (src\*.c) do %CC% %CF% -Isrc -c %%f
-@if errorlevel 1 goto error
-ndplib %BLIB% @b\dos32\ndp.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Dconst= -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Microway NDP C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=mx486
+set CF=-ansi -on %CFI%
+set LF=%BLIB% -bind -map
+
+@REM %CC% %CF% -Isrc -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -Isrc -c %%f
+@if errorlevel 1 goto error
+ndplib %BLIB% @b\dos32\ndp.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Dconst= -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/ndp.rsp b/app/lzo/B/dos32/ndp.rsp
index c62b19eb..24c1d438 100644
--- a/app/lzo/B/dos32/ndp.rsp
+++ b/app/lzo/B/dos32/ndp.rsp
@@ -1,67 +1,67 @@
--add lzo1.obj
--add lzo1_99.obj
--add lzo1a.obj
--add lzo1a_99.obj
--add lzo1b_1.obj
--add lzo1b_2.obj
--add lzo1b_3.obj
--add lzo1b_4.obj
--add lzo1b_5.obj
--add lzo1b_6.obj
--add lzo1b_7.obj
--add lzo1b_8.obj
--add lzo1b_9.obj
--add lzo1b_99.obj
--add lzo1b_9x.obj
--add lzo1b_cc.obj
--add lzo1b_d1.obj
--add lzo1b_d2.obj
--add lzo1b_rr.obj
--add lzo1b_xx.obj
--add lzo1c_1.obj
--add lzo1c_2.obj
--add lzo1c_3.obj
--add lzo1c_4.obj
--add lzo1c_5.obj
--add lzo1c_6.obj
--add lzo1c_7.obj
--add lzo1c_8.obj
--add lzo1c_9.obj
--add lzo1c_99.obj
--add lzo1c_9x.obj
--add lzo1c_cc.obj
--add lzo1c_d1.obj
--add lzo1c_d2.obj
--add lzo1c_rr.obj
--add lzo1c_xx.obj
--add lzo1f_1.obj
--add lzo1f_9x.obj
--add lzo1f_d1.obj
--add lzo1f_d2.obj
--add lzo1x_1.obj
--add lzo1x_1k.obj
--add lzo1x_1l.obj
--add lzo1x_1o.obj
--add lzo1x_9x.obj
--add lzo1x_d1.obj
--add lzo1x_d2.obj
--add lzo1x_d3.obj
--add lzo1x_o.obj
--add lzo1y_1.obj
--add lzo1y_9x.obj
--add lzo1y_d1.obj
--add lzo1y_d2.obj
--add lzo1y_d3.obj
--add lzo1y_o.obj
--add lzo1z_9x.obj
--add lzo1z_d1.obj
--add lzo1z_d2.obj
--add lzo1z_d3.obj
--add lzo2a_9x.obj
--add lzo2a_d1.obj
--add lzo2a_d2.obj
--add lzo_crc.obj
--add lzo_init.obj
--add lzo_ptr.obj
--add lzo_str.obj
--add lzo_util.obj
+-add lzo1.obj
+-add lzo1_99.obj
+-add lzo1a.obj
+-add lzo1a_99.obj
+-add lzo1b_1.obj
+-add lzo1b_2.obj
+-add lzo1b_3.obj
+-add lzo1b_4.obj
+-add lzo1b_5.obj
+-add lzo1b_6.obj
+-add lzo1b_7.obj
+-add lzo1b_8.obj
+-add lzo1b_9.obj
+-add lzo1b_99.obj
+-add lzo1b_9x.obj
+-add lzo1b_cc.obj
+-add lzo1b_d1.obj
+-add lzo1b_d2.obj
+-add lzo1b_rr.obj
+-add lzo1b_xx.obj
+-add lzo1c_1.obj
+-add lzo1c_2.obj
+-add lzo1c_3.obj
+-add lzo1c_4.obj
+-add lzo1c_5.obj
+-add lzo1c_6.obj
+-add lzo1c_7.obj
+-add lzo1c_8.obj
+-add lzo1c_9.obj
+-add lzo1c_99.obj
+-add lzo1c_9x.obj
+-add lzo1c_cc.obj
+-add lzo1c_d1.obj
+-add lzo1c_d2.obj
+-add lzo1c_rr.obj
+-add lzo1c_xx.obj
+-add lzo1f_1.obj
+-add lzo1f_9x.obj
+-add lzo1f_d1.obj
+-add lzo1f_d2.obj
+-add lzo1x_1.obj
+-add lzo1x_1k.obj
+-add lzo1x_1l.obj
+-add lzo1x_1o.obj
+-add lzo1x_9x.obj
+-add lzo1x_d1.obj
+-add lzo1x_d2.obj
+-add lzo1x_d3.obj
+-add lzo1x_o.obj
+-add lzo1y_1.obj
+-add lzo1y_9x.obj
+-add lzo1y_d1.obj
+-add lzo1y_d2.obj
+-add lzo1y_d3.obj
+-add lzo1y_o.obj
+-add lzo1z_9x.obj
+-add lzo1z_d1.obj
+-add lzo1z_d2.obj
+-add lzo1z_d3.obj
+-add lzo2a_9x.obj
+-add lzo2a_d1.obj
+-add lzo2a_d2.obj
+-add lzo_crc.obj
+-add lzo_init.obj
+-add lzo_ptr.obj
+-add lzo_str.obj
+-add lzo_util.obj
diff --git a/app/lzo/B/dos32/sc.bat b/app/lzo/B/dos32/sc.bat
index 1b233336..5751fa3b 100644
--- a/app/lzo/B/dos32/sc.bat
+++ b/app/lzo/B/dos32/sc.bat
@@ -1,51 +1,51 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Symantec C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=sc -mx
-set CF=-o -w- %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Symantec C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -mx
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/wc.bat b/app/lzo/B/dos32/wc.bat
index bfa776d5..8817b19c 100644
--- a/app/lzo/B/dos32/wc.bat
+++ b/app/lzo/B/dos32/wc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Watcom C/C++ (using DOS/4G extender)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl386 -zq -mf -5r -bt#dos -l#dos4g
-set CF=-ox -zc %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Watcom C/C++ (using DOS/4G extender)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#dos -l#dos4g
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/dos32/zc.bat b/app/lzo/B/dos32/zc.bat
index 0da77941..159e99ca 100644
--- a/app/lzo/B/dos32/zc.bat
+++ b/app/lzo/B/dos32/zc.bat
@@ -1,51 +1,51 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // DOS 32-bit
-@echo // Zortech C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=ztc -b -v0 -mx
-set CF=-o -w- -r %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-zorlib %BLIB% @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Zortech C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=ztc -b -v0 -mx
+set CF=-o -w- -r %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+zorlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/generic/build.sh b/app/lzo/B/generic/build.sh
index 1bf5585b..0480314e 100755
--- a/app/lzo/B/generic/build.sh
+++ b/app/lzo/B/generic/build.sh
@@ -1,7 +1,7 @@
#! /bin/sh
# vi:ts=4:et
set -e
-echo "// Copyright (C) 1996-2011 Markus F.X.J. Oberhumer"
+echo "// Copyright (C) 1996-2014 Markus F.X.J. Oberhumer"
echo "//"
echo "// Generic Posix/Unix system"
echo "// Generic C compiler"
diff --git a/app/lzo/B/generic/clean.sh b/app/lzo/B/generic/clean.sh
index 11c23951..2728d2de 100755
--- a/app/lzo/B/generic/clean.sh
+++ b/app/lzo/B/generic/clean.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# vi:ts=4:et
-# Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+# Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out
diff --git a/app/lzo/B/os2/emx.bat b/app/lzo/B/os2/emx.bat
index 01d7dfa4..35e26fc5 100644
--- a/app/lzo/B/os2/emx.bat
+++ b/app/lzo/B/os2/emx.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // OS/2 32-bit
-@echo // emx + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=%BNAME%.a
-set CC=gcc
-set CF=@b/dos32/dj2.opt %CFI% %CFASM%
-set LF=%BLIB% -s
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% @b/win32/cygwin.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // emx + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/os2/wc.bat b/app/lzo/B/os2/wc.bat
index 79e2082b..44ca3ab1 100644
--- a/app/lzo/B/os2/wc.bat
+++ b/app/lzo/B/os2/wc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // OS/2 32-bit
-@echo // Watcom C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl386 -zq -mf -5r -bt#os2 -l#os2v2
-set CF=-ox -zc %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#os2 -l#os2v2
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/os2/zc.bat b/app/lzo/B/os2/zc.bat
index 47a6d51b..db751a67 100644
--- a/app/lzo/B/os2/zc.bat
+++ b/app/lzo/B/os2/zc.bat
@@ -1,51 +1,51 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // OS/2 32-bit
-@echo // Zortech C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=ztc -b -v0 -mf
-set CF=-o -w- -r %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-zorlib %BLIB% @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // Zortech C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=ztc -b -v0 -mf
+set CF=-o -w- -r %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+zorlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/os2_16/mc.bat b/app/lzo/B/os2_16/mc.bat
index 95742d41..378d43f0 100644
--- a/app/lzo/B/os2_16/mc.bat
+++ b/app/lzo/B/os2_16/mc.bat
@@ -1,43 +1,43 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // OS/2 16-bit
-@echo // Microsoft C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -AL -G2
-set CF=-D__OS2__ -O -Gf -Gs -W3 %CFI%
-set LF=%BLIB% -Lp -Fm /link /stack:8096
-
-@REM %CC% %CF% -c src\*.c
-for %%f in (src\*.c) do %CC% %CF% -c %%f
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 16-bit
+@echo // Microsoft C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2
+set CF=-D__OS2__ -O -Gf -Gs -W3 %CFI%
+set LF=%BLIB% -Lp -Fm /link /stack:8096
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/os2_16/wc.bat b/app/lzo/B/os2_16/wc.bat
index bbe17430..fcf7fc99 100644
--- a/app/lzo/B/os2_16/wc.bat
+++ b/app/lzo/B/os2_16/wc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // OS/2 16-bit
-@echo // Watcom C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl -zq -ml -2 -bt#os2 -l#os2
-set CF=-ox %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -2 -bt#os2 -l#os2
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/prepare.bat b/app/lzo/B/prepare.bat
index 34bac191..5f70fb77 100644
--- a/app/lzo/B/prepare.bat
+++ b/app/lzo/B/prepare.bat
@@ -1,10 +1,10 @@
-@call b\unset.bat
-@call b\clean.bat
-
-@set CFI=-Iinclude -I. -Isrc
-@set CFASM=-DLZO_USE_ASM
-@set BNAME=lzo2
-@set BLIB=lzo2.lib
-@set BDLL=lzo2.dll
-
-@echo Compiling, please be patient...
+@call b\unset.bat
+@call b\clean.bat
+
+@set CFI=-Iinclude -I. -Isrc
+@set CFASM=-DLZO_USE_ASM
+@set BNAME=lzo2
+@set BLIB=lzo2.lib
+@set BDLL=lzo2.dll
+
+@echo Compiling, please be patient...
diff --git a/app/lzo/B/src.rsp b/app/lzo/B/src.rsp
index 2a1dbce6..26fd0110 100644
--- a/app/lzo/B/src.rsp
+++ b/app/lzo/B/src.rsp
@@ -1,67 +1,67 @@
-src/lzo1.c
-src/lzo1_99.c
-src/lzo1a.c
-src/lzo1a_99.c
-src/lzo1b_1.c
-src/lzo1b_2.c
-src/lzo1b_3.c
-src/lzo1b_4.c
-src/lzo1b_5.c
-src/lzo1b_6.c
-src/lzo1b_7.c
-src/lzo1b_8.c
-src/lzo1b_9.c
-src/lzo1b_99.c
-src/lzo1b_9x.c
-src/lzo1b_cc.c
-src/lzo1b_d1.c
-src/lzo1b_d2.c
-src/lzo1b_rr.c
-src/lzo1b_xx.c
-src/lzo1c_1.c
-src/lzo1c_2.c
-src/lzo1c_3.c
-src/lzo1c_4.c
-src/lzo1c_5.c
-src/lzo1c_6.c
-src/lzo1c_7.c
-src/lzo1c_8.c
-src/lzo1c_9.c
-src/lzo1c_99.c
-src/lzo1c_9x.c
-src/lzo1c_cc.c
-src/lzo1c_d1.c
-src/lzo1c_d2.c
-src/lzo1c_rr.c
-src/lzo1c_xx.c
-src/lzo1f_1.c
-src/lzo1f_9x.c
-src/lzo1f_d1.c
-src/lzo1f_d2.c
-src/lzo1x_1.c
-src/lzo1x_1k.c
-src/lzo1x_1l.c
-src/lzo1x_1o.c
-src/lzo1x_9x.c
-src/lzo1x_d1.c
-src/lzo1x_d2.c
-src/lzo1x_d3.c
-src/lzo1x_o.c
-src/lzo1y_1.c
-src/lzo1y_9x.c
-src/lzo1y_d1.c
-src/lzo1y_d2.c
-src/lzo1y_d3.c
-src/lzo1y_o.c
-src/lzo1z_9x.c
-src/lzo1z_d1.c
-src/lzo1z_d2.c
-src/lzo1z_d3.c
-src/lzo2a_9x.c
-src/lzo2a_d1.c
-src/lzo2a_d2.c
-src/lzo_crc.c
-src/lzo_init.c
-src/lzo_ptr.c
-src/lzo_str.c
-src/lzo_util.c
+src/lzo1.c
+src/lzo1_99.c
+src/lzo1a.c
+src/lzo1a_99.c
+src/lzo1b_1.c
+src/lzo1b_2.c
+src/lzo1b_3.c
+src/lzo1b_4.c
+src/lzo1b_5.c
+src/lzo1b_6.c
+src/lzo1b_7.c
+src/lzo1b_8.c
+src/lzo1b_9.c
+src/lzo1b_99.c
+src/lzo1b_9x.c
+src/lzo1b_cc.c
+src/lzo1b_d1.c
+src/lzo1b_d2.c
+src/lzo1b_rr.c
+src/lzo1b_xx.c
+src/lzo1c_1.c
+src/lzo1c_2.c
+src/lzo1c_3.c
+src/lzo1c_4.c
+src/lzo1c_5.c
+src/lzo1c_6.c
+src/lzo1c_7.c
+src/lzo1c_8.c
+src/lzo1c_9.c
+src/lzo1c_99.c
+src/lzo1c_9x.c
+src/lzo1c_cc.c
+src/lzo1c_d1.c
+src/lzo1c_d2.c
+src/lzo1c_rr.c
+src/lzo1c_xx.c
+src/lzo1f_1.c
+src/lzo1f_9x.c
+src/lzo1f_d1.c
+src/lzo1f_d2.c
+src/lzo1x_1.c
+src/lzo1x_1k.c
+src/lzo1x_1l.c
+src/lzo1x_1o.c
+src/lzo1x_9x.c
+src/lzo1x_d1.c
+src/lzo1x_d2.c
+src/lzo1x_d3.c
+src/lzo1x_o.c
+src/lzo1y_1.c
+src/lzo1y_9x.c
+src/lzo1y_d1.c
+src/lzo1y_d2.c
+src/lzo1y_d3.c
+src/lzo1y_o.c
+src/lzo1z_9x.c
+src/lzo1z_d1.c
+src/lzo1z_d2.c
+src/lzo1z_d3.c
+src/lzo2a_9x.c
+src/lzo2a_d1.c
+src/lzo2a_d2.c
+src/lzo_crc.c
+src/lzo_init.c
+src/lzo_ptr.c
+src/lzo_str.c
+src/lzo_util.c
diff --git a/app/lzo/B/unset.bat b/app/lzo/B/unset.bat
index 21672dd6..98f13786 100644
--- a/app/lzo/B/unset.bat
+++ b/app/lzo/B/unset.bat
@@ -1,10 +1,10 @@
-@set CC=
-@set CF=
-@set CFI=
-@set CFX=
-@set CFASM=
-@set LF=
-@set BNAME=
-@set BLIB=
-@set BDLL=
-@set BECHO=
+@set CC=
+@set CF=
+@set CFI=
+@set CFX=
+@set CFASM=
+@set LF=
+@set BNAME=
+@set BLIB=
+@set BDLL=
+@set BECHO=
diff --git a/app/lzo/B/win16/bc.bat b/app/lzo/B/win16/bc.bat
index f252ada8..06f64bda 100644
--- a/app/lzo/B/win16/bc.bat
+++ b/app/lzo/B/win16/bc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Borland C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc -ml -2 -tW -h
-set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -2 -tW -h
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win16/dm.bat b/app/lzo/B/win16/dm.bat
index 8009a996..d844ef83 100644
--- a/app/lzo/B/win16/dm.bat
+++ b/app/lzo/B/win16/dm.bat
@@ -1,43 +1,43 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Digital Mars C/C++ (using WINIO)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=dmc -ml -2 -W
-set CF=-o -w- %CFI%
-set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-set LF=libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Digital Mars C/C++ (using WINIO)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -ml -2 -W
+set CF=-o -w- %CFI%
+set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win16/mc.bat b/app/lzo/B/win16/mc.bat
index 4404e421..26af7b6e 100644
--- a/app/lzo/B/win16/mc.bat
+++ b/app/lzo/B/win16/mc.bat
@@ -1,56 +1,56 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Microsoft C/C++ (using QuickWin)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -AL -G2 -Mq
-set CF=-O -Gf -W3 %CFI%
-set LF=/seg:256 /stack:8096 /nod:llibce /map
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-link %LF% dict.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-link %LF% lzopack.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-link %LF% precomp.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-link %LF% precomp2.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-link %LF% simple.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-link %LF% lzotest.obj,,,llibcewq.lib libw.lib %BLIB%;
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-link %LF% testmini.obj minilzo.obj,,,llibcewq.lib libw.lib;
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Microsoft C/C++ (using QuickWin)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2 -Mq
+set CF=-O -Gf -W3 %CFI%
+set LF=/seg:256 /stack:8096 /nod:llibce /map
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+link %LF% testmini.obj minilzo.obj,,,llibcewq.lib libw.lib;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win16/sc.bat b/app/lzo/B/win16/sc.bat
index 0dab9e3c..89dd73c5 100644
--- a/app/lzo/B/win16/sc.bat
+++ b/app/lzo/B/win16/sc.bat
@@ -1,53 +1,53 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Symantec C/C++ (using WINIO)
-@echo //
-@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=sc -ml -2 -W
-set CF=-w- %CFI%
-set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Symantec C/C++ (using WINIO)
+@echo //
+@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -ml -2 -W
+set CF=-w- %CFI%
+set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win16/vc.bat b/app/lzo/B/win16/vc.bat
index 2c35cfc4..74962326 100644
--- a/app/lzo/B/win16/vc.bat
+++ b/app/lzo/B/win16/vc.bat
@@ -1,43 +1,43 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Microsoft Visual C/C++ (using QuickWin)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -AL -G2 -Mq
-set CF=-O -Gf -Gs -Gy -W3 %CFI%
-set LF=%BLIB% -Fm /link /seg:256
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib /nologo %BLIB% @b\dos16\bc.rsp;
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-set LF=-Fm /link /seg:256
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Microsoft Visual C/C++ (using QuickWin)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2 -Mq
+set CF=-O -Gf -Gs -Gy -W3 %CFI%
+set LF=%BLIB% -Fm /link /seg:256
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=-Fm /link /seg:256
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win16/wc.bat b/app/lzo/B/win16/wc.bat
index b5dbf22a..be06828a 100644
--- a/app/lzo/B/win16/wc.bat
+++ b/app/lzo/B/win16/wc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 16-bit
-@echo // Watcom C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl -zq -ml -2 -bw -bt#windows -l#windows
-set CF=-ox %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -2 -bw -bt#windows -l#windows
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/bc.bat b/app/lzo/B/win32/bc.bat
index 2aa9028c..21fafa0e 100644
--- a/app/lzo/B/win32/bc.bat
+++ b/app/lzo/B/win32/bc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Borland C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=bcc32
-set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -Isrc -c @b\src.rsp
-@if errorlevel 1 goto error
-tlib %BLIB% @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Iexamples examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -ls -Iexamples examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc32
+set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/bc.rsp b/app/lzo/B/win32/bc.rsp
index 477f1ffd..d62b5b38 100644
--- a/app/lzo/B/win32/bc.rsp
+++ b/app/lzo/B/win32/bc.rsp
@@ -1,79 +1,73 @@
-+lzo1.obj &
-+lzo1_99.obj &
-+lzo1a.obj &
-+lzo1a_99.obj &
-+lzo1b_1.obj &
-+lzo1b_2.obj &
-+lzo1b_3.obj &
-+lzo1b_4.obj &
-+lzo1b_5.obj &
-+lzo1b_6.obj &
-+lzo1b_7.obj &
-+lzo1b_8.obj &
-+lzo1b_9.obj &
-+lzo1b_99.obj &
-+lzo1b_9x.obj &
-+lzo1b_cc.obj &
-+lzo1b_d1.obj &
-+lzo1b_d2.obj &
-+lzo1b_rr.obj &
-+lzo1b_xx.obj &
-+lzo1c_1.obj &
-+lzo1c_2.obj &
-+lzo1c_3.obj &
-+lzo1c_4.obj &
-+lzo1c_5.obj &
-+lzo1c_6.obj &
-+lzo1c_7.obj &
-+lzo1c_8.obj &
-+lzo1c_9.obj &
-+lzo1c_99.obj &
-+lzo1c_9x.obj &
-+lzo1c_cc.obj &
-+lzo1c_d1.obj &
-+lzo1c_d2.obj &
-+lzo1c_rr.obj &
-+lzo1c_xx.obj &
-+lzo1f_1.obj &
-+lzo1f_9x.obj &
-+lzo1f_d1.obj &
-+lzo1f_d2.obj &
-+lzo1x_1.obj &
-+lzo1x_1k.obj &
-+lzo1x_1l.obj &
-+lzo1x_1o.obj &
-+lzo1x_9x.obj &
-+lzo1x_d1.obj &
-+lzo1x_d2.obj &
-+lzo1x_d3.obj &
-+lzo1x_o.obj &
-+lzo1y_1.obj &
-+lzo1y_9x.obj &
-+lzo1y_d1.obj &
-+lzo1y_d2.obj &
-+lzo1y_d3.obj &
-+lzo1y_o.obj &
-+lzo1z_9x.obj &
-+lzo1z_d1.obj &
-+lzo1z_d2.obj &
-+lzo1z_d3.obj &
-+lzo2a_9x.obj &
-+lzo2a_d1.obj &
-+lzo2a_d2.obj &
-+lzo_crc.obj &
-+lzo_init.obj &
-+lzo_ptr.obj &
-+lzo_str.obj &
-+lzo_util.obj &
-+asm\i386\obj\omf32\lzo1c_s1.obj &
-+asm\i386\obj\omf32\lzo1c_s2.obj &
-+asm\i386\obj\omf32\lzo1f_f1.obj &
-+asm\i386\obj\omf32\lzo1f_f2.obj &
-+asm\i386\obj\omf32\lzo1x_f1.obj &
-+asm\i386\obj\omf32\lzo1x_f2.obj &
-+asm\i386\obj\omf32\lzo1x_s1.obj &
-+asm\i386\obj\omf32\lzo1x_s2.obj &
-+asm\i386\obj\omf32\lzo1y_f1.obj &
-+asm\i386\obj\omf32\lzo1y_f2.obj &
-+asm\i386\obj\omf32\lzo1y_s1.obj &
-+asm\i386\obj\omf32\lzo1y_s2.obj
++lzo1.obj &
++lzo1_99.obj &
++lzo1a.obj &
++lzo1a_99.obj &
++lzo1b_1.obj &
++lzo1b_2.obj &
++lzo1b_3.obj &
++lzo1b_4.obj &
++lzo1b_5.obj &
++lzo1b_6.obj &
++lzo1b_7.obj &
++lzo1b_8.obj &
++lzo1b_9.obj &
++lzo1b_99.obj &
++lzo1b_9x.obj &
++lzo1b_cc.obj &
++lzo1b_d1.obj &
++lzo1b_d2.obj &
++lzo1b_rr.obj &
++lzo1b_xx.obj &
++lzo1c_1.obj &
++lzo1c_2.obj &
++lzo1c_3.obj &
++lzo1c_4.obj &
++lzo1c_5.obj &
++lzo1c_6.obj &
++lzo1c_7.obj &
++lzo1c_8.obj &
++lzo1c_9.obj &
++lzo1c_99.obj &
++lzo1c_9x.obj &
++lzo1c_cc.obj &
++lzo1c_d1.obj &
++lzo1c_d2.obj &
++lzo1c_rr.obj &
++lzo1c_xx.obj &
++lzo1f_1.obj &
++lzo1f_9x.obj &
++lzo1f_d1.obj &
++lzo1f_d2.obj &
++lzo1x_1.obj &
++lzo1x_1k.obj &
++lzo1x_1l.obj &
++lzo1x_1o.obj &
++lzo1x_9x.obj &
++lzo1x_d1.obj &
++lzo1x_d2.obj &
++lzo1x_d3.obj &
++lzo1x_o.obj &
++lzo1y_1.obj &
++lzo1y_9x.obj &
++lzo1y_d1.obj &
++lzo1y_d2.obj &
++lzo1y_d3.obj &
++lzo1y_o.obj &
++lzo1z_9x.obj &
++lzo1z_d1.obj &
++lzo1z_d2.obj &
++lzo1z_d3.obj &
++lzo2a_9x.obj &
++lzo2a_d1.obj &
++lzo2a_d2.obj &
++lzo_crc.obj &
++lzo_init.obj &
++lzo_ptr.obj &
++lzo_str.obj &
++lzo_util.obj &
++asm\i386\obj\omf32\lzo1c_s1.obj &
++asm\i386\obj\omf32\lzo1f_f1.obj &
++asm\i386\obj\omf32\lzo1x_f1.obj &
++asm\i386\obj\omf32\lzo1x_s1.obj &
++asm\i386\obj\omf32\lzo1y_f1.obj &
++asm\i386\obj\omf32\lzo1y_s1.obj
diff --git a/app/lzo/B/win32/cygwin.bat b/app/lzo/B/win32/cygwin.bat
index 661badba..35baf058 100644
--- a/app/lzo/B/win32/cygwin.bat
+++ b/app/lzo/B/win32/cygwin.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // cygwin + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=lib%BNAME%.a
-set CC=gcc
-set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
-set LF=%BLIB% -lwinmm -s
-
-%CC% %CF% -c src/*.c
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% @b/win32/cygwin.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // cygwin + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/cygwin.rsp b/app/lzo/B/win32/cygwin.rsp
index 2c9c9f99..d6b3da0b 100644
--- a/app/lzo/B/win32/cygwin.rsp
+++ b/app/lzo/B/win32/cygwin.rsp
@@ -1,79 +1,73 @@
-lzo1.o
-lzo1_99.o
-lzo1a.o
-lzo1a_99.o
-lzo1b_1.o
-lzo1b_2.o
-lzo1b_3.o
-lzo1b_4.o
-lzo1b_5.o
-lzo1b_6.o
-lzo1b_7.o
-lzo1b_8.o
-lzo1b_9.o
-lzo1b_99.o
-lzo1b_9x.o
-lzo1b_cc.o
-lzo1b_d1.o
-lzo1b_d2.o
-lzo1b_rr.o
-lzo1b_xx.o
-lzo1c_1.o
-lzo1c_2.o
-lzo1c_3.o
-lzo1c_4.o
-lzo1c_5.o
-lzo1c_6.o
-lzo1c_7.o
-lzo1c_8.o
-lzo1c_9.o
-lzo1c_99.o
-lzo1c_9x.o
-lzo1c_cc.o
-lzo1c_d1.o
-lzo1c_d2.o
-lzo1c_rr.o
-lzo1c_xx.o
-lzo1f_1.o
-lzo1f_9x.o
-lzo1f_d1.o
-lzo1f_d2.o
-lzo1x_1.o
-lzo1x_1k.o
-lzo1x_1l.o
-lzo1x_1o.o
-lzo1x_9x.o
-lzo1x_d1.o
-lzo1x_d2.o
-lzo1x_d3.o
-lzo1x_o.o
-lzo1y_1.o
-lzo1y_9x.o
-lzo1y_d1.o
-lzo1y_d2.o
-lzo1y_d3.o
-lzo1y_o.o
-lzo1z_9x.o
-lzo1z_d1.o
-lzo1z_d2.o
-lzo1z_d3.o
-lzo2a_9x.o
-lzo2a_d1.o
-lzo2a_d2.o
-lzo_crc.o
-lzo_init.o
-lzo_ptr.o
-lzo_str.o
-lzo_util.o
-lzo1c_s1.o
-lzo1c_s2.o
-lzo1f_f1.o
-lzo1f_f2.o
-lzo1x_f1.o
-lzo1x_f2.o
-lzo1x_s1.o
-lzo1x_s2.o
-lzo1y_f1.o
-lzo1y_f2.o
-lzo1y_s1.o
-lzo1y_s2.o
+lzo1.o
+lzo1_99.o
+lzo1a.o
+lzo1a_99.o
+lzo1b_1.o
+lzo1b_2.o
+lzo1b_3.o
+lzo1b_4.o
+lzo1b_5.o
+lzo1b_6.o
+lzo1b_7.o
+lzo1b_8.o
+lzo1b_9.o
+lzo1b_99.o
+lzo1b_9x.o
+lzo1b_cc.o
+lzo1b_d1.o
+lzo1b_d2.o
+lzo1b_rr.o
+lzo1b_xx.o
+lzo1c_1.o
+lzo1c_2.o
+lzo1c_3.o
+lzo1c_4.o
+lzo1c_5.o
+lzo1c_6.o
+lzo1c_7.o
+lzo1c_8.o
+lzo1c_9.o
+lzo1c_99.o
+lzo1c_9x.o
+lzo1c_cc.o
+lzo1c_d1.o
+lzo1c_d2.o
+lzo1c_rr.o
+lzo1c_xx.o
+lzo1f_1.o
+lzo1f_9x.o
+lzo1f_d1.o
+lzo1f_d2.o
+lzo1x_1.o
+lzo1x_1k.o
+lzo1x_1l.o
+lzo1x_1o.o
+lzo1x_9x.o
+lzo1x_d1.o
+lzo1x_d2.o
+lzo1x_d3.o
+lzo1x_o.o
+lzo1y_1.o
+lzo1y_9x.o
+lzo1y_d1.o
+lzo1y_d2.o
+lzo1y_d3.o
+lzo1y_o.o
+lzo1z_9x.o
+lzo1z_d1.o
+lzo1z_d2.o
+lzo1z_d3.o
+lzo2a_9x.o
+lzo2a_d1.o
+lzo2a_d2.o
+lzo_crc.o
+lzo_init.o
+lzo_ptr.o
+lzo_str.o
+lzo_util.o
+lzo1c_s1.o
+lzo1f_f1.o
+lzo1x_f1.o
+lzo1x_s1.o
+lzo1y_f1.o
+lzo1y_s1.o
diff --git a/app/lzo/B/win32/dm.bat b/app/lzo/B/win32/dm.bat
index c06498d7..3e152a6a 100644
--- a/app/lzo/B/win32/dm.bat
+++ b/app/lzo/B/win32/dm.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Digital Mars C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=dmc -mn
-set CF=-o -w- %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -mn
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/ic.bat b/app/lzo/B/win32/ic.bat
index 807e33d9..9fe53821 100644
--- a/app/lzo/B/win32/ic.bat
+++ b/app/lzo/B/win32/ic.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Intel C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=icl -nologo -MD
-set CF=-O2 -GF -W3 %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Intel C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 -Qvec-report0 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/lccwin32.bat b/app/lzo/B/win32/lccwin32.bat
index e9a1c5f9..1b5265f0 100644
--- a/app/lzo/B/win32/lccwin32.bat
+++ b/app/lzo/B/win32/lccwin32.bat
@@ -1,59 +1,59 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // lcc-win32
-@echo //
-@echo // NOTE: some lcc-win32 versions are buggy, so we disable optimizations
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=lcc
-set CF=-O -A %CFI% -Iinclude\lzo %CFASM%
-set CF=-A %CFI% -Iinclude\lzo %CFASM%
-set LF=%BLIB% winmm.lib
-
-for %%f in (src\*.c) do %CC% %CF% -c %%f
-@if errorlevel 1 goto error
-lcclib /out:%BLIB% @b\win32\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% -c %CF% examples\dict.c
-@if errorlevel 1 goto error
-lc dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% -c %CF% examples\lzopack.c
-@if errorlevel 1 goto error
-lc lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% -c %CF% examples\precomp.c
-@if errorlevel 1 goto error
-lc precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% -c %CF% examples\precomp2.c
-@if errorlevel 1 goto error
-lc precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% -c %CF% examples\simple.c
-@if errorlevel 1 goto error
-lc simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% -c %CF% lzotest\lzotest.c
-@if errorlevel 1 goto error
-lc lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% -c %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-lc testmini.obj minilzo.obj
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // lcc-win32
+@echo //
+@echo // NOTE: some lcc-win32 versions are buggy, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=lcc
+set CF=-O -A %CFI% -Iinclude\lzo %CFASM%
+set CF=-A %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB% winmm.lib
+
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lcclib /out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% -c %CF% examples\dict.c
+@if errorlevel 1 goto error
+lc dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\lzopack.c
+@if errorlevel 1 goto error
+lc lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\precomp.c
+@if errorlevel 1 goto error
+lc precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\precomp2.c
+@if errorlevel 1 goto error
+lc precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\simple.c
+@if errorlevel 1 goto error
+lc simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% -c %CF% lzotest\lzotest.c
+@if errorlevel 1 goto error
+lc lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% -c %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+lc testmini.obj minilzo.obj
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/mingw.bat b/app/lzo/B/win32/mingw.bat
index 1a747bbd..3bba6e07 100644
--- a/app/lzo/B/win32/mingw.bat
+++ b/app/lzo/B/win32/mingw.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // MinGW + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=lib%BNAME%.a
-set CC=gcc
-set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
-set LF=%BLIB% -lwinmm -s
-
-%CC% %CF% -c src/*.c
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% *.o
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // MinGW + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/mwerks.bat b/app/lzo/B/win32/mwerks.bat
index 99395cc0..3cc27428 100644
--- a/app/lzo/B/win32/mwerks.bat
+++ b/app/lzo/B/win32/mwerks.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Metrowerks CodeWarrior C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=mwcc -gccinc
-set CF=-opt full %CFI% %CFASM%
-set LF=%BLIB% -lwinmm.lib
-
-%CC% -w on %CF% -w nounusedexpr -c @b\src.rsp
-@if errorlevel 1 goto error
-mwld -library -o %BLIB% @b\win32\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Metrowerks CodeWarrior C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=mwcc -gccinc
+set CF=-opt full %CFI% %CFASM%
+set LF=%BLIB% -lwinmm.lib
+
+%CC% -w on %CF% -w nounusedexpr -c @b\src.rsp
+@if errorlevel 1 goto error
+mwld -library -o %BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/pellesc.bat b/app/lzo/B/win32/pellesc.bat
index 4c9569f1..5e92ab94 100644
--- a/app/lzo/B/win32/pellesc.bat
+++ b/app/lzo/B/win32/pellesc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Pelles C
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cc -Ze -Go
-set CF=-O2 -W2 %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-polib -out:%BLIB% @b\win32\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Pelles C
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cc -Ze -Go
+set CF=-O2 -W2 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+polib -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/pgi.bat b/app/lzo/B/win32/pgi.bat
index 73be86ed..079a7142 100644
--- a/app/lzo/B/win32/pgi.bat
+++ b/app/lzo/B/win32/pgi.bat
@@ -1,43 +1,43 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Portland Group PGI C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=lib%BNAME%.a
-set CC=pgcc
-set CF=-fast %CFI% %CFASM%
-set LF=%BLIB% -lwinmm
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-ar rcs %BLIB% *.o asm/i386/obj/win32/*.obj
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Portland Group PGI C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=pgcc
+set CF=-fast %CFI% %CFASM%
+set LF=%BLIB% -lwinmm
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o asm/i386/obj/win32/*.obj
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/pw32.bat b/app/lzo/B/win32/pw32.bat
index b863dd0a..a156242f 100644
--- a/app/lzo/B/win32/pw32.bat
+++ b/app/lzo/B/win32/pw32.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // PW32 + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=lib%BNAME%.a
-set CC=gcc
-set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
-set LF=%BLIB% -lwinmm -s
-
-%CC% %CF% -c src/*.c
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% *.o
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // PW32 + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/rsxnt.bat b/app/lzo/B/win32/rsxnt.bat
index 8f7b5795..1b9d87e6 100644
--- a/app/lzo/B/win32/rsxnt.bat
+++ b/app/lzo/B/win32/rsxnt.bat
@@ -1,45 +1,45 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // rsxnt + gcc
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set BLIB=%BNAME%.a
-set CC=gcc -Zwin32 -Zsys -mprobe
-set CF=@b/dos32/dj2.opt %CFI% %CFASM%
-set LF=%BLIB% -s
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
-@if errorlevel 1 goto error
-ar rcs %BLIB% @b/win32/cygwin.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -o dict.exe examples/dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp.exe examples/precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -o simple.exe examples/simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // rsxnt + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc -Zwin32 -Zsys -mprobe
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/sc.bat b/app/lzo/B/win32/sc.bat
index 83a4e565..38edbc7f 100644
--- a/app/lzo/B/win32/sc.bat
+++ b/app/lzo/B/win32/sc.bat
@@ -1,56 +1,56 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Symantec C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=sc -mn
-set CF=-o -w- %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% -c examples\dict.c
-@if errorlevel 1 goto error
-%CC% dict.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\lzopack.c
-@if errorlevel 1 goto error
-%CC% lzopack.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp.c
-@if errorlevel 1 goto error
-%CC% precomp.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\precomp2.c
-@if errorlevel 1 goto error
-%CC% precomp2.obj %LF%
-@if errorlevel 1 goto error
-%CC% %CF% -c examples\simple.c
-@if errorlevel 1 goto error
-%CC% simple.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -c lzotest\lzotest.c
-@if errorlevel 1 goto error
-%CC% lzotest.obj %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-%CC% testmini.obj minilzo.obj
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Symantec C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -mn
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+%CC% testmini.obj minilzo.obj
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/vc.bat b/app/lzo/B/win32/vc.bat
index 5a8a394b..db278b58 100644
--- a/app/lzo/B/win32/vc.bat
+++ b/app/lzo/B/win32/vc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Microsoft Visual C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -MD
-set CF=-O2 -GF -W3 %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/vc.rsp b/app/lzo/B/win32/vc.rsp
index 6c5ca7ea..1cf09fe2 100644
--- a/app/lzo/B/win32/vc.rsp
+++ b/app/lzo/B/win32/vc.rsp
@@ -1,79 +1,73 @@
-.\lzo1.obj
-.\lzo1_99.obj
-.\lzo1a.obj
-.\lzo1a_99.obj
-.\lzo1b_1.obj
-.\lzo1b_2.obj
-.\lzo1b_3.obj
-.\lzo1b_4.obj
-.\lzo1b_5.obj
-.\lzo1b_6.obj
-.\lzo1b_7.obj
-.\lzo1b_8.obj
-.\lzo1b_9.obj
-.\lzo1b_99.obj
-.\lzo1b_9x.obj
-.\lzo1b_cc.obj
-.\lzo1b_d1.obj
-.\lzo1b_d2.obj
-.\lzo1b_rr.obj
-.\lzo1b_xx.obj
-.\lzo1c_1.obj
-.\lzo1c_2.obj
-.\lzo1c_3.obj
-.\lzo1c_4.obj
-.\lzo1c_5.obj
-.\lzo1c_6.obj
-.\lzo1c_7.obj
-.\lzo1c_8.obj
-.\lzo1c_9.obj
-.\lzo1c_99.obj
-.\lzo1c_9x.obj
-.\lzo1c_cc.obj
-.\lzo1c_d1.obj
-.\lzo1c_d2.obj
-.\lzo1c_rr.obj
-.\lzo1c_xx.obj
-.\lzo1f_1.obj
-.\lzo1f_9x.obj
-.\lzo1f_d1.obj
-.\lzo1f_d2.obj
-.\lzo1x_1.obj
-.\lzo1x_1k.obj
-.\lzo1x_1l.obj
-.\lzo1x_1o.obj
-.\lzo1x_9x.obj
-.\lzo1x_d1.obj
-.\lzo1x_d2.obj
-.\lzo1x_d3.obj
-.\lzo1x_o.obj
-.\lzo1y_1.obj
-.\lzo1y_9x.obj
-.\lzo1y_d1.obj
-.\lzo1y_d2.obj
-.\lzo1y_d3.obj
-.\lzo1y_o.obj
-.\lzo1z_9x.obj
-.\lzo1z_d1.obj
-.\lzo1z_d2.obj
-.\lzo1z_d3.obj
-.\lzo2a_9x.obj
-.\lzo2a_d1.obj
-.\lzo2a_d2.obj
-.\lzo_crc.obj
-.\lzo_init.obj
-.\lzo_ptr.obj
-.\lzo_str.obj
-.\lzo_util.obj
-.\asm\i386\obj\win32\lzo1c_s1.obj
-.\asm\i386\obj\win32\lzo1c_s2.obj
-.\asm\i386\obj\win32\lzo1f_f1.obj
-.\asm\i386\obj\win32\lzo1f_f2.obj
-.\asm\i386\obj\win32\lzo1x_f1.obj
-.\asm\i386\obj\win32\lzo1x_f2.obj
-.\asm\i386\obj\win32\lzo1x_s1.obj
-.\asm\i386\obj\win32\lzo1x_s2.obj
-.\asm\i386\obj\win32\lzo1y_f1.obj
-.\asm\i386\obj\win32\lzo1y_f2.obj
-.\asm\i386\obj\win32\lzo1y_s1.obj
-.\asm\i386\obj\win32\lzo1y_s2.obj
+.\lzo1.obj
+.\lzo1_99.obj
+.\lzo1a.obj
+.\lzo1a_99.obj
+.\lzo1b_1.obj
+.\lzo1b_2.obj
+.\lzo1b_3.obj
+.\lzo1b_4.obj
+.\lzo1b_5.obj
+.\lzo1b_6.obj
+.\lzo1b_7.obj
+.\lzo1b_8.obj
+.\lzo1b_9.obj
+.\lzo1b_99.obj
+.\lzo1b_9x.obj
+.\lzo1b_cc.obj
+.\lzo1b_d1.obj
+.\lzo1b_d2.obj
+.\lzo1b_rr.obj
+.\lzo1b_xx.obj
+.\lzo1c_1.obj
+.\lzo1c_2.obj
+.\lzo1c_3.obj
+.\lzo1c_4.obj
+.\lzo1c_5.obj
+.\lzo1c_6.obj
+.\lzo1c_7.obj
+.\lzo1c_8.obj
+.\lzo1c_9.obj
+.\lzo1c_99.obj
+.\lzo1c_9x.obj
+.\lzo1c_cc.obj
+.\lzo1c_d1.obj
+.\lzo1c_d2.obj
+.\lzo1c_rr.obj
+.\lzo1c_xx.obj
+.\lzo1f_1.obj
+.\lzo1f_9x.obj
+.\lzo1f_d1.obj
+.\lzo1f_d2.obj
+.\lzo1x_1.obj
+.\lzo1x_1k.obj
+.\lzo1x_1l.obj
+.\lzo1x_1o.obj
+.\lzo1x_9x.obj
+.\lzo1x_d1.obj
+.\lzo1x_d2.obj
+.\lzo1x_d3.obj
+.\lzo1x_o.obj
+.\lzo1y_1.obj
+.\lzo1y_9x.obj
+.\lzo1y_d1.obj
+.\lzo1y_d2.obj
+.\lzo1y_d3.obj
+.\lzo1y_o.obj
+.\lzo1z_9x.obj
+.\lzo1z_d1.obj
+.\lzo1z_d2.obj
+.\lzo1z_d3.obj
+.\lzo2a_9x.obj
+.\lzo2a_d1.obj
+.\lzo2a_d2.obj
+.\lzo_crc.obj
+.\lzo_init.obj
+.\lzo_ptr.obj
+.\lzo_str.obj
+.\lzo_util.obj
+.\asm\i386\obj\win32\lzo1c_s1.obj
+.\asm\i386\obj\win32\lzo1f_f1.obj
+.\asm\i386\obj\win32\lzo1x_f1.obj
+.\asm\i386\obj\win32\lzo1x_s1.obj
+.\asm\i386\obj\win32\lzo1y_f1.obj
+.\asm\i386\obj\win32\lzo1y_s1.obj
diff --git a/app/lzo/B/win32/vc_dll.bat b/app/lzo/B/win32/vc_dll.bat
index f6aa14c0..c6ba0863 100644
--- a/app/lzo/B/win32/vc_dll.bat
+++ b/app/lzo/B/win32/vc_dll.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Microsoft Visual C/C++ (DLL)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -MD
-set CF=-O2 -GF -W3 %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -LD -Fe%BDLL% @b\win32\vc.rsp /link /map /def:b\win32\vc_dll.def
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Microsoft Visual C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win32\vc.rsp /link /map /def:b\win32\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/vc_dll.def b/app/lzo/B/win32/vc_dll.def
index cade569c..a5abd35a 100644
--- a/app/lzo/B/win32/vc_dll.def
+++ b/app/lzo/B/win32/vc_dll.def
@@ -1,13 +1,7 @@
-EXPORTS
- _lzo1c_decompress_asm=lzo1c_decompress_asm
- _lzo1c_decompress_asm_safe=lzo1c_decompress_asm_safe
- _lzo1f_decompress_asm_fast=lzo1f_decompress_asm_fast
- _lzo1f_decompress_asm_fast_safe=lzo1f_decompress_asm_fast_safe
- _lzo1x_decompress_asm=lzo1x_decompress_asm
- _lzo1x_decompress_asm_fast=lzo1x_decompress_asm_fast
- _lzo1x_decompress_asm_fast_safe=lzo1x_decompress_asm_fast_safe
- _lzo1x_decompress_asm_safe=lzo1x_decompress_asm_safe
- _lzo1y_decompress_asm=lzo1y_decompress_asm
- _lzo1y_decompress_asm_fast=lzo1y_decompress_asm_fast
- _lzo1y_decompress_asm_fast_safe=lzo1y_decompress_asm_fast_safe
- _lzo1y_decompress_asm_safe=lzo1y_decompress_asm_safe
+EXPORTS
+ _lzo1c_decompress_asm=lzo1c_decompress_asm
+ _lzo1f_decompress_asm_fast=lzo1f_decompress_asm_fast
+ _lzo1x_decompress_asm=lzo1x_decompress_asm
+ _lzo1x_decompress_asm_fast=lzo1x_decompress_asm_fast
+ _lzo1y_decompress_asm=lzo1y_decompress_asm
+ _lzo1y_decompress_asm_fast=lzo1y_decompress_asm_fast
diff --git a/app/lzo/B/win32/wc.bat b/app/lzo/B/win32/wc.bat
index ffdbe636..ab9f5f44 100644
--- a/app/lzo/B/win32/wc.bat
+++ b/app/lzo/B/win32/wc.bat
@@ -1,39 +1,39 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 32-bit
-@echo // Watcom C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=wcl386 -zq -mf -5r -bt#nt -l#nt
-set CF=-ox -zc %CFI% %CFASM%
-set LF=%BLIB%
-
-%CC% %CF% -c src\*.c
-@if errorlevel 1 goto error
-wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#nt -l#nt
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win32/wc.rsp b/app/lzo/B/win32/wc.rsp
index 5bf8b8c1..12760d98 100644
--- a/app/lzo/B/win32/wc.rsp
+++ b/app/lzo/B/win32/wc.rsp
@@ -1,79 +1,73 @@
-+'lzo1.obj'
-+'lzo1_99.obj'
-+'lzo1a.obj'
-+'lzo1a_99.obj'
-+'lzo1b_1.obj'
-+'lzo1b_2.obj'
-+'lzo1b_3.obj'
-+'lzo1b_4.obj'
-+'lzo1b_5.obj'
-+'lzo1b_6.obj'
-+'lzo1b_7.obj'
-+'lzo1b_8.obj'
-+'lzo1b_9.obj'
-+'lzo1b_99.obj'
-+'lzo1b_9x.obj'
-+'lzo1b_cc.obj'
-+'lzo1b_d1.obj'
-+'lzo1b_d2.obj'
-+'lzo1b_rr.obj'
-+'lzo1b_xx.obj'
-+'lzo1c_1.obj'
-+'lzo1c_2.obj'
-+'lzo1c_3.obj'
-+'lzo1c_4.obj'
-+'lzo1c_5.obj'
-+'lzo1c_6.obj'
-+'lzo1c_7.obj'
-+'lzo1c_8.obj'
-+'lzo1c_9.obj'
-+'lzo1c_99.obj'
-+'lzo1c_9x.obj'
-+'lzo1c_cc.obj'
-+'lzo1c_d1.obj'
-+'lzo1c_d2.obj'
-+'lzo1c_rr.obj'
-+'lzo1c_xx.obj'
-+'lzo1f_1.obj'
-+'lzo1f_9x.obj'
-+'lzo1f_d1.obj'
-+'lzo1f_d2.obj'
-+'lzo1x_1.obj'
-+'lzo1x_1k.obj'
-+'lzo1x_1l.obj'
-+'lzo1x_1o.obj'
-+'lzo1x_9x.obj'
-+'lzo1x_d1.obj'
-+'lzo1x_d2.obj'
-+'lzo1x_d3.obj'
-+'lzo1x_o.obj'
-+'lzo1y_1.obj'
-+'lzo1y_9x.obj'
-+'lzo1y_d1.obj'
-+'lzo1y_d2.obj'
-+'lzo1y_d3.obj'
-+'lzo1y_o.obj'
-+'lzo1z_9x.obj'
-+'lzo1z_d1.obj'
-+'lzo1z_d2.obj'
-+'lzo1z_d3.obj'
-+'lzo2a_9x.obj'
-+'lzo2a_d1.obj'
-+'lzo2a_d2.obj'
-+'lzo_crc.obj'
-+'lzo_init.obj'
-+'lzo_ptr.obj'
-+'lzo_str.obj'
-+'lzo_util.obj'
-+'asm\i386\obj\omf32\lzo1c_s1.obj'
-+'asm\i386\obj\omf32\lzo1c_s2.obj'
-+'asm\i386\obj\omf32\lzo1f_f1.obj'
-+'asm\i386\obj\omf32\lzo1f_f2.obj'
-+'asm\i386\obj\omf32\lzo1x_f1.obj'
-+'asm\i386\obj\omf32\lzo1x_f2.obj'
-+'asm\i386\obj\omf32\lzo1x_s1.obj'
-+'asm\i386\obj\omf32\lzo1x_s2.obj'
-+'asm\i386\obj\omf32\lzo1y_f1.obj'
-+'asm\i386\obj\omf32\lzo1y_f2.obj'
-+'asm\i386\obj\omf32\lzo1y_s1.obj'
-+'asm\i386\obj\omf32\lzo1y_s2.obj'
++'lzo1.obj'
++'lzo1_99.obj'
++'lzo1a.obj'
++'lzo1a_99.obj'
++'lzo1b_1.obj'
++'lzo1b_2.obj'
++'lzo1b_3.obj'
++'lzo1b_4.obj'
++'lzo1b_5.obj'
++'lzo1b_6.obj'
++'lzo1b_7.obj'
++'lzo1b_8.obj'
++'lzo1b_9.obj'
++'lzo1b_99.obj'
++'lzo1b_9x.obj'
++'lzo1b_cc.obj'
++'lzo1b_d1.obj'
++'lzo1b_d2.obj'
++'lzo1b_rr.obj'
++'lzo1b_xx.obj'
++'lzo1c_1.obj'
++'lzo1c_2.obj'
++'lzo1c_3.obj'
++'lzo1c_4.obj'
++'lzo1c_5.obj'
++'lzo1c_6.obj'
++'lzo1c_7.obj'
++'lzo1c_8.obj'
++'lzo1c_9.obj'
++'lzo1c_99.obj'
++'lzo1c_9x.obj'
++'lzo1c_cc.obj'
++'lzo1c_d1.obj'
++'lzo1c_d2.obj'
++'lzo1c_rr.obj'
++'lzo1c_xx.obj'
++'lzo1f_1.obj'
++'lzo1f_9x.obj'
++'lzo1f_d1.obj'
++'lzo1f_d2.obj'
++'lzo1x_1.obj'
++'lzo1x_1k.obj'
++'lzo1x_1l.obj'
++'lzo1x_1o.obj'
++'lzo1x_9x.obj'
++'lzo1x_d1.obj'
++'lzo1x_d2.obj'
++'lzo1x_d3.obj'
++'lzo1x_o.obj'
++'lzo1y_1.obj'
++'lzo1y_9x.obj'
++'lzo1y_d1.obj'
++'lzo1y_d2.obj'
++'lzo1y_d3.obj'
++'lzo1y_o.obj'
++'lzo1z_9x.obj'
++'lzo1z_d1.obj'
++'lzo1z_d2.obj'
++'lzo1z_d3.obj'
++'lzo2a_9x.obj'
++'lzo2a_d1.obj'
++'lzo2a_d2.obj'
++'lzo_crc.obj'
++'lzo_init.obj'
++'lzo_ptr.obj'
++'lzo_str.obj'
++'lzo_util.obj'
++'asm\i386\obj\omf32\lzo1c_s1.obj'
++'asm\i386\obj\omf32\lzo1f_f1.obj'
++'asm\i386\obj\omf32\lzo1x_f1.obj'
++'asm\i386\obj\omf32\lzo1x_s1.obj'
++'asm\i386\obj\omf32\lzo1y_f1.obj'
++'asm\i386\obj\omf32\lzo1y_s1.obj'
diff --git a/app/lzo/B/win64/ic.bat b/app/lzo/B/win64/ic.bat
index c5d367a9..cdc9762f 100644
--- a/app/lzo/B/win64/ic.bat
+++ b/app/lzo/B/win64/ic.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 64-bit (Itanium)
-@echo // Intel C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=icl -nologo -MD
-set CF=-O2 -GF -W3 %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (Itanium)
+@echo // Intel C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 -Qvec-report0 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win64/ic_dll.bat b/app/lzo/B/win64/ic_dll.bat
index 6e5b7df7..ec806084 100644
--- a/app/lzo/B/win64/ic_dll.bat
+++ b/app/lzo/B/win64/ic_dll.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 64-bit (Itanium)
-@echo // Intel C/C++ (DLL)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=icl -nologo -MD
-set CF=-O2 -GF -W3 %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (Itanium)
+@echo // Intel C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win64/vc.bat b/app/lzo/B/win64/vc.bat
index 67245460..03694ca9 100644
--- a/app/lzo/B/win64/vc.bat
+++ b/app/lzo/B/win64/vc.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 64-bit (AMD64 or Itanium)
-@echo // Microsoft Visual C/C++
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -MD
-set CF=-O2 -GF -W3 -Wp64 %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -c @b\src.rsp
-@if errorlevel 1 goto error
-link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (AMD64 or Itanium)
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win64/vc.rsp b/app/lzo/B/win64/vc.rsp
index 182de60c..da684c94 100644
--- a/app/lzo/B/win64/vc.rsp
+++ b/app/lzo/B/win64/vc.rsp
@@ -1,67 +1,67 @@
-.\lzo1.obj
-.\lzo1_99.obj
-.\lzo1a.obj
-.\lzo1a_99.obj
-.\lzo1b_1.obj
-.\lzo1b_2.obj
-.\lzo1b_3.obj
-.\lzo1b_4.obj
-.\lzo1b_5.obj
-.\lzo1b_6.obj
-.\lzo1b_7.obj
-.\lzo1b_8.obj
-.\lzo1b_9.obj
-.\lzo1b_99.obj
-.\lzo1b_9x.obj
-.\lzo1b_cc.obj
-.\lzo1b_d1.obj
-.\lzo1b_d2.obj
-.\lzo1b_rr.obj
-.\lzo1b_xx.obj
-.\lzo1c_1.obj
-.\lzo1c_2.obj
-.\lzo1c_3.obj
-.\lzo1c_4.obj
-.\lzo1c_5.obj
-.\lzo1c_6.obj
-.\lzo1c_7.obj
-.\lzo1c_8.obj
-.\lzo1c_9.obj
-.\lzo1c_99.obj
-.\lzo1c_9x.obj
-.\lzo1c_cc.obj
-.\lzo1c_d1.obj
-.\lzo1c_d2.obj
-.\lzo1c_rr.obj
-.\lzo1c_xx.obj
-.\lzo1f_1.obj
-.\lzo1f_9x.obj
-.\lzo1f_d1.obj
-.\lzo1f_d2.obj
-.\lzo1x_1.obj
-.\lzo1x_1k.obj
-.\lzo1x_1l.obj
-.\lzo1x_1o.obj
-.\lzo1x_9x.obj
-.\lzo1x_d1.obj
-.\lzo1x_d2.obj
-.\lzo1x_d3.obj
-.\lzo1x_o.obj
-.\lzo1y_1.obj
-.\lzo1y_9x.obj
-.\lzo1y_d1.obj
-.\lzo1y_d2.obj
-.\lzo1y_d3.obj
-.\lzo1y_o.obj
-.\lzo1z_9x.obj
-.\lzo1z_d1.obj
-.\lzo1z_d2.obj
-.\lzo1z_d3.obj
-.\lzo2a_9x.obj
-.\lzo2a_d1.obj
-.\lzo2a_d2.obj
-.\lzo_crc.obj
-.\lzo_init.obj
-.\lzo_ptr.obj
-.\lzo_str.obj
-.\lzo_util.obj
+.\lzo1.obj
+.\lzo1_99.obj
+.\lzo1a.obj
+.\lzo1a_99.obj
+.\lzo1b_1.obj
+.\lzo1b_2.obj
+.\lzo1b_3.obj
+.\lzo1b_4.obj
+.\lzo1b_5.obj
+.\lzo1b_6.obj
+.\lzo1b_7.obj
+.\lzo1b_8.obj
+.\lzo1b_9.obj
+.\lzo1b_99.obj
+.\lzo1b_9x.obj
+.\lzo1b_cc.obj
+.\lzo1b_d1.obj
+.\lzo1b_d2.obj
+.\lzo1b_rr.obj
+.\lzo1b_xx.obj
+.\lzo1c_1.obj
+.\lzo1c_2.obj
+.\lzo1c_3.obj
+.\lzo1c_4.obj
+.\lzo1c_5.obj
+.\lzo1c_6.obj
+.\lzo1c_7.obj
+.\lzo1c_8.obj
+.\lzo1c_9.obj
+.\lzo1c_99.obj
+.\lzo1c_9x.obj
+.\lzo1c_cc.obj
+.\lzo1c_d1.obj
+.\lzo1c_d2.obj
+.\lzo1c_rr.obj
+.\lzo1c_xx.obj
+.\lzo1f_1.obj
+.\lzo1f_9x.obj
+.\lzo1f_d1.obj
+.\lzo1f_d2.obj
+.\lzo1x_1.obj
+.\lzo1x_1k.obj
+.\lzo1x_1l.obj
+.\lzo1x_1o.obj
+.\lzo1x_9x.obj
+.\lzo1x_d1.obj
+.\lzo1x_d2.obj
+.\lzo1x_d3.obj
+.\lzo1x_o.obj
+.\lzo1y_1.obj
+.\lzo1y_9x.obj
+.\lzo1y_d1.obj
+.\lzo1y_d2.obj
+.\lzo1y_d3.obj
+.\lzo1y_o.obj
+.\lzo1z_9x.obj
+.\lzo1z_d1.obj
+.\lzo1z_d2.obj
+.\lzo1z_d3.obj
+.\lzo2a_9x.obj
+.\lzo2a_d1.obj
+.\lzo2a_d2.obj
+.\lzo_crc.obj
+.\lzo_init.obj
+.\lzo_ptr.obj
+.\lzo_str.obj
+.\lzo_util.obj
diff --git a/app/lzo/B/win64/vc_dll.bat b/app/lzo/B/win64/vc_dll.bat
index 73bf6d3f..f21361a7 100644
--- a/app/lzo/B/win64/vc_dll.bat
+++ b/app/lzo/B/win64/vc_dll.bat
@@ -1,42 +1,42 @@
-@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
-@echo //
-@echo // Windows 64-bit (AMD64 or Itanium)
-@echo // Microsoft Visual C/C++ (DLL)
-@echo //
-@call b\prepare.bat
-@if "%BECHO%"=="n" echo off
-
-
-set CC=cl -nologo -MD
-set CF=-O2 -GF -W3 -Wp64 %CFI%
-set LF=%BLIB%
-
-%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
-@if errorlevel 1 goto error
-%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
-@if errorlevel 1 goto error
-
-%CC% %CF% examples\dict.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\lzopack.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\precomp2.c %LF%
-@if errorlevel 1 goto error
-%CC% %CF% examples\simple.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% lzotest\lzotest.c %LF%
-@if errorlevel 1 goto error
-
-%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
-@if errorlevel 1 goto error
-
-
-@call b\done.bat
-@goto end
-:error
-@echo ERROR during build!
-:end
-@call b\unset.bat
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (AMD64 or Itanium)
+@echo // Microsoft Visual C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/app/lzo/B/win64/vc_dll.def b/app/lzo/B/win64/vc_dll.def
index e80a637a..aabd2247 100644
--- a/app/lzo/B/win64/vc_dll.def
+++ b/app/lzo/B/win64/vc_dll.def
@@ -1 +1 @@
-EXPORTS
+EXPORTS
diff --git a/app/lzo/Makefile.am b/app/lzo/Makefile.am
index 4b728046..246dc603 100644
--- a/app/lzo/Makefile.am
+++ b/app/lzo/Makefile.am
@@ -4,12 +4,12 @@
#
# This file is part of the LZO data compression library.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
# All Rights Reserved.
#
EXTRA_DIST =
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
LDADD = src/liblzo2.la
lib_LTLIBRARIES =
noinst_PROGRAMS =
@@ -72,7 +72,7 @@ pkginclude_HEADERS = \
lib_LTLIBRARIES += src/liblzo2.la
-src_liblzo2_la_LDFLAGS = -version-info 2:0:0 $(AM_LDFLAGS)
+src_liblzo2_la_LDFLAGS = -version-info 2:0:0 -no-undefined $(AM_LDFLAGS)
src_liblzo2_la_SOURCES = \
src/lzo1.c src/lzo1_99.c src/lzo1a.c src/lzo1a_99.c src/lzo1b_1.c \
@@ -101,23 +101,23 @@ EXTRA_DIST += \
src/lzo1b_de.h src/lzo1b_r.ch src/lzo1b_sm.ch src/lzo1b_tm.ch \
src/lzo1c_cc.h src/lzo1f_d.ch src/lzo1x_c.ch src/lzo1x_d.ch \
src/lzo1x_oo.ch src/lzo2a_d.ch src/lzo_conf.h src/lzo_dict.h \
- src/lzo_dll.ch src/lzo_func.ch src/lzo_mchw.ch src/lzo_ptr.h src/lzo_swd.ch \
- src/miniacc.h src/stats1a.h src/stats1b.h src/stats1c.h
+ src/lzo_dll.ch src/lzo_func.h src/lzo_mchw.ch src/lzo_ptr.h \
+ src/lzo_supp.h src/lzo_swd.ch src/stats1a.h src/stats1b.h src/stats1c.h
LZO_ASM_SOURCES_i386_src_gas = \
- asm/i386/src_gas/lzo1c_s1.S asm/i386/src_gas/lzo1c_s2.S \
- asm/i386/src_gas/lzo1f_f1.S asm/i386/src_gas/lzo1f_f2.S \
- asm/i386/src_gas/lzo1x_f1.S asm/i386/src_gas/lzo1x_f2.S \
- asm/i386/src_gas/lzo1x_s1.S asm/i386/src_gas/lzo1x_s2.S \
- asm/i386/src_gas/lzo1y_f1.S asm/i386/src_gas/lzo1y_f2.S \
- asm/i386/src_gas/lzo1y_s1.S asm/i386/src_gas/lzo1y_s2.S
+ asm/i386/src_gas/lzo1c_s1.S \
+ asm/i386/src_gas/lzo1f_f1.S \
+ asm/i386/src_gas/lzo1x_f1.S \
+ asm/i386/src_gas/lzo1x_s1.S \
+ asm/i386/src_gas/lzo1y_f1.S \
+ asm/i386/src_gas/lzo1y_s1.S
LZO_ASM_OBJECTS_i386_obj_elf32 = \
- asm/i386/obj/elf32/lzo1c_s1.o asm/i386/obj/elf32/lzo1c_s2.o \
- asm/i386/obj/elf32/lzo1f_f1.o asm/i386/obj/elf32/lzo1f_f2.o \
- asm/i386/obj/elf32/lzo1x_f1.o asm/i386/obj/elf32/lzo1x_f2.o \
- asm/i386/obj/elf32/lzo1x_s1.o asm/i386/obj/elf32/lzo1x_s2.o \
- asm/i386/obj/elf32/lzo1y_f1.o asm/i386/obj/elf32/lzo1y_f2.o \
- asm/i386/obj/elf32/lzo1y_s1.o asm/i386/obj/elf32/lzo1y_s2.o
+ asm/i386/obj/elf32/lzo1c_s1.o \
+ asm/i386/obj/elf32/lzo1f_f1.o \
+ asm/i386/obj/elf32/lzo1x_f1.o \
+ asm/i386/obj/elf32/lzo1x_s1.o \
+ asm/i386/obj/elf32/lzo1y_f1.o \
+ asm/i386/obj/elf32/lzo1y_s1.o
if LZO_USE_ASM_i386_src_gas
LZO_ASM_SOURCES = $(LZO_ASM_SOURCES_i386_src_gas)
endif
@@ -186,9 +186,9 @@ noinst_PROGRAMS += minilzo/testmini
minilzo_testmini_SOURCES = minilzo/testmini.c minilzo/minilzo.c
minilzo_testmini_SHORTNAME = t
-minilzo_testmini_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H=1
+minilzo_testmini_CPPFLAGS = $(AM_CPPFLAGS)
+minilzo_testmini_CPPFLAGS += -DMINILZO_HAVE_CONFIG_H=1
minilzo_testmini_CPPFLAGS += -I$(top_srcdir)/include/lzo
-minilzo_testmini_CPPFLAGS += $(AM_CPPFLAGS)
minilzo_testmini_LDADD =
EXTRA_DIST += minilzo/Makefile.minilzo minilzo/README.LZO minilzo/minilzo.h
diff --git a/app/lzo/Makefile.in b/app/lzo/Makefile.in
index b0395ea8..6b77e152 100644
--- a/app/lzo/Makefile.in
+++ b/app/lzo/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 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.
@@ -20,7 +19,7 @@
#
# This file is part of the LZO data compression library.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
# All Rights Reserved.
#
@@ -28,6 +27,51 @@
VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -54,14 +98,21 @@ noinst_PROGRAMS = examples/dict$(EXEEXT) examples/lzopack$(EXEEXT) \
tests/chksum$(EXEEXT) tests/promote$(EXEEXT) \
tests/sizes$(EXEEXT) minilzo/testmini$(EXEEXT)
subdir = .
-DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.hin $(top_srcdir)/configure AUTHORS COPYING \
- ChangeLog INSTALL NEWS THANKS autoconf/compile \
- autoconf/config.guess autoconf/config.rpath \
- autoconf/config.sub autoconf/depcomp autoconf/install-sh \
- autoconf/ltmain.sh autoconf/mdate-sh autoconf/missing \
- autoconf/mkinstalldirs autoconf/py-compile autoconf/ylwrap
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.hin $(top_srcdir)/autoconf/mkinstalldirs \
+ $(top_srcdir)/autoconf/depcomp $(pkginclude_HEADERS) COPYING \
+ THANKS autoconf/compile autoconf/config.guess \
+ autoconf/config.rpath autoconf/config.sub autoconf/depcomp \
+ autoconf/install-sh autoconf/mdate-sh autoconf/missing \
+ autoconf/mkinstalldirs autoconf/py-compile autoconf/ylwrap \
+ autoconf/ltmain.sh $(top_srcdir)/autoconf/compile \
+ $(top_srcdir)/autoconf/config.guess \
+ $(top_srcdir)/autoconf/config.sub \
+ $(top_srcdir)/autoconf/install-sh \
+ $(top_srcdir)/autoconf/ltmain.sh \
+ $(top_srcdir)/autoconf/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/autoconf/local.m4 \
$(top_srcdir)/configure.ac
@@ -94,6 +145,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
"$(DESTDIR)$(pkgincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
@@ -119,19 +176,17 @@ am_src_liblzo2_la_OBJECTS = src/lzo1.lo src/lzo1_99.lo src/lzo1a.lo \
src/lzo2a_d2.lo src/lzo_crc.lo src/lzo_init.lo src/lzo_ptr.lo \
src/lzo_str.lo src/lzo_util.lo
am__objects_1 = asm/i386/src_gas/lzo1c_s1.lo \
- asm/i386/src_gas/lzo1c_s2.lo asm/i386/src_gas/lzo1f_f1.lo \
- asm/i386/src_gas/lzo1f_f2.lo asm/i386/src_gas/lzo1x_f1.lo \
- asm/i386/src_gas/lzo1x_f2.lo asm/i386/src_gas/lzo1x_s1.lo \
- asm/i386/src_gas/lzo1x_s2.lo asm/i386/src_gas/lzo1y_f1.lo \
- asm/i386/src_gas/lzo1y_f2.lo asm/i386/src_gas/lzo1y_s1.lo \
- asm/i386/src_gas/lzo1y_s2.lo
+ asm/i386/src_gas/lzo1f_f1.lo asm/i386/src_gas/lzo1x_f1.lo \
+ asm/i386/src_gas/lzo1x_s1.lo asm/i386/src_gas/lzo1y_f1.lo \
+ asm/i386/src_gas/lzo1y_s1.lo
@LZO_USE_ASM_i386_src_gas_TRUE@am__objects_2 = $(am__objects_1)
nodist_src_liblzo2_la_OBJECTS = $(am__objects_2)
src_liblzo2_la_OBJECTS = $(am_src_liblzo2_la_OBJECTS) \
$(nodist_src_liblzo2_la_OBJECTS)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am__v_lt_1 =
src_liblzo2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(src_liblzo2_la_LDFLAGS) $(LDFLAGS) -o \
@@ -183,6 +238,18 @@ tests_promote_DEPENDENCIES =
am_tests_sizes_OBJECTS = tests/sizes.$(OBJEXT)
tests_sizes_OBJECTS = $(am_tests_sizes_OBJECTS)
tests_sizes_DEPENDENCIES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
am__depfiles_maybe = depfiles
@@ -193,31 +260,28 @@ LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CCASFLAGS) $(CCASFLAGS)
-AM_V_CPPAS = $(am__v_CPPAS_$(V))
-am__v_CPPAS_ = $(am__v_CPPAS_$(AM_DEFAULT_VERBOSITY))
-am__v_CPPAS_0 = @echo " CPPAS " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
+am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
+am__v_CPPAS_0 = @echo " CPPAS " $@;
+am__v_CPPAS_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo " CC " $@;
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo " GEN " $@;
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = $(src_liblzo2_la_SOURCES) $(nodist_src_liblzo2_la_SOURCES) \
$(examples_dict_SOURCES) $(examples_lzopack_SOURCES) \
$(examples_overlap_SOURCES) $(examples_precomp_SOURCES) \
@@ -232,20 +296,51 @@ DIST_SOURCES = $(src_liblzo2_la_SOURCES) $(examples_dict_SOURCES) \
$(minilzo_testmini_SOURCES) $(tests_align_SOURCES) \
$(tests_chksum_SOURCES) $(tests_promote_SOURCES) \
$(tests_sizes_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DATA = $(doc_DATA)
HEADERS = $(pkginclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.hin
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
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)"; }; }
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -266,6 +361,7 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -290,6 +386,7 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
@@ -315,6 +412,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -375,12 +473,12 @@ EXTRA_DIST = BUGS autoconf/shtool src/compr1b.h src/compr1c.h \
src/lzo1b_r.ch src/lzo1b_sm.ch src/lzo1b_tm.ch src/lzo1c_cc.h \
src/lzo1f_d.ch src/lzo1x_c.ch src/lzo1x_d.ch src/lzo1x_oo.ch \
src/lzo2a_d.ch src/lzo_conf.h src/lzo_dict.h src/lzo_dll.ch \
- src/lzo_func.ch src/lzo_mchw.ch src/lzo_ptr.h src/lzo_swd.ch \
- src/miniacc.h src/stats1a.h src/stats1b.h src/stats1c.h \
+ src/lzo_func.h src/lzo_mchw.ch src/lzo_ptr.h src/lzo_supp.h \
+ src/lzo_swd.ch src/stats1a.h src/stats1b.h src/stats1c.h \
examples/portab.h examples/portab_a.h lzotest/asm.h \
lzotest/db.h lzotest/wrap.h lzotest/wrapmisc.h \
minilzo/Makefile.minilzo minilzo/README.LZO minilzo/minilzo.h
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
LDADD = src/liblzo2.la
lib_LTLIBRARIES = src/liblzo2.la
doc_DATA = AUTHORS COPYING NEWS THANKS doc/LZO.FAQ doc/LZO.TXT doc/LZOAPI.TXT
@@ -391,7 +489,7 @@ pkginclude_HEADERS = \
include/lzo/lzo_asm.h include/lzo/lzoconf.h include/lzo/lzodefs.h \
include/lzo/lzoutil.h
-src_liblzo2_la_LDFLAGS = -version-info 2:0:0 $(AM_LDFLAGS)
+src_liblzo2_la_LDFLAGS = -version-info 2:0:0 -no-undefined $(AM_LDFLAGS)
src_liblzo2_la_SOURCES = \
src/lzo1.c src/lzo1_99.c src/lzo1a.c src/lzo1a_99.c src/lzo1b_1.c \
src/lzo1b_2.c src/lzo1b_3.c src/lzo1b_4.c src/lzo1b_5.c src/lzo1b_6.c \
@@ -411,20 +509,20 @@ src_liblzo2_la_SOURCES = \
src/lzo_str.c src/lzo_util.c
LZO_ASM_SOURCES_i386_src_gas = \
- asm/i386/src_gas/lzo1c_s1.S asm/i386/src_gas/lzo1c_s2.S \
- asm/i386/src_gas/lzo1f_f1.S asm/i386/src_gas/lzo1f_f2.S \
- asm/i386/src_gas/lzo1x_f1.S asm/i386/src_gas/lzo1x_f2.S \
- asm/i386/src_gas/lzo1x_s1.S asm/i386/src_gas/lzo1x_s2.S \
- asm/i386/src_gas/lzo1y_f1.S asm/i386/src_gas/lzo1y_f2.S \
- asm/i386/src_gas/lzo1y_s1.S asm/i386/src_gas/lzo1y_s2.S
+ asm/i386/src_gas/lzo1c_s1.S \
+ asm/i386/src_gas/lzo1f_f1.S \
+ asm/i386/src_gas/lzo1x_f1.S \
+ asm/i386/src_gas/lzo1x_s1.S \
+ asm/i386/src_gas/lzo1y_f1.S \
+ asm/i386/src_gas/lzo1y_s1.S
LZO_ASM_OBJECTS_i386_obj_elf32 = \
- asm/i386/obj/elf32/lzo1c_s1.o asm/i386/obj/elf32/lzo1c_s2.o \
- asm/i386/obj/elf32/lzo1f_f1.o asm/i386/obj/elf32/lzo1f_f2.o \
- asm/i386/obj/elf32/lzo1x_f1.o asm/i386/obj/elf32/lzo1x_f2.o \
- asm/i386/obj/elf32/lzo1x_s1.o asm/i386/obj/elf32/lzo1x_s2.o \
- asm/i386/obj/elf32/lzo1y_f1.o asm/i386/obj/elf32/lzo1y_f2.o \
- asm/i386/obj/elf32/lzo1y_s1.o asm/i386/obj/elf32/lzo1y_s2.o
+ asm/i386/obj/elf32/lzo1c_s1.o \
+ asm/i386/obj/elf32/lzo1f_f1.o \
+ asm/i386/obj/elf32/lzo1x_f1.o \
+ asm/i386/obj/elf32/lzo1x_s1.o \
+ asm/i386/obj/elf32/lzo1y_f1.o \
+ asm/i386/obj/elf32/lzo1y_s1.o
@LZO_USE_ASM_i386_src_gas_TRUE@LZO_ASM_SOURCES = $(LZO_ASM_SOURCES_i386_src_gas)
@LZO_USE_ASM_i386_obj_elf32_TRUE@LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_i386_obj_elf32)
@@ -445,15 +543,15 @@ tests_promote_LDADD =
tests_sizes_LDADD =
minilzo_testmini_SOURCES = minilzo/testmini.c minilzo/minilzo.c
minilzo_testmini_SHORTNAME = t
-minilzo_testmini_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H=1 \
- -I$(top_srcdir)/include/lzo $(AM_CPPFLAGS)
+minilzo_testmini_CPPFLAGS = $(AM_CPPFLAGS) -DMINILZO_HAVE_CONFIG_H=1 \
+ -I$(top_srcdir)/include/lzo
minilzo_testmini_LDADD =
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .obj
-am--refresh:
+am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
@@ -489,10 +587,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
- else :; fi
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
@rm -f stamp-h1
@@ -504,9 +600,9 @@ $(srcdir)/config.hin: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
distclean-hdr:
-rm -f config.h stamp-h1
+
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
@@ -514,6 +610,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
else :; fi; \
done; \
test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
@@ -529,12 +627,14 @@ uninstall-libLTLIBRARIES:
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
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
src/$(am__dirstamp):
@$(MKDIR_P) src
@: > src/$(am__dirstamp)
@@ -616,29 +716,18 @@ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp):
@: > asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1c_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1c_s2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1f_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1f_f2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1x_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1x_f2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1x_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1x_s2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1y_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1y_f2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
asm/i386/src_gas/lzo1y_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-asm/i386/src_gas/lzo1y_s2.lo: asm/i386/src_gas/$(am__dirstamp) \
- asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
-src/liblzo2.la: $(src_liblzo2_la_OBJECTS) $(src_liblzo2_la_DEPENDENCIES) src/$(am__dirstamp)
+
+src/liblzo2.la: $(src_liblzo2_la_OBJECTS) $(src_liblzo2_la_DEPENDENCIES) $(EXTRA_src_liblzo2_la_DEPENDENCIES) src/$(am__dirstamp)
$(AM_V_CCLD)$(src_liblzo2_la_LINK) -rpath $(libdir) $(src_liblzo2_la_OBJECTS) $(src_liblzo2_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
@@ -657,32 +746,38 @@ examples/$(DEPDIR)/$(am__dirstamp):
@: > examples/$(DEPDIR)/$(am__dirstamp)
examples/dict.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/dict$(EXEEXT): $(examples_dict_OBJECTS) $(examples_dict_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/dict$(EXEEXT): $(examples_dict_OBJECTS) $(examples_dict_DEPENDENCIES) $(EXTRA_examples_dict_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/dict$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_dict_OBJECTS) $(examples_dict_LDADD) $(LIBS)
examples/lzopack.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/lzopack$(EXEEXT): $(examples_lzopack_OBJECTS) $(examples_lzopack_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/lzopack$(EXEEXT): $(examples_lzopack_OBJECTS) $(examples_lzopack_DEPENDENCIES) $(EXTRA_examples_lzopack_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/lzopack$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_lzopack_OBJECTS) $(examples_lzopack_LDADD) $(LIBS)
examples/overlap.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/overlap$(EXEEXT): $(examples_overlap_OBJECTS) $(examples_overlap_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/overlap$(EXEEXT): $(examples_overlap_OBJECTS) $(examples_overlap_DEPENDENCIES) $(EXTRA_examples_overlap_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/overlap$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_overlap_OBJECTS) $(examples_overlap_LDADD) $(LIBS)
examples/precomp.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/precomp$(EXEEXT): $(examples_precomp_OBJECTS) $(examples_precomp_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/precomp$(EXEEXT): $(examples_precomp_OBJECTS) $(examples_precomp_DEPENDENCIES) $(EXTRA_examples_precomp_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/precomp$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_precomp_OBJECTS) $(examples_precomp_LDADD) $(LIBS)
examples/precomp2.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/precomp2$(EXEEXT): $(examples_precomp2_OBJECTS) $(examples_precomp2_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/precomp2$(EXEEXT): $(examples_precomp2_OBJECTS) $(examples_precomp2_DEPENDENCIES) $(EXTRA_examples_precomp2_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/precomp2$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_precomp2_OBJECTS) $(examples_precomp2_LDADD) $(LIBS)
examples/simple.$(OBJEXT): examples/$(am__dirstamp) \
examples/$(DEPDIR)/$(am__dirstamp)
-examples/simple$(EXEEXT): $(examples_simple_OBJECTS) $(examples_simple_DEPENDENCIES) examples/$(am__dirstamp)
+
+examples/simple$(EXEEXT): $(examples_simple_OBJECTS) $(examples_simple_DEPENDENCIES) $(EXTRA_examples_simple_DEPENDENCIES) examples/$(am__dirstamp)
@rm -f examples/simple$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(examples_simple_OBJECTS) $(examples_simple_LDADD) $(LIBS)
lzotest/$(am__dirstamp):
@@ -693,7 +788,8 @@ lzotest/$(DEPDIR)/$(am__dirstamp):
@: > lzotest/$(DEPDIR)/$(am__dirstamp)
lzotest/lzotest.$(OBJEXT): lzotest/$(am__dirstamp) \
lzotest/$(DEPDIR)/$(am__dirstamp)
-lzotest/lzotest$(EXEEXT): $(lzotest_lzotest_OBJECTS) $(lzotest_lzotest_DEPENDENCIES) lzotest/$(am__dirstamp)
+
+lzotest/lzotest$(EXEEXT): $(lzotest_lzotest_OBJECTS) $(lzotest_lzotest_DEPENDENCIES) $(EXTRA_lzotest_lzotest_DEPENDENCIES) lzotest/$(am__dirstamp)
@rm -f lzotest/lzotest$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(lzotest_lzotest_OBJECTS) $(lzotest_lzotest_LDADD) $(LIBS)
minilzo/$(am__dirstamp):
@@ -706,7 +802,8 @@ minilzo/t-testmini.$(OBJEXT): minilzo/$(am__dirstamp) \
minilzo/$(DEPDIR)/$(am__dirstamp)
minilzo/t-minilzo.$(OBJEXT): minilzo/$(am__dirstamp) \
minilzo/$(DEPDIR)/$(am__dirstamp)
-minilzo/testmini$(EXEEXT): $(minilzo_testmini_OBJECTS) $(minilzo_testmini_DEPENDENCIES) minilzo/$(am__dirstamp)
+
+minilzo/testmini$(EXEEXT): $(minilzo_testmini_OBJECTS) $(minilzo_testmini_DEPENDENCIES) $(EXTRA_minilzo_testmini_DEPENDENCIES) minilzo/$(am__dirstamp)
@rm -f minilzo/testmini$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(minilzo_testmini_OBJECTS) $(minilzo_testmini_LDADD) $(LIBS)
tests/$(am__dirstamp):
@@ -717,214 +814,49 @@ tests/$(DEPDIR)/$(am__dirstamp):
@: > tests/$(DEPDIR)/$(am__dirstamp)
tests/align.$(OBJEXT): tests/$(am__dirstamp) \
tests/$(DEPDIR)/$(am__dirstamp)
-tests/align$(EXEEXT): $(tests_align_OBJECTS) $(tests_align_DEPENDENCIES) tests/$(am__dirstamp)
+
+tests/align$(EXEEXT): $(tests_align_OBJECTS) $(tests_align_DEPENDENCIES) $(EXTRA_tests_align_DEPENDENCIES) tests/$(am__dirstamp)
@rm -f tests/align$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tests_align_OBJECTS) $(tests_align_LDADD) $(LIBS)
tests/chksum.$(OBJEXT): tests/$(am__dirstamp) \
tests/$(DEPDIR)/$(am__dirstamp)
-tests/chksum$(EXEEXT): $(tests_chksum_OBJECTS) $(tests_chksum_DEPENDENCIES) tests/$(am__dirstamp)
+
+tests/chksum$(EXEEXT): $(tests_chksum_OBJECTS) $(tests_chksum_DEPENDENCIES) $(EXTRA_tests_chksum_DEPENDENCIES) tests/$(am__dirstamp)
@rm -f tests/chksum$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tests_chksum_OBJECTS) $(tests_chksum_LDADD) $(LIBS)
tests/promote.$(OBJEXT): tests/$(am__dirstamp) \
tests/$(DEPDIR)/$(am__dirstamp)
-tests/promote$(EXEEXT): $(tests_promote_OBJECTS) $(tests_promote_DEPENDENCIES) tests/$(am__dirstamp)
+
+tests/promote$(EXEEXT): $(tests_promote_OBJECTS) $(tests_promote_DEPENDENCIES) $(EXTRA_tests_promote_DEPENDENCIES) tests/$(am__dirstamp)
@rm -f tests/promote$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tests_promote_OBJECTS) $(tests_promote_LDADD) $(LIBS)
tests/sizes.$(OBJEXT): tests/$(am__dirstamp) \
tests/$(DEPDIR)/$(am__dirstamp)
-tests/sizes$(EXEEXT): $(tests_sizes_OBJECTS) $(tests_sizes_DEPENDENCIES) tests/$(am__dirstamp)
+
+tests/sizes$(EXEEXT): $(tests_sizes_OBJECTS) $(tests_sizes_DEPENDENCIES) $(EXTRA_tests_sizes_DEPENDENCIES) tests/$(am__dirstamp)
@rm -f tests/sizes$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tests_sizes_OBJECTS) $(tests_sizes_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1c_s1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1c_s1.lo
- -rm -f asm/i386/src_gas/lzo1c_s2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1c_s2.lo
- -rm -f asm/i386/src_gas/lzo1f_f1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1f_f1.lo
- -rm -f asm/i386/src_gas/lzo1f_f2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1f_f2.lo
- -rm -f asm/i386/src_gas/lzo1x_f1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1x_f1.lo
- -rm -f asm/i386/src_gas/lzo1x_f2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1x_f2.lo
- -rm -f asm/i386/src_gas/lzo1x_s1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1x_s1.lo
- -rm -f asm/i386/src_gas/lzo1x_s2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1x_s2.lo
- -rm -f asm/i386/src_gas/lzo1y_f1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1y_f1.lo
- -rm -f asm/i386/src_gas/lzo1y_f2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1y_f2.lo
- -rm -f asm/i386/src_gas/lzo1y_s1.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1y_s1.lo
- -rm -f asm/i386/src_gas/lzo1y_s2.$(OBJEXT)
- -rm -f asm/i386/src_gas/lzo1y_s2.lo
- -rm -f examples/dict.$(OBJEXT)
- -rm -f examples/lzopack.$(OBJEXT)
- -rm -f examples/overlap.$(OBJEXT)
- -rm -f examples/precomp.$(OBJEXT)
- -rm -f examples/precomp2.$(OBJEXT)
- -rm -f examples/simple.$(OBJEXT)
- -rm -f lzotest/lzotest.$(OBJEXT)
- -rm -f minilzo/t-minilzo.$(OBJEXT)
- -rm -f minilzo/t-testmini.$(OBJEXT)
- -rm -f src/lzo1.$(OBJEXT)
- -rm -f src/lzo1.lo
- -rm -f src/lzo1_99.$(OBJEXT)
- -rm -f src/lzo1_99.lo
- -rm -f src/lzo1a.$(OBJEXT)
- -rm -f src/lzo1a.lo
- -rm -f src/lzo1a_99.$(OBJEXT)
- -rm -f src/lzo1a_99.lo
- -rm -f src/lzo1b_1.$(OBJEXT)
- -rm -f src/lzo1b_1.lo
- -rm -f src/lzo1b_2.$(OBJEXT)
- -rm -f src/lzo1b_2.lo
- -rm -f src/lzo1b_3.$(OBJEXT)
- -rm -f src/lzo1b_3.lo
- -rm -f src/lzo1b_4.$(OBJEXT)
- -rm -f src/lzo1b_4.lo
- -rm -f src/lzo1b_5.$(OBJEXT)
- -rm -f src/lzo1b_5.lo
- -rm -f src/lzo1b_6.$(OBJEXT)
- -rm -f src/lzo1b_6.lo
- -rm -f src/lzo1b_7.$(OBJEXT)
- -rm -f src/lzo1b_7.lo
- -rm -f src/lzo1b_8.$(OBJEXT)
- -rm -f src/lzo1b_8.lo
- -rm -f src/lzo1b_9.$(OBJEXT)
- -rm -f src/lzo1b_9.lo
- -rm -f src/lzo1b_99.$(OBJEXT)
- -rm -f src/lzo1b_99.lo
- -rm -f src/lzo1b_9x.$(OBJEXT)
- -rm -f src/lzo1b_9x.lo
- -rm -f src/lzo1b_cc.$(OBJEXT)
- -rm -f src/lzo1b_cc.lo
- -rm -f src/lzo1b_d1.$(OBJEXT)
- -rm -f src/lzo1b_d1.lo
- -rm -f src/lzo1b_d2.$(OBJEXT)
- -rm -f src/lzo1b_d2.lo
- -rm -f src/lzo1b_rr.$(OBJEXT)
- -rm -f src/lzo1b_rr.lo
- -rm -f src/lzo1b_xx.$(OBJEXT)
- -rm -f src/lzo1b_xx.lo
- -rm -f src/lzo1c_1.$(OBJEXT)
- -rm -f src/lzo1c_1.lo
- -rm -f src/lzo1c_2.$(OBJEXT)
- -rm -f src/lzo1c_2.lo
- -rm -f src/lzo1c_3.$(OBJEXT)
- -rm -f src/lzo1c_3.lo
- -rm -f src/lzo1c_4.$(OBJEXT)
- -rm -f src/lzo1c_4.lo
- -rm -f src/lzo1c_5.$(OBJEXT)
- -rm -f src/lzo1c_5.lo
- -rm -f src/lzo1c_6.$(OBJEXT)
- -rm -f src/lzo1c_6.lo
- -rm -f src/lzo1c_7.$(OBJEXT)
- -rm -f src/lzo1c_7.lo
- -rm -f src/lzo1c_8.$(OBJEXT)
- -rm -f src/lzo1c_8.lo
- -rm -f src/lzo1c_9.$(OBJEXT)
- -rm -f src/lzo1c_9.lo
- -rm -f src/lzo1c_99.$(OBJEXT)
- -rm -f src/lzo1c_99.lo
- -rm -f src/lzo1c_9x.$(OBJEXT)
- -rm -f src/lzo1c_9x.lo
- -rm -f src/lzo1c_cc.$(OBJEXT)
- -rm -f src/lzo1c_cc.lo
- -rm -f src/lzo1c_d1.$(OBJEXT)
- -rm -f src/lzo1c_d1.lo
- -rm -f src/lzo1c_d2.$(OBJEXT)
- -rm -f src/lzo1c_d2.lo
- -rm -f src/lzo1c_rr.$(OBJEXT)
- -rm -f src/lzo1c_rr.lo
- -rm -f src/lzo1c_xx.$(OBJEXT)
- -rm -f src/lzo1c_xx.lo
- -rm -f src/lzo1f_1.$(OBJEXT)
- -rm -f src/lzo1f_1.lo
- -rm -f src/lzo1f_9x.$(OBJEXT)
- -rm -f src/lzo1f_9x.lo
- -rm -f src/lzo1f_d1.$(OBJEXT)
- -rm -f src/lzo1f_d1.lo
- -rm -f src/lzo1f_d2.$(OBJEXT)
- -rm -f src/lzo1f_d2.lo
- -rm -f src/lzo1x_1.$(OBJEXT)
- -rm -f src/lzo1x_1.lo
- -rm -f src/lzo1x_1k.$(OBJEXT)
- -rm -f src/lzo1x_1k.lo
- -rm -f src/lzo1x_1l.$(OBJEXT)
- -rm -f src/lzo1x_1l.lo
- -rm -f src/lzo1x_1o.$(OBJEXT)
- -rm -f src/lzo1x_1o.lo
- -rm -f src/lzo1x_9x.$(OBJEXT)
- -rm -f src/lzo1x_9x.lo
- -rm -f src/lzo1x_d1.$(OBJEXT)
- -rm -f src/lzo1x_d1.lo
- -rm -f src/lzo1x_d2.$(OBJEXT)
- -rm -f src/lzo1x_d2.lo
- -rm -f src/lzo1x_d3.$(OBJEXT)
- -rm -f src/lzo1x_d3.lo
- -rm -f src/lzo1x_o.$(OBJEXT)
- -rm -f src/lzo1x_o.lo
- -rm -f src/lzo1y_1.$(OBJEXT)
- -rm -f src/lzo1y_1.lo
- -rm -f src/lzo1y_9x.$(OBJEXT)
- -rm -f src/lzo1y_9x.lo
- -rm -f src/lzo1y_d1.$(OBJEXT)
- -rm -f src/lzo1y_d1.lo
- -rm -f src/lzo1y_d2.$(OBJEXT)
- -rm -f src/lzo1y_d2.lo
- -rm -f src/lzo1y_d3.$(OBJEXT)
- -rm -f src/lzo1y_d3.lo
- -rm -f src/lzo1y_o.$(OBJEXT)
- -rm -f src/lzo1y_o.lo
- -rm -f src/lzo1z_9x.$(OBJEXT)
- -rm -f src/lzo1z_9x.lo
- -rm -f src/lzo1z_d1.$(OBJEXT)
- -rm -f src/lzo1z_d1.lo
- -rm -f src/lzo1z_d2.$(OBJEXT)
- -rm -f src/lzo1z_d2.lo
- -rm -f src/lzo1z_d3.$(OBJEXT)
- -rm -f src/lzo1z_d3.lo
- -rm -f src/lzo2a_9x.$(OBJEXT)
- -rm -f src/lzo2a_9x.lo
- -rm -f src/lzo2a_d1.$(OBJEXT)
- -rm -f src/lzo2a_d1.lo
- -rm -f src/lzo2a_d2.$(OBJEXT)
- -rm -f src/lzo2a_d2.lo
- -rm -f src/lzo_crc.$(OBJEXT)
- -rm -f src/lzo_crc.lo
- -rm -f src/lzo_init.$(OBJEXT)
- -rm -f src/lzo_init.lo
- -rm -f src/lzo_ptr.$(OBJEXT)
- -rm -f src/lzo_ptr.lo
- -rm -f src/lzo_str.$(OBJEXT)
- -rm -f src/lzo_str.lo
- -rm -f src/lzo_util.$(OBJEXT)
- -rm -f src/lzo_util.lo
- -rm -f tests/align.$(OBJEXT)
- -rm -f tests/chksum.$(OBJEXT)
- -rm -f tests/promote.$(OBJEXT)
- -rm -f tests/sizes.$(OBJEXT)
+ -rm -f asm/i386/src_gas/*.$(OBJEXT)
+ -rm -f asm/i386/src_gas/*.lo
+ -rm -f examples/*.$(OBJEXT)
+ -rm -f lzotest/*.$(OBJEXT)
+ -rm -f minilzo/*.$(OBJEXT)
+ -rm -f src/*.$(OBJEXT)
+ -rm -f src/*.lo
+ -rm -f tests/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1c_s1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1c_s2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1f_f1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1f_f2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_f1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_f2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_s1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_s2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_f1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_f2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_s1.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_s2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/dict.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/lzopack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/overlap.Po@am__quote@
@@ -1010,87 +942,77 @@ distclean-compile:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
.S.obj:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.S.lo:
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $<
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
minilzo/t-testmini.o: minilzo/testmini.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-testmini.o -MD -MP -MF minilzo/$(DEPDIR)/t-testmini.Tpo -c -o minilzo/t-testmini.o `test -f 'minilzo/testmini.c' || echo '$(srcdir)/'`minilzo/testmini.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-testmini.Tpo minilzo/$(DEPDIR)/t-testmini.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minilzo/testmini.c' object='minilzo/t-testmini.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/testmini.c' object='minilzo/t-testmini.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.o `test -f 'minilzo/testmini.c' || echo '$(srcdir)/'`minilzo/testmini.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.o `test -f 'minilzo/testmini.c' || echo '$(srcdir)/'`minilzo/testmini.c
minilzo/t-testmini.obj: minilzo/testmini.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-testmini.obj -MD -MP -MF minilzo/$(DEPDIR)/t-testmini.Tpo -c -o minilzo/t-testmini.obj `if test -f 'minilzo/testmini.c'; then $(CYGPATH_W) 'minilzo/testmini.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/testmini.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-testmini.Tpo minilzo/$(DEPDIR)/t-testmini.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minilzo/testmini.c' object='minilzo/t-testmini.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/testmini.c' object='minilzo/t-testmini.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.obj `if test -f 'minilzo/testmini.c'; then $(CYGPATH_W) 'minilzo/testmini.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/testmini.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.obj `if test -f 'minilzo/testmini.c'; then $(CYGPATH_W) 'minilzo/testmini.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/testmini.c'; fi`
minilzo/t-minilzo.o: minilzo/minilzo.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-minilzo.o -MD -MP -MF minilzo/$(DEPDIR)/t-minilzo.Tpo -c -o minilzo/t-minilzo.o `test -f 'minilzo/minilzo.c' || echo '$(srcdir)/'`minilzo/minilzo.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-minilzo.Tpo minilzo/$(DEPDIR)/t-minilzo.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minilzo/minilzo.c' object='minilzo/t-minilzo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/minilzo.c' object='minilzo/t-minilzo.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.o `test -f 'minilzo/minilzo.c' || echo '$(srcdir)/'`minilzo/minilzo.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.o `test -f 'minilzo/minilzo.c' || echo '$(srcdir)/'`minilzo/minilzo.c
minilzo/t-minilzo.obj: minilzo/minilzo.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-minilzo.obj -MD -MP -MF minilzo/$(DEPDIR)/t-minilzo.Tpo -c -o minilzo/t-minilzo.obj `if test -f 'minilzo/minilzo.c'; then $(CYGPATH_W) 'minilzo/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/minilzo.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-minilzo.Tpo minilzo/$(DEPDIR)/t-minilzo.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minilzo/minilzo.c' object='minilzo/t-minilzo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/minilzo.c' object='minilzo/t-minilzo.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.obj `if test -f 'minilzo/minilzo.c'; then $(CYGPATH_W) 'minilzo/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/minilzo.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.obj `if test -f 'minilzo/minilzo.c'; then $(CYGPATH_W) 'minilzo/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/minilzo.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -1108,8 +1030,11 @@ distclean-libtool:
-rm -f libtool config.lt
install-docDATA: $(doc_DATA)
@$(NORMAL_INSTALL)
- test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1123,13 +1048,14 @@ uninstall-docDATA:
@$(NORMAL_UNINSTALL)
@list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(docdir)" && rm -f $$files
+ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1143,30 +1069,17 @@ uninstall-pkgincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -1178,15 +1091,11 @@ TAGS: $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -1195,9 +1104,31 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
@@ -1243,36 +1174,42 @@ distdir: $(DISTFILES)
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
- $(am__remove_distdir)
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_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
@@ -1283,8 +1220,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
@@ -1294,17 +1231,19 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ && ../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1327,13 +1266,21 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
- $(am__remove_distdir)
+ $(am__post_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'
distuninstallcheck:
- @$(am__cd) '$(distuninstallcheck_dir)' \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
@@ -1368,10 +1315,15 @@ install-am: all-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
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -1472,23 +1424,25 @@ uninstall-am: uninstall-docDATA uninstall-libLTLIBRARIES \
.MAKE: all check-am install-am install-strip
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am check-local \
- clean clean-generic clean-libLTLIBRARIES clean-libtool \
- clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \
- dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-tags distcleancheck \
- distdir distuninstallcheck dvi dvi-am html html-am info \
- info-am install install-am install-data install-data-am \
- install-docDATA install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-libLTLIBRARIES install-man install-pdf \
- install-pdf-am install-pkgincludeHEADERS install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-docDATA uninstall-libLTLIBRARIES \
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \
+ check-local clean clean-cscope clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS cscope \
+ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
+ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-docDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-pkgincludeHEADERS install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-docDATA uninstall-libLTLIBRARIES \
uninstall-pkgincludeHEADERS
diff --git a/app/lzo/NEWS b/app/lzo/NEWS
index 15eedeff..103c4d87 100644
--- a/app/lzo/NEWS
+++ b/app/lzo/NEWS
@@ -2,6 +2,22 @@
User visible changes for LZO -- a real-time data compression library
============================================================================
+Changes in 2.07 (25 Jun 2014)
+ * Fixed a potential integer overflow condition in the "safe" decompressor
+ variants which could result in a possible buffer overrun when
+ processing maliciously crafted compressed input data.
+
+ As this issue only affects 32-bit systems and also can only happen if
+ you use uncommonly huge buffer sizes where you have to decompress more
+ than 16 MiB (2^24 bytes) compressed bytes within a single function call,
+ the practical implications are limited.
+
+ POTENTIAL SECURITY ISSUE.
+
+ * Removed support for ancient configurations like 16-bit "huge" pointers -
+ LZO now requires a flat 32-bit or 64-bit memory model.
+ * Assorted cleanups.
+
Changes in 2.06 (12 Aug 2011)
* Some minor optimizations for big-endian architectures.
* Fixed overly strict malloc() misalignment check in examples.
diff --git a/app/lzo/aclocal.m4 b/app/lzo/aclocal.m4
index 4d774da0..b6ae565b 100644
--- a/app/lzo/aclocal.m4
+++ b/app/lzo/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,19 +11,18 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -32,8 +31,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -60,7 +59,7 @@ m4_define([_LT_COPYING], [dnl
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
-# serial 57 LT_INIT
+# serial 58 LT_INIT
# LT_PREREQ(VERSION)
@@ -112,7 +111,7 @@ dnl Parse OPTIONS
_LT_SET_OPTIONS([$0], [$1])
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -151,7 +150,7 @@ cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
# _LT_FILEUTILS_DEFAULTS
# ----------------------
# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
m4_defun([_LT_FILEUTILS_DEFAULTS],
[: ${CP="cp -f"}
: ${MV="mv -f"}
@@ -167,6 +166,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
@@ -189,19 +190,22 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@@ -214,7 +218,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
+ if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -225,14 +229,14 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# 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"
+with_gnu_ld=$lt_cv_prog_gnu_ld
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
# Set sane defaults for various variables
test -z "$CC" && CC=cc
@@ -285,21 +289,21 @@ no_glob_subst='s/\*/\\\*/g'
# _LT_PROG_LTMAIN
# ---------------
-# Note that this code is called both from `configure', and `config.status'
+# 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,
+# '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"
+ltmain=$ac_aux_dir/ltmain.sh
])# _LT_PROG_LTMAIN
# So that we can recreate a full libtool script including additional
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
# label.
@@ -431,8 +435,8 @@ m4_define([_lt_decl_all_varnames],
# _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
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -456,7 +460,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
# 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
+available_tags='_LT_TAGS'dnl
])
@@ -484,7 +488,7 @@ 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'
+# 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],
@@ -510,8 +514,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
# 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
+# 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],
@@ -557,7 +561,7 @@ for var in lt_decl_all_varnames([[ \
]], lt_decl_quote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -570,7 +574,7 @@ for var in lt_decl_all_varnames([[ \
]], lt_decl_dquote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -586,7 +590,7 @@ _LT_OUTPUT_LIBTOOL_INIT
# Generate a child script FILE with all initialization necessary to
# reuse the environment learned by the parent script, and make the
# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
+# '#!' sequence but before initialization text begins. After this
# macro, additional text can be appended to FILE to form the body of
# the child script. The macro ends with non-zero status if the
# file could not be fully written (such as if the disk is full).
@@ -608,7 +612,7 @@ AS_SHELL_SANITIZE
_AS_PREPARE
exec AS_MESSAGE_FD>&1
_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
@@ -631,7 +635,7 @@ exec AS_MESSAGE_LOG_FD>>config.log
} >&AS_MESSAGE_LOG_FD
lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.
@@ -649,11 +653,11 @@ 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) 2010 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
-while test $[#] != 0
+while test 0 != $[#]
do
case $[1] in
--version | --v* | -V )
@@ -666,10 +670,10 @@ do
lt_cl_silent=: ;;
-*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
*) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
esac
shift
done
@@ -695,7 +699,7 @@ chmod +x "$CONFIG_LT"
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
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
@@ -715,13 +719,13 @@ m4_defun([_LT_CONFIG],
_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
+ # See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
+ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
- cfgfile="${ofile}T"
+ cfgfile=${ofile}T
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
@@ -729,7 +733,7 @@ _LT_CONFIG_SAVE_COMMANDS([
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $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.
#
@@ -749,7 +753,7 @@ _LT_EOF
# 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
+if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -763,15 +767,10 @@ _LT_EOF
# 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 '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
@@ -788,7 +787,6 @@ _LT_EOF
[m4_if([$1], [], [
PACKAGE='$PACKAGE'
VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'], [])
])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -816,6 +814,7 @@ AC_DEFUN([LT_LANG],
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
@@ -837,6 +836,29 @@ m4_defun([_LT_LANG],
])# _LT_LANG
+m4_ifndef([AC_PROG_GO], [
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -867,6 +889,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -957,7 +983,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
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
+ 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
@@ -969,7 +995,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
$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
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -977,6 +1009,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
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
@@ -986,8 +1019,9 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[lt_cv_ld_exported_symbols_list=yes],
[lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
])
+
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
[lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
@@ -1005,7 +1039,9 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1015,32 +1051,32 @@ _LT_EOF
])
case $host_os in
rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _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' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ if test yes = "$lt_cv_apple_cc_single_mod"; 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'
+ if test yes = "$lt_cv_ld_exported_symbols_list"; 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}'
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
@@ -1050,8 +1086,8 @@ _LT_EOF
])
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
@@ -1060,27 +1096,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ if test yes = "$lt_cv_ld_force_load"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
- if test "$_lt_dar_can_shared" = "yes"; then
+ if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ _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}"
+[ if test yes != "$lt_cv_apple_cc_single_mod"; 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
@@ -1088,30 +1126,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
fi
])
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
-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
+if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
])# _LT_SYS_MODULE_PATH_AIX
@@ -1127,8 +1176,8 @@ m4_define([_LT_SHELL_INIT],
# -----------------------
# Find how we can fake an echo command that does not interpret backslash.
# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
m4_defun([_LT_PROG_ECHO_BACKSLASH],
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1136,7 +1185,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
AC_MSG_CHECKING([how to print strings])
# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -1159,7 +1208,7 @@ func_echo_all ()
$ECHO "$*"
}
-case "$ECHO" in
+case $ECHO in
printf*) AC_MSG_RESULT([printf]) ;;
print*) AC_MSG_RESULT([print -r]) ;;
*) AC_MSG_RESULT([cat]) ;;
@@ -1180,37 +1229,73 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
])# _LT_PROG_ECHO_BACKSLASH
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([$with_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
# _LT_ENABLE_LOCK
# ---------------
m4_defun([_LT_ENABLE_LOCK],
[AC_ARG_ENABLE([libtool-lock],
[AS_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || 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.
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
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"
+ HPUX_IA64_MODE=32
;;
*ELF-64*)
- HPUX_IA64_MODE="64"
+ HPUX_IA64_MODE=64
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
@@ -1239,9 +1324,46 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
@@ -1251,9 +1373,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1272,7 +1404,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -1290,25 +1425,39 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
+ 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
+ if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
+ CFLAGS=$SAVE_CFLAGS
fi
;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
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" ;;
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -1322,18 +1471,51 @@ sparc*-*solaris*)
;;
esac
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
])# _LT_ENABLE_LOCK
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
-[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])
+[_LT_PROG_AR
AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
@@ -1351,14 +1533,14 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -1387,7 +1569,7 @@ 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"
+ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
# 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
@@ -1414,7 +1596,7 @@ AC_CACHE_CHECK([$1], [$2],
$RM conftest*
])
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
m4_if([$5], , :, [$5])
else
m4_if([$6], , :, [$6])
@@ -1436,7 +1618,7 @@ AC_DEFUN([_LT_LINKER_OPTION],
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
- save_LDFLAGS="$LDFLAGS"
+ 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
@@ -1455,10 +1637,10 @@ AC_CACHE_CHECK([$1], [$2],
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
])
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
m4_if([$4], , :, [$4])
else
m4_if([$5], , :, [$5])
@@ -1479,7 +1661,7 @@ AC_DEFUN([LT_CMD_MAX_LEN],
AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0
- teststring="ABCD"
+ teststring=ABCD
case $build_os in
msdosdjgpp*)
@@ -1519,7 +1701,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# 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`
@@ -1538,6 +1720,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=196608
;;
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1564,22 +1751,23 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$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
+ for i in 1 2 3 4 5 6 7 8; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
+ test 17 != "$i" # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
@@ -1595,7 +1783,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
;;
esac
])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
else
AC_MSG_RESULT(none)
@@ -1623,7 +1811,7 @@ m4_defun([_LT_HEADER_DLFCN],
# ----------------------------------------------------------------
m4_defun([_LT_TRY_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
[$4]
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1672,11 +1860,11 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -1698,7 +1886,7 @@ int main ()
return status;
}]
_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ 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
@@ -1719,7 +1907,7 @@ rm -fr conftest*
# ------------------
AC_DEFUN([LT_SYS_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -1729,44 +1917,52 @@ else
case $host_os in
beos*)
- lt_cv_dlopen="load_add_on"
+ 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=LoadLibrary
lt_cv_dlopen_libs=
;;
cygwin*)
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen=dlopen
lt_cv_dlopen_libs=
;;
darwin*)
- # if libdl is installed we need to link against it
+ # 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=dlopen lt_cv_dlopen_libs=-ldl],[
+ lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
])
;;
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
*)
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="-ldld"],
+ [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
[AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="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="-ldld"])
+ [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
])
])
])
@@ -1775,21 +1971,21 @@ else
;;
esac
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
+ if test no = "$lt_cv_dlopen"; then
enable_dlopen=no
+ else
+ enable_dlopen=yes
fi
case $lt_cv_dlopen in
dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
- save_LIBS="$LIBS"
+ save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1799,7 +1995,7 @@ else
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
- if test "x$lt_cv_dlopen_self" = xyes; then
+ if test yes = "$lt_cv_dlopen_self"; 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
@@ -1809,9 +2005,9 @@ else
])
fi
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
;;
esac
@@ -1903,8 +2099,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS],
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
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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
@@ -1914,8 +2110,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" !=
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])
+ if test no = "$hard_links"; then
+ AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
need_locks=warn
fi
else
@@ -1942,8 +2138,8 @@ 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.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+ [Define to the sub-directory where libtool stores uninstalled libraries.])
])# _LT_CHECK_OBJDIR
@@ -1955,15 +2151,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
_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
+ test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
# We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
# 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
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
# Linking always hardcodes the temporary library directory.
_LT_TAGVAR(hardcode_action, $1)=relink
else
@@ -1977,12 +2173,12 @@ else
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
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
# Fast installation is not supported
enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
# Fast installation is not necessary
enable_fast_install=needless
fi
@@ -2006,7 +2202,7 @@ else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
- if test -n "$STRIP" ; then
+ if test -n "$STRIP"; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
@@ -2037,14 +2233,14 @@ m4_require([_LT_CHECK_SHELL_FEATURES])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
@@ -2060,28 +2256,35 @@ if test "$GCC" = yes; then
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
+ # 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`
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
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
+ 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"
+ elif test -n "$lt_multi_os_dir"; then
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;
+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;
+ lt_foo = "/" $lt_i lt_foo;
} else {
lt_count--;
}
@@ -2095,7 +2298,7 @@ BEGIN {RS=" "; FS="/|\n";} {
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
@@ -2104,7 +2307,7 @@ fi])
library_names_spec=
libname_spec='lib$name'
soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
@@ -2123,53 +2326,53 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='$libname$release$shared_ext$major'
;;
aix[[4-9]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ 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
+ # 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
+ 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
+ # AIX (on Power*) has no versioning support, so currently we cannot 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 test yes = "$aix_use_runtimelinking"; 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}'
+ 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'
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
fi
shlibpath_var=LIBPATH
fi
@@ -2180,27 +2383,27 @@ amigaos*)
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}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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}'
+ library_names_spec='$libname$shared_ext'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi[[45]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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"
@@ -2212,16 +2415,17 @@ bsdi[[45]]*)
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ 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~
@@ -2237,26 +2441,84 @@ cygwin* | mingw* | pw32* | cegcc*)
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}'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
@@ -2266,8 +2528,8 @@ darwin* | rhapsody*)
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'
+ 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`'
@@ -2277,18 +2539,14 @@ m4_if([$1], [],[
;;
dgux*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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.
@@ -2296,25 +2554,25 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[[123]]*) objformat=aout ;;
+ freebsd[[23]].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ 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'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2*)
+ freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2333,25 +2591,15 @@ freebsd* | dragonfly*)
esac
;;
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
haiku*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -2369,9 +2617,9 @@ hpux9* | hpux10* | hpux11*)
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
+ 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 32 = "$HPUX_IA64_MODE"; 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"
@@ -2384,8 +2632,8 @@ hpux9* | hpux10* | hpux11*)
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'
+ 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
;;
@@ -2394,8 +2642,8 @@ hpux9* | hpux10* | hpux11*)
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'
+ 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, ...
@@ -2405,11 +2653,11 @@ hpux9* | hpux10* | hpux11*)
;;
interix[[3-9]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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
@@ -2420,16 +2668,16 @@ irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ 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=
@@ -2448,8 +2696,8 @@ irix5* | irix6* | nonstopux*)
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}"
+ 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
;;
@@ -2458,13 +2706,33 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
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'
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # 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
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -2513,12 +2781,12 @@ netbsd*)
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'
+ 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'
+ 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
@@ -2527,8 +2795,8 @@ netbsd*)
;;
newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
@@ -2537,45 +2805,34 @@ newsos6)
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'
+ 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*)
+openbsd* | bitrig*)
version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
+ 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
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
else
- shlibpath_overrides_runpath=yes
+ need_version=yes
fi
+ 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
+ shlibpath_overrides_runpath=yes
;;
os2*)
libname_spec='$name'
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
+ library_names_spec='$libname$shared_ext $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
@@ -2584,11 +2841,11 @@ 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}'
+ 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"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
rdos*)
@@ -2596,11 +2853,11 @@ rdos*)
;;
solaris*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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
@@ -2610,20 +2867,20 @@ solaris*)
sunos4*)
version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ 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
+ if test yes = "$with_gnu_ld"; 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'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
@@ -2644,10 +2901,10 @@ sysv4 | sysv4.3*)
;;
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'
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
@@ -2656,12 +2913,12 @@ 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'
+ 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
+ if test yes = "$with_gnu_ld"; 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'
@@ -2676,19 +2933,19 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ 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'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -2697,18 +2954,18 @@ uts4*)
;;
esac
AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; 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"
+if test set = "${lt_cv_sys_lib_search_path_spec+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"
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
_LT_DECL([], [variables_saved_for_relink], [1],
@@ -2750,32 +3007,32 @@ _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
-# find a file program which can recognize shared library
+# find a file program that 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_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
+ 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"
+ 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 -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"
+ 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
:
@@ -2798,11 +3055,11 @@ _LT_EOF
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
AC_MSG_RESULT($MAGIC_CMD)
else
@@ -2820,7 +3077,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
# _LT_PATH_MAGIC
# --------------
-# find a file program which can recognize a shared library
+# find a file program that 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
@@ -2847,16 +3104,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
[assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
+ [test no = "$withval" || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; 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
+ # 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` ;;
@@ -2870,7 +3127,7 @@ if test "$GCC" = yes; then
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"
+ test -z "$LD" && LD=$ac_prog
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -2881,37 +3138,37 @@ if test "$GCC" = yes; then
with_gnu_ld=unknown
;;
esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; 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
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
+ 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"
+ 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 no != "$with_gnu_ld" && break
;;
*)
- test "$with_gnu_ld" != yes && break
+ test yes != "$with_gnu_ld" && break
;;
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
else
- lt_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="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
@@ -2964,9 +3221,14 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -2992,13 +3254,13 @@ 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.
+# '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.
+# that 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]]*)
@@ -3025,8 +3287,7 @@ mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ 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
@@ -3062,10 +3323,6 @@ freebsd* | dragonfly*)
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3103,8 +3360,8 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3126,8 +3383,8 @@ newos6*)
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
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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)$'
@@ -3182,6 +3439,21 @@ tpf*)
;;
esac
])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -3189,7 +3461,11 @@ 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"])
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
])# _LT_CHECK_MAGIC_METHOD
@@ -3201,33 +3477,33 @@ AC_DEFUN([LT_PATH_NM],
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"
+ lt_cv_path_NM=$NM
else
- lt_nm_to_check="${ac_tool_prefix}nm"
+ 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
+ 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"
+ 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
+ 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:
+ # 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
+ break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
- break
+ break 2
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3238,21 +3514,21 @@ else
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
done
: ${lt_cv_path_NM=no}
fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
*COFF*)
- DUMPBIN="$DUMPBIN -symbols"
+ DUMPBIN="$DUMPBIN -symbols -headers"
;;
*)
DUMPBIN=:
@@ -3260,8 +3536,8 @@ else
esac
fi
AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
fi
fi
test -z "$NM" && NM=nm
@@ -3292,6 +3568,82 @@ dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_PROG_NM], [])
dnl AC_DEFUN([AC_PROG_NM], [])
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+ test DEF = "`$SED -n dnl
+ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
+ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
+ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
+ -e q dnl Only consider the first "real" line
+ $1`" dnl
+])# _LT_DLL_DEF_P
+
# LT_LIB_M
# --------
@@ -3304,11 +3656,11 @@ case $host in
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
+ AC_CHECK_LIB(m, cos, LIBM=-lm)
;;
esac
AC_SUBST([LIBM])
@@ -3327,7 +3679,7 @@ m4_defun([_LT_COMPILER_NO_RTTI],
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $cc_basename in
nvcc*)
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3379,7 +3731,7 @@ cygwin* | mingw* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
symcode='[[ABCDEGRST]]'
fi
;;
@@ -3412,14 +3764,44 @@ case `$NM -V 2>&1` in
symcode='[[ABCDGIRSTW]]' ;;
esac
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
# 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'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$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'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
@@ -3437,24 +3819,29 @@ for ac_symprfx in "" "_"; do
# 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.
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
" \$ 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))}"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -3488,6 +3875,18 @@ _LT_EOF
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -3499,7 +3898,7 @@ _LT_EOF
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT@&t@_DLSYM_CONST struct {
const char *name;
void *address;
}
@@ -3507,7 +3906,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
@@ -3525,15 +3924,15 @@ static const void *lt_preloaded_setup() {
_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"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
@@ -3550,7 +3949,7 @@ _LT_EOF
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
+ if test yes = "$pipe_works"; then
break
else
lt_cv_sys_global_symbol_pipe=
@@ -3566,16 +3965,29 @@ else
AC_MSG_RESULT(ok)
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
[Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+ [Transform the output of nm into a list of symbols to manually relocate])
_LT_DECL([global_symbol_to_c_name_address],
[lt_cv_sys_global_symbol_to_c_name_address], [1],
[Transform the output of nm in a C name address pair])
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+ [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3587,20 +3999,20 @@ _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
+ if test yes = "$GXX"; 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
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
amigaos*)
@@ -3611,8 +4023,8 @@ m4_if([$1], [CXX], [
;;
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'.
+ # 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
@@ -3677,7 +4089,7 @@ m4_if([$1], [CXX], [
case $host_os in
aix[[4-9]]*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
@@ -3692,6 +4104,12 @@ m4_if([$1], [CXX], [
;;
esac
;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
dgux*)
case $cc_basename in
ec++*)
@@ -3712,14 +4130,14 @@ m4_if([$1], [CXX], [
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_static, $1)='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; 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'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
@@ -3748,7 +4166,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -3756,7 +4174,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
+ # 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'
@@ -3901,17 +4319,18 @@ m4_if([$1], [CXX], [
fi
],
[
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; 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
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
amigaos*)
@@ -3922,8 +4341,8 @@ m4_if([$1], [CXX], [
;;
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'.
+ # 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
@@ -4000,7 +4419,9 @@ m4_if([$1], [CXX], [
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
;;
esac
else
@@ -4008,7 +4429,7 @@ m4_if([$1], [CXX], [
case $host_os in
aix*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
@@ -4016,6 +4437,20 @@ m4_if([$1], [CXX], [
fi
;;
+ 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'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+
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).
@@ -4036,7 +4471,7 @@ m4_if([$1], [CXX], [
;;
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'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
@@ -4045,9 +4480,9 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
+ # 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'
@@ -4066,6 +4501,18 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny 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)='-static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -4086,18 +4533,33 @@ m4_if([$1], [CXX], [
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ F* | *Sun*Fortran*)
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
*Sun\ C*)
# Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
esac
;;
esac
@@ -4148,7 +4610,7 @@ m4_if([$1], [CXX], [
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
@@ -4177,7 +4639,7 @@ m4_if([$1], [CXX], [
fi
])
case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
+ # For platforms that do not support PIC, -DPIC is meaningless:
*djgpp*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
@@ -4185,9 +4647,11 @@ case $host_os in
_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])
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
#
# Check to make sure the PIC flag actually works.
@@ -4206,6 +4670,8 @@ fi
_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
[Additional compiler flags for building library objects])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
#
# Check to make sure the static flag actually works.
#
@@ -4226,6 +4692,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_DECL_SED])dnl
@@ -4234,6 +4701,7 @@ m4_require([_LT_TAG_COMPILER])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_if([$1], [CXX], [
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
@@ -4247,16 +4715,23 @@ m4_if([$1], [CXX], [
fi
;;
pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
+ _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'
- ;;
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
+ ;;
esac
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
@@ -4271,7 +4746,6 @@ m4_if([$1], [CXX], [
_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
@@ -4287,9 +4761,9 @@ m4_if([$1], [CXX], [
# 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'.
+ # 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
@@ -4305,7 +4779,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
# 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
+ if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
@@ -4313,7 +4787,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
- openbsd*)
+ openbsd* | bitrig*)
with_gnu_ld=no
;;
esac
@@ -4323,7 +4797,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
@@ -4345,24 +4819,24 @@ dnl Note also adjust exclude_expsyms for C++ above.
esac
fi
- if test "$lt_use_gnu_ld_interface" = yes; then
+ if test yes = "$lt_use_gnu_ld_interface"; then
# If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
+ 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'
+ _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'
+ _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
+ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4375,7 +4849,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
+ if test ia64 != "$host_cpu"; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
@@ -4394,7 +4868,7 @@ _LT_EOF
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_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
@@ -4410,7 +4884,7 @@ _LT_EOF
_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'
+ _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
@@ -4420,68 +4894,69 @@ _LT_EOF
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ _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, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
+ if test linux-dietlibc = "$host_os"; 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
+ && test no = "$tmp_diet"
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
@@ -4492,43 +4967,44 @@ _LT_EOF
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _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
+ if test yes = "$supports_anon_versioning"; 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'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
@@ -4542,8 +5018,8 @@ _LT_EOF
_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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -4561,8 +5037,8 @@ _LT_EOF
_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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4574,7 +5050,7 @@ _LT_EOF
_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
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
*** 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
@@ -4589,9 +5065,9 @@ _LT_EOF
# 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'
+ _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
@@ -4608,15 +5084,15 @@ _LT_EOF
*)
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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
runpath_var=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4632,7 +5108,7 @@ _LT_EOF
# 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
+ if test yes = "$GCC" && 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
@@ -4640,12 +5116,12 @@ _LT_EOF
;;
aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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=""
+ 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
@@ -4663,7 +5139,7 @@ _LT_EOF
# 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
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
aix_use_runtimelinking=yes
break
fi
@@ -4686,13 +5162,13 @@ _LT_EOF
_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,'
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; 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`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -4711,61 +5187,61 @@ _LT_EOF
;;
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
fi
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
fi
fi
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ _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
+ if test yes = "$aix_use_runtimelinking"; 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; 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"
+ _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"
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _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
;;
@@ -4774,7 +5250,7 @@ _LT_EOF
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_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
@@ -4794,20 +5270,65 @@ _LT_EOF
# 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 `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -4820,10 +5341,6 @@ _LT_EOF
_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
@@ -4836,7 +5353,7 @@ _LT_EOF
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
+ 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
@@ -4845,41 +5362,40 @@ _LT_EOF
# 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(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _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'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
;;
hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _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
@@ -4887,25 +5403,25 @@ _LT_EOF
;;
hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ if test yes,no = "$GCC,$with_gnu_ld"; then
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _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 $pic_flag $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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _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+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
m4_if($1, [], [
@@ -4913,14 +5429,14 @@ _LT_EOF
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
_LT_LINKER_OPTION([if $CC understands -b],
_LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
[_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ [_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'
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
@@ -4931,7 +5447,7 @@ _LT_EOF
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _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.
@@ -4942,23 +5458,38 @@ _LT_EOF
;;
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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- )
- LDFLAGS="$save_LDFLAGS"
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS=$save_LDFLAGS])
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_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
@@ -4978,7 +5509,7 @@ _LT_EOF
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_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
@@ -4986,27 +5517,19 @@ _LT_EOF
*nto* | *qnx*)
;;
- openbsd*)
+ openbsd* | bitrig*)
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
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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'
+ _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
+ _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'
fi
else
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5022,28 +5545,28 @@ _LT_EOF
;;
osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5054,24 +5577,24 @@ _LT_EOF
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'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_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'
+ $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'
+ 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'
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
@@ -5081,11 +5604,11 @@ _LT_EOF
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 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'
+ if test yes = "$GCC"; 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
@@ -5095,10 +5618,10 @@ _LT_EOF
;;
sunos4*)
- if test "x$host_vendor" = xsequent; then
+ if test sequent = "$host_vendor"; 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'
+ _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
@@ -5147,43 +5670,43 @@ _LT_EOF
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _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'
+ if test yes = "$GCC"; 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'
+ _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
+ # Note: We CANNOT 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(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_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'
+ _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'
+ if test yes = "$GCC"; 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'
+ _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
;;
@@ -5198,17 +5721,17 @@ _LT_EOF
;;
esac
- if test x$host_vendor = xsni; then
+ if test sni = "$host_vendor"; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ _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
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
@@ -5225,7 +5748,7 @@ x|xyes)
# Assume -lc should be added
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
+ if test yes,yes = "$GCC,$enable_shared"; then
case $_LT_TAGVAR(archive_cmds, $1) in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
@@ -5302,18 +5825,15 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
_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
+ [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
+ [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
+ "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
@@ -5330,8 +5850,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
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],
@@ -5342,6 +5860,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
[Symbols that must always be exported])
_LT_TAGDECL([], [prelink_cmds], [2],
[Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
@@ -5354,10 +5874,10 @@ dnl [Compiler flag to generate thread safe objects])
# ------------------------
# 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'.
+# the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_C_CONFIG],
[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
AC_LANG_PUSH(C)
# Source file extension for C test sources.
@@ -5393,18 +5913,18 @@ if test -n "$compiler"; then
LT_SYS_DLOPEN_SELF
_LT_CMD_STRIPLIB
- # Report which library types will actually be built
+ # Report what 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
+ test no = "$can_build_shared" && 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
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -5412,8 +5932,8 @@ if test -n "$compiler"; then
;;
aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && enable_static=no
fi
;;
esac
@@ -5421,13 +5941,13 @@ if test -n "$compiler"; then
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
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_CONFIG($1)
fi
AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
])# _LT_LANG_C_CONFIG
@@ -5435,13 +5955,14 @@ CC="$lt_save_CC"
# --------------------------
# 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'.
+# the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_CXX_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
AC_PROG_CXXCPP
else
_lt_caught_CXX_error=yes
@@ -5457,7 +5978,6 @@ _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
@@ -5484,7 +6004,7 @@ _LT_TAGVAR(objext, $1)=$objext
# 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
+if test yes != "$_lt_caught_CXX_error"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
@@ -5500,6 +6020,7 @@ if test "$_lt_caught_CXX_error" != yes; then
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
lt_save_LD=$LD
lt_save_GCC=$GCC
GCC=$GXX
@@ -5517,6 +6038,7 @@ if test "$_lt_caught_CXX_error" != yes; then
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -5524,35 +6046,35 @@ if test "$_lt_caught_CXX_error" != yes; then
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
+ if test yes = "$GXX"; 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
+ if test yes = "$GXX"; 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'
+ if test yes = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _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}'
+ 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'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
@@ -5588,12 +6110,12 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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=""
+ no_entry_flag=
else
aix_use_runtimelinking=no
@@ -5627,13 +6149,13 @@ if test "$_lt_caught_CXX_error" != yes; then
_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,'
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
- if test "$GXX" = yes; then
+ if test yes = "$GXX"; 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`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -5651,56 +6173,56 @@ if test "$_lt_caught_CXX_error" != yes; then
fi
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
fi
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
fi
fi
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ _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
+ if test yes = "$aix_use_runtimelinking"; 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_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; 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"
+ _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"
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
@@ -5708,7 +6230,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_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'
+ _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
;;
@@ -5718,7 +6240,7 @@ if test "$_lt_caught_CXX_error" != yes; 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'
+ _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
@@ -5734,29 +6256,76 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- 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
- ;;
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
@@ -5779,7 +6348,7 @@ if test "$_lt_caught_CXX_error" != yes; then
esac
;;
- freebsd[[12]]*)
+ freebsd2.*)
# C++ shared libraries reported to be fairly broken before
# switch to ELF
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5795,18 +6364,15 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- gnu*)
- ;;
-
haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _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
@@ -5818,7 +6384,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_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'
+ _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 "x$output_objdir/$soname" = "x$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.
@@ -5827,11 +6393,11 @@ if test "$_lt_caught_CXX_error" != yes; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -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'
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5841,15 +6407,15 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; 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'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
;;
esac
fi
@@ -5875,13 +6441,13 @@ if test "$_lt_caught_CXX_error" != yes; then
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'
+ _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+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'
+ _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
@@ -5892,20 +6458,20 @@ if test "$_lt_caught_CXX_error" != yes; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; 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'
+ _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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
@@ -5920,22 +6486,22 @@ if test "$_lt_caught_CXX_error" != yes; then
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'
+ _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'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
CC*)
# SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
# Archives containing C++ object files must be created using
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
@@ -5944,22 +6510,22 @@ if test "$_lt_caught_CXX_error" != yes; then
_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -5967,8 +6533,8 @@ if test "$_lt_caught_CXX_error" != yes; then
# 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'
+ _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.
@@ -5977,10 +6543,10 @@ if test "$_lt_caught_CXX_error" != yes; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _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.
@@ -5994,59 +6560,59 @@ if test "$_lt_caught_CXX_error" != yes; then
# 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'
+ _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'
+ _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'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
case `$CC -V` in
*pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
;;
cxx*)
# Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+ _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'
@@ -6060,18 +6626,18 @@ if test "$_lt_caught_CXX_error" != yes; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
;;
xl* | mpixl* | bgxl*)
# IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(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 yes = "$supports_anon_versioning"; 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'
+ 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
;;
*)
@@ -6079,10 +6645,10 @@ if test "$_lt_caught_CXX_error" != yes; then
*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(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
@@ -6140,22 +6706,17 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
+ openbsd* | bitrig*)
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'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
fi
output_verbose_link_cmd=func_echo_all
else
@@ -6171,9 +6732,9 @@ if test "$_lt_caught_CXX_error" != yes; then
# 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_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_flag_spec, $1)='$wl-rpath,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Archives containing C++ object files must be created using
@@ -6191,17 +6752,17 @@ if test "$_lt_caught_CXX_error" != yes; then
cxx*)
case $host in
osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
*)
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
;;
esac
@@ -6216,21 +6777,21 @@ if test "$_lt_caught_CXX_error" != yes; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
case $host in
osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
@@ -6276,9 +6837,9 @@ if test "$_lt_caught_CXX_error" != yes; then
# 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_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'
+ $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
@@ -6286,7 +6847,7 @@ if test "$_lt_caught_CXX_error" != yes; then
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
+ # 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'
;;
@@ -6303,30 +6864,30 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
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'
+ _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 test yes,no = "$GXX,$with_gnu_ld"; 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_cmds, $1)='$CC -shared $pic_flag -nostdlib $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'
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # 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_cmds, $1)='$CC -G -nostdlib $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'
+ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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
@@ -6334,11 +6895,11 @@ if test "$_lt_caught_CXX_error" != yes; then
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ _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'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
;;
esac
fi
@@ -6347,52 +6908,52 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _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 -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'
+ _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
+ # Note: We CANNOT 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(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_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'
+ _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 -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
_LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
+ '"$_LT_TAGVAR(reload_cmds, $1)"
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _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
;;
@@ -6423,10 +6984,10 @@ if test "$_lt_caught_CXX_error" != yes; then
esac
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
+ _LT_TAGVAR(GCC, $1)=$GXX
+ _LT_TAGVAR(LD, $1)=$LD
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
@@ -6444,6 +7005,7 @@ if test "$_lt_caught_CXX_error" != yes; then
fi # test -n "$compiler"
CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
LDCXX=$LD
LD=$lt_save_LD
GCC=$lt_save_GCC
@@ -6452,12 +7014,35 @@ if test "$_lt_caught_CXX_error" != yes; then
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
+fi # test yes != "$_lt_caught_CXX_error"
AC_LANG_POP
])# _LT_LANG_CXX_CONFIG
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case @S|@2 in
+ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
@@ -6466,6 +7051,7 @@ AC_LANG_POP
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
@@ -6515,7 +7101,20 @@ public class foo {
}
};
_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
@@ -6527,29 +7126,38 @@ if AC_TRY_EVAL(ac_compile); then
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
- case $p in
+ case $prev$p in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
prev=$p
continue
- else
- prev=
fi
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
+ -L | -R)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ _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}"
+ _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
@@ -6557,13 +7165,15 @@ if AC_TRY_EVAL(ac_compile); then
esac
else
if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ _LT_TAGVAR(postdeps, $1)=$prev$p
else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
fi
fi
+ prev=
;;
+ *.lto.$objext) ;; # Ignore GCC LTO objects
*.$objext)
# This assumes that the test object file only shows up
# once in the compiler output.
@@ -6572,15 +7182,15 @@ if AC_TRY_EVAL(ac_compile); then
continue
fi
- if test "$pre_test_object_deps_done" = no; then
+ if test no = "$pre_test_object_deps_done"; then
if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
+ _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"
+ _LT_TAGVAR(postdep_objects, $1)=$p
else
_LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
fi
@@ -6599,6 +7209,7 @@ else
fi
$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
@@ -6626,7 +7237,7 @@ linux*)
;;
esac
- if test "$solaris_use_stlport4" != yes; then
+ if test yes != "$solaris_use_stlport4"; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
@@ -6649,7 +7260,7 @@ solaris*)
# 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
+ if test yes != "$solaris_use_stlport4"; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
@@ -6663,7 +7274,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in
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!^ !!'`
+ _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])
@@ -6683,10 +7294,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
# --------------------------
# 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'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_F77_CONFIG],
[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
_lt_disable_F77=yes
fi
@@ -6698,7 +7309,6 @@ _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
@@ -6724,7 +7334,7 @@ _LT_TAGVAR(objext, $1)=$objext
# 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
+if test yes != "$_lt_disable_F77"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
@@ -6746,9 +7356,11 @@ if test "$_lt_disable_F77" != yes; then
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
+ lt_save_CC=$CC
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -6758,21 +7370,21 @@ if test "$_lt_disable_F77" != yes; then
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && 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
+ test yes = "$enable_shared" && 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
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && enable_static=no
fi
;;
esac
@@ -6780,11 +7392,11 @@ if test "$_lt_disable_F77" != yes; then
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
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
+ _LT_TAGVAR(GCC, $1)=$G77
+ _LT_TAGVAR(LD, $1)=$LD
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
@@ -6801,8 +7413,9 @@ if test "$_lt_disable_F77" != yes; then
fi # test -n "$compiler"
GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_F77" != yes
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
AC_LANG_POP
])# _LT_LANG_F77_CONFIG
@@ -6812,11 +7425,11 @@ AC_LANG_POP
# -------------------------
# 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'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_FC_CONFIG],
[AC_LANG_PUSH(Fortran)
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
_lt_disable_FC=yes
fi
@@ -6828,7 +7441,6 @@ _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
@@ -6854,7 +7466,7 @@ _LT_TAGVAR(objext, $1)=$objext
# 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
+if test yes != "$_lt_disable_FC"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
@@ -6876,9 +7488,11 @@ if test "$_lt_disable_FC" != yes; then
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
+ lt_save_CC=$CC
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
compiler=$CC
GCC=$ac_cv_fc_compiler_gnu
@@ -6890,21 +7504,21 @@ if test "$_lt_disable_FC" != yes; then
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && 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
+ test yes = "$enable_shared" && 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
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && enable_static=no
fi
;;
esac
@@ -6912,11 +7526,11 @@ if test "$_lt_disable_FC" != yes; then
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
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
+ _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
@@ -6934,8 +7548,9 @@ if test "$_lt_disable_FC" != yes; then
fi # test -n "$compiler"
GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_FC" != yes
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
AC_LANG_POP
])# _LT_LANG_FC_CONFIG
@@ -6945,7 +7560,7 @@ AC_LANG_POP
# --------------------------
# 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'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_GCJ_CONFIG],
[AC_REQUIRE([LT_PROG_GCJ])dnl
AC_LANG_SAVE
@@ -6971,13 +7586,15 @@ _LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=yes
CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
_LT_CC_BASENAME([$compiler])
# GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7001,15 +7618,83 @@ fi
AC_LANG_RESTORE
GCC=$lt_save_GCC
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_GCJ_CONFIG
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_RC_CONFIG],
[AC_REQUIRE([LT_PROG_RC])dnl
AC_LANG_SAVE
@@ -7025,7 +7710,7 @@ _LT_TAGVAR(objext, $1)=$objext
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"
+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
@@ -7035,10 +7720,12 @@ _LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=
CC=${RC-"windres"}
+CFLAGS=
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -7051,7 +7738,8 @@ fi
GCC=$lt_save_GCC
AC_LANG_RESTORE
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_RC_CONFIG
@@ -7061,7 +7749,7 @@ 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"
+ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)])])[]dnl
])
@@ -7071,6 +7759,13 @@ dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
# LT_PROG_RC
# ----------
AC_DEFUN([LT_PROG_RC],
@@ -7110,6 +7805,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
AC_SUBST([OBJDUMP])
])
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
# _LT_DECL_SED
# ------------
@@ -7154,7 +7858,7 @@ 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
+ test ! -f "$lt_ac_sed" && continue
cat /dev/null > conftest.in
lt_ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7171,9 +7875,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
$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
+ test 10 -lt "$lt_ac_count" && break
lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
+ if test "$lt_ac_count" -gt "$lt_ac_max"; then
lt_ac_max=$lt_ac_count
lt_cv_path_SED=$lt_ac_sed
fi
@@ -7197,27 +7901,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], [])
# 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
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
@@ -7241,221 +7925,84 @@ _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
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
-
-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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$[@]"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]+=\$[2]"
-}
-_LT_EOF
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
;;
- *)
- 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
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
;;
- esac
+esac
])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software
+# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -7476,7 +8023,7 @@ 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
+ [m4_warning([Unknown $1 option '$2'])])[]dnl
])
@@ -7522,13 +8069,13 @@ m4_if([$1],[LT_INIT],[
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 '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_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
@@ -7556,7 +8103,7 @@ 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.])
+put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -7592,7 +8139,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
_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.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -7601,9 +8148,9 @@ 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'.
+# 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],
@@ -7616,14 +8163,14 @@ AC_ARG_ENABLE([shared],
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -7655,9 +8202,9 @@ 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'.
+# 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],
@@ -7670,14 +8217,14 @@ AC_ARG_ENABLE([static],
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -7709,9 +8256,9 @@ 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'.
+# 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],
@@ -7724,14 +8271,14 @@ AC_ARG_ENABLE([fast-install],
*)
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,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -7748,14 +8295,14 @@ 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.])
+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.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -7765,17 +8312,30 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# 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'.
+# 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],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[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_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
@@ -7788,7 +8348,7 @@ 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.])
+put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -7811,7 +8371,8 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software
+# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -7844,7 +8405,7 @@ m4_define([_lt_join],
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# 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])],
@@ -7855,7 +8416,7 @@ m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# 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
@@ -7935,31 +8496,32 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2013 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.
+# @configure_input@
-# serial 3175 ltversion.m4
+# serial 4038 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.2.10])
-m4_define([LT_PACKAGE_REVISION], [1.3175])
+m4_define([LT_PACKAGE_VERSION], [2.4.2.418])
+m4_define([LT_PACKAGE_REVISION], [2.4.2.418])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.10'
-macro_revision='1.3175'
+[macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software
+# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
@@ -7970,7 +8532,7 @@ _LT_DECL(, macro_revision, 0)
# These exist entirely to fool aclocal when bootstrapping libtool.
#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# 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.
#
@@ -8056,7 +8618,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8068,10 +8630,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.14.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -8087,21 +8649,19 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Figure out how to run the assembler. -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_PROG_AS
# ----------
AC_DEFUN([AM_PROG_AS],
@@ -8116,15 +8676,15 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $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
@@ -8143,7 +8703,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
#
# 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
+# 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,
@@ -8169,22 +8729,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
-
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -8203,16 +8760,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 10
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# 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
@@ -8222,7 +8777,7 @@ fi])])
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# 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
@@ -8235,12 +8790,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
@@ -8248,8 +8804,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -8288,16 +8845,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -8306,16 +8863,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -8363,7 +8920,7 @@ AM_CONDITIONAL([am__fastdep$1], [
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# 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
@@ -8373,34 +8930,39 @@ 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])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -8413,7 +8975,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -8425,21 +8987,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
@@ -8457,7 +9017,7 @@ AC_DEFUN([_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
+# 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],
@@ -8467,18 +9027,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
-
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -8491,7 +9054,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -8520,31 +9083,40 @@ 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_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[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([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@@ -8555,34 +9127,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_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
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
@@ -8604,7 +9220,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8623,16 +9239,14 @@ if test x"${install_sh}" != xset; then
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
@@ -8649,20 +9263,17 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
@@ -8670,13 +9281,14 @@ AC_DEFUN([AM_MAINTAINER_MODE],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
@@ -8684,18 +9296,14 @@ AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of
]
)
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
-
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
@@ -8713,7 +9321,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -8738,52 +9346,14 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
@@ -8791,11 +9361,10 @@ AC_DEFUN([AM_MISSING_PROG],
$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.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
@@ -8808,63 +9377,35 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
+ AC_MSG_WARN(['missing' script is too old or missing])
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
-
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -8875,24 +9416,82 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -8903,32 +9502,40 @@ case `pwd` in
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$[2]" = conftest.file
)
then
@@ -8938,36 +9545,85 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
+# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[ --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8975,34 +9631,32 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
# AM_PROG_INSTALL_STRIP
# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# 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
+# 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
+# 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'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -9010,24 +9664,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
@@ -9037,75 +9689,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
+#
AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
diff --git a/app/lzo/asm/i386/src/enter.ash b/app/lzo/asm/i386/src/enter.ash
index c2aa0817..c121c573 100644
--- a/app/lzo/asm/i386/src/enter.ash
+++ b/app/lzo/asm/i386/src/enter.ash
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/leave.ash b/app/lzo/asm/i386/src/leave.ash
index 0fdb729f..2aa02867 100644
--- a/app/lzo/asm/i386/src/leave.ash
+++ b/app/lzo/asm/i386/src/leave.ash
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1c_d.ash b/app/lzo/asm/i386/src/lzo1c_d.ash
index 56622ab5..4560452b 100644
--- a/app/lzo/asm/i386/src/lzo1c_d.ash
+++ b/app/lzo/asm/i386/src/lzo1c_d.ash
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1c_s1.S b/app/lzo/asm/i386/src/lzo1c_s1.S
index b68ca293..d1cdd628 100644
--- a/app/lzo/asm/i386/src/lzo1c_s1.S
+++ b/app/lzo/asm/i386/src/lzo1c_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1f_d.ash b/app/lzo/asm/i386/src/lzo1f_d.ash
index 97a103c0..50248d8b 100644
--- a/app/lzo/asm/i386/src/lzo1f_d.ash
+++ b/app/lzo/asm/i386/src/lzo1f_d.ash
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1f_f1.S b/app/lzo/asm/i386/src/lzo1f_f1.S
index 46eb26b2..5566cc57 100644
--- a/app/lzo/asm/i386/src/lzo1f_f1.S
+++ b/app/lzo/asm/i386/src/lzo1f_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1x_d.ash b/app/lzo/asm/i386/src/lzo1x_d.ash
index 782b47fe..a05f15dc 100644
--- a/app/lzo/asm/i386/src/lzo1x_d.ash
+++ b/app/lzo/asm/i386/src/lzo1x_d.ash
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1x_f1.S b/app/lzo/asm/i386/src/lzo1x_f1.S
index ccdb9022..f9706f13 100644
--- a/app/lzo/asm/i386/src/lzo1x_f1.S
+++ b/app/lzo/asm/i386/src/lzo1x_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1x_s1.S b/app/lzo/asm/i386/src/lzo1x_s1.S
index 1e901ed6..198980de 100644
--- a/app/lzo/asm/i386/src/lzo1x_s1.S
+++ b/app/lzo/asm/i386/src/lzo1x_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1y_f1.S b/app/lzo/asm/i386/src/lzo1y_f1.S
index c993beef..98ab9152 100644
--- a/app/lzo/asm/i386/src/lzo1y_f1.S
+++ b/app/lzo/asm/i386/src/lzo1y_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo1y_s1.S b/app/lzo/asm/i386/src/lzo1y_s1.S
index c57a1c8c..b48212f5 100644
--- a/app/lzo/asm/i386/src/lzo1y_s1.S
+++ b/app/lzo/asm/i386/src/lzo1y_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src/lzo_asm.h b/app/lzo/asm/i386/src/lzo_asm.h
index 1188dd60..1958517d 100644
--- a/app/lzo/asm/i386/src/lzo_asm.h
+++ b/app/lzo/asm/i386/src/lzo_asm.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/all/asm_all.S b/app/lzo/asm/i386/src_gas/all/asm_all.S
index cb859427..6da894b2 100644
--- a/app/lzo/asm/i386/src_gas/all/asm_all.S
+++ b/app/lzo/asm/i386/src_gas/all/asm_all.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,7 +27,7 @@
/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
-#if defined(__MACH__) && defined(__APPLE__)
+#if (defined(__MACH__) && defined(__APPLE__))
# define NAME1(x) _ ## x
#else
# define NAME1(x) _ ## x
@@ -68,14 +53,18 @@
# define sizef(x,s)
# endif
#endif
-#ifndef db
-# define db .byte
-#endif
-#ifdef __ELF__
+#if defined(__ELF__)
.section .note.GNU-stack,"",@progbits
#endif
.text
+#if defined(__ELF__) || (defined(__MACH__) && defined(__APPLE__)) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
+p2align(6)
+#else
p2align(4)
+#endif
+#ifndef db
+# define db .byte
+#endif
#ifdef NAME1
typef(NAME1(lzo1c_decompress_asm))
@@ -121,60 +110,6 @@ sizef(NAME2(lzo1c_decompress_asm),.-NAME2(lzo1c_decompress_asm))
#endif
#ifdef NAME1
-typef(NAME1(lzo1c_decompress_asm_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1c_decompress_asm_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1c_decompress_asm_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1c_decompress_asm_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1c_decompress_asm_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1c_decompress_asm_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
-db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
-db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
-db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
-db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
-db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
-db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
-db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
-db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
-db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
-db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
-db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
-db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
-db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
-db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
-db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
-db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
-db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
-db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
-db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
-db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
-db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
-db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
-db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
-db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
-db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
-#ifdef NAME1
-sizef(NAME1(lzo1c_decompress_asm_safe),.-NAME1(lzo1c_decompress_asm_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1c_decompress_asm_safe),.-NAME2(lzo1c_decompress_asm_safe))
-#endif
-
-#ifdef NAME1
typef(NAME1(lzo1f_decompress_asm_fast))
#endif
#ifdef NAME2
@@ -220,58 +155,6 @@ sizef(NAME2(lzo1f_decompress_asm_fast),.-NAME2(lzo1f_decompress_asm_fast))
#endif
#ifdef NAME1
-typef(NAME1(lzo1f_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1f_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1f_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1f_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1f_decompress_asm_fast_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1f_decompress_asm_fast_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
-db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
-db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
-db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
-db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
-db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
-db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
-db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
-db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
-db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
-db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
-db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
-db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
-db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
-db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
-db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
-db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
-db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
-db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
-db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
-db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
-db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
-db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
-db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
-#ifdef NAME1
-sizef(NAME1(lzo1f_decompress_asm_fast_safe),.-NAME1(lzo1f_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1f_decompress_asm_fast_safe),.-NAME2(lzo1f_decompress_asm_fast_safe))
-#endif
-
-#ifdef NAME1
typef(NAME1(lzo1x_decompress_asm_fast))
#endif
#ifdef NAME2
@@ -325,74 +208,6 @@ sizef(NAME2(lzo1x_decompress_asm_fast),.-NAME2(lzo1x_decompress_asm_fast))
#endif
#ifdef NAME1
-typef(NAME1(lzo1x_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1x_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1x_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1x_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1x_decompress_asm_fast_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1x_decompress_asm_fast_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
-db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
-db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
-db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
-db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-#ifdef NAME1
-sizef(NAME1(lzo1x_decompress_asm_fast_safe),.-NAME1(lzo1x_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1x_decompress_asm_fast_safe),.-NAME2(lzo1x_decompress_asm_fast_safe))
-#endif
-
-#ifdef NAME1
typef(NAME1(lzo1x_decompress_asm))
#endif
#ifdef NAME2
@@ -448,77 +263,6 @@ sizef(NAME2(lzo1x_decompress_asm),.-NAME2(lzo1x_decompress_asm))
#endif
#ifdef NAME1
-typef(NAME1(lzo1x_decompress_asm_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1x_decompress_asm_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1x_decompress_asm_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1x_decompress_asm_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1x_decompress_asm_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1x_decompress_asm_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
-db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
-db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
-db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
-db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-#ifdef NAME1
-sizef(NAME1(lzo1x_decompress_asm_safe),.-NAME1(lzo1x_decompress_asm_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1x_decompress_asm_safe),.-NAME2(lzo1x_decompress_asm_safe))
-#endif
-
-#ifdef NAME1
typef(NAME1(lzo1y_decompress_asm_fast))
#endif
#ifdef NAME2
@@ -572,74 +316,6 @@ sizef(NAME2(lzo1y_decompress_asm_fast),.-NAME2(lzo1y_decompress_asm_fast))
#endif
#ifdef NAME1
-typef(NAME1(lzo1y_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1y_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1y_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1y_decompress_asm_fast_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1y_decompress_asm_fast_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1y_decompress_asm_fast_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
-db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
-db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
-db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
-db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-#ifdef NAME1
-sizef(NAME1(lzo1y_decompress_asm_fast_safe),.-NAME1(lzo1y_decompress_asm_fast_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1y_decompress_asm_fast_safe),.-NAME2(lzo1y_decompress_asm_fast_safe))
-#endif
-
-#ifdef NAME1
typef(NAME1(lzo1y_decompress_asm))
#endif
#ifdef NAME2
@@ -693,75 +369,3 @@ sizef(NAME1(lzo1y_decompress_asm),.-NAME1(lzo1y_decompress_asm))
#ifdef NAME2
sizef(NAME2(lzo1y_decompress_asm),.-NAME2(lzo1y_decompress_asm))
#endif
-
-#ifdef NAME1
-typef(NAME1(lzo1y_decompress_asm_safe))
-#endif
-#ifdef NAME2
-typef(NAME2(lzo1y_decompress_asm_safe))
-#endif
-#ifdef NAME1
-globalf(NAME1(lzo1y_decompress_asm_safe))
-#endif
-#ifdef NAME2
-globalf(NAME2(lzo1y_decompress_asm_safe))
-#endif
-#ifdef NAME1
-NAME1(lzo1y_decompress_asm_safe):
-#endif
-#ifdef NAME2
-NAME2(lzo1y_decompress_asm_safe):
-#endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
-db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
-db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
-db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
-db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-#ifdef NAME1
-sizef(NAME1(lzo1y_decompress_asm_safe),.-NAME1(lzo1y_decompress_asm_safe))
-#endif
-#ifdef NAME2
-sizef(NAME2(lzo1y_decompress_asm_safe),.-NAME2(lzo1y_decompress_asm_safe))
-#endif
-
diff --git a/app/lzo/asm/i386/src_gas/asminit.def b/app/lzo/asm/i386/src_gas/asminit.def
index 154b8a52..1115582f 100644
--- a/app/lzo/asm/i386/src_gas/asminit.def
+++ b/app/lzo/asm/i386/src_gas/asminit.def
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -40,7 +25,7 @@
http://www.oberhumer.com/opensource/lzo/
*/
-#if defined(__MACH__) && defined(__APPLE__)
+#if (defined(__MACH__) && defined(__APPLE__))
# define NAME1(x) _ ## x
#else
# define NAME1(x) _ ## x
@@ -67,12 +52,16 @@
# define sizef(x,s)
# endif
#endif
-#ifndef db
-# define db .byte
-#endif
-#ifdef __ELF__
+#if defined(__ELF__)
.section .note.GNU-stack,"",@progbits
#endif
.text
+#if defined(__ELF__) || (defined(__MACH__) && defined(__APPLE__)) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
+p2align(6)
+#else
p2align(4)
+#endif
+#ifndef db
+# define db .byte
+#endif
diff --git a/app/lzo/asm/i386/src_gas/lzo1c_s1.S b/app/lzo/asm/i386/src_gas/lzo1c_s1.S
index 8b01a3b0..c21ef485 100644
--- a/app/lzo/asm/i386/src_gas/lzo1c_s1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1c_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/lzo1f_f1.S b/app/lzo/asm/i386/src_gas/lzo1f_f1.S
index e3f5ccf8..eec8c8a6 100644
--- a/app/lzo/asm/i386/src_gas/lzo1f_f1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1f_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/lzo1x_f1.S b/app/lzo/asm/i386/src_gas/lzo1x_f1.S
index 26f42e91..87ef8d7d 100644
--- a/app/lzo/asm/i386/src_gas/lzo1x_f1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1x_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/lzo1x_s1.S b/app/lzo/asm/i386/src_gas/lzo1x_s1.S
index a18a7319..69523a73 100644
--- a/app/lzo/asm/i386/src_gas/lzo1x_s1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1x_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/lzo1y_f1.S b/app/lzo/asm/i386/src_gas/lzo1y_f1.S
index e13fd08d..cfc59937 100644
--- a/app/lzo/asm/i386/src_gas/lzo1y_f1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1y_f1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_gas/lzo1y_s1.S b/app/lzo/asm/i386/src_gas/lzo1y_s1.S
index 269955b0..b7900ca6 100644
--- a/app/lzo/asm/i386/src_gas/lzo1y_s1.S
+++ b/app/lzo/asm/i386/src_gas/lzo1y_s1.S
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/all/asm_all.asm b/app/lzo/asm/i386/src_masm/all/asm_all.asm
index ae982219..c35e2969 100644
--- a/app/lzo/asm/i386/src_masm/all/asm_all.asm
+++ b/app/lzo/asm/i386/src_masm/all/asm_all.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
@@ -74,38 +59,6 @@ db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
-public _lzo1c_decompress_asm_safe
-_lzo1c_decompress_asm_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
-db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
-db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
-db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
-db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
-db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
-db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
-db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
-db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
-db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
-db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
-db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
-db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
-db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
-db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
-db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
-db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
-db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
-db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
-db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
-db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
-db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
-db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
-db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
-db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
-db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
-
public _lzo1f_decompress_asm_fast
_lzo1f_decompress_asm_fast:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
@@ -129,36 +82,6 @@ db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
-public _lzo1f_decompress_asm_fast_safe
-_lzo1f_decompress_asm_fast_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
-db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
-db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
-db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
-db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
-db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
-db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
-db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
-db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
-db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
-db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
-db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
-db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
-db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
-db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
-db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
-db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
-db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
-db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
-db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
-db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
-db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
-db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
-db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
-
public _lzo1x_decompress_asm_fast
_lzo1x_decompress_asm_fast:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
@@ -190,52 +113,6 @@ db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
-public _lzo1x_decompress_asm_fast_safe
-_lzo1x_decompress_asm_fast_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
-db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
-db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
-db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
-db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-
public _lzo1x_decompress_asm
_lzo1x_decompress_asm:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
@@ -269,55 +146,6 @@ db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
-public _lzo1x_decompress_asm_safe
-_lzo1x_decompress_asm_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
-db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
-db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
-db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
-db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-
public _lzo1y_decompress_asm_fast
_lzo1y_decompress_asm_fast:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
@@ -349,52 +177,6 @@ db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
-public _lzo1y_decompress_asm_fast_safe
-_lzo1y_decompress_asm_fast_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
-db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
-db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
-db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
-db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-
public _lzo1y_decompress_asm
_lzo1y_decompress_asm:
db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
@@ -428,53 +210,4 @@ db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
-public _lzo1y_decompress_asm_safe
-_lzo1y_decompress_asm_safe:
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
-db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
-db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
-db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
-db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-
end
diff --git a/app/lzo/asm/i386/src_masm/asminit.def b/app/lzo/asm/i386/src_masm/asminit.def
index df0455f3..81a9d21c 100644
--- a/app/lzo/asm/i386/src_masm/asminit.def
+++ b/app/lzo/asm/i386/src_masm/asminit.def
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1c_s1.asm b/app/lzo/asm/i386/src_masm/lzo1c_s1.asm
index 38910181..f6aae35f 100644
--- a/app/lzo/asm/i386/src_masm/lzo1c_s1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1c_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1f_f1.asm b/app/lzo/asm/i386/src_masm/lzo1f_f1.asm
index 5a24d791..23ee4493 100644
--- a/app/lzo/asm/i386/src_masm/lzo1f_f1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1f_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1x_f1.asm b/app/lzo/asm/i386/src_masm/lzo1x_f1.asm
index 62fe70da..7e77a174 100644
--- a/app/lzo/asm/i386/src_masm/lzo1x_f1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1x_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1x_s1.asm b/app/lzo/asm/i386/src_masm/lzo1x_s1.asm
index 58edebc1..f466aa8a 100644
--- a/app/lzo/asm/i386/src_masm/lzo1x_s1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1x_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1y_f1.asm b/app/lzo/asm/i386/src_masm/lzo1y_f1.asm
index 8ef5c407..c4ff7a36 100644
--- a/app/lzo/asm/i386/src_masm/lzo1y_f1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1y_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_masm/lzo1y_s1.asm b/app/lzo/asm/i386/src_masm/lzo1y_s1.asm
index 18afd548..4c8d7108 100644
--- a/app/lzo/asm/i386/src_masm/lzo1y_s1.asm
+++ b/app/lzo/asm/i386/src_masm/lzo1y_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/all/asm_all.asm b/app/lzo/asm/i386/src_nasm/all/asm_all.asm
index 2751256a..b0df7de7 100644
--- a/app/lzo/asm/i386/src_nasm/all/asm_all.asm
+++ b/app/lzo/asm/i386/src_nasm/all/asm_all.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
@@ -42,9 +27,29 @@
; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+bits 32
+%ifndef __OUTPUT_FORMAT__
+%error "__OUTPUT_FORMAT__ is not defined"
+%endif
+%ifidni __OUTPUT_FORMAT__,elf
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ elf32
+%endif
%ifidni __OUTPUT_FORMAT__,macho
-%define NAME1(x) _ %+ x
-%elifidni __OUTPUT_FORMAT__,macho32
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ macho32
+%endif
+%ifidni __OUTPUT_FORMAT__,win
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win32
+%endif
+%ifdef __YASM_MAJOR__
+%ifidni __OUTPUT_FORMAT__,x64
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win64
+%endif
+%endif
+%ifidni __OUTPUT_FORMAT__,macho32
%define NAME1(x) _ %+ x
%elifidni __OUTPUT_FORMAT__,macho64
%define NAME1(x) _ %+ x
@@ -52,10 +57,7 @@
%define NAME1(x) _ %+ x
%define NAME2(x) x
%endif
-%ifidni __OUTPUT_FORMAT__,elf
-%define globalf(x) global x:function (x %+ _end - x)
-%define globalf_end(x) x %+ _end:
-%elifidni __OUTPUT_FORMAT__,elf32
+%ifidni __OUTPUT_FORMAT__,elf32
%define globalf(x) global x:function (x %+ _end - x)
%define globalf_end(x) x %+ _end:
%elifidni __OUTPUT_FORMAT__,elf64
@@ -65,20 +67,35 @@
%define globalf(x) global x
%define globalf_end(x)
%endif
-bits 32
-%ifidni __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%elifidni __OUTPUT_FORMAT__,elf32
+%ifidni __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%elifidni __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidni __OUTPUT_FORMAT__,obj
-segment _TEXT class=CODE public use32 flat align=16
+%if __BITS__==16
+segment _TEXT class=CODE public use16
+%else
+segment _TEXT class=CODE public use32 flat
+%endif
%else
section .text
%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+align 64
+%elifidni __OUTPUT_FORMAT__,elf64
+align 64
+%elifidni __OUTPUT_FORMAT__,macho32
+align 64
+%elifidni __OUTPUT_FORMAT__,macho64
+align 64
+%elifidni __OUTPUT_FORMAT__,win32
+align 64
+%elifidni __OUTPUT_FORMAT__,win64
+align 64
+%else
align 16
+%endif
%ifdef NAME1
globalf(NAME1(lzo1c_decompress_asm))
@@ -118,54 +135,6 @@ globalf_end(NAME2(lzo1c_decompress_asm))
%endif
%ifdef NAME1
-globalf(NAME1(lzo1c_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1c_decompress_asm_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1c_decompress_asm_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1c_decompress_asm_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
-db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
-db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
-db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
-db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
-db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
-db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
-db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
-db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
-db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
-db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
-db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
-db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
-db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
-db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
-db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
-db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
-db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
-db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
-db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
-db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
-db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
-db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
-db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
-db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
-db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
-%ifdef NAME1
-globalf_end(NAME1(lzo1c_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1c_decompress_asm_safe))
-%endif
-
-%ifdef NAME1
globalf(NAME1(lzo1f_decompress_asm_fast))
%endif
%ifdef NAME2
@@ -205,52 +174,6 @@ globalf_end(NAME2(lzo1f_decompress_asm_fast))
%endif
%ifdef NAME1
-globalf(NAME1(lzo1f_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1f_decompress_asm_fast_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1f_decompress_asm_fast_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1f_decompress_asm_fast_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
-db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
-db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
-db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
-db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
-db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
-db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
-db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
-db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
-db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
-db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
-db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
-db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
-db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
-db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
-db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
-db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
-db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
-db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
-db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
-db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
-db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
-db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
-db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
-db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
-%ifdef NAME1
-globalf_end(NAME1(lzo1f_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1f_decompress_asm_fast_safe))
-%endif
-
-%ifdef NAME1
globalf(NAME1(lzo1x_decompress_asm_fast))
%endif
%ifdef NAME2
@@ -298,68 +221,6 @@ globalf_end(NAME2(lzo1x_decompress_asm_fast))
%endif
%ifdef NAME1
-globalf(NAME1(lzo1x_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1x_decompress_asm_fast_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1x_decompress_asm_fast_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1x_decompress_asm_fast_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
-db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
-db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
-db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
-db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-%ifdef NAME1
-globalf_end(NAME1(lzo1x_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1x_decompress_asm_fast_safe))
-%endif
-
-%ifdef NAME1
globalf(NAME1(lzo1x_decompress_asm))
%endif
%ifdef NAME2
@@ -409,71 +270,6 @@ globalf_end(NAME2(lzo1x_decompress_asm))
%endif
%ifdef NAME1
-globalf(NAME1(lzo1x_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1x_decompress_asm_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1x_decompress_asm_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1x_decompress_asm_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
-db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
-db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
-db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
-db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-%ifdef NAME1
-globalf_end(NAME1(lzo1x_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1x_decompress_asm_safe))
-%endif
-
-%ifdef NAME1
globalf(NAME1(lzo1y_decompress_asm_fast))
%endif
%ifdef NAME2
@@ -521,68 +317,6 @@ globalf_end(NAME2(lzo1y_decompress_asm_fast))
%endif
%ifdef NAME1
-globalf(NAME1(lzo1y_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1y_decompress_asm_fast_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1y_decompress_asm_fast_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1y_decompress_asm_fast_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
-db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
-db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
-db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
-db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
-db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
-db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
-db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
-db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
-db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
-db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
-db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
-db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
-db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
-db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
-db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
-db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
-db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
-db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
-db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
-db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
-db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
-db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
-db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
-db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
-db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
-db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
-db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
-db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
-db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
-db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
-db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
-db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
-db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
-db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
-db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
-db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
-db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
-db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
-db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
-%ifdef NAME1
-globalf_end(NAME1(lzo1y_decompress_asm_fast_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1y_decompress_asm_fast_safe))
-%endif
-
-%ifdef NAME1
globalf(NAME1(lzo1y_decompress_asm))
%endif
%ifdef NAME2
@@ -630,69 +364,3 @@ globalf_end(NAME1(lzo1y_decompress_asm))
%ifdef NAME2
globalf_end(NAME2(lzo1y_decompress_asm))
%endif
-
-%ifdef NAME1
-globalf(NAME1(lzo1y_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf(NAME2(lzo1y_decompress_asm_safe))
-%endif
-%ifdef NAME1
-NAME1(lzo1y_decompress_asm_safe):
-%endif
-%ifdef NAME2
-NAME2(lzo1y_decompress_asm_safe):
-%endif
-db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
-db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
-db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
-db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
-db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
-db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
-db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
-db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
-db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
-db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
-db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
-db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
-db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
-db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
-db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
-db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
-db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
-db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
-db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
-db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
-db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
-db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
-db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
-db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
-db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
-db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
-db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
-db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
-db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
-db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
-db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
-db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
-db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
-db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
-db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
-db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
-db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
-db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
-db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
-db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
-db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
-db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
-db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
-db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
-db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
-db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
-%ifdef NAME1
-globalf_end(NAME1(lzo1y_decompress_asm_safe))
-%endif
-%ifdef NAME2
-globalf_end(NAME2(lzo1y_decompress_asm_safe))
-%endif
-
diff --git a/app/lzo/asm/i386/src_nasm/asminit.def b/app/lzo/asm/i386/src_nasm/asminit.def
index 3f2e0d6e..0ccdb8d7 100644
--- a/app/lzo/asm/i386/src_nasm/asminit.def
+++ b/app/lzo/asm/i386/src_nasm/asminit.def
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
@@ -40,9 +25,30 @@
; http://www.oberhumer.com/opensource/lzo/
;
+bits 32
+%ifndef __OUTPUT_FORMAT__
+%error "__OUTPUT_FORMAT__ is not defined"
+%endif
+%ifidni __OUTPUT_FORMAT__,elf
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ elf32
+%endif
%ifidni __OUTPUT_FORMAT__,macho
-%define NAME1(x) _ %+ x
-%elifidni __OUTPUT_FORMAT__,macho32
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ macho32
+%endif
+%ifidni __OUTPUT_FORMAT__,win
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win32
+%endif
+%ifdef __YASM_MAJOR__
+%ifidni __OUTPUT_FORMAT__,x64
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win64
+%endif
+%endif
+
+%ifidni __OUTPUT_FORMAT__,macho32
%define NAME1(x) _ %+ x
%elifidni __OUTPUT_FORMAT__,macho64
%define NAME1(x) _ %+ x
@@ -51,10 +57,7 @@
%define NAME2(x) x
%endif
-%ifidni __OUTPUT_FORMAT__,elf
-%define globalf(x) global x:function (x %+ _end - x)
-%define globalf_end(x) x %+ _end:
-%elifidni __OUTPUT_FORMAT__,elf32
+%ifidni __OUTPUT_FORMAT__,elf32
%define globalf(x) global x:function (x %+ _end - x)
%define globalf_end(x) x %+ _end:
%elifidni __OUTPUT_FORMAT__,elf64
@@ -65,17 +68,32 @@
%define globalf_end(x)
%endif
-bits 32
-%ifidni __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%elifidni __OUTPUT_FORMAT__,elf32
+%ifidni __OUTPUT_FORMAT__,elf32
section .note.GNU-stack noalloc noexec nowrite progbits
%elifidni __OUTPUT_FORMAT__,elf64
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
%ifidni __OUTPUT_FORMAT__,obj
-segment _TEXT class=CODE public use32 flat align=16
+%if __BITS__==16
+segment _TEXT class=CODE public use16
+%else
+segment _TEXT class=CODE public use32 flat
+%endif
%else
section .text
%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+align 64
+%elifidni __OUTPUT_FORMAT__,elf64
+align 64
+%elifidni __OUTPUT_FORMAT__,macho32
+align 64
+%elifidni __OUTPUT_FORMAT__,macho64
+align 64
+%elifidni __OUTPUT_FORMAT__,win32
+align 64
+%elifidni __OUTPUT_FORMAT__,win64
+align 64
+%else
align 16
+%endif
diff --git a/app/lzo/asm/i386/src_nasm/lzo1c_s1.asm b/app/lzo/asm/i386/src_nasm/lzo1c_s1.asm
index c9bb264a..e35e627b 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1c_s1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1c_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/lzo1f_f1.asm b/app/lzo/asm/i386/src_nasm/lzo1f_f1.asm
index cdbaade2..514ab474 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1f_f1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1f_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/lzo1x_f1.asm b/app/lzo/asm/i386/src_nasm/lzo1x_f1.asm
index a54585fa..585963b7 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1x_f1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1x_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/lzo1x_s1.asm b/app/lzo/asm/i386/src_nasm/lzo1x_s1.asm
index 00d4f4e6..98790b91 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1x_s1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1x_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/lzo1y_f1.asm b/app/lzo/asm/i386/src_nasm/lzo1y_f1.asm
index 1c42cda8..6ca700d8 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1y_f1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1y_f1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/asm/i386/src_nasm/lzo1y_s1.asm b/app/lzo/asm/i386/src_nasm/lzo1y_s1.asm
index f7e42782..b5c6ee75 100644
--- a/app/lzo/asm/i386/src_nasm/lzo1y_s1.asm
+++ b/app/lzo/asm/i386/src_nasm/lzo1y_s1.asm
@@ -2,22 +2,7 @@
;
; This file is part of the LZO real-time data compression library.
;
-; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
-; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
-; 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
+; Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
; All Rights Reserved.
;
; The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/autoconf/compile b/app/lzo/autoconf/compile
index bac481cd..a85b723c 100755
--- a/app/lzo/autoconf/compile
+++ b/app/lzo/autoconf/compile
@@ -1,10 +1,9 @@
#! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
+# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2010-11-15.09; # UTC
+scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -40,7 +39,7 @@ file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
-# Currently only supports Win32 hosts. If the determined conversion
+# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
@@ -79,6 +78,53 @@ func_file_conv ()
esac
}
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
@@ -94,7 +140,7 @@ func_cl_wrapper ()
else
case $1 in
-o)
- # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
@@ -109,43 +155,34 @@ func_cl_wrapper ()
;;
esac
;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
-l*)
- lib=${1#-l}
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- set x "$@" "$dir/$lib.dll.lib"
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- set x "$@" "$dir/$lib.lib"
- break
- fi
- done
- IFS=$save_IFS
-
- test "$found" != yes && set x "$@" "$lib.lib"
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
shift
;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
-L*)
- func_file_conv "${1#-L}"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
+ func_cl_dashL "${1#-L}"
;;
-static)
shared=false
@@ -196,19 +233,19 @@ eat=
case $1 in
'')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
+right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
@@ -233,8 +270,8 @@ do
else
case $1 in
-o)
- # configure might choose to run compile as `compile cc -o foo foo.c'.
- # So we strip `-o arg' only if arg is an object.
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
@@ -261,10 +298,10 @@ do
done
if test -z "$ofile" || test -z "$cfile"; then
- # If no `-o' option was seen then we might have been invoked from a
+ # If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
- # `.c' file was seen then we are probably linking. That is also
+ # '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
@@ -273,7 +310,7 @@ fi
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
-# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
diff --git a/app/lzo/autoconf/config.guess b/app/lzo/autoconf/config.guess
index b02565c7..1f5c50c0 100755
--- a/app/lzo/autoconf/config.guess
+++ b/app/lzo/autoconf/config.guess
@@ -1,14 +1,12 @@
#! /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, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2011-06-03'
+timestamp='2014-03-23'
# 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
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2011-06-03'
# 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.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# 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.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,9 +50,7 @@ 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, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -140,12 +132,33 @@ 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
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
# 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*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -202,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -304,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -792,21 +809,26 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ *:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
@@ -852,15 +874,22 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`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
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -872,56 +901,54 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
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-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -940,54 +967,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC}
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-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1191,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1217,19 +1256,31 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1246,7 +1297,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1315,158 +1366,10 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
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
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
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
+esac
cat >&2 <<EOF
$0: unable to guess system type
diff --git a/app/lzo/autoconf/config.rpath b/app/lzo/autoconf/config.rpath
index 8bd7f5d7..b625621f 100755
--- a/app/lzo/autoconf/config.rpath
+++ b/app/lzo/autoconf/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2011 Free Software Foundation, Inc.
+# Copyright 1996-2014 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -25,7 +25,7 @@
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
@@ -367,11 +367,7 @@ else
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
- freebsd2.2*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- freebsd2*)
+ freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
@@ -548,13 +544,11 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
freebsd* | dragonfly*)
- case "$host_os" in
- freebsd[123]*)
- library_names_spec='$libname$shrext$versuffix' ;;
- *)
- library_names_spec='$libname$shrext' ;;
- esac
+ library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'
diff --git a/app/lzo/autoconf/config.sub b/app/lzo/autoconf/config.sub
index f9fcdc87..d654d03c 100755
--- a/app/lzo/autoconf/config.sub
+++ b/app/lzo/autoconf/config.sub
@@ -1,38 +1,31 @@
#! /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, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2011-06-03'
+timestamp='2014-05-01'
-# 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
+# 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 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# 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.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -75,9 +68,7 @@ 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, 2009, 2010, 2011 Free
-Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -125,13 +116,17 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -154,7 +149,7 @@ case $os in
-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 | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -223,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -247,20 +248,28 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| 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 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
- | c4x | clipper \
+ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -274,24 +283,26 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
- | rx \
+ | rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
@@ -315,8 +326,7 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
- # Motorola 68HC11/12.
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -329,7 +339,10 @@ case $basic_machine in
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
-
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
xscaleeb)
basic_machine=armeb-unknown
;;
@@ -352,25 +365,31 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
+ | c8051-* | 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-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -384,23 +403,27 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* | rx-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
@@ -712,7 +735,6 @@ case $basic_machine in
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
@@ -770,11 +792,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@@ -809,10 +835,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -993,7 +1027,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1320,21 +1358,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -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-android* \
- | -linux-newlib* | -linux-uclibc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1342,7 +1380,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1466,9 +1504,6 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
@@ -1517,6 +1552,12 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
tic54x-*)
os=-coff
;;
@@ -1544,9 +1585,6 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout
diff --git a/app/lzo/autoconf/install-sh b/app/lzo/autoconf/install-sh
index a9244eb0..0b0fdcbb 100755
--- a/app/lzo/autoconf/install-sh
+++ b/app/lzo/autoconf/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-01-19.21; # UTC
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,25 +35,21 @@ scriptversion=2011-01-19.21; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# 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
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,17 +64,6 @@ 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
- }
-'
-
posix_mkdir=
# Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift;;
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
- # Protect names problematic for `test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
- -T) no_target_directory=true;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
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.
@@ -190,7 +186,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
@@ -202,12 +198,21 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -240,7 +245,7 @@ fi
for src
do
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
@@ -269,41 +274,15 @@ do
# 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
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: 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'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
@@ -314,74 +293,74 @@ do
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;;
+ # 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-writable 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
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
@@ -391,53 +370,51 @@ do
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
- eval "$initialize_posix_glob"
-
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && 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/
+ test X"$d" = X && 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
+ # 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
fi
fi
fi
@@ -472,15 +449,12 @@ do
# 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 &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
+ set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
@@ -493,24 +467,24 @@ do
# 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 "$dsttmp" "$dst"
+ # 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 "$dsttmp" "$dst"
}
fi || exit 1
diff --git a/app/lzo/autoconf/local.m4 b/app/lzo/autoconf/local.m4
index 7cebb1dc..5c0ba29d 100644
--- a/app/lzo/autoconf/local.m4
+++ b/app/lzo/autoconf/local.m4
@@ -1,4 +1,4 @@
-dnl Serial 2 mfx/m4/acc.m4
+dnl Serial 3 mfx/m4/acc.m4
AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
@@ -37,7 +37,7 @@ test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
-[[#define ACC_CONFIG_NO_HEADER 1
+[[#define ACC_CFG_NO_CONFIG_HEADER 1
#include "acc/acc.h"
#include "acc/acc_incd.h"
@@ -87,7 +87,7 @@ dnl AS_EXIT
esac
])
-dnl Serial 2 mfx/m4/acc_miniacc.m4
+dnl Serial 3 mfx/m4/acc_miniacc.m4
AC_DEFUN([mfx_MINIACC_ACCCHK], [
mfx_tmp=$1
@@ -98,7 +98,7 @@ test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
-[[#define ACC_CONFIG_NO_HEADER 1
+[[#define ACC_CFG_NO_CONFIG_HEADER 1
#define ACC_WANT_ACC_INCD_H 1
#include $2
@@ -193,17 +193,17 @@ case x$mfx_tmp in
esac
])
-dnl Serial 10 -*- Autoconf -*-
+dnl Serial 13 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
@@ -225,6 +225,7 @@ dnl Serial 10 -*- Autoconf -*-
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
+#
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
@@ -233,36 +234,28 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])
-
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
- [Define to 1 if you need to in order for `stat' and other
+ [Define to 1 if you need to in order for 'stat' and other
things to work.])
AC_DEFINE([_POSIX_1_SOURCE], [2],
[Define to 2 if the system does not provide POSIX.1 features
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
+ AC_DEFINE([_NETBSD_SOURCE], [1],
+ [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
fi
- dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
- dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
- dnl provided.
- case "$host_os" in
- hpux*)
- AC_DEFINE([_XOPEN_SOURCE], [500],
- [Define to 500 only on HP-UX.])
- ;;
- esac
-
- AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-/* Enable general extensions on MacOS X. */
+/* Enable general extensions on OS X. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
@@ -278,6 +271,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
@@ -298,6 +297,22 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])
+ test $ac_cv_should_define__xopen_source = yes &&
+ AC_DEFINE([_XOPEN_SOURCE], [500])
])# AC_USE_SYSTEM_EXTENSIONS
# gl_USE_SYSTEM_EXTENSIONS
@@ -430,6 +445,71 @@ AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
])
+dnl Serial 2 mfx/m4/lzo_lzochk.m4
+
+AC_DEFUN([mfx_LZO_LZOCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the LZO conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define LZO_CFG_NO_CONFIG_HEADER 1
+#define LZO_WANT_ACC_INCD_H 1
+#include $2
+#include $3
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+static void test_lzo_compile_time_assert(void) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+}
+
+#undef NDEBUG
+#include <assert.h>
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) assert(expr);
+static int test_lzo_run_time_assert(int r) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+return r;
+}
+]], [[
+test_lzo_compile_time_assert();
+if (test_lzo_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the LZO conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([LZO conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])
+
dnl Serial 2 mfx/m4/mfx.m4
AC_DEFUN([mfx_CHECK_SIZEOF], [
@@ -468,7 +548,7 @@ AC_C_BIGENDIAN([AC_DEFINE(NRV_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is b
])
# Checks for stat-related time functions.
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2011 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2014 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -487,7 +567,6 @@ dnl From Paul Eggert.
AC_DEFUN([gl_STAT_TIME],
[
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS_ONCE([sys/time.h])
@@ -538,7 +617,6 @@ AC_DEFUN([gl_STAT_TIME],
#
AC_DEFUN([gl_STAT_BIRTHTIME],
[
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
diff --git a/app/lzo/autoconf/ltmain.sh b/app/lzo/autoconf/ltmain.sh
index 04eaea40..a50a21a6 100644
--- a/app/lzo/autoconf/ltmain.sh
+++ b/app/lzo/autoconf/ltmain.sh
@@ -1,10 +1,10 @@
-# Generated from ltmain.m4sh.
+#! /bin/sh
-# libtool (GNU libtool) 2.2.10
+# libtool (GNU libtool) 2.4.2.418
+# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
@@ -24,117 +24,181 @@
# 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.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Usage: $progname [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
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# 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. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.10
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.2.10
-TIMESTAMP=""
-package_revision=1.3175
+VERSION=2.4.2.418
+package_revision=2.4.2.418
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2013-08-23.20; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2013 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.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+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
else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ eval "if test set = \"\${$_G_var+set}\"; then
+ save_$_G_var=\$$_G_var
+ $_G_var=C
+ export $_G_var
+ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp $nl"
+
+# There are still modern systems that have problems with 'echo' mis-
+# handling backslashes, among others, so make sure $bs_echo is set to a
+# command that correctly interprets backslashes.
+# (this code from Autoconf 2.68)
+
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='print -r --'
+ bs_echo_n='print -rn --'
+elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='printf %s\n'
+ bs_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then
+ bs_echo_body='eval /usr/ucb/echo -n "$1$nl"'
+ bs_echo_n='/usr/ucb/echo -n'
+ else
+ bs_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ bs_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$nl"*)
+ expr "X$arg" : "X\\(.*\\)$nl";
+ arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$nl"
+ '
+ export bs_echo_n_body
+ bs_echo_n='sh -c $bs_echo_n_body bs_echo'
+ fi
+ export bs_echo_body
+ bs_echo='sh -c $bs_echo_body bs_echo'
+fi
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+# All uppercase variable names are used for environment variables. These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="$bs_echo"}
: ${EGREP="grep -E"}
: ${FGREP="grep -F"}
: ${GREP="grep"}
@@ -145,624 +209,1828 @@ test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
: ${RM="rm -f"}
: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-exit_status=$EXIT_SUCCESS
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
+# 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'
-# 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 ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -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_result=`$ECHO "${1}" | $SED -e "$basename"`
-}
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same. If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion. Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+ s/$_G_bs4/&\\
+/g
+ s/^$_G_bs2$_G_dollar/$_G_bs&/
+ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+ s/\n//g"
-# Generated shell functions inserted here.
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
- s@/\./@/@g
- t dotsl
- s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test "$func_normal_abspath_tpath" = / ; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result" ; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=${func_dirname_result}
- if test "x$func_relative_path_tlibdir" = x ; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test "x$func_stripname_result" != x ; then
- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
- fi
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
- # Normalisation. If bindir is libdir, return empty string,
- # else relative path ending with a slash; either way, target
- # file name can be directly appended.
- if test ! -z "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result/"
- func_relative_path_result=$func_stripname_result
- fi
-}
+# By convention, finish your script with:
+#
+# exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+# The name of this program.
+progname=`$bs_echo "$progpath" |$SED "$sed_basename"`
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
case $progpath in
[\\/]*|[A-Za-z]:\\*) ;;
*[\\/]*)
- progdir=$func_dirname_result
+ progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"`
progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
+ progpath=$progdir/$progname
;;
*)
- save_IFS="$IFS"
- IFS=:
+ _G_IFS=$IFS
+ IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
- IFS="$save_IFS"
+ IFS=$_G_IFS
test -x "$progdir/$progname" && break
done
- IFS="$save_IFS"
+ IFS=$_G_IFS
test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
+ progpath=$progdir/$progname
;;
esac
-# 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'
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
-# Standard options:
opt_dry_run=false
-opt_help=false
opt_quiet=false
opt_verbose=false
-opt_warning=:
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
+# Categories 'all' and 'none' are always available. Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'. Set
+# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
{
- $ECHO "$progname${mode+: }$mode: $*"
+ $debug_cmd
+
+ test -t 1 && {
+ # COLORTERM and USE_ANSI_COLORS environment variables take
+ # precedence, because most terminfo databases neglect to describe
+ # whether color sequences are supported.
+ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+ if test 1 = "$USE_ANSI_COLORS"; then
+ # Standard ANSI escape sequences
+ tc_reset=''
+ tc_bold=''; tc_standout=''
+ tc_red=''; tc_green=''
+ tc_blue=''; tc_cyan=''
+ else
+ # Otherwise trust the terminfo database after all.
+ test -n "`tput sgr0 2>/dev/null`" && {
+ tc_reset=`tput sgr0`
+ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+ tc_standout=$tc_bold
+ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+ }
+ fi
+ }
+
+ require_term_colors=:
}
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+ # We should try to minimise forks, especially on Windows where they are
+ # unreasonably slow, so skip the feature probes when bash or zsh are
+ # being used:
+ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+ : ${_G_HAVE_ARITH_OP="yes"}
+ : ${_G_HAVE_XSI_OPS="yes"}
+ # The += operator was introduced in bash 3.1
+ case $BASH_VERSION in
+ [12].* | 3.0 | 3.0*) ;;
+ *)
+ : ${_G_HAVE_PLUSEQ_OP="yes"}
+ ;;
+ esac
+ fi
+
+ # _G_HAVE_PLUSEQ_OP
+ # Can be empty, in which case the shell is probed, "yes" if += is
+ # useable or anything else if it does not work.
+ test -z "$_G_HAVE_PLUSEQ_OP" \
+ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+ && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_append ()
+ {
+ $debug_cmd
+
+ eval "$1+=\$2"
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_append ()
+ {
+ $debug_cmd
+
+ eval "$1=\$$1\$2"
+ }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+ eval 'func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1+=\\ \$func_quote_for_eval_result"
+ }'
+else
+ func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE. For example:
+#
+# func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
{
- $opt_verbose && func_echo ${1+"$@"}
+ $debug_cmd
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
+ eval _G_current_value='`$bs_echo $'$1'`'
+ _G_delim=`expr "$2" : '\(.\)'`
+
+ case $_G_delim$_G_current_value$_G_delim in
+ *"$2$_G_delim"*) ;;
+ *) func_append "$@" ;;
+ esac
}
-# func_echo_all arg...
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+ test -z "$_G_HAVE_ARITH_OP" \
+ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+ && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+ eval 'func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=$(( $* ))
+ }'
+else
+ func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=`expr "$@"`
+ }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ # If this shell supports suffix pattern removal, then use it to avoid
+ # forking. Hide the definitions single quotes in case the shell chokes
+ # on unsupported syntax...
+ _b='func_basename_result=${1##*/}'
+ _d='case $1 in
+ */*) func_dirname_result=${1%/*}$2 ;;
+ * ) func_dirname_result=$3 ;;
+ esac'
+
+else
+ # ...otherwise fall back to using sed.
+ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
+ if test "X$func_dirname_result" = "X$1"; then
+ func_dirname_result=$3
+ else
+ func_append func_dirname_result "$2"
+ fi'
+fi
+
+eval 'func_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+ $debug_cmd
+
+ '"$_d"'
+}'
+
+
+# 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"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+ '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $bs_echo "$progname: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
$ECHO "$*"
}
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
{
- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+ $debug_cmd
+
+ $require_term_colors
+
+ _G_infix=$1; shift
+ _G_indent=$_G_infix
+ _G_prefix="$progname: $_G_infix: "
+ _G_message=$*
+
+ # Strip color escape sequences before counting printable length
+ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+ do
+ test -n "$_G_tc" && {
+ _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"`
+ _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"`
+ }
+ done
+ _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
+
+ func_echo_infix_1_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_infix_1_IFS
+ $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+ _G_prefix=$_G_indent
+ done
+ IFS=$func_echo_infix_1_IFS
}
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
{
- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+ $debug_cmd
- # bash bug again:
- :
+ $require_term_colors
+
+ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
}
-# func_fatal_error arg...
+
+# func_fatal_error ARG...
+# -----------------------
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
+ $debug_cmd
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
+ func_error "$*"
+ exit $EXIT_FAILURE
}
-help="Try \`$progname --help' for more information." ## default
-# func_grep expression filename
+# func_grep EXPRESSION FILENAME
+# -----------------------------
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
+ $debug_cmd
+
$GREP "$1" "$2" >/dev/null 2>&1
}
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+ test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=${#1}
+ }'
+else
+ func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+ }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
- my_directory_path="$1"
- my_dir_list=
+ $debug_cmd
+
+ _G_directory_path=$1
+ _G_dir_list=
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
+ # Protect directory names starting with '-'
+ case $_G_directory_path in
+ -*) _G_directory_path=./$_G_directory_path ;;
esac
# While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
+ while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
# list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
+ _G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
+ case $_G_directory_path in */*) ;; *) break ;; esac
# ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
+ func_mkdir_p_IFS=$IFS; IFS=:
+ for _G_dir in $_G_dir_list; do
+ IFS=$func_mkdir_p_IFS
+ # mkdir can fail with a 'File exist' error if two processes
# try to create one of the directories concurrently. Don't
# stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
+ $MKDIR "$_G_dir" 2>/dev/null || :
done
- IFS="$save_mkdir_p_IFS"
+ IFS=$func_mkdir_p_IFS
# Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
+ test -d "$_G_directory_path" || \
+ func_fatal_error "Failed to create '$1'"
fi
}
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
func_mktempdir ()
{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
+ $debug_cmd
+
+ _G_template=${TMPDIR-/tmp}/${1-$progname}
- if test "$opt_dry_run" = ":"; then
+ if test : = "$opt_dry_run"; then
# Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
+ _G_tmpdir=$_G_template-$$
else
# If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
- if test ! -d "$my_tmpdir"; then
+ if test ! -d "$_G_tmpdir"; then
# Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
+ _G_tmpdir=$_G_template-${RANDOM-0}$$
- save_mktempdir_umask=`umask`
+ func_mktempdir_umask=`umask`
umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
+ $MKDIR "$_G_tmpdir"
+ umask $func_mktempdir_umask
fi
# If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ test -d "$_G_tmpdir" || \
+ func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
fi
- $ECHO "$my_tmpdir"
+ $ECHO "$_G_tmpdir"
}
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
+ $debug_cmd
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ _G_pathcar='s|^/\([^/]*\).*$|\1|'
+ _G_pathcdr='s|^/[^/]*||'
+ _G_removedotparts=':dotsl
+ s|/\./|/|g
+ t dotsl
+ s|/\.$|/|'
+ _G_collapseslashes='s|/\{1,\}|/|g'
+ _G_finalslash='s|/*$|/|'
+
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
;;
*)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
esac
+
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test / = "$func_normal_abspath_tpath"; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result"; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}
-# func_quote_for_expand arg
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+ $debug_cmd
+
+ $opt_quiet || func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+ $debug_cmd
+
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=$func_dirname_result
+ if test -z "$func_relative_path_tlibdir"; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test -n "$func_stripname_result"; then
+ func_append func_relative_path_result "/$func_stripname_result"
+ fi
+
+ # Normalisation. If bindir is libdir, return '.' else relative path.
+ if test -n "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ fi
+
+ test -n "$func_relative_path_result" || func_relative_path_result=.
+
+ :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+# i) func_quote_for_eval_result
+# double-quoted, suitable for a subsequent eval
+# ii) func_quote_for_eval_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified.
+func_quote_for_eval ()
+{
+ $debug_cmd
+
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+ case $1 in
+ *[\\\`\"\$]*)
+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+ *)
+ _G_unquoted_arg=$1 ;;
+ esac
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ fi
+
+ case $_G_unquoted_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_quoted_arg=\"$_G_unquoted_arg\"
+ ;;
+ *)
+ _G_quoted_arg=$_G_unquoted_arg
+ ;;
+ esac
+
+ if test -n "$func_quote_for_eval_result"; then
+ func_append func_quote_for_eval_result " $_G_quoted_arg"
+ else
+ func_append func_quote_for_eval_result "$_G_quoted_arg"
+ fi
+ shift
+ done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
+ $debug_cmd
+
case $1 in
*[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ _G_arg=`$ECHO "$1" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
*)
- my_arg="$1" ;;
+ _G_arg=$1 ;;
esac
- case $my_arg in
+ case $_G_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting and command substitution for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
+ _G_arg=\"$_G_arg\"
;;
esac
- func_quote_for_expand_result="$my_arg"
+ func_quote_for_expand_result=$_G_arg
}
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# 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).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_stripname ()
+ {
+ $debug_cmd
+
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary variable first.
+ func_stripname_result=$3
+ func_stripname_result=${func_stripname_result#"$1"}
+ func_stripname_result=${func_stripname_result%"$2"}
+ }'
+else
+ func_stripname ()
+ {
+ $debug_cmd
+
+ case $2 in
+ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+ esac
+ }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
- my_cmd="$1"
- my_fail_exp="${2-:}"
+ $debug_cmd
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
+ func_quote_for_expand "$_G_cmd"
+ eval "func_notquiet $func_quote_for_expand_result"
+
+ $opt_dry_run || {
+ eval "$_G_cmd"
+ _G_status=$?
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
fi
- fi
+ }
}
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. Use the saved locale for evaluation.
func_show_eval_locale ()
{
- my_cmd="$1"
- my_fail_exp="${2-:}"
+ $debug_cmd
+
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
+ $opt_quiet || {
+ func_quote_for_expand "$_G_cmd"
eval "func_echo $func_quote_for_expand_result"
}
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
+ $opt_dry_run || {
+ eval "$_G_user_locale
+ $_G_cmd"
+ _G_status=$?
+ eval "$_G_safe_locale"
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
fi
- fi
+ }
}
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
{
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
+ $debug_cmd
+
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
}
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
{
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
+ $debug_cmd
+
+ $opt_verbose && func_echo "$*"
+
+ :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+ $debug_cmd
+
+ # CATEGORY must be in the warning_categories list!
+ case " $warning_categories " in
+ *" $1 "*) ;;
+ *) func_internal_error "invalid warning category '$1'" ;;
+ esac
+
+ _G_category=$1
+ shift
+
+ case " $opt_warning_types " in
+ *" $_G_category "*) $warning_func ${1+"$@"} ;;
+ esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+ $debug_cmd
+
+ ver1=$1
+ ver2=$2
+
+ # Split on '.' and compare each component.
+ i=1
+ while :; do
+ p1=`echo "$ver1" |cut -d. -f$i`
+ p2=`echo "$ver2" |cut -d. -f$i`
+ if test ! "$p1"; then
+ echo "$1 $2"
+ break
+ elif test ! "$p2"; then
+ echo "$2 $1"
+ break
+ elif test ! "$p1" = "$p2"; then
+ if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison
+ echo "$2 $1"
+ elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison
+ echo "$1 $2"
+ else # numeric, then lexicographic comparison
+ lp=`printf "$p1\n$p2\n" |sort -n |tail -n1`
+ if test "$lp" = "$p2"; then
+ echo "$1 $2"
+ else
+ echo "$2 $1"
+ fi
+ fi
+ break
+ fi
+ i=`expr $i + 1`
+ done
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2012-10-21.11; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2013 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.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+# #!/bin/sh
+# . relative/path/to/funclib.sh
+# . relative/path/to/options-parser
+# scriptversion=1.0
+# func_options ${1+"$@"}
+# eval set dummy "$func_options_result"; shift
+# ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'. Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+ --debug enable verbose shell tracing
+ -W, --warnings=CATEGORY
+ report the warnings falling in CATEGORY [all]
+ -v, --verbose verbosely report processing
+ --version print version information and exit
+ -h, --help print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+ 'all' show all warnings
+ 'none' turn off all the warnings
+ 'error' warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code. A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+ $debug_cmd
+
+ func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not accept hook functions." ;;
+ esac
+
+ eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+ $debug_cmd
+
+ eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ esac
+
+ eval _G_hook_fns=\$$1_hooks; shift
+
+ for _G_hook in $_G_hook_fns; do
+ eval $_G_hook '"$@"'
+
+ # store returned options list back into positional
+ # parameters for next 'cmd' execution.
+ eval _G_hook_result=\$${_G_hook}_result
+ eval set dummy "$_G_hook_result"; shift
+ done
+
+ func_quote_for_eval ${1+"$@"}
+ func_run_hooks_result=$func_quote_for_eval_result
}
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'. Like this:
+#
+# my_options_prep ()
+# {
+# $debug_cmd
+#
+# # Extend the existing usage message.
+# usage_message=$usage_message'
+# -s, --silent don'\''t print informational messages
+# '
+#
+# func_quote_for_eval ${1+"$@"}
+# my_options_prep_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_options_prep my_options_prep
+#
+#
+# my_silent_option ()
+# {
+# $debug_cmd
+#
+# # Note that for efficiency, we parse as many options as we can
+# # recognise in a loop before passing the remainder back to the
+# # caller on the first unrecognised argument we encounter.
+# while test $# -gt 0; do
+# opt=$1; shift
+# case $opt in
+# --silent|-s) opt_silent=: ;;
+# # Separate non-argument short options:
+# -s*) func_split_short_opt "$_G_opt"
+# set dummy "$func_split_short_opt_name" \
+# "-$func_split_short_opt_arg" ${1+"$@"}
+# shift
+# ;;
+# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# esac
+# done
+#
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_parse_options my_silent_option
+#
+#
+# my_option_validation ()
+# {
+# $debug_cmd
+#
+# $opt_silent && $opt_verbose && func_fatal_help "\
+# '--silent' and '--verbose' options are mutually exclusive."
+#
+# func_quote_for_eval ${1+"$@"}
+# my_option_validation_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse. It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+ $debug_cmd
+
+ func_options_prep ${1+"$@"}
+ eval func_parse_options \
+ ${func_options_prep_result+"$func_options_prep_result"}
+ eval func_validate_options \
+ ${func_parse_options_result+"$func_parse_options_result"}
+
+ eval func_run_hooks func_options \
+ ${func_validate_options_result+"$func_validate_options_result"}
+
+ # save modified positional parameters for caller
+ func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters. If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+ $debug_cmd
+
+ # Option defaults:
+ opt_verbose=false
+ opt_warning_types=
+
+ func_run_hooks func_options_prep ${1+"$@"}
+
+ # save modified positional parameters for caller
+ func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+ $debug_cmd
+
+ func_parse_options_result=
+
+ # this just eases exit handling
+ while test $# -gt 0; do
+ # Defer to hook functions for initial option parsing, so they
+ # get priority in the event of reusing an option name.
+ func_run_hooks func_parse_options ${1+"$@"}
+
+ # Adjust func_parse_options positional parameters to match
+ eval set dummy "$func_run_hooks_result"; shift
+
+ # Break out of the loop if we already parsed every option.
+ test $# -gt 0 || break
+
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --debug|-x) debug_cmd='set -x'
+ func_echo "enabling shell trace mode"
+ $debug_cmd
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ set dummy --warnings none ${1+"$@"}
+ shift
+ ;;
+
+ --warnings|--warning|-W)
+ test $# = 0 && func_missing_arg $_G_opt && break
+ case " $warning_categories $1" in
+ *" $1 "*)
+ # trailing space prevents matching last $1 above
+ func_append_uniq opt_warning_types " $1"
+ ;;
+ *all)
+ opt_warning_types=$warning_categories
+ ;;
+ *none)
+ opt_warning_types=none
+ warning_func=:
+ ;;
+ *error)
+ opt_warning_types=$warning_categories
+ warning_func=func_fatal_error
+ ;;
+ *)
+ func_fatal_error \
+ "unsupported warning category: '$1'"
+ ;;
+ esac
+ shift
+ ;;
+
+ --verbose|-v) opt_verbose=: ;;
+ --version) func_version ;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+
+ # Separate optargs to long options (plugins may need this):
+ --*=*) func_split_equals "$_G_opt"
+ set dummy "$func_split_equals_lhs" \
+ "$func_split_equals_rhs" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate optargs to short options:
+ -W*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-v*|-x*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+ $debug_cmd
+
+ # Display all warnings if -W was not given.
+ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+ func_run_hooks func_validate_options ${1+"$@"}
+
+ # Bail if the options were screwed!
+ $exit_cmd $EXIT_FAILURE
+
+ # save modified positional parameters for caller
+ func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ $debug_cmd
+
+ eval \$bs_echo \""Usage: $usage"\"
+ eval \$bs_echo \""$fatal_help"\"
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
func_help ()
{
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
- p
- }' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
+ $debug_cmd
+
+ func_usage_message
+ $bs_echo "$long_help_message"
+ exit 0
}
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
- func_error "missing argument for $1."
+ $debug_cmd
+
+ func_error "Missing argument for '$1'."
exit_cmd=exit
}
-exit_cmd=:
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_equals ()
+ {
+ $debug_cmd
+ func_split_equals_lhs=${1%%=*}
+ func_split_equals_rhs=${1#*=}
+ test "x$func_split_equals_lhs" = "x$1" \
+ && func_split_equals_rhs=
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_equals ()
+ {
+ $debug_cmd
+ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+ func_split_equals_rhs=
+ test "x$func_split_equals_lhs" = "x$1" \
+ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+ }
+fi #func_split_equals
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_short_opt ()
+ {
+ $debug_cmd
-# Global variables.
-# $mode is unset
-nonopt=
-execute_dlfiles=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_short_opt ()
+ {
+ $debug_cmd
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
+ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+ }
+fi #func_split_short_opt
-# 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=
-# func_fatal_configuration arg...
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $bs_echo "Run '$progname --help |${PAGER-more}' for full usage"
+ exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+ $debug_cmd
+
+ eval \$bs_echo \""Usage: $usage"\"
+ echo
+ $SED -n 's|^# ||
+ /^Written by/{
+ x;p;x
+ }
+ h
+ /^Written by/q' < "$progpath"
+ echo
+ eval \$bs_echo \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ printf '%s\n' "$progname $scriptversion"
+ $SED -n '/^##/q
+ /(C)/!b go
+ :more
+ /\./!{
+ N
+ s|\n# | |
+ b more
+ }
+ :go
+ /^# Written by /,/# warranty; / {
+ s|^# ||
+ s|^# *$||
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ p
+ }
+ /^# Written by / {
+ s|^# ||
+ p
+ }
+ /^warranty; /q' < "$progpath"
+
+ exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.2.418'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ $debug_cmd
+
+ $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+ --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
+ --mode=MODE use operation mode MODE
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message=$long_help_message"
+
+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. When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+ host-triplet: $host
+ shell: $SHELL
+ compiler: $LTCC
+ compiler flags: $LTCFLAGS
+ linker: $LD (gnu? $with_gnu_ld)
+ version: $progname (GNU libtool) 2.4.2.418
+ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_lo2o ()
+ {
+ case $1 in
+ *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+ * ) func_lo2o_result=$1 ;;
+ esac
+ }'
+
+ # func_xform LIBOBJ-OR-SOURCE
+ # ---------------------------
+ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+ # suffix to a '.lo' libtool-object suffix.
+ eval 'func_xform ()
+ {
+ func_xform_result=${1%.*}.lo
+ }'
+else
+ # ...otherwise fall back to using sed.
+ func_lo2o ()
+ {
+ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+ }
+
+ func_xform ()
+ {
+ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+ }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
+ func__fatal_error ${1+"$@"} \
+ "See the $PACKAGE documentation for more information." \
+ "Fatal configuration error."
}
# func_config
+# -----------
# Display the configuration for all the tags in this script.
func_config ()
{
@@ -780,17 +2048,19 @@ func_config ()
exit $?
}
+
# func_features
+# -------------
# Display the features supported by this script.
func_features ()
{
echo "host: $host"
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
echo "enable shared libraries"
else
echo "disable shared libraries"
fi
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
echo "enable static libraries"
else
echo "disable static libraries"
@@ -799,256 +2069,325 @@ func_features ()
exit $?
}
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
# Verify that TAGNAME is valid, and either flag an error and exit, or
# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
# variable here.
func_enable_tag ()
{
- # Global variable:
- tagname="$1"
+ # Global variable:
+ tagname=$1
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf=/$re_begincf/,/$re_endcf/p
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-# Parse options once, thoroughly. This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
-{
-
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
- compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
- execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
- finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
- install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
- link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
- esac
-
- # Parse non-mode specific arguments:
- while test "$#" -gt 0; do
- opt="$1"
- shift
-
- case $opt in
- --config) func_config ;;
-
- --debug) preserve_args="$preserve_args $opt"
- func_echo "enabling shell trace mode"
- opt_debug='set -x'
- $opt_debug
- ;;
-
- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
- execute_dlfiles="$execute_dlfiles $1"
- shift
- ;;
-
- --dry-run | -n) opt_dry_run=: ;;
- --features) func_features ;;
- --finish) mode="finish" ;;
-
- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
- case $1 in
- # Valid mode arguments:
- clean) ;;
- compile) ;;
- execute) ;;
- finish) ;;
- install) ;;
- link) ;;
- relink) ;;
- uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
- esac
-
- mode="$1"
- shift
- ;;
-
- --preserve-dup-deps)
- opt_duplicate_deps=: ;;
-
- --quiet|--silent) preserve_args="$preserve_args $opt"
- opt_silent=:
- opt_verbose=false
- ;;
-
- --no-quiet|--no-silent)
- preserve_args="$preserve_args $opt"
- opt_silent=false
- ;;
-
- --verbose| -v) preserve_args="$preserve_args $opt"
- opt_silent=false
- opt_verbose=:
- ;;
-
- --no-verbose) preserve_args="$preserve_args $opt"
- opt_verbose=false
- ;;
-
- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
- preserve_args="$preserve_args $opt $1"
- func_enable_tag "$1" # tagname is set here
- shift
- ;;
-
- # Separate optargs to long options:
- -dlopen=*|--mode=*|--tag=*)
- func_opt_split "$opt"
- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
- shift
- ;;
-
- -\?|-h) func_usage ;;
- --help) opt_help=: ;;
- --help-all) opt_help=': help-all' ;;
- --version) func_version ;;
-
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
-
- *) nonopt="$opt"
- break
- ;;
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
esac
- done
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
*)
- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
- ;;
- esac
-
- # Having warned about all mis-specified options, bail out if
- # anything was wrong.
- $exit_cmd $EXIT_FAILURE
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
}
+
# func_check_version_match
+# ------------------------
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
- else
- cat >&2 <<_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
$progname: of $PACKAGE $VERSION and run autoconf again.
_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
fi
+}
- exit $EXIT_MISMATCH
- fi
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+ $debug_mode
+
+ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+ opt_help=false
+ opt_mode=
+ opt_preserve_dup_deps=false
+ opt_quiet=false
+
+ nonopt=
+ preserve_args=
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Pass back the list of options.
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
}
+func_add_hook func_options_prep libtool_options_prep
-## ----------- ##
-## Main. ##
-## ----------- ##
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+ $debug_cmd
-$opt_help || {
- # Sanity checks first:
- func_check_version_match
+ # Perform our own loop to consume as many options as possible in
+ # each iteration.
+ while test $# -gt 0; do
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+
+ --config) func_config ;;
+
+ --dlopen|-dlopen)
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=: ;;
+
+ --features) func_features ;;
+
+ --finish) set dummy --mode finish ${1+"$@"}; shift ;;
+
+ --help) opt_help=: ;;
+
+ --help-all) opt_help=': help-all' ;;
+
+ --mode) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_mode=$1
+ case $1 in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $_G_opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+ shift
+ ;;
+
+ --no-silent|--no-quiet)
+ opt_quiet=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ opt_warning=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-verbose)
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --silent|--quiet)
+ opt_quiet=:
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --tag) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_tag=$1
+ func_append preserve_args " $_G_opt $1"
+ func_enable_tag "$1"
+ shift
+ ;;
+
+ --verbose|-v) opt_quiet=false
+ opt_verbose=:
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
- test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+ # save first non-option argument
+ if test 0 -lt $#; then
+ nonopt=$1
+ shift
+ fi
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
+ # preserve --debug
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ test yes != "$build_libtool_libs" \
+ && test yes != "$build_old_libs" \
+ && func_fatal_configuration "not configured to build any kind of library"
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$mode' for more information."
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+ func_error "unrecognized option '-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
+
+ # Pass back the unparsed argument list
+ func_quote_for_eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_for_eval_result
}
+func_add_hook func_validate_options libtool_validate_options
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# 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=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
@@ -1059,12 +2398,12 @@ func_lalib_p ()
}
# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs. To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
+# fatal anyway. Works if 'file' does not exist.
func_lalib_unsafe_p ()
{
lalib_p=no
@@ -1072,13 +2411,13 @@ func_lalib_unsafe_p ()
for lalib_p_l in 1 2 3 4
do
read lalib_p_line
- case "$lalib_p_line" in
+ case $lalib_p_line in
\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
esac
done
exec 0<&5 5<&-
fi
- test "$lalib_p" = yes
+ test yes = "$lalib_p"
}
# func_ltwrapper_script_p file
@@ -1110,12 +2449,9 @@ func_ltwrapper_executable_p ()
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
- func_ltwrapper_scriptname_result=""
- if func_ltwrapper_executable_p "$1"; then
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- fi
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
}
# func_ltwrapper_p file
@@ -1134,11 +2470,13 @@ func_ltwrapper_p ()
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
- $opt_debug
+ $debug_cmd
+
save_ifs=$IFS; IFS='~'
for cmd in $1; do
- IFS=$save_ifs
+ IFS=$sp$nl
eval cmd=\"$cmd\"
+ IFS=$save_ifs
func_show_eval "$cmd" "${2-:}"
done
IFS=$save_ifs
@@ -1150,10 +2488,11 @@ func_execute_cmds ()
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
func_source ()
{
- $opt_debug
+ $debug_cmd
+
case $1 in
*/* | *\\*) . "$1" ;;
*) . "./$1" ;;
@@ -1161,6 +2500,37 @@ func_source ()
}
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case $lt_sysroot:$1 in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result='='$func_stripname_result
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
@@ -1169,12 +2539,12 @@ func_source ()
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
- $opt_debug
+ $debug_cmd
+
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
@@ -1189,12 +2559,11 @@ func_infer_tag ()
for z in $available_tags; do
if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
@@ -1215,7 +2584,7 @@ func_infer_tag ()
# line option must be used.
if test -z "$tagname"; then
func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
+ func_fatal_error "specify a tag with '--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
@@ -1231,15 +2600,15 @@ func_infer_tag ()
# but don't create it if we're doing a dry run.
func_write_libtool_object ()
{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
+ write_libobj=$1
+ if test yes = "$build_libtool_libs"; then
+ write_lobj=\'$2\'
else
write_lobj=none
fi
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
+ if test yes = "$build_old_libs"; then
+ write_oldobj=\'$3\'
else
write_oldobj=none
fi
@@ -1247,7 +2616,7 @@ func_write_libtool_object ()
$opt_dry_run || {
cat >${write_libobj}T <<EOF
# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
@@ -1259,17 +2628,536 @@ pic_object=$write_lobj
non_pic_object=$write_oldobj
EOF
- $MV "${write_libobj}T" "${write_libobj}"
+ $MV "${write_libobj}T" "$write_libobj"
}
}
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $debug_cmd
+
+ func_convert_core_file_wine_to_w32_result=$1
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $debug_cmd
+
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result"; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $debug_cmd
+
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $debug_cmd
+
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $debug_cmd
+
+ if test -z "$2" && test -n "$1"; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result=$1
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $debug_cmd
+
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " '$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result=$3
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $debug_cmd
+
+ case $4 in
+ $1 ) func_to_host_path_result=$3$func_to_host_path_result
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via '$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $debug_cmd
+
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $debug_cmd
+
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result=$1
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_msys_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via '$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $debug_cmd
+
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd=func_convert_path_$func_stripname_result
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $debug_cmd
+
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result=$1
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_msys_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+ $debug_cmd
+
+ func_dll_def_p_tmp=`$SED -n \
+ -e 's/^[ ]*//' \
+ -e '/^\(;.*\)*$/d' \
+ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
+ -e q \
+ "$1"`
+ test DEF = "$func_dll_def_p_tmp"
+}
+
+
# func_mode_compile arg...
func_mode_compile ()
{
- $opt_debug
+ $debug_cmd
+
# Get the compilation command and the source file.
base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ srcfile=$nonopt # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output=
arg_mode=normal
@@ -1282,12 +3170,12 @@ func_mode_compile ()
case $arg_mode in
arg )
# do not "continue". Instead, add this to base_compile
- lastarg="$arg"
+ lastarg=$arg
arg_mode=normal
;;
target )
- libobj="$arg"
+ libobj=$arg
arg_mode=normal
continue
;;
@@ -1297,18 +3185,18 @@ func_mode_compile ()
case $arg in
-o)
test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
+ func_fatal_error "you cannot specify '-o' more than once"
arg_mode=target
continue
;;
-pie | -fpie | -fPIE)
- pie_flag="$pie_flag $arg"
+ func_append pie_flag " $arg"
continue
;;
-shared | -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
+ func_append later " $arg"
continue
;;
@@ -1326,18 +3214,17 @@ func_mode_compile ()
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
lastarg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for arg in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$arg"
- lastarg="$lastarg $func_quote_for_eval_result"
+ IFS=$save_ifs
+ func_append_quoted lastarg "$arg"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$lastarg"
lastarg=$func_stripname_result
# Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
+ func_append base_compile " $lastarg"
continue
;;
@@ -1345,16 +3232,15 @@ func_mode_compile ()
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
- lastarg="$srcfile"
- srcfile="$arg"
+ lastarg=$srcfile
+ srcfile=$arg
;;
esac # case $arg
;;
esac # case $arg_mode
# Aesthetically quote the previous argument.
- func_quote_for_eval "$lastarg"
- base_compile="$base_compile $func_quote_for_eval_result"
+ func_append_quoted base_compile "$lastarg"
done # for arg
case $arg_mode in
@@ -1362,13 +3248,13 @@ func_mode_compile ()
func_fatal_error "you must specify an argument for -Xcompile"
;;
target)
- func_fatal_error "you must specify a target with \`-o'"
+ func_fatal_error "you must specify a target with '-o'"
;;
*)
# Get the name of the library object.
test -z "$libobj" && {
func_basename "$srcfile"
- libobj="$func_basename_result"
+ libobj=$func_basename_result
}
;;
esac
@@ -1379,7 +3265,7 @@ func_mode_compile ()
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
@@ -1388,7 +3274,7 @@ func_mode_compile ()
case $libobj in
*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
*)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
+ func_fatal_error "cannot determine name of library object from '$libobj'"
;;
esac
@@ -1397,8 +3283,8 @@ func_mode_compile ()
for arg in $later; do
case $arg in
-shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
+ test yes = "$build_libtool_libs" \
+ || func_fatal_configuration "cannot build a shared library"
build_old_libs=no
continue
;;
@@ -1424,17 +3310,17 @@ func_mode_compile ()
func_quote_for_eval "$libobj"
test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ && func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
- lobj=${xdir}$objdir/$objname
+ objname=$func_basename_result
+ xdir=$func_dirname_result
+ lobj=$xdir$objdir/$objname
test -z "$base_compile" && \
func_fatal_help "you must specify a compilation command"
# Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
removelist="$obj $lobj $libobj ${libobj}T"
else
removelist="$lobj $libobj ${libobj}T"
@@ -1446,16 +3332,16 @@ func_mode_compile ()
pic_mode=default
;;
esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
+ if test no = "$compiler_c_o"; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+ lockfile=$output_obj.lock
else
output_obj=
need_locks=no
@@ -1464,12 +3350,12 @@ func_mode_compile ()
# 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
+ if test yes = "$need_locks"; then
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
- elif test "$need_locks" = warn; then
+ elif test warn = "$need_locks"; then
if test -f "$lockfile"; then
$ECHO "\
*** ERROR, $lockfile exists and contains:
@@ -1477,7 +3363,7 @@ func_mode_compile ()
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
+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."
@@ -1485,26 +3371,25 @@ compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
- removelist="$removelist $output_obj"
+ func_append removelist " $output_obj"
$ECHO "$srcfile" > "$lockfile"
fi
$opt_dry_run || $RM $removelist
- removelist="$removelist $lockfile"
+ func_append removelist " $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
- if test "$pic_mode" != no; then
+ if test no != "$pic_mode"; then
command="$base_compile $qsrcfile $pic_flag"
else
# Don't build PIC code
@@ -1515,13 +3400,13 @@ compiler."
if test -z "$output_obj"; then
# Place PIC objects in $objdir
- command="$command -o $lobj"
+ func_append command " -o $lobj"
fi
func_show_eval_locale "$command" \
'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
- if test "$need_locks" = warn &&
+ if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
@@ -1532,7 +3417,7 @@ $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
+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."
@@ -1548,29 +3433,29 @@ compiler."
fi
# Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
+ if test yes = "$suppress_opt"; then
suppress_output=' >/dev/null 2>&1'
fi
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
+ if test yes = "$build_old_libs"; then
+ if test yes != "$pic_mode"; then
# Don't build PIC code
command="$base_compile $qsrcfile$pie_flag"
else
command="$base_compile $qsrcfile $pic_flag"
fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
+ if test yes = "$compiler_c_o"; then
+ func_append command " -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
+ func_append command "$suppress_output"
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
- if test "$need_locks" = warn &&
+ if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
@@ -1581,7 +3466,7 @@ $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
+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."
@@ -1601,7 +3486,7 @@ compiler."
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
# Unlock the critical section if it was locked
- if test "$need_locks" != no; then
+ if test no != "$need_locks"; then
removelist=$lockfile
$RM "$lockfile"
fi
@@ -1611,13 +3496,13 @@ compiler."
}
$opt_help || {
- test "$mode" = compile && func_mode_compile ${1+"$@"}
+ test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
}
func_mode_help ()
{
# We need to display help for each of the modes.
- case $mode in
+ case $opt_mode in
"")
# Generic help is extracted from the usage comments
# at the start of this file.
@@ -1631,7 +3516,7 @@ func_mode_help ()
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
+(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
@@ -1650,16 +3535,16 @@ This mode accepts the following additional options:
-no-suppress do not suppress compiler output for multiple passes
-prefer-pic try to build PIC objects only
-prefer-non-pic try to build non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
+ -shared do not build a '.o' file suitable for static linking
+ -static only build a '.o' file suitable for static linking
-Wc,FLAG pass FLAG directly to the compiler
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+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'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
;;
execute)
@@ -1672,7 +3557,7 @@ 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'
+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
@@ -1691,7 +3576,7 @@ 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."
+the '--dry-run' option if you just want to see what would be executed."
;;
install)
@@ -1701,7 +3586,7 @@ the \`--dry-run' option if you just want to see what would be executed."
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
The following components of INSTALL-COMMAND are treated specially:
@@ -1727,7 +3612,7 @@ The following components of LINK-COMMAND are treated specially:
-avoid-version do not add a version suffix if possible
-bindir BINDIR specify path to binaries directory (for systems where
libraries must be found in the PATH setting at runtime)
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -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
@@ -1761,20 +3646,20 @@ The following components of LINK-COMMAND are treated specially:
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
-Every other argument is treated as a filename. Files ending in \`.la' are
+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
+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 '.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
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
is created, otherwise an executable program is created."
;;
@@ -1785,7 +3670,7 @@ is created, otherwise an executable program is created."
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
+(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.
@@ -1793,28 +3678,28 @@ Otherwise, only FILE itself is deleted using RM."
;;
*)
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode '$opt_mode'"
;;
esac
echo
- $ECHO "Try \`$progname --help' for more information about other modes."
+ $ECHO "Try '$progname --help' for more information about other modes."
}
# Now that we've collected a possible --mode arg, show help if necessary
if $opt_help; then
- if test "$opt_help" = :; then
+ if test : = "$opt_help"; then
func_mode_help
else
{
func_help noexit
- for mode in compile link execute install finish uninstall clean; do
+ for opt_mode in compile link execute install finish uninstall clean; do
func_mode_help
done
} | sed -n '1p; 2,$s/^Usage:/ or: /p'
{
func_help noexit
- for mode in compile link execute install finish uninstall clean; do
+ for opt_mode in compile link execute install finish uninstall clean; do
echo
func_mode_help
done
@@ -1836,23 +3721,27 @@ fi
# func_mode_execute arg...
func_mode_execute ()
{
- $opt_debug
+ $debug_cmd
+
# The first argument is the command name.
- cmd="$nonopt"
+ cmd=$nonopt
test -z "$cmd" && \
func_fatal_help "you must specify a COMMAND"
# Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
+ for file in $opt_dlopen; do
test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
+ || func_fatal_help "'$file' is not a file"
dir=
case $file in
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
+ || func_fatal_help "'$lib' is not a valid libtool archive"
# Read the libtool library.
dlname=
@@ -1863,18 +3752,18 @@ func_mode_execute ()
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
+ func_warning "'$file' was not linked with '-export-dynamic'"
continue
fi
func_dirname "$file" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
+ func_append dir "/$objdir"
else
if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
fi
fi
;;
@@ -1882,18 +3771,18 @@ func_mode_execute ()
*.lo)
# Just add the directory containing the .lo file.
func_dirname "$file" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
;;
*)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
+ test -n "$absdir" && dir=$absdir
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
@@ -1905,7 +3794,7 @@ func_mode_execute ()
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
- libtool_execute_magic="$magic"
+ libtool_execute_magic=$magic
# Check if any of the arguments is a wrapper script.
args=
@@ -1918,21 +3807,28 @@ func_mode_execute ()
if func_ltwrapper_script_p "$file"; then
func_source "$file"
# Transform arg to wrapped name.
- file="$progdir/$program"
+ file=$progdir/$program
elif func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
func_source "$func_ltwrapper_scriptname_result"
# Transform arg to wrapped name.
- file="$progdir/$program"
+ file=$progdir/$program
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
- func_quote_for_eval "$file"
- args="$args $func_quote_for_eval_result"
+ func_append_quoted args "$file"
done
- if test "X$opt_dry_run" = Xfalse; then
+ if $opt_dry_run; then
+ # 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 $EXIT_SUCCESS
+ else
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
@@ -1949,34 +3845,64 @@ func_mode_execute ()
done
# 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 $EXIT_SUCCESS
+ exec_cmd=\$cmd$args
fi
}
-test "$mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
# func_mode_finish arg...
func_mode_finish ()
{
- $opt_debug
- libdirs="$nonopt"
+ $debug_cmd
+
+ libs=
+ libdirs=
admincmds=
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "'$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument '$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
@@ -1986,73 +3912,77 @@ func_mode_finish ()
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
+ $opt_quiet && exit $EXIT_SUCCESS
- 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\"
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ 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 " - 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"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
exit $EXIT_SUCCESS
}
-test "$mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
# func_mode_install arg...
func_mode_install ()
{
- $opt_debug
+ $debug_cmd
+
# 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 ||
+ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
# Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac; then
+ case $nonopt in *shtool*) :;; *) false;; esac
+ then
# Aesthetically quote it.
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
@@ -2066,7 +3996,7 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_for_eval "$arg"
- install_prog="$install_prog$func_quote_for_eval_result"
+ func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@@ -2079,20 +4009,20 @@ func_mode_install ()
opts=
prev=
install_type=
- isdir=no
+ isdir=false
stripme=
no_mode=:
for arg
do
arg2=
if test -n "$dest"; then
- files="$files $dest"
+ func_append files " $dest"
dest=$arg
continue
fi
case $arg in
- -d) isdir=yes ;;
+ -d) isdir=: ;;
-f)
if $install_cp; then :; else
prev=$arg
@@ -2110,7 +4040,7 @@ func_mode_install ()
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
- if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ if test X-m = "X$prev" && test -n "$install_override_mode"; then
arg2=$install_override_mode
no_mode=false
fi
@@ -2124,23 +4054,23 @@ func_mode_install ()
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
- install_prog="$install_prog $func_quote_for_eval_result"
+ func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then
func_quote_for_eval "$arg2"
fi
- install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
+ func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
func_fatal_help "you must specify an install program"
test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
+ func_fatal_help "the '$prev' option requires an argument"
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
func_quote_for_eval "$install_override_mode"
- install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
fi
fi
@@ -2157,19 +4087,19 @@ func_mode_install ()
dest=$func_stripname_result
# Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
+ test -d "$dest" && isdir=:
+ if $isdir; then
+ destdir=$dest
destname=
else
func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
+ destdir=$func_dirname_result
+ destname=$func_basename_result
# Not a directory, so check to see that there is only one file specified.
set dummy $files; shift
test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
+ func_fatal_help "'$dest' is not a directory"
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2178,7 +4108,7 @@ func_mode_install ()
case $file in
*.lo) ;;
*)
- func_fatal_help "\`$destdir' must be an absolute directory name"
+ func_fatal_help "'$destdir' must be an absolute directory name"
;;
esac
done
@@ -2187,7 +4117,7 @@ func_mode_install ()
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
- libtool_install_magic="$magic"
+ libtool_install_magic=$magic
staticlibs=
future_libdirs=
@@ -2198,13 +4128,16 @@ func_mode_install ()
case $file in
*.$libext)
# Do the static libraries later.
- staticlibs="$staticlibs $file"
+ func_append staticlibs " $file"
;;
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
+ || func_fatal_help "'$file' is not a valid libtool archive"
library_names=
old_library=
@@ -2215,19 +4148,19 @@ func_mode_install ()
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
+ *) func_append current_libdirs " $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
+ *) func_append future_libdirs " $libdir" ;;
esac
fi
func_dirname "$file" "/" ""
- dir="$func_dirname_result"
- dir="$dir$objdir"
+ dir=$func_dirname_result
+ func_append dir "$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
@@ -2240,7 +4173,7 @@ func_mode_install ()
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -2249,29 +4182,29 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
- func_warning "relinking \`$file'"
+ func_warning "relinking '$file'"
func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
fi
# See the names of the shared library.
set dummy $library_names; shift
if test -n "$1"; then
- realname="$1"
+ realname=$1
shift
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
+ srcname=$realname
+ test -n "$relink_command" && srcname=${realname}T
# Install the shared library and build the symlinks.
func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
'exit $?'
- tstripme="$stripme"
+ tstripme=$stripme
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
case $realname in
*.dll.a)
- tstripme=""
+ tstripme=
;;
esac
;;
@@ -2282,7 +4215,7 @@ func_mode_install ()
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
+ # Try 'ln -sf' first, because the 'ln' binary might depend on
# the symlink we replace! Solaris /bin/ln does not understand -f,
# so we also need to try rm && ln -s.
for linkname
@@ -2293,18 +4226,18 @@ func_mode_install ()
fi
# Do each command in the postinstall commands.
- lib="$destdir/$realname"
+ lib=$destdir/$realname
func_execute_cmds "$postinstall_cmds" 'exit $?'
fi
# Install the pseudo-library for information purposes.
func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
+ name=$func_basename_result
+ instname=$dir/${name}i
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
;;
*.lo)
@@ -2312,11 +4245,11 @@ func_mode_install ()
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
- destfile="$destdir/$destname"
+ destfile=$destdir/$destname
else
func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
fi
# Deduce the name of the destination old-style object file.
@@ -2326,11 +4259,11 @@ func_mode_install ()
staticdest=$func_lo2o_result
;;
*.$objext)
- staticdest="$destfile"
+ staticdest=$destfile
destfile=
;;
*)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ func_fatal_help "cannot copy a libtool object to '$destfile'"
;;
esac
@@ -2339,7 +4272,7 @@ func_mode_install ()
func_show_eval "$install_prog $file $destfile" 'exit $?'
# Install the old object if enabled.
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
# Deduce the name of the old-style object file.
func_lo2o "$file"
staticobj=$func_lo2o_result
@@ -2351,23 +4284,23 @@ func_mode_install ()
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
- destfile="$destdir/$destname"
+ destfile=$destdir/$destname
else
func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
- stripped_ext=""
+ stripped_ext=
case $file in
*.exe)
if test ! -f "$file"; then
func_stripname '' '.exe' "$file"
file=$func_stripname_result
- stripped_ext=".exe"
+ stripped_ext=.exe
fi
;;
esac
@@ -2395,19 +4328,19 @@ func_mode_install ()
# Check the variables that should have been set.
test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+ func_fatal_error "invalid libtool wrapper script '$wrapper'"
- finalize=yes
+ finalize=:
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
func_source "$lib"
fi
- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
+ func_warning "'$lib' has not been installed in '$libdir'"
+ finalize=false
fi
done
@@ -2415,29 +4348,29 @@ func_mode_install ()
func_source "$wrapper"
outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
+ if test no = "$fast_install" && test -n "$relink_command"; then
$opt_dry_run || {
- if test "$finalize" = yes; then
+ if $finalize; then
tmpdir=`func_mktempdir`
func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
+ file=$func_basename_result
+ outputname=$tmpdir/$file
# Replace the output file specification.
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
- $opt_silent || {
+ $opt_quiet || {
func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
- func_error "error: relink \`$file' with the above command before installing it"
+ func_error "error: relink '$file' with the above command before installing it"
$opt_dry_run || ${RM}r "$tmpdir"
continue
fi
- file="$outputname"
+ file=$outputname
else
- func_warning "cannot relink \`$file'"
+ func_warning "cannot relink '$file'"
fi
}
else
@@ -2474,15 +4407,17 @@ func_mode_install ()
for file in $staticlibs; do
func_basename "$file"
- name="$func_basename_result"
+ name=$func_basename_result
# Set up the ranlib parameters.
- oldlib="$destdir/$name"
+ oldlib=$destdir/$name
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $oldlib" 'exit $?'
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -2490,18 +4425,18 @@ func_mode_install ()
done
test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
+ func_warning "remember to run '$progname --finish$future_libdirs'"
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
$opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
else
exit $EXIT_SUCCESS
fi
}
-test "$mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
@@ -2509,16 +4444,17 @@ test "$mode" = install && func_mode_install ${1+"$@"}
# a dlpreopen symbol table.
func_generate_dlsyms ()
{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
+ $debug_cmd
+
+ my_outputname=$1
+ my_originator=$2
+ my_pic_p=${3-false}
my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
my_dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
+ my_dlsyms=${my_outputname}S.c
else
func_error "not configured to extract global symbols from dlpreopened files"
fi
@@ -2529,7 +4465,7 @@ func_generate_dlsyms ()
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
+ nlist=$output_objdir/$my_outputname.nm
func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
@@ -2537,30 +4473,45 @@ func_generate_dlsyms ()
func_verbose "creating $output_objdir/$my_dlsyms"
$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
#ifdef __cplusplus
extern \"C\" {
#endif
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#endif
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
/* External symbol declarations for the compiler. */\
"
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
+ if test yes = "$dlself"; then
+ func_verbose "generating symbol list for '$output'"
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
for progfile in $progfiles; do
- func_verbose "extracting global C symbols from \`$progfile'"
- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
@@ -2579,10 +4530,10 @@ extern \"C\" {
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
+ export_symbols=$output_objdir/$outputname.exp
$opt_dry_run || {
$RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
*cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -2592,7 +4543,7 @@ extern \"C\" {
}
else
$opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
@@ -2606,13 +4557,55 @@ extern \"C\" {
fi
for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_verbose "extracting global C symbols from '$dlprefile'"
func_basename "$dlprefile"
- name="$func_basename_result"
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
+ name=$func_basename_result
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname"; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename=$func_basename_result
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename"; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
done
$opt_dry_run || {
@@ -2643,6 +4636,11 @@ extern \"C\" {
echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
fi
+ func_show_eval '$RM "${nlist}I"'
+ if test -n "$global_symbol_to_import"; then
+ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+ fi
+
echo >> "$output_objdir/$my_dlsyms" "\
/* The mapping between symbol names and symbols. */
@@ -2650,29 +4648,31 @@ typedef struct {
const char *name;
void *address;
} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];\
"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
+
+ if test -s "$nlist"I; then
echo >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs. */"
- lt_dlsym_const= ;;
- *osf5*)
+static void lt_syminit(void)
+{
+ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+ for (; symbol->name; ++symbol)
+ {"
+ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
- lt_dlsym_const= ;;
- *)
- lt_dlsym_const=const ;;
- esac
-
+ }
+}"
+ fi
echo >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
+LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {\"@INIT@\", (void *) &lt_syminit},"
+ fi
case $need_lib_prefix in
no)
@@ -2709,14 +4709,12 @@ static const void *lt_preloaded_setup() {
# 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*)
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
*)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
+ $my_pic_p && pic_flag_for_symtable=" $pic_flag"
;;
esac
;;
@@ -2725,7 +4723,7 @@ static const void *lt_preloaded_setup() {
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
- *) symtab_cflags="$symtab_cflags $arg" ;;
+ *) func_append symtab_cflags " $arg" ;;
esac
done
@@ -2733,10 +4731,10 @@ static const void *lt_preloaded_setup() {
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
# Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
+ symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
*cygwin* | *mingw* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
@@ -2754,7 +4752,7 @@ static const void *lt_preloaded_setup() {
esac
;;
*)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ func_fatal_error "unknown suffix for '$my_dlsyms'"
;;
esac
else
@@ -2768,6 +4766,32 @@ static const void *lt_preloaded_setup() {
fi
}
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
# func_win32_libid arg
# return the library type of file 'arg'
#
@@ -2777,8 +4801,9 @@ static const void *lt_preloaded_setup() {
# Despite the name, also deal with 64 bit binaries.
func_win32_libid ()
{
- $opt_debug
- win32_libid_type="unknown"
+ $debug_cmd
+
+ win32_libid_type=unknown
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
@@ -2788,15 +4813,29 @@ func_win32_libid ()
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- win32_nmres=`eval $NM -f posix -A $1 |
- $SED -n -e '
+ case $nm_interface in
+ "MS dumpbin")
+ if func_cygming_ms_implib_p "$1" ||
+ func_cygming_gnu_implib_p "$1"
+ then
+ win32_nmres=import
+ else
+ win32_nmres=
+ fi
+ ;;
+ *)
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
1,100{
/ I /{
- s,.*,import,
+ s|.*|import|
p
q
}
}'`
+ ;;
+ esac
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
@@ -2817,15 +4856,120 @@ func_win32_libid ()
$ECHO "$win32_libid_type"
}
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $debug_cmd
+
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $debug_cmd
+
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive that possess that section. Heuristic: eliminate
+ # all those that have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $debug_cmd
+
+ if func_cygming_gnu_implib_p "$1"; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1"; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=
+ fi
+}
# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- if test "$lock_old_archive_extraction" = yes; then
+ $debug_cmd
+
+ f_ex_an_ar_dir=$1; shift
+ f_ex_an_ar_oldlib=$1
+ if test yes = "$lock_old_archive_extraction"; then
lockfile=$f_ex_an_ar_oldlib.lock
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
@@ -2834,7 +4978,7 @@ func_extract_an_archive ()
fi
func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
'stat=$?; rm -f "$lockfile"; exit $stat'
- if test "$lock_old_archive_extraction" = yes; then
+ if test yes = "$lock_old_archive_extraction"; then
$opt_dry_run || rm -f "$lockfile"
fi
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -2848,22 +4992,23 @@ func_extract_an_archive ()
# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
- $opt_debug
- my_gentop="$1"; shift
+ $debug_cmd
+
+ my_gentop=$1; shift
my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
+ my_oldobjs=
+ my_xlib=
+ my_xabs=
+ my_xdir=
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
func_basename "$my_xlib"
- my_xlib="$func_basename_result"
+ my_xlib=$func_basename_result
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
@@ -2875,7 +5020,7 @@ func_extract_archives ()
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
+ my_xdir=$my_gentop/$my_xlib_u
func_mkdir_p "$my_xdir"
@@ -2888,19 +5033,20 @@ func_extract_archives ()
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
+ func_basename "$darwin_archive"
+ darwin_base_archive=$func_basename_result
darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
if test -n "$darwin_arches"; then
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ for darwin_arch in $darwin_arches; do
+ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+ cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+ func_extract_an_archive "`pwd`" "$darwin_base_archive"
cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
done # $darwin_arches
## Okay now we've a bunch of thin objects, gotta fatten them up :)
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
@@ -2925,7 +5071,7 @@ func_extract_archives ()
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
- func_extract_archives_result="$my_oldobjs"
+ func_extract_archives_result=$my_oldobjs
}
@@ -2940,7 +5086,7 @@ func_extract_archives ()
#
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
# the $objdir directory. This is a cygwin/mingw-specific
# behavior.
func_emit_wrapper ()
@@ -2951,7 +5097,7 @@ func_emit_wrapper ()
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
@@ -3008,9 +5154,9 @@ _LTECHO_EOF'
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
@@ -3043,7 +5189,7 @@ func_parse_lt_options ()
# Print the debug banner immediately:
if test -n \"\$lt_option_debug\"; then
- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
fi
}
@@ -3054,7 +5200,7 @@ func_lt_dump_args ()
lt_dump_args_N=1;
for lt_arg
do
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
done
}
@@ -3068,7 +5214,7 @@ func_exec_program_core ()
*-*-mingw | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3078,7 +5224,7 @@ func_exec_program_core ()
*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -3095,14 +5241,17 @@ func_exec_program_core ()
# launches target application with the remaining arguments.
func_exec_program ()
{
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
func_exec_program_core \${1+\"\$@\"}
}
@@ -3150,13 +5299,13 @@ func_exec_program ()
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
- if test "$fast_install" = yes; then
+ if test yes = "$fast_install"; then
$ECHO "\
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\"
@@ -3195,8 +5344,20 @@ func_exec_program ()
if test -f \"\$progdir/\$program\"; then"
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
# Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -3209,14 +5370,6 @@ func_exec_program ()
"
fi
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
$ECHO "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
@@ -3224,7 +5377,7 @@ func_exec_program ()
fi
else
# The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$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
@@ -3234,166 +5387,6 @@ fi\
}
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin. Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
- func_to_host_path_result="$1"
- if test -n "$1"; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- case $build in
- *mingw* ) # actually, msys
- # awkward: cmd appends spaces to result
- func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_path_result=`cygpath -w "$1" |
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # Unfortunately, winepath does not exit with a non-zero
- # error code, so we are forced to check the contents of
- # stdout. On the other hand, if the command is not
- # found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both
- # error code of zero AND non-empty stdout, which explains
- # the odd construction:
- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
- func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
- $SED -e "$lt_sed_naive_backslashify"`
- else
- # Allow warning below.
- func_to_host_path_result=
- fi
- ;;
- esac
- if test -z "$func_to_host_path_result" ; then
- func_error "Could not determine host path corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_path_result="$1"
- fi
- ;;
- esac
- fi
-}
-# end: func_to_host_path
-
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
- func_to_host_pathlist_result="$1"
- if test -n "$1"; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_pathlist_tmp1=$func_stripname_result
- case $build in
- *mingw* ) # Actually, msys.
- # Awkward: cmd appends spaces to result.
- func_to_host_pathlist_result=`
- ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # unfortunately, winepath doesn't convert pathlists
- func_to_host_pathlist_result=""
- func_to_host_pathlist_oldIFS=$IFS
- IFS=:
- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
- IFS=$func_to_host_pathlist_oldIFS
- if test -n "$func_to_host_pathlist_f" ; then
- func_to_host_path "$func_to_host_pathlist_f"
- if test -n "$func_to_host_path_result" ; then
- if test -z "$func_to_host_pathlist_result" ; then
- func_to_host_pathlist_result="$func_to_host_path_result"
- else
- func_append func_to_host_pathlist_result ";$func_to_host_path_result"
- fi
- fi
- fi
- done
- IFS=$func_to_host_pathlist_oldIFS
- ;;
- esac
- if test -z "$func_to_host_pathlist_result"; then
- func_error "Could not determine the host path(s) corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This may break if $1 contains DOS-style drive
- # specifications. The fix is not to complicate the expression
- # below, but for the user to provide a working wine installation
- # with winepath so that path translation in the cross-to-mingw
- # case works properly.
- lt_replace_pathsep_nix_to_dos="s|:|;|g"
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_replace_pathsep_nix_to_dos"`
- fi
- # Now, add the leading and trailing path separators back
- case "$1" in
- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
- ;;
- esac
- case "$1" in
- *: ) func_append func_to_host_pathlist_result ";"
- ;;
- esac
- ;;
- esac
- fi
-}
-# end: func_to_host_pathlist
-
# func_emit_cwrapperexe_src
# emit the source code for a wrapper executable on stdout
# Must ONLY be called from within func_mode_link because
@@ -3403,7 +5396,7 @@ func_emit_cwrapperexe_src ()
cat <<EOF
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+ Generated by $PROGRAM (GNU $PACKAGE) $VERSION
The $output program cannot be directly executed until all the libtool
libraries that it depends on are installed.
@@ -3438,47 +5431,45 @@ EOF
#include <fcntl.h>
#include <sys/stat.h>
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
# ifdef __STRICT_ANSI__
int _putenv (const char *);
# endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
char *realpath (const char *, char *);
int putenv (char *);
int setenv (const char *, const char *, int);
# endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
#endif
/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
# define putenv _putenv
# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
# define putenv _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
# define HAVE_SETENV
# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
#endif
-#if defined(PATH_MAX)
+#if defined PATH_MAX
# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
@@ -3497,8 +5488,8 @@ int setenv (const char *, const char *, int);
# define PATH_SEPARATOR ':'
#endif
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+ defined __OS2__
# define HAVE_DOS_BASED_FILE_SYSTEM
# define FOPEN_WB "wb"
# ifndef DIR_SEPARATOR_2
@@ -3531,10 +5522,10 @@ int setenv (const char *, const char *, int);
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
+ if (stale) { free (stale); stale = 0; } \
} while (0)
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
static int lt_debug = 1;
#else
static int lt_debug = 0;
@@ -3563,14 +5554,14 @@ void lt_dump_script (FILE *f);
EOF
cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
EOF
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_pathlist "$temp_rpath"
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
@@ -3579,10 +5570,10 @@ EOF
fi
if test -n "$dllsearchpath"; then
- func_to_host_pathlist "$dllsearchpath:"
+ func_to_host_path "$dllsearchpath:"
cat <<EOF
const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
@@ -3591,7 +5582,7 @@ const char * EXE_PATH_VALUE = "";
EOF
fi
- if test "$fast_install" = yes; then
+ if test yes = "$fast_install"; then
cat <<EOF
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
EOF
@@ -3620,12 +5611,12 @@ main (int argc, char *argv[])
char *actual_cwrapper_name;
char *target_name;
char *lt_argv_zero;
- intptr_t rval = 127;
+ int rval = 127;
int i;
program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, argc + 1);
+ newargz = XMALLOC (char *, (size_t) argc + 1);
/* very simple arg parsing; don't want to rely on getopt
* also, copy all non cwrapper options to newargz, except
@@ -3634,10 +5625,10 @@ main (int argc, char *argv[])
newargc=0;
for (i = 1; i < argc; i++)
{
- if (strcmp (argv[i], dumpscript_opt) == 0)
+ if (STREQ (argv[i], dumpscript_opt))
{
EOF
- case "$host" in
+ case $host in
*mingw* | *cygwin* )
# make stdout use "unix" line endings
echo " setmode(1,_O_BINARY);"
@@ -3648,12 +5639,12 @@ EOF
lt_dump_script (stdout);
return 0;
}
- if (strcmp (argv[i], debug_opt) == 0)
+ if (STREQ (argv[i], debug_opt))
{
lt_debug = 1;
continue;
}
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ if (STREQ (argv[i], ltwrapper_option_prefix))
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
@@ -3676,7 +5667,7 @@ EOF
EOF
cat <<EOF
/* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
EOF
cat <<"EOF"
lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -3765,8 +5756,12 @@ EOF
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
nonnull (lt_argv_zero));
@@ -3783,7 +5778,7 @@ EOF
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
newargz = prepare_spawn (newargz);
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
if (rval == -1)
{
/* failed to start process */
@@ -3828,7 +5823,7 @@ base_name (const char *name)
{
const char *base;
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
/* Skip over the disk name in MSDOS pathnames. */
if (isalpha ((unsigned char) name[0]) && name[1] == ':')
name += 2;
@@ -3887,7 +5882,7 @@ find_executable (const char *wrapper)
const char *p_next;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1];
- int tmp_len;
+ size_t tmp_len;
char *concat_name;
lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -3897,7 +5892,7 @@ find_executable (const char *wrapper)
return NULL;
/* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
{
concat_name = xstrdup (wrapper);
@@ -3915,7 +5910,7 @@ find_executable (const char *wrapper)
return concat_name;
XFREE (concat_name);
}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
}
#endif
@@ -3938,7 +5933,7 @@ find_executable (const char *wrapper)
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR (*q))
break;
- p_len = q - p;
+ p_len = (size_t) (q - p);
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
@@ -4057,7 +6052,7 @@ strendzap (char *str, const char *pat)
if (patlen <= len)
{
str += len - patlen;
- if (strcmp (str, pat) == 0)
+ if (STREQ (str, pat))
*str = '\0';
}
return str;
@@ -4122,7 +6117,7 @@ lt_setenv (const char *name, const char *value)
char *str = xstrdup (value);
setenv (name, str, 1);
#else
- int len = strlen (name) + 1 + strlen (value) + 1;
+ size_t len = strlen (name) + 1 + strlen (value) + 1;
char *str = XMALLOC (char, len);
sprintf (str, "%s=%s", name, value);
if (putenv (str) != EXIT_SUCCESS)
@@ -4139,8 +6134,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
char *new_value;
if (orig_value && *orig_value)
{
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
+ size_t orig_value_len = strlen (orig_value);
+ size_t add_len = strlen (add);
new_value = XMALLOC (char, add_len + orig_value_len + 1);
if (to_end)
{
@@ -4171,10 +6166,10 @@ lt_update_exe_path (const char *name, const char *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
/* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ size_t len = strlen (new_value);
+ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
{
- new_value[len-1] = '\0';
+ new_value[--len] = '\0';
}
lt_setenv (name, new_value);
XFREE (new_value);
@@ -4322,9 +6317,15 @@ void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
-
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
cat <<"EOF"
}
EOF
@@ -4335,7 +6336,8 @@ EOF
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
{
- $opt_debug
+ $debug_cmd
+
case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
*import*) : ;;
*) false ;;
@@ -4345,17 +6347,18 @@ func_win32_import_lib_p ()
# func_mode_link arg...
func_mode_link ()
{
- $opt_debug
+ $debug_cmd
+
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
# 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
+ # what system we are compiling for in order to pass an extra
# flag for every libtool invocation.
# 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
+ # to make a dll that 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.
@@ -4402,7 +6405,7 @@ func_mode_link ()
non_pic_objects=
precious_files_regex=
prefer_static_libs=no
- preload=no
+ preload=false
prev=
prevarg=
release=
@@ -4414,7 +6417,7 @@ func_mode_link ()
vinfo=
vinfo_number=no
weak_libs=
- single_module="${wl}-single_module"
+ single_module=$wl-single_module
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames.
@@ -4422,15 +6425,15 @@ func_mode_link ()
do
case $arg in
-shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
+ test yes != "$build_libtool_libs" \
+ && func_fatal_configuration "cannot build a shared library"
build_old_libs=no
break
;;
-all-static | -static | -static-libtool-libs)
case $arg in
-all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
func_warning "complete static linking is impossible in this configuration"
fi
if test -n "$link_static_flag"; then
@@ -4463,7 +6466,7 @@ func_mode_link ()
# Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do
- arg="$1"
+ arg=$1
shift
func_quote_for_eval "$arg"
qarg=$func_quote_for_eval_unquoted_result
@@ -4480,21 +6483,21 @@ func_mode_link ()
case $prev in
bindir)
- bindir="$arg"
+ bindir=$arg
prev=
continue
;;
dlfiles|dlprefiles)
- if test "$preload" = no; then
+ $preload || {
# Add the symbol object into the linking commands.
func_append compile_command " @SYMFILE@"
func_append finalize_command " @SYMFILE@"
- preload=yes
- fi
+ preload=:
+ }
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
- if test "$dlself" = no; then
+ if test no = "$dlself"; then
dlself=needless
export_dynamic=yes
fi
@@ -4502,9 +6505,9 @@ func_mode_link ()
continue
;;
self)
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
dlself=yes
else
dlself=needless
@@ -4514,10 +6517,10 @@ func_mode_link ()
continue
;;
*)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
+ if test dlfiles = "$prev"; then
+ func_append dlfiles " $arg"
else
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $arg"
fi
prev=
continue
@@ -4525,14 +6528,14 @@ func_mode_link ()
esac
;;
expsyms)
- export_symbols="$arg"
+ export_symbols=$arg
test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
+ || func_fatal_error "symbol file '$arg' does not exist"
prev=
continue
;;
expsyms_regex)
- export_symbols_regex="$arg"
+ export_symbols_regex=$arg
prev=
continue
;;
@@ -4541,7 +6544,7 @@ func_mode_link ()
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
;;
esac
;;
@@ -4550,7 +6553,13 @@ func_mode_link ()
continue
;;
inst_prefix)
- inst_prefix_dir="$arg"
+ inst_prefix_dir=$arg
+ prev=
+ continue
+ ;;
+ mllvm)
+ # Clang does not use LLVM to link, so we can simply discard any
+ # '-mllvm $arg' options when doing the link step.
prev=
continue
;;
@@ -4560,7 +6569,7 @@ func_mode_link ()
moreargs=
for fil in `cat "$save_arg"`
do
-# moreargs="$moreargs $fil"
+# func_append moreargs " $fil"
arg=$fil
# A libtool-controlled object.
@@ -4574,22 +6583,22 @@ func_mode_link ()
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
- if test "$pic_object" != none; then
+ if test none != "$pic_object"; then
# Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
+ pic_object=$xdir$pic_object
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
prev=
continue
else
@@ -4599,31 +6608,31 @@ func_mode_link ()
fi
# CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
- arg="$pic_object"
+ arg=$pic_object
fi
# Non-PIC object.
- if test "$non_pic_object" != none; then
+ if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
+ non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
+ non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
@@ -4631,7 +6640,7 @@ func_mode_link ()
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
@@ -4639,24 +6648,24 @@ func_mode_link ()
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
done
else
- func_fatal_error "link input file \`$arg' does not exist"
+ func_fatal_error "link input file '$arg' does not exist"
fi
arg=$save_arg
prev=
continue
;;
precious_regex)
- precious_files_regex="$arg"
+ precious_files_regex=$arg
prev=
continue
;;
release)
- release="-$arg"
+ release=-$arg
prev=
continue
;;
@@ -4668,48 +6677,48 @@ func_mode_link ()
func_fatal_error "only absolute run-paths are allowed"
;;
esac
- if test "$prev" = rpath; then
+ if test rpath = "$prev"; then
case "$rpath " in
*" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
+ *) func_append rpath " $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
+ *) func_append xrpath " $arg" ;;
esac
fi
prev=
continue
;;
shrext)
- shrext_cmds="$arg"
+ shrext_cmds=$arg
prev=
continue
;;
weak)
- weak_libs="$weak_libs $arg"
+ func_append weak_libs " $arg"
prev=
continue
;;
xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xcompiler)
- compiler_flags="$compiler_flags $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
@@ -4723,7 +6732,7 @@ func_mode_link ()
esac
fi # test -n "$prev"
- prevarg="$arg"
+ prevarg=$arg
case $arg in
-all-static)
@@ -4737,7 +6746,7 @@ func_mode_link ()
-allow-undefined)
# FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ func_fatal_error "'-allow-undefined' must not be used because it is the default"
;;
-avoid-version)
@@ -4769,7 +6778,7 @@ func_mode_link ()
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
func_fatal_error "more than one -exported-symbols argument is not allowed"
fi
- if test "X$arg" = "X-export-symbols"; then
+ if test X-export-symbols = "X$arg"; then
prev=expsyms
else
prev=expsyms_regex
@@ -4800,30 +6809,37 @@ func_mode_link ()
;;
-L*)
- func_stripname '-L' '' "$arg"
- dir=$func_stripname_result
- if test -z "$dir"; then
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
+ func_fatal_error "require no space between '-L' and '$1'"
else
- func_fatal_error "need path for \`-L' option"
+ func_fatal_error "need path for '-L' option"
fi
fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
- dir="$absdir"
+ func_fatal_error "cannot determine absolute directory name of '$dir'"
+ dir=$absdir
;;
esac
case "$deplibs " in
- *" -L$dir "*) ;;
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
*)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
;;
esac
case $host in
@@ -4832,12 +6848,12 @@ func_mode_link ()
case :$dllsearchpath: in
*":$dir:"*) ;;
::) dllsearchpath=$dir;;
- *) dllsearchpath="$dllsearchpath:$dir";;
+ *) func_append dllsearchpath ":$dir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
@@ -4845,7 +6861,7 @@ func_mode_link ()
;;
-l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
@@ -4853,35 +6869,40 @@ func_mode_link ()
;;
*-*-os2*)
# These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
esac
- elif test "X$arg" = "X-lc_r"; then
+ elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
- deplibs="$deplibs $arg"
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -mllvm)
+ prev=mllvm
continue
;;
@@ -4893,27 +6914,28 @@ func_mode_link ()
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot)
- compiler_flags="$compiler_flags $arg"
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- compiler_flags="$compiler_flags $arg"
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
esac
continue
;;
-multi_module)
- single_module="${wl}-multi_module"
+ single_module=$wl-multi_module
continue
;;
@@ -4927,8 +6949,8 @@ func_mode_link ()
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
+ func_warning "'-no-install' is ignored for $host"
+ func_warning "assuming '-no-fast-install' instead"
fast_install=no
;;
*) no_install=yes ;;
@@ -4974,13 +6996,17 @@ func_mode_link ()
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
continue
;;
@@ -5029,14 +7055,14 @@ func_mode_link ()
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
- arg="$arg $func_quote_for_eval_result"
- compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -5045,15 +7071,15 @@ func_mode_link ()
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- linker_flags="$linker_flags $func_quote_for_eval_result"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -5076,7 +7102,7 @@ func_mode_link ()
# -msg_* for osf cc
-msg_*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
# Flags to be passed through unchanged, with rationale:
@@ -5090,25 +7116,29 @@ func_mode_link ()
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC
# @file GCC response files
# -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -stdlib=* select c++ std lib with clang
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
- compiler_flags="$compiler_flags $arg"
+ func_append compiler_flags " $arg"
continue
;;
# Some other compiler flag.
-* | +*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
*.$objext)
# A standard object.
- objs="$objs $arg"
+ func_append objs " $arg"
;;
*.lo)
@@ -5124,22 +7154,22 @@ func_mode_link ()
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
- if test "$pic_object" != none; then
+ test none = "$pic_object" || {
# Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
+ pic_object=$xdir$pic_object
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
prev=
continue
else
@@ -5149,31 +7179,31 @@ func_mode_link ()
fi
# CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
+ arg=$pic_object
+ }
# Non-PIC object.
- if test "$non_pic_object" != none; then
+ if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
+ non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
+ non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
@@ -5181,7 +7211,7 @@ func_mode_link ()
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
@@ -5189,31 +7219,32 @@ func_mode_link ()
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
;;
*.$libext)
# An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
continue
;;
*.la)
# A libtool-controlled library.
- if test "$prev" = dlfiles; then
+ func_resolve_sysroot "$arg"
+ if test dlfiles = "$prev"; then
# This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
+ func_append dlfiles " $func_resolve_sysroot_result"
prev=
- elif test "$prev" = dlprefiles; then
+ elif test dlprefiles = "$prev"; then
# The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $func_resolve_sysroot_result"
prev=
else
- deplibs="$deplibs $arg"
+ func_append deplibs " $func_resolve_sysroot_result"
fi
continue
;;
@@ -5223,7 +7254,7 @@ func_mode_link ()
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
esac # arg
@@ -5235,9 +7266,9 @@ func_mode_link ()
done # argument parsing loop
test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
+ func_fatal_help "the '$prevarg' option requires an argument"
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -5246,12 +7277,12 @@ func_mode_link ()
oldlibs=
# calculate the name of the file, without its directory
func_basename "$output"
- outputname="$func_basename_result"
- libobjs_save="$libobjs"
+ outputname=$func_basename_result
+ libobjs_save=$libobjs
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
else
shlib_search_path=
fi
@@ -5259,7 +7290,9 @@ func_mode_link ()
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
+ output_objdir=$func_dirname_result$objdir
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
# Create the object directory.
func_mkdir_p "$output_objdir"
@@ -5280,15 +7313,15 @@ func_mode_link ()
# 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 $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps; then
case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- libs="$libs $deplib"
+ func_append libs " $deplib"
done
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
# Compute libraries that are listed more than once in $predeps
@@ -5298,9 +7331,9 @@ func_mode_link ()
if $opt_duplicate_compiler_generated_deps; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
+ func_append pre_post_deps " $pre_post_dep"
done
fi
pre_post_deps=
@@ -5320,7 +7353,7 @@ func_mode_link ()
case $file in
*.la) ;;
*)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
;;
esac
done
@@ -5328,7 +7361,7 @@ func_mode_link ()
prog)
compile_deplibs=
finalize_deplibs=
- alldeplibs=no
+ alldeplibs=false
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
@@ -5340,35 +7373,36 @@ func_mode_link ()
for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
+ if test lib,link = "$linkmode,$pass"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
- deplibs="$tmp_deplibs"
+ deplibs=$tmp_deplibs
fi
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass"; then
+ libs=$deplibs
deplibs=
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
+ dlopen) libs=$dlfiles ;;
+ dlpreopen) libs=$dlprefiles ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ if test lib,dlpreopen = "$linkmode,$pass"; then
# Collect and forward deplibs of preopened libtool libs
for lib in $dlprefiles; do
# Ignore non-libtool-libs
dependency_libs=
+ func_resolve_sysroot "$lib"
case $lib in
- *.la) func_source "$lib" ;;
+ *.la) func_source "$func_resolve_sysroot_result" ;;
esac
# Collect preopened libtool deplibs, except any this library
@@ -5378,45 +7412,46 @@ func_mode_link ()
deplib_base=$func_basename_result
case " $weak_libs " in
*" $deplib_base "*) ;;
- *) deplibs="$deplibs $deplib" ;;
+ *) func_append deplibs " $deplib" ;;
esac
done
done
- libs="$dlprefiles"
+ libs=$dlprefiles
fi
- if test "$pass" = dlopen; then
+ if test dlopen = "$pass"; then
# Collect dlpreopened libraries
- save_deplibs="$deplibs"
+ save_deplibs=$deplibs
deplibs=
fi
for deplib in $libs; do
lib=
- found=no
+ found=false
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- if test "$linkmode,$pass" = "prog,link"; then
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- compiler_flags="$compiler_flags $deplib"
- if test "$linkmode" = lib ; then
+ func_append compiler_flags " $deplib"
+ if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
continue
;;
-l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
+ if test lib != "$linkmode" && test prog != "$linkmode"; then
+ func_warning "'-l' is ignored for archives/objects"
continue
fi
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -5424,31 +7459,22 @@ func_mode_link ()
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
+ lib=$searchdir/lib$name$search_ext
if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
+ if test .la = "$search_ext"; then
+ found=:
else
- found=no
+ found=false
fi
break 2
fi
done
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
- else # deplib is a libtool library
+ if $found; then
+ # deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $deplib "*)
if func_lalib_p "$lib"; then
@@ -5456,19 +7482,19 @@ func_mode_link ()
old_library=
func_source "$lib"
for l in $old_library $library_names; do
- ll="$l"
+ ll=$l
done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
+ if test "X$ll" = "X$old_library"; then # only static version available
+ found=false
func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=$func_dirname_result
lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
@@ -5477,18 +7503,28 @@ func_mode_link ()
*) ;;
esac
fi
+ else
+ # deplib doesn't seem to be a libtool library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
fi
;; # -l
*.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
+ if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
@@ -5498,47 +7534,53 @@ func_mode_link ()
case $linkmode in
lib)
deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
+ test conv = "$pass" && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
prog)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
- if test "$pass" = scan; then
+ if test scan = "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
*)
- func_warning "\`-L' is ignored for archives/objects"
+ func_warning "'-L' is ignored for archives/objects"
;;
esac # linkmode
continue
;; # -L
-R*)
- if test "$pass" = link; then
+ if test link = "$pass"; then
func_stripname '-R' '' "$deplib"
- dir=$func_stripname_result
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
- *.la) lib="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
*.$libext)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
@@ -5549,21 +7591,26 @@ func_mode_link ()
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
- valid_a_lib=no
+ valid_a_lib=false
case $deplibs_check_method in
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
+ valid_a_lib=:
fi
;;
pass_all)
- valid_a_lib=yes
+ valid_a_lib=:
;;
esac
- if test "$valid_a_lib" != yes; then
+ if $valid_a_lib; then
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ else
echo
$ECHO "*** Warning: Trying to link with static lib archive $deplib."
echo "*** I have the capability to make that library automatically link in when"
@@ -5571,18 +7618,13 @@ func_mode_link ()
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 use here."
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
fi
;;
esac
continue
;;
prog)
- if test "$pass" != link; then
+ if test link != "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
@@ -5593,38 +7635,36 @@ func_mode_link ()
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ elif test prog = "$linkmode"; then
+ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
+ func_append newdlprefiles " $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- newdlfiles="$newdlfiles $deplib"
+ func_append newdlfiles " $deplib"
fi
fi
continue
;;
%DEPLIBS%)
- alldeplibs=yes
+ alldeplibs=:
continue
;;
esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- fi
+ $found || test -f "$lib" \
+ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
+ || func_fatal_error "'$lib' is not a valid libtool archive"
func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=$func_dirname_result
dlname=
dlopen=
@@ -5649,40 +7689,40 @@ func_mode_link ()
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
esac
done
fi
dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass" ||
+ { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
fi
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ func_fatal_error "cannot find name of link library for '$lib'"
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"
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test prog != "$linkmode" && test lib != "$linkmode"; then
+ func_fatal_error "'$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done
continue
fi # $pass = conv
@@ -5690,101 +7730,133 @@ func_mode_link ()
# Get the name of the library we link against.
linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
+ if test -n "$old_library" &&
+ { test yes = "$prefer_static_libs" ||
+ test built,no = "$prefer_static_libs,$installed"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib=$l
+ done
+ fi
if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ func_fatal_error "cannot find name of link library for '$lib'"
fi
# This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- fi
+ if test dlopen = "$pass"; then
+ test -z "$libdir" \
+ && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
+ test yes != "$dlopen_support" ||
+ test no = "$build_libtool_libs"
+ then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
+ func_append dlprefiles " $lib $dependency_libs"
else
- newdlfiles="$newdlfiles $lib"
+ func_append newdlfiles " $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "cannot determine absolute directory name of '$ladir'"
func_warning "passing it literally to the linker, although it might fail"
- abs_ladir="$ladir"
+ abs_ladir=$ladir
fi
;;
esac
func_basename "$lib"
- laname="$func_basename_result"
+ laname=$func_basename_result
# 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
- func_warning "library \`$lib' was moved."
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
+ if test yes = "$installed"; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library '$lib' was moved."
+ dir=$ladir
+ absdir=$abs_ladir
+ libdir=$abs_ladir
else
- dir="$libdir"
- absdir="$libdir"
+ dir=$lt_sysroot$libdir
+ absdir=$lt_sysroot$libdir
fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ test yes = "$hardcode_automatic" && avoidtemprpath=yes
else
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
+ dir=$ladir
+ absdir=$abs_ladir
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
+ dir=$ladir/$objdir
+ absdir=$abs_ladir/$objdir
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
fi
fi # $installed = yes
func_stripname 'lib' '.la' "$laname"
name=$func_stripname_result
# This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- 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"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- dlpreconveniencelibs="$dlpreconveniencelibs $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"
+ if test dlpreopen = "$pass"; then
+ if test -z "$libdir" && test prog = "$linkmode"; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
fi
+ case $host in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
+ elif test prog,link = "$linkmode,$pass"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
@@ -5794,52 +7866,53 @@ func_mode_link ()
fi
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
+ if test prog = "$linkmode" && test link != "$pass"; then
+ func_append 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
+ linkalldeplibs=false
+ if test no != "$link_all_deplibs" || test -z "$library_names" ||
+ test no = "$build_libtool_libs"; then
+ linkalldeplibs=:
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
esac
# Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
+ if $linkalldeplibs; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done # for deplib
continue
fi # $linkmode = prog...
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ { { test no = "$prefer_static_libs" ||
+ test built,yes = "$prefer_static_libs,$installed"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
# Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
+ case $temp_rpath: in
*"$absdir:"*) ;;
- *) temp_rpath="$temp_rpath$absdir:" ;;
+ *) func_append temp_rpath "$absdir:" ;;
esac
fi
@@ -5851,7 +7924,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
@@ -5860,15 +7933,15 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
fi # $linkmode,$pass = prog,link...
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
+ if $alldeplibs &&
+ { test pass_all = "$deplibs_check_method" ||
+ { test yes = "$build_libtool_libs" &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
@@ -5877,20 +7950,20 @@ func_mode_link ()
link_static=no # Whether the deplib will be linked statically
use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
+ if test built = "$use_static_libs" && test yes = "$installed"; then
use_static_libs=no
fi
if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
case $host in
*cygwin* | *mingw* | *cegcc*)
# No point in relinking DLLs because paths are not encoded
- notinst_deplibs="$notinst_deplibs $lib"
+ func_append notinst_deplibs " $lib"
need_relink=no
;;
*)
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
+ if test no = "$installed"; then
+ func_append notinst_deplibs " $lib"
need_relink=yes
fi
;;
@@ -5899,24 +7972,24 @@ func_mode_link ()
# Warn about portability, can't link against -module's on some
# systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
+ dlopenmodule=
for dlpremoduletest in $dlprefiles; do
if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
+ dlopenmodule=$dlpremoduletest
break
fi
done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
$ECHO "*** Warning: Linking the executable $output against the loadable module"
else
$ECHO "*** Warning: Linking the shared library $output against the loadable module"
fi
$ECHO "*** $linklib is not portable!"
fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
+ if test lib = "$linkmode" &&
+ test yes = "$hardcode_into_libs"; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
@@ -5925,7 +7998,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
@@ -5934,7 +8007,7 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
@@ -5944,43 +8017,43 @@ func_mode_link ()
# figure out the soname
set dummy $library_names
shift
- realname="$1"
+ realname=$1
shift
libname=`eval "\\$ECHO \"$libname_spec\""`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
- soname="$dlname"
+ soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin* | mingw* | *cegcc*)
func_arith $current - $age
major=$func_arith_result
- versuffix="-$major"
+ versuffix=-$major
;;
esac
eval soname=\"$soname_spec\"
else
- soname="$realname"
+ soname=$realname
fi
# Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
+ soroot=$soname
func_basename "$soroot"
- soname="$func_basename_result"
+ soname=$func_basename_result
func_stripname 'lib' '.dll' "$soname"
newlib=libimp-$func_stripname_result.a
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
- func_verbose "extracting exported symbol list from \`$soname'"
+ func_verbose "extracting exported symbol list from '$soname'"
func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
+ func_verbose "generating import library for '$soname'"
func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
fi
# make sure the library variables are pointing to the new library
@@ -5988,70 +8061,70 @@ func_mode_link ()
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
- if test "$linkmode" = prog || test "$mode" != relink; then
+ if test prog = "$linkmode" || test relink != "$opt_mode"; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
+ if test no = "$hardcode_direct"; then
+ add=$dir/$linklib
case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+ *-*-sysv4*uw2*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
+ # if the lib is a (non-dlopened) module then we cannot
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
+ $GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
+ if test -z "$old_library"; then
echo
echo "*** And there doesn't seem to be a static archive available"
echo "*** The link will probably fail, sorry"
else
- add="$dir/$old_library"
+ add=$dir/$old_library
fi
elif test -n "$old_library"; then
- add="$dir/$old_library"
+ add=$dir/$old_library
fi
fi
esac
- elif test "$hardcode_minus_L" = no; then
+ elif test no = "$hardcode_minus_L"; then
case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
+ *-*-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"
+ add_dir=-L$dir
+ add=-l$name
+ elif test no = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
else
lib_linked=no
fi
;;
relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$dir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$absdir
# 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"
+ func_append 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"
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
else
lib_linked=no
fi
@@ -6059,72 +8132,72 @@ func_mode_link ()
*) lib_linked=no ;;
esac
- if test "$lib_linked" != yes; then
+ if test yes != "$lib_linked"; then
func_fatal_configuration "unsupported hardcode properties"
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
esac
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; 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
+ if test yes != "$hardcode_direct" &&
+ test yes != "$hardcode_minus_L" &&
+ test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
fi
fi
fi
- if test "$linkmode" = prog || test "$mode" = relink; then
+ if test prog = "$linkmode" || test relink = "$opt_mode"; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; 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
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$libdir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$libdir
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
+ add=-l$name
+ elif test yes = "$hardcode_automatic"; then
if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
+ test -f "$inst_prefix_dir$libdir/$linklib"; then
+ add=$inst_prefix_dir$libdir/$linklib
else
- add="$libdir/$linklib"
+ add=$libdir/$linklib
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
+ 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"
+ func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
- add="-l$name"
+ add=-l$name
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
@@ -6132,43 +8205,43 @@ func_mode_link ()
test -n "$add" && deplibs="$add $deplibs"
fi
fi
- elif test "$linkmode" = prog; then
+ elif test prog = "$linkmode"; then
# 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"
+ if test unsupported != "$hardcode_direct"; 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
+ elif test yes = "$build_libtool_libs"; then
# Not a shared library
- if test "$deplibs_check_method" != pass_all; then
+ if test pass_all != "$deplibs_check_method"; 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 "*** Warning: This system cannot 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
+ if test yes = "$module"; 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 "*** 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 "*** 'nm' from GNU binutils and a full rebuild may help."
fi
- if test "$build_old_libs" = no; then
+ if test no = "$build_old_libs"; then
build_libtool_libs=module
build_old_libs=yes
else
@@ -6181,11 +8254,11 @@ func_mode_link ()
fi
fi # link shared/static library?
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
+ { test yes != "$hardcode_into_libs" ||
+ test yes = "$build_old_libs" ||
+ test yes = "$link_static"; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
@@ -6194,46 +8267,54 @@ func_mode_link ()
temp_xrpath=$func_stripname_result
case " $xrpath " in
*" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
+ *) func_append xrpath " $temp_xrpath";;
esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
+ *) func_append temp_deplibs " $libdir";;
esac
done
- dependency_libs="$temp_deplibs"
+ dependency_libs=$temp_deplibs
fi
- newlib_search_path="$newlib_search_path $absdir"
+ func_append newlib_search_path " $absdir"
# Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ test no = "$link_static" && 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 $opt_duplicate_deps ; then
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $func_resolve_sysroot_result"
done
- if test "$link_all_deplibs" != no; then
+ if test no != "$link_all_deplibs"; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
- -L*) path="$deplib" ;;
+ -L*) path=$deplib ;;
*.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
func_dirname "$deplib" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
# We need an absolute path.
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
- absdir="$dir"
+ func_warning "cannot determine absolute directory name of '$dir'"
+ absdir=$dir
fi
;;
esac
@@ -6241,35 +8322,35 @@ func_mode_link ()
case $host in
*-*-darwin*)
depdepl=
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
+ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names"; then
+ for tmp in $deplibrary_names; do
depdepl=$tmp
done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -f "$absdir/$objdir/$depdepl"; then
+ depdepl=$absdir/$objdir/$depdepl
+ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
path=
fi
fi
;;
*)
- path="-L$absdir/$objdir"
+ path=-L$absdir/$objdir
;;
esac
else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_fatal_error "'$deplib' is not a valid libtool archive"
test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
+ func_warning "'$deplib' seems to be moved"
- path="-L$absdir"
+ path=-L$absdir
fi
;;
esac
@@ -6281,38 +8362,38 @@ func_mode_link ()
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
+ if test link = "$pass"; then
+ if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
else
compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
fi
fi
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
+ dependency_libs=$newdependency_libs
+ if test dlpreopen = "$pass"; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
+ if test dlopen != "$pass"; then
+ test conv = "$pass" || {
# 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" ;;
+ *) func_append lib_search_path " $dir" ;;
esac
done
newlib_search_path=
- fi
+ }
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
+ if test prog,link = "$linkmode,$pass"; then
vars="compile_deplibs finalize_deplibs"
+ else
+ vars=deplibs
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
@@ -6361,10 +8442,10 @@ func_mode_link ()
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
@@ -6373,59 +8454,59 @@ func_mode_link ()
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
- for i in $dependency_libs ; do
+ for i in $dependency_libs; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
- i=""
+ i=
;;
esac
- if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
+ if test -n "$i"; then
+ func_append tmp_libs " $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
+ if test prog = "$linkmode"; then
+ dlfiles=$newdlfiles
fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
- dlprefiles="$newdlprefiles"
+ if test prog = "$linkmode" || test lib = "$linkmode"; then
+ dlprefiles=$newdlprefiles
fi
case $linkmode in
oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for archives"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ func_warning "'-l' and '-L' are ignored for archives" ;;
esac
test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
+ func_warning "'-rpath' is ignored for archives"
test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
+ func_warning "'-R' is ignored for archives"
test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
+ func_warning "'-version-info/-version-number' is ignored for archives"
test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
+ func_warning "'-release' is ignored for archives"
test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
+ func_warning "'-export-symbols' is ignored for archives"
# Now set the variables for building old libraries.
build_libtool_libs=no
- oldlibs="$output"
- objs="$objs$old_deplibs"
+ oldlibs=$output
+ func_append objs "$old_deplibs"
;;
lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
+ # Make sure we only generate libraries of the form 'libNAME.la'.
case $outputname in
lib*)
func_stripname 'lib' '.la' "$outputname"
@@ -6434,10 +8515,10 @@ func_mode_link ()
eval libname=\"$libname_spec\"
;;
*)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
+ test no = "$module" \
+ && func_fatal_help "libtool library '$output' must begin with 'lib'"
- if test "$need_lib_prefix" != no; then
+ if test no != "$need_lib_prefix"; then
# Add the "lib" prefix for modules if required
func_stripname '' '.la' "$outputname"
name=$func_stripname_result
@@ -6451,31 +8532,31 @@ func_mode_link ()
esac
if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ if test pass_all != "$deplibs_check_method"; then
+ func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
echo
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
$ECHO "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
+ func_append libobjs " $objs"
fi
fi
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
+ test no = "$dlself" \
+ || func_warning "'-dlopen self' is ignored for libtool libraries"
set dummy $rpath
shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
+ test 1 -lt "$#" \
+ && func_warning "ignoring multiple '-rpath's for a libtool library"
- install_libdir="$1"
+ install_libdir=$1
oldlibs=
if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
# Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
+ # Some compilers have problems with a '.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -6484,20 +8565,20 @@ func_mode_link ()
fi
test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+ func_warning "'-version-info/-version-number' is ignored for convenience libraries"
test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
+ func_warning "'-release' is ignored for convenience libraries"
else
# Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
+ save_ifs=$IFS; IFS=:
set dummy $vinfo 0 0 0
shift
- IFS="$save_ifs"
+ IFS=$save_ifs
test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
+ func_fatal_help "too many parameters to '-version-info'"
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
@@ -6505,41 +8586,42 @@ func_mode_link ()
case $vinfo_number in
yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
+ number_major=$1
+ number_minor=$2
+ number_revision=$3
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
- # which has an extra 1 added just for fun
+ # that has an extra 1 added just for fun
#
case $version_type in
+ # correct linux to gnu/linux during the next big refactor
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
- age="$number_minor"
- revision="$number_revision"
+ age=$number_minor
+ revision=$number_revision
;;
freebsd-aout|freebsd-elf|qnx|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
+ current=$number_major
+ revision=$number_minor
+ age=0
;;
irix|nonstopux)
func_arith $number_major + $number_minor
current=$func_arith_result
- age="$number_minor"
- revision="$number_minor"
+ age=$number_minor
+ revision=$number_minor
lt_irix_increment=no
;;
esac
;;
no)
- current="$1"
- revision="$2"
- age="$3"
+ current=$1
+ revision=$2
+ age=$3
;;
esac
@@ -6547,30 +8629,30 @@ func_mode_link ()
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "CURRENT '$current' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "REVISION '$revision' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "AGE '$age' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "AGE '$age' is greater than the current interface number '$current'"
+ func_fatal_error "'$vinfo' is not valid version information"
fi
# Calculate the version variables.
@@ -6585,26 +8667,35 @@ func_mode_link ()
# verstring for coding it into the library header
func_arith $current - $age
major=.$func_arith_result
- versuffix="$major.$age.$revision"
+ versuffix=$major.$age.$revision
# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ # On Darwin other compilers
+ case $CC in
+ nagfor*)
+ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ ;;
+ *)
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+ esac
;;
freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
+ major=.$current
+ versuffix=.$current.$revision
;;
freebsd-elf)
- major=".$current"
- versuffix=".$current"
+ major=.$current
+ versuffix=.$current
;;
irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
+ if test no = "$lt_irix_increment"; then
func_arith $current - $age
else
func_arith $current - $age + 1
@@ -6615,69 +8706,69 @@ func_mode_link ()
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
- verstring="$verstring_prefix$major.$revision"
+ verstring=$verstring_prefix$major.$revision
# Add in all the interfaces that we are compatible with.
loop=$revision
- while test "$loop" -ne 0; do
+ while test 0 -ne "$loop"; do
func_arith $revision - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
- verstring="$verstring_prefix$major.$iface:$verstring"
+ verstring=$verstring_prefix$major.$iface:$verstring
done
- # Before this point, $major must not contain `.'.
+ # Before this point, $major must not contain '.'.
major=.$major
- versuffix="$major.$revision"
+ versuffix=$major.$revision
;;
- linux)
+ linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
- versuffix="$major.$age.$revision"
+ versuffix=$major.$age.$revision
;;
osf)
func_arith $current - $age
major=.$func_arith_result
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
+ versuffix=.$current.$age.$revision
+ verstring=$current.$age.$revision
# Add in all the interfaces that we are compatible with.
loop=$age
- while test "$loop" -ne 0; do
+ while test 0 -ne "$loop"; do
func_arith $current - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
- verstring="$verstring:${iface}.0"
+ verstring=$verstring:$iface.0
done
# Make executables depend on our current version.
- verstring="$verstring:${current}.0"
+ func_append verstring ":$current.0"
;;
qnx)
- major=".$current"
- versuffix=".$current"
+ major=.$current
+ versuffix=.$current
;;
sunos)
- major=".$current"
- versuffix=".$current.$revision"
+ major=.$current
+ versuffix=.$current.$revision
;;
windows)
# Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
+ # extension on DOS 8.3 file systems.
func_arith $current - $age
major=$func_arith_result
- versuffix="-$major"
+ versuffix=-$major
;;
*)
- func_fatal_configuration "unknown library version type \`$version_type'"
+ func_fatal_configuration "unknown library version type '$version_type'"
;;
esac
@@ -6691,42 +8782,45 @@ func_mode_link ()
verstring=
;;
*)
- verstring="0.0"
+ verstring=0.0
;;
esac
- if test "$need_version" = no; then
+ if test no = "$need_version"; then
versuffix=
else
- versuffix=".0.0"
+ 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
+ if test yes,no = "$avoid_version,$need_version"; then
major=
versuffix=
- verstring=""
+ 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
- func_warning "undefined symbols not allowed in $host shared libraries"
- build_libtool_libs=no
- build_old_libs=yes
+ if test yes = "$allow_undefined"; then
+ if test unsupported = "$allow_undefined_flag"; then
+ if test yes = "$build_old_libs"; then
+ func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+ build_libtool_libs=no
+ else
+ func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+ fi
fi
else
# Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
+ allow_undefined_flag=$no_undefined_flag
fi
fi
- func_generate_dlsyms "$libname" "$libname" "yes"
- libobjs="$libobjs $symfileobj"
- test "X$libobjs" = "X " && libobjs=
+ func_generate_dlsyms "$libname" "$libname" :
+ func_append libobjs " $symfileobj"
+ test " " = "$libobjs" && libobjs=
- if test "$mode" != relink; then
+ if test relink != "$opt_mode"; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
@@ -6735,14 +8829,14 @@ func_mode_link ()
case $p in
*.$objext | *.gcno)
;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+ if test -n "$precious_files_regex"; then
if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
fi
fi
- removelist="$removelist $p"
+ func_append removelist " $p"
;;
*) ;;
esac
@@ -6752,11 +8846,11 @@ func_mode_link ()
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"
+ if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
@@ -6770,38 +8864,39 @@ func_mode_link ()
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
+ old_dlfiles=$dlfiles
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
+ *) func_append dlfiles " $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
+ old_dlprefiles=$dlprefiles
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
+ *) func_append dlprefiles " $lib" ;;
esac
done
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -6809,7 +8904,7 @@ func_mode_link ()
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
@@ -6825,8 +8920,8 @@ func_mode_link ()
;;
*)
# Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
+ if test yes = "$build_libtool_need_lc"; then
+ func_append deplibs " -lc"
fi
;;
esac
@@ -6841,9 +8936,9 @@ func_mode_link ()
# 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=""
+ release=
+ versuffix=
+ major=
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
@@ -6872,21 +8967,21 @@ EOF
-l*)
func_stripname -l '' "$i"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
+ func_append newdeplibs " $i"
+ i=
;;
esac
fi
- if test -n "$i" ; then
+ if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append newdeplibs " $i"
else
droppeddeps=yes
echo
@@ -6900,7 +8995,7 @@ EOF
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
@@ -6915,21 +9010,21 @@ EOF
$opt_dry_run || $RM conftest
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
+ func_append newdeplibs " $i"
+ i=
;;
esac
fi
- if test -n "$i" ; then
+ if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append newdeplibs " $i"
else
droppeddeps=yes
echo
@@ -6951,7 +9046,7 @@ EOF
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
@@ -6965,18 +9060,30 @@ EOF
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
;;
esac
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ if test yes = "$want_nocaseglob"; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
@@ -6988,25 +9095,25 @@ EOF
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
- potlib="$potent_lib"
+ 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+ *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
break 2
fi
done
done
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7014,7 +9121,7 @@ EOF
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
+ 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"
@@ -7024,7 +9131,7 @@ EOF
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
@@ -7037,30 +9144,30 @@ EOF
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
;;
esac
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; 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 above in file_magic test
+ potlib=$potent_lib # see symlink-check above 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=""
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
break 2
fi
done
done
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7068,7 +9175,7 @@ EOF
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
+ 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"
@@ -7078,24 +9185,24 @@ EOF
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
none | unknown | *)
- newdeplibs=""
+ newdeplibs=
tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ for i in $predeps $postdeps; do
# can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
done
fi
case $tmp_deplibs in
*[!\ \ ]*)
echo
- if test "X$deplibs_check_method" = "Xnone"; then
+ if test none = "$deplibs_check_method"; then
echo "*** Warning: inter-library dependencies are not supported in this platform."
else
echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7119,8 +9226,8 @@ EOF
;;
esac
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
+ if test yes = "$droppeddeps"; then
+ if test yes = "$module"; then
echo
echo "*** Warning: libtool could not satisfy all declared inter-library"
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
@@ -7129,12 +9236,12 @@ EOF
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 "*** 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 "*** 'nm' from GNU binutils and a full rebuild may help."
fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
@@ -7145,14 +9252,14 @@ EOF
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
- if test "$allow_undefined" = no; then
+ if test no = "$allow_undefined"; 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"
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
@@ -7182,7 +9289,7 @@ EOF
*)
case " $deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
@@ -7192,13 +9299,13 @@ EOF
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
- deplibs="$new_libs"
+ deplibs=$new_libs
# All the library-specific variables (install_libdir is set above).
library_names=
@@ -7206,62 +9313,65 @@ EOF
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
+ if test yes = "$build_libtool_libs"; then
+ # Remove $wl instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test yes = "$hardcode_into_libs"; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
- rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
+ rpath=$finalize_rpath
+ test relink = "$opt_mode" || rpath=$compile_rpath$rpath
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ 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"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
+ func_append dep_rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_append 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"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
+ 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:"
+ func_append 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"
+ shlibpath=$finalize_shlibpath
+ test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
@@ -7271,23 +9381,23 @@ EOF
eval library_names=\"$library_names_spec\"
set dummy $library_names
shift
- realname="$1"
+ realname=$1
shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
- soname="$realname"
+ soname=$realname
fi
if test -z "$dlname"; then
dlname=$soname
fi
- lib="$output_objdir/$realname"
+ lib=$output_objdir/$realname
linknames=
for link
do
- linknames="$linknames $link"
+ func_append linknames " $link"
done
# Use standard objects if they are pic
@@ -7297,8 +9407,8 @@ EOF
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
- delfiles="$delfiles $export_symbols"
+ export_symbols=$output_objdir/$libname.uexp
+ func_append delfiles " $export_symbols"
fi
orig_export_symbols=
@@ -7306,36 +9416,68 @@ EOF
cygwin* | mingw* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ func_dll_def_p "$export_symbols" || {
# and it's NOT already a .def file. Must figure out
# which of the given symbols are data symbols and tag
# them as such. So, trigger use of export_symbols_cmds.
# export_symbols gets reassigned inside the "prepare
# the list of exported symbols" if statement, so the
# include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
+ orig_export_symbols=$export_symbols
export_symbols=
always_export_symbols=yes
- fi
+ }
fi
;;
esac
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
+ if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- func_len " $cmd"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ save_ifs=$IFS; IFS='~'
+ for cmd1 in $cmds; do
+ IFS=$save_ifs
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test yes = "$try_normal_branch" \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=$output_objdir/$output_la.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
skipped_export=false
else
# The command line is too long to execute in one step.
@@ -7346,8 +9488,8 @@ EOF
break
fi
done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ IFS=$save_ifs
+ if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
@@ -7355,21 +9497,21 @@ EOF
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
+ # 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
@@ -7379,15 +9521,15 @@ EOF
case " $convenience " in
*" $test_deplib "*) ;;
*)
- tmp_deplibs="$tmp_deplibs $test_deplib"
+ func_append tmp_deplibs " $test_deplib"
;;
esac
done
- deplibs="$tmp_deplibs"
+ deplibs=$tmp_deplibs
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
+ test yes = "$compiler_needs_object" &&
test -z "$libobjs"; then
# extract the archives, so we have objects to list.
# TODO: could optimize this to just extract one archive.
@@ -7398,27 +9540,27 @@ EOF
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
else
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
+ func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
+ if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
+ if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
@@ -7436,7 +9578,7 @@ EOF
fi
fi
- if test "X$skipped_export" != "X:" &&
+ if test : != "$skipped_export" &&
func_len " $test_cmds" &&
len=$func_len_result &&
test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -7469,37 +9611,42 @@ EOF
last_robj=
k=1
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
func_verbose "creating GNU ld script: $output"
echo 'INPUT (' > $output
for obj in $save_libobjs
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
echo ')' >> $output
- delfiles="$delfiles $output"
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
set x $save_libobjs
shift
firstobj=
- if test "$compiler_needs_object" = yes; then
+ if test yes = "$compiler_needs_object"; then
firstobj="$1 "
shift
fi
for obj
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
- delfiles="$delfiles $output"
- output=$firstobj\"$file_list_spec$output\"
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
+ output=$output_objdir/$output_la-$k.$objext
eval test_cmds=\"$reload_cmds\"
func_len " $test_cmds"
len0=$func_len_result
@@ -7511,13 +9658,13 @@ EOF
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
- if test "X$objlist" = X ||
+ if test -z "$objlist" ||
test "$len" -lt "$max_cmd_len"; then
func_append objlist " $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
- if test "$k" -eq 1 ; then
+ if test 1 -eq "$k"; then
# The first file doesn't have a previous command to add.
reload_objs=$objlist
eval concat_cmds=\"$reload_cmds\"
@@ -7527,10 +9674,10 @@ EOF
reload_objs="$objlist $last_robj"
eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
fi
- last_robj=$output_objdir/$output_la-${k}.$objext
+ last_robj=$output_objdir/$output_la-$k.$objext
func_arith $k + 1
k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
+ output=$output_objdir/$output_la-$k.$objext
objlist=" $obj"
func_len " $last_robj"
func_arith $len0 + $func_len_result
@@ -7542,19 +9689,19 @@ EOF
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ eval concat_cmds=\"\$concat_cmds$reload_cmds\"
if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
- delfiles="$delfiles $output"
+ func_append delfiles " $output"
else
output=
fi
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
+ ${skipped_export-false} && {
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
@@ -7563,16 +9710,16 @@ EOF
if test -n "$last_robj"; then
eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
- fi
+ }
test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
+ save_ifs=$IFS; IFS='~'
for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
+ IFS=$save_ifs
+ $opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
@@ -7580,7 +9727,7 @@ EOF
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -7589,7 +9736,7 @@ EOF
exit $lt_exit
}
done
- IFS="$save_ifs"
+ IFS=$save_ifs
if test -n "$export_symbols_regex" && ${skipped_export-false}; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -7597,27 +9744,27 @@ EOF
fi
fi
- if ${skipped_export-false}; then
+ ${skipped_export-false} && {
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
+ # 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
- fi
+ }
libobjs=$output
# Restore the value of output.
@@ -7631,7 +9778,7 @@ EOF
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
+ if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
@@ -7653,19 +9800,20 @@ EOF
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
- save_ifs="$IFS"; IFS='~'
+ save_ifs=$IFS; IFS='~'
for cmd in $cmds; do
- IFS="$save_ifs"
+ IFS=$sp$nl
eval cmd=\"$cmd\"
- $opt_silent || {
+ IFS=$save_ifs
+ $opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
@@ -7673,7 +9821,7 @@ EOF
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -7682,10 +9830,10 @@ EOF
exit $lt_exit
}
done
- IFS="$save_ifs"
+ IFS=$save_ifs
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
@@ -7705,39 +9853,39 @@ EOF
done
# If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
+ if test yes = "$module" || test yes = "$export_dynamic"; then
# On all known operating systems, these are identical.
- dlname="$soname"
+ dlname=$soname
fi
fi
;;
obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for objects"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ func_warning "'-l' and '-L' are ignored for objects" ;;
esac
test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
+ func_warning "'-rpath' is ignored for objects"
test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
+ func_warning "'-R' is ignored for objects"
test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
+ func_warning "'-version-info' is ignored for objects"
test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
+ func_warning "'-release' is ignored for objects"
case $output in
*.lo)
test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+ func_fatal_error "cannot build library object '$output' from non-libtool objects"
libobj=$output
func_lo2o "$libobj"
@@ -7745,7 +9893,7 @@ EOF
;;
*)
libobj=
- obj="$output"
+ obj=$output
;;
esac
@@ -7768,18 +9916,21 @@ EOF
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
else
- gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${obj}x
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
+ # If we're not building shared, we need to use non_pic_objs
+ test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+
# Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
- output="$obj"
+ output=$obj
func_execute_cmds "$reload_cmds" 'exit $?'
# Exit if we aren't doing a library object file.
@@ -7791,7 +9942,7 @@ EOF
exit $EXIT_SUCCESS
fi
- if test "$build_libtool_libs" != yes; then
+ test yes = "$build_libtool_libs" || {
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
@@ -7801,12 +9952,12 @@ EOF
# $show "echo timestamp > $libobj"
# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
- fi
+ }
- if test -n "$pic_flag" || test "$pic_mode" != default; then
+ if test -n "$pic_flag" || test default != "$pic_mode"; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
+ output=$libobj
func_execute_cmds "$reload_cmds" 'exit $?'
fi
@@ -7823,16 +9974,14 @@ EOF
output=$func_stripname_result.exe;;
esac
test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
+ func_warning "'-version-info' is ignored for programs"
test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
+ func_warning "'-release' is ignored for programs"
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+ $preload \
+ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
@@ -7846,11 +9995,11 @@ EOF
*-*-darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
# But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
+ if test CXX = "$tagname"; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
+ func_append compile_command " $wl-bind_at_load"
+ func_append finalize_command " $wl-bind_at_load"
;;
esac
fi
@@ -7870,7 +10019,7 @@ EOF
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
@@ -7880,17 +10029,17 @@ EOF
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
- compile_deplibs="$new_libs"
+ compile_deplibs=$new_libs
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -7898,7 +10047,7 @@ EOF
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
fi
@@ -7910,39 +10059,39 @@ EOF
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ 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"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
+ *) func_append dllsearchpath ":$libdir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
@@ -7950,10 +10099,10 @@ EOF
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
+ libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
- compile_rpath="$rpath"
+ compile_rpath=$rpath
rpath=
hardcode_libdirs=
@@ -7961,82 +10110,86 @@ EOF
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ 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"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ *) func_append 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"
+ libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
- finalize_rpath="$rpath"
+ finalize_rpath=$rpath
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ if test -n "$libobjs" && test yes = "$build_old_libs"; then
# Transform all the library objects into standard objects.
compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
fi
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+ func_generate_dlsyms "$outputname" "@PROGRAM@" false
# template prelinking step
if test -n "$prelink_cmds"; then
func_execute_cmds "$prelink_cmds" 'exit $?'
fi
- wrappers_required=yes
+ wrappers_required=:
case $host in
*cegcc* | *mingw32ce*)
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=no
+ wrappers_required=false
;;
*cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
+ test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
+ if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+ wrappers_required=false
fi
;;
esac
- if test "$wrappers_required" = no; then
+ $wrappers_required || {
# Replace the output file specification.
compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
+ link_command=$compile_command$compile_rpath
# We have no uninstalled library dependencies, so finalize right now.
exit_status=0
func_show_eval "$link_command" 'exit_status=$?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ if test -f "$output_objdir/${outputname}S.$objext"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
fi
exit $exit_status
- fi
+ }
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8052,7 +10205,7 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
@@ -8060,45 +10213,53 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
- if test "$no_install" = yes; then
+ if test yes = "$no_install"; then
# We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
+ link_command=$compile_var$compile_command$compile_rpath
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
exit $EXIT_SUCCESS
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"
+ case $hardcode_action,$fast_install in
+ relink,*)
+ # Fast installation is not supported
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED '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
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "'$output' will be relinked during installation"
+ ;;
+ *,yes)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ ;;
+ *,no)
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+ ;;
+ *,needless)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=
+ ;;
+ esac
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -8108,6 +10269,12 @@ EOF
func_show_eval "$link_command" 'exit $?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Now create the wrapper script.
func_verbose "creating $output"
@@ -8149,8 +10316,8 @@ EOF
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
+ cwrappersource=$output_path/$objdir/lt-$output_name.c
+ cwrapper=$output_path/$output_name.exe
$RM $cwrappersource $cwrapper
trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
@@ -8171,7 +10338,7 @@ EOF
trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
+ if test "x$build" = "x$host"; then
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -8194,43 +10361,45 @@ EOF
# 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 $symfileobj"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
+ case $build_libtool_libs in
+ convenience)
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs=$convenience
build_libtool_libs=no
- else
+ ;;
+ module)
+ oldobjs=$libobjs_save
+ addlibs=$old_convenience
+ build_libtool_libs=no
+ ;;
+ *)
oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- oldobjs="$oldobjs $symfileobj"
- fi
- fi
- addlibs="$old_convenience"
- fi
+ $preload && test -f "$symfileobj" \
+ && func_append oldobjs " $symfileobj"
+ addlibs=$old_convenience
+ ;;
+ esac
if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
cmds=$old_archive_from_new_cmds
else
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# POSIX demands no paths to be encoded in archives. We have
@@ -8247,8 +10416,8 @@ EOF
:
else
echo "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
oldobjs=
@@ -8256,7 +10425,7 @@ EOF
for obj in $save_oldobjs
do
func_basename "$obj"
- objbase="$func_basename_result"
+ objbase=$func_basename_result
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
@@ -8272,18 +10441,30 @@ EOF
esac
done
func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
;;
- *) oldobjs="$oldobjs $obj" ;;
+ *) func_append oldobjs " $obj" ;;
esac
done
fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
func_verbose "using piecewise archive linking..."
@@ -8313,18 +10494,18 @@ EOF
else
# the above command should be used before it gets too long
oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
+ if test "$obj" = "$last_oldobj"; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
objlist=
len=$len0
fi
done
RANLIB=$save_RANLIB
oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
+ if test -z "$oldobjs"; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -8341,7 +10522,7 @@ EOF
case $output in
*.la)
old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
+ test yes = "$build_old_libs" && old_library=$libname.$libext
func_verbose "creating $output"
# Preserve any variables that may affect compiler behavior
@@ -8356,52 +10537,63 @@ EOF
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
+ if test yes = "$hardcode_automatic"; then
relink_command=
fi
# Only create the output if not a dry run.
$opt_dry_run || {
for installed in no yes; do
- if test "$installed" = yes; then
+ if test yes = "$installed"; then
if test -z "$install_libdir"; then
break
fi
- output="$output_objdir/$outputname"i
+ 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)
func_basename "$deplib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ name=$func_basename_result
+ func_resolve_sysroot "$deplib"
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- newdependency_libs="$newdependency_libs $libdir/$name"
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
+ *) func_append newdependency_libs " $deplib" ;;
esac
done
- dependency_libs="$newdependency_libs"
+ dependency_libs=$newdependency_libs
newdlfiles=
for lib in $dlfiles; do
case $lib in
*.la)
func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlfiles="$newdlfiles $libdir/$name"
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
;;
- *) newdlfiles="$newdlfiles $lib" ;;
+ *) func_append newdlfiles " $lib" ;;
esac
done
- dlfiles="$newdlfiles"
+ dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
@@ -8411,34 +10603,34 @@ EOF
# didn't already link the preopened objects directly into
# the library:
func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlprefiles="$newdlprefiles $libdir/$name"
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
;;
esac
done
- dlprefiles="$newdlprefiles"
+ dlprefiles=$newdlprefiles
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlfiles="$newdlfiles $abs"
+ func_append newdlfiles " $abs"
done
- dlfiles="$newdlfiles"
+ dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlprefiles="$newdlprefiles $abs"
+ func_append newdlprefiles " $abs"
done
- dlprefiles="$newdlprefiles"
+ dlprefiles=$newdlprefiles
fi
$RM $output
# place dlname in correct position for cygwin
@@ -8454,10 +10646,9 @@ EOF
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
- if test "x$bindir" != x ;
- then
+ if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result$dlname
+ tdlname=$func_relative_path_result/$dlname
else
# Otherwise fall back on heuristic.
tdlname=../bin/$dlname
@@ -8466,7 +10657,7 @@ EOF
esac
$ECHO > $output "\
# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
@@ -8480,7 +10671,7 @@ library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
inherited_linker_flags='$new_inherited_linker_flags'
# Libraries that this one depends upon.
@@ -8506,7 +10697,7 @@ dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
+ if test no,yes = "$installed,$need_relink"; then
$ECHO >> $output "\
relink_command=\"$relink_command\""
fi
@@ -8521,29 +10712,31 @@ relink_command=\"$relink_command\""
exit $EXIT_SUCCESS
}
-{ test "$mode" = link || test "$mode" = relink; } &&
- func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+ func_mode_link ${1+"$@"}
+fi
# func_mode_uninstall arg...
func_mode_uninstall ()
{
- $opt_debug
- RM="$nonopt"
+ $debug_cmd
+
+ RM=$nonopt
files=
- rmforce=
+ rmforce=false
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
- libtool_install_magic="$magic"
+ libtool_install_magic=$magic
for arg
do
case $arg in
- -f) RM="$RM $arg"; rmforce=yes ;;
- -*) RM="$RM $arg" ;;
- *) files="$files $arg" ;;
+ -f) func_append RM " $arg"; rmforce=: ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
esac
done
@@ -8552,24 +10745,23 @@ func_mode_uninstall ()
rmdirs=
- origobjdir="$objdir"
for file in $files; do
func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- objdir="$origobjdir"
+ dir=$func_dirname_result
+ if test . = "$dir"; then
+ odir=$objdir
else
- objdir="$dir/$origobjdir"
+ odir=$dir/$objdir
fi
func_basename "$file"
- name="$func_basename_result"
- test "$mode" = uninstall && objdir="$dir"
+ name=$func_basename_result
+ test uninstall = "$opt_mode" && odir=$dir
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test clean = "$opt_mode"; then
case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
esac
fi
@@ -8581,11 +10773,11 @@ func_mode_uninstall ()
elif test -d "$file"; then
exit_status=1
continue
- elif test "$rmforce" = yes; then
+ elif $rmforce; then
continue
fi
- rmfiles="$file"
+ rmfiles=$file
case $name in
*.la)
@@ -8595,28 +10787,27 @@ func_mode_uninstall ()
# Delete the libtool libraries and symlinks.
for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
+ func_append rmfiles " $odir/$n"
done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
- case "$mode" in
+ case $opt_mode in
clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
+ case " $library_names " in
*" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
;;
uninstall)
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
fi
# FIXME: should reinstall the best remaining shared library.
;;
@@ -8632,21 +10823,19 @@ func_mode_uninstall ()
func_source $dir/$name
# Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
+ if test -n "$pic_object" && test none != "$pic_object"; then
+ func_append rmfiles " $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
+ if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+ func_append rmfiles " $dir/$non_pic_object"
fi
fi
;;
*)
- if test "$mode" = clean ; then
+ if test clean = "$opt_mode"; then
noexename=$name
case $file in
*.exe)
@@ -8656,7 +10845,7 @@ func_mode_uninstall ()
noexename=$func_stripname_result
# $file with .exe has already been added to rmfiles,
# add $file without .exe
- rmfiles="$rmfiles $file"
+ func_append rmfiles " $file"
;;
esac
# Do a test to see if this is a libtool program.
@@ -8665,7 +10854,7 @@ func_mode_uninstall ()
func_ltwrapper_scriptname "$file"
relink_command=
func_source $func_ltwrapper_scriptname_result
- rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
else
relink_command=
func_source $dir/$noexename
@@ -8673,12 +10862,12 @@ func_mode_uninstall ()
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
+ func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+ if test yes = "$fast_install" && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
fi
- if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ if test "X$noexename" != "X$name"; then
+ func_append rmfiles " $odir/lt-$noexename.c"
fi
fi
fi
@@ -8686,9 +10875,8 @@ func_mode_uninstall ()
esac
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
- objdir="$origobjdir"
- # Try to remove the ${objdir}s in the directories where we deleted files
+ # Try to remove the $objdir's in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -8698,16 +10886,17 @@ func_mode_uninstall ()
exit $exit_status
}
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+ func_mode_uninstall ${1+"$@"}
+fi
-test -z "$mode" && {
- help="$generic_help"
+test -z "$opt_mode" && {
+ help=$generic_help
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode '$opt_mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
@@ -8718,7 +10907,7 @@ exit $exit_status
# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
+# where we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
@@ -8741,5 +10930,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
# mode:shell-script
# sh-indentation:2
# End:
-# vi:sw=2
-
diff --git a/app/lzo/autoconf/mdate-sh b/app/lzo/autoconf/mdate-sh
index 60dc485a..e8dfaca1 100755
--- a/app/lzo/autoconf/mdate-sh
+++ b/app/lzo/autoconf/mdate-sh
@@ -3,8 +3,7 @@
scriptversion=2010-08-21.06; # UTC
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1995-2014 Free Software Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# This program is free software; you can redistribute it and/or modify
@@ -40,7 +39,7 @@ fi
case $1 in
'')
- echo "$0: No file. Try \`$0 --help' for more information." 1>&2
+ echo "$0: No file. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
@@ -76,7 +75,7 @@ LC_TIME=C
export LC_TIME
# GNU ls changes its time format in response to the TIME_STYLE
-# variable. Since we cannot assume `unset' works, revert this
+# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
@@ -96,14 +95,14 @@ if ls -n /dev/null 1>/dev/null 2>&1; then
ls_command="$ls_command -n"
fi
-# A `ls -l' line looks as follows on OS/2.
+# A 'ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo
# This differs from Unix, which adds ownership information.
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
#
# To find the date, we split the line on spaces and iterate on words
# until we find a month. This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
+# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
# will be owned by a user whose name is a month. So we first look at
# the extended ls output of the root directory to decide how many
# words should be skipped to get the date.
@@ -116,7 +115,7 @@ month=
command=
until test $month
do
- test $# -gt 0 || error "failed parsing \`$ls_command /' output"
+ test $# -gt 0 || error "failed parsing '$ls_command /' output"
shift
# Add another shift to the command.
command="$command shift;"
@@ -136,7 +135,7 @@ do
esac
done
-test -n "$month" || error "failed parsing \`$ls_command /' output"
+test -n "$month" || error "failed parsing '$ls_command /' output"
# Get the extended ls output of the file or directory.
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
diff --git a/app/lzo/autoconf/missing b/app/lzo/autoconf/missing
index 28055d2a..f62bbae3 100755
--- a/app/lzo/autoconf/missing
+++ b/app/lzo/autoconf/missing
@@ -1,11 +1,10 @@
#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
# 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"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
+case $1 in
-msg="missing on your system"
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
@@ -100,272 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
;;
-*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
-# normalize program name to check for.
-program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program). This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
- lex*|yacc*)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar*)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te*)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison*|yacc*)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex*|flex*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit $?
- fi
- ;;
-
- makeinfo*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- tar*)
- shift
-
- # 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 is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
-exit 0
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/app/lzo/autoconf/mkinstalldirs b/app/lzo/autoconf/mkinstalldirs
index 4191a45d..55d537f8 100755
--- a/app/lzo/autoconf/mkinstalldirs
+++ b/app/lzo/autoconf/mkinstalldirs
@@ -81,9 +81,9 @@ case $dirmode in
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
- # On NextStep and OpenStep, the `mkdir' command does not
+ # 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
+ # directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
diff --git a/app/lzo/autoconf/py-compile b/app/lzo/autoconf/py-compile
index 3f9d05b6..bc203914 100755
--- a/app/lzo/autoconf/py-compile
+++ b/app/lzo/autoconf/py-compile
@@ -1,10 +1,9 @@
#!/bin/sh
# py-compile - Compile a Python program
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-06-08.12; # UTC
-# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000-2014 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
@@ -32,28 +31,36 @@ if [ -z "$PYTHON" ]; then
PYTHON=python
fi
+me=py-compile
+
+usage_error ()
+{
+ echo "$me: $*" >&2
+ echo "Try '$me --help' for more information." >&2
+ exit 1
+}
+
basedir=
destdir=
-files=
while test $# -ne 0; do
case "$1" in
--basedir)
- basedir=$2
- if test -z "$basedir"; then
- echo "$0: Missing argument to --basedir." 1>&2
- exit 1
+ if test $# -lt 2; then
+ usage_error "option '--basedir' requires an argument"
+ else
+ basedir=$2
fi
shift
;;
--destdir)
- destdir=$2
- if test -z "$destdir"; then
- echo "$0: Missing argument to --destdir." 1>&2
- exit 1
+ if test $# -lt 2; then
+ usage_error "option '--destdir' requires an argument"
+ else
+ destdir=$2
fi
shift
;;
- -h|--h*)
+ -h|--help)
cat <<\EOF
Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
@@ -69,20 +76,27 @@ Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
- -v|--v*)
- echo "py-compile $scriptversion"
+ -v|--version)
+ echo "$me $scriptversion"
exit $?
;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ usage_error "unrecognized option '$1'"
+ ;;
*)
- files="$files $1"
+ break
;;
esac
shift
done
+files=$*
if test -z "$files"; then
- echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
- exit 1
+ usage_error "no files given"
fi
# if basedir was given, then it should be prepended to filenames before
@@ -102,7 +116,7 @@ else
fi
$PYTHON -c "
-import sys, os, py_compile
+import sys, os, py_compile, imp
files = '''$files'''
@@ -115,12 +129,19 @@ for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
- py_compile.compile(filepath, filepath + 'c', path)
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+ else:
+ py_compile.compile(filepath, filepath + 'c', path)
sys.stdout.write('\n')" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
-import sys, os, py_compile
+import sys, os, py_compile, imp
+
+# pypy does not use .pyo optimization
+if hasattr(sys, 'pypy_translation_info'):
+ sys.exit(0)
files = '''$files'''
sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
@@ -132,7 +153,10 @@ for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
- py_compile.compile(filepath, filepath + 'o', path)
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+ else:
+ py_compile.compile(filepath, filepath + 'o', path)
sys.stdout.write('\n')" 2>/dev/null || :
# Local Variables:
diff --git a/app/lzo/autoconf/shtool b/app/lzo/autoconf/shtool
index a1f4e7ee..78c0b125 100755
--- a/app/lzo/autoconf/shtool
+++ b/app/lzo/autoconf/shtool
@@ -3102,9 +3102,9 @@ platform )
sed -e 's/^://' \
-e 's;\[\([^]]*\)\];\1;g' \
-e 's;<\([^>]*\)>;\1;g' \
- -e "s; ;;g" \
+ -e "s; ;��;g" \
-e "s;/;%%;g" \
- -e "s;;${opt_S};g" \
+ -e "s;��;${opt_S};g" \
-e "s;%%;${opt_C};g"`
eval "${var_uc}_V=\"\${val_V}\""
;;
@@ -3115,9 +3115,9 @@ platform )
sed -e 's/^://' \
-e 's;\[\([^]]*\)\];;g' \
-e 's;<\([^>]*\)>;\1;g' \
- -e "s; ;;g" \
+ -e "s; ;��;g" \
-e "s;/;%%;g" \
- -e "s;;${opt_S};g" \
+ -e "s;��;${opt_S};g" \
-e "s;%%;${opt_C};g"`
eval "${var_uc}_N=\"\${val_N}\""
;;
@@ -3128,9 +3128,9 @@ platform )
sed -e 's/^://' \
-e 's;\[\([^]]*\)\];;g' \
-e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \
- -e "s; ;;g" \
+ -e "s; ;��;g" \
-e "s;/;%%;g" \
- -e "s;;${opt_S};g" \
+ -e "s;��;${opt_S};g" \
-e "s;%%;${opt_C};g"`
eval "${var_uc}_C=\"\${val_C}\""
;;
diff --git a/app/lzo/autoconf/ylwrap b/app/lzo/autoconf/ylwrap
index 92b20117..13fa706c 100755
--- a/app/lzo/autoconf/ylwrap
+++ b/app/lzo/autoconf/ylwrap
@@ -1,10 +1,9 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-scriptversion=2010-02-06.18; # UTC
+scriptversion=2013-01-12.17; # UTC
-# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-# 2007, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# Written by Tom Tromey <tromey@cygnus.com>.
#
@@ -30,9 +29,41 @@ scriptversion=2010-02-06.18; # UTC
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
+get_dirname ()
+{
+ case $1 in
+ */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+ # Otherwise, we want the empty string (not ".").
+ esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard ()
+{
+ printf '%s\n' "$1" \
+ | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
+ -e 's/__*/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+ case $# in
+ 0) cat;;
+ 1) printf '%s\n' "$1";;
+ esac \
+ | sed -e 's|[][\\.*]|\\&|g'
+}
+
case "$1" in
'')
- echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
+ echo "$0: No files given. Try '$0 --help' for more information." 1>&2
exit 1
;;
--basedir)
@@ -65,39 +96,56 @@ esac
# The input.
-input="$1"
+input=$1
shift
-case "$input" in
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
+case $input in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
- input="`pwd`/$input"
+ input=`pwd`/$input
;;
esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
-pairlist=
-while test "$#" -ne 0; do
- if test "$1" = "--"; then
+while test $# -ne 0; do
+ if test x"$1" = x"--"; then
shift
break
fi
- pairlist="$pairlist $1"
+ from=$1
shift
+ to=$1
+ shift
+ sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+ sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
done
# The program to run.
-prog="$1"
+prog=$1
shift
# Make any relative path in $prog absolute.
-case "$prog" in
+case $prog in
[\\/]* | ?:[\\/]*) ;;
- *[\\/]*) prog="`pwd`/$prog" ;;
+ *[\\/]*) prog=`pwd`/$prog ;;
esac
-# FIXME: add hostname here for parallel makes that run commands on
-# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@@ -115,98 +163,56 @@ esac
ret=$?
if test $ret -eq 0; then
- set X $pairlist
- shift
- first=yes
- # Since DOS filename conventions don't allow two dots,
- # the DOS version of Bison writes out y_tab.c instead of y.tab.c
- # and y_tab.h instead of y.tab.h. Test to see if this is the case.
- y_tab_nodot="no"
- if test -f y_tab.c || test -f y_tab.h; then
- y_tab_nodot="yes"
- fi
-
- # The directory holding the input.
- input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
- # Quote $INPUT_DIR so we can use it in a regexp.
- # FIXME: really we should care about more than `.' and `\'.
- input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
-
- while test "$#" -ne 0; do
- from="$1"
- # Handle y_tab.c and y_tab.h output by DOS
- if test $y_tab_nodot = "yes"; then
- if test $from = "y.tab.c"; then
- from="y_tab.c"
- else
- if test $from = "y.tab.h"; then
- from="y_tab.h"
- fi
- fi
- fi
+ for from in *
+ do
+ to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
- # otherwise prepend `../'.
- case "$2" in
- [\\/]* | ?:[\\/]*) target="$2";;
- *) target="../$2";;
+ # otherwise prepend '../'.
+ case $to in
+ [\\/]* | ?:[\\/]*) target=$to;;
+ *) target=../$to;;
esac
- # We do not want to overwrite a header file if it hasn't
- # changed. This avoid useless recompilations. However the
- # parser itself (the first file) should always be updated,
- # because it is the destination of the .y.c rule in the
- # Makefile. Divert the output of all other files to a temporary
- # file so we can compare them to existing versions.
- if test $first = no; then
- realtarget="$target"
- target="tmp-`echo $target | sed s/.*[\\/]//g`"
+ # Do not overwrite unchanged header files to avoid useless
+ # recompilations. Always update the parser itself: it is the
+ # destination of the .y.c rule in the Makefile. Divert the
+ # output of all other files to a temporary file so we can
+ # compare them to existing versions.
+ if test $from != $parser; then
+ realtarget=$target
+ target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
- # Edit out `#line' or `#' directives.
- #
- # We don't want the resulting debug information to point at
- # an absolute srcdir; it is better for it to just mention the
- # .y file with no path.
- #
- # We want to use the real output file name, not yy.lex.c for
- # instance.
- #
- # We want the include guards to be adjusted too.
- FROM=`echo "$from" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
- TARGET=`echo "$2" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
- sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
- -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
-
- # Check whether header files must be updated.
- if test $first = no; then
- if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
- echo "$2" is unchanged
- rm -f "$target"
- else
- echo updating "$2"
+
+ # Munge "#line" or "#" directives. Don't let the resulting
+ # debug information point at an absolute srcdir. Use the real
+ # output file name, not yy.lex.c for instance. Adjust the
+ # include guards too.
+ sed -e "/^#/!b" \
+ -e "s|$input_rx|$input_sub_rx|" \
+ -e "$sed_fix_filenames" \
+ -e "$sed_fix_header_guards" \
+ "$from" >"$target" || ret=$?
+
+ # Check whether files must be updated.
+ if test "$from" != "$parser"; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$to is unchanged"
+ rm -f "$target"
+ else
+ echo "updating $to"
mv -f "$target" "$realtarget"
fi
fi
else
- # A missing file is only an error for the first file. This
- # is a blatant hack to let us support using "yacc -d". If -d
- # is not specified, we don't want an error when the header
- # file is "missing".
- if test $first = yes; then
+ # A missing file is only an error for the parser. This is a
+ # blatant hack to let us support using "yacc -d". If -d is not
+ # specified, don't fail when the header file is "missing".
+ if test "$from" = "$parser"; then
ret=1
fi
fi
- shift
- shift
- first=no
done
-else
- ret=$?
fi
# Remove the directory.
diff --git a/app/lzo/config.hin b/app/lzo/config.hin
index 94a6f18e..bd528c0a 100644
--- a/app/lzo/config.hin
+++ b/app/lzo/config.hin
@@ -243,8 +243,7 @@
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Define to 1 if your machine is big endian. */
@@ -253,9 +252,6 @@
/* Define to 1 if your machine is little endian. */
#undef LZO_ABI_LITTLE_ENDIAN
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
/* Name of package */
#undef PACKAGE
@@ -370,6 +366,11 @@
# endif
#endif
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
diff --git a/app/lzo/configure b/app/lzo/configure
index a72c8ab8..4ff70230 100755
--- a/app/lzo/configure
+++ b/app/lzo/configure
@@ -1,18 +1,16 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for LZO 2.06.
+# Generated by GNU Autoconf 2.69 for LZO 2.07.
#
# Report bugs to <markus@oberhumer.com>.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer.
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
# All Rights Reserved.
# This configure script may be copied, distributed and modified under the
# terms of the GNU General Public License; see COPYING for more details.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -96,6 +94,7 @@ fi
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -140,6 +139,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -173,7 +197,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -226,14 +251,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -336,6 +372,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -457,6 +501,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# 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).
@@ -491,16 +539,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... 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'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -512,28 +560,8 @@ else
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
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# 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'"
@@ -567,8 +595,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='LZO'
PACKAGE_TARNAME='lzo'
-PACKAGE_VERSION='2.06'
-PACKAGE_STRING='LZO 2.06'
+PACKAGE_VERSION='2.07'
+PACKAGE_STRING='LZO 2.07'
PACKAGE_BUGREPORT='markus@oberhumer.com'
PACKAGE_URL='http://www.oberhumer.com/opensource/lzo/'
@@ -623,8 +651,11 @@ OTOOL
LIPO
NMEDIT
DSYMUTIL
+MANIFEST_TOOL
RANLIB
+ac_ct_AR
AR
+DLLTOOL
OBJDUMP
LN_S
NM
@@ -636,6 +667,8 @@ SED
LIBTOOL
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
@@ -667,6 +700,7 @@ CPP
am__fastdepCCAS_FALSE
am__fastdepCCAS_TRUE
CCASDEPMODE
+am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
@@ -748,6 +782,7 @@ enable_shared
with_pic
enable_fast_install
with_gnu_ld
+with_sysroot
enable_libtool_lock
enable_asm
'
@@ -1166,7 +1201,7 @@ Try \`$0 --help' for more information"
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
@@ -1217,8 +1252,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1304,7 +1337,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures LZO 2.06 to adapt to many kinds of systems.
+\`configure' configures LZO 2.07 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1375,7 +1408,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of LZO 2.06:";;
+ short | recursive ) echo "Configuration of LZO 2.07:";;
esac
cat <<\_ACEOF
@@ -1383,13 +1416,16 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
--disable-largefile omit support for large files
- --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
--enable-static[=PKGS] build static libraries [default=yes]
--enable-shared[=PKGS] build shared libraries [default=no]
--enable-fast-install[=PKGS]
@@ -1400,9 +1436,11 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic try to use only PIC/non-PIC objects [default=use
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
+ compiler's sysroot if not specified).
Some influential environment variables:
CC C compiler command
@@ -1483,14 +1521,14 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-LZO configure 2.06
-generated by GNU Autoconf 2.67
+LZO configure 2.07
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer.
+Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
All Rights Reserved.
This configure script may be copied, distributed and modified under the
terms of the GNU General Public License; see COPYING for more details.
@@ -1535,7 +1573,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1572,7 +1610,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -1614,7 +1652,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
@@ -1628,7 +1666,7 @@ ac_fn_c_check_header_compile ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1646,7 +1684,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
@@ -1677,7 +1715,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -1691,7 +1729,7 @@ fi
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
@@ -1704,7 +1742,7 @@ ac_fn_c_check_func ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1759,7 +1797,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
@@ -1771,10 +1809,10 @@ $as_echo "$ac_res" >&6; }
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval "test \"\${$3+set}\"" = set; then :
+ if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -1841,7 +1879,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -1850,7 +1888,7 @@ eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
@@ -1863,7 +1901,7 @@ ac_fn_c_check_type ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
@@ -1904,7 +1942,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
@@ -1925,7 +1963,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1941,7 +1980,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1967,7 +2007,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1983,7 +2024,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2017,7 +2059,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2081,7 +2124,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
rm -f conftest.val
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_compute_int
@@ -2089,8 +2132,8 @@ 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 LZO $as_me 2.06, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+It was created by LZO $as_me 2.07, which was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2488,14 +2531,14 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
@@ -2517,6 +2560,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
+#
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
@@ -2536,6 +2580,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
#
@@ -2544,7 +2591,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Checks for stat-related time functions.
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2011 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2014 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -2582,7 +2629,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
@@ -2616,7 +2663,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
@@ -2649,7 +2696,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
$as_echo_n "checking target system type... " >&6; }
-if test "${ac_cv_target+set}" = set; then :
+if ${ac_cv_target+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$target_alias" = x; then
@@ -2763,7 +2810,7 @@ if test -n "$ac_tool_prefix"; then
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2775,7 +2822,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2803,7 +2850,7 @@ if test -z "$ac_cv_prog_CC"; then
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -2815,7 +2862,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2856,7 +2903,7 @@ if test -z "$CC"; then
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2868,7 +2915,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2896,7 +2943,7 @@ if test -z "$CC"; then
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2909,7 +2956,7 @@ 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 as_fn_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
@@ -2955,7 +3002,7 @@ if test -z "$CC"; then
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2967,7 +3014,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2999,7 +3046,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -3011,7 +3058,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3282,7 +3329,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3333,7 +3380,7 @@ OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3370,7 +3417,7 @@ ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3448,7 +3495,7 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
@@ -3457,8 +3504,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* 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);
@@ -3543,16 +3589,17 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3566,103 +3613,30 @@ main ()
return 0;
}
_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
+ done
+ rm -f core conftest*
+ unset am_i
fi
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
@@ -3670,6 +3644,12 @@ if test "$am_t" != yes; then
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
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
+
rm -rf .tst 2>/dev/null
@@ -3700,7 +3680,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -3733,6 +3713,7 @@ fi
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
@@ -3754,15 +3735,16 @@ depcc="$CCAS" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -3794,16 +3776,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -3812,16 +3794,16 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -3887,7 +3869,7 @@ if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then :
+ if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
@@ -4069,7 +4051,7 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
+if ${ac_cv_c_const+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4078,11 +4060,11 @@ else
int
main ()
{
-/* FIXME: Include the comments suggested by Paul. */
+
#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
+ /* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
- const charset cs;
+ const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
@@ -4099,8 +4081,9 @@ main ()
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
@@ -4116,10 +4099,10 @@ main ()
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this saying
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, 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;
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
@@ -4150,7 +4133,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
@@ -4164,7 +4147,7 @@ do
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
+ as_fn_executable_p "$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
@@ -4213,7 +4196,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4230,7 +4213,7 @@ do
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
+ as_fn_executable_p "$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
@@ -4280,7 +4263,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4410,7 +4393,7 @@ done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
+if ${ac_cv_c_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
@@ -4645,7 +4628,7 @@ if test "$enable_largefile" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+if ${ac_cv_sys_largefile_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_sys_largefile_CC=no
@@ -4696,7 +4679,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+if ${ac_cv_sys_file_offset_bits+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
@@ -4765,7 +4748,7 @@ rm -rf conftest*
if test $ac_cv_sys_file_offset_bits = unknown; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then :
+if ${ac_cv_sys_large_files+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
@@ -4832,10 +4815,12 @@ _ACEOF
esac
rm -rf conftest*
fi
+
+
fi
-am__api_version='1.11'
+am__api_version='1.14'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -4854,7 +4839,7 @@ am__api_version='1.11'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4874,7 +4859,7 @@ case $as_dir/ in #((
# 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 as_fn_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.
@@ -4932,9 +4917,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -4945,32 +4927,40 @@ case `pwd` in
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$2" = conftest.file
)
then
@@ -4982,6 +4972,16 @@ Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
@@ -5001,12 +5001,12 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
@@ -5018,17 +5018,17 @@ if test x"${install_sh}" != xset; then
esac
fi
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
@@ -5040,7 +5040,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5068,7 +5068,7 @@ if test -z "$ac_cv_prog_STRIP"; then
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
@@ -5080,7 +5080,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5121,7 +5121,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then :
+ if ${ac_cv_path_mkdir+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5131,7 +5131,7 @@ do
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
+ as_fn_executable_p "$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) '* | \
@@ -5160,19 +5160,13 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
@@ -5184,7 +5178,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5212,7 +5206,7 @@ done
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -5239,6 +5233,45 @@ $as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -5261,7 +5294,7 @@ fi
# Define the identity of the package.
PACKAGE='lzo'
- VERSION='2.06'
+ VERSION='2.07'
cat >>confdefs.h <<_ACEOF
@@ -5289,13 +5322,24 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
@@ -5304,15 +5348,16 @@ depcc="$CC" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -5346,16 +5391,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -5364,16 +5409,16 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -5428,16 +5473,84 @@ fi
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
fi
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=0;;
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
AM_BACKSLASH='\'
ac_config_headers="$ac_config_headers config.h:config.hin"
@@ -5452,14 +5565,14 @@ if test "${enable_static+set}" = set; then :
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -5483,14 +5596,14 @@ if test "${enable_shared+set}" = set; then :
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -5513,8 +5626,8 @@ esac
-macro_version='2.2.10'
-macro_revision='1.3175'
+macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
@@ -5528,7 +5641,7 @@ macro_revision='1.3175'
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
# Backslashify metacharacters that are still active within
# double-quoted strings.
@@ -5554,7 +5667,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
$as_echo_n "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -5577,7 +5690,7 @@ func_echo_all ()
$ECHO ""
}
-case "$ECHO" in
+case $ECHO in
printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
$as_echo "printf" >&6; } ;;
print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -5601,7 +5714,7 @@ esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
+if ${ac_cv_path_SED+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -5621,7 +5734,7 @@ do
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+ as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
@@ -5683,7 +5796,7 @@ Xsed="$SED -e 1s/^X//"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then :
+if ${ac_cv_path_FGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -5700,7 +5813,7 @@ do
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+ as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
@@ -5770,19 +5883,19 @@ test -z "$GREP" && GREP=grep
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
else
with_gnu_ld=no
fi
ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
+ # 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` ;;
@@ -5796,7 +5909,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
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"
+ test -z "$LD" && LD=$ac_prog
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -5807,43 +5920,43 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
with_gnu_ld=unknown
;;
esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
-if test "${lt_cv_path_LD+set}" = set; then :
+if ${lt_cv_path_LD+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
+ 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"
+ 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 no != "$with_gnu_ld" && break
;;
*)
- test "$with_gnu_ld" != yes && break
+ test yes != "$with_gnu_ld" && break
;;
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
else
- lt_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="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
$as_echo "$LD" >&6; }
@@ -5854,7 +5967,7 @@ fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+if ${lt_cv_prog_gnu_ld+:} false; then :
$as_echo_n "(cached) " >&6
else
# I'd rather use --version here, but apparently some GNU lds only accept -v.
@@ -5881,38 +5994,38 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if test "${lt_cv_path_NM+set}" = set; then :
+if ${lt_cv_path_NM+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
# Let the user override the test.
- lt_cv_path_NM="$NM"
+ lt_cv_path_NM=$NM
else
- lt_nm_to_check="${ac_tool_prefix}nm"
+ 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
+ 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"
+ 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
+ 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:
+ # 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
+ break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
- break
+ break 2
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5923,15 +6036,15 @@ else
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
done
: ${lt_cv_path_NM=no}
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
@@ -5944,7 +6057,7 @@ else
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+if ${ac_cv_prog_DUMPBIN+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DUMPBIN"; then
@@ -5956,7 +6069,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5988,7 +6101,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DUMPBIN"; then
@@ -6000,7 +6113,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6037,9 +6150,9 @@ esac
fi
fi
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
*COFF*)
- DUMPBIN="$DUMPBIN -symbols"
+ DUMPBIN="$DUMPBIN -symbols -headers"
;;
*)
DUMPBIN=:
@@ -6047,8 +6160,8 @@ fi
esac
fi
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
fi
fi
test -z "$NM" && NM=nm
@@ -6060,7 +6173,7 @@ test -z "$NM" && NM=nm
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if test "${lt_cv_nm_interface+set}" = set; then :
+if ${lt_cv_nm_interface+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_nm_interface="BSD nm"
@@ -6095,11 +6208,11 @@ fi
# find the maximum length of command line arguments
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+if ${lt_cv_sys_max_cmd_len+:} false; then :
$as_echo_n "(cached) " >&6
else
i=0
- teststring="ABCD"
+ teststring=ABCD
case $build_os in
msdosdjgpp*)
@@ -6139,7 +6252,7 @@ else
lt_cv_sys_max_cmd_len=8192;
;;
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# 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`
@@ -6158,6 +6271,11 @@ else
lt_cv_sys_max_cmd_len=196608
;;
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -6184,22 +6302,23 @@ else
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$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
+ for i in 1 2 3 4 5 6 7 8; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
+ test 17 != "$i" # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
@@ -6217,7 +6336,7 @@ else
fi
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
@@ -6235,30 +6354,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
: ${MV="mv -f"}
: ${RM="rm -f"}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
@@ -6290,9 +6385,83 @@ esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then :
+if ${lt_cv_ld_reload_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_reload_flag='-r'
@@ -6306,9 +6475,14 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -6328,7 +6502,7 @@ if test -n "$ac_tool_prefix"; then
set dummy ${ac_tool_prefix}objdump; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJDUMP"; then
@@ -6340,7 +6514,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6368,7 +6542,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
set dummy objdump; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJDUMP"; then
@@ -6380,7 +6554,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6427,7 +6601,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then :
+if ${lt_cv_deplibs_check_method+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
@@ -6436,13 +6610,13 @@ 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.
+# '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.
+# that 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]*)
@@ -6469,8 +6643,7 @@ mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ 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
@@ -6506,10 +6679,6 @@ freebsd* | dragonfly*)
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6547,8 +6716,8 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6570,8 +6739,8 @@ newos6*)
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
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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)$'
@@ -6629,6 +6798,21 @@ esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -6644,12 +6828,165 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AR"; then
@@ -6661,8 +6998,8 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6682,14 +7019,18 @@ $as_echo "no" >&6; }
fi
+ test -n "$AR" && break
+ done
fi
-if test -z "$ac_cv_prog_AR"; then
+if test -z "$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
+ 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_AR"; then
@@ -6701,8 +7042,8 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6721,6 +7062,10 @@ else
$as_echo "no" >&6; }
fi
+
+ test -n "$ac_ct_AR" && break
+done
+
if test "x$ac_ct_AR" = x; then
AR="false"
else
@@ -6732,12 +7077,12 @@ ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
fi
-else
- AR="$ac_cv_prog_AR"
fi
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
@@ -6747,6 +7092,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
@@ -6754,7 +7155,7 @@ if test -n "$ac_tool_prefix"; then
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
@@ -6766,7 +7167,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6794,7 +7195,7 @@ if test -z "$ac_cv_prog_STRIP"; then
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
@@ -6806,7 +7207,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6853,7 +7254,7 @@ if test -n "$ac_tool_prefix"; then
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
+if ${ac_cv_prog_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
@@ -6865,7 +7266,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6893,7 +7294,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
set dummy ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
@@ -6905,7 +7306,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6954,14 +7355,14 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -7022,7 +7423,7 @@ compiler=$CC
# Check for command to grab the raw symbol name followed by C symbol from nm.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
$as_echo_n "(cached) " >&6
else
@@ -7044,7 +7445,7 @@ cygwin* | mingw* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
symcode='[ABCDEGRST]'
fi
;;
@@ -7077,14 +7478,44 @@ case `$NM -V 2>&1` in
symcode='[ABCDGIRSTW]' ;;
esac
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
# 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'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$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'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
@@ -7102,24 +7533,29 @@ for ac_symprfx in "" "_"; do
# 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.
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
" \$ 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))}"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -7161,6 +7597,18 @@ _LT_EOF
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -7172,7 +7620,7 @@ _LT_EOF
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT_DLSYM_CONST struct {
const char *name;
void *address;
}
@@ -7180,7 +7628,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
@@ -7198,19 +7646,19 @@ static const void *lt_preloaded_setup() {
_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"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&5
fi
@@ -7227,7 +7675,7 @@ _LT_EOF
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
+ if test yes = "$pipe_works"; then
break
else
lt_cv_sys_global_symbol_pipe=
@@ -7247,6 +7695,21 @@ else
$as_echo "ok" >&6; }
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
@@ -7268,18 +7731,63 @@ fi
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
fi
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || 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.
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7288,24 +7796,25 @@ ia64-*-hpux*)
test $ac_status = 0; }; then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
- HPUX_IA64_MODE="32"
+ HPUX_IA64_MODE=32
;;
*ELF-64*)
- HPUX_IA64_MODE="64"
+ HPUX_IA64_MODE=64
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo '#line '$LINENO' "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
@@ -7334,9 +7843,50 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7350,9 +7900,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -7371,7 +7931,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -7389,11 +7952,11 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
+ SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -belf"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then :
+if ${lt_cv_cc_needs_belf+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_ext=c
@@ -7429,13 +7992,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
+ CFLAGS=$SAVE_CFLAGS
fi
;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7445,7 +8009,20 @@ sparc*-*solaris*)
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -7459,7 +8036,124 @@ sparc*-*solaris*)
;;
esac
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
case $host_os in
@@ -7469,7 +8163,7 @@ need_locks="$enable_libtool_lock"
set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DSYMUTIL"; then
@@ -7481,7 +8175,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7509,7 +8203,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then
set dummy dsymutil; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DSYMUTIL"; then
@@ -7521,7 +8215,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7561,7 +8255,7 @@ fi
set dummy ${ac_tool_prefix}nmedit; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+if ${ac_cv_prog_NMEDIT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NMEDIT"; then
@@ -7573,7 +8267,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7601,7 +8295,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then
set dummy nmedit; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_NMEDIT"; then
@@ -7613,7 +8307,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7653,7 +8347,7 @@ fi
set dummy ${ac_tool_prefix}lipo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LIPO+set}" = set; then :
+if ${ac_cv_prog_LIPO+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$LIPO"; then
@@ -7665,7 +8359,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7693,7 +8387,7 @@ if test -z "$ac_cv_prog_LIPO"; then
set dummy lipo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_LIPO"; then
@@ -7705,7 +8399,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7745,7 +8439,7 @@ fi
set dummy ${ac_tool_prefix}otool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL+set}" = set; then :
+if ${ac_cv_prog_OTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL"; then
@@ -7757,7 +8451,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7785,7 +8479,7 @@ if test -z "$ac_cv_prog_OTOOL"; then
set dummy otool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL"; then
@@ -7797,7 +8491,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7837,7 +8531,7 @@ fi
set dummy ${ac_tool_prefix}otool64; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+if ${ac_cv_prog_OTOOL64+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL64"; then
@@ -7849,7 +8543,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7877,7 +8571,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then
set dummy otool64; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL64"; then
@@ -7889,7 +8583,7 @@ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7952,11 +8646,11 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
$as_echo_n "checking for -single_module linker flag... " >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+if ${lt_cv_apple_cc_single_mod+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
+ 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
@@ -7968,7 +8662,13 @@ else
$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
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
@@ -7979,9 +8679,10 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_exported_symbols_list=no
@@ -8006,14 +8707,15 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
-if test "${lt_cv_ld_force_load+set}" = set; then :
+if ${lt_cv_ld_force_load+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_force_load=no
@@ -8032,7 +8734,9 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
@@ -8045,32 +8749,32 @@ fi
$as_echo "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _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' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[012]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ if test yes = "$lt_cv_apple_cc_single_mod"; 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'
+ if test yes = "$lt_cv_ld_exported_symbols_list"; 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}'
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
@@ -8082,7 +8786,7 @@ for ac_header in dlfcn.h
do :
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
-if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DLFCN_H 1
_ACEOF
@@ -8110,14 +8814,27 @@ done
# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then :
- withval=$with_pic; pic_mode="$withval"
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
else
pic_mode=default
fi
-test -z "$pic_mode" && pic_mode=default
-
@@ -8133,14 +8850,14 @@ if test "${enable_fast_install+set}" = set; then :
*)
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,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -8158,7 +8875,7 @@ fi
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8188,6 +8905,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
test -z "$LN_S" && LN_S="ln -s"
@@ -8203,13 +8924,13 @@ test -z "$LN_S" && LN_S="ln -s"
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
-if test "${lt_cv_objdir+set}" = set; then :
+if ${lt_cv_objdir+:} false; then :
$as_echo_n "(cached) " >&6
else
rm -f .libs 2>/dev/null
@@ -8242,7 +8963,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
+ if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -8253,14 +8974,14 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# 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"
+with_gnu_ld=$lt_cv_prog_gnu_ld
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
# Set sane defaults for various variables
test -z "$CC" && CC=cc
@@ -8287,27 +9008,27 @@ file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ lt_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
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -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"
+ 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
:
@@ -8330,13 +9051,13 @@ _LT_EOF
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac
fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
@@ -8353,27 +9074,27 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
$as_echo_n "checking for file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ lt_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
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -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"
+ 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
:
@@ -8396,13 +9117,13 @@ _LT_EOF
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac
fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
@@ -8423,7 +9144,7 @@ esac
# Use C for the default configuration in the libtool script
-lt_save_CC="$CC"
+lt_save_CC=$CC
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8481,7 +9202,7 @@ if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $cc_basename in
nvcc*)
lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8491,13 +9212,13 @@ if test "$GCC" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
+ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
# 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
@@ -8527,7 +9248,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
else
:
@@ -8544,20 +9265,19 @@ fi
lt_prog_compiler_pic=
lt_prog_compiler_static=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_static='-static'
case $host_os in
aix*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
fi
+ lt_prog_compiler_pic='-fPIC'
;;
amigaos*)
@@ -8568,8 +9288,8 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
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'.
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
esac
@@ -8645,7 +9365,9 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
lt_prog_compiler_wl='-Xlinker '
- lt_prog_compiler_pic='-Xcompiler -fPIC'
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
;;
esac
else
@@ -8653,7 +9375,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
case $host_os in
aix*)
lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
else
@@ -8661,6 +9383,20 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
fi
;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
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).
@@ -8680,7 +9416,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
+ lt_prog_compiler_static='$wl-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
@@ -8689,9 +9425,9 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
+ # old Intel for x86_64, which still supported -KPIC.
ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
@@ -8710,6 +9446,18 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
lt_prog_compiler_pic='--shared'
lt_prog_compiler_static='--static'
;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -8730,18 +9478,33 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ F* | *Sun*Fortran*)
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl=''
;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
esac
;;
esac
@@ -8792,7 +9555,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
lt_prog_compiler_pic='-Kconform_pic'
lt_prog_compiler_static='-Bstatic'
fi
@@ -8821,7 +9584,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
fi
case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
+ # For platforms that do not support PIC, -DPIC is meaningless:
*djgpp*)
lt_prog_compiler_pic=
;;
@@ -8829,13 +9592,17 @@ case $host_os in
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
@@ -8843,13 +9610,13 @@ $as_echo "$lt_prog_compiler_pic" >&6; }
if test -n "$lt_prog_compiler_pic"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
# 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
@@ -8879,7 +9646,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -8896,17 +9663,22 @@ fi
+
+
+
+
+
#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+if ${lt_cv_prog_compiler_static_works+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -8925,13 +9697,13 @@ else
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
:
else
lt_prog_compiler_static=
@@ -8945,7 +9717,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
@@ -9000,7 +9772,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
@@ -9051,8 +9823,8 @@ $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
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
$as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9064,9 +9836,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
ln conftest.a conftest.b 2>/dev/null && hard_links=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
@@ -9094,7 +9866,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
hardcode_direct=no
hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
@@ -9110,9 +9881,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9127,7 +9898,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# 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
+ if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
@@ -9135,7 +9906,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
- openbsd*)
+ openbsd* | bitrig*)
with_gnu_ld=no
;;
esac
@@ -9145,7 +9916,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
@@ -9167,24 +9938,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
esac
fi
- if test "$lt_use_gnu_ld_interface" = yes; then
+ if test yes = "$lt_use_gnu_ld_interface"; then
# If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
+ wlarc='$wl'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec='$wl--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v 2>&1` in
+ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9197,7 +9968,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
case $host_os in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
+ if test ia64 != "$host_cpu"; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
@@ -9216,7 +9987,7 @@ _LT_EOF
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
@@ -9232,7 +10003,7 @@ _LT_EOF
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'
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
@@ -9242,68 +10013,69 @@ _LT_EOF
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='${wl}--export-all-symbols'
+ export_dynamic_flag_spec='$wl--export-all-symbols'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs=no
fi
;;
haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
link_all_deplibs=yes
;;
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
+ if test linux-dietlibc = "$host_os"; 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
+ && test no = "$tmp_diet"
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
@@ -9314,43 +10086,44 @@ _LT_EOF
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
@@ -9364,8 +10137,8 @@ _LT_EOF
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -9383,8 +10156,8 @@ _LT_EOF
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9396,7 +10169,7 @@ _LT_EOF
ld_shlibs=no
cat <<_LT_EOF 1>&2
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
*** 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
@@ -9411,9 +10184,9 @@ _LT_EOF
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9430,15 +10203,15 @@ _LT_EOF
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
- if test "$ld_shlibs" = no; then
+ if test no = "$ld_shlibs"; then
runpath_var=
hardcode_libdir_flag_spec=
export_dynamic_flag_spec=
@@ -9454,7 +10227,7 @@ _LT_EOF
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
@@ -9462,12 +10235,12 @@ _LT_EOF
;;
aix[4-9]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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=""
+ 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
@@ -9485,7 +10258,7 @@ _LT_EOF
# 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
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
aix_use_runtimelinking=yes
break
fi
@@ -9508,13 +10281,13 @@ _LT_EOF
hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
- file_list_spec='${wl}-f,'
+ file_list_spec='$wl-f,'
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; 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`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -9533,35 +10306,41 @@ _LT_EOF
;;
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
fi
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; 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'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
fi
fi
- export_dynamic_flag_spec='${wl}-bexpall'
+ export_dynamic_flag_spec='$wl-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
+ if test yes = "$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -9574,34 +10353,47 @@ main ()
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_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 "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -9614,38 +10406,45 @@ main ()
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_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 "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ no_undefined_flag=' $wl-bernotok'
+ allow_undefined_flag=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec='$convenience'
fi
archive_cmds_need_lc=yes
# This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
@@ -9654,7 +10453,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
@@ -9674,20 +10473,65 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -9697,23 +10541,24 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
else
whole_archive_flag_spec=''
fi
link_all_deplibs=yes
- allow_undefined_flag="$_lt_dar_allow_undefined"
+ allow_undefined_flag=$_lt_dar_allow_undefined
case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
- if test "$_lt_dar_can_shared" = "yes"; then
+ if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
ld_shlibs=no
@@ -9727,10 +10572,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=no
;;
- 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
@@ -9743,7 +10584,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
+ freebsd2.*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
@@ -9752,41 +10593,40 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ if test yes = "$GCC"; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
;;
hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_flag_spec_ld='+b $libdir'
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
@@ -9794,25 +10634,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ if test yes,no = "$GCC,$with_gnu_ld"; then
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
@@ -9820,11 +10660,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
$as_echo_n "checking if $CC understands -b... " >&6; }
-if test "${lt_cv_prog_compiler__b+set}" = set; then :
+if ${lt_cv_prog_compiler__b+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler__b=no
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -b"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9843,14 +10683,14 @@ else
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
$as_echo "$lt_cv_prog_compiler__b" >&6; }
-if test x"$lt_cv_prog_compiler__b" = xyes; then
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
@@ -9858,8 +10698,8 @@ fi
;;
esac
fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
case $host_cpu in
@@ -9870,7 +10710,7 @@ fi
*)
hardcode_direct=yes
hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
@@ -9881,30 +10721,43 @@ fi
;;
irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-int foo(void) {}
+int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
fi
archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
inherit_rpath=yes
link_all_deplibs=yes
@@ -9924,7 +10777,7 @@ rm -f core conftest.err conftest.$ac_objext \
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_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
@@ -9932,27 +10785,19 @@ rm -f core conftest.err conftest.$ac_objext \
*nto* | *qnx*)
;;
- openbsd*)
+ openbsd* | bitrig*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
fi
else
ld_shlibs=no
@@ -9968,28 +10813,28 @@ rm -f core conftest.err conftest.$ac_objext \
;;
osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
fi
archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10000,24 +10845,24 @@ rm -f core conftest.err conftest.$ac_objext \
solaris*)
no_undefined_flag=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ 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'
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
- wlarc='${wl}'
- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ wlarc='$wl'
+ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
@@ -10027,11 +10872,11 @@ rm -f core conftest.err conftest.$ac_objext \
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 understands '-z linker_flag'. GCC discards it without '$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ if test yes = "$GCC"; then
+ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
else
whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
fi
@@ -10041,10 +10886,10 @@ rm -f core conftest.err conftest.$ac_objext \
;;
sunos4*)
- if test "x$host_vendor" = xsequent; then
+ if test sequent = "$host_vendor"; 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'
+ 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
@@ -10093,43 +10938,43 @@ rm -f core conftest.err conftest.$ac_objext \
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
+ no_undefined_flag='$wl-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
+ # Note: We CANNOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
+ no_undefined_flag='$wl-z,text'
+ allow_undefined_flag='$wl-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_flag_spec='$wl-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
+ export_dynamic_flag_spec='$wl-Bexport'
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -10144,10 +10989,10 @@ rm -f core conftest.err conftest.$ac_objext \
;;
esac
- if test x$host_vendor = xsni; then
+ if test sni = "$host_vendor"; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='${wl}-Blargedynsym'
+ export_dynamic_flag_spec='$wl-Blargedynsym'
;;
esac
fi
@@ -10155,7 +11000,7 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
with_gnu_ld=$with_gnu_ld
@@ -10181,7 +11026,7 @@ x|xyes)
# Assume -lc should be added
archive_cmds_need_lc=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
+ if test yes,yes = "$GCC,$enable_shared"; then
case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
@@ -10192,7 +11037,7 @@ x|xyes)
# to ld, don't add -lc before -lgcc.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if test "${lt_cv_archive_cmds_need_lc+set}" = set; then :
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
$as_echo_n "(cached) " >&6
else
$RM conftest*
@@ -10393,22 +11238,17 @@ esac
-
-
-
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
@@ -10424,28 +11264,35 @@ if test "$GCC" = yes; then
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
+ # 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`
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
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
+ 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"
+ elif test -n "$lt_multi_os_dir"; then
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;
+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;
+ lt_foo = "/" $lt_i lt_foo;
} else {
lt_count--;
}
@@ -10459,7 +11306,7 @@ BEGIN {RS=" "; FS="/|\n";} {
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
@@ -10468,7 +11315,7 @@ fi
library_names_spec=
libname_spec='lib$name'
soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
@@ -10487,53 +11334,53 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='$libname$release$shared_ext$major'
;;
aix[4-9]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ 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
+ # 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
+ 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
+ # AIX (on Power*) has no versioning support, so currently we cannot 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 test yes = "$aix_use_runtimelinking"; 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}'
+ 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'
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
fi
shlibpath_var=LIBPATH
fi
@@ -10544,27 +11391,27 @@ amigaos*)
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}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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}'
+ library_names_spec='$libname$shared_ext'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi[45]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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"
@@ -10576,16 +11423,17 @@ bsdi[45]*)
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ 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~
@@ -10601,26 +11449,84 @@ cygwin* | mingw* | pw32* | cegcc*)
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}'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
@@ -10630,8 +11536,8 @@ darwin* | rhapsody*)
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'
+ 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`'
@@ -10641,18 +11547,14 @@ darwin* | rhapsody*)
;;
dgux*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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.
@@ -10660,25 +11562,25 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[123]*) objformat=aout ;;
+ freebsd[23].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ 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'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2*)
+ freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10697,25 +11599,15 @@ freebsd* | dragonfly*)
esac
;;
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
haiku*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -10733,9 +11625,9 @@ hpux9* | hpux10* | hpux11*)
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
+ 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 32 = "$HPUX_IA64_MODE"; 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"
@@ -10748,8 +11640,8 @@ hpux9* | hpux10* | hpux11*)
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'
+ 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
;;
@@ -10758,8 +11650,8 @@ hpux9* | hpux10* | hpux11*)
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'
+ 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, ...
@@ -10769,11 +11661,11 @@ hpux9* | hpux10* | hpux11*)
;;
interix[3-9]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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
@@ -10784,16 +11676,16 @@ irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ 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=
@@ -10812,8 +11704,8 @@ irix5* | irix6* | nonstopux*)
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}"
+ 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
;;
@@ -10822,19 +11714,39 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # 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
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
- if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then :
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_shlibpath_overrides_runpath=no
@@ -10896,12 +11808,12 @@ netbsd*)
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'
+ 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'
+ 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
@@ -10910,8 +11822,8 @@ netbsd*)
;;
newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
@@ -10920,45 +11832,34 @@ newsos6)
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'
+ 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*)
+openbsd* | bitrig*)
version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
+ 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
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
else
- shlibpath_overrides_runpath=yes
+ need_version=yes
fi
+ 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
+ shlibpath_overrides_runpath=yes
;;
os2*)
libname_spec='$name'
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
+ library_names_spec='$libname$shared_ext $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
@@ -10967,11 +11868,11 @@ 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}'
+ 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"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
rdos*)
@@ -10979,11 +11880,11 @@ rdos*)
;;
solaris*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ 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
@@ -10993,20 +11894,20 @@ solaris*)
sunos4*)
version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ 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
+ if test yes = "$with_gnu_ld"; 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'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
@@ -11027,10 +11928,10 @@ sysv4 | sysv4.3*)
;;
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'
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
@@ -11039,12 +11940,12 @@ 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'
+ 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
+ if test yes = "$with_gnu_ld"; 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'
@@ -11059,19 +11960,19 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ 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'
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -11081,18 +11982,18 @@ uts4*)
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; 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"
+if test set = "${lt_cv_sys_lib_search_path_spec+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"
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
@@ -11191,15 +12092,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
- test "X$hardcode_automatic" = "Xyes" ; then
+ test yes = "$hardcode_automatic"; then
# We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
+ if test no != "$hardcode_direct" &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+ test no != "$hardcode_minus_L"; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
@@ -11214,12 +12115,12 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
$as_echo "$hardcode_action" >&6; }
-if test "$hardcode_action" = relink ||
- test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+ test yes = "$inherit_rpath"; then
# Fast installation is not supported
enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
# Fast installation is not necessary
enable_fast_install=needless
fi
@@ -11229,7 +12130,7 @@ fi
- if test "x$enable_dlopen" != xyes; then
+ if test yes != "$enable_dlopen"; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -11239,26 +12140,26 @@ else
case $host_os in
beos*)
- lt_cv_dlopen="load_add_on"
+ 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=LoadLibrary
lt_cv_dlopen_libs=
;;
cygwin*)
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen=dlopen
lt_cv_dlopen_libs=
;;
darwin*)
- # if libdl is installed we need to link against it
+ # if libdl is installed we need to link against it
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -11292,11 +12193,11 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
else
- lt_cv_dlopen="dyld"
+ lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
@@ -11304,14 +12205,22 @@ fi
;;
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = x""yes; then :
- lt_cv_dlopen="shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+if ${ac_cv_lib_dld_shl_load+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -11345,16 +12254,16 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
else
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = x""yes; then :
- lt_cv_dlopen="dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -11388,12 +12297,12 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+if ${ac_cv_lib_svld_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -11427,12 +12336,12 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+if ${ac_cv_lib_dld_dld_link+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -11466,8 +12375,8 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
fi
@@ -11488,29 +12397,29 @@ fi
;;
esac
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
+ if test no = "$lt_cv_dlopen"; then
enable_dlopen=no
+ else
+ enable_dlopen=yes
fi
case $lt_cv_dlopen in
dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
- save_LIBS="$LIBS"
+ save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then :
+if ${lt_cv_dlopen_self+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
+ if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11559,11 +12468,11 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11589,7 +12498,7 @@ _LT_EOF
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -11609,14 +12518,14 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
$as_echo "$lt_cv_dlopen_self" >&6; }
- if test "x$lt_cv_dlopen_self" = xyes; then
+ if test yes = "$lt_cv_dlopen_self"; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then :
+if ${lt_cv_dlopen_self_static+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
+ if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11665,11 +12574,11 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11695,7 +12604,7 @@ _LT_EOF
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -11716,9 +12625,9 @@ fi
$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
;;
esac
@@ -11762,7 +12671,7 @@ else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
- if test -n "$STRIP" ; then
+ if test -n "$STRIP"; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -11790,7 +12699,7 @@ fi
- # Report which library types will actually be built
+ # Report what library types will actually be built
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -11798,13 +12707,13 @@ $as_echo "$can_build_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
$as_echo_n "checking whether to build shared libraries... " >&6; }
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && 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
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -11812,8 +12721,8 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
;;
aix[4-9]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && enable_static=no
fi
;;
esac
@@ -11823,7 +12732,7 @@ $as_echo "$enable_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
+ test yes = "$enable_shared" || enable_static=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
$as_echo "$enable_static" >&6; }
@@ -11837,7 +12746,9 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-CC="$lt_save_CC"
+CC=$lt_save_CC
+
+
@@ -11868,7 +12779,7 @@ CC="$lt_save_CC"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11921,7 +12832,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h is sane" >&5
$as_echo_n "checking whether limits.h is sane... " >&6; }
-if test "${mfx_cv_header_sane_limits_h+set}" = set; then :
+if ${mfx_cv_header_sane_limits_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12052,7 +12963,7 @@ fi
# ************************************************************************/
ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
+if test "x$ac_cv_type_off_t" = xyes; then :
else
@@ -12063,7 +12974,7 @@ _ACEOF
fi
ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
else
@@ -12074,7 +12985,7 @@ _ACEOF
fi
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
else
@@ -12086,7 +12997,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then :
+if ${ac_cv_type_signal+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12125,7 +13036,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
$as_echo_n "checking size of short... " >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then :
+if ${ac_cv_sizeof_short+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
@@ -12158,7 +13069,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
$as_echo_n "checking size of int... " >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then :
+if ${ac_cv_sizeof_int+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
@@ -12191,7 +13102,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
$as_echo_n "checking size of long... " >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then :
+if ${ac_cv_sizeof_long+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
@@ -12225,7 +13136,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
$as_echo_n "checking size of long long... " >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then :
+if ${ac_cv_sizeof_long_long+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
@@ -12258,7 +13169,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int16" >&5
$as_echo_n "checking size of __int16... " >&6; }
-if test "${ac_cv_sizeof___int16+set}" = set; then :
+if ${ac_cv_sizeof___int16+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int16))" "ac_cv_sizeof___int16" "$ac_includes_default"; then :
@@ -12291,7 +13202,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32" >&5
$as_echo_n "checking size of __int32... " >&6; }
-if test "${ac_cv_sizeof___int32+set}" = set; then :
+if ${ac_cv_sizeof___int32+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32))" "ac_cv_sizeof___int32" "$ac_includes_default"; then :
@@ -12324,7 +13235,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
$as_echo_n "checking size of __int64... " >&6; }
-if test "${ac_cv_sizeof___int64+set}" = set; then :
+if ${ac_cv_sizeof___int64+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
@@ -12358,7 +13269,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
$as_echo_n "checking size of void *... " >&6; }
-if test "${ac_cv_sizeof_void_p+set}" = set; then :
+if ${ac_cv_sizeof_void_p+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
@@ -12391,7 +13302,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
$as_echo_n "checking size of size_t... " >&6; }
-if test "${ac_cv_sizeof_size_t+set}" = set; then :
+if ${ac_cv_sizeof_size_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
@@ -12424,7 +13335,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5
$as_echo_n "checking size of ptrdiff_t... " >&6; }
-if test "${ac_cv_sizeof_ptrdiff_t+set}" = set; then :
+if ${ac_cv_sizeof_ptrdiff_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then :
@@ -12459,7 +13370,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32" >&5
$as_echo_n "checking size of __int32... " >&6; }
-if test "${ac_cv_sizeof___int32+set}" = set; then :
+if ${ac_cv_sizeof___int32+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32))" "ac_cv_sizeof___int32" "$ac_includes_default"; then :
@@ -12492,7 +13403,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
$as_echo_n "checking size of intmax_t... " >&6; }
-if test "${ac_cv_sizeof_intmax_t+set}" = set; then :
+if ${ac_cv_sizeof_intmax_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
@@ -12525,7 +13436,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintmax_t" >&5
$as_echo_n "checking size of uintmax_t... " >&6; }
-if test "${ac_cv_sizeof_uintmax_t+set}" = set; then :
+if ${ac_cv_sizeof_uintmax_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintmax_t))" "ac_cv_sizeof_uintmax_t" "$ac_includes_default"; then :
@@ -12558,7 +13469,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intptr_t" >&5
$as_echo_n "checking size of intptr_t... " >&6; }
-if test "${ac_cv_sizeof_intptr_t+set}" = set; then :
+if ${ac_cv_sizeof_intptr_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intptr_t))" "ac_cv_sizeof_intptr_t" "$ac_includes_default"; then :
@@ -12591,7 +13502,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5
$as_echo_n "checking size of uintptr_t... " >&6; }
-if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
+if ${ac_cv_sizeof_uintptr_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
@@ -12625,7 +13536,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
$as_echo_n "checking size of float... " >&6; }
-if test "${ac_cv_sizeof_float+set}" = set; then :
+if ${ac_cv_sizeof_float+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then :
@@ -12658,7 +13569,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
$as_echo_n "checking size of double... " >&6; }
-if test "${ac_cv_sizeof_double+set}" = set; then :
+if ${ac_cv_sizeof_double+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then :
@@ -12691,7 +13602,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
$as_echo_n "checking size of long double... " >&6; }
-if test "${ac_cv_sizeof_long_double+set}" = set; then :
+if ${ac_cv_sizeof_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
@@ -12725,7 +13636,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
$as_echo_n "checking size of dev_t... " >&6; }
-if test "${ac_cv_sizeof_dev_t+set}" = set; then :
+if ${ac_cv_sizeof_dev_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t" "$ac_includes_default"; then :
@@ -12758,7 +13669,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
$as_echo_n "checking size of fpos_t... " >&6; }
-if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
+if ${ac_cv_sizeof_fpos_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
@@ -12791,7 +13702,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mode_t" >&5
$as_echo_n "checking size of mode_t... " >&6; }
-if test "${ac_cv_sizeof_mode_t+set}" = set; then :
+if ${ac_cv_sizeof_mode_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (mode_t))" "ac_cv_sizeof_mode_t" "$ac_includes_default"; then :
@@ -12824,7 +13735,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
$as_echo_n "checking size of off_t... " >&6; }
-if test "${ac_cv_sizeof_off_t+set}" = set; then :
+if ${ac_cv_sizeof_off_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
@@ -12857,7 +13768,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5
$as_echo_n "checking size of ssize_t... " >&6; }
-if test "${ac_cv_sizeof_ssize_t+set}" = set; then :
+if ${ac_cv_sizeof_ssize_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default"; then :
@@ -12890,7 +13801,7 @@ _ACEOF
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
$as_echo_n "checking size of time_t... " >&6; }
-if test "${ac_cv_sizeof_time_t+set}" = set; then :
+if ${ac_cv_sizeof_time_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then :
@@ -12976,6 +13887,10 @@ $as_echo_n "checking whether to build assembly versions... " >&6; }
if test "X$enable_asm" != Xno; then
mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&5'
cat > conftest.S <<EOF
+#if !defined(__i386__) && !defined(__i386)
+#error
+this+is+an+error
+#endif
#include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
EOF
enable_asm=no
@@ -13031,34 +13946,35 @@ mfx_tmp="-I$srcdir"
mfx_save_CPPFLAGS=$CPPFLAGS
test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your compiler passes the ACC conformance test" >&5
-$as_echo_n "checking whether your compiler passes the ACC conformance test... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your compiler passes the LZO conformance test" >&5
+$as_echo_n "checking whether your compiler passes the LZO conformance test... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define ACC_CONFIG_NO_HEADER 1
-#define ACC_WANT_ACC_INCD_H 1
-#include "src/miniacc.h"
-
-#undef ACCCHK_ASSERT
-#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
-#define ACC_WANT_ACC_CHK_CH 1
-#include "src/miniacc.h"
-
-#undef ACCCHK_ASSERT
-#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
-static void test_acc_compile_time_assert(void) {
-#define ACC_WANT_ACC_CHK_CH 1
-#include "src/miniacc.h"
+#define LZO_CFG_NO_CONFIG_HEADER 1
+#define LZO_WANT_ACC_INCD_H 1
+#include "include/lzo/lzodefs.h"
+#include "src/lzo_supp.h"
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+static void test_lzo_compile_time_assert(void) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
}
#undef NDEBUG
#include <assert.h>
-#undef ACCCHK_ASSERT
-#define ACCCHK_ASSERT(expr) assert(expr);
-static int test_acc_run_time_assert(int r) {
-#define ACC_WANT_ACC_CHK_CH 1
-#include "src/miniacc.h"
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) assert(expr);
+static int test_lzo_run_time_assert(int r) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
return r;
}
@@ -13066,8 +13982,8 @@ int
main ()
{
-test_acc_compile_time_assert();
-if (test_acc_run_time_assert(1) != 1) return 1;
+test_lzo_compile_time_assert();
+if (test_lzo_run_time_assert(1) != 1) return 1;
;
@@ -13091,8 +14007,8 @@ case x$mfx_tmp in
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: Your compiler failed the ACC conformance test - for details see " >&5
-$as_echo "$as_me: Your compiler failed the ACC conformance test - for details see " >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Your compiler failed the LZO conformance test - for details see " >&5
+$as_echo "$as_me: Your compiler failed the LZO conformance test - for details see " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: \`config.log'. Please check that log file and consider sending" >&5
$as_echo "$as_me: \`config.log'. Please check that log file and consider sending" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&5
@@ -13101,7 +14017,7 @@ $as_echo "$as_me: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&6;}
$as_echo "$as_me: Thanks for your support." >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
- as_fn_error $? "ACC conformance test failed. Stop." "$LINENO" 5
+ as_fn_error $? "LZO conformance test failed. Stop." "$LINENO" 5
;;
esac
@@ -13182,10 +14098,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&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" &&
+ if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -13229,6 +14156,14 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -13255,7 +14190,7 @@ fi
DEFS="${DEFS}${my_DEFS}"
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -13356,6 +14291,7 @@ fi
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -13551,16 +14487,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... 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'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -13620,28 +14556,16 @@ else
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
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# 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'"
@@ -13662,8 +14586,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by LZO $as_me 2.06, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+This file was extended by LZO $as_me 2.07, which was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -13729,11 +14653,11 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-LZO config.status 2.06
-configured by $0, generated by GNU Autoconf 2.67,
+LZO config.status 2.07
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -13824,7 +14748,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ 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'
@@ -13866,6 +14790,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
@@ -13886,13 +14811,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
@@ -13905,16 +14837,21 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
@@ -13938,7 +14875,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
@@ -13947,12 +14883,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
@@ -13994,6 +14930,7 @@ _LTECHO_EOF'
# Quote evaled strings.
for var in SHELL \
ECHO \
+PATH_SEPARATOR \
SED \
GREP \
EGREP \
@@ -14007,8 +14944,13 @@ reload_flag \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
+archiver_list_spec \
STRIP \
RANLIB \
CC \
@@ -14016,14 +14958,18 @@ CFLAGS \
compiler \
lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
lt_prog_compiler_pic \
+lt_prog_compiler_wl \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
+MANIFEST_TOOL \
DSYMUTIL \
NMEDIT \
LIPO \
@@ -14037,9 +14983,7 @@ with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
-fix_srcfile_path \
exclude_expsyms \
include_expsyms \
file_list_spec \
@@ -14053,7 +14997,7 @@ old_striplib \
striplib; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -14075,6 +15019,7 @@ module_cmds \
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
+postlink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
@@ -14082,7 +15027,7 @@ sys_lib_search_path_spec \
sys_lib_dlsearch_path_spec; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -14091,19 +15036,16 @@ sys_lib_dlsearch_path_spec; do
done
ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
PACKAGE='$PACKAGE'
VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'
@@ -14146,9 +15088,10 @@ fi
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
@@ -14156,12 +15099,13 @@ $debug ||
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
+ test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -14183,7 +15127,7 @@ else
ac_cs_awk_cr=$ac_cr
fi
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
@@ -14211,7 +15155,7 @@ done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
@@ -14259,7 +15203,7 @@ t delim
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
@@ -14291,7 +15235,7 @@ 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" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
@@ -14325,7 +15269,7 @@ fi # test -n "$CONFIG_FILES"
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
@@ -14337,8 +15281,8 @@ _ACEOF
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_t"; then
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -14458,7 +15402,7 @@ do
for ac_f
do
case $ac_f in
- -) ac_f="$tmp/stdin";;
+ -) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
@@ -14493,7 +15437,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin" \
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
@@ -14630,21 +15574,22 @@ s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
- rm -f "$tmp/stdin"
+ rm -f "$ac_tmp/stdin"
case $ac_file in
- -) cat "$tmp/out" && rm -f "$tmp/out";;
- *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -14655,20 +15600,20 @@ which seems to be undefined. Please make sure it is defined" >&2;}
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
- } >"$tmp/config.h" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
- mv "$tmp/config.h" "$ac_file" \
+ mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
# Compute "$ac_file"'s index in $config_headers.
@@ -14715,7 +15660,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -14728,7 +15673,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -14762,21 +15707,19 @@ $as_echo X"$mf" |
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
@@ -14811,13 +15754,13 @@ $as_echo X"$file" |
;;
"libtool":C)
- # See if we are running on zsh, and set the options which allow our
+ # See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
+ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
- cfgfile="${ofile}T"
+ cfgfile=${ofile}T
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
@@ -14825,13 +15768,13 @@ $as_echo X"$file" |
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -14859,7 +15802,7 @@ $as_echo X"$file" |
# The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags=''
# ### BEGIN LIBTOOL CONFIG
@@ -14885,6 +15828,9 @@ SHELL=$lt_SHELL
# An echo program that protects backslashes.
ECHO=$lt_ECHO
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
# The host system.
host_alias=$host_alias
host=$host
@@ -14934,19 +15880,42 @@ SP2NL=$lt_lt_SP2NL
# turn newlines into spaces.
NL2SP=$lt_lt_NL2SP
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
-# Command to use when deplibs_check_method == "file_magic".
+# Command to use when deplibs_check_method = "file_magic".
file_magic_cmd=$lt_file_magic_cmd
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
# The archiver.
AR=$lt_AR
+
+# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
# A symbol stripping program.
STRIP=$lt_STRIP
@@ -14970,12 +15939,24 @@ 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 into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
# Transform the output of nm in a C name address pair.
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
# The name of the directory that contains temporary libtool files.
objdir=$objdir
@@ -14985,6 +15966,9 @@ MAGIC_CMD=$MAGIC_CMD
# Must we lock files when doing compilation?
need_locks=$lt_need_locks
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL
@@ -15099,12 +16083,12 @@ with_gcc=$GCC
# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
# Additional compiler flags for building library objects.
pic_flag=$lt_lt_prog_compiler_pic
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_lt_prog_compiler_static
@@ -15154,20 +16138,16 @@ no_undefined_flag=$lt_no_undefined_flag
# This must work even if \$libdir does not exist
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking. This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary.
hardcode_direct=$hardcode_direct
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# 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
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
@@ -15191,9 +16171,6 @@ inherit_rpath=$inherit_rpath
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
# Set to "yes" if exported symbols are required.
always_export_symbols=$always_export_symbols
@@ -15209,6 +16186,9 @@ include_expsyms=$lt_include_expsyms
# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=$lt_prelink_cmds
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
# Specify filename containing input files.
file_list_spec=$lt_file_list_spec
@@ -15225,7 +16205,7 @@ _LT_EOF
# 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
+if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -15234,217 +16214,17 @@ _LT_EOF
esac
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1+=\$2"
-}
-_LT_EOF
- ;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1=\$$1\$2"
-}
-
-_LT_EOF
- ;;
- esac
-
-
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
- mv -f "$cfgfile" "$ofile" ||
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
@@ -15508,7 +16288,7 @@ cat <<EOF
LZO ${PACKAGE_VERSION} configured.
- Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/configure.ac b/app/lzo/configure.ac
index cda9734a..e2dff5fc 100644
--- a/app/lzo/configure.ac
+++ b/app/lzo/configure.ac
@@ -3,7 +3,7 @@
#
# This file is part of the LZO data compression library.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
# All Rights Reserved.
#
# The LZO library is free software; you can redistribute it and/or
@@ -31,13 +31,13 @@
# // Init
# ************************************************************************/
-AC_COPYRIGHT([Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer.
+AC_COPYRIGHT([Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
All Rights Reserved.
This configure script may be copied, distributed and modified under the
terms of the GNU General Public License; see COPYING for more details.])
-AC_PREREQ(2.67)
-AC_INIT([LZO],[2.06],[markus@oberhumer.com],[lzo],[http://www.oberhumer.com/opensource/lzo/])
+AC_PREREQ(2.69)
+AC_INIT([LZO],[2.07],[markus@oberhumer.com],[lzo],[http://www.oberhumer.com/opensource/lzo/])
AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION])
AC_CONFIG_SRCDIR(src/lzo_init.c)
AC_CONFIG_AUX_DIR(autoconf)
@@ -67,7 +67,7 @@ AC_C_CONST
mfx_LZO_CHECK_ENDIAN
AC_SYS_LARGEFILE
-AM_INIT_AUTOMAKE([1.11.1 gnu subdir-objects])
+AM_INIT_AUTOMAKE([1.14.1 gnu subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h:config.hin])
@@ -134,6 +134,10 @@ AC_MSG_CHECKING([whether to build assembly versions])
if test "X$enable_asm" != Xno; then
mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
cat > conftest.S <<EOF
+#if !defined(__i386__) && !defined(__i386)
+#error
+this+is+an+error
+#endif
#include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
EOF
enable_asm=no
@@ -160,7 +164,7 @@ AM_CONDITIONAL(LZO_USE_ASM_i386_obj_elf32, [false])
# // Write output files
# ************************************************************************/
-mfx_MINIACC_ACCCHK(["-I$srcdir"],["src/miniacc.h"])
+mfx_LZO_LZOCHK(["-I$srcdir"],["include/lzo/lzodefs.h"],["src/lzo_supp.h"])
if test -r .Conf.settings2; then
. ./.Conf.settings2
@@ -199,7 +203,7 @@ cat <<EOF
LZO ${PACKAGE_VERSION} configured.
- Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/doc/LZO.TXT b/app/lzo/doc/LZO.TXT
index 7426ab2b..2d3b5aa7 100644
--- a/app/lzo/doc/LZO.TXT
+++ b/app/lzo/doc/LZO.TXT
@@ -6,8 +6,8 @@
Author : Markus Franz Xaver Johannes Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
- Version : 2.06
- Date : 12 Aug 2011
+ Version : 2.07
+ Date : 25 Jun 2014
Abstract
@@ -277,9 +277,8 @@
Copyright
---------
- LZO is Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Markus Franz Xaver Oberhumer <markus@oberhumer.com>.
+ LZO is Copyright (C) 1996-2014 Markus Franz Xaver Oberhumer
+ All Rights Reserved.
LZO is distributed under the terms of the GNU General Public License (GPL).
See the file COPYING.
diff --git a/app/lzo/doc/LZOAPI.TXT b/app/lzo/doc/LZOAPI.TXT
index 5ae73532..547b0d70 100644
--- a/app/lzo/doc/LZOAPI.TXT
+++ b/app/lzo/doc/LZOAPI.TXT
@@ -75,17 +75,7 @@ This section briefly describes the headers.
2.1 The memory model
--------------------
-The documentation indicates that LZO requires 32-bit integers. It's
-not the integer size that really matters, though, but the memory
-model. If your memory model allows to access pointers at 32-bit
-offsets, then there is no problem at all - LZO works fine on my
-old Atari ST, which has 16 bit integers and a flat 32-bit memory model.
-Using 'huge' 32-bit pointers under 16-bit DOS is a workaround for this.
-
-While LZO also works with a strict 16-bit memory model, I don't officially
-support this because this limits the maximum block size to 64 KiB - and this
-makes the library incompatible with other platforms, i.e. you cannot
-decompress larger blocks compressed on those platforms.
+LZO requires a flat 32-bit or 64-bit memory model.
2.2 Public integral types
@@ -93,26 +83,16 @@ decompress larger blocks compressed on those platforms.
lzo_uint
- used as size_t, must be 32 bits or more for compatibility reasons
-
-lzo_uint32
-
- *must* be 32 bits or more
+ must match size_t
lzo_bool
can store the values 0 ("false") and 1 ("true")
-lzo_byte
-
- unsigned char (memory model specific)
-
2.3 Public pointer types
------------------------
-All pointer types are memory model specific.
-
lzo_voidp
pointer to void
@@ -121,10 +101,6 @@ lzo_bytep
pointer to unsigned char
-lzo_bytepp
-
- array of pointers to unsigned char
-
2.4 Public function types
-------------------------
diff --git a/app/lzo/examples/dict.c b/app/lzo/examples/dict.c
index 04db2453..3ccc9a53 100644
--- a/app/lzo/examples/dict.c
+++ b/app/lzo/examples/dict.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -62,7 +47,7 @@ static const char *progname = NULL;
#define DICT_LEN 0xbfff
static lzo_bytep dict;
static lzo_uint dict_len = 0;
-static lzo_uint32 dict_adler32;
+static lzo_uint32_t dict_adler32;
/*************************************************************************
@@ -73,11 +58,11 @@ static lzo_uint total_n = 0;
static lzo_uint total_c_len = 0;
static lzo_uint total_d_len = 0;
-static void print_file ( const char *name, lzo_uint d_len, lzo_uint c_len )
+static void print_info(const char *name, lzo_uint d_len, lzo_uint c_len)
{
double perc;
- perc = (d_len > 0) ? c_len * 100.0 / d_len : 0;
+ perc = (d_len > 0) ? c_len * 100.0 / d_len : 0.0;
printf(" | %-30s %9ld -> %9ld %7.2f%% |\n",
name, (long) d_len, (long) c_len, perc);
@@ -91,7 +76,7 @@ static void print_file ( const char *name, lzo_uint d_len, lzo_uint c_len )
//
**************************************************************************/
-int do_file ( const char *in_name, int compression_level )
+static int do_file(const char *in_name, int compression_level)
{
int r;
lzo_bytep in;
@@ -108,9 +93,9 @@ int do_file ( const char *in_name, int compression_level )
* Step 1: open the input file
*/
fp = fopen(in_name,"rb");
- if (fp == 0)
+ if (fp == NULL)
{
- printf("%s: cannot open file %s\n", progname, in_name);
+ printf("%s: %s: cannot open file\n", progname, in_name);
return 0; /* no error */
}
fseek(fp, 0, SEEK_END);
@@ -120,9 +105,15 @@ int do_file ( const char *in_name, int compression_level )
{
printf("%s: %s: empty file -- skipping\n", progname, in_name);
fclose(fp); fp = NULL;
- return 0;
+ return 0; /* no error */
}
in_len = (lzo_uint) l;
+ if ((long) in_len != l || l > 256L * 1024L * 1024L)
+ {
+ printf("%s: %s: file is too big -- skipping\n", progname, in_name);
+ fclose(fp); fp = NULL;
+ return 0; /* no error */
+ }
/*
* Step 2: allocate compression buffers and read the file
@@ -151,13 +142,13 @@ int do_file ( const char *in_name, int compression_level )
return 1;
}
- print_file(in_name,in_len,out_len);
+ print_info(in_name, in_len, out_len);
/*
* Step 4: decompress again, now going from 'out' to 'newb'
*/
new_len = in_len;
- r = lzo1x_decompress_dict_safe(out,out_len,newb,&new_len,NULL,dict,dict_len);
+ r = lzo1x_decompress_dict_safe(out, out_len, newb, &new_len, NULL, dict, dict_len);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
@@ -168,7 +159,7 @@ int do_file ( const char *in_name, int compression_level )
/*
* Step 5: verify decompression
*/
- if (new_len != in_len || lzo_memcmp(in,newb,in_len) != 0)
+ if (new_len != in_len || lzo_memcmp(in, newb, in_len) != 0)
{
/* this should NEVER happen */
printf("internal error - decompression data error\n");
@@ -191,7 +182,7 @@ int do_file ( const char *in_name, int compression_level )
int __lzo_cdecl_main main(int argc, char *argv[])
{
int i = 1;
- int r;
+ int r = 0;
const char *dict_name;
FILE *fp;
time_t t_total;
@@ -201,7 +192,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
progname = argv[0];
@@ -243,7 +234,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
else
{
fp = fopen(dict_name,"rb");
- if (!fp)
+ if (fp == NULL)
{
printf("%s: cannot open dictionary file %s\n", progname, dict_name);
exit(1);
@@ -252,30 +243,32 @@ int __lzo_cdecl_main main(int argc, char *argv[])
fclose(fp); fp = NULL;
}
- dict_adler32 = lzo_adler32(0,NULL,0);
- dict_adler32 = lzo_adler32(dict_adler32,dict,dict_len);
+ dict_adler32 = lzo_adler32(0, NULL, 0);
+ dict_adler32 = lzo_adler32(dict_adler32, dict, dict_len);
printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n",
- dict_name, (long) dict_len, (long) dict_adler32);
+ dict_name, (long) dict_len, (unsigned long) dict_adler32);
/*
* Step 3: process files
*/
t_total = time(NULL);
- for (r = 0; r == 0 && i < argc; i++)
- r = do_file(argv[i], compression_level);
+ for ( ; i < argc; i++) {
+ if (do_file(argv[i], compression_level) != 0) {
+ r = 1;
+ break;
+ }
+ }
t_total = time(NULL) - t_total;
lzo_free(dict);
if (total_n > 1)
- print_file("***TOTALS***",total_d_len,total_c_len);
+ print_info("***TOTALS***", total_d_len, total_c_len);
printf("Dictionary compression test %s, execution time %lu seconds.\n",
- r == 0 ? "passed" : "FAILED", (unsigned long) t_total);
+ r == 0 ? "passed" : "FAILED", (unsigned long) t_total);
return r;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/lzopack.c b/app/lzo/examples/lzopack.c
index e4e745df..10e2c1dc 100644
--- a/app/lzo/examples/lzopack.c
+++ b/app/lzo/examples/lzopack.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -76,7 +61,7 @@ static const unsigned char magic[7] =
// file IO
**************************************************************************/
-lzo_uint xread(FILE *fp, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
+static lzo_uint xread(FILE *fp, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
{
lzo_uint l;
@@ -95,7 +80,7 @@ lzo_uint xread(FILE *fp, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
return l;
}
-lzo_uint xwrite(FILE *fp, const lzo_voidp buf, lzo_uint len)
+static lzo_uint xwrite(FILE *fp, const lzo_voidp buf, lzo_uint len)
{
if (fp != NULL && lzo_fwrite(fp, buf, len) != len)
{
@@ -107,14 +92,14 @@ lzo_uint xwrite(FILE *fp, const lzo_voidp buf, lzo_uint len)
}
-int xgetc(FILE *fp)
+static int xgetc(FILE *fp)
{
unsigned char c;
xread(fp, (lzo_voidp) &c, 1, 0);
return c;
}
-void xputc(FILE *fp, int c)
+static void xputc(FILE *fp, int c)
{
unsigned char cc = (unsigned char) (c & 0xff);
xwrite(fp, (const lzo_voidp) &cc, 1);
@@ -122,20 +107,20 @@ void xputc(FILE *fp, int c)
/* read and write portable 32-bit integers */
-lzo_uint32 xread32(FILE *fp)
+static lzo_uint32_t xread32(FILE *fp)
{
unsigned char b[4];
- lzo_uint32 v;
+ lzo_uint32_t v;
xread(fp, b, 4, 0);
- v = (lzo_uint32) b[3] << 0;
- v |= (lzo_uint32) b[2] << 8;
- v |= (lzo_uint32) b[1] << 16;
- v |= (lzo_uint32) b[0] << 24;
+ v = (lzo_uint32_t) b[3] << 0;
+ v |= (lzo_uint32_t) b[2] << 8;
+ v |= (lzo_uint32_t) b[1] << 16;
+ v |= (lzo_uint32_t) b[0] << 24;
return v;
}
-void xwrite32(FILE *fp, lzo_xint v)
+static void xwrite32(FILE *fp, lzo_xint v)
{
unsigned char b[4];
@@ -159,7 +144,7 @@ void xwrite32(FILE *fp, lzo_xint v)
// compression.
**************************************************************************/
-int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
+static int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
{
int r = 0;
lzo_bytep in = NULL;
@@ -167,10 +152,10 @@ int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
lzo_voidp wrkmem = NULL;
lzo_uint in_len;
lzo_uint out_len;
- lzo_uint32 wrk_len = 0;
- lzo_uint32 flags = 1; /* do compute a checksum */
+ lzo_uint wrkmem_size;
+ lzo_uint32_t flags = 1; /* do compute a checksum */
int method = 1; /* compression method: LZO1X */
- lzo_uint32 checksum;
+ lzo_uint32_t checksum;
total_in = total_out = 0;
@@ -190,10 +175,10 @@ int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
in = (lzo_bytep) xmalloc(block_size);
out = (lzo_bytep) xmalloc(block_size + block_size / 16 + 64 + 3);
if (compression_level == 9)
- wrk_len = LZO1X_999_MEM_COMPRESS;
+ wrkmem_size = LZO1X_999_MEM_COMPRESS;
else
- wrk_len = LZO1X_1_MEM_COMPRESS;
- wrkmem = (lzo_voidp) xmalloc(wrk_len);
+ wrkmem_size = LZO1X_1_MEM_COMPRESS;
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
if (in == NULL || out == NULL || wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
@@ -217,7 +202,7 @@ int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
/* clear wrkmem (not needed, only for debug/benchmark purposes) */
if (opt_debug)
- lzo_memset(wrkmem, 0xff, wrk_len);
+ lzo_memset(wrkmem, 0xff, wrkmem_size);
/* compress block */
if (compression_level == 9)
@@ -272,17 +257,17 @@ err:
// memory - see overlap.c.
**************************************************************************/
-int do_decompress(FILE *fi, FILE *fo)
+static int do_decompress(FILE *fi, FILE *fo)
{
int r = 0;
lzo_bytep buf = NULL;
lzo_uint buf_len;
unsigned char m [ sizeof(magic) ];
- lzo_uint32 flags;
+ lzo_uint32_t flags;
int method;
int compression_level;
lzo_uint block_size;
- lzo_uint32 checksum;
+ lzo_uint32_t checksum;
total_in = total_out = 0;
@@ -307,7 +292,7 @@ int do_decompress(FILE *fi, FILE *fo)
goto err;
}
block_size = xread32(fi);
- if (block_size < 1024 || block_size > 8*1024*1024L)
+ if (block_size < 1024 || block_size > 8L * 1024L * 1024L)
{
printf("%s: header error - invalid block size %ld\n",
progname, (long) block_size);
@@ -396,7 +381,7 @@ int do_decompress(FILE *fi, FILE *fo)
/* read and verify checksum */
if (flags & 1)
{
- lzo_uint32 c = xread32(fi);
+ lzo_uint32_t c = xread32(fi);
if (c != checksum)
{
printf("%s: checksum error - data corrupted\n", progname);
@@ -524,7 +509,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
#if 0
printf(
@@ -552,9 +537,9 @@ int __lzo_cdecl_main main(int argc, char *argv[])
*/
opt_block_size = 256 * 1024L;
-#if defined(ACC_MM_AHSHIFT)
+#if defined(LZO_MM_AHSHIFT)
/* reduce memory requirements for ancient 16-bit DOS 640kB real-mode */
- if (ACC_MM_AHSHIFT != 3)
+ if (LZO_MM_AHSHIFT != 3)
opt_block_size = 16 * 1024L;
#endif
@@ -639,7 +624,5 @@ int __lzo_cdecl_main main(int argc, char *argv[])
return r;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/overlap.c b/app/lzo/examples/overlap.c
index b2337680..114fe3b4 100644
--- a/app/lzo/examples/overlap.c
+++ b/app/lzo/examples/overlap.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -71,15 +56,7 @@ static const char *progname = NULL;
* will be needed. See step 4a) below.
*/
-static lzo_uint opt_overhead = 0; /* assume worst case */
-
-
-#if 0 && defined(LZO_USE_ASM)
- /* just for testing */
-# include <lzo_asm.h>
-# define lzo1x_decompress lzo1x_decompress_asm_fast
-#endif
-
+static long opt_overhead = 0; /* assume worst case */
static unsigned long total_files = 0;
static unsigned long total_in = 0;
@@ -89,7 +66,7 @@ static unsigned long total_in = 0;
//
**************************************************************************/
-int do_file ( const char *in_name )
+static int do_file(const char *in_name)
{
int r;
FILE *fp = NULL;
@@ -127,6 +104,11 @@ int do_file ( const char *in_name )
goto next_file;
}
in_len = (lzo_uint) l;
+ if ((long) in_len != l || l > 256L * 1024L * 1024L)
+ {
+ printf("%s: %s: file is too big -- skipping\n", progname, in_name);
+ goto next_file;
+ }
/*
* Step 2: allocate compression buffers and read the file
@@ -144,14 +126,14 @@ int do_file ( const char *in_name )
/*
* Step 3: compress from 'in' to 'out' with LZO1X-1
*/
- r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
+ r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem);
if (r != LZO_E_OK || out_len > in_len + in_len / 16 + 64 + 3)
{
/* this should NEVER happen */
printf("internal error - compression failed: %d\n", r);
exit(1);
}
- printf("%-26s %8lu -> %8lu\n", "LZO1X-1:", (unsigned long) in_len, (unsigned long) out_len);
+ printf("%-25s %8lu -> %8lu\n", "LZO1X-1:", (unsigned long) in_len, (unsigned long) out_len);
/***** Step 4: overlapping compression *****/
@@ -174,18 +156,18 @@ int do_file ( const char *in_name )
/*
* Step 4c: do an in-place compression within the 'overlap' buffer
*/
- r = lzo1x_1_compress(overlap+offset,in_len,overlap,&new_len,wrkmem);
+ r = lzo1x_1_compress(overlap + offset, in_len, overlap, &new_len, wrkmem);
if (r != LZO_E_OK)
{
/* this should NEVER happen */
- printf("overlapping compression failed: %d\n", r);
+ printf("in-place compression failed: %d\n", r);
exit(1);
}
/*
* Step 4d: verify overlapping compression
*/
- if (new_len != out_len || lzo_memcmp(out,overlap,out_len) != 0)
+ if (new_len != out_len || lzo_memcmp(out, overlap, out_len) != 0)
{
/* As compression is non-deterministic there can be a difference
* in the representation of the compressed data (but this usually
@@ -198,18 +180,18 @@ int do_file ( const char *in_name )
if (r != LZO_E_OK || ll != in_len || lzo_memcmp(in, tmp, ll) != 0)
{
/* this should NEVER happen */
- printf("overlapping compression data error\n");
+ printf("in-place compression data error\n");
exit(1);
}
lzo_free(tmp);
}
- printf("overlapping compression: %8lu -> %8lu overhead: %7lu\n",
+ printf(" in-place compression: %8lu -> %8lu overhead: %7lu\n",
(unsigned long) in_len, (unsigned long) new_len, (unsigned long) overhead);
lzo_free(overlap); overlap = NULL;
-/***** Step 5: overlapping decompression *****/
+/***** Step 5: in-place decompression *****/
/*
* Step 5a: allocate the 'overlap' buffer for in-place decompression
@@ -217,7 +199,7 @@ int do_file ( const char *in_name )
if (opt_overhead == 0 || out_len >= in_len)
overhead = in_len / 16 + 64 + 3;
else
- overhead = opt_overhead;
+ overhead = (lzo_uint) opt_overhead;
overlap = (lzo_bytep) xmalloc(in_len + overhead);
/*
@@ -231,24 +213,24 @@ int do_file ( const char *in_name )
* Step 5c: do an in-place decompression within the 'overlap' buffer
*/
new_len = in_len;
- r = lzo1x_decompress(overlap+offset,out_len,overlap,&new_len,NULL);
+ r = lzo1x_decompress_safe(overlap + offset, out_len, overlap, &new_len, NULL);
if (r != LZO_E_OK)
{
/* this may happen if overhead is too small */
- printf("overlapping decompression failed: %d - increase 'opt_overhead'\n", r);
+ printf("in-place decompression failed: %d - increase 'opt_overhead'\n", r);
exit(1);
}
/*
* Step 5d: verify decompression
*/
- if (new_len != in_len || lzo_memcmp(in,overlap,in_len) != 0)
+ if (new_len != in_len || lzo_memcmp(in, overlap, in_len) != 0)
{
/* this may happen if overhead is too small */
- printf("overlapping decompression data error - increase 'opt_overhead'\n");
+ printf("in-place decompression data error - increase 'opt_overhead'\n");
exit(1);
}
- printf("overlapping decompression: %8lu -> %8lu overhead: %7lu\n",
+ printf(" in-place decompression: %8lu -> %8lu overhead: %7lu\n",
(unsigned long) out_len, (unsigned long) new_len, (unsigned long) overhead);
lzo_free(overlap); overlap = NULL;
@@ -277,15 +259,15 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
progname = argv[0];
if (i < argc && argv[i][0] == '-')
- opt_overhead = atoi(&argv[i++][1]);
+ opt_overhead = atol(&argv[i++][1]);
#if 1
- if (opt_overhead != 0 && opt_overhead < 8)
+ if (opt_overhead != 0 && opt_overhead < 4)
{
- printf("%s: invalid overhead value %ld\n", progname, (long)opt_overhead);
+ printf("%s: invalid overhead value %ld\n", progname, opt_overhead);
exit(1);
}
#endif
@@ -316,7 +298,5 @@ int __lzo_cdecl_main main(int argc, char *argv[])
return r;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/portab.h b/app/lzo/examples/portab.h
index b4b5a21a..d8217ed3 100644
--- a/app/lzo/examples/portab.h
+++ b/app/lzo/examples/portab.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -53,8 +38,12 @@
/* avoid warnings about inlining */
# pragma warning(disable: 4710 4711)
#endif
-#if (LZO_CC_MSC && (_MSC_VER >= 1400))
- /* avoid warnings when using "deprecated" POSIX functions */
+/* disable silly warnings about using "deprecated" POSIX functions like "fopen" */
+#if (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1100))
+# pragma warning(disable: 1786)
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1000))
+# pragma warning(disable: 1478)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
# pragma warning(disable: 4996)
#endif
#if (LZO_CC_PELLESC && (__POCC__ >= 290))
@@ -66,19 +55,13 @@
//
**************************************************************************/
-#if defined(__LZO_MMODEL_HUGE) || defined(ACC_WANT_ACCLIB_GETOPT) || !(defined(LZO_LIBC_ISOC90) || defined(LZO_LIBC_ISOC99))
+#if defined(LZO_WANT_ACCLIB_GETOPT) || !(defined(LZO_LIBC_ISOC90) || defined(LZO_LIBC_ISOC99))
#include "examples/portab_a.h"
#else
-/* INFO:
- * The "portab_a.h" version above uses the ACC library to add
- * support for ancient systems (like 16-bit DOS) and to provide
- * some gimmicks like Windows high-resolution timers.
- * Still, on any halfway modern machine you can also use the
- * following pure ANSI-C code instead.
- */
+/* On any halfway modern machine we can use the following pure ANSI-C code. */
#include <stddef.h>
#include <stdlib.h>
@@ -98,13 +81,14 @@
# define lzo_fread(f,b,s) (fread(b,1,s,f))
# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
#endif
-#if defined(WANT_LZO_UCLOCK)
-# define lzo_uclock_handle_t int
-# define lzo_uclock_t double
-# define lzo_uclock_open(a) ((void)(a))
-# define lzo_uclock_close(a) ((void)(a))
-# define lzo_uclock_read(a,b) *(b) = (clock() / (double)(CLOCKS_PER_SEC))
-# define lzo_uclock_get_elapsed(a,b,c) (*(c) - *(b))
+#if defined(WANT_LZO_PCLOCK)
+# define lzo_pclock_handle_t int
+# define lzo_pclock_t double
+# define lzo_pclock_open_default(a) ((void)(a))
+# define lzo_pclock_close(a) ((void)(a))
+# define lzo_pclock_read(a,b) *(b) = (clock() / (double)(CLOCKS_PER_SEC))
+# define lzo_pclock_get_elapsed(a,b,c) (*(c) - *(b))
+# define lzo_pclock_flush_cpu_cache(a,b) ((void)(a))
#endif
#if defined(WANT_LZO_WILDARGV)
# define lzo_wildargv(a,b) ((void)0)
@@ -154,34 +138,4 @@ static lzo_voidp xmalloc(lzo_uint len)
#endif
-#if defined(WANT_LZO_UCLOCK)
-
-/* High quality benchmarking.
- *
- * Flush the CPU cache to get more accurate benchmark values.
- * This needs custom kernel patches. As a result - in combination with
- * the perfctr Linux kernel patches - accurate high-quality benchmarking
- * is possible.
- *
- * All other methods (rdtsc, QueryPerformanceCounter, gettimeofday, ...)
- * are completely unreliable for our purposes, and the only other
- * option is to boot into a legacy single-task operating system
- * like plain MSDOS and to directly reprogram the hardware clock.
- * [The djgpp2 port of the gcc compiler has support functions for this.]
- *
- * Also, for embedded systems it's best to benchmark by using a
- * CPU emulator/simulator software that can exactly count all
- * virtual clock ticks.
- */
-
-#if !defined(lzo_uclock_flush_cpu_cache)
-# define lzo_uclock_flush_cpu_cache(h,flags) ((void)(h))
-#endif
-
-#endif
-
-
-/*
-vi:ts=4:et
-*/
-
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/portab_a.h b/app/lzo/examples/portab_a.h
index 2706022d..a3fbec90 100644
--- a/app/lzo/examples/portab_a.h
+++ b/app/lzo/examples/portab_a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,99 +27,35 @@
/*************************************************************************
-// use the ACC library for the hard work
+//
**************************************************************************/
#if defined(LZO_HAVE_CONFIG_H)
-# define ACC_CONFIG_NO_HEADER 1
+# define LZO_CFG_NO_CONFIG_HEADER 1
#endif
-#define ACC_WANT_ACC_INCD_H 1
-#define ACC_WANT_ACC_INCE_H 1
-#if defined(__LZO_MMODEL_HUGE) || defined(ACC_WANT_ACCLIB_GETOPT) || defined(WANT_LZO_UCLOCK) || defined(WANT_LZO_WILDARGV)
-# define ACC_WANT_ACC_INCI_H 1
-# define ACC_WANT_ACC_LIB_H 1
+#define LZO_WANT_ACC_INCD_H 1
+#define LZO_WANT_ACC_INCE_H 1
+#if defined(LZO_WANT_ACCLIB_GETOPT) || defined(WANT_LZO_PCLOCK) || defined(WANT_LZO_WILDARGV)
+# define LZO_WANT_ACC_INCI_H 1
+# define LZO_WANT_ACC_LIB_H 1
#endif
-#include "src/miniacc.h"
-
-#if defined(WANT_LZO_MALLOC)
-# if defined(__LZO_MMODEL_HUGE)
-# define ACC_WANT_ACCLIB_HALLOC 1
-# else
-# define acc_halloc(a) (malloc(a))
-# define acc_hfree(a) (free(a))
-# endif
-#endif
-#if defined(WANT_LZO_FREAD)
-# if defined(__LZO_MMODEL_HUGE)
-# define ACC_WANT_ACCLIB_HFREAD 1
-# else
-# define acc_hfread(f,b,s) (fread(b,1,s,f))
-# define acc_hfwrite(f,b,s) (fwrite(b,1,s,f))
-# endif
-#endif
-#if defined(WANT_LZO_UCLOCK)
-# define ACC_WANT_ACCLIB_PCLOCK 1
-# if 0 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
-# define __ACCLIB_PCLOCK_USE_RDTSC 1
-# define ACC_WANT_ACCLIB_RDTSC 1
-# endif
+#if defined(WANT_LZO_PCLOCK)
+# define LZO_WANT_ACCLIB_PCLOCK 1
#endif
#if defined(WANT_LZO_WILDARGV)
-# define ACC_WANT_ACCLIB_WILDARGV 1
-#endif
-#if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED)
-# define ACC_WANT_ACCLIB_HMEMCPY 1
+# define LZO_WANT_ACCLIB_WILDARGV 1
#endif
-#include "src/miniacc.h"
-
+#include "src/lzo_supp.h"
-/*************************************************************************
-// finally pull into the LZO namespace
-**************************************************************************/
-
-#undef lzo_malloc
-#undef lzo_free
-#undef lzo_fread
-#undef lzo_fwrite
#if defined(WANT_LZO_MALLOC)
-# if defined(acc_halloc)
-# define lzo_malloc(a) acc_halloc(a)
-# else
-# define lzo_malloc(a) __ACCLIB_FUNCNAME(acc_halloc)(a)
-# endif
-# if defined(acc_hfree)
-# define lzo_free(a) acc_hfree(a)
-# else
-# define lzo_free(a) __ACCLIB_FUNCNAME(acc_hfree)(a)
-# endif
+# define lzo_malloc(a) (malloc(a))
+# define lzo_free(a) (free(a))
#endif
#if defined(WANT_LZO_FREAD)
-# if defined(acc_hfread)
-# define lzo_fread(f,b,s) acc_hfread(f,b,s)
-# else
-# define lzo_fread(f,b,s) __ACCLIB_FUNCNAME(acc_hfread)(f,b,s)
-# endif
-# if defined(acc_hfwrite)
-# define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s)
-# else
-# define lzo_fwrite(f,b,s) __ACCLIB_FUNCNAME(acc_hfwrite)(f,b,s)
-# endif
-#endif
-#if defined(WANT_LZO_UCLOCK)
-# define lzo_uclock_handle_t acc_pclock_handle_t
-# define lzo_uclock_t acc_pclock_t
-# define lzo_uclock_open(a) __ACCLIB_FUNCNAME(acc_pclock_open_default)(a)
-# define lzo_uclock_close(a) __ACCLIB_FUNCNAME(acc_pclock_close)(a)
-# define lzo_uclock_read(a,b) __ACCLIB_FUNCNAME(acc_pclock_read)(a,b)
-# define lzo_uclock_get_elapsed(a,b,c) __ACCLIB_FUNCNAME(acc_pclock_get_elapsed)(a,b,c)
+# define lzo_fread(f,b,s) (fread(b,1,s,f))
+# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
#endif
-#if defined(WANT_LZO_WILDARGV)
-# define lzo_wildargv(a,b) __ACCLIB_FUNCNAME(acc_wildargv)(a,b)
-#endif
-
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/precomp.c b/app/lzo/examples/precomp.c
index a953827b..01b1e77f 100644
--- a/app/lzo/examples/precomp.c
+++ b/app/lzo/examples/precomp.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -85,14 +70,14 @@ int __lzo_cdecl_main main(int argc, char *argv[])
lzo_uint out_len = 0;
lzo_voidp wrkmem;
- lzo_uint wrk_len;
+ lzo_uint wrkmem_size;
lzo_uint best_len;
int best_compress = -1;
lzo_uint orig_len;
- lzo_uint32 uncompressed_checksum;
- lzo_uint32 compressed_checksum;
+ lzo_uint32_t uncompressed_checksum;
+ lzo_uint32_t compressed_checksum;
FILE *fp;
const char *in_name = NULL;
@@ -104,7 +89,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
progname = argv[0];
if (argc < 2 || argc > 3)
@@ -128,16 +113,14 @@ int __lzo_cdecl_main main(int argc, char *argv[])
/*
* Step 2: allocate the work-memory
*/
- wrk_len = 1;
+ wrkmem_size = 1;
#ifdef USE_LZO1X
- if (wrk_len < LZO1X_999_MEM_COMPRESS)
- wrk_len = LZO1X_999_MEM_COMPRESS;
+ wrkmem_size = (LZO1X_999_MEM_COMPRESS > wrkmem_size) ? LZO1X_999_MEM_COMPRESS : wrkmem_size;
#endif
#ifdef USE_LZO1Y
- if (wrk_len < LZO1Y_999_MEM_COMPRESS)
- wrk_len = LZO1Y_999_MEM_COMPRESS;
+ wrkmem_size = (LZO1Y_999_MEM_COMPRESS > wrkmem_size) ? LZO1Y_999_MEM_COMPRESS : wrkmem_size;
#endif
- wrkmem = (lzo_voidp) xmalloc(wrk_len);
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
if (wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
@@ -343,7 +326,5 @@ int __lzo_cdecl_main main(int argc, char *argv[])
return 0;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/precomp2.c b/app/lzo/examples/precomp2.c
index d9e1b47b..93dd8b55 100644
--- a/app/lzo/examples/precomp2.c
+++ b/app/lzo/examples/precomp2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -68,7 +53,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
- lzo_uint32 flags );
+ lzo_uint32_t flags );
LZO_EXTERN(int)
lzo1y_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
@@ -81,7 +66,7 @@ lzo1y_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
- lzo_uint32 flags );
+ lzo_uint32_t flags );
#define USE_LZO1X 1
#define USE_LZO1Y 1
@@ -108,7 +93,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
int lazy;
const int max_try_lazy = 5;
const lzo_uint big = 65536L; /* can result in very slow compression */
- const lzo_uint32 flags = 0x1;
+ const lzo_uint32_t flags = 0x1;
lzo_bytep in;
lzo_uint in_len;
@@ -118,15 +103,15 @@ int __lzo_cdecl_main main(int argc, char *argv[])
lzo_uint out_len = 0;
lzo_voidp wrkmem;
- lzo_uint wrk_len;
+ lzo_uint wrkmem_size;
lzo_uint best_len;
int best_compress = -1;
int best_lazy = -1;
lzo_uint orig_len;
- lzo_uint32 uncompressed_checksum;
- lzo_uint32 compressed_checksum;
+ lzo_uint32_t uncompressed_checksum;
+ lzo_uint32_t compressed_checksum;
FILE *fp;
const char *in_name = NULL;
@@ -138,7 +123,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
progname = argv[0];
if (argc < 2 || argc > 3)
@@ -162,16 +147,14 @@ int __lzo_cdecl_main main(int argc, char *argv[])
/*
* Step 2: allocate the work-memory
*/
- wrk_len = 1;
+ wrkmem_size = 1;
#ifdef USE_LZO1X
- if (wrk_len < LZO1X_999_MEM_COMPRESS)
- wrk_len = LZO1X_999_MEM_COMPRESS;
+ wrkmem_size = (LZO1X_999_MEM_COMPRESS > wrkmem_size) ? LZO1X_999_MEM_COMPRESS : wrkmem_size;
#endif
#ifdef USE_LZO1Y
- if (wrk_len < LZO1Y_999_MEM_COMPRESS)
- wrk_len = LZO1Y_999_MEM_COMPRESS;
+ wrkmem_size = (LZO1Y_999_MEM_COMPRESS > wrkmem_size) ? LZO1Y_999_MEM_COMPRESS : wrkmem_size;
#endif
- wrkmem = (lzo_voidp) xmalloc(wrk_len);
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
if (wrkmem == NULL)
{
printf("%s: out of memory\n", progname);
@@ -395,7 +378,5 @@ int __lzo_cdecl_main main(int argc, char *argv[])
return 0;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/examples/simple.c b/app/lzo/examples/simple.c
index 9d06cb5c..42f814a7 100644
--- a/app/lzo/examples/simple.c
+++ b/app/lzo/examples/simple.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -93,7 +78,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
/*
* Step 1: initialize the LZO library
@@ -128,10 +113,10 @@ int __lzo_cdecl_main main(int argc, char *argv[])
/*
* Step 4: compress from 'in' to 'out' with LZO1X-1
*/
- r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
+ r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem);
if (r == LZO_E_OK)
printf("compressed %lu bytes into %lu bytes\n",
- (unsigned long) in_len, (unsigned long) out_len);
+ (unsigned long) in_len, (unsigned long) out_len);
else
{
/* this should NEVER happen */
@@ -149,10 +134,10 @@ int __lzo_cdecl_main main(int argc, char *argv[])
* Step 5: decompress again, now going from 'out' to 'in'
*/
new_len = in_len;
- r = lzo1x_decompress(out,out_len,in,&new_len,NULL);
+ r = lzo1x_decompress(out, out_len, in, &new_len, NULL);
if (r == LZO_E_OK && new_len == in_len)
printf("decompressed %lu bytes back into %lu bytes\n",
- (unsigned long) out_len, (unsigned long) in_len);
+ (unsigned long) out_len, (unsigned long) in_len);
else
{
/* this should NEVER happen */
@@ -167,7 +152,5 @@ int __lzo_cdecl_main main(int argc, char *argv[])
return 0;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/include/lzo/lzo1.h b/app/lzo/include/lzo/lzo1.h
index de0fba57..433d91d9 100644
--- a/app/lzo/include/lzo/lzo1.h
+++ b/app/lzo/include/lzo/lzo1.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
+#define LZO1_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))
#define LZO1_MEM_DECOMPRESS (0)
@@ -80,7 +65,7 @@ lzo1_decompress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
+#define LZO1_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1_99_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1a.h b/app/lzo/include/lzo/lzo1a.h
index 0969c67d..46d7e75d 100644
--- a/app/lzo/include/lzo/lzo1a.h
+++ b/app/lzo/include/lzo/lzo1a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1A_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t))
+#define LZO1A_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))
#define LZO1A_MEM_DECOMPRESS (0)
@@ -80,7 +65,7 @@ lzo1a_decompress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1A_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
+#define LZO1A_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1a_99_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1b.h b/app/lzo/include/lzo/lzo1b.h
index da3b597c..3295b9e7 100644
--- a/app/lzo/include/lzo/lzo1b.h
+++ b/app/lzo/include/lzo/lzo1b.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1B_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1B_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1B_MEM_DECOMPRESS (0)
@@ -136,7 +121,7 @@ lzo1b_9_compress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1B_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
+#define LZO1B_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1b_99_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -144,7 +129,7 @@ lzo1b_99_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_voidp wrkmem );
-#define LZO1B_999_MEM_COMPRESS ((lzo_uint32) (3 * 65536L * sizeof(lzo_xint)))
+#define LZO1B_999_MEM_COMPRESS ((lzo_uint32_t) (3 * 65536L * sizeof(lzo_xint)))
LZO_EXTERN(int)
lzo1b_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1c.h b/app/lzo/include/lzo/lzo1c.h
index d5b1b8c5..6fa3cf92 100644
--- a/app/lzo/include/lzo/lzo1c.h
+++ b/app/lzo/include/lzo/lzo1c.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1C_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1C_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1C_MEM_DECOMPRESS (0)
@@ -136,7 +121,7 @@ lzo1c_9_compress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1C_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t))
+#define LZO1C_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1c_99_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -144,7 +129,7 @@ lzo1c_99_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_voidp wrkmem );
-#define LZO1C_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
+#define LZO1C_999_MEM_COMPRESS ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo1c_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1f.h b/app/lzo/include/lzo/lzo1f.h
index 77130703..adc6b0d9 100644
--- a/app/lzo/include/lzo/lzo1f.h
+++ b/app/lzo/include/lzo/lzo1f.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1F_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1F_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1F_MEM_DECOMPRESS (0)
@@ -92,7 +77,7 @@ lzo1f_1_compress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1F_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short)))
+#define LZO1F_999_MEM_COMPRESS ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo1f_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1x.h b/app/lzo/include/lzo/lzo1x.h
index 9bb993cc..ef591db7 100644
--- a/app/lzo/include/lzo/lzo1x.h
+++ b/app/lzo/include/lzo/lzo1x.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -83,7 +68,7 @@ lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
//
************************************************************************/
-#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -96,7 +81,7 @@ lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
************************************************************************/
/* this version needs only 8 KiB work memory */
-#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32) (2048L * lzo_sizeof_dict_t))
+#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32_t) (2048L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -105,7 +90,7 @@ lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len,
/* this version needs 16 KiB work memory */
-#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32) (4096L * lzo_sizeof_dict_t))
+#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32_t) (4096L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -114,7 +99,7 @@ lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len,
/* use this version if you need a little more compression speed */
-#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32) (32768L * lzo_sizeof_dict_t))
+#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32_t) (32768L * lzo_sizeof_dict_t))
LZO_EXTERN(int)
lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -126,7 +111,7 @@ lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1X_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
+#define LZO1X_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1y.h b/app/lzo/include/lzo/lzo1y.h
index 359e3580..37370c78 100644
--- a/app/lzo/include/lzo/lzo1y.h
+++ b/app/lzo/include/lzo/lzo1y.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,7 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1Y_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1Y_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1Y_MEM_DECOMPRESS (0)
#define LZO1Y_MEM_OPTIMIZE (0)
@@ -93,7 +78,7 @@ lzo1y_1_compress ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
+#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo1y_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo1z.h b/app/lzo/include/lzo/lzo1z.h
index f385ca39..b097e119 100644
--- a/app/lzo/include/lzo/lzo1z.h
+++ b/app/lzo/include/lzo/lzo1z.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -61,9 +46,7 @@ extern "C" {
* When the required size is 0, you can also pass a NULL pointer.
*/
-#define LZO1Z_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
#define LZO1Z_MEM_DECOMPRESS (0)
-#define LZO1Z_MEM_OPTIMIZE (0)
/* decompression */
@@ -80,23 +63,10 @@ lzo1z_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
/***********************************************************************
-//
-************************************************************************/
-
-#if 0
-/* not yet implemented */
-LZO_EXTERN(int)
-lzo1z_1_compress ( const lzo_bytep src, lzo_uint src_len,
- lzo_bytep dst, lzo_uintp dst_len,
- lzo_voidp wrkmem );
-#endif
-
-
-/***********************************************************************
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short)))
+#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo1z_999_compress ( const lzo_bytep src, lzo_uint src_len,
@@ -129,20 +99,6 @@ lzo1z_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
const lzo_bytep dict, lzo_uint dict_len );
-/***********************************************************************
-// optimize a compressed data block
-************************************************************************/
-
-#if 0
-/* not yet implemented */
-LZO_EXTERN(int)
-lzo1z_optimize ( lzo_bytep src, lzo_uint src_len,
- lzo_bytep dst, lzo_uintp dst_len,
- lzo_voidp wrkmem /* NOT USED */ );
-#endif
-
-
-
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/app/lzo/include/lzo/lzo2a.h b/app/lzo/include/lzo/lzo2a.h
index ef65155e..1c9ef2e9 100644
--- a/app/lzo/include/lzo/lzo2a.h
+++ b/app/lzo/include/lzo/lzo2a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -76,7 +61,7 @@ lzo2a_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
// better compression ratio at the cost of more memory and time
************************************************************************/
-#define LZO2A_999_MEM_COMPRESS ((lzo_uint32) (8 * 16384L * sizeof(short)))
+#define LZO2A_999_MEM_COMPRESS ((lzo_uint32_t) (8 * 16384L * sizeof(short)))
LZO_EXTERN(int)
lzo2a_999_compress ( const lzo_bytep src, lzo_uint src_len,
diff --git a/app/lzo/include/lzo/lzo_asm.h b/app/lzo/include/lzo/lzo_asm.h
index 51bea657..d5f6ff63 100644
--- a/app/lzo/include/lzo/lzo_asm.h
+++ b/app/lzo/include/lzo/lzo_asm.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -129,18 +114,18 @@ LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe
#if 0
-LZO_EXTERN(lzo_uint32)
-lzo_crc32_asm(lzo_uint32 c, const lzo_bytep buf, lzo_uint len,
- const lzo_uint32p tab);
+LZO_EXTERN(lzo_uint32_t)
+lzo_crc32_asm(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len,
+ const lzo_uint32_tp tab);
-LZO_EXTERN(lzo_uint32)
-lzo_crc32_asm_small(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
+LZO_EXTERN(lzo_uint32_t)
+lzo_crc32_asm_small(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
LZO_EXTERN(int)
-lzo_cpuid_asm(lzo_uint32p /* lzo_uint32 info[16] */ );
+lzo_cpuid_asm(lzo_uint32_tp /* lzo_uint32_t info[16] */ );
-LZO_EXTERN(lzo_uint32)
-lzo_rdtsc_asm(lzo_uint32p /* lzo_uint32 ticks[2] */ );
+LZO_EXTERN(lzo_uint32_t)
+lzo_rdtsc_asm(lzo_uint32_tp /* lzo_uint32_t ticks[2] */ );
#endif
diff --git a/app/lzo/include/lzo/lzoconf.h b/app/lzo/include/lzo/lzoconf.h
index 23c6ca93..02fb202d 100644
--- a/app/lzo/include/lzo/lzoconf.h
+++ b/app/lzo/include/lzo/lzoconf.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -44,9 +29,9 @@
#ifndef __LZOCONF_H_INCLUDED
#define __LZOCONF_H_INCLUDED 1
-#define LZO_VERSION 0x2060
-#define LZO_VERSION_STRING "2.06"
-#define LZO_VERSION_DATE "Aug 12 2011"
+#define LZO_VERSION 0x2070
+#define LZO_VERSION_STRING "2.07"
+#define LZO_VERSION_DATE "Jun 25 2014"
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
@@ -63,7 +48,7 @@
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
-#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
+#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
@@ -85,14 +70,6 @@ extern "C" {
// 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)
@@ -111,28 +88,31 @@ extern "C" {
// integral and pointer types
************************************************************************/
-/* lzo_uint should match size_t */
+/* lzo_uint must match size_t */
#if !defined(LZO_UINT_MAX)
-# if defined(LZO_ABI_LLP64) /* WIN64 */
-# if defined(LZO_OS_WIN64)
+# if (LZO_ABI_LLP64)
+# if (LZO_OS_WIN64)
typedef unsigned __int64 lzo_uint;
typedef __int64 lzo_int;
# else
- typedef unsigned long long lzo_uint;
- typedef long long lzo_int;
+ typedef lzo_ullong_t lzo_uint;
+ typedef lzo_llong_t lzo_int;
# endif
+# define LZO_SIZEOF_LZO_UINT 8
# 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 */
+# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
typedef unsigned int lzo_uint;
typedef int lzo_int;
+# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_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_SIZEOF_LZO_UINT LZO_SIZEOF_LONG
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
@@ -141,63 +121,22 @@ extern "C" {
# 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
-
-/* Integral types with exactly 64 bits. */
-#if !defined(LZO_UINT64_MAX)
-# if (LZO_UINT_MAX >= LZO_0xffffffffL)
-# if ((((LZO_UINT_MAX) >> 31) >> 31) == 3)
-# define lzo_uint64 lzo_uint
-# define lzo_int64 lzo_int
-# define LZO_UINT64_MAX LZO_UINT_MAX
-# define LZO_INT64_MAX LZO_INT_MAX
-# define LZO_INT64_MIN LZO_INT_MIN
-# endif
-# elif (ULONG_MAX >= LZO_0xffffffffL)
-# if ((((ULONG_MAX) >> 31) >> 31) == 3)
- typedef unsigned long lzo_uint64;
- typedef long lzo_int64;
-# define LZO_UINT64_MAX ULONG_MAX
-# define LZO_INT64_MAX LONG_MAX
-# define LZO_INT64_MIN LONG_MIN
-# endif
-# endif
-#endif
-
-/* The larger type of lzo_uint and lzo_uint32. */
-#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
+/* The larger type of lzo_uint and lzo_uint32_t. */
+#if (LZO_SIZEOF_LZO_UINT >= 4)
# define lzo_xint lzo_uint
#else
-# define lzo_xint lzo_uint32
+# define lzo_xint lzo_uint32_t
#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 /*empty*/
-# elif defined(LZO_HAVE_MM_HUGE_PTR)
-# define __LZO_MMODEL_HUGE 1
-# define __LZO_MMODEL __huge
-# else
-# define __LZO_MMODEL /*empty*/
-# endif
+typedef int lzo_bool;
+
+/* sanity checks */
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
+
+#ifndef __LZO_MMODEL
+#define __LZO_MMODEL /*empty*/
#endif
/* no typedef here because of const-pointer issues */
@@ -206,21 +145,52 @@ extern "C" {
#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 *
-#if defined(LZO_UINT64_MAX)
-#define lzo_uint64p lzo_uint64 __LZO_MMODEL *
-#define lzo_int64p lzo_int64 __LZO_MMODEL *
-#endif
-#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
+#define lzo_uintp lzo_uint __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;
+#define lzo_int8_tp lzo_int8_t __LZO_MMODEL *
+#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL *
+#define lzo_int16_tp lzo_int16_t __LZO_MMODEL *
+#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL *
+#define lzo_int32_tp lzo_int32_t __LZO_MMODEL *
+#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL *
+#if defined(lzo_int64_t)
+#define lzo_int64_tp lzo_int64_t __LZO_MMODEL *
+#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL *
+#endif
+
+/* Older LZO versions used to support ancient systems and memory models
+ * like 16-bit MSDOS with __huge pointers and Cray PVP, but these
+ * obsolete configurations are not supported any longer.
+ */
+#if defined(__LZO_MMODEL_HUGE)
+#error "__LZO_MMODEL_HUGE is unsupported"
+#endif
+#if (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#endif
+#if (LZO_SIZEOF_INT < 4)
+#error "LZO_SIZEOF_INT < 4 is unsupported"
+#endif
+#if (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
+/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
+ * work but have not received much testing lately, so be strict here.
+ */
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
/***********************************************************************
@@ -315,7 +285,7 @@ struct lzo_callback_t
/* 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
+ /* INFO: 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;
@@ -343,6 +313,9 @@ struct lzo_callback_t
#define LZO_E_INPUT_NOT_CONSUMED (-8)
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
#define LZO_E_INVALID_ARGUMENT (-10)
+#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */
+#define LZO_E_OUTPUT_NOT_CONSUMED (-12)
+#define LZO_E_INTERNAL_ERROR (-99)
#ifndef lzo_sizeof_dict_t
@@ -356,7 +329,7 @@ struct lzo_callback_t
* 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)sizeof(long),(int)sizeof(lzo_uint32_t),(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);
@@ -379,18 +352,22 @@ LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp buf, int c, lzo_uint len);
/* checksum functions */
-LZO_EXTERN(lzo_uint32)
- lzo_adler32(lzo_uint32 c, 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_EXTERN(lzo_uint32_t)
+ lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
+LZO_EXTERN(lzo_uint32_t)
+ lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
+LZO_EXTERN(const lzo_uint32_tp)
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_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t;
+typedef union {
+ lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
+ void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
+#if defined(lzo_int64_t)
+ lzo_uint64_t a10;
+#endif
+} 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 p, lzo_uint size);
@@ -399,9 +376,30 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
/***********************************************************************
-// deprecated macros - only for backward compatibility with LZO v1.xx
+// deprecated macros - only for backward compatibility
************************************************************************/
+/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
+#define lzo_byte unsigned char
+/* deprecated type names */
+#define lzo_int32 lzo_int32_t
+#define lzo_uint32 lzo_uint32_t
+#define lzo_int32p lzo_int32_t __LZO_MMODEL *
+#define lzo_uint32p lzo_uint32_t __LZO_MMODEL *
+#define LZO_INT32_MAX LZO_INT32_C(2147483647)
+#define LZO_UINT32_MAX LZO_UINT32_C(4294967295)
+#if defined(lzo_int64_t)
+#define lzo_int64 lzo_int64_t
+#define lzo_uint64 lzo_uint64_t
+#define lzo_int64p lzo_int64_t __LZO_MMODEL *
+#define lzo_uint64p lzo_uint64_t __LZO_MMODEL *
+#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807)
+#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615)
+#endif
+/* deprecated types */
+typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
+typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
+
#if defined(LZO_CFG_COMPAT)
#define __LZOCONF_H 1
diff --git a/app/lzo/include/lzo/lzodefs.h b/app/lzo/include/lzo/lzodefs.h
index 0e40e332..f4ae9487 100644
--- a/app/lzo/include/lzo/lzodefs.h
+++ b/app/lzo/include/lzo/lzodefs.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -47,12 +32,6 @@
#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
@@ -61,19 +40,30 @@
# define __LONG_MAX__ 9223372036854775807L
# endif
#endif
-#if defined(__INTEL_COMPILER) && defined(__linux__)
+#if !defined(LZO_CFG_NO_DISABLE_WUNDEF)
+#if defined(__ARMCC_VERSION)
+# pragma diag_suppress 193
+#elif defined(__clang__) && defined(__clang_minor__)
+# pragma clang diagnostic ignored "-Wundef"
+#elif defined(__INTEL_COMPILER)
# pragma warning(disable: 193)
-#endif
-#if defined(__KEIL__) && defined(__C166__)
-# pragma warning disable = 322
-#elif 0 && defined(__C251__)
+#elif defined(__KEIL__) && defined(__C166__)
# pragma warning disable = 322
-#endif
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
-# if (_MSC_VER >= 1300)
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__)
+# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2))
+# pragma GCC diagnostic ignored "-Wundef"
+# endif
+#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if ((_MSC_VER-0) >= 1300)
# pragma warning(disable: 4668)
# endif
#endif
+#endif
+#if 0 && defined(__POCC__) && defined(_WIN32)
+# if (__POCC__ >= 400)
+# pragma warn(disable: 2216)
+# endif
+#endif
#if 0 && defined(__WATCOMC__)
# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
# pragma warning 203 9
@@ -82,13 +72,29 @@
#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
# pragma option -h
#endif
+#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC)
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS 1
+#endif
+#endif
#if 0
-#define LZO_0xffffL 0xfffful
-#define LZO_0xffffffffL 0xfffffffful
+#define LZO_0xffffUL 0xfffful
+#define LZO_0xffffffffUL 0xfffffffful
#else
-#define LZO_0xffffL 65535ul
-#define LZO_0xffffffffL 4294967295ul
+#define LZO_0xffffUL 65535ul
+#define LZO_0xffffffffUL 4294967295ul
#endif
+#define LZO_0xffffL LZO_0xffffUL
+#define LZO_0xffffffffL LZO_0xffffffffUL
#if (LZO_0xffffL == LZO_0xffffffffL)
# error "your preprocessor is broken 1"
#endif
@@ -103,6 +109,13 @@
# error "your preprocessor is broken 4"
#endif
#endif
+#if defined(__COUNTER__)
+# ifndef LZO_CFG_USE_COUNTER
+# define LZO_CFG_USE_COUNTER 1
+# endif
+#else
+# undef LZO_CFG_USE_COUNTER
+#endif
#if (UINT_MAX == LZO_0xffffL)
#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
# if !defined(MSDOS)
@@ -233,14 +246,31 @@
#endif
#define LZO_PP_STRINGIZE(x) #x
#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT0() /*empty*/
+#define LZO_PP_CONCAT1(a) a
#define LZO_PP_CONCAT2(a,b) a ## b
#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0()
+#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a)
#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f)
+#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g)
+#define LZO_PP_EMPTY /*empty*/
+#define LZO_PP_EMPTY0() /*empty*/
+#define LZO_PP_EMPTY1(a) /*empty*/
+#define LZO_PP_EMPTY2(a,b) /*empty*/
+#define LZO_PP_EMPTY3(a,b,c) /*empty*/
+#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/
+#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/
+#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/
+#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/
#if 1
#define LZO_CPP_STRINGIZE(x) #x
#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
@@ -248,12 +278,16 @@
#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_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
#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_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f)
+#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g)
#endif
-#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
#if 1 && defined(__cplusplus)
# if !defined(__STDC_CONSTANT_MACROS)
# define __STDC_CONSTANT_MACROS 1
@@ -263,9 +297,13 @@
# endif
#endif
#if defined(__cplusplus)
-# define LZO_EXTERN_C extern "C"
+# define LZO_EXTERN_C extern "C"
+# define LZO_EXTERN_C_BEGIN extern "C" {
+# define LZO_EXTERN_C_END }
#else
-# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C_BEGIN /*empty*/
+# define LZO_EXTERN_C_END /*empty*/
#endif
#if !defined(__LZO_OS_OVERRIDE)
#if (LZO_OS_FREESTANDING)
@@ -366,12 +404,12 @@
#elif defined(__VMS)
# define LZO_OS_VMS 1
# define LZO_INFO_OS "vms"
-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+#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__))
+#elif defined(__mips__) && defined(__psp__)
# define LZO_OS_CONSOLE 1
# define LZO_OS_CONSOLE_PSP 1
# define LZO_INFO_OS "console"
@@ -399,9 +437,18 @@
# elif defined(__linux__) || 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(__APPLE__) && defined(__MACH__)
+# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000)
+# define LZO_OS_POSIX_DARWIN 1040
+# define LZO_INFO_OS_POSIX "darwin_iphone"
+# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040)
+# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# define LZO_INFO_OS_POSIX "darwin"
+# else
+# define LZO_OS_POSIX_DARWIN 1
+# define LZO_INFO_OS_POSIX "darwin"
+# endif
+# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN
# elif defined(__minix__) || defined(__minix)
# define LZO_OS_POSIX_MINIX 1
# define LZO_INFO_OS_POSIX "minix"
@@ -436,18 +483,18 @@
#endif
#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
# if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# 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"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
@@ -463,59 +510,65 @@
# define LZO_INFO_CC "sdcc"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC)
#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
-# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0))
# define LZO_INFO_CC "Pathscale C"
# define LZO_INFO_CCVER __PATHSCALE__
-#elif defined(__INTEL_COMPILER)
-# define LZO_CC_INTELC 1
+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0)
+# define LZO_CC_INTELC __INTEL_COMPILER
# define LZO_INFO_CC "Intel C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
-# if defined(_WIN32) || defined(_WIN64)
-# define LZO_CC_SYNTAX_MSC 1
-# else
-# define LZO_CC_SYNTAX_GNUC 1
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_INTELC_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# endif
#elif defined(__POCC__) && defined(_WIN32)
# define LZO_CC_PELLESC 1
# define LZO_INFO_CC "Pelles C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# else
-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
# endif
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
-# define LZO_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
+# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
# else
-# define LZO_CC_CLANG_CLANG 0x010000L
+# define LZO_CC_CLANG 0x010000L
+# endif
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_CLANG_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# endif
-# define LZO_CC_CLANG LZO_CC_CLANG_GNUC
# define LZO_INFO_CC "clang"
# define LZO_INFO_CCVER __VERSION__
#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# else
-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
# endif
# define LZO_CC_LLVM LZO_CC_LLVM_GNUC
# 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(__ACK__) && defined(_ACK)
# define LZO_CC_ACK 1
# define LZO_INFO_CC "Amsterdam Compiler Kit C"
# define LZO_INFO_CCVER "unknown"
+#elif defined(__ARMCC_VERSION) && !defined(__GNUC__)
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION)
#elif defined(__AZTEC_C__)
# define LZO_CC_AZTECC 1
# define LZO_INFO_CC "Aztec C"
@@ -540,10 +593,23 @@
# define LZO_CC_DECC 1
# define LZO_INFO_CC "DEC C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0)
+# define LZO_CC_GHS 1
+# define LZO_INFO_CC "Green Hills C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_GHS_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
#elif defined(__HIGHC__)
# define LZO_CC_HIGHC 1
# define LZO_INFO_CC "MetaWare High C"
# define LZO_INFO_CCVER "unknown"
+#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0)
+# define LZO_CC_HPACC __HP_aCC
+# define LZO_INFO_CC "HP aCC"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC)
#elif defined(__IAR_SYSTEMS_ICC__)
# define LZO_CC_IARC 1
# define LZO_INFO_CC "IAR C"
@@ -552,10 +618,14 @@
# else
# define LZO_INFO_CCVER "unknown"
# endif
-#elif defined(__IBMC__)
-# define LZO_CC_IBMC 1
+#elif defined(__IBMC__) && ((__IBMC__-0) > 0)
+# define LZO_CC_IBMC __IBMC__
# define LZO_INFO_CC "IBM C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0)
+# define LZO_CC_IBMC __IBMCPP__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__)
#elif defined(__KEIL__) && defined(__C166__)
# define LZO_CC_KEILC 1
# define LZO_INFO_CC "Keil C"
@@ -572,16 +642,8 @@
# 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_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
-# else
-# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
-# endif
-#elif defined(__MWERKS__)
-# define LZO_CC_MWERKS 1
+#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0)
+# define LZO_CC_MWERKS __MWERKS__
# define LZO_INFO_CC "Metrowerks C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__)
#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
@@ -592,6 +654,15 @@
# define LZO_CC_PACIFICC 1
# define LZO_INFO_CC "Pacific C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0))
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__)
+# else
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0"
+# endif
+# define LZO_INFO_CC "Portland Group PGI C"
#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
# define LZO_CC_PGI 1
# define LZO_INFO_CC "Portland Group PGI C"
@@ -606,7 +677,7 @@
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
#elif defined(__SUNPRO_C)
# define LZO_INFO_CC "SunPro C"
-# if ((__SUNPRO_C)+0 > 0)
+# if ((__SUNPRO_C-0) > 0)
# define LZO_CC_SUNPROC __SUNPRO_C
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
# else
@@ -615,7 +686,7 @@
# endif
#elif defined(__SUNPRO_CC)
# define LZO_INFO_CC "SunPro C"
-# if ((__SUNPRO_CC)+0 > 0)
+# if ((__SUNPRO_CC-0) > 0)
# define LZO_CC_SUNPROC __SUNPRO_CC
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
# else
@@ -641,16 +712,46 @@
#elif defined(__ZTC__)
# define LZO_CC_ZORTECHC 1
# define LZO_INFO_CC "Zortech C"
-# if (__ZTC__ == 0x310)
+# if ((__ZTC__-0) == 0x310)
# define LZO_INFO_CCVER "0x310"
# else
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
# endif
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_MSC _MSC_VER
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
#else
# define LZO_CC_UNKNOWN 1
# define LZO_INFO_CC "unknown"
# define LZO_INFO_CCVER "unknown"
#endif
+#if (LZO_CC_GNUC) && defined(__OPEN64__)
+# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__)
+# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0))
+# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC
+# endif
+#endif
+#if (LZO_CC_GNUC) && defined(__PCC__)
+# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__)
+# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0))
+# define LZO_CC_PCC_GNUC LZO_CC_GNUC
+# endif
+#endif
#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
#endif
@@ -668,8 +769,10 @@
# 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(__aarch64__)
+# define LZO_ARCH_ARM64 1
+# define LZO_INFO_ARCH "arm64"
#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
# define LZO_ARCH_ALPHA 1
# define LZO_INFO_ARCH "alpha"
@@ -685,10 +788,10 @@
# define LZO_INFO_ARCH "arm_thumb"
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
# define LZO_ARCH_ARM 1
-# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
+# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1)
# define LZO_ARCH_ARM_THUMB 1
# define LZO_INFO_ARCH "arm_thumb"
-# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2)
# define LZO_INFO_ARCH "arm"
# else
# define LZO_INFO_ARCH "arm"
@@ -806,53 +909,147 @@
# error "FIXME - missing define for CPU architecture"
#endif
#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
-# error "FIXME - missing WIN32 define for CPU architecture"
+# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture"
#endif
#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
-# error "FIXME - missing WIN64 define for CPU architecture"
+# error "FIXME - missing LZO_OS_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 (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM)
-# error "this should not happen"
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64)
+# define LZO_ARCH_X64 1
+#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_AMD64 1
#endif
-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086)
-# error "this should not happen"
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64)
+# define LZO_ARCH_AARCH64 1
+#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_ARM64 1
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86)
+# define LZO_ARCH_X86 1
+#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_I386 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086PM && !LZO_ARCH_I086)
+# error "unexpected configuration - check your compiler defines"
#endif
#if (LZO_ARCH_I086)
# if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#if (LZO_ARCH_I386)
# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if !defined(LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSE2__)
+# define LZO_TARGET_FEATURE_SSE2 1
+# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64))
+# define LZO_TARGET_FEATURE_SSE2 1
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSSE3)
+# if (LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSSE3__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# elif defined(_MSC_VER) && defined(__AVX__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSE4_2)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__SSE4_2__)
+# define LZO_TARGET_FEATURE_SSE4_2 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__AVX__)
+# define LZO_TARGET_FEATURE_AVX 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX2)
+# if (LZO_TARGET_FEATURE_AVX)
+# if defined(__AVX2__)
+# define LZO_TARGET_FEATURE_AVX2 1
+# endif
+# endif
# endif
#endif
-#if !defined(__LZO_MM_OVERRIDE)
+#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if defined(__ARM_NEON__)
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if 1
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#endif
+#if 0
+#elif !defined(__LZO_MM_OVERRIDE)
#if (LZO_ARCH_I086)
#if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
#endif
#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
# define LZO_MM_TINY 1
@@ -879,7 +1076,7 @@
#elif (LZO_CC_ZORTECHC && defined(__VCM__))
# define LZO_MM_LARGE 1
#else
-# error "unknown memory model"
+# error "unknown LZO_ARCH_I086 memory model"
#endif
#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
#define LZO_HAVE_MM_HUGE_PTR 1
@@ -902,10 +1099,10 @@
#endif
#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR)
# if (LZO_OS_DOS16)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# elif (LZO_CC_ZORTECHC)
# else
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#ifdef __cplusplus
@@ -937,7 +1134,7 @@ extern "C" {
#endif
#elif (LZO_ARCH_C166)
#if !defined(__MODEL__)
-# error "FIXME - C166 __MODEL__"
+# error "FIXME - LZO_ARCH_C166 __MODEL__"
#elif ((__MODEL__) == 0)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 1)
@@ -951,11 +1148,11 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - C166 __MODEL__"
+# error "FIXME - LZO_ARCH_C166 __MODEL__"
#endif
#elif (LZO_ARCH_MCS251)
#if !defined(__MODEL__)
-# error "FIXME - MCS251 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS251 __MODEL__"
#elif ((__MODEL__) == 0)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 2)
@@ -967,11 +1164,11 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - MCS251 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS251 __MODEL__"
#endif
#elif (LZO_ARCH_MCS51)
#if !defined(__MODEL__)
-# error "FIXME - MCS51 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS51 __MODEL__"
#elif ((__MODEL__) == 1)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 2)
@@ -983,7 +1180,7 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - MCS51 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS51 __MODEL__"
#endif
#elif (LZO_ARCH_CRAY_PVP)
# define LZO_MM_PVP 1
@@ -1010,35 +1207,818 @@ extern "C" {
# error "unknown memory model"
#endif
#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_gnuc_extension__ __extension__
+#else
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+# define __lzo_gnuc_extension__ /*empty*/
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# else
+# define LZO_CFG_USE_NEW_STYLE_CASTS 1
+# endif
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(__cplusplus)
+# if defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# undef LZO_CFG_USE_NEW_STYLE_CASTS
+# endif
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# define LZO_REINTERPRET_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_STATIC_CAST(t,e) (static_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_STATIC_CAST)
+# define LZO_STATIC_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST2)
+# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e))
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e))))
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_PCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_PCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_PCAST)
+# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e))
+#endif
+#if !defined(LZO_CCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_CCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_CCAST)
+# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e))
+#endif
+#if !defined(LZO_ICONV)
+# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ICAST)
+# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ITRUNC)
+# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(__lzo_cte)
+# if (LZO_CC_MSC || LZO_CC_WATCOMC)
+# define __lzo_cte(e) ((void)0,(e))
+# elif 1
+# define __lzo_cte(e) ((void)0,(e))
+# endif
+#endif
+#if !defined(__lzo_cte)
+# define __lzo_cte(e) (e)
+#endif
+#if !defined(LZO_BLOCK_BEGIN)
+# define LZO_BLOCK_BEGIN do {
+# define LZO_BLOCK_END } while __lzo_cte(0)
+#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_CLANG && (LZO_CC_CLANG >= 0x030200ul))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_CLANG || 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) {LZO_EXTERN_C 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_CLANG || 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) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_CLANG >= 0x020800ul)
+# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l)))
+# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || 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_GHS)
+# define __lzo_inline __inline__
+#elif (LZO_CC_IBMC >= 600)
+# 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 (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_inline __inline__
+#endif
+#endif
+#if defined(__lzo_inline)
+# ifndef __lzo_HAVE_inline
+# define __lzo_HAVE_inline 1
+# endif
+#else
+# define __lzo_inline /*empty*/
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# ifndef __lzo_HAVE_forceinline
+# define __lzo_HAVE_forceinline 1
+# endif
+#else
+# define __lzo_forceinline __lzo_inline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || 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
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_noinline __attribute__((__noinline__))
+#endif
+#endif
+#if defined(__lzo_noinline)
+# ifndef __lzo_HAVE_noinline
+# define __lzo_HAVE_noinline 1
+# endif
+#else
+# define __lzo_noinline /*empty*/
+#endif
+#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_static_inline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline
+#endif
+#endif
+#if !defined(__lzo_static_inline)
+# define __lzo_static_inline static __lzo_inline
+#endif
+#if !defined(__lzo_static_forceinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline
+#endif
+#endif
+#if !defined(__lzo_static_forceinline)
+# define __lzo_static_forceinline static __lzo_forceinline
+#endif
+#if !defined(__lzo_static_noinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline
+#endif
+#endif
+#if !defined(__lzo_static_noinline)
+# define __lzo_static_noinline static __lzo_noinline
+#endif
+#if !defined(__lzo_c99_extern_inline)
+#if defined(__GNUC_GNU_INLINE__)
+# define __lzo_c99_extern_inline __lzo_inline
+#elif defined(__GNUC_STDC_INLINE__)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#endif
+#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline)
+# define __lzo_c99_extern_inline __lzo_inline
+#endif
+#endif
+#if defined(__lzo_c99_extern_inline)
+# ifndef __lzo_HAVE_c99_extern_inline
+# define __lzo_HAVE_c99_extern_inline 1
+# endif
+#else
+# define __lzo_c99_extern_inline /*empty*/
+#endif
+#if !defined(__lzo_may_alias)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_CLANG >= 0x020900ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#endif
+#endif
+#if defined(__lzo_may_alias)
+# ifndef __lzo_HAVE_may_alias
+# define __lzo_HAVE_may_alias 1
+# endif
+#else
+# define __lzo_may_alias /*empty*/
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# ifndef __lzo_HAVE_noreturn
+# define __lzo_HAVE_noreturn 1
+# endif
+#else
+# define __lzo_noreturn /*empty*/
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900))
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# ifndef __lzo_HAVE_nothrow
+# define __lzo_HAVE_nothrow 1
+# endif
+#else
+# define __lzo_nothrow /*empty*/
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 1210)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_restrict __restrict__
+#endif
+#endif
+#if defined(__lzo_restrict)
+# ifndef __lzo_HAVE_restrict
+# define __lzo_HAVE_restrict 1
+# endif
+#else
+# define __lzo_restrict /*empty*/
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_GHS) && !defined(__cplusplus)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_alignof(e) (__lzo_gnuc_extension__ __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)
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_alignof(e) __alignof__(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# ifndef __lzo_HAVE_alignof
+# define __lzo_HAVE_alignof 1
+# endif
+#endif
+#if !defined(__lzo_struct_packed)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__));
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s {
+# define __lzo_struct_packed_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_struct_packed(s) _Packed struct s {
+# define __lzo_struct_packed_end() };
+#endif
+#endif
+#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma)
+# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s)
+#endif
+#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end)
+# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end()
+#endif
+#if !defined(__lzo_byte_struct)
+#if defined(__lzo_struct_packed)
+# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end()
+# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end()
+#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__));
+# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__));
+#endif
+#endif
+#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma)
+# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n)
+#endif
+#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))
+#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_CILLY || LZO_CC_PCC)
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_align16(s) struct __declspec(align(16)) s {
+# define __lzo_struct_align16_end() };
+# define __lzo_struct_align32(s) struct __declspec(align(32)) s {
+# define __lzo_struct_align32_end() };
+# define __lzo_struct_align64(s) struct __declspec(align(64)) s {
+# define __lzo_struct_align64_end() };
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_struct_align16(s) struct s {
+# define __lzo_struct_align16_end() } __attribute__((__aligned__(16)));
+# define __lzo_struct_align32(s) struct s {
+# define __lzo_struct_align32_end() } __attribute__((__aligned__(32)));
+# define __lzo_struct_align64(s) struct s {
+# define __lzo_struct_align64_end() } __attribute__((__aligned__(64)));
+#endif
+#endif
+#if !defined(__lzo_union_um)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810))
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_union_am(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_union_um(s) __pragma(pack(push,1)) union s {
+# define __lzo_union_um_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_union_um(s) _Packed union s {
+# define __lzo_union_um_end() };
+#endif
+#endif
+#if !defined(__lzo_union_am)
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() };
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# ifndef __lzo_HAVE_constructor
+# define __lzo_HAVE_constructor 1
+# endif
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# ifndef __lzo_HAVE_destructor
+# define __lzo_HAVE_destructor 1
+# endif
+#endif
+#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_IBMC >= 1010)
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# ifndef __lzo_HAVE_likely
+# define __lzo_HAVE_likely 1
+# endif
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# ifndef __lzo_HAVE_unlikely
+# define __lzo_HAVE_unlikely 1
+# endif
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(__lzo_static_unused_void_func)
+# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void)
+# else
+# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void)
+# endif
+#endif
+#if !defined(__lzo_loop_forever)
+# if (LZO_CC_IBMC)
+# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END
+# else
+# define __lzo_loop_forever() do { ; } while __lzo_cte(1)
+# endif
+#endif
+#if !defined(__lzo_unreachable)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul))
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_GNUC >= 0x040500ul)
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1
+# define __lzo_unreachable() __builtin_unreachable();
+#endif
+#endif
+#if defined(__lzo_unreachable)
+# ifndef __lzo_HAVE_unreachable
+# define __lzo_HAVE_unreachable 1
+# endif
+#else
+# if 0
+# define __lzo_unreachable() ((void)0);
+# else
+# define __lzo_unreachable() __lzo_loop_forever();
+# endif
+#endif
+#ifndef __LZO_CTA_NAME
+#if (LZO_CFG_USE_COUNTER)
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__)
+#else
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__)
+#endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END
+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(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_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));}
+# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));}
+# elif (LZO_CC_GNUC >= 0x040700ul)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));}
+# 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_NAME(lzo_cta_t__)[1-2*!(e)];}
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1)
+#if defined(__cplusplus)
+extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) }
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3)
+#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 /*empty*/
+# 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_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#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 /*empty*/
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit /*empty*/
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main /*empty*/
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort /*empty*/
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler /*empty*/
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !(LZO_CFG_NO_WINDOWS_H)
+#if !defined(LZO_HAVE_WINDOWS_H)
+#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
+#endif
+#endif
+#ifndef LZO_SIZEOF_SHORT
#if defined(SIZEOF_SHORT)
# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#elif defined(__SIZEOF_SHORT__)
+# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__)
+#endif
#endif
+#ifndef LZO_SIZEOF_INT
#if defined(SIZEOF_INT)
# define LZO_SIZEOF_INT (SIZEOF_INT)
+#elif defined(__SIZEOF_INT__)
+# define LZO_SIZEOF_INT (__SIZEOF_INT__)
#endif
+#endif
+#ifndef LZO_SIZEOF_LONG
#if defined(SIZEOF_LONG)
# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#elif defined(__SIZEOF_LONG__)
+# define LZO_SIZEOF_LONG (__SIZEOF_LONG__)
+#endif
#endif
+#ifndef LZO_SIZEOF_LONG_LONG
#if defined(SIZEOF_LONG_LONG)
# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#elif defined(__SIZEOF_LONG_LONG__)
+# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__)
#endif
+#endif
+#ifndef LZO_SIZEOF___INT16
#if defined(SIZEOF___INT16)
# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
#endif
+#endif
+#ifndef LZO_SIZEOF___INT32
#if defined(SIZEOF___INT32)
# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
#endif
+#endif
+#ifndef LZO_SIZEOF___INT64
#if defined(SIZEOF___INT64)
# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
#endif
+#endif
+#ifndef LZO_SIZEOF_VOID_P
#if defined(SIZEOF_VOID_P)
# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#elif defined(__SIZEOF_POINTER__)
+# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__)
#endif
+#endif
+#ifndef LZO_SIZEOF_SIZE_T
#if defined(SIZEOF_SIZE_T)
# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#elif defined(__SIZEOF_SIZE_T__)
+# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__)
+#endif
#endif
+#ifndef LZO_SIZEOF_PTRDIFF_T
#if defined(SIZEOF_PTRDIFF_T)
# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#elif defined(__SIZEOF_PTRDIFF_T__)
+# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__)
+#endif
#endif
#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
#if !defined(LZO_SIZEOF_SHORT)
@@ -1060,6 +2040,7 @@ extern "C" {
# error "LZO_SIZEOF_SHORT"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short))
#if !defined(LZO_SIZEOF_INT)
# if (LZO_ARCH_CRAY_PVP)
# define LZO_SIZEOF_INT 8
@@ -1081,6 +2062,7 @@ extern "C" {
# error "LZO_SIZEOF_INT"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int))
#if !defined(LZO_SIZEOF_LONG)
# if (ULONG_MAX == LZO_0xffffffffL)
# define LZO_SIZEOF_LONG 4
@@ -1090,6 +2072,8 @@ extern "C" {
# define LZO_SIZEOF_LONG 2
# elif (__LZO_LSR(ULONG_MAX,31) == 1)
# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,39) == 1)
+# define LZO_SIZEOF_LONG 5
# elif (__LZO_LSR(ULONG_MAX,63) == 1)
# define LZO_SIZEOF_LONG 8
# elif (__LZO_LSR(ULONG_MAX,127) == 1)
@@ -1098,11 +2082,12 @@ extern "C" {
# error "LZO_SIZEOF_LONG"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long))
#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)
+# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0))
# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
# define LZO_SIZEOF_LONG_LONG 4
@@ -1116,7 +2101,7 @@ extern "C" {
#if (LZO_ARCH_I086 && LZO_CC_DMC)
#elif (LZO_CC_CILLY) && defined(__GNUC__)
# define LZO_SIZEOF_LONG_LONG 8
-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
# define LZO_SIZEOF_LONG_LONG 8
#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
# define LZO_SIZEOF_LONG_LONG 8
@@ -1138,11 +2123,13 @@ extern "C" {
# 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))
+#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64))
# define LZO_SIZEOF___INT64 8
#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
# define LZO_SIZEOF_LONG_LONG 8
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+#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)
@@ -1155,87 +2142,127 @@ extern "C" {
# undef LZO_SIZEOF_LONG_LONG
# endif
#endif
-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+#if (LZO_CFG_NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(_NO_LONGLONG)
# 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
+#if !defined(LZO_WORDSIZE)
+#if (LZO_ARCH_ALPHA)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AMD64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AVR)
+# define LZO_WORDSIZE 1
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define LZO_WORDSIZE 4
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_WORDSIZE 4
# else
-# error "LZO_MM"
+# define LZO_WORDSIZE 2
# endif
-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
-# define __LZO_WORDSIZE 1
+#elif (LZO_ARCH_I086)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_IA64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_M16C)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_SPU)
+# define LZO_WORDSIZE 4
+#elif (LZO_ARCH_Z80)
+# define LZO_WORDSIZE 1
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_WORDSIZE 8
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define LZO_WORDSIZE 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_WORDSIZE 8
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LP64__) || defined(__LP64) || defined(_LP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_ARCH_AVR)
# 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_I086)
+# 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 "invalid LZO_ARCH_I086 memory model"
+# 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_ARCH_SPU)
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_ARCH_Z80)
+# define LZO_SIZEOF_VOID_P 2
#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(__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 || defined(__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
+# if defined(__LLP64_IFC__)
+# 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 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+# endif
#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
-#elif (LZO_ARCH_SPU)
-# if 0
-# define __LZO_WORDSIZE 16
-# endif
-# define LZO_SIZEOF_VOID_P 4
-#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
+#if !defined(LZO_SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *))
#if !defined(LZO_SIZEOF_SIZE_T)
#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
# define LZO_SIZEOF_SIZE_T 2
-#else
+#endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t))
#endif
#if !defined(LZO_SIZEOF_PTRDIFF_T)
#if (LZO_ARCH_I086)
@@ -1248,11 +2275,18 @@ extern "C" {
# define LZO_SIZEOF_PTRDIFF_T 2
# endif
# else
-# error "LZO_MM"
+# error "invalid LZO_ARCH_I086 memory model"
# endif
-#else
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
+#endif
+#if !defined(LZO_WORDSIZE)
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
#endif
#if (LZO_ABI_NEUTRAL_ENDIAN)
# undef LZO_ABI_BIG_ENDIAN
@@ -1264,7 +2298,7 @@ extern "C" {
# define LZO_ABI_LITTLE_ENDIAN 1
#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
# define LZO_ABI_LITTLE_ENDIAN 1
-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390)
+#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU)
# define LZO_ABI_BIG_ENDIAN 1
#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
# if (__LITTLE_ENDIAN__ == 1)
@@ -1280,6 +2314,19 @@ extern "C" {
# define LZO_ABI_BIG_ENDIAN 1
#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC)
+# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+# elif defined(__BIG_ENDIAN)
+# define LZO_ABI_BIG_ENDIAN 1
+# else
+# define LZO_ABI_LITTLE_ENDIAN 1
+# endif
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
+# 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__)
@@ -1287,7 +2334,7 @@ extern "C" {
#endif
#endif
#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
#endif
#if (LZO_ABI_BIG_ENDIAN)
# define LZO_INFO_ABI_ENDIAN "be"
@@ -1302,6 +2349,9 @@ extern "C" {
#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 == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_LP32 1
+# define LZO_INFO_ABI_PM "lp32"
#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"
@@ -1318,7 +2368,8 @@ extern "C" {
# define LZO_ABI_IP32L64 1
# define LZO_INFO_ABI_PM "ip32l64"
#endif
-#if !defined(__LZO_LIBC_OVERRIDE)
+#if 0
+#elif !defined(__LZO_LIBC_OVERRIDE)
#if (LZO_LIBC_NAKED)
# define LZO_INFO_LIBC "naked"
#elif (LZO_LIBC_FREESTANDING)
@@ -1329,6 +2380,9 @@ extern "C" {
# define LZO_INFO_LIBC "isoc90"
#elif (LZO_LIBC_ISOC99)
# define LZO_INFO_LIBC "isoc99"
+#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
#elif defined(__dietlibc__)
# define LZO_LIBC_DIETLIBC 1
# define LZO_INFO_LIBC "dietlibc"
@@ -1337,13 +2391,13 @@ extern "C" {
# 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__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0))
# else
# define LZO_LIBC_UCLIBC 0x00090bL
# endif
-# define LZO_INFO_LIBC "uclibc"
+# define LZO_INFO_LIBC "uc" "libc"
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
-# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100)
# define LZO_INFO_LIBC "glibc"
#elif (LZO_CC_MWERKS) && defined(__MSL__)
# define LZO_LIBC_MSL __MSL__
@@ -1356,424 +2410,160 @@ extern "C" {
# define LZO_INFO_LIBC "default"
#endif
#endif
-#if !defined(__lzo_gnuc_extension__)
-#if (LZO_CC_GNUC >= 0x020800ul)
-# define __lzo_gnuc_extension__ __extension__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_gnuc_extension__ __extension__
-#else
-# define __lzo_gnuc_extension__ /*empty*/
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-# define __lzo_ua_volatile volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || LZO_CC_CLANG || 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)
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_alignof(e) __alignof__(e)
-#endif
-#endif
-#if defined(__lzo_alignof)
-# define __lzo_HAVE_alignof 1
-#endif
-#if !defined(__lzo_constructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_constructor __attribute__((__constructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_constructor __attribute__((__constructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_constructor __attribute__((__constructor__))
-#endif
-#endif
-#if defined(__lzo_constructor)
-# define __lzo_HAVE_constructor 1
-#endif
-#if !defined(__lzo_destructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_destructor __attribute__((__destructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_destructor __attribute__((__destructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_destructor __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-# define __lzo_HAVE_destructor 1
-#endif
-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
-# error "this should not happen"
-#endif
-#if !defined(__lzo_inline)
-#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_CLANG || 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 (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_inline __inline__
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define __lzo_inline inline
-#endif
+#if (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_GNUC == 0x011f00ul))
+#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_CC_GNUC)
+# define LZO_ASM_SYNTAX_GNUC 1
#endif
-#if defined(__lzo_inline)
-# define __lzo_HAVE_inline 1
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000))
+# define __LZO_ASM_CLOBBER "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
#else
-# define __lzo_inline /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-#if (LZO_CC_GNUC >= 0x030200ul)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-# define __lzo_forceinline __forceinline
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-# define __lzo_forceinline __forceinline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+# define __LZO_ASM_CLOBBER "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC : "cc"
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
#endif
#endif
-#if defined(__lzo_forceinline)
-# define __lzo_HAVE_forceinline 1
-#else
-# define __lzo_forceinline /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
-# define __lzo_noinline __attribute__((__noinline__,__used__))
-#elif (LZO_CC_GNUC >= 0x030200ul)
-# define __lzo_noinline __attribute__((__noinline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
-# define __lzo_noinline __declspec(noinline)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_noinline __attribute__((__noinline__))
-#elif (LZO_CC_CLANG || 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)
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_noinline __attribute__((__noinline__))
-#endif
-#endif
-#if defined(__lzo_noinline)
-# define __lzo_HAVE_noinline 1
-#else
-# define __lzo_noinline /*empty*/
-#endif
-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
-# error "this should not happen"
-#endif
-#if !defined(__lzo_noreturn)
-#if (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-# define __lzo_noreturn __declspec(noreturn)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-# define __lzo_noreturn __declspec(noreturn)
-#endif
-#endif
-#if defined(__lzo_noreturn)
-# define __lzo_HAVE_noreturn 1
-#else
-# define __lzo_noreturn /*empty*/
-#endif
-#if !defined(__lzo_nothrow)
-#if (LZO_CC_GNUC >= 0x030300ul)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
-# define __lzo_nothrow __declspec(nothrow)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
-# define __lzo_nothrow __declspec(nothrow)
-#endif
-#endif
-#if defined(__lzo_nothrow)
-# define __lzo_HAVE_nothrow 1
-#else
-# define __lzo_nothrow /*empty*/
-#endif
-#if !defined(__lzo_restrict)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
-# define __lzo_restrict __restrict
-#endif
-#endif
-#if defined(__lzo_restrict)
-# define __lzo_HAVE_restrict 1
-#else
-# define __lzo_restrict /*empty*/
-#endif
-#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
-#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_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_likely(e) (__builtin_expect(!!(e),1))
-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
-#endif
-#endif
-#if defined(__lzo_likely)
-# define __lzo_HAVE_likely 1
-#else
-# define __lzo_likely(e) (e)
-#endif
-#if defined(__lzo_unlikely)
-# define __lzo_HAVE_unlikely 1
-#else
-# 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_CLANG || 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)
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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_CLANG || 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)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
# 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_CLANG || 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
+#elif (LZO_ARCH_ARM)
+# if defined(__ARM_FEATURE_UNALIGNED)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
# endif
-#endif
-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
-# if 0
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
-# elif 0 && (LZO_CC_GNUC)
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
-# else
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+#elif (LZO_ARCH_ARM64)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#endif
-#if !defined(LZO_UNCONST_CAST)
-# if 0 && defined(__cplusplus)
-# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e))))))
-# else
-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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)];
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
# 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)];}
+#elif (LZO_ARCH_CRIS)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# 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 /*empty*/
-# 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
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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
+#elif (LZO_ARCH_I386)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
-# define __lzo_cdecl __cdecl
-#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 /*empty*/
-#endif
-#if !defined(__lzo_cdecl_atexit)
-# define __lzo_cdecl_atexit /*empty*/
-#endif
-#if !defined(__lzo_cdecl_main)
-# define __lzo_cdecl_main /*empty*/
-#endif
-#if !defined(__lzo_cdecl_qsort)
-# define __lzo_cdecl_qsort /*empty*/
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-# define __lzo_cdecl_sighandler /*empty*/
-#endif
-#if !defined(__lzo_cdecl_va)
-# define __lzo_cdecl_va __lzo_cdecl
-#endif
-#if !(LZO_CFG_NO_WINDOWS_H)
-#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
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# endif
-#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
+# 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
+# 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
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
# endif
#elif (LZO_ARCH_MIPS)
-# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
#elif (LZO_ARCH_POWERPC)
-# define LZO_OPT_PREFER_PREINC 1
-# define LZO_OPT_PREFER_PREDEC 1
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
# if (LZO_ABI_BIG_ENDIAN)
-# define LZO_OPT_UNALIGNED16 1
-# define LZO_OPT_UNALIGNED32 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
# 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
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
# endif
#elif (LZO_ARCH_SH)
-# define LZO_OPT_PREFER_POSTINC 1
-# define LZO_OPT_PREFER_PREDEC 1
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
#endif
#ifndef LZO_CFG_NO_INLINE_ASM
-#if (LZO_CC_LLVM)
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_INLINE_ASM 1
+#elif (LZO_CC_LLVM)
# define LZO_CFG_NO_INLINE_ASM 1
#endif
#endif
+#if (LZO_CFG_NO_INLINE_ASM)
+# undef LZO_ASM_SYNTAX_MSC
+# undef LZO_ASM_SYNTAX_GNUC
+# undef __LZO_ASM_CLOBBER
+# undef __LZO_ASM_CLOBBER_LIST_CC
+# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY
+# undef __LZO_ASM_CLOBBER_LIST_EMPTY
+#endif
#ifndef LZO_CFG_NO_UNALIGNED
#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
# define LZO_CFG_NO_UNALIGNED 1
@@ -1784,25 +2574,6 @@ extern "C" {
# undef LZO_OPT_UNALIGNED32
# undef LZO_OPT_UNALIGNED64
#endif
-#if (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_GNUC == 0x011f00ul))
-#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-# define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || 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 ""
@@ -1846,7 +2617,382 @@ extern "C" {
#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
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(lzo_llong_t)
+#if (LZO_SIZEOF_LONG_LONG+0 > 0)
+__lzo_gnuc_extension__ typedef long long lzo_llong_t__;
+__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__;
+# define lzo_llong_t lzo_llong_t__
+# define lzo_ullong_t lzo_ullong_t__
+#endif
+#endif
+#if !defined(lzo_int16e_t)
+#if (LZO_SIZEOF_LONG == 2)
+# define lzo_int16e_t long
+# define lzo_uint16e_t unsigned long
+#elif (LZO_SIZEOF_INT == 2)
+# define lzo_int16e_t int
+# define lzo_uint16e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 2)
+# define lzo_int16e_t short int
+# define lzo_uint16e_t unsigned short int
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM)
+ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__)));
+ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__)));
+# define lzo_int16e_t lzo_int16e_hi_t__
+# define lzo_uint16e_t lzo_uint16e_hi_t__
+#elif (LZO_SIZEOF___INT16 == 2)
+# define lzo_int16e_t __int16
+# define lzo_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(lzo_int16e_t)
+# define LZO_SIZEOF_LZO_INT16E_T 2
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+#endif
+#if !defined(lzo_int32e_t)
+#if (LZO_SIZEOF_LONG == 4)
+# define lzo_int32e_t long int
+# define lzo_uint32e_t unsigned long int
+#elif (LZO_SIZEOF_INT == 4)
+# define lzo_int32e_t int
+# define lzo_uint32e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 4)
+# define lzo_int32e_t short int
+# define lzo_uint32e_t unsigned short int
+#elif (LZO_SIZEOF_LONG_LONG == 4)
+# define lzo_int32e_t lzo_llong_t
+# define lzo_uint32e_t lzo_ullong_t
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+#elif (LZO_SIZEOF___INT32 == 4)
+# define lzo_int32e_t __int32
+# define lzo_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(lzo_int32e_t)
+# define LZO_SIZEOF_LZO_INT32E_T 4
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+#endif
+#if !defined(lzo_int64e_t)
+#if (LZO_SIZEOF___INT64 == 8)
+# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define LZO_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int64e_t int
+# define lzo_uint64e_t unsigned int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG == 8)
+# define lzo_int64e_t long int
+# define lzo_uint64e_t unsigned long int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define lzo_int64e_t lzo_llong_t
+# define lzo_uint64e_t lzo_ullong_t
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0ll)
+# define LZO_UINT64_C(c) ((c) + 0ull)
+# elif 0
+# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL))
+# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL))
+# else
+# define LZO_INT64_C(c) (c##LL)
+# define LZO_UINT64_C(c) (c##ULL)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG
+#elif (LZO_SIZEOF___INT64 == 8)
+# define lzo_int64e_t __int64
+# define lzo_uint64e_t unsigned __int64
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0i64)
+# define LZO_UINT64_C(c) ((c) + 0ui64)
+# else
+# define LZO_INT64_C(c) (c##i64)
+# define LZO_UINT64_C(c) (c##ui64)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64
+#else
+#endif
+#endif
+#if defined(lzo_int64e_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+#endif
+#if !defined(lzo_int32l_t)
+#if defined(lzo_int32e_t)
+# define lzo_int32l_t lzo_int32e_t
+# define lzo_uint32l_t lzo_uint32e_t
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T
+#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int32l_t int
+# define lzo_uint32l_t unsigned int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= 4)
+# define lzo_int32l_t long int
+# define lzo_uint32l_t unsigned long int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG
+#else
+# error "lzo_int32l_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+#endif
+#if !defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+# define lzo_int64l_t lzo_int64e_t
+# define lzo_uint64l_t lzo_uint64e_t
+# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T
+#else
+#endif
+#endif
+#if defined(lzo_int64l_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+#endif
+#if !defined(lzo_int32f_t)
+#if (LZO_SIZEOF_SIZE_T >= 8)
+# define lzo_int32f_t lzo_int64l_t
+# define lzo_uint32f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# define lzo_int32f_t lzo_int32l_t
+# define lzo_uint32f_t lzo_uint32l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+#endif
+#if !defined(lzo_int64f_t)
+#if defined(lzo_int64l_t)
+# define lzo_int64f_t lzo_int64l_t
+# define lzo_uint64f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+#endif
+#endif
+#if defined(lzo_int64f_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+#endif
+#if !defined(lzo_intptr_t)
+#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16))
+# define __LZO_INTPTR_T_IS_POINTER 1
+ typedef char* lzo_intptr_t;
+ typedef char* lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4))
+ typedef __w64 int lzo_intptr_t;
+ typedef __w64 unsigned int lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t short
+# define lzo_uintptr_t unsigned short
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT
+#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_intptr_t int
+# define lzo_uintptr_t unsigned int
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t long
+# define lzo_uintptr_t unsigned long
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t lzo_int64l_t
+# define lzo_uintptr_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# error "lzo_intptr_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#endif
+#if !defined(lzo_word_t)
+#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0)
+#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER)
+# define lzo_word_t lzo_uintptr_t
+# define lzo_sword_t lzo_intptr_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG)
+# define lzo_word_t unsigned long
+# define lzo_sword_t long
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG
+#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
+# define lzo_word_t unsigned int
+# define lzo_sword_t int
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
+#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT)
+# define lzo_word_t unsigned short
+# define lzo_sword_t short
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT
+#elif (LZO_WORDSIZE == 1)
+# define lzo_word_t unsigned char
+# define lzo_sword_t signed char
+# define LZO_SIZEOF_LZO_WORD_T 1
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T)
+# define lzo_word_t lzo_uint64l_t
+# define lzo_sword_t lzo_int64l_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T
+#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC)
+#if 0
+ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__)));
+# define lzo_word_t lzo_word_t
+# define lzo_sword_t lzo_sword_t
+# define LZO_SIZEOF_LZO_WORD_T 16
+#endif
+#else
+# error "lzo_word_t"
+#endif
+#endif
+#endif
+#if 1 && defined(lzo_word_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE)
+#endif
+#if 1
+#define lzo_int8_t signed char
+#define lzo_uint8_t unsigned char
+#define LZO_SIZEOF_LZO_INT8_T 1
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+#endif
+#if defined(lzo_int16e_t)
+#define lzo_int16_t lzo_int16e_t
+#define lzo_uint16_t lzo_uint16e_t
+#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t))
+#endif
+#if defined(lzo_int32e_t)
+#define lzo_int32_t lzo_int32e_t
+#define lzo_uint32_t lzo_uint32e_t
+#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t))
+#endif
+#if defined(lzo_int64e_t)
+#define lzo_int64_t lzo_int64e_t
+#define lzo_uint64_t lzo_uint64e_t
+#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t))
+#endif
+#if 1
+#define lzo_int_least32_t lzo_int32l_t
+#define lzo_uint_least32_t lzo_uint32l_t
+#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t))
+#endif
+#if defined(lzo_int64l_t)
+#define lzo_int_least64_t lzo_int64l_t
+#define lzo_uint_least64_t lzo_uint64l_t
+#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t))
+#endif
+#if 1
+#define lzo_int_fast32_t lzo_int32f_t
+#define lzo_uint_fast32_t lzo_uint32f_t
+#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t))
+#endif
+#if defined(lzo_int64f_t)
+#define lzo_int_fast64_t lzo_int64f_t
+#define lzo_uint_fast64_t lzo_uint64f_t
+#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t))
+#endif
+#if !defined(LZO_INT16_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) ((c) + 0)
+# define LZO_UINT16_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) ((c) + 0L)
+# define LZO_UINT16_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) (c)
+# define LZO_UINT16_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) (c##L)
+# define LZO_UINT16_C(c) (c##UL)
+# else
+# error "LZO_INT16_C"
+# endif
+#endif
+#if !defined(LZO_INT32_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) ((c) + 0)
+# define LZO_UINT32_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) ((c) + 0L)
+# define LZO_UINT32_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) (c)
+# define LZO_UINT32_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) (c##L)
+# define LZO_UINT32_C(c) (c##UL)
+# elif (LZO_SIZEOF_LONG_LONG >= 4)
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+# else
+# error "LZO_INT32_C"
+# endif
+#endif
+#if !defined(LZO_INT64_C) && defined(lzo_int64l_t)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) ((c) + 0)
+# define LZO_UINT64_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) ((c) + 0L)
+# define LZO_UINT64_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) (c)
+# define LZO_UINT64_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) (c##L)
+# define LZO_UINT64_C(c) (c##UL)
+# else
+# error "LZO_INT64_C"
+# endif
+#endif
+#endif
#endif /* already included */
-/* vim:set ts=4 et: */
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/include/lzo/lzoutil.h b/app/lzo/include/lzo/lzoutil.h
index eb741ce2..23ea5229 100644
--- a/app/lzo/include/lzo/lzoutil.h
+++ b/app/lzo/include/lzo/lzoutil.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/lzotest/asm.h b/app/lzo/lzotest/asm.h
index a368fbed..cbc07156 100644
--- a/app/lzo/lzotest/asm.h
+++ b/app/lzo/lzotest/asm.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/lzotest/db.h b/app/lzo/lzotest/db.h
index 5bccc25d..9ce0a6ca 100644
--- a/app/lzo/lzotest/db.h
+++ b/app/lzo/lzotest/db.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/lzotest/lzotest.c b/app/lzo/lzotest/lzotest.c
index 3a9874e7..e4359d3e 100644
--- a/app/lzo/lzotest/lzotest.c
+++ b/app/lzo/lzotest/lzotest.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -52,8 +37,8 @@
#define WANT_LZO_MALLOC 1
#define WANT_LZO_FREAD 1
#define WANT_LZO_WILDARGV 1
-#define WANT_LZO_UCLOCK 1
-#define ACC_WANT_ACCLIB_GETOPT 1
+#define WANT_LZO_PCLOCK 1
+#define LZO_WANT_ACCLIB_GETOPT 1
#include "examples/portab.h"
#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP)
@@ -255,11 +240,11 @@ lzo_bool opt_read_from_stdin = 0;
/* set these to 1 to measure the speed impact of a checksum */
lzo_bool opt_compute_adler32 = 0;
lzo_bool opt_compute_crc32 = 0;
-static lzo_uint32 adler_in, adler_out;
-static lzo_uint32 crc_in, crc_out;
+static lzo_uint32_t adler_in, adler_out;
+static lzo_uint32_t crc_in, crc_out;
lzo_bool opt_execution_time = 0;
-int opt_uclock = -1;
+int opt_pclock = -1;
lzo_bool opt_clear_wrkmem = 0;
static const lzo_bool opt_try_to_compress_0_bytes = 1;
@@ -270,7 +255,7 @@ static const lzo_bool opt_try_to_compress_0_bytes = 1;
**************************************************************************/
static const char *progname = "";
-static lzo_uclock_handle_t uch;
+static lzo_pclock_handle_t pch;
/* for statistics and benchmark */
int opt_totals = 0;
@@ -353,8 +338,8 @@ static lzo_uint opt_max_data_len;
typedef struct {
lzo_bytep ptr;
lzo_uint len;
- lzo_uint32 adler;
- lzo_uint32 crc;
+ lzo_uint32_t adler;
+ lzo_uint32_t crc;
lzo_bytep alloc_ptr;
lzo_uint alloc_len;
lzo_uint saved_len;
@@ -491,8 +476,8 @@ typedef struct
{
const char * name;
int id;
- lzo_uint32 mem_compress;
- lzo_uint32 mem_decompress;
+ lzo_uint32_t mem_compress;
+ lzo_uint32_t mem_decompress;
lzo_compress_t compress;
lzo_optimize_t optimize;
lzo_decompress_t decompress;
@@ -508,14 +493,20 @@ compress_t;
#include "asm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "wrap.h"
#define M_PRIVATE LZO_PRIVATE
#define m_uint lzo_uint
-#define m_uint32 lzo_uint32
+#define m_uint32_t lzo_uint32_t
#define m_voidp lzo_voidp
#define m_bytep lzo_bytep
#define m_uintp lzo_uintp
#include "wrapmisc.h"
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
static const compress_t compress_database[] = {
#include "db.h"
@@ -628,7 +619,7 @@ lzo_bool is_compressor ( const compress_t *c )
// check that memory gets accessed within bounds
**************************************************************************/
-void memchecker_init ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
+static void memchecker_init ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
{
lzo_uint i;
lzo_uint len = (lzo_uint) l;
@@ -654,7 +645,7 @@ void memchecker_init ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
}
-int memchecker_check ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
+static int memchecker_check ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
{
lzo_uint i;
lzo_uint len = (lzo_uint) l;
@@ -705,14 +696,14 @@ int call_compressor ( const compress_t *c,
if (r == 0 && opt_compute_adler32)
{
- lzo_uint32 adler;
+ lzo_uint32_t adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, src, src_len);
adler_in = adler;
}
if (r == 0 && opt_compute_crc32)
{
- lzo_uint32 crc;
+ lzo_uint32_t crc;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, src, src_len);
crc_in = crc;
@@ -907,7 +898,7 @@ void print_stats ( const char *method_name, const char *file_name,
d_bytes = x_len * d_loops * t_loops;
t_bytes = c_bytes + d_bytes;
- if (opt_uclock == 0)
+ if (opt_pclock == 0)
c_secs = d_secs = t_secs = 0.0;
/* speed in uncompressed megabytes per second (1 megabyte = 1.000.000 bytes) */
@@ -982,11 +973,11 @@ void print_totals ( void )
unsigned long n = total_n > 0 ? total_n : 1;
const char *t1 = "-------";
const char *t2 = total_method_names == 1 ? total_method_name : "";
-#if 1 && defined(__ACCLIB_PCLOCK_CH_INCLUDED)
- char uclock_mode[32+1];
- sprintf(uclock_mode, "[clock=%d]", uch.mode);
- t1 = uclock_mode;
- if (opt_uclock == 0) t1 = t2;
+#if 1 && defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ char pclock_mode[32+1];
+ sprintf(pclock_mode, "[clock=%d]", pch.mode);
+ t1 = pclock_mode;
+ if (opt_pclock == 0) t1 = t2;
#endif
#if 1
@@ -994,15 +985,15 @@ void print_totals ( void )
printf("%-13s %-12s %10lu %4.1f %9lu %4s %8.3f %8.3f\n",
t1, "***AVG***",
total_d_len / n, total_blocks * 1.0 / n, total_c_len / n, perc_str,
- t_div(total_c_mbs_n, total_c_mbs_harmonic),
- t_div(total_d_mbs_n, total_d_mbs_harmonic));
+ t_div((double)total_c_mbs_n, total_c_mbs_harmonic),
+ t_div((double)total_d_mbs_n, total_d_mbs_harmonic));
#endif
set_perc(total_c_len, total_d_len, perc_str);
printf("%-13s %-12s %10lu %4lu %9lu %4s %s%8.3f %8.3f\n",
t2, "***TOTALS***",
total_d_len, total_blocks, total_c_len, perc_str, "",
- t_div(total_c_mbs_n, total_c_mbs_harmonic),
- t_div(total_d_mbs_n, total_d_mbs_harmonic));
+ t_div((double)total_c_mbs_n, total_c_mbs_harmonic),
+ t_div((double)total_d_mbs_n, total_d_mbs_harmonic));
}
}
@@ -1021,7 +1012,7 @@ int process_file ( const compress_t *c, lzo_decompress_t decompress,
unsigned long blocks = 0;
unsigned long compressed_len = 0;
double t_time = 0, c_time = 0, d_time = 0;
- lzo_uclock_t t_start, t_stop, x_start, x_stop;
+ lzo_pclock_t t_start, t_stop, x_start, x_stop;
FILE *fp_dump = NULL;
if (opt_dump_compressed_data)
@@ -1029,8 +1020,8 @@ int process_file ( const compress_t *c, lzo_decompress_t decompress,
/* process the file */
- lzo_uclock_flush_cpu_cache(&uch, 0);
- lzo_uclock_read(&uch, &t_start);
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &t_start);
for (t_i = 0; t_i < t_loops; t_i++)
{
lzo_uint len, c_len, c_len_max, d_len = 0;
@@ -1071,8 +1062,8 @@ int process_file ( const compress_t *c, lzo_decompress_t decompress,
/* compress the block */
c_len = c_len_max = 0;
- lzo_uclock_flush_cpu_cache(&uch, 0);
- lzo_uclock_read(&uch, &x_start);
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &x_start);
for (r = 0, c_i = 0; c_i < c_loops; c_i++)
{
c_len = block_c.len;
@@ -1084,8 +1075,8 @@ int process_file ( const compress_t *c, lzo_decompress_t decompress,
if (c_len > block_c.len)
goto compress_overrun;
}
- lzo_uclock_read(&uch, &x_stop);
- c_time += lzo_uclock_get_elapsed(&uch, &x_start, &x_stop);
+ lzo_pclock_read(&pch, &x_stop);
+ c_time += lzo_pclock_get_elapsed(&pch, &x_start, &x_stop);
if (r != 0)
{
printf(" compression failed in block %lu (%d) (%lu %lu)\n",
@@ -1134,8 +1125,8 @@ compress_overrun:
}
/* decompress the block and verify */
- lzo_uclock_flush_cpu_cache(&uch, 0);
- lzo_uclock_read(&uch, &x_start);
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &x_start);
for (r = 0, c_i = 0; c_i < d_loops; c_i++)
{
d_len = bl;
@@ -1143,8 +1134,8 @@ compress_overrun:
if (r != 0 || d_len != bl)
break;
}
- lzo_uclock_read(&uch, &x_stop);
- d_time += lzo_uclock_get_elapsed(&uch, &x_start, &x_stop);
+ lzo_pclock_read(&pch, &x_stop);
+ d_time += lzo_pclock_get_elapsed(&pch, &x_start, &x_stop);
if (r != 0)
{
printf(" decompression failed in block %lu (%d) "
@@ -1217,8 +1208,8 @@ compress_overrun:
}
while (len > 0);
}
- lzo_uclock_read(&uch, &t_stop);
- t_time += lzo_uclock_get_elapsed(&uch, &t_start, &t_stop);
+ lzo_pclock_read(&pch, &t_stop);
+ t_time += lzo_pclock_get_elapsed(&pch, &t_start, &t_stop);
if (fp_dump) {
(void) fclose(fp_dump); fp_dump = NULL;
@@ -1242,12 +1233,12 @@ compress_overrun:
static
int do_file ( int method, const char *file_name,
long c_loops, long d_loops,
- lzo_uint32p p_adler, lzo_uint32p p_crc )
+ lzo_uint32_tp p_adler, lzo_uint32_tp p_crc )
{
int r;
const compress_t *c;
lzo_decompress_t decompress;
- lzo_uint32 adler, crc;
+ lzo_uint32_t adler, crc;
char method_name[256+1];
const char *n;
const long t_loops = 1;
@@ -1312,8 +1303,8 @@ struct corpus_entry_t
{
const char *name;
long loops;
- lzo_uint32 adler;
- lzo_uint32 crc;
+ lzo_uint32_t adler;
+ lzo_uint32_t crc;
};
const struct corpus_entry_t *opt_corpus = NULL;
@@ -1375,7 +1366,7 @@ int do_corpus ( const struct corpus_entry_t *corpus, int method, const char *pat
for (i = 0; corpus[i].name != NULL; i++)
{
- lzo_uint32 adler, crc;
+ lzo_uint32_t adler, crc;
long c = c_loops * corpus[i].loops;
long d = d_loops * corpus[i].loops;
int r;
@@ -1436,11 +1427,11 @@ void usage ( const char *name, int exit_code, lzo_bool show_methods )
if (show_methods)
{
-#if defined(__ACCLIB_PCLOCK_CH_INCLUDED)
- lzo_uclock_t t_dummy;
- lzo_uclock_read(&uch, &t_dummy);
- (void) lzo_uclock_get_elapsed(&uch, &t_dummy, &t_dummy);
- fprintf(fp,"\nAll timings are recorded using uclock mode %d %s.\n", uch.mode, uch.name);
+#if defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ lzo_pclock_t t_dummy;
+ lzo_pclock_read(&pch, &t_dummy);
+ (void) lzo_pclock_get_elapsed(&pch, &t_dummy, &t_dummy);
+ fprintf(fp,"\nAll timings are recorded using pclock mode %d %s.\n", pch.mode, pch.name);
#endif
fprintf(fp,"\n\n");
fprintf(fp,"The following compression methods are available:\n");
@@ -1692,11 +1683,11 @@ enum {
OPT_MAX_DATA_LEN,
OPT_MAX_DICT_LEN,
OPT_SILESIA_CORPUS,
- OPT_UCLOCK,
+ OPT_PCLOCK,
OPT_UNUSED
};
-static const struct acc_getopt_longopt_t longopts[] =
+static const struct lzo_getopt_longopt_t longopts[] =
{
/* { name has_arg *flag val } */
{"help", 0, 0, 'h'+256}, /* give help */
@@ -1708,7 +1699,7 @@ static const struct acc_getopt_longopt_t longopts[] =
{"adler32", 0, 0, OPT_ADLER32},
{"calgary-corpus", 1, 0, OPT_CALGARY_CORPUS},
{"clear-wrkmem", 0, 0, OPT_CLEAR_WRKMEM},
- {"clock", 1, 0, OPT_UCLOCK},
+ {"clock", 1, 0, OPT_PCLOCK},
{"corpus", 1, 0, OPT_CALGARY_CORPUS},
{"crc32", 0, 0, OPT_CRC32},
{"dict", 1, 0, OPT_DICT},
@@ -1717,7 +1708,7 @@ static const struct acc_getopt_longopt_t longopts[] =
{"max-data-length", 1, 0, OPT_MAX_DATA_LEN},
{"max-dict-length", 1, 0, OPT_MAX_DICT_LEN},
{"silesia-corpus", 1, 0, OPT_SILESIA_CORPUS},
- {"uclock", 1, 0, OPT_UCLOCK},
+ {"uclock", 1, 0, OPT_PCLOCK},
{"methods", 1, 0, 'm'},
{"totals", 0, 0, 'T'},
@@ -1725,7 +1716,7 @@ static const struct acc_getopt_longopt_t longopts[] =
};
-static int do_option(acc_getopt_p g, int optc)
+static int do_option(lzo_getopt_p g, int optc)
{
#define mfx_optarg g->optarg
switch (optc)
@@ -1855,13 +1846,13 @@ static int do_option(acc_getopt_p g, int optc)
return optc;
opt_max_dict_len = atol(mfx_optarg);
break;
- case OPT_UCLOCK:
+ case OPT_PCLOCK:
if (!mfx_optarg || !is_digit(mfx_optarg[0]))
return optc;
- opt_uclock = atoi(mfx_optarg);
-#if defined(__ACCLIB_PCLOCK_CH_INCLUDED)
- if (opt_uclock > 0)
- uch.mode = opt_uclock;
+ opt_pclock = atoi(mfx_optarg);
+#if defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ if (opt_pclock > 0)
+ pch.mode = opt_pclock;
#endif
break;
@@ -1878,7 +1869,7 @@ static int do_option(acc_getopt_p g, int optc)
}
-static void handle_opterr(acc_getopt_p g, const char *f, void *v)
+static void handle_opterr(lzo_getopt_p g, const char *f, void *v)
{
struct A { va_list ap; };
struct A *a = (struct A *) v;
@@ -1893,15 +1884,15 @@ static void handle_opterr(acc_getopt_p g, const char *f, void *v)
static int get_options(int argc, char **argv)
{
- acc_getopt_t mfx_getopt;
+ lzo_getopt_t mfx_getopt;
int optc;
static const char shortopts[] =
"Ab::c:C:d:D:FhHLm::n:OqQs:STvV@123456789";
- acc_getopt_init(&mfx_getopt, 1, argc, argv);
+ lzo_getopt_init(&mfx_getopt, 1, argc, argv);
mfx_getopt.progname = progname;
mfx_getopt.opterr = handle_opterr;
- while ((optc = acc_getopt(&mfx_getopt, shortopts, longopts, NULL)) >= 0)
+ while ((optc = lzo_getopt(&mfx_getopt, shortopts, longopts, NULL)) >= 0)
{
if (do_option(&mfx_getopt, optc) != 0)
exit(EXIT_USAGE);
@@ -1924,7 +1915,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
const char *s;
lzo_wildargv(&argc, &argv);
- lzo_uclock_open(&uch);
+ lzo_pclock_open_default(&pch);
progname = argv[0];
for (s = progname; *s; s++)
@@ -1934,11 +1925,11 @@ int __lzo_cdecl_main main(int argc, char *argv[])
#if defined(__LZO_PROFESSIONAL__)
printf("\nLZO Professional real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
#else
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
#endif
@@ -1961,17 +1952,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
opt_max_data_len = 64 * 1024L * 1024L;
opt_block_size = 256 * 1024L;
-#if defined(LZO_ARCH_I086) && defined(ACC_MM_AHSHIFT)
-# if 1 && defined(LZO_ARCH_I086PM) && defined(BLX286)
- opt_max_data_len = 32 * 1024L * 1024L;
-# else
- opt_max_data_len = 14 * 1024L * 1024L;
-# endif
- /* reduce memory requirements for ancient 16-bit DOS 640kB real-mode */
- if (ACC_MM_AHSHIFT != 3) {
- opt_max_data_len = 16 * 1024L;
- }
-#elif defined(LZO_OS_TOS)
+#if (LZO_ARCH_M68K && LZO_OS_TOS)
/* reduce memory requirements for 14 MB machines */
opt_max_data_len = 8 * 1024L * 1024L;
#endif
@@ -2103,7 +2084,7 @@ int __lzo_cdecl_main main(int argc, char *argv[])
if (r != EXIT_OK)
printf("\n%s: exit code: %d\n", progname, r);
- lzo_uclock_close(&uch);
+ lzo_pclock_close(&pch);
return r;
}
diff --git a/app/lzo/lzotest/wrap.h b/app/lzo/lzotest/wrap.h
index bd627df6..e85cd939 100644
--- a/app/lzo/lzotest/wrap.h
+++ b/app/lzo/lzotest/wrap.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -251,7 +236,7 @@ adler32_x_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
- lzo_uint32 adler;
+ lzo_uint32_t adler;
adler = lzo_adler32(0, NULL, 0);
adler = lzo_adler32(adler, dst, src_len);
*dst_len = src_len;
@@ -266,7 +251,7 @@ crc32_x_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem )
{
- lzo_uint32 crc;
+ lzo_uint32_t crc;
crc = lzo_crc32(0, NULL, 0);
crc = lzo_crc32(crc, dst, src_len);
*dst_len = src_len;
diff --git a/app/lzo/lzotest/wrapmisc.h b/app/lzo/lzotest/wrapmisc.h
index 559ffac3..dfcb9187 100644
--- a/app/lzo/lzotest/wrapmisc.h
+++ b/app/lzo/lzotest/wrapmisc.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/minilzo/Makefile.minilzo b/app/lzo/minilzo/Makefile.minilzo
index 9da6d596..e511e74e 100644
--- a/app/lzo/minilzo/Makefile.minilzo
+++ b/app/lzo/minilzo/Makefile.minilzo
@@ -1,25 +1,27 @@
#
# a very simple Makefile for miniLZO
#
-# Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+# Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
#
PROGRAM = testmini
SOURCES = testmini.c minilzo.c
default:
- @echo "Please choose one of the following targets:"
+ @echo ""
+ @echo "Welcome to miniLZO. Please choose one of the following 'make' targets:"
+ @echo ""
@echo " gcc: gcc"
@echo " unix: hpux hpux9"
@echo " win32: win32-bc win32-cygwin win32-dm win32-lccwin32"
@echo " win32-intelc win32-mingw win32-vc win32-watcomc"
- @echo " dos16: dos16-bc dos16-mc dos16-wc"
@echo " dos32: dos32-djgpp2 dos32-wc"
+ @echo ""
# Make sure that minilzo.h, lzoconf.h and lzodefs.h are in the
# current dircectory. Otherwise you may want to adjust CPPFLAGS.
-##CPPFLAGS = -I../include/lzo -I.
+CPPFLAGS = -I. -I../include/lzo
GCC_CFLAGS = -s -Wall -O2 -fomit-frame-pointer
@@ -60,7 +62,7 @@ win32-digitalmars win32-dm:
dmc -mn -o -w- $(CPPFLAGS) $(SOURCES)
win32-intelc win32-ic:
- icl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
+ icl -nologo -MT -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
win32-lccwin32:
@echo "NOTE: need lcc 2002-07-25 or newer, older versions have bugs"
@@ -70,27 +72,13 @@ win32-mingw32 win32-mingw:
gcc -mno-cygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES)
win32-visualc win32-vc:
- cl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
+ cl -nologo -MT -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
win32-watcomc win32-wc:
wcl386 -bt=nt -zq -mf -5r -zc -w5 -oneatx $(CPPFLAGS) $(SOURCES)
#
-# DOS (16-bit)
-#
-
-dos16-borlandc dos16-bc:
- bcc -ml -w -d -O -4 $(CPPFLAGS) $(SOURCES)
-
-dos16-microsoftc dos16-msc dos16-mc:
- cl -nologo -f- -AL -O -G2 -W3 $(CPPFLAGS) $(SOURCES)
-
-dos16-watcomc dos16-wc:
- wcl -zq -ml -bt=dos -l=dos -ox -w5 $(CPPFLAGS) $(SOURCES)
-
-
-#
# DOS (32-bit)
#
@@ -110,4 +98,3 @@ clean:
rm -f *.err *.o *.obj
.PHONY: default clean
-
diff --git a/app/lzo/minilzo/README.LZO b/app/lzo/minilzo/README.LZO
index 058eace7..9a8fbb40 100644
--- a/app/lzo/minilzo/README.LZO
+++ b/app/lzo/minilzo/README.LZO
@@ -6,8 +6,8 @@
Author : Markus Franz Xaver Johannes Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
- Version : 2.06
- Date : 12 Aug 2011
+ Version : 2.07
+ Date : 25 Jun 2014
I've created miniLZO for projects where it is inconvenient to
include (or require) the full LZO source code just because you
@@ -110,9 +110,8 @@
Appendix D: Copyright
---------------------
- LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Markus Franz Xaver Oberhumer <markus@oberhumer.com>.
+ LZO and miniLZO are Copyright (C) 1996-2014 Markus Franz Xaver Oberhumer
+ All Rights Reserved.
LZO and miniLZO are distributed under the terms of the GNU General
Public License (GPL). See the file COPYING.
diff --git a/app/lzo/minilzo/minilzo.c b/app/lzo/minilzo/minilzo.c
index 34ce0f09..26513174 100644
--- a/app/lzo/minilzo/minilzo.c
+++ b/app/lzo/minilzo/minilzo.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -67,12 +52,6 @@
#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
@@ -81,19 +60,30 @@
# define __LONG_MAX__ 9223372036854775807L
# endif
#endif
-#if defined(__INTEL_COMPILER) && defined(__linux__)
+#if !defined(LZO_CFG_NO_DISABLE_WUNDEF)
+#if defined(__ARMCC_VERSION)
+# pragma diag_suppress 193
+#elif defined(__clang__) && defined(__clang_minor__)
+# pragma clang diagnostic ignored "-Wundef"
+#elif defined(__INTEL_COMPILER)
# pragma warning(disable: 193)
-#endif
-#if defined(__KEIL__) && defined(__C166__)
-# pragma warning disable = 322
-#elif 0 && defined(__C251__)
+#elif defined(__KEIL__) && defined(__C166__)
# pragma warning disable = 322
-#endif
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
-# if (_MSC_VER >= 1300)
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__)
+# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2))
+# pragma GCC diagnostic ignored "-Wundef"
+# endif
+#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if ((_MSC_VER-0) >= 1300)
# pragma warning(disable: 4668)
# endif
#endif
+#endif
+#if 0 && defined(__POCC__) && defined(_WIN32)
+# if (__POCC__ >= 400)
+# pragma warn(disable: 2216)
+# endif
+#endif
#if 0 && defined(__WATCOMC__)
# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
# pragma warning 203 9
@@ -102,13 +92,29 @@
#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
# pragma option -h
#endif
+#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC)
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS 1
+#endif
+#endif
#if 0
-#define LZO_0xffffL 0xfffful
-#define LZO_0xffffffffL 0xfffffffful
+#define LZO_0xffffUL 0xfffful
+#define LZO_0xffffffffUL 0xfffffffful
#else
-#define LZO_0xffffL 65535ul
-#define LZO_0xffffffffL 4294967295ul
+#define LZO_0xffffUL 65535ul
+#define LZO_0xffffffffUL 4294967295ul
#endif
+#define LZO_0xffffL LZO_0xffffUL
+#define LZO_0xffffffffL LZO_0xffffffffUL
#if (LZO_0xffffL == LZO_0xffffffffL)
# error "your preprocessor is broken 1"
#endif
@@ -123,6 +129,13 @@
# error "your preprocessor is broken 4"
#endif
#endif
+#if defined(__COUNTER__)
+# ifndef LZO_CFG_USE_COUNTER
+# define LZO_CFG_USE_COUNTER 1
+# endif
+#else
+# undef LZO_CFG_USE_COUNTER
+#endif
#if (UINT_MAX == LZO_0xffffL)
#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
# if !defined(MSDOS)
@@ -253,14 +266,31 @@
#endif
#define LZO_PP_STRINGIZE(x) #x
#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT0() /*empty*/
+#define LZO_PP_CONCAT1(a) a
#define LZO_PP_CONCAT2(a,b) a ## b
#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0()
+#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a)
#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f)
+#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g)
+#define LZO_PP_EMPTY /*empty*/
+#define LZO_PP_EMPTY0() /*empty*/
+#define LZO_PP_EMPTY1(a) /*empty*/
+#define LZO_PP_EMPTY2(a,b) /*empty*/
+#define LZO_PP_EMPTY3(a,b,c) /*empty*/
+#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/
+#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/
+#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/
+#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/
#if 1
#define LZO_CPP_STRINGIZE(x) #x
#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
@@ -268,12 +298,16 @@
#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_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
#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_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f)
+#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g)
#endif
-#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
#if 1 && defined(__cplusplus)
# if !defined(__STDC_CONSTANT_MACROS)
# define __STDC_CONSTANT_MACROS 1
@@ -283,9 +317,13 @@
# endif
#endif
#if defined(__cplusplus)
-# define LZO_EXTERN_C extern "C"
+# define LZO_EXTERN_C extern "C"
+# define LZO_EXTERN_C_BEGIN extern "C" {
+# define LZO_EXTERN_C_END }
#else
-# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C_BEGIN /*empty*/
+# define LZO_EXTERN_C_END /*empty*/
#endif
#if !defined(__LZO_OS_OVERRIDE)
#if (LZO_OS_FREESTANDING)
@@ -386,12 +424,12 @@
#elif defined(__VMS)
# define LZO_OS_VMS 1
# define LZO_INFO_OS "vms"
-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+#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__))
+#elif defined(__mips__) && defined(__psp__)
# define LZO_OS_CONSOLE 1
# define LZO_OS_CONSOLE_PSP 1
# define LZO_INFO_OS "console"
@@ -419,9 +457,18 @@
# elif defined(__linux__) || 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(__APPLE__) && defined(__MACH__)
+# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000)
+# define LZO_OS_POSIX_DARWIN 1040
+# define LZO_INFO_OS_POSIX "darwin_iphone"
+# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040)
+# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# define LZO_INFO_OS_POSIX "darwin"
+# else
+# define LZO_OS_POSIX_DARWIN 1
+# define LZO_INFO_OS_POSIX "darwin"
+# endif
+# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN
# elif defined(__minix__) || defined(__minix)
# define LZO_OS_POSIX_MINIX 1
# define LZO_INFO_OS_POSIX "minix"
@@ -456,18 +503,18 @@
#endif
#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
# if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# 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"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
@@ -483,59 +530,65 @@
# define LZO_INFO_CC "sdcc"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC)
#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
-# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0))
# define LZO_INFO_CC "Pathscale C"
# define LZO_INFO_CCVER __PATHSCALE__
-#elif defined(__INTEL_COMPILER)
-# define LZO_CC_INTELC 1
+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0)
+# define LZO_CC_INTELC __INTEL_COMPILER
# define LZO_INFO_CC "Intel C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
-# if defined(_WIN32) || defined(_WIN64)
-# define LZO_CC_SYNTAX_MSC 1
-# else
-# define LZO_CC_SYNTAX_GNUC 1
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_INTELC_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# endif
#elif defined(__POCC__) && defined(_WIN32)
# define LZO_CC_PELLESC 1
# define LZO_INFO_CC "Pelles C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# else
-# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
# endif
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
-# define LZO_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
+# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
# else
-# define LZO_CC_CLANG_CLANG 0x010000L
+# define LZO_CC_CLANG 0x010000L
+# endif
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_CLANG_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# endif
-# define LZO_CC_CLANG LZO_CC_CLANG_GNUC
# define LZO_INFO_CC "clang"
# define LZO_INFO_CCVER __VERSION__
#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
# if defined(__GNUC_PATCHLEVEL__)
-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
# else
-# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
# endif
# define LZO_CC_LLVM LZO_CC_LLVM_GNUC
# 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(__ACK__) && defined(_ACK)
# define LZO_CC_ACK 1
# define LZO_INFO_CC "Amsterdam Compiler Kit C"
# define LZO_INFO_CCVER "unknown"
+#elif defined(__ARMCC_VERSION) && !defined(__GNUC__)
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION)
#elif defined(__AZTEC_C__)
# define LZO_CC_AZTECC 1
# define LZO_INFO_CC "Aztec C"
@@ -560,10 +613,23 @@
# define LZO_CC_DECC 1
# define LZO_INFO_CC "DEC C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0)
+# define LZO_CC_GHS 1
+# define LZO_INFO_CC "Green Hills C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_GHS_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
#elif defined(__HIGHC__)
# define LZO_CC_HIGHC 1
# define LZO_INFO_CC "MetaWare High C"
# define LZO_INFO_CCVER "unknown"
+#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0)
+# define LZO_CC_HPACC __HP_aCC
+# define LZO_INFO_CC "HP aCC"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC)
#elif defined(__IAR_SYSTEMS_ICC__)
# define LZO_CC_IARC 1
# define LZO_INFO_CC "IAR C"
@@ -572,10 +638,14 @@
# else
# define LZO_INFO_CCVER "unknown"
# endif
-#elif defined(__IBMC__)
-# define LZO_CC_IBMC 1
+#elif defined(__IBMC__) && ((__IBMC__-0) > 0)
+# define LZO_CC_IBMC __IBMC__
# define LZO_INFO_CC "IBM C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0)
+# define LZO_CC_IBMC __IBMCPP__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__)
#elif defined(__KEIL__) && defined(__C166__)
# define LZO_CC_KEILC 1
# define LZO_INFO_CC "Keil C"
@@ -592,16 +662,8 @@
# 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_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
-# else
-# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
-# endif
-#elif defined(__MWERKS__)
-# define LZO_CC_MWERKS 1
+#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0)
+# define LZO_CC_MWERKS __MWERKS__
# define LZO_INFO_CC "Metrowerks C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__)
#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
@@ -612,6 +674,15 @@
# define LZO_CC_PACIFICC 1
# define LZO_INFO_CC "Pacific C"
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0))
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__)
+# else
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0"
+# endif
+# define LZO_INFO_CC "Portland Group PGI C"
#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
# define LZO_CC_PGI 1
# define LZO_INFO_CC "Portland Group PGI C"
@@ -626,7 +697,7 @@
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
#elif defined(__SUNPRO_C)
# define LZO_INFO_CC "SunPro C"
-# if ((__SUNPRO_C)+0 > 0)
+# if ((__SUNPRO_C-0) > 0)
# define LZO_CC_SUNPROC __SUNPRO_C
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
# else
@@ -635,7 +706,7 @@
# endif
#elif defined(__SUNPRO_CC)
# define LZO_INFO_CC "SunPro C"
-# if ((__SUNPRO_CC)+0 > 0)
+# if ((__SUNPRO_CC-0) > 0)
# define LZO_CC_SUNPROC __SUNPRO_CC
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
# else
@@ -661,16 +732,46 @@
#elif defined(__ZTC__)
# define LZO_CC_ZORTECHC 1
# define LZO_INFO_CC "Zortech C"
-# if (__ZTC__ == 0x310)
+# if ((__ZTC__-0) == 0x310)
# define LZO_INFO_CCVER "0x310"
# else
# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
# endif
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_MSC _MSC_VER
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
#else
# define LZO_CC_UNKNOWN 1
# define LZO_INFO_CC "unknown"
# define LZO_INFO_CCVER "unknown"
#endif
+#if (LZO_CC_GNUC) && defined(__OPEN64__)
+# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__)
+# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0))
+# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC
+# endif
+#endif
+#if (LZO_CC_GNUC) && defined(__PCC__)
+# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__)
+# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0))
+# define LZO_CC_PCC_GNUC LZO_CC_GNUC
+# endif
+#endif
#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
#endif
@@ -688,8 +789,10 @@
# 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(__aarch64__)
+# define LZO_ARCH_ARM64 1
+# define LZO_INFO_ARCH "arm64"
#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
# define LZO_ARCH_ALPHA 1
# define LZO_INFO_ARCH "alpha"
@@ -705,10 +808,10 @@
# define LZO_INFO_ARCH "arm_thumb"
#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
# define LZO_ARCH_ARM 1
-# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
+# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1)
# define LZO_ARCH_ARM_THUMB 1
# define LZO_INFO_ARCH "arm_thumb"
-# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2)
# define LZO_INFO_ARCH "arm"
# else
# define LZO_INFO_ARCH "arm"
@@ -826,53 +929,147 @@
# error "FIXME - missing define for CPU architecture"
#endif
#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
-# error "FIXME - missing WIN32 define for CPU architecture"
+# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture"
#endif
#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
-# error "FIXME - missing WIN64 define for CPU architecture"
+# error "FIXME - missing LZO_OS_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 (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM)
-# error "this should not happen"
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64)
+# define LZO_ARCH_X64 1
+#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_AMD64 1
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64)
+# define LZO_ARCH_AARCH64 1
+#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_ARM64 1
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86)
+# define LZO_ARCH_X86 1
+#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_I386 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM)
+# error "unexpected configuration - check your compiler defines"
#endif
-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086)
-# error "this should not happen"
+#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086PM && !LZO_ARCH_I086)
+# error "unexpected configuration - check your compiler defines"
#endif
#if (LZO_ARCH_I086)
# if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#if (LZO_ARCH_I386)
# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
# if (ULONG_MAX != LZO_0xffffffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if !defined(LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSE2__)
+# define LZO_TARGET_FEATURE_SSE2 1
+# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64))
+# define LZO_TARGET_FEATURE_SSE2 1
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSSE3)
+# if (LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSSE3__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# elif defined(_MSC_VER) && defined(__AVX__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSE4_2)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__SSE4_2__)
+# define LZO_TARGET_FEATURE_SSE4_2 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__AVX__)
+# define LZO_TARGET_FEATURE_AVX 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX2)
+# if (LZO_TARGET_FEATURE_AVX)
+# if defined(__AVX2__)
+# define LZO_TARGET_FEATURE_AVX2 1
+# endif
+# endif
+# endif
+#endif
+#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if defined(__ARM_NEON__)
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if 1
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
# endif
#endif
-#if !defined(__LZO_MM_OVERRIDE)
+#if 0
+#elif !defined(__LZO_MM_OVERRIDE)
#if (LZO_ARCH_I086)
#if (UINT_MAX != LZO_0xffffL)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
#endif
#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
# define LZO_MM_TINY 1
@@ -899,7 +1096,7 @@
#elif (LZO_CC_ZORTECHC && defined(__VCM__))
# define LZO_MM_LARGE 1
#else
-# error "unknown memory model"
+# error "unknown LZO_ARCH_I086 memory model"
#endif
#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
#define LZO_HAVE_MM_HUGE_PTR 1
@@ -922,10 +1119,10 @@
#endif
#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR)
# if (LZO_OS_DOS16)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# elif (LZO_CC_ZORTECHC)
# else
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
# endif
#endif
#ifdef __cplusplus
@@ -957,7 +1154,7 @@ extern "C" {
#endif
#elif (LZO_ARCH_C166)
#if !defined(__MODEL__)
-# error "FIXME - C166 __MODEL__"
+# error "FIXME - LZO_ARCH_C166 __MODEL__"
#elif ((__MODEL__) == 0)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 1)
@@ -971,11 +1168,11 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - C166 __MODEL__"
+# error "FIXME - LZO_ARCH_C166 __MODEL__"
#endif
#elif (LZO_ARCH_MCS251)
#if !defined(__MODEL__)
-# error "FIXME - MCS251 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS251 __MODEL__"
#elif ((__MODEL__) == 0)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 2)
@@ -987,11 +1184,11 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - MCS251 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS251 __MODEL__"
#endif
#elif (LZO_ARCH_MCS51)
#if !defined(__MODEL__)
-# error "FIXME - MCS51 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS51 __MODEL__"
#elif ((__MODEL__) == 1)
# define LZO_MM_SMALL 1
#elif ((__MODEL__) == 2)
@@ -1003,7 +1200,7 @@ extern "C" {
#elif ((__MODEL__) == 5)
# define LZO_MM_XSMALL 1
#else
-# error "FIXME - MCS51 __MODEL__"
+# error "FIXME - LZO_ARCH_MCS51 __MODEL__"
#endif
#elif (LZO_ARCH_CRAY_PVP)
# define LZO_MM_PVP 1
@@ -1030,35 +1227,818 @@ extern "C" {
# error "unknown memory model"
#endif
#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_gnuc_extension__ __extension__
+#else
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+# define __lzo_gnuc_extension__ /*empty*/
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# else
+# define LZO_CFG_USE_NEW_STYLE_CASTS 1
+# endif
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(__cplusplus)
+# if defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# undef LZO_CFG_USE_NEW_STYLE_CASTS
+# endif
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# define LZO_REINTERPRET_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_STATIC_CAST(t,e) (static_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_STATIC_CAST)
+# define LZO_STATIC_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST2)
+# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e))
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e))))
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_PCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_PCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_PCAST)
+# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e))
+#endif
+#if !defined(LZO_CCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_CCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_CCAST)
+# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e))
+#endif
+#if !defined(LZO_ICONV)
+# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ICAST)
+# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ITRUNC)
+# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(__lzo_cte)
+# if (LZO_CC_MSC || LZO_CC_WATCOMC)
+# define __lzo_cte(e) ((void)0,(e))
+# elif 1
+# define __lzo_cte(e) ((void)0,(e))
+# endif
+#endif
+#if !defined(__lzo_cte)
+# define __lzo_cte(e) (e)
+#endif
+#if !defined(LZO_BLOCK_BEGIN)
+# define LZO_BLOCK_BEGIN do {
+# define LZO_BLOCK_END } while __lzo_cte(0)
+#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_CLANG && (LZO_CC_CLANG >= 0x030200ul))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_CLANG || 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) {LZO_EXTERN_C 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_CLANG || 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) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_CLANG >= 0x020800ul)
+# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l)))
+# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || 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_GHS)
+# define __lzo_inline __inline__
+#elif (LZO_CC_IBMC >= 600)
+# 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 (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_inline __inline__
+#endif
+#endif
+#if defined(__lzo_inline)
+# ifndef __lzo_HAVE_inline
+# define __lzo_HAVE_inline 1
+# endif
+#else
+# define __lzo_inline /*empty*/
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# ifndef __lzo_HAVE_forceinline
+# define __lzo_HAVE_forceinline 1
+# endif
+#else
+# define __lzo_forceinline __lzo_inline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || 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
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_noinline __attribute__((__noinline__))
+#endif
+#endif
+#if defined(__lzo_noinline)
+# ifndef __lzo_HAVE_noinline
+# define __lzo_HAVE_noinline 1
+# endif
+#else
+# define __lzo_noinline /*empty*/
+#endif
+#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_static_inline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline
+#endif
+#endif
+#if !defined(__lzo_static_inline)
+# define __lzo_static_inline static __lzo_inline
+#endif
+#if !defined(__lzo_static_forceinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline
+#endif
+#endif
+#if !defined(__lzo_static_forceinline)
+# define __lzo_static_forceinline static __lzo_forceinline
+#endif
+#if !defined(__lzo_static_noinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline
+#endif
+#endif
+#if !defined(__lzo_static_noinline)
+# define __lzo_static_noinline static __lzo_noinline
+#endif
+#if !defined(__lzo_c99_extern_inline)
+#if defined(__GNUC_GNU_INLINE__)
+# define __lzo_c99_extern_inline __lzo_inline
+#elif defined(__GNUC_STDC_INLINE__)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#endif
+#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline)
+# define __lzo_c99_extern_inline __lzo_inline
+#endif
+#endif
+#if defined(__lzo_c99_extern_inline)
+# ifndef __lzo_HAVE_c99_extern_inline
+# define __lzo_HAVE_c99_extern_inline 1
+# endif
+#else
+# define __lzo_c99_extern_inline /*empty*/
+#endif
+#if !defined(__lzo_may_alias)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_CLANG >= 0x020900ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#endif
+#endif
+#if defined(__lzo_may_alias)
+# ifndef __lzo_HAVE_may_alias
+# define __lzo_HAVE_may_alias 1
+# endif
+#else
+# define __lzo_may_alias /*empty*/
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# ifndef __lzo_HAVE_noreturn
+# define __lzo_HAVE_noreturn 1
+# endif
+#else
+# define __lzo_noreturn /*empty*/
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900))
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# ifndef __lzo_HAVE_nothrow
+# define __lzo_HAVE_nothrow 1
+# endif
+#else
+# define __lzo_nothrow /*empty*/
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 1210)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_restrict __restrict__
+#endif
+#endif
+#if defined(__lzo_restrict)
+# ifndef __lzo_HAVE_restrict
+# define __lzo_HAVE_restrict 1
+# endif
+#else
+# define __lzo_restrict /*empty*/
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_GHS) && !defined(__cplusplus)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_alignof(e) (__lzo_gnuc_extension__ __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)
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_alignof(e) __alignof__(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# ifndef __lzo_HAVE_alignof
+# define __lzo_HAVE_alignof 1
+# endif
+#endif
+#if !defined(__lzo_struct_packed)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__));
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s {
+# define __lzo_struct_packed_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_struct_packed(s) _Packed struct s {
+# define __lzo_struct_packed_end() };
+#endif
+#endif
+#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma)
+# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s)
+#endif
+#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end)
+# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end()
+#endif
+#if !defined(__lzo_byte_struct)
+#if defined(__lzo_struct_packed)
+# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end()
+# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end()
+#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__));
+# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__));
+#endif
+#endif
+#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma)
+# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n)
+#endif
+#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))
+#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_CILLY || LZO_CC_PCC)
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_align16(s) struct __declspec(align(16)) s {
+# define __lzo_struct_align16_end() };
+# define __lzo_struct_align32(s) struct __declspec(align(32)) s {
+# define __lzo_struct_align32_end() };
+# define __lzo_struct_align64(s) struct __declspec(align(64)) s {
+# define __lzo_struct_align64_end() };
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_struct_align16(s) struct s {
+# define __lzo_struct_align16_end() } __attribute__((__aligned__(16)));
+# define __lzo_struct_align32(s) struct s {
+# define __lzo_struct_align32_end() } __attribute__((__aligned__(32)));
+# define __lzo_struct_align64(s) struct s {
+# define __lzo_struct_align64_end() } __attribute__((__aligned__(64)));
+#endif
+#endif
+#if !defined(__lzo_union_um)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810))
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_union_am(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_union_um(s) __pragma(pack(push,1)) union s {
+# define __lzo_union_um_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_union_um(s) _Packed union s {
+# define __lzo_union_um_end() };
+#endif
+#endif
+#if !defined(__lzo_union_am)
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() };
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# ifndef __lzo_HAVE_constructor
+# define __lzo_HAVE_constructor 1
+# endif
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# ifndef __lzo_HAVE_destructor
+# define __lzo_HAVE_destructor 1
+# endif
+#endif
+#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_IBMC >= 1010)
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# ifndef __lzo_HAVE_likely
+# define __lzo_HAVE_likely 1
+# endif
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# ifndef __lzo_HAVE_unlikely
+# define __lzo_HAVE_unlikely 1
+# endif
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(__lzo_static_unused_void_func)
+# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void)
+# else
+# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void)
+# endif
+#endif
+#if !defined(__lzo_loop_forever)
+# if (LZO_CC_IBMC)
+# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END
+# else
+# define __lzo_loop_forever() do { ; } while __lzo_cte(1)
+# endif
+#endif
+#if !defined(__lzo_unreachable)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul))
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_GNUC >= 0x040500ul)
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1
+# define __lzo_unreachable() __builtin_unreachable();
+#endif
+#endif
+#if defined(__lzo_unreachable)
+# ifndef __lzo_HAVE_unreachable
+# define __lzo_HAVE_unreachable 1
+# endif
+#else
+# if 0
+# define __lzo_unreachable() ((void)0);
+# else
+# define __lzo_unreachable() __lzo_loop_forever();
+# endif
+#endif
+#ifndef __LZO_CTA_NAME
+#if (LZO_CFG_USE_COUNTER)
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__)
+#else
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__)
+#endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END
+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(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_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));}
+# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));}
+# elif (LZO_CC_GNUC >= 0x040700ul)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));}
+# 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_NAME(lzo_cta_t__)[1-2*!(e)];}
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1)
+#if defined(__cplusplus)
+extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) }
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3)
+#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 /*empty*/
+# 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_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#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 /*empty*/
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit /*empty*/
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main /*empty*/
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort /*empty*/
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler /*empty*/
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !(LZO_CFG_NO_WINDOWS_H)
+#if !defined(LZO_HAVE_WINDOWS_H)
+#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
+#endif
+#endif
+#ifndef LZO_SIZEOF_SHORT
#if defined(SIZEOF_SHORT)
# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#elif defined(__SIZEOF_SHORT__)
+# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__)
+#endif
#endif
+#ifndef LZO_SIZEOF_INT
#if defined(SIZEOF_INT)
# define LZO_SIZEOF_INT (SIZEOF_INT)
+#elif defined(__SIZEOF_INT__)
+# define LZO_SIZEOF_INT (__SIZEOF_INT__)
#endif
+#endif
+#ifndef LZO_SIZEOF_LONG
#if defined(SIZEOF_LONG)
# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#elif defined(__SIZEOF_LONG__)
+# define LZO_SIZEOF_LONG (__SIZEOF_LONG__)
+#endif
#endif
+#ifndef LZO_SIZEOF_LONG_LONG
#if defined(SIZEOF_LONG_LONG)
# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#elif defined(__SIZEOF_LONG_LONG__)
+# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__)
+#endif
#endif
+#ifndef LZO_SIZEOF___INT16
#if defined(SIZEOF___INT16)
# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
#endif
+#endif
+#ifndef LZO_SIZEOF___INT32
#if defined(SIZEOF___INT32)
# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
#endif
+#endif
+#ifndef LZO_SIZEOF___INT64
#if defined(SIZEOF___INT64)
# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
#endif
+#endif
+#ifndef LZO_SIZEOF_VOID_P
#if defined(SIZEOF_VOID_P)
# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#elif defined(__SIZEOF_POINTER__)
+# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__)
#endif
+#endif
+#ifndef LZO_SIZEOF_SIZE_T
#if defined(SIZEOF_SIZE_T)
# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#elif defined(__SIZEOF_SIZE_T__)
+# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__)
+#endif
#endif
+#ifndef LZO_SIZEOF_PTRDIFF_T
#if defined(SIZEOF_PTRDIFF_T)
# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#elif defined(__SIZEOF_PTRDIFF_T__)
+# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__)
+#endif
#endif
#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
#if !defined(LZO_SIZEOF_SHORT)
@@ -1080,6 +2060,7 @@ extern "C" {
# error "LZO_SIZEOF_SHORT"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short))
#if !defined(LZO_SIZEOF_INT)
# if (LZO_ARCH_CRAY_PVP)
# define LZO_SIZEOF_INT 8
@@ -1101,6 +2082,7 @@ extern "C" {
# error "LZO_SIZEOF_INT"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int))
#if !defined(LZO_SIZEOF_LONG)
# if (ULONG_MAX == LZO_0xffffffffL)
# define LZO_SIZEOF_LONG 4
@@ -1110,6 +2092,8 @@ extern "C" {
# define LZO_SIZEOF_LONG 2
# elif (__LZO_LSR(ULONG_MAX,31) == 1)
# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,39) == 1)
+# define LZO_SIZEOF_LONG 5
# elif (__LZO_LSR(ULONG_MAX,63) == 1)
# define LZO_SIZEOF_LONG 8
# elif (__LZO_LSR(ULONG_MAX,127) == 1)
@@ -1118,11 +2102,12 @@ extern "C" {
# error "LZO_SIZEOF_LONG"
# endif
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long))
#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)
+# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0))
# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
# define LZO_SIZEOF_LONG_LONG 4
@@ -1136,7 +2121,7 @@ extern "C" {
#if (LZO_ARCH_I086 && LZO_CC_DMC)
#elif (LZO_CC_CILLY) && defined(__GNUC__)
# define LZO_SIZEOF_LONG_LONG 8
-#elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
# define LZO_SIZEOF_LONG_LONG 8
#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
# define LZO_SIZEOF_LONG_LONG 8
@@ -1158,11 +2143,13 @@ extern "C" {
# 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))
+#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64))
# define LZO_SIZEOF___INT64 8
#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
# define LZO_SIZEOF_LONG_LONG 8
-#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+#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)
@@ -1175,87 +2162,127 @@ extern "C" {
# undef LZO_SIZEOF_LONG_LONG
# endif
#endif
-#if (LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+#if (LZO_CFG_NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(_NO_LONGLONG)
# 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
+#if !defined(LZO_WORDSIZE)
+#if (LZO_ARCH_ALPHA)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AMD64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AVR)
+# define LZO_WORDSIZE 1
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define LZO_WORDSIZE 4
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_WORDSIZE 4
# else
-# error "LZO_MM"
+# define LZO_WORDSIZE 2
# endif
-#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
-# define __LZO_WORDSIZE 1
+#elif (LZO_ARCH_I086)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_IA64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_M16C)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_SPU)
+# define LZO_WORDSIZE 4
+#elif (LZO_ARCH_Z80)
+# define LZO_WORDSIZE 1
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_WORDSIZE 8
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define LZO_WORDSIZE 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_WORDSIZE 8
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LP64__) || defined(__LP64) || defined(_LP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_ARCH_AVR)
# 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_I086)
+# 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 "invalid LZO_ARCH_I086 memory model"
+# 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_ARCH_SPU)
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_ARCH_Z80)
+# define LZO_SIZEOF_VOID_P 2
#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(__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 || defined(__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
+# if defined(__LLP64_IFC__)
+# 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 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+# endif
#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
-#elif (LZO_ARCH_SPU)
-# if 0
-# define __LZO_WORDSIZE 16
-# endif
-# define LZO_SIZEOF_VOID_P 4
-#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
+#if !defined(LZO_SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *))
#if !defined(LZO_SIZEOF_SIZE_T)
#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
# define LZO_SIZEOF_SIZE_T 2
-#else
+#endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t))
#endif
#if !defined(LZO_SIZEOF_PTRDIFF_T)
#if (LZO_ARCH_I086)
@@ -1268,11 +2295,18 @@ extern "C" {
# define LZO_SIZEOF_PTRDIFF_T 2
# endif
# else
-# error "LZO_MM"
+# error "invalid LZO_ARCH_I086 memory model"
# endif
-#else
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
+#endif
+#if !defined(LZO_WORDSIZE)
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
#endif
#if (LZO_ABI_NEUTRAL_ENDIAN)
# undef LZO_ABI_BIG_ENDIAN
@@ -1284,7 +2318,7 @@ extern "C" {
# define LZO_ABI_LITTLE_ENDIAN 1
#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
# define LZO_ABI_LITTLE_ENDIAN 1
-#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390)
+#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU)
# define LZO_ABI_BIG_ENDIAN 1
#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
# if (__LITTLE_ENDIAN__ == 1)
@@ -1300,6 +2334,19 @@ extern "C" {
# define LZO_ABI_BIG_ENDIAN 1
#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC)
+# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+# elif defined(__BIG_ENDIAN)
+# define LZO_ABI_BIG_ENDIAN 1
+# else
+# define LZO_ABI_LITTLE_ENDIAN 1
+# endif
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
+# 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__)
@@ -1307,7 +2354,7 @@ extern "C" {
#endif
#endif
#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
-# error "this should not happen"
+# error "unexpected configuration - check your compiler defines"
#endif
#if (LZO_ABI_BIG_ENDIAN)
# define LZO_INFO_ABI_ENDIAN "be"
@@ -1322,6 +2369,9 @@ extern "C" {
#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 == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_LP32 1
+# define LZO_INFO_ABI_PM "lp32"
#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"
@@ -1338,7 +2388,8 @@ extern "C" {
# define LZO_ABI_IP32L64 1
# define LZO_INFO_ABI_PM "ip32l64"
#endif
-#if !defined(__LZO_LIBC_OVERRIDE)
+#if 0
+#elif !defined(__LZO_LIBC_OVERRIDE)
#if (LZO_LIBC_NAKED)
# define LZO_INFO_LIBC "naked"
#elif (LZO_LIBC_FREESTANDING)
@@ -1349,6 +2400,9 @@ extern "C" {
# define LZO_INFO_LIBC "isoc90"
#elif (LZO_LIBC_ISOC99)
# define LZO_INFO_LIBC "isoc99"
+#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
#elif defined(__dietlibc__)
# define LZO_LIBC_DIETLIBC 1
# define LZO_INFO_LIBC "dietlibc"
@@ -1357,13 +2411,13 @@ extern "C" {
# 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__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0))
# else
# define LZO_LIBC_UCLIBC 0x00090bL
# endif
-# define LZO_INFO_LIBC "uclibc"
+# define LZO_INFO_LIBC "uc" "libc"
#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
-# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100)
# define LZO_INFO_LIBC "glibc"
#elif (LZO_CC_MWERKS) && defined(__MSL__)
# define LZO_LIBC_MSL __MSL__
@@ -1376,424 +2430,160 @@ extern "C" {
# define LZO_INFO_LIBC "default"
#endif
#endif
-#if !defined(__lzo_gnuc_extension__)
-#if (LZO_CC_GNUC >= 0x020800ul)
-# define __lzo_gnuc_extension__ __extension__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_gnuc_extension__ __extension__
-#else
-# define __lzo_gnuc_extension__ /*empty*/
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-# define __lzo_ua_volatile volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || LZO_CC_CLANG || 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)
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_alignof(e) __alignof__(e)
-#endif
-#endif
-#if defined(__lzo_alignof)
-# define __lzo_HAVE_alignof 1
-#endif
-#if !defined(__lzo_constructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_constructor __attribute__((__constructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_constructor __attribute__((__constructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_constructor __attribute__((__constructor__))
-#endif
-#endif
-#if defined(__lzo_constructor)
-# define __lzo_HAVE_constructor 1
-#endif
-#if !defined(__lzo_destructor)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_destructor __attribute__((__destructor__,__used__))
-#elif (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_destructor __attribute__((__destructor__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_destructor __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-# define __lzo_HAVE_destructor 1
-#endif
-#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
-# error "this should not happen"
-#endif
-#if !defined(__lzo_inline)
-#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_CLANG || 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 (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_inline __inline__
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define __lzo_inline inline
-#endif
+#if (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_GNUC == 0x011f00ul))
+#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_CC_GNUC)
+# define LZO_ASM_SYNTAX_GNUC 1
#endif
-#if defined(__lzo_inline)
-# define __lzo_HAVE_inline 1
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000))
+# define __LZO_ASM_CLOBBER "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
#else
-# define __lzo_inline /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-#if (LZO_CC_GNUC >= 0x030200ul)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-# define __lzo_forceinline __forceinline
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-# define __lzo_forceinline __forceinline
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+# define __LZO_ASM_CLOBBER "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC : "cc"
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
#endif
#endif
-#if defined(__lzo_forceinline)
-# define __lzo_HAVE_forceinline 1
-#else
-# define __lzo_forceinline /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
-# define __lzo_noinline __attribute__((__noinline__,__used__))
-#elif (LZO_CC_GNUC >= 0x030200ul)
-# define __lzo_noinline __attribute__((__noinline__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC)
-# define __lzo_noinline __declspec(noinline)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_noinline __attribute__((__noinline__))
-#elif (LZO_CC_CLANG || 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)
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC >= 0x5100))
-# define __lzo_noinline __attribute__((__noinline__))
-#endif
-#endif
-#if defined(__lzo_noinline)
-# define __lzo_HAVE_noinline 1
-#else
-# define __lzo_noinline /*empty*/
-#endif
-#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
-# error "this should not happen"
-#endif
-#if !defined(__lzo_noreturn)
-#if (LZO_CC_GNUC >= 0x020700ul)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC)
-# define __lzo_noreturn __declspec(noreturn)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_noreturn __attribute__((__noreturn__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-# define __lzo_noreturn __declspec(noreturn)
-#endif
-#endif
-#if defined(__lzo_noreturn)
-# define __lzo_HAVE_noreturn 1
-#else
-# define __lzo_noreturn /*empty*/
-#endif
-#if !defined(__lzo_nothrow)
-#if (LZO_CC_GNUC >= 0x030300ul)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus)
-# define __lzo_nothrow __declspec(nothrow)
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 900) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_nothrow __attribute__((__nothrow__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
-# define __lzo_nothrow __declspec(nothrow)
-#endif
-#endif
-#if defined(__lzo_nothrow)
-# define __lzo_HAVE_nothrow 1
-#else
-# define __lzo_nothrow /*empty*/
-#endif
-#if !defined(__lzo_restrict)
-#if (LZO_CC_GNUC >= 0x030400ul)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_CLANG || LZO_CC_LLVM)
-# define __lzo_restrict __restrict__
-#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
-# define __lzo_restrict __restrict
-#endif
-#endif
-#if defined(__lzo_restrict)
-# define __lzo_HAVE_restrict 1
-#else
-# define __lzo_restrict /*empty*/
-#endif
-#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
-#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_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define __lzo_likely(e) (__builtin_expect(!!(e),1))
-# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
-#endif
-#endif
-#if defined(__lzo_likely)
-# define __lzo_HAVE_likely 1
-#else
-# define __lzo_likely(e) (e)
-#endif
-#if defined(__lzo_unlikely)
-# define __lzo_HAVE_unlikely 1
-#else
-# 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_CLANG || 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)
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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_CLANG || 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)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
# 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_CLANG || 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
+#elif (LZO_ARCH_ARM)
+# if defined(__ARM_FEATURE_UNALIGNED)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
# endif
-#endif
-#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
-# if 0
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
-# elif 0 && (LZO_CC_GNUC)
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
-# else
-# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+#elif (LZO_ARCH_ARM64)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#endif
-#if !defined(LZO_UNCONST_CAST)
-# if 0 && defined(__cplusplus)
-# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
-# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((lzo_uintptr_t) ((const void *) (e))))))
-# else
-# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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)];
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
# 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)];}
+#elif (LZO_ARCH_CRIS)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# 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 /*empty*/
-# 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
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# 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
+#elif (LZO_ARCH_I386)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
# endif
-#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC)
-# define __lzo_cdecl __cdecl
-#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 /*empty*/
-#endif
-#if !defined(__lzo_cdecl_atexit)
-# define __lzo_cdecl_atexit /*empty*/
-#endif
-#if !defined(__lzo_cdecl_main)
-# define __lzo_cdecl_main /*empty*/
-#endif
-#if !defined(__lzo_cdecl_qsort)
-# define __lzo_cdecl_qsort /*empty*/
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-# define __lzo_cdecl_sighandler /*empty*/
-#endif
-#if !defined(__lzo_cdecl_va)
-# define __lzo_cdecl_va __lzo_cdecl
-#endif
-#if !(LZO_CFG_NO_WINDOWS_H)
-#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
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
# endif
-#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
+# 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
+# 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
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
# endif
#elif (LZO_ARCH_MIPS)
-# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
#elif (LZO_ARCH_POWERPC)
-# define LZO_OPT_PREFER_PREINC 1
-# define LZO_OPT_PREFER_PREDEC 1
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
# if (LZO_ABI_BIG_ENDIAN)
-# define LZO_OPT_UNALIGNED16 1
-# define LZO_OPT_UNALIGNED32 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
# 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
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
# endif
#elif (LZO_ARCH_SH)
-# define LZO_OPT_PREFER_POSTINC 1
-# define LZO_OPT_PREFER_PREDEC 1
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
#endif
#ifndef LZO_CFG_NO_INLINE_ASM
-#if (LZO_CC_LLVM)
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_INLINE_ASM 1
+#elif (LZO_CC_LLVM)
# define LZO_CFG_NO_INLINE_ASM 1
#endif
#endif
+#if (LZO_CFG_NO_INLINE_ASM)
+# undef LZO_ASM_SYNTAX_MSC
+# undef LZO_ASM_SYNTAX_GNUC
+# undef __LZO_ASM_CLOBBER
+# undef __LZO_ASM_CLOBBER_LIST_CC
+# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY
+# undef __LZO_ASM_CLOBBER_LIST_EMPTY
+#endif
#ifndef LZO_CFG_NO_UNALIGNED
#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
# define LZO_CFG_NO_UNALIGNED 1
@@ -1804,25 +2594,6 @@ extern "C" {
# undef LZO_OPT_UNALIGNED32
# undef LZO_OPT_UNALIGNED64
#endif
-#if (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_GNUC == 0x011f00ul))
-#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
-# define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || 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 ""
@@ -1866,6 +2637,381 @@ extern "C" {
#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
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(lzo_llong_t)
+#if (LZO_SIZEOF_LONG_LONG+0 > 0)
+__lzo_gnuc_extension__ typedef long long lzo_llong_t__;
+__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__;
+# define lzo_llong_t lzo_llong_t__
+# define lzo_ullong_t lzo_ullong_t__
+#endif
+#endif
+#if !defined(lzo_int16e_t)
+#if (LZO_SIZEOF_LONG == 2)
+# define lzo_int16e_t long
+# define lzo_uint16e_t unsigned long
+#elif (LZO_SIZEOF_INT == 2)
+# define lzo_int16e_t int
+# define lzo_uint16e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 2)
+# define lzo_int16e_t short int
+# define lzo_uint16e_t unsigned short int
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM)
+ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__)));
+ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__)));
+# define lzo_int16e_t lzo_int16e_hi_t__
+# define lzo_uint16e_t lzo_uint16e_hi_t__
+#elif (LZO_SIZEOF___INT16 == 2)
+# define lzo_int16e_t __int16
+# define lzo_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(lzo_int16e_t)
+# define LZO_SIZEOF_LZO_INT16E_T 2
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+#endif
+#if !defined(lzo_int32e_t)
+#if (LZO_SIZEOF_LONG == 4)
+# define lzo_int32e_t long int
+# define lzo_uint32e_t unsigned long int
+#elif (LZO_SIZEOF_INT == 4)
+# define lzo_int32e_t int
+# define lzo_uint32e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 4)
+# define lzo_int32e_t short int
+# define lzo_uint32e_t unsigned short int
+#elif (LZO_SIZEOF_LONG_LONG == 4)
+# define lzo_int32e_t lzo_llong_t
+# define lzo_uint32e_t lzo_ullong_t
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+#elif (LZO_SIZEOF___INT32 == 4)
+# define lzo_int32e_t __int32
+# define lzo_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(lzo_int32e_t)
+# define LZO_SIZEOF_LZO_INT32E_T 4
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+#endif
+#if !defined(lzo_int64e_t)
+#if (LZO_SIZEOF___INT64 == 8)
+# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define LZO_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int64e_t int
+# define lzo_uint64e_t unsigned int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG == 8)
+# define lzo_int64e_t long int
+# define lzo_uint64e_t unsigned long int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define lzo_int64e_t lzo_llong_t
+# define lzo_uint64e_t lzo_ullong_t
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0ll)
+# define LZO_UINT64_C(c) ((c) + 0ull)
+# elif 0
+# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL))
+# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL))
+# else
+# define LZO_INT64_C(c) (c##LL)
+# define LZO_UINT64_C(c) (c##ULL)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG
+#elif (LZO_SIZEOF___INT64 == 8)
+# define lzo_int64e_t __int64
+# define lzo_uint64e_t unsigned __int64
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0i64)
+# define LZO_UINT64_C(c) ((c) + 0ui64)
+# else
+# define LZO_INT64_C(c) (c##i64)
+# define LZO_UINT64_C(c) (c##ui64)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64
+#else
+#endif
+#endif
+#if defined(lzo_int64e_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+#endif
+#if !defined(lzo_int32l_t)
+#if defined(lzo_int32e_t)
+# define lzo_int32l_t lzo_int32e_t
+# define lzo_uint32l_t lzo_uint32e_t
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T
+#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int32l_t int
+# define lzo_uint32l_t unsigned int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= 4)
+# define lzo_int32l_t long int
+# define lzo_uint32l_t unsigned long int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG
+#else
+# error "lzo_int32l_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+#endif
+#if !defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+# define lzo_int64l_t lzo_int64e_t
+# define lzo_uint64l_t lzo_uint64e_t
+# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T
+#else
+#endif
+#endif
+#if defined(lzo_int64l_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+#endif
+#if !defined(lzo_int32f_t)
+#if (LZO_SIZEOF_SIZE_T >= 8)
+# define lzo_int32f_t lzo_int64l_t
+# define lzo_uint32f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# define lzo_int32f_t lzo_int32l_t
+# define lzo_uint32f_t lzo_uint32l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+#endif
+#if !defined(lzo_int64f_t)
+#if defined(lzo_int64l_t)
+# define lzo_int64f_t lzo_int64l_t
+# define lzo_uint64f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+#endif
+#endif
+#if defined(lzo_int64f_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+#endif
+#if !defined(lzo_intptr_t)
+#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16))
+# define __LZO_INTPTR_T_IS_POINTER 1
+ typedef char* lzo_intptr_t;
+ typedef char* lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4))
+ typedef __w64 int lzo_intptr_t;
+ typedef __w64 unsigned int lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t short
+# define lzo_uintptr_t unsigned short
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT
+#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_intptr_t int
+# define lzo_uintptr_t unsigned int
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t long
+# define lzo_uintptr_t unsigned long
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t lzo_int64l_t
+# define lzo_uintptr_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# error "lzo_intptr_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#endif
+#if !defined(lzo_word_t)
+#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0)
+#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER)
+# define lzo_word_t lzo_uintptr_t
+# define lzo_sword_t lzo_intptr_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG)
+# define lzo_word_t unsigned long
+# define lzo_sword_t long
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG
+#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
+# define lzo_word_t unsigned int
+# define lzo_sword_t int
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
+#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT)
+# define lzo_word_t unsigned short
+# define lzo_sword_t short
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT
+#elif (LZO_WORDSIZE == 1)
+# define lzo_word_t unsigned char
+# define lzo_sword_t signed char
+# define LZO_SIZEOF_LZO_WORD_T 1
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T)
+# define lzo_word_t lzo_uint64l_t
+# define lzo_sword_t lzo_int64l_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T
+#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC)
+#if 0
+ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__)));
+# define lzo_word_t lzo_word_t
+# define lzo_sword_t lzo_sword_t
+# define LZO_SIZEOF_LZO_WORD_T 16
+#endif
+#else
+# error "lzo_word_t"
+#endif
+#endif
+#endif
+#if 1 && defined(lzo_word_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE)
+#endif
+#if 1
+#define lzo_int8_t signed char
+#define lzo_uint8_t unsigned char
+#define LZO_SIZEOF_LZO_INT8_T 1
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+#endif
+#if defined(lzo_int16e_t)
+#define lzo_int16_t lzo_int16e_t
+#define lzo_uint16_t lzo_uint16e_t
+#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t))
+#endif
+#if defined(lzo_int32e_t)
+#define lzo_int32_t lzo_int32e_t
+#define lzo_uint32_t lzo_uint32e_t
+#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t))
+#endif
+#if defined(lzo_int64e_t)
+#define lzo_int64_t lzo_int64e_t
+#define lzo_uint64_t lzo_uint64e_t
+#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t))
+#endif
+#if 1
+#define lzo_int_least32_t lzo_int32l_t
+#define lzo_uint_least32_t lzo_uint32l_t
+#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t))
+#endif
+#if defined(lzo_int64l_t)
+#define lzo_int_least64_t lzo_int64l_t
+#define lzo_uint_least64_t lzo_uint64l_t
+#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t))
+#endif
+#if 1
+#define lzo_int_fast32_t lzo_int32f_t
+#define lzo_uint_fast32_t lzo_uint32f_t
+#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t))
+#endif
+#if defined(lzo_int64f_t)
+#define lzo_int_fast64_t lzo_int64f_t
+#define lzo_uint_fast64_t lzo_uint64f_t
+#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t))
+#endif
+#if !defined(LZO_INT16_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) ((c) + 0)
+# define LZO_UINT16_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) ((c) + 0L)
+# define LZO_UINT16_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) (c)
+# define LZO_UINT16_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) (c##L)
+# define LZO_UINT16_C(c) (c##UL)
+# else
+# error "LZO_INT16_C"
+# endif
+#endif
+#if !defined(LZO_INT32_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) ((c) + 0)
+# define LZO_UINT32_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) ((c) + 0L)
+# define LZO_UINT32_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) (c)
+# define LZO_UINT32_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) (c##L)
+# define LZO_UINT32_C(c) (c##UL)
+# elif (LZO_SIZEOF_LONG_LONG >= 4)
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+# else
+# error "LZO_INT32_C"
+# endif
+#endif
+#if !defined(LZO_INT64_C) && defined(lzo_int64l_t)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) ((c) + 0)
+# define LZO_UINT64_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) ((c) + 0L)
+# define LZO_UINT64_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) (c)
+# define LZO_UINT64_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) (c##L)
+# define LZO_UINT64_C(c) (c##UL)
+# else
+# error "LZO_INT64_C"
+# endif
+#endif
+#endif
#endif
@@ -1874,7 +3020,7 @@ extern "C" {
#undef LZO_HAVE_CONFIG_H
#include "minilzo.h"
-#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2060)
+#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2070)
# error "version mismatch in miniLZO source files"
#endif
@@ -1886,23 +3032,9 @@ extern "C" {
#define __LZO_CONF_H 1
#if !defined(__LZO_IN_MINILZO)
-#if (LZO_CFG_FREESTANDING)
+#if defined(LZO_CFG_FREESTANDING) && (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 (LZO_CFG_NO_UNALIGNED)
-# define ACC_CFG_NO_UNALIGNED 1
-#endif
-#if (LZO_ARCH_GENERIC)
-# define ACC_ARCH_GENERIC 1
-#endif
-#if (LZO_ABI_NEUTRAL_ENDIAN)
-# define ACC_ABI_NEUTRAL_ENDIAN 1
-#endif
-#if (LZO_HAVE_CONFIG_H)
-# define ACC_CONFIG_NO_HEADER 1
#endif
#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
# include LZO_CFG_EXTRA_CONFIG_HEADER
@@ -1911,22 +3043,27 @@ extern "C" {
# error "include this file first"
#endif
#include "lzo/lzoconf.h"
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2)
+# include LZO_CFG_EXTRA_CONFIG_HEADER2
+#endif
#endif
-#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED)
+#if (LZO_VERSION < 0x2070) || !defined(__LZOCONF_H_INCLUDED)
# error "version mismatch"
#endif
-#if (LZO_CC_BORLANDC && LZO_ARCH_I086)
-# pragma option -h
+#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100))
+# pragma warning(disable: 4702)
#endif
-
#if (LZO_CC_MSC && (_MSC_VER >= 1000))
# pragma warning(disable: 4127 4701)
+# pragma warning(disable: 4514 4710 4711)
#endif
#if (LZO_CC_MSC && (_MSC_VER >= 1300))
# pragma warning(disable: 4820)
-# pragma warning(disable: 4514 4710 4711)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1800))
+# pragma warning(disable: 4746)
#endif
#if (LZO_CC_SUNPROC)
@@ -1937,48 +3074,15 @@ extern "C" {
#endif
#endif
-#if (__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
+#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING)
#elif 1
# include <string.h>
#else
-# define ACC_WANT_ACC_INCD_H 1
+# define LZO_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
+#if defined(LZO_HAVE_CONFIG_H)
+# define LZO_CFG_NO_CONFIG_HEADER 1
#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)
@@ -2002,6 +3106,23 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
#include <string.h>
#endif
+#if 1 || defined(lzo_int8_t) || defined(lzo_uint8_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1)
+#endif
+#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2)
+#endif
+#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4)
+#endif
+#if defined(lzo_int64_t) || defined(lzo_uint64_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8)
+#endif
+
#if (LZO_CFG_FREESTANDING)
# undef HAVE_MEMCMP
# undef HAVE_MEMCPY
@@ -2012,28 +3133,28 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
#if !(HAVE_MEMCMP)
# undef memcmp
# define memcmp(a,b,c) lzo_memcmp(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memcmp
# define lzo_memcmp(a,b,c) memcmp(a,b,c)
#endif
#if !(HAVE_MEMCPY)
# undef memcpy
# define memcpy(a,b,c) lzo_memcpy(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memcpy
# define lzo_memcpy(a,b,c) memcpy(a,b,c)
#endif
#if !(HAVE_MEMMOVE)
# undef memmove
# define memmove(a,b,c) lzo_memmove(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memmove
# define lzo_memmove(a,b,c) memmove(a,b,c)
#endif
#if !(HAVE_MEMSET)
# undef memset
# define memset(a,b,c) lzo_memset(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memset
# define lzo_memset(a,b,c) memset(a,b,c)
#endif
@@ -2058,27 +3179,29 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
#endif
-#if !defined(__lzo_inline)
-# define __lzo_inline /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-# define __lzo_forceinline /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-# define __lzo_noinline /*empty*/
-#endif
-
#if (LZO_CFG_PGO)
-# undef __acc_likely
-# undef __acc_unlikely
# undef __lzo_likely
# undef __lzo_unlikely
-# define __acc_likely(e) (e)
-# define __acc_unlikely(e) (e)
# define __lzo_likely(e) (e)
# define __lzo_unlikely(e) (e)
#endif
+#undef _
+#undef __
+#undef ___
+#undef ____
+#undef _p0
+#undef _p1
+#undef _p2
+#undef _p3
+#undef _p4
+#undef _s0
+#undef _s1
+#undef _s2
+#undef _s3
+#undef _s4
+#undef _ww
+
#if 1
# define LZO_BYTE(x) ((unsigned char) (x))
#else
@@ -2097,84 +3220,548 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
#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)))
+# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b)))
#else
# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
#endif
#endif
-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC)
-# if (LZO_SIZEOF_SHORT == 2)
-# define LZO_UNALIGNED_OK_2 1
-# endif
-# if (LZO_SIZEOF_INT == 4)
-# define LZO_UNALIGNED_OK_4 1
-# endif
+#ifndef __LZO_FUNC_H
+#define __LZO_FUNC_H 1
+
+#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN)
+#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC)
+#define LZO_BITOPS_USE_ASM_BITSCAN 1
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#define LZO_BITOPS_USE_GNUC_BITSCAN 1
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#define LZO_BITOPS_USE_MSC_BITSCAN 1
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#include <intrin.h>
#endif
-#if 1 && (LZO_ARCH_AMD64)
-# if defined(LZO_UINT64_MAX)
-# define LZO_UNALIGNED_OK_8 1
-# endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#pragma intrinsic(_BitScanReverse)
+#pragma intrinsic(_BitScanForward)
#endif
-#if (LZO_CFG_NO_UNALIGNED)
-# undef LZO_UNALIGNED_OK_2
-# undef LZO_UNALIGNED_OK_4
-# undef LZO_UNALIGNED_OK_8
-#endif
-
-#undef UA_GET16
-#undef UA_SET16
-#undef UA_COPY16
-#undef UA_GET32
-#undef UA_SET32
-#undef UA_COPY32
-#undef UA_GET64
-#undef UA_SET64
-#undef UA_COPY64
-#if defined(LZO_UNALIGNED_OK_2)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2)
-# if 1 && defined(ACC_UA_COPY16)
-# define UA_GET16 ACC_UA_GET16
-# define UA_SET16 ACC_UA_SET16
-# define UA_COPY16 ACC_UA_COPY16
-# else
-# define UA_GET16(p) (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET16(p,v) ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v))
-# define UA_COPY16(d,s) UA_SET16(d, UA_GET16(s))
-# endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64)
+#pragma intrinsic(_BitScanReverse64)
+#pragma intrinsic(_BitScanForward64)
#endif
-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-# if 1 && defined(ACC_UA_COPY32)
-# define UA_GET32 ACC_UA_GET32
-# define UA_SET32 ACC_UA_SET32
-# define UA_COPY32 ACC_UA_COPY32
-# else
-# define UA_GET32(p) (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET32(p,v) ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v))
-# define UA_COPY32(d,s) UA_SET32(d, UA_GET32(s))
-# endif
#endif
-#if defined(LZO_UNALIGNED_OK_8)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8)
-# if 1 && defined(ACC_UA_COPY64)
-# define UA_GET64 ACC_UA_GET64
-# define UA_SET64 ACC_UA_SET64
-# define UA_COPY64 ACC_UA_COPY64
-# else
-# define UA_GET64(p) (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET64(p,v) ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v))
-# define UA_COPY64(d,s) UA_SET64(d, UA_GET64(s))
-# endif
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4)
+ unsigned r; r = (unsigned) __builtin_clz(v); return r;
+#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzl(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzll(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4)
+ unsigned r; r = (unsigned) __builtin_ctz(v); return r;
+#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzl(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzll(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_bitops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz32_func);
+#if defined(lzo_uint64_t)
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz64_func);
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+}
+
+#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED)
+#ifndef __lzo_memops_tcheck
+#define __lzo_memops_tcheck(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b))
+#endif
+#endif
+#ifndef lzo_memops_TU0p
+#define lzo_memops_TU0p void __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU1p
+#define lzo_memops_TU1p unsigned char __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU2p
+#if (LZO_OPT_UNALIGNED16)
+typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2;
+#define lzo_memops_TU2p volatile lzo_memops_TU2 *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU2_struct,2)
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#else
+struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias;
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#endif
+#ifndef lzo_memops_TU2p
+#define lzo_memops_TU2p lzo_memops_TU2 *
+#endif
+#endif
+#ifndef lzo_memops_TU4p
+#if (LZO_OPT_UNALIGNED32)
+typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4;
+#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU4_struct,4)
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#else
+struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias;
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#endif
+#ifndef lzo_memops_TU4p
+#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_TU8p
+#if (LZO_OPT_UNALIGNED64)
+typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8;
+#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU8_struct,8)
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#else
+struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias;
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#endif
+#ifndef lzo_memops_TU8p
+#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_set_TU1p
+#define lzo_memops_set_TU1p volatile lzo_memops_TU1p
+#endif
+#ifndef lzo_memops_move_TU1p
+#define lzo_memops_move_TU1p lzo_memops_TU1p
+#endif
+#define LZO_MEMOPS_SET1(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__1[0] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET2(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET3(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET4(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE1(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__1[0] = s__1[0]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE2(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__2[0] = s__2[0]; d__2[1] = s__2[1]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE3(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE4(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE8(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \
+ d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \
+ LZO_BLOCK_END
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1)
+#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss)
+#if (LZO_OPT_UNALIGNED16)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU2,2,1)) { \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss)
+#endif
+#if (LZO_OPT_UNALIGNED32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU4,4,1)) { \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss)
+#endif
+#if (LZO_WORDSIZE != 8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#else
+#if (LZO_OPT_UNALIGNED64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#elif (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU8,8,1)) { \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss)
+#endif
+#endif
+#define LZO_MEMOPS_COPYN(dd,ss,nn) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \
+ lzo_uint n__n = (nn); \
+ while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \
+ if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(&v, ss);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss;
+ unsigned long vv;
+ __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint16_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(&v, ss);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss;
+ unsigned long vv;
+ __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint32_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint32_t) (((lzo_uint32_t)s[0] << 24) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[3]));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+ LZO_MEMOPS_COPY2(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+ LZO_MEMOPS_COPY4(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64)
+#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(dd, &vv);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU2p d = (lzo_memops_TU2p) dd;
+ unsigned long v = vv;
+ __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(dd, &vv);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU4p d = (lzo_memops_TU4p) dd;
+ unsigned long v = vv;
+ __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+ d[2] = LZO_BYTE((vv >> 16) & 0xff);
+ d[3] = LZO_BYTE((vv >> 24) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv)
+{
+ LZO_MEMOPS_COPY2(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv)
+{
+ LZO_MEMOPS_COPY4(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv)
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_memops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_memops_get_le16);
+ LZO_UNUSED_FUNC(lzo_memops_get_le32);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_put_le16);
+ LZO_UNUSED_FUNC(lzo_memops_put_le32);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_unused_funcs);
+}
+
+#endif
+
+#ifndef UA_SET1
+#define UA_SET1 LZO_MEMOPS_SET1
+#endif
+#ifndef UA_SET2
+#define UA_SET2 LZO_MEMOPS_SET2
+#endif
+#ifndef UA_SET3
+#define UA_SET3 LZO_MEMOPS_SET3
+#endif
+#ifndef UA_SET4
+#define UA_SET4 LZO_MEMOPS_SET4
+#endif
+#ifndef UA_MOVE1
+#define UA_MOVE1 LZO_MEMOPS_MOVE1
+#endif
+#ifndef UA_MOVE2
+#define UA_MOVE2 LZO_MEMOPS_MOVE2
+#endif
+#ifndef UA_MOVE3
+#define UA_MOVE3 LZO_MEMOPS_MOVE3
+#endif
+#ifndef UA_MOVE4
+#define UA_MOVE4 LZO_MEMOPS_MOVE4
+#endif
+#ifndef UA_MOVE8
+#define UA_MOVE8 LZO_MEMOPS_MOVE8
+#endif
+#ifndef UA_COPY1
+#define UA_COPY1 LZO_MEMOPS_COPY1
+#endif
+#ifndef UA_COPY2
+#define UA_COPY2 LZO_MEMOPS_COPY2
+#endif
+#ifndef UA_COPY3
+#define UA_COPY3 LZO_MEMOPS_COPY3
+#endif
+#ifndef UA_COPY4
+#define UA_COPY4 LZO_MEMOPS_COPY4
+#endif
+#ifndef UA_COPY8
+#define UA_COPY8 LZO_MEMOPS_COPY8
+#endif
+#ifndef UA_COPYN
+#define UA_COPYN LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_COPYN_X
+#define UA_COPYN_X LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_GET_LE16
+#define UA_GET_LE16 LZO_MEMOPS_GET_LE16
+#endif
+#ifndef UA_GET_LE32
+#define UA_GET_LE32 LZO_MEMOPS_GET_LE32
+#endif
+#ifdef LZO_MEMOPS_GET_LE64
+#ifndef UA_GET_LE64
+#define UA_GET_LE64 LZO_MEMOPS_GET_LE64
+#endif
+#endif
+#ifndef UA_GET_NE16
+#define UA_GET_NE16 LZO_MEMOPS_GET_NE16
+#endif
+#ifndef UA_GET_NE32
+#define UA_GET_NE32 LZO_MEMOPS_GET_NE32
+#endif
+#ifdef LZO_MEMOPS_GET_NE64
+#ifndef UA_GET_NE64
+#define UA_GET_NE64 LZO_MEMOPS_GET_NE64
+#endif
+#endif
+#ifndef UA_PUT_LE16
+#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16
+#endif
+#ifndef UA_PUT_LE32
+#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32
+#endif
+#ifndef UA_PUT_NE16
+#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16
+#endif
+#ifndef UA_PUT_NE32
+#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32
#endif
#define MEMCPY8_DS(dest,src,len) \
@@ -2195,25 +3782,10 @@ LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
extern "C" {
#endif
-#if !defined(lzo_uintptr_t)
-# if (__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)
+#error "LZO_ARCH_I086 is unsupported"
#elif (LZO_MM_PVP)
-#define PTR(a) ((lzo_bytep) (a))
-#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0)
-#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0)
+#error "LZO_MM_PVP is unsupported"
#else
#define PTR(a) ((lzo_uintptr_t) (a))
#define PTR_LINEAR(a) PTR(a)
@@ -2243,24 +3815,28 @@ typedef union
unsigned long a_ulong;
lzo_int a_lzo_int;
lzo_uint a_lzo_uint;
- lzo_int32 a_lzo_int32;
- lzo_uint32 a_lzo_uint32;
-#if defined(LZO_UINT64_MAX)
- lzo_int64 a_lzo_int64;
- lzo_uint64 a_lzo_uint64;
-#endif
+ lzo_xint a_lzo_xint;
+ lzo_int16_t a_lzo_int16_t;
+ lzo_uint16_t a_lzo_uint16_t;
+ lzo_int32_t a_lzo_int32_t;
+ lzo_uint32_t a_lzo_uint32_t;
+#if defined(lzo_uint64_t)
+ lzo_int64_t a_lzo_int64_t;
+ lzo_uint64_t a_lzo_uint64_t;
+#endif
+ size_t a_size_t;
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;
+ unsigned char * a_uchar_p;
+ const void * a_c_void_p;
+ const char * a_c_char_p;
+ const unsigned char * a_c_uchar_p;
+ lzo_voidp a_lzo_voidp;
+ lzo_bytep a_lzo_bytep;
+ const lzo_voidp a_c_lzo_voidp;
+ const lzo_bytep a_c_lzo_bytep;
}
lzo_full_align_t;
@@ -2276,18 +3852,14 @@ lzo_full_align_t;
#ifndef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 1
-#if 0 && (LZO_ARCH_I086)
-# undef LZO_DICT_USE_PTR
-# define LZO_DICT_USE_PTR 0
-#endif
#endif
#if (LZO_DICT_USE_PTR)
# define lzo_dict_t const lzo_bytep
-# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+# define lzo_dict_p lzo_dict_t *
#else
# define lzo_dict_t lzo_uint
-# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+# define lzo_dict_p lzo_dict_t *
#endif
#endif
@@ -2300,10 +3872,9 @@ __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));
+#error "LZO_ARCH_I086 is unsupported"
#elif (LZO_MM_PVP)
- p = (lzo_uintptr_t) (ptr);
- p = (p << 3) | (p >> 61);
+#error "LZO_MM_PVP is unsupported"
#else
p = (lzo_uintptr_t) PTR_LINEAR(ptr);
#endif
@@ -2314,9 +3885,8 @@ __lzo_ptr_linear(const lzo_voidp ptr)
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;
+#if (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
#else
lzo_uintptr_t p, n;
p = __lzo_ptr_linear(ptr);
@@ -2342,7 +3912,7 @@ static const char __lzo_copyright[] =
#else
"\r\n\n"
"LZO data compression library.\n"
- "$Copyright: LZO Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\n"
+ "$Copyright: LZO Copyright (C) 1996-2014 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"
@@ -2352,11 +3922,7 @@ static const char __lzo_copyright[] =
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)
@@ -2398,11 +3964,11 @@ _lzo_version_date(void)
#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_PUBLIC(lzo_uint32_t)
+lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len)
{
- lzo_uint32 s1 = adler & 0xffff;
- lzo_uint32 s2 = (adler >> 16) & 0xffff;
+ lzo_uint32_t s1 = adler & 0xffff;
+ lzo_uint32_t s2 = (adler >> 16) & 0xffff;
unsigned k;
if (buf == NULL)
@@ -2459,8 +4025,8 @@ lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len)
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) || !(HAVE_MEMCMP)
- const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1;
- const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2;
+ const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, s2);
if __lzo_likely(len > 0) do
{
int d = *p1 - *p2;
@@ -2476,8 +4042,8 @@ LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo
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) || !(HAVE_MEMCPY)
- lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
- const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src);
if (!(len > 0) || p1 == p2)
return dest;
do
@@ -2491,8 +4057,8 @@ LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src
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) || !(HAVE_MEMMOVE)
- lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
- const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src);
if (!(len > 0) || p1 == p2)
return dest;
if (p1 < p2)
@@ -2514,16 +4080,17 @@ LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p sr
return memmove(dest, src, len);
#endif
}
-LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len)
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int cc, lzo_hsize_t len)
{
#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
- lzo_hbyte_p p = (lzo_hbyte_p) s;
+ lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s);
+ unsigned char c = LZO_ITRUNC(unsigned char, cc);
if __lzo_likely(len > 0) do
- *p++ = (unsigned char) c;
+ *p++ = c;
while __lzo_likely(--len > 0);
return s;
#else
- return memset(s, c, len);
+ return memset(s, cc, len);
#endif
}
#undef LZOLIB_PUBLIC
@@ -2532,103 +4099,28 @@ LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len)
#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)
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
- 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_UINT64_MAX)
- ACCCHK_ASSERT(sizeof(lzo_uint64) == 8)
- ACCCHK_ASSERT_IS_SIGNED_T(lzo_int64)
- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64)
+ LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+#if !(__LZO_UINTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
#endif
+ LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
-#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
-
-#define WANT_lzo_bitops_clz32 1
-#define WANT_lzo_bitops_clz64 1
-#define WANT_lzo_bitops_ctz32 1
-#define WANT_lzo_bitops_ctz64 1
-
-#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
-#include <intrin.h>
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
-#pragma intrinsic(_BitScanReverse)
-static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
-{
- unsigned long r;
- (void) _BitScanReverse(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_clz32 lzo_bitops_clz32
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
-#pragma intrinsic(_BitScanReverse64)
-static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
-{
- unsigned long r;
- (void) _BitScanReverse64(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_clz64 lzo_bitops_clz64
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#pragma intrinsic(_BitScanForward)
-static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
-{
- unsigned long r;
- (void) _BitScanForward(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_ctz32 lzo_bitops_ctz32
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#pragma intrinsic(_BitScanForward64)
-static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
-{
- unsigned long r;
- (void) _BitScanForward64(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_ctz64 lzo_bitops_ctz64
#endif
+#undef LZOCHK_ASSERT
-#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
-#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
-#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
-#endif
+union lzo_config_check_union {
+ lzo_uint a[2];
+ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))];
+#if defined(lzo_uint64_t)
+ lzo_uint64_t c[2];
#endif
+};
#if 0
#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
@@ -2642,73 +4134,85 @@ static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
LZO_PUBLIC(int)
_lzo_config_check(void)
{
- lzo_bool r = 1;
- union {
- lzo_xint a[2]; unsigned char b[2*LZO_MAX(8,sizeof(lzo_xint))];
-#if defined(LZO_UNALIGNED_OK_8)
- lzo_uint64 c[2];
-#endif
- unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2];
- } u;
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul))
+# if 0
+ volatile
+# endif
+#endif
+ union lzo_config_check_union u;
lzo_voidp p;
+ unsigned r = 1;
u.a[0] = u.a[1] = 0;
p = u2p(&u, 0);
r &= ((* (lzo_bytep) p) == 0);
-#if !defined(LZO_CFG_NO_CONFIG_CHECK)
-#if defined(LZO_ABI_BIG_ENDIAN)
+#if !(LZO_CFG_NO_CONFIG_CHECK)
+#if (LZO_ABI_BIG_ENDIAN)
u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
p = u2p(&u, 0);
r &= ((* (lzo_uintp) p) == 128);
#endif
-#if defined(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ABI_LITTLE_ENDIAN)
u.a[0] = u.a[1] = 0; u.b[0] = 128;
p = u2p(&u, 0);
r &= ((* (lzo_uintp) p) == 128);
#endif
-#if defined(LZO_UNALIGNED_OK_2)
u.a[0] = u.a[1] = 0;
- u.b[0] = 1; u.b[sizeof(unsigned short) + 1] = 2;
+ u.b[0] = 1; u.b[3] = 2;
p = u2p(&u, 1);
- r &= ((* (lzo_ushortp) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
+ r &= UA_GET_NE16(p) == 0;
+ r &= UA_GET_LE16(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE16(p) == 128;
u.a[0] = u.a[1] = 0;
- u.b[0] = 3; u.b[sizeof(lzo_uint32) + 1] = 4;
+ u.b[0] = 3; u.b[5] = 4;
p = u2p(&u, 1);
- r &= ((* (lzo_uint32p) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_8)
+ r &= UA_GET_NE32(p) == 0;
+ r &= UA_GET_LE32(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE32(p) == 128;
+#if defined(UA_GET_NE64)
u.c[0] = u.c[1] = 0;
- u.b[0] = 5; u.b[sizeof(lzo_uint64) + 1] = 6;
+ u.b[0] = 5; u.b[9] = 6;
p = u2p(&u, 1);
- r &= ((* (lzo_uint64p) p) == 0);
-#endif
-#if defined(lzo_bitops_clz32)
- { unsigned i; lzo_uint32 v = 1;
- for (i = 0; i < 32; i++, v <<= 1)
- r &= lzo_bitops_clz32(v) == 31 - i;
- }
-#endif
-#if defined(lzo_bitops_clz64)
- { unsigned i; lzo_uint64 v = 1;
- for (i = 0; i < 64; i++, v <<= 1)
- r &= lzo_bitops_clz64(v) == 63 - i;
- }
-#endif
-#if defined(lzo_bitops_ctz32)
- { unsigned i; lzo_uint32 v = 1;
- for (i = 0; i < 32; i++, v <<= 1)
- r &= lzo_bitops_ctz32(v) == i;
- }
-#endif
-#if defined(lzo_bitops_ctz64)
- { unsigned i; lzo_uint64 v = 1;
- for (i = 0; i < 64; i++, v <<= 1)
- r &= lzo_bitops_ctz64(v) == i;
- }
-#endif
-#endif
+ u.c[0] = u.c[1] = 0;
+ r &= UA_GET_NE64(p) == 0;
+#if defined(UA_GET_LE64)
+ r &= UA_GET_LE64(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE64(p) == 128;
+#endif
+#endif
+#if defined(lzo_bitops_ctlz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz32(v) == 31 - i;
+ r &= lzo_bitops_ctlz32_func(v) == 31 - i;
+ }}
+#endif
+#if defined(lzo_bitops_ctlz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz64(v) == 63 - i;
+ r &= lzo_bitops_ctlz64_func(v) == 63 - i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz32(v) == i;
+ r &= lzo_bitops_cttz32_func(v) == i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz64(v) == i;
+ r &= lzo_bitops_cttz64_func(v) == i;
+ }}
+#endif
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
return r == 1 ? LZO_E_OK : LZO_E_ERROR;
}
@@ -2722,11 +4226,11 @@ __lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
#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)
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
#endif
-#undef ACCCHK_ASSERT
+#undef LZOCHK_ASSERT
if (v == 0)
return LZO_E_ERROR;
@@ -2734,7 +4238,7 @@ __lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
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)) &&
+ (s4 == -1 || s4 == (int) sizeof(lzo_uint32_t)) &&
(s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
(s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
(s7 == -1 || s7 == (int) sizeof(char *)) &&
@@ -2777,11 +4281,11 @@ int __far __pascal LibMain ( int a, short b, short c, long d )
#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#endif
#define LZO_NEED_DICT_H 1
@@ -3086,81 +4590,7 @@ DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
#endif
#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
-# define do_compress LZO_CPP_ECONCAT2(DO_COMPRESS,_core)
-#endif
-
-#if defined(UA_GET64) && (LZO_ABI_BIG_ENDIAN)
-# define WANT_lzo_bitops_clz64 1
-#elif defined(UA_GET64) && (LZO_ABI_LITTLE_ENDIAN)
-# define WANT_lzo_bitops_ctz64 1
-#elif defined(UA_GET32) && (LZO_ABI_BIG_ENDIAN)
-# define WANT_lzo_bitops_clz32 1
-#elif defined(UA_GET32) && (LZO_ABI_LITTLE_ENDIAN)
-# define WANT_lzo_bitops_ctz32 1
-#endif
-
-#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
-#include <intrin.h>
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
-#pragma intrinsic(_BitScanReverse)
-static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
-{
- unsigned long r;
- (void) _BitScanReverse(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_clz32 lzo_bitops_clz32
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
-#pragma intrinsic(_BitScanReverse64)
-static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
-{
- unsigned long r;
- (void) _BitScanReverse64(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_clz64 lzo_bitops_clz64
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#pragma intrinsic(_BitScanForward)
-static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
-{
- unsigned long r;
- (void) _BitScanForward(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_ctz32 lzo_bitops_ctz32
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#pragma intrinsic(_BitScanForward64)
-static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
-{
- unsigned long r;
- (void) _BitScanForward64(&r, v);
- return (unsigned) r;
-}
-#define lzo_bitops_ctz64 lzo_bitops_ctz64
-#endif
-
-#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
-#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
-#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
-#endif
-#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
-#endif
-#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
-#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
-#endif
-#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
-#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
-#endif
-#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
-#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
-#endif
+# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core)
#endif
static __lzo_noinline lzo_uint
@@ -3168,7 +4598,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_uint ti, lzo_voidp wrkmem)
{
- register const lzo_bytep ip;
+ 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 - 20;
@@ -3207,8 +4637,8 @@ next:
goto literal;
try_match:
-#if defined(UA_GET32)
- if (UA_GET32(m_pos) != UA_GET32(ip))
+#if (LZO_OPT_UNALIGNED32)
+ if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip))
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
#endif
@@ -3223,50 +4653,43 @@ literal:
lzo_uint m_off;
lzo_uint m_len;
{
- lzo_uint32 dv;
+ lzo_uint32_t dv;
lzo_uint dindex;
literal:
ip += 1 + ((ip - ii) >> 5);
next:
if __lzo_unlikely(ip >= ip_end)
break;
- dv = UA_GET32(ip);
+ dv = UA_GET_LE32(ip);
dindex = DINDEX(dv,ip);
GINDEX(m_off,m_pos,in+dict,dindex,in);
UPDATE_I(dict,0,dindex,ip,in);
- if __lzo_unlikely(dv != UA_GET32(m_pos))
+ if __lzo_unlikely(dv != UA_GET_LE32(m_pos))
goto literal;
}
#endif
ii -= ti; ti = 0;
{
- register lzo_uint t = pd(ip,ii);
+ lzo_uint t = pd(ip,ii);
if (t != 0)
{
if (t <= 3)
{
- op[-2] |= LZO_BYTE(t);
-#if defined(UA_COPY32)
- UA_COPY32(op, ii);
+ op[-2] = LZO_BYTE(op[-2] | t);
+#if (LZO_OPT_UNALIGNED32)
+ UA_COPY4(op, ii);
op += t;
#else
{ do *op++ = *ii++; while (--t > 0); }
#endif
}
-#if defined(UA_COPY32) || defined(UA_COPY64)
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
else if (t <= 16)
{
*op++ = LZO_BYTE(t - 3);
-#if defined(UA_COPY64)
- UA_COPY64(op, ii);
- UA_COPY64(op+8, ii+8);
-#else
- UA_COPY32(op, ii);
- UA_COPY32(op+4, ii+4);
- UA_COPY32(op+8, ii+8);
- UA_COPY32(op+12, ii+12);
-#endif
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
op += t;
}
#endif
@@ -3276,31 +4699,21 @@ next:
*op++ = LZO_BYTE(t - 3);
else
{
- register lzo_uint tt = t - 18;
+ lzo_uint tt = t - 18;
*op++ = 0;
while __lzo_unlikely(tt > 255)
{
tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
-#if defined(UA_COPY32) || defined(UA_COPY64)
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
do {
-#if defined(UA_COPY64)
- UA_COPY64(op, ii);
- UA_COPY64(op+8, ii+8);
-#else
- UA_COPY32(op, ii);
- UA_COPY32(op+4, ii+4);
- UA_COPY32(op+8, ii+8);
- UA_COPY32(op+12, ii+12);
-#endif
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
op += 16; ii += 16; t -= 16;
} while (t >= 16); if (t > 0)
#endif
@@ -3310,26 +4723,26 @@ next:
}
m_len = 4;
{
-#if defined(UA_GET64)
- lzo_uint64 v;
- v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+#if (LZO_OPT_UNALIGNED64)
+ lzo_uint64_t v;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
if __lzo_unlikely(v == 0) {
do {
m_len += 8;
- v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (v == 0);
}
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz64)
- m_len += lzo_bitops_clz64(v) / CHAR_BIT;
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64)
+ m_len += lzo_bitops_ctlz64(v) / CHAR_BIT;
#elif (LZO_ABI_BIG_ENDIAN)
if ((v >> (64 - CHAR_BIT)) == 0) do {
v <<= CHAR_BIT;
m_len += 1;
} while ((v >> (64 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz64)
- m_len += lzo_bitops_ctz64(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64)
+ m_len += lzo_bitops_cttz64(v) / CHAR_BIT;
#elif (LZO_ABI_LITTLE_ENDIAN)
if ((v & UCHAR_MAX) == 0) do {
v >>= CHAR_BIT;
@@ -3340,26 +4753,30 @@ next:
m_len += 1;
} while (ip[m_len] == m_pos[m_len]);
#endif
-#elif defined(UA_GET32)
- lzo_uint32 v;
- v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+#elif (LZO_OPT_UNALIGNED32)
+ lzo_uint32_t v;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
if __lzo_unlikely(v == 0) {
do {
m_len += 4;
- v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if (v != 0)
+ break;
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (v == 0);
}
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz32)
- m_len += lzo_bitops_clz32(v) / CHAR_BIT;
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32)
+ m_len += lzo_bitops_ctlz32(v) / CHAR_BIT;
#elif (LZO_ABI_BIG_ENDIAN)
if ((v >> (32 - CHAR_BIT)) == 0) do {
v <<= CHAR_BIT;
m_len += 1;
} while ((v >> (32 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz32)
- m_len += lzo_bitops_ctz32(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32)
+ m_len += lzo_bitops_cttz32(v) / CHAR_BIT;
#elif (LZO_ABI_LITTLE_ENDIAN)
if ((v & UCHAR_MAX) == 0) do {
v >>= CHAR_BIT;
@@ -3374,6 +4791,27 @@ next:
if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
do {
m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (ip[m_len] == m_pos[m_len]);
@@ -3407,11 +4845,8 @@ m_len_done:
while __lzo_unlikely(m_len > 255)
{
m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
*op++ = LZO_BYTE(m_len);
}
@@ -3430,11 +4865,8 @@ m_len_done:
while __lzo_unlikely(m_len > 255)
{
m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
*op++ = LZO_BYTE(m_len);
}
@@ -3485,7 +4917,7 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
if (op == out && t <= 238)
*op++ = LZO_BYTE(17 + t);
else if (t <= 3)
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
@@ -3496,17 +4928,14 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
while (tt > 255)
{
tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
-
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
- do *op++ = *ii++; while (--t > 0);
+ UA_COPYN(op, ii, t);
+ op += t;
}
*op++ = M4_MARKER | 1;
@@ -3543,10 +4972,13 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
#undef TEST_IP
#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
#undef TEST_LB
#undef TEST_LBO
#undef NEED_IP
#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
@@ -3561,6 +4993,7 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
# if (LZO_TEST_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun
# endif
#endif
@@ -3572,12 +5005,13 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
# undef TEST_OP
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) 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
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun
#else
# define TEST_LB(m_pos) ((void) 0)
# define TEST_LBO(m_pos,o) ((void) 0)
@@ -3598,15 +5032,27 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
# define TEST_OP 1
#endif
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
#if defined(NEED_IP)
# define HAVE_NEED_IP 1
#else
# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP 1
#else
# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
@@ -3623,14 +5069,14 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_voidp wrkmem )
#endif
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_bytep dict_end;
#else
- register const lzo_bytep m_pos;
+ const lzo_bytep m_pos;
#endif
const lzo_bytep const ip_end = in + in_len;
@@ -3665,43 +5111,45 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
+ NEED_IP(1);
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
- assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
- while (TEST_IP && TEST_OP)
+ for (;;)
{
+ NEED_IP(3);
t = *ip++;
if (t >= 16)
goto match;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_IV(t);
NEED_IP(1);
}
t += 15 + *ip++;
}
- assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
t += 3;
if (t >= 8) do
{
- UA_COPY64(op,ip);
+ UA_COPY8(op,ip);
op += 8; ip += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
}
if (t > 0)
@@ -3709,19 +5157,19 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
*op++ = *ip++;
if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
}
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -3729,12 +5177,12 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
else
do *op++ = *ip++; while (--t > 0);
}
-#if !defined(LZO_UNALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
}
else
#endif
#endif
-#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
+#if !(LZO_OPT_UNALIGNED32)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
@@ -3770,7 +5218,7 @@ first_literal_run:
#endif
goto match_done;
- do {
+ for (;;) {
match:
if (t >= 64)
{
@@ -3830,14 +5278,15 @@ match:
t &= 31;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 31 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -3853,9 +5302,9 @@ match:
m_pos = op - off;
last_m_off = off;
}
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
m_pos = op - 1;
- m_pos -= UA_GET16(ip) >> 2;
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
@@ -3874,14 +5323,15 @@ match:
t &= 7;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 7 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -3899,8 +5349,8 @@ match:
#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 -= UA_GET16(ip) >> 2;
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
@@ -3948,18 +5398,18 @@ match:
#else
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
if (op - m_pos >= 8)
{
t += (3 - 1);
if (t >= 8) do
{
- UA_COPY64(op,m_pos);
+ UA_COPY8(op,m_pos);
op += 8; m_pos += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
}
if (t > 0)
@@ -3969,8 +5419,8 @@ match:
}
}
else
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4);
@@ -3978,10 +5428,10 @@ match:
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
@@ -4006,7 +5456,7 @@ match_done:
break;
match_next:
- assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3);
#if 0
do *op++ = *ip++; while (--t > 0);
#else
@@ -4014,16 +5464,10 @@ match_next:
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));
@@ -4069,10 +5513,13 @@ lookbehind_overrun:
#undef TEST_IP
#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
#undef TEST_LB
#undef TEST_LBO
#undef NEED_IP
#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
@@ -4087,6 +5534,7 @@ lookbehind_overrun:
# if (LZO_TEST_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun
# endif
#endif
@@ -4098,12 +5546,13 @@ lookbehind_overrun:
# undef TEST_OP
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) 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
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun
#else
# define TEST_LB(m_pos) ((void) 0)
# define TEST_LBO(m_pos,o) ((void) 0)
@@ -4124,15 +5573,27 @@ lookbehind_overrun:
# define TEST_OP 1
#endif
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
#if defined(NEED_IP)
# define HAVE_NEED_IP 1
#else
# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP 1
#else
# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
#endif
#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
@@ -4149,14 +5610,14 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_voidp wrkmem )
#endif
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_bytep dict_end;
#else
- register const lzo_bytep m_pos;
+ const lzo_bytep m_pos;
#endif
const lzo_bytep const ip_end = in + in_len;
@@ -4191,43 +5652,45 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
+ NEED_IP(1);
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
- assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
- while (TEST_IP && TEST_OP)
+ for (;;)
{
+ NEED_IP(3);
t = *ip++;
if (t >= 16)
goto match;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_IV(t);
NEED_IP(1);
}
t += 15 + *ip++;
}
- assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
t += 3;
if (t >= 8) do
{
- UA_COPY64(op,ip);
+ UA_COPY8(op,ip);
op += 8; ip += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
}
if (t > 0)
@@ -4235,19 +5698,19 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
*op++ = *ip++;
if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
}
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -4255,12 +5718,12 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
else
do *op++ = *ip++; while (--t > 0);
}
-#if !defined(LZO_UNALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
}
else
#endif
#endif
-#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
+#if !(LZO_OPT_UNALIGNED32)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
@@ -4296,7 +5759,7 @@ first_literal_run:
#endif
goto match_done;
- do {
+ for (;;) {
match:
if (t >= 64)
{
@@ -4356,14 +5819,15 @@ match:
t &= 31;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 31 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -4379,9 +5843,9 @@ match:
m_pos = op - off;
last_m_off = off;
}
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
m_pos = op - 1;
- m_pos -= UA_GET16(ip) >> 2;
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
@@ -4400,14 +5864,15 @@ match:
t &= 7;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 7 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -4425,8 +5890,8 @@ match:
#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 -= UA_GET16(ip) >> 2;
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
@@ -4474,18 +5939,18 @@ match:
#else
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
if (op - m_pos >= 8)
{
t += (3 - 1);
if (t >= 8) do
{
- UA_COPY64(op,m_pos);
+ UA_COPY8(op,m_pos);
op += 8; m_pos += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
}
if (t > 0)
@@ -4495,8 +5960,8 @@ match:
}
}
else
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4);
@@ -4504,10 +5969,10 @@ match:
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
@@ -4532,7 +5997,7 @@ match_done:
break;
match_next:
- assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3);
#if 0
do *op++ = *ip++; while (--t > 0);
#else
@@ -4540,16 +6005,10 @@ match_next:
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));
@@ -4576,4 +6035,3 @@ lookbehind_overrun:
#endif
/***** End of minilzo.c *****/
-
diff --git a/app/lzo/minilzo/minilzo.h b/app/lzo/minilzo/minilzo.h
index 4c7b2378..fd2fb321 100644
--- a/app/lzo/minilzo/minilzo.h
+++ b/app/lzo/minilzo/minilzo.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -50,7 +35,7 @@
#ifndef __MINILZO_H
#define __MINILZO_H 1
-#define MINILZO_VERSION 0x2060
+#define MINILZO_VERSION 0x2070
#ifdef __LZOCONF_H
# error "you cannot use both LZO and miniLZO"
@@ -78,7 +63,7 @@ extern "C" {
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
-#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1X_MEM_DECOMPRESS (0)
diff --git a/app/lzo/minilzo/testmini.c b/app/lzo/minilzo/testmini.c
index 991f8789..581943ff 100644
--- a/app/lzo/minilzo/testmini.c
+++ b/app/lzo/minilzo/testmini.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -66,13 +51,7 @@
* is not possible.
*/
-#if defined(__LZO_STRICT_16BIT)
-#define IN_LEN (8*1024u)
-#elif defined(LZO_ARCH_I086) && !defined(LZO_HAVE_MM_HUGE_ARRAY)
-#define IN_LEN (60*1024u)
-#else
#define IN_LEN (128*1024ul)
-#endif
#define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3)
static unsigned char __LZO_MMODEL in [ IN_LEN ];
@@ -105,7 +84,7 @@ int main(int argc, char *argv[])
printf("\nLZO real-time data compression library (v%s, %s).\n",
lzo_version_string(), lzo_version_date());
- printf("Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
/*
diff --git a/app/lzo/src/compr1b.h b/app/lzo/src/compr1b.h
index de46b0a5..32b22669 100644
--- a/app/lzo/src/compr1b.h
+++ b/app/lzo/src/compr1b.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -46,7 +31,7 @@
#if !defined(COMPRESS_ID)
-#define COMPRESS_ID LZO_CPP_ECONCAT2(DD_BITS,CLEVEL)
+#define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL)
#endif
@@ -58,10 +43,10 @@
************************************************************************/
#define LZO_COMPRESS \
- LZO_CPP_ECONCAT3(lzo1b_,COMPRESS_ID,_compress)
+ LZO_PP_ECONCAT3(lzo1b_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
- LZO_CPP_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func)
+ LZO_PP_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func)
diff --git a/app/lzo/src/compr1c.h b/app/lzo/src/compr1c.h
index 44dcdcf2..566ba447 100644
--- a/app/lzo/src/compr1c.h
+++ b/app/lzo/src/compr1c.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -46,7 +31,7 @@
#if !defined(COMPRESS_ID)
-#define COMPRESS_ID LZO_CPP_ECONCAT2(DD_BITS,CLEVEL)
+#define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL)
#endif
@@ -58,10 +43,10 @@
************************************************************************/
#define LZO_COMPRESS \
- LZO_CPP_ECONCAT3(lzo1c_,COMPRESS_ID,_compress)
+ LZO_PP_ECONCAT3(lzo1c_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
- LZO_CPP_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func)
+ LZO_PP_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func)
diff --git a/app/lzo/src/config1.h b/app/lzo/src/config1.h
index 14dc1317..592f4737 100644
--- a/app/lzo/src/config1.h
+++ b/app/lzo/src/config1.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1a.h b/app/lzo/src/config1a.h
index 3c0f24cf..3f0aa48f 100644
--- a/app/lzo/src/config1a.h
+++ b/app/lzo/src/config1a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1b.h b/app/lzo/src/config1b.h
index 33bb638d..26f47cbe 100644
--- a/app/lzo/src/config1b.h
+++ b/app/lzo/src/config1b.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1c.h b/app/lzo/src/config1c.h
index 32ca1f3a..a465eaf6 100644
--- a/app/lzo/src/config1c.h
+++ b/app/lzo/src/config1c.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1f.h b/app/lzo/src/config1f.h
index 6a77efc2..5e2a8e96 100644
--- a/app/lzo/src/config1f.h
+++ b/app/lzo/src/config1f.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1x.h b/app/lzo/src/config1x.h
index f52d1b88..cbbc1672 100644
--- a/app/lzo/src/config1x.h
+++ b/app/lzo/src/config1x.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1y.h b/app/lzo/src/config1y.h
index ed5a7e4e..a36dac14 100644
--- a/app/lzo/src/config1y.h
+++ b/app/lzo/src/config1y.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config1z.h b/app/lzo/src/config1z.h
index 27ef74e0..fcbc8385 100644
--- a/app/lzo/src/config1z.h
+++ b/app/lzo/src/config1z.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/config2a.h b/app/lzo/src/config2a.h
index f290132d..16b74b03 100644
--- a/app/lzo/src/config2a.h
+++ b/app/lzo/src/config2a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -136,14 +121,14 @@
/* get bits */
#define _NEEDBITS \
- { _NEEDBYTE; b |= ((lzo_uint32) _NEXTBYTE) << k; k += 8; assert(k <= 32); }
+ { _NEEDBYTE; b |= ((lzo_uint32_t) _NEXTBYTE) << k; k += 8; assert(k <= 32); }
#define NEEDBITS(j) { assert((j) < 8); if (k < (j)) _NEEDBITS }
/* set bits */
-#define SETBITS(j,x) { b |= (x) << k; k += (j); assert(k <= 32); }
+#define SETBITS(j,x) { b |= ((lzo_uint32_t)(x)) << k; k += (j); assert(k <= 32); }
/* access bits */
-#define MASKBITS(j) (b & ((((lzo_uint32)1 << (j)) - 1)))
+#define MASKBITS(j) (b & ((((lzo_uint32_t)1 << (j)) - 1)))
/* drop bits */
#define DUMPBITS(j) { assert(k >= j); b >>= (j); k -= (j); }
diff --git a/app/lzo/src/lzo1.c b/app/lzo/src/lzo1.c
index edf1c3af..e629730c 100644
--- a/app/lzo/src/lzo1.c
+++ b/app/lzo/src/lzo1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1_99.c b/app/lzo/src/lzo1_99.c
index b23695d2..a0ebf369 100644
--- a/app/lzo/src/lzo1_99.c
+++ b/app/lzo/src/lzo1_99.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -109,10 +94,10 @@ _lzo1_do_compress ( const lzo_bytep in, lzo_uint in_len,
************************************************************************/
#define LZO_COMPRESS \
- LZO_CPP_ECONCAT3(lzo1_,COMPRESS_ID,_compress)
+ LZO_PP_ECONCAT3(lzo1_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
- LZO_CPP_ECONCAT3(_lzo1_,COMPRESS_ID,_compress_func)
+ LZO_PP_ECONCAT3(_lzo1_,COMPRESS_ID,_compress_func)
/***********************************************************************
diff --git a/app/lzo/src/lzo1_cm.ch b/app/lzo/src/lzo1_cm.ch
index 148c9faf..9e6ee32f 100644
--- a/app/lzo/src/lzo1_cm.ch
+++ b/app/lzo/src/lzo1_cm.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1_d.ch b/app/lzo/src/lzo1_d.ch
index 40a5bfdc..e4dff04e 100644
--- a/app/lzo/src/lzo1_d.ch
+++ b/app/lzo/src/lzo1_d.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -72,10 +57,13 @@
#undef TEST_IP
#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
#undef TEST_LB
#undef TEST_LBO
#undef NEED_IP
#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
#undef HAVE_TEST_IP
#undef HAVE_TEST_OP
#undef HAVE_NEED_IP
@@ -91,6 +79,7 @@
# if (LZO_TEST_OVERRUN_INPUT >= 2)
# define NEED_IP(x) \
if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun
# endif
#endif
@@ -102,12 +91,13 @@
# undef TEST_OP /* don't need both of the tests here */
# define NEED_OP(x) \
if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) 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
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun
#else
# define TEST_LB(m_pos) ((void) 0)
# define TEST_LBO(m_pos,o) ((void) 0)
@@ -131,15 +121,27 @@
# define TEST_OP 1
#endif
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
#if defined(NEED_IP)
# define HAVE_NEED_IP 1
#else
# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
#endif
#if defined(NEED_OP)
# define HAVE_NEED_OP 1
#else
# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
#endif
diff --git a/app/lzo/src/lzo1a.c b/app/lzo/src/lzo1a.c
index 37020dd6..e0894f60 100644
--- a/app/lzo/src/lzo1a.c
+++ b/app/lzo/src/lzo1a.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -140,10 +125,10 @@ lzo1a_decompress ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
- register const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
const lzo_bytep const ip_end = in + in_len;
LZO_UNUSED(wrkmem);
@@ -262,7 +247,7 @@ 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;
+ const lzo_bytep ip;
#if defined(__LZO_HASH_INCREMENTAL)
lzo_xint dv;
#endif
@@ -374,7 +359,7 @@ match:
LZO_STATS(lzo_stats->lit_run_after_long_match[t]++);
assert(ii - im <= MAX_MATCH_LONG);
assert((op[-1] >> LBITS) == 0);
- op[-1] |= t << LBITS;
+ op[-1] = LZO_BYTE(op[-1] | (t << LBITS));
MEMCPY_DS(op, ii, t);
}
else
diff --git a/app/lzo/src/lzo1a_99.c b/app/lzo/src/lzo1a_99.c
index 57f5f32d..0feddbda 100644
--- a/app/lzo/src/lzo1a_99.c
+++ b/app/lzo/src/lzo1a_99.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -109,10 +94,10 @@ _lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len,
************************************************************************/
#define LZO_COMPRESS \
- LZO_CPP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
+ LZO_PP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
- LZO_CPP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
+ LZO_PP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
/***********************************************************************
diff --git a/app/lzo/src/lzo1a_cm.ch b/app/lzo/src/lzo1a_cm.ch
index d86b891e..75289d5b 100644
--- a/app/lzo/src/lzo1a_cm.ch
+++ b/app/lzo/src/lzo1a_cm.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1a_cr.ch b/app/lzo/src/lzo1a_cr.ch
index 9e58e23a..cc1f7b4e 100644
--- a/app/lzo/src/lzo1a_cr.ch
+++ b/app/lzo/src/lzo1a_cr.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -58,9 +43,9 @@
static lzo_bytep
store_run(lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len)
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
op = oo;
ip = ii;
diff --git a/app/lzo/src/lzo1a_de.h b/app/lzo/src/lzo1a_de.h
index 3e4b05a0..28c4be74 100644
--- a/app/lzo/src/lzo1a_de.h
+++ b/app/lzo/src/lzo1a_de.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_1.c b/app/lzo/src/lzo1b_1.c
index bad1486a..7dfa93a5 100644
--- a/app/lzo/src/lzo1b_1.c
+++ b/app/lzo/src/lzo1b_1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_2.c b/app/lzo/src/lzo1b_2.c
index 0d456b8a..cfe8adf2 100644
--- a/app/lzo/src/lzo1b_2.c
+++ b/app/lzo/src/lzo1b_2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_3.c b/app/lzo/src/lzo1b_3.c
index af7b12da..b1059950 100644
--- a/app/lzo/src/lzo1b_3.c
+++ b/app/lzo/src/lzo1b_3.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_4.c b/app/lzo/src/lzo1b_4.c
index 9ce8abf3..c666d6d1 100644
--- a/app/lzo/src/lzo1b_4.c
+++ b/app/lzo/src/lzo1b_4.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_5.c b/app/lzo/src/lzo1b_5.c
index 6052f5fd..67e9facd 100644
--- a/app/lzo/src/lzo1b_5.c
+++ b/app/lzo/src/lzo1b_5.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_6.c b/app/lzo/src/lzo1b_6.c
index d31511ab..bdbcce8c 100644
--- a/app/lzo/src/lzo1b_6.c
+++ b/app/lzo/src/lzo1b_6.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_7.c b/app/lzo/src/lzo1b_7.c
index 5545458b..1d415e05 100644
--- a/app/lzo/src/lzo1b_7.c
+++ b/app/lzo/src/lzo1b_7.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_8.c b/app/lzo/src/lzo1b_8.c
index 693d90ed..a0cb8e12 100644
--- a/app/lzo/src/lzo1b_8.c
+++ b/app/lzo/src/lzo1b_8.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_9.c b/app/lzo/src/lzo1b_9.c
index e6d3fb46..9eb51d60 100644
--- a/app/lzo/src/lzo1b_9.c
+++ b/app/lzo/src/lzo1b_9.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_99.c b/app/lzo/src/lzo1b_99.c
index a0e44462..b39e145f 100644
--- a/app/lzo/src/lzo1b_99.c
+++ b/app/lzo/src/lzo1b_99.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_9x.c b/app/lzo/src/lzo1b_9x.c
index e00186d5..b1c9a1bd 100644
--- a/app/lzo/src/lzo1b_9x.c
+++ b/app/lzo/src/lzo1b_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_c.ch b/app/lzo/src/lzo1b_c.ch
index a17e3adb..4fb79d46 100644
--- a/app/lzo/src/lzo1b_c.ch
+++ b/app/lzo/src/lzo1b_c.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -74,12 +59,15 @@
// I really apologize for this spaghetti code.
************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
LZO_PRIVATE(int)
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;
+ const lzo_bytep ip;
#if (DD_BITS > 0)
#if defined(__LZO_HASH_INCREMENTAL)
lzo_xint dv;
@@ -108,7 +96,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_stats->d_bits = D_BITS;
lzo_stats->min_lookahead = MIN_LOOKAHEAD;
lzo_stats->max_lookbehind = MAX_LOOKBEHIND;
- lzo_stats->compress_id = LZO_CPP_MACRO_EXPAND(COMPRESS_ID);
+ lzo_stats->compress_id = LZO_PP_MACRO_EXPAND(COMPRESS_ID);
#endif
/* init dictionary */
@@ -266,6 +254,9 @@ match:
*out_len = pd(op, out);
return LZO_E_OK; /* compression went ok */
}
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
/*
diff --git a/app/lzo/src/lzo1b_cc.c b/app/lzo/src/lzo1b_cc.c
index cc7c2e87..cf597d52 100644
--- a/app/lzo/src/lzo1b_cc.c
+++ b/app/lzo/src/lzo1b_cc.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_cc.h b/app/lzo/src/lzo1b_cc.h
index fef3556c..d92a095f 100644
--- a/app/lzo/src/lzo1b_cc.h
+++ b/app/lzo/src/lzo1b_cc.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_cm.ch b/app/lzo/src/lzo1b_cm.ch
index 7bd50a78..2a90b509 100644
--- a/app/lzo/src/lzo1b_cm.ch
+++ b/app/lzo/src/lzo1b_cm.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_cr.ch b/app/lzo/src/lzo1b_cr.ch
index 61cc7f6e..faf12e2a 100644
--- a/app/lzo/src/lzo1b_cr.ch
+++ b/app/lzo/src/lzo1b_cr.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -89,7 +74,7 @@
LZO_STATS(lzo_stats->lit_runs_after_m3_match++);
LZO_STATS(lzo_stats->lit_run_after_m3_match[t]++);
assert((m3[-2] >> M3O_BITS) == 0);
- m3[-2] |= LZO_BYTE(t << M3O_BITS);
+ m3[-2] = LZO_BYTE(m3[-2] | (t << M3O_BITS));
}
else
#endif
diff --git a/app/lzo/src/lzo1b_d.ch b/app/lzo/src/lzo1b_d.ch
index fe5f3611..cf253573 100644
--- a/app/lzo/src/lzo1b_d.ch
+++ b/app/lzo/src/lzo1b_d.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -53,10 +38,10 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
- register const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
const lzo_bytep const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
@@ -68,7 +53,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
t = *ip++; /* get marker */
@@ -96,10 +81,10 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
}
NEED_IP(t); NEED_OP(t);
-#if 1 && defined(LZO_UNALIGNED_OK_4)
+#if 1 && (LZO_OPT_UNALIGNED32)
do {
- UA_COPY32(op+0, ip+0);
- UA_COPY32(op+4, ip+4);
+ UA_COPY4(op+0, ip+0);
+ UA_COPY4(op+4, ip+4);
op += 8; ip += 8;
t -= 8;
} while (t > 0);
@@ -113,11 +98,11 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
NEED_IP(t); NEED_OP(t);
/* copy literal run */
-#if 1 && defined(LZO_UNALIGNED_OK_4)
+#if 1 && (LZO_OPT_UNALIGNED32)
if (t >= 4)
{
do {
- UA_COPY32(op, ip);
+ UA_COPY4(op, ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -136,7 +121,7 @@ literal2:
#endif
/* after a literal a match must follow */
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
t = *ip++; /* get R1 marker */
if (t >= R0MIN)
@@ -187,6 +172,7 @@ match:
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += (M4_MIN_LEN - M3_MIN_LEN) + *ip++;
@@ -205,13 +191,13 @@ match:
/* copy match */
assert(m_pos >= out); assert(m_pos < op);
TEST_LB(m_pos); NEED_OP(t + M3_MIN_LEN - 1);
-#if defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (M3_MIN_LEN - 1) && (op - m_pos) >= 4)
{
- UA_COPY32(op, m_pos);
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4 - (M3_MIN_LEN - 1);
do {
- UA_COPY32(op, m_pos);
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
diff --git a/app/lzo/src/lzo1b_d1.c b/app/lzo/src/lzo1b_d1.c
index 3b15686b..cd52b250 100644
--- a/app/lzo/src/lzo1b_d1.c
+++ b/app/lzo/src/lzo1b_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_d2.c b/app/lzo/src/lzo1b_d2.c
index 1c54d583..879b4aef 100644
--- a/app/lzo/src/lzo1b_d2.c
+++ b/app/lzo/src/lzo1b_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_de.h b/app/lzo/src/lzo1b_de.h
index 5cba46f3..c88ee614 100644
--- a/app/lzo/src/lzo1b_de.h
+++ b/app/lzo/src/lzo1b_de.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -120,7 +105,7 @@ extern "C" {
#define __MIN_OFFSET(bits) 1
-#define __MAX_OFFSET(bits) LZO_LSIZE(bits)
+#define __MAX_OFFSET(bits) LZO_SIZE(bits)
#define M1_MIN_OFFSET __MIN_OFFSET(M1X_BITS)
#define M2_MIN_OFFSET __MIN_OFFSET(M2X_BITS)
diff --git a/app/lzo/src/lzo1b_r.ch b/app/lzo/src/lzo1b_r.ch
index c8ebbc54..d6ca5fa2 100644
--- a/app/lzo/src/lzo1b_r.ch
+++ b/app/lzo/src/lzo1b_r.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -48,9 +33,9 @@
LZO_PUBLIC(lzo_bytep )
STORE_RUN ( lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len)
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
LZO_STATS(lzo_stats->literals += r_len);
diff --git a/app/lzo/src/lzo1b_rr.c b/app/lzo/src/lzo1b_rr.c
index e9eb24c8..6442ea85 100644
--- a/app/lzo/src/lzo1b_rr.c
+++ b/app/lzo/src/lzo1b_rr.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_sm.ch b/app/lzo/src/lzo1b_sm.ch
index 89ba3a77..032ec41b 100644
--- a/app/lzo/src/lzo1b_sm.ch
+++ b/app/lzo/src/lzo1b_sm.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_tm.ch b/app/lzo/src/lzo1b_tm.ch
index 94c79e2a..96b96f00 100644
--- a/app/lzo/src/lzo1b_tm.ch
+++ b/app/lzo/src/lzo1b_tm.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1b_xx.c b/app/lzo/src/lzo1b_xx.c
index 49d4dd12..21eec0aa 100644
--- a/app/lzo/src/lzo1b_xx.c
+++ b/app/lzo/src/lzo1b_xx.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_1.c b/app/lzo/src/lzo1c_1.c
index 98dbfae7..fa9ae7d6 100644
--- a/app/lzo/src/lzo1c_1.c
+++ b/app/lzo/src/lzo1c_1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_2.c b/app/lzo/src/lzo1c_2.c
index 181fa9dc..eb48954e 100644
--- a/app/lzo/src/lzo1c_2.c
+++ b/app/lzo/src/lzo1c_2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_3.c b/app/lzo/src/lzo1c_3.c
index 9f5ea878..cd6b861d 100644
--- a/app/lzo/src/lzo1c_3.c
+++ b/app/lzo/src/lzo1c_3.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_4.c b/app/lzo/src/lzo1c_4.c
index 61e4b5d3..81eafa5f 100644
--- a/app/lzo/src/lzo1c_4.c
+++ b/app/lzo/src/lzo1c_4.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_5.c b/app/lzo/src/lzo1c_5.c
index 0efcf2ad..b2fa252a 100644
--- a/app/lzo/src/lzo1c_5.c
+++ b/app/lzo/src/lzo1c_5.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_6.c b/app/lzo/src/lzo1c_6.c
index 5074171b..44760049 100644
--- a/app/lzo/src/lzo1c_6.c
+++ b/app/lzo/src/lzo1c_6.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_7.c b/app/lzo/src/lzo1c_7.c
index 437f0445..0b16c07d 100644
--- a/app/lzo/src/lzo1c_7.c
+++ b/app/lzo/src/lzo1c_7.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_8.c b/app/lzo/src/lzo1c_8.c
index 2a6a67ed..727f2fc1 100644
--- a/app/lzo/src/lzo1c_8.c
+++ b/app/lzo/src/lzo1c_8.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_9.c b/app/lzo/src/lzo1c_9.c
index df961e18..6705bd7d 100644
--- a/app/lzo/src/lzo1c_9.c
+++ b/app/lzo/src/lzo1c_9.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_99.c b/app/lzo/src/lzo1c_99.c
index 0cc1c2d3..bec243b0 100644
--- a/app/lzo/src/lzo1c_99.c
+++ b/app/lzo/src/lzo1c_99.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_9x.c b/app/lzo/src/lzo1c_9x.c
index 4b7091ff..9a7d6d0e 100644
--- a/app/lzo/src/lzo1c_9x.c
+++ b/app/lzo/src/lzo1c_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -306,7 +291,7 @@ lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
else if (lit < 4 && op == c->m3)
{
assert((c->m3[-2] >> M3O_BITS) == 0);
- c->m3[-2] |= LZO_BYTE(lit << M3O_BITS);
+ c->m3[-2] = LZO_BYTE(c->m3[-2] | (lit << M3O_BITS));
MEMCPY_DS(op, ii, lit);
assert(ii + ahead == c->ip - c->look);
c->m3_r++;
diff --git a/app/lzo/src/lzo1c_cc.c b/app/lzo/src/lzo1c_cc.c
index 9618cf3c..f6999dba 100644
--- a/app/lzo/src/lzo1c_cc.c
+++ b/app/lzo/src/lzo1c_cc.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_cc.h b/app/lzo/src/lzo1c_cc.h
index c2f081da..ff63ff06 100644
--- a/app/lzo/src/lzo1c_cc.h
+++ b/app/lzo/src/lzo1c_cc.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_d1.c b/app/lzo/src/lzo1c_d1.c
index 940820cf..63b6eaf4 100644
--- a/app/lzo/src/lzo1c_d1.c
+++ b/app/lzo/src/lzo1c_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_d2.c b/app/lzo/src/lzo1c_d2.c
index b055311f..64bc8e62 100644
--- a/app/lzo/src/lzo1c_d2.c
+++ b/app/lzo/src/lzo1c_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -47,3 +32,17 @@
#define DO_DECOMPRESS lzo1c_decompress_safe
#include "lzo1b_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1c_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1c_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1c_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/app/lzo/src/lzo1c_rr.c b/app/lzo/src/lzo1c_rr.c
index 6a516f68..860d36e1 100644
--- a/app/lzo/src/lzo1c_rr.c
+++ b/app/lzo/src/lzo1c_rr.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1c_xx.c b/app/lzo/src/lzo1c_xx.c
index c9af645d..7a0e5940 100644
--- a/app/lzo/src/lzo1c_xx.c
+++ b/app/lzo/src/lzo1c_xx.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1f_1.c b/app/lzo/src/lzo1f_1.c
index 269887ef..0f8612e4 100644
--- a/app/lzo/src/lzo1f_1.c
+++ b/app/lzo/src/lzo1f_1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -72,7 +57,7 @@ int 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;
+ 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 - 9;
@@ -86,7 +71,7 @@ int do_compress ( const lzo_bytep in , lzo_uint in_len,
ip++;
for (;;)
{
- register const lzo_bytep m_pos;
+ const lzo_bytep m_pos;
LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
lzo_uint m_len;
lzo_uint dindex;
@@ -110,8 +95,8 @@ int do_compress ( const lzo_bytep in , lzo_uint in_len,
try_match:
-#if 0 && defined(LZO_UNALIGNED_OK_2)
- if (UA_GET16(m_pos) != UA_GET16(ip))
+#if 0 && (LZO_OPT_UNALIGNED16)
+ if (UA_GET_NE16(m_pos) != UA_GET_NE16(ip))
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
#endif
@@ -155,21 +140,22 @@ match:
lit = pd(ip,ii);
if (lit > 0)
{
- register lzo_uint t = lit;
+ lzo_uint t = lit;
if (t < 4 && op > out)
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
{
- register lzo_uint tt = t - 31;
+ lzo_uint tt = t - 31;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
- *op++ = 0;
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
@@ -228,7 +214,8 @@ match:
while (m_len > 255)
{
m_len -= 255;
- *op++ = 0;
+ UA_SET1(op, 0);
+ op++;
}
assert(m_len > 0);
*op++ = LZO_BYTE(m_len);
@@ -246,26 +233,28 @@ match:
/* store final literal run */
if (pd(in_end,ii) > 0)
{
- register lzo_uint t = pd(in_end,ii);
+ lzo_uint t = pd(in_end,ii);
if (t < 4 && op > out)
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
{
- register lzo_uint tt = t - 31;
+ lzo_uint tt = t - 31;
*op++ = 0;
while (tt > 255)
{
tt -= 255;
- *op++ = 0;
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
- do *op++ = *ii++; while (--t > 0);
+ UA_COPYN(op, ii, t);
+ op += t;
}
*out_len = pd(op, out);
diff --git a/app/lzo/src/lzo1f_9x.c b/app/lzo/src/lzo1f_9x.c
index 3846651a..eb78d8cb 100644
--- a/app/lzo/src/lzo1f_9x.c
+++ b/app/lzo/src/lzo1f_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -112,7 +97,7 @@ static lzo_bytep
STORE_RUN ( lzo_bytep op, const lzo_bytep ii, lzo_uint t, lzo_bytep out )
{
if (t < 4 && op > out)
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
else if (t <= 31)
*op++ = LZO_BYTE(t);
else
diff --git a/app/lzo/src/lzo1f_d.ch b/app/lzo/src/lzo1f_d.ch
index 9e942f51..b22916e5 100644
--- a/app/lzo/src/lzo1f_d.ch
+++ b/app/lzo/src/lzo1f_d.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -53,10 +38,10 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
- register const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
const lzo_bytep const ip_end = in + in_len;
#if defined(HAVE_ANY_OP)
@@ -70,7 +55,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
t = *ip++;
if (t > 31)
@@ -84,17 +69,18 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
{
t += 255;
ip++;
+ TEST_IV(t);
NEED_IP(1);
}
t += 31 + *ip++;
}
/* copy literals */
assert(t > 0); NEED_OP(t); NEED_IP(t+1);
-#if defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED32)
if (t >= 4)
{
do {
- UA_COPY32(op, ip);
+ UA_COPY4(op, ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -105,7 +91,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
t = *ip++;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
/* handle matches */
if (t < 32)
@@ -138,14 +124,15 @@ match:
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 31 + *ip++;
}
NEED_IP(2);
m_pos = op;
-#if defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= UA_GET16(ip) >> 2;
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
ip += 2;
#else
m_pos -= *ip++ >> 2;
@@ -157,13 +144,13 @@ match:
/* copy match */
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
- UA_COPY32(op, m_pos);
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- UA_COPY32(op, m_pos);
+ UA_COPY4(op, m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
diff --git a/app/lzo/src/lzo1f_d1.c b/app/lzo/src/lzo1f_d1.c
index 0b80696d..0c505584 100644
--- a/app/lzo/src/lzo1f_d1.c
+++ b/app/lzo/src/lzo1f_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1f_d2.c b/app/lzo/src/lzo1f_d2.c
index 7bc407d1..b762a7af 100644
--- a/app/lzo/src/lzo1f_d2.c
+++ b/app/lzo/src/lzo1f_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -47,3 +32,17 @@
#define DO_DECOMPRESS lzo1f_decompress_safe
#include "lzo1f_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1f_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1f_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1f_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/app/lzo/src/lzo1x_1.c b/app/lzo/src/lzo1x_1.c
index ca60c44a..2bdecce0 100644
--- a/app/lzo/src/lzo1x_1.c
+++ b/app/lzo/src/lzo1x_1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,11 +27,11 @@
#include "lzo_conf.h"
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#endif
#define LZO_NEED_DICT_H 1
diff --git a/app/lzo/src/lzo1x_1k.c b/app/lzo/src/lzo1x_1k.c
index 4d312221..cbfa2344 100644
--- a/app/lzo/src/lzo1x_1k.c
+++ b/app/lzo/src/lzo1x_1k.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,11 +27,11 @@
#include "lzo_conf.h"
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#endif
#define LZO_NEED_DICT_H 1
diff --git a/app/lzo/src/lzo1x_1l.c b/app/lzo/src/lzo1x_1l.c
index 018bedd9..ee857bce 100644
--- a/app/lzo/src/lzo1x_1l.c
+++ b/app/lzo/src/lzo1x_1l.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,11 +27,11 @@
#include "lzo_conf.h"
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#endif
#define LZO_NEED_DICT_H 1
diff --git a/app/lzo/src/lzo1x_1o.c b/app/lzo/src/lzo1x_1o.c
index b3cba7e0..28fdaffc 100644
--- a/app/lzo/src/lzo1x_1o.c
+++ b/app/lzo/src/lzo1x_1o.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,11 +27,11 @@
#include "lzo_conf.h"
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#define D_BITS 13
#endif
diff --git a/app/lzo/src/lzo1x_9x.c b/app/lzo/src/lzo1x_9x.c
index f910a69e..9de75df0 100644
--- a/app/lzo/src/lzo1x_9x.c
+++ b/app/lzo/src/lzo1x_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -91,9 +76,9 @@
# define HEAD3(b,p) \
((((((lzo_xint)b[p]<<3)^b[p+1])<<3)^b[p+2]) & (SWD_HSIZE-1))
#endif
-#if 0 && defined(LZO_UNALIGNED_OK_4) && defined(LZO_ABI_LITTLE_ENDIAN)
+#if 0 && (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
# define HEAD3(b,p) \
- (((* (lzo_uint32p) &b[p]) ^ ((* (lzo_uint32p) &b[p])>>10)) & (SWD_HSIZE-1))
+ (((* (lzo_uint32_tp) &b[p]) ^ ((* (lzo_uint32_tp) &b[p])>>10)) & (SWD_HSIZE-1))
#endif
#include "lzo_mchw.ch"
@@ -111,7 +96,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
- lzo_uint32 flags );
+ lzo_uint32_t flags );
/***********************************************************************
@@ -289,9 +274,9 @@ STORE_RUN ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii, lzo_uint t )
else if (t <= 3)
{
#if defined(LZO1Z)
- op[-1] |= LZO_BYTE(t);
+ op[-1] = LZO_BYTE(op[-1] | t);
#else
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
#endif
c->lit1_r++;
}
@@ -543,7 +528,7 @@ lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
lzo_uint max_lazy,
lzo_uint nice_length,
lzo_uint max_chain,
- lzo_uint32 flags )
+ lzo_uint32_t flags )
{
lzo_bytep op;
const lzo_bytep ii;
@@ -821,7 +806,7 @@ lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len,
lzo_uint max_lazy;
lzo_uint nice_length;
lzo_uint max_chain;
- lzo_uint32 flags;
+ lzo_uint32_t flags;
} c[9] = {
/* faster compression */
{ 0, 0, 0, 8, 4, 0 },
diff --git a/app/lzo/src/lzo1x_c.ch b/app/lzo/src/lzo1x_c.ch
index b2646249..805f71d3 100644
--- a/app/lzo/src/lzo1x_c.ch
+++ b/app/lzo/src/lzo1x_c.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -44,20 +29,9 @@
#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
/* choose a unique name to better help PGO optimizations */
-# define do_compress LZO_CPP_ECONCAT2(DO_COMPRESS,_core)
+# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core)
#endif
-#if defined(UA_GET64) && (LZO_ABI_BIG_ENDIAN)
-# define WANT_lzo_bitops_clz64 1
-#elif defined(UA_GET64) && (LZO_ABI_LITTLE_ENDIAN)
-# define WANT_lzo_bitops_ctz64 1
-#elif defined(UA_GET32) && (LZO_ABI_BIG_ENDIAN)
-# define WANT_lzo_bitops_clz32 1
-#elif defined(UA_GET32) && (LZO_ABI_LITTLE_ENDIAN)
-# define WANT_lzo_bitops_ctz32 1
-#endif
-#include "lzo_func.ch"
-
/***********************************************************************
// compress a block of data.
@@ -68,7 +42,7 @@ do_compress ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_uint ti, lzo_voidp wrkmem)
{
- register const lzo_bytep ip;
+ 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 - 20;
@@ -107,8 +81,8 @@ next:
goto literal;
try_match:
-#if defined(UA_GET32)
- if (UA_GET32(m_pos) != UA_GET32(ip))
+#if (LZO_OPT_UNALIGNED32)
+ if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip))
#else
if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
#endif
@@ -125,18 +99,18 @@ literal:
lzo_uint m_off;
lzo_uint m_len;
{
- lzo_uint32 dv;
+ lzo_uint32_t dv;
lzo_uint dindex;
literal:
ip += 1 + ((ip - ii) >> 5);
next:
if __lzo_unlikely(ip >= ip_end)
break;
- dv = UA_GET32(ip);
+ dv = UA_GET_LE32(ip);
dindex = DINDEX(dv,ip);
GINDEX(m_off,m_pos,in+dict,dindex,in);
UPDATE_I(dict,0,dindex,ip,in);
- if __lzo_unlikely(dv != UA_GET32(m_pos))
+ if __lzo_unlikely(dv != UA_GET_LE32(m_pos))
goto literal;
}
#endif
@@ -145,32 +119,25 @@ next:
ii -= ti; ti = 0;
{
- register lzo_uint t = pd(ip,ii);
+ lzo_uint t = pd(ip,ii);
if (t != 0)
{
if (t <= 3)
{
- op[-2] |= LZO_BYTE(t);
-#if defined(UA_COPY32)
- UA_COPY32(op, ii);
+ op[-2] = LZO_BYTE(op[-2] | t);
+#if (LZO_OPT_UNALIGNED32)
+ UA_COPY4(op, ii);
op += t;
#else
{ do *op++ = *ii++; while (--t > 0); }
#endif
}
-#if defined(UA_COPY32) || defined(UA_COPY64)
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
else if (t <= 16)
{
*op++ = LZO_BYTE(t - 3);
-#if defined(UA_COPY64)
- UA_COPY64(op, ii);
- UA_COPY64(op+8, ii+8);
-#else
- UA_COPY32(op, ii);
- UA_COPY32(op+4, ii+4);
- UA_COPY32(op+8, ii+8);
- UA_COPY32(op+12, ii+12);
-#endif
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
op += t;
}
#endif
@@ -180,31 +147,21 @@ next:
*op++ = LZO_BYTE(t - 3);
else
{
- register lzo_uint tt = t - 18;
+ lzo_uint tt = t - 18;
*op++ = 0;
while __lzo_unlikely(tt > 255)
{
tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
-#if defined(UA_COPY32) || defined(UA_COPY64)
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
do {
-#if defined(UA_COPY64)
- UA_COPY64(op, ii);
- UA_COPY64(op+8, ii+8);
-#else
- UA_COPY32(op, ii);
- UA_COPY32(op+4, ii+4);
- UA_COPY32(op+8, ii+8);
- UA_COPY32(op+12, ii+12);
-#endif
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
op += 16; ii += 16; t -= 16;
} while (t >= 16); if (t > 0)
#endif
@@ -214,26 +171,26 @@ next:
}
m_len = 4;
{
-#if defined(UA_GET64)
- lzo_uint64 v;
- v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+#if (LZO_OPT_UNALIGNED64)
+ lzo_uint64_t v;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
if __lzo_unlikely(v == 0) {
do {
m_len += 8;
- v = UA_GET64(ip + m_len) ^ UA_GET64(m_pos + m_len);
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (v == 0);
}
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz64)
- m_len += lzo_bitops_clz64(v) / CHAR_BIT;
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64)
+ m_len += lzo_bitops_ctlz64(v) / CHAR_BIT;
#elif (LZO_ABI_BIG_ENDIAN)
if ((v >> (64 - CHAR_BIT)) == 0) do {
v <<= CHAR_BIT;
m_len += 1;
} while ((v >> (64 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz64)
- m_len += lzo_bitops_ctz64(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64)
+ m_len += lzo_bitops_cttz64(v) / CHAR_BIT;
#elif (LZO_ABI_LITTLE_ENDIAN)
if ((v & UCHAR_MAX) == 0) do {
v >>= CHAR_BIT;
@@ -244,26 +201,30 @@ next:
m_len += 1;
} while (ip[m_len] == m_pos[m_len]);
#endif
-#elif defined(UA_GET32)
- lzo_uint32 v;
- v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+#elif (LZO_OPT_UNALIGNED32)
+ lzo_uint32_t v;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
if __lzo_unlikely(v == 0) {
do {
m_len += 4;
- v = UA_GET32(ip + m_len) ^ UA_GET32(m_pos + m_len);
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if (v != 0)
+ break;
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (v == 0);
}
-#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_clz32)
- m_len += lzo_bitops_clz32(v) / CHAR_BIT;
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32)
+ m_len += lzo_bitops_ctlz32(v) / CHAR_BIT;
#elif (LZO_ABI_BIG_ENDIAN)
if ((v >> (32 - CHAR_BIT)) == 0) do {
v <<= CHAR_BIT;
m_len += 1;
} while ((v >> (32 - CHAR_BIT)) == 0);
-#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_ctz32)
- m_len += lzo_bitops_ctz32(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32)
+ m_len += lzo_bitops_cttz32(v) / CHAR_BIT;
#elif (LZO_ABI_LITTLE_ENDIAN)
if ((v & UCHAR_MAX) == 0) do {
v >>= CHAR_BIT;
@@ -278,6 +239,27 @@ next:
if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
do {
m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
if __lzo_unlikely(ip + m_len >= ip_end)
goto m_len_done;
} while (ip[m_len] == m_pos[m_len]);
@@ -311,11 +293,8 @@ m_len_done:
while __lzo_unlikely(m_len > 255)
{
m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
*op++ = LZO_BYTE(m_len);
}
@@ -334,11 +313,8 @@ m_len_done:
while __lzo_unlikely(m_len > 255)
{
m_len -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
*op++ = LZO_BYTE(m_len);
}
@@ -394,7 +370,7 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
if (op == out && t <= 238)
*op++ = LZO_BYTE(17 + t);
else if (t <= 3)
- op[-2] |= LZO_BYTE(t);
+ op[-2] = LZO_BYTE(op[-2] | t);
else if (t <= 18)
*op++ = LZO_BYTE(t - 3);
else
@@ -405,18 +381,14 @@ DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
while (tt > 255)
{
tt -= 255;
-#if 1 && (LZO_CC_MSC && (_MSC_VER >= 1400))
- /* prevent the compiler from transforming this loop
- * into a memset() call */
- * (volatile unsigned char *) op++ = 0;
-#else
- *op++ = 0;
-#endif
+ UA_SET1(op, 0);
+ op++;
}
assert(tt > 0);
*op++ = LZO_BYTE(tt);
}
- do *op++ = *ii++; while (--t > 0);
+ UA_COPYN(op, ii, t);
+ op += t;
}
*op++ = M4_MARKER | 1;
diff --git a/app/lzo/src/lzo1x_d.ch b/app/lzo/src/lzo1x_d.ch
index 49cf3266..aa0a8e08 100644
--- a/app/lzo/src/lzo1x_d.ch
+++ b/app/lzo/src/lzo1x_d.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -55,14 +40,14 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_voidp wrkmem )
#endif
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register lzo_uint t;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
#if defined(COPY_DICT)
lzo_uint m_off;
const lzo_bytep dict_end;
#else
- register const lzo_bytep m_pos;
+ const lzo_bytep m_pos;
#endif
const lzo_bytep const ip_end = in + in_len;
@@ -97,45 +82,47 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
+ NEED_IP(1);
if (*ip > 17)
{
t = *ip++ - 17;
if (t < 4)
goto match_next;
- assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
do *op++ = *ip++; while (--t > 0);
goto first_literal_run;
}
- while (TEST_IP && TEST_OP)
+ for (;;)
{
+ NEED_IP(3);
t = *ip++;
if (t >= 16)
goto match;
/* a literal run */
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_IV(t);
NEED_IP(1);
}
t += 15 + *ip++;
}
/* copy literals */
- assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
t += 3;
if (t >= 8) do
{
- UA_COPY64(op,ip);
+ UA_COPY8(op,ip);
op += 8; ip += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
}
if (t > 0)
@@ -143,19 +130,19 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
*op++ = *ip++;
if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
}
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (PTR_ALIGNED2_4(op,ip))
{
#endif
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4;
if (--t > 0)
{
if (t >= 4)
{
do {
- UA_COPY32(op,ip);
+ UA_COPY4(op,ip);
op += 4; ip += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *ip++; while (--t > 0);
@@ -163,12 +150,12 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
else
do *op++ = *ip++; while (--t > 0);
}
-#if !defined(LZO_UNALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
}
else
#endif
#endif
-#if !defined(LZO_UNALIGNED_OK_4) && !defined(LZO_UNALIGNED_OK_8)
+#if !(LZO_OPT_UNALIGNED32)
{
*op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
do *op++ = *ip++; while (--t > 0);
@@ -208,7 +195,7 @@ first_literal_run:
/* handle matches */
- do {
+ for (;;) {
match:
if (t >= 64) /* a M2 match */
{
@@ -268,14 +255,15 @@ match:
t &= 31;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 31 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -291,9 +279,9 @@ match:
m_pos = op - off;
last_m_off = off;
}
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
m_pos = op - 1;
- m_pos -= UA_GET16(ip) >> 2;
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos = op - 1;
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
@@ -312,14 +300,15 @@ match:
t &= 7;
if (t == 0)
{
- NEED_IP(1);
while (*ip == 0)
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += 7 + *ip++;
+ NEED_IP(2);
}
#if defined(COPY_DICT)
#if defined(LZO1Z)
@@ -337,8 +326,8 @@ match:
#else /* !COPY_DICT */
#if defined(LZO1Z)
m_pos -= (ip[0] << 6) + (ip[1] >> 2);
-#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
- m_pos -= UA_GET16(ip) >> 2;
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
#else
m_pos -= (ip[0] >> 2) + (ip[1] << 6);
#endif
@@ -387,18 +376,18 @@ match:
#else /* !COPY_DICT */
TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
-#if defined(LZO_UNALIGNED_OK_8) && defined(LZO_UNALIGNED_OK_4)
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
if (op - m_pos >= 8)
{
t += (3 - 1);
if (t >= 8) do
{
- UA_COPY64(op,m_pos);
+ UA_COPY8(op,m_pos);
op += 8; m_pos += 8; t -= 8;
} while (t >= 8);
if (t >= 4)
{
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
}
if (t > 0)
@@ -408,8 +397,8 @@ match:
}
}
else
-#elif defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
{
assert((op - m_pos) >= 4); /* both pointers are aligned */
@@ -417,10 +406,10 @@ match:
if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
{
#endif
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4 - (3 - 1);
do {
- UA_COPY32(op,m_pos);
+ UA_COPY4(op,m_pos);
op += 4; m_pos += 4; t -= 4;
} while (t >= 4);
if (t > 0) do *op++ = *m_pos++; while (--t > 0);
@@ -446,7 +435,7 @@ match_done:
/* copy literals */
match_next:
- assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3);
#if 0
do *op++ = *ip++; while (--t > 0);
#else
@@ -454,17 +443,10 @@ match_next:
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)
- /* no EOF code was found */
- *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));
diff --git a/app/lzo/src/lzo1x_d1.c b/app/lzo/src/lzo1x_d1.c
index aa61399f..2342afdb 100644
--- a/app/lzo/src/lzo1x_d1.c
+++ b/app/lzo/src/lzo1x_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1x_d2.c b/app/lzo/src/lzo1x_d2.c
index 10a3efe1..477522cb 100644
--- a/app/lzo/src/lzo1x_d2.c
+++ b/app/lzo/src/lzo1x_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -47,3 +32,28 @@
#define DO_DECOMPRESS lzo1x_decompress_safe
#include "lzo1x_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1x_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1x_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+LZO_EXTERN(int) lzo1x_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1x_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/app/lzo/src/lzo1x_d3.c b/app/lzo/src/lzo1x_d3.c
index 93cea502..8da06923 100644
--- a/app/lzo/src/lzo1x_d3.c
+++ b/app/lzo/src/lzo1x_d3.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -67,7 +52,7 @@
#define COPY_DICT_DICT(m_len,m_off) \
{ \
- register const lzo_bytep m_pos; \
+ const lzo_bytep m_pos; \
m_off -= pd(op, out); assert(m_off > 0); \
if (m_off > dict_len) goto lookbehind_overrun; \
m_pos = dict_end - m_off; \
@@ -86,7 +71,7 @@
assert(m_len >= 2); assert(m_off > 0); assert(op > out); \
if (m_off <= pd(op, out)) \
{ \
- register const lzo_bytep m_pos = op - m_off; \
+ const lzo_bytep m_pos = op - m_off; \
DICT_MEMMOVE(op,m_pos,m_len,m_off) \
} \
else \
diff --git a/app/lzo/src/lzo1x_o.c b/app/lzo/src/lzo1x_o.c
index 76a5353e..5b3dbafd 100644
--- a/app/lzo/src/lzo1x_o.c
+++ b/app/lzo/src/lzo1x_o.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1x_oo.ch b/app/lzo/src/lzo1x_oo.ch
index 6bd2cf17..ebb406ff 100644
--- a/app/lzo/src/lzo1x_oo.ch
+++ b/app/lzo/src/lzo1x_oo.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -43,6 +28,7 @@
#define TEST_IP (ip < ip_end)
#define TEST_OP (op <= op_end)
+#define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
#define NO_LIT LZO_UINT_MAX
@@ -121,7 +107,7 @@ DO_OPTIMIZE ( lzo_bytep in , lzo_uint in_len,
}
assert(*ip < 16 || (*ip == 17 && in_len == 3));
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
t = *ip++;
if (t >= 16)
@@ -342,7 +328,7 @@ match_done:
match_next:
do *op++ = *ip++; while (--t > 0);
t = *ip++;
- } while (TEST_IP && TEST_OP);
+ } while (TEST_IP_AND_TEST_OP);
}
/* no EOF code was found */
diff --git a/app/lzo/src/lzo1y_1.c b/app/lzo/src/lzo1y_1.c
index e5490098..dfa4487a 100644
--- a/app/lzo/src/lzo1y_1.c
+++ b/app/lzo/src/lzo1y_1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,11 +27,11 @@
#include "lzo_conf.h"
-#if 1 && defined(UA_GET32)
+#if 1 && defined(UA_GET_LE32)
#undef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 0
#undef lzo_dict_t
-#define lzo_dict_t unsigned short
+#define lzo_dict_t lzo_uint16_t
#endif
#define LZO_NEED_DICT_H 1
diff --git a/app/lzo/src/lzo1y_9x.c b/app/lzo/src/lzo1y_9x.c
index dc875768..464d849e 100644
--- a/app/lzo/src/lzo1y_9x.c
+++ b/app/lzo/src/lzo1y_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1y_d1.c b/app/lzo/src/lzo1y_d1.c
index 59129bde..e10877e7 100644
--- a/app/lzo/src/lzo1y_d1.c
+++ b/app/lzo/src/lzo1y_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1y_d2.c b/app/lzo/src/lzo1y_d2.c
index d2da8fa5..0aeeec6e 100644
--- a/app/lzo/src/lzo1y_d2.c
+++ b/app/lzo/src/lzo1y_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -47,3 +32,28 @@
#define DO_DECOMPRESS lzo1y_decompress_safe
#include "lzo1x_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1y_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1y_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1y_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/app/lzo/src/lzo1y_d3.c b/app/lzo/src/lzo1y_d3.c
index 58cae1d7..494a5f52 100644
--- a/app/lzo/src/lzo1y_d3.c
+++ b/app/lzo/src/lzo1y_d3.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1y_o.c b/app/lzo/src/lzo1y_o.c
index 702ca555..27abd469 100644
--- a/app/lzo/src/lzo1y_o.c
+++ b/app/lzo/src/lzo1y_o.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1z_9x.c b/app/lzo/src/lzo1z_9x.c
index 4c25ba39..579b161a 100644
--- a/app/lzo/src/lzo1z_9x.c
+++ b/app/lzo/src/lzo1z_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1z_d1.c b/app/lzo/src/lzo1z_d1.c
index e4e865c8..81cc02ac 100644
--- a/app/lzo/src/lzo1z_d1.c
+++ b/app/lzo/src/lzo1z_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1z_d2.c b/app/lzo/src/lzo1z_d2.c
index 96d12d61..2a132e61 100644
--- a/app/lzo/src/lzo1z_d2.c
+++ b/app/lzo/src/lzo1z_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo1z_d3.c b/app/lzo/src/lzo1z_d3.c
index 1e9db9df..d82dc324 100644
--- a/app/lzo/src/lzo1z_d3.c
+++ b/app/lzo/src/lzo1z_d3.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo2a_9x.c b/app/lzo/src/lzo2a_9x.c
index cd54f192..2fec38c2 100644
--- a/app/lzo/src/lzo2a_9x.c
+++ b/app/lzo/src/lzo2a_9x.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -108,7 +93,7 @@ lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
lzo_swd_p const swd = (lzo_swd_p) wrkmem;
int r;
- lzo_uint32 b = 0; /* bit buffer */
+ lzo_uint32_t b = 0; /* bit buffer */
unsigned k = 0; /* bits in bit buffer */
/* sanity check */
diff --git a/app/lzo/src/lzo2a_d.ch b/app/lzo/src/lzo2a_d.ch
index 48e51caa..1f4acf12 100644
--- a/app/lzo/src/lzo2a_d.ch
+++ b/app/lzo/src/lzo2a_d.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -56,9 +41,9 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
- register lzo_bytep op;
- register const lzo_bytep ip;
- register const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep ip;
+ const lzo_bytep m_pos;
lzo_uint t;
const lzo_bytep const ip_end = in + in_len;
@@ -66,7 +51,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
lzo_bytep const op_end = out + *out_len;
#endif
- lzo_uint32 b = 0; /* bit buffer */
+ lzo_uint32_t b = 0; /* bit buffer */
unsigned k = 0; /* bits in bit buffer */
LZO_UNUSED(wrkmem);
@@ -74,7 +59,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
op = out;
ip = in;
- while (TEST_IP && TEST_OP)
+ while (TEST_IP_AND_TEST_OP)
{
NEEDBITS(1);
if (MASKBITS(1) == 0)
@@ -131,6 +116,7 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
{
t += 255;
ip++;
+ TEST_OV(t);
NEED_IP(1);
}
t += *ip++;
diff --git a/app/lzo/src/lzo2a_d1.c b/app/lzo/src/lzo2a_d1.c
index 55446d03..a32f4cd4 100644
--- a/app/lzo/src/lzo2a_d1.c
+++ b/app/lzo/src/lzo2a_d1.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo2a_d2.c b/app/lzo/src/lzo2a_d2.c
index 29859b38..c3c3bed3 100644
--- a/app/lzo/src/lzo2a_d2.c
+++ b/app/lzo/src/lzo2a_d2.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo_conf.h b/app/lzo/src/lzo_conf.h
index 5fcf9635..3543b140 100644
--- a/app/lzo/src/lzo_conf.h
+++ b/app/lzo/src/lzo_conf.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -51,23 +36,9 @@
#define __LZO_CONF_H 1
#if !defined(__LZO_IN_MINILZO)
-#if (LZO_CFG_FREESTANDING)
+#if defined(LZO_CFG_FREESTANDING) && (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 (LZO_CFG_NO_UNALIGNED)
-# define ACC_CFG_NO_UNALIGNED 1
-#endif
-#if (LZO_ARCH_GENERIC)
-# define ACC_ARCH_GENERIC 1
-#endif
-#if (LZO_ABI_NEUTRAL_ENDIAN)
-# define ACC_ABI_NEUTRAL_ENDIAN 1
-#endif
-#if (LZO_HAVE_CONFIG_H)
-# define ACC_CONFIG_NO_HEADER 1
#endif
#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
# include LZO_CFG_EXTRA_CONFIG_HEADER
@@ -76,9 +47,12 @@
# error "include this file first"
#endif
#include "lzo/lzoconf.h"
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2)
+# include LZO_CFG_EXTRA_CONFIG_HEADER2
+#endif
#endif
-#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED)
+#if (LZO_VERSION < 0x2070) || !defined(__LZOCONF_H_INCLUDED)
# error "version mismatch"
#endif
@@ -87,18 +61,22 @@
// pragmas
************************************************************************/
-#if (LZO_CC_BORLANDC && LZO_ARCH_I086)
-# pragma option -h /* enable fast huge pointers */
+#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100))
+ /* disable bogus "unreachable code" warnings */
+# pragma warning(disable: 4702)
#endif
-
#if (LZO_CC_MSC && (_MSC_VER >= 1000))
# pragma warning(disable: 4127 4701)
+ /* disable warnings about inlining */
+# pragma warning(disable: 4514 4710 4711)
#endif
#if (LZO_CC_MSC && (_MSC_VER >= 1300))
- /* avoid '-Wall' warnings in system header files */
+ /* disable '-Wall' warnings in system header files */
# pragma warning(disable: 4820)
- /* avoid warnings about inlining */
-# pragma warning(disable: 4514 4710 4711)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1800))
+ /* disable '-Wall' warnings in system header files */
+# pragma warning(disable: 4746)
#endif
#if (LZO_CC_SUNPROC)
@@ -114,22 +92,34 @@
//
************************************************************************/
-#if (__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
+#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING)
#elif 1
# include <string.h>
#else
-# define ACC_WANT_ACC_INCD_H 1
+# define LZO_WANT_ACC_INCD_H 1
+#endif
+#if defined(LZO_HAVE_CONFIG_H)
+# define LZO_CFG_NO_CONFIG_HEADER 1
#endif
-#include "miniacc.h"
+#include "lzo_supp.h"
+/* Integral types */
+#if 1 || defined(lzo_int8_t) || defined(lzo_uint8_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1)
+#endif
+#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2)
+#endif
+#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4)
+#endif
+#if defined(lzo_int64_t) || defined(lzo_uint64_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8)
+#endif
#if (LZO_CFG_FREESTANDING)
# undef HAVE_MEMCMP
@@ -141,33 +131,32 @@
#if !(HAVE_MEMCMP)
# undef memcmp
# define memcmp(a,b,c) lzo_memcmp(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memcmp
# define lzo_memcmp(a,b,c) memcmp(a,b,c)
#endif
#if !(HAVE_MEMCPY)
# undef memcpy
# define memcpy(a,b,c) lzo_memcpy(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memcpy
# define lzo_memcpy(a,b,c) memcpy(a,b,c)
#endif
#if !(HAVE_MEMMOVE)
# undef memmove
# define memmove(a,b,c) lzo_memmove(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memmove
# define lzo_memmove(a,b,c) memmove(a,b,c)
#endif
#if !(HAVE_MEMSET)
# undef memset
# define memset(a,b,c) lzo_memset(a,b,c)
-#elif !(__LZO_MMODEL_HUGE)
+#else
# undef lzo_memset
# define lzo_memset(a,b,c) memset(a,b,c)
#endif
-
#undef NDEBUG
#if (LZO_CFG_FREESTANDING)
# undef LZO_DEBUG
@@ -188,27 +177,29 @@
# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
#endif
-#if !defined(__lzo_inline)
-# define __lzo_inline /*empty*/
-#endif
-#if !defined(__lzo_forceinline)
-# define __lzo_forceinline /*empty*/
-#endif
-#if !defined(__lzo_noinline)
-# define __lzo_noinline /*empty*/
-#endif
-
#if (LZO_CFG_PGO)
-# undef __acc_likely
-# undef __acc_unlikely
# undef __lzo_likely
# undef __lzo_unlikely
-# define __acc_likely(e) (e)
-# define __acc_unlikely(e) (e)
# define __lzo_likely(e) (e)
# define __lzo_unlikely(e) (e)
#endif
+#undef _
+#undef __
+#undef ___
+#undef ____
+#undef _p0
+#undef _p1
+#undef _p2
+#undef _p3
+#undef _p4
+#undef _s0
+#undef _s1
+#undef _s2
+#undef _s3
+#undef _s4
+#undef _ww
+
/***********************************************************************
//
@@ -229,13 +220,10 @@
#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array))))
-/* this always fits into 16 bits */
+/* this always fits into 32 bits */
#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)
@@ -243,7 +231,7 @@
#if 0
/* 32*32 multiplies may be faster than 64*64 on some 64-bit machines,
* but then we need extra casts from unsigned<->size_t */
-# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b)))
+# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b)))
#else
# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
#endif
@@ -259,69 +247,89 @@
* even if it is allowed by your system.
*/
-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386 || LZO_ARCH_POWERPC)
-# if (LZO_SIZEOF_SHORT == 2)
-# define LZO_UNALIGNED_OK_2 1
-# endif
-# if (LZO_SIZEOF_INT == 4)
-# define LZO_UNALIGNED_OK_4 1
-# endif
+#include "lzo_func.h"
+
+#ifndef UA_SET1
+#define UA_SET1 LZO_MEMOPS_SET1
#endif
-#if 1 && (LZO_ARCH_AMD64)
-# if defined(LZO_UINT64_MAX)
-# define LZO_UNALIGNED_OK_8 1
-# endif
+#ifndef UA_SET2
+#define UA_SET2 LZO_MEMOPS_SET2
#endif
-#if (LZO_CFG_NO_UNALIGNED)
-# undef LZO_UNALIGNED_OK_2
-# undef LZO_UNALIGNED_OK_4
-# undef LZO_UNALIGNED_OK_8
-#endif
-
-#undef UA_GET16
-#undef UA_SET16
-#undef UA_COPY16
-#undef UA_GET32
-#undef UA_SET32
-#undef UA_COPY32
-#undef UA_GET64
-#undef UA_SET64
-#undef UA_COPY64
-#if defined(LZO_UNALIGNED_OK_2)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(unsigned short) == 2)
-# if 1 && defined(ACC_UA_COPY16)
-# define UA_GET16 ACC_UA_GET16
-# define UA_SET16 ACC_UA_SET16
-# define UA_COPY16 ACC_UA_COPY16
-# else
-# define UA_GET16(p) (* (__lzo_ua_volatile const lzo_ushortp) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET16(p,v) ((* (__lzo_ua_volatile lzo_ushortp) (__lzo_ua_volatile lzo_voidp) (p)) = (unsigned short) (v))
-# define UA_COPY16(d,s) UA_SET16(d, UA_GET16(s))
-# endif
+#ifndef UA_SET3
+#define UA_SET3 LZO_MEMOPS_SET3
#endif
-#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-# if 1 && defined(ACC_UA_COPY32)
-# define UA_GET32 ACC_UA_GET32
-# define UA_SET32 ACC_UA_SET32
-# define UA_COPY32 ACC_UA_COPY32
-# else
-# define UA_GET32(p) (* (__lzo_ua_volatile const lzo_uint32p) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET32(p,v) ((* (__lzo_ua_volatile lzo_uint32p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint32) (v))
-# define UA_COPY32(d,s) UA_SET32(d, UA_GET32(s))
-# endif
+#ifndef UA_SET4
+#define UA_SET4 LZO_MEMOPS_SET4
+#endif
+#ifndef UA_MOVE1
+#define UA_MOVE1 LZO_MEMOPS_MOVE1
+#endif
+#ifndef UA_MOVE2
+#define UA_MOVE2 LZO_MEMOPS_MOVE2
+#endif
+#ifndef UA_MOVE3
+#define UA_MOVE3 LZO_MEMOPS_MOVE3
+#endif
+#ifndef UA_MOVE4
+#define UA_MOVE4 LZO_MEMOPS_MOVE4
+#endif
+#ifndef UA_MOVE8
+#define UA_MOVE8 LZO_MEMOPS_MOVE8
+#endif
+#ifndef UA_COPY1
+#define UA_COPY1 LZO_MEMOPS_COPY1
+#endif
+#ifndef UA_COPY2
+#define UA_COPY2 LZO_MEMOPS_COPY2
+#endif
+#ifndef UA_COPY3
+#define UA_COPY3 LZO_MEMOPS_COPY3
+#endif
+#ifndef UA_COPY4
+#define UA_COPY4 LZO_MEMOPS_COPY4
+#endif
+#ifndef UA_COPY8
+#define UA_COPY8 LZO_MEMOPS_COPY8
+#endif
+#ifndef UA_COPYN
+#define UA_COPYN LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_COPYN_X
+#define UA_COPYN_X LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_GET_LE16
+#define UA_GET_LE16 LZO_MEMOPS_GET_LE16
+#endif
+#ifndef UA_GET_LE32
+#define UA_GET_LE32 LZO_MEMOPS_GET_LE32
+#endif
+#ifdef LZO_MEMOPS_GET_LE64
+#ifndef UA_GET_LE64
+#define UA_GET_LE64 LZO_MEMOPS_GET_LE64
#endif
-#if defined(LZO_UNALIGNED_OK_8)
- LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64) == 8)
-# if 1 && defined(ACC_UA_COPY64)
-# define UA_GET64 ACC_UA_GET64
-# define UA_SET64 ACC_UA_SET64
-# define UA_COPY64 ACC_UA_COPY64
-# else
-# define UA_GET64(p) (* (__lzo_ua_volatile const lzo_uint64p) (__lzo_ua_volatile const lzo_voidp) (p))
-# define UA_SET64(p,v) ((* (__lzo_ua_volatile lzo_uint64p) (__lzo_ua_volatile lzo_voidp) (p)) = (lzo_uint64) (v))
-# define UA_COPY64(d,s) UA_SET64(d, UA_GET64(s))
-# endif
+#endif
+#ifndef UA_GET_NE16
+#define UA_GET_NE16 LZO_MEMOPS_GET_NE16
+#endif
+#ifndef UA_GET_NE32
+#define UA_GET_NE32 LZO_MEMOPS_GET_NE32
+#endif
+#ifdef LZO_MEMOPS_GET_NE64
+#ifndef UA_GET_NE64
+#define UA_GET_NE64 LZO_MEMOPS_GET_NE64
+#endif
+#endif
+#ifndef UA_PUT_LE16
+#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16
+#endif
+#ifndef UA_PUT_LE32
+#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32
+#endif
+#ifndef UA_PUT_NE16
+#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16
+#endif
+#ifndef UA_PUT_NE32
+#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32
#endif
@@ -342,19 +350,13 @@
/***********************************************************************
-// some globals
+//
************************************************************************/
LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
-
-/***********************************************************************
-//
-************************************************************************/
-
#include "lzo_ptr.h"
-
/* Generate compressed data in a deterministic way.
* This is fully portable, and compression can be faster as well.
* A reason NOT to be deterministic is when the block size is
@@ -369,18 +371,14 @@ LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
#ifndef LZO_DICT_USE_PTR
#define LZO_DICT_USE_PTR 1
-#if 0 && (LZO_ARCH_I086)
-# undef LZO_DICT_USE_PTR
-# define LZO_DICT_USE_PTR 0
-#endif
#endif
#if (LZO_DICT_USE_PTR)
# define lzo_dict_t const lzo_bytep
-# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+# define lzo_dict_p lzo_dict_t *
#else
# define lzo_dict_t lzo_uint
-# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+# define lzo_dict_p lzo_dict_t *
#endif
diff --git a/app/lzo/src/lzo_crc.c b/app/lzo/src/lzo_crc.c
index f5632cfc..adb72381 100644
--- a/app/lzo/src/lzo_crc.c
+++ b/app/lzo/src/lzo_crc.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -50,7 +35,7 @@
// see http://www.zlib.org/
************************************************************************/
-static const lzo_uint32 lzo_crc32_table[256] = {
+static const lzo_uint32_t lzo_crc32_table[256] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
@@ -106,7 +91,7 @@ static const lzo_uint32 lzo_crc32_table[256] = {
};
-LZO_PUBLIC(const lzo_uint32p)
+LZO_PUBLIC(const lzo_uint32_tp)
lzo_get_crc32_table(void)
{
return lzo_crc32_table;
@@ -126,15 +111,15 @@ lzo_get_crc32_table(void)
#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
-LZO_PUBLIC(lzo_uint32)
-lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len)
+LZO_PUBLIC(lzo_uint32_t)
+lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len)
{
- lzo_uint32 crc;
+ lzo_uint32_t crc;
#undef table
#if 1
# define table lzo_crc32_table
#else
- const lzo_uint32 * table = lzo_crc32_table;
+ const lzo_uint32_t * table = lzo_crc32_table;
#endif
if (buf == NULL)
diff --git a/app/lzo/src/lzo_dict.h b/app/lzo/src/lzo_dict.h
index 961522c2..c3dd52bf 100644
--- a/app/lzo/src/lzo_dict.h
+++ b/app/lzo/src/lzo_dict.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo_dll.ch b/app/lzo/src/lzo_dll.ch
index 3f56a3b8..3b80edff 100644
--- a/app/lzo/src/lzo_dll.ch
+++ b/app/lzo/src/lzo_dll.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/lzo_func.h b/app/lzo/src/lzo_func.h
new file mode 100644
index 00000000..f11f2ae3
--- /dev/null
+++ b/app/lzo/src/lzo_func.h
@@ -0,0 +1,494 @@
+/* lzo_func.h -- functions
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_FUNC_H
+#define __LZO_FUNC_H 1
+
+
+/***********************************************************************
+// bitops
+************************************************************************/
+
+#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN)
+#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC)
+#define LZO_BITOPS_USE_ASM_BITSCAN 1
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#define LZO_BITOPS_USE_GNUC_BITSCAN 1
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#define LZO_BITOPS_USE_MSC_BITSCAN 1
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#include <intrin.h>
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#pragma intrinsic(_BitScanReverse)
+#pragma intrinsic(_BitScanForward)
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64)
+#pragma intrinsic(_BitScanReverse64)
+#pragma intrinsic(_BitScanForward64)
+#endif
+#endif
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4)
+ unsigned r; r = (unsigned) __builtin_clz(v); return r;
+#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzl(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzll(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4)
+ unsigned r; r = (unsigned) __builtin_ctz(v); return r;
+#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzl(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzll(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_bitops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz32_func);
+#if defined(lzo_uint64_t)
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz64_func);
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+}
+
+
+/***********************************************************************
+// memops
+************************************************************************/
+
+#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED)
+#ifndef __lzo_memops_tcheck
+#define __lzo_memops_tcheck(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b))
+#endif
+#endif
+#ifndef lzo_memops_TU0p
+#define lzo_memops_TU0p void __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU1p
+#define lzo_memops_TU1p unsigned char __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU2p
+#if (LZO_OPT_UNALIGNED16)
+typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2;
+#define lzo_memops_TU2p volatile lzo_memops_TU2 *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU2_struct,2)
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#else
+struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias;
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#endif
+#ifndef lzo_memops_TU2p
+#define lzo_memops_TU2p lzo_memops_TU2 *
+#endif
+#endif
+#ifndef lzo_memops_TU4p
+#if (LZO_OPT_UNALIGNED32)
+typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4;
+#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU4_struct,4)
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#else
+struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias;
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#endif
+#ifndef lzo_memops_TU4p
+#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_TU8p
+#if (LZO_OPT_UNALIGNED64)
+typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8;
+#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU8_struct,8)
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#else
+struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias;
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#endif
+#ifndef lzo_memops_TU8p
+#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_set_TU1p
+#define lzo_memops_set_TU1p volatile lzo_memops_TU1p
+#endif
+#ifndef lzo_memops_move_TU1p
+#define lzo_memops_move_TU1p lzo_memops_TU1p
+#endif
+#define LZO_MEMOPS_SET1(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__1[0] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET2(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET3(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET4(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE1(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__1[0] = s__1[0]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE2(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__2[0] = s__2[0]; d__2[1] = s__2[1]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE3(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE4(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE8(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \
+ d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \
+ LZO_BLOCK_END
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1)
+#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss)
+#if (LZO_OPT_UNALIGNED16)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU2,2,1)) { \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss)
+#endif
+#if (LZO_OPT_UNALIGNED32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU4,4,1)) { \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss)
+#endif
+#if (LZO_WORDSIZE != 8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#else
+#if (LZO_OPT_UNALIGNED64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#elif (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU8,8,1)) { \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss)
+#endif
+#endif
+#define LZO_MEMOPS_COPYN(dd,ss,nn) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \
+ lzo_uint n__n = (nn); \
+ while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \
+ if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(&v, ss);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss;
+ unsigned long vv;
+ __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint16_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(&v, ss);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss;
+ unsigned long vv;
+ __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint32_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint32_t) (((lzo_uint32_t)s[0] << 24) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[3]));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+ LZO_MEMOPS_COPY2(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+ LZO_MEMOPS_COPY4(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64)
+#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(dd, &vv);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU2p d = (lzo_memops_TU2p) dd;
+ unsigned long v = vv;
+ __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(dd, &vv);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU4p d = (lzo_memops_TU4p) dd;
+ unsigned long v = vv;
+ __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+ d[2] = LZO_BYTE((vv >> 16) & 0xff);
+ d[3] = LZO_BYTE((vv >> 24) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv)
+{
+ LZO_MEMOPS_COPY2(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv)
+{
+ LZO_MEMOPS_COPY4(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv)
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_memops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_memops_get_le16);
+ LZO_UNUSED_FUNC(lzo_memops_get_le32);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_put_le16);
+ LZO_UNUSED_FUNC(lzo_memops_put_le32);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_unused_funcs);
+}
+
+#endif /* already included */
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/src/lzo_init.c b/app/lzo/src/lzo_init.c
index 2872949c..4128a602 100644
--- a/app/lzo/src/lzo_init.c
+++ b/app/lzo/src/lzo_init.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -59,46 +44,35 @@
#if !defined(__LZO_IN_MINILZO)
-#define ACC_WANT_ACC_CHK_CH 1
-#undef ACCCHK_ASSERT
-#include "miniacc.h"
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#include "lzo_supp.h"
- 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_UINT64_MAX)
- ACCCHK_ASSERT(sizeof(lzo_uint64) == 8)
- ACCCHK_ASSERT_IS_SIGNED_T(lzo_int64)
- ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64)
+ LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+#if !(__LZO_UINTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
#endif
+ LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
-#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
+#undef LZOCHK_ASSERT
/***********************************************************************
//
************************************************************************/
-#define WANT_lzo_bitops_clz32 1
-#define WANT_lzo_bitops_clz64 1
-#define WANT_lzo_bitops_ctz32 1
-#define WANT_lzo_bitops_ctz64 1
-#include "lzo_func.ch"
+union lzo_config_check_union {
+ lzo_uint a[2];
+ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))];
+#if defined(lzo_uint64_t)
+ lzo_uint64_t c[2];
+#endif
+};
+
#if 0
#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
@@ -109,76 +83,90 @@ static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
}
#endif
+
LZO_PUBLIC(int)
_lzo_config_check(void)
{
- lzo_bool r = 1;
- union {
- lzo_xint a[2]; unsigned char b[2*LZO_MAX(8,sizeof(lzo_xint))];
-#if defined(LZO_UNALIGNED_OK_8)
- lzo_uint64 c[2];
-#endif
- unsigned short x[2]; lzo_uint32 y[2]; lzo_uint z[2];
- } u;
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul))
+# if 0
+ /* work around a clang 3.1 and clang 3.2 compiler bug; clang 3.3 and 3.4 work */
+ volatile
+# endif
+#endif
+ union lzo_config_check_union u;
lzo_voidp p;
+ unsigned r = 1;
u.a[0] = u.a[1] = 0;
p = u2p(&u, 0);
r &= ((* (lzo_bytep) p) == 0);
-#if !defined(LZO_CFG_NO_CONFIG_CHECK)
-#if defined(LZO_ABI_BIG_ENDIAN)
+#if !(LZO_CFG_NO_CONFIG_CHECK)
+#if (LZO_ABI_BIG_ENDIAN)
u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
p = u2p(&u, 0);
r &= ((* (lzo_uintp) p) == 128);
#endif
-#if defined(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ABI_LITTLE_ENDIAN)
u.a[0] = u.a[1] = 0; u.b[0] = 128;
p = u2p(&u, 0);
r &= ((* (lzo_uintp) p) == 128);
#endif
-#if defined(LZO_UNALIGNED_OK_2)
u.a[0] = u.a[1] = 0;
- u.b[0] = 1; u.b[sizeof(unsigned short) + 1] = 2;
+ u.b[0] = 1; u.b[3] = 2;
p = u2p(&u, 1);
- r &= ((* (lzo_ushortp) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
+ r &= UA_GET_NE16(p) == 0;
+ r &= UA_GET_LE16(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE16(p) == 128;
u.a[0] = u.a[1] = 0;
- u.b[0] = 3; u.b[sizeof(lzo_uint32) + 1] = 4;
+ u.b[0] = 3; u.b[5] = 4;
p = u2p(&u, 1);
- r &= ((* (lzo_uint32p) p) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_8)
+ r &= UA_GET_NE32(p) == 0;
+ r &= UA_GET_LE32(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE32(p) == 128;
+#if defined(UA_GET_NE64)
u.c[0] = u.c[1] = 0;
- u.b[0] = 5; u.b[sizeof(lzo_uint64) + 1] = 6;
+ u.b[0] = 5; u.b[9] = 6;
p = u2p(&u, 1);
- r &= ((* (lzo_uint64p) p) == 0);
-#endif
-#if defined(lzo_bitops_clz32)
- { unsigned i; lzo_uint32 v = 1;
- for (i = 0; i < 32; i++, v <<= 1)
- r &= lzo_bitops_clz32(v) == 31 - i;
- }
-#endif
-#if defined(lzo_bitops_clz64)
- { unsigned i; lzo_uint64 v = 1;
- for (i = 0; i < 64; i++, v <<= 1)
- r &= lzo_bitops_clz64(v) == 63 - i;
- }
-#endif
-#if defined(lzo_bitops_ctz32)
- { unsigned i; lzo_uint32 v = 1;
- for (i = 0; i < 32; i++, v <<= 1)
- r &= lzo_bitops_ctz32(v) == i;
- }
-#endif
-#if defined(lzo_bitops_ctz64)
- { unsigned i; lzo_uint64 v = 1;
- for (i = 0; i < 64; i++, v <<= 1)
- r &= lzo_bitops_ctz64(v) == i;
- }
-#endif
-#endif
+ u.c[0] = u.c[1] = 0;
+ r &= UA_GET_NE64(p) == 0;
+#if defined(UA_GET_LE64)
+ r &= UA_GET_LE64(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE64(p) == 128;
+#endif
+#endif
+#if defined(lzo_bitops_ctlz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz32(v) == 31 - i;
+ r &= lzo_bitops_ctlz32_func(v) == 31 - i;
+ }}
+#endif
+#if defined(lzo_bitops_ctlz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz64(v) == 63 - i;
+ r &= lzo_bitops_ctlz64_func(v) == 63 - i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz32(v) == i;
+ r &= lzo_bitops_cttz32_func(v) == i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz64(v) == i;
+ r &= lzo_bitops_cttz64_func(v) == i;
+ }}
+#endif
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
return r == 1 ? LZO_E_OK : LZO_E_ERROR;
}
@@ -197,12 +185,12 @@ __lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
#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)
-#include "miniacc.h"
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+#include "lzo_supp.h"
#endif
-#undef ACCCHK_ASSERT
+#undef LZOCHK_ASSERT
if (v == 0)
return LZO_E_ERROR;
@@ -210,7 +198,7 @@ __lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
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)) &&
+ (s4 == -1 || s4 == (int) sizeof(lzo_uint32_t)) &&
(s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
(s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
(s7 == -1 || s7 == (int) sizeof(char *)) &&
diff --git a/app/lzo/src/lzo_mchw.ch b/app/lzo/src/lzo_mchw.ch
index fec8d92b..8273612a 100644
--- a/app/lzo/src/lzo_mchw.ch
+++ b/app/lzo/src/lzo_mchw.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -115,15 +100,7 @@ typedef struct
LZO_COMPRESS_T;
-#if (LZO_CC_BORLANDC && LZO_ARCH_I086) && (__BORLANDC__ < 0x0450)
- /* work around a Borland C 3.1 bug */
-# define getbyte(c) ((c).ip < (c).in_end ? (c).ip +=1, (c).ip[-1] : (-1))
-#elif (LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
- /* work around a code generation bug in Turbo C / Pure C (Atari ST) */
-# define getbyte(c) ((c).ip < (c).in_end ? (int) (unsigned) *((c).ip)++ : (-1))
-#else
-# define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
-#endif
+#define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
#include "lzo_swd.ch"
@@ -135,7 +112,7 @@ LZO_COMPRESS_T;
static int
init_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
const lzo_bytep dict, lzo_uint dict_len,
- lzo_uint32 flags )
+ lzo_uint32_t flags )
{
int r;
diff --git a/app/lzo/src/lzo_ptr.c b/app/lzo/src/lzo_ptr.c
index 46e6e353..2896b70b 100644
--- a/app/lzo/src/lzo_ptr.c
+++ b/app/lzo/src/lzo_ptr.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -54,10 +39,9 @@ __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));
+#error "LZO_ARCH_I086 is unsupported"
#elif (LZO_MM_PVP)
- p = (lzo_uintptr_t) (ptr);
- p = (p << 3) | (p >> 61);
+#error "LZO_MM_PVP is unsupported"
#else
p = (lzo_uintptr_t) PTR_LINEAR(ptr);
#endif
@@ -73,9 +57,8 @@ __lzo_ptr_linear(const lzo_voidp ptr)
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;
+#if (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
#else
lzo_uintptr_t p, n;
p = __lzo_ptr_linear(ptr);
diff --git a/app/lzo/src/lzo_ptr.h b/app/lzo/src/lzo_ptr.h
index 6aa1fc84..1e23548f 100644
--- a/app/lzo/src/lzo_ptr.h
+++ b/app/lzo/src/lzo_ptr.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -56,22 +41,6 @@ extern "C" {
/***********************************************************************
-// Integral types
-************************************************************************/
-
-#if !defined(lzo_uintptr_t)
-# if (__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
-
-
-/***********************************************************************
//
************************************************************************/
@@ -80,21 +49,12 @@ extern "C" {
*
* Note that this only works if the representation and ordering
* of the pointer and the integral is the same (at bit level).
- *
- * Most 16-bit compilers have their own view about pointers -
- * fortunately they don't care about comparing pointers
- * that are pointing to Nirvana.
*/
#if (LZO_ARCH_I086)
-#define PTR(a) ((lzo_bytep) (a))
-/* only need the low bits of the pointer -> offset is ok */
-#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)
+#error "LZO_ARCH_I086 is unsupported"
#elif (LZO_MM_PVP)
-#define PTR(a) ((lzo_bytep) (a))
-#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0)
-#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0)
+#error "LZO_MM_PVP is unsupported"
#else
#define PTR(a) ((lzo_uintptr_t) (a))
#define PTR_LINEAR(a) PTR(a)
@@ -126,24 +86,28 @@ typedef union
unsigned long a_ulong;
lzo_int a_lzo_int;
lzo_uint a_lzo_uint;
- lzo_int32 a_lzo_int32;
- lzo_uint32 a_lzo_uint32;
-#if defined(LZO_UINT64_MAX)
- lzo_int64 a_lzo_int64;
- lzo_uint64 a_lzo_uint64;
+ lzo_xint a_lzo_xint;
+ lzo_int16_t a_lzo_int16_t;
+ lzo_uint16_t a_lzo_uint16_t;
+ lzo_int32_t a_lzo_int32_t;
+ lzo_uint32_t a_lzo_uint32_t;
+#if defined(lzo_uint64_t)
+ lzo_int64_t a_lzo_int64_t;
+ lzo_uint64_t a_lzo_uint64_t;
#endif
+ size_t a_size_t;
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;
+ unsigned char * a_uchar_p;
+ const void * a_c_void_p;
+ const char * a_c_char_p;
+ const unsigned char * a_c_uchar_p;
+ lzo_voidp a_lzo_voidp;
+ lzo_bytep a_lzo_bytep;
+ const lzo_voidp a_c_lzo_voidp;
+ const lzo_bytep a_c_lzo_bytep;
}
lzo_full_align_t;
diff --git a/app/lzo/src/lzo_str.c b/app/lzo/src/lzo_str.c
index faeb5b54..a7ca638f 100644
--- a/app/lzo/src/lzo_str.c
+++ b/app/lzo/src/lzo_str.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -53,23 +38,20 @@
// slow but portable <string.h> stuff, only used in assertions
************************************************************************/
-#if !(__LZO_MMODEL_HUGE)
-# undef ACC_HAVE_MM_HUGE_PTR
+#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
+#ifndef __LZOLIB_FUNCNAME
+#define __LZOLIB_FUNCNAME(f) f
#endif
-#define acc_hsize_t lzo_uint
-#define acc_hvoid_p lzo_voidp
-#define acc_hbyte_p lzo_bytep
-#define ACCLIB_PUBLIC(r,f) LZO_PUBLIC(r) f
-#ifndef __ACCLIB_FUNCNAME
-#define __ACCLIB_FUNCNAME(f) f
-#endif
-#define acc_hmemcmp __ACCLIB_FUNCNAME(lzo_memcmp)
-#define acc_hmemcpy __ACCLIB_FUNCNAME(lzo_memcpy)
-#define acc_hmemmove __ACCLIB_FUNCNAME(lzo_memmove)
-#define acc_hmemset __ACCLIB_FUNCNAME(lzo_memset)
-#define ACC_WANT_ACCLIB_HMEMCPY 1
-#include "miniacc.h"
-#undef ACCLIB_PUBLIC
+#define lzo_hmemcmp __LZOLIB_FUNCNAME(lzo_memcmp)
+#define lzo_hmemcpy __LZOLIB_FUNCNAME(lzo_memcpy)
+#define lzo_hmemmove __LZOLIB_FUNCNAME(lzo_memmove)
+#define lzo_hmemset __LZOLIB_FUNCNAME(lzo_memset)
+#define LZO_WANT_ACCLIB_HMEMCPY 1
+#include "lzo_supp.h"
+#undef LZOLIB_PUBLIC
/*
diff --git a/app/lzo/src/lzo_supp.h b/app/lzo/src/lzo_supp.h
new file mode 100644
index 00000000..f7d0351e
--- /dev/null
+++ b/app/lzo/src/lzo_supp.h
@@ -0,0 +1,3685 @@
+/* lzo_supp.h -- architecture, OS and compiler specific defines
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO_SUPP_H_INCLUDED
+#define __LZO_SUPP_H_INCLUDED 1
+#if (LZO_CFG_NO_CONFIG_HEADER)
+#elif defined(LZO_CFG_CONFIG_HEADER)
+#else
+#if !(LZO_CFG_AUTO_NO_HEADERS)
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_SETJMP_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+# define HAVE_STDIO_H 1
+# define HAVE_STRING_H 1
+#else
+#define STDC_HEADERS 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_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SETJMP_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_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#if (LZO_OS_POSIX)
+# if (LZO_OS_POSIX_AIX)
+# define HAVE_SYS_RESOURCE_H 1
+# elif (LZO_OS_POSIX_FREEBSD || LZO_OS_POSIX_MACOSX || LZO_OS_POSIX_NETBSD || LZO_OS_POSIX_OPENBSD)
+# define HAVE_STRINGS_H 1
+# undef HAVE_MALLOC_H
+# elif (LZO_OS_POSIX_HPUX || LZO_OS_POSIX_INTERIX)
+# define HAVE_ALLOCA_H 1
+# elif (LZO_OS_POSIX_MACOSX && LZO_LIBC_MSL)
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# elif (LZO_OS_POSIX_SOLARIS || LZO_OS_POSIX_SUNOS)
+# define HAVE_ALLOCA_H 1
+# endif
+# if (LZO_LIBC_DIETLIBC || LZO_LIBC_GLIBC || LZO_LIBC_UCLIBC)
+# define HAVE_STRINGS_H 1
+# define HAVE_SYS_MMAN_H 1
+# define HAVE_SYS_RESOURCE_H 1
+# define HAVE_SYS_WAIT_H 1
+# endif
+# if (LZO_LIBC_NEWLIB)
+# undef HAVE_STRINGS_H
+# endif
+#elif (LZO_OS_CYGWIN)
+# define HAVE_IO_H 1
+#elif (LZO_OS_EMX)
+# define HAVE_ALLOCA_H 1
+# define HAVE_IO_H 1
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_MALLOC_H
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+#define HAVE_CONIO_H 1
+#define HAVE_DIRECT_H 1
+#define HAVE_DOS_H 1
+#define HAVE_IO_H 1
+#define HAVE_SHARE_H 1
+#if (LZO_CC_AZTECC)
+# undef HAVE_CONIO_H
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_CC_BORLANDC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# if (LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# endif
+#elif (LZO_CC_DMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# define HAVE_SYS_DIRENT_H 1
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+#elif (LZO_CC_IBMC && LZO_OS_OS2)
+# undef HAVE_DOS_H
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_CC_GHS || LZO_CC_INTELC || LZO_CC_MSC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_CC_LCCWIN32)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_OS_WIN32 && LZO_LIBC_MSL)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DOS_H
+# undef HAVE_SHARE_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_CC_NDPC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_CC_PACIFICC)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_IO_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_OS_WIN32 && LZO_CC_PELLESC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# if (__POCC__ < 280)
+# else
+# define HAVE_SYS_UTIME_H 1
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_PGI) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+#elif (LZO_CC_SYMANTECC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# if (__SC__ < 0x700)
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# endif
+#elif (LZO_CC_TOPSPEEDC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_CC_TURBOC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# if (LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_SIGNAL_H
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UTIME_H
+# endif
+#elif (LZO_CC_WATCOMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+# if (__WATCOMC__ < 950)
+# undef HAVE_UNISTD_H
+# endif
+#elif (LZO_CC_ZORTECHC)
+# undef HAVE_DIRENT_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#endif
+#endif
+#if (LZO_OS_CONSOLE)
+# undef HAVE_DIRENT_H
+#endif
+#if (LZO_OS_EMBEDDED)
+# undef HAVE_DIRENT_H
+#endif
+#if (LZO_LIBC_ISOC90 || LZO_LIBC_ISOC99)
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (LZO_LIBC_GLIBC >= 0x020100ul)
+# define HAVE_STDINT_H 1
+#elif (LZO_LIBC_DIETLIBC)
+# undef HAVE_STDINT_H
+#elif (LZO_LIBC_UCLIBC)
+# define HAVE_STDINT_H 1
+#elif (LZO_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
+# undef HAVE_STDINT_H
+#elif (LZO_CC_DMC) && (__DMC__ >= 0x825)
+# define HAVE_STDINT_H 1
+#endif
+#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
+# define TIME_WITH_SYS_TIME 1
+#endif
+#endif
+#endif
+#if !(LZO_CFG_AUTO_NO_FUNCTIONS)
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LONGJMP 1
+# define HAVE_MEMCMP 1
+# define HAVE_MEMCPY 1
+# define HAVE_MEMMOVE 1
+# define HAVE_MEMSET 1
+# define HAVE_SETJMP 1
+#else
+#define HAVE_ACCESS 1
+#define HAVE_ALLOCA 1
+#define HAVE_ATEXIT 1
+#define HAVE_ATOI 1
+#define HAVE_ATOL 1
+#define HAVE_CHMOD 1
+#define HAVE_CHOWN 1
+#define HAVE_CTIME 1
+#define HAVE_DIFFTIME 1
+#define HAVE_FILENO 1
+#define HAVE_FSTAT 1
+#define HAVE_GETENV 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GMTIME 1
+#define HAVE_ISATTY 1
+#define HAVE_LOCALTIME 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MEMCMP 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKTIME 1
+#define HAVE_QSORT 1
+#define HAVE_RAISE 1
+#define HAVE_RMDIR 1
+#define HAVE_SETJMP 1
+#define HAVE_SIGNAL 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STAT 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_TIME 1
+#define HAVE_UMASK 1
+#define HAVE_UTIME 1
+#define HAVE_VSNPRINTF 1
+#if (LZO_OS_BEOS || LZO_OS_CYGWIN || LZO_OS_POSIX || LZO_OS_QNX || LZO_OS_VMS)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#else
+# define HAVE_STRICMP 1
+# define HAVE_STRNICMP 1
+#endif
+#if (LZO_OS_POSIX)
+# if (LZO_OS_POSIX_AIX)
+# define HAVE_GETRUSAGE 1
+# elif (LZO_OS_POSIX_MACOSX && LZO_LIBC_MSL)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+# elif (LZO_OS_POSIX_UNICOS)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+# if (LZO_CC_TINYC)
+# undef HAVE_ALLOCA
+# endif
+# if (LZO_LIBC_DIETLIBC || LZO_LIBC_GLIBC || LZO_LIBC_UCLIBC)
+# define HAVE_GETRUSAGE 1
+# define HAVE_GETPAGESIZE 1
+# define HAVE_MMAP 1
+# define HAVE_MPROTECT 1
+# define HAVE_MUNMAP 1
+# endif
+#elif (LZO_OS_CYGWIN)
+# if (LZO_CC_GNUC < 0x025a00ul)
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# endif
+# if (LZO_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_OS_EMX)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# undef HAVE_ALLOCA
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_SNPRINTF
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+#undef HAVE_CHOWN
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_LSTAT
+#undef HAVE_UMASK
+#if (LZO_CC_AZTECC)
+# undef HAVE_ALLOCA
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_STRDUP
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_BORLANDC)
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_ALLOCA
+# undef HAVE_UTIME
+# endif
+# if ((__BORLANDC__ < 0x0410) && LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (__BORLANDC__ < 0x0550)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_CC_DMC)
+# if (LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_GHS)
+# undef HAVE_ALLOCA
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_IBMC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_INTELC)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_LCCWIN32)
+# define utime _utime
+#elif (LZO_CC_MSC)
+# if (_MSC_VER < 600)
+# undef HAVE_STRFTIME
+# endif
+# if (_MSC_VER < 700)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (_MSC_VER < 1500)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+# else
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# endif
+# if ((_MSC_VER < 800) && LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (LZO_ARCH_I086) && defined(__cplusplus)
+# undef HAVE_LONGJMP
+# undef HAVE_SETJMP
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__MINGW32__)
+# if (LZO_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_OS_WIN32 && LZO_LIBC_MSL)
+# if (__MSL__ < 0x8000ul)
+# undef HAVE_CHMOD
+# endif
+#elif (LZO_CC_NDPC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_STRNICMP
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+# if defined(__cplusplus)
+# undef HAVE_STAT
+# endif
+#elif (LZO_CC_PACIFICC)
+# undef HAVE_ACCESS
+# undef HAVE_ALLOCA
+# undef HAVE_CHMOD
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_MKTIME
+# undef HAVE_RAISE
+# undef HAVE_SNPRINTF
+# undef HAVE_STRFTIME
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (LZO_OS_WIN32 && LZO_CC_PELLESC)
+# if (__POCC__ < 280)
+# define alloca _alloca
+# undef HAVE_UTIME
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_PGI) && defined(__MINGW32__)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_SYMANTECC)
+# if (LZO_OS_WIN16 && (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# if (__SC__ < 0x600)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+# if (__SC__ < 0x700)
+# undef HAVE_DIFFTIME
+# undef HAVE_UTIME
+# endif
+#elif (LZO_CC_TOPSPEEDC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_TURBOC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_RAISE
+# undef HAVE_SIGNAL
+# endif
+# if (__TURBOC__ < 0x0295)
+# undef HAVE_MKTIME
+# undef HAVE_STRFTIME
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_UTIME
+# endif
+#elif (LZO_CC_WATCOMC)
+# if (__WATCOMC__ < 1100)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (__WATCOMC__ < 1200)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_ZORTECHC)
+# if (LZO_OS_WIN16 && (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# undef HAVE_DIFFTIME
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#endif
+#if (LZO_OS_CONSOLE)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_TIME
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+#endif
+#if (LZO_LIBC_ISOC90 || LZO_LIBC_ISOC99)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FILENO
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_STAT
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# if 1
+# undef HAVE_ALLOCA
+# undef HAVE_ISATTY
+# undef HAVE_MKDIR
+# undef HAVE_RMDIR
+# undef HAVE_STRDUP
+# undef HAVE_STRICMP
+# undef HAVE_STRNICMP
+# endif
+#endif
+#endif
+#endif
+#if !(LZO_CFG_AUTO_NO_SIZES)
+#if !defined(SIZEOF_SHORT) && defined(LZO_SIZEOF_SHORT)
+# define SIZEOF_SHORT LZO_SIZEOF_SHORT
+#endif
+#if !defined(SIZEOF_INT) && defined(LZO_SIZEOF_INT)
+# define SIZEOF_INT LZO_SIZEOF_INT
+#endif
+#if !defined(SIZEOF_LONG) && defined(LZO_SIZEOF_LONG)
+# define SIZEOF_LONG LZO_SIZEOF_LONG
+#endif
+#if !defined(SIZEOF_LONG_LONG) && defined(LZO_SIZEOF_LONG_LONG)
+# define SIZEOF_LONG_LONG LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(SIZEOF___INT32) && defined(LZO_SIZEOF___INT32)
+# define SIZEOF___INT32 LZO_SIZEOF___INT32
+#endif
+#if !defined(SIZEOF___INT64) && defined(LZO_SIZEOF___INT64)
+# define SIZEOF___INT64 LZO_SIZEOF___INT64
+#endif
+#if !defined(SIZEOF_VOID_P) && defined(LZO_SIZEOF_VOID_P)
+# define SIZEOF_VOID_P LZO_SIZEOF_VOID_P
+#endif
+#if !defined(SIZEOF_SIZE_T) && defined(LZO_SIZEOF_SIZE_T)
+# define SIZEOF_SIZE_T LZO_SIZEOF_SIZE_T
+#endif
+#if !defined(SIZEOF_PTRDIFF_T) && defined(LZO_SIZEOF_PTRDIFF_T)
+# define SIZEOF_PTRDIFF_T LZO_SIZEOF_PTRDIFF_T
+#endif
+#endif
+#if (HAVE_SIGNAL) && !defined(RETSIGTYPE)
+# define RETSIGTYPE void
+#endif
+#endif
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if 1 && !defined(lzo_signo_t) && defined(__linux__) && defined(__dietlibc__) && (LZO_SIZEOF_INT != 4)
+# define lzo_signo_t lzo_int32e_t
+#endif
+#if !defined(lzo_signo_t)
+# define lzo_signo_t int
+#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#if (LZO_BROKEN_CDECL_ALT_SYNTAX)
+typedef void __lzo_cdecl_sighandler (*lzo_sighandler_t)(lzo_signo_t);
+#elif defined(RETSIGTYPE)
+typedef RETSIGTYPE (__lzo_cdecl_sighandler *lzo_sighandler_t)(lzo_signo_t);
+#else
+typedef void (__lzo_cdecl_sighandler *lzo_sighandler_t)(lzo_signo_t);
+#endif
+#if defined(__cplusplus)
+}
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCD_H)
+# undef LZO_WANT_ACC_INCD_H
+#ifndef __LZO_INCD_H_INCLUDED
+#define __LZO_INCD_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#ifndef __LZO_FALLBACK_STDDEF_H_INCLUDED
+#define __LZO_FALLBACK_STDDEF_H_INCLUDED 1
+#if defined(__PTRDIFF_TYPE__)
+typedef __PTRDIFF_TYPE__ lzo_fallback_ptrdiff_t;
+#elif defined(__MIPS_PSX2__)
+typedef int lzo_fallback_ptrdiff_t;
+#else
+typedef long lzo_fallback_ptrdiff_t;
+#endif
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ lzo_fallback_size_t;
+#elif defined(__MIPS_PSX2__)
+typedef unsigned int lzo_fallback_size_t;
+#else
+typedef unsigned long lzo_fallback_size_t;
+#endif
+#if !defined(ptrdiff_t)
+typedef lzo_fallback_ptrdiff_t ptrdiff_t;
+#ifndef _PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED 1
+#endif
+#endif
+#if !defined(size_t)
+typedef lzo_fallback_size_t size_t;
+#ifndef _SIZE_T_DEFINED
+#define _SIZE_T_DEFINED 1
+#endif
+#endif
+#if !defined(__cplusplus) && !defined(wchar_t)
+typedef unsigned short wchar_t;
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED 1
+#endif
+#endif
+#ifndef NULL
+#if defined(__cplusplus) && defined(__GNUC__) && (__GNUC__ >= 4)
+#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void*)0)
+#endif
+#endif
+#ifndef offsetof
+#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
+#endif
+#endif
+#elif (LZO_LIBC_FREESTANDING)
+# if defined(HAVE_STDDEF_H) && (HAVE_STDDEF_H+0)
+# include <stddef.h>
+# endif
+# if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+# endif
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# if defined(HAVE_STDIO_H) && (HAVE_STDIO_H+0)
+# include <stdio.h>
+# endif
+# if defined(HAVE_STDDEF_H) && (HAVE_STDDEF_H+0)
+# include <stddef.h>
+# endif
+# if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+# endif
+#else
+#include <stdio.h>
+#if defined(HAVE_TIME_H) && (HAVE_TIME_H+0) && defined(__MSL__) && defined(__cplusplus)
+# include <time.h>
+#endif
+#if defined(HAVE_SYS_TYPES_H) && (HAVE_SYS_TYPES_H+0)
+# include <sys/types.h>
+#endif
+#if defined(HAVE_SYS_STAT_H) && (HAVE_SYS_STAT_H+0)
+# include <sys/stat.h>
+#endif
+#if defined(STDC_HEADERS) && (STDC_HEADERS+0)
+# include <stdlib.h>
+#elif defined(HAVE_STDLIB_H) && (HAVE_STDLIB_H+0)
+# include <stdlib.h>
+#endif
+#include <stddef.h>
+#if defined(HAVE_STRING_H) && (HAVE_STRING_H+0)
+# if defined(STDC_HEADERS) && (STDC_HEADERS+0)
+# elif defined(HAVE_MEMORY_H) && (HAVE_MEMORY_H+0)
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && (HAVE_STRINGS_H+0)
+# include <strings.h>
+#endif
+#if defined(HAVE_INTTYPES_H) && (HAVE_INTTYPES_H+0)
+# include <inttypes.h>
+#endif
+#if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+#endif
+#if defined(HAVE_UNISTD_H) && (HAVE_UNISTD_H+0)
+# include <unistd.h>
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCE_H)
+# undef LZO_WANT_ACC_INCE_H
+#ifndef __LZO_INCE_H_INCLUDED
+#define __LZO_INCE_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# if (HAVE_SETJMP_H)
+# include <setjmp.h>
+# endif
+#else
+#if (HAVE_STDARG_H)
+# include <stdarg.h>
+#endif
+#if (HAVE_CTYPE_H)
+# include <ctype.h>
+#endif
+#if (HAVE_ERRNO_H)
+# include <errno.h>
+#endif
+#if (HAVE_MALLOC_H)
+# include <malloc.h>
+#endif
+#if (HAVE_ALLOCA_H)
+# include <alloca.h>
+#endif
+#if (HAVE_FCNTL_H)
+# include <fcntl.h>
+#endif
+#if (HAVE_DIRENT_H)
+# include <dirent.h>
+#endif
+#if (HAVE_SETJMP_H)
+# include <setjmp.h>
+#endif
+#if (HAVE_SIGNAL_H)
+# include <signal.h>
+#endif
+#if (TIME_WITH_SYS_TIME)
+# include <sys/time.h>
+# include <time.h>
+#elif (HAVE_TIME_H)
+# include <time.h>
+#endif
+#if (HAVE_UTIME_H)
+# include <utime.h>
+#elif (HAVE_SYS_UTIME_H)
+# include <sys/utime.h>
+#endif
+#if (HAVE_IO_H)
+# include <io.h>
+#endif
+#if (HAVE_DOS_H)
+# include <dos.h>
+#endif
+#if (HAVE_DIRECT_H)
+# include <direct.h>
+#endif
+#if (HAVE_SHARE_H)
+# include <share.h>
+#endif
+#if (LZO_CC_NDPC)
+# include <os.h>
+#endif
+#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
+# include <ext.h>
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCI_H)
+# undef LZO_WANT_ACC_INCI_H
+#ifndef __LZO_INCI_H_INCLUDED
+#define __LZO_INCI_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+#else
+#if (LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# include <tos.h>
+#elif (LZO_HAVE_WINDOWS_H)
+# if 1 && !defined(WIN32_LEAN_AND_MEAN)
+# define WIN32_LEAN_AND_MEAN 1
+# endif
+# if 1 && !defined(_WIN32_WINNT)
+# define _WIN32_WINNT 0x0400
+# endif
+# include <windows.h>
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# include <dir.h>
+# endif
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_WIN16)
+# if (LZO_CC_AZTECC)
+# include <model.h>
+# include <stat.h>
+# elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# include <alloc.h>
+# include <dir.h>
+# elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# include <sys/exceptn.h>
+# elif (LZO_CC_PACIFICC)
+# include <unixio.h>
+# include <stat.h>
+# include <sys.h>
+# elif (LZO_CC_WATCOMC)
+# include <i86.h>
+# endif
+#elif (LZO_OS_OS216)
+# if (LZO_CC_WATCOMC)
+# include <i86.h>
+# endif
+#endif
+#if (HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
+#if (HAVE_SYS_RESOURCE_H)
+# include <sys/resource.h>
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if defined(FP_OFF)
+# define LZO_PTR_FP_OFF(x) FP_OFF(x)
+# elif defined(_FP_OFF)
+# define LZO_PTR_FP_OFF(x) _FP_OFF(x)
+# else
+# define LZO_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# endif
+# if defined(FP_SEG)
+# define LZO_PTR_FP_SEG(x) FP_SEG(x)
+# elif defined(_FP_SEG)
+# define LZO_PTR_FP_SEG(x) _FP_SEG(x)
+# else
+# define LZO_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# endif
+# if defined(MK_FP)
+# define LZO_PTR_MK_FP(s,o) MK_FP(s,o)
+# elif defined(_MK_FP)
+# define LZO_PTR_MK_FP(s,o) _MK_FP(s,o)
+# else
+# define LZO_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+# endif
+# if 0
+# undef LZO_PTR_FP_OFF
+# undef LZO_PTR_FP_SEG
+# undef LZO_PTR_MK_FP
+# define LZO_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# define LZO_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# define LZO_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+# endif
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_LIB_H)
+# undef LZO_WANT_ACC_LIB_H
+#ifndef __LZO_LIB_H_INCLUDED
+#define __LZO_LIB_H_INCLUDED 1
+#if !defined(__LZOLIB_FUNCNAME)
+# define __LZOLIB_FUNCNAME(f) f
+#endif
+#if !defined(LZOLIB_EXTERN)
+# define LZOLIB_EXTERN(r,f) extern r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_EXTERN_NOINLINE)
+# if defined(__lzo_noinline)
+# define LZOLIB_EXTERN_NOINLINE(r,f) extern __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_EXTERN_NOINLINE(r,f) extern r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+#if (LZO_SIZEOF_LONG > LZO_SIZEOF_VOID_P)
+# define lzolib_handle_t long
+#else
+# define lzolib_handle_t lzo_intptr_t
+#endif
+#if 0
+LZOLIB_EXTERN(int, lzo_ascii_digit) (int);
+LZOLIB_EXTERN(int, lzo_ascii_islower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_isupper) (int);
+LZOLIB_EXTERN(int, lzo_ascii_tolower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_toupper) (int);
+LZOLIB_EXTERN(int, lzo_ascii_utolower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_utoupper) (int);
+#endif
+#define lzo_ascii_isdigit(c) ((LZO_ICAST(unsigned, c) - 48) < 10)
+#define lzo_ascii_islower(c) ((LZO_ICAST(unsigned, c) - 97) < 26)
+#define lzo_ascii_isupper(c) ((LZO_ICAST(unsigned, c) - 65) < 26)
+#define lzo_ascii_tolower(c) (LZO_ICAST(int, c) + (lzo_ascii_isupper(c) << 5))
+#define lzo_ascii_toupper(c) (LZO_ICAST(int, c) - (lzo_ascii_islower(c) << 5))
+#define lzo_ascii_utolower(c) lzo_ascii_tolower(LZO_ITRUNC(unsigned char, c))
+#define lzo_ascii_utoupper(c) lzo_ascii_toupper(LZO_ITRUNC(unsigned char, c))
+#ifndef lzo_hsize_t
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define lzo_hsize_t unsigned long
+# define lzo_hvoid_p void __huge *
+# define lzo_hchar_p char __huge *
+# define lzo_hchar_pp char __huge * __huge *
+# define lzo_hbyte_p unsigned char __huge *
+#else
+# define lzo_hsize_t size_t
+# define lzo_hvoid_p void *
+# define lzo_hchar_p char *
+# define lzo_hchar_pp char **
+# define lzo_hbyte_p unsigned char *
+#endif
+#endif
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_halloc) (lzo_hsize_t);
+LZOLIB_EXTERN(void, lzo_hfree) (lzo_hvoid_p);
+#if (LZO_OS_DOS16 || LZO_OS_OS216)
+LZOLIB_EXTERN(void __far*, lzo_dos_alloc) (unsigned long);
+LZOLIB_EXTERN(int, lzo_dos_free) (void __far*);
+#endif
+LZOLIB_EXTERN(int, lzo_hmemcmp) (const lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlen) (const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_hstrcmp) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_hstrncmp)(const lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_ascii_hstricmp) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_ascii_hstrnicmp)(const lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_ascii_hmemicmp) (const lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrstr) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstristr) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemmem) (const lzo_hvoid_p, lzo_hsize_t, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemimem) (const lzo_hvoid_p, lzo_hsize_t, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrcpy) (lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrcat) (lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlcpy) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlcat) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_hstrscpy) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_hstrscat) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrccpy) (lzo_hchar_p, const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemccpy) (lzo_hvoid_p, const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrchr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrchr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrichr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrrichr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemchr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemrchr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemichr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemrichr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrrspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrcspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrrcspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrpbrk) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrpbrk) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrsep) (lzo_hchar_pp, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrsep) (lzo_hchar_pp, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrlwr) (lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrupr) (lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemlwr) (lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemupr) (lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hfread) (void *, lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hfwrite) (void *, const lzo_hvoid_p, lzo_hsize_t);
+#if (LZO_HAVE_MM_HUGE_PTR)
+LZOLIB_EXTERN(long, lzo_hread) (int, lzo_hvoid_p, long);
+LZOLIB_EXTERN(long, lzo_hwrite) (int, const lzo_hvoid_p, long);
+#endif
+LZOLIB_EXTERN(long, lzo_safe_hread) (int, lzo_hvoid_p, long);
+LZOLIB_EXTERN(long, lzo_safe_hwrite) (int, const lzo_hvoid_p, long);
+LZOLIB_EXTERN(unsigned, lzo_ua_get_be16) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_be24) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_be32) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_be16) (lzo_hvoid_p, unsigned);
+LZOLIB_EXTERN(void, lzo_ua_set_be24) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(void, lzo_ua_set_be32) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(unsigned, lzo_ua_get_le16) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_le24) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_le32) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_le16) (lzo_hvoid_p, unsigned);
+LZOLIB_EXTERN(void, lzo_ua_set_le24) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(void, lzo_ua_set_le32) (lzo_hvoid_p, lzo_uint32l_t);
+#if defined(lzo_int64l_t)
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_ua_get_be64) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_be64) (lzo_hvoid_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_ua_get_le64) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_le64) (lzo_hvoid_p, lzo_uint64l_t);
+#endif
+LZOLIB_EXTERN_NOINLINE(short, lzo_vget_short) (short, int);
+LZOLIB_EXTERN_NOINLINE(int, lzo_vget_int) (int, int);
+LZOLIB_EXTERN_NOINLINE(long, lzo_vget_long) (long, int);
+#if defined(lzo_int64l_t)
+LZOLIB_EXTERN_NOINLINE(lzo_int64l_t, lzo_vget_lzo_int64l_t) (lzo_int64l_t, int);
+#endif
+LZOLIB_EXTERN_NOINLINE(lzo_hsize_t, lzo_vget_lzo_hsize_t) (lzo_hsize_t, int);
+#if !(LZO_CFG_NO_FLOAT)
+LZOLIB_EXTERN_NOINLINE(float, lzo_vget_float) (float, int);
+#endif
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_EXTERN_NOINLINE(double, lzo_vget_double) (double, int);
+#endif
+LZOLIB_EXTERN_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_p) (lzo_hvoid_p, int);
+LZOLIB_EXTERN_NOINLINE(const lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p, int);
+#if !defined(LZO_FN_PATH_MAX)
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+# define LZO_FN_PATH_MAX 143
+#elif (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# define LZO_FN_PATH_MAX 259
+#elif (LZO_OS_TOS)
+# define LZO_FN_PATH_MAX 259
+#endif
+#endif
+#if !defined(LZO_FN_PATH_MAX)
+# define LZO_FN_PATH_MAX 1023
+#endif
+#if !defined(LZO_FN_NAME_MAX)
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+# define LZO_FN_NAME_MAX 12
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define LZO_FN_NAME_MAX 12
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+#elif (LZO_OS_DOS32)
+# define LZO_FN_NAME_MAX 12
+#endif
+#endif
+#if !defined(LZO_FN_NAME_MAX)
+# define LZO_FN_NAME_MAX LZO_FN_PATH_MAX
+#endif
+#define LZO_FNMATCH_NOESCAPE 1
+#define LZO_FNMATCH_PATHNAME 2
+#define LZO_FNMATCH_PATHSTAR 4
+#define LZO_FNMATCH_PERIOD 8
+#define LZO_FNMATCH_ASCII_CASEFOLD 16
+LZOLIB_EXTERN(int, lzo_fnmatch) (const lzo_hchar_p, const lzo_hchar_p, int);
+#undef __LZOLIB_USE_OPENDIR
+#if (HAVE_DIRENT_H || LZO_CC_WATCOMC)
+# define __LZOLIB_USE_OPENDIR 1
+# if (LZO_OS_DOS32 && defined(__BORLANDC__))
+# elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# elif (LZO_OS_OS2 || LZO_OS_OS216)
+# elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# elif (LZO_OS_WIN32 && !(LZO_HAVE_WINDOWS_H))
+# elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_TOS || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef __LZOLIB_USE_OPENDIR
+# endif
+#endif
+typedef struct
+{
+#if defined(__LZOLIB_USE_OPENDIR)
+ void* u_dirp;
+# if (LZO_CC_WATCOMC)
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned long f_size;
+# endif
+ char f_name[LZO_FN_NAME_MAX+1];
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64)
+ lzolib_handle_t u_handle;
+ unsigned f_attr;
+ unsigned f_size_low;
+ unsigned f_size_high;
+ char f_name[LZO_FN_NAME_MAX+1];
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_TOS || LZO_OS_WIN16)
+ char u_dta[21];
+ unsigned char f_attr;
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned short f_size_low;
+ unsigned short f_size_high;
+ char f_name[LZO_FN_NAME_MAX+1];
+ char u_dirp;
+#else
+ void* u_dirp;
+ char f_name[LZO_FN_NAME_MAX+1];
+#endif
+} lzo_dir_t;
+#ifndef lzo_dir_p
+#define lzo_dir_p lzo_dir_t *
+#endif
+LZOLIB_EXTERN(int, lzo_opendir) (lzo_dir_p, const char*);
+LZOLIB_EXTERN(int, lzo_readdir) (lzo_dir_p);
+LZOLIB_EXTERN(int, lzo_closedir) (lzo_dir_p);
+#if (LZO_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
+# define lzo_alloca(x) __builtin_alloca((x))
+#elif (LZO_CC_GNUC) && (LZO_OS_CONSOLE_PS2)
+# define lzo_alloca(x) __builtin_alloca((x))
+#elif (LZO_CC_BORLANDC || LZO_CC_LCC) && defined(__linux__)
+#elif (HAVE_ALLOCA)
+# define lzo_alloca(x) LZO_STATIC_CAST(void *, alloca((x)))
+#endif
+#if (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
+# if (LZO_OS_WIN16) && (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# else
+# define lzo_stackavail() stackavail()
+# endif
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086) && LZO_CC_MSC && (_MSC_VER >= 700))
+# define lzo_stackavail() _stackavail()
+#elif ((LZO_ARCH_I086) && LZO_CC_MSC)
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && LZO_CC_TURBOC && (__TURBOC__ >= 0x0450))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_TURBOC && (__TURBOC__ >= 0x0400))
+ LZO_EXTERN_C size_t __cdecl stackavail(void);
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_CC_WATCOMC))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_ZORTECHC)
+# define lzo_stackavail() _chkstack()
+#endif
+LZOLIB_EXTERN(lzo_intptr_t, lzo_get_osfhandle) (int);
+LZOLIB_EXTERN(const char *, lzo_getenv) (const char *);
+LZOLIB_EXTERN(int, lzo_isatty) (int);
+LZOLIB_EXTERN(int, lzo_mkdir) (const char*, unsigned);
+LZOLIB_EXTERN(int, lzo_rmdir) (const char*);
+LZOLIB_EXTERN(int, lzo_response) (int*, char***);
+LZOLIB_EXTERN(int, lzo_set_binmode) (int, int);
+#if defined(lzo_int32e_t)
+LZOLIB_EXTERN(lzo_int32e_t, lzo_muldiv32s) (lzo_int32e_t, lzo_int32e_t, lzo_int32e_t);
+LZOLIB_EXTERN(lzo_uint32e_t, lzo_muldiv32u) (lzo_uint32e_t, lzo_uint32e_t, lzo_uint32e_t);
+#endif
+LZOLIB_EXTERN(void, lzo_wildargv) (int*, char***);
+LZOLIB_EXTERN_NOINLINE(void, lzo_debug_break) (void);
+LZOLIB_EXTERN_NOINLINE(void, lzo_debug_nop) (void);
+LZOLIB_EXTERN_NOINLINE(int, lzo_debug_align_check_query) (void);
+LZOLIB_EXTERN_NOINLINE(int, lzo_debug_align_check_enable) (int);
+LZOLIB_EXTERN_NOINLINE(unsigned, lzo_debug_running_on_qemu) (void);
+LZOLIB_EXTERN_NOINLINE(unsigned, lzo_debug_running_on_valgrind) (void);
+#if defined(lzo_int32e_t)
+LZOLIB_EXTERN(int, lzo_tsc_read) (lzo_uint32e_t*);
+#endif
+struct lzo_pclock_handle_t;
+struct lzo_pclock_t;
+typedef struct lzo_pclock_handle_t lzo_pclock_handle_t;
+typedef struct lzo_pclock_t lzo_pclock_t;
+#ifndef lzo_pclock_handle_p
+#define lzo_pclock_handle_p lzo_pclock_handle_t *
+#endif
+#ifndef lzo_pclock_p
+#define lzo_pclock_p lzo_pclock_t *
+#endif
+#define LZO_PCLOCK_REALTIME 0
+#define LZO_PCLOCK_MONOTONIC 1
+#define LZO_PCLOCK_PROCESS_CPUTIME_ID 2
+#define LZO_PCLOCK_THREAD_CPUTIME_ID 3
+typedef int (*lzo_pclock_gettime_t) (lzo_pclock_handle_p, lzo_pclock_p);
+struct lzo_pclock_handle_t {
+ lzolib_handle_t h;
+ int mode;
+ int read_error;
+ const char* name;
+ lzo_pclock_gettime_t gettime;
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t ticks_base;
+#endif
+};
+struct lzo_pclock_t {
+#if defined(lzo_int64l_t)
+ lzo_int64l_t tv_sec;
+#else
+ lzo_int32l_t tv_sec_high;
+ lzo_uint32l_t tv_sec_low;
+#endif
+ lzo_uint32l_t tv_nsec;
+};
+LZOLIB_EXTERN(int, lzo_pclock_open) (lzo_pclock_handle_p, int);
+LZOLIB_EXTERN(int, lzo_pclock_open_default) (lzo_pclock_handle_p);
+LZOLIB_EXTERN(int, lzo_pclock_close) (lzo_pclock_handle_p);
+LZOLIB_EXTERN(void, lzo_pclock_read) (lzo_pclock_handle_p, lzo_pclock_p);
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_EXTERN(double, lzo_pclock_get_elapsed) (lzo_pclock_handle_p, const lzo_pclock_p, const lzo_pclock_p);
+#endif
+LZOLIB_EXTERN(int, lzo_pclock_flush_cpu_cache) (lzo_pclock_handle_p, unsigned);
+struct lzo_getopt_t;
+typedef struct lzo_getopt_t lzo_getopt_t;
+#ifndef lzo_getopt_p
+#define lzo_getopt_p lzo_getopt_t *
+#endif
+struct lzo_getopt_longopt_t;
+typedef struct lzo_getopt_longopt_t lzo_getopt_longopt_t;
+#ifndef lzo_getopt_longopt_p
+#define lzo_getopt_longopt_p lzo_getopt_longopt_t *
+#endif
+struct lzo_getopt_longopt_t {
+ const char* name;
+ int has_arg;
+ int* flag;
+ int val;
+};
+typedef void (*lzo_getopt_opterr_t)(lzo_getopt_p, const char*, void *);
+struct lzo_getopt_t {
+ void *user;
+ const char *progname;
+ int bad_option;
+ char *optarg;
+ lzo_getopt_opterr_t opterr;
+ int optind;
+ int optopt;
+ int errcount;
+ int argc; char** argv;
+ int eof; int shortpos;
+ int pending_rotate_first, pending_rotate_middle;
+};
+enum { LZO_GETOPT_NO_ARG, LZO_GETOPT_REQUIRED_ARG, LZO_GETOPT_OPTIONAL_ARG, LZO_GETOPT_EXACT_ARG = 0x10 };
+enum { LZO_GETOPT_PERMUTE, LZO_GETOPT_RETURN_IN_ORDER, LZO_GETOPT_REQUIRE_ORDER };
+LZOLIB_EXTERN(void, lzo_getopt_init) (lzo_getopt_p g,
+ int start_argc, int argc, char** argv);
+LZOLIB_EXTERN(int, lzo_getopt) (lzo_getopt_p g,
+ const char* shortopts,
+ const lzo_getopt_longopt_p longopts,
+ int* longind);
+typedef struct {
+ lzo_uint32l_t seed;
+} lzo_rand31_t;
+#ifndef lzo_rand31_p
+#define lzo_rand31_p lzo_rand31_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand31) (lzo_rand31_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand31) (lzo_rand31_p);
+#if defined(lzo_int64l_t)
+typedef struct {
+ lzo_uint64l_t seed;
+} lzo_rand48_t;
+#ifndef lzo_rand48_p
+#define lzo_rand48_p lzo_rand48_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand48) (lzo_rand48_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand48) (lzo_rand48_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand48_r32) (lzo_rand48_p);
+#endif
+#if defined(lzo_int64l_t)
+typedef struct {
+ lzo_uint64l_t seed;
+} lzo_rand64_t;
+#ifndef lzo_rand64_p
+#define lzo_rand64_p lzo_rand64_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand64) (lzo_rand64_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand64) (lzo_rand64_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand64_r32) (lzo_rand64_p);
+#endif
+typedef struct {
+ unsigned n;
+ lzo_uint32l_t s[624];
+} lzo_randmt_t;
+#ifndef lzo_randmt_p
+#define lzo_randmt_p lzo_randmt_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srandmt) (lzo_randmt_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_randmt) (lzo_randmt_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_randmt_r32) (lzo_randmt_p);
+#if defined(lzo_int64l_t)
+typedef struct {
+ unsigned n;
+ lzo_uint64l_t s[312];
+} lzo_randmt64_t;
+#ifndef lzo_randmt64_p
+#define lzo_randmt64_p lzo_randmt64_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srandmt64) (lzo_randmt64_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_randmt64_r64) (lzo_randmt64_p);
+#endif
+#define LZO_SPAWN_P_WAIT 0
+#define LZO_SPAWN_P_NOWAIT 1
+LZOLIB_EXTERN(int, lzo_spawnv) (int mode, const char* fn, const char* const * argv);
+LZOLIB_EXTERN(int, lzo_spawnvp) (int mode, const char* fn, const char* const * argv);
+LZOLIB_EXTERN(int, lzo_spawnve) (int mode, const char* fn, const char* const * argv, const char * const envp);
+#endif
+#endif
+#if defined(LZO_WANT_ACC_CXX_H)
+# undef LZO_WANT_ACC_CXX_H
+#ifndef __LZO_CXX_H_INCLUDED
+#define __LZO_CXX_H_INCLUDED 1
+#if defined(__cplusplus)
+#if defined(LZO_CXX_NOTHROW)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (LZO_CC_GHS && !defined(__EXCEPTIONS))
+#elif (LZO_CC_HIGHC)
+#elif (LZO_CC_MSC && (_MSC_VER < 1100))
+#elif (LZO_CC_NDPC)
+#elif (LZO_CC_TURBOC)
+#elif (LZO_CC_WATCOMC && !defined(_CPPUNWIND))
+#elif (LZO_CC_ZORTECHC)
+#else
+# define LZO_CXX_NOTHROW throw()
+#endif
+#if !defined(LZO_CXX_NOTHROW)
+# define LZO_CXX_NOTHROW /*empty*/
+#endif
+#if defined(__LZO_CXX_DO_NEW)
+#elif (LZO_CC_GHS || LZO_CC_NDPC || LZO_CC_PGI)
+# define __LZO_CXX_DO_NEW { return 0; }
+#elif ((LZO_CC_BORLANDC || LZO_CC_TURBOC) && LZO_ARCH_I086)
+# define __LZO_CXX_DO_NEW { return 0; }
+#else
+# define __LZO_CXX_DO_NEW ;
+#endif
+#if defined(__LZO_CXX_DO_DELETE)
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define __LZO_CXX_DO_DELETE { }
+#else
+# define __LZO_CXX_DO_DELETE LZO_CXX_NOTHROW { }
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (LZO_CC_MSC && LZO_MM_HUGE)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_MSC && (_MSC_VER < 1100))
+#elif (LZO_CC_NDPC)
+#elif (LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+#elif (LZO_CC_TURBOC)
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1100))
+#else
+# define __LZO_CXX_HAVE_ARRAY_NEW 1
+#endif
+#if (__LZO_CXX_HAVE_ARRAY_NEW)
+# define __LZO_CXX_HAVE_PLACEMENT_NEW 1
+#endif
+#if (__LZO_CXX_HAVE_PLACEMENT_NEW)
+# if (LZO_CC_GNUC >= 0x030000ul)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_INTELC)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_PGI)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# endif
+#endif
+#if defined(LZO_CXX_DISABLE_NEW_DELETE)
+#elif defined(new) || defined(delete)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025b00ul))
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_HIGHC)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif !(__LZO_CXX_HAVE_ARRAY_NEW)
+# define LZO_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __LZO_CXX_DO_DELETE \
+ protected: static void* operator new(size_t) __LZO_CXX_DO_NEW \
+ private:
+#else
+# define LZO_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __LZO_CXX_DO_DELETE \
+ static void operator delete[](void*) __LZO_CXX_DO_DELETE \
+ private: static void* operator new(size_t) __LZO_CXX_DO_NEW \
+ static void* operator new[](size_t) __LZO_CXX_DO_NEW
+#endif
+#if defined(LZO_CXX_TRIGGER_FUNCTION)
+#else
+# define LZO_CXX_TRIGGER_FUNCTION \
+ protected: virtual const void* lzo_cxx_trigger_function() const; \
+ private:
+#endif
+#if defined(LZO_CXX_TRIGGER_FUNCTION_IMPL)
+#else
+# define LZO_CXX_TRIGGER_FUNCTION_IMPL(klass) \
+ const void* klass::lzo_cxx_trigger_function() const { return LZO_STATIC_CAST(const void *, 0); }
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_CHK_CH)
+# undef LZO_WANT_ACC_CHK_CH
+#if !defined(LZOCHK_ASSERT)
+# define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#endif
+#if !defined(LZOCHK_ASSERT_SIGN_T)
+# define LZOCHK_ASSERT_SIGN_T(type,relop) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, -1) relop LZO_STATIC_CAST(type, 0)) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, ~LZO_STATIC_CAST(type, 0)) relop LZO_STATIC_CAST(type, 0)) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, ~LZO_STATIC_CAST(type, 0)) == LZO_STATIC_CAST(type, -1))
+#endif
+#if !defined(LZOCHK_ASSERT_IS_SIGNED_T)
+# define LZOCHK_ASSERT_IS_SIGNED_T(type) LZOCHK_ASSERT_SIGN_T(type,<)
+#endif
+#if !defined(LZOCHK_ASSERT_IS_UNSIGNED_T)
+# if (LZO_BROKEN_INTEGRAL_PROMOTION)
+# define LZOCHK_ASSERT_IS_UNSIGNED_T(type) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, -1) > LZO_STATIC_CAST(type, 0) )
+# else
+# define LZOCHK_ASSERT_IS_UNSIGNED_T(type) LZOCHK_ASSERT_SIGN_T(type,>)
+# endif
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550) && (__BORLANDC__ < 0x0560))
+# pragma option push -w-8055
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0550))
+# pragma option push -w-osh
+#endif
+#endif
+#if (LZO_0xffffffffL - LZO_UINT32_C(4294967294) != 1)
+# error "preprocessor error"
+#endif
+#if (LZO_0xffffffffL - LZO_UINT32_C(0xfffffffd) != 2)
+# error "preprocessor error"
+#endif
+#if +0
+# error "preprocessor error"
+#endif
+#if -0
+# error "preprocessor error"
+#endif
+#if +0 != 0
+# error "preprocessor error"
+#endif
+#if -0 != 0
+# error "preprocessor error"
+#endif
+#define LZOCHK_VAL 1
+#define LZOCHK_TMP1 LZOCHK_VAL
+#undef LZOCHK_VAL
+#define LZOCHK_VAL 2
+#define LZOCHK_TMP2 LZOCHK_VAL
+#if (LZOCHK_TMP1 != 2)
+# error "preprocessor error 3a"
+#endif
+#if (LZOCHK_TMP2 != 2)
+# error "preprocessor error 3b"
+#endif
+#undef LZOCHK_VAL
+#if (LZOCHK_TMP2)
+# error "preprocessor error 3c"
+#endif
+#if (LZOCHK_TMP2 + 0 != 0)
+# error "preprocessor error 3d"
+#endif
+#undef LZOCHK_TMP1
+#undef LZOCHK_TMP2
+#if 0 || defined(LZOCHK_CFG_PEDANTIC)
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZINT)
+ LZOCHK_ASSERT((_MIPS_SZINT) == 8 * sizeof(int))
+# endif
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZLONG)
+ LZOCHK_ASSERT((_MIPS_SZLONG) == 8 * sizeof(long))
+# endif
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZPTR)
+ LZOCHK_ASSERT((_MIPS_SZPTR) == 8 * sizeof(void *))
+# endif
+#endif
+ LZOCHK_ASSERT(1 == 1)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,1) == 1)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,2) == 3)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,3) == 7)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,8) == 255)
+#if (SIZEOF_INT >= 2)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,15) == 32767)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,16) == 0xffffU)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0u,16) == 0u)
+#else
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,16) == 0xffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,16) == 0ul)
+#endif
+#if (SIZEOF_INT >= 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,31) == 2147483647)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,32) == 0xffffffffU)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0u,32) == 0u)
+#endif
+#if (SIZEOF_LONG >= 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,32) == 0xffffffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,32) == 0ul)
+#endif
+#if (SIZEOF_LONG >= 8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,64) == 0xffffffffffffffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,64) == 0ul)
+#endif
+#if !(LZO_BROKEN_INTEGRAL_PROMOTION)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,SIZEOF_INT*8) == ~0u)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul)
+#endif
+#if 1
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,0) == 0)
+#endif
+#if 1
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,1) == 2)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,1) == 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,1) == 8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,2) == 2+4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,2) == 4+8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,2) == 8+16)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,3) == 2+4+8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,3) == 4+8+16)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,3) == 8+16+32)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,1) == 7)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,2) == 7+14)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,3) == 7+14+28)
+#endif
+#if !(LZO_BROKEN_SIGNED_RIGHT_SHIFT)
+ LZOCHK_ASSERT(((-1) >> 7) == -1)
+#endif
+ LZOCHK_ASSERT(((1) >> 7) == 0)
+#if (LZO_CC_INTELC && (__INTEL_COMPILER >= 900))
+# pragma warning(push)
+# pragma warning(disable: 1025)
+#endif
+ LZOCHK_ASSERT((~0l & ~0) == ~0l)
+ LZOCHK_ASSERT((~0l & ~0u) == ~0u)
+ LZOCHK_ASSERT((~0ul & ~0) == ~0ul)
+ LZOCHK_ASSERT((~0ul & ~0u) == ~0u)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#elif (SIZEOF_INT == 2)
+ LZOCHK_ASSERT((~0l & ~0u) == 0xffffU)
+ LZOCHK_ASSERT((~0ul & ~0u) == 0xffffU)
+#elif (SIZEOF_INT == 4)
+ LZOCHK_ASSERT((~0l & ~0u) == 0xffffffffU)
+ LZOCHK_ASSERT((~0ul & ~0u) == 0xffffffffU)
+#endif
+#if (LZO_CC_INTELC && (__INTEL_COMPILER >= 900))
+# pragma warning(pop)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(signed char)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
+ LZOCHK_ASSERT(sizeof(signed char) == sizeof(char))
+ LZOCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
+ LZOCHK_ASSERT(sizeof(char) == 1)
+#if (LZO_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ LZOCHK_ASSERT(sizeof(char) == sizeof(LZO_STATIC_CAST(char, 0)))
+#endif
+#if defined(__cplusplus)
+ LZOCHK_ASSERT(sizeof('\0') == sizeof(char))
+#else
+# if (LZO_CC_DMC)
+# else
+ LZOCHK_ASSERT(sizeof('\0') == sizeof(int))
+# endif
+#endif
+#if defined(__lzo_alignof)
+ LZOCHK_ASSERT(__lzo_alignof(char) == 1)
+ LZOCHK_ASSERT(__lzo_alignof(signed char) == 1)
+ LZOCHK_ASSERT(__lzo_alignof(unsigned char) == 1)
+#if defined(lzo_int16e_t)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int16e_t) >= 1)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int16e_t) <= 2)
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int32e_t) >= 1)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int32e_t) <= 4)
+#endif
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(short)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
+ LZOCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(short) >= 2)
+#endif
+ LZOCHK_ASSERT(sizeof(short) >= sizeof(char))
+#if (LZO_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ LZOCHK_ASSERT(sizeof(short) == sizeof(LZO_STATIC_CAST(short, 0)))
+#endif
+#if (SIZEOF_SHORT > 0)
+ LZOCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
+ LZOCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(int) >= 2)
+#endif
+ LZOCHK_ASSERT(sizeof(int) >= sizeof(short))
+ LZOCHK_ASSERT(sizeof(int) == sizeof(0))
+ LZOCHK_ASSERT(sizeof(int) == sizeof(LZO_STATIC_CAST(int, 0)))
+#if (SIZEOF_INT > 0)
+ LZOCHK_ASSERT(sizeof(int) == SIZEOF_INT)
+#endif
+ LZOCHK_ASSERT(sizeof(0) == sizeof(int))
+ LZOCHK_ASSERT_IS_SIGNED_T(long)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
+ LZOCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(long) >= 4)
+#endif
+ LZOCHK_ASSERT(sizeof(long) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(long) == sizeof(0L))
+ LZOCHK_ASSERT(sizeof(long) == sizeof(LZO_STATIC_CAST(long, 0)))
+#if (SIZEOF_LONG > 0)
+ LZOCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
+#endif
+ LZOCHK_ASSERT(sizeof(0L) == sizeof(long))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(size_t)
+ LZOCHK_ASSERT(sizeof(size_t) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0)))
+#if (SIZEOF_SIZE_T > 0)
+ LZOCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
+#if !(LZO_BROKEN_SIZEOF)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(LZO_STATIC_CAST(char*, 0) - LZO_STATIC_CAST(char*, 0)))
+# if (LZO_HAVE_MM_HUGE_PTR)
+ LZOCHK_ASSERT(4 == sizeof(LZO_STATIC_CAST(char __huge*, 0) - LZO_STATIC_CAST(char __huge*, 0)))
+# endif
+#endif
+#if (SIZEOF_PTRDIFF_T > 0)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
+#endif
+ LZOCHK_ASSERT(sizeof(void*) >= sizeof(char*))
+#if (SIZEOF_VOID_P > 0)
+ LZOCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
+ LZOCHK_ASSERT(sizeof(char*) == SIZEOF_VOID_P)
+#endif
+#if (LZO_HAVE_MM_HUGE_PTR)
+ LZOCHK_ASSERT(4 == sizeof(void __huge*))
+ LZOCHK_ASSERT(4 == sizeof(char __huge*))
+#endif
+#if (LZO_ABI_I8LP16)
+ LZOCHK_ASSERT((((1u << 7) + 1) >> 7) == 1)
+ LZOCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1)
+#else
+ LZOCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
+ LZOCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#else
+ LZOCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
+#endif
+#endif
+ LZOCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
+#endif
+ LZOCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
+#if defined(lzo_int16e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint16e_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == sizeof(lzo_uint16e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int16e_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint16e_t)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#else
+ LZOCHK_ASSERT((LZO_STATIC_CAST(lzo_uint16e_t, (~LZO_STATIC_CAST(lzo_uint16e_t,0ul))) >> 15) == 1)
+#endif
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_int16e_t, (1 + ~LZO_STATIC_CAST(lzo_int16e_t, 0))) == 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_uint16e_t, (1 + ~LZO_STATIC_CAST(lzo_uint16e_t, 0))) == 0)
+#endif
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32e_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == sizeof(lzo_uint32e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32e_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32e_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32e_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32e_t, 1) << 31) + 1) >> 31) == 1)
+ LZOCHK_ASSERT((LZO_STATIC_CAST(lzo_uint32e_t, (~LZO_STATIC_CAST(lzo_uint32e_t, 0ul))) >> 31) == 1)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_int32e_t, (1 + ~LZO_STATIC_CAST(lzo_int32e_t, 0))) == 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_uint32e_t, (1 + ~LZO_STATIC_CAST(lzo_uint32e_t, 0))) == 0)
+#endif
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) >= sizeof(lzo_int32e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32l_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) == sizeof(lzo_uint32l_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32l_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32l_t, 1) << 31) + 1) >> 31) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(int))
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32f_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_uint32f_t) >= sizeof(lzo_uint32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) == sizeof(lzo_uint32f_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32f_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32f_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32f_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32f_t, 1) << 31) + 1) >> 31) == 1)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64e_t) == 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == sizeof(lzo_uint64e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64e_t)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64e_t)
+#endif
+#endif
+#if defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) >= sizeof(lzo_int64e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64l_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) == sizeof(lzo_uint64l_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int64l_t, 1) << 62) + 1) >> 62) == 1)
+ LZOCHK_ASSERT(((( LZO_INT64_C(1) << 62) + 1) >> 62) == 1)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64l_t)
+ LZOCHK_ASSERT(LZO_UINT64_C(18446744073709551615) > 0)
+#endif
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint64l_t, 1) << 63) + 1) >> 63) == 1)
+ LZOCHK_ASSERT(((( LZO_UINT64_C(1) << 63) + 1) >> 63) == 1)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020600ul))
+ LZOCHK_ASSERT(LZO_INT64_C(9223372036854775807) > LZO_INT64_C(0))
+#else
+ LZOCHK_ASSERT(LZO_INT64_C(9223372036854775807) > 0)
+#endif
+ LZOCHK_ASSERT(LZO_INT64_C(-9223372036854775807) - 1 < 0)
+ LZOCHK_ASSERT( LZO_INT64_C(9223372036854775807) % LZO_INT32_C(2147483629) == 721)
+ LZOCHK_ASSERT( LZO_INT64_C(9223372036854775807) % LZO_INT32_C(2147483647) == 1)
+ LZOCHK_ASSERT(LZO_UINT64_C(9223372036854775807) % LZO_UINT32_C(2147483629) == 721)
+ LZOCHK_ASSERT(LZO_UINT64_C(9223372036854775807) % LZO_UINT32_C(2147483647) == 1)
+#endif
+#if defined(lzo_int64f_t)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64f_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_uint64f_t) >= sizeof(lzo_uint64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) == sizeof(lzo_uint64f_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64f_t)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64f_t)
+#endif
+#endif
+#if !defined(__LZO_INTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_intptr_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == LZO_SIZEOF_LZO_INTPTR_T)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#if defined(lzo_word_t)
+ LZOCHK_ASSERT(LZO_WORDSIZE == LZO_SIZEOF_LZO_WORD_T)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_word_t)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_sword_t)
+ LZOCHK_ASSERT(sizeof(lzo_word_t) == LZO_SIZEOF_LZO_WORD_T)
+ LZOCHK_ASSERT(sizeof(lzo_word_t) == sizeof(lzo_sword_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int8_t) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_uint8_t) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int8_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint8_t)
+#if defined(LZO_INT16_C)
+ LZOCHK_ASSERT(sizeof(LZO_INT16_C(0)) >= 2)
+ LZOCHK_ASSERT(sizeof(LZO_UINT16_C(0)) >= 2)
+ LZOCHK_ASSERT((LZO_UINT16_C(0xffff) >> 15) == 1)
+#endif
+#if defined(LZO_INT32_C)
+ LZOCHK_ASSERT(sizeof(LZO_INT32_C(0)) >= 4)
+ LZOCHK_ASSERT(sizeof(LZO_UINT32_C(0)) >= 4)
+ LZOCHK_ASSERT((LZO_UINT32_C(0xffffffff) >> 31) == 1)
+#endif
+#if defined(LZO_INT64_C)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0560))
+#else
+ LZOCHK_ASSERT(sizeof(LZO_INT64_C(0)) >= 8)
+ LZOCHK_ASSERT(sizeof(LZO_UINT64_C(0)) >= 8)
+#endif
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) >> 63) == 1)
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & ~0) == LZO_UINT64_C(0xffffffffffffffff))
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & ~0l) == LZO_UINT64_C(0xffffffffffffffff))
+#if (SIZEOF_INT == 4)
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# else
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & (~0u+0u)) == 0xffffffffu)
+# endif
+#endif
+#if (SIZEOF_LONG == 4)
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# else
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & (~0ul+0ul)) == 0xfffffffful)
+# endif
+#endif
+#endif
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+ LZOCHK_ASSERT(sizeof(void*) == 2)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 2)
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+#endif
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_COMPACT)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 2)
+#elif (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#endif
+#if (LZO_ABI_ILP32)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_ILP64)
+ LZOCHK_ASSERT(sizeof(int) == 8)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_IP32L64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LLP64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LP32)
+ LZOCHK_ASSERT(sizeof(int) == 2)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LP64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ARCH_I086)
+ LZOCHK_ASSERT(sizeof(size_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#elif (LZO_ARCH_I386 || LZO_ARCH_M68K)
+ LZOCHK_ASSERT(sizeof(size_t) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32)
+ LZOCHK_ASSERT(sizeof(size_t) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#elif (LZO_OS_WIN64)
+ LZOCHK_ASSERT(sizeof(size_t) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 8)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 8)
+#endif
+#if (LZO_CC_NDPC)
+#elif (SIZEOF_INT > 1)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(int, LZO_STATIC_CAST(unsigned char, LZO_STATIC_CAST(signed char, -1))) == 255)
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_KEILC)
+#elif (LZO_CC_NDPC)
+#elif !(LZO_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+ LZOCHK_ASSERT( ((LZO_STATIC_CAST(unsigned char, 128)) << LZO_STATIC_CAST(int, (8*sizeof(int)-8))) < 0)
+#endif
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
+# pragma option pop
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_VGET)
+# undef LZO_WANT_ACCLIB_VGET
+#define __LZOLIB_VGET_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_PUBLIC_NOINLINE)
+# if !defined(__lzo_noinline)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) r __LZOLIB_FUNCNAME(f)
+# elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline __attribute__((__used__)) r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+extern void* volatile lzo_vget_ptr__;
+#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+void* volatile __attribute__((__used__)) lzo_vget_ptr__ = LZO_STATIC_CAST(void *, 0);
+#else
+void* volatile lzo_vget_ptr__ = LZO_STATIC_CAST(void *, 0);
+#endif
+#ifndef __LZOLIB_VGET_BODY
+#define __LZOLIB_VGET_BODY(T) \
+ if __lzo_unlikely(lzo_vget_ptr__) { \
+ typedef T __lzo_may_alias TT; \
+ unsigned char e; expr &= 255; e = LZO_STATIC_CAST(unsigned char, expr); \
+ * LZO_STATIC_CAST(TT *, lzo_vget_ptr__) = v; \
+ * LZO_STATIC_CAST(unsigned char *, lzo_vget_ptr__) = e; \
+ v = * LZO_STATIC_CAST(TT *, lzo_vget_ptr__); \
+ } \
+ return v;
+#endif
+LZOLIB_PUBLIC_NOINLINE(short, lzo_vget_short) (short v, int expr)
+{
+ __LZOLIB_VGET_BODY(short)
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_vget_int) (int v, int expr)
+{
+ __LZOLIB_VGET_BODY(int)
+}
+LZOLIB_PUBLIC_NOINLINE(long, lzo_vget_long) (long v, int expr)
+{
+ __LZOLIB_VGET_BODY(long)
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC_NOINLINE(lzo_int64l_t, lzo_vget_lzo_int64l_t) (lzo_int64l_t v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_int64l_t)
+}
+#endif
+LZOLIB_PUBLIC_NOINLINE(lzo_hsize_t, lzo_vget_lzo_hsize_t) (lzo_hsize_t v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_hsize_t)
+}
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_PUBLIC_NOINLINE(double, lzo_vget_double) (double v, int expr)
+{
+ __LZOLIB_VGET_BODY(double)
+}
+#endif
+LZOLIB_PUBLIC_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_p) (lzo_hvoid_p v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_hvoid_p)
+}
+#if (LZO_ARCH_I086 && LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) && !defined(__cplusplus)
+LZOLIB_PUBLIC_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p vv, int expr)
+{
+ lzo_hvoid_p v = (lzo_hvoid_p) vv;
+ __LZOLIB_VGET_BODY(lzo_hvoid_p)
+}
+#else
+LZOLIB_PUBLIC_NOINLINE(const lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p v, int expr)
+{
+ __LZOLIB_VGET_BODY(const lzo_hvoid_p)
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_HMEMCPY)
+# undef LZO_WANT_ACCLIB_HMEMCPY
+#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) || !(HAVE_MEMCMP)
+ const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMCPY)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMMOVE)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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 cc, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
+ lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s);
+ unsigned char c = LZO_ITRUNC(unsigned char, cc);
+ if __lzo_likely(len > 0) do
+ *p++ = c;
+ while __lzo_likely(--len > 0);
+ return s;
+#else
+ return memset(s, cc, len);
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_RAND)
+# undef LZO_WANT_ACCLIB_RAND
+#define __LZOLIB_RAND_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(void, lzo_srand31) (lzo_rand31_p r, lzo_uint32l_t seed)
+{
+ r->seed = seed & LZO_UINT32_C(0xffffffff);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand31) (lzo_rand31_p r)
+{
+ r->seed = r->seed * LZO_UINT32_C(1103515245) + 12345;
+ r->seed &= LZO_UINT32_C(0x7fffffff);
+ return r->seed;
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srand48) (lzo_rand48_p r, lzo_uint32l_t seed)
+{
+ r->seed = seed & LZO_UINT32_C(0xffffffff);
+ r->seed <<= 16; r->seed |= 0x330e;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand48) (lzo_rand48_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(25214903917) + 11;
+ r->seed &= LZO_UINT64_C(0xffffffffffff);
+ a = r->seed >> 17;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand48_r32) (lzo_rand48_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(25214903917) + 11;
+ r->seed &= LZO_UINT64_C(0xffffffffffff);
+ a = r->seed >> 16;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+#endif
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srand64) (lzo_rand64_p r, lzo_uint64l_t seed)
+{
+ r->seed = seed & LZO_UINT64_C(0xffffffffffffffff);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand64) (lzo_rand64_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(6364136223846793005) + 1;
+#if (LZO_SIZEOF_LZO_INT64L_T > 8)
+ r->seed &= LZO_UINT64_C(0xffffffffffffffff);
+#endif
+ a = r->seed >> 33;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand64_r32) (lzo_rand64_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(6364136223846793005) + 1;
+#if (LZO_SIZEOF_LZO_INT64L_T > 8)
+ r->seed &= LZO_UINT64_C(0xffffffffffffffff);
+#endif
+ a = r->seed >> 32;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+#endif
+LZOLIB_PUBLIC(void, lzo_srandmt) (lzo_randmt_p r, lzo_uint32l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= LZO_UINT32_C(0xffffffff));
+ seed ^= seed >> 30;
+ seed = seed * LZO_UINT32_C(0x6c078965) + i;
+ } while (i != 624);
+ r->n = i;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt) (lzo_randmt_p r)
+{
+ return (__LZOLIB_FUNCNAME(lzo_randmt_r32)(r)) >> 1;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt_r32) (lzo_randmt_p r)
+{
+ lzo_uint32l_t v;
+ if __lzo_unlikely(r->n == 624) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 623; if (LZO_STATIC_CAST(int, j) < 0) j += 624;
+ v = (r->s[i] & LZO_UINT32_C(0x80000000)) ^ (r->s[j] & LZO_UINT32_C(0x7fffffff));
+ j = i - 227; if (LZO_STATIC_CAST(int, j) < 0) j += 624;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= LZO_UINT32_C(0x9908b0df);
+ } while (++i != 624);
+ }
+ { unsigned i = r->n++; v = r->s[i]; }
+ v ^= v >> 11; v ^= (v & LZO_UINT32_C(0x013a58ad)) << 7;
+ v ^= (v & LZO_UINT32_C(0x0001df8c)) << 15; v ^= v >> 18;
+ return v;
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srandmt64) (lzo_randmt64_p r, lzo_uint64l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= LZO_UINT64_C(0xffffffffffffffff));
+ seed ^= seed >> 62;
+ seed = seed * LZO_UINT64_C(0x5851f42d4c957f2d) + i;
+ } while (i != 312);
+ r->n = i;
+}
+#if 0
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt64) (lzo_randmt64_p r)
+{
+ lzo_uint64l_t v;
+ v = (__LZOLIB_FUNCNAME(lzo_randmt64_r64)(r)) >> 33;
+ return LZO_STATIC_CAST(lzo_uint32l_t, v);
+}
+#endif
+LZOLIB_PUBLIC(lzo_uint64l_t, lzo_randmt64_r64) (lzo_randmt64_p r)
+{
+ lzo_uint64l_t v;
+ if __lzo_unlikely(r->n == 312) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 311; if (LZO_STATIC_CAST(int, j) < 0) j += 312;
+ v = (r->s[i] & LZO_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & LZO_UINT64_C(0x7fffffff));
+ j = i - 156; if (LZO_STATIC_CAST(int, j) < 0) j += 312;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= LZO_UINT64_C(0xb5026f5aa96619e9);
+ } while (++i != 312);
+ }
+ { unsigned i = r->n++; v = r->s[i]; }
+ v ^= (v & LZO_UINT64_C(0xaaaaaaaaa0000000)) >> 29;
+ v ^= (v & LZO_UINT64_C(0x38eb3ffff6d3)) << 17;
+ v ^= (v & LZO_UINT64_C(0x7ffbf77)) << 37;
+ return v ^ (v >> 43);
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_RDTSC)
+# undef LZO_WANT_ACCLIB_RDTSC
+#define __LZOLIB_RDTSC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if defined(lzo_int32e_t)
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_AMD64 && LZO_CC_INTELC)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "memory", "rax", "rdx"
+#elif (LZO_ARCH_AMD64)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "rax", "rdx"
+#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "ax", "dx"
+#elif (LZO_ARCH_I386 && LZO_CC_INTELC)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "memory", "eax", "edx"
+#else
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "eax", "edx"
+#endif
+#endif
+LZOLIB_PUBLIC(int, lzo_tsc_read) (lzo_uint32e_t* t)
+{
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__(
+ "clc \n" ".byte 0x0f,0x31\n"
+ "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
+ __LZOLIB_RDTSC_REGS
+ );
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ LZO_UNUSED(t);
+ __asm {
+ mov ecx, t
+ clc
+# if (LZO_CC_MSC && (_MSC_VER < 1200))
+ _emit 0x0f
+ _emit 0x31
+# else
+ rdtsc
+# endif
+ mov [ecx], eax
+ mov [ecx+4], edx
+ }
+ return 0;
+#else
+ t[0] = t[1] = 0; return -1;
+#endif
+}
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_DOSALLOC)
+# undef LZO_WANT_ACCLIB_DOSALLOC
+#define __LZOLIB_DOSALLOC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_OS_OS216)
+LZO_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+LZO_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+#if !(LZO_CC_AZTECC)
+LZOLIB_PUBLIC(void __far*, lzo_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ union REGS ri, ro;
+ if ((long)size <= 0)
+ return p;
+ size = (size + 15) >> 4;
+ if (size > 0xffffu)
+ return p;
+ ri.x.ax = 0x4800;
+ ri.x.bx = (unsigned short) size;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ p = (void __far*) LZO_PTR_MK_FP(ro.x.ax, 0);
+ return p;
+}
+LZOLIB_PUBLIC(int, lzo_dos_free) (void __far* p)
+{
+ union REGS ri, ro;
+ struct SREGS rs;
+ if (!p)
+ return 0;
+ if (LZO_PTR_FP_OFF(p) != 0)
+ return -1;
+ segread(&rs);
+ ri.x.ax = 0x4900;
+ rs.es = LZO_PTR_FP_SEG(p);
+ int86x(0x21, &ri, &ro, &rs);
+ if (ro.x.cflag & 1)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if (LZO_OS_OS216)
+LZOLIB_PUBLIC(void __far*, lzo_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ unsigned short sel = 0;
+ if ((long)size <= 0)
+ return p;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (void __far*) LZO_PTR_MK_FP(sel, 0);
+ return p;
+}
+LZOLIB_PUBLIC(int, lzo_dos_free) (void __far* p)
+{
+ if (!p)
+ return 0;
+ if (LZO_PTR_FP_OFF(p) != 0)
+ return -1;
+ if (DosFreeSeg(LZO_PTR_FP_SEG(p)) != 0)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_GETOPT)
+# undef LZO_WANT_ACCLIB_GETOPT
+#define __LZOLIB_GETOPT_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(void, lzo_getopt_init) (lzo_getopt_p g,
+ int start_argc, int argc, char** argv)
+{
+ memset(g, 0, sizeof(*g));
+ g->optind = start_argc;
+ g->argc = argc; g->argv = argv;
+ g->optopt = -1;
+}
+static int __LZOLIB_FUNCNAME(lzo_getopt_rotate) (char** p, int first, int middle, int last)
+{
+ int i = middle, n = middle - first;
+ if (first >= middle || middle >= last) return 0;
+ for (;;)
+ {
+ char* t = p[first]; p[first] = p[i]; p[i] = t;
+ if (++first == middle)
+ {
+ if (++i == last) break;
+ middle = i;
+ }
+ else if (++i == last)
+ i = middle;
+ }
+ return n;
+}
+static int __LZOLIB_FUNCNAME(lzo_getopt_perror) (lzo_getopt_p g, int ret, const char* f, ...)
+{
+ if (g->opterr)
+ {
+#if (HAVE_STDARG_H)
+ struct { va_list ap; } s;
+ va_start(s.ap, f);
+ g->opterr(g, f, &s);
+ va_end(s.ap);
+#else
+ g->opterr(g, f, NULL);
+#endif
+ }
+ ++g->errcount;
+ return ret;
+}
+LZOLIB_PUBLIC(int, lzo_getopt) (lzo_getopt_p g,
+ const char* shortopts,
+ const lzo_getopt_longopt_p longopts,
+ int* longind)
+{
+#define pe __LZOLIB_FUNCNAME(lzo_getopt_perror)
+ int ordering = LZO_GETOPT_PERMUTE;
+ int missing_arg_ret = g->bad_option;
+ char* a;
+ if (shortopts)
+ {
+ if (*shortopts == '-' || *shortopts == '+')
+ ordering = *shortopts++ == '-' ? LZO_GETOPT_RETURN_IN_ORDER : LZO_GETOPT_REQUIRE_ORDER;
+ if (*shortopts == ':')
+ missing_arg_ret = *shortopts++;
+ }
+ g->optarg = NULL;
+ if (g->optopt == -1)
+ g->optopt = g->bad_option;
+ if (longind)
+ *longind = -1;
+ if (g->eof)
+ return -1;
+ if (g->shortpos)
+ goto lzo_label_next_shortopt;
+ g->optind -= __LZOLIB_FUNCNAME(lzo_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ if (ordering == LZO_GETOPT_PERMUTE)
+ {
+ while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
+ ++g->optind;
+ g->pending_rotate_middle = g->optind;
+ }
+ if (g->optind >= g->argc)
+ {
+ g->optind = g->pending_rotate_first;
+ goto lzo_label_eof;
+ }
+ a = g->argv[g->optind];
+ if (a[0] == '-' && a[1] == '-')
+ {
+ size_t l = 0;
+ const lzo_getopt_longopt_p o;
+ const lzo_getopt_longopt_p o1 = NULL;
+ const lzo_getopt_longopt_p o2 = NULL;
+ int need_exact = 0;
+ ++g->optind;
+ if (!a[2])
+ goto lzo_label_eof;
+ for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
+ ++l;
+ for (o = longopts; l && o && o->name; ++o)
+ {
+ if (strncmp(a, o->name, l) != 0)
+ continue;
+ if (!o->name[l])
+ goto lzo_label_found_o;
+ need_exact |= o->has_arg & LZO_GETOPT_EXACT_ARG;
+ if (o1) o2 = o;
+ else o1 = o;
+ }
+ if (!o1 || need_exact)
+ return pe(g, g->bad_option, "unrecognized option '--%s'", a);
+ if (o2)
+ return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
+ o = o1;
+ lzo_label_found_o:
+ a += l;
+ switch (o->has_arg & 0x2f)
+ {
+ case LZO_GETOPT_OPTIONAL_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ break;
+ case LZO_GETOPT_REQUIRED_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ else if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
+ break;
+ case LZO_GETOPT_REQUIRED_ARG | 0x20:
+ if (a[0] && a[1])
+ g->optarg = a + 1;
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
+ break;
+ default:
+ if (a[0])
+ return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
+ break;
+ }
+ if (longind)
+ *longind = (int) (o - longopts);
+ if (o->flag)
+ {
+ *o->flag = o->val;
+ return 0;
+ }
+ return o->val;
+ }
+ if (a[0] == '-' && a[1])
+ {
+ unsigned char c;
+ const char* s;
+ lzo_label_next_shortopt:
+ a = g->argv[g->optind] + ++g->shortpos;
+ c = (unsigned char) *a++; s = NULL;
+ if (c != ':' && shortopts)
+ s = strchr(shortopts, c);
+ if (!s || s[1] != ':')
+ {
+ if (!a[0])
+ ++g->optind, g->shortpos = 0;
+ if (!s)
+ {
+ g->optopt = c;
+ return pe(g, g->bad_option, "invalid option '-%c'", c);
+ }
+ }
+ else
+ {
+ ++g->optind, g->shortpos = 0;
+ if (a[0])
+ g->optarg = a;
+ else if (s[2] != ':')
+ {
+ if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ else
+ {
+ g->optopt = c;
+ return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
+ }
+ }
+ }
+ return c;
+ }
+ if (ordering == LZO_GETOPT_RETURN_IN_ORDER)
+ {
+ ++g->optind;
+ g->optarg = a;
+ return 1;
+ }
+lzo_label_eof:
+ g->optind -= __LZOLIB_FUNCNAME(lzo_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ g->eof = 1;
+ return -1;
+#undef pe
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HALLOC)
+# undef LZO_WANT_ACCLIB_HALLOC
+#define __LZOLIB_HALLOC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_OS216)
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_WIN16)
+# define __LZOLIB_HALLOC_USE_GA 1
+#elif 1 && (LZO_OS_DOS16) && (LZO_CC_BORLANDC) && defined(__DPMI16__)
+# define __LZOLIB_HALLOC_USE_GA 1
+#endif
+#endif
+#if (__LZOLIB_HALLOC_USE_DAH)
+#if 0 && (LZO_OS_OS216)
+#include <os2.h>
+#else
+LZO_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+LZO_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#endif
+#if (__LZOLIB_HALLOC_USE_GA)
+#if 0
+#define STRICT 1
+#include <windows.h>
+#else
+LZO_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long);
+LZO_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*);
+LZO_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned);
+LZO_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*);
+LZO_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
+#endif
+#endif
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_halloc) (lzo_hsize_t size)
+{
+ lzo_hvoid_p p = LZO_STATIC_CAST(lzo_hvoid_p, 0);
+ if (!(size > 0))
+ return p;
+#if 0 && defined(__palmos__)
+ p = MemPtrNew(size);
+#elif !(LZO_HAVE_MM_HUGE_PTR)
+ if (size < LZO_STATIC_CAST(size_t, -1))
+ p = malloc(LZO_STATIC_CAST(size_t, size));
+#else
+ if (LZO_STATIC_CAST(long, size) <= 0)
+ return p;
+{
+#if (__LZOLIB_HALLOC_USE_DAH)
+ unsigned short sel = 0;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (lzo_hvoid_p) LZO_PTR_MK_FP(sel, 0);
+#elif (__LZOLIB_HALLOC_USE_GA)
+ const void __near* h = GlobalAlloc(2, size);
+ if (h) {
+ p = GlobalLock(h);
+ if (p && LZO_PTR_FP_OFF(p) != 0) {
+ GlobalUnlock(h);
+ p = 0;
+ }
+ if (!p)
+ GlobalFree(h);
+ }
+#elif (LZO_CC_MSC && (_MSC_VER >= 700))
+ p = _halloc(size, 1);
+#elif (LZO_CC_MSC || LZO_CC_WATCOMC)
+ p = halloc(size, 1);
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ p = farmalloc(size);
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+ p = farmalloc(size);
+#elif (LZO_CC_AZTECC)
+ p = lmalloc(size);
+#else
+ if (size < LZO_STATIC_CAST(size_t, -1))
+ p = malloc((size_t) size);
+#endif
+}
+#endif
+ return p;
+}
+LZOLIB_PUBLIC(void, lzo_hfree) (lzo_hvoid_p p)
+{
+ if (!p)
+ return;
+#if 0 && defined(__palmos__)
+ MemPtrFree(p);
+#elif !(LZO_HAVE_MM_HUGE_PTR)
+ free(p);
+#else
+#if (__LZOLIB_HALLOC_USE_DAH)
+ if (LZO_PTR_FP_OFF(p) == 0)
+ DosFreeSeg((unsigned short) LZO_PTR_FP_SEG(p));
+#elif (__LZOLIB_HALLOC_USE_GA)
+ if (LZO_PTR_FP_OFF(p) == 0) {
+ const void __near* h = (const void __near*) (unsigned) GlobalHandle(LZO_PTR_FP_SEG(p));
+ if (h) {
+ GlobalUnlock(h);
+ GlobalFree(h);
+ }
+ }
+#elif (LZO_CC_MSC && (_MSC_VER >= 700))
+ _hfree(p);
+#elif (LZO_CC_MSC || LZO_CC_WATCOMC)
+ hfree(p);
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ farfree((void __far*) p);
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+ farfree((void __far*) p);
+#elif (LZO_CC_AZTECC)
+ lfree(p);
+#else
+ free(p);
+#endif
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HFREAD)
+# undef LZO_WANT_ACCLIB_HFREAD
+#define __LZOLIB_HFREAD_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(lzo_hsize_t, lzo_hfread) (void* vfp, lzo_hvoid_p buf, lzo_hsize_t size)
+{
+ FILE* fp = LZO_STATIC_CAST(FILE *, vfp);
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+#define __LZOLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ n = fread(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ __LZOLIB_FUNCNAME(lzo_hmemcpy)((lzo_hbyte_p)buf + l, tmp, (lzo_hsize_t)n);
+ l += n;
+ }
+ return l;
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ lzo_hbyte_p b = (lzo_hbyte_p) buf;
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = LZO_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((lzo_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fread((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fread(buf, 1, size, fp);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hsize_t, lzo_hfwrite) (void* vfp, const lzo_hvoid_p buf, lzo_hsize_t size)
+{
+ FILE* fp = LZO_STATIC_CAST(FILE *, vfp);
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+#define __LZOLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ __LZOLIB_FUNCNAME(lzo_hmemcpy)(tmp, (const lzo_hbyte_p)buf + l, (lzo_hsize_t)n);
+ n = fwrite(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ l += n;
+ }
+ return l;
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ const lzo_hbyte_p b = (const lzo_hbyte_p) buf;
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = LZO_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((lzo_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fwrite((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fwrite(buf, 1, size, fp);
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HSREAD)
+# undef LZO_WANT_ACCLIB_HSREAD
+#define __LZOLIB_HSREAD_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(long, lzo_safe_hread) (int fd, lzo_hvoid_p buf, long size)
+{
+ lzo_hbyte_p b = (lzo_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define __LZOLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = lzo_hread(fd, b, n);
+#elif (LZO_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _read(fd, b, n);
+#else
+ errno = 0; n = read(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+LZOLIB_PUBLIC(long, lzo_safe_hwrite) (int fd, const lzo_hvoid_p buf, long size)
+{
+ const lzo_hbyte_p b = (const lzo_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define __LZOLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = lzo_hwrite(fd, b, n);
+#elif (LZO_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _write(fd, b, n);
+#else
+ errno = 0; n = write(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_PCLOCK)
+# undef LZO_WANT_ACCLIB_PCLOCK
+#define __LZOLIB_PCLOCK_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if 1 && (LZO_OS_POSIX_LINUX && LZO_ARCH_AMD64 && LZO_ASM_SYNTAX_GNUC)
+#ifndef lzo_pclock_syscall_clock_gettime
+#define lzo_pclock_syscall_clock_gettime lzo_pclock_syscall_clock_gettime
+#endif
+__lzo_static_noinline long lzo_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ unsigned long r = 228;
+ __asm__ __volatile__("syscall\n" : "=a" (r) : "0" (r), "D" (clockid), "S" (ts) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICAST(long, r);
+}
+#endif
+#if 1 && (LZO_OS_POSIX_LINUX && LZO_ARCH_I386 && LZO_ASM_SYNTAX_GNUC) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_syscall_clock_gettime
+#define lzo_pclock_syscall_clock_gettime lzo_pclock_syscall_clock_gettime
+#endif
+__lzo_static_noinline long lzo_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ unsigned long r = 265;
+ __asm__ __volatile__("pushl %%ebx\n pushl %%edx\n popl %%ebx\n int $0x80\n popl %%ebx\n" : "=a" (r) : "0" (r), "d" (clockid), "c" (ts) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICAST(long, r);
+}
+#endif
+#if 0 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_r_syscall
+#define lzo_pclock_read_clock_gettime_r_syscall lzo_pclock_read_clock_gettime_r_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_r_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(0, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETTIMEOFDAY)
+#ifndef lzo_pclock_read_gettimeofday
+#define lzo_pclock_read_gettimeofday lzo_pclock_read_gettimeofday
+#endif
+static int lzo_pclock_read_gettimeofday(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) != 0)
+ return -1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = tv.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = tv.tv_sec;
+#endif
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (tv.tv_usec * 1000u));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if defined(CLOCKS_PER_SEC) && !(LZO_CFG_NO_DOUBLE)
+#ifndef lzo_pclock_read_clock
+#define lzo_pclock_read_clock lzo_pclock_read_clock
+#endif
+static int lzo_pclock_read_clock(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ clock_t ticks;
+ double secs;
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t nsecs;
+ ticks = clock();
+ secs = LZO_STATIC_CAST(double, ticks) / (CLOCKS_PER_SEC);
+ nsecs = LZO_STATIC_CAST(lzo_uint64l_t, (secs * 1000000000.0));
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (nsecs / 1000000000ul));
+ nsecs = (nsecs % 1000000000ul);
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, nsecs);
+#else
+ ticks = clock();
+ secs = LZO_STATIC_CAST(double, ticks) / (CLOCKS_PER_SEC);
+ c->tv_sec_high = 0;
+ c->tv_sec_low = LZO_STATIC_CAST(lzo_uint32l_t, (secs + 0.5));
+ c->tv_nsec = 0;
+#endif
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_m_syscall
+#define lzo_pclock_read_clock_gettime_m_syscall lzo_pclock_read_clock_gettime_m_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_m_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(1, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC) && !(LZO_CFG_NO_DOUBLE)
+#ifndef lzo_pclock_read_uclock
+#define lzo_pclock_read_uclock lzo_pclock_read_uclock
+#endif
+static int lzo_pclock_read_uclock(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ lzo_uint64l_t ticks;
+ double secs;
+ lzo_uint64l_t nsecs;
+ ticks = uclock();
+ secs = LZO_STATIC_CAST(double, ticks) / (UCLOCKS_PER_SEC);
+ nsecs = LZO_STATIC_CAST(lzo_uint64l_t, (secs * 1000000000.0));
+ c->tv_sec = nsecs / 1000000000ul;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (nsecs % 1000000000ul));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_clock_gettime_p_libc
+#define lzo_pclock_read_clock_gettime_p_libc lzo_pclock_read_clock_gettime_p_libc
+#endif
+static int lzo_pclock_read_clock_gettime_p_libc(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_p_syscall
+#define lzo_pclock_read_clock_gettime_p_syscall lzo_pclock_read_clock_gettime_p_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_p_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(2, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_CYGWIN || LZO_OS_WIN32 || LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_getprocesstimes
+#define lzo_pclock_read_getprocesstimes lzo_pclock_read_getprocesstimes
+#endif
+static int lzo_pclock_read_getprocesstimes(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ lzo_uint64l_t ticks;
+ if (GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = (LZO_STATIC_CAST(lzo_uint64l_t, ut.dwHighDateTime) << 32) | ut.dwLowDateTime;
+ if __lzo_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (ticks / 10000000ul));
+ ticks = (ticks % 10000000ul) * 100u;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ticks);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
+#ifndef lzo_pclock_read_getrusage
+#define lzo_pclock_read_getrusage lzo_pclock_read_getrusage
+#endif
+static int lzo_pclock_read_getrusage(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) != 0)
+ return -1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = ru.ru_utime.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = ru.ru_utime.tv_sec;
+#endif
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (ru.ru_utime.tv_usec * 1000u));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_clock_gettime_t_libc
+#define lzo_pclock_read_clock_gettime_t_libc lzo_pclock_read_clock_gettime_t_libc
+#endif
+static int lzo_pclock_read_clock_gettime_t_libc(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = (lzo_uint32l_t) ts.tv_nsec;
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_t_syscall
+#define lzo_pclock_read_clock_gettime_t_syscall lzo_pclock_read_clock_gettime_t_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_t_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(3, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_CYGWIN || LZO_OS_WIN32 || LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_getthreadtimes
+#define lzo_pclock_read_getthreadtimes lzo_pclock_read_getthreadtimes
+#endif
+static int lzo_pclock_read_getthreadtimes(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ lzo_uint64l_t ticks;
+ if (GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = (LZO_STATIC_CAST(lzo_uint64l_t, ut.dwHighDateTime) << 32) | ut.dwLowDateTime;
+ if __lzo_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (ticks / 10000000ul));
+ ticks = (ticks % 10000000ul) * 100u;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ticks);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+LZOLIB_PUBLIC(int, lzo_pclock_open) (lzo_pclock_handle_p h, int mode)
+{
+ lzo_pclock_t c;
+ int i;
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 0);
+ h->mode = -1;
+ h->read_error = 2;
+ h->name = NULL;
+ h->gettime = LZO_STATIC_CAST(lzo_pclock_gettime_t, 0);
+#if defined(lzo_int64l_t)
+ h->ticks_base = 0;
+#endif
+ switch (mode)
+ {
+ case LZO_PCLOCK_REALTIME:
+# if defined(lzo_pclock_read_clock_gettime_r_syscall)
+ if (lzo_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_r_syscall;
+ h->name = "CLOCK_REALTIME/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_gettimeofday)
+ if (lzo_pclock_read_gettimeofday(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_gettimeofday;
+ h->name = "gettimeofday";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_MONOTONIC:
+# if defined(lzo_pclock_read_clock_gettime_m_syscall)
+ if (lzo_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_m_syscall;
+ h->name = "CLOCK_MONOTONIC/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_uclock)
+ if (lzo_pclock_read_uclock(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_uclock;
+ h->name = "uclock";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock)
+ if (lzo_pclock_read_clock(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock;
+ h->name = "clock";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_PROCESS_CPUTIME_ID:
+# if defined(lzo_pclock_read_getprocesstimes)
+ if (lzo_pclock_read_getprocesstimes(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getprocesstimes;
+ h->name = "GetProcessTimes";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_p_syscall)
+ if (lzo_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_p_syscall;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_p_libc)
+ if (lzo_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_p_libc;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_getrusage)
+ if (lzo_pclock_read_getrusage(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getrusage;
+ h->name = "getrusage";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_THREAD_CPUTIME_ID:
+# if defined(lzo_pclock_read_getthreadtimes)
+ if (lzo_pclock_read_getthreadtimes(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getthreadtimes;
+ h->name = "GetThreadTimes";
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_t_syscall)
+ if (lzo_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_t_syscall;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_t_libc)
+ if (lzo_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_t_libc;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+ break;
+ }
+ if (!h->gettime)
+ return -1;
+ if (!h->h)
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 1);
+ h->mode = mode;
+ h->read_error = 0;
+ if (!h->name)
+ h->name = "unknown";
+ for (i = 0; i < 10; i++) {
+ __LZOLIB_FUNCNAME(lzo_pclock_read)(h, &c);
+ }
+ return 0;
+}
+LZOLIB_PUBLIC(int, lzo_pclock_open_default) (lzo_pclock_handle_p h)
+{
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_PROCESS_CPUTIME_ID) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_MONOTONIC) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_REALTIME) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_THREAD_CPUTIME_ID) == 0)
+ return 0;
+ return -1;
+}
+LZOLIB_PUBLIC(int, lzo_pclock_close) (lzo_pclock_handle_p h)
+{
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 0);
+ h->mode = -1;
+ h->name = NULL;
+ h->gettime = LZO_STATIC_CAST(lzo_pclock_gettime_t, 0);
+ return 0;
+}
+LZOLIB_PUBLIC(void, lzo_pclock_read) (lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ if (h->gettime) {
+ if (h->gettime(h, c) == 0)
+ return;
+ }
+ h->read_error = 1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = 0;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = 0;
+#endif
+ c->tv_nsec = 0;
+}
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_PUBLIC(double, lzo_pclock_get_elapsed) (lzo_pclock_handle_p h, const lzo_pclock_p start, const lzo_pclock_p stop)
+{
+ if (!h->h) { h->mode = -1; return 0.0; }
+ {
+#if 1 && (LZO_ARCH_I386 && LZO_CC_GNUC) && defined(__STRICT_ALIGNMENT__)
+ float tstop, tstart;
+ tstop = LZO_STATIC_CAST(float, (stop->tv_sec + stop->tv_nsec / 1000000000.0));
+ tstart = LZO_STATIC_CAST(float, (start->tv_sec + start->tv_nsec / 1000000000.0));
+#elif defined(lzo_int64l_t)
+ double tstop, tstart;
+#if 1 && (LZO_CC_INTELC)
+ { lzo_int64l_t a = stop->tv_sec; lzo_uint32l_t b = stop->tv_nsec;
+ tstop = a + b / 1000000000.0; }
+ { lzo_int64l_t a = start->tv_sec; lzo_uint32l_t b = start->tv_nsec;
+ tstart = a + b / 1000000000.0; }
+#else
+ tstop = stop->tv_sec + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec + start->tv_nsec / 1000000000.0;
+#endif
+#else
+ double tstop, tstart;
+ tstop = stop->tv_sec_low + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec_low + start->tv_nsec / 1000000000.0;
+#endif
+ return tstop - tstart;
+ }
+}
+#endif
+LZOLIB_PUBLIC(int, lzo_pclock_flush_cpu_cache) (lzo_pclock_handle_p h, unsigned flags)
+{
+ LZO_UNUSED(h); LZO_UNUSED(flags);
+ return -1;
+}
+#if defined(__LZOLIB_PCLOCK_NEED_WARN_POP)
+# if (LZO_CC_MSC && (_MSC_VER >= 1200))
+# pragma warning(pop)
+# else
+# error "__LZOLIB_PCLOCK_NEED_WARN_POP"
+# endif
+# undef __LZOLIB_PCLOCK_NEED_WARN_POP
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_MISC)
+# undef LZO_WANT_ACCLIB_MISC
+#define __LZOLIB_MISC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_PUBLIC_NOINLINE)
+# if !defined(__lzo_noinline)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) r __LZOLIB_FUNCNAME(f)
+# elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline __attribute__((__used__)) r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+LZOLIB_PUBLIC(const char *, lzo_getenv) (const char *s)
+{
+#if (HAVE_GETENV)
+ return getenv(s);
+#else
+ LZO_UNUSED(s); return LZO_STATIC_CAST(const char *, 0);
+#endif
+}
+LZOLIB_PUBLIC(lzo_intptr_t, lzo_get_osfhandle) (int fd)
+{
+ if (fd < 0)
+ return -1;
+#if (LZO_OS_CYGWIN)
+ return get_osfhandle(fd);
+#elif (LZO_OS_EMX && defined(__RSXNT__))
+ return -1;
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ return -1;
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_PELLESC && (__POCC__ < 280))
+ return -1;
+# elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+ return -1;
+# elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1100))
+ return _os_handle(fd);
+# else
+ return _get_osfhandle(fd);
+# endif
+#else
+ return fd;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_set_binmode) (int fd, int binary)
+{
+#if (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC) && defined(__MINT__)
+ FILE* fp; int old_binary;
+ if (fd == STDIN_FILENO) fp = stdin;
+ else if (fd == STDOUT_FILENO) fp = stdout;
+ else if (fd == STDERR_FILENO) fp = stderr;
+ else return -1;
+ old_binary = fp->__mode.__binary;
+ __set_binmode(fp, binary ? 1 : 0);
+ return old_binary ? 1 : 0;
+#elif (LZO_ARCH_M68K && LZO_OS_TOS)
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_DOS16 && (LZO_CC_AZTECC || LZO_CC_PACIFICC))
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+ int r; unsigned old_flags = __djgpp_hwint_flags;
+ LZO_COMPILE_TIME_ASSERT(O_BINARY > 0)
+ LZO_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u))
+ __djgpp_set_ctrl_c(!(old_flags & 1));
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ if (fd < 0) return -1;
+ LZO_UNUSED(binary);
+ return 1;
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+ FILE* fp; int r;
+ if (fd == fileno(stdin)) fp = stdin;
+ else if (fd == fileno(stdout)) fp = stdout;
+ else if (fd == fileno(stderr)) fp = stderr;
+ else return -1;
+ r = _setmode(fp, binary ? _BINARY : _TEXT);
+ if (r == -1) return -1;
+ return (r & _BINARY) ? 1 : 0;
+#elif (LZO_OS_WIN32 && LZO_CC_MWERKS) && defined(__MSL__)
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_CYGWIN && (LZO_CC_GNUC < 0x025a00ul))
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_CYGWIN || LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_EMX || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+ int r;
+#if !(LZO_CC_ZORTECHC)
+ LZO_COMPILE_TIME_ASSERT(O_BINARY > 0)
+#endif
+ LZO_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#else
+ if (fd < 0) return -1;
+ LZO_UNUSED(binary);
+ return 1;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_isatty) (int fd)
+{
+ if (fd < 0)
+ return 0;
+#if (LZO_OS_DOS16 && !(LZO_CC_AZTECC))
+ {
+ union REGS ri, ro;
+ ri.x.ax = 0x4400; ri.x.bx = fd;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ if ((ro.x.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (LZO_OS_DOS32 && LZO_CC_WATCOMC)
+ {
+ union REGS ri, ro;
+ ri.w.ax = 0x4400; ri.w.bx = LZO_STATIC_CAST(unsigned short, fd);
+ int386(0x21, &ri, &ro);
+ if ((ro.w.cflag & 1) == 0)
+ if ((ro.w.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (LZO_HAVE_WINDOWS_H)
+ {
+ lzo_intptr_t h = __LZOLIB_FUNCNAME(lzo_get_osfhandle)(fd);
+ LZO_COMPILE_TIME_ASSERT(sizeof(h) == sizeof(HANDLE))
+ if (h != -1)
+ {
+ DWORD d = 0;
+ if (GetConsoleMode(LZO_REINTERPRET_CAST(HANDLE, h), &d) == 0)
+ return 0;
+ }
+ }
+#endif
+#if (HAVE_ISATTY)
+ return (isatty(fd)) ? 1 : 0;
+#else
+ return 0;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_mkdir) (const char* name, unsigned mode)
+{
+#if !(HAVE_MKDIR)
+ LZO_UNUSED(name); LZO_UNUSED(mode);
+ return -1;
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+ LZO_UNUSED(mode);
+ return Dcreate(name);
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+ return mkdir(name, mode);
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ return mkdir(name, mode);
+#elif ((LZO_OS_DOS16 || LZO_OS_DOS32) && (LZO_CC_HIGHC || LZO_CC_PACIFICC))
+ LZO_UNUSED(mode);
+ return mkdir(LZO_UNCONST_CAST(char *, name));
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+ LZO_UNUSED(mode);
+ return mkdir(name);
+#elif (LZO_CC_WATCOMC)
+ return mkdir(name, LZO_STATIC_CAST(mode_t, mode));
+#else
+ return mkdir(name, mode);
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_rmdir) (const char* name)
+{
+#if !(HAVE_RMDIR)
+ LZO_UNUSED(name);
+ return -1;
+#elif ((LZO_OS_DOS16 || LZO_OS_DOS32) && (LZO_CC_HIGHC || LZO_CC_PACIFICC))
+ return rmdir(LZO_UNCONST_CAST(char *, name));
+#else
+ return rmdir(name);
+#endif
+}
+#if defined(lzo_int32e_t)
+LZOLIB_PUBLIC(lzo_int32e_t, lzo_muldiv32s) (lzo_int32e_t a, lzo_int32e_t b, lzo_int32e_t x)
+{
+ lzo_int32e_t r = 0;
+ if __lzo_likely(x != 0)
+ {
+#if defined(lzo_int64l_t)
+ lzo_int64l_t rr = (LZO_ICONV(lzo_int64l_t, a) * b) / x;
+ r = LZO_ITRUNC(lzo_int32e_t, rr);
+#else
+ LZO_UNUSED(a); LZO_UNUSED(b);
+#endif
+ }
+ return r;
+}
+LZOLIB_PUBLIC(lzo_uint32e_t, lzo_muldiv32u) (lzo_uint32e_t a, lzo_uint32e_t b, lzo_uint32e_t x)
+{
+ lzo_uint32e_t r = 0;
+ if __lzo_likely(x != 0)
+ {
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t rr = (LZO_ICONV(lzo_uint64l_t, a) * b) / x;
+ r = LZO_ITRUNC(lzo_uint32e_t, rr);
+#else
+ LZO_UNUSED(a); LZO_UNUSED(b);
+#endif
+ }
+ return r;
+}
+#endif
+#if 0
+LZOLIB_PUBLIC_NOINLINE(int, lzo_syscall_clock_gettime) (int c)
+{
+}
+#endif
+#if (LZO_OS_WIN16)
+LZO_EXTERN_C void __far __pascal DebugBreak(void);
+#endif
+LZOLIB_PUBLIC_NOINLINE(void, lzo_debug_break) (void)
+{
+#if (LZO_OS_WIN16)
+ DebugBreak();
+#elif (LZO_ARCH_I086)
+#elif (LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H)
+ DebugBreak();
+#elif (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__("int $3\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ __asm { int 3 }
+#elif (LZO_OS_WIN32) && (LZO_HAVE_WINDOWS_H)
+ DebugBreak();
+#else
+ volatile lzo_intptr_t a = -1;
+ * LZO_STATIC_CAST(volatile unsigned long *, LZO_REINTERPRET_CAST(volatile void *, a)) = ~0ul;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(void, lzo_debug_nop) (void)
+{
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_debug_align_check_query) (void)
+{
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+# if (LZO_ARCH_AMD64)
+ lzo_uint64e_t r = 0;
+# else
+ size_t r = 0;
+# endif
+ __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICONV(int, (r >> 18) & 1);
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ unsigned long r;
+ __asm {
+ pushf
+ pop eax
+ mov r,eax
+ }
+ return LZO_ICONV(int, (r >> 18) & 1);
+#else
+ return -1;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_debug_align_check_enable) (int v)
+{
+#if (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%rsp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%rsp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ }
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%esp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%esp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ }
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ if (v) { __asm {
+ pushf
+ or dword ptr [esp],262144
+ popf
+ }} else { __asm {
+ pushf
+ and dword ptr [esp],-262145
+ popf
+ }}
+ return 0;
+#else
+ LZO_UNUSED(v); return -1;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(unsigned, lzo_debug_running_on_qemu) (void)
+{
+ unsigned r = 0;
+#if (LZO_OS_POSIX_LINUX || LZO_OS_WIN32 || LZO_OS_WIN64)
+ const char* p;
+ p = __LZOLIB_FUNCNAME(lzo_getenv)(LZO_PP_STRINGIZE(LZO_ENV_RUNNING_ON_QEMU));
+ if (p) {
+ if (p[0] == 0) r = 0;
+ else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = LZO_ICAST(unsigned, p[0]) - '0';
+ else r = 1;
+ }
+#endif
+ return r;
+}
+LZOLIB_PUBLIC_NOINLINE(unsigned, lzo_debug_running_on_valgrind) (void)
+{
+#if (LZO_ARCH_AMD64 && LZO_ABI_ILP32)
+ return 0;
+#elif (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ volatile size_t a[6];
+ size_t r = 0;
+ a[0] = 0x1001; a[1] = 0; a[2] = 0; a[3] = 0; a[4] = 0; a[5] = 0;
+# if (LZO_ARCH_AMD64)
+ __asm__ __volatile__(".byte 0x48,0xc1,0xc7,0x03,0x48,0xc1,0xc7,0x0d,0x48,0xc1,0xc7,0x3d,0x48,0xc1,0xc7,0x33,0x48,0x87,0xdb\n" : "=d" (r) : "a" (&a[0]), "d" (r) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+# elif (LZO_ARCH_I386)
+ __asm__ __volatile__(".byte 0xc1,0xc7,0x03,0xc1,0xc7,0x0d,0xc1,0xc7,0x1d,0xc1,0xc7,0x13,0x87,0xdb\n" : "=d" (r) : "a" (&a[0]), "d" (r) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+# endif
+ return LZO_ITRUNC(unsigned, r);
+#else
+ return 0;
+#endif
+}
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_WILDARGV)
+# undef LZO_WANT_ACCLIB_WILDARGV
+#define __LZOLIB_WILDARGV_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#if 0 && (LZO_CC_MSC)
+LZO_EXTERN_C int __lzo_cdecl __setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (LZO_OS_WIN32 || LZO_OS_WIN64)
+#if (LZO_CC_INTELC || LZO_CC_MSC)
+LZO_EXTERN_C int __lzo_cdecl __setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (LZO_OS_EMX)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+ if (argc && argv) {
+ _response(argc, argv);
+ _wildcard(argc, argv);
+ }
+}
+#endif
+#if (LZO_OS_CONSOLE_PSP) && defined(__PSPSDK_DEBUG__)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZO_EXTERN_C int lzo_psp_init_module(int*, char***, int);
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+ lzo_psp_init_module(argc, argv, -1);
+}
+#endif
+#if !(__LZOLIB_HAVE_LZO_WILDARGV)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+#if 1 && (LZO_ARCH_I086PM)
+ if (LZO_MM_AHSHIFT != 3) { exit(1); }
+#elif 1 && (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC) && defined(__MINT__)
+ __binmode(1);
+ if (isatty(1)) __set_binmode(stdout, 0);
+ if (isatty(2)) __set_binmode(stderr, 0);
+#endif
+ LZO_UNUSED(argc); LZO_UNUSED(argv);
+}
+#endif
+#endif
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/src/lzo_swd.ch b/app/lzo/src/lzo_swd.ch
index a8d8b396..566aca45 100644
--- a/app/lzo/src/lzo_swd.ch
+++ b/app/lzo/src/lzo_swd.ch
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -57,17 +42,14 @@
************************************************************************/
/* unsigned type for dictionary access - don't waste memory here */
-#if (0UL + SWD_N + SWD_F + SWD_F < 0UL + USHRT_MAX)
- typedef unsigned short swd_uint;
-# define SWD_UINT_MAX USHRT_MAX
-#elif (0UL + SWD_N + SWD_F + SWD_F < 0UL + UINT_MAX)
- typedef unsigned swd_uint;
-# define SWD_UINT_MAX UINT_MAX
+#if (0UL + SWD_N + SWD_F + SWD_F < 65535UL)
+ typedef lzo_uint16_t swd_uint;
+# define SWD_UINT_MAX 0xffffu
#else
- typedef lzo_uint swd_uint;
-# define SWD_UINT_MAX LZO_UINT_MAX
+ typedef lzo_uint32_t swd_uint;
+# define SWD_UINT_MAX 0xffffffffu
#endif
-#define swd_uintp swd_uint __LZO_MMODEL *
+#define swd_uintp swd_uint *
#define SWD_UINT(x) ((swd_uint)(x))
@@ -89,10 +71,10 @@
#endif
#if !(SWD_NO_HEAD2) && (SWD_THRESHOLD == 1) && !defined(HEAD2)
-# if 1 && defined(LZO_UNALIGNED_OK_2)
-# define HEAD2(b,p) UA_GET16((b)+(p))
+# if 1 && (LZO_OPT_UNALIGNED16)
+# define HEAD2(b,p) UA_GET_NE16((b)+(p))
# else
-# define HEAD2(b,p) (b[p] ^ ((unsigned)b[p+1]<<8))
+# define HEAD2(b,p) (b[p] ^ ((unsigned)b[(p)+1]<<8))
# endif
# define NIL2 SWD_UINT_MAX
#endif
@@ -146,32 +128,7 @@ typedef struct
lzo_uint node_count;
lzo_uint first_rp;
-#if defined(__LZO_MMODEL_HUGE)
-# define A(type, n) ((((n) * sizeof(type)) + 3UL) &~ 3UL)
-
-# define O_b(s) (0L)
-# define O_head3(s) (O_b(s) + A(char, 0UL + SWD_N + SWD_F + SWD_F))
-# define O_succ3(s) (O_head3(s) + A(swd_uint, 0UL + SWD_HSIZE))
-# define O_best3(s) (O_succ3(s) + A(swd_uint, 0UL + SWD_N + SWD_F))
-# define O_llen3(s) (O_best3(s) + A(swd_uint, 0UL + SWD_N + SWD_F))
-# ifdef HEAD2
-# define O_head2(s) (O_llen3(s) + A(swd_uint, 0UL + SWD_HSIZE))
-# define O_END(s) (O_head2(s) + A(swd_uint, 0UL + 65536L))
-# else
-# define O_END(s) (O_llen3(s) + A(swd_uint, 0UL + SWD_HSIZE))
-# endif
-
-# define S_DEF(s,type,off) ((type) ((lzo_bytep)s + 0L + sizeof(*s) + off))
-# define s_b(s) S_DEF(s, lzo_bytep, O_b(s))
-# define s_head3(s) S_DEF(s, swd_uintp, O_head3(s))
-# define s_succ3(s) S_DEF(s, swd_uintp, O_succ3(s))
-# define s_best3(s) S_DEF(s, swd_uintp, O_best3(s))
-# define s_llen3(s) S_DEF(s, swd_uintp, O_llen3(s))
-# ifdef HEAD2
-# define s_head2(s) S_DEF(s, swd_uintp, O_head2(s))
-# endif
-
-#elif defined(__LZO_CHECKER)
+#if defined(__LZO_CHECKER)
/* malloc arrays of the exact size to detect any overrun */
unsigned char *b;
swd_uint *head3;
@@ -194,12 +151,9 @@ typedef struct
#endif
}
lzo_swd_t;
-#define lzo_swd_p lzo_swd_t __LZO_MMODEL *
+#define lzo_swd_p lzo_swd_t *
-#if defined(__LZO_MMODEL_HUGE)
-#define SIZEOF_LZO_SWD_T O_END(0)
-#else
#define s_b(s) s->b
#define s_head3(s) s->head3
#define s_succ3(s) s->succ3
@@ -209,18 +163,17 @@ lzo_swd_t;
#define s_head2(s) s->head2
#endif
#define SIZEOF_LZO_SWD_T (sizeof(lzo_swd_t))
-#endif
/* Access macro for head3.
* head3[key] may be uninitialized if the list is emtpy,
* but then its value will never be used.
*/
-#if defined(__LZO_CHECKER)
+#if 1 || defined(__LZO_CHECKER)
# define s_get_head3(s,key) \
- ((s_llen3(s)[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key])
+ ((swd_uint)((s_llen3(s)[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key]))
#else
-# define s_get_head3(s,key) s_head3(s)[key]
+# define s_get_head3(s,key) (s_head3(s)[key])
#endif
@@ -338,7 +291,7 @@ int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
lzo_memset(s_head2(s), 0xff, (lzo_uint)sizeof(s_head2(s)[0]) * 65536L);
assert(s_head2(s)[0] == NIL2);
#else
- lzo_uint32 i;
+ lzo_xint i;
for (i = 0; i < 65536L; i++)
s_head2(s)[i] = NIL2;
#endif
@@ -434,7 +387,7 @@ void swd_getbyte(lzo_swd_p s)
{
if (s->look > 0)
--s->look;
-#if defined(__LZO_CHECKER)
+#if 1 || defined(__LZO_CHECKER)
/* initialize memory - value doesn't matter */
s_b(s)[s->ip] = 0;
if (s->ip < s->swd_f)
@@ -572,9 +525,9 @@ void swd_search(lzo_swd_p s, lzo_uint node, lzo_uint cnt)
lzo_uint i;
assert(lzo_memcmp(bp,&b[node],3) == 0);
-#if 0 && defined(LZO_UNALIGNED_OK_4)
+#if 0 && (LZO_OPT_UNALIGNED32)
p1 += 3; p2 += 3;
- while (p1 + 4 <= px && UA_GET32(p1) == UA_GET32(p2))
+ while (p1 + 4 <= px && UA_GET_NE32(p1) == UA_GET_NE32(p2))
p1 += 4, p2 += 4;
while (p1 < px && *p1 == *p2)
p1 += 1, p2 += 1;
diff --git a/app/lzo/src/lzo_util.c b/app/lzo/src/lzo_util.c
index 1e4a9e33..1f2a4d54 100644
--- a/app/lzo/src/lzo_util.c
+++ b/app/lzo/src/lzo_util.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -59,7 +44,7 @@ static const char __lzo_copyright[] =
#else
"\r\n\n"
"LZO data compression library.\n"
- "$Copyright: LZO Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer\n"
+ "$Copyright: LZO Copyright (C) 1996-2014 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"
@@ -70,11 +55,7 @@ static const char __lzo_copyright[] =
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)
@@ -124,11 +105,11 @@ _lzo_version_date(void)
#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_PUBLIC(lzo_uint32_t)
+lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len)
{
- lzo_uint32 s1 = adler & 0xffff;
- lzo_uint32 s2 = (adler >> 16) & 0xffff;
+ lzo_uint32_t s1 = adler & 0xffff;
+ lzo_uint32_t s2 = (adler >> 16) & 0xffff;
unsigned k;
if (buf == NULL)
diff --git a/app/lzo/src/stats1a.h b/app/lzo/src/stats1a.h
index 577f50c8..5c2af38c 100644
--- a/app/lzo/src/stats1a.h
+++ b/app/lzo/src/stats1a.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/stats1b.h b/app/lzo/src/stats1b.h
index e3ced967..453e7ab3 100644
--- a/app/lzo/src/stats1b.h
+++ b/app/lzo/src/stats1b.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/src/stats1c.h b/app/lzo/src/stats1c.h
index 8a0d3a5d..7f1f4cd9 100644
--- a/app/lzo/src/stats1c.h
+++ b/app/lzo/src/stats1c.h
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
diff --git a/app/lzo/tests/align.c b/app/lzo/tests/align.c
index bc15663d..a4c5f7db 100644
--- a/app/lzo/tests/align.c
+++ b/app/lzo/tests/align.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -52,14 +37,14 @@
#include "examples/portab.h"
-int opt_verbose = 0;
+static int opt_verbose = 0;
/*************************************************************************
//
**************************************************************************/
-unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
+static unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
{
lzo_bytep b1 = block;
lzo_bytep b2 = block;
@@ -208,7 +193,4 @@ int main(int argc, char *argv[])
}
-/*
-vi:ts=4:et
-*/
-
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/tests/chksum.c b/app/lzo/tests/chksum.c
index 7fbcb417..bb5b502b 100644
--- a/app/lzo/tests/chksum.c
+++ b/app/lzo/tests/chksum.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -56,7 +41,7 @@ int main(int argc, char *argv[])
{
lzo_bytep block;
lzo_uint block_len;
- lzo_uint32 adler, crc;
+ lzo_uint32_t adler, crc;
if (argc < 0 && argv == NULL) /* avoid warning about unused args */
return 0;
@@ -101,7 +86,4 @@ int main(int argc, char *argv[])
}
-/*
-vi:ts=4:et
-*/
-
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/tests/promote.c b/app/lzo/tests/promote.c
index 21fff2c4..30c6da60 100644
--- a/app/lzo/tests/promote.c
+++ b/app/lzo/tests/promote.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -42,6 +27,11 @@
#include <stdio.h>
+#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
+ /* disable "unreachable code" warnings */
+# pragma warning(disable: 4702)
+#endif
+
int main(int argc, char *argv[])
{
unsigned char c;
@@ -54,10 +44,12 @@ int main(int argc, char *argv[])
s = 8 * (int) (sizeof(int) - sizeof(char));
printf("Integral promotion: ");
- if ((c << s) > 0)
+ {
+ const int u = (c << s) > 0;
+ if (u)
{
printf("Classic C (unsigned-preserving)\n");
- printf("%d %d %uU\n", c, s, c << s);
+ printf("%d %d %uU\n", c, s, (unsigned)c << s);
return 1;
}
else
@@ -66,8 +58,7 @@ int main(int argc, char *argv[])
printf("%d %d %d\n", c, s, c << s);
return 0;
}
+ }
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/tests/sizes.c b/app/lzo/tests/sizes.c
index aea8cc2e..3840fe2a 100644
--- a/app/lzo/tests/sizes.c
+++ b/app/lzo/tests/sizes.c
@@ -2,22 +2,7 @@
This file is part of the LZO real-time data compression library.
- Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
- Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
- 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
+ Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
@@ -59,6 +44,11 @@
#include "lzo/lzoconf.h"
#include <stdio.h>
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+ /* disable warning C4310: cast truncates constant value */
+# pragma warning(disable: 4310)
+#endif
+
union _lzo_align1_t
{
@@ -101,15 +91,15 @@ union _lzo_align6_t
#define print_size(type) \
sprintf(s,"sizeof(%s)",#type); \
- printf("%-30s %2d\n", s, (int)sizeof(type));
+ printf("%-30s %2ld\n", s, (long)sizeof(type));
#define print_ssize(type,m) \
sprintf(s,"sizeof(%s)",#type); \
- printf("%-30s %2d %20ld\n", s, (int)sizeof(type), (long)(m));
+ printf("%-30s %2ld %20ld\n", s, (long)sizeof(type), (long)(m));
#define print_usize(type,m) \
sprintf(s,"sizeof(%s)",#type); \
- printf("%-30s %2d %20lu\n", s, (int)sizeof(type), (unsigned long)(m));
+ printf("%-30s %2ld %20lu\n", s, (long)sizeof(type), (unsigned long)(m));
int main(int argc, char *argv[])
@@ -130,7 +120,6 @@ int main(int argc, char *argv[])
printf("\n");
print_ssize(lzo_int,LZO_INT_MAX);
print_usize(lzo_uint,LZO_UINT_MAX);
- print_usize(lzo_uint32,LZO_UINT32_MAX);
print_size(lzo_bytep);
printf("\n");
print_size(union _lzo_align1_t);
@@ -145,7 +134,5 @@ int main(int argc, char *argv[])
return 0;
}
-/*
-vi:ts=4:et
-*/
+/* vim:set ts=4 sw=4 et: */
diff --git a/app/lzo/util/check.sh b/app/lzo/util/check.sh
index 6fbd141f..f412803f 100644
--- a/app/lzo/util/check.sh
+++ b/app/lzo/util/check.sh
@@ -7,7 +7,7 @@ set -e
# This script runs lzotest with all algorithms on a complete directory tree.
# It is not suitable for accurate timings.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
#
LZOTEST="lzotest"
diff --git a/app/lzo/util/checkasm.sh b/app/lzo/util/checkasm.sh
index 63ed2b87..4fee682e 100644
--- a/app/lzo/util/checkasm.sh
+++ b/app/lzo/util/checkasm.sh
@@ -8,7 +8,7 @@ set -e
# on a complete directory tree.
# It is not suitable for accurate timings.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
#
LZOTEST="lzotest"
diff --git a/app/lzo/util/notime.pl b/app/lzo/util/notime.pl
index 9d8a6d14..5fa7d4d1 100644
--- a/app/lzo/util/notime.pl
+++ b/app/lzo/util/notime.pl
@@ -10,7 +10,7 @@
## Description:
## Remove timing values from a table created by table.pl
##
-## Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
diff --git a/app/lzo/util/overlap.sh b/app/lzo/util/overlap.sh
index 727c86f1..8f3b16b1 100644
--- a/app/lzo/util/overlap.sh
+++ b/app/lzo/util/overlap.sh
@@ -6,7 +6,7 @@ set -e
#
# This script runs the overlap example program on a complete directory tree.
#
-# Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
#
OVERLAP="overlap"
diff --git a/app/lzo/util/shortf.pl b/app/lzo/util/shortf.pl
index 380d3ebe..3e447cdd 100644
--- a/app/lzo/util/shortf.pl
+++ b/app/lzo/util/shortf.pl
@@ -10,7 +10,7 @@
## Description:
## Create short files for compression test
##
-## Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
diff --git a/app/lzo/util/table.pl b/app/lzo/util/table.pl
index 8ccbad6f..8b352073 100644
--- a/app/lzo/util/table.pl
+++ b/app/lzo/util/table.pl
@@ -10,7 +10,7 @@
## Description:
## Convert the output of the LZO lzotest program into a nice table.
##
-## Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
diff --git a/app/lzo/util/uncompr.pl b/app/lzo/util/uncompr.pl
index df3e969d..54ec9e06 100644
--- a/app/lzo/util/uncompr.pl
+++ b/app/lzo/util/uncompr.pl
@@ -10,7 +10,7 @@
## Description:
## Create incompressible files for compression test
##
-## Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
##
##---------------------------------------------------------------------------##
diff --git a/app/misc/fetchtranslations.sh b/app/misc/fetchtranslations.sh
index d92c24b5..3529a646 100755
--- a/app/misc/fetchtranslations.sh
+++ b/app/misc/fetchtranslations.sh
@@ -10,7 +10,7 @@ fi
echo "Fetch translation archive"
fetch -q http://crowdin.net/download/project/ics-openvpn.zip
-langtoinclude="ca cs de es et fr id it ja ko no nl pl ro ru sv tr uk"
+langtoinclude="ca cs de es et fr hu it ja ko no nl pl ro ru sv tr uk"
for lang in $langtoinclude
do
@@ -26,7 +26,7 @@ do
elif [ $lang = "zh-TW" ] ; then
rlang="zh-rTW"
elif [ $lang = "id" ] ; then
- rlang="id"
+ rlang="in"
fi
echo "Fetch archive for $lang"
diff --git a/app/openvpn/README.polarssl b/app/openvpn/README.polarssl
index ab7c2d78..6f1fa51a 100644
--- a/app/openvpn/README.polarssl
+++ b/app/openvpn/README.polarssl
@@ -7,7 +7,7 @@ To Build and Install,
make
make install
-This version depends on at least PolarSSL v1.1.
+This version depends on PolarSSL 1.3 (and requires at least 1.3.3).
*************************************************************************
@@ -17,12 +17,10 @@ in the PolarSSL version of OpenVPN:
* PKCS#12 file support
* --capath support - Loading certificate authorities from a directory
* Windows CryptoAPI support
- * Management external key support
* X.509 alternative username fields (must be "CN")
Plugin/Script features:
- * X.509 Serial number is in hex, not decimal as with OpenSSL
* X.509 subject line has a different format than the OpenSSL subject line
* X.509 certificate export does not work
* X.509 certificate tracking
diff --git a/app/openvpn/configure.ac b/app/openvpn/configure.ac
index 55c40847..ffba3749 100644
--- a/app/openvpn/configure.ac
+++ b/app/openvpn/configure.ac
@@ -72,6 +72,13 @@ AC_ARG_ENABLE(
)
AC_ARG_ENABLE(
+ [ofb-cfb],
+ [AS_HELP_STRING([--enable-ofb-cfb], [enable support for OFB and CFB cipher modes @<:@default=yes@:>@])],
+ ,
+ [enable_crypto_ofb_cfb="yes"]
+)
+
+AC_ARG_ENABLE(
[ssl],
[AS_HELP_STRING([--disable-ssl], [disable SSL support for TLS-based key exchange @<:@default=yes@:>@])],
,
@@ -335,6 +342,13 @@ case "$host" in
AC_DEFINE([TARGET_DRAGONFLY], [1], [Are we running on DragonFlyBSD?])
AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["D"], [Target prefix])
;;
+ *-aix*)
+ AC_DEFINE([TARGET_AIX], [1], [Are we running AIX?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["A"], [Target prefix])
+ ROUTE="/usr/sbin/route"
+ have_tap_header="yes"
+ ac_cv_header_net_if_h="no" # exists, but breaks things
+ ;;
*)
AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["X"], [Target prefix])
have_tap_header="yes"
@@ -786,24 +800,6 @@ if test "${have_openssl_crypto}" = "yes"; then
LIBS="${saved_LIBS}"
fi
-if test "${have_openssl_ssl}" = "yes"; then
- saved_CPPFLAGS="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${OPENSSL_CRYPTO_CFLAGS}"
- AC_MSG_CHECKING([for SSL_OP_NO_TICKET flag in OpenSSL])
- AC_EGREP_CPP(have_ssl_op_no_ticket, [
- #include <openssl/ssl.h>
- #ifdef SSL_OP_NO_TICKET
- have_ssl_op_no_ticket
- #endif
- ], [
- AC_MSG_RESULT([yes])
- ], [
- AC_MSG_RESULT([no])
- AC_ERROR([OpenVPN 2.4+ requires SSL_OP_NO_TICKET in OpenSSL])
- ])
- CPPFLAGS="${saved_CPPFLAGS}"
-fi
-
AC_ARG_VAR([POLARSSL_CFLAGS], [C compiler flags for polarssl])
AC_ARG_VAR([POLARSSL_LIBS], [linker flags for polarssl])
have_polarssl_ssl="yes"
@@ -1070,6 +1066,7 @@ fi
if test "${enable_crypto}" = "yes"; then
test "${have_crypto_crypto}" != "yes" && AC_MSG_ERROR([${with_crypto_library} crypto is required but missing])
+ test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes])
OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CRYPTO_CFLAGS}"
OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_CRYPTO_LIBS}"
AC_DEFINE([ENABLE_CRYPTO], [1], [Enable crypto library])
diff --git a/app/openvpn/distro/rpm/openvpn.init.d.rhel b/app/openvpn/distro/rpm/openvpn.init.d.rhel
index 821abd58..cdf3e9de 100755
--- a/app/openvpn/distro/rpm/openvpn.init.d.rhel
+++ b/app/openvpn/distro/rpm/openvpn.init.d.rhel
@@ -148,7 +148,7 @@ case "$1" in
for c in `/bin/ls *.conf 2>/dev/null`; do
bn=${c%%.conf}
if [ -f "$bn.sh" ]; then
- . $bn.sh
+ . ./$bn.sh
fi
rm -f $piddir/$bn.pid
$openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
diff --git a/app/openvpn/distro/rpm/openvpn.init.d.suse b/app/openvpn/distro/rpm/openvpn.init.d.suse
index 2bac7f32..270024e8 100644
--- a/app/openvpn/distro/rpm/openvpn.init.d.suse
+++ b/app/openvpn/distro/rpm/openvpn.init.d.suse
@@ -161,7 +161,7 @@ case "$1" in
for c in `/bin/ls *.conf 2>/dev/null`; do
bn=${c%%.conf}
if [ -f "$bn.sh" ]; then
- . $bn.sh
+ . ./$bn.sh
fi
rm -f $piddir/$bn.pid
$openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
diff --git a/app/openvpn/doc/openvpn.8 b/app/openvpn/doc/openvpn.8
index 34894e5a..aee0bc83 100644
--- a/app/openvpn/doc/openvpn.8
+++ b/app/openvpn/doc/openvpn.8
@@ -1621,7 +1621,7 @@ and
in server mode configurations.
The server timeout is set twice the value of the second argument.
-This ensures that a timeout is dectected on client side
+This ensures that a timeout is detected on client side
before the server side drops the connection.
For example,
@@ -2502,7 +2502,7 @@ Normally, adaptive compression is enabled with
.B \-\-comp-lzo.
Adaptive compression tries to optimize the case where you have
-compression enabled, but you are sending predominantly uncompressible
+compression enabled, but you are sending predominantly incompressible
(or pre-compressed) packets over the tunnel, such as an FTP or rsync transfer
of a large, compressed file. With adaptive compression,
OpenVPN will periodically sample the compression process to measure its
@@ -2704,7 +2704,7 @@ on sufficiently fast hardware. SSL/TLS authentication must
be used in this mode.
.\"*********************************************************
.TP
-.B \-\-server network netmask
+.B \-\-server network netmask ['nopool']
A helper directive designed to simplify the configuration
of OpenVPN's server mode. This directive will set up an
OpenVPN server which will allocate addresses to clients
@@ -2739,6 +2739,9 @@ expands as follows:
if !nopool:
ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
push "route-gateway 10.8.0.1"
+ if route-gateway unset:
+ route-gateway 10.8.0.2
+
.in -4
.ft
.fi
@@ -3542,7 +3545,7 @@ like this:
.B
/C=US/L=Somewhere/CN=John Doe/emailAddress=john@example.com
.IP
-In addition the old behavivour was to remap any character other than
+In addition the old behaviour was to remap any character other than
alphanumeric, underscore ('_'), dash ('-'), dot ('.'), and slash ('/') to
underscore ('_'). The X.509 Subject string as returned by the
.B tls_id
@@ -4399,7 +4402,7 @@ A different mode can be specified for each provider.
Mode is encoded as hex number, and can be a mask one of the following:
.B 0
-(default) \-\- Try to determind automatically.
+(default) \-\- Try to determine automatically.
.br
.B 1
\-\- Use sign.
@@ -4790,12 +4793,44 @@ the tls-verify script returns. The file name used for the certificate
is available via the peer_cert environment variable.
.\"*********************************************************
.TP
-.B \-\-x509-username-field fieldname
-Field in x509 certificate subject to be used as username (default=CN).
-.B Fieldname
-will be uppercased before matching. When this option is used, the
-.B \-\-verify-x509-username
-option will match against the chosen fieldname instead of the CN.
+.B \-\-x509-username-field [ext:\]fieldname
+Field in the X.509 certificate subject to be used as the username (default=CN).
+Typically, this option is specified with
+.B fieldname
+as either of the following:
+
+.B \-\-x509-username-field
+emailAddress
+.br
+.B \-\-x509-username-field ext:\fRsubjectAltName
+
+The first example uses the value of the "emailAddress" attribute in the
+certificate's Subject field as the username. The second example uses
+the
+.B ext:
+prefix to signify that the X.509 extension
+.B fieldname
+"subjectAltName" be searched for an rfc822Name (email) field to be used
+as the username. In cases where there are multiple email addresses
+in
+.B ext:fieldname\fR,
+the last occurrence is chosen.
+
+When this option is used, the
+.B \-\-verify-x509-name
+option will match against the chosen
+.B fieldname
+instead of the Common Name.
+
+.B Please note:
+This option has a feature which will convert an all-lowercase
+.B fieldname
+to uppercase characters, e.g., ou -> OU. A mixed-case
+.B fieldname
+or one having the
+.B ext:
+prefix will be left as-is. This automatic upcasing feature
+is deprecated and will be removed in a future release.
.\"*********************************************************
.TP
.B \-\-tls-remote name (DEPRECATED)
diff --git a/app/openvpn/openvpn.sln b/app/openvpn/openvpn.sln
index f832e7a4..90c01b89 100644
--- a/app/openvpn/openvpn.sln
+++ b/app/openvpn/openvpn.sln
@@ -1,38 +1,38 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32
- {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32
- {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32
- {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32
- {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32
- {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32
- {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32
- {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32
- {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32
- {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32
- {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32
- {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32
- {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32
- {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32
- {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32
- {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/app/openvpn/sample/sample-config-files/server.conf b/app/openvpn/sample/sample-config-files/server.conf
index f483b6bb..467d5b8a 100644
--- a/app/openvpn/sample/sample-config-files/server.conf
+++ b/app/openvpn/sample/sample-config-files/server.conf
@@ -83,9 +83,16 @@ key server.key # This file should be kept secret
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
-# 2048 bit keys.
+# 2048 bit keys.
dh dh1024.pem
+# Network topology
+# Should be subnet (addressing via IP)
+# unless Windows clients v2.0.9 and lower have to
+# be supported (then net30, i.e. a /30 per client)
+# Defaults to net30 (not recommended)
+;topology subnet
+
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
diff --git a/app/openvpn/sample/sample-keys/pkcs12.p12 b/app/openvpn/sample/sample-keys/pkcs12.p12
index 253d4081..8df2ccb5 100644
--- a/app/openvpn/sample/sample-keys/pkcs12.p12
+++ b/app/openvpn/sample/sample-keys/pkcs12.p12
Binary files differ
diff --git a/app/openvpn/src/compat/compat.vcxproj b/app/openvpn/src/compat/compat.vcxproj
index d872fa75..42979c11 100644
--- a/app/openvpn/src/compat/compat.vcxproj
+++ b/app/openvpn/src/compat/compat.vcxproj
@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{4B2E2719-E661-45D7-9203-F6F456B22F19}</ProjectGuid>
- <RootNamespace>compat</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="compat-basename.c" />
- <ClCompile Include="compat-dirname.c" />
- <ClCompile Include="compat-gettimeofday.c" />
- <ClCompile Include="compat-inet_ntop.c" />
- <ClCompile Include="compat-inet_pton.c" />
- <ClCompile Include="compat-daemon.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="compat.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4B2E2719-E661-45D7-9203-F6F456B22F19}</ProjectGuid>
+ <RootNamespace>compat</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="compat-basename.c" />
+ <ClCompile Include="compat-dirname.c" />
+ <ClCompile Include="compat-gettimeofday.c" />
+ <ClCompile Include="compat-inet_ntop.c" />
+ <ClCompile Include="compat-inet_pton.c" />
+ <ClCompile Include="compat-daemon.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="compat.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/src/compat/compat.vcxproj.filters b/app/openvpn/src/compat/compat.vcxproj.filters
index 9576c512..00bb0ffa 100644
--- a/app/openvpn/src/compat/compat.vcxproj.filters
+++ b/app/openvpn/src/compat/compat.vcxproj.filters
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="compat-basename.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="compat-dirname.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="compat-gettimeofday.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="compat-inet_ntop.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="compat-inet_pton.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="compat-daemon.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="compat.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="compat-basename.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-dirname.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-gettimeofday.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-inet_ntop.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-inet_pton.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-daemon.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="compat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/src/openvpn/crypto.c b/app/openvpn/src/openvpn/crypto.c
index c4c356dc..62c4ab28 100644
--- a/app/openvpn/src/openvpn/crypto.c
+++ b/app/openvpn/src/openvpn/crypto.c
@@ -100,10 +100,10 @@ openvpn_encrypt (struct buffer *buf, struct buffer work,
{
uint8_t iv_buf[OPENVPN_MAX_IV_LENGTH];
const int iv_size = cipher_ctx_iv_length (ctx->cipher);
- const unsigned int mode = cipher_ctx_mode (ctx->cipher);
+ const cipher_kt_t *cipher_kt = cipher_ctx_get_cipher_kt (ctx->cipher);
int outlen;
- if (mode == OPENVPN_MODE_CBC)
+ if (cipher_kt_mode_cbc(cipher_kt))
{
CLEAR (iv_buf);
@@ -119,7 +119,7 @@ openvpn_encrypt (struct buffer *buf, struct buffer work,
ASSERT (packet_id_write (&pin, buf, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM), true));
}
}
- else if (mode == OPENVPN_MODE_CFB || mode == OPENVPN_MODE_OFB)
+ else if (cipher_kt_mode_ofb_cfb(cipher_kt))
{
struct packet_id_net pin;
struct buffer b;
@@ -171,7 +171,10 @@ openvpn_encrypt (struct buffer *buf, struct buffer work,
/* Flush the encryption buffer */
ASSERT(cipher_ctx_final(ctx->cipher, BPTR (&work) + outlen, &outlen));
work.len += outlen;
- ASSERT (outlen == iv_size);
+
+ /* For all CBC mode ciphers, check the last block is complete */
+ ASSERT (cipher_kt_mode (cipher_kt) != OPENVPN_MODE_CBC ||
+ outlen == iv_size);
/* prepend the IV to the ciphertext */
if (opt->flags & CO_USE_IV)
@@ -272,8 +275,8 @@ openvpn_decrypt (struct buffer *buf, struct buffer work,
if (ctx->cipher)
{
- const unsigned int mode = cipher_ctx_mode (ctx->cipher);
const int iv_size = cipher_ctx_iv_length (ctx->cipher);
+ const cipher_kt_t *cipher_kt = cipher_ctx_get_cipher_kt (ctx->cipher);
uint8_t iv_buf[OPENVPN_MAX_IV_LENGTH];
int outlen;
@@ -320,7 +323,7 @@ openvpn_decrypt (struct buffer *buf, struct buffer work,
/* Get packet ID from plaintext buffer or IV, depending on cipher mode */
{
- if (mode == OPENVPN_MODE_CBC)
+ if (cipher_kt_mode_cbc(cipher_kt))
{
if (opt->packet_id)
{
@@ -329,7 +332,7 @@ openvpn_decrypt (struct buffer *buf, struct buffer work,
have_pin = true;
}
}
- else if (mode == OPENVPN_MODE_CFB || mode == OPENVPN_MODE_OFB)
+ else if (cipher_kt_mode_ofb_cfb(cipher_kt))
{
struct buffer b;
@@ -389,6 +392,60 @@ openvpn_decrypt (struct buffer *buf, struct buffer work,
}
/*
+ * This verifies if a packet and its HMAC fit to a crypto context.
+ *
+ * On success true is returned.
+ */
+bool
+crypto_test_hmac (struct buffer *buf, const struct crypto_options *opt)
+{
+ struct gc_arena gc;
+ gc_init (&gc);
+ int offset = 4; /* 1 byte opcode + 3 bytes session-id */
+
+ if (buf->len > 0 && opt->key_ctx_bi)
+ {
+ struct key_ctx *ctx = &opt->key_ctx_bi->decrypt;
+
+ /* Verify the HMAC */
+ if (ctx->hmac)
+ {
+ int hmac_len;
+ uint8_t local_hmac[MAX_HMAC_KEY_LENGTH]; /* HMAC of ciphertext computed locally */
+
+ hmac_ctx_reset(ctx->hmac);
+
+ /* Assume the length of the input HMAC */
+ hmac_len = hmac_ctx_size (ctx->hmac);
+
+ /* Authentication fails if insufficient data in packet for HMAC */
+ if ((buf->len - offset) < hmac_len)
+ {
+ gc_free (&gc);
+ return false;
+ }
+
+ hmac_ctx_update (ctx->hmac, BPTR (buf) + offset + hmac_len,
+ BLEN (buf) - offset - hmac_len);
+ hmac_ctx_final (ctx->hmac, local_hmac);
+
+ /* Compare locally computed HMAC with packet HMAC */
+ if (memcmp (local_hmac, BPTR (buf) + offset, hmac_len))
+ {
+ gc_free (&gc);
+ return false;
+ }
+
+ gc_free (&gc);
+ return true;
+ }
+ }
+
+ gc_free (&gc);
+ return false;
+}
+
+/*
* How many bytes will we add to frame buffer for a given
* set of crypto options?
*/
@@ -426,17 +483,12 @@ init_key_type (struct key_type *kt, const char *ciphername,
/* check legal cipher mode */
{
- const unsigned int mode = cipher_kt_mode (kt->cipher);
- if (!(mode == OPENVPN_MODE_CBC
-#ifdef ALLOW_NON_CBC_CIPHERS
- || (cfb_ofb_allowed && (mode == OPENVPN_MODE_CFB || mode == OPENVPN_MODE_OFB))
+ if (!(cipher_kt_mode_cbc(kt->cipher)
+#ifdef ENABLE_OFB_CFB_MODE
+ || (cfb_ofb_allowed && cipher_kt_mode_ofb_cfb(kt->cipher))
#endif
))
-#ifdef ENABLE_SMALL
msg (M_FATAL, "Cipher '%s' mode not supported", ciphername);
-#else
- msg (M_FATAL, "Cipher '%s' uses a mode not supported by " PACKAGE_NAME " in your current configuration. CBC mode is always supported, while CFB and OFB modes are supported only when using SSL/TLS authentication and key exchange mode, and when " PACKAGE_NAME " has been built with ALLOW_NON_CBC_CIPHERS.", ciphername);
-#endif
}
}
else
@@ -606,18 +658,10 @@ fixup_key (struct key *key, const struct key_type *kt)
void
check_replay_iv_consistency (const struct key_type *kt, bool packet_id, bool use_iv)
{
- if (cfb_ofb_mode (kt) && !(packet_id && use_iv))
- msg (M_FATAL, "--no-replay or --no-iv cannot be used with a CFB or OFB mode cipher");
-}
+ ASSERT(kt);
-bool
-cfb_ofb_mode (const struct key_type* kt)
-{
- if (kt && kt->cipher) {
- const unsigned int mode = cipher_kt_mode (kt->cipher);
- return mode == OPENVPN_MODE_CFB || mode == OPENVPN_MODE_OFB;
- }
- return false;
+ if (cipher_kt_mode_ofb_cfb(kt->cipher) && !(packet_id && use_iv))
+ msg (M_FATAL, "--no-replay or --no-iv cannot be used with a CFB or OFB mode cipher");
}
/*
diff --git a/app/openvpn/src/openvpn/crypto.h b/app/openvpn/src/openvpn/crypto.h
index 3b4b88ea..3c4e59d7 100644
--- a/app/openvpn/src/openvpn/crypto.h
+++ b/app/openvpn/src/openvpn/crypto.h
@@ -32,8 +32,6 @@
#ifdef ENABLE_CRYPTO
-#define ALLOW_NON_CBC_CIPHERS
-
#include "crypto_backend.h"
#include "basic.h"
#include "buffer.h"
@@ -189,8 +187,6 @@ bool write_key (const struct key *key, const struct key_type *kt,
int read_key (struct key *key, const struct key_type *kt, struct buffer *buf);
-bool cfb_ofb_mode (const struct key_type* kt);
-
void init_key_type (struct key_type *kt, const char *ciphername,
bool ciphername_defined, const char *authname, bool authname_defined,
int keysize, bool cfb_ofb_allowed, bool warn);
@@ -279,6 +275,9 @@ bool openvpn_decrypt (struct buffer *buf, struct buffer work,
const struct crypto_options *opt,
const struct frame* frame);
+
+bool crypto_test_hmac (struct buffer *buf, const struct crypto_options *opt);
+
/** @} name Functions for performing security operations on data channel packets */
void crypto_adjust_frame_parameters(struct frame *frame,
diff --git a/app/openvpn/src/openvpn/crypto_backend.h b/app/openvpn/src/openvpn/crypto_backend.h
index 5ae47e6c..a48ad6c5 100644
--- a/app/openvpn/src/openvpn/crypto_backend.h
+++ b/app/openvpn/src/openvpn/crypto_backend.h
@@ -230,6 +230,26 @@ int cipher_kt_block_size (const cipher_kt_t *cipher_kt);
*/
int cipher_kt_mode (const cipher_kt_t *cipher_kt);
+/**
+ * Check of the supplied cipher is a supported CBC mode cipher.
+ *
+ * @param cipher Static cipher parameters. May not be NULL.
+ *
+ * @return true iff the cipher is a CBC mode cipher.
+ */
+bool cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+ __attribute__((nonnull));
+
+/**
+ * Check of the supplied cipher is a supported OFB or CFB mode cipher.
+ *
+ * @param cipher Static cipher parameters. May not be NULL.
+ *
+ * @return true iff the cipher is a OFB or CFB mode cipher.
+ */
+bool cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+ __attribute__((nonnull));
+
/**
*
@@ -288,6 +308,16 @@ int cipher_ctx_block_size (const cipher_ctx_t *ctx);
int cipher_ctx_mode (const cipher_ctx_t *ctx);
/**
+ * Returns the static cipher parameters for this context.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ *
+ * @return Static cipher parameters for the supplied context.
+ */
+const cipher_kt_t *cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+ __attribute__((nonnull));
+
+/**
* Resets the given cipher context, setting the IV to the specified value.
* Preserves the associated key information.
*
diff --git a/app/openvpn/src/openvpn/crypto_openssl.c b/app/openvpn/src/openvpn/crypto_openssl.c
index c3480e02..0ac89a19 100644
--- a/app/openvpn/src/openvpn/crypto_openssl.c
+++ b/app/openvpn/src/openvpn/crypto_openssl.c
@@ -40,6 +40,7 @@
#include "basic.h"
#include "buffer.h"
#include "integer.h"
+#include "crypto.h"
#include "crypto_backend.h"
#include <openssl/objects.h>
#include <openssl/evp.h>
@@ -253,7 +254,7 @@ show_available_ciphers ()
"used as a parameter to the --cipher option. The default\n"
"key size is shown as well as whether or not it can be\n"
"changed with the --keysize directive. Using a CBC mode\n"
- "is recommended.\n\n");
+ "is recommended. In static key mode only CBC mode is allowed.\n\n");
#endif
for (nid = 0; nid < 10000; ++nid) /* is there a better way to get the size of the nid list? */
@@ -261,17 +262,22 @@ show_available_ciphers ()
const EVP_CIPHER *cipher = EVP_get_cipherbynid (nid);
if (cipher)
{
- const unsigned int mode = EVP_CIPHER_mode (cipher);
- if (mode == EVP_CIPH_CBC_MODE
-#ifdef ALLOW_NON_CBC_CIPHERS
- || mode == EVP_CIPH_CFB_MODE || mode == EVP_CIPH_OFB_MODE
+ if (cipher_kt_mode_cbc(cipher)
+#ifdef ENABLE_OFB_CFB_MODE
+ || cipher_kt_mode_ofb_cfb(cipher)
#endif
)
- printf ("%s %d bit default key (%s)\n",
- OBJ_nid2sn (nid),
- EVP_CIPHER_key_length (cipher) * 8,
- ((EVP_CIPHER_flags (cipher) & EVP_CIPH_VARIABLE_LENGTH) ?
- "variable" : "fixed"));
+ {
+ const char *var_key_size =
+ (EVP_CIPHER_flags (cipher) & EVP_CIPH_VARIABLE_LENGTH) ?
+ "variable" : "fixed";
+ const char *ssl_only = cipher_kt_mode_ofb_cfb(cipher) ?
+ " (TLS client/server mode)" : "";
+
+ printf ("%s %d bit default key (%s)%s\n", OBJ_nid2sn (nid),
+ EVP_CIPHER_key_length (cipher) * 8, var_key_size,
+ ssl_only);
+ }
}
}
printf ("\n");
@@ -483,6 +489,29 @@ cipher_kt_mode (const EVP_CIPHER *cipher_kt)
return EVP_CIPHER_mode (cipher_kt);
}
+bool
+cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+{
+ return cipher_kt_mode(cipher) == OPENVPN_MODE_CBC
+#ifdef EVP_CIPH_FLAG_AEAD_CIPHER
+ /* Exclude AEAD cipher modes, they require a different API */
+ && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
+#endif
+ ;
+}
+
+bool
+cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+{
+ return (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
+ cipher_kt_mode(cipher) == OPENVPN_MODE_CFB)
+#ifdef EVP_CIPH_FLAG_AEAD_CIPHER
+ /* Exclude AEAD cipher modes, they require a different API */
+ && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
+#endif
+ ;
+}
+
/*
*
* Generic cipher context functions
@@ -536,6 +565,13 @@ cipher_ctx_mode (const EVP_CIPHER_CTX *ctx)
return EVP_CIPHER_CTX_mode (ctx);
}
+const cipher_kt_t *
+cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+{
+ return EVP_CIPHER_CTX_cipher(ctx);
+}
+
+
int
cipher_ctx_reset (EVP_CIPHER_CTX *ctx, uint8_t *iv_buf)
{
diff --git a/app/openvpn/src/openvpn/crypto_polarssl.c b/app/openvpn/src/openvpn/crypto_polarssl.c
index 7dc8aa5b..1a986dbd 100644
--- a/app/openvpn/src/openvpn/crypto_polarssl.c
+++ b/app/openvpn/src/openvpn/crypto_polarssl.c
@@ -416,6 +416,19 @@ cipher_kt_mode (const cipher_info_t *cipher_kt)
return cipher_kt->mode;
}
+bool
+cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+{
+ return cipher_kt_mode(cipher) == OPENVPN_MODE_CBC;
+}
+
+bool
+cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+{
+ return (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
+ cipher_kt_mode(cipher) == OPENVPN_MODE_CFB);
+}
+
/*
*
@@ -464,6 +477,14 @@ int cipher_ctx_mode (const cipher_context_t *ctx)
return cipher_kt_mode(ctx->cipher_info);
}
+const cipher_kt_t *
+cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+{
+ ASSERT(NULL != ctx);
+
+ return ctx->cipher_info;
+}
+
int cipher_ctx_reset (cipher_context_t *ctx, uint8_t *iv_buf)
{
int retval = cipher_reset(ctx);
diff --git a/app/openvpn/src/openvpn/helper.c b/app/openvpn/src/openvpn/helper.c
index d9eef03b..0ed0b2ba 100644
--- a/app/openvpn/src/openvpn/helper.c
+++ b/app/openvpn/src/openvpn/helper.c
@@ -232,6 +232,8 @@ helper_client_server (struct options *o)
* if !nopool:
* ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
* push "route-gateway 10.8.0.1"
+ * if route-gateway unset:
+ * route-gateway 10.8.0.2
*/
if (o->server_defined)
@@ -311,8 +313,10 @@ helper_client_server (struct options *o)
ifconfig_pool_verify_range (M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
}
o->ifconfig_pool_netmask = o->server_netmask;
-
+
push_option (o, print_opt_route_gateway (o->server_network + 1, &o->gc), M_USAGE);
+ if (!o->route_default_gateway)
+ o->route_default_gateway = print_in_addr_t (o->server_network + 2, 0, &o->gc);
}
else
ASSERT (0);
diff --git a/app/openvpn/src/openvpn/init.c b/app/openvpn/src/openvpn/init.c
index ede955a1..6137588d 100644
--- a/app/openvpn/src/openvpn/init.c
+++ b/app/openvpn/src/openvpn/init.c
@@ -2150,7 +2150,7 @@ do_init_crypto_tls (struct context *c, const unsigned int flags)
options->use_iv);
/* In short form, unique datagram identifier is 32 bits, in long form 64 bits */
- packet_id_long_form = cfb_ofb_mode (&c->c1.ks.key_type);
+ packet_id_long_form = cipher_kt_mode_ofb_cfb (c->c1.ks.key_type.cipher);
/* Compute MTU parameters */
crypto_adjust_frame_parameters (&c->c2.frame,
@@ -3165,13 +3165,24 @@ management_show_net_callback (void *arg, const int msglevel)
int
managmenet_callback_network_change (void *arg)
{
+ int socketfd=-1;
struct context *c = (struct context *) arg;
if (!c->c2.link_socket)
return -1;
if (c->c2.link_socket->sd == SOCKET_UNDEFINED)
return -1;
- return c->c2.link_socket->sd;
+ /* Check if the client should translate the network change to a SIGUSR1 to
+ reestablish the connection or just reprotect the socket */
+
+ /* At the moment just assume that, for all settings that use pull
+ reestablishing the connection is required */
+
+ socketfd = c->c2.link_socket->sd;
+ if (!c->options.pull || c->c2.tls_multi->use_session_id)
+ return socketfd;
+ else
+ return -2;
}
#endif
diff --git a/app/openvpn/src/openvpn/manage.c b/app/openvpn/src/openvpn/manage.c
index e7a7fe85..9913197b 100644
--- a/app/openvpn/src/openvpn/manage.c
+++ b/app/openvpn/src/openvpn/manage.c
@@ -1113,7 +1113,9 @@ man_network_change (struct management *man)
{
int fd = (*man->persist.callback.network_change)(man->persist.callback.arg);
man->connection.fdtosend = fd;
- msg (M_CLIENT, "PROTECTFD: fd '%d' sent to be protected", fd);
+ msg (M_CLIENT, "PROTECTFD: fd '%d' sent to be protected", fd);
+ if (fd == -2)
+ man_signal (man, "USR1");
}
}
#endif
@@ -1164,7 +1166,7 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
#ifdef TARGET_ANDROID
else if (streq (p[0], "network-change"))
{
- man_network_change(man);
+ man_network_change(man);
}
#endif
else if (streq (p[0], "load-stats"))
diff --git a/app/openvpn/src/openvpn/misc.c b/app/openvpn/src/openvpn/misc.c
index 7483184f..63b4c1cf 100644
--- a/app/openvpn/src/openvpn/misc.c
+++ b/app/openvpn/src/openvpn/misc.c
@@ -861,6 +861,12 @@ test_file (const char *filename)
fclose (fp);
ret = true;
}
+ else
+ {
+ if( openvpn_errno () == EACCES ) {
+ msg( M_WARN | M_ERRNO, "Could not access file '%s'", filename);
+ }
+ }
}
dmsg (D_TEST_FILE, "TEST FILE '%s' [%d]",
diff --git a/app/openvpn/src/openvpn/mudp.c b/app/openvpn/src/openvpn/mudp.c
index 3468dab5..f7ab6253 100644
--- a/app/openvpn/src/openvpn/mudp.c
+++ b/app/openvpn/src/openvpn/mudp.c
@@ -38,6 +38,55 @@
#include "memdbg.h"
/*
+ * Update instance with new peer address
+ */
+void
+update_floated(struct multi_context *m, struct multi_instance *mi,
+ struct mroute_addr real, uint32_t hv)
+{
+ struct mroute_addr real_old;
+
+ real_old = mi->real;
+ generate_prefix (mi);
+
+ /* remove before modifying mi->real, since it also modifies key in hash */
+ hash_remove(m->hash, &real_old);
+ hash_remove(m->iter, &real_old);
+
+ /* update address */
+ memcpy(&mi->real, &real, sizeof(real));
+
+ mi->context.c2.from = m->top.c2.from;
+ mi->context.c2.to_link_addr = &mi->context.c2.from;
+
+ /* switch to new log prefix */
+ generate_prefix (mi);
+ /* inherit buffers */
+ mi->context.c2.buffers = m->top.c2.buffers;
+
+ /* inherit parent link_socket and link_socket_info */
+ mi->context.c2.link_socket = m->top.c2.link_socket;
+ mi->context.c2.link_socket_info->lsa->actual = m->top.c2.from;
+
+ /* fix remote_addr in tls structure */
+ tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
+ mi->did_open_context = true;
+
+ hash_add(m->hash, &mi->real, mi, false);
+ hash_add(m->iter, &mi->real, mi, false);
+
+ mi->did_real_hash = true;
+#ifdef MANAGEMENT_DEF_AUTH
+ hash_remove (m->cid_hash, &mi->context.c2.mda_context.cid);
+ hash_add (m->cid_hash, &mi->context.c2.mda_context.cid, mi, false);
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+ mi->did_cid_hash = true;
+#endif
+}
+
+/*
* Get a client instance based on real address. If
* the instance doesn't exist, create it while
* maintaining real address hash table atomicity.
@@ -56,15 +105,47 @@ multi_get_create_instance_udp (struct multi_context *m)
struct hash_element *he;
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
-
- he = hash_lookup_fast (hash, bucket, &real, hv);
+ uint8_t* ptr = BPTR(&m->top.c2.buf);
+ uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
+ uint32_t sess_id;
+ bool session_forged = false;
- if (he)
+ if (op == P_DATA_V2)
{
- mi = (struct multi_instance *) he->value;
+ sess_id = (*(uint32_t*)ptr) >> 8;
+ if ((sess_id < m->max_clients) && (m->instances[sess_id]))
+ {
+ mi = m->instances[sess_id];
+
+ if (!link_socket_actual_match(&mi->context.c2.from, &m->top.c2.from))
+ {
+ msg(D_MULTI_MEDIUM, "floating detected from %s to %s",
+ print_link_socket_actual (&mi->context.c2.from, &gc), print_link_socket_actual (&m->top.c2.from, &gc));
+
+ /* session-id is not trusted, so check hmac */
+ session_forged = !(crypto_test_hmac(&m->top.c2.buf, &mi->context.c2.crypto_options));
+ if (session_forged)
+ {
+ mi = NULL;
+ msg (D_MULTI_MEDIUM, "hmac verification failed, session forge detected!");
+ }
+ else
+ {
+ update_floated(m, mi, real, hv);
+ }
+ }
+ }
}
else
{
+ he = hash_lookup_fast (hash, bucket, &real, hv);
+ if (he)
+ {
+ mi = (struct multi_instance *) he->value;
+ }
+ }
+ if (!mi && !session_forged)
+ {
if (!m->top.c2.tls_auth_standalone
|| tls_pre_decrypt_lite (m->top.c2.tls_auth_standalone, &m->top.c2.from, &m->top.c2.buf))
{
@@ -75,6 +156,17 @@ multi_get_create_instance_udp (struct multi_context *m)
{
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
+
+ int i;
+ for (i = 0; i < m->max_clients; ++ i)
+ {
+ if (!m->instances[i])
+ {
+ mi->context.c2.tls_multi->vpn_session_id = i;
+ m->instances[i] = mi;
+ break;
+ }
+ }
}
}
else
@@ -89,15 +181,17 @@ multi_get_create_instance_udp (struct multi_context *m)
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
- const char *status;
+ const char *status = mi ? "[ok]" : "[failed]";
+ /*
if (he && mi)
status = "[succeeded]";
else if (!he && mi)
status = "[created]";
else
status = "[failed]";
-
+ */
+
dmsg (D_MULTI_DEBUG, "GET INST BY REAL: %s %s",
mroute_addr_print (&real, &gc),
status);
diff --git a/app/openvpn/src/openvpn/multi.c b/app/openvpn/src/openvpn/multi.c
index 16250dc2..a4289ac7 100644
--- a/app/openvpn/src/openvpn/multi.c
+++ b/app/openvpn/src/openvpn/multi.c
@@ -303,6 +303,7 @@ multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int threa
cid_compare_function);
#endif
+
/*
* This is our scheduler, for time-based wakeup
* events.
@@ -373,6 +374,13 @@ multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int threa
*/
m->max_clients = t->options.max_clients;
+ int i;
+ m->instances = malloc(sizeof(struct multi_instance*) * m->max_clients);
+ for (i = 0; i < m->max_clients; ++ i)
+ {
+ m->instances[i] = NULL;
+ }
+
/*
* Initialize multi-socket TCP I/O wait object
*/
@@ -553,6 +561,8 @@ multi_close_instance (struct multi_context *m,
}
#endif
+ m->instances[mi->context.c2.tls_multi->vpn_session_id] = NULL;
+
schedule_remove_entry (m->schedule, (struct schedule_entry *) mi);
ifconfig_pool_release (m->ifconfig_pool, mi->vaddr_handle, false);
@@ -629,6 +639,8 @@ multi_uninit (struct multi_context *m)
#endif
m->hash = NULL;
+ free(m->instances);
+
schedule_free (m->schedule);
mbuf_free (m->mbuf);
ifconfig_pool_free (m->ifconfig_pool);
@@ -652,8 +664,6 @@ multi_create_instance (struct multi_context *m, const struct mroute_addr *real)
perf_push (PERF_MULTI_CREATE_INSTANCE);
- msg (D_MULTI_MEDIUM, "MULTI: multi_create_instance called");
-
ALLOC_OBJ_CLEAR (mi, struct multi_instance);
mi->gc = gc_new ();
@@ -2159,8 +2169,17 @@ multi_process_incoming_link (struct multi_context *m, struct multi_instance *ins
/* make sure that source address is associated with this client */
else if (multi_get_instance_by_virtual_addr (m, &src, true) != m->pending)
{
- msg (D_MULTI_DROPPED, "MULTI: bad source address from client [%s], packet dropped",
- mroute_addr_print (&src, &gc));
+ /* IPv6 link-local address (fe80::xxx)? */
+ if ( (src.type & MR_ADDR_MASK) == MR_ADDR_IPV6 &&
+ src.addr[0] == 0xfe && src.addr[1] == 0x80 )
+ {
+ /* do nothing, for now. TODO: add address learning */
+ }
+ else
+ {
+ msg (D_MULTI_DROPPED, "MULTI: bad source address from client [%s], packet dropped",
+ mroute_addr_print (&src, &gc));
+ }
c->c2.to_tun.len = 0;
}
/* client-to-client communication enabled? */
diff --git a/app/openvpn/src/openvpn/multi.h b/app/openvpn/src/openvpn/multi.h
index fc2ffb24..0446fbfc 100644
--- a/app/openvpn/src/openvpn/multi.h
+++ b/app/openvpn/src/openvpn/multi.h
@@ -125,6 +125,8 @@ struct multi_context {
# define MC_WORK_THREAD (MC_MULTI_THREADED_WORKER|MC_MULTI_THREADED_SCHEDULER)
int thread_mode;
+ struct multi_instance** instances;
+
struct hash *hash; /**< VPN tunnel instances indexed by real
* address of the remote peer. */
struct hash *vhash; /**< VPN tunnel instances indexed by
diff --git a/app/openvpn/src/openvpn/openvpn.vcxproj b/app/openvpn/src/openvpn/openvpn.vcxproj
index 452876fc..3b2340ee 100755
--- a/app/openvpn/src/openvpn/openvpn.vcxproj
+++ b/app/openvpn/src/openvpn/openvpn.vcxproj
@@ -1,263 +1,263 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}</ProjectGuid>
- <RootNamespace>openvpn</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
- </ClCompile>
- <ResourceCompile>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
- </ClCompile>
- <ResourceCompile>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="base64.c" />
- <ClCompile Include="buffer.c" />
- <ClCompile Include="clinat.c" />
- <ClCompile Include="console.c" />
- <ClCompile Include="crypto.c" />
- <ClCompile Include="crypto_openssl.c" />
- <ClCompile Include="cryptoapi.c" />
- <ClCompile Include="dhcp.c" />
- <ClCompile Include="error.c" />
- <ClCompile Include="event.c" />
- <ClCompile Include="fdmisc.c" />
- <ClCompile Include="forward.c" />
- <ClCompile Include="fragment.c" />
- <ClCompile Include="gremlin.c" />
- <ClCompile Include="helper.c" />
- <ClCompile Include="httpdigest.c" />
- <ClCompile Include="init.c" />
- <ClCompile Include="interval.c" />
- <ClCompile Include="list.c" />
- <ClCompile Include="lladdr.c" />
- <ClCompile Include="lzo.c" />
- <ClCompile Include="manage.c" />
- <ClCompile Include="mbuf.c" />
- <ClCompile Include="misc.c" />
- <ClCompile Include="mroute.c" />
- <ClCompile Include="mss.c" />
- <ClCompile Include="mstats.c" />
- <ClCompile Include="mtcp.c" />
- <ClCompile Include="mtu.c" />
- <ClCompile Include="mudp.c" />
- <ClCompile Include="multi.c" />
- <ClCompile Include="ntlm.c" />
- <ClCompile Include="occ.c" />
- <ClCompile Include="openvpn.c" />
- <ClCompile Include="options.c" />
- <ClCompile Include="otime.c" />
- <ClCompile Include="packet_id.c" />
- <ClCompile Include="perf.c" />
- <ClCompile Include="pf.c" />
- <ClCompile Include="ping.c" />
- <ClCompile Include="pkcs11.c" />
- <ClCompile Include="pkcs11_openssl.c" />
- <ClCompile Include="platform.c" />
- <ClCompile Include="plugin.c" />
- <ClCompile Include="pool.c" />
- <ClCompile Include="proto.c" />
- <ClCompile Include="proxy.c" />
- <ClCompile Include="ps.c" />
- <ClCompile Include="push.c" />
- <ClCompile Include="reliable.c" />
- <ClCompile Include="route.c" />
- <ClCompile Include="schedule.c" />
- <ClCompile Include="session_id.c" />
- <ClCompile Include="shaper.c" />
- <ClCompile Include="sig.c" />
- <ClCompile Include="socket.c" />
- <ClCompile Include="socks.c" />
- <ClCompile Include="ssl.c" />
- <ClCompile Include="ssl_openssl.c" />
- <ClCompile Include="ssl_verify.c" />
- <ClCompile Include="ssl_verify_openssl.c" />
- <ClCompile Include="status.c" />
- <ClCompile Include="tun.c" />
- <ClCompile Include="win32.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="base64.h" />
- <ClInclude Include="basic.h" />
- <ClInclude Include="buffer.h" />
- <ClInclude Include="circ_list.h" />
- <ClInclude Include="clinat.h" />
- <ClInclude Include="common.h" />
- <ClInclude Include="console.h" />
- <ClInclude Include="crypto.h" />
- <ClInclude Include="crypto_backend.h" />
- <ClInclude Include="crypto_openssl.h" />
- <ClInclude Include="cryptoapi.h" />
- <ClInclude Include="dhcp.h" />
- <ClInclude Include="errlevel.h" />
- <ClInclude Include="error.h" />
- <ClInclude Include="event.h" />
- <ClInclude Include="fdmisc.h" />
- <ClInclude Include="forward-inline.h" />
- <ClInclude Include="forward.h" />
- <ClInclude Include="fragment.h" />
- <ClInclude Include="gremlin.h" />
- <ClInclude Include="helper.h" />
- <ClInclude Include="httpdigest.h" />
- <ClInclude Include="init.h" />
- <ClInclude Include="integer.h" />
- <ClInclude Include="interval.h" />
- <ClInclude Include="list.h" />
- <ClInclude Include="lladdr.h" />
- <ClInclude Include="lzo.h" />
- <ClInclude Include="manage.h" />
- <ClInclude Include="mbuf.h" />
- <ClInclude Include="memdbg.h" />
- <ClInclude Include="misc.h" />
- <ClInclude Include="mroute.h" />
- <ClInclude Include="mss.h" />
- <ClInclude Include="mstats.h" />
- <ClInclude Include="mtcp.h" />
- <ClInclude Include="mtu.h" />
- <ClInclude Include="mudp.h" />
- <ClInclude Include="multi.h" />
- <ClInclude Include="ntlm.h" />
- <ClInclude Include="occ-inline.h" />
- <ClInclude Include="occ.h" />
- <ClInclude Include="openvpn.h" />
- <ClInclude Include="options.h" />
- <ClInclude Include="otime.h" />
- <ClInclude Include="packet_id.h" />
- <ClInclude Include="perf.h" />
- <ClInclude Include="pf-inline.h" />
- <ClInclude Include="pf.h" />
- <ClInclude Include="ping-inline.h" />
- <ClInclude Include="ping.h" />
- <ClInclude Include="pkcs11.h" />
- <ClInclude Include="pkcs11_backend.h" />
- <ClInclude Include="platform.h" />
- <ClInclude Include="plugin.h" />
- <ClInclude Include="pool.h" />
- <ClInclude Include="proto.h" />
- <ClInclude Include="proxy.h" />
- <ClInclude Include="ps.h" />
- <ClInclude Include="push.h" />
- <ClInclude Include="pushlist.h" />
- <ClInclude Include="reliable.h" />
- <ClInclude Include="route.h" />
- <ClInclude Include="schedule.h" />
- <ClInclude Include="session_id.h" />
- <ClInclude Include="shaper.h" />
- <ClInclude Include="sig.h" />
- <ClInclude Include="socket.h" />
- <ClInclude Include="socks.h" />
- <ClInclude Include="ssl.h" />
- <ClInclude Include="ssl_backend.h" />
- <ClInclude Include="ssl_common.h" />
- <ClInclude Include="ssl_openssl.h" />
- <ClInclude Include="ssl_verify.h" />
- <ClInclude Include="ssl_verify_backend.h" />
- <ClInclude Include="ssl_verify_openssl.h" />
- <ClInclude Include="status.h" />
- <ClInclude Include="syshead.h" />
- <ClInclude Include="tun.h" />
- <ClInclude Include="win32.h" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="openvpn_win32_resources.rc" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
- <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- <ProjectReference Include="..\compat\compat.vcxproj">
- <Project>{4b2e2719-e661-45d7-9203-f6f456b22f19}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}</ProjectGuid>
+ <RootNamespace>openvpn</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="base64.c" />
+ <ClCompile Include="buffer.c" />
+ <ClCompile Include="clinat.c" />
+ <ClCompile Include="console.c" />
+ <ClCompile Include="crypto.c" />
+ <ClCompile Include="crypto_openssl.c" />
+ <ClCompile Include="cryptoapi.c" />
+ <ClCompile Include="dhcp.c" />
+ <ClCompile Include="error.c" />
+ <ClCompile Include="event.c" />
+ <ClCompile Include="fdmisc.c" />
+ <ClCompile Include="forward.c" />
+ <ClCompile Include="fragment.c" />
+ <ClCompile Include="gremlin.c" />
+ <ClCompile Include="helper.c" />
+ <ClCompile Include="httpdigest.c" />
+ <ClCompile Include="init.c" />
+ <ClCompile Include="interval.c" />
+ <ClCompile Include="list.c" />
+ <ClCompile Include="lladdr.c" />
+ <ClCompile Include="lzo.c" />
+ <ClCompile Include="manage.c" />
+ <ClCompile Include="mbuf.c" />
+ <ClCompile Include="misc.c" />
+ <ClCompile Include="mroute.c" />
+ <ClCompile Include="mss.c" />
+ <ClCompile Include="mstats.c" />
+ <ClCompile Include="mtcp.c" />
+ <ClCompile Include="mtu.c" />
+ <ClCompile Include="mudp.c" />
+ <ClCompile Include="multi.c" />
+ <ClCompile Include="ntlm.c" />
+ <ClCompile Include="occ.c" />
+ <ClCompile Include="openvpn.c" />
+ <ClCompile Include="options.c" />
+ <ClCompile Include="otime.c" />
+ <ClCompile Include="packet_id.c" />
+ <ClCompile Include="perf.c" />
+ <ClCompile Include="pf.c" />
+ <ClCompile Include="ping.c" />
+ <ClCompile Include="pkcs11.c" />
+ <ClCompile Include="pkcs11_openssl.c" />
+ <ClCompile Include="platform.c" />
+ <ClCompile Include="plugin.c" />
+ <ClCompile Include="pool.c" />
+ <ClCompile Include="proto.c" />
+ <ClCompile Include="proxy.c" />
+ <ClCompile Include="ps.c" />
+ <ClCompile Include="push.c" />
+ <ClCompile Include="reliable.c" />
+ <ClCompile Include="route.c" />
+ <ClCompile Include="schedule.c" />
+ <ClCompile Include="session_id.c" />
+ <ClCompile Include="shaper.c" />
+ <ClCompile Include="sig.c" />
+ <ClCompile Include="socket.c" />
+ <ClCompile Include="socks.c" />
+ <ClCompile Include="ssl.c" />
+ <ClCompile Include="ssl_openssl.c" />
+ <ClCompile Include="ssl_verify.c" />
+ <ClCompile Include="ssl_verify_openssl.c" />
+ <ClCompile Include="status.c" />
+ <ClCompile Include="tun.c" />
+ <ClCompile Include="win32.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="base64.h" />
+ <ClInclude Include="basic.h" />
+ <ClInclude Include="buffer.h" />
+ <ClInclude Include="circ_list.h" />
+ <ClInclude Include="clinat.h" />
+ <ClInclude Include="common.h" />
+ <ClInclude Include="console.h" />
+ <ClInclude Include="crypto.h" />
+ <ClInclude Include="crypto_backend.h" />
+ <ClInclude Include="crypto_openssl.h" />
+ <ClInclude Include="cryptoapi.h" />
+ <ClInclude Include="dhcp.h" />
+ <ClInclude Include="errlevel.h" />
+ <ClInclude Include="error.h" />
+ <ClInclude Include="event.h" />
+ <ClInclude Include="fdmisc.h" />
+ <ClInclude Include="forward-inline.h" />
+ <ClInclude Include="forward.h" />
+ <ClInclude Include="fragment.h" />
+ <ClInclude Include="gremlin.h" />
+ <ClInclude Include="helper.h" />
+ <ClInclude Include="httpdigest.h" />
+ <ClInclude Include="init.h" />
+ <ClInclude Include="integer.h" />
+ <ClInclude Include="interval.h" />
+ <ClInclude Include="list.h" />
+ <ClInclude Include="lladdr.h" />
+ <ClInclude Include="lzo.h" />
+ <ClInclude Include="manage.h" />
+ <ClInclude Include="mbuf.h" />
+ <ClInclude Include="memdbg.h" />
+ <ClInclude Include="misc.h" />
+ <ClInclude Include="mroute.h" />
+ <ClInclude Include="mss.h" />
+ <ClInclude Include="mstats.h" />
+ <ClInclude Include="mtcp.h" />
+ <ClInclude Include="mtu.h" />
+ <ClInclude Include="mudp.h" />
+ <ClInclude Include="multi.h" />
+ <ClInclude Include="ntlm.h" />
+ <ClInclude Include="occ-inline.h" />
+ <ClInclude Include="occ.h" />
+ <ClInclude Include="openvpn.h" />
+ <ClInclude Include="options.h" />
+ <ClInclude Include="otime.h" />
+ <ClInclude Include="packet_id.h" />
+ <ClInclude Include="perf.h" />
+ <ClInclude Include="pf-inline.h" />
+ <ClInclude Include="pf.h" />
+ <ClInclude Include="ping-inline.h" />
+ <ClInclude Include="ping.h" />
+ <ClInclude Include="pkcs11.h" />
+ <ClInclude Include="pkcs11_backend.h" />
+ <ClInclude Include="platform.h" />
+ <ClInclude Include="plugin.h" />
+ <ClInclude Include="pool.h" />
+ <ClInclude Include="proto.h" />
+ <ClInclude Include="proxy.h" />
+ <ClInclude Include="ps.h" />
+ <ClInclude Include="push.h" />
+ <ClInclude Include="pushlist.h" />
+ <ClInclude Include="reliable.h" />
+ <ClInclude Include="route.h" />
+ <ClInclude Include="schedule.h" />
+ <ClInclude Include="session_id.h" />
+ <ClInclude Include="shaper.h" />
+ <ClInclude Include="sig.h" />
+ <ClInclude Include="socket.h" />
+ <ClInclude Include="socks.h" />
+ <ClInclude Include="ssl.h" />
+ <ClInclude Include="ssl_backend.h" />
+ <ClInclude Include="ssl_common.h" />
+ <ClInclude Include="ssl_openssl.h" />
+ <ClInclude Include="ssl_verify.h" />
+ <ClInclude Include="ssl_verify_backend.h" />
+ <ClInclude Include="ssl_verify_openssl.h" />
+ <ClInclude Include="status.h" />
+ <ClInclude Include="syshead.h" />
+ <ClInclude Include="tun.h" />
+ <ClInclude Include="win32.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpn_win32_resources.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+ <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\compat\compat.vcxproj">
+ <Project>{4b2e2719-e661-45d7-9203-f6f456b22f19}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/src/openvpn/openvpn.vcxproj.filters b/app/openvpn/src/openvpn/openvpn.vcxproj.filters
index ec5e676c..40336ba8 100644
--- a/app/openvpn/src/openvpn/openvpn.vcxproj.filters
+++ b/app/openvpn/src/openvpn/openvpn.vcxproj.filters
@@ -1,458 +1,458 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="base64.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="buffer.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="clinat.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="console.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="crypto.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="crypto_openssl.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="cryptoapi.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="dhcp.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="error.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="event.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="fdmisc.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="forward.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="fragment.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="gremlin.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="helper.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="httpdigest.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="init.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="interval.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="list.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="lladdr.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="lzo.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="manage.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mbuf.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="misc.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mroute.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mss.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mstats.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mtcp.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mtu.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="mudp.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="multi.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ntlm.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="occ.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="openvpn.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="options.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="otime.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="packet_id.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="perf.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pf.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ping.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pkcs11.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pkcs11_openssl.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="platform.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="plugin.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pool.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="proto.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="proxy.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ps.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="push.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="reliable.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="route.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="schedule.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="session_id.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="shaper.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="sig.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="socket.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="socks.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ssl.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ssl_openssl.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ssl_verify.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="ssl_verify_openssl.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="status.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="tun.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="win32.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="base64.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="basic.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="buffer.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="circ_list.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="clinat.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="common.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="console.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="crypto.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="crypto_backend.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="crypto_openssl.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cryptoapi.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="dhcp.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="errlevel.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="error.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="event.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="fdmisc.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="forward-inline.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="forward.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="fragment.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="gremlin.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="helper.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="httpdigest.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="init.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="integer.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="interval.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="list.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="lladdr.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="lzo.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="manage.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mbuf.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="memdbg.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="misc.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mroute.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mss.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mstats.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mtcp.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mtu.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="mudp.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="multi.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ntlm.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="occ-inline.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="occ.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="openvpn.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="options.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="otime.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="packet_id.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="perf.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pf-inline.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pf.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ping-inline.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ping.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pkcs11.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pkcs11_backend.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="platform.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="plugin.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pool.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="proto.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="proxy.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ps.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="push.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="pushlist.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="reliable.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="route.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="schedule.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="session_id.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="shaper.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="sig.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="socket.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="socks.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_backend.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_common.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_openssl.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_verify.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_verify_backend.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="ssl_verify_openssl.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="status.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="syshead.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="tun.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="win32.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="openvpn_win32_resources.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="base64.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="buffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="clinat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="console.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="crypto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="crypto_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="cryptoapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dhcp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="error.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="event.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="fdmisc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="forward.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="fragment.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="gremlin.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="helper.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="httpdigest.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="init.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="interval.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="list.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lladdr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lzo.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="manage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mbuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="misc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mroute.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mss.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mstats.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mtcp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mtu.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mudp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="multi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ntlm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="occ.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="openvpn.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="options.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="otime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="packet_id.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="perf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ping.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pkcs11.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pkcs11_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="platform.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="plugin.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pool.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="proto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="proxy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ps.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="push.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="reliable.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="route.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="schedule.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="session_id.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="shaper.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="sig.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="socket.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="socks.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_verify.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_verify_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="status.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="tun.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="win32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="base64.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="basic.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="buffer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="circ_list.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="clinat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="console.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="cryptoapi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="dhcp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="errlevel.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="error.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="event.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="fdmisc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="forward-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="forward.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="fragment.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="gremlin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="helper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="httpdigest.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="init.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="integer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="interval.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="list.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="lladdr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="lzo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="manage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="memdbg.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="misc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mroute.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mss.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mstats.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mtcp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mtu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mudp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="multi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ntlm.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="occ-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="occ.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="openvpn.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="options.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="otime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="packet_id.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="perf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pf-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ping-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ping.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pkcs11.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pkcs11_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="platform.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="plugin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="proxy.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ps.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="push.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pushlist.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="reliable.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="route.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="schedule.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="session_id.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="shaper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="sig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="socket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="socks.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="status.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="syshead.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="tun.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="win32.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpn_win32_resources.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/src/openvpn/options.c b/app/openvpn/src/openvpn/options.c
index fc764616..9ff2db5a 100644
--- a/app/openvpn/src/openvpn/options.c
+++ b/app/openvpn/src/openvpn/options.c
@@ -575,8 +575,8 @@ static const char usage_message[] =
" and optionally the root CA certificate.\n"
#endif
#ifdef ENABLE_X509ALTUSERNAME
- "--x509-username-field : Field used in x509 certificate to be username.\n"
- " Default is CN.\n"
+ "--x509-username-field : Field in x509 certificate containing the username.\n"
+ " Default is CN in the Subject field.\n"
#endif
"--verify-hash : Specify SHA1 fingerprint for level-1 cert.\n"
#ifdef WIN32
@@ -3898,7 +3898,8 @@ apply_push_options (struct options *options,
struct buffer *buf,
unsigned int permission_mask,
unsigned int *option_types_found,
- struct env_set *es)
+ struct env_set *es,
+ struct tls_multi *tls_multi)
{
char line[OPTION_PARM_SIZE];
int line_num = 0;
@@ -3912,7 +3913,17 @@ apply_push_options (struct options *options,
++line_num;
if (parse_line (line, p, SIZE (p), file, line_num, msglevel, &options->gc))
{
- add_option (options, p, file, line_num, 0, msglevel, permission_mask, option_types_found, es);
+ if (streq(p[0], "session_id"))
+ {
+ /* Server supports P_DATA_V2 */
+ tls_multi->vpn_session_id = atoi(p[1]);
+ tls_multi->use_session_id = true;
+ msg(D_PUSH, "session id: %d", tls_multi->vpn_session_id);
+ }
+ else
+ {
+ add_option (options, p, file, line_num, 0, msglevel, permission_mask, option_types_found, es);
+ }
}
}
return true;
@@ -6870,10 +6881,28 @@ add_option (struct options *options,
#ifdef ENABLE_X509ALTUSERNAME
else if (streq (p[0], "x509-username-field") && p[1])
{
+ /* This option used to automatically upcase the fieldname passed as the
+ * option argument, e.g., "ou" became "OU". Now, this "helpfulness" is
+ * fine-tuned by only upcasing Subject field attribute names which consist
+ * of all lower-case characters. Mixed-case attributes such as
+ * "emailAddress" are left as-is. An option parameter having the "ext:"
+ * prefix for matching X.509v3 extended fields will also remain unchanged.
+ */
char *s = p[1];
+
VERIFY_PERMISSION (OPT_P_GENERAL);
- if( strncmp ("ext:",s,4) != 0 )
- while ((*s = toupper(*s)) != '\0') s++; /* Uppercase if necessary */
+ if (strncmp("ext:", s, 4) != 0)
+ {
+ size_t i = 0;
+ while (s[i] && !isupper(s[i])) i++;
+ if (strlen(s) == i)
+ {
+ while ((*s = toupper(*s)) != '\0') s++;
+ msg(M_WARN, "DEPRECATED FEATURE: automatically upcased the "
+ "--x509-username-field parameter to '%s'; please update your"
+ "configuration", p[1]);
+ }
+ }
options->x509_username_field = p[1];
}
#endif /* ENABLE_X509ALTUSERNAME */
diff --git a/app/openvpn/src/openvpn/options.h b/app/openvpn/src/openvpn/options.h
index 21c210ee..77c942ca 100644
--- a/app/openvpn/src/openvpn/options.h
+++ b/app/openvpn/src/openvpn/options.h
@@ -712,11 +712,13 @@ void options_postprocess (struct options *options);
void pre_pull_save (struct options *o);
void pre_pull_restore (struct options *o, struct gc_arena *gc);
+struct tls_multi;
bool apply_push_options (struct options *options,
struct buffer *buf,
unsigned int permission_mask,
unsigned int *option_types_found,
- struct env_set *es);
+ struct env_set *es,
+ struct tls_multi* tls_multi);
void options_detach (struct options *o);
diff --git a/app/openvpn/src/openvpn/push.c b/app/openvpn/src/openvpn/push.c
index 24d12c7b..028d838e 100644
--- a/app/openvpn/src/openvpn/push.c
+++ b/app/openvpn/src/openvpn/push.c
@@ -303,6 +303,11 @@ send_push_reply (struct context *c)
if (multi_push)
buf_printf (&buf, ",push-continuation 1");
+ /* Send session_id if client supports it */
+ if (c->c2.tls_multi->peer_info && strstr(c->c2.tls_multi->peer_info, "IV_PROTO=2")) {
+ buf_printf(&buf, ",session_id %d", c->c2.tls_multi->vpn_session_id);
+ }
+
if (BLEN (&buf) > sizeof(cmd)-1)
{
const bool status = send_control_channel_string (c, BSTR (&buf), D_PUSH);
@@ -462,7 +467,8 @@ process_incoming_push_msg (struct context *c,
&buf,
permission_mask,
option_types_found,
- c->c2.es))
+ c->c2.es,
+ c->c2.tls_multi))
switch (c->options.push_continuation)
{
case 0:
diff --git a/app/openvpn/src/openvpn/route.c b/app/openvpn/src/openvpn/route.c
index bcc6fcee..562af9fe 100644
--- a/app/openvpn/src/openvpn/route.c
+++ b/app/openvpn/src/openvpn/route.c
@@ -1535,6 +1535,17 @@ add_route (struct route_ipv4 *r,
argv_msg (D_ROUTE, &argv);
status = openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD/NetBSD route add command failed");
+#elif defined(TARGET_AIX)
+
+ {
+ int netbits = netmask_to_netbits2(r->netmask);
+ argv_printf (&argv, "%s add -net %s/%d %s",
+ ROUTE_PATH,
+ network, netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+ }
+
#else
msg (M_FATAL, "Sorry, but I don't know how to do 'route' commands on this operating system. Try putting your routes in a --route-up script");
#endif
@@ -1754,6 +1765,14 @@ add_route_ipv6 (struct route_ipv6 *r6, const struct tuntap *tt, unsigned int fla
argv_msg (D_ROUTE, &argv);
status = openvpn_execve_check (&argv, es, 0, "ERROR: NetBSD route add -inet6 command failed");
+#elif defined(TARGET_AIX)
+
+ argv_printf (&argv, "%s add -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+
#else
msg (M_FATAL, "Sorry, but I don't know how to do 'route ipv6' commands on this operating system. Try putting your routes in a --route-up script");
#endif
@@ -1912,8 +1931,21 @@ delete_route (struct route_ipv4 *r,
argv_msg (D_ROUTE, &argv);
openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD/NetBSD route delete command failed");
+
#elif defined(TARGET_ANDROID)
msg (M_NONFATAL, "Sorry, deleting routes on Android is not possible. The VpnService API allows routes to be set on connect only.");
+
+#elif defined(TARGET_AIX)
+
+ {
+ int netbits = netmask_to_netbits2(r->netmask);
+ argv_printf (&argv, "%s delete -net %s/%d %s",
+ ROUTE_PATH,
+ network, netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: AIX route delete command failed");
+ }
+
#else
msg (M_FATAL, "Sorry, but I don't know how to do 'route' commands on this operating system. Try putting your routes in a --route-up script");
#endif
@@ -2084,6 +2116,14 @@ delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigne
argv_msg (D_ROUTE, &argv);
openvpn_execve_check (&argv, es, 0, "ERROR: NetBSD route delete -inet6 command failed");
+#elif defined(TARGET_AIX)
+
+ argv_printf (&argv, "%s delete -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+
#else
msg (M_FATAL, "Sorry, but I don't know how to do 'route ipv6' commands on this operating system. Try putting your routes in a --route-down script");
#endif
@@ -2921,6 +2961,26 @@ netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbi
return false;
}
+/* similar to netmask_to_netbits(), but don't mess with base address
+ * etc., just convert to netbits - non-mappable masks are returned as "-1"
+ */
+int netmask_to_netbits2 (in_addr_t netmask)
+{
+ int i;
+ const int addrlen = sizeof (in_addr_t) * 8;
+
+ for (i = 0; i <= addrlen; ++i)
+ {
+ in_addr_t mask = netbits_to_netmask (i);
+ if (mask == netmask)
+ {
+ return i;
+ }
+ }
+ return -1;
+}
+
+
/*
* get_bypass_addresses() is used by the redirect-gateway bypass-x
* functions to build a route bypass to selected DHCP/DNS servers,
diff --git a/app/openvpn/src/openvpn/ssl.c b/app/openvpn/src/openvpn/ssl.c
index 95bbb277..929f95fa 100644
--- a/app/openvpn/src/openvpn/ssl.c
+++ b/app/openvpn/src/openvpn/ssl.c
@@ -624,6 +624,8 @@ packet_opcode_name (int op)
return "P_ACK_V1";
case P_DATA_V1:
return "P_DATA_V1";
+ case P_DATA_V2:
+ return "P_DATA_V2";
default:
return "P_???";
}
@@ -996,22 +998,6 @@ reset_session (struct tls_multi *multi, struct tls_session *session)
tls_session_init (multi, session);
}
-#if 0
-/*
- * Transmit a TLS reset on our untrusted channel.
- */
-static void
-initiate_untrusted_session (struct tls_multi *multi, struct sockaddr_in *to)
-{
- struct tls_session *session = &multi->session[TM_UNTRUSTED];
- struct key_state *ks = &session->key[KS_PRIMARY];
-
- reset_session (multi, session);
- ks->remote_addr = *to;
- msg (D_TLS_DEBUG_LOW, "TLS: initiate_untrusted_session: addr=%s", print_sockaddr (to));
-}
-#endif
-
/*
* Used to determine in how many seconds we should be
* called again.
@@ -1069,6 +1055,9 @@ tls_multi_init (struct tls_options *tls_options)
ret->key_scan[1] = &ret->session[TM_ACTIVE].key[KS_LAME_DUCK];
ret->key_scan[2] = &ret->session[TM_LAME_DUCK].key[KS_LAME_DUCK];
+ /* By default not use P_DATA_V2 */
+ ret->use_session_id = false;
+
return ret;
}
@@ -1842,6 +1831,9 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
buf_printf (&out, "IV_PLAT=win\n");
#endif
+ /* support for P_DATA_V2 */
+ buf_printf(&out, "IV_PROTO=2\n");
+
/* push compression status */
#ifdef USE_COMP
comp_generate_peer_info_string(&session->opt->comp_options, &out);
@@ -2799,8 +2791,9 @@ tls_pre_decrypt (struct tls_multi *multi,
key_id = c & P_KEY_ID_MASK;
}
- if (op == P_DATA_V1)
- { /* data channel packet */
+ if ((op == P_DATA_V1) || (op == P_DATA_V2))
+ {
+ /* data channel packet */
for (i = 0; i < KEY_SCAN_SIZE; ++i)
{
struct key_state *ks = multi->key_scan[i];
@@ -2832,7 +2825,9 @@ tls_pre_decrypt (struct tls_multi *multi,
opt->pid_persist = NULL;
opt->flags &= multi->opt.crypto_flags_and;
opt->flags |= multi->opt.crypto_flags_or;
- ASSERT (buf_advance (buf, 1));
+
+ ASSERT (buf_advance (buf, op == P_DATA_V1 ? 1 : 4));
+
++ks->n_packets;
ks->n_bytes += buf->len;
dmsg (D_TLS_KEYSELECT,
@@ -3329,6 +3324,7 @@ tls_pre_decrypt_lite (const struct tls_auth_standalone *tas,
return ret;
error:
+
tls_clear_error();
gc_free (&gc);
return ret;
@@ -3397,14 +3393,24 @@ tls_post_encrypt (struct tls_multi *multi, struct buffer *buf)
{
struct key_state *ks;
uint8_t *op;
+ uint32_t sess;
ks = multi->save_ks;
multi->save_ks = NULL;
if (buf->len > 0)
{
ASSERT (ks);
- ASSERT (op = buf_prepend (buf, 1));
- *op = (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id;
+
+ if (!multi->opt.server && multi->use_session_id)
+ {
+ sess = ((P_DATA_V2 << P_OPCODE_SHIFT) | ks->key_id) | (multi->vpn_session_id << 8);
+ ASSERT (buf_write_prepend (buf, &sess, 4));
+ }
+ else
+ {
+ ASSERT (op = buf_prepend (buf, 1));
+ *op = (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id;
+ }
++ks->n_packets;
ks->n_bytes += buf->len;
}
@@ -3477,6 +3483,31 @@ tls_rec_payload (struct tls_multi *multi,
return ret;
}
+/* Update the remote_addr, needed if a client floats. */
+void
+tls_update_remote_addr (struct tls_multi *multi,
+const struct link_socket_actual *from)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ if (DECRYPT_KEY_ENABLED (multi, ks) && ks->authenticated && link_socket_actual_defined(&ks->remote_addr))
+ {
+ if (link_socket_actual_match (from, &ks->remote_addr))
+ continue;
+ dmsg (D_TLS_KEYSELECT,
+ "TLS: tls_update_remote_addr from IP=%s to IP=%s",
+ print_link_socket_actual (&ks->remote_addr, &gc),
+ print_link_socket_actual (from, &gc));
+ memcpy(&ks->remote_addr, from, sizeof(*from));
+ }
+ }
+ gc_free (&gc);
+}
+
/*
* Dump a human-readable rendition of an openvpn packet
* into a garbage collectable string which is returned.
@@ -3511,7 +3542,7 @@ protocol_dump (struct buffer *buffer, unsigned int flags, struct gc_arena *gc)
key_id = c & P_KEY_ID_MASK;
buf_printf (&out, "%s kid=%d", packet_opcode_name (op), key_id);
- if (op == P_DATA_V1)
+ if ((op == P_DATA_V1) || (op == P_DATA_V2))
goto print_data;
/*
diff --git a/app/openvpn/src/openvpn/ssl.h b/app/openvpn/src/openvpn/ssl.h
index aaecff43..9bdd641f 100644
--- a/app/openvpn/src/openvpn/ssl.h
+++ b/app/openvpn/src/openvpn/ssl.h
@@ -60,6 +60,7 @@
#define P_CONTROL_V1 4 /* control channel packet (usually TLS ciphertext) */
#define P_ACK_V1 5 /* acknowledgement for packets received */
#define P_DATA_V1 6 /* data channel packet */
+#define P_DATA_V2 9 /* data channel packet with session_id */
/* indicates key_method >= 2 */
#define P_CONTROL_HARD_RESET_CLIENT_V2 7 /* initial key from client, forget previous state */
@@ -67,7 +68,7 @@
/* define the range of legal opcodes */
#define P_FIRST_OPCODE 1
-#define P_LAST_OPCODE 8
+#define P_LAST_OPCODE 9
/* Should we aggregate TLS
* acknowledgements, and tack them onto
@@ -430,6 +431,12 @@ bool tls_send_payload (struct tls_multi *multi,
bool tls_rec_payload (struct tls_multi *multi,
struct buffer *buf);
+/*
+ * Update remote address of a tls_multi structure
+ */
+void tls_update_remote_addr (struct tls_multi *multi,
+ const struct link_socket_actual *from);
+
#ifdef MANAGEMENT_DEF_AUTH
static inline char *
tls_get_peer_info(const struct tls_multi *multi)
diff --git a/app/openvpn/src/openvpn/ssl_common.h b/app/openvpn/src/openvpn/ssl_common.h
index 04ba7892..2fc72aa6 100644
--- a/app/openvpn/src/openvpn/ssl_common.h
+++ b/app/openvpn/src/openvpn/ssl_common.h
@@ -495,6 +495,10 @@ struct tls_multi
char *peer_info;
#endif
+ /* For P_DATA_V2 */
+ uint32_t vpn_session_id;
+ int use_session_id;
+
/*
* Our session objects.
*/
diff --git a/app/openvpn/src/openvpn/ssl_openssl.c b/app/openvpn/src/openvpn/ssl_openssl.c
index c9d2d26d..adf3ae6f 100644
--- a/app/openvpn/src/openvpn/ssl_openssl.c
+++ b/app/openvpn/src/openvpn/ssl_openssl.c
@@ -270,7 +270,8 @@ tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
current_cipher_len = strlen(current_cipher);
if (end_of_cipher - begin_of_cipher == current_cipher_len &&
- 0 == memcmp (&ciphers[begin_of_cipher], cipher_pair->openssl_name, end_of_cipher - begin_of_cipher))
+ 0 != memcmp (&ciphers[begin_of_cipher], cipher_pair->iana_name,
+ end_of_cipher - begin_of_cipher))
{
// Non-IANA name used, show warning
msg (M_WARN, "Deprecated TLS cipher name '%s', please use IANA name '%s'", cipher_pair->openssl_name, cipher_pair->iana_name);
diff --git a/app/openvpn/src/openvpn/ssl_openssl.h b/app/openvpn/src/openvpn/ssl_openssl.h
index fc2052cb..97dc7422 100644
--- a/app/openvpn/src/openvpn/ssl_openssl.h
+++ b/app/openvpn/src/openvpn/ssl_openssl.h
@@ -33,6 +33,17 @@
#include <openssl/ssl.h>
/**
+ * SSL_OP_NO_TICKET tells OpenSSL to disable "stateless session resumption",
+ * as this is something we do not want nor need, but could potentially be
+ * used for a future attack. For compatibility reasons we keep building if the
+ * OpenSSL version is too old (pre-0.9.8f) to support stateless session
+ * resumption (and the accompanying SSL_OP_NO_TICKET flag).
+ */
+#ifndef SSL_OP_NO_TICKET
+# define SSL_OP_NO_TICKET 0
+#endif
+
+/**
* Structure that wraps the TLS context. Contents differ depending on the
* SSL library used.
*/
diff --git a/app/openvpn/src/openvpn/ssl_verify_openssl.c b/app/openvpn/src/openvpn/ssl_verify_openssl.c
index 2482eaa4..cbcff022 100644
--- a/app/openvpn/src/openvpn/ssl_verify_openssl.c
+++ b/app/openvpn/src/openvpn/ssl_verify_openssl.c
@@ -591,12 +591,12 @@ x509_verify_crl(const char *crl_file, X509 *peer_cert, const char *subject)
in = BIO_new_file (crl_file, "r");
if (in == NULL) {
- msg (M_ERR, "CRL: cannot read: %s", crl_file);
+ msg (M_WARN, "CRL: cannot read: %s", crl_file);
goto end;
}
crl=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
if (crl == NULL) {
- msg (M_ERR, "CRL: cannot read CRL from file %s", crl_file);
+ msg (M_WARN, "CRL: cannot read CRL from file %s", crl_file);
goto end;
}
diff --git a/app/openvpn/src/openvpn/ssl_verify_polarssl.c b/app/openvpn/src/openvpn/ssl_verify_polarssl.c
index 71d38a9d..2b7c214f 100644
--- a/app/openvpn/src/openvpn/ssl_verify_polarssl.c
+++ b/app/openvpn/src/openvpn/ssl_verify_polarssl.c
@@ -337,7 +337,7 @@ x509_verify_cert_eku (x509_crt *cert, const char * const expected_oid)
}
}
- if (0 == x509_oid_get_numeric_string( oid_num_str,
+ if (0 < x509_oid_get_numeric_string( oid_num_str,
sizeof (oid_num_str), oid))
{
msg (D_HANDSHAKE, "++ Certificate has EKU (oid) %s, expects %s",
@@ -371,9 +371,12 @@ x509_verify_crl(const char *crl_file, x509_crt *cert, const char *subject)
result_t retval = FAILURE;
x509_crl crl = {0};
- if (x509_crl_parse_file(&crl, crl_file) != 0)
+ int polar_retval = x509_crl_parse_file(&crl, crl_file);
+ if (polar_retval != 0)
{
- msg (M_ERR, "CRL: cannot read CRL from file %s", crl_file);
+ char errstr[128];
+ polarssl_strerror(polar_retval, errstr, sizeof(errstr));
+ msg (M_WARN, "CRL: cannot read CRL from file %s (%s)", crl_file, errstr);
goto end;
}
diff --git a/app/openvpn/src/openvpn/syshead.h b/app/openvpn/src/openvpn/syshead.h
index 771c4fc1..dc511cbc 100644
--- a/app/openvpn/src/openvpn/syshead.h
+++ b/app/openvpn/src/openvpn/syshead.h
@@ -349,6 +349,14 @@
#endif /* TARGET_DRAGONFLY */
+#ifdef TARGET_DARWIN
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#endif /* TARGET_DARWIN */
+
#ifdef WIN32
#include <iphlpapi.h>
#include <ntddndis.h>
diff --git a/app/openvpn/src/openvpn/tun.c b/app/openvpn/src/openvpn/tun.c
index 482f6402..e92edc2f 100644
--- a/app/openvpn/src/openvpn/tun.c
+++ b/app/openvpn/src/openvpn/tun.c
@@ -1194,6 +1194,43 @@ do_ifconfig (struct tuntap *tt,
openvpn_execve_check (&argv, es, S_FATAL, "FreeBSD ifconfig inet6 failed");
}
+#elif defined(TARGET_AIX)
+ {
+ /* AIX ifconfig will complain if it can't find ODM path in env */
+ struct env_set *aix_es = env_set_create (NULL);
+ env_set_add( aix_es, "ODMDIR=/etc/objrepos" );
+
+ if (tun)
+ msg(M_FATAL, "no tun support on AIX (canthappen)");
+
+ /* example: ifconfig tap0 172.30.1.1 netmask 255.255.254.0 up */
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, aix_es, S_FATAL, "AIX ifconfig failed");
+ tt->did_ifconfig = true;
+
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, aix_es, S_FATAL, "AIX ifconfig inet6 failed");
+ }
+ env_set_destroy (aix_es);
+ }
#elif defined (WIN32)
{
/*
@@ -2825,6 +2862,139 @@ read_tun (struct tuntap* tt, uint8_t *buf, int len)
return read (tt->fd, buf, len);
}
+#elif defined(TARGET_AIX)
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ char tunname[256];
+ char dynamic_name[20];
+ const char *p;
+ struct argv argv;
+
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ return;
+ }
+
+ if ( tt->type == DEV_TYPE_TUN)
+ {
+ msg(M_FATAL, "no support for 'tun' devices on AIX" );
+ }
+
+ if ( strncmp( dev, "tap", 3 ) != 0 || dev_node )
+ {
+ msg(M_FATAL, "'--dev %s' and/or '--dev-node' not supported on AIX, use '--dev tap0', 'tap1', etc.", dev );
+ }
+
+ if ( strcmp( dev, "tap" ) == 0 ) /* find first free tap dev */
+ { /* (= no /dev/tapN node) */
+ int i;
+ for (i=0; i<99; i++ )
+ {
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/tap%d", i);
+ if ( access( tunname, F_OK ) < 0 && errno == ENOENT )
+ { break; }
+ }
+ if ( i >= 99 )
+ msg( M_FATAL, "cannot find unused tap device" );
+
+ openvpn_snprintf( dynamic_name, sizeof(dynamic_name), "tap%d", i );
+ dev = dynamic_name;
+ }
+ else /* name given, sanity check */
+ {
+ /* ensure that dev name is "tap+<digits>" *only* */
+ p = &dev[3];
+ while( isdigit(*p) ) p++;
+ if ( *p != '\0' )
+ msg( M_FATAL, "TAP device name must be '--dev tapNNNN'" );
+
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/%s", dev);
+ }
+
+ /* pre-existing device?
+ */
+ if ( access( tunname, F_OK ) < 0 && errno == ENOENT )
+ {
+
+ /* tunnel device must be created with 'ifconfig tapN create'
+ */
+ struct env_set *es = env_set_create (NULL);
+ argv_init (&argv);
+ argv_printf (&argv, "%s %s create", IFCONFIG_PATH, dev);
+ argv_msg (M_INFO, &argv);
+ env_set_add( es, "ODMDIR=/etc/objrepos" );
+ openvpn_execve_check (&argv, es, S_FATAL, "AIX 'create tun interface' failed");
+ env_set_destroy (es);
+ }
+ else
+ {
+ /* we didn't make it, we're not going to break it */
+ tt->persistent_if = TRUE;
+ }
+
+ if ((tt->fd = open (tunname, O_RDWR)) < 0)
+ {
+ msg (M_ERR, "Cannot open TAP device '%s'", tunname);
+ }
+
+ set_nonblock (tt->fd);
+ set_cloexec (tt->fd); /* don't pass fd to scripts */
+ msg (M_INFO, "TUN/TAP device %s opened", tunname);
+
+ /* tt->actual_name is passed to up and down scripts and used as the ifconfig dev name */
+ tt->actual_name = string_alloc(dev, NULL);
+}
+
+/* tap devices need to be manually destroyed on AIX
+ */
+void
+close_tun (struct tuntap* tt)
+{
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+ struct env_set *es = env_set_create (NULL);
+
+ if (!tt) return;
+
+ /* persistent devices need IP address unconfig, others need destroyal
+ */
+ argv_init (&argv);
+
+ if (tt->persistent_if)
+ {
+ argv_printf (&argv, "%s %s 0.0.0.0 down",
+ IFCONFIG_PATH, tt->actual_name);
+ }
+ else
+ {
+ argv_printf (&argv, "%s %s destroy",
+ IFCONFIG_PATH, tt->actual_name);
+ }
+
+ close_tun_generic (tt);
+ argv_msg (M_INFO, &argv);
+ env_set_add( es, "ODMDIR=/etc/objrepos" );
+ openvpn_execve_check (&argv, es, 0, "AIX 'destroy tap interface' failed (non-critical)");
+
+ free(tt);
+ env_set_destroy (es);
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return read (tt->fd, buf, len);
+}
+
#elif defined(WIN32)
int
diff --git a/app/openvpn/src/openvpnserv/openvpnserv.vcxproj b/app/openvpn/src/openvpnserv/openvpnserv.vcxproj
index f2c00718..0b75ed01 100644
--- a/app/openvpn/src/openvpnserv/openvpnserv.vcxproj
+++ b/app/openvpn/src/openvpnserv/openvpnserv.vcxproj
@@ -1,112 +1,112 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}</ProjectGuid>
- <RootNamespace>openvpnserv</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <ResourceCompile>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <ResourceCompile>
- <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="openvpnserv.c" />
- <ClCompile Include="service.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="service.h" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="openvpnserv_resources.rc" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
- <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}</ProjectGuid>
+ <RootNamespace>openvpnserv</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="openvpnserv.c" />
+ <ClCompile Include="service.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="service.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpnserv_resources.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+ <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters b/app/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters
index a6f8ecc6..0c89b4f4 100644
--- a/app/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters
+++ b/app/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="openvpnserv.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="service.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="service.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="openvpnserv_resources.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="openvpnserv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="service.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="service.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpnserv_resources.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/app/openvpn/tests/t_client.sh.in b/app/openvpn/tests/t_client.sh.in
index 52c5ed1a..d4f7c4ab 100755
--- a/app/openvpn/tests/t_client.sh.in
+++ b/app/openvpn/tests/t_client.sh.in
@@ -134,6 +134,12 @@ get_ifconfig_route()
@NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }'
return
;;
+ AIX)
+ echo "-- AIX --"
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }'
+ return
+ ;;
esac
echo "get_ifconfig_route(): no idea how to get info on your OS. FAIL." >&2
diff --git a/app/openvpn/tests/t_lpback.sh b/app/openvpn/tests/t_lpback.sh
index 40767a1b..8f88ad92 100755
--- a/app/openvpn/tests/t_lpback.sh
+++ b/app/openvpn/tests/t_lpback.sh
@@ -2,6 +2,7 @@
#
# t_lpback.sh - script to test OpenVPN's crypto loopback
# Copyright (C) 2005 Matthias Andree
+# Copyright (C) 2014 Steffan Karger
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -18,15 +19,39 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
-set -e
+set -eu
top_builddir="${top_builddir:-..}"
trap "rm -f key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15
trap "rm -f key.$$ log.$$ ; exit 1" 0 3
+
+# Get list of supported ciphers from openvpn --show-ciphers output
+CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
+ sed -e '1,/^$/d' -e s'/ .*//' -e '/^\s*$/d' | sort)
+
+# SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is
+# broken (see http://rt.openssl.org/Ticket/Display.html?id=2867), so exclude
+# that cipher from this test.
+# GD, 2014-07-06 so is DES-CFB1
+# GD, 2014-07-06 do not test RC5-* either (fails on NetBSD w/o libcrypto_rc5)
+CIPHERS=$(echo "$CIPHERS" | egrep -v '^(DES-EDE3-CFB1|DES-CFB1|RC5-)' )
+
"${top_builddir}/src/openvpn/openvpn" --genkey --secret key.$$
set +e
-( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ ) >log.$$ 2>&1
-e=$?
-if [ $e != 0 ] ; then cat log.$$ ; fi
+
+e=0
+for cipher in ${CIPHERS}
+do
+ echo -n "Testing cipher ${cipher}... "
+ ( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ --cipher ${cipher} ) >log.$$ 2>&1
+ if [ $? != 0 ] ; then
+ echo "FAILED"
+ cat log.$$
+ e=1
+ else
+ echo "OK"
+ fi
+done
+
rm key.$$ log.$$
trap 0
exit $e
diff --git a/app/ovpnlibs/assets/nopievpn.mips b/app/ovpnlibs/assets/nopievpn.mips
index af510053..c2ec6589 100755
--- a/app/ovpnlibs/assets/nopievpn.mips
+++ b/app/ovpnlibs/assets/nopievpn.mips
Binary files differ
diff --git a/app/ovpnlibs/assets/pievpn.mips b/app/ovpnlibs/assets/pievpn.mips
index e7eaf435..fcc9c8ef 100755
--- a/app/ovpnlibs/assets/pievpn.mips
+++ b/app/ovpnlibs/assets/pievpn.mips
Binary files differ
diff --git a/app/src/main/java/de/blinkt/openvpn/LaunchVPN.java b/app/src/main/java/de/blinkt/openvpn/LaunchVPN.java
index a39e780a..3f80eef0 100644
--- a/app/src/main/java/de/blinkt/openvpn/LaunchVPN.java
+++ b/app/src/main/java/de/blinkt/openvpn/LaunchVPN.java
@@ -4,8 +4,6 @@ import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.R;
-import java.io.IOException;
-
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
@@ -20,13 +18,17 @@ import android.text.InputType;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
-import android.widget.*;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+
+import java.io.IOException;
import de.blinkt.openvpn.activities.LogWindow;
-import de.blinkt.openvpn.core.VpnStatus;
-import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
import de.blinkt.openvpn.core.ProfileManager;
import de.blinkt.openvpn.core.VPNLaunchHelper;
+import de.blinkt.openvpn.core.VpnStatus;
+import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
/**
* This Activity actually handles two stages of a launcher shortcut's life cycle.
@@ -111,7 +113,6 @@ public class LaunchVPN extends Activity {
}
}
-
@Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
diff --git a/app/src/main/java/de/blinkt/openvpn/VpnProfile.java b/app/src/main/java/de/blinkt/openvpn/VpnProfile.java
index 0166eb98..d44d0f5a 100644
--- a/app/src/main/java/de/blinkt/openvpn/VpnProfile.java
+++ b/app/src/main/java/de/blinkt/openvpn/VpnProfile.java
@@ -4,6 +4,7 @@ import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.R;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -14,6 +15,7 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.security.KeyChain;
import android.security.KeyChainException;
+import android.text.TextUtils;
import android.util.Base64;
import org.spongycastle.util.io.pem.PemObject;
@@ -115,8 +117,8 @@ public class VpnProfile implements Serializable {
public boolean mUseDefaultRoute = true;
public boolean mUsePull = true;
public String mCustomRoutes;
- public boolean mCheckRemoteCN = false;
- public boolean mExpectTLSCert = true;
+ public boolean mCheckRemoteCN = true;
+ public boolean mExpectTLSCert = false;
public String mRemoteCN = "";
public String mPassword = "";
public String mUsername = "";
@@ -181,6 +183,7 @@ public class VpnProfile implements Serializable {
mUseDefaultRoute = false;
mUseDefaultRoutev6 = false;
mExpectTLSCert = false;
+ mCheckRemoteCN = false;
mPersistTun = false;
mAllowLocalLAN = true;
}
@@ -199,10 +202,7 @@ public class VpnProfile implements Serializable {
public void upgradeProfile(){
if(mProfileVersion< 2) {
/* default to the behaviour the OS used */
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
- mAllowLocalLAN = true;
- else
- mAllowLocalLAN = false;
+ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT;
}
mProfileVersion= CURRENT_PROFILE_VERSION;
@@ -213,7 +213,7 @@ public class VpnProfile implements Serializable {
File cacheDir = context.getCacheDir();
String cfg = "";
- // Enable managment interface
+ // Enable management interface
cfg += "# Enables connection to GUI\n";
cfg += "management ";
@@ -230,6 +230,9 @@ public class VpnProfile implements Serializable {
cfg += "machine-readable-output\n";
+ // Users are confused by warnings that are misleading...
+ cfg += "ifconfig-nowarn\n";
+
boolean useTLSClient = (mAuthenticationType != TYPE_STATICKEYS);
@@ -327,7 +330,7 @@ public class VpnProfile implements Serializable {
else
cfg += insertFileData("tls-auth", mTLSAuthFilename);
- if (nonNull(mTLSAuthDirection)) {
+ if (!TextUtils.isEmpty(mTLSAuthDirection)) {
cfg += "key-direction ";
cfg += mTLSAuthDirection;
cfg += "\n";
@@ -336,10 +339,10 @@ public class VpnProfile implements Serializable {
}
if (!mUsePull) {
- if (nonNull(mIPv4Address))
+ if (!TextUtils.isEmpty(mIPv4Address))
cfg += "ifconfig " + cidrToIPAndNetmask(mIPv4Address) + "\n";
- if (nonNull(mIPv6Address))
+ if (!TextUtils.isEmpty(mIPv6Address))
cfg += "ifconfig-ipv6 " + mIPv6Address + "\n";
}
@@ -377,11 +380,11 @@ public class VpnProfile implements Serializable {
cfg += routes;
if (mOverrideDNS || !mUsePull) {
- if (nonNull(mDNS1))
+ if (!TextUtils.isEmpty(mDNS1))
cfg += "dhcp-option DNS " + mDNS1 + "\n";
- if (nonNull(mDNS2))
+ if (!TextUtils.isEmpty(mDNS2))
cfg += "dhcp-option DNS " + mDNS2 + "\n";
- if (nonNull(mSearchDomain))
+ if (!TextUtils.isEmpty(mSearchDomain))
cfg += "dhcp-option DOMAIN " + mSearchDomain + "\n";
}
@@ -422,11 +425,11 @@ public class VpnProfile implements Serializable {
cfg += "remote-cert-tls server\n";
}
- if (nonNull(mCipher)) {
+ if (!TextUtils.isEmpty(mCipher)) {
cfg += "cipher " + mCipher + "\n";
}
- if (nonNull(mAuth)) {
+ if (!TextUtils.isEmpty(mAuth)) {
cfg += "auth " + mAuth + "\n";
}
@@ -488,13 +491,6 @@ public class VpnProfile implements Serializable {
}
}
- private boolean nonNull(String val) {
- if (val == null || val.equals(""))
- return false;
- else
- return true;
- }
-
private Collection<String> getCustomRoutes(String routes) {
Vector<String> cidrRoutes = new Vector<String>();
if (routes == null) {
@@ -636,8 +632,8 @@ public class VpnProfile implements Serializable {
synchronized String[] getKeyStoreCertificates(Context context,int tries) {
PrivateKey privateKey = null;
- X509Certificate[] cachain;
- Exception exp=null;
+ X509Certificate[] caChain;
+ Exception exp;
try {
privateKey = KeyChain.getPrivateKey(context, mAlias);
mPrivateKey = privateKey;
@@ -645,18 +641,18 @@ public class VpnProfile implements Serializable {
String keystoreChain = null;
- cachain = KeyChain.getCertificateChain(context, mAlias);
- if(cachain == null)
+ caChain = KeyChain.getCertificateChain(context, mAlias);
+ if(caChain == null)
throw new NoCertReturnedException("No certificate returned from Keystore");
- if (cachain.length <= 1 && !nonNull(mCaFilename)) {
+ if (caChain.length <= 1 && TextUtils.isEmpty(mCaFilename)) {
VpnStatus.logMessage(VpnStatus.LogLevel.ERROR, "", context.getString(R.string.keychain_nocacert));
} else {
StringWriter ksStringWriter = new StringWriter();
PemWriter pw = new PemWriter(ksStringWriter);
- for (int i = 1; i < cachain.length; i++) {
- X509Certificate cert = cachain[i];
+ for (int i = 1; i < caChain.length; i++) {
+ X509Certificate cert = caChain[i];
pw.writeObject(new PemObject("CERTIFICATE", cert.getEncoded()));
}
pw.close();
@@ -665,7 +661,7 @@ public class VpnProfile implements Serializable {
String caout = null;
- if (nonNull(mCaFilename)) {
+ if (!TextUtils.isEmpty(mCaFilename)) {
try {
Certificate cacert = X509Utils.getCertificateFromFile(mCaFilename);
StringWriter caoutWriter = new StringWriter();
@@ -684,8 +680,8 @@ public class VpnProfile implements Serializable {
StringWriter certout = new StringWriter();
- if (cachain.length >= 1) {
- X509Certificate usercert = cachain[0];
+ if (caChain.length >= 1) {
+ X509Certificate usercert = caChain[0];
PemWriter upw = new PemWriter(certout);
upw.writeObject(new PemObject("CERTIFICATE", usercert.getEncoded()));
@@ -730,15 +726,14 @@ public class VpnProfile implements Serializable {
}
return getKeyStoreCertificates(context, tries-1);
}
- if (exp != null) {
- exp.printStackTrace();
- VpnStatus.logError(R.string.keyChainAccessError, exp.getLocalizedMessage());
- VpnStatus.logError(R.string.keychain_access);
- if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {
- if (!mAlias.matches("^[a-zA-Z0-9]$")) {
- VpnStatus.logError(R.string.jelly_keystore_alphanumeric_bug);
- }
+ exp.printStackTrace();
+ VpnStatus.logError(R.string.keyChainAccessError, exp.getLocalizedMessage());
+
+ VpnStatus.logError(R.string.keychain_access);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {
+ if (!mAlias.matches("^[a-zA-Z0-9]$")) {
+ VpnStatus.logError(R.string.jelly_keystore_alphanumeric_bug);
}
}
return null;
@@ -801,7 +796,7 @@ public class VpnProfile implements Serializable {
}
public boolean requireTLSKeyPassword() {
- if (!nonNull(mClientKeyFilename))
+ if (TextUtils.isEmpty(mClientKeyFilename))
return false;
String data = "";
@@ -842,13 +837,13 @@ public class VpnProfile implements Serializable {
}
if (mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) {
- if (requireTLSKeyPassword() && !nonNull(mKeyPassword))
+ if (requireTLSKeyPassword() && TextUtils.isEmpty(mKeyPassword))
if (mTransientPCKS12PW == null) {
return R.string.private_key_password;
}
}
- if (isUserPWAuth() && !(nonNull(mUsername) && (nonNull(mPassword) || mTransientPW != null))) {
+ if (isUserPWAuth() && !(!TextUtils.isEmpty(mUsername) && (!TextUtils.isEmpty(mPassword) || mTransientPW != null))) {
return R.string.password;
}
return 0;
@@ -893,12 +888,15 @@ public class VpnProfile implements Serializable {
try {
+ /* ECB is perfectly fine in this special case, since we are using it for
+ the public/private part in the TLS exchange
+ */
+ @SuppressLint("GetInstance")
+ Cipher rsaSigner = Cipher.getInstance("RSA/ECB/PKCS1PADDING");
- Cipher rsasinger = Cipher.getInstance("RSA/ECB/PKCS1PADDING");
-
- rsasinger.init(Cipher.ENCRYPT_MODE, privkey);
+ rsaSigner.init(Cipher.ENCRYPT_MODE, privkey);
- byte[] signed_bytes = rsasinger.doFinal(data);
+ byte[] signed_bytes = rsaSigner.doFinal(data);
return Base64.encodeToString(signed_bytes, Base64.NO_WRAP);
} catch (NoSuchAlgorithmException e) {
diff --git a/app/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java b/app/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
index da011c98..8e418053 100644
--- a/app/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
+++ b/app/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
@@ -43,8 +43,8 @@ public class DisconnectVPN extends Activity implements DialogInterface.OnClickLi
}
@Override
- protected void onStop() {
- super.onStop();
+ protected void onPause() {
+ super.onPause();
unbindService(mConnection);
}
diff --git a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index 378b6b92..d23b521f 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -1,7 +1,5 @@
package de.blinkt.openvpn.core;
-import de.blinkt.openvpn.VpnProfile;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
@@ -10,6 +8,8 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Vector;
+import de.blinkt.openvpn.VpnProfile;
+
//! Openvpn Config FIle Parser, probably not 100% accurate but close enough
// And remember, this is valid :)
@@ -31,11 +31,17 @@ public class ConfigParser {
BufferedReader br =new BufferedReader(reader);
+ int lineno=0;
while (true){
String line = br.readLine();
+ lineno++;
if(line==null)
break;
+ if (lineno==1 && (line.startsWith("PK\003\004")
+ || (line.startsWith("PK\007\008"))))
+ throw new ConfigParseError("Input looks like a ZIP Archive. Import is only possible for OpenVPN config files (.ovpn/.conf)");
+
// Check for OpenVPN Access Server Meta information
if (line.startsWith("# OVPN_ACCESS_SERVER_")) {
Vector<String> metaarg = parsemeta(line);
@@ -440,8 +446,8 @@ public class ConfigParser {
}
Vector<String> rport = getOption("rport", 1,1);
- if(port!=null){
- np.mServerPort = port.get(1);
+ if(rport!=null){
+ np.mServerPort = rport.get(1);
}
Vector<String> proto = getOption("proto", 1,1);
diff --git a/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java b/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
index 990e70d8..81a17ef9 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
@@ -5,6 +5,8 @@ import android.text.TextUtils;
import junit.framework.Assert;
+import org.jetbrains.annotations.NotNull;
+
import java.math.BigInteger;
import java.net.Inet6Address;
import java.util.*;
@@ -23,13 +25,18 @@ public class NetworkSpace {
private BigInteger lastAddress;
+ /**
+ * sorts the networks with following criteria:
+ * 1. compares first 1 of the network
+ * 2. smaller networks are returned as smaller
+ */
@Override
- public int compareTo(ipAddress another) {
+ public int compareTo(@NotNull ipAddress another) {
int comp = getFirstAddress().compareTo(another.getFirstAddress());
if (comp != 0)
return comp;
- // bigger mask means smaller address block
+
if (networkMask > another.networkMask)
return -1;
else if (another.networkMask == networkMask)
@@ -38,6 +45,22 @@ public class NetworkSpace {
return 1;
}
+ /**
+ * Warning ignores the included integer
+ *
+ * @param o
+ * the object to compare this instance with.
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof ipAddress))
+ return super.equals(o);
+
+
+ ipAddress on = (ipAddress) o;
+ return (networkMask == on.networkMask) && on.getFirstAddress().equals(getFirstAddress());
+ }
+
public ipAddress(CIDRIP ip, boolean include) {
included = include;
netAddress = BigInteger.valueOf(ip.getInt());
@@ -110,10 +133,10 @@ public class NetworkSpace {
public ipAddress[] split() {
- ipAddress firsthalf = new ipAddress(getFirstAddress(), networkMask + 1, included, isV4);
- ipAddress secondhalf = new ipAddress(firsthalf.getLastAddress().add(BigInteger.ONE), networkMask + 1, included, isV4);
- if (BuildConfig.DEBUG) Assert.assertTrue(secondhalf.getLastAddress().equals(getLastAddress()));
- return new ipAddress[]{firsthalf, secondhalf};
+ ipAddress firstHalf = new ipAddress(getFirstAddress(), networkMask + 1, included, isV4);
+ ipAddress secondHalf = new ipAddress(firstHalf.getLastAddress().add(BigInteger.ONE), networkMask + 1, included, isV4);
+ if (BuildConfig.DEBUG) Assert.assertTrue(secondHalf.getLastAddress().equals(getLastAddress()));
+ return new ipAddress[]{firstHalf, secondHalf};
}
String getIPv4Address() {
@@ -185,7 +208,7 @@ public class NetworkSpace {
return ipsDone;
while (currentNet!=null) {
- // Check if it and the next of it are compatbile
+ // Check if it and the next of it are compatible
ipAddress nextNet = networks.poll();
if (BuildConfig.DEBUG) Assert.assertNotNull(currentNet);
@@ -202,9 +225,12 @@ public class NetworkSpace {
// Simply forget our current network
currentNet=nextNet;
} else {
- // our currentnet is included in next and types differ. Need to split the next network
+ // our currentNet is included in next and types differ. Need to split the next network
ipAddress[] newNets = nextNet.split();
+
+ // TODO: The contains method of the Priority is stupid linear search
+
// First add the second half to keep the order in networks
if (!networks.contains(newNets[1]))
networks.add(newNets[1]);
@@ -226,6 +252,7 @@ public class NetworkSpace {
}
// This network is bigger than the next and last ip of current >= next
+ //noinspection StatementWithEmptyBody
if (currentNet.included == nextNet.included) {
// Next network is in included in our network with the same type,
// simply ignore the next and move on
@@ -238,7 +265,7 @@ public class NetworkSpace {
if (BuildConfig.DEBUG) {
Assert.assertTrue (newNets[1].getFirstAddress().equals(nextNet.getFirstAddress()));
Assert.assertTrue (newNets[1].getLastAddress().equals(currentNet.getLastAddress()));
- // Splitted second equal the next network, do not add it
+ // split second equal the next network, do not add it
}
networks.add(nextNet);
} else {
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
index 0de54ed7..67c05e7d 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
@@ -48,8 +48,6 @@ public class OpenVPNThread implements Runnable {
public void stopProcess() {
mProcess.destroy();
}
-
-
@Override
public void run() {
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
index 4cba4f5f..e6e5be25 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
@@ -9,11 +9,9 @@ import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
import android.util.Log;
-import org.jetbrains.annotations.NotNull;
+import junit.framework.Assert;
-import se.leap.bitmaskclient.R;
-import de.blinkt.openvpn.VpnProfile;
-import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
+import org.jetbrains.annotations.NotNull;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -22,7 +20,16 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.Vector;
+
+import se.leap.bitmaskclient.BuildConfig;
+import se.leap.bitmaskclient.R;
+import de.blinkt.openvpn.VpnProfile;
+import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
@@ -391,7 +398,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
*/
if(routeparts.length==5) {
- assert(routeparts[3].equals("dev"));
+ if (BuildConfig.DEBUG) Assert.assertEquals("dev", routeparts[3]);
mOpenVPNService.addRoute(routeparts[0], routeparts[1], routeparts[2], routeparts[4]);
} else if (routeparts.length >= 3) {
mOpenVPNService.addRoute(routeparts[0], routeparts[1], routeparts[2], null);
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
index 43b27212..9d61247a 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
@@ -72,6 +72,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
private OpenVPNManagement mManagement;
private String mLastTunCfg;
private String mRemoteGW;
+ private Object mProcessLock = new Object();
// From: http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java
public static String humanReadableByteCount(long bytes, boolean mbit) {
@@ -110,7 +111,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
}
private void endVpnService() {
- mProcessThread = null;
+ synchronized (mProcessLock) {
+ mProcessThread = null;
+ }
VpnStatus.removeByteCountListener(this);
unregisterDeviceStateReceiver();
ProfileManager.setConntectedVpnProfileDisconnected(this);
@@ -124,46 +127,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
}
}
- private void showNotification(String msg, String tickerText, boolean lowpriority, long when, ConnectionStatus status) {
- String ns = Context.NOTIFICATION_SERVICE;
- NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
-
-
- int icon = getIconByConnectionStatus(status);
-
- android.app.Notification.Builder nbuilder = new Notification.Builder(this);
-
- if (mProfile != null)
- nbuilder.setContentTitle(getString(R.string.notifcation_title, mProfile.mName));
- else
- nbuilder.setContentTitle(getString(R.string.notifcation_title_notconnect));
-
- nbuilder.setContentText(msg);
- nbuilder.setOnlyAlertOnce(true);
- nbuilder.setOngoing(true);
- nbuilder.setContentIntent(getLogPendingIntent());
- nbuilder.setSmallIcon(icon);
-
-
- if (when != 0)
- nbuilder.setWhen(when);
-
-
- // Try to set the priority available since API 16 (Jellybean)
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
- jbNotificationExtras(lowpriority, nbuilder);
-
- if (tickerText != null && !tickerText.equals(""))
- nbuilder.setTicker(tickerText);
-
- @SuppressWarnings("deprecation")
- Notification notification = nbuilder.getNotification();
-
-
- mNotificationManager.notify(OPENVPN_STATUS, notification);
- startForeground(OPENVPN_STATUS, notification);
- }
-
private int getIconByConnectionStatus(ConnectionStatus level) {
switch (level) {
case LEVEL_CONNECTED:
@@ -314,11 +277,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mProfile = ProfileManager.get(this, profileUUID);
- String startTitle = getString(R.string.start_vpn_title, mProfile.mName);
- String startTicker = getString(R.string.start_vpn_ticker, mProfile.mName);
- showNotification(startTitle, startTicker,
- false, 0, LEVEL_CONNECTING_NO_SERVER_REPLY_YET);
-
// Set a flag that we are starting a new VPN
mStarting = true;
// Stop the previous session by interrupting the thread.
@@ -330,13 +288,14 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
//ignore
}
-
- if (mProcessThread != null) {
- mProcessThread.interrupt();
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- //ignore
+ synchronized (mProcessLock) {
+ if (mProcessThread != null) {
+ mProcessThread.interrupt();
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ //ignore
+ }
}
}
// An old running VPN should now be exited
@@ -380,9 +339,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
processThread = new OpenVPNThread(this, argv, env, nativelibdir);
}
- mProcessThread = new Thread(processThread, "OpenVPNProcessThread");
- mProcessThread.start();
-
+ synchronized (mProcessLock) {
+ mProcessThread = new Thread(processThread, "OpenVPNProcessThread");
+ mProcessThread.start();
+ }
if (mDeviceStateReceiver != null)
unregisterDeviceStateReceiver();
@@ -416,11 +376,12 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
@Override
public void onDestroy() {
- if (mProcessThread != null) {
- mManagement.stopVPN();
-
- mProcessThread.interrupt();
+ synchronized (mProcessLock) {
+ if (mProcessThread != null) {
+ mManagement.stopVPN();
+ }
}
+
if (mDeviceStateReceiver != null) {
this.unregisterReceiver(mDeviceStateReceiver);
}
@@ -639,10 +600,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mMtu = mtu;
mRemoteGW=null;
+ long netMaskAsInt = CIDRIP.getInt(netmask);
if (mLocalIP.len == 32 && !netmask.equals("255.255.255.255")) {
// get the netmask as IP
- long netMaskAsInt = CIDRIP.getInt(netmask);
int masklen;
if ("net30".equals(mode))
@@ -655,11 +616,18 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
if ((netMaskAsInt & mask) == (mLocalIP.getInt() & mask )) {
mLocalIP.len = masklen;
} else {
+ mLocalIP.len = 32;
if (!"p2p".equals(mode))
VpnStatus.logWarning(R.string.ip_not_cidr, local, netmask, mode);
- mRemoteGW=netmask;
}
}
+ if (("p2p".equals(mode)) && mLocalIP.len < 32 || "net30".equals("net30") && mLocalIP.len < 30) {
+ VpnStatus.logWarning(R.string.ip_looks_like_subnet, local, netmask, mode);
+ }
+
+
+ // Configurations are sometimes really broken...
+ mRemoteGW=netmask;
}
public void setLocalIPv6(String ipv6addr) {
@@ -690,14 +658,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mDisplayBytecount = false;
}
- // Other notifications are shown,
- // This also mean we are no longer connected, ignore bytecount messages until next
- // CONNECTED
- // Does not work :(
- String msg = getString(resid);
- String ticker = msg;
- showNotification(msg + " " + logmessage, ticker, lowpriority , 0, level);
-
}
}
@@ -717,9 +677,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
humanReadableByteCount(diffIn / OpenVPNManagement.mBytecountInterval, true),
humanReadableByteCount(out, false),
humanReadableByteCount(diffOut / OpenVPNManagement.mBytecountInterval, true));
-
- boolean lowpriority = !mNotificationAlwaysVisible;
- showNotification(netstat, null, lowpriority, mConnecttime, LEVEL_CONNECTED);
}
}
@@ -746,7 +703,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
} else {
String release = Build.VERSION.RELEASE;
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && !release.startsWith("4.4.3")
- && !release.startsWith("4.4.4") && !release.startsWith("4.4.5"))
+ && !release.startsWith("4.4.4") && !release.startsWith("4.4.5") && !release.startsWith("4.4.6"))
// There will be probably no 4.4.4 or 4.4.5 version, so don't waste effort to do parsing here
return "OPEN_AFTER_CLOSE";
else
diff --git a/app/src/main/res/values-cs/strings-icsopenvpn.xml b/app/src/main/res/values-cs/strings-icsopenvpn.xml
index 179f81f1..b13bfcdd 100755
--- a/app/src/main/res/values-cs/strings-icsopenvpn.xml
+++ b/app/src/main/res/values-cs/strings-icsopenvpn.xml
@@ -215,6 +215,7 @@
<string name="vpn_import_hint">Použij ikonu &lt;img src=\"ic_menu_archive\"/&gt; k imporu existujícího (.ovpn nebo .conf) profilu z SD karty.</string>
<string name="faq_hint">Ujisti se, že jsi si pročetl FAQ. Je zde nápověda pro rychlý start.</string>
<string name="faq_routing_title">Nastavení směrování/rozhraní</string>
+ <string name="faq_routing">Směrování a konfigurace rozhraní není provedena pomocí tradičních příkazů ifconfig/route, ale pomocí VPNService API. To má za následek odlišnou konfiguraci směrování, než na jiných operačních systémech. Konfigurace VPN tunelu se skládá z IP adresy a sítě, která má být směrována skrze toto rozhraní. Zejména není potřeba adresa protistrany nebo brány. Speciální směrování pro dosažení VPN serveru (například v případě použití redirect-gataway direktivy) také není potřeba. Aplikace bude toto nastavení při importu konfigurace ignorovat. Aplikace pomocí VPNService API zajišťuje, že spojení k VPN serveru není směrováno skrze tunel. Povoleno je pouze specifikování sítí, které se mají směrovat skrze tunel. Aplikace se snaží detekovat sítě, které by neměli procházet tunelem (např. route x.x.x.x y.y.y.y net_gateway) a vypočítává nastavení směrování tak, aby emulovalo správné chováni jako na ostatních platformách. Logovací okno ukazuje konfiguraci VPNService při navázání spojení.</string>
<string name="persisttun_summary">Nevracej se ke spojení mimo VPN, zatímco se OpenVPN připojuje.</string>
<string name="persistent_tun_title">Trvalý tun</string>
<string name="openvpn_log">OpenVPN Log</string>
@@ -311,10 +312,11 @@
<string name="unhandled_exception_context">%3$s: %1$s\n\n%2$s</string>
<string name="faq_system_dialog_xposed">Pokud máš rootnuté zařízení, můžeš nainstalovat &lt;a href=\"http://xposed.info/\"&gt;Xposed framework&lt;/a&gt; a &lt;a href=\"http://repo.xposed.info/module/de.blinkt.vpndialogxposed\"&gt;VPN potvrzovací modul&lt;/a&gt; na vlastní nebezpečí\"</string>
<string name="full_licenses">Plné licence</string>
- <string name="blocklocal_summary">Sítě přímo připojené na lokální interface nebudou směrovány skrze VPN. Odškrtnutím této volby bude přesměrován všechen lokální provoz do VPN.</string>
+ <string name="blocklocal_summary">Sítě přímo připojené na lokální rozhraní nebudou směrovány skrze VPN. Odškrtnutím této volby bude přesměrován všechen lokální provoz do VPN.</string>
<string name="blocklocal_title">Nepoužívat VPN pro lokální sítě</string>
<string name="userpw_file">Soubor pro Jméno/Heslo</string>
<string name="imported_from_file">[Importováno z: %s]</string>
- <string name="files_missing_hint">Některé soubory nemohly být nalezeny. Prosím vyberte profil, který chcete importovat:</string>
+ <string name="files_missing_hint">Některé soubory nemohly být nalezeny. Prosím vyber profil, který chceš importovat:</string>
+ <string name="openvpn_is_no_free_vpn">Pro používání této aplikace je potřeba VPN poskytovatel/brána, která podporuje OpenVPN (často je to zaměstnavatel). Pro více informací a návod na nastavení OpenVPN serveru navštiv http://community.openvpn.net/</string>
<string name="import_log">Import logu:</string>
</resources>
diff --git a/app/src/main/res/values-hu/strings-icsopenvpn.xml b/app/src/main/res/values-hu/strings-icsopenvpn.xml
new file mode 100755
index 00000000..99c5201f
--- /dev/null
+++ b/app/src/main/res/values-hu/strings-icsopenvpn.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.net-->
+<!-- Generated by crowdin.net -->
+<resources>
+
+ <string name="address">Szerver cím:</string>
+ <string name="port">Szerver port:</string>
+ <string name="location">Hely</string>
+ <string name="cant_read_folder">A könyvtár nem olvasható</string>
+ <string name="select">Választ</string>
+ <string name="cancel">Mégsem</string>
+ <string name="no_data">Nincs Adat</string>
+ <string name="useLZO">LZO tömörítés</string>
+ <string name="client_no_certificate">Nincs Tanúsítvány</string>
+ <string name="client_certificate_title">Kliens Tanúsítvány</string>
+ <string name="client_key_title">Kliens Privátkulcs</string>
+ <string name="client_pkcs12_title">PKCS12 Fájl</string>
+ <string name="ca_title">CA Tanúsítvány</string>
+ <string name="no_certificate">Válasszon egy tanúsítványt</string>
+ <string name="copyright_guicode">A forráskód és a hibakezelő elérhetősége http://code.google.com/p/ics-openvpn/</string>
+ <string name="copyright_others">A program a következő komponenseket használja; a licenszek összes részletei a forráskódban találhatóak</string>
+ <string name="about">Névjegy</string>
+ <string name="vpn_list_title">Profilok</string>
+ <string name="vpn_type">Típus</string>
+ <string name="pkcs12pwquery">PKCS12 Jelszó</string>
+ <string name="file_select">Válasszon&#8230;</string>
+ <string name="file_nothing_selected">Válasszon egy fájlt</string>
+ <string name="useTLSAuth">TLS-hitelesítés használata</string>
+ <string name="tls_direction">TLS irány</string>
+ <string name="ipv6_dialog_tile">Adja meg az IPv6 címet CIDR formában (pl.: 2000:dd::23/64)</string>
+ <string name="ipv4_dialog_title">Adja meg az IPv4 címet CIDR formában (pl.: 1.2.3.4/24)</string>
+ <string name="ipv4_address">IPv4 Cím</string>
+ <string name="ipv6_address">IPv6 Cím</string>
+ <string name="custom_option_warning">Egyéni OpenVPN opciók megadása. Körültekintéssel használja! Vegye figyelembe, hogy a tun-nal kapcsolatos OpenVPN beállítások nem támogatottak a VPNSettings felépítéséből adódóan. Ha úgy gondolja, hogy egy fontos opció hiányzik, lépjen kapcsolatba a fejlesztőkkel</string>
+ <string name="auth_username">Felhasználónév</string>
+ <string name="auth_pwquery">Jelszó</string>
+ <string name="static_keys_info">A statikus konfigurációhoz a TLS Auth Key-ek statikus kulcsokként lesznek használva</string>
+ <string name="configure_the_vpn">A VPN beállítása</string>
+ <string name="menu_add_profile">Profil hozzáadása</string>
+ <string name="add_profile_name_prompt">Adja meg az új Profil nevét</string>
+ <string name="duplicate_profile_name">Kérlek, egyedi profilnevet válassz magadnak</string>
+ <string name="profilename">Profil név</string>
+ <string name="no_keystore_cert_selected">Válassz egy felhasználói tanúsítványt</string>
+ <string name="no_error_found">hiba nem található</string>
+ <string name="config_error_found">Hiba a beállításokban</string>
+ <string name="ipv4_format_error">Hiba az IPv4 cím elemzésekor</string>
+ <string name="custom_route_format_error">Hiba az egyéni útvonalak elemzésekor</string>
+ <string name="pw_query_hint">(a lekérdezés igénye szerint hagyja üresen)</string>
+ <string name="vpn_shortcut">OpenVPN parancsikon</string>
+ <string name="vpn_launch_title">Csatlakozás a VPN-hez</string>
+ <string name="shortcut_profile_notfound">A parancsikonban kiválasztott Profil nem létezik</string>
+ <string name="random_host_prefix">Véletlen Host Prefix</string>
+ <string name="random_host_summary">6 random karakter hozzáadása a hosztnév elejére</string>
+ <string name="custom_config_title">Egyéni Beállítások engedélyezése</string>
+ <string name="custom_config_summary">Egyéni beállítások megadása. Óvatosan használja!</string>
+ <string name="route_rejected">Az Android elutasította az útvonalat</string>
+ <string name="cancel_connection">Szétkapcsolás</string>
+ <string name="cancel_connection_long">VPN kapcsolat szétkapcsolása</string>
+ <string name="clear_log">napló törlése</string>
+ <string name="title_cancel">jóváhagyás törlése</string>
+ <string name="cancel_connection_query">VPN kapcsolat/kapcsolódás megszakítása?</string>
+ <string name="remove_vpn">VPN kapcsolat eltávolítása</string>
+ <string name="check_remote_tlscert">Ellenőrzi, hogy a kiszolgáló használ-e tanúsitványt TLS Server kiterjesztéssel (--remote-cert-tls server)</string>
+ <string name="check_remote_tlscert_title">TLS server tanúsítvány megkövetelése</string>
+ <string name="remote_tlscn_check_summary">Ellenőrzi a Távoli Kiszolgáló Tanúsítvány Subject DN mezőt</string>
+ <string name="remote_tlscn_check_title">Tanúsítvány Kiszolgálónév Ellenőrzés</string>
+ <string name="enter_tlscn_dialog">Adja meg a távoli tanúsítvány DN ellenőrzését (pl.: C=DE, L=Paderborn, OU=Avian IP Carriers, CN=openvpn.blinkt.de)\n\nAdja meg a teljes DN-t vagy az RDN-t (openvpn.blinkt.de a példában) vagy egy RDN prefix-et az ellenőrzéshez.\n\nRDN prefix használatakor a \"Server\" egyezik a \"Server-1\"-gyel és a \"Server-2\"-vel\n\nA mező üresen hagyásakor az RDN a kiszolgáló nevével kerül ellenőrzésre.\n\nTovábbi részleteket az OpenVPN 2.3.1+ manuál oldalon talál —verify-x509-name</string>
+ <string name="enter_tlscn_title">Távoli tanúsítvány tárgy</string>
+ <string name="tls_key_auth">TLS Key Hitelesítés engedélyetése</string>
+ <string name="tls_auth_file">TLS Auth Fájl</string>
+ <string name="pull_on_summary">IP címek, útvonalak és időzítések lekérése a kiszolgálótól.</string>
+ <string name="pull_off_summary">Nem történt információkérés a kiszolgálótól. Alul meg kell adni a beállításokat.</string>
+ <string name="use_pull">Pull Beállítások</string>
+ <string name="dns">DNS</string>
+ <string name="override_dns">A kiszolgálótól kapott DNS Beállítások felülbírálása</string>
+ <string name="dns_override_summary">Saját DNS Szerverek használata</string>
+ <string name="searchdomain">searchDomain</string>
+ <string name="dns1_summary">a használatban levő DNS-kiszolgáló.</string>
+ <string name="dns_server">DNS szerver</string>
+ <string name="secondary_dns_message">A másodlagos DNS-kiszolgáló használható, ha a normál DNS-kiszolgáló nem érhető el.</string>
+ <string name="backup_dns">tartalék DNS szerver</string>
+ <string name="ignored_pushed_routes">Push-olt útvonalak figyelmen kívül hagyása</string>
+ <string name="ignore_routes_summary">A szerver által push-olt útvonalak figyelmen kívül hagyása.</string>
+ <string name="default_route_summary">A teljes forgalom átirányítása a VPN-re</string>
+ <string name="use_default_title">használja az alapértelmezett útvonalat</string>
+ <string name="custom_route_message">Egyéni útvonalak megadása. A célt csak CIDR formátumban adja meg. \"10.0.0.0/8 2002::/16\" átirányítaná a 10.0.0.0/8 és 2002::/16 hálózatokat a VPN-en.</string>
+ <string name="custom_route_message_excluded">Útvonalak amikek nem a VPN-en át kell route-olni.</string>
+ <string name="custom_routes_title">Egyéni útvonalak</string>
+ <string name="custom_routes_title_excluded">Hálózat kivételek</string>
+ <string name="log_verbosity_level">Napló részletességi szint</string>
+ <string name="float_summary">Hitelesített csomagok engedélyezése minden IP-ről</string>
+ <string name="float_title">Lebegő szerver engedélyezése</string>
+ <string name="custom_options_title">Egyéni beállítások</string>
+ <string name="edit_vpn">VPN-beállítások szerkesztése</string>
+ <string name="remove_vpn_query">\'%s\' VPN Profil eltávolítása?</string>
+ <string name="tun_error_helpful">Néhány egyedi ICS image-en a /dev/tun hozzáférési jogai rosszak lehetnek, vagy a tun modul teljesen hiányzik. CM9 imagek-en próbálja a fix tulajdonos opciót az általános beállításokban</string>
+ <string name="tun_open_error">Nem sikerült megnyitni a tun interfészt</string>
+ <string name="error">"Hiba:"</string>
+ <string name="clear">töröl</string>
+ <string name="last_openvpn_tun_config">tun interfész megnyitása:</string>
+ <string name="local_ip_info">Helyi IPv4: %1$s/%2$d IPv6: %3$s MTU: %4$d</string>
+ <string name="dns_server_info">DNS Szerver: %1$s, Domain: %2$s</string>
+ <string name="routes_info_incl">Útvonalak: %1$s %2$s</string>
+ <string name="routes_info_excl">Kizárt útvonalak: %1$s %2$s</string>
+ <string name="routes_debug">VpnService útvonalak telepítve: %1$s %2$s</string>
+ <string name="ip_not_cidr">Érkezett interfész információk: %1$s és %2$s, feltételezve a második cím a távoli oldali cím. /32 alhálózati maszk lesz használva a helyi IP-hez. OpenVPN beállította a módokat: \"%3$s\".</string>
+ <string name="route_not_cidr">Nincs értelme a %1$s és %2$s-nek, mint IP útvonalnak CIDR alhálózati maszkkal, /32 alhálózati maszk kerül használatra.</string>
+ <string name="route_not_netip">Az %1$s/%2$s útvonal javítva: %3$s/%2$s</string>
+ <string name="keychain_access">Nem sikerült hozzáférni az Android Keychain Tanúsivànyokhoz. Ezt egy firmware frissítés vagy az alkalmazás/beállításainak visszaállítása okozhatja. Kérem szerkessze meg a VPN-t, és újra válassza ki a tanúsítványokat az alapvető beállításoknál, hogy visszaálljanak a tanúsítványok hozzáférési jogai.</string>
+ <string name="version_info">%1$s %2$s</string>
+ <string name="send_logfile">naplófájl küldése</string>
+ <string name="send">küld</string>
+ <string name="ics_openvpn_log_file">ICS OpenVPN naplófájl</string>
+ <string name="copied_entry">Naplóbejegyzés másolva a vágólapra</string>
+ <string name="tap_mode">Tap mód</string>
+ <string name="faq_tap_mode">Tap mód nem lehetséges nem-root VPN API-val. Ez által az alkalmazás nem kínál tap támogatást</string>
+ <string name="tap_faq2">Megint? Viccelsz? Nem, a tap mód tényleg nem támogatott és további levelek küldése hogy támogatott lesz-e sem fog segíteni.</string>
+ <string name="tap_faq3">Harmadszor is? Tulajdonképpen lehetne írni egy tap emulátort a tun alapján ami képes layer2 adatokat is küldeni és fogadni, de ennek a tap emulátornak implementálnia kell ARP-t és lehetőleg egy DHCP klienst is. Nem tudok róla, hogy bárki is ezen az irányon dolgozna. Ha lenne kedve ilyet kódolni, lépjen kapcsolatba velem.</string>
+ <string name="faq">GYIK</string>
+ <string name="copying_log_entries">naplóbejegyzések másolása</string>
+ <string name="faq_copying">Másoláshoz nyomja le és tartsa lenyomva a naplóbejegyzést. A teljes napló küldéséhez használja a Napló Küldése opciót. Használja a hardver menü gombot ha nem látható a GUI-ban.</string>
+ <string name="faq_shortcut">Parancsikon az indításhoz</string>
+ <string name="faq_howto_shortcut">Az asztalra helyezhet egy OpenVPN parancsikont. A képernyőkezelő programtól függően parancsikont vagy widget-et helyezhet el.</string>
+ <string name="no_vpn_support_image">Az image-ed nem támogatja a VPNService API-t, elnézést :(</string>
+ <string name="encryption">Titkosítás</string>
+ <string name="cipher_dialog_title">Adja meg a titkosítási módszert</string>
+ <string name="chipher_dialog_message">Adja meg az OpenVPN által használt titkosítási algoritmust. Hagyja üresen az alapértelmezett kódoláshoz.</string>
+ <string name="auth_dialog_message">Adja meg az OpenVPN által használt authentication digest-et. Hagyja üresen az alapértelmezett digest-hez.</string>
+ <string name="settings_auth">Hitelesítés/Titkosítás</string>
+ <string name="file_explorer_tab">Fájlkezelő</string>
+ <string name="inline_file_tab">Beágyazott fájl</string>
+ <string name="error_importing_file">Hiba a fájl importálása közben</string>
+ <string name="import_error_message">Nem sikerült importálni a Fájlt a fájlrendszerből</string>
+ <string name="inline_file_data">[[Beágyazott fájladatok]]</string>
+ <string name="opentun_no_ipaddr">IP információ nélküli tun eszköz megnyitás megtagadva</string>
+ <string name="menu_import">Profil import ovpn fájlból</string>
+ <string name="menu_import_short">Import</string>
+ <string name="import_content_resolve_error">Nem sikerült beolvasni az importálási profilt</string>
+ <string name="error_reading_config_file">Hiba a konfigurációs fájl olvasása közben</string>
+ <string name="add_profile">Profil hozzáadása</string>
+ <string name="import_could_not_open">%1$s fájl nem található, pedig az importált konfigurációs fájlban hivatkozás van rá</string>
+ <string name="importing_config">Konfigurációs fájl importálása %1$s forrásból</string>
+ <string name="import_warning_custom_options">A konfiguráció tartalmaz néhány opciót, amik nincsenek UI konfigurációhoz rendelve. Ezek az opciók az egyéni konfiguráció alatt találhatók. Az egyéni konfiguráció lent látható:</string>
+ <string name="import_done">Konfigurációs fájl olvasása kész.</string>
+ <string name="nobind_summary">Ne bind-eljen helyi címhez és porthoz</string>
+ <string name="no_bind">Nincs helyi bind</string>
+ <string name="import_configuration_file">Konfigurációs fájl importálása</string>
+ <string name="faq_security_title">Biztonsági szempontok</string>
+ <string name="import_vpn">Import</string>
+ <string name="broken_image_cert_title">Hiba a tanúsítvány kiválasztása során</string>
+ <string name="broken_image_cert">Exception történt az Android 4.0+ tanúsítvány legördülő megjelenítésekor. Ennek sohasem szabad megtörténnie, mivel ez egy szavványos Android 4.0+ funkció. Lehet, hogy az Android ROM tanúsítványtár támogatása nem működik megfelelően</string>
+ <string name="ipv4">IPv4</string>
+ <string name="ipv6">IPv6</string>
+ <string name="speed_waiting">Állapot üzenetre várakozás&#8230;</string>
+ <string name="converted_profile">importált profil</string>
+ <string name="converted_profile_i">%d profil importálva</string>
+ <string name="broken_images">Működésképtelen image-ek</string>
+ <string name="pkcs12_file_encryption_key">PKCS12 Fájltitkosítási kulcs</string>
+ <string name="private_key_password">Privát kulcs jelszó</string>
+ <string name="password">Jelszó</string>
+ <string name="file_icon">fájlikon</string>
+ <string name="tls_authentication">TLS hitelesítés</string>
+ <string name="generated_config">Generált konfiguráció</string>
+ <string name="generalsettings">Beállítások</string>
+ <string name="owner_fix_summary">/dev/tun tulajdonosának beállítása. Néhány CM9 image-hez ez kell, hogy a VPNService API működjön. Root szükséges.</string>
+ <string name="owner_fix">Fix tulajdonos a /dev/tun-hoz</string>
+ <string name="generated_config_summary">Generált OpenVPN konfigurációs fájl megmutatása</string>
+ <string name="edit_profile_title">\"%s\" szerkesztése</string>
+ <string name="building_configration">Konfiguráció felépítése&#8230;</string>
+ <string name="netchange_summary">Ennek az opciónak a bekapcsolása erőlteti az újracsatlakozást ha a hálózati állapot megváltozik (pl.: WiFi-re/ről mobil-ra/ról)</string>
+ <string name="netchange">Újracsatlakozás hálózatváltáskor</string>
+ <string name="netstatus">Hálózati állapot: %s</string>
+ <string name="extracahint">A CA tanúsítvány általában visszajön az Android Keystore-ból. Adjon meg egy külön tanúsítványt ha tanúsítvány-ellenőrzési hibát kap.</string>
+ <string name="select_file">Választ</string>
+ <string name="keychain_nocacert">Nem jött vissza CA tanúsítvány az Android keystore olvasása során. A hitelesítés valószínűleg sikertelen lesz.</string>
+ <string name="show_log_summary">Napló ablak mutatása a csatlakozás alatt. A napló ablak mindig elérető a rolóról is.</string>
+ <string name="show_log_window">Naplózási ablak mutatása</string>
+ <string name="mobile_info">%1$s (%2$s) %3$s, Android API %4$d</string>
+ <string name="error_rsa_sign">Hiba az Android keystore %1$s: %2$s kulccsal való belépéskor</string>
+ <string name="faq_system_dialogs_title">Kapcsolat figyelmeztetés és értesítés hang</string>
+ <string name="translationby">A magyar fordítást készítette Juhász Sándor &lt;msc@digitaltrip.hu&gt;</string>
+ <string name="ipdns">IP és DNS</string>
+ <string name="basic">Alapvető</string>
+ <string name="routing">Útválasztás</string>
+ <string name="obscure">Obscure OpenVPN beállítások. Általában nem szükséges.</string>
+ <string name="advanced">Speciális</string>
+ <string name="export_config_title">ICS Openvpn Konfiguráció</string>
+ <string name="warn_no_dns">Nincsenek DNS szerverek használatban. A névfeloldás nem működik. Fontolja meg az egyéni DNS szerverek beállítását. Kérjük, vegye figyelembe, hogy az Android továbbra is ugyanazokat a proxy beállításokat fogja használni a mobil/WiFi csatlakozáshoz, mint amit a DNS szerverek megadása előtt.</string>
+ <string name="dns_add_error">Nem lehet hozzáadni a %1$s DNS szervert, a rendszer elutasította: %2$s</string>
+ <string name="ip_add_error">A \"%1$s\" IP címet nem lehet konfigurálni, a rendszer elutasította: %2$s</string>
+ <string name="faq_howto_title">Quick Start</string>
+ <string name="setting_loadtun_summary">Próbálja meg betölteni a tun.ko kernel modult mielőtt megpróbál csatlakozni. Root-olt eszköz szükséges.</string>
+ <string name="setting_loadtun">Tun modul betöltése</string>
+ <string name="importpkcs12fromconfig">PKCS12 konfiguráció importálása az Android Keystore-ba</string>
+ <string name="getproxy_error">Hiba a proxy beállítások lekérésekor: %s</string>
+ <string name="using_proxy">Proxy használatban: %1$s %2$d</string>
+ <string name="use_system_proxy">Rendszerproxy használata</string>
+ <string name="use_system_proxy_summary">Rendszerszintű konfiguráció használata a HTTP/HTTPS proxy csatlakozáshoz.</string>
+ <string name="donatewithpaypal">&lt;a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;amp;cmd=_s-xclick\"&gt;Adakozhat PayPal-al&lt;/a&gt; </string>
+ <string name="onbootrestartsummary">Az OpenVPN újracsatlakozik a VPN-hez ha az aktív volt az újraindításkoz/leállításkor.</string>
+ <string name="onbootrestart">Újracsatlakozás újraindításkor</string>
+ <string name="ignore">Hagyja figyelmen kívül</string>
+ <string name="restart">Újraindítás</string>
+ <string name="restart_vpn_after_change">A konfiguráció változások a VPN újraindítása után lépnek életbe. (Újra)indítja most a VPN-t?</string>
+ <string name="configuration_changed">A konfiguráció megváltozott</string>
+ <string name="log_no_last_vpn">A legutóbb csatlakozott profil nem található</string>
+ <string name="no_vpn_profiles_defined">Nincsenek VPN profilok definiálva.</string>
+ <string name="add_new_vpn_hint">Használd az &lt;img src=\"ic_menu_add\"/&gt; ikont új VPN hozzáadásához</string>
+ <string name="vpn_import_hint">Használd az &lt;img src=\"ic_menu_archive\"/&gt; ikont egy SD-kártyán meglevő (.ovpn or .conf) profil importálásához.</string>
+ <string name="faq_hint">Tekintse meg a FAQ-ot. Ott van egy a kezdeti lépéseket segítő leírás.</string>
+ <string name="faq_routing_title">Routing/Interfész Beállítás</string>
+ <string name="persisttun_summary">Ne térjen vissza VPN kapcsolat nélküli módba, amikor az OpenVPN újracsatlakozik.</string>
+ <string name="persistent_tun_title">Megmaradó tun</string>
+ <string name="openvpn_log">OpenVPN Napló</string>
+ <string name="import_config">OpenVPN konfiguráció importálása</string>
+ <string name="battery_consumption_title">Akkumulátor használat</string>
+ <string name="vpn_tethering_title">VPN és Internetmegosztás</string>
+ <string name="connection_retries">Csatlakozás újrapróbálkozások</string>
+ <string name="reconnection_settings">Újracsatlakozás beállítások</string>
+ <string name="connectretrymessage">Csatlakozási próbálkozások közötti várakozási idő másodpercben.</string>
+ <string name="connectretrywait">Csatlakozások közotti idő másodpercben</string>
+ <string name="minidump_generated">Az OpenVPN váratlanul összeomlott. Kérem, gondolja meg a főmenüben levő Minidump elküldése opció használatát</string>
+ <string name="send_minidump">Minidump elküldése a fejlesztőnek</string>
+ <string name="send_minidump_summary">Hibakeresési információkat küld a fejlesztőnek a legutóbbi összeomlásról</string>
+ <string name="notifcation_title">OpenVPN - %s</string>
+ <string name="session_ipv4string">%1$s - %2$s</string>
+ <string name="session_ipv6string">%1$s - %3$s, %2$s</string>
+ <string name="state_connecting">Csatlakozás</string>
+ <string name="state_wait">Várakozás a szerver válaszára</string>
+ <string name="state_auth">Hitelesítés</string>
+ <string name="state_get_config">Kliens konfiguráció lekérése</string>
+ <string name="state_assign_ip">IP címek kiosztása</string>
+ <string name="state_add_routes">Útvonalak hozzáadása</string>
+ <string name="state_connected">Csatlakoztatva</string>
+ <string name="state_disconnected">Szétkapcsolás</string>
+ <string name="state_reconnecting">Újracsatlakozás</string>
+ <string name="state_exiting">Kilépés</string>
+ <string name="state_noprocess">Nem fut</string>
+ <string name="state_resolve">Állomásnevek feloldása</string>
+ <string name="state_tcp_connect">Csatlakozás (TCP)</string>
+ <string name="state_auth_failed">Hitelesítési hiba</string>
+ <string name="state_nonetwork">Várakozás használható hálózatra</string>
+ <string name="statusline_bytecount">↓%2$s/s %1$s - ↑%4$s/s %3$s</string>
+ <string name="notifcation_title_notconnect">Nincs kapcsolat</string>
+ <string name="start_vpn_title">Csatlakozás VPN-hez %s</string>
+ <string name="start_vpn_ticker">Csatlakozás VPN-hez %s</string>
+ <string name="jelly_keystore_alphanumeric_bug">Néhány Android 4.1-es verzió alatt problémába ütközhet ha a hitelesítési tanúsítvány nevében nem csak alfanumerikus karakterek szerepelnek (mint pl szóköz, alulvonás vagy kötőjel). Speciális karakterek nélkül próbálja újra importálni</string>
+ <string name="encryption_cipher">Titkosítás</string>
+ <string name="packet_auth">Csomag hitelesítés</string>
+ <string name="auth_dialog_title">Adja meg a csomaghitelesítési metódust</string>
+ <string name="mobile_info_extended">%1$s (%2$s) %3$s, Android API %4$d, %5$s, %6$s verzió</string>
+ <string name="built_by">%s fordítóval</string>
+ <string name="debug_build">hibakeresési fordítás</string>
+ <string name="official_build">hivatalos build</string>
+ <string name="make_selection_inline">Másolás profilba</string>
+ <string name="crashdump">Crashdump</string>
+ <string name="add">Hozzáad</string>
+ <string name="send_config">Konfig fájl küldése</string>
+ <string name="complete_dn">Teljes DN</string>
+ <string name="remotetlsnote">Az importált konfiguráció a régi tls-remote konfigurációt használta, ami egy másik DN formátumban volt.</string>
+ <string name="rdn">RDN (közös név)</string>
+ <string name="rdn_prefix">RDN előtag</string>
+ <string name="tls_remote_deprecated">tls-remote (elavult)</string>
+ <string name="help_translate">Segíthetsz fordítani ha meglátogatod http://crowdin.net/project/ics-openvpn/invite</string>
+ <string name="prompt">%1$s próbálkozás %2$s vezérlésre</string>
+ <string name="remote_trust">Megbízom ebben az alkalmazásban.</string>
+ <string name="no_external_app_allowed">Egy alkalmazás sem használhat külső API-t</string>
+ <string name="allowed_apps">Engedélyezett alkalmazások: %s</string>
+ <string name="clearappsdialog">Engedélyezett külső alkalmazások listájának törlése?\nAz engedélyezett alkalmazások aktuális listája:\n\n%s</string>
+ <string name="screenoff_title">VPN kapcsolat szüneteltetése a képernyő lekapcsolása után</string>
+ <string name="screenoff_pause">Kapcsolat szüneteltetése a képernyő kikapcsolt állapotában: kevesebb mint %1$s %2$ss alatt</string>
+ <string name="screen_nopersistenttun">Figyelmeztetés: Megmaradó tun nem engedélyezett ehhez a VPN-hez. A forgalom a normál internetcsatlakozáson megy amikor a képernyő ki van kapcsolva.</string>
+ <string name="save_password">Jelszó mentése</string>
+ <string name="timestamp_short">Rövid</string>
+ <string name="timestamp_iso">ISO</string>
+ <string name="timestamps">Időbélyegzők</string>
+ <string name="timestamps_none">Egyik sem</string>
+ <string name="uploaded_data">Feltöltés</string>
+ <string name="downloaded_data">Letöltés</string>
+ <string name="vpn_status">Vpn állapot</string>
+ <string name="logview_options">Nézet beállításai</string>
+ <string name="unhandled_exception">Nem kezelt kivétel: %1$s\n\n%2$s</string>
+ <string name="full_licenses">Teljes engedélyek</string>
+</resources>
diff --git a/app/src/main/res/values-in/strings-icsopenvpn.xml b/app/src/main/res/values-in/strings-icsopenvpn.xml
new file mode 100755
index 00000000..ccb60754
--- /dev/null
+++ b/app/src/main/res/values-in/strings-icsopenvpn.xml
@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.net-->
+<!-- Generated by crowdin.net -->
+<resources>
+
+ <string name="address">Alamat Server:</string>
+ <string name="port">Port server:</string>
+ <string name="location">Lokasi</string>
+ <string name="cant_read_folder">Gagal membaca direktori</string>
+ <string name="select">Pilih</string>
+ <string name="cancel">Batal</string>
+ <string name="no_data">Tak ada data</string>
+ <string name="useLZO">Kompresi LZO</string>
+ <string name="client_no_certificate">Tanpa Sertifikat</string>
+ <string name="client_certificate_title">Sertifikat Klien</string>
+ <string name="client_key_title">Kunci Sertifikat Klien</string>
+ <string name="client_pkcs12_title">Berkas PKCS12</string>
+ <string name="ca_title">Sertifikat CA</string>
+ <string name="no_certificate">Anda harus memilih sertifikat</string>
+ <string name="copyright_guicode">Kode program dan perekam masalah tersedia di</string>
+ <string name="copyright_others">Aplikasi memakai komponen berikut; lihat kode program untuk lebih jelas mengenai lisensi</string>
+ <string name="about">Tentang…</string>
+ <string name="vpn_list_title">Profil</string>
+ <string name="vpn_type">Tipe</string>
+ <string name="pkcs12pwquery">Password PKCS12</string>
+ <string name="file_select">Pilih&#8230;</string>
+ <string name="file_nothing_selected">Anda harus memilih berkas (file)</string>
+ <string name="useTLSAuth">Pakai otentikasi TLS</string>
+ <string name="tls_direction">Pengarah TLS</string>
+ <string name="ipv6_dialog_tile">Masukkan IPv6 Address/Netmask dalam format CIDR (contoh: 2000:dd::23/64)</string>
+ <string name="ipv4_dialog_title">Masukkan IPv4 Address/Netmask dalam format CIDR (contoh: 1.2.3.4/24)</string>
+ <string name="ipv4_address">Alamat IPv4</string>
+ <string name="ipv6_address">Alamat IPv6</string>
+ <string name="custom_option_warning">Masukan seting openvpn. Gunakan dengan hati-hati. Harap dicatat, TUN yanng terkait seting OpenVPN tidak didukung oleh VPNsettings. Jika anda berpikir ada hal penting belum tersedia, hubungi pembuatnya</string>
+ <string name="auth_username">Nama Penguna</string>
+ <string name="auth_pwquery">Password</string>
+ <string name="static_keys_info">Untuk konfigurasi statis, kunci otentifikasi TLS akan digunakan sebagai kunci konfigurasi statis</string>
+ <string name="configure_the_vpn">Konfigurasi VPN</string>
+ <string name="menu_add_profile">Tambah Profil</string>
+ <string name="add_profile_name_prompt">Masukkan nama profil yang baru</string>
+ <string name="duplicate_profile_name">Silakan masukan UPN (Unique Profile Name)</string>
+ <string name="profilename">Nama profil</string>
+ <string name="no_keystore_cert_selected">Anda harus memilih sertifikat pengguna</string>
+ <string name="no_error_found">Tidak ada kesalahan</string>
+ <string name="config_error_found">Konfigurasi Salah</string>
+ <string name="ipv4_format_error">Gagal menganalisa alamat IPV4</string>
+ <string name="custom_route_format_error">Gagal menganalisa rute buatan</string>
+ <string name="pw_query_hint">(biarkan kosong untuk antrian permintaan)</string>
+ <string name="vpn_shortcut">Jalan Pintas OpenVPN</string>
+ <string name="vpn_launch_title">Hubungkan VPN</string>
+ <string name="shortcut_profile_notfound">Profil di shrotcut tidak ada</string>
+ <string name="random_host_prefix">Acak awalan Host </string>
+ <string name="random_host_summary">Tambah 6 karakter acak di depan nama host</string>
+ <string name="custom_config_title">Aktifkan pilihan buatan</string>
+ <string name="custom_config_summary">Tentukan seting buatan. Gunakan hati-hati</string>
+ <string name="route_rejected">Rute ditolak Android</string>
+ <string name="cancel_connection">Putus</string>
+ <string name="cancel_connection_long">Memutuskan sambungan VPN</string>
+ <string name="clear_log">Bersihkan catatan</string>
+ <string name="title_cancel">Batal Konfirmasi</string>
+ <string name="cancel_connection_query">Putuskan sambungan VPN/Batalkan usaha menyambungkan VPN?</string>
+ <string name="remove_vpn">Singkirkan VPN</string>
+ <string name="check_remote_tlscert">Memeriksa apakah server menggunakan sertifikat dengan ekstensi TLS Server (--server remote-cert-tls)</string>
+ <string name="check_remote_tlscert_title">Mengharapkan sertifikat server TLS</string>
+ <string name="remote_tlscn_check_summary">Memeriksa sertifikat Remote Server Subjek DN</string>
+ <string name="remote_tlscn_check_title">Cek nama sertifikat Host</string>
+ <string name="enter_tlscn_dialog">Tentukan nilai ynag digunakan untuk memverifikasi sertifikat remote DN (misal C=nama perusahaan, L=Kota lokasi, OU=nama departemen perusahaan, CN=openvpn.blinkt.de. Tentukan DN atau RDN yang lengkap (dalam contoh : openvpn.blinkt.de) atau sebuah awalan RDN untuk verifikasi. Saat memakai RDN awalan \"server\" cocok dengan \"server-1\" dan \"server-2\". Mengosongkan field akan membuat RDN diperiksa dengan nama host server. Lebih jelasnya lihat OpenVPN 2.3.1 manpage di bagian -verify-x509-name</string>
+ <string name="enter_tlscn_title">Subyek sertifikat remote</string>
+ <string name="tls_key_auth">Aktifkan otentifikasi kunci TLS</string>
+ <string name="tls_auth_file">Berkas otintikasi TLS</string>
+ <string name="pull_on_summary">Meminta pilihan alamat IP, rute dan waktu dari server.</string>
+ <string name="pull_off_summary">Tidak ada informasi diminta dari server. Seting harus ditentukan di bawah ini</string>
+ <string name="use_pull">Tarik pengaturan</string>
+ <string name="dns">DNS</string>
+ <string name="override_dns">Menimpa pengaturan DNS oleh Server</string>
+ <string name="dns_override_summary">Gunakan server DNS pribadi</string>
+ <string name="searchdomain">Cari domain</string>
+ <string name="dns1_summary">Server DNS yang akan digunakan</string>
+ <string name="dns_server">Server DNS</string>
+ <string name="secondary_dns_message">Server DNS sekunder digunakan jika Server DNS yang normal tidak dapat dicapai.</string>
+ <string name="backup_dns">Server DNS cadangan</string>
+ <string name="ignored_pushed_routes">Abaikan rute yang diberikan</string>
+ <string name="ignore_routes_summary">Abaikan rute yang diberikan server</string>
+ <string name="default_route_summary">Alihkan semua lalulintas data melalui VPN</string>
+ <string name="use_default_title">Gunakan rute standar</string>
+ <string name="custom_route_message">Masukkan rute butan sendiri. Masukkan tujuan dalam format CIDR. \"10.0.0.0/8 2002:: / 16\" akan mengarahkan jaringan 10.0.0.0/8 dan 2002:: / 16 melalui jaringan VPN</string>
+ <string name="custom_routes_title">Rute buatan sendiri</string>
+ <string name="log_verbosity_level">Tingkat rincian catatan</string>
+ <string name="float_summary">Ijinkan paket terotentifikasi dari semua IP</string>
+ <string name="float_title">Ijinkan server mengambang</string>
+ <string name="custom_options_title">Pilihan buatan</string>
+ <string name="edit_vpn">Ubah seting OpenVPN</string>
+ <string name="remove_vpn_query">Hapus profil \'%s\'?</string>
+ <string name="tun_error_helpful">Pada beberapa setelan manual gambar ICS izin pada/dev/tun mungkin salah, atau modul tun mungkin hilang sepenuhnya. Untuk gambar CM9, coba perbaiki pilihan kepemilikannya di bawah pengaturan umum</string>
+ <string name="tun_open_error">Gagal membuka layanan antarmuka TUN</string>
+ <string name="error">"Kesalahan: "</string>
+ <string name="clear">Bersihkan</string>
+ <string name="last_openvpn_tun_config">Membuka interface tun :</string>
+ <string name="local_ip_info">IPv4 lokal : %1$s/%2$d IPv6: %3$s MTU: %4$d</string>
+ <string name="dns_server_info">DNS Server: %1$s, Domain: %2$s</string>
+ <string name="ip_not_cidr">Memilki informasi antarmuka %1$s dan %2$s, asumsi alamat kedua adalah alamat remote. Menggunakan netmask /32 untuk IP lokal. Mode yang diberikan oleh OpenVPN adalah \"%3$s\".</string>
+ <string name="route_not_cidr">Tidak masuk akal membuat %1$s dan %2$s sebagai rute IP dengan netmask CIDR, Gunakan /32 sebagai netmask.</string>
+ <string name="route_not_netip">rute yang diperbaiki %1$s/%2$s hingga %3$s/%2$s</string>
+ <string name="keychain_access">Tidak dapat mengakses sertifikat Keychain Android. Dapat disebabkan karena upgrade firmware atau pengembalian backup pengaturan app. Mohon ubah VPN, dan pilih ulang sertifikat berbasis pengaturan dasar agar izin mengakses sertifikat dapat dibuat ulang.</string>
+ <string name="version_info">%1$s %2$s</string>
+ <string name="send_logfile">Kirim berkas catatan</string>
+ <string name="send">Kirim</string>
+ <string name="ics_openvpn_log_file">Berkas catatan ICS OpenVPN</string>
+ <string name="copied_entry">Salin catatan masuk ke clipboard</string>
+ <string name="tap_mode">Mode TAP</string>
+ <string name="faq_tap_mode">Mode TAP tidak diijinkan tanpa VPN API non admin/root. Karena itu aplikasi ini tidak dapat memberikan dukungan mode TAP</string>
+ <string name="tap_faq2">Lagi ? Becanda ? mode TAP benar-benar tidak didukung dan mengirim email menanyakan apakah akan ada dukungan TAP, tidak akan membantu</string>
+ <string name="tap_faq3">Untuk ketiga kalinya? Sebenarnya, seseorang bisa menulis emulator TAP berdasarkan tun yang akan menambahkan lapisan2 informasi pengiriman dan lapisan2 informasi penerimaan. Tapi emulator TAP ini juga harus menerapkan ARP dan mungkin klien DHCP. Saya tidak tau apakah ada yang bekerja ke arah ini. Hubungi saya jika Anda ingin memulai menulis kode2 emulator TAP ini.</string>
+ <string name="faq">FAQ</string>
+ <string name="copying_log_entries">Menyalin catatan</string>
+ <string name="faq_copying">Untuk menyalin satu catatan masuk, Tekan dan tahan di catatan masuk. Untuk meyanlin\mengirim seluruh catatan, gunakan opsi Kirim Log. Gunakan tombol perangkat keras jika tidak terlihat di GUI.</string>
+ <string name="faq_shortcut">Jalan pintas memulai</string>
+ <string name="faq_howto_shortcut">Anda dapat menempatkan jalan pintas untuk memulai OpenVPN pada desktop Anda. Tergantung pada program homescreen Anda, Anda harus menambahkan jalan pintas atau widget.</string>
+ <string name="no_vpn_support_image">Gambar Anda tidak mendukung VPNService API, maaf:(</string>
+ <string name="encryption">Enkripsi</string>
+ <string name="cipher_dialog_title">Masukkan metode enkripsi</string>
+ <string name="chipher_dialog_message">Masukkan sandi enkripsi algoritma yang digunakan oleh OpenVPN. Biarkan kosong untuk menggunakan sandi default.</string>
+ <string name="auth_dialog_message">Masukkan digest otentikasi yang digunakan OpenVPN. Biarkan kosong untuk menggunakan standar digest.</string>
+ <string name="settings_auth">Otentikasi/Enkripsi</string>
+ <string name="file_explorer_tab">Penjelajah berkas</string>
+ <string name="inline_file_tab">Inline File</string>
+ <string name="error_importing_file">Gagal mengambil berkas</string>
+ <string name="import_error_message">Tidak dapat mengambil berkas dari filesystem</string>
+ <string name="inline_file_data">[[Inline file data]]</string>
+ <string name="opentun_no_ipaddr">TUN tidak dapat dibuka tanpa informasi IP</string>
+ <string name="menu_import">Ambil profil dari berkas ovpn</string>
+ <string name="menu_import_short">Ambil</string>
+ <string name="import_content_resolve_error">Tidak dapat membaca profil yang akan diambil</string>
+ <string name="error_reading_config_file">Kesalahan membaca berkas konfigurasi</string>
+ <string name="add_profile">Tambah Profil</string>
+ <string name="import_could_not_open">Tidak dapat menemukan berkas %1$s yang disebut dalam berkas konfigurasi</string>
+ <string name="importing_config">Mengambil berkas konfigurasi dari sumber %1$s</string>
+ <string name="import_warning_custom_options">Konfigurasi Anda memiliki beberapa pilihan konfigurasi yang tidak dipetakan ke konfigurasi UI. Pilihan ini ditambahkan sebagai opsi konfigurasi kustom. Konfigurasi kustom ditampilkan di bawah ini:</string>
+ <string name="import_done">Berkas konfigurasi selesai dibaca</string>
+ <string name="nobind_summary">Jangan kaitkan ke alamat dan port lokal</string>
+ <string name="no_bind">Tidak ada ikatan lokal</string>
+ <string name="import_configuration_file">Ambil berkas konfigurasi</string>
+ <string name="faq_security_title">Pertimbangan Keamanan</string>
+ <string name="faq_security">"Karena OpenVPN adalah sensitif pada isu keamanan, beberapa catatan tentang keamanan dianggap perlu. Semua data pada sdcard pada dasarnya tidak aman. Setiap app dapat membaca (misalnya program ini tidak perlu hak khusus untuk membaca sd-card). Data dari aplikasi ini hanya dapat dibaca oleh aplikasi itu sendiri. Dengan menggunakan opsi impor untuk cacert/cert/kunci dalam file dialog data yang disimpan dalam profil VPN. Profil VPN hanya dapat diakses oleh aplikasi ini. (Jangan lupa untuk menghapus salinan pada sd-card setelah itu). Bahkan meskipun dapat diakses hanya dengan aplikasi ini data masih tidak terenkripsi. Dengan melakukan rooting atau eksploitasi lainnya maka memungkinkan mengambil data. Sandi-sandi (passwords) juga tersimpan dalam teks biasa. Berkas pkcs12 sangat dianjurkan Anda mengimpornya ke android keystore."</string>
+ <string name="import_vpn">Impor</string>
+ <string name="broken_image_cert_title">Kesalahan menampilkan sertifikat</string>
+ <string name="broken_image_cert">Mendapat pesan kesalahan saat berusaha menampilkan layar pemilihan sertifikat Android 4.0+. Ini seharusnya tidak terjadi karena ini fitur standar Android 4.0 +. Mungkin ROM Android anda yang mengurus penyimpanan sertifikat rusak</string>
+ <string name="ipv4">IPv4</string>
+ <string name="ipv6">IPv6</string>
+ <string name="speed_waiting">Menunggu pesan status&#8230;</string>
+ <string name="converted_profile">Profil yang diambil</string>
+ <string name="converted_profile_i">profil yang diambil %d</string>
+ <string name="broken_images">Gambar rusak</string>
+ <string name="broken_images_faq">Image HTC yang resmi diketahui memiliki masalah routing yang ganjilyang menyebabkan trafik data tidak melalui tunnel (Lihat di &lt;a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=18\"&gt;Issue 18&lt;/a&gt; di bagian bug tracker.))&lt;/p&gt;&lt;p&gt; Image SONY resmi yang lama dari Xperia Arc S and Xperia Ray telah dilaporkan tidak memiliki VPNService dalam Imagenya. (Lihat juga &lt;a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=29\"&gt;Issue 29&lt;/a&gt; di bagian bug tracker.))&lt;/p&gt;&lt;p&gt;Pada image yang dibuat non resmi, modul TUN mungkin tak ada atau hak /dev/tun mungkin salah. Beberapa image CM9 memerlukan pilihan \"Fix ownership\" di bagian \"Device specific hacks\" diaktfikan. .&lt;/p&gt;&lt;p&gt; Lebih penting lagi, jika device anda memiliki image android yang lengkap, laporkan pada vendor anda. Semakin banyak laporan masuk, semakin tinggi kemungkinan vendor melakukan perbaikan.&lt;/p&gt;</string>
+ <string name="pkcs12_file_encryption_key">Berkas kunci enkripsi PKCS12</string>
+ <string name="private_key_password">Sandi kunci pribadi</string>
+ <string name="password">Sandi</string>
+ <string name="file_icon">ikon berkas</string>
+ <string name="tls_authentication">Otentikasi TLS</string>
+ <string name="generated_config">Konfigurasi Dibuat</string>
+ <string name="generalsettings">Pengaturan</string>
+ <string name="owner_fix_summary">Mencoba menetapkan pemilik /dev/tun ke sistem. Beberapa gambar CM9 memerlukan ini untuk membuat API VPNService bekerja. Memerlukan akses Root.</string>
+ <string name="owner_fix">Perbaiki kepemilikan /dev/tun</string>
+ <string name="generated_config_summary">Tunjukkan berkas konfigurasi OpenVPN yang dibuat</string>
+ <string name="edit_profile_title">Mengubah \"%s\"</string>
+ <string name="building_configration">Membuat konfigurasi&#8230;</string>
+ <string name="netchange_summary">Menyalakan pilihan ini akan memaksa menyambung kembali jika keadaan jaringan berubah (misalnya WiFi dari mobile)</string>
+ <string name="netchange">Koneksi ulang saat ganti jaringan</string>
+ <string name="netstatus">Status jaringan: %s</string>
+ <string name="extracahint">Sertifikat CA biasanya kembali dari Android Keystore. Tentukan sertifikat terpisah jika Anda mendapatkan kesalahan verifikasi sertifikat.</string>
+ <string name="select_file">Pilih</string>
+ <string name="keychain_nocacert">Tidak ada sertifikat CA yang didapat saat membaca dari Android Keystore. Otentifikasi mungkin gagal</string>
+ <string name="show_log_summary">Tampilkan jendela catatan saat terkoneksi. Jendela catatan juga dapat diakses melalui status notifikasi</string>
+ <string name="show_log_window">Tampilkan jendela catatan</string>
+ <string name="mobile_info">Berjalan di %1$s (%2$s) %3$s, Android API %4$d</string>
+ <string name="error_rsa_sign">Kesalahan masuk dengan kunci Android keystore %1$s: %2$s</string>
+ <string name="faq_system_dialogs">Peringatan sambungan VPN yang memberitahukan Anda bahwa aplikasi ini dapat mencegat semua lalu lintas dikeluarkan oleh sistem untuk mencegah penyalahgunaan dari sambungan VPNService API.\nPemberitahuan sambungan VPN (simbol kunci) juga dikeluarkan oleh sistem Android untuk memberitahu VPN yang sedang berlangsung. Pada beberapa gambar pemberitahuan ini memainkan suara. \nAndroid memperkenalkan sistem dialog ini untuk keselamatan Anda sendiri dan memastikan bahwa mereka tidak membuat masalah. (Pada beberapa gambar sayangnya ini termasuk peringatan suara)</string>
+ <string name="faq_system_dialogs_title">Peringatan sambungan dan pemberitahuan melalui suara</string>
+ <string name="translationby">Terjemah Bahasa Indonesia oleh Dayro</string>
+ <string name="ipdns">IP dan DNS</string>
+ <string name="basic">Dasar</string>
+ <string name="routing">Rute</string>
+ <string name="obscure">Mengaburkan pengaturan OpenVPN. Biasanya tidak diperlukan.</string>
+ <string name="advanced">Lanjutan</string>
+ <string name="export_config_title">Konfigurasi ICS Openvpn</string>
+ <string name="warn_no_dns">Tidak DNS server yang digunakan. Name Resolution mungkin akan gagal bekerja. Pertimbangkan pengaturan server DNS. Harap dicatat Android akan terus memakai pengaturan proxy untuk koneksi mobile/wifi saat tidak ada server DNS diatur.</string>
+ <string name="dns_add_error">Tak bisa menambahkan Server DNS \"%1$s\", ditolak oleh sistem: %2$s</string>
+ <string name="faq_howto">&lt;p&gt; Ambil konfigurasi yang dapat berjalan (diuji pada komputer Anda atau download dari penyedia/organisasi) &lt;/p&gt; &lt;p&gt; Satu file(berkas) saja tanpa tambahan berkas pem/pks12. Anda dapat kirim imel berkas dan membuka lampirannya. Jika Anda memiliki beberapa berkas, salin ke sd-card &lt;/p&gt; &lt;p&gt; klik pada lampiran imel atau gunakan ikon folder dalam daftar vpn untuk mengimpor berkas konfigurasi &lt;/p&gt; &lt;p&gt; jika ada berkas yang kurang, salin file hilang ke sd-card. &lt;/p&gt; &lt;p&gt; klik pada simbol Simpan untuk menambahkan VPN yang diimpor ke daftar VPN &lt;/p&gt; &lt;p &gt; Connect VPN dengan mengklik nama VPN &lt;/p&gt; &lt;p&gt; jika ada kesalahan atau peringatan di catatan, coba pahami peringatannya dan coba untuk memperbaikinya &lt;/p&gt; </string>
+ <string name="faq_howto_title">Mulai Cepat</string>
+ <string name="setting_loadtun_summary">Coba pakai tun.ko kernel sebelum mencoba koneksi. Membutuhkan perangkat yang sudah diroot. Google: android superuser</string>
+ <string name="setting_loadtun">Pakai modul TUN</string>
+ <string name="importpkcs12fromconfig">Ambil PKCS12 dari konfigurasi ke Android Keystore</string>
+ <string name="getproxy_error">Gagal mendapatkan pengaturan proxy: %s</string>
+ <string name="using_proxy">Menggunakan proxy %1$s %2$d</string>
+ <string name="use_system_proxy">Gunakan sistem proxy</string>
+ <string name="use_system_proxy_summary">Gunakan konfigurasi lebih luas untuk menyambung system melalui proxy HTTP/HTTPS</string>
+ <string name="donatewithpaypal">Anda dapat melakukan donasi &lt;a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;amp;cmd=_s-xclick\"&gt;dengan PayPal&lt;/a&gt; </string>
+ <string name="onbootrestartsummary">OpenVPN akan menyambung kembali VPN jika VPN aktif pada saat sistem reboot/shutdown. Silakan baca FAQ tentang peringatan sambungan sebelum menggunakan pilihan ini.</string>
+ <string name="onbootrestart">Koneksi ulang saat perangkat dihidupkan kembali</string>
+ <string name="ignore">Abaikan</string>
+ <string name="restart">Restart</string>
+ <string name="restart_vpn_after_change">Perubahan konfigurasi baru diterapkan setelah restart VPN. Restart VPN sekarang?</string>
+ <string name="configuration_changed">Konfigurasi berubah</string>
+ <string name="log_no_last_vpn">Tak bisa menentukan profil terhubung terakhir untuk diubah</string>
+ <string name="faq_duplicate_notification_title">Pemberitahuan berganda</string>
+ <string name="faq_duplicate_notification">Jika Android kekurangan sistem memori (RAM), aplikasi dan layanan yang tidak diperlukan pada saat itu akan dihapus dari memori aktif. Sambungan VPN yang sedang aktif juga ditutup. Untuk memastikan bahwa sambungan/OpenVPN tetap berjalan, OpenVPN diberikan prioritas yang lebih tinggi. Untuk menjalankan dengan prioritas lebih tinggi, aplikasi harus menampilkan pemberitahuan. Ikon pemberitahuan dijalankan oleh sistem seperti dijelaskan dalam FAQ entri sebelumnya. Ini tidak dihitung sebagai pemberitahuan app yang berjalan dengan prioritas lebih tinggi.</string>
+ <string name="no_vpn_profiles_defined">Tak ada profil VPN yang didefinisikan.</string>
+ <string name="add_new_vpn_hint">Gunakan ikon &lt; img src = \"ic_menu_add\" / &gt; untuk menambah VPN baru</string>
+ <string name="vpn_import_hint">Gunakan ikon &lt; img src = \"ic_menu_archive\" / &gt; untuk mengimpor profil (.ovpn atau .conf) yang ada dari sdcard Anda.</string>
+ <string name="faq_hint">Pastikan untuk juga memeriksa FAQ. Ada petunjuk untuk memudahkan anda.</string>
+ <string name="faq_routing_title">Konfigurasi rute\antarmuka</string>
+ <string name="persisttun_summary">Jangan kembali ke status tidak ada koneksi VPN ketika OpenVPN mencoba terhubung kembali.</string>
+ <string name="persistent_tun_title">Paksa mode TUN</string>
+ <string name="openvpn_log">Catatan OpenVPN</string>
+ <string name="import_config">Ambil konfigurasi VPN</string>
+ <string name="battery_consumption_title">Konsumsi baterai</string>
+ <string name="baterry_consumption">Berdasarkan tes pribadi, alasan utama tingginya konsumsi baterai oleh OpenVPN adalah paket keepalive. Sebagian besar server OpenVPN memiliki parameter konfigurasi seperti \'keepalive 10 60\' yang membuat klien dan server bertukar paket keepalive setiap 10 detik. &lt;p&gt; Dengan kecilnya paket ini dan tidak memakai trafik terlalu banyak, mereka menjaga jaringan radio mobile tetap sibuk dan meningkatkan konsumsi energi. (See also &lt;a href=\"http://developer.android.com/training/efficient-downloads/efficient-network-access.html#RadioStateMachine\"&gt;The Radio State Machine | Android Developers&lt;/a&gt;) &lt;p&gt; Seting keepalive ini tidak bisa dirubah di klien. Hanya Admin sistem OpenVPN yang dapat merubah seting ini. &lt;p&gt; Sayangnya membuat keepalive lebih besar dari 60 detik tanpa UDP dapat membuat beberapa gateway NAT memutus koneksi karena anggapan tidak ada aktifitas pada periode tertentu (timeout). Memakai TCP dengan waktu timeout lebih lama dapat bekerja, tapi membuat tunnel TCP di jalur TCP menyebabkan koneksi yang buruk dan tingginya angka kehilangan paket data ((See &lt;a href=\"http://sites.inka.de/bigred/devel/tcp-tcp.html\"&gt;Why TCP Over TCP Is A Bad Idea&lt;/a&gt;)</string>
+ <string name="faq_tethering">Fitur penggandengan Android (melalui WiFi, USB atau Bluetooth) dan API VPNService (digunakan oleh program ini) tidak bekerja bersama-sama. Untuk keterangan lanjut lihat &lt; href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=34\" &gt; mengeluarkan #34 &lt;/a&gt;</string>
+ <string name="vpn_tethering_title">VPN dan penarikan</string>
+ <string name="connection_retries">Mengulang koneksi</string>
+ <string name="reconnection_settings">Pengaturan rekoneksi</string>
+ <string name="connectretrymessage">Jumlah detik untuk menunggu antar usaha koneksi</string>
+ <string name="connectretrywait">Detik antar koneksi</string>
+ <string name="minidump_generated">OpenVPN crash tak terduga. Silakan mempertimbangkan mengirim menggunakan pilihan Minidump di Menu Utama</string>
+ <string name="send_minidump">Mengirim MiniDump untuk pengembang</string>
+ <string name="send_minidump_summary">Mengirim informasi debug tentang kegagalan aplikasi yang terakhir ke pengembang</string>
+ <string name="notifcation_title">OpenVPN - %s</string>
+ <string name="session_ipv4string">%1$s - %2$s</string>
+ <string name="session_ipv6string">%1$s - %3$s, %2$s</string>
+ <string name="state_connecting">Menghubungkan</string>
+ <string name="state_wait">Menunggu jawaban server</string>
+ <string name="state_auth">Melakukan otentifikasi</string>
+ <string name="state_get_config">Mengambil konfigurasi klien</string>
+ <string name="state_assign_ip">Menetapkan alamat IP</string>
+ <string name="state_add_routes">Menambahkan rute</string>
+ <string name="state_connected">Terhubung</string>
+ <string name="state_disconnected">Putus</string>
+ <string name="state_reconnecting">Menghubungkan kembali</string>
+ <string name="state_exiting">Keluar</string>
+ <string name="state_noprocess">Tidak berjalan</string>
+ <string name="state_resolve">Mengenali nama host</string>
+ <string name="state_tcp_connect">Menghubungkan (TCP)</string>
+ <string name="state_auth_failed">Otentifikasi gagal</string>
+ <string name="state_nonetwork">Menunggu jaringan yang dapat dipakai</string>
+ <string name="statusline_bytecount">↓%2$s/s %1$s - ↑%4$s/s %3$s</string>
+ <string name="notifcation_title_notconnect">Tidak terhubung</string>
+ <string name="start_vpn_title">Menghubungkan ke VPN %s</string>
+ <string name="start_vpn_ticker">Menghubungkan ke VPN %s</string>
+ <string name="jelly_keystore_alphanumeric_bug">Beberapa versi Android 4.1 memiliki masalah jika nama sertifikat keystore berisi karakter non alfanumerik (seperti spasi, garis bawah atau tanda hubung). Cobalah import ulang sertifikat tanpa karakter khusus</string>
+ <string name="encryption_cipher">Enkripsi sandi</string>
+ <string name="packet_auth">Otentikasi paket</string>
+ <string name="auth_dialog_title">Masukkan metode otentikasi paket</string>
+ <string name="mobile_info_extended">Berjalan pada Android API %4$d, versi %5$s %1$s (%2$s) %3$s, %6$s</string>
+ <string name="built_by">dibangun oleh %s</string>
+ <string name="debug_build">Pengembangan debug</string>
+ <string name="official_build">Build Resmi</string>
+ <string name="make_selection_inline">Salin ke profil</string>
+ <string name="crashdump">Data saat terjadi crash</string>
+ <string name="add">Tambahkan</string>
+ <string name="send_config">Mengirim config file</string>
+ <string name="complete_dn">DN lengkap</string>
+ <string name="remotetlsnote">Konfigurasi yang diimpor menggunakan opsi tls-remote DEPRECATED tua dengan menggunakan format DN yang berbeda.</string>
+ <string name="rdn">RDN (nama umum)</string>
+ <string name="rdn_prefix">RDN awalan</string>
+ <string name="tls_remote_deprecated">TLS-remote (DEPRECATED)</string>
+ <string name="help_translate">Anda dapat membantu menerjemahkan dengan mengunjungi http://crowdin.net/project/ics-openvpn/invite</string>
+ <string name="prompt">%1$s berusaha mengendalikan %2$s</string>
+ <string name="remote_trust">Saya percaya aplikasi ini.</string>
+ <string name="no_external_app_allowed">App tidak diizinkan untuk menggunakan API eksternal</string>
+ <string name="allowed_apps">apps yang diijinkan : %s</string>
+ <string name="clearappsdialog">Hapus daftar aplikasi eksternal yang dibolehkan? \nDaftar apps yang dibolehkan terkini:\n\n%s </string>
+ <string name="screenoff_summary">\"Pause VPN ketika layar off dan data yang ditransfer dalam 60 detik kurang dari 64kB. Ketika opsi \"Persistent Tun\" diaktifkan, memberhentikan VPN akan membuat perangkat Anda tidak memiliki koneksi jaringan. Jika tidak memakai \"Persistent Tun\" maka perangkat akan menampilkan Tidak ada koneksi VPN.</string>
+ <string name="screenoff_title">Sambungan VPN jeda setelah layar mati</string>
+ <string name="screenoff_pause">Hentikan sambungan dalam kondisi layar mati: kurang dari %1$s dalam %2$ss</string>
+ <string name="screen_nopersistenttun">Peringatan: Pemaksaan tun tidak diaktifkan untuk VPN ini. Lalu lintas akan menggunakan koneksi Internet normal ketika layar dimatikan.</string>
+ <string name="save_password">Menyimpan sandi</string>
+ <string name="pauseVPN">Jeda VPN</string>
+ <string name="resumevpn">Lanjutkan VPN</string>
+ <string name="state_userpause">Pause VPN diminta oleh pengguna</string>
+ <string name="state_screenoff">VPN dijeda - layar off</string>
+ <string name="device_specific">Perangkat dengan spesifikasi Hacks</string>
+ <string name="cannotparsecert">Tidak dapat menampilkan informasi sertifikat</string>
+ <string name="appbehaviour">Prilaku Aplikasi</string>
+ <string name="vpnbehaviour">Prilaku VPN</string>
+</resources>
diff --git a/app/src/main/res/values-ja/strings-icsopenvpn.xml b/app/src/main/res/values-ja/strings-icsopenvpn.xml
index 2ce290a3..c96b9b8e 100755
--- a/app/src/main/res/values-ja/strings-icsopenvpn.xml
+++ b/app/src/main/res/values-ja/strings-icsopenvpn.xml
@@ -286,6 +286,7 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="tls_remote_deprecated"> tls-remote (非推奨)</string>
<string name="help_translate">翻訳作業を手伝っていただける方は次のURLへ http://crowdin.net/project/ics-openvpn/invite</string>
<string name="prompt">%1$s は %2$s を制御しようとしています。</string>
+ <string name="remote_warning">このまま進むと、あなたはOpenVPN for Androidの完全な制御とすべての通信を傍受する権限をアプリケーションに対し与えることになります。<b>アプリケーションが信頼できない限り、承諾しないでください。</b>さもないと、あなたのデータがマルウェアにより漏洩させられる危険があります。</string>
<string name="remote_trust">私はこのアプリケーションを信頼します</string>
<string name="no_external_app_allowed">外部APIの使用を許可されたアプリはありません</string>
<string name="allowed_apps">許可アプリ: %s</string>
@@ -307,6 +308,7 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="permission_icon_app">OpenVPN for Androidを使用しようと試みるアプリのアイコン</string>
<string name="faq_vpndialog43_title">Android 4.3以降用VPN確認ダイアログ</string>
<string name="donatePlayStore">ほかの手段として、Play Storeで私に寄付できます。</string>
+ <string name="thanks_for_donation">%s の寄付をお寄せいただきありがとうございます!</string>
<string name="logCleared">ログがクリアされました。</string>
<string name="show_password">パスワードを表示する</string>
<string name="keyChainAccessError">キーチェーン アクセス エラー: %s</string>
@@ -316,12 +318,17 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="uploaded_data">アップロード</string>
<string name="downloaded_data">ダウンロード</string>
<string name="vpn_status">VPNの状態</string>
+ <string name="logview_options">オプションを表示</string>
<string name="unhandled_exception">未処理の例外: %1$s\n\n%2$s</string>
<string name="unhandled_exception_context">%3$s: %1$s\n\n%2$s</string>
<string name="faq_system_dialog_xposed">もしあなたがデバイスをroot化しているのであれば、 &lt;a href=\"http://xposed.info/\"&gt;Xposed framework&lt;/a&gt;と&lt;a href=\"http://repo.xposed.info/module/de.blinkt.vpndialogxposed\"&gt;VPN Dialog confirm module&lt;/a&gt; を自己責任においてインストールできます</string>
<string name="full_licenses">フルライセンス</string>
<string name="blocklocal_summary">ローカルインターフェイスに直接接続されているネットワークはVPNを経由しません。
このオプションを外すとローカルネットワーク宛のすべての通信をVPNにリダイレクトします。</string>
+ <string name="blocklocal_title">ローカルネットワークはVPNを経由しない</string>
+ <string name="userpw_file">ユーザー名/パスワードファイル</string>
+ <string name="imported_from_file">[インポート元: %s]</string>
<string name="files_missing_hint">いくつかのファイルが見つかりませんでした。プロファイルをインポートするファイルを選択してください:</string>
+ <string name="openvpn_is_no_free_vpn">このアプリを使用するには、(多くの場合、あなたの雇用者によって提供される)OpenVPNをサポートするVPNプロバイダ/ VPNゲートウェイが必要です。あなた独自のOpenVPNサーバーをセットアップするためにはhttp://community.openvpn.net/ をチェックしてください。</string>
<string name="import_log">インポートログ:</string>
</resources>
diff --git a/app/src/main/res/values-tr/strings-icsopenvpn.xml b/app/src/main/res/values-tr/strings-icsopenvpn.xml
index 26ac47ad..a40df5bf 100755
--- a/app/src/main/res/values-tr/strings-icsopenvpn.xml
+++ b/app/src/main/res/values-tr/strings-icsopenvpn.xml
@@ -309,4 +309,6 @@
<string name="full_licenses">Lisanslar</string>
<string name="blocklocal_title">Yerel ağlar için Bypass VPN</string>
<string name="userpw_file">Kullanıcı adı / Şifre dosyası</string>
+ <string name="imported_from_file">[Buradan içeri aktar: %s]</string>
+ <string name="import_log">Kaydı içe aktar:</string>
</resources>
diff --git a/app/src/main/res/values/strings-icsopenvpn.xml b/app/src/main/res/values/strings-icsopenvpn.xml
index 6ab41787..40698afa 100755
--- a/app/src/main/res/values/strings-icsopenvpn.xml
+++ b/app/src/main/res/values/strings-icsopenvpn.xml
@@ -117,7 +117,7 @@
<string name="tap_faq3">A third time? Actually, one could write a a tap emulator based on tun that would add layer2 information on send and strip layer2 information on receive. But this tap emulator would also have to implement ARP and possibly a DHCP client. I am not aware of anybody doing any work in this direction. Contact me if you want to start coding on this.</string>
<string name="faq">FAQ</string>
<string name="copying_log_entries">Copying log entries</string>
- <string name="faq_copying">To copy a single log entry press and hold on the log entry. To copy/send the whole log use the Send Log option. Use the hardware menu button if not visible in the GUI.</string>
+ <string name="faq_copying">To copy a single log entry press and hold on the log entry. To copy/send the whole log use the Send Log option. Use the hardware menu button, if the button is not visible in the GUI.</string>
<string name="faq_shortcut">Shortcut to start</string>
<string name="faq_howto_shortcut">You can place a shortcut to start OpenVPN on your desktop. Depending on your homescreen program you will have to add either a shortcut or a widget.</string>
<string name="no_vpn_support_image">Your image does not support the VPNService API, sorry :(</string>
@@ -190,7 +190,7 @@
<string name="warn_no_dns">No DNS servers being used. Name resolution may not work. Consider setting custom DNS Servers. Please also note that Android will keep using your proxy settings specified for your mobile/Wi-Fi connection when no DNS servers are set.</string>
<string name="dns_add_error">Could not add DNS Server \"%1$s\", rejected by the system: %2$s</string>
<string name="ip_add_error">Could not configure IP Address \"%1$s\", rejected by the system: %2$s</string>
- <string name="faq_howto">&lt;p&gt;Get a working config (tested on your computer or download from your provider/organisation)&lt;/p&gt;&lt;p&gt;If it is a single file no with no extra pem/pks12 files you can email the file yourself and open the attachment. If you have multiple files put them on your sd card.&lt;/p&gt;&lt;p&gt;Click on the email attachment/Use the folder icon in the vpn list to import the config file&lt;/p&gt;&lt;p&gt;If there are errors about missing files put the missing files on your sd card.&lt;/p&gt;&lt;p&gt;Click on the save symbol to add the imported VPN to your VPN list&lt;/p&gt;&lt;p&gt;Connect the VPN by clicking on the name of the VPN&lt;/p&gt;&lt;p&gt;If there are error or warnings in the log try to understand the warnings/error and try to fix them&lt;/p&gt; </string>
+ <string name="faq_howto">&lt;p&gt;Get a working config (tested on your computer or download from your provider/organisation)&lt;/p&gt;&lt;p&gt;If it is a single file with no extra pem/pks12 files you can email the file yourself and open the attachment. If you have multiple files put them on your sd card.&lt;/p&gt;&lt;p&gt;Click on the email attachment/Use the folder icon in the vpn list to import the config file&lt;/p&gt;&lt;p&gt;If there are errors about missing files put the missing files on your sd card.&lt;/p&gt;&lt;p&gt;Click on the save symbol to add the imported VPN to your VPN list&lt;/p&gt;&lt;p&gt;Connect the VPN by clicking on the name of the VPN&lt;/p&gt;&lt;p&gt;If there are error or warnings in the log try to understand the warnings/error and try to fix them&lt;/p&gt; </string>
<string name="faq_howto_title">Quick Start</string>
<string name="setting_loadtun_summary">Try to load the tun.ko kernel module before trying to connect. Needs rooted devices.</string>
<string name="setting_loadtun">Load tun module</string>
@@ -214,7 +214,7 @@
<string name="vpn_import_hint">Use the &lt;img src=\"ic_menu_archive\"/&gt; icon to import an existing (.ovpn or .conf) profile from your sdcard.</string>
<string name="faq_hint">Be sure to also check out the FAQ. There is a quick start guide.</string>
<string name="faq_routing_title">Routing/Interface Configuration</string>
- <string name="faq_routing">The Routing and interface configuration is not done via traditional ifconfig/route commands but by using the VPNService API. This results in a different routing configuration than on other OSes. The configuration for the VPN tunnel consists of the IP address and the networks that should be routed over this interface. Especially no peer partner address or gateway address is needed. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel. Only specifying networks to be routed via tunnel is supported. The app tries to detect networks that should not be routed over tunnel (e.g. route x.x.x.x y.y.y.y net_gateway) and calculates a route set that excludes this routes to emulate the behaviour of other platforms. The log windows shows the configuration of the VPNService upon establishing a connection.</string>
+ <string name="faq_routing">The Routing and interface configuration is not done via traditional ifconfig/route commands but by using the VPNService API. This results in a different routing configuration than on other OSes. \nThe configuration of the VPN tunnel consists of the IP address and the networks that should be routed over this interface. Especially, no peer partner address or gateway address is needed or required. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel.\nThe VPNService API does not allow specifying networks that should not be routed via the VPN. As a workaround the app tries to detect networks that should not be routed over tunnel (e.g. route x.x.x.x y.y.y.y net_gateway) and calculates a set of routes that excludes this routes to emulate the behaviour of other platforms. The log windows shows the configuration of the VPNService upon establishing a connection.\nBehind the scenes: Android 4.4+ does use policy routing. Using route/ifconfig will not show the installed routes. Instead use ip rule, iptables -t mangle -L</string>
<string name="persisttun_summary">Do not fallback to no VPN connection when OpenVPN is reconnecting.</string>
<string name="persistent_tun_title">Persistent tun</string>
<string name="openvpn_log">OpenVPN Log</string>
@@ -318,4 +318,5 @@
<string name="files_missing_hint">Some files could not be found. Please select the files to import the profile:</string>
<string name="openvpn_is_no_free_vpn">To use this app you need a VPN provider/VPN gateway supporting OpenVPN (often provided by your employer). Check out http://community.openvpn.net/ for more information on OpenVPN and how to setup your own OpenVPN server.</string>
<string name="import_log">Import log:</string>
+ <string name="ip_looks_like_subnet">Vpn topology \"%3$s\" specified but ifconfig %1$s %2$s looks more like an IP address with a network mask. Assuming \"subnet\" topology.</string>
</resources>
diff --git a/app/src/main/res/values/untranslatable.xml b/app/src/main/res/values/untranslatable.xml
index f956b6bd..e667a808 100644
--- a/app/src/main/res/values/untranslatable.xml
+++ b/app/src/main/res/values/untranslatable.xml
@@ -893,4 +893,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
</resources> \ No newline at end of file
diff --git a/build.gradle b/build.gradle
index e26c54a9..1a4f6932 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,21 +24,21 @@ apply plugin: 'mercurial-mq'
// branch = 'ics-openvpn-upstream'
// }
-task cloneIcsOpenVPN( type: HgClone ) {
- ext.srcFile = file('build.gradle')
- ext.destDir = new File('.', 'ics-openvpn')
- inputs.file srcFile
- outputs.dir destDir
+// task cloneIcsOpenVPN( type: HgClone ) {
+// ext.srcFile = file('build.gradle')
+// ext.destDir = new File('.', 'ics-openvpn')
+// inputs.file srcFile
+// outputs.dir destDir
- sourceUrl = 'https://code.google.com/p/ics-openvpn/'
-}
+// sourceUrl = 'https://code.google.com/p/ics-openvpn/'
+// }
-task updateIcsOpenVPN( type: HgUpdate, dependsOn: 'pullIcsOpenVPN' ) {
- workingDir = 'ics-openvpn'
- branch = 'default'
-}
+// task updateIcsOpenVPN( type: HgUpdate, dependsOn: 'pullIcsOpenVPN' ) {
+// workingDir = 'ics-openvpn'
+// branch = 'default'
+// }
-task pullIcsOpenVPN( type: HgPull ) {
- sourceUrl = 'https://code.google.com/p/ics-openvpn/'
- workingDir = 'ics-openvpn'
-} \ No newline at end of file
+// task pullIcsOpenVPN( type: HgPull ) {
+// sourceUrl = 'https://code.google.com/p/ics-openvpn/'
+// workingDir = 'ics-openvpn'
+// } \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/jni/Android.mk b/ics-openvpn-stripped/main/jni/Android.mk
new file mode 100644
index 00000000..33d0bc76
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/Android.mk
@@ -0,0 +1,73 @@
+# Path of the sources
+JNI_DIR := $(call my-dir)
+
+#optional arguments
+#WITH_POLAR=1
+#WITH_OPENVPN3=1
+# Build openvpn with polar (OpenVPN3 core is always build with polar)
+#WITH_BREAKPAD=0
+
+
+include lzo/Android.mk
+include snappy/Android.mk
+
+include openssl/Android.mk
+
+ifneq ($(USE_BREAKPAD),0)
+ ifneq ($(TARGET_ARCH),mips)
+ WITH_BREAKPAD=1
+ include google-breakpad/android/google_breakpad/Android.mk
+ else
+ WITH_BREAKPAD=0
+ endif
+else
+WITH_BREAKPAD=0
+endif
+
+ifeq ($(WITH_POLAR),1)
+ USE_POLAR=1
+endif
+ifeq ($(WITH_OPENVPN3),1)
+ USE_POLAR=1
+endif
+
+ifeq ($(USE_POLAR),1)
+ include polarssl/Android.mk
+endif
+
+include openvpn/Android.mk
+
+ifeq ($(WITH_OPENVPN3),1)
+ include ovpn3/Android.mk
+endif
+
+LOCAL_PATH := $(JNI_DIR)
+
+# The only real JNI library
+include $(CLEAR_VARS)
+LOCAL_LDLIBS := -llog -lz
+LOCAL_C_INCLUDES := openssl/include openssl/crypto openssl
+LOCAL_SRC_FILES:= jniglue.c jbcrypto.cpp
+LOCAL_MODULE = opvpnutil
+LOCAL_SHARED_LIBRARIES := libcrypto
+include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+LOCAL_LDLIBS := -lz -lc
+LOCAL_SHARED_LIBRARIES := libssl libcrypto openvpn
+LOCAL_SRC_FILES:= minivpn.c dummy.cpp
+LOCAL_MODULE = nopievpn
+include $(BUILD_EXECUTABLE)
+
+
+include $(CLEAR_VARS)
+LOCAL_LDLIBS := -lz -lc
+LOCAL_CFLAGS= -fPIE -pie
+LOCAL_CFLAGS = -fPIE
+LOCAL_LDFLAGS = -fPIE -pie
+LOCAL_SHARED_LIBRARIES := libssl libcrypto openvpn
+LOCAL_SRC_FILES:= minivpn.c dummy.cpp
+LOCAL_MODULE = pievpn
+include $(BUILD_EXECUTABLE)
+
diff --git a/ics-openvpn-stripped/main/jni/Application.mk b/ics-openvpn-stripped/main/jni/Application.mk
new file mode 100644
index 00000000..718e79a8
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/Application.mk
@@ -0,0 +1,11 @@
+APP_ABI := all
+APP_PLATFORM := android-14
+
+APP_STL:=stlport_shared
+#APP_STL:=gnustl_shared
+
+#APP_OPTIM := release
+
+#LOCAL_ARM_MODE := arm
+
+#NDK_TOOLCHAIN_VERSION=clang \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/jni/dummy.cpp b/ics-openvpn-stripped/main/jni/dummy.cpp
new file mode 100644
index 00000000..58466656
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/dummy.cpp
@@ -0,0 +1,8 @@
+/*#include <string>
+#include <iostream>
+
+void dummy()
+{
+ std::cout << "I am a dummy function to help compile on Android NDK r9" << std::endl;
+}
+*/
diff --git a/ics-openvpn-stripped/main/jni/jbcrypto.cpp b/ics-openvpn-stripped/main/jni/jbcrypto.cpp
new file mode 100644
index 00000000..2fd1262a
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/jbcrypto.cpp
@@ -0,0 +1,95 @@
+//
+// JBCyrpto.cpp
+// xcopenvpn
+//
+// Created by Arne Schwabe on 12.07.12.
+// Copyright (c) 2012 Universität Paderborn. All rights reserved.
+//
+
+#include <jni.h>
+
+#include <openssl/ssl.h>
+#include <openssl/rsa.h>
+#include <openssl/objects.h>
+#include <openssl/md5.h>
+#include <android/log.h>
+#include <openssl/err.h>
+
+
+extern "C" {
+jbyteArray Java_de_blinkt_openvpn_core_NativeUtils_rsasign(JNIEnv* env, jclass, jbyteArray from, jint pkeyRef);
+}
+
+int jniThrowException(JNIEnv* env, const char* className, const char* msg) {
+
+ jclass exceptionClass = env->FindClass(className);
+
+ if (exceptionClass == NULL) {
+ __android_log_print(ANDROID_LOG_DEBUG,"openvpn","Unable to find exception class %s", className);
+ /* ClassNotFoundException now pending */
+ return -1;
+ }
+
+ if (env->ThrowNew( exceptionClass, msg) != JNI_OK) {
+ __android_log_print(ANDROID_LOG_DEBUG,"openvpn","Failed throwing '%s' '%s'", className, msg);
+ /* an exception, most likely OOM, will now be pending */
+ return -1;
+ }
+
+ env->DeleteLocalRef(exceptionClass);
+ return 0;
+}
+
+static char opensslerr[1024];
+jbyteArray Java_de_blinkt_openvpn_core_NativeUtils_rsasign (JNIEnv* env, jclass, jbyteArray from, jint pkeyRef) {
+
+ // EVP_MD_CTX* ctx = reinterpret_cast<EVP_MD_CTX*>(ctxRef);
+ EVP_PKEY* pkey = reinterpret_cast<EVP_PKEY*>(pkeyRef);
+
+
+ if (pkey == NULL || from == NULL) {
+ jniThrowException(env, "java/lang/NullPointerException", "EVP_KEY is null");
+ return NULL;
+ }
+
+ jbyte* data = env-> GetByteArrayElements (from, NULL);
+ int datalen = env-> GetArrayLength(from);
+
+ if(data==NULL )
+ jniThrowException(env, "java/lang/NullPointerException", "data is null");
+
+ int siglen;
+ unsigned char* sigret = (unsigned char*)malloc(RSA_size(pkey->pkey.rsa));
+
+
+ //int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
+ // unsigned char *sigret, unsigned int *siglen, RSA *rsa);
+
+ // adapted from s3_clnt.c
+ /* if (RSA_sign(NID_md5_sha1, (unsigned char*) data, datalen,
+ sigret, &siglen, pkey->pkey.rsa) <= 0 ) */
+
+ siglen = RSA_private_encrypt(datalen,(unsigned char*) data,sigret,pkey->pkey.rsa,RSA_PKCS1_PADDING);
+
+ if (siglen < 0)
+ {
+
+ ERR_error_string_n(ERR_get_error(), opensslerr ,1024);
+ jniThrowException(env, "java/security/InvalidKeyException", opensslerr);
+
+ ERR_print_errors_fp(stderr);
+ return NULL;
+
+
+ }
+
+
+ jbyteArray jb;
+
+ jb =env->NewByteArray(siglen);
+
+ env->SetByteArrayRegion(jb, 0, siglen, (jbyte *) sigret);
+ free(sigret);
+ return jb;
+
+}
diff --git a/ics-openvpn-stripped/main/jni/jniglue.c b/ics-openvpn-stripped/main/jni/jniglue.c
new file mode 100644
index 00000000..36ad8fe7
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/jniglue.c
@@ -0,0 +1,21 @@
+#include <jni.h>
+#include <android/log.h>
+#include <stdlib.h>
+#include <setjmp.h>
+
+#include "jniglue.h"
+
+jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+ __android_log_write(ANDROID_LOG_DEBUG,"openvpn", "Loading openvpn native library $id$ compiled on " __DATE__ " " __TIME__ );
+ return JNI_VERSION_1_2;
+}
+
+
+void android_openvpn_log(int level,const char* prefix,const char* prefix_sep,const char* m1)
+{
+ __android_log_print(ANDROID_LOG_DEBUG,"openvpn","%s%s%s",prefix,prefix_sep,m1);
+}
+
+void Java_de_blinkt_openvpn_core_NativeUtils_jniclose(JNIEnv *env,jclass jo, jint fd) {
+ int ret = close(fd);
+}
diff --git a/ics-openvpn-stripped/main/jni/jniglue.h b/ics-openvpn-stripped/main/jni/jniglue.h
new file mode 100644
index 00000000..a86d52da
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/jniglue.h
@@ -0,0 +1,12 @@
+//
+// jniglue.h
+// xcopenvpn
+//
+// Created by Arne Schwabe on 29.03.12.
+// Copyright (c) 2012 Universität Paderborn. All rights reserved.
+//
+
+#ifndef xcopenvpn_jniglue_h
+#define xcopenvpn_jniglue_h
+void android_openvpn_log(int level,const char* prefix,const char* prefix_sep,const char* m1);
+#endif
diff --git a/ics-openvpn-stripped/main/jni/minivpn.c b/ics-openvpn-stripped/main/jni/minivpn.c
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/ics-openvpn-stripped/main/jni/minivpn.c
diff --git a/ics-openvpn-stripped/main/lzo/AUTHORS b/ics-openvpn-stripped/main/lzo/AUTHORS
new file mode 100644
index 00000000..d53d32cd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/AUTHORS
@@ -0,0 +1,3 @@
+Authors of the LZO data compression library:
+
+Markus F.X.J. Oberhumer. Invented, designed and implemented LZO.
diff --git a/ics-openvpn-stripped/main/lzo/Android.mk b/ics-openvpn-stripped/main/lzo/Android.mk
new file mode 100644
index 00000000..004be5fb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/Android.mk
@@ -0,0 +1,97 @@
+
+LOCAL_PATH:= $(call my-dir)
+
+common_SRC_FILES:= \
+ src/lzo_crc.c \
+ src/lzo_init.c \
+ src/lzo_ptr.c \
+ src/lzo_str.c \
+ src/lzo_util.c \
+ src/lzo1.c \
+ src/lzo1_99.c \
+ src/lzo1a.c \
+ src/lzo1a_99.c \
+ src/lzo1b_1.c \
+ src/lzo1b_2.c \
+ src/lzo1b_3.c \
+ src/lzo1b_4.c \
+ src/lzo1b_5.c \
+ src/lzo1b_6.c \
+ src/lzo1b_7.c \
+ src/lzo1b_8.c \
+ src/lzo1b_9.c \
+ src/lzo1b_99.c \
+ src/lzo1b_9x.c \
+ src/lzo1b_cc.c \
+ src/lzo1b_d1.c \
+ src/lzo1b_d2.c \
+ src/lzo1b_rr.c \
+ src/lzo1b_xx.c \
+ src/lzo1c_1.c \
+ src/lzo1c_2.c \
+ src/lzo1c_3.c \
+ src/lzo1c_4.c \
+ src/lzo1c_5.c \
+ src/lzo1c_6.c \
+ src/lzo1c_7.c \
+ src/lzo1c_8.c \
+ src/lzo1c_9.c \
+ src/lzo1c_99.c \
+ src/lzo1c_9x.c \
+ src/lzo1c_cc.c \
+ src/lzo1c_d1.c \
+ src/lzo1c_d2.c \
+ src/lzo1c_rr.c \
+ src/lzo1c_xx.c \
+ src/lzo1f_1.c \
+ src/lzo1f_9x.c \
+ src/lzo1f_d1.c \
+ src/lzo1f_d2.c \
+ src/lzo1x_1.c \
+ src/lzo1x_9x.c \
+ src/lzo1x_d1.c \
+ src/lzo1x_d2.c \
+ src/lzo1x_d3.c \
+ src/lzo1x_o.c \
+ src/lzo1x_1k.c \
+ src/lzo1x_1l.c \
+ src/lzo1x_1o.c \
+ src/lzo1y_1.c \
+ src/lzo1y_9x.c \
+ src/lzo1y_d1.c \
+ src/lzo1y_d2.c \
+ src/lzo1y_d3.c \
+ src/lzo1y_o.c \
+ src/lzo1z_9x.c \
+ src/lzo1z_d1.c \
+ src/lzo1z_d2.c \
+ src/lzo1z_d3.c \
+ src/lzo2a_9x.c \
+ src/lzo2a_d1.c \
+ src/lzo2a_d2.c
+
+
+common_C_INCLUDES += $(LOCAL_PATH)/include
+
+# static library
+# =====================================================
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES:= $(common_SRC_FILES)
+LOCAL_C_INCLUDES:= $(common_C_INCLUDES)
+LOCAL_MODULE := liblzo-static
+LOCAL_PRELINK_MODULE:= false
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_STATIC_LIBRARY)
+
+# dynamic library
+# =====================================================
+
+# include $(CLEAR_VARS)
+# LOCAL_SRC_FILES:= $(common_SRC_FILES)
+# LOCAL_C_INCLUDES:= $(common_C_INCLUDES)
+# LOCAL_MODULE := liblzo
+# LOCAL_PRELINK_MODULE:= false
+# LOCAL_MODULE_TAGS := optional
+# include $(BUILD_SHARED_LIBRARY)
+
diff --git a/ics-openvpn-stripped/main/lzo/B/00README.TXT b/ics-openvpn-stripped/main/lzo/B/00README.TXT
new file mode 100644
index 00000000..b5352a86
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/00README.TXT
@@ -0,0 +1,51 @@
+Simple make drivers for DOS, Windows, OS/2 and other systems
+============================================================
+
+This directory contains a bunch of simple build scripts - I've tried
+to make them as foolproof as possible.
+
+To build LZO for your system type 'b\OS\COMPILER' in the base directory,
+e.g. 'b\win32\vc.bat' will build the Win32 Visual C/C++ version.
+
+After building do a basic test by running 'lzotest.exe -mlzo COPYING'.
+util\check.sh is an example of a more thorough test driver.
+
+Please send me your additional/improved versions.
+
+
+Overview:
+---------
+
+b\dos32\bc_pp.bat Borland C/C++ (1)
+b\dos32\dj2.bat djgpp v2 + gcc (1)
+b\dos32\dm.bat Digital Mars C/C++ (1)
+b\dos32\emx.bat emx + gcc (1)
+b\dos32\sc.bat Symantec C/C++ (1)
+b\dos32\wc.bat Watcom C/C++ (1)
+
+b\os2\emx.bat emx + gcc (1)
+b\os2\wc.bat Watcom C/C++ (1)
+
+b\win32\bc.bat Borland C/C++ (1)
+b\win32\cygwin.bat Cygwin + gcc (1)
+b\win32\dm.bat Digital Mars C/C++ (1)
+b\win32\ic.bat Intel C/C++ (1)
+b\win32\mingw.bat MinGW + gcc (1)
+b\win32\mwerks.bat Metrowerks CodeWarrior C/C++ (1)
+b\win32\pellesc.bat Pelles C (1)
+b\win32\pgi.bat Portland Group PGI C/C++ (1)
+b\win32\rsxnt.bat rsxnt + gcc (1)
+b\win32\sc.bat Symantec C/C++ (1)
+b\win32\vc.bat Visual C/C++ (1)
+b\win32\vc_dll.bat Visual C/C++ (DLL version) (1)
+b\win32\wc.bat Watcom C/C++ (1)
+
+b\win64\ic.bat Intel C/C++ (Itanium)
+b\win64\ic_dll.bat Intel C/C++ (Itanium) (DLL version)
+b\win64\vc.bat Visual C/C++ (AMD64 or Itanium)
+b\win64\vc_dll.bat Visual C/C++ (AMD64 or Itanium) (DLL version)
+
+
+Notes:
+ (1) includes support for i386 assembler versions
+
diff --git a/ics-openvpn-stripped/main/lzo/B/clean.bat b/ics-openvpn-stripped/main/lzo/B/clean.bat
new file mode 100644
index 00000000..453e9479
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/clean.bat
@@ -0,0 +1,4 @@
+@del /q *.def *.err *.exp *.map *.o *.obj *.res *.tds > nul 2> nul
+@del /q liblzo2.a lzo2.a lzo2.dll lzo2.lib > nul 2> nul
+@del /q a.exe a.out dict.exe lzopack.exe precomp.exe precomp2.exe simple.exe > nul 2> nul
+@del /q lzotest.exe testmini.exe > nul 2> nul
diff --git a/ics-openvpn-stripped/main/lzo/B/done.bat b/ics-openvpn-stripped/main/lzo/B/done.bat
new file mode 100644
index 00000000..0ae243d4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/done.bat
@@ -0,0 +1,2 @@
+@echo //
+@echo // Building LZO was successful. All done.
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/bc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/bc.bat
new file mode 100644
index 00000000..bfcf38c6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/bc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -f-
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/bc.rsp b/ics-openvpn-stripped/main/lzo/B/dos16/bc.rsp
new file mode 100644
index 00000000..39b28f9f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/bc.rsp
@@ -0,0 +1,67 @@
++lzo1.obj &
++lzo1_99.obj &
++lzo1a.obj &
++lzo1a_99.obj &
++lzo1b_1.obj &
++lzo1b_2.obj &
++lzo1b_3.obj &
++lzo1b_4.obj &
++lzo1b_5.obj &
++lzo1b_6.obj &
++lzo1b_7.obj &
++lzo1b_8.obj &
++lzo1b_9.obj &
++lzo1b_99.obj &
++lzo1b_9x.obj &
++lzo1b_cc.obj &
++lzo1b_d1.obj &
++lzo1b_d2.obj &
++lzo1b_rr.obj &
++lzo1b_xx.obj &
++lzo1c_1.obj &
++lzo1c_2.obj &
++lzo1c_3.obj &
++lzo1c_4.obj &
++lzo1c_5.obj &
++lzo1c_6.obj &
++lzo1c_7.obj &
++lzo1c_8.obj &
++lzo1c_9.obj &
++lzo1c_99.obj &
++lzo1c_9x.obj &
++lzo1c_cc.obj &
++lzo1c_d1.obj &
++lzo1c_d2.obj &
++lzo1c_rr.obj &
++lzo1c_xx.obj &
++lzo1f_1.obj &
++lzo1f_9x.obj &
++lzo1f_d1.obj &
++lzo1f_d2.obj &
++lzo1x_1.obj &
++lzo1x_1k.obj &
++lzo1x_1l.obj &
++lzo1x_1o.obj &
++lzo1x_9x.obj &
++lzo1x_d1.obj &
++lzo1x_d2.obj &
++lzo1x_d3.obj &
++lzo1x_o.obj &
++lzo1y_1.obj &
++lzo1y_9x.obj &
++lzo1y_d1.obj &
++lzo1y_d2.obj &
++lzo1y_d3.obj &
++lzo1y_o.obj &
++lzo1z_9x.obj &
++lzo1z_d1.obj &
++lzo1z_d2.obj &
++lzo1z_d3.obj &
++lzo2a_9x.obj &
++lzo2a_d1.obj &
++lzo2a_d2.obj &
++lzo_crc.obj &
++lzo_init.obj &
++lzo_ptr.obj &
++lzo_str.obj &
++lzo_util.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/bc_286.bat b/ics-openvpn-stripped/main/lzo/B/dos16/bc_286.bat
new file mode 100644
index 00000000..e68fd4e2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/bc_286.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++ + Pharlap 286DOS-Extender
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc286 -ml -2
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/bc_pp.bat b/ics-openvpn-stripped/main/lzo/B/dos16/bc_pp.bat
new file mode 100644
index 00000000..2a09ba01
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/bc_pp.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI16)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -2 -WX
+set CF=-O1 -d -w -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/dm.bat b/ics-openvpn-stripped/main/lzo/B/dos16/dm.bat
new file mode 100644
index 00000000..24335982
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/dm.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -ml
+set CF=-o -w- %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/mc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/mc.bat
new file mode 100644
index 00000000..077401af
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/mc.bat
@@ -0,0 +1,52 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=/map
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/mc_qc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/mc_qc.bat
new file mode 100644
index 00000000..cb814dd7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/mc_qc.bat
@@ -0,0 +1,52 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft C/C++ (QuickC)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -qc -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=/map
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,%BLIB%;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/qc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/qc.bat
new file mode 100644
index 00000000..e51166ec
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/qc.bat
@@ -0,0 +1,40 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft QuickC
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=qcl -nologo -AL
+set CF=-O -Gf -W3 %CFI%
+set LF=%BLIB% -Fm
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/sc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/sc.bat
new file mode 100644
index 00000000..52960232
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/sc.bat
@@ -0,0 +1,53 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Symantec C/C++
+@echo //
+@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -ml
+set CF=-w- %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/tc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/tc.bat
new file mode 100644
index 00000000..c397ae1b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/tc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Turbo C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=tcc -ml -f-
+set CF=-O -G -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c src\*.c
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -f -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/vc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/vc.bat
new file mode 100644
index 00000000..17ec4ccd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/vc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL
+set CF=-O -Gf -Gs -Gy -W3 %CFI%
+set LF=%BLIB% -Fm
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/vc_qc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/vc_qc.bat
new file mode 100644
index 00000000..09fc0d3d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/vc_qc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Microsoft Visual C/C++ (QuickC)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -qc -AL
+set CF=-O -Gf -Gy -W3 %CFI%
+set LF=%BLIB% -Fm
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/wc.bat b/ics-openvpn-stripped/main/lzo/B/dos16/wc.bat
new file mode 100644
index 00000000..4effecc6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/wc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -bt#dos -l#dos
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos16/wc.rsp b/ics-openvpn-stripped/main/lzo/B/dos16/wc.rsp
new file mode 100644
index 00000000..f36b8cba
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos16/wc.rsp
@@ -0,0 +1,67 @@
++'lzo1.obj'
++'lzo1_99.obj'
++'lzo1a.obj'
++'lzo1a_99.obj'
++'lzo1b_1.obj'
++'lzo1b_2.obj'
++'lzo1b_3.obj'
++'lzo1b_4.obj'
++'lzo1b_5.obj'
++'lzo1b_6.obj'
++'lzo1b_7.obj'
++'lzo1b_8.obj'
++'lzo1b_9.obj'
++'lzo1b_99.obj'
++'lzo1b_9x.obj'
++'lzo1b_cc.obj'
++'lzo1b_d1.obj'
++'lzo1b_d2.obj'
++'lzo1b_rr.obj'
++'lzo1b_xx.obj'
++'lzo1c_1.obj'
++'lzo1c_2.obj'
++'lzo1c_3.obj'
++'lzo1c_4.obj'
++'lzo1c_5.obj'
++'lzo1c_6.obj'
++'lzo1c_7.obj'
++'lzo1c_8.obj'
++'lzo1c_9.obj'
++'lzo1c_99.obj'
++'lzo1c_9x.obj'
++'lzo1c_cc.obj'
++'lzo1c_d1.obj'
++'lzo1c_d2.obj'
++'lzo1c_rr.obj'
++'lzo1c_xx.obj'
++'lzo1f_1.obj'
++'lzo1f_9x.obj'
++'lzo1f_d1.obj'
++'lzo1f_d2.obj'
++'lzo1x_1.obj'
++'lzo1x_1k.obj'
++'lzo1x_1l.obj'
++'lzo1x_1o.obj'
++'lzo1x_9x.obj'
++'lzo1x_d1.obj'
++'lzo1x_d2.obj'
++'lzo1x_d3.obj'
++'lzo1x_o.obj'
++'lzo1y_1.obj'
++'lzo1y_9x.obj'
++'lzo1y_d1.obj'
++'lzo1y_d2.obj'
++'lzo1y_d3.obj'
++'lzo1y_o.obj'
++'lzo1z_9x.obj'
++'lzo1z_d1.obj'
++'lzo1z_d2.obj'
++'lzo1z_d3.obj'
++'lzo2a_9x.obj'
++'lzo2a_d1.obj'
++'lzo2a_d2.obj'
++'lzo_crc.obj'
++'lzo_init.obj'
++'lzo_ptr.obj'
++'lzo_str.obj'
++'lzo_util.obj'
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/bc_pp.bat b/ics-openvpn-stripped/main/lzo/B/dos32/bc_pp.bat
new file mode 100644
index 00000000..dbaf460c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/bc_pp.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI32)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc32 -WX
+set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/dj2.bat b/ics-openvpn-stripped/main/lzo/B/dos32/dj2.bat
new file mode 100644
index 00000000..02da9232
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/dj2.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // djgpp2 + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -s -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/dj2.opt b/ics-openvpn-stripped/main/lzo/B/dos32/dj2.opt
new file mode 100644
index 00000000..782eda58
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/dj2.opt
@@ -0,0 +1,6 @@
+-O2
+-fomit-frame-pointer
+-Wall
+-Wcast-align
+-Wcast-qual
+-Wwrite-strings
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/dm.bat b/ics-openvpn-stripped/main/lzo/B/dos32/dm.bat
new file mode 100644
index 00000000..3328e1f3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/dm.bat
@@ -0,0 +1,43 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -mx
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB% x32.lib
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=x32.lib
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/emx.bat b/ics-openvpn-stripped/main/lzo/B/dos32/emx.bat
new file mode 100644
index 00000000..631dceb3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/emx.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // emx + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/highc.bat b/ics-openvpn-stripped/main/lzo/B/dos32/highc.bat
new file mode 100644
index 00000000..83d4cdc0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/highc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // MetaWare High C/C++ (using Pharlap DOS extender)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=hc386
+set CF=-O3 -w4 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -w1 -c src\*.c
+@if errorlevel 1 goto error
+386lib %BLIB% -nobanner @b\dos32\highc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/highc.rsp b/ics-openvpn-stripped/main/lzo/B/dos32/highc.rsp
new file mode 100644
index 00000000..d17a52ae
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/highc.rsp
@@ -0,0 +1,73 @@
+-create lzo1.obj
+-create lzo1_99.obj
+-create lzo1a.obj
+-create lzo1a_99.obj
+-create lzo1b_1.obj
+-create lzo1b_2.obj
+-create lzo1b_3.obj
+-create lzo1b_4.obj
+-create lzo1b_5.obj
+-create lzo1b_6.obj
+-create lzo1b_7.obj
+-create lzo1b_8.obj
+-create lzo1b_9.obj
+-create lzo1b_99.obj
+-create lzo1b_9x.obj
+-create lzo1b_cc.obj
+-create lzo1b_d1.obj
+-create lzo1b_d2.obj
+-create lzo1b_rr.obj
+-create lzo1b_xx.obj
+-create lzo1c_1.obj
+-create lzo1c_2.obj
+-create lzo1c_3.obj
+-create lzo1c_4.obj
+-create lzo1c_5.obj
+-create lzo1c_6.obj
+-create lzo1c_7.obj
+-create lzo1c_8.obj
+-create lzo1c_9.obj
+-create lzo1c_99.obj
+-create lzo1c_9x.obj
+-create lzo1c_cc.obj
+-create lzo1c_d1.obj
+-create lzo1c_d2.obj
+-create lzo1c_rr.obj
+-create lzo1c_xx.obj
+-create lzo1f_1.obj
+-create lzo1f_9x.obj
+-create lzo1f_d1.obj
+-create lzo1f_d2.obj
+-create lzo1x_1.obj
+-create lzo1x_1k.obj
+-create lzo1x_1l.obj
+-create lzo1x_1o.obj
+-create lzo1x_9x.obj
+-create lzo1x_d1.obj
+-create lzo1x_d2.obj
+-create lzo1x_d3.obj
+-create lzo1x_o.obj
+-create lzo1y_1.obj
+-create lzo1y_9x.obj
+-create lzo1y_d1.obj
+-create lzo1y_d2.obj
+-create lzo1y_d3.obj
+-create lzo1y_o.obj
+-create lzo1z_9x.obj
+-create lzo1z_d1.obj
+-create lzo1z_d2.obj
+-create lzo1z_d3.obj
+-create lzo2a_9x.obj
+-create lzo2a_d1.obj
+-create lzo2a_d2.obj
+-create lzo_crc.obj
+-create lzo_init.obj
+-create lzo_ptr.obj
+-create lzo_str.obj
+-create lzo_util.obj
+-create asm\i386\obj\omf32\lzo1c_s1.obj
+-create asm\i386\obj\omf32\lzo1f_f1.obj
+-create asm\i386\obj\omf32\lzo1x_f1.obj
+-create asm\i386\obj\omf32\lzo1x_s1.obj
+-create asm\i386\obj\omf32\lzo1y_f1.obj
+-create asm\i386\obj\omf32\lzo1y_s1.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/ndp.bat b/ics-openvpn-stripped/main/lzo/B/dos32/ndp.bat
new file mode 100644
index 00000000..c2c1beba
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/ndp.bat
@@ -0,0 +1,40 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Microway NDP C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=mx486
+set CF=-ansi -on %CFI%
+set LF=%BLIB% -bind -map
+
+@REM %CC% %CF% -Isrc -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -Isrc -c %%f
+@if errorlevel 1 goto error
+ndplib %BLIB% @b\dos32\ndp.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Dconst= -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/ndp.rsp b/ics-openvpn-stripped/main/lzo/B/dos32/ndp.rsp
new file mode 100644
index 00000000..24c1d438
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/ndp.rsp
@@ -0,0 +1,67 @@
+-add lzo1.obj
+-add lzo1_99.obj
+-add lzo1a.obj
+-add lzo1a_99.obj
+-add lzo1b_1.obj
+-add lzo1b_2.obj
+-add lzo1b_3.obj
+-add lzo1b_4.obj
+-add lzo1b_5.obj
+-add lzo1b_6.obj
+-add lzo1b_7.obj
+-add lzo1b_8.obj
+-add lzo1b_9.obj
+-add lzo1b_99.obj
+-add lzo1b_9x.obj
+-add lzo1b_cc.obj
+-add lzo1b_d1.obj
+-add lzo1b_d2.obj
+-add lzo1b_rr.obj
+-add lzo1b_xx.obj
+-add lzo1c_1.obj
+-add lzo1c_2.obj
+-add lzo1c_3.obj
+-add lzo1c_4.obj
+-add lzo1c_5.obj
+-add lzo1c_6.obj
+-add lzo1c_7.obj
+-add lzo1c_8.obj
+-add lzo1c_9.obj
+-add lzo1c_99.obj
+-add lzo1c_9x.obj
+-add lzo1c_cc.obj
+-add lzo1c_d1.obj
+-add lzo1c_d2.obj
+-add lzo1c_rr.obj
+-add lzo1c_xx.obj
+-add lzo1f_1.obj
+-add lzo1f_9x.obj
+-add lzo1f_d1.obj
+-add lzo1f_d2.obj
+-add lzo1x_1.obj
+-add lzo1x_1k.obj
+-add lzo1x_1l.obj
+-add lzo1x_1o.obj
+-add lzo1x_9x.obj
+-add lzo1x_d1.obj
+-add lzo1x_d2.obj
+-add lzo1x_d3.obj
+-add lzo1x_o.obj
+-add lzo1y_1.obj
+-add lzo1y_9x.obj
+-add lzo1y_d1.obj
+-add lzo1y_d2.obj
+-add lzo1y_d3.obj
+-add lzo1y_o.obj
+-add lzo1z_9x.obj
+-add lzo1z_d1.obj
+-add lzo1z_d2.obj
+-add lzo1z_d3.obj
+-add lzo2a_9x.obj
+-add lzo2a_d1.obj
+-add lzo2a_d2.obj
+-add lzo_crc.obj
+-add lzo_init.obj
+-add lzo_ptr.obj
+-add lzo_str.obj
+-add lzo_util.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/sc.bat b/ics-openvpn-stripped/main/lzo/B/dos32/sc.bat
new file mode 100644
index 00000000..5751fa3b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/sc.bat
@@ -0,0 +1,51 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Symantec C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -mx
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/wc.bat b/ics-openvpn-stripped/main/lzo/B/dos32/wc.bat
new file mode 100644
index 00000000..8817b19c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/wc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Watcom C/C++ (using DOS/4G extender)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#dos -l#dos4g
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/dos32/zc.bat b/ics-openvpn-stripped/main/lzo/B/dos32/zc.bat
new file mode 100644
index 00000000..159e99ca
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/dos32/zc.bat
@@ -0,0 +1,51 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // DOS 32-bit
+@echo // Zortech C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=ztc -b -v0 -mx
+set CF=-o -w- -r %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+zorlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/generic/build.sh b/ics-openvpn-stripped/main/lzo/B/generic/build.sh
new file mode 100755
index 00000000..0480314e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/generic/build.sh
@@ -0,0 +1,69 @@
+#! /bin/sh
+# vi:ts=4:et
+set -e
+echo "// Copyright (C) 1996-2014 Markus F.X.J. Oberhumer"
+echo "//"
+echo "// Generic Posix/Unix system"
+echo "// Generic C compiler"
+
+test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../..
+
+test "X${AR}" = X && AR="ar"
+test "X${CC}" = X && CC="cc"
+test "X${CFLAGS+set}" = Xset || CFLAGS="-O"
+# CPPFLAGS, LDFLAGS, LIBS
+# LZO_EXTRA_CPPFLAGS, LZO_EXTRA_CFLAGS, LZO_EXTRA_LDFLAGS
+# LZO_EXTRA_SOURCES, LZO_EXTRA_OBJECTS, LZO_EXTRA_LIBS
+
+CFI="-I${top_srcdir}/include -I${top_srcdir} -I${top_srcdir}/src"
+BNAME=lzo2
+BLIB=lib${BNAME}.a
+
+CF="$CPPFLAGS $CFI $CFLAGS"
+# info: we restrict ourselves to pure ANSI C library functions for the examples
+CF="-DLZO_LIBC_ISOC90=1 $CF"
+# info: we do not use _any_ external functions in freestanding mode
+test -z "$LZO_CFG_FREESTANDING" || CF="-DLZO_CFG_FREESTANDING=1 $CF"
+LF="$LDFLAGS $LZO_EXTRA_LDFLAGS"
+LL="$BLIB $LIBS $LZO_EXTRA_LIBS"
+
+. $top_srcdir/B/generic/clean.sh
+
+for f in $top_srcdir/src/*.c $LZO_EXTRA_SOURCES; do
+ echo $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f
+ $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f
+done
+
+echo $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS
+ $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS
+
+
+if test -n "$LZO_CFG_FREESTANDING"; then
+
+echo "//"
+echo "// Building $BLIB in freestanding mode was successful. All done."
+echo "// Now try 'nm --extern-only $BLIB'"
+
+else
+
+for f in dict lzopack precomp precomp2 simple; do
+ echo $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL
+ $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL
+done
+echo $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL
+ $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL
+
+for f in minilzo.c testmini.c; do
+ XF="-I$top_srcdir/include/lzo $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS"
+ echo $CC $XF -c $top_srcdir/minilzo/$f
+ $CC $XF -c $top_srcdir/minilzo/$f
+done
+echo $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS
+ $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS
+
+
+echo "//"
+echo "// Building LZO was successful. All done."
+
+fi
+true
diff --git a/ics-openvpn-stripped/main/lzo/B/generic/build_freestanding.sh b/ics-openvpn-stripped/main/lzo/B/generic/build_freestanding.sh
new file mode 100755
index 00000000..9473dd6d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/generic/build_freestanding.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+# vi:ts=4:et
+
+test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../..
+
+LZO_CFG_FREESTANDING=1
+
+. $top_srcdir/B/generic/build.sh
diff --git a/ics-openvpn-stripped/main/lzo/B/generic/build_gcc.sh b/ics-openvpn-stripped/main/lzo/B/generic/build_gcc.sh
new file mode 100755
index 00000000..179d8c0f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/generic/build_gcc.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+# vi:ts=4:et
+set -e
+echo "// Using GNU C compiler."
+echo "//"
+
+test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../..
+UNAME_MACHINE=unknown
+
+CC="gcc -fPIC"
+CC="gcc -static"
+CC="gcc"
+CFLAGS="-Wall -O2 -fomit-frame-pointer"
+
+# delete the next line to disable assembler support
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+case $UNAME_MACHINE in
+ i[34567]86)
+ CC="$CC -m32"
+ CPPFLAGS="-DLZO_USE_ASM"
+ LZO_EXTRA_SOURCES=$top_srcdir/asm/i386/src_gas/*.S
+ ;;
+esac
+
+. $top_srcdir/B/generic/build.sh
diff --git a/ics-openvpn-stripped/main/lzo/B/generic/clean.sh b/ics-openvpn-stripped/main/lzo/B/generic/clean.sh
new file mode 100755
index 00000000..2728d2de
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/generic/clean.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+# vi:ts=4:et
+# Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+
+rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out
+
+true
diff --git a/ics-openvpn-stripped/main/lzo/B/os2/emx.bat b/ics-openvpn-stripped/main/lzo/B/os2/emx.bat
new file mode 100644
index 00000000..35e26fc5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/os2/emx.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // emx + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/os2/wc.bat b/ics-openvpn-stripped/main/lzo/B/os2/wc.bat
new file mode 100644
index 00000000..44ca3ab1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/os2/wc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#os2 -l#os2v2
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/os2/zc.bat b/ics-openvpn-stripped/main/lzo/B/os2/zc.bat
new file mode 100644
index 00000000..db751a67
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/os2/zc.bat
@@ -0,0 +1,51 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 32-bit
+@echo // Zortech C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=ztc -b -v0 -mf
+set CF=-o -w- -r %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+zorlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/os2_16/mc.bat b/ics-openvpn-stripped/main/lzo/B/os2_16/mc.bat
new file mode 100644
index 00000000..378d43f0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/os2_16/mc.bat
@@ -0,0 +1,43 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 16-bit
+@echo // Microsoft C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2
+set CF=-D__OS2__ -O -Gf -Gs -W3 %CFI%
+set LF=%BLIB% -Lp -Fm /link /stack:8096
+
+@REM %CC% %CF% -c src\*.c
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/os2_16/wc.bat b/ics-openvpn-stripped/main/lzo/B/os2_16/wc.bat
new file mode 100644
index 00000000..fcf7fc99
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/os2_16/wc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // OS/2 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -2 -bt#os2 -l#os2
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/prepare.bat b/ics-openvpn-stripped/main/lzo/B/prepare.bat
new file mode 100644
index 00000000..5f70fb77
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/prepare.bat
@@ -0,0 +1,10 @@
+@call b\unset.bat
+@call b\clean.bat
+
+@set CFI=-Iinclude -I. -Isrc
+@set CFASM=-DLZO_USE_ASM
+@set BNAME=lzo2
+@set BLIB=lzo2.lib
+@set BDLL=lzo2.dll
+
+@echo Compiling, please be patient...
diff --git a/ics-openvpn-stripped/main/lzo/B/src.rsp b/ics-openvpn-stripped/main/lzo/B/src.rsp
new file mode 100644
index 00000000..26fd0110
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/src.rsp
@@ -0,0 +1,67 @@
+src/lzo1.c
+src/lzo1_99.c
+src/lzo1a.c
+src/lzo1a_99.c
+src/lzo1b_1.c
+src/lzo1b_2.c
+src/lzo1b_3.c
+src/lzo1b_4.c
+src/lzo1b_5.c
+src/lzo1b_6.c
+src/lzo1b_7.c
+src/lzo1b_8.c
+src/lzo1b_9.c
+src/lzo1b_99.c
+src/lzo1b_9x.c
+src/lzo1b_cc.c
+src/lzo1b_d1.c
+src/lzo1b_d2.c
+src/lzo1b_rr.c
+src/lzo1b_xx.c
+src/lzo1c_1.c
+src/lzo1c_2.c
+src/lzo1c_3.c
+src/lzo1c_4.c
+src/lzo1c_5.c
+src/lzo1c_6.c
+src/lzo1c_7.c
+src/lzo1c_8.c
+src/lzo1c_9.c
+src/lzo1c_99.c
+src/lzo1c_9x.c
+src/lzo1c_cc.c
+src/lzo1c_d1.c
+src/lzo1c_d2.c
+src/lzo1c_rr.c
+src/lzo1c_xx.c
+src/lzo1f_1.c
+src/lzo1f_9x.c
+src/lzo1f_d1.c
+src/lzo1f_d2.c
+src/lzo1x_1.c
+src/lzo1x_1k.c
+src/lzo1x_1l.c
+src/lzo1x_1o.c
+src/lzo1x_9x.c
+src/lzo1x_d1.c
+src/lzo1x_d2.c
+src/lzo1x_d3.c
+src/lzo1x_o.c
+src/lzo1y_1.c
+src/lzo1y_9x.c
+src/lzo1y_d1.c
+src/lzo1y_d2.c
+src/lzo1y_d3.c
+src/lzo1y_o.c
+src/lzo1z_9x.c
+src/lzo1z_d1.c
+src/lzo1z_d2.c
+src/lzo1z_d3.c
+src/lzo2a_9x.c
+src/lzo2a_d1.c
+src/lzo2a_d2.c
+src/lzo_crc.c
+src/lzo_init.c
+src/lzo_ptr.c
+src/lzo_str.c
+src/lzo_util.c
diff --git a/ics-openvpn-stripped/main/lzo/B/unset.bat b/ics-openvpn-stripped/main/lzo/B/unset.bat
new file mode 100644
index 00000000..98f13786
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/unset.bat
@@ -0,0 +1,10 @@
+@set CC=
+@set CF=
+@set CFI=
+@set CFX=
+@set CFASM=
+@set LF=
+@set BNAME=
+@set BLIB=
+@set BDLL=
+@set BECHO=
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/bc.bat b/ics-openvpn-stripped/main/lzo/B/win16/bc.bat
new file mode 100644
index 00000000..06f64bda
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/bc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc -ml -2 -tW -h
+set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/dm.bat b/ics-openvpn-stripped/main/lzo/B/win16/dm.bat
new file mode 100644
index 00000000..d844ef83
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/dm.bat
@@ -0,0 +1,43 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Digital Mars C/C++ (using WINIO)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -ml -2 -W
+set CF=-o -w- %CFI%
+set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/mc.bat b/ics-openvpn-stripped/main/lzo/B/win16/mc.bat
new file mode 100644
index 00000000..26af7b6e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/mc.bat
@@ -0,0 +1,56 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Microsoft C/C++ (using QuickWin)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2 -Mq
+set CF=-O -Gf -W3 %CFI%
+set LF=/seg:256 /stack:8096 /nod:llibce /map
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+link %LF% dict.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+link %LF% lzopack.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+link %LF% precomp.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+link %LF% precomp2.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+link %LF% simple.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+link %LF% lzotest.obj,,,llibcewq.lib libw.lib %BLIB%;
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+link %LF% testmini.obj minilzo.obj,,,llibcewq.lib libw.lib;
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/sc.bat b/ics-openvpn-stripped/main/lzo/B/win16/sc.bat
new file mode 100644
index 00000000..89dd73c5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/sc.bat
@@ -0,0 +1,53 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Symantec C/C++ (using WINIO)
+@echo //
+@echo // NOTE: LZO breaks the optimizer, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -ml -2 -W
+set CF=-w- %CFI%
+set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/vc.bat b/ics-openvpn-stripped/main/lzo/B/win16/vc.bat
new file mode 100644
index 00000000..74962326
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/vc.bat
@@ -0,0 +1,43 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Microsoft Visual C/C++ (using QuickWin)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -AL -G2 -Mq
+set CF=-O -Gf -Gs -Gy -W3 %CFI%
+set LF=%BLIB% -Fm /link /seg:256
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib /nologo %BLIB% @b\dos16\bc.rsp;
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+set LF=-Fm /link /seg:256
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win16/wc.bat b/ics-openvpn-stripped/main/lzo/B/win16/wc.bat
new file mode 100644
index 00000000..be06828a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win16/wc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2011 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 16-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl -zq -ml -2 -bw -bt#windows -l#windows
+set CF=-ox %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/bc.bat b/ics-openvpn-stripped/main/lzo/B/win32/bc.bat
new file mode 100644
index 00000000..21fafa0e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/bc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Borland C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=bcc32
+set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -Isrc -c @b\src.rsp
+@if errorlevel 1 goto error
+tlib %BLIB% @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iexamples examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -ls -Iexamples examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/bc.rsp b/ics-openvpn-stripped/main/lzo/B/win32/bc.rsp
new file mode 100644
index 00000000..d62b5b38
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/bc.rsp
@@ -0,0 +1,73 @@
++lzo1.obj &
++lzo1_99.obj &
++lzo1a.obj &
++lzo1a_99.obj &
++lzo1b_1.obj &
++lzo1b_2.obj &
++lzo1b_3.obj &
++lzo1b_4.obj &
++lzo1b_5.obj &
++lzo1b_6.obj &
++lzo1b_7.obj &
++lzo1b_8.obj &
++lzo1b_9.obj &
++lzo1b_99.obj &
++lzo1b_9x.obj &
++lzo1b_cc.obj &
++lzo1b_d1.obj &
++lzo1b_d2.obj &
++lzo1b_rr.obj &
++lzo1b_xx.obj &
++lzo1c_1.obj &
++lzo1c_2.obj &
++lzo1c_3.obj &
++lzo1c_4.obj &
++lzo1c_5.obj &
++lzo1c_6.obj &
++lzo1c_7.obj &
++lzo1c_8.obj &
++lzo1c_9.obj &
++lzo1c_99.obj &
++lzo1c_9x.obj &
++lzo1c_cc.obj &
++lzo1c_d1.obj &
++lzo1c_d2.obj &
++lzo1c_rr.obj &
++lzo1c_xx.obj &
++lzo1f_1.obj &
++lzo1f_9x.obj &
++lzo1f_d1.obj &
++lzo1f_d2.obj &
++lzo1x_1.obj &
++lzo1x_1k.obj &
++lzo1x_1l.obj &
++lzo1x_1o.obj &
++lzo1x_9x.obj &
++lzo1x_d1.obj &
++lzo1x_d2.obj &
++lzo1x_d3.obj &
++lzo1x_o.obj &
++lzo1y_1.obj &
++lzo1y_9x.obj &
++lzo1y_d1.obj &
++lzo1y_d2.obj &
++lzo1y_d3.obj &
++lzo1y_o.obj &
++lzo1z_9x.obj &
++lzo1z_d1.obj &
++lzo1z_d2.obj &
++lzo1z_d3.obj &
++lzo2a_9x.obj &
++lzo2a_d1.obj &
++lzo2a_d2.obj &
++lzo_crc.obj &
++lzo_init.obj &
++lzo_ptr.obj &
++lzo_str.obj &
++lzo_util.obj &
++asm\i386\obj\omf32\lzo1c_s1.obj &
++asm\i386\obj\omf32\lzo1f_f1.obj &
++asm\i386\obj\omf32\lzo1x_f1.obj &
++asm\i386\obj\omf32\lzo1x_s1.obj &
++asm\i386\obj\omf32\lzo1y_f1.obj &
++asm\i386\obj\omf32\lzo1y_s1.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/cygwin.bat b/ics-openvpn-stripped/main/lzo/B/win32/cygwin.bat
new file mode 100644
index 00000000..35baf058
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/cygwin.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // cygwin + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/cygwin.rsp b/ics-openvpn-stripped/main/lzo/B/win32/cygwin.rsp
new file mode 100644
index 00000000..d6b3da0b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/cygwin.rsp
@@ -0,0 +1,73 @@
+lzo1.o
+lzo1_99.o
+lzo1a.o
+lzo1a_99.o
+lzo1b_1.o
+lzo1b_2.o
+lzo1b_3.o
+lzo1b_4.o
+lzo1b_5.o
+lzo1b_6.o
+lzo1b_7.o
+lzo1b_8.o
+lzo1b_9.o
+lzo1b_99.o
+lzo1b_9x.o
+lzo1b_cc.o
+lzo1b_d1.o
+lzo1b_d2.o
+lzo1b_rr.o
+lzo1b_xx.o
+lzo1c_1.o
+lzo1c_2.o
+lzo1c_3.o
+lzo1c_4.o
+lzo1c_5.o
+lzo1c_6.o
+lzo1c_7.o
+lzo1c_8.o
+lzo1c_9.o
+lzo1c_99.o
+lzo1c_9x.o
+lzo1c_cc.o
+lzo1c_d1.o
+lzo1c_d2.o
+lzo1c_rr.o
+lzo1c_xx.o
+lzo1f_1.o
+lzo1f_9x.o
+lzo1f_d1.o
+lzo1f_d2.o
+lzo1x_1.o
+lzo1x_1k.o
+lzo1x_1l.o
+lzo1x_1o.o
+lzo1x_9x.o
+lzo1x_d1.o
+lzo1x_d2.o
+lzo1x_d3.o
+lzo1x_o.o
+lzo1y_1.o
+lzo1y_9x.o
+lzo1y_d1.o
+lzo1y_d2.o
+lzo1y_d3.o
+lzo1y_o.o
+lzo1z_9x.o
+lzo1z_d1.o
+lzo1z_d2.o
+lzo1z_d3.o
+lzo2a_9x.o
+lzo2a_d1.o
+lzo2a_d2.o
+lzo_crc.o
+lzo_init.o
+lzo_ptr.o
+lzo_str.o
+lzo_util.o
+lzo1c_s1.o
+lzo1f_f1.o
+lzo1x_f1.o
+lzo1x_s1.o
+lzo1y_f1.o
+lzo1y_s1.o
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/dm.bat b/ics-openvpn-stripped/main/lzo/B/win32/dm.bat
new file mode 100644
index 00000000..3e152a6a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/dm.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Digital Mars C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=dmc -mn
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/ic.bat b/ics-openvpn-stripped/main/lzo/B/win32/ic.bat
new file mode 100644
index 00000000..9fe53821
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/ic.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Intel C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 -Qvec-report0 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/lccwin32.bat b/ics-openvpn-stripped/main/lzo/B/win32/lccwin32.bat
new file mode 100644
index 00000000..1b5265f0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/lccwin32.bat
@@ -0,0 +1,59 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // lcc-win32
+@echo //
+@echo // NOTE: some lcc-win32 versions are buggy, so we disable optimizations
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=lcc
+set CF=-O -A %CFI% -Iinclude\lzo %CFASM%
+set CF=-A %CFI% -Iinclude\lzo %CFASM%
+set LF=%BLIB% winmm.lib
+
+for %%f in (src\*.c) do %CC% %CF% -c %%f
+@if errorlevel 1 goto error
+lcclib /out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% -c %CF% examples\dict.c
+@if errorlevel 1 goto error
+lc dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\lzopack.c
+@if errorlevel 1 goto error
+lc lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\precomp.c
+@if errorlevel 1 goto error
+lc precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\precomp2.c
+@if errorlevel 1 goto error
+lc precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% -c %CF% examples\simple.c
+@if errorlevel 1 goto error
+lc simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% -c %CF% lzotest\lzotest.c
+@if errorlevel 1 goto error
+lc lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% -c %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+lc testmini.obj minilzo.obj
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/mingw.bat b/ics-openvpn-stripped/main/lzo/B/win32/mingw.bat
new file mode 100644
index 00000000..3bba6e07
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/mingw.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // MinGW + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/mwerks.bat b/ics-openvpn-stripped/main/lzo/B/win32/mwerks.bat
new file mode 100644
index 00000000..3cc27428
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/mwerks.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Metrowerks CodeWarrior C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=mwcc -gccinc
+set CF=-opt full %CFI% %CFASM%
+set LF=%BLIB% -lwinmm.lib
+
+%CC% -w on %CF% -w nounusedexpr -c @b\src.rsp
+@if errorlevel 1 goto error
+mwld -library -o %BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/pellesc.bat b/ics-openvpn-stripped/main/lzo/B/win32/pellesc.bat
new file mode 100644
index 00000000..5e92ab94
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/pellesc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Pelles C
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cc -Ze -Go
+set CF=-O2 -W2 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+polib -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/pgi.bat b/ics-openvpn-stripped/main/lzo/B/win32/pgi.bat
new file mode 100644
index 00000000..079a7142
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/pgi.bat
@@ -0,0 +1,43 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Portland Group PGI C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=pgcc
+set CF=-fast %CFI% %CFASM%
+set LF=%BLIB% -lwinmm
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o asm/i386/obj/win32/*.obj
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/pw32.bat b/ics-openvpn-stripped/main/lzo/B/win32/pw32.bat
new file mode 100644
index 00000000..a156242f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/pw32.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // PW32 + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=lib%BNAME%.a
+set CC=gcc
+set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM%
+set LF=%BLIB% -lwinmm -s
+
+%CC% %CF% -c src/*.c
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% *.o
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/rsxnt.bat b/ics-openvpn-stripped/main/lzo/B/win32/rsxnt.bat
new file mode 100644
index 00000000..1b9d87e6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/rsxnt.bat
@@ -0,0 +1,45 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // rsxnt + gcc
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set BLIB=%BNAME%.a
+set CC=gcc -Zwin32 -Zsys -mprobe
+set CF=@b/dos32/dj2.opt %CFI% %CFASM%
+set LF=%BLIB% -s
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S
+@if errorlevel 1 goto error
+ar rcs %BLIB% @b/win32/cygwin.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -o dict.exe examples/dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o lzopack.exe examples/lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp.exe examples/precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o precomp2.exe examples/precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -o simple.exe examples/simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/sc.bat b/ics-openvpn-stripped/main/lzo/B/win32/sc.bat
new file mode 100644
index 00000000..38edbc7f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/sc.bat
@@ -0,0 +1,56 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Symantec C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=sc -mn
+set CF=-o -w- %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+lib %BLIB% /b /c /n /noi @b\win32\bc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% -c examples\dict.c
+@if errorlevel 1 goto error
+%CC% dict.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\lzopack.c
+@if errorlevel 1 goto error
+%CC% lzopack.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp.c
+@if errorlevel 1 goto error
+%CC% precomp.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\precomp2.c
+@if errorlevel 1 goto error
+%CC% precomp2.obj %LF%
+@if errorlevel 1 goto error
+%CC% %CF% -c examples\simple.c
+@if errorlevel 1 goto error
+%CC% simple.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -c lzotest\lzotest.c
+@if errorlevel 1 goto error
+%CC% lzotest.obj %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+%CC% testmini.obj minilzo.obj
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/vc.bat b/ics-openvpn-stripped/main/lzo/B/win32/vc.bat
new file mode 100644
index 00000000..db278b58
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/vc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win32\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/vc.rsp b/ics-openvpn-stripped/main/lzo/B/win32/vc.rsp
new file mode 100644
index 00000000..1cf09fe2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/vc.rsp
@@ -0,0 +1,73 @@
+.\lzo1.obj
+.\lzo1_99.obj
+.\lzo1a.obj
+.\lzo1a_99.obj
+.\lzo1b_1.obj
+.\lzo1b_2.obj
+.\lzo1b_3.obj
+.\lzo1b_4.obj
+.\lzo1b_5.obj
+.\lzo1b_6.obj
+.\lzo1b_7.obj
+.\lzo1b_8.obj
+.\lzo1b_9.obj
+.\lzo1b_99.obj
+.\lzo1b_9x.obj
+.\lzo1b_cc.obj
+.\lzo1b_d1.obj
+.\lzo1b_d2.obj
+.\lzo1b_rr.obj
+.\lzo1b_xx.obj
+.\lzo1c_1.obj
+.\lzo1c_2.obj
+.\lzo1c_3.obj
+.\lzo1c_4.obj
+.\lzo1c_5.obj
+.\lzo1c_6.obj
+.\lzo1c_7.obj
+.\lzo1c_8.obj
+.\lzo1c_9.obj
+.\lzo1c_99.obj
+.\lzo1c_9x.obj
+.\lzo1c_cc.obj
+.\lzo1c_d1.obj
+.\lzo1c_d2.obj
+.\lzo1c_rr.obj
+.\lzo1c_xx.obj
+.\lzo1f_1.obj
+.\lzo1f_9x.obj
+.\lzo1f_d1.obj
+.\lzo1f_d2.obj
+.\lzo1x_1.obj
+.\lzo1x_1k.obj
+.\lzo1x_1l.obj
+.\lzo1x_1o.obj
+.\lzo1x_9x.obj
+.\lzo1x_d1.obj
+.\lzo1x_d2.obj
+.\lzo1x_d3.obj
+.\lzo1x_o.obj
+.\lzo1y_1.obj
+.\lzo1y_9x.obj
+.\lzo1y_d1.obj
+.\lzo1y_d2.obj
+.\lzo1y_d3.obj
+.\lzo1y_o.obj
+.\lzo1z_9x.obj
+.\lzo1z_d1.obj
+.\lzo1z_d2.obj
+.\lzo1z_d3.obj
+.\lzo2a_9x.obj
+.\lzo2a_d1.obj
+.\lzo2a_d2.obj
+.\lzo_crc.obj
+.\lzo_init.obj
+.\lzo_ptr.obj
+.\lzo_str.obj
+.\lzo_util.obj
+.\asm\i386\obj\win32\lzo1c_s1.obj
+.\asm\i386\obj\win32\lzo1f_f1.obj
+.\asm\i386\obj\win32\lzo1x_f1.obj
+.\asm\i386\obj\win32\lzo1x_s1.obj
+.\asm\i386\obj\win32\lzo1y_f1.obj
+.\asm\i386\obj\win32\lzo1y_s1.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.bat b/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.bat
new file mode 100644
index 00000000..c6ba0863
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Microsoft Visual C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win32\vc.rsp /link /map /def:b\win32\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.def b/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.def
new file mode 100644
index 00000000..a5abd35a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/vc_dll.def
@@ -0,0 +1,7 @@
+EXPORTS
+ _lzo1c_decompress_asm=lzo1c_decompress_asm
+ _lzo1f_decompress_asm_fast=lzo1f_decompress_asm_fast
+ _lzo1x_decompress_asm=lzo1x_decompress_asm
+ _lzo1x_decompress_asm_fast=lzo1x_decompress_asm_fast
+ _lzo1y_decompress_asm=lzo1y_decompress_asm
+ _lzo1y_decompress_asm_fast=lzo1y_decompress_asm_fast
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/wc.bat b/ics-openvpn-stripped/main/lzo/B/win32/wc.bat
new file mode 100644
index 00000000..ab9f5f44
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/wc.bat
@@ -0,0 +1,39 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 32-bit
+@echo // Watcom C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=wcl386 -zq -mf -5r -bt#nt -l#nt
+set CF=-ox -zc %CFI% %CFASM%
+set LF=%BLIB%
+
+%CC% %CF% -c src\*.c
+@if errorlevel 1 goto error
+wlib -q -b -n -t %BLIB% @b\win32\wc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win32/wc.rsp b/ics-openvpn-stripped/main/lzo/B/win32/wc.rsp
new file mode 100644
index 00000000..12760d98
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win32/wc.rsp
@@ -0,0 +1,73 @@
++'lzo1.obj'
++'lzo1_99.obj'
++'lzo1a.obj'
++'lzo1a_99.obj'
++'lzo1b_1.obj'
++'lzo1b_2.obj'
++'lzo1b_3.obj'
++'lzo1b_4.obj'
++'lzo1b_5.obj'
++'lzo1b_6.obj'
++'lzo1b_7.obj'
++'lzo1b_8.obj'
++'lzo1b_9.obj'
++'lzo1b_99.obj'
++'lzo1b_9x.obj'
++'lzo1b_cc.obj'
++'lzo1b_d1.obj'
++'lzo1b_d2.obj'
++'lzo1b_rr.obj'
++'lzo1b_xx.obj'
++'lzo1c_1.obj'
++'lzo1c_2.obj'
++'lzo1c_3.obj'
++'lzo1c_4.obj'
++'lzo1c_5.obj'
++'lzo1c_6.obj'
++'lzo1c_7.obj'
++'lzo1c_8.obj'
++'lzo1c_9.obj'
++'lzo1c_99.obj'
++'lzo1c_9x.obj'
++'lzo1c_cc.obj'
++'lzo1c_d1.obj'
++'lzo1c_d2.obj'
++'lzo1c_rr.obj'
++'lzo1c_xx.obj'
++'lzo1f_1.obj'
++'lzo1f_9x.obj'
++'lzo1f_d1.obj'
++'lzo1f_d2.obj'
++'lzo1x_1.obj'
++'lzo1x_1k.obj'
++'lzo1x_1l.obj'
++'lzo1x_1o.obj'
++'lzo1x_9x.obj'
++'lzo1x_d1.obj'
++'lzo1x_d2.obj'
++'lzo1x_d3.obj'
++'lzo1x_o.obj'
++'lzo1y_1.obj'
++'lzo1y_9x.obj'
++'lzo1y_d1.obj'
++'lzo1y_d2.obj'
++'lzo1y_d3.obj'
++'lzo1y_o.obj'
++'lzo1z_9x.obj'
++'lzo1z_d1.obj'
++'lzo1z_d2.obj'
++'lzo1z_d3.obj'
++'lzo2a_9x.obj'
++'lzo2a_d1.obj'
++'lzo2a_d2.obj'
++'lzo_crc.obj'
++'lzo_init.obj'
++'lzo_ptr.obj'
++'lzo_str.obj'
++'lzo_util.obj'
++'asm\i386\obj\omf32\lzo1c_s1.obj'
++'asm\i386\obj\omf32\lzo1f_f1.obj'
++'asm\i386\obj\omf32\lzo1x_f1.obj'
++'asm\i386\obj\omf32\lzo1x_s1.obj'
++'asm\i386\obj\omf32\lzo1y_f1.obj'
++'asm\i386\obj\omf32\lzo1y_s1.obj'
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/ic.bat b/ics-openvpn-stripped/main/lzo/B/win64/ic.bat
new file mode 100644
index 00000000..cdc9762f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/ic.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (Itanium)
+@echo // Intel C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 -Qvec-report0 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/ic_dll.bat b/ics-openvpn-stripped/main/lzo/B/win64/ic_dll.bat
new file mode 100644
index 00000000..ec806084
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/ic_dll.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (Itanium)
+@echo // Intel C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=icl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/vc.bat b/ics-openvpn-stripped/main/lzo/B/win64/vc.bat
new file mode 100644
index 00000000..03694ca9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/vc.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (AMD64 or Itanium)
+@echo // Microsoft Visual C/C++
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -c @b\src.rsp
+@if errorlevel 1 goto error
+link -lib -nologo -out:%BLIB% @b\win64\vc.rsp
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/vc.rsp b/ics-openvpn-stripped/main/lzo/B/win64/vc.rsp
new file mode 100644
index 00000000..da684c94
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/vc.rsp
@@ -0,0 +1,67 @@
+.\lzo1.obj
+.\lzo1_99.obj
+.\lzo1a.obj
+.\lzo1a_99.obj
+.\lzo1b_1.obj
+.\lzo1b_2.obj
+.\lzo1b_3.obj
+.\lzo1b_4.obj
+.\lzo1b_5.obj
+.\lzo1b_6.obj
+.\lzo1b_7.obj
+.\lzo1b_8.obj
+.\lzo1b_9.obj
+.\lzo1b_99.obj
+.\lzo1b_9x.obj
+.\lzo1b_cc.obj
+.\lzo1b_d1.obj
+.\lzo1b_d2.obj
+.\lzo1b_rr.obj
+.\lzo1b_xx.obj
+.\lzo1c_1.obj
+.\lzo1c_2.obj
+.\lzo1c_3.obj
+.\lzo1c_4.obj
+.\lzo1c_5.obj
+.\lzo1c_6.obj
+.\lzo1c_7.obj
+.\lzo1c_8.obj
+.\lzo1c_9.obj
+.\lzo1c_99.obj
+.\lzo1c_9x.obj
+.\lzo1c_cc.obj
+.\lzo1c_d1.obj
+.\lzo1c_d2.obj
+.\lzo1c_rr.obj
+.\lzo1c_xx.obj
+.\lzo1f_1.obj
+.\lzo1f_9x.obj
+.\lzo1f_d1.obj
+.\lzo1f_d2.obj
+.\lzo1x_1.obj
+.\lzo1x_1k.obj
+.\lzo1x_1l.obj
+.\lzo1x_1o.obj
+.\lzo1x_9x.obj
+.\lzo1x_d1.obj
+.\lzo1x_d2.obj
+.\lzo1x_d3.obj
+.\lzo1x_o.obj
+.\lzo1y_1.obj
+.\lzo1y_9x.obj
+.\lzo1y_d1.obj
+.\lzo1y_d2.obj
+.\lzo1y_d3.obj
+.\lzo1y_o.obj
+.\lzo1z_9x.obj
+.\lzo1z_d1.obj
+.\lzo1z_d2.obj
+.\lzo1z_d3.obj
+.\lzo2a_9x.obj
+.\lzo2a_d1.obj
+.\lzo2a_d2.obj
+.\lzo_crc.obj
+.\lzo_init.obj
+.\lzo_ptr.obj
+.\lzo_str.obj
+.\lzo_util.obj
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.bat b/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.bat
new file mode 100644
index 00000000..f21361a7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.bat
@@ -0,0 +1,42 @@
+@echo // Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+@echo //
+@echo // Windows 64-bit (AMD64 or Itanium)
+@echo // Microsoft Visual C/C++ (DLL)
+@echo //
+@call b\prepare.bat
+@if "%BECHO%"=="n" echo off
+
+
+set CC=cl -nologo -MT
+set CF=-O2 -GF -W3 %CFI%
+set LF=%BLIB%
+
+%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp
+@if errorlevel 1 goto error
+%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def
+@if errorlevel 1 goto error
+
+%CC% %CF% examples\dict.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\lzopack.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\precomp2.c %LF%
+@if errorlevel 1 goto error
+%CC% %CF% examples\simple.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% lzotest\lzotest.c %LF%
+@if errorlevel 1 goto error
+
+%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c
+@if errorlevel 1 goto error
+
+
+@call b\done.bat
+@goto end
+:error
+@echo ERROR during build!
+:end
+@call b\unset.bat
diff --git a/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.def b/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.def
new file mode 100644
index 00000000..aabd2247
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/B/win64/vc_dll.def
@@ -0,0 +1 @@
+EXPORTS
diff --git a/ics-openvpn-stripped/main/lzo/BUGS b/ics-openvpn-stripped/main/lzo/BUGS
new file mode 100644
index 00000000..aed77990
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/BUGS
@@ -0,0 +1,21 @@
+============================================================================
+LZO -- a real-time data compression library
+============================================================================
+
+LZO is free of any known bugs.
+
+Nevertheless LZO has been reported to break the optimizer of some
+compilers including gcc 2.7.2 (AIX, IRIX) and Watcom C 9.5.
+
+So if 'lzotest' reports data decompression errors you should recompile
+everything without optimizations and see if that fixes the problem.
+I'd like to hear about optimizer problems and possible workarounds.
+
+
+Known compiler problems:
+------------------------
+ some versions of gcc use '-O2 -fno-strength-reduce'
+ some versions of gcc use '-O2 -fno-schedule-insns -fno-schedule-insns2'
+ Watcom C 9.5 compile with '-oneax' instead of '-oneatx'
+
+
diff --git a/ics-openvpn-stripped/main/lzo/COPYING b/ics-openvpn-stripped/main/lzo/COPYING
new file mode 100644
index 00000000..d159169d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/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/ics-openvpn-stripped/main/lzo/ChangeLog b/ics-openvpn-stripped/main/lzo/ChangeLog
new file mode 100644
index 00000000..755db71e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/ChangeLog
@@ -0,0 +1,3 @@
+Sorry, no detailed ChangeLog available yet.
+
+Please see the file NEWS for a list of user visible changes.
diff --git a/ics-openvpn-stripped/main/lzo/INSTALL b/ics-openvpn-stripped/main/lzo/INSTALL
new file mode 100644
index 00000000..886ee504
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/INSTALL
@@ -0,0 +1,265 @@
+Introduction
+============
+
+ This installation guide is for POSIX (Autoconf) systems.
+ For Win32, Win64, DOS and OS/2 please read the file B/00README.TXT.
+
+ Quick start
+ -----------
+ ./configure
+ make
+ make check
+ make test (run a full test)
+ make install (when logged in as root)
+
+ Exotic machines
+ ---------------
+ Instead of using Autoconf you may want to adapt the simple build
+ script in B/generic/build.sh.
+
+ Shared libraries
+ ----------------
+ LZO uses Libtool so that shared libraries are supported on many
+ systems. If want to build shared libraries type you have to type
+ `./configure --enable-shared' - building shared libraries is not
+ enabled by default.
+
+ Assembler versions
+ ------------------
+ On Intel i386 systems, the assembler versions of the decompressors are
+ built and used by default. You can use `./configure --disable-asm' if
+ for some reason they cause compilation problems on your system.
+
+
+
+[ The standard Autoconf installation instructions follow below. ]
+
+
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ 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').
+
+ 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.)
+
+ 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.
+
+ 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'.
+
+The simplest way to compile this package is:
+
+ 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.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 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.
+
+Compilers and Options
+=====================
+
+ 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
+
+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' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' 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 `--target=TYPE' option 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
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`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/ics-openvpn-stripped/main/lzo/Makefile.am b/ics-openvpn-stripped/main/lzo/Makefile.am
new file mode 100644
index 00000000..246dc603
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/Makefile.am
@@ -0,0 +1,196 @@
+## Process this file with automake to create Makefile.in
+#
+# Makefile --- Makefile for building the LZO library
+#
+# This file is part of the LZO data compression library.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+# All Rights Reserved.
+#
+
+EXTRA_DIST =
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
+LDADD = src/liblzo2.la
+lib_LTLIBRARIES =
+noinst_PROGRAMS =
+
+
+##/***********************************************************************
+##// TOPDIR
+##************************************************************************/
+
+doc_DATA = AUTHORS COPYING NEWS THANKS doc/LZO.FAQ doc/LZO.TXT doc/LZOAPI.TXT
+EXTRA_DIST += BUGS autoconf/shtool
+
+# hooks for Automake targets
+dist-hook: dist-hook-1
+dist-hook-1:
+ cp -pR $(srcdir)/B/ $(srcdir)/asm/ $(srcdir)/doc/ $(srcdir)/util/ "$(distdir)/"
+ -rm -f $(distdir)/util/*.dat
+
+check-local: all-am
+ ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING
+ @echo
+ @echo "All checks passed."
+ @echo
+
+# special targets
+basic-test: all
+ ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING
+ ./tests/align
+ ./tests/chksum
+ ./examples/simple
+ ./minilzo/testmini
+
+test: all
+ ./lzotest/lzotest -mavail -n10 -q $(top_srcdir)/COPYING
+ $(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir)
+ ./tests/align
+ ./tests/chksum
+ ./examples/simple
+ ./minilzo/testmini
+ @echo
+ @echo "All tests passed. Now you are ready to install LZO."
+ @echo
+
+
+##/***********************************************************************
+##// SUBDIR include/lzo
+##************************************************************************/
+
+pkginclude_HEADERS = \
+ include/lzo/lzo1.h include/lzo/lzo1a.h include/lzo/lzo1b.h \
+ include/lzo/lzo1c.h include/lzo/lzo1f.h include/lzo/lzo1x.h \
+ include/lzo/lzo1y.h include/lzo/lzo1z.h include/lzo/lzo2a.h \
+ include/lzo/lzo_asm.h include/lzo/lzoconf.h include/lzo/lzodefs.h \
+ include/lzo/lzoutil.h
+
+
+##/***********************************************************************
+##// SUBDIR src
+##************************************************************************/
+
+lib_LTLIBRARIES += src/liblzo2.la
+
+src_liblzo2_la_LDFLAGS = -version-info 2:0:0 -no-undefined $(AM_LDFLAGS)
+
+src_liblzo2_la_SOURCES = \
+ src/lzo1.c src/lzo1_99.c src/lzo1a.c src/lzo1a_99.c src/lzo1b_1.c \
+ src/lzo1b_2.c src/lzo1b_3.c src/lzo1b_4.c src/lzo1b_5.c src/lzo1b_6.c \
+ src/lzo1b_7.c src/lzo1b_8.c src/lzo1b_9.c src/lzo1b_99.c src/lzo1b_9x.c \
+ src/lzo1b_cc.c src/lzo1b_d1.c src/lzo1b_d2.c src/lzo1b_rr.c \
+ src/lzo1b_xx.c src/lzo1c_1.c src/lzo1c_2.c src/lzo1c_3.c src/lzo1c_4.c \
+ src/lzo1c_5.c src/lzo1c_6.c src/lzo1c_7.c src/lzo1c_8.c src/lzo1c_9.c \
+ src/lzo1c_99.c src/lzo1c_9x.c src/lzo1c_cc.c src/lzo1c_d1.c \
+ src/lzo1c_d2.c src/lzo1c_rr.c src/lzo1c_xx.c src/lzo1f_1.c \
+ src/lzo1f_9x.c src/lzo1f_d1.c src/lzo1f_d2.c src/lzo1x_1.c \
+ src/lzo1x_1k.c src/lzo1x_1l.c src/lzo1x_1o.c src/lzo1x_9x.c \
+ src/lzo1x_d1.c src/lzo1x_d2.c src/lzo1x_d3.c src/lzo1x_o.c \
+ src/lzo1y_1.c src/lzo1y_9x.c src/lzo1y_d1.c src/lzo1y_d2.c \
+ src/lzo1y_d3.c src/lzo1y_o.c src/lzo1z_9x.c src/lzo1z_d1.c \
+ src/lzo1z_d2.c src/lzo1z_d3.c src/lzo2a_9x.c src/lzo2a_d1.c \
+ src/lzo2a_d2.c src/lzo_crc.c src/lzo_init.c src/lzo_ptr.c \
+ src/lzo_str.c src/lzo_util.c
+
+EXTRA_DIST += \
+ src/compr1b.h src/compr1c.h src/config1.h src/config1a.h src/config1b.h \
+ src/config1c.h src/config1f.h src/config1x.h src/config1y.h \
+ src/config1z.h src/config2a.h src/lzo1_cm.ch src/lzo1_d.ch \
+ src/lzo1a_cm.ch src/lzo1a_cr.ch src/lzo1a_de.h src/lzo1b_c.ch \
+ src/lzo1b_cc.h src/lzo1b_cm.ch src/lzo1b_cr.ch src/lzo1b_d.ch \
+ src/lzo1b_de.h src/lzo1b_r.ch src/lzo1b_sm.ch src/lzo1b_tm.ch \
+ src/lzo1c_cc.h src/lzo1f_d.ch src/lzo1x_c.ch src/lzo1x_d.ch \
+ src/lzo1x_oo.ch src/lzo2a_d.ch src/lzo_conf.h src/lzo_dict.h \
+ src/lzo_dll.ch src/lzo_func.h src/lzo_mchw.ch src/lzo_ptr.h \
+ src/lzo_supp.h src/lzo_swd.ch src/stats1a.h src/stats1b.h src/stats1c.h
+
+LZO_ASM_SOURCES_i386_src_gas = \
+ asm/i386/src_gas/lzo1c_s1.S \
+ asm/i386/src_gas/lzo1f_f1.S \
+ asm/i386/src_gas/lzo1x_f1.S \
+ asm/i386/src_gas/lzo1x_s1.S \
+ asm/i386/src_gas/lzo1y_f1.S \
+ asm/i386/src_gas/lzo1y_s1.S
+LZO_ASM_OBJECTS_i386_obj_elf32 = \
+ asm/i386/obj/elf32/lzo1c_s1.o \
+ asm/i386/obj/elf32/lzo1f_f1.o \
+ asm/i386/obj/elf32/lzo1x_f1.o \
+ asm/i386/obj/elf32/lzo1x_s1.o \
+ asm/i386/obj/elf32/lzo1y_f1.o \
+ asm/i386/obj/elf32/lzo1y_s1.o
+if LZO_USE_ASM_i386_src_gas
+LZO_ASM_SOURCES = $(LZO_ASM_SOURCES_i386_src_gas)
+endif
+if LZO_USE_ASM_i386_obj_elf32
+LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_i386_obj_elf32)
+endif
+nodist_src_liblzo2_la_SOURCES = $(LZO_ASM_SOURCES)
+src_liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS)
+
+
+##/***********************************************************************
+##// SUBDIR examples
+##************************************************************************/
+
+noinst_PROGRAMS += examples/dict
+noinst_PROGRAMS += examples/lzopack
+noinst_PROGRAMS += examples/overlap
+noinst_PROGRAMS += examples/precomp
+noinst_PROGRAMS += examples/precomp2
+noinst_PROGRAMS += examples/simple
+
+examples_dict_SOURCES = examples/dict.c
+examples_lzopack_SOURCES = examples/lzopack.c
+examples_overlap_SOURCES = examples/overlap.c
+examples_precomp_SOURCES = examples/precomp.c
+examples_precomp2_SOURCES = examples/precomp2.c
+examples_simple_SOURCES = examples/simple.c
+
+EXTRA_DIST += examples/portab.h examples/portab_a.h
+
+
+##/***********************************************************************
+##// SUBDIR lzotest
+##************************************************************************/
+
+noinst_PROGRAMS += lzotest/lzotest
+
+lzotest_lzotest_SOURCES = lzotest/lzotest.c
+
+EXTRA_DIST += lzotest/asm.h lzotest/db.h lzotest/wrap.h lzotest/wrapmisc.h
+
+
+##/***********************************************************************
+##// SUBDIR tests
+##************************************************************************/
+
+noinst_PROGRAMS += tests/align
+noinst_PROGRAMS += tests/chksum
+noinst_PROGRAMS += tests/promote
+noinst_PROGRAMS += tests/sizes
+
+tests_align_SOURCES = tests/align.c
+tests_chksum_SOURCES = tests/chksum.c
+tests_promote_SOURCES = tests/promote.c
+tests_sizes_SOURCES = tests/sizes.c
+
+tests_promote_LDADD =
+tests_sizes_LDADD =
+
+
+##/***********************************************************************
+##// SUBDIR minilzo
+##************************************************************************/
+
+noinst_PROGRAMS += minilzo/testmini
+
+minilzo_testmini_SOURCES = minilzo/testmini.c minilzo/minilzo.c
+minilzo_testmini_SHORTNAME = t
+minilzo_testmini_CPPFLAGS = $(AM_CPPFLAGS)
+minilzo_testmini_CPPFLAGS += -DMINILZO_HAVE_CONFIG_H=1
+minilzo_testmini_CPPFLAGS += -I$(top_srcdir)/include/lzo
+minilzo_testmini_LDADD =
+
+EXTRA_DIST += minilzo/Makefile.minilzo minilzo/README.LZO minilzo/minilzo.h
+
+@MAINT@-include $(top_srcdir)/Makefile.maint
diff --git a/ics-openvpn-stripped/main/lzo/Makefile.in b/ics-openvpn-stripped/main/lzo/Makefile.in
new file mode 100644
index 00000000..6b77e152
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/Makefile.in
@@ -0,0 +1,1484 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 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@
+
+#
+# Makefile --- Makefile for building the LZO library
+#
+# This file is part of the LZO data compression library.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+# All Rights Reserved.
+#
+
+
+
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+noinst_PROGRAMS = examples/dict$(EXEEXT) examples/lzopack$(EXEEXT) \
+ examples/overlap$(EXEEXT) examples/precomp$(EXEEXT) \
+ examples/precomp2$(EXEEXT) examples/simple$(EXEEXT) \
+ lzotest/lzotest$(EXEEXT) tests/align$(EXEEXT) \
+ tests/chksum$(EXEEXT) tests/promote$(EXEEXT) \
+ tests/sizes$(EXEEXT) minilzo/testmini$(EXEEXT)
+subdir = .
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.hin $(top_srcdir)/autoconf/mkinstalldirs \
+ $(top_srcdir)/autoconf/depcomp $(pkginclude_HEADERS) COPYING \
+ THANKS autoconf/compile autoconf/config.guess \
+ autoconf/config.rpath autoconf/config.sub autoconf/depcomp \
+ autoconf/install-sh autoconf/mdate-sh autoconf/missing \
+ autoconf/mkinstalldirs autoconf/py-compile autoconf/ylwrap \
+ autoconf/ltmain.sh $(top_srcdir)/autoconf/compile \
+ $(top_srcdir)/autoconf/config.guess \
+ $(top_srcdir)/autoconf/config.sub \
+ $(top_srcdir)/autoconf/install-sh \
+ $(top_srcdir)/autoconf/ltmain.sh \
+ $(top_srcdir)/autoconf/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/autoconf/local.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
+ "$(DESTDIR)$(pkgincludedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+src_liblzo2_la_DEPENDENCIES = $(LZO_ASM_OBJECTS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_src_liblzo2_la_OBJECTS = src/lzo1.lo src/lzo1_99.lo src/lzo1a.lo \
+ src/lzo1a_99.lo src/lzo1b_1.lo src/lzo1b_2.lo src/lzo1b_3.lo \
+ src/lzo1b_4.lo src/lzo1b_5.lo src/lzo1b_6.lo src/lzo1b_7.lo \
+ src/lzo1b_8.lo src/lzo1b_9.lo src/lzo1b_99.lo src/lzo1b_9x.lo \
+ src/lzo1b_cc.lo src/lzo1b_d1.lo src/lzo1b_d2.lo \
+ src/lzo1b_rr.lo src/lzo1b_xx.lo src/lzo1c_1.lo src/lzo1c_2.lo \
+ src/lzo1c_3.lo src/lzo1c_4.lo src/lzo1c_5.lo src/lzo1c_6.lo \
+ src/lzo1c_7.lo src/lzo1c_8.lo src/lzo1c_9.lo src/lzo1c_99.lo \
+ src/lzo1c_9x.lo src/lzo1c_cc.lo src/lzo1c_d1.lo \
+ src/lzo1c_d2.lo src/lzo1c_rr.lo src/lzo1c_xx.lo src/lzo1f_1.lo \
+ src/lzo1f_9x.lo src/lzo1f_d1.lo src/lzo1f_d2.lo src/lzo1x_1.lo \
+ src/lzo1x_1k.lo src/lzo1x_1l.lo src/lzo1x_1o.lo \
+ src/lzo1x_9x.lo src/lzo1x_d1.lo src/lzo1x_d2.lo \
+ src/lzo1x_d3.lo src/lzo1x_o.lo src/lzo1y_1.lo src/lzo1y_9x.lo \
+ src/lzo1y_d1.lo src/lzo1y_d2.lo src/lzo1y_d3.lo src/lzo1y_o.lo \
+ src/lzo1z_9x.lo src/lzo1z_d1.lo src/lzo1z_d2.lo \
+ src/lzo1z_d3.lo src/lzo2a_9x.lo src/lzo2a_d1.lo \
+ src/lzo2a_d2.lo src/lzo_crc.lo src/lzo_init.lo src/lzo_ptr.lo \
+ src/lzo_str.lo src/lzo_util.lo
+am__objects_1 = asm/i386/src_gas/lzo1c_s1.lo \
+ asm/i386/src_gas/lzo1f_f1.lo asm/i386/src_gas/lzo1x_f1.lo \
+ asm/i386/src_gas/lzo1x_s1.lo asm/i386/src_gas/lzo1y_f1.lo \
+ asm/i386/src_gas/lzo1y_s1.lo
+@LZO_USE_ASM_i386_src_gas_TRUE@am__objects_2 = $(am__objects_1)
+nodist_src_liblzo2_la_OBJECTS = $(am__objects_2)
+src_liblzo2_la_OBJECTS = $(am_src_liblzo2_la_OBJECTS) \
+ $(nodist_src_liblzo2_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+src_liblzo2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(src_liblzo2_la_LDFLAGS) $(LDFLAGS) -o \
+ $@
+PROGRAMS = $(noinst_PROGRAMS)
+am_examples_dict_OBJECTS = examples/dict.$(OBJEXT)
+examples_dict_OBJECTS = $(am_examples_dict_OBJECTS)
+examples_dict_LDADD = $(LDADD)
+examples_dict_DEPENDENCIES = src/liblzo2.la
+am_examples_lzopack_OBJECTS = examples/lzopack.$(OBJEXT)
+examples_lzopack_OBJECTS = $(am_examples_lzopack_OBJECTS)
+examples_lzopack_LDADD = $(LDADD)
+examples_lzopack_DEPENDENCIES = src/liblzo2.la
+am_examples_overlap_OBJECTS = examples/overlap.$(OBJEXT)
+examples_overlap_OBJECTS = $(am_examples_overlap_OBJECTS)
+examples_overlap_LDADD = $(LDADD)
+examples_overlap_DEPENDENCIES = src/liblzo2.la
+am_examples_precomp_OBJECTS = examples/precomp.$(OBJEXT)
+examples_precomp_OBJECTS = $(am_examples_precomp_OBJECTS)
+examples_precomp_LDADD = $(LDADD)
+examples_precomp_DEPENDENCIES = src/liblzo2.la
+am_examples_precomp2_OBJECTS = examples/precomp2.$(OBJEXT)
+examples_precomp2_OBJECTS = $(am_examples_precomp2_OBJECTS)
+examples_precomp2_LDADD = $(LDADD)
+examples_precomp2_DEPENDENCIES = src/liblzo2.la
+am_examples_simple_OBJECTS = examples/simple.$(OBJEXT)
+examples_simple_OBJECTS = $(am_examples_simple_OBJECTS)
+examples_simple_LDADD = $(LDADD)
+examples_simple_DEPENDENCIES = src/liblzo2.la
+am_lzotest_lzotest_OBJECTS = lzotest/lzotest.$(OBJEXT)
+lzotest_lzotest_OBJECTS = $(am_lzotest_lzotest_OBJECTS)
+lzotest_lzotest_LDADD = $(LDADD)
+lzotest_lzotest_DEPENDENCIES = src/liblzo2.la
+am_minilzo_testmini_OBJECTS = minilzo/t-testmini.$(OBJEXT) \
+ minilzo/t-minilzo.$(OBJEXT)
+minilzo_testmini_OBJECTS = $(am_minilzo_testmini_OBJECTS)
+minilzo_testmini_DEPENDENCIES =
+am_tests_align_OBJECTS = tests/align.$(OBJEXT)
+tests_align_OBJECTS = $(am_tests_align_OBJECTS)
+tests_align_LDADD = $(LDADD)
+tests_align_DEPENDENCIES = src/liblzo2.la
+am_tests_chksum_OBJECTS = tests/chksum.$(OBJEXT)
+tests_chksum_OBJECTS = $(am_tests_chksum_OBJECTS)
+tests_chksum_LDADD = $(LDADD)
+tests_chksum_DEPENDENCIES = src/liblzo2.la
+am_tests_promote_OBJECTS = tests/promote.$(OBJEXT)
+tests_promote_OBJECTS = $(am_tests_promote_OBJECTS)
+tests_promote_DEPENDENCIES =
+am_tests_sizes_OBJECTS = tests/sizes.$(OBJEXT)
+tests_sizes_OBJECTS = $(am_tests_sizes_OBJECTS)
+tests_sizes_DEPENDENCIES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CCASFLAGS) $(CCASFLAGS)
+AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
+am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
+am__v_CPPAS_0 = @echo " CPPAS " $@;
+am__v_CPPAS_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(src_liblzo2_la_SOURCES) $(nodist_src_liblzo2_la_SOURCES) \
+ $(examples_dict_SOURCES) $(examples_lzopack_SOURCES) \
+ $(examples_overlap_SOURCES) $(examples_precomp_SOURCES) \
+ $(examples_precomp2_SOURCES) $(examples_simple_SOURCES) \
+ $(lzotest_lzotest_SOURCES) $(minilzo_testmini_SOURCES) \
+ $(tests_align_SOURCES) $(tests_chksum_SOURCES) \
+ $(tests_promote_SOURCES) $(tests_sizes_SOURCES)
+DIST_SOURCES = $(src_liblzo2_la_SOURCES) $(examples_dict_SOURCES) \
+ $(examples_lzopack_SOURCES) $(examples_overlap_SOURCES) \
+ $(examples_precomp_SOURCES) $(examples_precomp2_SOURCES) \
+ $(examples_simple_SOURCES) $(lzotest_lzotest_SOURCES) \
+ $(minilzo_testmini_SOURCES) $(tests_align_SOURCES) \
+ $(tests_chksum_SOURCES) $(tests_promote_SOURCES) \
+ $(tests_sizes_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+DATA = $(doc_DATA)
+HEADERS = $(pkginclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.hin
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = BUGS autoconf/shtool src/compr1b.h src/compr1c.h \
+ src/config1.h src/config1a.h src/config1b.h src/config1c.h \
+ src/config1f.h src/config1x.h src/config1y.h src/config1z.h \
+ src/config2a.h src/lzo1_cm.ch src/lzo1_d.ch src/lzo1a_cm.ch \
+ src/lzo1a_cr.ch src/lzo1a_de.h src/lzo1b_c.ch src/lzo1b_cc.h \
+ src/lzo1b_cm.ch src/lzo1b_cr.ch src/lzo1b_d.ch src/lzo1b_de.h \
+ src/lzo1b_r.ch src/lzo1b_sm.ch src/lzo1b_tm.ch src/lzo1c_cc.h \
+ src/lzo1f_d.ch src/lzo1x_c.ch src/lzo1x_d.ch src/lzo1x_oo.ch \
+ src/lzo2a_d.ch src/lzo_conf.h src/lzo_dict.h src/lzo_dll.ch \
+ src/lzo_func.h src/lzo_mchw.ch src/lzo_ptr.h src/lzo_supp.h \
+ src/lzo_swd.ch src/stats1a.h src/stats1b.h src/stats1c.h \
+ examples/portab.h examples/portab_a.h lzotest/asm.h \
+ lzotest/db.h lzotest/wrap.h lzotest/wrapmisc.h \
+ minilzo/Makefile.minilzo minilzo/README.LZO minilzo/minilzo.h
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
+LDADD = src/liblzo2.la
+lib_LTLIBRARIES = src/liblzo2.la
+doc_DATA = AUTHORS COPYING NEWS THANKS doc/LZO.FAQ doc/LZO.TXT doc/LZOAPI.TXT
+pkginclude_HEADERS = \
+ include/lzo/lzo1.h include/lzo/lzo1a.h include/lzo/lzo1b.h \
+ include/lzo/lzo1c.h include/lzo/lzo1f.h include/lzo/lzo1x.h \
+ include/lzo/lzo1y.h include/lzo/lzo1z.h include/lzo/lzo2a.h \
+ include/lzo/lzo_asm.h include/lzo/lzoconf.h include/lzo/lzodefs.h \
+ include/lzo/lzoutil.h
+
+src_liblzo2_la_LDFLAGS = -version-info 2:0:0 -no-undefined $(AM_LDFLAGS)
+src_liblzo2_la_SOURCES = \
+ src/lzo1.c src/lzo1_99.c src/lzo1a.c src/lzo1a_99.c src/lzo1b_1.c \
+ src/lzo1b_2.c src/lzo1b_3.c src/lzo1b_4.c src/lzo1b_5.c src/lzo1b_6.c \
+ src/lzo1b_7.c src/lzo1b_8.c src/lzo1b_9.c src/lzo1b_99.c src/lzo1b_9x.c \
+ src/lzo1b_cc.c src/lzo1b_d1.c src/lzo1b_d2.c src/lzo1b_rr.c \
+ src/lzo1b_xx.c src/lzo1c_1.c src/lzo1c_2.c src/lzo1c_3.c src/lzo1c_4.c \
+ src/lzo1c_5.c src/lzo1c_6.c src/lzo1c_7.c src/lzo1c_8.c src/lzo1c_9.c \
+ src/lzo1c_99.c src/lzo1c_9x.c src/lzo1c_cc.c src/lzo1c_d1.c \
+ src/lzo1c_d2.c src/lzo1c_rr.c src/lzo1c_xx.c src/lzo1f_1.c \
+ src/lzo1f_9x.c src/lzo1f_d1.c src/lzo1f_d2.c src/lzo1x_1.c \
+ src/lzo1x_1k.c src/lzo1x_1l.c src/lzo1x_1o.c src/lzo1x_9x.c \
+ src/lzo1x_d1.c src/lzo1x_d2.c src/lzo1x_d3.c src/lzo1x_o.c \
+ src/lzo1y_1.c src/lzo1y_9x.c src/lzo1y_d1.c src/lzo1y_d2.c \
+ src/lzo1y_d3.c src/lzo1y_o.c src/lzo1z_9x.c src/lzo1z_d1.c \
+ src/lzo1z_d2.c src/lzo1z_d3.c src/lzo2a_9x.c src/lzo2a_d1.c \
+ src/lzo2a_d2.c src/lzo_crc.c src/lzo_init.c src/lzo_ptr.c \
+ src/lzo_str.c src/lzo_util.c
+
+LZO_ASM_SOURCES_i386_src_gas = \
+ asm/i386/src_gas/lzo1c_s1.S \
+ asm/i386/src_gas/lzo1f_f1.S \
+ asm/i386/src_gas/lzo1x_f1.S \
+ asm/i386/src_gas/lzo1x_s1.S \
+ asm/i386/src_gas/lzo1y_f1.S \
+ asm/i386/src_gas/lzo1y_s1.S
+
+LZO_ASM_OBJECTS_i386_obj_elf32 = \
+ asm/i386/obj/elf32/lzo1c_s1.o \
+ asm/i386/obj/elf32/lzo1f_f1.o \
+ asm/i386/obj/elf32/lzo1x_f1.o \
+ asm/i386/obj/elf32/lzo1x_s1.o \
+ asm/i386/obj/elf32/lzo1y_f1.o \
+ asm/i386/obj/elf32/lzo1y_s1.o
+
+@LZO_USE_ASM_i386_src_gas_TRUE@LZO_ASM_SOURCES = $(LZO_ASM_SOURCES_i386_src_gas)
+@LZO_USE_ASM_i386_obj_elf32_TRUE@LZO_ASM_OBJECTS = $(LZO_ASM_OBJECTS_i386_obj_elf32)
+nodist_src_liblzo2_la_SOURCES = $(LZO_ASM_SOURCES)
+src_liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS)
+examples_dict_SOURCES = examples/dict.c
+examples_lzopack_SOURCES = examples/lzopack.c
+examples_overlap_SOURCES = examples/overlap.c
+examples_precomp_SOURCES = examples/precomp.c
+examples_precomp2_SOURCES = examples/precomp2.c
+examples_simple_SOURCES = examples/simple.c
+lzotest_lzotest_SOURCES = lzotest/lzotest.c
+tests_align_SOURCES = tests/align.c
+tests_chksum_SOURCES = tests/chksum.c
+tests_promote_SOURCES = tests/promote.c
+tests_sizes_SOURCES = tests/sizes.c
+tests_promote_LDADD =
+tests_sizes_LDADD =
+minilzo_testmini_SOURCES = minilzo/testmini.c minilzo/minilzo.c
+minilzo_testmini_SHORTNAME = t
+minilzo_testmini_CPPFLAGS = $(AM_CPPFLAGS) -DMINILZO_HAVE_CONFIG_H=1 \
+ -I$(top_srcdir)/include/lzo
+minilzo_testmini_LDADD =
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.hin: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+src/$(am__dirstamp):
+ @$(MKDIR_P) src
+ @: > src/$(am__dirstamp)
+src/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/$(DEPDIR)
+ @: > src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1_99.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1a.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1a_99.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_3.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_4.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_5.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_6.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_7.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_8.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_9.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_99.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_cc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_rr.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1b_xx.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_3.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_4.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_5.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_6.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_7.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_8.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_9.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_99.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_cc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_rr.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1c_xx.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1f_1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1f_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1f_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1f_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_1k.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_1l.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_1o.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_d3.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1x_o.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_d3.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1y_o.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1z_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1z_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1z_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo1z_d3.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo2a_9x.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo2a_d1.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo2a_d2.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo_crc.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo_init.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo_ptr.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo_str.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/lzo_util.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/$(am__dirstamp):
+ @$(MKDIR_P) asm/i386/src_gas
+ @: > asm/i386/src_gas/$(am__dirstamp)
+asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) asm/i386/src_gas/$(DEPDIR)
+ @: > asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1c_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1f_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1x_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1x_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1y_f1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+asm/i386/src_gas/lzo1y_s1.lo: asm/i386/src_gas/$(am__dirstamp) \
+ asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+
+src/liblzo2.la: $(src_liblzo2_la_OBJECTS) $(src_liblzo2_la_DEPENDENCIES) $(EXTRA_src_liblzo2_la_DEPENDENCIES) src/$(am__dirstamp)
+ $(AM_V_CCLD)$(src_liblzo2_la_LINK) -rpath $(libdir) $(src_liblzo2_la_OBJECTS) $(src_liblzo2_la_LIBADD) $(LIBS)
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+examples/$(am__dirstamp):
+ @$(MKDIR_P) examples
+ @: > examples/$(am__dirstamp)
+examples/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) examples/$(DEPDIR)
+ @: > examples/$(DEPDIR)/$(am__dirstamp)
+examples/dict.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/dict$(EXEEXT): $(examples_dict_OBJECTS) $(examples_dict_DEPENDENCIES) $(EXTRA_examples_dict_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/dict$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_dict_OBJECTS) $(examples_dict_LDADD) $(LIBS)
+examples/lzopack.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/lzopack$(EXEEXT): $(examples_lzopack_OBJECTS) $(examples_lzopack_DEPENDENCIES) $(EXTRA_examples_lzopack_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/lzopack$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_lzopack_OBJECTS) $(examples_lzopack_LDADD) $(LIBS)
+examples/overlap.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/overlap$(EXEEXT): $(examples_overlap_OBJECTS) $(examples_overlap_DEPENDENCIES) $(EXTRA_examples_overlap_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/overlap$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_overlap_OBJECTS) $(examples_overlap_LDADD) $(LIBS)
+examples/precomp.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/precomp$(EXEEXT): $(examples_precomp_OBJECTS) $(examples_precomp_DEPENDENCIES) $(EXTRA_examples_precomp_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/precomp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_precomp_OBJECTS) $(examples_precomp_LDADD) $(LIBS)
+examples/precomp2.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/precomp2$(EXEEXT): $(examples_precomp2_OBJECTS) $(examples_precomp2_DEPENDENCIES) $(EXTRA_examples_precomp2_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/precomp2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_precomp2_OBJECTS) $(examples_precomp2_LDADD) $(LIBS)
+examples/simple.$(OBJEXT): examples/$(am__dirstamp) \
+ examples/$(DEPDIR)/$(am__dirstamp)
+
+examples/simple$(EXEEXT): $(examples_simple_OBJECTS) $(examples_simple_DEPENDENCIES) $(EXTRA_examples_simple_DEPENDENCIES) examples/$(am__dirstamp)
+ @rm -f examples/simple$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(examples_simple_OBJECTS) $(examples_simple_LDADD) $(LIBS)
+lzotest/$(am__dirstamp):
+ @$(MKDIR_P) lzotest
+ @: > lzotest/$(am__dirstamp)
+lzotest/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) lzotest/$(DEPDIR)
+ @: > lzotest/$(DEPDIR)/$(am__dirstamp)
+lzotest/lzotest.$(OBJEXT): lzotest/$(am__dirstamp) \
+ lzotest/$(DEPDIR)/$(am__dirstamp)
+
+lzotest/lzotest$(EXEEXT): $(lzotest_lzotest_OBJECTS) $(lzotest_lzotest_DEPENDENCIES) $(EXTRA_lzotest_lzotest_DEPENDENCIES) lzotest/$(am__dirstamp)
+ @rm -f lzotest/lzotest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(lzotest_lzotest_OBJECTS) $(lzotest_lzotest_LDADD) $(LIBS)
+minilzo/$(am__dirstamp):
+ @$(MKDIR_P) minilzo
+ @: > minilzo/$(am__dirstamp)
+minilzo/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) minilzo/$(DEPDIR)
+ @: > minilzo/$(DEPDIR)/$(am__dirstamp)
+minilzo/t-testmini.$(OBJEXT): minilzo/$(am__dirstamp) \
+ minilzo/$(DEPDIR)/$(am__dirstamp)
+minilzo/t-minilzo.$(OBJEXT): minilzo/$(am__dirstamp) \
+ minilzo/$(DEPDIR)/$(am__dirstamp)
+
+minilzo/testmini$(EXEEXT): $(minilzo_testmini_OBJECTS) $(minilzo_testmini_DEPENDENCIES) $(EXTRA_minilzo_testmini_DEPENDENCIES) minilzo/$(am__dirstamp)
+ @rm -f minilzo/testmini$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(minilzo_testmini_OBJECTS) $(minilzo_testmini_LDADD) $(LIBS)
+tests/$(am__dirstamp):
+ @$(MKDIR_P) tests
+ @: > tests/$(am__dirstamp)
+tests/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tests/$(DEPDIR)
+ @: > tests/$(DEPDIR)/$(am__dirstamp)
+tests/align.$(OBJEXT): tests/$(am__dirstamp) \
+ tests/$(DEPDIR)/$(am__dirstamp)
+
+tests/align$(EXEEXT): $(tests_align_OBJECTS) $(tests_align_DEPENDENCIES) $(EXTRA_tests_align_DEPENDENCIES) tests/$(am__dirstamp)
+ @rm -f tests/align$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tests_align_OBJECTS) $(tests_align_LDADD) $(LIBS)
+tests/chksum.$(OBJEXT): tests/$(am__dirstamp) \
+ tests/$(DEPDIR)/$(am__dirstamp)
+
+tests/chksum$(EXEEXT): $(tests_chksum_OBJECTS) $(tests_chksum_DEPENDENCIES) $(EXTRA_tests_chksum_DEPENDENCIES) tests/$(am__dirstamp)
+ @rm -f tests/chksum$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tests_chksum_OBJECTS) $(tests_chksum_LDADD) $(LIBS)
+tests/promote.$(OBJEXT): tests/$(am__dirstamp) \
+ tests/$(DEPDIR)/$(am__dirstamp)
+
+tests/promote$(EXEEXT): $(tests_promote_OBJECTS) $(tests_promote_DEPENDENCIES) $(EXTRA_tests_promote_DEPENDENCIES) tests/$(am__dirstamp)
+ @rm -f tests/promote$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tests_promote_OBJECTS) $(tests_promote_LDADD) $(LIBS)
+tests/sizes.$(OBJEXT): tests/$(am__dirstamp) \
+ tests/$(DEPDIR)/$(am__dirstamp)
+
+tests/sizes$(EXEEXT): $(tests_sizes_OBJECTS) $(tests_sizes_DEPENDENCIES) $(EXTRA_tests_sizes_DEPENDENCIES) tests/$(am__dirstamp)
+ @rm -f tests/sizes$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tests_sizes_OBJECTS) $(tests_sizes_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f asm/i386/src_gas/*.$(OBJEXT)
+ -rm -f asm/i386/src_gas/*.lo
+ -rm -f examples/*.$(OBJEXT)
+ -rm -f lzotest/*.$(OBJEXT)
+ -rm -f minilzo/*.$(OBJEXT)
+ -rm -f src/*.$(OBJEXT)
+ -rm -f src/*.lo
+ -rm -f tests/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1c_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1f_f1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_f1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1x_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_f1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@asm/i386/src_gas/$(DEPDIR)/lzo1y_s1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/dict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/lzopack.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/overlap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/precomp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/precomp2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/simple.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@lzotest/$(DEPDIR)/lzotest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@minilzo/$(DEPDIR)/t-minilzo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@minilzo/$(DEPDIR)/t-testmini.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1a.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1a_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_6.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_7.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_9.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_cc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_rr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1b_xx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_6.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_7.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_9.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_cc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_rr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1c_xx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1f_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1f_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1f_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1f_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_1k.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_1l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_1o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1x_o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1y_o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1z_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1z_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1z_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo1z_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo2a_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo2a_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo2a_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo_crc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo_ptr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo_str.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/lzo_util.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/align.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/chksum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/promote.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/sizes.Po@am__quote@
+
+.S.o:
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
+
+.S.obj:
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.S.lo:
+@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+minilzo/t-testmini.o: minilzo/testmini.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-testmini.o -MD -MP -MF minilzo/$(DEPDIR)/t-testmini.Tpo -c -o minilzo/t-testmini.o `test -f 'minilzo/testmini.c' || echo '$(srcdir)/'`minilzo/testmini.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-testmini.Tpo minilzo/$(DEPDIR)/t-testmini.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/testmini.c' object='minilzo/t-testmini.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.o `test -f 'minilzo/testmini.c' || echo '$(srcdir)/'`minilzo/testmini.c
+
+minilzo/t-testmini.obj: minilzo/testmini.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-testmini.obj -MD -MP -MF minilzo/$(DEPDIR)/t-testmini.Tpo -c -o minilzo/t-testmini.obj `if test -f 'minilzo/testmini.c'; then $(CYGPATH_W) 'minilzo/testmini.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/testmini.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-testmini.Tpo minilzo/$(DEPDIR)/t-testmini.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/testmini.c' object='minilzo/t-testmini.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-testmini.obj `if test -f 'minilzo/testmini.c'; then $(CYGPATH_W) 'minilzo/testmini.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/testmini.c'; fi`
+
+minilzo/t-minilzo.o: minilzo/minilzo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-minilzo.o -MD -MP -MF minilzo/$(DEPDIR)/t-minilzo.Tpo -c -o minilzo/t-minilzo.o `test -f 'minilzo/minilzo.c' || echo '$(srcdir)/'`minilzo/minilzo.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-minilzo.Tpo minilzo/$(DEPDIR)/t-minilzo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/minilzo.c' object='minilzo/t-minilzo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.o `test -f 'minilzo/minilzo.c' || echo '$(srcdir)/'`minilzo/minilzo.c
+
+minilzo/t-minilzo.obj: minilzo/minilzo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo/t-minilzo.obj -MD -MP -MF minilzo/$(DEPDIR)/t-minilzo.Tpo -c -o minilzo/t-minilzo.obj `if test -f 'minilzo/minilzo.c'; then $(CYGPATH_W) 'minilzo/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/minilzo.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) minilzo/$(DEPDIR)/t-minilzo.Tpo minilzo/$(DEPDIR)/t-minilzo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo/minilzo.c' object='minilzo/t-minilzo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(minilzo_testmini_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo/t-minilzo.obj `if test -f 'minilzo/minilzo.c'; then $(CYGPATH_W) 'minilzo/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo/minilzo.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+ -rm -rf asm/i386/src_gas/.libs asm/i386/src_gas/_libs
+ -rm -rf examples/.libs examples/_libs
+ -rm -rf lzotest/.libs lzotest/_libs
+ -rm -rf minilzo/.libs minilzo/_libs
+ -rm -rf src/.libs src/_libs
+ -rm -rf tests/.libs tests/_libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-docDATA: $(doc_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+ done
+
+uninstall-docDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+install-pkgincludeHEADERS: $(pkginclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
+ done
+
+uninstall-pkgincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+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 \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -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 {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
+ && $(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 \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_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'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { 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
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
+ config.h
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" "$(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:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f asm/i386/src_gas/$(DEPDIR)/$(am__dirstamp)
+ -rm -f asm/i386/src_gas/$(am__dirstamp)
+ -rm -f examples/$(DEPDIR)/$(am__dirstamp)
+ -rm -f examples/$(am__dirstamp)
+ -rm -f lzotest/$(DEPDIR)/$(am__dirstamp)
+ -rm -f lzotest/$(am__dirstamp)
+ -rm -f minilzo/$(DEPDIR)/$(am__dirstamp)
+ -rm -f minilzo/$(am__dirstamp)
+ -rm -f src/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/$(am__dirstamp)
+ -rm -f tests/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tests/$(am__dirstamp)
+
+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 \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf asm/i386/src_gas/$(DEPDIR) examples/$(DEPDIR) lzotest/$(DEPDIR) minilzo/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-docDATA install-pkgincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf asm/i386/src_gas/$(DEPDIR) examples/$(DEPDIR) lzotest/$(DEPDIR) minilzo/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR)
+ -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-docDATA uninstall-libLTLIBRARIES \
+ uninstall-pkgincludeHEADERS
+
+.MAKE: all check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \
+ check-local clean clean-cscope clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS cscope \
+ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
+ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-docDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-pkgincludeHEADERS install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-docDATA uninstall-libLTLIBRARIES \
+ uninstall-pkgincludeHEADERS
+
+
+# hooks for Automake targets
+dist-hook: dist-hook-1
+dist-hook-1:
+ cp -pR $(srcdir)/B/ $(srcdir)/asm/ $(srcdir)/doc/ $(srcdir)/util/ "$(distdir)/"
+ -rm -f $(distdir)/util/*.dat
+
+check-local: all-am
+ ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING
+ @echo
+ @echo "All checks passed."
+ @echo
+
+# special targets
+basic-test: all
+ ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING
+ ./tests/align
+ ./tests/chksum
+ ./examples/simple
+ ./minilzo/testmini
+
+test: all
+ ./lzotest/lzotest -mavail -n10 -q $(top_srcdir)/COPYING
+ $(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir)
+ ./tests/align
+ ./tests/chksum
+ ./examples/simple
+ ./minilzo/testmini
+ @echo
+ @echo "All tests passed. Now you are ready to install LZO."
+ @echo
+
+@MAINT@-include $(top_srcdir)/Makefile.maint
+
+# 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/ics-openvpn-stripped/main/lzo/NEWS b/ics-openvpn-stripped/main/lzo/NEWS
new file mode 100644
index 00000000..103c4d87
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/NEWS
@@ -0,0 +1,279 @@
+============================================================================
+User visible changes for LZO -- a real-time data compression library
+============================================================================
+
+Changes in 2.07 (25 Jun 2014)
+ * Fixed a potential integer overflow condition in the "safe" decompressor
+ variants which could result in a possible buffer overrun when
+ processing maliciously crafted compressed input data.
+
+ As this issue only affects 32-bit systems and also can only happen if
+ you use uncommonly huge buffer sizes where you have to decompress more
+ than 16 MiB (2^24 bytes) compressed bytes within a single function call,
+ the practical implications are limited.
+
+ POTENTIAL SECURITY ISSUE.
+
+ * Removed support for ancient configurations like 16-bit "huge" pointers -
+ LZO now requires a flat 32-bit or 64-bit memory model.
+ * Assorted cleanups.
+
+Changes in 2.06 (12 Aug 2011)
+ * Some minor optimizations for big-endian architectures.
+ * Fixed overly strict malloc() misalignment check in examples.
+
+Changes in 2.05 (23 Apr 2011)
+ * Converted the configure system to non-recursive Automake.
+ * Applied some overdue speed optimizations for modern x86/x64 architectures
+ and current compilers like gcc 4.6 and MSVC 2010.
+
+Changes in 2.04 (31 Oct 2010)
+ * Fixed a gcc-4.5 aliasing issue in lzo_init().
+ * Updated the configure system.
+ * Assorted cleanups.
+
+Changes in 2.03 (30 Apr 2008)
+ * Updated the ELF assembler sources to mark the stack as non-executable.
+ * Fixed a HP-UX 11 build issue with Itanium in ILP32 mode.
+ * Updated the configure system.
+
+Changes in 2.02 (17 Oct 2005)
+ * Updated the build and Autoconf scripts to fix some reported
+ compilation problems.
+
+Changes in 2.01 (27 Jun 2005)
+ * Changed the configure system to install the LZO library under the
+ name "liblzo2" so that parallel installation with LZO v1 is possible.
+ * Improved auto-configuration in miniLZO for some embedded targets like
+ Blackfin and H8/300 processors.
+
+Changes in 2.00 (30 May 2005)
+
+ [Library interface changes]
+ * The 'lzo_uint' typedef has been changed to match 'size_t', which means
+ it now is 64 bits on most 64-bit architectures. 32-bit machines
+ are not affected by this change.
+ * The formula for maximum expansion of incompressible data has changed.
+ See doc/LZO.FAQ. This is needed for some upcoming speed improvements,
+ and also for compatibility with our commercial LZO Professional product.
+ * The progress indicator callback interface has been revamped.
+ * All public header files now get installed into a "lzo" subdirectory, so
+ your applications should use #include <lzo/lzoXXX.h>.
+ * A number of (internal) macros have been renamed. See LZO_CFG_COMPAT
+ in <lzo/lzoconf.h> if your code depends on these.
+
+ [Speed]
+ * Small overall speedup by exploiting features like branch prediction
+ hints and explicit inline control present in modern C/C++ compilers.
+ * Significant speedup for 64-bit architectures like AMD64.
+
+ [Portability]
+ * LZO now fully supports the LLP64 programming model.
+ * LZO now fully supports the ILP64 and SILP64 programming models which
+ are used on some supercomputing architectures.
+ * Full Win64 support for AMD64 (aka x64) and IA64 (Itanium).
+ * Full 16-bit support for ancient DOS 286 protected mode, OS/2 1.x
+ and Windows 3.x.
+ * The LZO library now compiles and works on completely freestanding or
+ embedded systems as long as you have <limits.h> and <stddef.h> header
+ files. See the B/generic/build_freestanding.sh build script.
+
+ [Misc]
+ * The i386 assembler versions of the decompressors are now automatically
+ built and installed. See also asm/i386/00README.TXT.
+ * Added include file <lzo/lzo_asm.h> that provides prototypes for all
+ assembler functions.
+ * Under MacOS X, the configure script now will use the '-no-cpp-precomp'
+ compiler option in order to work around bugs in some versions of
+ Apple's native "smart" preprocessor.
+ * Worked around a preprocessor bug that is present in all compilers which
+ are based on the lcc compiler kit.
+ * Added simple B/generic/build.sh build script family.
+ * Added lots of new build scripts for various DOS/Windows compilers.
+
+ [Upgrade instructions from LZO v1 to LZO v2]
+ * On 64-bit architectures, revisit all uses of lzo_uint.
+ * Adapt for the maximum expansion change of incompressible data.
+ * If you use the progress callback then adapt for the new interface.
+ * Use #include <lzo/lzoXXX.h> or adjust your include path.
+ * Check your code for use of deprecated macros. Add a
+ #define LZO_CFG_COMPAT if necessary.
+ * Other than that LZO v2 should be fully source-compatible with LZO v1.
+ Of course, the compressed data is fully compatible as well.
+ * Re-compile and re-link your application.
+ * Enjoy the improvements!
+
+----------------------------------------------------------------------------
+
+Changes in 1.08 (12 Jul 2002)
+ * Much better support for cross compiling.
+ * Straighten out ANSI-conforming compiler checks.
+ * Avoid harmless compiler warnings reported by -Wcast-align.
+ * Fixed some sign extension problems on rather exotic machines where
+ sizeof(size_t) < sizeof(ptrdiff_t) and sizeof(lzo_uint) == sizeof(size_t)
+ * Updated the configure system to use the latest Autoconf, Automake
+ and Libtool versions.
+
+Changes in 1.07 (18 Oct 2000)
+ * Default to '--disable-shared' (I'm getting tired of Libtool's
+ shared library build problems, this time AIX was the culprit).
+ * Avoid some harmless compiler warnings.
+
+Changes in 1.06 (29 Nov 1999)
+ * Updated the configure system to use Autoconf 2.13, Automake 1.4 and
+ Libtool 1.3.3. This should hopefully fix the shared-library build
+ problems that were reported on some machines.
+ * Enhanced example programs a little bit.
+
+Changes in 1.05 (14 Apr 1998)
+ * Just a one-line change in the configure script to workaround
+ a HPUX and IRIX build problem.
+
+Changes in 1.04 (15 Mar 1998)
+ * Worked around a bug in the cpp preprocessor under HPUX 10.20.
+ * Adapted for Automake 1.2f and Libtool 1.1.
+
+Changes in 1.03 (18 Jan 1998)
+ * minor compression ratio improvement
+ * extended example program to show how to do overlapping compression
+ * assembler changes, added support for the nasm assembler
+ * better support for cross compiling
+ * some cleanups
+
+Changes in 1.02 (07 Dec 1997)
+ * improved LZO1X-999 and LZO1Y-999 compression ratio a little bit again
+ * introduced compression levels for LZO1X-999 and LZO1Y-999
+ * added support for preset dictionaries
+ * implemented LZO1X-1(12): needs 16 KiB for compression
+ * new algorithm LZO1Z: this is another variant of LZO1X
+ * added example program: how to use preset dictionaries
+ * added example program: how to do in-place decompression
+ * added a little file-packer example program
+ * LZO now works cleanly under checkergcc
+ * strict 16-bit memory model is working (but not officially supported)
+ * shared libraries are supported on many platforms
+ * adapted for Automake 1.2d and Libtool 1.0h
+
+Changes in 1.01 (10 Aug 1997)
+ * improved LZO1X-999 and LZO1Y-999 compression ratio a little bit
+ * i386+gcc: significant speedup of the C version of the LZO1, LZO1A,
+ LZO1B and LZO1C decompressors
+ * added example programs that show how to generate pre-compressed data
+ * added Makefiles for DOS, Windows and OS/2 targets
+
+Changes in 1.00 (13 Jul 1997)
+ * added miniLZO - can be easily included in your project
+ * improved documentation, added LZO.FAQ
+ * added build scripts for many systems where Autoconf is not available:
+ Windows 3.1 (LIB+DLL), Windows 95/NT (LIB+DLL), DOS (16+32 bit), OS/2
+ * adapted for Automake 1.2 and Libtool 1.0
+
+Changes in 0.90 (27 Jun 1997): never released
+ * LZO now uses GNU Automake 1.0 - lots of configuration changes
+ * added LZO1X-1(11): this version needs only 8 KiB for compression
+ * implemented LZO1Y-1
+ * added i386 assembler decompressors for MASM/TASM/WASM
+ * the name of some assembler functions changed
+ * the numeric value of some error codes changed
+ * portability fixes
+
+Changes in 0.29 (04 May 1997)
+ * Linux ELF shared library support
+ * workaround for gcc 2.7.2 optimizer bug under AIX
+ * added lzo_crc32() checksum
+
+Changes in 0.28 (22 Feb 1997)
+ * new algorithm LZO1Y: LZO1Y-999 and LZO1Y decompressor
+ * added lzo1x_optimize() and lzo1y_optimize()
+ * minor speedup in assembler decompressors (i386+gcc)
+ * ltest.c rewritten
+
+Changes in 0.27 (19 Jan 1997)
+ * fixed a bug in LZO1B-999 and LZO1C-999 that could produce
+ invalid compressed data in very rare cases
+
+Changes in 0.26 (18 Jan 1997): never released
+ * implemented LZO1B-999
+ * renamed LZO1D to LZO2A (also updated all docs)
+ * some cleanups
+
+Changes in 0.25 (28 Dec 1996): never released
+ * some portability fixes (LZO now works on my old Atari ST :-)
+ * adapted for Autoconf 2.12
+
+Changes in 0.24 (30 Nov 1996): never released
+ * improved performance of LZO1X assembler decompressor on a Pentium (i386+gcc)
+
+Changes in 0.23 (23 Nov 1996)
+ * added LZO1C, LZO1F and LZO1X decompressors in assembler (i386+gcc)
+ * added corresponding LZO_PUBLIC to all LZO_EXTERN functions
+ * added support for Microsoft C 7.0 (16-bit DOS)
+ * introduced lzo_uint32. This could prove useful for a strict 16-bit
+ version that doesn't use 'huge' pointers.
+ * all algorithms use incremental hashing now
+ * some cleanups and portability fixes
+
+Changes in 0.22 (19 Sep 1996)
+ * LZO1X: minor decompressor speedup, added some checks in safe decompressor
+ * Autoconf: added detection of gcc strength-reduction bug
+ * Makefile changes
+
+Changes in 0.21 (08 Sep 1996)
+ * LZO now uses GNU Autoconf 2.10 - lots of configuration changes
+ * a few cosmetical changes
+
+Changes in 0.20 (11 Aug 1996)
+ * new algorithm LZO1X: LZO1X-1, LZO1X-999 and LZO1X decompressor
+ * significantly speeded up LZO1B, LZO1C and LZO1F decompressors
+ on CPUs which allow unaligned memory access (e.g. Intel i386)
+ * greatly speeded up LZO2A-999 compressor at the cost of some memory
+ * some cleanups, portability fixes and minor speedups
+
+Changes in 0.16 (22 Jul 1996)
+ * speeded up LZO1F decompressor a little bit
+ * improved LZO1F-999 compression ratio
+
+Changes in 0.15 (10 Jul 1996)
+ * new algorithm LZO1F: LZO1F-1, LZO1F-999 and LZO1F decompressor
+ * improved LZO2A-999 compression ratio
+ * removed LZO1E as it is dominated by LZO1F
+
+Changes in 0.14 (06 Jul 1996): never released
+ * experimental algorithms: LZO1E and LZO1F
+ * added LZO_EXTERN to all prototypes. Useful when building a DLL.
+ * improved LZO1C-999 and LZO2A-999 compression ratio a little bit
+ * fixed progress indicator callback (it was called only once)
+
+Changes in 0.13 (20 Jun 1996)
+ * some speed improvements in LZO1C-999 and LZO2A-999
+
+Changes in 0.12 (18 Jun 1996): never released
+ * added LZO1C-999, a slow but nearly optimal compressor
+ intended for generating pre-compressed data
+ * added tests for lookbehind-overrun in all safe decompressors
+ * source tree completely rearranged, some filenames changed
+ * extensions changed: a .ch file is a C source code that is included
+ for reasons of code sharing
+ * new algorithm LZO2A: LZO2A-999 and LZO2A decompressor. There is
+ no fast compressor yet.
+ * some cleanups
+
+Changes in 0.11 (29 May 1996)
+ * source tree rearranged
+ * LZO now compiles fine as a C++ library (interface still has C linkage)
+ * improved overall compression ratio a little bit
+ * LZO1B-99/LZO1C-99 now search for longer matches
+ * incremental hash is working, it's a little bit faster
+ * Makefile changed
+ * added lzo_uint and lzo_sizeof in some places
+ * split LZO1B compressor into even more include-files
+
+Changes in 0.10 (20 May 1996): first public release of the LZO library
+ * includes LZO1, LZO1A, LZO1B and LZO1C algorithms
+ (compression levels 1-9 and 99)
+
+14 Mar 1996:
+ * public release of the LZO1A algorithm
+
+04 Mar 1996:
+ * public release of the LZO1 algorithm
diff --git a/ics-openvpn-stripped/main/lzo/README b/ics-openvpn-stripped/main/lzo/README
new file mode 100644
index 00000000..9d1d3319
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/README
@@ -0,0 +1,32 @@
+============================================================================
+LZO -- a real-time data compression library
+============================================================================
+
+Please read the file doc/LZO.TXT for an introduction to LZO.
+See the file doc/LZO.FAQ for various tidbits of information.
+
+See the file NEWS for a list of major changes in the current release.
+
+See the file INSTALL for compilation and installation instructions.
+
+For a quick start how to use LZO look at examples/lzopack.c.
+
+
+Directory overview:
+-------------------
+ autoconf Autoconf configuration files (UNIX specific)
+ B various support files for DOS, Windows, OS/2, ...
+ doc documentation
+ examples example programs
+ include public header files
+ minilzo a lightweight subset for easy inclusion in your project
+ src library source
+ tests more or less exotic test programs
+ util some utility scripts
+
+
+Have fun,
+Markus
+
+http://www.oberhumer.com/opensource/lzo/
+
diff --git a/ics-openvpn-stripped/main/lzo/README.ANDROID b/ics-openvpn-stripped/main/lzo/README.ANDROID
new file mode 100644
index 00000000..6d463a52
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/README.ANDROID
@@ -0,0 +1,3 @@
+
+2009-09-09 Android port of liblzo needed by openvpn
+ fries@desert.lnp.org
diff --git a/ics-openvpn-stripped/main/lzo/THANKS b/ics-openvpn-stripped/main/lzo/THANKS
new file mode 100644
index 00000000..cf09bdf6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/THANKS
@@ -0,0 +1,14 @@
+I want to thank the following people for giving feedback, doing
+beta-testing or helping me some other way:
+
+Charles W. Sandmann <sandmann@clio.rice.edu>
+Frank Donahoe <fdonahoe@wilkes1.wilkes.edu>
+Holger Berger <Holger.Berger@rus.uni-stuttgart.de>
+Jean-loup Gailly <jloup@gzip.org>
+Laszlo Molnar <ml1050@freemail.c3.hu>
+Mark Adler <madler@alumni.caltech.edu>
+Paul D. Eccles <pde@sd.inri.com>
+Rodolphe Ortalo <ortalo@laas.fr>
+William Magro <wmagro@TC.Cornell.EDU>
+Wolfgang Lugmayr <W.Lugmayr@infosys.tuwien.ac.at>
+Natascha
diff --git a/ics-openvpn-stripped/main/lzo/aclocal.m4 b/ics-openvpn-stripped/main/lzo/aclocal.m4
new file mode 100644
index 00000000..b6ae565b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/aclocal.m4
@@ -0,0 +1,9803 @@
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 58 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from 'configure', and 'config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain=$ac_aux_dir/ltmain.sh
+])# _LT_PROG_LTMAIN
+
+
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the 'libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags='_LT_TAGS'dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# '#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $[#]
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try '$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try '$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options that 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) $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 set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ 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'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS=$save_LDFLAGS
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ m4_if([$1], [CXX],
+[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case $ECHO in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([$with_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ 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 what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test yes = "$lt_cv_prog_gnu_ld"; 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*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ 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*)
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ 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"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ 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 yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 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 yes = "$cross_compiling"; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes != "$enable_dlopen"; 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
+ ])
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ 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 no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+ # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP"; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ 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"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; 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 cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test yes = "$aix_use_runtimelinking"; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # 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
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ 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
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=.dll
+ need_lib_prefix=no
+ library_names_spec='$libname$shared_ext $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program that 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 that can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test no = "$withval" || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi])
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that 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
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | 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* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ 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 no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+ test DEF = "`$SED -n dnl
+ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
+ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
+ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
+ -e q dnl Only consider the first "real" line
+ $1`" dnl
+])# _LT_DLL_DEF_P
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM=-lm)
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; 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
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# 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"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$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"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+ [Transform the output of nm into a list of symbols to manually relocate])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+ [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test yes = "$GCC"; 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 ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test ia64 = "$host_cpu"; 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
+ ;;
+
+ 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'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny 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)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; 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 no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); 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 yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; 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 yes = "$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; 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 yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS=$save_LDFLAGS])
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ 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__`"; 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
+ _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'
+ 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 yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting $shlibpath_var if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC=$CC
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && 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 yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC=$lt_save_CC
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='$wl'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test ia64 = "$host_cpu"; 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 yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
+ fi
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; 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 yes = "$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd* | bitrig*)
+ 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__`"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require '-G' NOT '-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $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 $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)=$GXX
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case @S|@2 in
+ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $prev$p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)=$prev$p
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test no = "$pre_test_object_deps_done"; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)=$p
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)=$p
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test yes != "$solaris_use_stlport4"; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test yes != "$solaris_use_stlport4"; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test no = "$F77"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && 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 yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$G77
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test no = "$FC"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && 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 yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=$lt_simple_compile_test_code
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f "$lt_ac_sed" && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test 10 -lt "$lt_ac_count" && 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],
+[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_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
+
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004-2005, 2007-2009, 2011-2013 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 8 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option '$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# LT_INIT options.
+# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59, which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 4038 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2.418])
+m4_define([LT_PACKAGE_REVISION], [2.4.2.418])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software
+# Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.14'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.14.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Figure out how to run the assembler. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 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.
+
+
+# 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", "OBJC", "OBJCXX", "UPC", or "GJC".
+# 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
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# 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.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 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.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_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 is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/00README.TXT b/ics-openvpn-stripped/main/lzo/asm/i386/00README.TXT
new file mode 100644
index 00000000..81b01423
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/00README.TXT
@@ -0,0 +1,45 @@
+
+Directory overview:
+===================
+
+As writing portable assembler sources supporting different operating
+systems, compilers and assemblers has proven to be extremely painful,
+the assembler sources have been converted into a more portable 'db'
+format. Use these whenever possible.
+
+ src_gas sources converted for portable gcc/gas syntax
+ src_masm sources converted for portable masm/tasm/wasm syntax
+ src_nasm sources converted for portable nasm syntax
+
+ src assembler sources (you need the OpenSource nasm assembler)
+
+ obj pre-assembled object files
+
+Also look 'src_XXX/all/asm_all.asm' which contains all assembler
+functions conveniently arranged into a single file.
+
+
+Notes:
+======
+
+- The assembler sources are designed for a flat 32-bit memory model
+ running in protected mode - they should work with all i386
+ 32-bit compilers around.
+
+- All functions expect a 'cdecl' (C stack based) calling convention.
+ The function return value will be placed into 'eax'.
+ All other registers are preserved.
+
+- Prototypes for the assembler functions can be found in <lzo/lzo_asm.h>.
+
+- For reasons of speed all fast assembler decompressors (having '_fast'
+ in their name) can access (write to) up to 3 bytes past the end of
+ the decompressed (output) block. Data past the end of the compressed
+ (input) block is never accessed (read from).
+ [ technical note: because data is transferred in 32-bit units ]
+
+- Finally you should test if the assembler versions are actually faster
+ than the C version on your machine - some compilers can do a very good
+ optimization job, and they also can optimize the code for a specific
+ processor type.
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/enter.ash b/ics-openvpn-stripped/main/lzo/asm/i386/src/enter.ash
new file mode 100644
index 00000000..c121c573
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/enter.ash
@@ -0,0 +1,77 @@
+/* enter.ash -- LZO assembler stuff
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+ pushl %ebp
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ subl $12,%esp
+
+ cld
+
+ movl INP,%esi
+ movl OUTP,%edi
+#if defined(N_3_EBP)
+ movl $3,%ebp
+#endif
+#if defined(N_255_EBP)
+ movl $255,%ebp
+#endif
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
+#if defined(INIT_OVERRUN)
+ INIT_OVERRUN
+# undef INIT_OVERRUN
+#endif
+ leal -3(%esi),%eax /* 3 == length of EOF code */
+ addl INS,%eax
+ movl %eax,INEND
+#endif
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
+#if defined(INIT_OVERRUN)
+ INIT_OVERRUN
+# undef INIT_OVERRUN
+#endif
+ movl %edi,%eax
+ movl OUTS,%edx
+ addl (%edx),%eax
+ movl %eax,OUTEND
+#endif
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/leave.ash b/ics-openvpn-stripped/main/lzo/asm/i386/src/leave.ash
new file mode 100644
index 00000000..2aa02867
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/leave.ash
@@ -0,0 +1,102 @@
+/* leave.ash -- LZO assembler stuff
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* check uncompressed size */
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
+ cmpl OUTEND,%edi
+ ja .L_output_overrun
+#endif
+
+/* check compressed size */
+ movl INP,%edx
+ addl INS,%edx
+ cmpl %edx,%esi /* check compressed size */
+ ja .L_input_overrun
+ jb .L_input_not_consumed
+
+.L_leave:
+ subl OUTP,%edi /* write back the uncompressed size */
+ movl OUTS,%edx
+ movl %edi,(%edx)
+
+ negl %eax
+ addl $12,%esp
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %esi
+ popl %edi
+ popl %ebp
+#if 1
+ ret
+#else
+ jmp .L_end
+#endif
+
+
+.L_error:
+ movl $1,%eax /* LZO_E_ERROR */
+ jmp .L_leave
+
+.L_input_not_consumed:
+ movl $8,%eax /* LZO_E_INPUT_NOT_CONSUMED */
+ jmp .L_leave
+
+.L_input_overrun:
+ movl $4,%eax /* LZO_E_INPUT_OVERRUN */
+ jmp .L_leave
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
+.L_output_overrun:
+ movl $5,%eax /* LZO_E_OUTPUT_OVERRUN */
+ jmp .L_leave
+#endif
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
+.L_lookbehind_overrun:
+ movl $6,%eax /* LZO_E_LOOKBEHIND_OVERRUN */
+ jmp .L_leave
+#endif
+
+#if defined(LZO_DEBUG)
+.L_assert_fail:
+ movl $99,%eax
+ jmp .L_leave
+#endif
+
+.L_end:
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_d.ash b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_d.ash
new file mode 100644
index 00000000..4560452b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_d.ash
@@ -0,0 +1,172 @@
+/* lzo1c_d.ash -- assembler implementation of the LZO1C decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+ ALIGN3
+.L1:
+ xorl %eax,%eax
+ movb (%esi),%al
+ incl %esi
+ cmpb $32,%al
+ jnb .LMATCH
+
+ orb %al,%al
+ jz .L12
+ movl %eax,%ecx
+.LIT:
+ TEST_OP((%edi,%ecx),%ebx)
+ TEST_IP((%esi,%ecx),%ebx)
+ rep
+ movsb
+.LM1:
+ movb (%esi),%al
+ incl %esi
+
+ cmpb $32,%al
+ jb .LM2
+.LMATCH:
+ cmpb $64,%al
+ jb .LN3
+
+ movl %eax,%ecx
+ andb $31,%al
+ leal -1(%edi),%edx
+ shrl $5,%ecx
+ subl %eax,%edx
+ movb (%esi),%al
+ incl %esi
+
+ shll $5,%eax
+ subl %eax,%edx
+ incl %ecx
+ xchgl %esi,%edx
+ TEST_LOOKBEHIND(%esi)
+ TEST_OP((%edi,%ecx),%ebx)
+ rep
+ movsb
+ movl %edx,%esi
+ jmp .L1
+
+ ALIGN3
+.L12:
+ LODSB
+ leal 32(%eax),%ecx
+ cmpb $248,%al
+ jb .LIT
+
+ movl $280,%ecx
+ subb $248,%al
+ jz .L11
+ xchgl %eax,%ecx
+ xorb %al,%al
+ shll %cl,%eax
+ xchgl %eax,%ecx
+.L11:
+ TEST_OP((%edi,%ecx),%ebx)
+ TEST_IP((%esi,%ecx),%ebx)
+ rep
+ movsb
+ jmp .L1
+
+ ALIGN3
+.LM2:
+ leal -1(%edi),%edx
+ subl %eax,%edx
+ LODSB
+ shll $5,%eax
+ subl %eax,%edx
+ xchgl %esi,%edx
+ TEST_LOOKBEHIND(%esi)
+ TEST_OP(4(%edi),%ebx)
+ movsb
+ movsb
+ movsb
+ movl %edx,%esi
+ movsb
+ xorl %eax,%eax
+ jmp .LM1
+.LN3:
+ andb $31,%al
+ movl %eax,%ecx
+ jnz .LN6
+ movb $31,%cl
+.LN4:
+ LODSB
+ orb %al,%al
+ jnz .LN5
+ addl N_255,%ecx
+ jmp .LN4
+
+ ALIGN3
+.LN5:
+ addl %eax,%ecx
+.LN6:
+ movb (%esi),%al
+ incl %esi
+
+ movl %eax,%ebx
+ andb $63,%al
+ movl %edi,%edx
+ subl %eax,%edx
+
+ movb (%esi),%al
+ incl %esi
+
+ shll $6,%eax
+ subl %eax,%edx
+ cmpl %edi,%edx
+ jz .LEOF
+
+ xchgl %edx,%esi
+ leal 3(%ecx),%ecx
+ TEST_LOOKBEHIND(%esi)
+ TEST_OP((%edi,%ecx),%eax)
+ rep
+ movsb
+
+ movl %edx,%esi
+ xorl %eax,%eax
+ shrl $6,%ebx
+ movl %ebx,%ecx
+ jnz .LIT
+ jmp .L1
+
+.LEOF:
+/**** xorl %eax,%eax eax=0 from above */
+
+ cmpl $1,%ecx /* ecx must be 1 */
+ setnz %al
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s1.S
new file mode 100644
index 00000000..d1cdd628
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s1.S
@@ -0,0 +1,49 @@
+/* lzo1c_s1.S -- LZO1C decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1c_decompress_asm)
+
+#include "enter.ash"
+#include "lzo1c_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1c_decompress_asm)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s2.S
new file mode 100644
index 00000000..f874002e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1c_s2.S
@@ -0,0 +1,68 @@
+/* lzo1c_s2.S -- LZO1C decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1c_decompress_asm_safe)
+
+#include "enter.ash"
+#include "lzo1c_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1c_decompress_asm_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_d.ash b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_d.ash
new file mode 100644
index 00000000..50248d8b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_d.ash
@@ -0,0 +1,164 @@
+/* lzo1f_d.ash -- assembler implementation of the LZO1F decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+ ALIGN3
+.L0:
+ xorl %eax,%eax
+ movb (%esi),%al
+ incl %esi
+ cmpb $31,%al
+ ja .LM2
+
+ orb %al,%al
+ movl %eax,%ecx
+ jnz .L2
+1:
+ LODSB
+ orb %al,%al
+ jnz 2f
+ addl N_255,%ecx
+ jmp 1b
+2:
+ lea 31(%eax,%ecx),%ecx
+.L2:
+ TEST_OP((%edi,%ecx),%ebx)
+ TEST_IP((%esi,%ecx),%ebx)
+ movb %cl,%al
+ shrl $2,%ecx
+ rep
+ movsl
+ andb $3,%al
+ jz 1f
+ movl (%esi),%ebx
+ addl %eax,%esi
+ movl %ebx,(%edi)
+ addl %eax,%edi
+1:
+ movb (%esi),%al
+ incl %esi
+.LM1:
+ cmpb $31,%al
+ jbe .LM21
+
+.LM2:
+ cmpb $223,%al
+ ja .LM3
+
+ movl %eax,%ecx
+ shrl $2,%eax
+ lea -1(%edi),%edx
+ andb $7,%al
+ shrl $5,%ecx
+ movl %eax,%ebx
+
+ movb (%esi),%al
+ leal (%ebx,%eax,8),%eax
+ incl %esi
+.LM5:
+ subl %eax,%edx
+ addl $2,%ecx
+ xchgl %edx,%esi
+ TEST_LOOKBEHIND(%esi)
+ TEST_OP((%edi,%ecx),%ebx)
+ cmpl $6,%ecx
+ jb 1f
+ cmpl $4,%eax
+ jb 1f
+ movb %cl,%al
+ shrl $2,%ecx
+ rep
+ movsl
+ andb $3,%al
+ movb %al,%cl
+1:
+ rep
+ movsb
+ movl %edx,%esi
+.LN1:
+ movb -2(%esi),%cl
+ andl $3,%ecx
+ jz .L0
+ movl (%esi),%eax
+ addl %ecx,%esi
+ movl %eax,(%edi)
+ addl %ecx,%edi
+ xorl %eax,%eax
+ movb (%esi),%al
+ incl %esi
+ jmp .LM1
+.LM21:
+ TEST_OP(3(%edi),%edx)
+ shrl $2,%eax
+ leal -0x801(%edi),%edx
+ movl %eax,%ecx
+ movb (%esi),%al
+ incl %esi
+ leal (%ecx,%eax,8),%eax
+ subl %eax,%edx
+ TEST_LOOKBEHIND(%edx)
+ movl (%edx),%eax
+ movl %eax,(%edi)
+ addl $3,%edi
+ jmp .LN1
+1:
+ LODSB
+ orb %al,%al
+ jnz 2f
+ addl N_255,%ecx
+ jmp 1b
+2:
+ lea 31(%eax,%ecx),%ecx
+ jmp .LM4
+
+ ALIGN3
+.LM3:
+ andb $31,%al
+ movl %eax,%ecx
+ jz 1b
+.LM4:
+ movl %edi,%edx
+ movw (%esi),%ax
+ addl $2,%esi
+ shrl $2,%eax
+ jnz .LM5
+
+.LEOF:
+/**** xorl %eax,%eax eax=0 from above */
+
+ cmpl $1,%ecx /* ecx must be 1 */
+ setnz %al
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f1.S
new file mode 100644
index 00000000..5566cc57
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f1.S
@@ -0,0 +1,49 @@
+/* lzo1f_f1.S -- fast LZO1F decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1f_decompress_asm_fast)
+
+#include "enter.ash"
+#include "lzo1f_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1f_decompress_asm_fast)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f2.S
new file mode 100644
index 00000000..904a5f31
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1f_f2.S
@@ -0,0 +1,68 @@
+/* lzo1f_f2.S -- fast LZO1F decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1f_decompress_asm_fast_safe)
+
+#include "enter.ash"
+#include "lzo1f_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1f_decompress_asm_fast_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_d.ash b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_d.ash
new file mode 100644
index 00000000..a05f15dc
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_d.ash
@@ -0,0 +1,389 @@
+/* lzo1x_d.ash -- assembler implementation of the LZO1X decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#if !defined(LZO1X) && !defined(LZO1Y)
+# define LZO1X
+#endif
+
+#if defined(LZO_FAST)
+# define NN 3
+#else
+# define NN 0
+#endif
+
+
+/***********************************************************************
+// init
+************************************************************************/
+
+ xorl %eax,%eax
+ xorl %ebx,%ebx /* high bits 9-32 stay 0 */
+ lodsb
+ cmpb $17,%al
+ jbe .L01
+ subb $17-NN,%al
+#if defined(LZO_FAST)
+ jmp .LFLR
+#else
+ cmpb $4,%al
+ jae .LFLR
+#if 1
+ TEST_OP((%edi,%eax),%edx)
+ TEST_IP((%esi,%eax),%edx)
+ movl %eax,%ecx
+ jmp .LFLR2
+#else
+ jmp .LFLR3
+#endif
+#endif
+
+
+/***********************************************************************
+// literal run
+************************************************************************/
+
+0: addl N_255,%eax
+ TEST_IP(18(%esi,%eax),%edx) /* minimum */
+1: movb (%esi),%bl
+ incl %esi
+ orb %bl,%bl
+ jz 0b
+ leal 18+NN(%eax,%ebx),%eax
+ jmp 3f
+
+
+ ALIGN3
+.L00:
+#ifdef LZO_DEBUG
+ andl $0xffffff00,%eax ; jnz .L_assert_fail
+ andl $0xffffff00,%ebx ; jnz .L_assert_fail
+ xorl %eax,%eax ; xorl %ebx,%ebx
+ xorl %ecx,%ecx ; xorl %edx,%edx
+#endif
+ TEST_IP_R(%esi)
+ LODSB
+.L01:
+ cmpb $16,%al
+ jae .LMATCH
+
+/* a literal run */
+ orb %al,%al
+ jz 1b
+ addl $3+NN,%eax
+3:
+.LFLR:
+ TEST_OP(-NN(%edi,%eax),%edx)
+ TEST_IP(-NN(%esi,%eax),%edx)
+#if defined(LZO_FAST)
+ movl %eax,%ecx
+ NOTL_3(%eax)
+ shrl $2,%ecx
+ andl N_3,%eax
+ COPYL(%esi,%edi,%edx)
+ subl %eax,%esi
+ subl %eax,%edi
+#else
+ movl %eax,%ecx
+ shrl $2,%eax
+ andl N_3,%ecx
+ COPYL_C(%esi,%edi,%edx,%eax)
+.LFLR2:
+ rep
+ movsb
+#endif
+
+#ifdef LZO_DEBUG
+ andl $0xffffff00,%eax ; jnz .L_assert_fail
+ andl $0xffffff00,%ebx ; jnz .L_assert_fail
+ xorl %eax,%eax ; xorl %ebx,%ebx
+ xorl %ecx,%ecx ; xorl %edx,%edx
+#endif
+ LODSB
+ cmpb $16,%al
+ jae .LMATCH
+
+
+/***********************************************************************
+// R1
+************************************************************************/
+
+ TEST_OP(3(%edi),%edx)
+ shrl $2,%eax
+ movb (%esi),%bl
+#if defined(LZO1X)
+ leal -0x801(%edi),%edx
+#elif defined(LZO1Y)
+ leal -0x401(%edi),%edx
+#endif
+ leal (%eax,%ebx,4),%eax
+ incl %esi
+ subl %eax,%edx
+ TEST_LOOKBEHIND(%edx)
+#if defined(LZO_FAST)
+ movl (%edx),%ecx
+ movl %ecx,(%edi)
+#else
+ movb (%edx),%al
+ movb %al,(%edi)
+ movb 1(%edx),%al
+ movb %al,1(%edi)
+ movb 2(%edx),%al
+ movb %al,2(%edi)
+#endif
+ addl N_3,%edi
+ jmp .LMDONE
+
+
+/***********************************************************************
+// M2
+************************************************************************/
+
+ ALIGN3
+.LMATCH:
+ cmpb $64,%al
+ jb .LM3MATCH
+
+/* a M2 match */
+ movl %eax,%ecx
+ shrl $2,%eax
+ leal -1(%edi),%edx
+#if defined(LZO1X)
+ andl $7,%eax
+ movb (%esi),%bl
+ shrl $5,%ecx
+ leal (%eax,%ebx,8),%eax
+#elif defined(LZO1Y)
+ andl N_3,%eax
+ movb (%esi),%bl
+ shrl $4,%ecx
+ leal (%eax,%ebx,4),%eax
+#endif
+ incl %esi
+ subl %eax,%edx
+
+#if defined(LZO_FAST)
+#if defined(LZO1X)
+ addl $1+3,%ecx
+#elif defined(LZO1Y)
+ addl $2,%ecx
+#endif
+#else
+#if defined(LZO1X)
+ incl %ecx
+#elif defined(LZO1Y)
+ decl %ecx
+#endif
+#endif
+
+ cmpl N_3,%eax
+ jae .LCOPYLONG
+ jmp .LCOPYBYTE
+
+
+/***********************************************************************
+// M3
+************************************************************************/
+
+0: addl N_255,%eax
+ TEST_IP(3(%esi),%edx) /* minimum */
+1: movb (%esi),%bl
+ incl %esi
+ orb %bl,%bl
+ jz 0b
+ leal 33+NN(%eax,%ebx),%ecx
+ xorl %eax,%eax
+ jmp 3f
+
+
+ ALIGN3
+.LM3MATCH:
+ cmpb $32,%al
+ jb .LM4MATCH
+
+/* a M3 match */
+ andl $31,%eax
+ jz 1b
+ lea 2+NN(%eax),%ecx
+3:
+#ifdef LZO_DEBUG
+ andl $0xffff0000,%eax ; jnz .L_assert_fail
+#endif
+ movw (%esi),%ax
+ leal -1(%edi),%edx
+ shrl $2,%eax
+ addl $2,%esi
+ subl %eax,%edx
+
+ cmpl N_3,%eax
+ jb .LCOPYBYTE
+
+
+/***********************************************************************
+// copy match
+************************************************************************/
+
+ ALIGN1
+.LCOPYLONG: /* copy match using longwords */
+ TEST_LOOKBEHIND(%edx)
+#if defined(LZO_FAST)
+ leal -3(%edi,%ecx),%eax
+ shrl $2,%ecx
+ TEST_OP_R(%eax)
+ COPYL(%edx,%edi,%ebx)
+ movl %eax,%edi
+ xorl %ebx,%ebx
+#else
+ TEST_OP((%edi,%ecx),%eax)
+ movl %ecx,%ebx
+ shrl $2,%ebx
+ jz 2f
+ COPYL_C(%edx,%edi,%eax,%ebx)
+ andl N_3,%ecx
+ jz 1f
+2: COPYB_C(%edx,%edi,%al,%ecx)
+1:
+#endif
+
+.LMDONE:
+ movb -2(%esi),%al
+ andl N_3,%eax
+ jz .L00
+.LFLR3:
+ TEST_OP((%edi,%eax),%edx)
+ TEST_IP((%esi,%eax),%edx)
+#if defined(LZO_FAST)
+ movl (%esi),%edx
+ addl %eax,%esi
+ movl %edx,(%edi)
+ addl %eax,%edi
+#else
+ COPYB_C(%esi,%edi,%cl,%eax)
+#endif
+
+#ifdef LZO_DEBUG
+ andl $0xffffff00,%eax ; jnz .L_assert_fail
+ andl $0xffffff00,%ebx ; jnz .L_assert_fail
+ xorl %eax,%eax ; xorl %ebx,%ebx
+ xorl %ecx,%ecx ; xorl %edx,%edx
+#endif
+ LODSB
+ jmp .LMATCH
+
+
+ ALIGN3
+.LCOPYBYTE: /* copy match using bytes */
+ TEST_LOOKBEHIND(%edx)
+ TEST_OP(-NN(%edi,%ecx),%eax)
+ xchgl %edx,%esi
+#if defined(LZO_FAST)
+ subl N_3,%ecx
+#endif
+ rep
+ movsb
+ movl %edx,%esi
+ jmp .LMDONE
+
+
+/***********************************************************************
+// M4
+************************************************************************/
+
+0: addl N_255,%ecx
+ TEST_IP(3(%esi),%edx) /* minimum */
+1: movb (%esi),%bl
+ incl %esi
+ orb %bl,%bl
+ jz 0b
+ leal 9+NN(%ebx,%ecx),%ecx
+ jmp 3f
+
+
+ ALIGN3
+.LM4MATCH:
+ cmpb $16,%al
+ jb .LM1MATCH
+
+/* a M4 match */
+ movl %eax,%ecx
+ andl $8,%eax
+ shll $13,%eax /* save in bit 16 */
+ andl $7,%ecx
+ jz 1b
+ addl $2+NN,%ecx
+3:
+#ifdef LZO_DEBUG
+ movl %eax,%edx ; andl $0xfffe0000,%edx ; jnz .L_assert_fail
+#endif
+ movw (%esi),%ax
+ addl $2,%esi
+ leal -0x4000(%edi),%edx
+ shrl $2,%eax
+ jz .LEOF
+ subl %eax,%edx
+ jmp .LCOPYLONG
+
+
+/***********************************************************************
+// M1
+************************************************************************/
+
+ ALIGN3
+.LM1MATCH:
+/* a M1 match */
+ TEST_OP(2(%edi),%edx)
+ shrl $2,%eax
+ movb (%esi),%bl
+ leal -1(%edi),%edx
+ leal (%eax,%ebx,4),%eax
+ incl %esi
+ subl %eax,%edx
+ TEST_LOOKBEHIND(%edx)
+
+ movb (%edx),%al /* we must use this because edx can be edi-1 */
+ movb %al,(%edi)
+ movb 1(%edx),%bl
+ movb %bl,1(%edi)
+ addl $2,%edi
+ jmp .LMDONE
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+.LEOF:
+/**** xorl %eax,%eax eax=0 from above */
+
+ cmpl $3+NN,%ecx /* ecx must be 3/6 */
+ setnz %al
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f1.S
new file mode 100644
index 00000000..f9706f13
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f1.S
@@ -0,0 +1,51 @@
+/* lzo1x_f1.S -- fast LZO1X decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_FAST
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1x_decompress_asm_fast)
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1x_decompress_asm_fast)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f2.S
new file mode 100644
index 00000000..f9ad6b32
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_f2.S
@@ -0,0 +1,70 @@
+/* lzo1x_f2.S -- fast LZO1X decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_FAST
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1x_decompress_asm_fast_safe)
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1x_decompress_asm_fast_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s1.S
new file mode 100644
index 00000000..198980de
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s1.S
@@ -0,0 +1,49 @@
+/* lzo1x_s1.S -- LZO1X decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1x_decompress_asm)
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1x_decompress_asm)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s2.S
new file mode 100644
index 00000000..aaa294de
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1x_s2.S
@@ -0,0 +1,68 @@
+/* lzo1x_s2.S -- LZO1X decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1x_decompress_asm_safe)
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1x_decompress_asm_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f1.S
new file mode 100644
index 00000000..98ab9152
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f1.S
@@ -0,0 +1,53 @@
+/* lzo1y_f1.S -- fast LZO1Y decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_FAST
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1y_decompress_asm_fast)
+
+#define LZO1Y
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1y_decompress_asm_fast)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f2.S
new file mode 100644
index 00000000..2dace850
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_f2.S
@@ -0,0 +1,72 @@
+/* lzo1y_f2.S -- fast LZO1Y decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_FAST
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1y_decompress_asm_fast_safe)
+
+#define LZO1Y
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1y_decompress_asm_fast_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s1.S
new file mode 100644
index 00000000..b48212f5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s1.S
@@ -0,0 +1,51 @@
+/* lzo1y_s1.S -- LZO1Y decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1y_decompress_asm)
+
+#define LZO1Y
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1y_decompress_asm)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s2.S
new file mode 100644
index 00000000..238c762e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo1y_s2.S
@@ -0,0 +1,70 @@
+/* lzo1y_s2.S -- LZO1Y decompression in assembler (i386 + gcc)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
+#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
+
+#include "lzo_asm.h"
+
+ .text
+
+ LZO_PUBLIC(lzo1y_decompress_asm_safe)
+
+#define LZO1Y
+
+#include "enter.ash"
+#include "lzo1x_d.ash"
+#include "leave.ash"
+
+ LZO_PUBLIC_END(lzo1y_decompress_asm_safe)
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo_asm.h b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo_asm.h
new file mode 100644
index 00000000..1958517d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src/lzo_asm.h
@@ -0,0 +1,275 @@
+/* lzo_asm.h -- LZO assembler stuff
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+// <asmconfig.h>
+************************************************************************/
+
+#if !defined(__i386__)
+# error
+#endif
+
+#if !defined(IN_CONFIGURE)
+#if defined(LZO_HAVE_CONFIG_H)
+# include <config.h>
+#else
+ /* manual configuration - see defaults below */
+# if defined(__ELF__)
+# define MFX_ASM_HAVE_TYPE 1
+# define MFX_ASM_NAME_NO_UNDERSCORES 1
+# elif defined(__linux__) /* Linux a.out */
+# define MFX_ASM_ALIGN_PTWO 1
+# elif defined(__DJGPP__)
+# define MFX_ASM_ALIGN_PTWO 1
+# elif defined(__GO32__) /* djgpp v1 */
+# define MFX_ASM_CANNOT_USE_EBP 1
+# elif defined(__EMX__)
+# define MFX_ASM_ALIGN_PTWO 1
+# define MFX_ASM_CANNOT_USE_EBP 1
+# endif
+#endif
+#endif
+
+#if 1 && defined(__ELF__)
+.section .note.GNU-stack,"",@progbits
+#endif
+#if 0 && defined(__ELF__)
+#undef i386
+.arch i386
+.code32
+#endif
+
+
+/***********************************************************************
+// name always uses underscores
+// [ OLD: name (default: with underscores) ]
+************************************************************************/
+
+#if !defined(LZO_ASM_NAME)
+# define LZO_ASM_NAME(n) _ ## n
+#if 0
+# if defined(MFX_ASM_NAME_NO_UNDERSCORES)
+# define LZO_ASM_NAME(n) n
+# else
+# define LZO_ASM_NAME(n) _ ## n
+# endif
+#endif
+#endif
+
+
+/***********************************************************************
+// .type (default: do not use)
+************************************************************************/
+
+#if !defined(LZO_PUBLIC)
+#if defined(__LZO_DB__)
+# define LZO_PUBLIC(func) \
+ .p2align 4 ; .byte 0,0,0,0,0,0,0 ; .ascii "LZO_START"
+# define LZO_PUBLIC_END(func) \
+ .p2align 4,0x90 ; .ascii "LZO_END"
+#elif defined(MFX_ASM_HAVE_TYPE)
+# define LZO_PUBLIC(func) \
+ ALIGN3 ; .type LZO_ASM_NAME(func),@function ; \
+ .globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func):
+# define LZO_PUBLIC_END(func) \
+ .size LZO_ASM_NAME(func),.-LZO_ASM_NAME(func)
+#else
+# define LZO_PUBLIC(func) \
+ ALIGN3 ; .globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func):
+# define LZO_PUBLIC_END(func)
+#endif
+#endif
+
+
+/***********************************************************************
+// .align (default: bytes)
+************************************************************************/
+
+#if !defined(MFX_ASM_ALIGN_BYTES) && !defined(MFX_ASM_ALIGN_PTWO)
+# define MFX_ASM_ALIGN_BYTES 1
+#endif
+
+#if !defined(LZO_ASM_ALIGN)
+# if defined(MFX_ASM_ALIGN_PTWO)
+# define LZO_ASM_ALIGN(x) .align x
+# else
+# define LZO_ASM_ALIGN(x) .align (1 << (x))
+# endif
+#endif
+
+#define ALIGN1 LZO_ASM_ALIGN(1)
+#define ALIGN2 LZO_ASM_ALIGN(2)
+#define ALIGN3 LZO_ASM_ALIGN(3)
+
+
+/***********************************************************************
+// ebp usage (default: can use)
+************************************************************************/
+
+#if !defined(MFX_ASM_CANNOT_USE_EBP)
+# if 1 && !defined(N_3_EBP) && !defined(N_255_EBP)
+# define N_3_EBP 1
+# endif
+# if 0 && !defined(N_3_EBP) && !defined(N_255_EBP)
+# define N_255_EBP 1
+# endif
+#endif
+
+#if defined(N_3_EBP) && defined(N_255_EBP)
+# error
+#endif
+#if defined(MFX_ASM_CANNOT_USE_EBP)
+# if defined(N_3_EBP) || defined(N_255_EBP)
+# error
+# endif
+#endif
+
+#if !defined(N_3)
+# if defined(N_3_EBP)
+# define N_3 %ebp
+# else
+# define N_3 $3
+# endif
+#endif
+
+#if !defined(N_255)
+# if defined(N_255_EBP)
+# define N_255 %ebp
+# define NOTL_3(r) xorl %ebp,r
+# else
+# define N_255 $255
+# endif
+#endif
+
+#if !defined(NOTL_3)
+# define NOTL_3(r) xorl N_3,r
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#ifndef INP
+#define INP 4+36(%esp)
+#define INS 8+36(%esp)
+#define OUTP 12+36(%esp)
+#define OUTS 16+36(%esp)
+#endif
+
+#define INEND 4(%esp)
+#define OUTEND (%esp)
+
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
+# define TEST_IP_R(r) cmpl r,INEND ; jb .L_input_overrun
+# define TEST_IP(addr,r) leal addr,r ; TEST_IP_R(r)
+#else
+# define TEST_IP_R(r)
+# define TEST_IP(addr,r)
+#endif
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
+# define TEST_OP_R(r) cmpl r,OUTEND ; jb .L_output_overrun
+# define TEST_OP(addr,r) leal addr,r ; TEST_OP_R(r)
+#else
+# define TEST_OP_R(r)
+# define TEST_OP(addr,r)
+#endif
+
+#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
+# define TEST_LOOKBEHIND(r) cmpl OUTP,r ; jb .L_lookbehind_overrun
+#else
+# define TEST_LOOKBEHIND(r)
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LODSB movb (%esi),%al ; incl %esi
+
+#define MOVSB(r1,r2,x) movb (r1),x ; incl r1 ; movb x,(r2) ; incl r2
+#define MOVSW(r1,r2,x) movb (r1),x ; movb x,(r2) ; \
+ movb 1(r1),x ; addl $2,r1 ; \
+ movb x,1(r2) ; addl $2,r2
+#define MOVSL(r1,r2,x) movl (r1),x ; addl $4,r1 ; movl x,(r2) ; addl $4,r2
+
+#if defined(LZO_DEBUG)
+#define COPYB_C(r1,r2,x,rc) \
+ cmpl $0,rc ; jz .L_assert_fail; \
+ 9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b
+#define COPYL_C(r1,r2,x,rc) \
+ cmpl $0,rc ; jz .L_assert_fail; \
+ 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
+#else
+#define COPYB_C(r1,r2,x,rc) \
+ 9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b
+#define COPYL_C(r1,r2,x,rc) \
+ 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b
+#endif
+
+#define COPYB(r1,r2,x) COPYB_C(r1,r2,x,%ecx)
+#define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx)
+
+
+/***********************************************************************
+// not used
+************************************************************************/
+
+#if 0
+
+#if 0
+#define REP_MOVSB(x) rep ; movsb
+#define REP_MOVSL(x) shrl $2,%ecx ; rep ; movsl
+#elif 1
+#define REP_MOVSB(x) COPYB(%esi,%edi,x)
+#define REP_MOVSL(x) shrl $2,%ecx ; COPYL(%esi,%edi,x)
+#else
+#define REP_MOVSB(x) rep ; movsb
+#define REP_MOVSL(x) jmp 9f ; 8: movsb ; decl %ecx ; \
+ 9: testl $3,%edi ; jnz 8b ; \
+ movl %ecx,x ; shrl $2,%ecx ; andl $3,x ; \
+ rep ; movsl ; movl x,%ecx ; rep ; movsb
+#endif
+
+#if 1
+#define NEGL(x) negl x
+#else
+#define NEGL(x) xorl $-1,x ; incl x
+#endif
+
+#endif
+
+
+
+/*
+vi:ts=4
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/all/asm_all.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/all/asm_all.S
new file mode 100644
index 00000000..6da894b2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/all/asm_all.S
@@ -0,0 +1,371 @@
+/* asm_all.S --
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#if (defined(__MACH__) && defined(__APPLE__))
+# define NAME1(x) _ ## x
+#else
+# define NAME1(x) _ ## x
+# define NAME2(x) x
+#endif
+#ifndef p2align
+# define p2align(x) .p2align x
+#endif
+#ifndef globalf
+# define globalf(x) .globl x
+#endif
+#ifndef typef
+# if defined(__ELF__)
+# define typef(x) .type x,@function
+# else
+# define typef(x)
+# endif
+#endif
+#ifndef sizef
+# if defined(__ELF__)
+# define sizef(x,s) .size x,s
+# else
+# define sizef(x,s)
+# endif
+#endif
+#if defined(__ELF__)
+.section .note.GNU-stack,"",@progbits
+#endif
+.text
+#if defined(__ELF__) || (defined(__MACH__) && defined(__APPLE__)) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
+p2align(6)
+#else
+p2align(4)
+#endif
+#ifndef db
+# define db .byte
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1c_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1c_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1c_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+#ifdef NAME1
+sizef(NAME1(lzo1c_decompress_asm),.-NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1c_decompress_asm),.-NAME2(lzo1c_decompress_asm))
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1f_decompress_asm_fast),.-NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1f_decompress_asm_fast),.-NAME2(lzo1f_decompress_asm_fast))
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm_fast),.-NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm_fast),.-NAME2(lzo1x_decompress_asm_fast))
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm),.-NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm),.-NAME2(lzo1x_decompress_asm))
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm_fast),.-NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm_fast),.-NAME2(lzo1y_decompress_asm_fast))
+#endif
+
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm),.-NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm),.-NAME2(lzo1y_decompress_asm))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/asminit.def b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/asminit.def
new file mode 100644
index 00000000..1115582f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/asminit.def
@@ -0,0 +1,67 @@
+/* asminit.def --
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+#if (defined(__MACH__) && defined(__APPLE__))
+# define NAME1(x) _ ## x
+#else
+# define NAME1(x) _ ## x
+# define NAME2(x) x
+#endif
+
+#ifndef p2align
+# define p2align(x) .p2align x
+#endif
+#ifndef globalf
+# define globalf(x) .globl x
+#endif
+#ifndef typef
+# if defined(__ELF__)
+# define typef(x) .type x,@function
+# else
+# define typef(x)
+# endif
+#endif
+#ifndef sizef
+# if defined(__ELF__)
+# define sizef(x,s) .size x,s
+# else
+# define sizef(x,s)
+# endif
+#endif
+
+#if defined(__ELF__)
+.section .note.GNU-stack,"",@progbits
+#endif
+.text
+#if defined(__ELF__) || (defined(__MACH__) && defined(__APPLE__)) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__)
+p2align(6)
+#else
+p2align(4)
+#endif
+#ifndef db
+# define db .byte
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s1.S
new file mode 100644
index 00000000..c21ef485
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s1.S
@@ -0,0 +1,72 @@
+/* lzo1c_s1.S -- lzo1c_decompress_asm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1c_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1c_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1c_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+#ifdef NAME1
+sizef(NAME1(lzo1c_decompress_asm),.-NAME1(lzo1c_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1c_decompress_asm),.-NAME2(lzo1c_decompress_asm))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s2.S
new file mode 100644
index 00000000..1797cc34
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1c_s2.S
@@ -0,0 +1,98 @@
+/* lzo1c_s2.S -- lzo1c_decompress_asm_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1c_decompress_asm_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1c_decompress_asm_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1c_decompress_asm_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1c_decompress_asm_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
+db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
+db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
+db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
+db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
+db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
+db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
+db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
+db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
+db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
+db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
+db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
+db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
+db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
+db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
+db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
+db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
+db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
+db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
+db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
+db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
+db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1c_decompress_asm_safe),.-NAME1(lzo1c_decompress_asm_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1c_decompress_asm_safe),.-NAME2(lzo1c_decompress_asm_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f1.S
new file mode 100644
index 00000000..eec8c8a6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f1.S
@@ -0,0 +1,74 @@
+/* lzo1f_f1.S -- lzo1f_decompress_asm_fast
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1f_decompress_asm_fast),.-NAME1(lzo1f_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1f_decompress_asm_fast),.-NAME2(lzo1f_decompress_asm_fast))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f2.S
new file mode 100644
index 00000000..f2041bc7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1f_f2.S
@@ -0,0 +1,96 @@
+/* lzo1f_f2.S -- lzo1f_decompress_asm_fast_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1f_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1f_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
+db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
+db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
+db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
+db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
+db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
+db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
+db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
+db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
+db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
+db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
+db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
+db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
+db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
+db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
+db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
+db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
+db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
+db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
+db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1f_decompress_asm_fast_safe),.-NAME1(lzo1f_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1f_decompress_asm_fast_safe),.-NAME2(lzo1f_decompress_asm_fast_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f1.S
new file mode 100644
index 00000000..87ef8d7d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f1.S
@@ -0,0 +1,82 @@
+/* lzo1x_f1.S -- lzo1x_decompress_asm_fast
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm_fast),.-NAME1(lzo1x_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm_fast),.-NAME2(lzo1x_decompress_asm_fast))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f2.S
new file mode 100644
index 00000000..0ded30ee
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_f2.S
@@ -0,0 +1,112 @@
+/* lzo1x_f2.S -- lzo1x_decompress_asm_fast_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
+db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
+db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
+db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
+db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm_fast_safe),.-NAME1(lzo1x_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm_fast_safe),.-NAME2(lzo1x_decompress_asm_fast_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s1.S
new file mode 100644
index 00000000..69523a73
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s1.S
@@ -0,0 +1,84 @@
+/* lzo1x_s1.S -- lzo1x_decompress_asm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm),.-NAME1(lzo1x_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm),.-NAME2(lzo1x_decompress_asm))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s2.S
new file mode 100644
index 00000000..46d60aa0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1x_s2.S
@@ -0,0 +1,115 @@
+/* lzo1x_s2.S -- lzo1x_decompress_asm_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1x_decompress_asm_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1x_decompress_asm_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1x_decompress_asm_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1x_decompress_asm_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
+db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
+db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
+db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1x_decompress_asm_safe),.-NAME1(lzo1x_decompress_asm_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1x_decompress_asm_safe),.-NAME2(lzo1x_decompress_asm_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f1.S
new file mode 100644
index 00000000..cfc59937
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f1.S
@@ -0,0 +1,82 @@
+/* lzo1y_f1.S -- lzo1y_decompress_asm_fast
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm_fast),.-NAME1(lzo1y_decompress_asm_fast))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm_fast),.-NAME2(lzo1y_decompress_asm_fast))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f2.S
new file mode 100644
index 00000000..de28ace9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_f2.S
@@ -0,0 +1,112 @@
+/* lzo1y_f2.S -- lzo1y_decompress_asm_fast_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
+db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
+db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
+db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
+db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm_fast_safe),.-NAME1(lzo1y_decompress_asm_fast_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm_fast_safe),.-NAME2(lzo1y_decompress_asm_fast_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s1.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s1.S
new file mode 100644
index 00000000..b7900ca6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s1.S
@@ -0,0 +1,84 @@
+/* lzo1y_s1.S -- lzo1y_decompress_asm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm),.-NAME1(lzo1y_decompress_asm))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm),.-NAME2(lzo1y_decompress_asm))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s2.S b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s2.S
new file mode 100644
index 00000000..4da81a3c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_gas/lzo1y_s2.S
@@ -0,0 +1,115 @@
+/* lzo1y_s2.S -- lzo1y_decompress_asm_safe
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+#include "asminit.def"
+#ifdef NAME1
+typef(NAME1(lzo1y_decompress_asm_safe))
+#endif
+#ifdef NAME2
+typef(NAME2(lzo1y_decompress_asm_safe))
+#endif
+#ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_safe))
+#endif
+#ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_safe))
+#endif
+#ifdef NAME1
+NAME1(lzo1y_decompress_asm_safe):
+#endif
+#ifdef NAME2
+NAME2(lzo1y_decompress_asm_safe):
+#endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
+db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
+db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
+db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+#ifdef NAME1
+sizef(NAME1(lzo1y_decompress_asm_safe),.-NAME1(lzo1y_decompress_asm_safe))
+#endif
+#ifdef NAME2
+sizef(NAME2(lzo1y_decompress_asm_safe),.-NAME2(lzo1y_decompress_asm_safe))
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/all/asm_all.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/all/asm_all.asm
new file mode 100644
index 00000000..c35e2969
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/all/asm_all.asm
@@ -0,0 +1,213 @@
+; asm_all.asm --
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+.386p
+.model flat
+.code
+ifdef __MASM__
+option casemap:none
+endif
+ifdef __TASM__
+endif
+ifdef __WASM__
+endif
+
+public _lzo1c_decompress_asm
+_lzo1c_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+
+public _lzo1f_decompress_asm_fast
+_lzo1f_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+
+public _lzo1x_decompress_asm_fast
+_lzo1x_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+
+public _lzo1x_decompress_asm
+_lzo1x_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+
+public _lzo1y_decompress_asm_fast
+_lzo1y_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+
+public _lzo1y_decompress_asm
+_lzo1y_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/asminit.def b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/asminit.def
new file mode 100644
index 00000000..81a9d21c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/asminit.def
@@ -0,0 +1,38 @@
+; asminit.def --
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+.386p
+.model flat
+.code
+
+ifdef __MASM__
+option casemap:none
+endif
+ifdef __TASM__
+endif
+ifdef __WASM__
+endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s1.asm
new file mode 100644
index 00000000..f6aae35f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s1.asm
@@ -0,0 +1,51 @@
+; lzo1c_s1.asm -- lzo1c_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1c_decompress_asm
+_lzo1c_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s2.asm
new file mode 100644
index 00000000..08dfb401
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1c_s2.asm
@@ -0,0 +1,77 @@
+; lzo1c_s2.asm -- lzo1c_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1c_decompress_asm_safe
+_lzo1c_decompress_asm_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
+db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
+db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
+db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
+db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
+db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
+db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
+db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
+db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
+db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
+db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
+db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
+db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
+db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
+db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
+db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
+db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
+db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
+db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
+db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
+db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
+db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f1.asm
new file mode 100644
index 00000000..23ee4493
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f1.asm
@@ -0,0 +1,53 @@
+; lzo1f_f1.asm -- lzo1f_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1f_decompress_asm_fast
+_lzo1f_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f2.asm
new file mode 100644
index 00000000..7ec00573
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1f_f2.asm
@@ -0,0 +1,75 @@
+; lzo1f_f2.asm -- lzo1f_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1f_decompress_asm_fast_safe
+_lzo1f_decompress_asm_fast_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
+db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
+db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
+db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
+db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
+db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
+db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
+db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
+db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
+db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
+db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
+db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
+db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
+db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
+db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
+db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
+db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
+db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
+db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
+db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f1.asm
new file mode 100644
index 00000000..7e77a174
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f1.asm
@@ -0,0 +1,61 @@
+; lzo1x_f1.asm -- lzo1x_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1x_decompress_asm_fast
+_lzo1x_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f2.asm
new file mode 100644
index 00000000..5994e2de
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_f2.asm
@@ -0,0 +1,91 @@
+; lzo1x_f2.asm -- lzo1x_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1x_decompress_asm_fast_safe
+_lzo1x_decompress_asm_fast_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
+db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
+db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
+db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
+db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s1.asm
new file mode 100644
index 00000000..f466aa8a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s1.asm
@@ -0,0 +1,63 @@
+; lzo1x_s1.asm -- lzo1x_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1x_decompress_asm
+_lzo1x_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s2.asm
new file mode 100644
index 00000000..7316e55b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1x_s2.asm
@@ -0,0 +1,94 @@
+; lzo1x_s2.asm -- lzo1x_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1x_decompress_asm_safe
+_lzo1x_decompress_asm_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
+db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
+db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
+db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f1.asm
new file mode 100644
index 00000000..c4ff7a36
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f1.asm
@@ -0,0 +1,61 @@
+; lzo1y_f1.asm -- lzo1y_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1y_decompress_asm_fast
+_lzo1y_decompress_asm_fast:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f2.asm
new file mode 100644
index 00000000..daf67e5a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_f2.asm
@@ -0,0 +1,91 @@
+; lzo1y_f2.asm -- lzo1y_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1y_decompress_asm_fast_safe
+_lzo1y_decompress_asm_fast_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
+db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
+db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
+db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
+db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s1.asm
new file mode 100644
index 00000000..4c8d7108
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s1.asm
@@ -0,0 +1,63 @@
+; lzo1y_s1.asm -- lzo1y_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1y_decompress_asm
+_lzo1y_decompress_asm:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s2.asm
new file mode 100644
index 00000000..c7ac80e2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_masm/lzo1y_s2.asm
@@ -0,0 +1,94 @@
+; lzo1y_s2.asm -- lzo1y_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+include asminit.def
+public _lzo1y_decompress_asm_safe
+_lzo1y_decompress_asm_safe:
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
+db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
+db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
+db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+end
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/all/asm_all.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/all/asm_all.asm
new file mode 100644
index 00000000..b0df7de7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/all/asm_all.asm
@@ -0,0 +1,366 @@
+; asm_all.asm --
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+bits 32
+%ifndef __OUTPUT_FORMAT__
+%error "__OUTPUT_FORMAT__ is not defined"
+%endif
+%ifidni __OUTPUT_FORMAT__,elf
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ elf32
+%endif
+%ifidni __OUTPUT_FORMAT__,macho
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ macho32
+%endif
+%ifidni __OUTPUT_FORMAT__,win
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win32
+%endif
+%ifdef __YASM_MAJOR__
+%ifidni __OUTPUT_FORMAT__,x64
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win64
+%endif
+%endif
+%ifidni __OUTPUT_FORMAT__,macho32
+%define NAME1(x) _ %+ x
+%elifidni __OUTPUT_FORMAT__,macho64
+%define NAME1(x) _ %+ x
+%else
+%define NAME1(x) _ %+ x
+%define NAME2(x) x
+%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+%define globalf(x) global x:function (x %+ _end - x)
+%define globalf_end(x) x %+ _end:
+%elifidni __OUTPUT_FORMAT__,elf64
+%define globalf(x) global x:function (x %+ _end - x)
+%define globalf_end(x) x %+ _end:
+%else
+%define globalf(x) global x
+%define globalf_end(x)
+%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%elifidni __OUTPUT_FORMAT__,elf64
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidni __OUTPUT_FORMAT__,obj
+%if __BITS__==16
+segment _TEXT class=CODE public use16
+%else
+segment _TEXT class=CODE public use32 flat
+%endif
+%else
+section .text
+%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+align 64
+%elifidni __OUTPUT_FORMAT__,elf64
+align 64
+%elifidni __OUTPUT_FORMAT__,macho32
+align 64
+%elifidni __OUTPUT_FORMAT__,macho64
+align 64
+%elifidni __OUTPUT_FORMAT__,win32
+align 64
+%elifidni __OUTPUT_FORMAT__,win64
+align 64
+%else
+align 16
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1c_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1c_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1c_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1c_decompress_asm))
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1f_decompress_asm_fast))
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm_fast))
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm))
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm_fast))
+%endif
+
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/asminit.def b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/asminit.def
new file mode 100644
index 00000000..0ccdb8d7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/asminit.def
@@ -0,0 +1,99 @@
+; asminit.def --
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+bits 32
+%ifndef __OUTPUT_FORMAT__
+%error "__OUTPUT_FORMAT__ is not defined"
+%endif
+%ifidni __OUTPUT_FORMAT__,elf
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ elf32
+%endif
+%ifidni __OUTPUT_FORMAT__,macho
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ macho32
+%endif
+%ifidni __OUTPUT_FORMAT__,win
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win32
+%endif
+%ifdef __YASM_MAJOR__
+%ifidni __OUTPUT_FORMAT__,x64
+%undef __OUTPUT_FORMAT__
+%define __OUTPUT_FORMAT__ win64
+%endif
+%endif
+
+%ifidni __OUTPUT_FORMAT__,macho32
+%define NAME1(x) _ %+ x
+%elifidni __OUTPUT_FORMAT__,macho64
+%define NAME1(x) _ %+ x
+%else
+%define NAME1(x) _ %+ x
+%define NAME2(x) x
+%endif
+
+%ifidni __OUTPUT_FORMAT__,elf32
+%define globalf(x) global x:function (x %+ _end - x)
+%define globalf_end(x) x %+ _end:
+%elifidni __OUTPUT_FORMAT__,elf64
+%define globalf(x) global x:function (x %+ _end - x)
+%define globalf_end(x) x %+ _end:
+%else
+%define globalf(x) global x
+%define globalf_end(x)
+%endif
+
+%ifidni __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%elifidni __OUTPUT_FORMAT__,elf64
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidni __OUTPUT_FORMAT__,obj
+%if __BITS__==16
+segment _TEXT class=CODE public use16
+%else
+segment _TEXT class=CODE public use32 flat
+%endif
+%else
+section .text
+%endif
+%ifidni __OUTPUT_FORMAT__,elf32
+align 64
+%elifidni __OUTPUT_FORMAT__,elf64
+align 64
+%elifidni __OUTPUT_FORMAT__,macho32
+align 64
+%elifidni __OUTPUT_FORMAT__,macho64
+align 64
+%elifidni __OUTPUT_FORMAT__,win32
+align 64
+%elifidni __OUTPUT_FORMAT__,win64
+align 64
+%else
+align 16
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s1.asm
new file mode 100644
index 00000000..e35e627b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s1.asm
@@ -0,0 +1,66 @@
+; lzo1c_s1.asm -- lzo1c_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1c_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1c_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115
+db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72
+db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194
+db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235
+db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248
+db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224
+db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70
+db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235
+db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8
+db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36
+db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116
+db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137
+db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15
+db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1c_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1c_decompress_asm))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s2.asm
new file mode 100644
index 00000000..89fa7367
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1c_s2.asm
@@ -0,0 +1,92 @@
+; lzo1c_s2.asm -- lzo1c_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1c_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1c_decompress_asm_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1c_decompress_asm_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1c_decompress_asm_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141
+db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92
+db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114
+db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255
+db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242
+db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36
+db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0
+db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44
+db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15
+db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0
+db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0
+db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59
+db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15
+db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255
+db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117
+db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0
+db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70
+db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116
+db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214
+db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254
+db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0
+db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1c_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1c_decompress_asm_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f1.asm
new file mode 100644
index 00000000..514ab474
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f1.asm
@@ -0,0 +1,68 @@
+; lzo1f_f1.asm -- lzo1f_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119
+db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193
+db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243
+db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70
+db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232
+db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195
+db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4
+db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137
+db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1
+db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141
+db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139
+db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129
+db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0
+db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36
+db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139
+db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93
+db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184
+db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1f_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1f_decompress_asm_fast))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f2.asm
new file mode 100644
index 00000000..70d6f36b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1f_f2.asm
@@ -0,0 +1,90 @@
+; lzo1f_f2.asm -- lzo1f_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1f_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1f_decompress_asm_fast_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1f_decompress_asm_fast_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1f_decompress_asm_fast_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0
+db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138
+db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76
+db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28
+db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2
+db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6
+db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193
+db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4
+db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239
+db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131
+db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165
+db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132
+db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6
+db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193
+db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193
+db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7
+db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0
+db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0
+db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232
+db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36
+db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29
+db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90
+db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0
+db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0
+db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1f_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1f_decompress_asm_fast_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f1.asm
new file mode 100644
index 00000000..585963b7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f1.asm
@@ -0,0 +1,76 @@
+; lzo1x_f1.asm -- lzo1x_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115
+db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141
+db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116
+db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm_fast))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f2.asm
new file mode 100644
index 00000000..ada1b886
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_f2.asm
@@ -0,0 +1,106 @@
+; lzo1x_f2.asm -- lzo1x_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_fast_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm_fast_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm_fast_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70
+db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255
+db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0
+db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144
+db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm_fast_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s1.asm
new file mode 100644
index 00000000..98790b91
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s1.asm
@@ -0,0 +1,78 @@
+; lzo1x_s1.asm -- lzo1x_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235
+db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24
+db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116
+db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s2.asm
new file mode 100644
index 00000000..5c655583
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1x_s2.asm
@@ -0,0 +1,109 @@
+; lzo1x_s2.asm -- lzo1x_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1x_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1x_decompress_asm_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1x_decompress_asm_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1x_decompress_asm_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138
+db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233
+db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4
+db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24
+db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1x_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1x_decompress_asm_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f1.asm
new file mode 100644
index 00000000..6ca700d8
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f1.asm
@@ -0,0 +1,76 @@
+; lzo1y_f1.asm -- lzo1y_decompress_asm_fast
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27
+db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244
+db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8
+db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139
+db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199
+db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251
+db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54
+db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76
+db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116
+db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131
+db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70
+db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1
+db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0
+db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0
+db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2
+db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255
+db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214
+db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216
+db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235
+db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm_fast))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm_fast))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f2.asm
new file mode 100644
index 00000000..9e6b37c5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_f2.asm
@@ -0,0 +1,106 @@
+; lzo1y_f2.asm -- lzo1y_decompress_asm_fast_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_fast_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm_fast_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm_fast_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141
+db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70
+db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0
+db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115
+db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15
+db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8
+db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198
+db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70
+db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0
+db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41
+db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1
+db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232
+db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41
+db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0
+db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138
+db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246
+db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5
+db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232
+db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253
+db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194
+db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254
+db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130
+db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0
+db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255
+db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0
+db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135
+db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141
+db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8
+db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0
+db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116
+db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255
+db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0
+db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7
+db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249
+db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36
+db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137
+db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0
+db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0
+db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm_fast_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm_fast_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s1.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s1.asm
new file mode 100644
index 00000000..b5c6ee75
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s1.asm
@@ -0,0 +1,78 @@
+; lzo1y_s1.asm -- lzo1y_decompress_asm
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 1996-2014 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35
+db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138
+db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0
+db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193
+db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72
+db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30
+db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7
+db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119
+db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120
+db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33
+db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116
+db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2
+db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131
+db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2
+db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255
+db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109
+db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215
+db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11
+db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233
+db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255
+db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1
+db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84
+db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48
+db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95
+db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220
+db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s2.asm b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s2.asm
new file mode 100644
index 00000000..065508cb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/asm/i386/src_nasm/lzo1y_s2.asm
@@ -0,0 +1,109 @@
+; lzo1y_s2.asm -- lzo1y_decompress_asm_safe
+;
+; This file is part of the LZO real-time data compression library.
+;
+; Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+; 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 as
+; published by the Free Software Foundation; either version 2 of
+; the License, or (at your option) any later version.
+;
+; 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/
+;
+
+; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/
+
+%include "asminit.def"
+%ifdef NAME1
+globalf(NAME1(lzo1y_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf(NAME2(lzo1y_decompress_asm_safe))
+%endif
+%ifdef NAME1
+NAME1(lzo1y_decompress_asm_safe):
+%endif
+%ifdef NAME2
+NAME2(lzo1y_decompress_asm_safe):
+%endif
+db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124
+db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68
+db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49
+db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57
+db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15
+db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84
+db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8
+db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0
+db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115
+db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15
+db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16
+db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137
+db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64
+db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138
+db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36
+db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71
+db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246
+db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30
+db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181
+db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15
+db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33
+db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0
+db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232
+db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130
+db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0
+db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199
+db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117
+db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57
+db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15
+db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6
+db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0
+db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135
+db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3
+db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116
+db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224
+db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131
+db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233
+db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106
+db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84
+db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199
+db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119
+db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43
+db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89
+db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0
+db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235
+db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0
+%ifdef NAME1
+globalf_end(NAME1(lzo1y_decompress_asm_safe))
+%endif
+%ifdef NAME2
+globalf_end(NAME2(lzo1y_decompress_asm_safe))
+%endif
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/compile b/ics-openvpn-stripped/main/lzo/autoconf/compile
new file mode 100755
index 00000000..a85b723c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/config.guess b/ics-openvpn-stripped/main/lzo/autoconf/config.guess
new file mode 100755
index 00000000..1f5c50c0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/config.guess
@@ -0,0 +1,1420 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2014 Free Software Foundation, Inc.
+
+timestamp='2014-03-23'
+
+# 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
+
+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 1992-2014 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
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
+# 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 tuples: *-*-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 -q __ELF__
+ 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 ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ 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 ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-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:*:[4567])
+ 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 -q __LP64__
+ 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:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ 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 ;;
+ 8664:Windows_NT:*)
+ echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-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 -q ld.so.1
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 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
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-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:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #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-${LIBC}"; exit; }
+ ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ 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 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ 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 ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 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.[02]*:*)
+ 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 i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-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; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ 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; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+ 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 ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-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
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ 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 ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ 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 ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+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/ics-openvpn-stripped/main/lzo/autoconf/config.rpath b/ics-openvpn-stripped/main/lzo/autoconf/config.rpath
new file mode 100755
index 00000000..b625621f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2014 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # 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.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ 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
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ 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
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 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
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$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"
+
+EOF
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/config.sub b/ics-openvpn-stripped/main/lzo/autoconf/config.sub
new file mode 100755
index 00000000..d654d03c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/config.sub
@@ -0,0 +1,1794 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2014 Free Software Foundation, Inc.
+
+timestamp='2014-05-01'
+
+# 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+#
+# 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 1992-2014 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-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ 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 | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -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*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -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 \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | 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 \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 | or1k | or1knd | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-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-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | 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-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | 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-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | 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
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ 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
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ 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 | 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*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
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-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
+ ;;
+ 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-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ 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
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ 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 | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ 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 | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ 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
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ 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
+ ;;
+ tile*)
+ basic_machine=$basic_machine-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
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ 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[24]aeb | 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.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -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* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -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* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -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* | -es* | -tirtos*)
+ # 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
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -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
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ 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
+ ;;
+ 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
+ ;;
+ -cnk*|-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/ics-openvpn-stripped/main/lzo/autoconf/install-sh b/ics-openvpn-stripped/main/lzo/autoconf/install-sh
new file mode 100755
index 00000000..0b0fdcbb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/install-sh
@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2013-12-25.23; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# 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_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+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.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+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
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ 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 '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # 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 "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ 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-writable 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
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # 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.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && 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
+ fi
+ fi
+ 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
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # 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` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ 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 ||
+
+ # 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 "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/local.m4 b/ics-openvpn-stripped/main/lzo/autoconf/local.m4
new file mode 100644
index 00000000..5c0ba29d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/local.m4
@@ -0,0 +1,637 @@
+dnl Serial 3 mfx/m4/acc.m4
+
+AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])
+
+AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
+AC_HEADER_TIME
+AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
+])
+
+AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
+AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
+])
+
+AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int16)
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(__int64)
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ptrdiff_t)
+])
+
+AC_DEFUN([mfx_ACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CFG_NO_CONFIG_HEADER 1
+#include "acc/acc.h"
+#include "acc/acc_incd.h"
+
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include "acc/acc_chk.ch"
+
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
+static void test_acc_compile_time_assert(void) {
+#include "acc/acc_chk.ch"
+}
+
+#undef NDEBUG
+#include <assert.h>
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) assert(expr);
+static int test_acc_run_time_assert(int r) {
+#include "acc/acc_chk.ch"
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])
+
+dnl Serial 3 mfx/m4/acc_miniacc.m4
+
+AC_DEFUN([mfx_MINIACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CFG_NO_CONFIG_HEADER 1
+#define ACC_WANT_ACC_INCD_H 1
+#include $2
+
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#define ACC_WANT_ACC_CHK_CH 1
+#include $2
+
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
+static void test_acc_compile_time_assert(void) {
+#define ACC_WANT_ACC_CHK_CH 1
+#include $2
+}
+
+#undef NDEBUG
+#include <assert.h>
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) assert(expr);
+static int test_acc_run_time_assert(int r) {
+#define ACC_WANT_ACC_CHK_CH 1
+#include $2
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])
+
+dnl Serial 2 mfx/m4/cppflags.m4
+
+AC_DEFUN([mfx_PROG_CPPFLAGS], [
+AC_MSG_CHECKING([whether the C preprocessor needs special flags])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# include "your C preprocessor is broken 1"
+#elif (0xffffu == 0xfffffffful)
+# include "your C preprocessor is broken 2"
+#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
+# include "your C preprocessor is broken 3"
+#endif
+]], [[ ]]
+)])
+
+mfx_save_CPPFLAGS=$CPPFLAGS
+mfx_tmp=ERROR
+for mfx_arg in "" -no-cpp-precomp
+do
+ CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
+ _AC_COMPILE_IFELSE([],
+[mfx_tmp=$mfx_arg
+break])
+done
+CPPFLAGS=$mfx_save_CPPFLAGS
+rm -f conftest.$ac_ext conftest.$ac_objext
+case x$mfx_tmp in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xERROR)
+ AC_MSG_RESULT([ERROR])
+ AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
+ ;;
+ *)
+ AC_MSG_RESULT([$mfx_tmp])
+ CPPFLAGS="$mfx_tmp $CPPFLAGS"
+ ;;
+esac
+])
+
+dnl Serial 13 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+#
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for 'stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ AC_DEFINE([_NETBSD_SOURCE], [1],
+ [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
+ fi
+
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_DARWIN_C_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])
+ test $ac_cv_should_define__xopen_source = yes &&
+ AC_DEFINE([_XOPEN_SOURCE], [500])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+ dnl gnulib does not need it. But if it gets required by third-party macros
+ dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+ dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+ dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+dnl Serial 4 mfx/m4/limits.m4
+
+AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
+AC_CACHE_CHECK([whether limits.h is sane],
+mfx_cv_header_sane_limits_h,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# if defined(__APPLE__) && defined(__GNUC__)
+# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
+# else
+# include "your preprocessor is broken"
+# endif
+#endif
+#define MFX_0xffff 0xffff
+#define MFX_0xffffffffL 4294967295ul
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+# include "error CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX)
+# include "error UCHAR_MAX 1"
+#endif
+#if !defined(USHRT_MAX)
+# include "error USHRT_MAX 1"
+#endif
+#if !defined(UINT_MAX)
+# include "error UINT_MAX 1"
+#endif
+#if !defined(ULONG_MAX)
+# include "error ULONG_MAX 1"
+#endif
+#if !defined(SHRT_MAX)
+# include "error SHRT_MAX 1"
+#endif
+#if !defined(INT_MAX)
+# include "error INT_MAX 1"
+#endif
+#if !defined(LONG_MAX)
+# include "error LONG_MAX 1"
+#endif
+#if (UCHAR_MAX < 1)
+# include "error UCHAR_MAX 2"
+#endif
+#if (USHRT_MAX < 1)
+# include "error USHRT_MAX 2"
+#endif
+#if (UINT_MAX < 1)
+# include "error UINT_MAX 2"
+#endif
+#if (ULONG_MAX < 1)
+# include "error ULONG_MAX 2"
+#endif
+#if (UCHAR_MAX < 0xff)
+# include "error UCHAR_MAX 3"
+#endif
+#if (USHRT_MAX < MFX_0xffff)
+# include "error USHRT_MAX 3"
+#endif
+#if (UINT_MAX < MFX_0xffff)
+# include "error UINT_MAX 3"
+#endif
+#if (ULONG_MAX < MFX_0xffffffffL)
+# include "error ULONG_MAX 3"
+#endif
+#if (USHRT_MAX > UINT_MAX)
+# include "error USHRT_MAX vs UINT_MAX"
+#endif
+#if (UINT_MAX > ULONG_MAX)
+# include "error UINT_MAX vs ULONG_MAX"
+#endif
+]], [[
+#if (USHRT_MAX == MFX_0xffff)
+{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
+#elif (USHRT_MAX >= MFX_0xffff)
+{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
+#endif
+#if (UINT_MAX == MFX_0xffff)
+{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
+#elif (UINT_MAX >= MFX_0xffff)
+{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffff)
+{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
+#elif (ULONG_MAX >= MFX_0xffff)
+{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
+#endif
+#if !defined(_CRAY1) /* CRAY PVP systems */
+#if (USHRT_MAX == MFX_0xffffffffL)
+{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
+#elif (USHRT_MAX >= MFX_0xffffffffL)
+{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
+#endif
+#endif /* _CRAY1 */
+#if (UINT_MAX == MFX_0xffffffffL)
+{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
+#elif (UINT_MAX >= MFX_0xffffffffL)
+{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffffffffL)
+{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
+#elif (ULONG_MAX >= MFX_0xffffffffL)
+{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
+#endif
+]])],
+[mfx_cv_header_sane_limits_h=yes],
+[mfx_cv_header_sane_limits_h=no])])
+])
+
+dnl Serial 2 mfx/m4/lzo.m4
+
+AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])
+
+dnl Serial 2 mfx/m4/lzo_lzochk.m4
+
+AC_DEFUN([mfx_LZO_LZOCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the LZO conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define LZO_CFG_NO_CONFIG_HEADER 1
+#define LZO_WANT_ACC_INCD_H 1
+#include $2
+#include $3
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+static void test_lzo_compile_time_assert(void) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+}
+
+#undef NDEBUG
+#include <assert.h>
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) assert(expr);
+static int test_lzo_run_time_assert(int r) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include $3
+return r;
+}
+]], [[
+test_lzo_compile_time_assert();
+if (test_lzo_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the LZO conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([LZO conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])
+
+dnl Serial 2 mfx/m4/mfx.m4
+
+AC_DEFUN([mfx_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(intmax_t)
+AC_CHECK_SIZEOF(uintmax_t)
+AC_CHECK_SIZEOF(intptr_t)
+AC_CHECK_SIZEOF(uintptr_t)
+
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+
+AC_CHECK_SIZEOF(dev_t)
+AC_CHECK_SIZEOF(fpos_t)
+AC_CHECK_SIZEOF(mode_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(ssize_t)
+AC_CHECK_SIZEOF(time_t)
+])#
+
+AC_DEFUN([mfx_CHECK_LIB_WINMM], [
+if test "X$GCC" = Xyes; then
+case $host_os in
+cygwin* | mingw* | pw32*)
+ test "X$LIBS" != "X" && LIBS="$LIBS "
+ LIBS="${LIBS}-lwinmm" ;;
+esac
+fi
+])
+
+dnl Serial 2 mfx/m4/nrv.m4
+
+AC_DEFUN([mfx_NRV_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(NRV_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(NRV_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2014 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 From Paul Eggert.
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+AC_DEFUN([gl_STAT_TIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+ AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+ [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+ ]],
+ [[
+ st.st_atim = ts;
+ ]])],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+ AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+ [Define to 1 if the type of the st_atim member of a struct stat is
+ struct timespec.])
+ fi],
+ [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported. See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+AC_DEFUN([gl_STAT_BIRTHTIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
+
+dnl Serial 2 mfx/m4/ucl.m4
+
+AC_DEFUN([mfx_UCL_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(UCL_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(UCL_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/ltmain.sh b/ics-openvpn-stripped/main/lzo/autoconf/ltmain.sh
new file mode 100644
index 00000000..a50a21a6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/ltmain.sh
@@ -0,0 +1,10932 @@
+#! /bin/sh
+
+# libtool (GNU libtool) 2.4.2.418
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996-2013 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.
+
+# 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2.418
+package_revision=2.4.2.418
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2013-08-23.20; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2013 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.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test set = \"\${$_G_var+set}\"; then
+ save_$_G_var=\$$_G_var
+ $_G_var=C
+ export $_G_var
+ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+ fi"
+done
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp $nl"
+
+# There are still modern systems that have problems with 'echo' mis-
+# handling backslashes, among others, so make sure $bs_echo is set to a
+# command that correctly interprets backslashes.
+# (this code from Autoconf 2.68)
+
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='print -r --'
+ bs_echo_n='print -rn --'
+elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='printf %s\n'
+ bs_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then
+ bs_echo_body='eval /usr/ucb/echo -n "$1$nl"'
+ bs_echo_n='/usr/ucb/echo -n'
+ else
+ bs_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ bs_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$nl"*)
+ expr "X$arg" : "X\\(.*\\)$nl";
+ arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$nl"
+ '
+ export bs_echo_n_body
+ bs_echo_n='sh -c $bs_echo_n_body bs_echo'
+ fi
+ export bs_echo_body
+ bs_echo='sh -c $bs_echo_body bs_echo'
+fi
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables. These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="$bs_echo"}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# 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.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same. If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion. Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+ s/$_G_bs4/&\\
+/g
+ s/^$_G_bs2$_G_dollar/$_G_bs&/
+ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+ s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+# exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$bs_echo "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"`
+ progdir=`cd "$progdir" && pwd`
+ progpath=$progdir/$progname
+ ;;
+ *)
+ _G_IFS=$IFS
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS=$_G_IFS
+ test -x "$progdir/$progname" && break
+ done
+ IFS=$_G_IFS
+ test -n "$progdir" || progdir=`pwd`
+ progpath=$progdir/$progname
+ ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available. Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'. Set
+# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+ $debug_cmd
+
+ test -t 1 && {
+ # COLORTERM and USE_ANSI_COLORS environment variables take
+ # precedence, because most terminfo databases neglect to describe
+ # whether color sequences are supported.
+ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+ if test 1 = "$USE_ANSI_COLORS"; then
+ # Standard ANSI escape sequences
+ tc_reset=''
+ tc_bold=''; tc_standout=''
+ tc_red=''; tc_green=''
+ tc_blue=''; tc_cyan=''
+ else
+ # Otherwise trust the terminfo database after all.
+ test -n "`tput sgr0 2>/dev/null`" && {
+ tc_reset=`tput sgr0`
+ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+ tc_standout=$tc_bold
+ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+ }
+ fi
+ }
+
+ require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+ # We should try to minimise forks, especially on Windows where they are
+ # unreasonably slow, so skip the feature probes when bash or zsh are
+ # being used:
+ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+ : ${_G_HAVE_ARITH_OP="yes"}
+ : ${_G_HAVE_XSI_OPS="yes"}
+ # The += operator was introduced in bash 3.1
+ case $BASH_VERSION in
+ [12].* | 3.0 | 3.0*) ;;
+ *)
+ : ${_G_HAVE_PLUSEQ_OP="yes"}
+ ;;
+ esac
+ fi
+
+ # _G_HAVE_PLUSEQ_OP
+ # Can be empty, in which case the shell is probed, "yes" if += is
+ # useable or anything else if it does not work.
+ test -z "$_G_HAVE_PLUSEQ_OP" \
+ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+ && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_append ()
+ {
+ $debug_cmd
+
+ eval "$1+=\$2"
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_append ()
+ {
+ $debug_cmd
+
+ eval "$1=\$$1\$2"
+ }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+ eval 'func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1+=\\ \$func_quote_for_eval_result"
+ }'
+else
+ func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE. For example:
+#
+# func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+ $debug_cmd
+
+ eval _G_current_value='`$bs_echo $'$1'`'
+ _G_delim=`expr "$2" : '\(.\)'`
+
+ case $_G_delim$_G_current_value$_G_delim in
+ *"$2$_G_delim"*) ;;
+ *) func_append "$@" ;;
+ esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+ test -z "$_G_HAVE_ARITH_OP" \
+ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+ && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+ eval 'func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=$(( $* ))
+ }'
+else
+ func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=`expr "$@"`
+ }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ # If this shell supports suffix pattern removal, then use it to avoid
+ # forking. Hide the definitions single quotes in case the shell chokes
+ # on unsupported syntax...
+ _b='func_basename_result=${1##*/}'
+ _d='case $1 in
+ */*) func_dirname_result=${1%/*}$2 ;;
+ * ) func_dirname_result=$3 ;;
+ esac'
+
+else
+ # ...otherwise fall back to using sed.
+ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
+ if test "X$func_dirname_result" = "X$1"; then
+ func_dirname_result=$3
+ else
+ func_append func_dirname_result "$2"
+ fi'
+fi
+
+eval 'func_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+ $debug_cmd
+
+ '"$_d"'
+}'
+
+
+# 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"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+ '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $bs_echo "$progname: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ _G_infix=$1; shift
+ _G_indent=$_G_infix
+ _G_prefix="$progname: $_G_infix: "
+ _G_message=$*
+
+ # Strip color escape sequences before counting printable length
+ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+ do
+ test -n "$_G_tc" && {
+ _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"`
+ _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"`
+ }
+ done
+ _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
+
+ func_echo_infix_1_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_infix_1_IFS
+ $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+ _G_prefix=$_G_indent
+ done
+ IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ $debug_cmd
+
+ func_error "$*"
+ exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $debug_cmd
+
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+ test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=${#1}
+ }'
+else
+ func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+ }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ $debug_cmd
+
+ _G_directory_path=$1
+ _G_dir_list=
+
+ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+ # Protect directory names starting with '-'
+ case $_G_directory_path in
+ -*) _G_directory_path=./$_G_directory_path ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$_G_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ _G_dir_list=$_G_directory_path:$_G_dir_list
+
+ # If the last portion added has no slash in it, the list is done
+ case $_G_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+ done
+ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+ func_mkdir_p_IFS=$IFS; IFS=:
+ for _G_dir in $_G_dir_list; do
+ IFS=$func_mkdir_p_IFS
+ # mkdir can fail with a 'File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$_G_dir" 2>/dev/null || :
+ done
+ IFS=$func_mkdir_p_IFS
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$_G_directory_path" || \
+ func_fatal_error "Failed to create '$1'"
+ fi
+}
+
+
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
+{
+ $debug_cmd
+
+ _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+ if test : = "$opt_dry_run"; then
+ # Return a directory name, but don't create it in dry-run mode
+ _G_tmpdir=$_G_template-$$
+ else
+
+ # If mktemp works, use that first and foremost
+ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$_G_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+ func_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$_G_tmpdir"
+ umask $func_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$_G_tmpdir" || \
+ func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+ fi
+
+ $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+ $debug_cmd
+
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ _G_pathcar='s|^/\([^/]*\).*$|\1|'
+ _G_pathcdr='s|^/[^/]*||'
+ _G_removedotparts=':dotsl
+ s|/\./|/|g
+ t dotsl
+ s|/\.$|/|'
+ _G_collapseslashes='s|/\{1,\}|/|g'
+ _G_finalslash='s|/*$|/|'
+
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test / = "$func_normal_abspath_tpath"; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result"; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+ $debug_cmd
+
+ $opt_quiet || func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+ $debug_cmd
+
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=$func_dirname_result
+ if test -z "$func_relative_path_tlibdir"; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test -n "$func_stripname_result"; then
+ func_append func_relative_path_result "/$func_stripname_result"
+ fi
+
+ # Normalisation. If bindir is libdir, return '.' else relative path.
+ if test -n "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ fi
+
+ test -n "$func_relative_path_result" || func_relative_path_result=.
+
+ :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+# i) func_quote_for_eval_result
+# double-quoted, suitable for a subsequent eval
+# ii) func_quote_for_eval_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified.
+func_quote_for_eval ()
+{
+ $debug_cmd
+
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+ case $1 in
+ *[\\\`\"\$]*)
+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+ *)
+ _G_unquoted_arg=$1 ;;
+ esac
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ fi
+
+ case $_G_unquoted_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_quoted_arg=\"$_G_unquoted_arg\"
+ ;;
+ *)
+ _G_quoted_arg=$_G_unquoted_arg
+ ;;
+ esac
+
+ if test -n "$func_quote_for_eval_result"; then
+ func_append func_quote_for_eval_result " $_G_quoted_arg"
+ else
+ func_append func_quote_for_eval_result "$_G_quoted_arg"
+ fi
+ shift
+ done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ $debug_cmd
+
+ case $1 in
+ *[\\\`\"]*)
+ _G_arg=`$ECHO "$1" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ _G_arg=$1 ;;
+ esac
+
+ case $_G_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_arg=\"$_G_arg\"
+ ;;
+ esac
+
+ func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# 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).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_stripname ()
+ {
+ $debug_cmd
+
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary variable first.
+ func_stripname_result=$3
+ func_stripname_result=${func_stripname_result#"$1"}
+ func_stripname_result=${func_stripname_result%"$2"}
+ }'
+else
+ func_stripname ()
+ {
+ $debug_cmd
+
+ case $2 in
+ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+ esac
+ }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ $debug_cmd
+
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
+
+ func_quote_for_expand "$_G_cmd"
+ eval "func_notquiet $func_quote_for_expand_result"
+
+ $opt_dry_run || {
+ eval "$_G_cmd"
+ _G_status=$?
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
+ fi
+ }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ $debug_cmd
+
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
+
+ $opt_quiet || {
+ func_quote_for_expand "$_G_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ $opt_dry_run || {
+ eval "$_G_user_locale
+ $_G_cmd"
+ _G_status=$?
+ eval "$_G_safe_locale"
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
+ fi
+ }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ $debug_cmd
+
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $debug_cmd
+
+ $opt_verbose && func_echo "$*"
+
+ :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+ $debug_cmd
+
+ # CATEGORY must be in the warning_categories list!
+ case " $warning_categories " in
+ *" $1 "*) ;;
+ *) func_internal_error "invalid warning category '$1'" ;;
+ esac
+
+ _G_category=$1
+ shift
+
+ case " $opt_warning_types " in
+ *" $_G_category "*) $warning_func ${1+"$@"} ;;
+ esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+ $debug_cmd
+
+ ver1=$1
+ ver2=$2
+
+ # Split on '.' and compare each component.
+ i=1
+ while :; do
+ p1=`echo "$ver1" |cut -d. -f$i`
+ p2=`echo "$ver2" |cut -d. -f$i`
+ if test ! "$p1"; then
+ echo "$1 $2"
+ break
+ elif test ! "$p2"; then
+ echo "$2 $1"
+ break
+ elif test ! "$p1" = "$p2"; then
+ if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison
+ echo "$2 $1"
+ elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison
+ echo "$1 $2"
+ else # numeric, then lexicographic comparison
+ lp=`printf "$p1\n$p2\n" |sort -n |tail -n1`
+ if test "$lp" = "$p2"; then
+ echo "$1 $2"
+ else
+ echo "$2 $1"
+ fi
+ fi
+ break
+ fi
+ i=`expr $i + 1`
+ done
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2012-10-21.11; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2013 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.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+# #!/bin/sh
+# . relative/path/to/funclib.sh
+# . relative/path/to/options-parser
+# scriptversion=1.0
+# func_options ${1+"$@"}
+# eval set dummy "$func_options_result"; shift
+# ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'. Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+ --debug enable verbose shell tracing
+ -W, --warnings=CATEGORY
+ report the warnings falling in CATEGORY [all]
+ -v, --verbose verbosely report processing
+ --version print version information and exit
+ -h, --help print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+ 'all' show all warnings
+ 'none' turn off all the warnings
+ 'error' warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code. A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+ $debug_cmd
+
+ func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not accept hook functions." ;;
+ esac
+
+ eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+ $debug_cmd
+
+ eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ esac
+
+ eval _G_hook_fns=\$$1_hooks; shift
+
+ for _G_hook in $_G_hook_fns; do
+ eval $_G_hook '"$@"'
+
+ # store returned options list back into positional
+ # parameters for next 'cmd' execution.
+ eval _G_hook_result=\$${_G_hook}_result
+ eval set dummy "$_G_hook_result"; shift
+ done
+
+ func_quote_for_eval ${1+"$@"}
+ func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'. Like this:
+#
+# my_options_prep ()
+# {
+# $debug_cmd
+#
+# # Extend the existing usage message.
+# usage_message=$usage_message'
+# -s, --silent don'\''t print informational messages
+# '
+#
+# func_quote_for_eval ${1+"$@"}
+# my_options_prep_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_options_prep my_options_prep
+#
+#
+# my_silent_option ()
+# {
+# $debug_cmd
+#
+# # Note that for efficiency, we parse as many options as we can
+# # recognise in a loop before passing the remainder back to the
+# # caller on the first unrecognised argument we encounter.
+# while test $# -gt 0; do
+# opt=$1; shift
+# case $opt in
+# --silent|-s) opt_silent=: ;;
+# # Separate non-argument short options:
+# -s*) func_split_short_opt "$_G_opt"
+# set dummy "$func_split_short_opt_name" \
+# "-$func_split_short_opt_arg" ${1+"$@"}
+# shift
+# ;;
+# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# esac
+# done
+#
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_parse_options my_silent_option
+#
+#
+# my_option_validation ()
+# {
+# $debug_cmd
+#
+# $opt_silent && $opt_verbose && func_fatal_help "\
+# '--silent' and '--verbose' options are mutually exclusive."
+#
+# func_quote_for_eval ${1+"$@"}
+# my_option_validation_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse. It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+ $debug_cmd
+
+ func_options_prep ${1+"$@"}
+ eval func_parse_options \
+ ${func_options_prep_result+"$func_options_prep_result"}
+ eval func_validate_options \
+ ${func_parse_options_result+"$func_parse_options_result"}
+
+ eval func_run_hooks func_options \
+ ${func_validate_options_result+"$func_validate_options_result"}
+
+ # save modified positional parameters for caller
+ func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters. If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+ $debug_cmd
+
+ # Option defaults:
+ opt_verbose=false
+ opt_warning_types=
+
+ func_run_hooks func_options_prep ${1+"$@"}
+
+ # save modified positional parameters for caller
+ func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+ $debug_cmd
+
+ func_parse_options_result=
+
+ # this just eases exit handling
+ while test $# -gt 0; do
+ # Defer to hook functions for initial option parsing, so they
+ # get priority in the event of reusing an option name.
+ func_run_hooks func_parse_options ${1+"$@"}
+
+ # Adjust func_parse_options positional parameters to match
+ eval set dummy "$func_run_hooks_result"; shift
+
+ # Break out of the loop if we already parsed every option.
+ test $# -gt 0 || break
+
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --debug|-x) debug_cmd='set -x'
+ func_echo "enabling shell trace mode"
+ $debug_cmd
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ set dummy --warnings none ${1+"$@"}
+ shift
+ ;;
+
+ --warnings|--warning|-W)
+ test $# = 0 && func_missing_arg $_G_opt && break
+ case " $warning_categories $1" in
+ *" $1 "*)
+ # trailing space prevents matching last $1 above
+ func_append_uniq opt_warning_types " $1"
+ ;;
+ *all)
+ opt_warning_types=$warning_categories
+ ;;
+ *none)
+ opt_warning_types=none
+ warning_func=:
+ ;;
+ *error)
+ opt_warning_types=$warning_categories
+ warning_func=func_fatal_error
+ ;;
+ *)
+ func_fatal_error \
+ "unsupported warning category: '$1'"
+ ;;
+ esac
+ shift
+ ;;
+
+ --verbose|-v) opt_verbose=: ;;
+ --version) func_version ;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+
+ # Separate optargs to long options (plugins may need this):
+ --*=*) func_split_equals "$_G_opt"
+ set dummy "$func_split_equals_lhs" \
+ "$func_split_equals_rhs" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate optargs to short options:
+ -W*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-v*|-x*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+ $debug_cmd
+
+ # Display all warnings if -W was not given.
+ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+ func_run_hooks func_validate_options ${1+"$@"}
+
+ # Bail if the options were screwed!
+ $exit_cmd $EXIT_FAILURE
+
+ # save modified positional parameters for caller
+ func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ------------------##
+## Helper functions. ##
+## ------------------##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ $debug_cmd
+
+ eval \$bs_echo \""Usage: $usage"\"
+ eval \$bs_echo \""$fatal_help"\"
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $bs_echo "$long_help_message"
+ exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $debug_cmd
+
+ func_error "Missing argument for '$1'."
+ exit_cmd=exit
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=${1%%=*}
+ func_split_equals_rhs=${1#*=}
+ test "x$func_split_equals_lhs" = "x$1" \
+ && func_split_equals_rhs=
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+ func_split_equals_rhs=
+ test "x$func_split_equals_lhs" = "x$1" \
+ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+ }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+ }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $bs_echo "Run '$progname --help |${PAGER-more}' for full usage"
+ exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+ $debug_cmd
+
+ eval \$bs_echo \""Usage: $usage"\"
+ echo
+ $SED -n 's|^# ||
+ /^Written by/{
+ x;p;x
+ }
+ h
+ /^Written by/q' < "$progpath"
+ echo
+ eval \$bs_echo \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ printf '%s\n' "$progname $scriptversion"
+ $SED -n '/^##/q
+ /(C)/!b go
+ :more
+ /\./!{
+ N
+ s|\n# | |
+ b more
+ }
+ :go
+ /^# Written by /,/# warranty; / {
+ s|^# ||
+ s|^# *$||
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ p
+ }
+ /^# Written by / {
+ s|^# ||
+ p
+ }
+ /^warranty; /q' < "$progpath"
+
+ exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.2.418'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ $debug_cmd
+
+ $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+ --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
+ --mode=MODE use operation mode MODE
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message=$long_help_message"
+
+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. When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+ host-triplet: $host
+ shell: $SHELL
+ compiler: $LTCC
+ compiler flags: $LTCFLAGS
+ linker: $LD (gnu? $with_gnu_ld)
+ version: $progname (GNU libtool) 2.4.2.418
+ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_lo2o ()
+ {
+ case $1 in
+ *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+ * ) func_lo2o_result=$1 ;;
+ esac
+ }'
+
+ # func_xform LIBOBJ-OR-SOURCE
+ # ---------------------------
+ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+ # suffix to a '.lo' libtool-object suffix.
+ eval 'func_xform ()
+ {
+ func_xform_result=${1%.*}.lo
+ }'
+else
+ # ...otherwise fall back to using sed.
+ func_lo2o ()
+ {
+ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+ }
+
+ func_xform ()
+ {
+ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+ }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func__fatal_error ${1+"$@"} \
+ "See the $PACKAGE documentation for more information." \
+ "Fatal configuration error."
+}
+
+
+# func_config
+# -----------
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+
+# func_features
+# -------------
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test yes = "$build_libtool_libs"; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test yes = "$build_old_libs"; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+
+# func_enable_tag TAGNAME
+# -----------------------
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname=$1
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf=/$re_begincf/,/$re_endcf/p
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+
+# func_check_version_match
+# ------------------------
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+ $debug_mode
+
+ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+ opt_help=false
+ opt_mode=
+ opt_preserve_dup_deps=false
+ opt_quiet=false
+
+ nonopt=
+ preserve_args=
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Pass back the list of options.
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
+
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+ $debug_cmd
+
+ # Perform our own loop to consume as many options as possible in
+ # each iteration.
+ while test $# -gt 0; do
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+
+ --config) func_config ;;
+
+ --dlopen|-dlopen)
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=: ;;
+
+ --features) func_features ;;
+
+ --finish) set dummy --mode finish ${1+"$@"}; shift ;;
+
+ --help) opt_help=: ;;
+
+ --help-all) opt_help=': help-all' ;;
+
+ --mode) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_mode=$1
+ case $1 in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $_G_opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+ shift
+ ;;
+
+ --no-silent|--no-quiet)
+ opt_quiet=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ opt_warning=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-verbose)
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --silent|--quiet)
+ opt_quiet=:
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --tag) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_tag=$1
+ func_append preserve_args " $_G_opt $1"
+ func_enable_tag "$1"
+ shift
+ ;;
+
+ --verbose|-v) opt_quiet=false
+ opt_verbose=:
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+ # save first non-option argument
+ if test 0 -lt $#; then
+ nonopt=$1
+ shift
+ fi
+
+ # preserve --debug
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ test yes != "$build_libtool_libs" \
+ && test yes != "$build_old_libs" \
+ && func_fatal_configuration "not configured to build any kind of library"
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+ func_error "unrecognized option '-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
+
+ # Pass back the unparsed argument list
+ func_quote_for_eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# 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=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_lalib_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if 'file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case $lalib_p_line in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test yes = "$lalib_p"
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $debug_cmd
+
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$sp$nl
+ eval cmd=\"$cmd\"
+ IFS=$save_ifs
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# 'FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $debug_cmd
+
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case $lt_sysroot:$1 in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result='='$func_stripname_result
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $debug_cmd
+
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with '--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=$1
+ if test yes = "$build_libtool_libs"; then
+ write_lobj=\'$2\'
+ else
+ write_lobj=none
+ fi
+
+ if test yes = "$build_old_libs"; then
+ write_oldobj=\'$3\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "$write_libobj"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $debug_cmd
+
+ func_convert_core_file_wine_to_w32_result=$1
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $debug_cmd
+
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result"; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $debug_cmd
+
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $debug_cmd
+
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $debug_cmd
+
+ if test -z "$2" && test -n "$1"; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result=$1
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $debug_cmd
+
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " '$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result=$3
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $debug_cmd
+
+ case $4 in
+ $1 ) func_to_host_path_result=$3$func_to_host_path_result
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via '$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $debug_cmd
+
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $debug_cmd
+
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result=$1
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_msys_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via '$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $debug_cmd
+
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd=func_convert_path_$func_stripname_result
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $debug_cmd
+
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result=$1
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_msys_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+ $debug_cmd
+
+ func_dll_def_p_tmp=`$SED -n \
+ -e 's/^[ ]*//' \
+ -e '/^\(;.*\)*$/d' \
+ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
+ -e q \
+ "$1"`
+ test DEF = "$func_dll_def_p_tmp"
+}
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $debug_cmd
+
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile=$nonopt # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg=$arg
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj=$arg
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify '-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs=$IFS; IFS=,
+ for arg in $args; do
+ IFS=$save_ifs
+ func_append_quoted lastarg "$arg"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg=$srcfile
+ srcfile=$arg
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with '-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj=$func_basename_result
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from '$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test yes = "$build_libtool_libs" \
+ || func_fatal_configuration "cannot build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name '$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname=$func_basename_result
+ xdir=$func_dirname_result
+ lobj=$xdir$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test yes = "$build_old_libs"; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+ lockfile=$output_obj.lock
+ else
+ output_obj=
+ 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 yes = "$need_locks"; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test warn = "$need_locks"; 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."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test yes = "$build_libtool_libs"; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test no != "$pic_mode"; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test warn = "$need_locks" &&
+ 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."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test yes = "$suppress_opt"; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test yes = "$build_old_libs"; then
+ if test yes != "$pic_mode"; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test yes = "$compiler_c_o"; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test warn = "$need_locks" &&
+ 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."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test no != "$need_locks"; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [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: $progname [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
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a '.o' file suitable for static linking
+ -static only build a '.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [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
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -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
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -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
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+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: $progname [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."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode '$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try '$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test : = "$opt_help"; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $debug_cmd
+
+ # The first argument is the command name.
+ cmd=$nonopt
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "'$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "'$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "'$file' was not linked with '-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+ ;;
+
+ *)
+ func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
+ 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
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file=$progdir/$program
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file=$progdir/$program
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if $opt_dry_run; then
+ # 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 $EXIT_SUCCESS
+ else
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd=\$cmd$args
+ fi
+}
+
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $debug_cmd
+
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "'$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument '$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_quiet && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ 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"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $debug_cmd
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac
+ then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=false
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=: ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test X-m = "X$prev" && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the '$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=:
+ if $isdir; then
+ destdir=$dest
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir=$func_dirname_result
+ destname=$func_basename_result
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "'$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "'$destdir' must be an absolute directory name"
+ ;;
+ 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.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "'$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir=$func_dirname_result
+ func_append 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 -e "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.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
+
+ 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
+
+ func_warning "relinking '$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname=$1
+ shift
+
+ srcname=$realname
+ test -n "$relink_command" && srcname=${realname}T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme=$stripme
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try 'ln -sf' first, because the 'ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib=$destdir/$realname
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name=$func_basename_result
+ instname=$dir/${name}i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append 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
+ func_basename "$file"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest=$destfile
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to '$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test yes = "$build_old_libs"; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile=$destdir/$destname
+ else
+ func_basename "$file"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=.exe
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script '$wrapper'"
+
+ finalize=:
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "'$lib' has not been installed in '$libdir'"
+ finalize=false
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test no = "$fast_install" && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if $finalize; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file=$func_basename_result
+ outputname=$tmpdir/$file
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_quiet || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink '$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file=$outputname
+ else
+ func_warning "cannot relink '$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name=$func_basename_result
+
+ # Set up the ranlib parameters.
+ oldlib=$destdir/$name
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run '$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $debug_cmd
+
+ my_outputname=$1
+ my_originator=$2
+ my_pic_p=${3-false}
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms=${my_outputname}S.c
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist=$output_objdir/$my_outputname.nm
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test yes = "$dlself"; then
+ func_verbose "generating symbol list for '$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols=$output_objdir/$outputname.exp
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from '$dlprefile'"
+ func_basename "$dlprefile"
+ name=$func_basename_result
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname"; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename=$func_basename_result
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename"; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # 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/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ func_show_eval '$RM "${nlist}I"'
+ if test -n "$global_symbol_to_import"; then
+ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+ for (; symbol->name; ++symbol)
+ {"
+ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+ echo >> "$output_objdir/$my_dlsyms" "\
+ }
+}"
+ fi
+ echo >> "$output_objdir/$my_dlsyms" "\
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{ {\"$my_originator\", (void *) 0},"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {\"@INIT@\", (void *) &lt_syminit},"
+ fi
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ 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*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj=$output_objdir/${my_outputname}S.$objext
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for '$my_dlsyms'"
+ ;;
+ 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 "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $debug_cmd
+
+ win32_libid_type=unknown
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ case $nm_interface in
+ "MS dumpbin")
+ if func_cygming_ms_implib_p "$1" ||
+ func_cygming_gnu_implib_p "$1"
+ then
+ win32_nmres=import
+ else
+ win32_nmres=
+ fi
+ ;;
+ *)
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s|.*|import|
+ p
+ q
+ }
+ }'`
+ ;;
+ esac
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $debug_cmd
+
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $debug_cmd
+
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive that possess that section. Heuristic: eliminate
+ # all those that have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $debug_cmd
+
+ if func_cygming_gnu_implib_p "$1"; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1"; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $debug_cmd
+
+ f_ex_an_ar_dir=$1; shift
+ f_ex_an_ar_oldlib=$1
+ if test yes = "$lock_old_archive_extraction"; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test yes = "$lock_old_archive_extraction"; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $debug_cmd
+
+ my_gentop=$1; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=
+ my_xlib=
+ my_xabs=
+ my_xdir=
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib=$func_basename_result
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir=$my_gentop/$my_xlib_u
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ func_basename "$darwin_archive"
+ darwin_base_archive=$func_basename_result
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches; do
+ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+ cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+ func_extract_an_archive "`pwd`" "$darwin_base_archive"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result=$my_oldobjs
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory where it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# 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.
+sed_quote_subst='$sed_quote_subst'
+
+# 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+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# 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
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ 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
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test yes = "$fast_install"; then
+ $ECHO "\
+ 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 "\
+
+ # 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 "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${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\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* declarations of non-ANSI functions */
+#if defined __MINGW32__
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined __CYGWIN__
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined other_platform || defined ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined _MSC_VER
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+#elif defined __MINGW32__
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined __CYGWIN__
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined other platforms ... */
+#endif
+
+#if defined PATH_MAX
+# define LT_PATHMAX PATH_MAX
+#elif defined MAXPATHLEN
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+ defined __OS2__
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free (stale); stale = 0; } \
+} while (0)
+
+#if defined LT_DEBUGWRAPPER
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test yes = "$fast_install"; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ int rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, (size_t) argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (STREQ (argv[i], dumpscript_opt))
+ {
+EOF
+ case $host in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (STREQ (argv[i], debug_opt))
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (STREQ (argv[i], ltwrapper_option_prefix))
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ size_t tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = (size_t) (q - p);
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (STREQ (str, pat))
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ size_t len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ size_t orig_value_len = strlen (orig_value);
+ size_t add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ size_t len = strlen (new_value);
+ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[--len] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $debug_cmd
+
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $debug_cmd
+
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # what system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll that 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
+ base_compile="$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=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=false
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module=$wl-single_module
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test yes != "$build_libtool_libs" \
+ && func_fatal_configuration "cannot build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_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
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir=$arg
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ $preload || {
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=:
+ }
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test no = "$dlself"; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test dlprefiles = "$prev"; then
+ dlself=yes
+ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test dlfiles = "$prev"; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols=$arg
+ test -f "$arg" \
+ || func_fatal_error "symbol file '$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex=$arg
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir=$arg
+ prev=
+ continue
+ ;;
+ mllvm)
+ # Clang does not use LLVM to link, so we can simply discard any
+ # '-mllvm $arg' options when doing the link step.
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ if test none != "$pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ pic_object=$xdir$pic_object
+
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test dlprefiles = "$prev"; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg=$pic_object
+ fi
+
+ # Non-PIC object.
+ if test none != "$non_pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object=$xdir$non_pic_object
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object=$pic_object
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "'$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file '$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex=$arg
+ prev=
+ continue
+ ;;
+ release)
+ release=-$arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test rpath = "$prev"; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds=$arg
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append 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
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "'-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ 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
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test X-export-symbols = "X$arg"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ 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* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between '-L' and '$1'"
+ else
+ func_fatal_error "need path for '-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of '$dir'"
+ dir=$absdir
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ # Do not include libc due to us having libc/libc_r.
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test X-lc = "X$arg" && continue
+ ;;
+ esac
+ elif test X-lc_r = "X$arg"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -mllvm)
+ prev=mllvm
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module=$wl-multi_module
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "'-no-install' is ignored for $host"
+ func_warning "assuming '-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # 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
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs=$IFS; IFS=,
+ for flag in $args; do
+ IFS=$save_ifs
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs=$IFS; IFS=,
+ for flag in $args; do
+ IFS=$save_ifs
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -stdlib=* select c++ std lib with clang
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ test none = "$pic_object" || {
+ # Prepend the subdirectory the object is found in.
+ pic_object=$xdir$pic_object
+
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test dlprefiles = "$prev"; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg=$pic_object
+ }
+
+ # Non-PIC object.
+ if test none != "$non_pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object=$xdir$non_pic_object
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object=$pic_object
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "'$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test dlfiles = "$prev"; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test dlprefiles = "$prev"; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ 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.
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the '$prevarg' option requires an argument"
+
+ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname=$func_basename_result
+ libobjs_save=$libobjs
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'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\"
+
+ func_dirname "$output" "/" ""
+ output_objdir=$func_dirname_result$objdir
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$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 $opt_preserve_dup_deps; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test lib = "$linkmode"; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ 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 dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=false
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test lib,link = "$linkmode,$pass"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs=$tmp_deplibs
+ fi
+
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass"; then
+ libs=$deplibs
+ deplibs=
+ fi
+ if test prog = "$linkmode"; then
+ case $pass in
+ dlopen) libs=$dlfiles ;;
+ dlpreopen) libs=$dlprefiles ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test lib,dlpreopen = "$linkmode,$pass"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs=$dlprefiles
+ fi
+ if test dlopen = "$pass"; then
+ # Collect dlpreopened libraries
+ save_deplibs=$deplibs
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=false
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test lib = "$linkmode"; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test lib != "$linkmode" && test prog != "$linkmode"; then
+ func_warning "'-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test lib = "$linkmode"; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib=$searchdir/lib$name$search_ext
+ if test -f "$lib"; then
+ if test .la = "$search_ext"; then
+ found=:
+ else
+ found=false
+ fi
+ break 2
+ fi
+ done
+ done
+ if $found; then
+ # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll=$l
+ done
+ if test "X$ll" = "X$old_library"; then # only static version available
+ found=false
+ func_dirname "$lib" "" "."
+ ladir=$func_dirname_result
+ lib=$ladir/$old_library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ else
+ # deplib doesn't seem to be a libtool library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ ;; # -l
+ *.ltframework)
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test lib = "$linkmode"; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test conv = "$pass" && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test scan = "$pass"; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "'-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test link = "$pass"; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=false
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=:
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=:
+ ;;
+ esac
+ if $valid_a_lib; then
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ else
+ 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 use here."
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test link != "$pass"; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ elif test prog = "$linkmode"; then
+ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=:
+ continue
+ ;;
+ esac # case $deplib
+
+ $found || test -f "$lib" \
+ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "'$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir=$func_dirname_result
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass" ||
+ { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test conv = "$pass"; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for '$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test prog != "$linkmode" && test lib != "$linkmode"; then
+ func_fatal_error "'$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test yes = "$prefer_static_libs" ||
+ test built,no = "$prefer_static_libs,$installed"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib=$l
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for '$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test dlopen = "$pass"; then
+ test -z "$libdir" \
+ && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+ if test -z "$dlname" ||
+ test yes != "$dlopen_support" ||
+ test no = "$build_libtool_libs"
+ then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append 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
+ func_warning "cannot determine absolute directory name of '$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir=$ladir
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname=$func_basename_result
+
+ # Find the relevant object directory and library name.
+ if test yes = "$installed"; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library '$lib' was moved."
+ dir=$ladir
+ absdir=$abs_ladir
+ libdir=$abs_ladir
+ else
+ dir=$lt_sysroot$libdir
+ absdir=$lt_sysroot$libdir
+ fi
+ test yes = "$hardcode_automatic" && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir=$ladir
+ absdir=$abs_ladir
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir=$ladir/$objdir
+ absdir=$abs_ladir/$objdir
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test dlpreopen = "$pass"; then
+ if test -z "$libdir" && test prog = "$linkmode"; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
+ fi
+ case $host in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test lib = "$linkmode"; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test prog = "$linkmode" && test link != "$pass"; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=false
+ if test no != "$link_all_deplibs" || test -z "$library_names" ||
+ test no = "$build_libtool_libs"; then
+ linkalldeplibs=:
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if $linkalldeplibs; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test prog,link = "$linkmode,$pass"; then
+ if test -n "$library_names" &&
+ { { test no = "$prefer_static_libs" ||
+ test built,yes = "$prefer_static_libs,$installed"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
+ # Make sure the rpath contains only unique directories.
+ case $temp_rpath: in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # 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 "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if $alldeplibs &&
+ { test pass_all = "$deplibs_check_method" ||
+ { test yes = "$build_libtool_libs" &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test built = "$use_static_libs" && test yes = "$installed"; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test no = "$installed"; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule=$dlpremoduletest
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
+ echo
+ if test prog = "$linkmode"; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test lib = "$linkmode" &&
+ test yes = "$hardcode_into_libs"; 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 "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname=$1
+ 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* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix=-$major
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname=$realname
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot=$soname
+ func_basename "$soroot"
+ soname=$func_basename_result
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from '$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for '$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ 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 prog = "$linkmode" || test relink != "$opt_mode"; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test no = "$hardcode_direct"; then
+ add=$dir/$linklib
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+ *-*-sysv4*uw2*) add_dir=-L$dir ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir=-L$dir ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we cannot
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library"; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add=$dir/$old_library
+ fi
+ elif test -n "$old_library"; then
+ add=$dir/$old_library
+ fi
+ fi
+ esac
+ elif test no = "$hardcode_minus_L"; then
+ case $host in
+ *-*-sunos*) add_shlibpath=$dir ;;
+ esac
+ add_dir=-L$dir
+ add=-l$name
+ elif test no = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$dir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$absdir
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test yes != "$lib_linked"; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test prog = "$linkmode"; 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 yes != "$hardcode_direct" &&
+ test yes != "$hardcode_minus_L" &&
+ test yes = "$hardcode_shlibpath_var"; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test prog = "$linkmode" || test relink = "$opt_mode"; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$libdir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$libdir
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add=-l$name
+ elif test yes = "$hardcode_automatic"; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib"; then
+ add=$inst_prefix_dir$libdir/$linklib
+ else
+ add=$libdir/$linklib
+ fi
+ 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
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add=-l$name
+ fi
+
+ if test prog = "$linkmode"; 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 prog = "$linkmode"; then
+ # 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then
+ # Not a shared library
+ if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test lib = "$linkmode"; then
+ if test -n "$dependency_libs" &&
+ { test yes != "$hardcode_into_libs" ||
+ test yes = "$build_old_libs" ||
+ test yes = "$link_static"; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs=$temp_deplibs
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test no != "$link_all_deplibs"; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path=$deplib ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of '$dir'"
+ absdir=$dir
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names"; then
+ for tmp in $deplibrary_names; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl"; then
+ depdepl=$absdir/$objdir/$depdepl
+ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path=-L$absdir/$objdir
+ ;;
+ esac
+ else
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "'$deplib' seems to be moved"
+
+ path=-L$absdir
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test link = "$pass"; then
+ if test prog = "$linkmode"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs=$newdependency_libs
+ if test dlpreopen = "$pass"; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test dlopen != "$pass"; then
+ test conv = "$pass" || {
+ # 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 "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ }
+
+ if test prog,link = "$linkmode,$pass"; then
+ vars="compile_deplibs finalize_deplibs"
+ else
+ vars=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
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ 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 "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=
+ ;;
+ esac
+ if test -n "$i"; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test prog = "$linkmode"; then
+ dlfiles=$newdlfiles
+ fi
+ if test prog = "$linkmode" || test lib = "$linkmode"; then
+ dlprefiles=$newdlprefiles
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "'-l' and '-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "'-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "'-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "'-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs=$output
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form 'libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test no = "$module" \
+ && func_fatal_help "libtool library '$output' must begin with 'lib'"
+
+ if test no != "$need_lib_prefix"; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test pass_all != "$deplibs_check_method"; then
+ func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test no = "$dlself" \
+ || func_warning "'-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test 1 -lt "$#" \
+ && func_warning "ignoring multiple '-rpath's for a libtool library"
+
+ install_libdir=$1
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test yes = "$build_libtool_libs"; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a '.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs=$IFS; IFS=:
+ set dummy $vinfo 0 0 0
+ shift
+ IFS=$save_ifs
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to '-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major=$1
+ number_minor=$2
+ number_revision=$3
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # that has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age=$number_minor
+ revision=$number_revision
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current=$number_major
+ revision=$number_minor
+ age=0
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age=$number_minor
+ revision=$number_minor
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current=$1
+ revision=$2
+ age=$3
+ ;;
+ esac
+
+ # 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT '$current' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION '$revision' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE '$age' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE '$age' is greater than the current interface number '$current'"
+ func_fatal_error "'$vinfo' is not valid version information"
+ 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
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ # On Darwin other compilers
+ case $CC in
+ nagfor*)
+ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ ;;
+ *)
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+ esac
+ ;;
+
+ freebsd-aout)
+ major=.$current
+ versuffix=.$current.$revision
+ ;;
+
+ freebsd-elf)
+ major=.$current
+ versuffix=.$current
+ ;;
+
+ irix | nonstopux)
+ if test no = "$lt_irix_increment"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ 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 0 -ne "$loop"; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring=$verstring_prefix$major.$iface:$verstring
+ done
+
+ # Before this point, $major must not contain '.'.
+ major=.$major
+ versuffix=$major.$revision
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=.$current.$age.$revision
+ verstring=$current.$age.$revision
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test 0 -ne "$loop"; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring=$verstring:$iface.0
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":$current.0"
+ ;;
+
+ qnx)
+ major=.$current
+ versuffix=.$current
+ ;;
+
+ sunos)
+ major=.$current
+ versuffix=.$current.$revision
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 file systems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix=-$major
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type '$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ 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 no = "$need_version"; then
+ versuffix=
+ else
+ versuffix=.0.0
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test yes,no = "$avoid_version,$need_version"; then
+ major=
+ versuffix=
+ verstring=
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test yes = "$allow_undefined"; then
+ if test unsupported = "$allow_undefined_flag"; then
+ if test yes = "$build_old_libs"; then
+ func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+ build_libtool_libs=no
+ else
+ func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+ fi
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag=$no_undefined_flag
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" :
+ func_append libobjs " $symfileobj"
+ test " " = "$libobjs" && libobjs=
+
+ if test relink != "$opt_mode"; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+ if test -n "$precious_files_regex"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "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
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;;
+ *) func_append 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 "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test yes = "$build_libtool_libs"; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test yes = "$build_libtool_need_lc"; then
+ func_append 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 behavior.
+ 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.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=
+ ;;
+ esac
+ fi
+ if test -n "$i"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append 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
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=
+ ;;
+ esac
+ fi
+ if test -n "$i"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append 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
+ 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
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test yes = "$want_nocaseglob"; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ break 2
+ fi
+ done
+ done
+ fi
+ 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
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib"; 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 above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ break 2
+ fi
+ done
+ done
+ fi
+ 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
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ for i in $predeps $postdeps; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test none = "$deplibs_check_method"; 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
+ ;;
+ esac
+ ;;
+ 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 with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test yes = "$droppeddeps"; then
+ if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs=$new_libs
+
+ # 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 yes = "$build_libtool_libs"; then
+ # Remove $wl instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test yes = "$hardcode_into_libs"; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath=$finalize_rpath
+ test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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
+ func_append 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 relink = "$opt_mode" || 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 shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname=$1
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname=$realname
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib=$output_objdir/$realname
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols=$output_objdir/$libname.uexp
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ func_dll_def_p "$export_symbols" || {
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols=$export_symbols
+ export_symbols=
+ always_export_symbols=yes
+ }
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs=$IFS; IFS='~'
+ for cmd1 in $cmds; do
+ IFS=$save_ifs
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test yes = "$try_normal_branch" \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=$output_objdir/$output_la.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS=$save_ifs
+ if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands, which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs=$tmp_deplibs
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test yes = "$compiler_needs_object" &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test relink = "$opt_mode"; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test yes = "$module" && test -n "$module_cmds"; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test : != "$skipped_export" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ output=$output_objdir/$output_la.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test yes = "$compiler_needs_object"; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-$k.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test -z "$objlist" ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test 1 -eq "$k"; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-$k.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-$k.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ ${skipped_export-false} && {
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ }
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs=$IFS; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS=$save_ifs
+ $opt_quiet || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS=$save_ifs
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ ${skipped_export-false} && {
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands, which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ }
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test yes = "$module" && test -n "$module_cmds"; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs=$IFS; IFS='~'
+ for cmd in $cmds; do
+ IFS=$sp$nl
+ eval cmd=\"$cmd\"
+ IFS=$save_ifs
+ $opt_quiet || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS=$save_ifs
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_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 yes = "$module" || test yes = "$export_dynamic"; then
+ # On all known operating systems, these are identical.
+ dlname=$soname
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "'-l' and '-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "'-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "'-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object '$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj=$output
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_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 and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop=$output_objdir/${obj}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+
+ # Create the old-style object.
+ reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
+
+ output=$obj
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ test yes = "$build_libtool_libs" || {
+ if test -n "$gentop"; then
+ func_show_eval '${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"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ }
+
+ if test -n "$pic_flag" || test default != "$pic_mode"; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output=$libobj
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "'-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for programs"
+
+ $preload \
+ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test CXX = "$tagname"; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " $wl-bind_at_load"
+ func_append finalize_command " $wl-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs=$new_libs
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append 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 "*) ;;
+ *) func_append 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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 yes = "$build_old_libs"; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" false
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=:
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=false
+ ;;
+ *cygwin* | *mingw* )
+ test yes = "$build_libtool_libs" || wrappers_required=false
+ ;;
+ *)
+ if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+ wrappers_required=false
+ fi
+ ;;
+ esac
+ $wrappers_required || {
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command=$compile_command$compile_rpath
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.$objext"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
+ fi
+
+ exit $exit_status
+ }
+
+ 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
+ func_append 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
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test yes = "$no_install"; 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ case $hardcode_action,$fast_install in
+ relink,*)
+ # Fast installation is not supported
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "'$output' will be relinked during installation"
+ ;;
+ *,yes)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ ;;
+ *,no)
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+ ;;
+ *,needless)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=
+ ;;
+ esac
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "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}\" || $lt_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
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource=$output_path/$objdir/lt-$output_name.c
+ cwrapper=$output_path/$output_name.exe
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host"; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ case $build_libtool_libs in
+ convenience)
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs=$convenience
+ build_libtool_libs=no
+ ;;
+ module)
+ oldobjs=$libobjs_save
+ addlibs=$old_convenience
+ build_libtool_libs=no
+ ;;
+ *)
+ oldobjs="$old_deplibs $non_pic_objects"
+ $preload && test -f "$symfileobj" \
+ && func_append oldobjs " $symfileobj"
+ addlibs=$old_convenience
+ ;;
+ esac
+
+ if test -n "$addlibs"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase=$func_basename_result
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj"; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test -z "$oldobjs"; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test yes = "$build_old_libs" && old_library=$libname.$libext
+ func_verbose "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}\" || $lt_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
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test yes = "$hardcode_automatic"; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test yes = "$installed"; 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)
+ func_basename "$deplib"
+ name=$func_basename_result
+ func_resolve_sysroot "$deplib"
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs=$newdependency_libs
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles=$newdlfiles
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles=$newdlprefiles
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles=$newdlfiles
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles=$newdlprefiles
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test -n "$bindir"; then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result/$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# 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'
+
+# Linker flags that cannot go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test no,yes = "$installed,$need_relink"; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+ func_mode_link ${1+"$@"}
+fi
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $debug_cmd
+
+ RM=$nonopt
+ files=
+ rmforce=false
+ 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) func_append RM " $arg"; rmforce=: ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+ if test . = "$dir"; then
+ odir=$objdir
+ else
+ odir=$dir/$objdir
+ fi
+ func_basename "$file"
+ name=$func_basename_result
+ test uninstall = "$opt_mode" && odir=$dir
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test clean = "$opt_mode"; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ 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 $rmforce; then
+ continue
+ fi
+
+ rmfiles=$file
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case $opt_mode in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" && test none != "$pic_object"; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test clean = "$opt_mode"; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+ if test yes = "$fast_install" && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name"; then
+ func_append rmfiles " $odir/lt-$noexename.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$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
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+ func_mode_uninstall ${1+"$@"}
+fi
+
+test -z "$opt_mode" && {
+ help=$generic_help
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode '$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# where we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/mdate-sh b/ics-openvpn-stripped/main/lzo/autoconf/mdate-sh
new file mode 100755
index 00000000..e8dfaca1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/mdate-sh
@@ -0,0 +1,224 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2010-08-21.06; # UTC
+
+# Copyright (C) 1995-2014 Free Software Foundation, Inc.
+# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+fi
+
+case $1 in
+ '')
+ echo "$0: No file. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "mdate-sh $scriptversion"
+ exit $?
+ ;;
+esac
+
+error ()
+{
+ echo "$0: $1" >&2
+ exit 1
+}
+
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# GNU ls changes its time format in response to the TIME_STYLE
+# variable. Since we cannot assume 'unset' works, revert this
+# variable to its documented default.
+if test "${TIME_STYLE+set}" = set; then
+ TIME_STYLE=posix-long-iso
+ export TIME_STYLE
+fi
+
+save_arg1=$1
+
+# Find out how to get the extended ls output of a file or directory.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+ ls_command='ls -L -l -d'
+else
+ ls_command='ls -l -d'
+fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+ ls_command="$ls_command -n"
+fi
+
+# A 'ls -l' line looks as follows on OS/2.
+# drwxrwx--- 0 Aug 11 2001 foo
+# This differs from Unix, which adds ownership information.
+# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
+#
+# To find the date, we split the line on spaces and iterate on words
+# until we find a month. This cannot work with files whose owner is a
+# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
+# will be owned by a user whose name is a month. So we first look at
+# the extended ls output of the root directory to decide how many
+# words should be skipped to get the date.
+
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+set x`$ls_command /`
+
+# Find which argument is the month.
+month=
+command=
+until test $month
+do
+ test $# -gt 0 || error "failed parsing '$ls_command /' output"
+ shift
+ # Add another shift to the command.
+ command="$command shift;"
+ case $1 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+ esac
+done
+
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
+# Get the extended ls output of the file or directory.
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
+
+# Remove all preceding arguments
+eval $command
+
+# Because of the dummy argument above, month is in $2.
+#
+# On a POSIX system, we should have
+#
+# $# = 5
+# $1 = file size
+# $2 = month
+# $3 = day
+# $4 = year or time
+# $5 = filename
+#
+# On Darwin 7.7.0 and 7.6.0, we have
+#
+# $# = 4
+# $1 = day
+# $2 = month
+# $3 = year or time
+# $4 = filename
+
+# Get the month.
+case $2 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+esac
+
+case $3 in
+ ???*) day=$1;;
+ *) day=$3; shift;;
+esac
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+ *:*) set `date`; eval year=\$$#
+ case $2 in
+ Jan) nummonthtod=1;;
+ Feb) nummonthtod=2;;
+ Mar) nummonthtod=3;;
+ Apr) nummonthtod=4;;
+ May) nummonthtod=5;;
+ Jun) nummonthtod=6;;
+ Jul) nummonthtod=7;;
+ Aug) nummonthtod=8;;
+ Sep) nummonthtod=9;;
+ Oct) nummonthtod=10;;
+ Nov) nummonthtod=11;;
+ Dec) nummonthtod=12;;
+ esac
+ # For the first six month of the year the time notation can also
+ # be used for files modified in the last year.
+ if (expr $nummonth \> $nummonthtod) > /dev/null;
+ then
+ year=`expr $year - 1`
+ fi;;
+ *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/missing b/ics-openvpn-stripped/main/lzo/autoconf/missing
new file mode 100755
index 00000000..f62bbae3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/mkinstalldirs b/ics-openvpn-stripped/main/lzo/autoconf/mkinstalldirs
new file mode 100755
index 00000000..55d537f8
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/mkinstalldirs
@@ -0,0 +1,162 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2009-04-28.21; # UTC
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+IFS=" "" $nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # 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
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec 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.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ 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
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/py-compile b/ics-openvpn-stripped/main/lzo/autoconf/py-compile
new file mode 100755
index 00000000..bc203914
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/py-compile
@@ -0,0 +1,170 @@
+#!/bin/sh
+# py-compile - Compile a Python program
+
+scriptversion=2011-06-08.12; # UTC
+
+# Copyright (C) 2000-2014 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+if [ -z "$PYTHON" ]; then
+ PYTHON=python
+fi
+
+me=py-compile
+
+usage_error ()
+{
+ echo "$me: $*" >&2
+ echo "Try '$me --help' for more information." >&2
+ exit 1
+}
+
+basedir=
+destdir=
+while test $# -ne 0; do
+ case "$1" in
+ --basedir)
+ if test $# -lt 2; then
+ usage_error "option '--basedir' requires an argument"
+ else
+ basedir=$2
+ fi
+ shift
+ ;;
+ --destdir)
+ if test $# -lt 2; then
+ usage_error "option '--destdir' requires an argument"
+ else
+ destdir=$2
+ fi
+ shift
+ ;;
+ -h|--help)
+ cat <<\EOF
+Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
+
+Byte compile some python scripts FILES. Use --destdir to specify any
+leading directory path to the FILES that you don't want to include in the
+byte compiled file. Specify --basedir for any additional path information you
+do want to be shown in the byte compiled file.
+
+Example:
+ py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--version)
+ echo "$me $scriptversion"
+ exit $?
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ usage_error "unrecognized option '$1'"
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+files=$*
+if test -z "$files"; then
+ usage_error "no files given"
+fi
+
+# if basedir was given, then it should be prepended to filenames before
+# byte compilation.
+if [ -z "$basedir" ]; then
+ pathtrans="path = file"
+else
+ pathtrans="path = os.path.join('$basedir', file)"
+fi
+
+# if destdir was given, then it needs to be prepended to the filename to
+# byte compile but not go into the compiled file.
+if [ -z "$destdir" ]; then
+ filetrans="filepath = path"
+else
+ filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
+fi
+
+$PYTHON -c "
+import sys, os, py_compile, imp
+
+files = '''$files'''
+
+sys.stdout.write('Byte-compiling python modules...\n')
+for file in files.split():
+ $pathtrans
+ $filetrans
+ if not os.path.exists(filepath) or not (len(filepath) >= 3
+ and filepath[-3:] == '.py'):
+ continue
+ sys.stdout.write(file)
+ sys.stdout.flush()
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+ else:
+ py_compile.compile(filepath, filepath + 'c', path)
+sys.stdout.write('\n')" || exit $?
+
+# this will fail for python < 1.5, but that doesn't matter ...
+$PYTHON -O -c "
+import sys, os, py_compile, imp
+
+# pypy does not use .pyo optimization
+if hasattr(sys, 'pypy_translation_info'):
+ sys.exit(0)
+
+files = '''$files'''
+sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
+for file in files.split():
+ $pathtrans
+ $filetrans
+ if not os.path.exists(filepath) or not (len(filepath) >= 3
+ and filepath[-3:] == '.py'):
+ continue
+ sys.stdout.write(file)
+ sys.stdout.flush()
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+ else:
+ py_compile.compile(filepath, filepath + 'o', path)
+sys.stdout.write('\n')" 2>/dev/null || :
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/shtool b/ics-openvpn-stripped/main/lzo/autoconf/shtool
new file mode 100755
index 00000000..78c0b125
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/shtool
@@ -0,0 +1,4083 @@
+#!/bin/sh
+##
+## GNU shtool -- The GNU Portable Shell Tool
+## Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>
+##
+## See http://www.gnu.org/software/shtool/ for more information.
+## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
+##
+## Version: 2.0.8 (18-Jul-2008)
+## Contents: all available modules
+##
+
+##
+## 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, or contact Ralf S. Engelschall <rse@engelschall.com>.
+##
+## NOTICE: Given that you include this file verbatim into your own
+## source tree, you are justified in saying that it remains separate
+## from your package, and that this way you are simply just using GNU
+## shtool. So, in this situation, there is no requirement that your
+## package itself is licensed under the GNU General Public License in
+## order to take advantage of GNU shtool.
+##
+
+##
+## Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]
+##
+## Available commands:
+## echo Print string with optional construct expansion
+## mdate Pretty-print modification time of a file or dir
+## table Pretty-print a field-separated list as a table
+## prop Display progress with a running propeller
+## move Move files with simultaneous substitution
+## install Install a program, script or datafile
+## mkdir Make one or more directories
+## mkln Make link with calculation of relative paths
+## mkshadow Make a shadow tree through symbolic links
+## fixperm Fix file permissions inside a source tree
+## rotate Logfile rotation
+## tarball Roll distribution tarballs
+## subst Apply sed(1) substitution operations
+## platform Platform Identification Utility
+## arx Extended archive command
+## slo Separate linker options by library class
+## scpp Sharing C Pre-Processor
+## version Maintain a version information file
+## path Deal with program paths
+##
+
+# maximum Bourne-Shell compatibility
+if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then
+ # reconfigure zsh(1)
+ emulate sh
+ NULLCMD=:
+ alias -g '${1+"$@"}'='"$@"'
+elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then
+ # reconfigure bash(1)
+ set -o posix
+fi
+
+# maximum independence of NLS nuisances
+for 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 $var=C; export $var) 2>&1`"); then
+ eval $var=C; export $var
+ else
+ unset $var
+ fi
+done
+
+# initial command line handling
+if [ $# -eq 0 ]; then
+ echo "$0:Error: invalid command line" 1>&2
+ echo "$0:Hint: run \`$0 -h' for usage" 1>&2
+ exit 1
+fi
+if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
+ echo "This is GNU shtool, version 2.0.8 (18-Jul-2008)"
+ echo 'Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>'
+ echo 'Report bugs to <bug-shtool@gnu.org>'
+ echo ''
+ echo 'Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]'
+ echo ''
+ echo 'Available global <options>:'
+ echo ' -v, --version display shtool version information'
+ echo ' -h, --help display shtool usage help page (this one)'
+ echo ' -d, --debug display shell trace information'
+ echo ' -r, --recreate recreate this shtool script via shtoolize'
+ echo ''
+ echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
+ echo ' echo [-n|--newline] [-e|--expand] [<string> ...]'
+ echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]'
+ echo ' [-f|--field-sep <str>] [-o|--order <spec>] <path>'
+ echo ' table [-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns'
+ echo ' <cols>] [-s|--strip <strip>] <str><sep><str>...'
+ echo ' prop [-p|--prefix <str>]'
+ echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]'
+ echo ' <src-file> <dst-file>'
+ echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]'
+ echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>]'
+ echo ' [-o|--owner <owner>] [-g|--group <group>] [-e|--exec'
+ echo ' <sed-cmd>] <file> [<file> ...] <path>'
+ echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode'
+ echo ' <mode>] [-o|--owner <owner>] [-g|--group <group>] <dir>'
+ echo ' [<dir> ...]'
+ echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] <src-path>'
+ echo ' [<src-path> ...] <dst-path>'
+ echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] <src-dir> <dst-dir>'
+ echo ' fixperm [-v|--verbose] [-t|--trace] <path> [<path> ...]'
+ echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
+ echo ' <count>] [-s|--size <size>] [-c|--copy] [-r|--remove]'
+ echo ' [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>]'
+ echo ' [-b|--background] [-d|--delay] [-p|--pad <len>] [-m|--mode'
+ echo ' <mode>] [-o|--owner <owner>] [-g|--group <group>] [-M|--migrate'
+ echo ' <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]'
+ echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output <tarball>]'
+ echo ' [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
+ echo ' <user>] [-g|--group <group>] [-e|--exclude <pattern>]'
+ echo ' <path> [<path> ...]'
+ echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]'
+ echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
+ echo ' <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>]'
+ echo ' [...]'
+ echo ' platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
+ echo ' <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
+ echo ' [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
+ echo ' [-V|--version] [-h|--help]'
+ echo ' arx [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
+ echo ' ...]'
+ echo ' slo [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
+ echo ' ...]'
+ echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter <filter>]'
+ echo ' [-o|--output <ofile>] [-t|--template <tfile>] [-M|--mark'
+ echo ' <mark>] [-D|--define <dname>] [-C|--class <cname>]'
+ echo ' <file> [<file> ...]'
+ echo ' version [-l|--language <lang>] [-n|--name <name>] [-p|--prefix'
+ echo ' <prefix>] [-s|--set <version>] [-e|--edit] [-i|--increase'
+ echo ' <knob>] [-d|--display <type>] <file>'
+ echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]'
+ echo ' [-m|--magic] [-p|--path <path>] <str> [<str> ...]'
+ echo ''
+ exit 0
+fi
+if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
+ echo "GNU shtool 2.0.8 (18-Jul-2008)"
+ exit 0
+fi
+if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
+ shtoolize -oshtool all
+ exit 0
+fi
+if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then
+ shift
+ set -x
+fi
+name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
+case "$name" in
+ echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|rotate|tarball|subst|platform|arx|slo|scpp|version|path )
+ # implicit tool command selection
+ tool="$name"
+ ;;
+ * )
+ # explicit tool command selection
+ tool="$1"
+ shift
+ ;;
+esac
+arg_spec=""
+opt_spec=""
+gen_tmpfile=no
+
+##
+## DISPATCH INTO SCRIPT PROLOG
+##
+
+case $tool in
+ echo )
+ str_tool="echo"
+ str_usage="[-n|--newline] [-e|--expand] [<string> ...]"
+ arg_spec="0+"
+ opt_spec="n.e."
+ opt_alias="n:newline,e:expand"
+ opt_n=no
+ opt_e=no
+ ;;
+ mdate )
+ str_tool="mdate"
+ str_usage="[-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits] [-f|--field-sep <str>] [-o|--order <spec>] <path>"
+ arg_spec="1="
+ opt_spec="n.z.s.d.f:o:"
+ opt_alias="n:newline,z:zero,s:shorten,d:digits,f:field-sep,o:order"
+ opt_n=no
+ opt_z=no
+ opt_s=no
+ opt_d=no
+ opt_f=" "
+ opt_o="dmy"
+ ;;
+ table )
+ str_tool="table"
+ str_usage="[-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns <cols>] [-s|--strip <strip>] <str><sep><str>..."
+ arg_spec="1+"
+ opt_spec="F:w:c:s:"
+ opt_alias="F:field-sep,w:width,c:columns,s:strip"
+ opt_F=":"
+ opt_w=15
+ opt_c=3
+ opt_s=79
+ ;;
+ prop )
+ str_tool="prop"
+ str_usage="[-p|--prefix <str>]"
+ arg_spec="0="
+ opt_spec="p:"
+ opt_alias="p:prefix"
+ opt_p=""
+ ;;
+ move )
+ str_tool="move"
+ str_usage="[-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve] <src-file> <dst-file>"
+ arg_spec="2="
+ opt_spec="v.t.e.p."
+ opt_alias="v:verbose,t:trace,e:expand,p:preserve"
+ opt_v=no
+ opt_t=no
+ opt_e=no
+ opt_p=no
+ ;;
+ install )
+ str_tool="install"
+ str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-e|--exec <sed-cmd>] <file> [<file> ...] <path>"
+ arg_spec="1+"
+ opt_spec="v.t.d.c.C.s.m:o:g:e+"
+ opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec"
+ opt_v=no
+ opt_t=no
+ opt_d=no
+ opt_c=no
+ opt_C=no
+ opt_s=no
+ opt_m="0755"
+ opt_o=""
+ opt_g=""
+ opt_e=""
+ ;;
+ mkdir )
+ str_tool="mkdir"
+ str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] <dir> [<dir> ...]"
+ arg_spec="1+"
+ opt_spec="t.f.p.m:o:g:"
+ opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group"
+ opt_t=no
+ opt_f=no
+ opt_p=no
+ opt_m=""
+ opt_o=""
+ opt_g=""
+ ;;
+ mkln )
+ str_tool="mkln"
+ str_usage="[-t|--trace] [-f|--force] [-s|--symbolic] <src-path> [<src-path> ...] <dst-path>"
+ arg_spec="2+"
+ opt_spec="t.f.s."
+ opt_alias="t:trace,f:force,s:symbolic"
+ opt_t=no
+ opt_f=no
+ opt_s=no
+ ;;
+ mkshadow )
+ str_tool="mkshadow"
+ str_usage="[-v|--verbose] [-t|--trace] [-a|--all] <src-dir> <dst-dir>"
+ arg_spec="2="
+ opt_spec="v.t.a."
+ opt_alias="v:verbose,t:trace,a:all"
+ opt_v=no
+ opt_t=no
+ opt_a=no
+ ;;
+ fixperm )
+ str_tool="fixperm"
+ str_usage="[-v|--verbose] [-t|--trace] <path> [<path> ...]"
+ arg_spec="1+"
+ opt_spec="v.t."
+ opt_alias="v:verbose,t:trace"
+ opt_v=no
+ opt_t=no
+ ;;
+ rotate )
+ str_tool="rotate"
+ str_usage="[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files <count>] [-s|--size <size>] [-c|--copy] [-r|--remove] [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>] [-b|--background] [-d|--delay] [-p|--pad <len>] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-M|--migrate <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]"
+ arg_spec="1+"
+ opt_spec="v.t.f.n:s:c.r.a:z:b.d.p:o:g:m:M:P:E:"
+ opt_alias="v:verbose,t:trace,f:force,n:num-files,s:size,c:copy,r:remove,a:archive-dir,z:compress,b:background,d:delay,p:pad,o:owner,g:group,m:mode,M:migrate,P:prolog,E:epilog"
+ opt_v=no
+ opt_t=no
+ opt_f=no
+ opt_n=10
+ opt_s=""
+ opt_c=no
+ opt_r=no
+ opt_a=""
+ opt_z=""
+ opt_b=no
+ opt_d=no
+ opt_p=1
+ opt_o=""
+ opt_g=""
+ opt_m=""
+ opt_M=""
+ opt_P=""
+ opt_E=""
+ ;;
+ tarball )
+ str_tool="tarball"
+ str_usage="[-t|--trace] [-v|--verbose] [-o|--output <tarball>] [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user <user>] [-g|--group <group>] [-e|--exclude <pattern>] <path> [<path> ...]"
+ gen_tmpfile=yes
+ arg_spec="1+"
+ opt_spec="t.v.o:c:d:u:g:e:"
+ opt_alias="t:trace,v:verbose,o:output,c:compress,d:directory,u:user,g:group,e:exclude"
+ opt_t=no
+ opt_v=no
+ opt_o=""
+ opt_c=""
+ opt_d=""
+ opt_u=""
+ opt_g=""
+ opt_e="CVS,\\.cvsignore,\\.svn,\\.[oa]\$"
+ ;;
+ subst )
+ str_tool="subst"
+ str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
+ gen_tmpfile=yes
+ arg_spec="0+"
+ opt_spec="v.t.n.w.q.s.i.b:e+f:"
+ opt_alias="v:verbose,t:trace,n:nop,w:warning,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file"
+ opt_v=no
+ opt_t=no
+ opt_n=no
+ opt_w=no
+ opt_q=no
+ opt_s=no
+ opt_i=no
+ opt_b=""
+ opt_e=""
+ opt_f=""
+ ;;
+ platform )
+ str_tool="platform"
+ str_usage="[-F|--format <format>] [-S|--sep <string>] [-C|--conc <string>] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type <type>] [-V|--version] [-h|--help]"
+ arg_spec="0="
+ opt_spec="F:S:C:L.U.v.c.n.t:d.V.h."
+ opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help"
+ opt_F="%{sp} (%{ap})"
+ opt_S=" "
+ opt_C="/"
+ opt_L=no
+ opt_U=no
+ opt_t=""
+ opt_v=no
+ opt_c=no
+ opt_n=no
+ opt_V=no
+ opt_h=no
+ ;;
+ arx )
+ str_tool="arx"
+ str_usage="[-t|--trace] [-C|--command <cmd>] <op> <archive> [<file> ...]"
+ arg_spec="2+"
+ opt_spec="t.C:"
+ opt_alias="t:trace,C:command"
+ opt_t=no
+ opt_C="ar"
+ ;;
+ slo )
+ str_tool="slo"
+ str_usage="[-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]"
+ arg_spec="1+"
+ opt_spec="p:"
+ opt_alias="p:prefix"
+ opt_p="SLO_"
+ ;;
+ scpp )
+ str_tool="scpp"
+ str_usage="[-v|--verbose] [-p|--preserve] [-f|--filter <filter>] [-o|--output <ofile>] [-t|--template <tfile>] [-M|--mark <mark>] [-D|--define <dname>] [-C|--class <cname>] <file> [<file> ...]"
+ gen_tmpfile=yes
+ arg_spec="1+"
+ opt_spec="v.p.f+o:t:M:D:C:"
+ opt_alias="v:verbose,p:preserve,f:filter,o:output,t:template,M:mark,D:define,C:class"
+ opt_v=no
+ opt_p=no
+ opt_f=""
+ opt_o="lib.h"
+ opt_t="lib.h.in"
+ opt_M="%%MARK%%"
+ opt_D="cpp"
+ opt_C="intern"
+ ;;
+ version )
+ str_tool="version"
+ str_usage="[-l|--language <lang>] [-n|--name <name>] [-p|--prefix <prefix>] [-s|--set <version>] [-e|--edit] [-i|--increase <knob>] [-d|--display <type>] <file>"
+ arg_spec="1="
+ opt_spec="l:n:p:s:i:e.d:"
+ opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display"
+ opt_l="txt"
+ opt_n="unknown"
+ opt_p=""
+ opt_s=""
+ opt_e="no"
+ opt_i=""
+ opt_d="short"
+ ;;
+ path )
+ str_tool="path"
+ str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path <path>] <str> [<str> ...]"
+ gen_tmpfile=yes
+ arg_spec="1+"
+ opt_spec="s.r.d.b.m.p:"
+ opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path"
+ opt_s=no
+ opt_r=no
+ opt_d=no
+ opt_b=no
+ opt_m=no
+ opt_p="$PATH"
+ ;;
+ -* )
+ echo "$0:Error: unknown option \`$tool'" 2>&1
+ echo "$0:Hint: run \`$0 -h' for usage" 2>&1
+ exit 1
+ ;;
+ * )
+ echo "$0:Error: unknown command \`$tool'" 2>&1
+ echo "$0:Hint: run \`$0 -h' for usage" 2>&1
+ exit 1
+ ;;
+esac
+
+##
+## COMMON UTILITY CODE
+##
+
+# commonly used ASCII values
+ASC_TAB=" "
+ASC_NL="
+"
+
+# determine name of tool
+if [ ".$tool" != . ]; then
+ # used inside shtool script
+ toolcmd="$0 $tool"
+ toolcmdhelp="shtool $tool"
+ msgprefix="shtool:$tool"
+else
+ # used as standalone script
+ toolcmd="$0"
+ toolcmdhelp="sh $0"
+ msgprefix="$str_tool"
+fi
+
+# parse argument specification string
+eval `echo $arg_spec |\
+ sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
+
+# parse option specification string
+eval `echo h.$opt_spec |\
+ sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
+
+# parse option alias string
+eval `echo h:help,$opt_alias |\
+ sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
+
+# interate over argument line
+opt_PREV=''
+while [ $# -gt 0 ]; do
+ # special option stops processing
+ if [ ".$1" = ".--" ]; then
+ shift
+ break
+ fi
+
+ # determine option and argument
+ opt_ARG_OK=no
+ if [ ".$opt_PREV" != . ]; then
+ # merge previous seen option with argument
+ opt_OPT="$opt_PREV"
+ opt_ARG="$1"
+ opt_ARG_OK=yes
+ opt_PREV=''
+ else
+ # split argument into option and argument
+ case "$1" in
+ --[a-zA-Z0-9]*=*)
+ eval `echo "x$1" |\
+ sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'`
+ opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
+ eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
+ ;;
+ --[a-zA-Z0-9]*)
+ opt_OPT=`echo "x$1" | cut -c4-`
+ opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
+ eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
+ opt_ARG=''
+ ;;
+ -[a-zA-Z0-9]*)
+ eval `echo "x$1" |\
+ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \
+ -e 's/";\(.*\)$/"; opt_ARG="\1"/'`
+ ;;
+ -[a-zA-Z0-9])
+ opt_OPT=`echo "x$1" | cut -c3-`
+ opt_ARG=''
+ ;;
+ *)
+ break
+ ;;
+ esac
+ fi
+
+ # eat up option
+ shift
+
+ # determine whether option needs an argument
+ eval "opt_MODE=\$opt_MODE_${opt_OPT}"
+ if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then
+ if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then
+ opt_PREV="$opt_OPT"
+ continue
+ fi
+ fi
+
+ # process option
+ case $opt_MODE in
+ '.' )
+ # boolean option
+ eval "opt_${opt_OPT}=yes"
+ ;;
+ ':' )
+ # option with argument (multiple occurances override)
+ eval "opt_${opt_OPT}=\"\$opt_ARG\""
+ ;;
+ '+' )
+ # option with argument (multiple occurances append)
+ eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
+ ;;
+ * )
+ echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2
+ echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
+ exit 1
+ ;;
+ esac
+done
+if [ ".$opt_PREV" != . ]; then
+ echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2
+ echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
+ exit 1
+fi
+
+# process help option
+if [ ".$opt_h" = .yes ]; then
+ echo "Usage: $toolcmdhelp $str_usage"
+ exit 0
+fi
+
+# complain about incorrect number of arguments
+case $arg_MODE in
+ '=' )
+ if [ $# -ne $arg_NUMS ]; then
+ echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
+ echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
+ exit 1
+ fi
+ ;;
+ '+' )
+ if [ $# -lt $arg_NUMS ]; then
+ echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
+ echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
+ exit 1
+ fi
+ ;;
+esac
+
+# establish a temporary file on request
+if [ ".$gen_tmpfile" = .yes ]; then
+ # create (explicitly) secure temporary directory
+ if [ ".$TMPDIR" != . ]; then
+ tmpdir="$TMPDIR"
+ elif [ ".$TEMPDIR" != . ]; then
+ tmpdir="$TEMPDIR"
+ else
+ tmpdir="/tmp"
+ fi
+ tmpdir="$tmpdir/.shtool.$$"
+ ( umask 077
+ rm -rf "$tmpdir" >/dev/null 2>&1 || true
+ mkdir "$tmpdir" >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2
+ exit 1
+ fi
+ )
+
+ # create (implicitly) secure temporary file
+ tmpfile="$tmpdir/shtool.tmp"
+ touch "$tmpfile"
+fi
+
+# utility function: map string to lower case
+util_lower () {
+ echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
+}
+
+# utility function: map string to upper case
+util_upper () {
+ echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+}
+
+# cleanup procedure
+shtool_exit () {
+ rc="$1"
+ if [ ".$gen_tmpfile" = .yes ]; then
+ rm -rf "$tmpdir" >/dev/null 2>&1 || true
+ fi
+ exit $rc
+}
+
+##
+## DISPATCH INTO SCRIPT BODY
+##
+
+case $tool in
+
+echo )
+ ##
+ ## echo -- Print string with optional construct expansion
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ text="$*"
+
+ # check for broken escape sequence expansion
+ seo=''
+ bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
+ if [ ".$bytes" != .3 ]; then
+ bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
+ if [ ".$bytes" = .3 ]; then
+ seo='-E'
+ fi
+ fi
+
+ # check for existing -n option (to suppress newline)
+ minusn=''
+ bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
+ if [ ".$bytes" = .3 ]; then
+ minusn='-n'
+ fi
+
+ # determine terminal bold sequence
+ term_bold=''
+ term_norm=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then
+ case $TERM in
+ # for the most important terminal types we directly know the sequences
+ xterm|xterm*|vt220|vt220*)
+ term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
+ term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
+ ;;
+ vt100|vt100*|cygwin)
+ term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
+ term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
+ ;;
+ # for all others, we try to use a possibly existing `tput' or `tcout' utility
+ * )
+ paths=`echo $PATH | sed -e 's/:/ /g'`
+ for tool in tput tcout; do
+ for dir in $paths; do
+ if [ -r "$dir/$tool" ]; then
+ for seq in bold md smso; do # 'smso' is last
+ bold="`$dir/$tool $seq 2>/dev/null`"
+ if [ ".$bold" != . ]; then
+ term_bold="$bold"
+ break
+ fi
+ done
+ if [ ".$term_bold" != . ]; then
+ for seq in sgr0 me rmso init reset; do # 'reset' is last
+ norm="`$dir/$tool $seq 2>/dev/null`"
+ if [ ".$norm" != . ]; then
+ term_norm="$norm"
+ break
+ fi
+ done
+ fi
+ break
+ fi
+ done
+ if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then
+ break;
+ fi
+ done
+ ;;
+ esac
+ if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then
+ echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
+ term_bold=''
+ term_norm=''
+ fi
+ fi
+
+ # determine user name
+ username=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then
+ username="`(id -un) 2>/dev/null`"
+ if [ ".$username" = . ]; then
+ str="`(id) 2>/dev/null`"
+ if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
+ username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'`
+ fi
+ if [ ".$username" = . ]; then
+ username="$LOGNAME"
+ if [ ".$username" = . ]; then
+ username="$USER"
+ if [ ".$username" = . ]; then
+ username="`(whoami) 2>/dev/null |\
+ awk '{ printf("%s", $1); }'`"
+ if [ ".$username" = . ]; then
+ username="`(who am i) 2>/dev/null |\
+ awk '{ printf("%s", $1); }'`"
+ if [ ".$username" = . ]; then
+ username='unknown'
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ # determine user id
+ userid=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then
+ userid="`(id -u) 2>/dev/null`"
+ if [ ".$userid" = . ]; then
+ userid="`(id -u ${username}) 2>/dev/null`"
+ if [ ".$userid" = . ]; then
+ str="`(id) 2>/dev/null`"
+ if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
+ userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'`
+ fi
+ if [ ".$userid" = . ]; then
+ userid=`(getent passwd ${username}) 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$userid" = . ]; then
+ userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$userid" = . ]; then
+ userid=`(ypmatch "${username}" passwd; nismatch "${username}" passwd) 2>/dev/null | \
+ sed -e 'q' | sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$userid" = . ]; then
+ userid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$userid" = . ]; then
+ userid='?'
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ # determine (primary) group id
+ groupid=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then
+ groupid="`(id -g ${username}) 2>/dev/null`"
+ if [ ".$groupid" = . ]; then
+ str="`(id) 2>/dev/null`"
+ if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then
+ groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'`
+ fi
+ if [ ".$groupid" = . ]; then
+ groupid=`(getent passwd ${username}) 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$groupid" = . ]; then
+ groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$groupid" = . ]; then
+ groupid=`(ypmatch "${username}" passwd; nismatch "${username}" passwd) 2>/dev/null | \
+ sed -e 'q' | sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$groupid" = . ]; then
+ groupid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \
+ sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$groupid" = . ]; then
+ groupid='?'
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ # determine (primary) group name
+ groupname=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then
+ groupname="`(id -gn ${username}) 2>/dev/null`"
+ if [ ".$groupname" = . ]; then
+ str="`(id) 2>/dev/null`"
+ if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then
+ groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'`
+ fi
+ if [ ".$groupname" = . ]; then
+ groupname=`(getent group) 2>/dev/null | \
+ grep "^[^:]*:[^:]*:${groupid}:" | \
+ sed -e 's/:.*$//'`
+ if [ ".$groupname" = . ]; then
+ groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
+ sed -e 's/:.*$//'`
+ if [ ".$groupname" = . ]; then
+ groupname=`(ypcat group; niscat group) 2>/dev/null | \
+ sed -e 'q' | grep "^[^:]*:[^:]*:${groupid}:" | \
+ sed -e 's/:.*$//'`
+ if [ ".$groupname" = . ]; then
+ groupname=`(nidump group .) 2>/dev/null | \
+ grep "^[^:]*:[^:]*:${groupid}:" | \
+ sed -e 's/:.*$//'`
+ if [ ".$groupname" = . ]; then
+ groupname='?'
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ # determine host and domain name
+ hostname=''
+ domainname=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then
+ hostname="`(uname -n) 2>/dev/null |\
+ awk '{ printf("%s", $1); }'`"
+ if [ ".$hostname" = . ]; then
+ hostname="`(hostname) 2>/dev/null |\
+ awk '{ printf("%s", $1); }'`"
+ if [ ".$hostname" = . ]; then
+ hostname='unknown'
+ fi
+ fi
+ case $hostname in
+ *.* )
+ domainname=".`echo $hostname | cut -d. -f2-`"
+ hostname="`echo $hostname | cut -d. -f1`"
+ ;;
+ esac
+ fi
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then
+ if [ ".$domainname" = . ]; then
+ if [ -f /etc/resolv.conf ]; then
+ domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\
+ sed -e 's/.*domain//' \
+ -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
+ -e 's/^\.//' -e 's/^/./' |\
+ awk '{ printf("%s", $1); }'`"
+ if [ ".$domainname" = . ]; then
+ domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\
+ sed -e 's/.*search//' \
+ -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
+ -e 's/ .*//' -e 's/ .*//' \
+ -e 's/^\.//' -e 's/^/./' |\
+ awk '{ printf("%s", $1); }'`"
+ fi
+ fi
+ fi
+ fi
+
+ # determine current time
+ time_day=''
+ time_month=''
+ time_year=''
+ time_monthname=''
+ if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then
+ time_day=`date '+%d'`
+ time_month=`date '+%m'`
+ time_year=`date '+%Y' 2>/dev/null`
+ if [ ".$time_year" = . ]; then
+ time_year=`date '+%y'`
+ case $time_year in
+ [5-9][0-9]) time_year="19$time_year" ;;
+ [0-4][0-9]) time_year="20$time_year" ;;
+ esac
+ fi
+ case $time_month in
+ 1|01) time_monthname='Jan' ;;
+ 2|02) time_monthname='Feb' ;;
+ 3|03) time_monthname='Mar' ;;
+ 4|04) time_monthname='Apr' ;;
+ 5|05) time_monthname='May' ;;
+ 6|06) time_monthname='Jun' ;;
+ 7|07) time_monthname='Jul' ;;
+ 8|08) time_monthname='Aug' ;;
+ 9|09) time_monthname='Sep' ;;
+ 10) time_monthname='Oct' ;;
+ 11) time_monthname='Nov' ;;
+ 12) time_monthname='Dec' ;;
+ esac
+ fi
+
+ # expand special ``%x'' constructs
+ if [ ".$opt_e" = .yes ]; then
+ text=`echo $seo "$text" |\
+ sed -e "s/%B/${term_bold}/g" \
+ -e "s/%b/${term_norm}/g" \
+ -e "s/%u/${username}/g" \
+ -e "s/%U/${userid}/g" \
+ -e "s/%g/${groupname}/g" \
+ -e "s/%G/${groupid}/g" \
+ -e "s/%h/${hostname}/g" \
+ -e "s/%d/${domainname}/g" \
+ -e "s/%D/${time_day}/g" \
+ -e "s/%M/${time_month}/g" \
+ -e "s/%Y/${time_year}/g" \
+ -e "s/%m/${time_monthname}/g" 2>/dev/null`
+ fi
+
+ # create output
+ if [ .$opt_n = .no ]; then
+ echo $seo "$text"
+ else
+ # the harder part: echo -n is best, because
+ # awk may complain about some \xx sequences.
+ if [ ".$minusn" != . ]; then
+ echo $seo $minusn "$text"
+ else
+ echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
+ fi
+ fi
+
+ shtool_exit 0
+ ;;
+
+mdate )
+ ##
+ ## mdate -- Pretty-print modification time of a file or dir
+ ## Copyright (c) 1995-1997 Free Software Foundation, Inc.
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ fod="$1"
+ case "$opt_o" in
+ [dmy][dmy][dmy] )
+ ;;
+ * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+ if [ ! -r "$fod" ]; then
+ echo "$msgprefix:Error: file or directory not found: $fod" 1>&2
+ shtool_exit 1
+ fi
+
+ # GNU ls changes its time format in response to the TIME_STYLE
+ # variable. Since we cannot assume "unset" works, revert this
+ # variable to its documented default.
+ if [ ".$TIME_STYLE" != . ]; then
+ TIME_STYLE=posix-long-iso
+ export TIME_STYLE
+ fi
+
+ # get the extended ls output of the file or directory.
+ if /bin/ls -L /dev/null >/dev/null 2>&1; then
+ set - x`/bin/ls -L -l -d $fod`
+ else
+ set - x`/bin/ls -l -d $fod`
+ fi
+
+ # The month is at least the fourth argument
+ # (3 shifts here, the next inside the loop).
+ shift; shift; shift
+
+ # Find the month. Next argument is day, followed by the year or time.
+ month=""
+ while [ ".$month" = . ]; do
+ shift
+ case $1 in
+ Jan) month=January; nummonth=1 ;;
+ Feb) month=February; nummonth=2 ;;
+ Mar) month=March; nummonth=3 ;;
+ Apr) month=April; nummonth=4 ;;
+ May) month=May; nummonth=5 ;;
+ Jun) month=June; nummonth=6 ;;
+ Jul) month=July; nummonth=7 ;;
+ Aug) month=August; nummonth=8 ;;
+ Sep) month=September; nummonth=9 ;;
+ Oct) month=October; nummonth=10 ;;
+ Nov) month=November; nummonth=11 ;;
+ Dec) month=December; nummonth=12 ;;
+ esac
+ done
+ day="$2"
+ year="$3"
+
+ # We finally have to deal with the problem that the "ls" output
+ # gives either the time of the day or the year.
+ case $year in
+ *:*)
+ this_year=`date '+%Y' 2>/dev/null`
+ if [ ".$this_year" = . ]; then
+ this_year=`date '+%y'`
+ case $this_year in
+ [5-9][0-9]) this_year="19$this_year" ;;
+ [0-4][0-9]) this_year="20$this_year" ;;
+ esac
+ fi
+ # for the following months of the last year the time notation
+ # is usually also used for files modified in the last year.
+ this_month=`date '+%m'`
+ if (expr $nummonth \> $this_month) >/dev/null; then
+ this_year=`expr $this_year - 1`
+ fi
+ year="$this_year"
+ ;;
+ esac
+
+ # Optionally fill day and month with leeding zeros
+ if [ ".$opt_z" = .yes ]; then
+ case $day in
+ [0-9][0-9] ) ;;
+ [0-9] ) day="0$day" ;;
+ esac
+ case $nummonth in
+ [0-9][0-9] ) ;;
+ [0-9] ) nummonth="0$nummonth" ;;
+ esac
+ fi
+
+ # Optionally use digits for month
+ if [ ".$opt_d" = .yes ]; then
+ month="$nummonth"
+ fi
+
+ # Optionally shorten the month name to three characters
+ if [ ".$opt_s" = .yes ]; then
+ month=`echo $month | cut -c1-3`
+ fi
+
+ # Output the resulting date string
+ echo dummy | awk '{
+ for (i = 0; i < 3; i++) {
+ now = substr(order, 1, 1);
+ order = substr(order, 2);
+ if (now == "d")
+ out = day;
+ else if (now == "m")
+ out = month;
+ else if (now == "y")
+ out = year;
+ if (i < 2)
+ printf("%s%s", out, field);
+ else
+ printf("%s", out);
+ }
+ if (newline != "yes")
+ printf("\n");
+ }' "day=$day" "month=$month" "year=$year" \
+ "field=$opt_f" "order=$opt_o" "newline=$opt_n"
+
+ shtool_exit 0
+ ;;
+
+table )
+ ##
+ ## table -- Pretty-print a field-separated list as a table
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ if [ $opt_c -gt 4 ]; then
+ echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2
+ shtool_exit 1
+ fi
+ case "x$opt_F" in
+ x? ) ;;
+ * ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 1>&2; shtool_exit 1 ;;
+ esac
+
+ # split the list into a table
+ list=`
+ IFS="$opt_F"
+ for entry in $*; do
+ if [ ".$entry" != . ]; then
+ echo "$entry"
+ fi
+ done |\
+ awk "
+ BEGIN { list = \"\"; n = 0; }
+ {
+ list = list \\$1;
+ n = n + 1;
+ if (n < $opt_c) {
+ list = list \":\";
+ }
+ if (n == $opt_c) {
+ list = list \"\\n\";
+ n = 0;
+ }
+ }
+ END { print list; }
+ "
+ `
+
+ # format table cells and make sure table
+ # doesn't exceed maximum width
+ OIFS="$IFS"
+ IFS='
+'
+ for entry in $list; do
+ case $opt_c in
+ 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;;
+ 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;;
+ 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;;
+ 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;;
+ esac
+ done |\
+ awk "{
+ if (length(\$0) > $opt_s) {
+ printf(\"%s\\n\", substr(\$0, 0, $opt_s-1));
+ } else {
+ print \$0;
+ }
+ }"
+ IFS="$OIFS"
+
+ shtool_exit 0
+ ;;
+
+prop )
+ ##
+ ## prop -- Display progress with a running propeller
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ perl=''
+ for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
+ if [ -f "$dir/perl" ]; then
+ perl="$dir/perl"
+ break
+ fi
+ done
+ if [ ".$perl" != . ]; then
+ # Perl is preferred because writing to STDERR in
+ # Perl really writes immediately as one would expect
+ $perl -e '
+ @p = ("|","/","-","\\");
+ $i = 0;
+ while (<STDIN>) {
+ printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]);
+ $i = 0 if ($i > 3);
+ }
+ printf(STDERR "\r%s \n", $ARGV[0]);
+ ' "$opt_p"
+ else
+ # But if Perl doesn't exists we use Awk even
+ # some Awk's buffer even the /dev/stderr writing :-(
+ awk '
+ BEGIN {
+ split("|#/#-#\\", p, "#");
+ i = 1;
+ }
+ {
+ printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr";
+ if (i > 4) { i = 1; }
+ }
+ END {
+ printf("\r%s \n", prefix) > "/dev/stderr";
+ }
+ ' "prefix=$opt_p"
+ fi
+
+ shtool_exit 0
+ ;;
+
+move )
+ ##
+ ## move -- Move files with simultaneous substitution
+ ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ src="$1"
+ dst="$2"
+
+ # consistency checks
+ if [ ".$src" = . ] || [ ".$dst" = . ]; then
+ echo "$msgprefix:Error: Invalid arguments" 1>&2
+ shtool_exit 1
+ fi
+ if [ ".$src" = ".$dst" ]; then
+ echo "$msgprefix:Error: Source and destination files are the same" 1>&2
+ shtool_exit 1
+ fi
+ expsrc="$src"
+ if [ ".$opt_e" = .yes ]; then
+ expsrc="`echo $expsrc`"
+ fi
+ if [ ".$opt_e" = .yes ]; then
+ if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then
+ echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2
+ shtool_exit 1
+ fi
+ if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then
+ echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2
+ shtool_exit 1
+ fi
+ if [ ".$expsrc" = ".$src" ]; then
+ echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2
+ shtool_exit 1
+ fi
+ else
+ if [ ! -r "$src" ]; then
+ echo "$msgprefix:Error: Source not found: $src" 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # determine substitution patterns
+ if [ ".$opt_e" = .yes ]; then
+ srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'`
+ dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'`
+ fi
+
+ # iterate over source(s)
+ for onesrc in $expsrc; do
+ if [ .$opt_e = .yes ]; then
+ onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"`
+ else
+ onedst="$dst"
+ fi
+ errorstatus=0
+ if [ ".$opt_v" = .yes ]; then
+ echo "$onesrc -> $onedst"
+ fi
+ if [ ".$opt_p" = .yes ]; then
+ if [ -r $onedst ]; then
+ if cmp -s $onesrc $onedst; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f $onesrc" 1>&2
+ fi
+ rm -f $onesrc || errorstatus=$?
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv -f $onesrc $onedst" 1>&2
+ fi
+ mv -f $onesrc $onedst || errorstatus=$?
+ fi
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv -f $onesrc $onedst" 1>&2
+ fi
+ mv -f $onesrc $onedst || errorstatus=$?
+ fi
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv -f $onesrc $onedst" 1>&2
+ fi
+ mv -f $onesrc $onedst || errorstatus=$?
+ fi
+ if [ $errorstatus -ne 0 ]; then
+ break;
+ fi
+ done
+
+ shtool_exit $errorstatus
+ ;;
+
+install )
+ ##
+ ## install -- Install a program, script or datafile
+ ## Copyright (c) 1997-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # special case: "shtool install -d <dir> [...]" internally
+ # maps to "shtool mkdir -f -p -m 755 <dir> [...]"
+ if [ "$opt_d" = yes ]; then
+ cmd="$0 mkdir -f -p -m 755"
+ if [ ".$opt_o" != . ]; then
+ cmd="$cmd -o '$opt_o'"
+ fi
+ if [ ".$opt_g" != . ]; then
+ cmd="$cmd -g '$opt_g'"
+ fi
+ if [ ".$opt_v" = .yes ]; then
+ cmd="$cmd -v"
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ cmd="$cmd -t"
+ fi
+ for dir in "$@"; do
+ eval "$cmd $dir" || shtool_exit $?
+ done
+ shtool_exit 0
+ fi
+
+ # determine source(s) and destination
+ argc=$#
+ srcs=""
+ while [ $# -gt 1 ]; do
+ srcs="$srcs $1"
+ shift
+ done
+ dstpath="$1"
+
+ # type check for destination
+ dstisdir=0
+ if [ -d $dstpath ]; then
+ dstpath=`echo "$dstpath" | sed -e 's:/$::'`
+ dstisdir=1
+ fi
+
+ # consistency check for destination
+ if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then
+ echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2
+ shtool_exit 1
+ fi
+
+ # iterate over all source(s)
+ for src in $srcs; do
+ dst=$dstpath
+
+ # if destination is a directory, append the input filename
+ if [ $dstisdir = 1 ]; then
+ dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
+ dst="$dst/$dstfile"
+ fi
+
+ # check for correct arguments
+ if [ ".$src" = ".$dst" ]; then
+ echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2
+ continue
+ fi
+ if [ -d "$src" ]; then
+ echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
+ continue
+ fi
+
+ # make a temp file name in the destination directory
+ dsttmp=`echo $dst |\
+ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
+ -e "s;\$;/#INST@$$#;"`
+
+ # verbosity
+ if [ ".$opt_v" = .yes ]; then
+ echo "$src -> $dst" 1>&2
+ fi
+
+ # copy or move the file name to the temp name
+ # (because we might be not allowed to change the source)
+ if [ ".$opt_C" = .yes ]; then
+ opt_c=yes
+ fi
+ if [ ".$opt_c" = .yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp $src $dsttmp" 1>&2
+ fi
+ cp "$src" "$dsttmp" || shtool_exit $?
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv $src $dsttmp" 1>&2
+ fi
+ mv "$src" "$dsttmp" || shtool_exit $?
+ fi
+
+ # adjust the target file
+ if [ ".$opt_e" != . ]; then
+ sed='sed'
+ OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
+ for e
+ do
+ sed="$sed -e '$e'"
+ done
+ cp "$dsttmp" "$dsttmp.old"
+ chmod u+w $dsttmp
+ eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $?
+ rm -f $dsttmp.old
+ fi
+ if [ ".$opt_s" = .yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "strip $dsttmp" 1>&2
+ fi
+ strip $dsttmp || shtool_exit $?
+ fi
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o $dsttmp" 1>&2
+ fi
+ chown $opt_o $dsttmp || shtool_exit $?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g $dsttmp" 1>&2
+ fi
+ chgrp $opt_g $dsttmp || shtool_exit $?
+ fi
+ if [ ".$opt_m" != ".-" ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m $dsttmp" 1>&2
+ fi
+ chmod $opt_m $dsttmp || shtool_exit $?
+ fi
+
+ # determine whether to do a quick install
+ # (has to be done _after_ the strip was already done)
+ quick=no
+ if [ ".$opt_C" = .yes ]; then
+ if [ -r $dst ]; then
+ if cmp -s "$src" "$dst"; then
+ quick=yes
+ fi
+ fi
+ fi
+
+ # finally, install the file to the real destination
+ if [ $quick = yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f $dsttmp" 1>&2
+ fi
+ rm -f $dsttmp
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f $dst && mv $dsttmp $dst" 1>&2
+ fi
+ rm -f $dst && mv $dsttmp $dst
+ fi
+ done
+
+ shtool_exit 0
+ ;;
+
+mkdir )
+ ##
+ ## mkdir -- Make one or more directories
+ ## Copyright (c) 1996-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ errstatus=0
+ for p in ${1+"$@"}; do
+ # if the directory already exists...
+ if [ -d "$p" ]; then
+ if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
+ echo "$msgprefix:Error: directory already exists: $p" 1>&2
+ errstatus=1
+ break
+ else
+ continue
+ fi
+ fi
+ # if the directory has to be created...
+ if [ ".$opt_p" = .no ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $p" 1>&2
+ fi
+ mkdir $p || errstatus=$?
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o $p" 1>&2
+ fi
+ chown $opt_o $p || errstatus=$?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g $p" 1>&2
+ fi
+ chgrp $opt_g $p || errstatus=$?
+ fi
+ if [ ".$opt_m" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m $p" 1>&2
+ fi
+ chmod $opt_m $p || errstatus=$?
+ fi
+ else
+ # the smart situation
+ set fnord `echo ":$p" |\
+ sed -e 's/^:\//%/' \
+ -e 's/^://' \
+ -e 's/\// /g' \
+ -e 's/^%/\//'`
+ shift
+ pathcomp=''
+ for d in ${1+"$@"}; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp="./$pathcomp" ;;
+ esac
+ if [ ! -d "$pathcomp" ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $pathcomp" 1>&2
+ fi
+ mkdir $pathcomp || errstatus=$?
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o $pathcomp" 1>&2
+ fi
+ chown $opt_o $pathcomp || errstatus=$?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g $pathcomp" 1>&2
+ fi
+ chgrp $opt_g $pathcomp || errstatus=$?
+ fi
+ if [ ".$opt_m" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m $pathcomp" 1>&2
+ fi
+ chmod $opt_m $pathcomp || errstatus=$?
+ fi
+ fi
+ pathcomp="$pathcomp/"
+ done
+ fi
+ done
+
+ shtool_exit $errstatus
+ ;;
+
+mkln )
+ ##
+ ## mkln -- Make link with calculation of relative paths
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # determine source(s) and destination
+ args=$#
+ srcs=""
+ while [ $# -gt 1 ]; do
+ srcs="$srcs $1"
+ shift
+ done
+ dst="$1"
+ if [ ! -d $dst ]; then
+ if [ $args -gt 2 ]; then
+ echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # determine link options
+ lnopt=""
+ if [ ".$opt_f" = .yes ]; then
+ lnopt="$lnopt -f"
+ fi
+ if [ ".$opt_s" = .yes ]; then
+ lnopt="$lnopt -s"
+ fi
+
+ # iterate over sources
+ for src in $srcs; do
+ # determine if one of the paths is an absolute path,
+ # because then we _have_ to use an absolute symlink
+ oneisabs=0
+ srcisabs=0
+ dstisabs=0
+ case $src in
+ /* ) oneisabs=1; srcisabs=1 ;;
+ esac
+ case $dst in
+ /* ) oneisabs=1; dstisabs=1 ;;
+ esac
+
+ # split source and destination into dir and base name
+ if [ -d $src ]; then
+ srcdir=`echo $src | sed -e 's;/*$;;'`
+ srcbase=""
+ else
+ srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
+ srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'`
+ fi
+ if [ -d $dst ]; then
+ dstdir=`echo $dst | sed -e 's;/*$;;'`
+ dstbase=""
+ else
+ dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
+ dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'`
+ fi
+
+ # consistency check
+ if [ ".$dstdir" != . ]; then
+ if [ ! -d $dstdir ]; then
+ echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # make sure the source is reachable from the destination
+ if [ $dstisabs = 1 ]; then
+ if [ $srcisabs = 0 ]; then
+ if [ ".$srcdir" = . ]; then
+ srcdir="`pwd | sed -e 's;/*$;;'`"
+ srcisabs=1
+ oneisabs=1
+ elif [ -d $srcdir ]; then
+ srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`"
+ srcisabs=1
+ oneisabs=1
+ fi
+ fi
+ fi
+
+ # split away a common prefix
+ prefix=""
+ if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then
+ prefix="$srcdir/"
+ srcdir=""
+ dstdir=""
+ else
+ while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do
+ presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
+ predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
+ if [ ".$presrc" != ".$predst" ]; then
+ break
+ fi
+ prefix="$prefix$presrc/"
+ srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'`
+ dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
+ done
+ fi
+
+ # destination prefix is just the common prefix
+ dstpre="$prefix"
+
+ # determine source prefix which is the reverse directory
+ # step-up corresponding to the destination directory
+ srcpre=""
+ allow_relative_srcpre=no
+ if [ ".$prefix" != . ] && [ ".$prefix" != ./ ]; then
+ allow_relative_srcpre=yes
+ fi
+ if [ $oneisabs = 0 ]; then
+ allow_relative_srcpre=yes
+ fi
+ if [ ".$opt_s" != .yes ]; then
+ allow_relative_srcpre=no
+ fi
+ if [ ".$allow_relative_srcpre" = .yes ]; then
+ pl="$dstdir/"
+ OIFS="$IFS"; IFS='/'
+ for pe in $pl; do
+ [ ".$pe" = . ] && continue
+ [ ".$pe" = .. ] && continue
+ srcpre="../$srcpre"
+ done
+ IFS="$OIFS"
+ else
+ if [ $srcisabs = 1 ]; then
+ srcpre="$prefix"
+ fi
+ fi
+
+ # determine destination symlink name
+ if [ ".$dstbase" = . ]; then
+ if [ ".$srcbase" != . ]; then
+ dstbase="$srcbase"
+ else
+ dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'`
+ fi
+ fi
+
+ # now finalize source and destination directory paths
+ srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
+ dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
+
+ # run the final link command
+ if [ ".$opt_t" = .yes ]; then
+ echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase"
+ fi
+ eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase
+ done
+
+ shtool_exit 0
+ ;;
+
+mkshadow )
+ ##
+ ## mkshadow -- Make a shadow tree through symbolic links
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # source and destination directory
+ src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
+ dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
+
+ # check whether source exists
+ if [ ! -d $src ]; then
+ echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2
+ shtool_exit 1
+ fi
+
+ # determine if one of the paths is an absolute path,
+ # because then we have to use an absolute symlink
+ oneisabs=0
+ case $src in
+ /* ) oneisabs=1 ;;
+ esac
+ case $dst in
+ /* ) oneisabs=1 ;;
+ esac
+
+ # determine reverse directory for destination directory
+ dstrevdir=''
+ if [ $oneisabs = 0 ]; then
+ # derive reverse path from forward path
+ pwd=`pwd`
+ OIFS="$IFS"; IFS='/'
+ for pe in $dst; do
+ if [ "x$pe" = "x.." ]; then
+ OIFS2="$IFS"; IFS="$DIFS"
+ eval `echo "$pwd" |\
+ sed -e 's:\([^/]*\)$:; dir="\1":' \
+ -e 's:^\(.*\)/[^/]*;:pwd="\1";:'\
+ -e 's:^;:pwd="";:'`
+ dstrevdir="$dir/$dstrevdir"
+ IFS="$OIFS2"
+ else
+ dstrevdir="../$dstrevdir"
+ fi
+ done
+ IFS="$OIFS"
+ else
+ src="`cd $src; pwd`";
+ fi
+
+ # create directory tree at destination
+ if [ ! -d $dst ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $dst" 1>&2
+ fi
+ mkdir $dst
+ fi
+ if [ ".$opt_a" = .yes ]; then
+ DIRS=`cd $src; find . -type d -print |\
+ sed -e '/^\.$/d' -e 's:^\./::'`
+ else
+ DIRS=`cd $src; find . -type d -print |\
+ sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'`
+ fi
+ for dir in $DIRS; do
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $dst/$dir" 1>&2
+ fi
+ mkdir $dst/$dir
+ done
+
+ # fill directory tree with symlinks to files
+ if [ ".$opt_a" = .yes ]; then
+ FILES="`cd $src; find . -depth -print |\
+ sed -e 's/^\.\///'`"
+ else
+ FILES="`cd $src; find . -depth -print |\
+ sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \
+ -e '/\.cvsignore$/d' -e '/\/CVS/d' \
+ -e '/\/\.#/d' -e '/\.orig$/d' \
+ -e 's/^\.\///'`"
+ fi
+ for file in $FILES; do
+ # don't use `-type f' above for find because of symlinks
+ if [ -d "$src/$file" ]; then
+ continue
+ fi
+ basename=`echo $file | sed -e 's:^.*/::'`
+ dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'`
+ from=`echo "$src/$file" | sed -e 's/^\.\///'`
+ to="$dst/$dir$basename"
+ if [ $oneisabs = 0 ]; then
+ if [ ".$dir" != . ]; then
+ subdir=`echo $dir | sed -e 's:/$::'`
+ # derive reverse path from forward path
+ revdir=''
+ OIFS="$IFS"; IFS='/'
+ for pe in $subdir; do
+ revdir="../$revdir"
+ done
+ IFS="$OIFS"
+ # finalize from
+ from="$revdir$from"
+ fi
+ from="$dstrevdir$from"
+ fi
+ if [ ".$opt_v" = .yes ]; then
+ echo " $to" 1>&2
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "ln -s $from $to" 1>&2
+ fi
+ ln -s $from $to
+ done
+
+ shtool_exit 0
+ ;;
+
+fixperm )
+ ##
+ ## fixperm -- Fix file permissions inside a source tree
+ ## Copyright (c) 1996-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ paths="$*"
+
+ # check whether the test command supports the -x option
+ if [ -x /bin/sh ] 2>/dev/null; then
+ minusx="-x"
+ else
+ minusx="-r"
+ fi
+
+ # iterate over paths
+ for p in $paths; do
+ for file in `find $p -depth -print`; do
+ if [ -f $file ]; then
+ if [ $minusx $file ]; then
+ if [ ".$opt_v" = .yes ]; then
+ echo "-rwxr-xr-x $file" 2>&1
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod 755 $file" 2>&1
+ fi
+ chmod 755 $file
+ else
+ if [ ".$opt_v" = .yes ]; then
+ echo "-rw-r--r-- $file" 2>&1
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod 644 $file" 2>&1
+ fi
+ chmod 644 $file
+ fi
+ continue
+ fi
+ if [ -d $file ]; then
+ if [ ".$opt_v" = .yes ]; then
+ echo "drwxr-xr-x $file" 2>&1
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod 755 $file" 2>&1
+ fi
+ chmod 755 $file
+ continue
+ fi
+ if [ ".$opt_v" = .yes ]; then
+ echo "?????????? $file" 2>&1
+ fi
+ done
+ done
+
+ shtool_exit 0
+ ;;
+
+rotate )
+ ##
+ ## rotate -- Logfile rotation
+ ## Copyright (c) 2001-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # make sure we have at least one file to rotate
+ if [ ".$opt_n" = .0 ]; then
+ echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2
+ shtool_exit 1
+ fi
+
+ # canonicalize -s option argument
+ if [ ".$opt_s" != . ]; then
+ if [ ".`expr $opt_s : '[0-9]*$'`" != .0 ]; then
+ :
+ elif [ ".`expr $opt_s : '[0-9]*[Kk]$'`" != .0 ]; then
+ opt_s=`expr $opt_s : '\([0-9]*\)[Kk]$'`
+ opt_s=`expr $opt_s \* 1024`
+ elif [ ".`expr $opt_s : '[0-9]*[Mm]$'`" != .0 ]; then
+ opt_s=`expr $opt_s : '\([0-9]*\)[Mm]$'`
+ opt_s=`expr $opt_s \* 1048576` # 1024*1024
+ elif [ ".`expr $opt_s : '[0-9]*[Gg]$'`" != .0 ]; then
+ opt_s=`expr $opt_s : '\([0-9]*\)[Gg]$'`
+ opt_s=`expr $opt_s \* 1073741824` # 1024*1024*1024
+ else
+ echo "$msgprefix:Error: invalid argument \`$opt_s' to option -s." 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # option -d/-z consistency
+ if [ ".$opt_d" = .yes ] && [ ".$opt_z" = . ]; then
+ echo "$msgprefix:Error: option -d requires option -z." 1>&2
+ shtool_exit 1
+ fi
+
+ # make sure target directory exists
+ if [ ".$opt_a" != . ]; then
+ if [ ! -d $opt_a ]; then
+ if [ ".$opt_f" = .no ]; then
+ echo "$msgprefix:Error: archive directory \`$opt_a' does not exist." 1>&2
+ shtool_exit 1
+ fi
+ mkdir $opt_a || shtool_exit $?
+ chmod 755 $opt_a
+ fi
+ if [ ! -w $opt_a ]; then
+ echo "$msgprefix:Error: archive directory \`$opt_a' not writable." 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # determine compression approach
+ if [ ".$opt_z" != . ]; then
+ comp_lvl="$opt_z"
+ comp_prg=""
+ case $comp_lvl in
+ *:* ) eval `echo $comp_lvl |\
+ sed -e 's%^\(.*\):\(.*\)$%comp_prg="\1"; comp_lvl="\2"%'` ;;
+ esac
+
+ # compression level consistency
+ case $comp_lvl in
+ [0-9] )
+ ;;
+ * ) echo "$msgprefix:Error: invalid compression level \`$comp_lvl'" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+
+ # determine a suitable compression tool
+ if [ ".$comp_prg" = . ]; then
+ # check whether the test command supports the -x option
+ if [ -x /bin/sh ] 2>/dev/null; then
+ minusx="-x"
+ else
+ minusx="-r"
+ fi
+ # search for tools in $PATH
+ paths="`echo $PATH |\
+ sed -e 's%/*:%:%g' -e 's%/*$%%' \
+ -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+ -e 's/:/ /g'`"
+ for prg in bzip2 gzip compress; do
+ for path in $paths; do
+ if [ $minusx "$path/$prg" ] && [ ! -d "$path/$prg" ]; then
+ comp_prg="$prg"
+ break
+ fi
+ done
+ if [ ".$comp_prg" != . ]; then
+ break
+ fi
+ done
+ if [ ".$comp_prg" = . ]; then
+ echo "$msgprefix:Error: no suitable compression tool found in \$PATH" 1>&2
+ shtool_exit 1
+ fi
+ fi
+
+ # determine standard compression extension
+ # and make sure it is a known tool
+ case $comp_prg in
+ */bzip2 | bzip2 ) comp_ext="bz2" comp_lvl="-$comp_lvl" ;;
+ */gzip | gzip ) comp_ext="gz" comp_lvl="-$comp_lvl" ;;
+ */compress | compress ) comp_ext="Z"; comp_lvl="" ;;
+ * ) echo "$msgprefix:Error: tool \`$comp_prg' is not a known compression tool" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+ comp_suf=".$comp_ext"
+ fi
+
+ # iterate over all given logfile arguments
+ for file in $*; do
+ # make sure the logfile exists
+ if [ ! -f $file ]; then
+ if [ ".$opt_f" = .yes ]; then
+ continue
+ fi
+ echo "$msgprefix:Error: logfile \`$file' not found" 1>&2
+ shtool_exit 1
+ fi
+
+ # determine log directory (where original logfile is placed)
+ ldir="."
+ case $file in
+ */* ) eval `echo $file | sed -e 's%^\(.*\)/\([^/]*\)$%ldir="\1"; file="\2";%'` ;;
+ esac
+
+ # determine archive directory (where rotated logfiles are placed)
+ adir="$ldir"
+ if [ ".$opt_a" != . ]; then
+ case "$opt_a" in
+ /* | ./* ) adir="$opt_a" ;;
+ * ) adir="$ldir/$opt_a" ;;
+ esac
+ fi
+
+ # optionally take logfile size into account
+ if [ ".$opt_s" != . ]; then
+ # determine size of logfile
+ set -- `env -i /bin/ls -l "$ldir/$file" | sed -e "s;$ldir/$file;;" |\
+ sed -e 's; -> .*$;;' -e 's;[ ][ ]*; ;g'`
+ n=`expr $# - 3`
+ eval "size=\`echo \${$n}\`"
+
+ # skip logfile if size is still too small
+ if [ $size -lt $opt_s ]; then
+ if [ ".$opt_v" = .yes ]; then
+ echo "$ldir/$file: still too small in size -- skipping"
+ fi
+ continue
+ fi
+ fi
+
+ # verbosity
+ if [ ".$opt_v" = .yes ]; then
+ echo "rotating $ldir/$file"
+ fi
+
+ # execute prolog
+ if [ ".$opt_P" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "$opt_P"
+ fi
+ eval $opt_P
+ [ $? -ne 0 ] && shtool_exit $?
+ fi
+
+ # kick away out-rotated logfile
+ n=`expr $opt_n - 1`
+ n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n`
+ if [ -f "${adir}/${file}.${n}${comp_suf}" ]; then
+ # optionally migrate away the out-rotated logfile
+ if [ ".$opt_M" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "$opt_M ${adir}/${file}.${n}${comp_suf}"
+ fi
+ eval "$opt_M ${adir}/${file}.${n}${comp_suf}"
+ [ $? -ne 0 ] && shtool_exit $?
+ fi
+ # finally get rid of the out-rotated logfile
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f ${adir}/${file}.${n}${comp_suf}"
+ fi
+ rm -f ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ fi
+
+ # rotate already archived logfiles
+ while [ $n -gt 0 ]; do
+ m=$n
+ n=`expr $n - 1`
+ n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n`
+ if [ $n -eq 0 ] && [ ".$opt_d" = .yes ]; then
+ # special case: first rotation file under delayed compression situation
+ if [ ! -f "${adir}/${file}.${n}" ]; then
+ continue
+ fi
+
+ # compress file (delayed)
+ if [ ".$opt_b" = .yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv ${adir}/${file}.${n} ${adir}/${file}.${m}"
+ fi
+ mv ${adir}/${file}.${n} ${adir}/${file}.${m} || shtool_exit $?
+ if [ ".$opt_t" = .yes ]; then
+ echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${m} >${adir}/${file}.${m}${comp_suf}; rm -f ${adir}/${file}.${m}) &"
+ fi
+ ( ${comp_prg} ${comp_lvl} \
+ <${adir}/${file}.${m} \
+ >${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ rm -f ${adir}/${file}.${m} || shtool_exit $?
+ ) </dev/null >/dev/null 2>&1 &
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${m}${comp_suf}"
+ fi
+ ${comp_prg} ${comp_lvl} \
+ <${adir}/${file}.${n} \
+ >${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f ${adir}/${file}.${n}"
+ fi
+ rm -f ${adir}/${file}.${n} || shtool_exit $?
+ fi
+
+ # fix file attributes
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o ${adir}/${file}.${m}${comp_suf}"
+ fi
+ chown $opt_o ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g ${adir}/${file}.${m}${comp_suf}"
+ fi
+ chgrp $opt_g ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ fi
+ if [ ".$opt_m" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m ${adir}/${file}.${m}${comp_suf}"
+ fi
+ chmod $opt_m ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ fi
+ else
+ # standard case: second and following rotation file
+ if [ ! -f "${adir}/${file}.${n}${comp_suf}" ]; then
+ continue
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf}"
+ fi
+ mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+ fi
+ done
+
+ # move away current logfile
+ if [ ".$opt_c" = .yes ]; then
+ # approach: copy[+truncate]
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp -p ${ldir}/${file} ${adir}/${file}.${n}"
+ fi
+ cp -p ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $?
+ if [ ".$opt_r" = .no ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp /dev/null ${ldir}/${file}"
+ fi
+ cp /dev/null ${ldir}/${file} || shtool_exit $?
+ fi
+ else
+ # approach: move[+touch]
+ if [ ".$opt_t" = .yes ]; then
+ echo "mv ${ldir}/${file} ${adir}/${file}.${n}"
+ fi
+ mv ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $?
+ if [ ".$opt_r" = .no ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "touch ${ldir}/${file}"
+ fi
+ touch ${ldir}/${file} || shtool_exit $?
+ # fix file attributes
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o ${ldir}/${file}"
+ fi
+ chown $opt_o ${ldir}/${file} || shtool_exit $?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g ${ldir}/${file}"
+ fi
+ chgrp $opt_g ${ldir}/${file} || shtool_exit $?
+ fi
+ if [ ".$opt_m" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m ${ldir}/${file}"
+ fi
+ chmod $opt_m ${ldir}/${file} || shtool_exit $?
+ fi
+ fi
+ fi
+
+ # regular compression step
+ if [ ".$opt_z" != . ] && [ ".$opt_d" = .no ]; then
+ # compress file
+ if [ ".$opt_b" = .yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}; rm -f ${adir}/${file}.${n}) &"
+ fi
+ ( ${comp_prg} ${comp_lvl} \
+ <${adir}/${file}.${n} \
+ >${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ rm -f ${adir}/${file}.${n} || shtool_exit $?
+ ) </dev/null >/dev/null 2>&1 &
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}"
+ fi
+ ${comp_prg} ${comp_lvl} \
+ <${adir}/${file}.${n} \
+ >${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f ${opt_a}${file}.${n}"
+ fi
+ rm -f ${adir}/${file}.${n} || shtool_exit $?
+ fi
+
+ # fix file attributes
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o ${adir}/${file}.${n}${comp_suf}"
+ fi
+ chown $opt_o ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp $opt_g ${adir}/${file}.${n}${comp_suf}"
+ fi
+ chgrp $opt_g ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ fi
+ if [ ".$opt_m" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chmod $opt_m ${adir}/${file}.${n}${comp_suf}"
+ fi
+ chmod $opt_m ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+ fi
+ fi
+
+ # execute epilog
+ if [ ".$opt_E" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "$opt_E"
+ fi
+ eval $opt_E
+ [ $? -ne 0 ] && shtool_exit $?
+ fi
+ done
+
+ shtool_exit 0
+ ;;
+
+tarball )
+ ##
+ ## tarball -- Roll distribution tarballs
+ ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ srcs="$*"
+
+ # check whether the test command supports the -x option
+ if [ -x /bin/sh ] 2>/dev/null; then
+ minusx="-x"
+ else
+ minusx="-r"
+ fi
+
+ # find the tools
+ paths="`echo $PATH |\
+ sed -e 's%/*:%:%g' -e 's%/*$%%' \
+ -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+ -e 's/:/ /g'`"
+ for spec in find:gfind,find tar:gtar,tar tardy:tardy,tarcust; do
+ prg=`echo $spec | sed -e 's/:.*$//'`
+ tools=`echo $spec | sed -e 's/^.*://'`
+ eval "prg_${prg}=''"
+ # iterate over tools
+ for tool in `echo $tools | sed -e 's/,/ /g'`; do
+ # iterate over paths
+ for path in $paths; do
+ if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then
+ eval "prg_${prg}=\"$path/$tool\""
+ break
+ fi
+ done
+ eval "val=\$prg_${prg}"
+ if [ ".$val" != . ]; then
+ break
+ fi
+ done
+ done
+
+ # expand source paths
+ exclude=''
+ for pat in `echo $opt_e | sed 's/,/ /g'`; do
+ exclude="$exclude | grep -v '$pat'"
+ done
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp /dev/null $tmpfile.lst" 1>&2
+ fi
+ cp /dev/null $tmpfile.lst
+ for src in $srcs; do
+ if [ -d $src ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2
+ fi
+ (cd $src && $prg_find . -type f -depth -print) |\
+ sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst
+ else
+ if [ ".$opt_t" = .yes ]; then
+ echo "echo $src >>$tmpfile.lst" 1>&2
+ fi
+ echo $src >>$tmpfile.lst
+ fi
+ done
+ sort <$tmpfile.lst >$tmpfile.lst.n
+ mv $tmpfile.lst.n $tmpfile.lst
+ if [ ".$opt_v" = .yes ]; then
+ cat $tmpfile.lst | sed -e 's/^/ /' 1>&2
+ fi
+
+ # determine tarball file and directory name
+ if [ ".$opt_o" != . ]; then
+ tarfile="$opt_o"
+ if [ ".$opt_d" != . ]; then
+ tarname="$opt_d"
+ else
+ tarname=`echo $tarfile | sed -e 's/\.tar.*$//' -e 's;.*/\([^/]*\)$;\1;'`
+ fi
+ else
+ if [ ".$opt_d" != . ]; then
+ tarname="$opt_d"
+ elif [ -d "$from" ]; then
+ tarname=`echo $from | sed -e 's;.*/\([^/]*\)$;\1;'`
+ else
+ tarname="out"
+ fi
+ tarfile="$tarname.tar"
+ fi
+
+ # roll the tarball
+ compress=''
+ if [ ".$opt_c" != . ]; then
+ compress="| $opt_c"
+ fi
+ if [ ".$prg_tardy" != . ]; then
+ # the elegant hackers way
+ tardy_opt="--prefix=$tarname"
+ tardy_opt="$tardy_opt --user_number=0 --group_number=0" # security!
+ if [ ".$opt_u" != . ]; then
+ tardy_opt="$tardy_opt --user_name=$opt_u"
+ fi
+ if [ ".$opt_g" != . ]; then
+ tardy_opt="$tardy_opt --group_name=$opt_g"
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "cat $tmpfile.lst | xargs $prg_tar cf - | $prg_tardy $tardy_opt | cat $compress >$tmpfile.out" 1>&2
+ fi
+ cat $tmpfile.lst |\
+ xargs $prg_tar cf - |\
+ $prg_tardy $tardy_opt |\
+ eval cat $compress >$tmpfile.out
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp $tmpfile.out $tarfile" 1>&2
+ fi
+ cp $tmpfile.out $tarfile
+ else
+ # the portable standard way
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $tmpdir/$tarname" 1>&2
+ fi
+ mkdir $tmpdir/$tarname || shtool_exit 1
+ if [ ".$opt_t" = .yes ]; then
+ echo "cat $tmpfile.lst | xargs $prg_tar cf - | (cd $tmpdir/$tarname && $prg_tar xf -)" 1>&2
+ fi
+ cat $tmpfile.lst |\
+ xargs $prg_tar cf - |\
+ (cd $tmpdir/$tarname && $prg_tar xf -)
+ if [ ".$opt_u" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1
+ fi
+ chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\
+ echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root privileges)"
+ fi
+ if [ ".$opt_g" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1
+ fi
+ chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\
+ echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root privileges)"
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2
+ fi
+ (cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) |\
+ eval cat $compress >$tmpfile.out
+ if [ ".$opt_t" = .yes ]; then
+ echo "cp $tmpfile.out $tarfile" 1>&2
+ fi
+ cp $tmpfile.out $tarfile
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -rf $tmpdir/$tarname" 1>&2
+ fi
+ rm -rf $tmpdir/$tarname
+ fi
+
+ # cleanup
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -f $tmpfile.lst $tmpfile.out" 1>&2
+ fi
+ rm -f $tmpfile.lst $tmpfile.out
+
+ shtool_exit 0
+ ;;
+
+subst )
+ ##
+ ## subst -- Apply sed(1) substitution operations
+ ## Copyright (c) 2001-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # remember optional list of file(s)
+ files="$*"
+ files_num="$#"
+
+ # parameter consistency check
+ if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then
+ echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2
+ shtool_exit 1
+ fi
+ if [ $# -eq 0 ] && [ ".$opt_s" = .yes ]; then
+ echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2
+ shtool_exit 1
+ fi
+
+ # build underlying sed(1) command
+ sedcmd='sed'
+ if [ ".$opt_e" != . ]; then
+ OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
+ for e
+ do
+ sedcmd="$sedcmd -e '$e'"
+ done
+ elif [ ".$opt_f" != . ]; then
+ if [ ! -f $opt_f ]; then
+ echo "$msgprefix:Error: command file \`$opt_f' not found or not a regular file" 1>&2
+ shtool_exit 1
+ fi
+ sedcmd="$sedcmd -f '$opt_f'"
+ else
+ echo "$msgprefix:Error: either -e option(s) or -f option required" 1>&2
+ shtool_exit 1
+ fi
+
+ # determine extension for original file
+ orig=".orig"
+ if [ ".$opt_b" != . ]; then
+ orig="$opt_b"
+ fi
+
+ # apply sed(1) operation(s)
+ if [ ".$files" != . ]; then
+ # apply operation(s) to files
+ substdone=no
+ for file in $files; do
+ test ".$file" = . && continue
+ if [ ! -f $file ]; then
+ echo "$msgprefix:Warning: file \`$file' not found or not a regular file" 1>&2
+ continue
+ fi
+
+ # handle interactive mode
+ if [ ".$opt_i" = .yes ]; then
+ eval "$sedcmd <$file >$file.new"
+ skip=no
+ if cmp $file $file.new >/dev/null 2>&1; then
+ rm -f $file.new
+ skip=yes
+ else
+ (diff -U1 $file $file.new >$tmpfile) 2>/dev/null
+ if [ ".`cat $tmpfile`" = . ]; then
+ (diff -C1 $file $file.new >$tmpfile) 2>/dev/null
+ if [ ".`cat $tmpfile`" = . ]; then
+ echo "$msgprefix:Warning: unable to show difference for file \`$file'" 1>&2
+ cp /dev/null $tmpfile
+ fi
+ fi
+ rm -f $file.new
+ cat $tmpfile
+ echo dummy | awk '{ printf("%s", TEXT); }' TEXT=">>> Apply [Y/n]: "
+ read input
+ if [ ".$input" != .Y ] &&\
+ [ ".$input" != .y ] &&\
+ [ ".$input" != . ]; then
+ skip=yes
+ fi
+ fi
+ if [ ".$skip" = .yes ]; then
+ if [ ".$opt_v" = .yes ]; then
+ echo "file \`$file' -- skipped" 1>&2
+ fi
+ continue
+ fi
+ fi
+
+ # apply sed(1) operation(s)
+ if [ ".$opt_v" = .yes ]; then
+ echo "patching \`$file'" 1>&2
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "\$ cp -p $file $file$orig"
+ echo "\$ chmod u+w $file"
+ echo "\$ $sedcmd <$file$orig >$file"
+ fi
+ if [ ".$opt_n" = .no ]; then
+ cp -p $file $file$orig
+ chmod u+w $file >/dev/null 2>&1 || true
+ eval "$sedcmd <$file$orig >$file"
+ fi
+
+ # optionally fix timestamp
+ if [ ".$opt_s" = .yes ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "\$ touch -r $file$orig $file"
+ fi
+ if [ ".$opt_n" = .no ]; then
+ touch -r $file$orig $file
+ fi
+ fi
+
+ # optionally check whether any content change actually occurred
+ if [ ".$opt_q" = .no ]; then
+ if cmp $file$orig $file >/dev/null 2>&1; then
+ if [ ".$opt_w" = .yes ]; then
+ echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
+ fi
+ else
+ substdone=yes
+ fi
+ fi
+
+ # optionally remove preserved original file
+ if [ ".$opt_b" = . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "\$ rm -f $file$orig"
+ fi
+ if [ ".$opt_n" = .no ]; then
+ rm -f $file$orig
+ fi
+ fi
+ done
+ if [ ".$opt_q" = .no ] && [ ".$opt_w" = .no ]; then
+ if [ ".$substdone" = .no ]; then
+ if [ ".$files_num" = .1 ]; then
+ echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
+ else
+ echo "$msgprefix:Warning: substitution resulted in no content change on any file" 1>&2
+ fi
+ fi
+ fi
+ else
+ # apply operation(s) to stdin/stdout
+ if [ ".$opt_v" = .yes ]; then
+ echo "patching <stdin>" 1>&2
+ fi
+ if [ ".$opt_t" = .yes ]; then
+ echo "\$ $sedcmd"
+ fi
+ if [ ".$opt_n" = .no ]; then
+ eval "$sedcmd"
+ fi
+ fi
+
+ shtool_exit 0
+ ;;
+
+platform )
+ ##
+ ## platform -- Platform Identification Utility
+ ## Copyright (c) 2003-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ # option post-processing
+ if [ ".$opt_t" != . ]; then
+ case "$opt_t" in
+ binary )
+ # binary package id (OpenPKG RPM)
+ opt_F="%<ap>-%<sp>"
+ opt_L=yes
+ opt_S=""
+ opt_C="+"
+ ;;
+ build )
+ # build time checking (OpenPKG RPM)
+ opt_F="%<at>-%<st>"
+ opt_L=yes
+ opt_S=""
+ opt_C="+"
+ ;;
+ gnu )
+ # GNU config.guess style <arch>-<vendor>-<os><osversion>
+ opt_F="%<at>-unknown-%<st>"
+ opt_L=yes
+ opt_S=""
+ opt_C="+"
+ ;;
+ web )
+ # non-whitespace HTTP Server-header id
+ opt_F="%<sp>-%<ap>"
+ opt_S="/"
+ opt_C="+"
+ ;;
+ summary)
+ # human readable verbose summary information
+ opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])"
+ opt_S=" "
+ opt_C="/"
+ ;;
+ all-in-one )
+ # full-table all-in-one information
+ opt_F=""
+ opt_F="${opt_F}concise architecture class: %<ac>\\n"
+ opt_F="${opt_F}regular architecture class: %{ac}\\n"
+ opt_F="${opt_F}verbose architecture class: %[ac]\\n"
+ opt_F="${opt_F}concise architecture product: %<ap>\\n"
+ opt_F="${opt_F}regular architecture product: %{ap}\\n"
+ opt_F="${opt_F}verbose architecture product: %[ap]\\n"
+ opt_F="${opt_F}concise architecture technology: %<at>\\n"
+ opt_F="${opt_F}regular architecture technology: %{at}\\n"
+ opt_F="${opt_F}verbose architecture technology: %[at]\\n"
+ opt_F="${opt_F}concise system class: %<sc>\\n"
+ opt_F="${opt_F}regular system class: %{sc}\\n"
+ opt_F="${opt_F}verbose system class: %[sc]\\n"
+ opt_F="${opt_F}concise system product: %<sp>\\n"
+ opt_F="${opt_F}regular system product: %{sp}\\n"
+ opt_F="${opt_F}verbose system product: %[sp]\\n"
+ opt_F="${opt_F}concise system technology: %<st>\\n"
+ opt_F="${opt_F}regular system technology: %{st}\\n"
+ opt_F="${opt_F}verbose system technology: %[st]"
+ ;;
+ * )
+ echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2
+ exit 1
+ ;;
+ esac
+ fi
+
+ # assemble initial platform information
+ UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\
+ UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\
+ UNAME_MACHINE='unknown'
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\
+ UNAME_SYSTEM='unknown'
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\
+ UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\
+ UNAME_RELEASE='unknown'
+
+ UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}"
+
+ AC=""; AP=""; AT=""
+ SC=""; SP=""; ST=""
+
+ # dispatch into platform specific sections
+ case "${UNAME}" in
+
+ # FreeBSD
+ *:FreeBSD:* )
+ # determine architecture
+ AC="${UNAME_MACHINE}"
+ case "${AC}" in
+ i386 ) AC="iX86" ;;
+ esac
+ AP="${AC}"
+ AT="${AP}"
+ if [ ".${AT}" = ".iX86" ]; then
+ case "`(/sbin/sysctl -n hw.model) 2>&1`" in
+ *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;;
+ *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;;
+ *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;;
+ esac
+ fi
+ # determine system
+ r=`echo "${UNAME_RELEASE}" |\
+ sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'`
+ ST="FreeBSD ${r}"
+ SP="${ST}"
+ case "${r}" in
+ 1.* ) SC="4.3BSD" ;;
+ * ) SC="4.4BSD" ;;
+ esac
+ ;;
+
+ # NetBSD
+ *:NetBSD:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ AP="${AT}"
+ case "${AP}" in
+ i[3-6]86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
+ ST="NetBSD ${r}"
+ SP="${ST}"
+ case "${r}" in
+ 0.* ) SC="4.3BSD" ;;
+ * ) SC="4.4BSD" ;;
+ esac
+ ;;
+
+ # OpenBSD
+ *:OpenBSD:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ AP="${AT}"
+ case "${AP}" in
+ i[3-6]86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
+ ST="OpenBSD ${r}"
+ SP="${ST}"
+ SC="4.4BSD"
+ ;;
+
+ # DragonFly BSD
+ *:DragonFly:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ AP="${AT}"
+ case "${AP}" in
+ i[3-6]86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
+ ST="DragonFly ${r}"
+ SP="${ST}"
+ SC="4.4BSD"
+ ;;
+
+ # GNU/Linux
+ *:Linux:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ case "${AT}" in
+ ia64 ) AT="IA64" ;;
+ x86_64 ) AT='AMD64' ;;
+ parisc ) AT="HPPA32" ;;
+ parisc64 ) AT="HPPA64" ;;
+ esac
+ AP="${AT}"
+ case "${AP}" in
+ i[3-6]86 ) AP='iX86' ;;
+ esac
+ AC="${AP}"
+ # determine system
+ v_kern=`echo "${UNAME_RELEASE}" |\
+ sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
+ v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\
+ env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null`
+ ST="GNU/<Linux >${v_libc}/<${v_kern}>"
+ if [ -f /etc/lsb-release ]; then
+ eval `( . /etc/lsb-release
+ echo "SC=\"LSB${LSB_VERSION}\""
+ if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then
+ echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\""
+ fi
+ ) 2>/dev/null`
+ fi
+ if [ ".$SP" = . ]; then
+ for tagfile in x \
+ `cd /etc && \
+ /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \
+ sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \
+ echo redhat-release lsb-release`
+ do
+ [ ".${tagfile}" = .x ] && continue
+ [ ! -f "/etc/${tagfile}" ] && continue
+ n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
+ v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
+ sed -e 's/^/#/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
+ -e 's/^#.*$//'`
+ case "`util_lower ${n}`" in
+ redhat )
+ if [ ".`egrep '(Red Hat Enterprise Linux|CentOS)' /etc/${tagfile}`" != . ]; then
+ n="<R>ed <H>at <E>nterprise <L>inux"
+ else
+ n="<R>ed <H>at <L>inux"
+ fi
+ ;;
+ debian ) n="Debian[ GNU/Linux]" ;;
+ ubuntu ) n="Ubuntu[ GNU/Linux]" ;;
+ fedora ) n="<Fedora> Core[ GNU/Linux]" ;;
+ suse ) n="[Novell ]SUSE[ Linux]" ;;
+ mandrake*|mandriva ) n="Mandriva[ Linux]" ;;
+ gentoo ) n="Gentoo[ GNU/Linux]" ;;
+ slackware ) n="Slackware[ Linux]" ;;
+ turbolinux ) n="TurboLinux" ;;
+ unitedlinux ) n="UnitedLinux" ;;
+ * ) n="${n}[ GNU/Linux]" ;;
+ esac
+ case "$n" in
+ *"<"*">"* ) SP="$n <$v>" ;;
+ * ) SP="$n $v" ;;
+ esac
+ break
+ done
+ fi
+ [ ".$SP" = . ] && SP="${ST}"
+ [ ".$SC" = . ] && SC="LSB"
+ ;;
+
+ # Sun Solaris
+ *:SunOS:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ case "${AT}" in
+ i86pc )
+ AT="iX86"
+ case "`(/bin/isainfo -k) 2>&1`" in
+ amd64 ) AT="AMD64" ;;
+ esac
+ ;;
+ esac
+ AP="${AT}"
+ case "${AP}" in
+ sun4[cdm] ) AP="SPARC32" ;;
+ sun4[uv] ) AP="SPARC64" ;;
+ sun4* ) AP="SPARC" ;;
+ esac
+ AC="${AP}"
+ case "${AC}" in
+ SPARC* ) AC="SPARC" ;;
+ esac
+ # determine system
+ ST="[Sun ]SunOS ${UNAME_RELEASE}"
+ v=`echo "${UNAME_RELEASE}" |\
+ sed -e 's;^4\.;1.;' \
+ -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \
+ -e 's;^5\.\([0-9][0-9]*\).*;\1;'`
+ SP="[Sun ]Solaris $v"
+ case "${UNAME_RELEASE}" in
+ 4.* ) SC="4.3BSD" ;;
+ 5.* ) SC="SVR4" ;;
+ esac
+ ;;
+
+ # SCO UnixWare
+ *:UnixWare:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ case "${AT}" in
+ i[3-6]86 | ix86at ) AT="iX86" ;;
+ esac
+ AP="${AT}"
+ # determine system
+ v=`/sbin/uname -v`
+ ST="[SCO ]UnixWare ${v}"
+ SP="${ST}"
+ SC="SVR${UNAME_RELEASE}"
+ ;;
+
+ # QNX
+ *:QNX:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ case "${AT}" in
+ x86pc ) AT="iX86" ;;
+ esac
+ AP="${AT}"
+ # determine system
+ v="${UNAME_RELEASE}"
+ ST="QNX[ Neutrino RTOS] ${v}"
+ v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'`
+ SP="QNX[ Neutrino RTOS] ${v}"
+ SC="QNX"
+ ;;
+
+ # SGI IRIX
+ *:IRIX*:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ AP="${AT}"
+ case "${AP}:${UNAME_SYSTEM}" in
+ IP*:IRIX64 ) AP="MIPS64" ;;
+ IP*:* ) AP="MIPS" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'`
+ ST="[SGI ]IRIX ${v}"
+ v="${UNAME_RELEASE}"
+ SP="[SGI ]IRIX ${v}"
+ SC="4.2BSD/SVR3"
+ ;;
+
+ # HP HP-UX
+ *:HP-UX:* )
+ # determine architecture
+ AT="${UNAME_MACHINE}"
+ case "${AT}" in
+ ia64 ) AT="IA64" ;;
+ 9000/[34]?? ) AT=M68K ;;
+ 9000/[678][0-9][0-9])
+ 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 ) AT="HPPA1.0" ;;
+ 528 ) AT="HPPA1.1" ;;
+ 532 ) AT="HPPA2.0"
+ case "${sc_kernel_bits}" in
+ 32 ) AT="${AT}n" ;;
+ 64 ) AT="${AT}w" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ AP="${AT}"
+ case "${AP}" in
+ HPPA* ) AP="HPPA" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'`
+ ST="[HP ]<HP>-<UX ${v}>"
+ SP="${ST}"
+ case "${v}" in
+ 10.* ) SC="SVR4.2" ;;
+ [7-9]* ) SC="SVR4" ;;
+ esac
+ ;;
+
+ # HP Tru64 (OSF1)
+ *:OSF1:* )
+ # determine architecture
+ AP="${UNAME_MACHINE}"
+ case "${AP}" in
+ alpha ) AP="Alpha" ;;
+ esac
+ alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\
+ sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'`
+ AT="${AP}${alpha_type}"
+ AC="${AP}"
+ # determine system
+ v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'`
+ ST="[HP ]Tru64 ${v}"
+ SP="${ST}"
+ SC="OSF1"
+ ;;
+
+ # IBM AIX
+ *:AIX:* )
+ # determine architecture
+ cpu_arch=RS6000
+ if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
+ cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then
+ cpu_arch=PPC
+ fi
+ elif [ -d /QOpenSys ]; then
+ # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment)
+ cpu_arch=PPC
+ fi
+ if [ -x /usr/bin/oslevel ]; then
+ os_level=`/usr/bin/oslevel`
+ else
+ os_level="`uname -v`.`uname -r`"
+ fi
+ os_level=`echo "${os_level}" |\
+ sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \
+ -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'`
+ AT="${cpu_arch}"
+ AP="${AT}"
+ AC="${AP}"
+ # determine system
+ ST="[IBM ]<AIX >${os_level}"
+ SP="${ST}"
+ case "${os_level}" in
+ [12]* ) SC="SVR2" ;;
+ * ) SC="SVR4" ;;
+ esac
+ ;;
+
+ # Apple Mac OS X (Darwin)
+ *:Darwin:* )
+ # determine architecture
+ AT="`uname -p`"
+ case "${AT}" in
+ powerpc ) AT="PPC" ;;
+ esac
+ AP="${AT}"
+ case "${AP}" in
+ i?86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ unset v1; unset v2; unset v3
+ eval `echo "${UNAME_RELEASE}" |\
+ sed -e 's/^/#/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
+ -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
+ -e 's/^#.*$/v1="0"/'`
+ ST="[Apple ]<${UNAME_SYSTEM} ${v1}>${v2+.$v2}${v3+[.$v3]}"
+ SP="$ST"
+ v="`(sw_vers) 2>/dev/null | grep 'ProductVersion:' | sed -e 's/^ProductVersion:[^0-9]*\([0-9][0-9.]*\).*$/\1/'`"
+ if [ ".$v" = . ]; then
+ for name in System Server; do
+ if [ -f /System/Library/CoreServices/${name}Version.plist ]; then
+ v=`(defaults read "/System/Library/CoreServices/${name}Version" "ProductVersion") 2>/dev/null`
+ [ ".$v" != . ] && break
+ fi
+ done
+ fi
+ if [ ".$v" != . ]; then
+ unset v1; unset v2; unset v3
+ eval `echo "${v}" |\
+ sed -e 's/^/#/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
+ -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
+ -e 's/^#.*$/v1="0"/'`
+ SP="[Apple ]Mac OS X ${v1}${v2+.$v2}${v3+[.$v3]}"
+ fi
+ SC="4.4BSD/Mach3.0"
+ ;;
+
+ # Windows/Cygwin
+ *:CYGWIN*:* )
+ # determine architecture
+ AT="`uname -m`"
+ AP="${AT}"
+ case "${AP}" in
+ i?86 ) AP="iX86" ;;
+ esac
+ AC="${AP}"
+ # determine system
+ unset v1; unset v2; unset v3
+ eval `echo "${UNAME_RELEASE}" |\
+ sed -e 's/^/#/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
+ -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
+ -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
+ -e 's/^#.*$/v1="0"/'`
+ ST="Cygwin ${v1}${v2+.$v2}${v3+[.$v3]}"
+ SP="$ST"
+ SC="Windows"
+ v=`echo "${UNAME_SYSTEM}" | sed -e 's/^CYGWIN_NT-//' |\
+ sed -e 's/^/#/' -e 's/^#\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' -e 's/^#.*$//'`
+ case "$v" in
+ 4.0 ) SC="$SC[ NT]" ;;
+ 5.0 ) SC="$SC[ 2000]" ;;
+ 5.1 ) SC="$SC[ XP]" ;;
+ 6.0 ) SC="$SC[ Vista]" ;;
+ esac
+ ;;
+
+ # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
+ # *:XXX:* )
+ # ...
+ # ;;
+
+ # ...A STILL UNKNOWN PLATFORM...
+ * )
+ AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"`
+ AP="${AT}"
+ AC="${AP}"
+ v=`echo "${UNAME_RELEASE}" |\
+ sed -e 's/^/#/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+ -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
+ -e 's/^#.*$/?/'`
+ ST="${UNAME_SYSTEM} ${v}"
+ SP="${ST}"
+ SC="${SP}"
+ ;;
+
+ esac
+
+ # provide fallback values
+ [ ".$AT" = . ] && AT="${AP:-${AC}}"
+ [ ".$AP" = . ] && AP="${AT:-${AC}}"
+ [ ".$AC" = . ] && AC="${AP:-${AT}}"
+ [ ".$ST" = . ] && ST="${SP:-${SC}}"
+ [ ".$SP" = . ] && SP="${ST:-${SC}}"
+ [ ".$SC" = . ] && SC="${SP:-${ST}}"
+
+ # support explicit enforced verbose/concise output
+ if [ ".$opt_v" = .yes ]; then
+ opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'`
+ elif [ ".$opt_c" = .yes ]; then
+ opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'`
+ fi
+
+ # provide verbose and concise variants
+ AC_V=""; AC_N=""; AC_C=""
+ AP_V=""; AP_N=""; AP_C=""
+ AT_V=""; AT_N=""; AT_C=""
+ SC_V=""; SC_N=""; SC_C=""
+ SP_V=""; SP_N=""; SP_C=""
+ ST_V=""; ST_N=""; ST_C=""
+ for var_lc in at ap ac st sp sc; do
+ case "$opt_F" in
+ *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* )
+ var_uc=`util_upper "$var_lc"`
+ eval "val=\"\$${var_uc}\""
+ val_V=""; val_N=""; val_C=""
+ case "$opt_F" in
+ *"%[${var_lc}]"* )
+ val_V=`echo ":$val" | \
+ sed -e 's/^://' \
+ -e 's;\[\([^]]*\)\];\1;g' \
+ -e 's;<\([^>]*\)>;\1;g' \
+ -e "s; ;��;g" \
+ -e "s;/;%%;g" \
+ -e "s;��;${opt_S};g" \
+ -e "s;%%;${opt_C};g"`
+ eval "${var_uc}_V=\"\${val_V}\""
+ ;;
+ esac
+ case "$opt_F" in
+ *"%{${var_lc}}"* | *"%${var_lc}"* )
+ val_N=`echo ":$val" | \
+ sed -e 's/^://' \
+ -e 's;\[\([^]]*\)\];;g' \
+ -e 's;<\([^>]*\)>;\1;g' \
+ -e "s; ;��;g" \
+ -e "s;/;%%;g" \
+ -e "s;��;${opt_S};g" \
+ -e "s;%%;${opt_C};g"`
+ eval "${var_uc}_N=\"\${val_N}\""
+ ;;
+ esac
+ case "$opt_F" in
+ *"%<${var_lc}>"* )
+ val_C=`echo ":$val" | \
+ sed -e 's/^://' \
+ -e 's;\[\([^]]*\)\];;g' \
+ -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \
+ -e "s; ;��;g" \
+ -e "s;/;%%;g" \
+ -e "s;��;${opt_S};g" \
+ -e "s;%%;${opt_C};g"`
+ eval "${var_uc}_C=\"\${val_C}\""
+ ;;
+ esac
+ ;;
+ esac
+ done
+
+ # create output string
+ output=`echo ":$opt_F" |\
+ sed -e "s/^://" \
+ -e "s;%\\[ac\\];${AC_V};g" \
+ -e "s;%{ac};${AC_N};g" \
+ -e "s;%ac;${AC_N};g" \
+ -e "s;%<ac>;${AC_C};g" \
+ -e "s;%\\[ap\\];${AP_V};g" \
+ -e "s;%{ap};${AP_N};g" \
+ -e "s;%ap;${AP_N};g" \
+ -e "s;%<ap>;${AP_C};g" \
+ -e "s;%\\[at\\];${AT_V};g" \
+ -e "s;%{at};${AT_N};g" \
+ -e "s;%at;${AT_N};g" \
+ -e "s;%<at>;${AT_C};g" \
+ -e "s;%\\[sc\\];${SC_V};g" \
+ -e "s;%{sc};${SC_N};g" \
+ -e "s;%sc;${SC_N};g" \
+ -e "s;%<sc>;${SC_C};g" \
+ -e "s;%\\[sp\\];${SP_V};g" \
+ -e "s;%{sp};${SP_N};g" \
+ -e "s;%sp;${SP_N};g" \
+ -e "s;%<sp>;${SP_C};g" \
+ -e "s;%\\[st\\];${ST_V};g" \
+ -e "s;%{st};${ST_N};g" \
+ -e "s;%st;${ST_N};g" \
+ -e "s;%<st>;${ST_C};g" \
+ -e 's/\\\\n/^/g' |\
+ tr '^' '\012'`
+
+ # support lower/upper-case mapping
+ if [ ".$opt_L" = .yes ]; then
+ output=`util_lower "$output"`
+ elif [ ".$opt_U" = .yes ]; then
+ output=`util_upper "$output"`
+ fi
+
+ # display output string
+ if [ ".$opt_n" = .yes ]; then
+ echo . | awk '{ printf("%s", output); }' output="$output"
+ else
+ echo "$output"
+ fi
+
+ shtool_exit 0
+ ;;
+
+arx )
+ ##
+ ## arx -- Extended archive command
+ ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ ar_prg="$opt_C"
+ ar_cmd="$1"; shift
+ archive="$1"; shift
+ files="$*"
+
+ # walk through the file list and expand archives members
+ ar_tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'`
+ nfiles=''
+ if [ ".$files" != . ]; then
+ for file in $files; do
+ if [ ! -f $file ]; then
+ echo "$msgprefix:Error: input file not found: $file" 1>&2
+ shtool_exit 1
+ fi
+ case $file in
+ *.a )
+ if [ ! -d $ar_tmpdir ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $ar_tmpdir" 1>&2
+ fi
+ mkdir $ar_tmpdir
+ fi
+ case $ar_tmpdir in
+ .arx )
+ from="../$file"
+ ;;
+ * )
+ dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
+ base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'`
+ from="`cd $dir; pwd`/$base"
+ ;;
+ esac
+ if [ ".$opt_t" = .yes ]; then
+ echo "(cd $ar_tmpdir && $ar_prg x $from)" 1>&2
+ fi
+ (cd $ar_tmpdir && eval $ar_prg x $from)
+ if [ $? -ne 0 ]; then
+ echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2
+ shtool_exit 1
+ fi
+ for member in - `eval $ar_prg t $file | sed -e '/_\.SYMDEF/d'`; do
+ [ ".$member" = .- ] && continue
+ nfiles="$nfiles $ar_tmpdir/$member"
+ done
+ ;;
+ * )
+ nfiles="$nfiles $file"
+ ;;
+ esac
+ done
+ fi
+
+ # run the final archive command
+ if [ ".$opt_t" = .yes ]; then
+ echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2
+ fi
+ eval $ar_prg $ar_cmd $archive $nfiles
+ if [ $? -ne 0 ]; then
+ echo "$msgprefix:Error: archive command failed" 1>&2
+ shtool_exit $?
+ fi
+
+ # cleanup and die gracefully
+ if [ -d $ar_tmpdir ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "rm -rf $ar_tmpdir" 1>&2
+ fi
+ rm -rf $ar_tmpdir
+ fi
+
+ shtool_exit 0
+ ;;
+
+slo )
+ ##
+ ## slo -- Separate linker options by library class
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ DIFS="$IFS"
+
+ # parse out -L and -l options from command line
+ DIRS=''
+ LIBS=''
+ ARGV=''
+ optprev=''
+ for opt
+ do
+ # concatenate with previous option if exists
+ if [ ".$optprev" != . ]; then
+ opt="${optprev}${opt}";
+ optprev=''
+ fi
+ # remember options for arg if used stand-alone
+ if [ ".$opt" = ".-L" ] || [ ".$opt" = ".-l" ]; then
+ optprev="$opt"
+ continue;
+ fi
+ # split argument into option plus option argument
+ arg="`echo $opt | cut -c3-`"
+ opt="`echo $opt | cut -c1-2`"
+ # store into containers
+ case $opt in
+ -L) DIRS="$DIRS:$arg" ;;
+ -l) LIBS="$LIBS:$arg" ;;
+ *) ARGV="$ARGV $opt" ;;
+ esac
+ done
+
+ # set linker default directories
+ DIRS_DEFAULT='/lib:/usr/lib'
+ if [ ".$LD_LIBRARY_PATH" != . ]; then
+ DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH"
+ fi
+
+ # sort options by class
+ DIRS_OBJ=''
+ LIBS_OBJ=''
+ DIRS_PIC=''
+ LIBS_PIC=''
+ DIRS_DSO=''
+ LIBS_DSO=''
+
+ # for each library...
+ OIFS="$IFS"; IFS=':'
+ for lib in $LIBS; do
+ [ ".$lib" = . ] && continue
+
+ found='no'
+ found_indefdir='no'
+ found_type=''
+ found_dir=''
+
+ # for each directory...
+ OIFS2="$IFS"; IFS=":$DIFS"
+ for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
+ [ ".$dir" = . ] && continue
+ [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes
+ [ ! -d $dir ] && continue
+
+ # search the file
+ OIFS3="$IFS"; IFS="$DIFS"
+ for file in '' `cd $dir && env -i /bin/ls lib${lib}.* 2>/dev/null`; do
+ [ ".$file" = . ] && continue
+ case $file in
+ *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* )
+ found=yes;
+ found_type=DSO;
+ break
+ ;;
+ *.lo|*.la )
+ found=yes;
+ found_type=PIC
+ ;;
+ *.a )
+ if [ ".$found_type" = . ]; then
+ found=yes
+ found_type=OBJ
+ fi
+ ;;
+ esac
+ done
+ IFS="$OIFS3"
+ if [ ".$found" = .yes ]; then
+ found_dir="$dir"
+ break
+ fi
+ done
+ IFS="$OIFS2"
+
+ if [ ".$found" = .yes ]; then
+ if [ ".$found_indefdir" != .yes ]; then
+ eval "dirlist=\"\${DIRS_${found_type}}:\""
+ case "$dirlist" in
+ *:$found_dir:* ) ;;
+ * ) eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" ;;
+ esac
+ eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
+ else
+ eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\""
+ fi
+ else
+ LIBS_OBJ="$LIBS_OBJ:$lib"
+ #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`"
+ #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1
+ #echo "slo:Warning: $dirlist" 1>&1
+ fi
+ done
+ IFS="$OIFS"
+
+ # also pass-through unused dirs even if it's useless
+ OIFS="$IFS"; IFS=':'
+ for dir in $DIRS; do
+ dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:"
+ case "$dirlist" in
+ *:$dir:* ) ;;
+ * ) DIRS_OBJ="$DIRS_OBJ:$dir" ;;
+ esac
+ done
+ IFS="$OIFS"
+
+ # reassemble the options but separated by type
+ for type in OBJ PIC DSO; do
+ OIFS="$IFS"; IFS=':'
+ eval "libs=\"\$LIBS_${type}\""
+ opts=''
+ for lib in $libs; do
+ [ ".$lib" = . ] && continue
+ opts="$opts -l$lib"
+ done
+ eval "LIBS_${type}=\"$opts\""
+
+ eval "dirs=\"\$DIRS_${type}\""
+ opts=''
+ for dir in $dirs; do
+ [ ".$dir" = . ] && continue
+ opts="$opts -L$dir"
+ done
+ eval "DIRS_${type}=\"$opts\""
+ IFS="$OIFS"
+ done
+
+ # give back results
+ for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do
+ eval "val=\"\$${var}\""
+ val="`echo $val | sed -e 's/^ *//'`"
+ echo "${opt_p}${var}=\"${val}\""
+ done
+
+ shtool_exit 0
+ ;;
+
+scpp )
+ ##
+ ## scpp -- Sharing C Pre-Processor
+ ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ srcs="$*"
+ output="${opt_o}.n"
+
+ # find a reasonable Awk
+ awk=''
+ paths=`echo $PATH |\
+ sed -e 's%/*:%:%g' -e 's%/$%%' \
+ -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+ -e 's/:/ /g'`
+ for name in gawk nawk awk; do
+ for path in $paths; do
+ if [ -r "$path/$name" ]; then
+ awk="$path/$name"
+ break
+ fi
+ done
+ if [ ".$awk" != . ]; then
+ break
+ fi
+ done
+ if [ ".$awk" = . ]; then
+ echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2
+ shtool_exit 1
+ fi
+
+ # parse source file(s)
+ if [ ".$opt_v" = .yes ]; then
+ echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2
+ fi
+ for src in $srcs; do
+ if [ ".$opt_v" = .yes ]; then
+ echo $src | $awk '{ printf(" %s", $0); }' 1>&2
+ fi
+ if [ ".$opt_f" != . ]; then
+ inputcmd="sed"
+ OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_f; IFS="$OIFS"
+ for e
+ do
+ inputcmd="$inputcmd -e '$e'"
+ done
+ inputcmd="$inputcmd '$src'"
+ else
+ inputcmd="cat '$src'"
+ fi
+ eval $inputcmd |\
+ $awk '
+ BEGIN {
+ ln = 0;
+ fln = 0;
+ level = 0;
+ mode = "";
+ store = "";
+ }
+ {
+ ln++;
+ }
+ /^#if.*/ {
+ level++;
+ }
+ /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ {
+ if ($2 == define) {
+ mode = "D";
+ printf("D:#line %d \"%s\"\n", ln, src);
+ next;
+ }
+ }
+ /^#endif.*/ {
+ level--;
+ if (mode == "D" && level == 0) {
+ mode = "";
+ next;
+ }
+ }
+ /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ {
+ if ($1 == class) {
+ printf("V:#line %d \"%s\"\n", ln, src);
+ printf("V:%s\n", $0);
+ printf("J:%s\n", $0);
+ next;
+ }
+ }
+ /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ {
+ if ($1 == class) {
+ printf("V:#line %d \"%s\"\n", ln, src);
+ printf("V:%s\n", $0);
+ printf("J:%s\n", $0);
+ next;
+ }
+ }
+ /^[a-zA-Z_][a-zA-Z0-9_]*/ {
+ if ($1 == class) {
+ fln = ln;
+ store = $0;
+ mode = "F";
+ next;
+ }
+ }
+ /^\{ *$/ {
+ if (mode == "F") {
+ printf("F:#line %d \"%s\"\n", fln, src);
+ printf("F:%s;\n", store);
+ printf("I:%s;\n", store);
+ store = "";
+ mode = "";
+ next;
+ }
+ }
+ {
+ if (mode == "D")
+ printf("D:%s\n", $0);
+ else if (mode == "F")
+ store = store " " $0;
+ }
+ ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile
+ done
+ if [ ".$opt_v" = .yes ]; then
+ echo "" 1>&2
+ fi
+
+ # start generating output header
+ echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output
+ echo "#line 1 \"$opt_t\"" >>$output
+ sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\
+ sed -e "/^${opt_M} *\$/d" >>$output
+
+ # merge in the define blocks
+ grep '^D:' $tmpfile | sed -e 's/^D://' >>$output
+
+ # generate standard prolog
+ echo "#line 1 \"_ON_THE_FLY_\"" >>$output
+ echo "" >>$output
+ echo "/* make sure the scpp source extensions are skipped */" >>$output
+ echo "#define $opt_D 0" >>$output
+ echo "#define $opt_C /**/" >>$output
+
+ # generate namespace hiding for variables
+ echo "" >>$output
+ echo "/* move intern variables to hidden namespace */" >>$output
+ grep '^J:' $tmpfile | sed >>$output \
+ -e 's/^J://' \
+ -e 's/ */ /g' \
+ -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \
+ -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \
+ -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \
+ -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/'
+
+ # generate namespace hiding for functions
+ echo "" >>$output
+ echo "/* move intern functions to hidden namespace */" >>$output
+ grep '^I:' $tmpfile | sed >>$output \
+ -e 's/^I://' \
+ -e 's/\([ (]\) */\1/g' \
+ -e 's/ *\([),]\)/\1/g' \
+ -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/'
+
+ # generate prototypes for variables
+ echo "" >>$output
+ echo "/* prototypes for intern variables */" >>$output
+ grep '^V:' $tmpfile | sed >>$output \
+ -e 's/^V://' \
+ -e 's/ */ /g' \
+ -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \
+ -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \
+ -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \
+ -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \
+ -e 's/ ;/;/g' \
+ -e "s/^$opt_C /extern /"
+
+ # generate prototypes for functions
+ echo "" >>$output
+ echo "/* prototypes for intern functions */" >>$output
+ grep '^F:' $tmpfile | sed >>$output \
+ -e 's/^F://' \
+ -e 's/\([ (]\) */\1/g' \
+ -e 's/ *\([),]\)/\1/g' \
+ -e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \
+ -e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \
+ -e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \
+ -e 's/\([ (]\) */\1/g' \
+ -e 's/ *\([),]\)/\1/g' \
+ -e "s/^$opt_C /extern /"
+
+ # finish generating output header
+ n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\
+ wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'`
+ echo "#line $n \"$opt_t\"" >>$output
+ sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\
+ sed -e "/^${opt_M} *\$/d" >>$output
+
+ # create final output file
+ if [ -f $opt_o ]; then
+ if [ ".$opt_p" = .yes ]; then
+ grep -v '^#line' $opt_o >$tmpfile.o
+ grep -v '^#line' $output >$tmpfile.n
+ out_old="$tmpfile.o"
+ out_new="$tmpfile.n"
+ else
+ out_old="$opt_o"
+ out_new="$output"
+ fi
+ if cmp -s $out_old $out_new; then
+ :
+ else
+ cp $output $opt_o
+ fi
+ else
+ cp $output $opt_o
+ fi
+ rm -f $output
+ rm -f $tmpfile $tmpfile.* >/dev/null 2>&1
+
+ shtool_exit 0
+ ;;
+
+version )
+ ##
+ ## version -- Maintain a version information file
+ ## Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ file="$1"
+
+ # determine prefix and name
+ name="$opt_n"
+ prefix="$opt_p"
+
+ # determine current version
+ triple="$opt_s"
+ if [ ".$triple" != . ]; then
+ # use given triple
+ if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then
+ echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2
+ shtool_exit 1
+ fi
+ eval `echo $triple |\
+ sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\
+ ver="\1";rev="\2";typ="\3";lev="\4"%'`
+ tim=calc
+ elif [ -r $file ]; then
+ # determine triple from given file
+ eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\
+ sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\
+ ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'`
+ else
+ # intialise to first version
+ ver=0
+ rev=1
+ typ=.
+ lev=0
+ tim=calc
+ fi
+
+ # determine new version in batch
+ if [ ".$opt_i" != . ]; then
+ case $opt_i in
+ v ) ver=`expr $ver + 1`
+ rev=0
+ lev=0
+ ;;
+ r ) rev=`expr $rev + 1`
+ lev=0
+ ;;
+ l ) lev=`expr $lev + 1`
+ ;;
+ * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+ tim=calc
+ fi
+
+ # determine new version interactively
+ if [ ".$opt_e" = .yes ]; then
+ echo "old version: ${ver}.${rev}${typ}${lev}"
+ while [ 1 ]; do
+ echo dummy | awk '{ printf("new version: "); }'
+ read triple
+ case $triple in
+ [0-9]*.[0-9]*[sabp.][0-9]* )
+ ;;
+ * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2
+ continue
+ ;;
+ esac
+ break
+ done
+ eval `echo $triple |\
+ sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\
+ ver="\1";rev="\2";typ="\3";lev="\4"%'`
+ tim=calc
+ fi
+
+ # determine hexadecimal and libtool value of version
+ case $typ in
+ a ) typnum=0; levnum=$lev ;;
+ b ) typnum=1; levnum=$lev ;;
+ p | . ) typnum=2; levnum=$lev ;;
+ s ) typnum=15; levnum=255 ;; # snapshots are special
+ esac
+ hex=`echo "$ver:$rev:$typnum:$levnum" |\
+ awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\
+ tr 'abcdef' 'ABCDEF'`
+ ltv=`echo "$ver:$rev:$typnum:$levnum" |\
+ awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'`
+
+ # determine date
+ if [ ".$tim" = .calc ]; then
+ day=`date '+%d'`
+ month=`date '+%m'`
+ year=`date '+%Y' 2>/dev/null`
+ if [ ".$time_year" = . ]; then
+ year=`date '+%y'`
+ case $year in
+ [5-9][0-9]) year="19$year" ;;
+ [0-4][0-9]) year="20$year" ;;
+ esac
+ fi
+ case $month in
+ 1|01) month='Jan' ;;
+ 2|02) month='Feb' ;;
+ 3|03) month='Mar' ;;
+ 4|04) month='Apr' ;;
+ 5|05) month='May' ;;
+ 6|06) month='Jun' ;;
+ 7|07) month='Jul' ;;
+ 8|08) month='Aug' ;;
+ 9|09) month='Sep' ;;
+ 10) month='Oct' ;;
+ 11) month='Nov' ;;
+ 12) month='Dec' ;;
+ esac
+ tim="${day}-${month}-${year}"
+ fi
+
+ # perform result actions
+ mode=show
+ if [ ".$opt_i" != . ]; then
+ mode=edit
+ elif [ ".$opt_e" = .yes ]; then
+ mode=edit
+ elif [ ".$opt_s" != . ]; then
+ mode=edit
+ fi
+ if [ ".$mode" = .show ]; then
+ # just display the current version
+ case $opt_d in
+ short )
+ echo "${ver}.${rev}${typ}${lev}"
+ ;;
+ long )
+ echo "${ver}.${rev}${typ}${lev} ($tim)"
+ ;;
+ libtool )
+ echo "${ltv}"
+ ;;
+ hex )
+ echo "${hex}"
+ ;;
+ * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+ else
+ # update the version file
+
+ # pre-generate various strings
+ triple="${ver}.${rev}${typ}${lev}"
+ vHex="$hex"
+ vShort="${triple}"
+ vLong="${triple} (${tim})"
+ vTeX="This is ${name}, Version ${triple} (${tim})"
+ vGNU="${name} ${triple} (${tim})"
+ vWeb="${name}/${triple}"
+ vSCCS="@(#)${name} ${triple} (${tim})"
+ vRCS="\$Id: ${name} ${triple} (${tim}) \$"
+
+ # determine string out of filename
+ # (do NOT try to optimize this in any way because of portability)
+ filestr=`util_upper "$file" | tr './%+' '____' | sed -e 's/-/_/g'`
+
+ # generate uppercase prefix
+ prefixupper=`util_upper "$prefix"`
+
+ # create the version file according the the selected language
+ echo "new version: ${vLong}"
+
+ cp /dev/null $file
+ case $opt_l in
+ txt )
+ echo >>$file ""
+ echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)"
+ echo >>$file " [automatically generated and maintained by GNU shtool]"
+ echo >>$file ""
+ echo >>$file " $vTeX"
+ echo >>$file ""
+ ;;
+ c )
+ echo >>$file "/*"
+ echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)"
+ echo >>$file "** [automatically generated and maintained by GNU shtool]"
+ echo >>$file "*/"
+ echo >>$file ""
+ echo >>$file "#ifdef _${filestr}_AS_HEADER_"
+ echo >>$file ""
+ echo >>$file "#ifndef _${filestr}_"
+ echo >>$file "#define _${filestr}_"
+ echo >>$file ""
+ echo >>$file "#define ${prefixupper}VERSION ${vHex}"
+ echo >>$file ""
+ echo >>$file "typedef struct {"
+ echo >>$file " const int v_hex;"
+ echo >>$file " const char *v_short;"
+ echo >>$file " const char *v_long;"
+ echo >>$file " const char *v_tex;"
+ echo >>$file " const char *v_gnu;"
+ echo >>$file " const char *v_web;"
+ echo >>$file " const char *v_sccs;"
+ echo >>$file " const char *v_rcs;"
+ echo >>$file "} ${prefix}version_t;"
+ echo >>$file ""
+ echo >>$file "extern ${prefix}version_t ${prefix}version;"
+ echo >>$file ""
+ echo >>$file "#endif /* _${filestr}_ */"
+ echo >>$file ""
+ echo >>$file "#else /* _${filestr}_AS_HEADER_ */"
+ echo >>$file ""
+ echo >>$file "#define _${filestr}_AS_HEADER_"
+ echo >>$file "#include \"${file}\""
+ echo >>$file "#undef _${filestr}_AS_HEADER_"
+ echo >>$file ""
+ echo >>$file "${prefix}version_t ${prefix}version = {"
+ echo >>$file " ${vHex},"
+ echo >>$file " \"${vShort}\","
+ echo >>$file " \"${vLong}\","
+ echo >>$file " \"${vTeX}\","
+ echo >>$file " \"${vGNU}\","
+ echo >>$file " \"${vWeb}\","
+ echo >>$file " \"${vSCCS}\","
+ echo >>$file " \"${vRCS}\""
+ echo >>$file "};"
+ echo >>$file ""
+ echo >>$file "#endif /* _${filestr}_AS_HEADER_ */"
+ echo >>$file ""
+ ;;
+ m4 )
+ echo >>$file "##"
+ echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)"
+ echo >>$file "## [automatically generated and maintained by GNU shtool]"
+ echo >>$file "##"
+ echo >>$file ""
+ echo >>$file "m4_define([v_hex], [${vHex}])"
+ echo >>$file "m4_define([v_short], [${vShort}])"
+ echo >>$file "m4_define([v_long], [${vLong}])"
+ echo >>$file "m4_define([v_tex], [${vTeX}])"
+ echo >>$file "m4_define([v_gnu], [${vGNU}])"
+ echo >>$file "m4_define([v_web], [${vWeb}])"
+ echo >>$file "m4_define([v_sccs], [${vSCCS}])"
+ echo >>$file "m4_define([v_rcs], [${vRCS}])"
+ echo >>$file ""
+ ;;
+ perl )
+ echo >>$file "##"
+ echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)"
+ echo >>$file "## [automatically generated and maintained by GNU shtool]"
+ echo >>$file "##"
+ echo >>$file ""
+ echo >>$file "our \$${prefix}version = {"
+ echo >>$file " 'v_hex' => ${vHex},"
+ echo >>$file " 'v_short' => \"${vShort}\","
+ echo >>$file " 'v_long' => \"${vLong}\","
+ echo >>$file " 'v_tex' => \"${vTeX}\","
+ echo >>$file " 'v_gnu' => \"${vGNU}\","
+ echo >>$file " 'v_web' => \"${vWeb}\","
+ echo >>$file " 'v_sccs' => \"${vSCCS}\","
+ echo >>$file " 'v_rcs' => \"\\${vRCS}/\""
+ echo >>$file "};"
+ echo >>$file ""
+ echo >>$file "1;"
+ echo >>$file ""
+ ;;
+ python )
+ echo >>$file "##"
+ echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)"
+ echo >>$file "## [automatically generated and maintained by GNU shtool]"
+ echo >>$file "##"
+ echo >>$file ""
+ echo >>$file "class ${prefix}version:"
+ echo >>$file " v_hex = ${vHex}"
+ echo >>$file " v_short = \"${vShort}\""
+ echo >>$file " v_long = \"${vLong}\""
+ echo >>$file " v_tex = \"${vTeX}\""
+ echo >>$file " v_gnu = \"${vGNU}\""
+ echo >>$file " v_web = \"${vWeb}\""
+ echo >>$file " v_sccs = \"${vSCCS}\""
+ echo >>$file " v_rcs = \"${vRCS}\""
+ echo >>$file ""
+ ;;
+ * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2
+ shtool_exit 1
+ ;;
+ esac
+ fi
+
+ shtool_exit 0
+ ;;
+
+path )
+ ##
+ ## path -- Deal with program paths
+ ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+
+ namelist="$*"
+
+ # check whether the test command supports the -x option
+ if [ -x /bin/sh ] 2>/dev/null; then
+ minusx="-x"
+ else
+ minusx="-r"
+ fi
+
+ # split path string
+ paths="`echo $opt_p |\
+ sed -e 's/^:/.:/' \
+ -e 's/::/:.:/g' \
+ -e 's/:$/:./' \
+ -e 's/:/ /g'`"
+
+ # SPECIAL REQUEST
+ # translate forward to reverse path
+ if [ ".$opt_r" = .yes ]; then
+ if [ "x$namelist" = "x." ]; then
+ rp='.'
+ else
+ rp=''
+ for pe in `IFS="$IFS/"; echo $namelist`; do
+ rp="../$rp"
+ done
+ fi
+ echo $rp | sed -e 's:/$::'
+ shtool_exit 0
+ fi
+
+ # SPECIAL REQUEST
+ # strip out directory or base name
+ if [ ".$opt_d" = .yes ]; then
+ echo "$namelist" |\
+ sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'
+ shtool_exit 0
+ fi
+ if [ ".$opt_b" = .yes ]; then
+ echo "$namelist" |\
+ sed -e 's;.*/\([^/]*\)$;\1;'
+ shtool_exit 0
+ fi
+
+ # MAGIC SITUATION
+ # Perl Interpreter (perl)
+ if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then
+ rm -f $tmpfile >/dev/null 2>&1
+ touch $tmpfile
+ found=0
+ pc=99
+ for dir in $paths; do
+ dir=`echo $dir | sed -e 's;/*$;;'`
+ nc=99
+ for name in perl perl5 miniperl; do
+ if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then
+ perl="$dir/$name"
+ pv=`$perl -e 'printf("%.3f", $]);'`
+ echo "$pv:$pc:$nc:$perl" >>$tmpfile
+ found=1
+ fi
+ nc=`expr $nc - 1`
+ done
+ pc=`expr $pc - 1`
+ done
+ if [ $found = 1 ]; then
+ perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`"
+ rm -f $tmpfile >/dev/null 2>&1
+ echo "$perl"
+ shtool_exit 0
+ fi
+ rm -f $tmpfile >/dev/null 2>&1
+ shtool_exit 1
+ fi
+
+ # MAGIC SITUATION
+ # C pre-processor (cpp)
+ if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then
+ echo >$tmpfile.c "#include <assert.h>"
+ echo >>$tmpfile.c "Syntax Error"
+ # 1. try the standard cc -E approach
+ cpp="${CC-cc} -E"
+ (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
+ my_error=`grep -v '^ *+' $tmpfile.out`
+ if [ ".$my_error" != . ]; then
+ # 2. try the cc -E approach and GCC's -traditional-ccp option
+ cpp="${CC-cc} -E -traditional-cpp"
+ (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
+ my_error=`grep -v '^ *+' $tmpfile.out`
+ if [ ".$my_error" != . ]; then
+ # 3. try a standalone cpp command in path and lib dirs
+ for path in $paths /lib /usr/lib /usr/local/lib; do
+ path=`echo $path | sed -e 's;/*$;;'`
+ if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then
+ cpp="$path/cpp"
+ break
+ fi
+ done
+ if [ ".$cpp" != . ]; then
+ (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out
+ my_error=`grep -v '^ *+' $tmpfile.out`
+ if [ ".$my_error" != . ]; then
+ # ok, we gave up...
+ cpp=''
+ fi
+ fi
+ fi
+ fi
+ rm -f $tmpfile >/dev/null 2>&1
+ rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1
+ if [ ".$cpp" != . ]; then
+ echo "$cpp"
+ shtool_exit 0
+ fi
+ shtool_exit 1
+ fi
+
+ # STANDARD SITUATION
+ # iterate over names
+ for name in $namelist; do
+ # iterate over paths
+ for path in $paths; do
+ path=`echo $path | sed -e 's;/*$;;'`
+ if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then
+ if [ ".$opt_s" != .yes ]; then
+ echo "$path/$name"
+ fi
+ shtool_exit 0
+ fi
+ done
+ done
+
+ shtool_exit 1
+ ;;
+
+esac
+
+shtool_exit 0
+
diff --git a/ics-openvpn-stripped/main/lzo/autoconf/ylwrap b/ics-openvpn-stripped/main/lzo/autoconf/ylwrap
new file mode 100755
index 00000000..13fa706c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/autoconf/ylwrap
@@ -0,0 +1,232 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2013-01-12.17; # UTC
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+get_dirname ()
+{
+ case $1 in
+ */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+ # Otherwise, we want the empty string (not ".").
+ esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard ()
+{
+ printf '%s\n' "$1" \
+ | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
+ -e 's/__*/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+ case $# in
+ 0) cat;;
+ 1) printf '%s\n' "$1";;
+ esac \
+ | sed -e 's|[][\\.*]|\\&|g'
+}
+
+case "$1" in
+ '')
+ echo "$0: No files given. Try '$0 --help' for more information." 1>&2
+ exit 1
+ ;;
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+ INPUT is the input file
+ OUTPUT is one file PROG generates
+ DESIRED is the file we actually want instead of OUTPUT
+ PROGRAM is program to run
+ ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "ylwrap $scriptversion"
+ exit $?
+ ;;
+esac
+
+
+# The input.
+input=$1
+shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
+case $input in
+ [\\/]* | ?:[\\/]*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute.
+ input=`pwd`/$input
+ ;;
+esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
+while test $# -ne 0; do
+ if test x"$1" = x"--"; then
+ shift
+ break
+ fi
+ from=$1
+ shift
+ to=$1
+ shift
+ sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+ sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
+done
+
+# The program to run.
+prog=$1
+shift
+# Make any relative path in $prog absolute.
+case $prog in
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog=`pwd`/$prog ;;
+esac
+
+dirname=ylwrap$$
+do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
+trap "ret=129; $do_exit" 1
+trap "ret=130; $do_exit" 2
+trap "ret=141; $do_exit" 13
+trap "ret=143; $do_exit" 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+ 0) "$prog" "$input" ;;
+ *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+ for from in *
+ do
+ to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
+ if test -f "$from"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend '../'.
+ case $to in
+ [\\/]* | ?:[\\/]*) target=$to;;
+ *) target=../$to;;
+ esac
+
+ # Do not overwrite unchanged header files to avoid useless
+ # recompilations. Always update the parser itself: it is the
+ # destination of the .y.c rule in the Makefile. Divert the
+ # output of all other files to a temporary file so we can
+ # compare them to existing versions.
+ if test $from != $parser; then
+ realtarget=$target
+ target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
+ fi
+
+ # Munge "#line" or "#" directives. Don't let the resulting
+ # debug information point at an absolute srcdir. Use the real
+ # output file name, not yy.lex.c for instance. Adjust the
+ # include guards too.
+ sed -e "/^#/!b" \
+ -e "s|$input_rx|$input_sub_rx|" \
+ -e "$sed_fix_filenames" \
+ -e "$sed_fix_header_guards" \
+ "$from" >"$target" || ret=$?
+
+ # Check whether files must be updated.
+ if test "$from" != "$parser"; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$to is unchanged"
+ rm -f "$target"
+ else
+ echo "updating $to"
+ mv -f "$target" "$realtarget"
+ fi
+ fi
+ else
+ # A missing file is only an error for the parser. This is a
+ # blatant hack to let us support using "yacc -d". If -d is not
+ # specified, don't fail when the header file is "missing".
+ if test "$from" = "$parser"; then
+ ret=1
+ fi
+ fi
+ done
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ics-openvpn-stripped/main/lzo/config.h b/ics-openvpn-stripped/main/lzo/config.h
new file mode 100644
index 00000000..ec40c7da
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/config.h
@@ -0,0 +1,365 @@
+/* config.h. Generated by configure. */
+/* config.hin. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `access' function. */
+#define HAVE_ACCESS 1
+
+/* Define to 1 if you have the `alloca' function. */
+/* #undef HAVE_ALLOCA */
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H 1
+
+/* Define to 1 if you have the `atexit' function. */
+#define HAVE_ATEXIT 1
+
+/* Define to 1 if you have the `atoi' function. */
+#define HAVE_ATOI 1
+
+/* Define to 1 if you have the `atol' function. */
+#define HAVE_ATOL 1
+
+/* Define to 1 if you have the `chmod' function. */
+#define HAVE_CHMOD 1
+
+/* Define to 1 if you have the `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define to 1 if you have the `clock_getcpuclockid' function. */
+/* #undef HAVE_CLOCK_GETCPUCLOCKID */
+
+/* Define to 1 if you have the `clock_getres' function. */
+/* #undef HAVE_CLOCK_GETRES */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the `ctime' function. */
+#define HAVE_CTIME 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the `difftime' function. */
+#define HAVE_DIFFTIME 1
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_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 `fstat' function. */
+#define HAVE_FSTAT 1
+
+/* Define to 1 if you have the `getenv' function. */
+#define HAVE_GETENV 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `getrusage' function. */
+#define HAVE_GETRUSAGE 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `gmtime' function. */
+#define HAVE_GMTIME 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isatty' function. */
+#define HAVE_ISATTY 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `localtime' function. */
+#define HAVE_LOCALTIME 1
+
+/* Define to 1 if you have the `longjmp' function. */
+#define HAVE_LONGJMP 1
+
+/* Define to 1 if you have the `lstat' function. */
+#define HAVE_LSTAT 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the `memcmp' function. */
+#define HAVE_MEMCMP 1
+
+/* Define to 1 if you have the `memcpy' function. */
+#define HAVE_MEMCPY 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 you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* Define to 1 if you have the `mktime' function. */
+#define HAVE_MKTIME 1
+
+/* Define to 1 if you have the `mmap' function. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the `mprotect' function. */
+#define HAVE_MPROTECT 1
+
+/* Define to 1 if you have the `munmap' function. */
+#define HAVE_MUNMAP 1
+
+/* Define to 1 if you have the `qsort' function. */
+#define HAVE_QSORT 1
+
+/* Define to 1 if you have the `raise' function. */
+#define HAVE_RAISE 1
+
+/* Define to 1 if you have the `rmdir' function. */
+#define HAVE_RMDIR 1
+
+/* Define to 1 if you have the `setjmp' function. */
+#define HAVE_SETJMP 1
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#define HAVE_SETJMP_H 1
+
+/* Define to 1 if you have the `signal' function. */
+#define HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* 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 `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the `stricmp' function. */
+/* #undef HAVE_STRICMP */
+
+/* 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 `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strnicmp' function. */
+/* #undef HAVE_STRNICMP */
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the `time' function. */
+#define HAVE_TIME 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if you have the `umask' function. */
+#define HAVE_UMASK 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if your machine is big endian. */
+/* #undef LZO_ABI_BIG_ENDIAN */
+
+/* Define to 1 if your machine is little endian. */
+#define LZO_ABI_LITTLE_ENDIAN 1
+
+/* Name of package */
+#define PACKAGE "lzo"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "markus@oberhumer.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "lzo"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "lzo 2.03"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "lzo"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.03"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* The size of a `dev_t', as computed by sizeof. */
+#define SIZEOF_DEV_T 8
+
+/* The size of a `double', as computed by sizeof. */
+#define SIZEOF_DOUBLE 8
+
+/* The size of a `float', as computed by sizeof. */
+#define SIZEOF_FLOAT 4
+
+/* The size of a `fpos_t', as computed by sizeof. */
+#define SIZEOF_FPOS_T 16
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of a `intmax_t', as computed by sizeof. */
+#define SIZEOF_INTMAX_T 8
+
+/* The size of a `intptr_t', as computed by sizeof. */
+#define SIZEOF_INTPTR_T 4
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
+
+/* The size of a `long double', as computed by sizeof. */
+#define SIZEOF_LONG_DOUBLE 12
+
+/* The size of a `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
+
+/* The size of a `mode_t', as computed by sizeof. */
+#define SIZEOF_MODE_T 4
+
+/* The size of a `off_t', as computed by sizeof. */
+#define SIZEOF_OFF_T 8
+
+/* The size of a `ptrdiff_t', as computed by sizeof. */
+#define SIZEOF_PTRDIFF_T 4
+
+/* The size of a `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
+
+/* The size of a `size_t', as computed by sizeof. */
+#define SIZEOF_SIZE_T 4
+
+/* The size of a `ssize_t', as computed by sizeof. */
+#define SIZEOF_SSIZE_T 4
+
+/* The size of a `time_t', as computed by sizeof. */
+#define SIZEOF_TIME_T 4
+
+/* The size of a `uintmax_t', as computed by sizeof. */
+#define SIZEOF_UINTMAX_T 8
+
+/* The size of a `uintptr_t', as computed by sizeof. */
+#define SIZEOF_UINTPTR_T 4
+
+/* The size of a `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 4
+
+/* The size of a `__int16', as computed by sizeof. */
+#define SIZEOF___INT16 0
+
+/* The size of a `__int32', as computed by sizeof. */
+#define SIZEOF___INT32 0
+
+/* The size of a `__int64', as computed by sizeof. */
+#define SIZEOF___INT64 0
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "2.03"
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#define _FILE_OFFSET_BITS 64
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef ptrdiff_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
diff --git a/ics-openvpn-stripped/main/lzo/config.hin b/ics-openvpn-stripped/main/lzo/config.hin
new file mode 100644
index 00000000..bd528c0a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/config.hin
@@ -0,0 +1,390 @@
+/* config.hin. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to 1 if you have the `access' function. */
+#undef HAVE_ACCESS
+
+/* Define to 1 if you have the `alloca' function. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the `atexit' function. */
+#undef HAVE_ATEXIT
+
+/* Define to 1 if you have the `atoi' function. */
+#undef HAVE_ATOI
+
+/* Define to 1 if you have the `atol' function. */
+#undef HAVE_ATOL
+
+/* Define to 1 if you have the `chmod' function. */
+#undef HAVE_CHMOD
+
+/* Define to 1 if you have the `chown' function. */
+#undef HAVE_CHOWN
+
+/* Define to 1 if you have the `clock_getcpuclockid' function. */
+#undef HAVE_CLOCK_GETCPUCLOCKID
+
+/* Define to 1 if you have the `clock_getres' function. */
+#undef HAVE_CLOCK_GETRES
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `ctime' function. */
+#undef HAVE_CTIME
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
+/* Define to 1 if you have the `difftime' function. */
+#undef HAVE_DIFFTIME
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_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 <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the `fstat' function. */
+#undef HAVE_FSTAT
+
+/* Define to 1 if you have the `getenv' function. */
+#undef HAVE_GETENV
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `gmtime' function. */
+#undef HAVE_GMTIME
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isatty' function. */
+#undef HAVE_ISATTY
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the `localtime' function. */
+#undef HAVE_LOCALTIME
+
+/* Define to 1 if you have the `longjmp' function. */
+#undef HAVE_LONGJMP
+
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the `memcmp' function. */
+#undef HAVE_MEMCMP
+
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* 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 `mkdir' function. */
+#undef HAVE_MKDIR
+
+/* Define to 1 if you have the `mktime' function. */
+#undef HAVE_MKTIME
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
+
+/* Define to 1 if you have the `qsort' function. */
+#undef HAVE_QSORT
+
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
+/* Define to 1 if you have the `rmdir' function. */
+#undef HAVE_RMDIR
+
+/* Define to 1 if you have the `setjmp' function. */
+#undef HAVE_SETJMP
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#undef HAVE_SETJMP_H
+
+/* Define to 1 if you have the `signal' function. */
+#undef HAVE_SIGNAL
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* 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 <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* 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 `stricmp' function. */
+#undef HAVE_STRICMP
+
+/* 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 `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strnicmp' function. */
+#undef HAVE_STRNICMP
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/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 `time' function. */
+#undef HAVE_TIME
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define to 1 if you have the `umask' function. */
+#undef HAVE_UMASK
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `utime' function. */
+#undef HAVE_UTIME
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
+/* Define to 1 if your machine is big endian. */
+#undef LZO_ABI_BIG_ENDIAN
+
+/* Define to 1 if your machine is little endian. */
+#undef LZO_ABI_LITTLE_ENDIAN
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* The size of `dev_t', as computed by sizeof. */
+#undef SIZEOF_DEV_T
+
+/* The size of `double', as computed by sizeof. */
+#undef SIZEOF_DOUBLE
+
+/* The size of `float', as computed by sizeof. */
+#undef SIZEOF_FLOAT
+
+/* The size of `fpos_t', as computed by sizeof. */
+#undef SIZEOF_FPOS_T
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `intmax_t', as computed by sizeof. */
+#undef SIZEOF_INTMAX_T
+
+/* The size of `intptr_t', as computed by sizeof. */
+#undef SIZEOF_INTPTR_T
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long double', as computed by sizeof. */
+#undef SIZEOF_LONG_DOUBLE
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `mode_t', as computed by sizeof. */
+#undef SIZEOF_MODE_T
+
+/* The size of `off_t', as computed by sizeof. */
+#undef SIZEOF_OFF_T
+
+/* The size of `ptrdiff_t', as computed by sizeof. */
+#undef SIZEOF_PTRDIFF_T
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of `ssize_t', as computed by sizeof. */
+#undef SIZEOF_SSIZE_T
+
+/* The size of `time_t', as computed by sizeof. */
+#undef SIZEOF_TIME_T
+
+/* The size of `uintmax_t', as computed by sizeof. */
+#undef SIZEOF_UINTMAX_T
+
+/* The size of `uintptr_t', as computed by sizeof. */
+#undef SIZEOF_UINTPTR_T
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* The size of `__int16', as computed by sizeof. */
+#undef SIZEOF___INT16
+
+/* The size of `__int32', as computed by sizeof. */
+#undef SIZEOF___INT32
+
+/* The size of `__int64', as computed by sizeof. */
+#undef SIZEOF___INT64
+
+/* 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
+
+/* Version number of package */
+#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef ptrdiff_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/ics-openvpn-stripped/main/lzo/config.log b/ics-openvpn-stripped/main/lzo/config.log
new file mode 100644
index 00000000..bd09f04b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/config.log
@@ -0,0 +1,3482 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by lzo configure 2.03, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ ./configure
+
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = dune
+uname -m = i686
+uname -r = 2.6.27-11-generic
+uname -s = Linux
+uname -v = #1 SMP Thu Jan 29 19:24:39 UTC 2009
+
+/usr/bin/uname -p = unknown
+/bin/uname -X = unknown
+
+/bin/arch = unknown
+/usr/bin/arch -k = unknown
+/usr/convex/getsysinfo = unknown
+hostinfo = unknown
+/bin/machine = unknown
+/usr/bin/oslevel = unknown
+/bin/universe = unknown
+
+PATH: /usr/local/sbin
+PATH: /usr/local/bin
+PATH: /usr/sbin
+PATH: /usr/bin
+PATH: /sbin
+PATH: /bin
+PATH: /usr/games
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+configure:1528: Configuring LZO 2.03
+configure:1563: checking build system type
+configure:1581: result: i686-pc-linux-gnu
+configure:1589: checking host system type
+configure:1603: result: i686-pc-linux-gnu
+configure:1611: checking target system type
+configure:1625: result: i686-pc-linux-gnu
+configure:1639: checking whether to enable maintainer-specific portions of Makefiles
+configure:1648: result: no
+configure:1781: checking for gcc
+configure:1797: found /usr/bin/gcc
+configure:1807: result: gcc
+configure:2051: checking for C compiler version
+configure:2054: gcc --version </dev/null >&5
+gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
+Copyright (C) 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.
+
+configure:2057: $? = 0
+configure:2059: gcc -v </dev/null >&5
+Using built-in specs.
+Target: i486-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
+Thread model: posix
+gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)
+configure:2062: $? = 0
+configure:2064: gcc -V </dev/null >&5
+gcc: '-V' option must have argument
+configure:2067: $? = 1
+configure:2090: checking for C compiler default output file name
+configure:2093: gcc conftest.c >&5
+configure:2096: $? = 0
+configure:2142: result: a.out
+configure:2147: checking whether the C compiler works
+configure:2153: ./a.out
+configure:2156: $? = 0
+configure:2173: result: yes
+configure:2180: checking whether we are cross compiling
+configure:2182: result: no
+configure:2185: checking for suffix of executables
+configure:2187: gcc -o conftest conftest.c >&5
+configure:2190: $? = 0
+configure:2215: result:
+configure:2221: checking for suffix of object files
+configure:2242: gcc -c conftest.c >&5
+configure:2245: $? = 0
+configure:2267: result: o
+configure:2271: checking whether we are using the GNU C compiler
+configure:2295: gcc -c conftest.c >&5
+configure:2301: $? = 0
+configure:2304: test -z || test ! -s conftest.err
+configure:2307: $? = 0
+configure:2310: test -s conftest.o
+configure:2313: $? = 0
+configure:2326: result: yes
+configure:2332: checking whether gcc accepts -g
+configure:2353: gcc -c -g conftest.c >&5
+configure:2359: $? = 0
+configure:2362: test -z || test ! -s conftest.err
+configure:2365: $? = 0
+configure:2368: test -s conftest.o
+configure:2371: $? = 0
+configure:2382: result: yes
+configure:2399: checking for gcc option to accept ANSI C
+configure:2469: gcc -c -g -O2 conftest.c >&5
+configure:2475: $? = 0
+configure:2478: test -z || test ! -s conftest.err
+configure:2481: $? = 0
+configure:2484: test -s conftest.o
+configure:2487: $? = 0
+configure:2505: result: none needed
+configure:2523: gcc -c -g -O2 conftest.c >&5
+conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
+configure:2529: $? = 1
+configure: failed program was:
+| #ifndef __cplusplus
+| choke me
+| #endif
+configure:2664: checking how to run the C preprocessor
+configure:2699: gcc -E conftest.c
+configure:2705: $? = 0
+configure:2737: gcc -E conftest.c
+conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
+configure:2743: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| /* end confdefs.h. */
+| #include <ac_nonexistent.h>
+configure:2782: result: gcc -E
+configure:2806: gcc -E conftest.c
+configure:2812: $? = 0
+configure:2844: gcc -E conftest.c
+conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
+configure:2850: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| /* end confdefs.h. */
+| #include <ac_nonexistent.h>
+configure:2894: checking whether the C preprocessor needs special flags
+configure:2928: gcc -c -g -O2 conftest.c >&5
+configure:2934: $? = 0
+configure:2937: test -z || test ! -s conftest.err
+configure:2940: $? = 0
+configure:2943: test -s conftest.o
+configure:2946: $? = 0
+configure:2961: result: none needed
+configure:2978: checking for an ANSI C-conforming const
+configure:3045: gcc -c -g -O2 conftest.c >&5
+configure:3051: $? = 0
+configure:3054: test -z || test ! -s conftest.err
+configure:3057: $? = 0
+configure:3060: test -s conftest.o
+configure:3063: $? = 0
+configure:3074: result: yes
+configure:3085: checking whether byte ordering is bigendian
+configure:3112: gcc -c -g -O2 conftest.c >&5
+configure:3118: $? = 0
+configure:3121: test -z || test ! -s conftest.err
+configure:3124: $? = 0
+configure:3127: test -s conftest.o
+configure:3130: $? = 0
+configure:3154: gcc -c -g -O2 conftest.c >&5
+conftest.c: In function 'main':
+conftest.c:16: error: 'not' undeclared (first use in this function)
+conftest.c:16: error: (Each undeclared identifier is reported only once
+conftest.c:16: error: for each function it appears in.)
+conftest.c:16: error: expected ';' before 'big'
+configure:3160: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| /* end confdefs.h. */
+| #include <sys/types.h>
+| #include <sys/param.h>
+|
+| int
+| main ()
+| {
+| #if BYTE_ORDER != BIG_ENDIAN
+| not big endian
+| #endif
+|
+| ;
+| return 0;
+| }
+configure:3293: result: no
+configure:3324: checking for special C compiler options needed for large files
+configure:3421: result: no
+configure:3427: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3458: gcc -c -g -O2 conftest.c >&5
+conftest.c:16: warning: left shift count >= width of type
+conftest.c:16: warning: left shift count >= width of type
+conftest.c:18: error: size of array 'off_t_is_large' is negative
+configure:3464: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| /* end confdefs.h. */
+| #include <sys/types.h>
+| /* Check that off_t can represent 2**63 - 1 correctly.
+| We can't simply define LARGE_OFF_T to be 9223372036854775807,
+| since some C++ compilers masquerading as C compilers
+| incorrectly reject 9223372036854775807. */
+| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+| && LARGE_OFF_T % 2147483647 == 1)
+| ? 1 : -1];
+| int
+| main ()
+| {
+|
+| ;
+| return 0;
+| }
+configure:3510: gcc -c -g -O2 conftest.c >&5
+configure:3516: $? = 0
+configure:3519: test -z || test ! -s conftest.err
+configure:3522: $? = 0
+configure:3525: test -s conftest.o
+configure:3528: $? = 0
+configure:3540: result: 64
+configure:3550: checking for _LARGE_FILES value needed for large files
+configure:3581: gcc -c -g -O2 conftest.c >&5
+configure:3587: $? = 0
+configure:3590: test -z || test ! -s conftest.err
+configure:3593: $? = 0
+configure:3596: test -s conftest.o
+configure:3599: $? = 0
+configure:3663: result: no
+configure:3690: checking for a BSD-compatible install
+configure:3745: result: /usr/bin/install -c
+configure:3756: checking whether build environment is sane
+configure:3799: result: yes
+configure:3864: checking for gawk
+configure:3893: result: no
+configure:3864: checking for mawk
+configure:3880: found /usr/bin/mawk
+configure:3890: result: mawk
+configure:3900: checking whether make sets $(MAKE)
+configure:3920: result: yes
+configure:3950: checking for style of include used by make
+configure:3978: result: GNU
+configure:4154: checking dependency style of gcc
+configure:4244: result: gcc3
+configure:4338: checking for a sed that does not truncate output
+configure:4392: result: /bin/sed
+configure:4395: checking for egrep
+configure:4405: result: grep -E
+configure:4421: checking for ld used by gcc
+configure:4488: result: /usr/bin/ld
+configure:4497: checking if the linker (/usr/bin/ld) is GNU ld
+configure:4512: result: yes
+configure:4517: checking for /usr/bin/ld option to reload object files
+configure:4524: result: -r
+configure:4542: checking for BSD-compatible nm
+configure:4591: result: /usr/bin/nm -B
+configure:4595: checking whether ln -s works
+configure:4599: result: yes
+configure:4606: checking how to recognise dependent libraries
+configure:4782: result: pass_all
+configure:5013: checking for ANSI C header files
+configure:5038: gcc -c -g -O2 conftest.c >&5
+configure:5044: $? = 0
+configure:5047: test -z || test ! -s conftest.err
+configure:5050: $? = 0
+configure:5053: test -s conftest.o
+configure:5056: $? = 0
+configure:5145: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c: In function 'main':
+conftest.c:30: warning: incompatible implicit declaration of built-in function 'exit'
+configure:5148: $? = 0
+configure:5150: ./conftest
+configure:5153: $? = 0
+configure:5168: result: yes
+configure:5192: checking for sys/types.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for sys/stat.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for stdlib.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for string.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for memory.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for strings.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for inttypes.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for stdint.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5192: checking for unistd.h
+configure:5208: gcc -c -g -O2 conftest.c >&5
+configure:5214: $? = 0
+configure:5217: test -z || test ! -s conftest.err
+configure:5220: $? = 0
+configure:5223: test -s conftest.o
+configure:5226: $? = 0
+configure:5237: result: yes
+configure:5263: checking dlfcn.h usability
+configure:5275: gcc -c -g -O2 conftest.c >&5
+configure:5281: $? = 0
+configure:5284: test -z || test ! -s conftest.err
+configure:5287: $? = 0
+configure:5290: test -s conftest.o
+configure:5293: $? = 0
+configure:5303: result: yes
+configure:5307: checking dlfcn.h presence
+configure:5317: gcc -E conftest.c
+configure:5323: $? = 0
+configure:5343: result: yes
+configure:5378: checking for dlfcn.h
+configure:5385: result: yes
+configure:5450: checking for g++
+configure:5466: found /usr/bin/g++
+configure:5476: result: g++
+configure:5492: checking for C++ compiler version
+configure:5495: g++ --version </dev/null >&5
+g++ (Ubuntu 4.3.2-1ubuntu12) 4.3.2
+Copyright (C) 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.
+
+configure:5498: $? = 0
+configure:5500: g++ -v </dev/null >&5
+Using built-in specs.
+Target: i486-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
+Thread model: posix
+gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)
+configure:5503: $? = 0
+configure:5505: g++ -V </dev/null >&5
+g++: '-V' option must have argument
+configure:5508: $? = 1
+configure:5511: checking whether we are using the GNU C++ compiler
+configure:5535: g++ -c conftest.cc >&5
+configure:5541: $? = 0
+configure:5544: test -z || test ! -s conftest.err
+configure:5547: $? = 0
+configure:5550: test -s conftest.o
+configure:5553: $? = 0
+configure:5566: result: yes
+configure:5572: checking whether g++ accepts -g
+configure:5593: g++ -c -g conftest.cc >&5
+configure:5599: $? = 0
+configure:5602: test -z || test ! -s conftest.err
+configure:5605: $? = 0
+configure:5608: test -s conftest.o
+configure:5611: $? = 0
+configure:5622: result: yes
+configure:5664: g++ -c -g -O2 conftest.cc >&5
+configure:5670: $? = 0
+configure:5673: test -z || test ! -s conftest.err
+configure:5676: $? = 0
+configure:5679: test -s conftest.o
+configure:5682: $? = 0
+configure:5708: g++ -c -g -O2 conftest.cc >&5
+conftest.cc: In function 'int main()':
+conftest.cc:28: error: 'exit' was not declared in this scope
+configure:5714: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| /* end confdefs.h. */
+|
+| int
+| main ()
+| {
+| exit (42);
+| ;
+| return 0;
+| }
+configure:5664: g++ -c -g -O2 conftest.cc >&5
+conftest.cc:24: error: 'void std::exit(int)' should have been declared inside 'std'
+configure:5670: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| /* end confdefs.h. */
+| extern "C" void std::exit (int) throw (); using std::exit;
+| #include <stdlib.h>
+| int
+| main ()
+| {
+| exit (42);
+| ;
+| return 0;
+| }
+configure:5664: g++ -c -g -O2 conftest.cc >&5
+conftest.cc:24: error: 'void std::exit(int)' should have been declared inside 'std'
+In file included from conftest.cc:25:
+/usr/include/stdlib.h:531: error: declaration of 'void std::exit(int) throw ()' throws different exceptions
+conftest.cc:24: error: from previous declaration 'void std::exit(int)'
+configure:5670: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| /* end confdefs.h. */
+| extern "C" void std::exit (int); using std::exit;
+| #include <stdlib.h>
+| int
+| main ()
+| {
+| exit (42);
+| ;
+| return 0;
+| }
+configure:5664: g++ -c -g -O2 conftest.cc >&5
+configure:5670: $? = 0
+configure:5673: test -z || test ! -s conftest.err
+configure:5676: $? = 0
+configure:5679: test -s conftest.o
+configure:5682: $? = 0
+configure:5708: g++ -c -g -O2 conftest.cc >&5
+configure:5714: $? = 0
+configure:5717: test -z || test ! -s conftest.err
+configure:5720: $? = 0
+configure:5723: test -s conftest.o
+configure:5726: $? = 0
+configure:5751: checking dependency style of g++
+configure:5841: result: gcc3
+configure:5868: checking how to run the C++ preprocessor
+configure:5899: g++ -E conftest.cc
+configure:5905: $? = 0
+configure:5937: g++ -E conftest.cc
+conftest.cc:27:28: error: ac_nonexistent.h: No such file or directory
+configure:5943: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| /* end confdefs.h. */
+| #include <ac_nonexistent.h>
+configure:5982: result: g++ -E
+configure:6006: g++ -E conftest.cc
+configure:6012: $? = 0
+configure:6044: g++ -E conftest.cc
+conftest.cc:27:28: error: ac_nonexistent.h: No such file or directory
+configure:6050: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| /* end confdefs.h. */
+| #include <ac_nonexistent.h>
+configure:6147: checking for g77
+configure:6176: result: no
+configure:6147: checking for f77
+configure:6176: result: no
+configure:6147: checking for xlf
+configure:6176: result: no
+configure:6147: checking for frt
+configure:6176: result: no
+configure:6147: checking for pgf77
+configure:6176: result: no
+configure:6147: checking for fort77
+configure:6176: result: no
+configure:6147: checking for fl32
+configure:6176: result: no
+configure:6147: checking for af77
+configure:6176: result: no
+configure:6147: checking for f90
+configure:6176: result: no
+configure:6147: checking for xlf90
+configure:6176: result: no
+configure:6147: checking for pgf90
+configure:6176: result: no
+configure:6147: checking for epcf90
+configure:6176: result: no
+configure:6147: checking for f95
+configure:6176: result: no
+configure:6147: checking for fort
+configure:6176: result: no
+configure:6147: checking for xlf95
+configure:6176: result: no
+configure:6147: checking for ifc
+configure:6176: result: no
+configure:6147: checking for efc
+configure:6176: result: no
+configure:6147: checking for pgf95
+configure:6176: result: no
+configure:6147: checking for lf95
+configure:6176: result: no
+configure:6147: checking for gfortran
+configure:6176: result: no
+configure:6188: checking for Fortran 77 compiler version
+configure:6191: --version </dev/null >&5
+./configure: line 6192: --version: command not found
+configure:6194: $? = 127
+configure:6196: -v </dev/null >&5
+./configure: line 6197: -v: command not found
+configure:6199: $? = 127
+configure:6201: -V </dev/null >&5
+./configure: line 6202: -V: command not found
+configure:6204: $? = 127
+configure:6212: checking whether we are using the GNU Fortran 77 compiler
+configure:6226: -c conftest.F >&5
+./configure: line 6227: -c: command not found
+configure:6232: $? = 127
+configure: failed program was:
+| program main
+| #ifndef __GNUC__
+| choke me
+| #endif
+|
+| end
+configure:6257: result: no
+configure:6263: checking whether accepts -g
+configure:6275: -c -g conftest.f >&5
+./configure: line 6276: -c: command not found
+configure:6281: $? = 127
+configure: failed program was:
+| program main
+|
+| end
+configure:6305: result: no
+configure:6335: checking the maximum length of command line arguments
+configure:6444: result: 32768
+configure:6455: checking command to parse /usr/bin/nm -B output from gcc object
+configure:6560: gcc -c -g -O2 conftest.c >&5
+configure:6563: $? = 0
+configure:6567: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm
+configure:6570: $? = 0
+configure:6622: gcc -o conftest -g -O2 conftest.c conftstm.o >&5
+configure:6625: $? = 0
+configure:6663: result: ok
+configure:6667: checking for objdir
+configure:6682: result: .libs
+configure:6772: checking for ar
+configure:6788: found /usr/bin/ar
+configure:6799: result: ar
+configure:6852: checking for ranlib
+configure:6868: found /usr/bin/ranlib
+configure:6879: result: ranlib
+configure:6932: checking for strip
+configure:6948: found /usr/bin/strip
+configure:6959: result: strip
+configure:7231: checking if gcc supports -fno-rtti -fno-exceptions
+configure:7249: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
+cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
+configure:7253: $? = 0
+configure:7266: result: no
+configure:7281: checking for gcc option to produce PIC
+configure:7491: result: -fPIC
+configure:7499: checking if gcc PIC flag -fPIC works
+configure:7517: gcc -c -g -O2 -fPIC -DPIC conftest.c >&5
+configure:7521: $? = 0
+configure:7534: result: yes
+configure:7562: checking if gcc static flag -static works
+configure:7590: result: yes
+configure:7600: checking if gcc supports -c -o file.o
+configure:7621: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5
+configure:7625: $? = 0
+configure:7647: result: yes
+configure:7673: checking whether the gcc linker (/usr/bin/ld) supports shared libraries
+configure:8629: result: yes
+configure:8696: checking dynamic linker characteristics
+configure:9305: result: GNU/Linux ld.so
+configure:9314: checking how to hardcode library paths into programs
+configure:9339: result: immediate
+configure:9353: checking whether stripping libraries is possible
+configure:9358: result: yes
+configure:10185: checking if libtool supports shared libraries
+configure:10187: result: yes
+configure:10190: checking whether to build shared libraries
+configure:10211: result: no
+configure:10214: checking whether to build static libraries
+configure:10218: result: yes
+configure:10310: creating libtool
+configure:10898: checking for ld used by g++
+configure:10965: result: /usr/bin/ld
+configure:10974: checking if the linker (/usr/bin/ld) is GNU ld
+configure:10989: result: yes
+configure:11040: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:11976: result: yes
+configure:11994: g++ -c -g -O2 conftest.cpp >&5
+configure:11997: $? = 0
+configure:12116: checking for g++ option to produce PIC
+configure:12390: result: -fPIC
+configure:12398: checking if g++ PIC flag -fPIC works
+configure:12416: g++ -c -g -O2 -fPIC -DPIC conftest.cpp >&5
+configure:12420: $? = 0
+configure:12433: result: yes
+configure:12461: checking if g++ static flag -static works
+configure:12489: result: yes
+configure:12499: checking if g++ supports -c -o file.o
+configure:12520: g++ -c -g -O2 -o out/conftest2.o conftest.cpp >&5
+configure:12524: $? = 0
+configure:12546: result: yes
+configure:12572: checking whether the g++ linker (/usr/bin/ld) supports shared libraries
+configure:12597: result: yes
+configure:12664: checking dynamic linker characteristics
+configure:13273: result: GNU/Linux ld.so
+configure:13282: checking how to hardcode library paths into programs
+configure:13307: result: immediate
+configure:19519: checking whether to build assembly versions
+configure:19527: gcc -c conftest.S 1>&5
+configure:19530: $? = 0
+configure:19533: test -s conftest.o
+configure:19536: $? = 0
+configure:19549: result: yes
+configure:19570: checking whether time.h and sys/time.h may both be included
+configure:19595: gcc -c -g -O2 conftest.c >&5
+configure:19601: $? = 0
+configure:19604: test -z || test ! -s conftest.err
+configure:19607: $? = 0
+configure:19610: test -s conftest.o
+configure:19613: $? = 0
+configure:19624: result: yes
+configure:19674: checking assert.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking assert.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for assert.h
+configure:19796: result: yes
+configure:19674: checking ctype.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking ctype.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for ctype.h
+configure:19796: result: yes
+configure:19674: checking dirent.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking dirent.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for dirent.h
+configure:19796: result: yes
+configure:19674: checking errno.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking errno.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for errno.h
+configure:19796: result: yes
+configure:19674: checking fcntl.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking fcntl.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for fcntl.h
+configure:19796: result: yes
+configure:19674: checking float.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking float.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for float.h
+configure:19796: result: yes
+configure:19674: checking limits.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking limits.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for limits.h
+configure:19796: result: yes
+configure:19674: checking malloc.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking malloc.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for malloc.h
+configure:19796: result: yes
+configure:19665: checking for memory.h
+configure:19670: result: yes
+configure:19674: checking setjmp.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking setjmp.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for setjmp.h
+configure:19796: result: yes
+configure:19674: checking signal.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking signal.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for signal.h
+configure:19796: result: yes
+configure:19674: checking stdarg.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking stdarg.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for stdarg.h
+configure:19796: result: yes
+configure:19674: checking stddef.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking stddef.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for stddef.h
+configure:19796: result: yes
+configure:19665: checking for stdint.h
+configure:19670: result: yes
+configure:19674: checking stdio.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking stdio.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for stdio.h
+configure:19796: result: yes
+configure:19665: checking for stdlib.h
+configure:19670: result: yes
+configure:19665: checking for string.h
+configure:19670: result: yes
+configure:19665: checking for strings.h
+configure:19670: result: yes
+configure:19674: checking time.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking time.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for time.h
+configure:19796: result: yes
+configure:19665: checking for unistd.h
+configure:19670: result: yes
+configure:19674: checking utime.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking utime.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for utime.h
+configure:19796: result: yes
+configure:19674: checking sys/mman.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking sys/mman.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for sys/mman.h
+configure:19796: result: yes
+configure:19674: checking sys/resource.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking sys/resource.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for sys/resource.h
+configure:19796: result: yes
+configure:19665: checking for sys/stat.h
+configure:19670: result: yes
+configure:19674: checking sys/time.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking sys/time.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for sys/time.h
+configure:19796: result: yes
+configure:19665: checking for sys/types.h
+configure:19670: result: yes
+configure:19674: checking sys/wait.h usability
+configure:19686: gcc -c -g -O2 conftest.c >&5
+configure:19692: $? = 0
+configure:19695: test -z || test ! -s conftest.err
+configure:19698: $? = 0
+configure:19701: test -s conftest.o
+configure:19704: $? = 0
+configure:19714: result: yes
+configure:19718: checking sys/wait.h presence
+configure:19728: gcc -E conftest.c
+configure:19734: $? = 0
+configure:19754: result: yes
+configure:19789: checking for sys/wait.h
+configure:19796: result: yes
+configure:19816: checking whether limits.h is sane
+configure:19934: gcc -c -g -O2 conftest.c >&5
+configure:19940: $? = 0
+configure:19943: test -z || test ! -s conftest.err
+configure:19946: $? = 0
+configure:19949: test -s conftest.o
+configure:19952: $? = 0
+configure:19963: result: yes
+configure:19977: checking for off_t
+configure:20001: gcc -c -g -O2 conftest.c >&5
+configure:20007: $? = 0
+configure:20010: test -z || test ! -s conftest.err
+configure:20013: $? = 0
+configure:20016: test -s conftest.o
+configure:20019: $? = 0
+configure:20030: result: yes
+configure:20042: checking for ptrdiff_t
+configure:20066: gcc -c -g -O2 conftest.c >&5
+configure:20072: $? = 0
+configure:20075: test -z || test ! -s conftest.err
+configure:20078: $? = 0
+configure:20081: test -s conftest.o
+configure:20084: $? = 0
+configure:20095: result: yes
+configure:20107: checking for size_t
+configure:20131: gcc -c -g -O2 conftest.c >&5
+configure:20137: $? = 0
+configure:20140: test -z || test ! -s conftest.err
+configure:20143: $? = 0
+configure:20146: test -s conftest.o
+configure:20149: $? = 0
+configure:20160: result: yes
+configure:20172: checking return type of signal handlers
+configure:20203: gcc -c -g -O2 conftest.c >&5
+configure:20209: $? = 0
+configure:20212: test -z || test ! -s conftest.err
+configure:20215: $? = 0
+configure:20218: test -s conftest.o
+configure:20221: $? = 0
+configure:20232: result: void
+configure:20242: checking for short
+configure:20266: gcc -c -g -O2 conftest.c >&5
+configure:20272: $? = 0
+configure:20275: test -z || test ! -s conftest.err
+configure:20278: $? = 0
+configure:20281: test -s conftest.o
+configure:20284: $? = 0
+configure:20295: result: yes
+configure:20298: checking size of short
+configure:20610: gcc -o conftest -g -O2 conftest.c >&5
+configure:20613: $? = 0
+configure:20615: ./conftest
+configure:20618: $? = 0
+configure:20641: result: 2
+configure:20648: checking for int
+configure:20672: gcc -c -g -O2 conftest.c >&5
+configure:20678: $? = 0
+configure:20681: test -z || test ! -s conftest.err
+configure:20684: $? = 0
+configure:20687: test -s conftest.o
+configure:20690: $? = 0
+configure:20701: result: yes
+configure:20704: checking size of int
+configure:21016: gcc -o conftest -g -O2 conftest.c >&5
+configure:21019: $? = 0
+configure:21021: ./conftest
+configure:21024: $? = 0
+configure:21047: result: 4
+configure:21054: checking for long
+configure:21078: gcc -c -g -O2 conftest.c >&5
+configure:21084: $? = 0
+configure:21087: test -z || test ! -s conftest.err
+configure:21090: $? = 0
+configure:21093: test -s conftest.o
+configure:21096: $? = 0
+configure:21107: result: yes
+configure:21110: checking size of long
+configure:21422: gcc -o conftest -g -O2 conftest.c >&5
+configure:21425: $? = 0
+configure:21427: ./conftest
+configure:21430: $? = 0
+configure:21453: result: 4
+configure:21461: checking for long long
+configure:21485: gcc -c -g -O2 conftest.c >&5
+configure:21491: $? = 0
+configure:21494: test -z || test ! -s conftest.err
+configure:21497: $? = 0
+configure:21500: test -s conftest.o
+configure:21503: $? = 0
+configure:21514: result: yes
+configure:21517: checking size of long long
+configure:21829: gcc -o conftest -g -O2 conftest.c >&5
+configure:21832: $? = 0
+configure:21834: ./conftest
+configure:21837: $? = 0
+configure:21860: result: 8
+configure:21867: checking for __int16
+configure:21891: gcc -c -g -O2 conftest.c >&5
+conftest.c: In function 'main':
+conftest.c:97: error: '__int16' undeclared (first use in this function)
+conftest.c:97: error: (Each undeclared identifier is reported only once
+conftest.c:97: error: for each function it appears in.)
+conftest.c:97: error: expected expression before ')' token
+configure:21897: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| /* end confdefs.h. */
+| #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
+| int
+| main ()
+| {
+| if ((__int16 *) 0)
+| return 0;
+| if (sizeof (__int16))
+| return 0;
+| ;
+| return 0;
+| }
+configure:21920: result: no
+configure:21923: checking size of __int16
+configure:22266: result: 0
+configure:22273: checking for __int32
+configure:22297: gcc -c -g -O2 conftest.c >&5
+conftest.c: In function 'main':
+conftest.c:98: error: '__int32' undeclared (first use in this function)
+conftest.c:98: error: (Each undeclared identifier is reported only once
+conftest.c:98: error: for each function it appears in.)
+conftest.c:98: error: expected expression before ')' token
+configure:22303: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| /* end confdefs.h. */
+| #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
+| int
+| main ()
+| {
+| if ((__int32 *) 0)
+| return 0;
+| if (sizeof (__int32))
+| return 0;
+| ;
+| return 0;
+| }
+configure:22326: result: no
+configure:22329: checking size of __int32
+configure:22672: result: 0
+configure:22679: checking for __int64
+configure:22703: gcc -c -g -O2 conftest.c >&5
+conftest.c: In function 'main':
+conftest.c:99: error: '__int64' undeclared (first use in this function)
+conftest.c:99: error: (Each undeclared identifier is reported only once
+conftest.c:99: error: for each function it appears in.)
+conftest.c:99: error: expected expression before ')' token
+configure:22709: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| /* end confdefs.h. */
+| #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
+| int
+| main ()
+| {
+| if ((__int64 *) 0)
+| return 0;
+| if (sizeof (__int64))
+| return 0;
+| ;
+| return 0;
+| }
+configure:22732: result: no
+configure:22735: checking size of __int64
+configure:23078: result: 0
+configure:23086: checking for void *
+configure:23110: gcc -c -g -O2 conftest.c >&5
+configure:23116: $? = 0
+configure:23119: test -z || test ! -s conftest.err
+configure:23122: $? = 0
+configure:23125: test -s conftest.o
+configure:23128: $? = 0
+configure:23139: result: yes
+configure:23142: checking size of void *
+configure:23454: gcc -o conftest -g -O2 conftest.c >&5
+configure:23457: $? = 0
+configure:23459: ./conftest
+configure:23462: $? = 0
+configure:23485: result: 4
+configure:23492: checking for size_t
+configure:23545: result: yes
+configure:23548: checking size of size_t
+configure:23860: gcc -o conftest -g -O2 conftest.c >&5
+configure:23863: $? = 0
+configure:23865: ./conftest
+configure:23868: $? = 0
+configure:23891: result: 4
+configure:23898: checking for ptrdiff_t
+configure:23951: result: yes
+configure:23954: checking size of ptrdiff_t
+configure:24266: gcc -o conftest -g -O2 conftest.c >&5
+configure:24269: $? = 0
+configure:24271: ./conftest
+configure:24274: $? = 0
+configure:24297: result: 4
+configure:24306: checking for __int32
+configure:24359: result: no
+configure:24362: checking size of __int32
+configure:24705: result: 0
+configure:24712: checking for intmax_t
+configure:24736: gcc -c -g -O2 conftest.c >&5
+configure:24742: $? = 0
+configure:24745: test -z || test ! -s conftest.err
+configure:24748: $? = 0
+configure:24751: test -s conftest.o
+configure:24754: $? = 0
+configure:24765: result: yes
+configure:24768: checking size of intmax_t
+configure:25080: gcc -o conftest -g -O2 conftest.c >&5
+configure:25083: $? = 0
+configure:25085: ./conftest
+configure:25088: $? = 0
+configure:25111: result: 8
+configure:25118: checking for uintmax_t
+configure:25142: gcc -c -g -O2 conftest.c >&5
+configure:25148: $? = 0
+configure:25151: test -z || test ! -s conftest.err
+configure:25154: $? = 0
+configure:25157: test -s conftest.o
+configure:25160: $? = 0
+configure:25171: result: yes
+configure:25174: checking size of uintmax_t
+configure:25486: gcc -o conftest -g -O2 conftest.c >&5
+configure:25489: $? = 0
+configure:25491: ./conftest
+configure:25494: $? = 0
+configure:25517: result: 8
+configure:25524: checking for intptr_t
+configure:25548: gcc -c -g -O2 conftest.c >&5
+configure:25554: $? = 0
+configure:25557: test -z || test ! -s conftest.err
+configure:25560: $? = 0
+configure:25563: test -s conftest.o
+configure:25566: $? = 0
+configure:25577: result: yes
+configure:25580: checking size of intptr_t
+configure:25892: gcc -o conftest -g -O2 conftest.c >&5
+configure:25895: $? = 0
+configure:25897: ./conftest
+configure:25900: $? = 0
+configure:25923: result: 4
+configure:25930: checking for uintptr_t
+configure:25954: gcc -c -g -O2 conftest.c >&5
+configure:25960: $? = 0
+configure:25963: test -z || test ! -s conftest.err
+configure:25966: $? = 0
+configure:25969: test -s conftest.o
+configure:25972: $? = 0
+configure:25983: result: yes
+configure:25986: checking size of uintptr_t
+configure:26298: gcc -o conftest -g -O2 conftest.c >&5
+configure:26301: $? = 0
+configure:26303: ./conftest
+configure:26306: $? = 0
+configure:26329: result: 4
+configure:26337: checking for float
+configure:26361: gcc -c -g -O2 conftest.c >&5
+configure:26367: $? = 0
+configure:26370: test -z || test ! -s conftest.err
+configure:26373: $? = 0
+configure:26376: test -s conftest.o
+configure:26379: $? = 0
+configure:26390: result: yes
+configure:26393: checking size of float
+configure:26705: gcc -o conftest -g -O2 conftest.c >&5
+configure:26708: $? = 0
+configure:26710: ./conftest
+configure:26713: $? = 0
+configure:26736: result: 4
+configure:26743: checking for double
+configure:26767: gcc -c -g -O2 conftest.c >&5
+configure:26773: $? = 0
+configure:26776: test -z || test ! -s conftest.err
+configure:26779: $? = 0
+configure:26782: test -s conftest.o
+configure:26785: $? = 0
+configure:26796: result: yes
+configure:26799: checking size of double
+configure:27111: gcc -o conftest -g -O2 conftest.c >&5
+configure:27114: $? = 0
+configure:27116: ./conftest
+configure:27119: $? = 0
+configure:27142: result: 8
+configure:27149: checking for long double
+configure:27173: gcc -c -g -O2 conftest.c >&5
+configure:27179: $? = 0
+configure:27182: test -z || test ! -s conftest.err
+configure:27185: $? = 0
+configure:27188: test -s conftest.o
+configure:27191: $? = 0
+configure:27202: result: yes
+configure:27205: checking size of long double
+configure:27517: gcc -o conftest -g -O2 conftest.c >&5
+configure:27520: $? = 0
+configure:27522: ./conftest
+configure:27525: $? = 0
+configure:27548: result: 12
+configure:27556: checking for dev_t
+configure:27580: gcc -c -g -O2 conftest.c >&5
+configure:27586: $? = 0
+configure:27589: test -z || test ! -s conftest.err
+configure:27592: $? = 0
+configure:27595: test -s conftest.o
+configure:27598: $? = 0
+configure:27609: result: yes
+configure:27612: checking size of dev_t
+configure:27924: gcc -o conftest -g -O2 conftest.c >&5
+configure:27927: $? = 0
+configure:27929: ./conftest
+configure:27932: $? = 0
+configure:27955: result: 8
+configure:27962: checking for fpos_t
+configure:27986: gcc -c -g -O2 conftest.c >&5
+configure:27992: $? = 0
+configure:27995: test -z || test ! -s conftest.err
+configure:27998: $? = 0
+configure:28001: test -s conftest.o
+configure:28004: $? = 0
+configure:28015: result: yes
+configure:28018: checking size of fpos_t
+configure:28330: gcc -o conftest -g -O2 conftest.c >&5
+configure:28333: $? = 0
+configure:28335: ./conftest
+configure:28338: $? = 0
+configure:28361: result: 16
+configure:28368: checking for mode_t
+configure:28392: gcc -c -g -O2 conftest.c >&5
+configure:28398: $? = 0
+configure:28401: test -z || test ! -s conftest.err
+configure:28404: $? = 0
+configure:28407: test -s conftest.o
+configure:28410: $? = 0
+configure:28421: result: yes
+configure:28424: checking size of mode_t
+configure:28736: gcc -o conftest -g -O2 conftest.c >&5
+configure:28739: $? = 0
+configure:28741: ./conftest
+configure:28744: $? = 0
+configure:28767: result: 4
+configure:28774: checking for off_t
+configure:28827: result: yes
+configure:28830: checking size of off_t
+configure:29142: gcc -o conftest -g -O2 conftest.c >&5
+configure:29145: $? = 0
+configure:29147: ./conftest
+configure:29150: $? = 0
+configure:29173: result: 8
+configure:29180: checking for ssize_t
+configure:29204: gcc -c -g -O2 conftest.c >&5
+configure:29210: $? = 0
+configure:29213: test -z || test ! -s conftest.err
+configure:29216: $? = 0
+configure:29219: test -s conftest.o
+configure:29222: $? = 0
+configure:29233: result: yes
+configure:29236: checking size of ssize_t
+configure:29548: gcc -o conftest -g -O2 conftest.c >&5
+configure:29551: $? = 0
+configure:29553: ./conftest
+configure:29556: $? = 0
+configure:29579: result: 4
+configure:29586: checking for time_t
+configure:29610: gcc -c -g -O2 conftest.c >&5
+configure:29616: $? = 0
+configure:29619: test -z || test ! -s conftest.err
+configure:29622: $? = 0
+configure:29625: test -s conftest.o
+configure:29628: $? = 0
+configure:29639: result: yes
+configure:29642: checking size of time_t
+configure:29954: gcc -o conftest -g -O2 conftest.c >&5
+configure:29957: $? = 0
+configure:29959: ./conftest
+configure:29962: $? = 0
+configure:29985: result: 4
+configure:30054: checking for access
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for alloca
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:105: warning: conflicting types for built-in function 'alloca'
+/tmp/ccme6UOI.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:120: undefined reference to `alloca'
+/tmp/ccme6UOI.o:(.data+0x0): undefined reference to `alloca'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| /* end confdefs.h. */
+| /* Define alloca to an innocuous variant, in case <limits.h> declares alloca.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define alloca innocuous_alloca
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char alloca (); 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 alloca
+|
+| /* 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 alloca ();
+| /* 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_alloca) || defined (__stub___alloca)
+| choke me
+| #else
+| char (*f) () = alloca;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != alloca;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for atexit
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for atoi
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for atol
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for chmod
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for chown
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for clock_getcpuclockid
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+/tmp/ccGnuUlV.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:125: undefined reference to `clock_getcpuclockid'
+/tmp/ccGnuUlV.o:(.data+0x0): undefined reference to `clock_getcpuclockid'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| #define HAVE_ATEXIT 1
+| #define HAVE_ATOI 1
+| #define HAVE_ATOL 1
+| #define HAVE_CHMOD 1
+| #define HAVE_CHOWN 1
+| /* end confdefs.h. */
+| /* Define clock_getcpuclockid to an innocuous variant, in case <limits.h> declares clock_getcpuclockid.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define clock_getcpuclockid innocuous_clock_getcpuclockid
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char clock_getcpuclockid (); 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 clock_getcpuclockid
+|
+| /* 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 clock_getcpuclockid ();
+| /* 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_clock_getcpuclockid) || defined (__stub___clock_getcpuclockid)
+| choke me
+| #else
+| char (*f) () = clock_getcpuclockid;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != clock_getcpuclockid;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for clock_getres
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+/tmp/ccBv98Oj.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:125: undefined reference to `clock_getres'
+/tmp/ccBv98Oj.o:(.data+0x0): undefined reference to `clock_getres'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| #define HAVE_ATEXIT 1
+| #define HAVE_ATOI 1
+| #define HAVE_ATOL 1
+| #define HAVE_CHMOD 1
+| #define HAVE_CHOWN 1
+| /* end confdefs.h. */
+| /* Define clock_getres to an innocuous variant, in case <limits.h> declares clock_getres.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define clock_getres innocuous_clock_getres
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char clock_getres (); 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 clock_getres
+|
+| /* 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 clock_getres ();
+| /* 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_clock_getres) || defined (__stub___clock_getres)
+| choke me
+| #else
+| char (*f) () = clock_getres;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != clock_getres;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for clock_gettime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+/tmp/cc4IygxA.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:125: undefined reference to `clock_gettime'
+/tmp/cc4IygxA.o:(.data+0x0): undefined reference to `clock_gettime'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| #define HAVE_ATEXIT 1
+| #define HAVE_ATOI 1
+| #define HAVE_ATOL 1
+| #define HAVE_CHMOD 1
+| #define HAVE_CHOWN 1
+| /* end confdefs.h. */
+| /* Define clock_gettime to an innocuous variant, in case <limits.h> declares clock_gettime.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define clock_gettime innocuous_clock_gettime
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char clock_gettime (); 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 clock_gettime
+|
+| /* 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 clock_gettime ();
+| /* 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_clock_gettime) || defined (__stub___clock_gettime)
+| choke me
+| #else
+| char (*f) () = clock_gettime;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != clock_gettime;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for ctime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for difftime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for fstat
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for getenv
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for getpagesize
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for getrusage
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for gettimeofday
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for gmtime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for isatty
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for localtime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for longjmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for lstat
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for memcmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:122: warning: conflicting types for built-in function 'memcmp'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for memcpy
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:123: warning: conflicting types for built-in function 'memcpy'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for memmove
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:124: warning: conflicting types for built-in function 'memmove'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for memset
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:125: warning: conflicting types for built-in function 'memset'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for mkdir
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for mktime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for mmap
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for mprotect
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for munmap
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for qsort
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for raise
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for rmdir
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for setjmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for signal
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for snprintf
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:136: warning: conflicting types for built-in function 'snprintf'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strcasecmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:137: warning: conflicting types for built-in function 'strcasecmp'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strchr
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:138: warning: conflicting types for built-in function 'strchr'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strdup
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:139: warning: conflicting types for built-in function 'strdup'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strerror
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strftime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:141: warning: conflicting types for built-in function 'strftime'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for stricmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+/tmp/ccGbcxXG.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:157: undefined reference to `stricmp'
+/tmp/ccGbcxXG.o:(.data+0x0): undefined reference to `stricmp'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| #define HAVE_ATEXIT 1
+| #define HAVE_ATOI 1
+| #define HAVE_ATOL 1
+| #define HAVE_CHMOD 1
+| #define HAVE_CHOWN 1
+| #define HAVE_CTIME 1
+| #define HAVE_DIFFTIME 1
+| #define HAVE_FSTAT 1
+| #define HAVE_GETENV 1
+| #define HAVE_GETPAGESIZE 1
+| #define HAVE_GETRUSAGE 1
+| #define HAVE_GETTIMEOFDAY 1
+| #define HAVE_GMTIME 1
+| #define HAVE_ISATTY 1
+| #define HAVE_LOCALTIME 1
+| #define HAVE_LONGJMP 1
+| #define HAVE_LSTAT 1
+| #define HAVE_MEMCMP 1
+| #define HAVE_MEMCPY 1
+| #define HAVE_MEMMOVE 1
+| #define HAVE_MEMSET 1
+| #define HAVE_MKDIR 1
+| #define HAVE_MKTIME 1
+| #define HAVE_MMAP 1
+| #define HAVE_MPROTECT 1
+| #define HAVE_MUNMAP 1
+| #define HAVE_QSORT 1
+| #define HAVE_RAISE 1
+| #define HAVE_RMDIR 1
+| #define HAVE_SETJMP 1
+| #define HAVE_SIGNAL 1
+| #define HAVE_SNPRINTF 1
+| #define HAVE_STRCASECMP 1
+| #define HAVE_STRCHR 1
+| #define HAVE_STRDUP 1
+| #define HAVE_STRERROR 1
+| #define HAVE_STRFTIME 1
+| /* end confdefs.h. */
+| /* Define stricmp to an innocuous variant, in case <limits.h> declares stricmp.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define stricmp innocuous_stricmp
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char stricmp (); 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 stricmp
+|
+| /* 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 stricmp ();
+| /* 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_stricmp) || defined (__stub___stricmp)
+| choke me
+| #else
+| char (*f) () = stricmp;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != stricmp;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for strncasecmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:142: warning: conflicting types for built-in function 'strncasecmp'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strnicmp
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+/tmp/ccGIUI3y.o: In function `main':
+/home/fries/Development/android/source/external/lzo/conftest.c:158: undefined reference to `strnicmp'
+/tmp/ccGIUI3y.o:(.data+0x0): undefined reference to `strnicmp'
+collect2: ld returned 1 exit status
+configure:30117: $? = 1
+configure: failed program was:
+| /* confdefs.h. */
+|
+| #define PACKAGE_NAME "lzo"
+| #define PACKAGE_TARNAME "lzo"
+| #define PACKAGE_VERSION "2.03"
+| #define PACKAGE_STRING "lzo 2.03"
+| #define PACKAGE_BUGREPORT "markus@oberhumer.com"
+| #define LZO_ABI_LITTLE_ENDIAN 1
+| #define _FILE_OFFSET_BITS 64
+| #define PACKAGE "lzo"
+| #define VERSION "2.03"
+| #define STDC_HEADERS 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_INTTYPES_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_DLFCN_H 1
+| #ifdef __cplusplus
+| extern "C" void exit (int) throw ();
+| #endif
+| #define TIME_WITH_SYS_TIME 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_FLOAT_H 1
+| #define HAVE_LIMITS_H 1
+| #define HAVE_MALLOC_H 1
+| #define HAVE_MEMORY_H 1
+| #define HAVE_SETJMP_H 1
+| #define HAVE_SIGNAL_H 1
+| #define HAVE_STDARG_H 1
+| #define HAVE_STDDEF_H 1
+| #define HAVE_STDINT_H 1
+| #define HAVE_STDIO_H 1
+| #define HAVE_STDLIB_H 1
+| #define HAVE_STRING_H 1
+| #define HAVE_STRINGS_H 1
+| #define HAVE_TIME_H 1
+| #define HAVE_UNISTD_H 1
+| #define HAVE_UTIME_H 1
+| #define HAVE_SYS_MMAN_H 1
+| #define HAVE_SYS_RESOURCE_H 1
+| #define HAVE_SYS_STAT_H 1
+| #define HAVE_SYS_TIME_H 1
+| #define HAVE_SYS_TYPES_H 1
+| #define HAVE_SYS_WAIT_H 1
+| #define RETSIGTYPE void
+| #define SIZEOF_SHORT 2
+| #define SIZEOF_INT 4
+| #define SIZEOF_LONG 4
+| #define SIZEOF_LONG_LONG 8
+| #define SIZEOF___INT16 0
+| #define SIZEOF___INT32 0
+| #define SIZEOF___INT64 0
+| #define SIZEOF_VOID_P 4
+| #define SIZEOF_SIZE_T 4
+| #define SIZEOF_PTRDIFF_T 4
+| #define SIZEOF___INT32 0
+| #define SIZEOF_INTMAX_T 8
+| #define SIZEOF_UINTMAX_T 8
+| #define SIZEOF_INTPTR_T 4
+| #define SIZEOF_UINTPTR_T 4
+| #define SIZEOF_FLOAT 4
+| #define SIZEOF_DOUBLE 8
+| #define SIZEOF_LONG_DOUBLE 12
+| #define SIZEOF_DEV_T 8
+| #define SIZEOF_FPOS_T 16
+| #define SIZEOF_MODE_T 4
+| #define SIZEOF_OFF_T 8
+| #define SIZEOF_SSIZE_T 4
+| #define SIZEOF_TIME_T 4
+| #define HAVE_ACCESS 1
+| #define HAVE_ATEXIT 1
+| #define HAVE_ATOI 1
+| #define HAVE_ATOL 1
+| #define HAVE_CHMOD 1
+| #define HAVE_CHOWN 1
+| #define HAVE_CTIME 1
+| #define HAVE_DIFFTIME 1
+| #define HAVE_FSTAT 1
+| #define HAVE_GETENV 1
+| #define HAVE_GETPAGESIZE 1
+| #define HAVE_GETRUSAGE 1
+| #define HAVE_GETTIMEOFDAY 1
+| #define HAVE_GMTIME 1
+| #define HAVE_ISATTY 1
+| #define HAVE_LOCALTIME 1
+| #define HAVE_LONGJMP 1
+| #define HAVE_LSTAT 1
+| #define HAVE_MEMCMP 1
+| #define HAVE_MEMCPY 1
+| #define HAVE_MEMMOVE 1
+| #define HAVE_MEMSET 1
+| #define HAVE_MKDIR 1
+| #define HAVE_MKTIME 1
+| #define HAVE_MMAP 1
+| #define HAVE_MPROTECT 1
+| #define HAVE_MUNMAP 1
+| #define HAVE_QSORT 1
+| #define HAVE_RAISE 1
+| #define HAVE_RMDIR 1
+| #define HAVE_SETJMP 1
+| #define HAVE_SIGNAL 1
+| #define HAVE_SNPRINTF 1
+| #define HAVE_STRCASECMP 1
+| #define HAVE_STRCHR 1
+| #define HAVE_STRDUP 1
+| #define HAVE_STRERROR 1
+| #define HAVE_STRFTIME 1
+| #define HAVE_STRNCASECMP 1
+| /* end confdefs.h. */
+| /* Define strnicmp to an innocuous variant, in case <limits.h> declares strnicmp.
+| For example, HP-UX 11i <limits.h> declares gettimeofday. */
+| #define strnicmp innocuous_strnicmp
+|
+| /* System header to define __stub macros and hopefully few prototypes,
+| which can conflict with char strnicmp (); 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 strnicmp
+|
+| /* 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 strnicmp ();
+| /* 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_strnicmp) || defined (__stub___strnicmp)
+| choke me
+| #else
+| char (*f) () = strnicmp;
+| #endif
+| #ifdef __cplusplus
+| }
+| #endif
+|
+| int
+| main ()
+| {
+| return f != strnicmp;
+| ;
+| return 0;
+| }
+configure:30141: result: no
+configure:30054: checking for strrchr
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:143: warning: conflicting types for built-in function 'strrchr'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for strstr
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:144: warning: conflicting types for built-in function 'strstr'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for time
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for umask
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for utime
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30054: checking for vsnprintf
+configure:30111: gcc -o conftest -g -O2 conftest.c >&5
+conftest.c:148: warning: conflicting types for built-in function 'vsnprintf'
+configure:30117: $? = 0
+configure:30120: test -z || test ! -s conftest.err
+configure:30123: $? = 0
+configure:30126: test -s conftest
+configure:30129: $? = 0
+configure:30141: result: yes
+configure:30174: checking whether your compiler passes the ACC conformance test
+configure:30224: gcc -c -g -O2 -I. conftest.c >&5
+configure:30230: $? = 0
+configure:30233: test -z || test ! -s conftest.err
+configure:30236: $? = 0
+configure:30239: test -s conftest.o
+configure:30242: $? = 0
+configure:30255: result: yes
+configure:30430: creating ./config.status
+
+## ---------------------- ##
+## Running config.status. ##
+## ---------------------- ##
+
+This file was extended by lzo config.status 2.03, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES =
+ CONFIG_HEADERS =
+ CONFIG_LINKS =
+ CONFIG_COMMANDS =
+ $ ./config.status
+
+on dune
+
+config.status:776: creating Makefile
+config.status:776: creating examples/Makefile
+config.status:776: creating include/Makefile
+config.status:776: creating include/lzo/Makefile
+config.status:776: creating lzotest/Makefile
+config.status:776: creating minilzo/Makefile
+config.status:776: creating src/Makefile
+config.status:776: creating tests/Makefile
+config.status:842: creating config.h
+config.status:1384: executing depfiles commands
+
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+
+ac_cv_build=i686-pc-linux-gnu
+ac_cv_build_alias=i686-pc-linux-gnu
+ac_cv_c_bigendian=no
+ac_cv_c_compiler_gnu=yes
+ac_cv_c_const=yes
+ac_cv_cxx_compiler_gnu=yes
+ac_cv_env_CC_set=
+ac_cv_env_CC_value=
+ac_cv_env_CFLAGS_set=
+ac_cv_env_CFLAGS_value=
+ac_cv_env_CPPFLAGS_set=
+ac_cv_env_CPPFLAGS_value=
+ac_cv_env_CPP_set=
+ac_cv_env_CPP_value=
+ac_cv_env_CXXCPP_set=
+ac_cv_env_CXXCPP_value=
+ac_cv_env_CXXFLAGS_set=
+ac_cv_env_CXXFLAGS_value=
+ac_cv_env_CXX_set=
+ac_cv_env_CXX_value=
+ac_cv_env_F77_set=
+ac_cv_env_F77_value=
+ac_cv_env_FFLAGS_set=
+ac_cv_env_FFLAGS_value=
+ac_cv_env_LDFLAGS_set=
+ac_cv_env_LDFLAGS_value=
+ac_cv_env_build_alias_set=
+ac_cv_env_build_alias_value=
+ac_cv_env_host_alias_set=
+ac_cv_env_host_alias_value=
+ac_cv_env_target_alias_set=
+ac_cv_env_target_alias_value=
+ac_cv_exeext=
+ac_cv_f77_compiler_gnu=no
+ac_cv_func_access=yes
+ac_cv_func_alloca=no
+ac_cv_func_atexit=yes
+ac_cv_func_atoi=yes
+ac_cv_func_atol=yes
+ac_cv_func_chmod=yes
+ac_cv_func_chown=yes
+ac_cv_func_clock_getcpuclockid=no
+ac_cv_func_clock_getres=no
+ac_cv_func_clock_gettime=no
+ac_cv_func_ctime=yes
+ac_cv_func_difftime=yes
+ac_cv_func_fstat=yes
+ac_cv_func_getenv=yes
+ac_cv_func_getpagesize=yes
+ac_cv_func_getrusage=yes
+ac_cv_func_gettimeofday=yes
+ac_cv_func_gmtime=yes
+ac_cv_func_isatty=yes
+ac_cv_func_localtime=yes
+ac_cv_func_longjmp=yes
+ac_cv_func_lstat=yes
+ac_cv_func_memcmp=yes
+ac_cv_func_memcpy=yes
+ac_cv_func_memmove=yes
+ac_cv_func_memset=yes
+ac_cv_func_mkdir=yes
+ac_cv_func_mktime=yes
+ac_cv_func_mmap=yes
+ac_cv_func_mprotect=yes
+ac_cv_func_munmap=yes
+ac_cv_func_qsort=yes
+ac_cv_func_raise=yes
+ac_cv_func_rmdir=yes
+ac_cv_func_setjmp=yes
+ac_cv_func_signal=yes
+ac_cv_func_snprintf=yes
+ac_cv_func_strcasecmp=yes
+ac_cv_func_strchr=yes
+ac_cv_func_strdup=yes
+ac_cv_func_strerror=yes
+ac_cv_func_strftime=yes
+ac_cv_func_stricmp=no
+ac_cv_func_strncasecmp=yes
+ac_cv_func_strnicmp=no
+ac_cv_func_strrchr=yes
+ac_cv_func_strstr=yes
+ac_cv_func_time=yes
+ac_cv_func_umask=yes
+ac_cv_func_utime=yes
+ac_cv_func_vsnprintf=yes
+ac_cv_header_assert_h=yes
+ac_cv_header_ctype_h=yes
+ac_cv_header_dirent_h=yes
+ac_cv_header_dlfcn_h=yes
+ac_cv_header_errno_h=yes
+ac_cv_header_fcntl_h=yes
+ac_cv_header_float_h=yes
+ac_cv_header_inttypes_h=yes
+ac_cv_header_limits_h=yes
+ac_cv_header_malloc_h=yes
+ac_cv_header_memory_h=yes
+ac_cv_header_setjmp_h=yes
+ac_cv_header_signal_h=yes
+ac_cv_header_stdarg_h=yes
+ac_cv_header_stdc=yes
+ac_cv_header_stddef_h=yes
+ac_cv_header_stdint_h=yes
+ac_cv_header_stdio_h=yes
+ac_cv_header_stdlib_h=yes
+ac_cv_header_string_h=yes
+ac_cv_header_strings_h=yes
+ac_cv_header_sys_mman_h=yes
+ac_cv_header_sys_resource_h=yes
+ac_cv_header_sys_stat_h=yes
+ac_cv_header_sys_time_h=yes
+ac_cv_header_sys_types_h=yes
+ac_cv_header_sys_wait_h=yes
+ac_cv_header_time=yes
+ac_cv_header_time_h=yes
+ac_cv_header_unistd_h=yes
+ac_cv_header_utime_h=yes
+ac_cv_host=i686-pc-linux-gnu
+ac_cv_host_alias=i686-pc-linux-gnu
+ac_cv_objext=o
+ac_cv_path_install='/usr/bin/install -c'
+ac_cv_prog_AWK=mawk
+ac_cv_prog_CPP='gcc -E'
+ac_cv_prog_CXXCPP='g++ -E'
+ac_cv_prog_ac_ct_AR=ar
+ac_cv_prog_ac_ct_CC=gcc
+ac_cv_prog_ac_ct_CXX=g++
+ac_cv_prog_ac_ct_RANLIB=ranlib
+ac_cv_prog_ac_ct_STRIP=strip
+ac_cv_prog_cc_g=yes
+ac_cv_prog_cc_stdc=
+ac_cv_prog_cxx_g=yes
+ac_cv_prog_egrep='grep -E'
+ac_cv_prog_f77_g=no
+ac_cv_prog_make_make_set=yes
+ac_cv_sizeof___int16=0
+ac_cv_sizeof___int32=0
+ac_cv_sizeof___int64=0
+ac_cv_sizeof_dev_t=8
+ac_cv_sizeof_double=8
+ac_cv_sizeof_float=4
+ac_cv_sizeof_fpos_t=16
+ac_cv_sizeof_int=4
+ac_cv_sizeof_intmax_t=8
+ac_cv_sizeof_intptr_t=4
+ac_cv_sizeof_long=4
+ac_cv_sizeof_long_double=12
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_mode_t=4
+ac_cv_sizeof_off_t=8
+ac_cv_sizeof_ptrdiff_t=4
+ac_cv_sizeof_short=2
+ac_cv_sizeof_size_t=4
+ac_cv_sizeof_ssize_t=4
+ac_cv_sizeof_time_t=4
+ac_cv_sizeof_uintmax_t=8
+ac_cv_sizeof_uintptr_t=4
+ac_cv_sizeof_void_p=4
+ac_cv_sys_file_offset_bits=64
+ac_cv_sys_large_files=no
+ac_cv_sys_largefile_CC=no
+ac_cv_target=i686-pc-linux-gnu
+ac_cv_target_alias=i686-pc-linux-gnu
+ac_cv_type___int16=no
+ac_cv_type___int32=no
+ac_cv_type___int64=no
+ac_cv_type_dev_t=yes
+ac_cv_type_double=yes
+ac_cv_type_float=yes
+ac_cv_type_fpos_t=yes
+ac_cv_type_int=yes
+ac_cv_type_intmax_t=yes
+ac_cv_type_intptr_t=yes
+ac_cv_type_long=yes
+ac_cv_type_long_double=yes
+ac_cv_type_long_long=yes
+ac_cv_type_mode_t=yes
+ac_cv_type_off_t=yes
+ac_cv_type_ptrdiff_t=yes
+ac_cv_type_short=yes
+ac_cv_type_signal=void
+ac_cv_type_size_t=yes
+ac_cv_type_ssize_t=yes
+ac_cv_type_time_t=yes
+ac_cv_type_uintmax_t=yes
+ac_cv_type_uintptr_t=yes
+ac_cv_type_void_p=yes
+am_cv_CC_dependencies_compiler_type=gcc3
+am_cv_CXX_dependencies_compiler_type=gcc3
+lt_cv_deplibs_check_method=pass_all
+lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_ld_reload_flag=-r
+lt_cv_objdir=.libs
+lt_cv_path_LD=/usr/bin/ld
+lt_cv_path_LDCXX=/usr/bin/ld
+lt_cv_path_NM='/usr/bin/nm -B'
+lt_cv_path_SED=/bin/sed
+lt_cv_prog_compiler_c_o=yes
+lt_cv_prog_compiler_c_o_CXX=yes
+lt_cv_prog_compiler_rtti_exceptions=no
+lt_cv_prog_gnu_ld=yes
+lt_cv_prog_gnu_ldcxx=yes
+lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'''
+lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr) \&\2},/p'\'''
+lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int \1;/p'\'''
+lt_cv_sys_max_cmd_len=32768
+lt_lt_cv_prog_compiler_c_o='"yes"'
+lt_lt_cv_prog_compiler_c_o_CXX='"yes"'
+lt_lt_cv_sys_global_symbol_pipe='"sed -n -e '\''s/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'\''"'
+lt_lt_cv_sys_global_symbol_to_c_name_address='"sed -n -e '\''s/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'\''"'
+lt_lt_cv_sys_global_symbol_to_cdecl='"sed -n -e '\''s/^. .* \\(.*\\)\$/extern int \\1;/p'\''"'
+mfx_cv_header_sane_limits_h=yes
+
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+
+ACLOCAL='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run aclocal-1.9'
+AMDEPBACKSLASH='\'
+AMDEP_FALSE='#'
+AMDEP_TRUE=''
+AMTAR='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run tar'
+AR='ar'
+AUTOCONF='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run autoconf'
+AUTOHEADER='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run autoheader'
+AUTOMAKE='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run automake-1.9'
+AWK='mawk'
+CC='gcc'
+CCDEPMODE='depmode=gcc3'
+CFLAGS='-g -O2'
+CPP='gcc -E'
+CPPFLAGS='-DLZO_HAVE_CONFIG_H -DLZO_USE_ASM'
+CXX='g++'
+CXXCPP='g++ -E'
+CXXDEPMODE='depmode=gcc3'
+CXXFLAGS='-g -O2'
+CYGPATH_W='echo'
+DEFS='-DHAVE_CONFIG_H'
+DEPDIR='.deps'
+ECHO='echo'
+ECHO_C=''
+ECHO_N='-n'
+ECHO_T=''
+EGREP='grep -E'
+EXEEXT=''
+F77=''
+FFLAGS=''
+INSTALL_DATA='${INSTALL} -m 644'
+INSTALL_PROGRAM='${INSTALL}'
+INSTALL_SCRIPT='${INSTALL}'
+INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
+LDFLAGS=''
+LIBOBJS=''
+LIBS=''
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LN_S='ln -s'
+LTLIBOBJS=''
+LZO_ASM_VPATH=':/home/fries/Development/android/source/external/lzo/asm/i386/src_gas'
+LZO_CFLAGS=''
+LZO_CPPFLAGS=''
+LZO_EXTRA_CFLAGS=''
+LZO_EXTRA_CPPFLAGS=''
+LZO_USE_ASM_FALSE='#'
+LZO_USE_ASM_TRUE=''
+MAINT='#'
+MAINTAINER_MODE_FALSE=''
+MAINTAINER_MODE_TRUE='#'
+MAKEINFO='${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run makeinfo'
+OBJEXT='o'
+PACKAGE='lzo'
+PACKAGE_BUGREPORT='markus@oberhumer.com'
+PACKAGE_NAME='lzo'
+PACKAGE_STRING='lzo 2.03'
+PACKAGE_TARNAME='lzo'
+PACKAGE_VERSION='2.03'
+PATH_SEPARATOR=':'
+RANLIB='ranlib'
+SET_MAKE=''
+SHELL='/bin/bash'
+STRIP='strip'
+VERSION='2.03'
+ac_ct_AR='ar'
+ac_ct_CC='gcc'
+ac_ct_CXX='g++'
+ac_ct_F77=''
+ac_ct_RANLIB='ranlib'
+ac_ct_STRIP='strip'
+am__fastdepCC_FALSE='#'
+am__fastdepCC_TRUE=''
+am__fastdepCXX_FALSE='#'
+am__fastdepCXX_TRUE=''
+am__include='include'
+am__leading_dot='.'
+am__quote=''
+am__tar='${AMTAR} chof - "$$tardir"'
+am__untar='${AMTAR} xf -'
+bindir='${exec_prefix}/bin'
+build='i686-pc-linux-gnu'
+build_alias=''
+build_cpu='i686'
+build_os='linux-gnu'
+build_vendor='pc'
+configure_CFLAGS='-g -O2'
+configure_CPPFLAGS='-DLZO_HAVE_CONFIG_H -DLZO_USE_ASM'
+datadir='${prefix}/share'
+exec_prefix='${prefix}'
+host='i686-pc-linux-gnu'
+host_alias=''
+host_cpu='i686'
+host_os='linux-gnu'
+host_vendor='pc'
+includedir='${prefix}/include'
+infodir='${prefix}/info'
+install_sh='/home/fries/Development/android/source/external/lzo/autoconf/install-sh'
+libdir='${exec_prefix}/lib'
+libexecdir='${exec_prefix}/libexec'
+localstatedir='${prefix}/var'
+mandir='${prefix}/man'
+mkdir_p='mkdir -p --'
+oldincludedir='/usr/include'
+prefix='/usr/local'
+program_transform_name='s,x,x,'
+sbindir='${exec_prefix}/sbin'
+sharedstatedir='${prefix}/com'
+sysconfdir='${prefix}/etc'
+target='i686-pc-linux-gnu'
+target_alias=''
+target_cpu='i686'
+target_os='linux-gnu'
+target_vendor='pc'
+
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+
+#define HAVE_ACCESS 1
+#define HAVE_ASSERT_H 1
+#define HAVE_ATEXIT 1
+#define HAVE_ATOI 1
+#define HAVE_ATOL 1
+#define HAVE_CHMOD 1
+#define HAVE_CHOWN 1
+#define HAVE_CTIME 1
+#define HAVE_CTYPE_H 1
+#define HAVE_DIFFTIME 1
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_FSTAT 1
+#define HAVE_GETENV 1
+#define HAVE_GETPAGESIZE 1
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GMTIME 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_ISATTY 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LOCALTIME 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMCMP 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKTIME 1
+#define HAVE_MMAP 1
+#define HAVE_MPROTECT 1
+#define HAVE_MUNMAP 1
+#define HAVE_QSORT 1
+#define HAVE_RAISE 1
+#define HAVE_RMDIR 1
+#define HAVE_SETJMP 1
+#define HAVE_SETJMP_H 1
+#define HAVE_SIGNAL 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_SYS_MMAN_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_TIME 1
+#define HAVE_TIME_H 1
+#define HAVE_UMASK 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME 1
+#define HAVE_UTIME_H 1
+#define HAVE_VSNPRINTF 1
+#define LZO_ABI_LITTLE_ENDIAN 1
+#define PACKAGE "lzo"
+#define PACKAGE_BUGREPORT "markus@oberhumer.com"
+#define PACKAGE_NAME "lzo"
+#define PACKAGE_STRING "lzo 2.03"
+#define PACKAGE_TARNAME "lzo"
+#define PACKAGE_VERSION "2.03"
+#define RETSIGTYPE void
+#define SIZEOF_DEV_T 8
+#define SIZEOF_DOUBLE 8
+#define SIZEOF_FLOAT 4
+#define SIZEOF_FPOS_T 16
+#define SIZEOF_INT 4
+#define SIZEOF_INTMAX_T 8
+#define SIZEOF_INTPTR_T 4
+#define SIZEOF_LONG 4
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF_MODE_T 4
+#define SIZEOF_OFF_T 8
+#define SIZEOF_PTRDIFF_T 4
+#define SIZEOF_SHORT 2
+#define SIZEOF_SIZE_T 4
+#define SIZEOF_SSIZE_T 4
+#define SIZEOF_TIME_T 4
+#define SIZEOF_UINTMAX_T 8
+#define SIZEOF_UINTPTR_T 4
+#define SIZEOF_VOID_P 4
+#define SIZEOF___INT16 0
+#define SIZEOF___INT32 0
+#define SIZEOF___INT32 0
+#define SIZEOF___INT64 0
+#define STDC_HEADERS 1
+#define TIME_WITH_SYS_TIME 1
+#define VERSION "2.03"
+#define _FILE_OFFSET_BITS 64
+#endif
+#ifdef __cplusplus
+extern "C" void exit (int) throw ();
+
+configure: exit 0
diff --git a/ics-openvpn-stripped/main/lzo/config.status b/ics-openvpn-stripped/main/lzo/config.status
new file mode 100755
index 00000000..4d39ecc0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/config.status
@@ -0,0 +1,1475 @@
+#! /bin/bash
+# Generated by configure.
+# 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-/bin/bash}
+## --------------------- ##
+## 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 lzo $as_me 2.03, 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
+config_files=" Makefile examples/Makefile include/Makefile include/lzo/Makefile lzotest/Makefile minilzo/Makefile src/Makefile tests/Makefile"
+config_headers=" config.h:config.hin"
+config_commands=" depfiles"
+
+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>."
+ac_cs_version="\
+lzo config.status 2.03
+configured by ./configure, generated by GNU Autoconf 2.59,
+ with options \"\"
+
+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=.
+INSTALL="/usr/bin/install -c"
+# 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.
+ -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
+
+if $ac_cs_recheck; then
+ echo "running /bin/bash ./configure " $ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec /bin/bash ./configure $ac_configure_extra_args --no-create --no-recursion
+fi
+
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="" ac_aux_dir="autoconf"
+
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "include/lzo/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/lzo/Makefile" ;;
+ "lzotest/Makefile" ) CONFIG_FILES="$CONFIG_FILES lzotest/Makefile" ;;
+ "minilzo/Makefile" ) CONFIG_FILES="$CONFIG_FILES minilzo/Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
+ *) { { 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; }
+}
+
+
+#
+# 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@,/bin/bash,;t t
+s,@PATH_SEPARATOR@,:,;t t
+s,@PACKAGE_NAME@,lzo,;t t
+s,@PACKAGE_TARNAME@,lzo,;t t
+s,@PACKAGE_VERSION@,2.03,;t t
+s,@PACKAGE_STRING@,lzo 2.03,;t t
+s,@PACKAGE_BUGREPORT@,markus@oberhumer.com,;t t
+s,@exec_prefix@,${prefix},;t t
+s,@prefix@,/usr/local,;t t
+s,@program_transform_name@,s,x,x,,;t t
+s,@bindir@,${exec_prefix}/bin,;t t
+s,@sbindir@,${exec_prefix}/sbin,;t t
+s,@libexecdir@,${exec_prefix}/libexec,;t t
+s,@datadir@,${prefix}/share,;t t
+s,@sysconfdir@,${prefix}/etc,;t t
+s,@sharedstatedir@,${prefix}/com,;t t
+s,@localstatedir@,${prefix}/var,;t t
+s,@libdir@,${exec_prefix}/lib,;t t
+s,@includedir@,${prefix}/include,;t t
+s,@oldincludedir@,/usr/include,;t t
+s,@infodir@,${prefix}/info,;t t
+s,@mandir@,${prefix}/man,;t t
+s,@build_alias@,,;t t
+s,@host_alias@,,;t t
+s,@target_alias@,,;t t
+s,@DEFS@,-DHAVE_CONFIG_H,;t t
+s,@ECHO_C@,,;t t
+s,@ECHO_N@,-n,;t t
+s,@ECHO_T@,,;t t
+s,@LIBS@,,;t t
+s,@build@,i686-pc-linux-gnu,;t t
+s,@build_cpu@,i686,;t t
+s,@build_vendor@,pc,;t t
+s,@build_os@,linux-gnu,;t t
+s,@host@,i686-pc-linux-gnu,;t t
+s,@host_cpu@,i686,;t t
+s,@host_vendor@,pc,;t t
+s,@host_os@,linux-gnu,;t t
+s,@target@,i686-pc-linux-gnu,;t t
+s,@target_cpu@,i686,;t t
+s,@target_vendor@,pc,;t t
+s,@target_os@,linux-gnu,;t t
+s,@MAINTAINER_MODE_TRUE@,#,;t t
+s,@MAINTAINER_MODE_FALSE@,,;t t
+s,@MAINT@,#,;t t
+s,@CC@,gcc,;t t
+s,@CFLAGS@,-g -O2,;t t
+s,@LDFLAGS@,,;t t
+s,@CPPFLAGS@,-DLZO_HAVE_CONFIG_H -DLZO_USE_ASM,;t t
+s,@ac_ct_CC@,gcc,;t t
+s,@EXEEXT@,,;t t
+s,@OBJEXT@,o,;t t
+s,@CPP@,gcc -E,;t t
+s,@INSTALL_PROGRAM@,${INSTALL},;t t
+s,@INSTALL_SCRIPT@,${INSTALL},;t t
+s,@INSTALL_DATA@,${INSTALL} -m 644,;t t
+s,@CYGPATH_W@,echo,;t t
+s,@PACKAGE@,lzo,;t t
+s,@VERSION@,2.03,;t t
+s,@ACLOCAL@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run aclocal-1.9,;t t
+s,@AUTOCONF@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run autoconf,;t t
+s,@AUTOMAKE@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run automake-1.9,;t t
+s,@AUTOHEADER@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run autoheader,;t t
+s,@MAKEINFO@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run makeinfo,;t t
+s,@install_sh@,/home/fries/Development/android/source/external/lzo/autoconf/install-sh,;t t
+s,@STRIP@,strip,;t t
+s,@ac_ct_STRIP@,strip,;t t
+s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t
+s,@mkdir_p@,mkdir -p --,;t t
+s,@AWK@,mawk,;t t
+s,@SET_MAKE@,,;t t
+s,@am__leading_dot@,.,;t t
+s,@AMTAR@,${SHELL} /home/fries/Development/android/source/external/lzo/autoconf/missing --run tar,;t t
+s,@am__tar@,${AMTAR} chof - "$$tardir",;t t
+s,@am__untar@,${AMTAR} xf -,;t t
+s,@DEPDIR@,.deps,;t t
+s,@am__include@,include,;t t
+s,@am__quote@,,;t t
+s,@AMDEP_TRUE@,,;t t
+s,@AMDEP_FALSE@,#,;t t
+s,@AMDEPBACKSLASH@,\,;t t
+s,@CCDEPMODE@,depmode=gcc3,;t t
+s,@am__fastdepCC_TRUE@,,;t t
+s,@am__fastdepCC_FALSE@,#,;t t
+s,@EGREP@,grep -E,;t t
+s,@LN_S@,ln -s,;t t
+s,@ECHO@,echo,;t t
+s,@AR@,ar,;t t
+s,@ac_ct_AR@,ar,;t t
+s,@RANLIB@,ranlib,;t t
+s,@ac_ct_RANLIB@,ranlib,;t t
+s,@CXX@,g++,;t t
+s,@CXXFLAGS@,-g -O2,;t t
+s,@ac_ct_CXX@,g++,;t t
+s,@CXXDEPMODE@,depmode=gcc3,;t t
+s,@am__fastdepCXX_TRUE@,,;t t
+s,@am__fastdepCXX_FALSE@,#,;t t
+s,@CXXCPP@,g++ -E,;t t
+s,@F77@,,;t t
+s,@FFLAGS@,,;t t
+s,@ac_ct_F77@,,;t t
+s,@LIBTOOL@,$(SHELL) $(top_builddir)/libtool,;t t
+s,@LZO_USE_ASM_TRUE@,,;t t
+s,@LZO_USE_ASM_FALSE@,#,;t t
+s,@LZO_ASM_VPATH@,:/home/fries/Development/android/source/external/lzo/asm/i386/src_gas,;t t
+s,@LZO_CPPFLAGS@,,;t t
+s,@LZO_EXTRA_CPPFLAGS@,,;t t
+s,@LZO_CFLAGS@,,;t t
+s,@LZO_EXTRA_CFLAGS@,,;t t
+s,@configure_CPPFLAGS@,-DLZO_HAVE_CONFIG_H -DLZO_USE_ASM,;t t
+s,@configure_CFLAGS@,-g -O2,;t t
+s,@LIBOBJS@,,;t t
+s,@LTLIBOBJS@,,;t t
+CEOF
+
+ # 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"
+
+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
+ sed "/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}
+
+: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
+
+#
+# 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
+
+ # Handle all the #define templates only if necessary.
+ if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then
+ # If there are no defines, we may have an empty if/fi
+ :
+ cat >$tmp/defines.sed <<CEOF
+/^[ ]*#[ ]*define/!b
+t clr
+: clr
+${ac_dA}PACKAGE_NAME${ac_dB}PACKAGE_NAME${ac_dC}"lzo"${ac_dD}
+${ac_dA}PACKAGE_TARNAME${ac_dB}PACKAGE_TARNAME${ac_dC}"lzo"${ac_dD}
+${ac_dA}PACKAGE_VERSION${ac_dB}PACKAGE_VERSION${ac_dC}"2.03"${ac_dD}
+${ac_dA}PACKAGE_STRING${ac_dB}PACKAGE_STRING${ac_dC}"lzo 2.03"${ac_dD}
+${ac_dA}PACKAGE_BUGREPORT${ac_dB}PACKAGE_BUGREPORT${ac_dC}"markus@oberhumer.com"${ac_dD}
+${ac_dA}LZO_ABI_LITTLE_ENDIAN${ac_dB}LZO_ABI_LITTLE_ENDIAN${ac_dC}1${ac_dD}
+${ac_dA}_FILE_OFFSET_BITS${ac_dB}_FILE_OFFSET_BITS${ac_dC}64${ac_dD}
+${ac_dA}PACKAGE${ac_dB}PACKAGE${ac_dC}"lzo"${ac_dD}
+${ac_dA}VERSION${ac_dB}VERSION${ac_dC}"2.03"${ac_dD}
+${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_TYPES_H${ac_dB}HAVE_SYS_TYPES_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_STAT_H${ac_dB}HAVE_SYS_STAT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDLIB_H${ac_dB}HAVE_STDLIB_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRING_H${ac_dB}HAVE_STRING_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMORY_H${ac_dB}HAVE_MEMORY_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRINGS_H${ac_dB}HAVE_STRINGS_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_INTTYPES_H${ac_dB}HAVE_INTTYPES_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_DLFCN_H${ac_dB}HAVE_DLFCN_H${ac_dC}1${ac_dD}
+${ac_dA}TIME_WITH_SYS_TIME${ac_dB}TIME_WITH_SYS_TIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_ASSERT_H${ac_dB}HAVE_ASSERT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_CTYPE_H${ac_dB}HAVE_CTYPE_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_DIRENT_H${ac_dB}HAVE_DIRENT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_ERRNO_H${ac_dB}HAVE_ERRNO_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_FCNTL_H${ac_dB}HAVE_FCNTL_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_FLOAT_H${ac_dB}HAVE_FLOAT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_LIMITS_H${ac_dB}HAVE_LIMITS_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MALLOC_H${ac_dB}HAVE_MALLOC_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMORY_H${ac_dB}HAVE_MEMORY_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SETJMP_H${ac_dB}HAVE_SETJMP_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SIGNAL_H${ac_dB}HAVE_SIGNAL_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDARG_H${ac_dB}HAVE_STDARG_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDDEF_H${ac_dB}HAVE_STDDEF_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDINT_H${ac_dB}HAVE_STDINT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDIO_H${ac_dB}HAVE_STDIO_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STDLIB_H${ac_dB}HAVE_STDLIB_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRING_H${ac_dB}HAVE_STRING_H${ac_dC}1${ac_dD}
+CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/defines.sed <<CEOF
+/^[ ]*#[ ]*define/!b
+t clr
+: clr
+${ac_dA}HAVE_STRINGS_H${ac_dB}HAVE_STRINGS_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_TIME_H${ac_dB}HAVE_TIME_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_UTIME_H${ac_dB}HAVE_UTIME_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_MMAN_H${ac_dB}HAVE_SYS_MMAN_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_RESOURCE_H${ac_dB}HAVE_SYS_RESOURCE_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_STAT_H${ac_dB}HAVE_SYS_STAT_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_TIME_H${ac_dB}HAVE_SYS_TIME_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_TYPES_H${ac_dB}HAVE_SYS_TYPES_H${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SYS_WAIT_H${ac_dB}HAVE_SYS_WAIT_H${ac_dC}1${ac_dD}
+${ac_dA}RETSIGTYPE${ac_dB}RETSIGTYPE${ac_dC}void${ac_dD}
+${ac_dA}SIZEOF_SHORT${ac_dB}SIZEOF_SHORT${ac_dC}2${ac_dD}
+${ac_dA}SIZEOF_INT${ac_dB}SIZEOF_INT${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_LONG${ac_dB}SIZEOF_LONG${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_LONG_LONG${ac_dB}SIZEOF_LONG_LONG${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF___INT16${ac_dB}SIZEOF___INT16${ac_dC}0${ac_dD}
+${ac_dA}SIZEOF___INT32${ac_dB}SIZEOF___INT32${ac_dC}0${ac_dD}
+${ac_dA}SIZEOF___INT64${ac_dB}SIZEOF___INT64${ac_dC}0${ac_dD}
+${ac_dA}SIZEOF_VOID_P${ac_dB}SIZEOF_VOID_P${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_SIZE_T${ac_dB}SIZEOF_SIZE_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_PTRDIFF_T${ac_dB}SIZEOF_PTRDIFF_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF___INT32${ac_dB}SIZEOF___INT32${ac_dC}0${ac_dD}
+${ac_dA}SIZEOF_INTMAX_T${ac_dB}SIZEOF_INTMAX_T${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF_UINTMAX_T${ac_dB}SIZEOF_UINTMAX_T${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF_INTPTR_T${ac_dB}SIZEOF_INTPTR_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_UINTPTR_T${ac_dB}SIZEOF_UINTPTR_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_FLOAT${ac_dB}SIZEOF_FLOAT${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_DOUBLE${ac_dB}SIZEOF_DOUBLE${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF_LONG_DOUBLE${ac_dB}SIZEOF_LONG_DOUBLE${ac_dC}12${ac_dD}
+${ac_dA}SIZEOF_DEV_T${ac_dB}SIZEOF_DEV_T${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF_FPOS_T${ac_dB}SIZEOF_FPOS_T${ac_dC}16${ac_dD}
+${ac_dA}SIZEOF_MODE_T${ac_dB}SIZEOF_MODE_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_OFF_T${ac_dB}SIZEOF_OFF_T${ac_dC}8${ac_dD}
+${ac_dA}SIZEOF_SSIZE_T${ac_dB}SIZEOF_SSIZE_T${ac_dC}4${ac_dD}
+${ac_dA}SIZEOF_TIME_T${ac_dB}SIZEOF_TIME_T${ac_dC}4${ac_dD}
+${ac_dA}HAVE_ACCESS${ac_dB}HAVE_ACCESS${ac_dC}1${ac_dD}
+${ac_dA}HAVE_ATEXIT${ac_dB}HAVE_ATEXIT${ac_dC}1${ac_dD}
+${ac_dA}HAVE_ATOI${ac_dB}HAVE_ATOI${ac_dC}1${ac_dD}
+CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/defines.sed <<CEOF
+/^[ ]*#[ ]*define/!b
+t clr
+: clr
+${ac_dA}HAVE_ATOL${ac_dB}HAVE_ATOL${ac_dC}1${ac_dD}
+${ac_dA}HAVE_CHMOD${ac_dB}HAVE_CHMOD${ac_dC}1${ac_dD}
+${ac_dA}HAVE_CHOWN${ac_dB}HAVE_CHOWN${ac_dC}1${ac_dD}
+${ac_dA}HAVE_CTIME${ac_dB}HAVE_CTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_DIFFTIME${ac_dB}HAVE_DIFFTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_FSTAT${ac_dB}HAVE_FSTAT${ac_dC}1${ac_dD}
+${ac_dA}HAVE_GETENV${ac_dB}HAVE_GETENV${ac_dC}1${ac_dD}
+${ac_dA}HAVE_GETPAGESIZE${ac_dB}HAVE_GETPAGESIZE${ac_dC}1${ac_dD}
+${ac_dA}HAVE_GETRUSAGE${ac_dB}HAVE_GETRUSAGE${ac_dC}1${ac_dD}
+${ac_dA}HAVE_GETTIMEOFDAY${ac_dB}HAVE_GETTIMEOFDAY${ac_dC}1${ac_dD}
+${ac_dA}HAVE_GMTIME${ac_dB}HAVE_GMTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_ISATTY${ac_dB}HAVE_ISATTY${ac_dC}1${ac_dD}
+${ac_dA}HAVE_LOCALTIME${ac_dB}HAVE_LOCALTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_LONGJMP${ac_dB}HAVE_LONGJMP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_LSTAT${ac_dB}HAVE_LSTAT${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMCMP${ac_dB}HAVE_MEMCMP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMCPY${ac_dB}HAVE_MEMCPY${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMMOVE${ac_dB}HAVE_MEMMOVE${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MEMSET${ac_dB}HAVE_MEMSET${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MKDIR${ac_dB}HAVE_MKDIR${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MKTIME${ac_dB}HAVE_MKTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MMAP${ac_dB}HAVE_MMAP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MPROTECT${ac_dB}HAVE_MPROTECT${ac_dC}1${ac_dD}
+${ac_dA}HAVE_MUNMAP${ac_dB}HAVE_MUNMAP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_QSORT${ac_dB}HAVE_QSORT${ac_dC}1${ac_dD}
+${ac_dA}HAVE_RAISE${ac_dB}HAVE_RAISE${ac_dC}1${ac_dD}
+${ac_dA}HAVE_RMDIR${ac_dB}HAVE_RMDIR${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SETJMP${ac_dB}HAVE_SETJMP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SIGNAL${ac_dB}HAVE_SIGNAL${ac_dC}1${ac_dD}
+${ac_dA}HAVE_SNPRINTF${ac_dB}HAVE_SNPRINTF${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRCASECMP${ac_dB}HAVE_STRCASECMP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRCHR${ac_dB}HAVE_STRCHR${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRDUP${ac_dB}HAVE_STRDUP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRERROR${ac_dB}HAVE_STRERROR${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRFTIME${ac_dB}HAVE_STRFTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRNCASECMP${ac_dB}HAVE_STRNCASECMP${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRRCHR${ac_dB}HAVE_STRRCHR${ac_dC}1${ac_dD}
+${ac_dA}HAVE_STRSTR${ac_dB}HAVE_STRSTR${ac_dC}1${ac_dD}
+CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/defines.sed <<CEOF
+/^[ ]*#[ ]*define/!b
+t clr
+: clr
+${ac_dA}HAVE_TIME${ac_dB}HAVE_TIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_UMASK${ac_dB}HAVE_UMASK${ac_dC}1${ac_dD}
+${ac_dA}HAVE_UTIME${ac_dB}HAVE_UTIME${ac_dC}1${ac_dD}
+${ac_dA}HAVE_VSNPRINTF${ac_dB}HAVE_VSNPRINTF${ac_dC}1${ac_dD}
+CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ fi # grep
+
+ # Handle all the #undef templates
+ cat >$tmp/undefs.sed <<CEOF
+/^[ ]*#[ ]*undef/!b
+t clr
+: clr
+${ac_uA}PACKAGE_NAME${ac_uB}PACKAGE_NAME${ac_uC}"lzo"${ac_uD}
+${ac_uA}PACKAGE_TARNAME${ac_uB}PACKAGE_TARNAME${ac_uC}"lzo"${ac_uD}
+${ac_uA}PACKAGE_VERSION${ac_uB}PACKAGE_VERSION${ac_uC}"2.03"${ac_uD}
+${ac_uA}PACKAGE_STRING${ac_uB}PACKAGE_STRING${ac_uC}"lzo 2.03"${ac_uD}
+${ac_uA}PACKAGE_BUGREPORT${ac_uB}PACKAGE_BUGREPORT${ac_uC}"markus@oberhumer.com"${ac_uD}
+${ac_uA}LZO_ABI_LITTLE_ENDIAN${ac_uB}LZO_ABI_LITTLE_ENDIAN${ac_uC}1${ac_uD}
+${ac_uA}_FILE_OFFSET_BITS${ac_uB}_FILE_OFFSET_BITS${ac_uC}64${ac_uD}
+${ac_uA}PACKAGE${ac_uB}PACKAGE${ac_uC}"lzo"${ac_uD}
+${ac_uA}VERSION${ac_uB}VERSION${ac_uC}"2.03"${ac_uD}
+${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_TYPES_H${ac_uB}HAVE_SYS_TYPES_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_STAT_H${ac_uB}HAVE_SYS_STAT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDLIB_H${ac_uB}HAVE_STDLIB_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRING_H${ac_uB}HAVE_STRING_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMORY_H${ac_uB}HAVE_MEMORY_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRINGS_H${ac_uB}HAVE_STRINGS_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_INTTYPES_H${ac_uB}HAVE_INTTYPES_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_DLFCN_H${ac_uB}HAVE_DLFCN_H${ac_uC}1${ac_uD}
+${ac_uA}TIME_WITH_SYS_TIME${ac_uB}TIME_WITH_SYS_TIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_ASSERT_H${ac_uB}HAVE_ASSERT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_CTYPE_H${ac_uB}HAVE_CTYPE_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_DIRENT_H${ac_uB}HAVE_DIRENT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_ERRNO_H${ac_uB}HAVE_ERRNO_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_FCNTL_H${ac_uB}HAVE_FCNTL_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_FLOAT_H${ac_uB}HAVE_FLOAT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_LIMITS_H${ac_uB}HAVE_LIMITS_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MALLOC_H${ac_uB}HAVE_MALLOC_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMORY_H${ac_uB}HAVE_MEMORY_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SETJMP_H${ac_uB}HAVE_SETJMP_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SIGNAL_H${ac_uB}HAVE_SIGNAL_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDARG_H${ac_uB}HAVE_STDARG_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDDEF_H${ac_uB}HAVE_STDDEF_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDINT_H${ac_uB}HAVE_STDINT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDIO_H${ac_uB}HAVE_STDIO_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STDLIB_H${ac_uB}HAVE_STDLIB_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRING_H${ac_uB}HAVE_STRING_H${ac_uC}1${ac_uD}
+CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/undefs.sed <<CEOF
+/^[ ]*#[ ]*undef/!b
+t clr
+: clr
+${ac_uA}HAVE_STRINGS_H${ac_uB}HAVE_STRINGS_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_TIME_H${ac_uB}HAVE_TIME_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_UTIME_H${ac_uB}HAVE_UTIME_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_MMAN_H${ac_uB}HAVE_SYS_MMAN_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_RESOURCE_H${ac_uB}HAVE_SYS_RESOURCE_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_STAT_H${ac_uB}HAVE_SYS_STAT_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_TIME_H${ac_uB}HAVE_SYS_TIME_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_TYPES_H${ac_uB}HAVE_SYS_TYPES_H${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SYS_WAIT_H${ac_uB}HAVE_SYS_WAIT_H${ac_uC}1${ac_uD}
+${ac_uA}RETSIGTYPE${ac_uB}RETSIGTYPE${ac_uC}void${ac_uD}
+${ac_uA}SIZEOF_SHORT${ac_uB}SIZEOF_SHORT${ac_uC}2${ac_uD}
+${ac_uA}SIZEOF_INT${ac_uB}SIZEOF_INT${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_LONG${ac_uB}SIZEOF_LONG${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_LONG_LONG${ac_uB}SIZEOF_LONG_LONG${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF___INT16${ac_uB}SIZEOF___INT16${ac_uC}0${ac_uD}
+${ac_uA}SIZEOF___INT32${ac_uB}SIZEOF___INT32${ac_uC}0${ac_uD}
+${ac_uA}SIZEOF___INT64${ac_uB}SIZEOF___INT64${ac_uC}0${ac_uD}
+${ac_uA}SIZEOF_VOID_P${ac_uB}SIZEOF_VOID_P${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_SIZE_T${ac_uB}SIZEOF_SIZE_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_PTRDIFF_T${ac_uB}SIZEOF_PTRDIFF_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF___INT32${ac_uB}SIZEOF___INT32${ac_uC}0${ac_uD}
+${ac_uA}SIZEOF_INTMAX_T${ac_uB}SIZEOF_INTMAX_T${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF_UINTMAX_T${ac_uB}SIZEOF_UINTMAX_T${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF_INTPTR_T${ac_uB}SIZEOF_INTPTR_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_UINTPTR_T${ac_uB}SIZEOF_UINTPTR_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_FLOAT${ac_uB}SIZEOF_FLOAT${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_DOUBLE${ac_uB}SIZEOF_DOUBLE${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF_LONG_DOUBLE${ac_uB}SIZEOF_LONG_DOUBLE${ac_uC}12${ac_uD}
+${ac_uA}SIZEOF_DEV_T${ac_uB}SIZEOF_DEV_T${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF_FPOS_T${ac_uB}SIZEOF_FPOS_T${ac_uC}16${ac_uD}
+${ac_uA}SIZEOF_MODE_T${ac_uB}SIZEOF_MODE_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_OFF_T${ac_uB}SIZEOF_OFF_T${ac_uC}8${ac_uD}
+${ac_uA}SIZEOF_SSIZE_T${ac_uB}SIZEOF_SSIZE_T${ac_uC}4${ac_uD}
+${ac_uA}SIZEOF_TIME_T${ac_uB}SIZEOF_TIME_T${ac_uC}4${ac_uD}
+${ac_uA}HAVE_ACCESS${ac_uB}HAVE_ACCESS${ac_uC}1${ac_uD}
+${ac_uA}HAVE_ATEXIT${ac_uB}HAVE_ATEXIT${ac_uC}1${ac_uD}
+${ac_uA}HAVE_ATOI${ac_uB}HAVE_ATOI${ac_uC}1${ac_uD}
+CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/undefs.sed <<CEOF
+/^[ ]*#[ ]*undef/!b
+t clr
+: clr
+${ac_uA}HAVE_ATOL${ac_uB}HAVE_ATOL${ac_uC}1${ac_uD}
+${ac_uA}HAVE_CHMOD${ac_uB}HAVE_CHMOD${ac_uC}1${ac_uD}
+${ac_uA}HAVE_CHOWN${ac_uB}HAVE_CHOWN${ac_uC}1${ac_uD}
+${ac_uA}HAVE_CTIME${ac_uB}HAVE_CTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_DIFFTIME${ac_uB}HAVE_DIFFTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_FSTAT${ac_uB}HAVE_FSTAT${ac_uC}1${ac_uD}
+${ac_uA}HAVE_GETENV${ac_uB}HAVE_GETENV${ac_uC}1${ac_uD}
+${ac_uA}HAVE_GETPAGESIZE${ac_uB}HAVE_GETPAGESIZE${ac_uC}1${ac_uD}
+${ac_uA}HAVE_GETRUSAGE${ac_uB}HAVE_GETRUSAGE${ac_uC}1${ac_uD}
+${ac_uA}HAVE_GETTIMEOFDAY${ac_uB}HAVE_GETTIMEOFDAY${ac_uC}1${ac_uD}
+${ac_uA}HAVE_GMTIME${ac_uB}HAVE_GMTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_ISATTY${ac_uB}HAVE_ISATTY${ac_uC}1${ac_uD}
+${ac_uA}HAVE_LOCALTIME${ac_uB}HAVE_LOCALTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_LONGJMP${ac_uB}HAVE_LONGJMP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_LSTAT${ac_uB}HAVE_LSTAT${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMCMP${ac_uB}HAVE_MEMCMP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMCPY${ac_uB}HAVE_MEMCPY${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMMOVE${ac_uB}HAVE_MEMMOVE${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MEMSET${ac_uB}HAVE_MEMSET${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MKDIR${ac_uB}HAVE_MKDIR${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MKTIME${ac_uB}HAVE_MKTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MMAP${ac_uB}HAVE_MMAP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MPROTECT${ac_uB}HAVE_MPROTECT${ac_uC}1${ac_uD}
+${ac_uA}HAVE_MUNMAP${ac_uB}HAVE_MUNMAP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_QSORT${ac_uB}HAVE_QSORT${ac_uC}1${ac_uD}
+${ac_uA}HAVE_RAISE${ac_uB}HAVE_RAISE${ac_uC}1${ac_uD}
+${ac_uA}HAVE_RMDIR${ac_uB}HAVE_RMDIR${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SETJMP${ac_uB}HAVE_SETJMP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SIGNAL${ac_uB}HAVE_SIGNAL${ac_uC}1${ac_uD}
+${ac_uA}HAVE_SNPRINTF${ac_uB}HAVE_SNPRINTF${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRCASECMP${ac_uB}HAVE_STRCASECMP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRCHR${ac_uB}HAVE_STRCHR${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRDUP${ac_uB}HAVE_STRDUP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRERROR${ac_uB}HAVE_STRERROR${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRFTIME${ac_uB}HAVE_STRFTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRNCASECMP${ac_uB}HAVE_STRNCASECMP${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRRCHR${ac_uB}HAVE_STRRCHR${ac_uC}1${ac_uD}
+${ac_uA}HAVE_STRSTR${ac_uB}HAVE_STRSTR${ac_uC}1${ac_uD}
+CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ cat >$tmp/undefs.sed <<CEOF
+/^[ ]*#[ ]*undef/!b
+t clr
+: clr
+${ac_uA}HAVE_TIME${ac_uB}HAVE_TIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_UMASK${ac_uB}HAVE_UMASK${ac_uC}1${ac_uD}
+${ac_uA}HAVE_UTIME${ac_uB}HAVE_UTIME${ac_uC}1${ac_uD}
+${ac_uA}HAVE_VSNPRINTF${ac_uB}HAVE_VSNPRINTF${ac_uC}1${ac_uD}
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+
+ # 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
+# 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
+
+#
+# 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
+ 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
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(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
+
+{ (exit 0); exit 0; }
diff --git a/ics-openvpn-stripped/main/lzo/configure b/ics-openvpn-stripped/main/lzo/configure
new file mode 100755
index 00000000..4ff70230
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/configure
@@ -0,0 +1,16314 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for LZO 2.07.
+#
+# Report bugs to <markus@oberhumer.com>.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
+# All Rights Reserved.
+# This configure script may be copied, distributed and modified under the
+# terms of the GNU General Public License; see COPYING for more details.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: markus@oberhumer.com about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='LZO'
+PACKAGE_TARNAME='lzo'
+PACKAGE_VERSION='2.07'
+PACKAGE_STRING='LZO 2.07'
+PACKAGE_BUGREPORT='markus@oberhumer.com'
+PACKAGE_URL='http://www.oberhumer.com/opensource/lzo/'
+
+ac_unique_file="src/lzo_init.c"
+ac_default_prefix=/usr/local
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+LZO_USE_ASM_i386_obj_elf32_FALSE
+LZO_USE_ASM_i386_obj_elf32_TRUE
+LZO_USE_ASM_i386_src_gas_FALSE
+LZO_USE_ASM_i386_src_gas_TRUE
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__untar
+am__tar
+AMTAR
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+EGREP
+GREP
+CPP
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+am__leading_dot
+CCASFLAGS
+CCAS
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_largefile
+enable_silent_rules
+enable_static
+enable_shared
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_asm
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CCAS
+CCASFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures LZO 2.07 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/lzo]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of LZO 2.07:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --disable-largefile omit support for large files
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-shared[=PKGS] build shared libraries [default=no]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-asm disable assembly versions
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
+ compiler's sysroot if not specified).
+
+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 (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CCAS assembler compiler command (defaults to CC)
+ CCASFLAGS assembler compiler flags (defaults to CFLAGS)
+ 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.
+
+Report bugs to <markus@oberhumer.com>.
+LZO home page: <http://www.oberhumer.com/opensource/lzo/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+LZO configure 2.07
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+
+Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
+All Rights Reserved.
+This configure script may be copied, distributed and modified under the
+terms of the GNU General Public License; see COPYING for more details.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ----------------------------------- ##
+## Report this to markus@oberhumer.com ##
+## ----------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by LZO $as_me 2.07, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring LZO $PACKAGE_VERSION" >&5
+$as_echo "$as_me: Configuring LZO $PACKAGE_VERSION" >&6;}
+
+ac_aux_dir=
+for ac_dir in autoconf "$srcdir"/autoconf; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2014 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+#
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+
+
+
+
+
+
+
+
+
+
+
+
+#
+
+
+
+
+
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2014 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.
+
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported. See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+
+
+
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+if test -z "$ac_abs_top_srcdir"; then
+ ac_builddir=.
+
+case . in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo . | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+fi
+if test -z "$ac_abs_top_srcdir"; then
+ as_fn_error 1 "internal error: ac_abs_top_srcdir is not set"
+fi
+if test -r .Conf.settings1; then
+ . ./.Conf.settings1
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_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"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+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
+
+
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+# By default we simply use the C compiler to build assembly code.
+
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+
+
+
+depcc="$CCAS" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ 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_CCAS_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+
+
+ 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 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CCAS_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CCAS_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
+CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
+ am__fastdepCCAS_TRUE=
+ am__fastdepCCAS_FALSE='#'
+else
+ am__fastdepCCAS_TRUE='#'
+ am__fastdepCCAS_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C preprocessor needs special flags" >&5
+$as_echo_n "checking whether the C preprocessor needs special flags... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# include "your C preprocessor is broken 1"
+#elif (0xffffu == 0xfffffffful)
+# include "your C preprocessor is broken 2"
+#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
+# include "your C preprocessor is broken 3"
+#endif
+
+int
+main ()
+{
+
+
+ ;
+ return 0;
+}
+_ACEOF
+
+mfx_save_CPPFLAGS=$CPPFLAGS
+mfx_tmp=ERROR
+for mfx_arg in "" -no-cpp-precomp
+do
+ CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ mfx_tmp=$mfx_arg
+break
+fi
+rm -f core conftest.err conftest.$ac_objext
+done
+CPPFLAGS=$mfx_save_CPPFLAGS
+rm -f conftest.$ac_ext conftest.$ac_objext
+case x$mfx_tmp in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xERROR)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ERROR" >&5
+$as_echo "ERROR" >&6; }
+ as_fn_error $? "your C preprocessor is broken - for details see config.log" "$LINENO" 5
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mfx_tmp" >&5
+$as_echo "$mfx_tmp" >&6; }
+ CPPFLAGS="$mfx_tmp $CPPFLAGS"
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* 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 sort of thing. */
+ char tx;
+ char *t = &tx;
+ 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 sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; 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
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+
+$as_echo "#define LZO_ABI_BIG_ENDIAN 1" >>confdefs.h
+;; #(
+ no)
+
+$as_echo "#define LZO_ABI_LITTLE_ENDIAN 1" >>confdefs.h
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+fi
+
+
+am__api_version='1.14'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_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
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='lzo'
+ VERSION='2.07'
+
+
+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"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+ac_config_headers="$ac_config_headers config.h:config.hin"
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_shared=no
+fi
+
+
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2.418'
+macro_revision='2.4.2.418'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case $ECHO in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that 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
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | 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* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; 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
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# 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"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$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"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE=32
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE=64
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test yes = "$lt_cv_prog_gnu_ld"; 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*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ 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"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/${ac_tool_prefix}file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC=$CC
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='$wl'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec='$wl--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='$wl--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; 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 no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $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 no = "$ld_shlibs"; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='$wl-f,'
+
+ if test yes = "$GCC"; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test yes = "$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_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 "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_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 "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' $wl-bernotok'
+ allow_undefined_flag=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='$wl-E'
+ ;;
+
+ hpux10*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test yes = "$lt_cv_prog_compiler__b"; then
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ else
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; then
+ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test sequent = "$host_vendor"; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='$wl-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='$wl-z,text'
+ allow_undefined_flag='$wl-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test sni = "$host_vendor"; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='$wl-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test no = "$ld_shlibs" && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ 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"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; 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 cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test yes = "$aix_use_runtimelinking"; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # 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
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ 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
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=.dll
+ need_lib_prefix=no
+ library_names_spec='$libname$shared_ext $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test yes = "$hardcode_automatic"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$hardcode_direct" &&
+ # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+ test no != "$hardcode_minus_L"; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test relink = "$hardcode_action" ||
+ test yes = "$inherit_rpath"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test yes != "$enable_dlopen"; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen=load_add_on
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen=LoadLibrary
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+
+ lt_cv_dlopen=dyld
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS=$LDFLAGS
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS=$LIBS
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP"; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report what library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
+ test yes = "$enable_shared" && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+# /***********************************************************************
+# // Checks for header files
+# ************************************************************************/
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+for ac_header in assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "X$ac_cv_header_limits_h" != Xyes; then
+ as_fn_error $? "<limits.h> header not found" "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h is sane" >&5
+$as_echo_n "checking whether limits.h is sane... " >&6; }
+if ${mfx_cv_header_sane_limits_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# if defined(__APPLE__) && defined(__GNUC__)
+# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
+# else
+# include "your preprocessor is broken"
+# endif
+#endif
+#define MFX_0xffff 0xffff
+#define MFX_0xffffffffL 4294967295ul
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+# include "error CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX)
+# include "error UCHAR_MAX 1"
+#endif
+#if !defined(USHRT_MAX)
+# include "error USHRT_MAX 1"
+#endif
+#if !defined(UINT_MAX)
+# include "error UINT_MAX 1"
+#endif
+#if !defined(ULONG_MAX)
+# include "error ULONG_MAX 1"
+#endif
+#if !defined(SHRT_MAX)
+# include "error SHRT_MAX 1"
+#endif
+#if !defined(INT_MAX)
+# include "error INT_MAX 1"
+#endif
+#if !defined(LONG_MAX)
+# include "error LONG_MAX 1"
+#endif
+#if (UCHAR_MAX < 1)
+# include "error UCHAR_MAX 2"
+#endif
+#if (USHRT_MAX < 1)
+# include "error USHRT_MAX 2"
+#endif
+#if (UINT_MAX < 1)
+# include "error UINT_MAX 2"
+#endif
+#if (ULONG_MAX < 1)
+# include "error ULONG_MAX 2"
+#endif
+#if (UCHAR_MAX < 0xff)
+# include "error UCHAR_MAX 3"
+#endif
+#if (USHRT_MAX < MFX_0xffff)
+# include "error USHRT_MAX 3"
+#endif
+#if (UINT_MAX < MFX_0xffff)
+# include "error UINT_MAX 3"
+#endif
+#if (ULONG_MAX < MFX_0xffffffffL)
+# include "error ULONG_MAX 3"
+#endif
+#if (USHRT_MAX > UINT_MAX)
+# include "error USHRT_MAX vs UINT_MAX"
+#endif
+#if (UINT_MAX > ULONG_MAX)
+# include "error UINT_MAX vs ULONG_MAX"
+#endif
+
+int
+main ()
+{
+
+#if (USHRT_MAX == MFX_0xffff)
+{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
+#elif (USHRT_MAX >= MFX_0xffff)
+{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
+#endif
+#if (UINT_MAX == MFX_0xffff)
+{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
+#elif (UINT_MAX >= MFX_0xffff)
+{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffff)
+{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
+#elif (ULONG_MAX >= MFX_0xffff)
+{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
+#endif
+#if !defined(_CRAY1) /* CRAY PVP systems */
+#if (USHRT_MAX == MFX_0xffffffffL)
+{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
+#elif (USHRT_MAX >= MFX_0xffffffffL)
+{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
+#endif
+#endif /* _CRAY1 */
+#if (UINT_MAX == MFX_0xffffffffL)
+{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
+#elif (UINT_MAX >= MFX_0xffffffffL)
+{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffffffffL)
+{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
+#elif (ULONG_MAX >= MFX_0xffffffffL)
+{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ mfx_cv_header_sane_limits_h=yes
+else
+ mfx_cv_header_sane_limits_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $mfx_cv_header_sane_limits_h" >&5
+$as_echo "$mfx_cv_header_sane_limits_h" >&6; }
+
+if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
+ as_fn_error $? "your <limits.h> header is broken - for details see config.log" "$LINENO" 5
+fi
+
+
+# /***********************************************************************
+# // Checks for typedefs and structures
+# ************************************************************************/
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ptrdiff_t long
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_signal=int
+else
+ ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int16" >&5
+$as_echo_n "checking size of __int16... " >&6; }
+if ${ac_cv_sizeof___int16+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int16))" "ac_cv_sizeof___int16" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int16" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (__int16)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof___int16=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int16" >&5
+$as_echo "$ac_cv_sizeof___int16" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF___INT16 $ac_cv_sizeof___int16
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32" >&5
+$as_echo_n "checking size of __int32... " >&6; }
+if ${ac_cv_sizeof___int32+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32))" "ac_cv_sizeof___int32" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int32" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (__int32)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof___int32=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int32" >&5
+$as_echo "$ac_cv_sizeof___int32" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF___INT32 $ac_cv_sizeof___int32
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
+$as_echo_n "checking size of __int64... " >&6; }
+if ${ac_cv_sizeof___int64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int64" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (__int64)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof___int64=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5
+$as_echo "$ac_cv_sizeof___int64" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF___INT64 $ac_cv_sizeof___int64
+_ACEOF
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_size_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5
+$as_echo_n "checking size of ptrdiff_t... " >&6; }
+if ${ac_cv_sizeof_ptrdiff_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_ptrdiff_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ptrdiff_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_ptrdiff_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ptrdiff_t" >&5
+$as_echo "$ac_cv_sizeof_ptrdiff_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t
+_ACEOF
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32" >&5
+$as_echo_n "checking size of __int32... " >&6; }
+if ${ac_cv_sizeof___int32+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32))" "ac_cv_sizeof___int32" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int32" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (__int32)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof___int32=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int32" >&5
+$as_echo "$ac_cv_sizeof___int32" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF___INT32 $ac_cv_sizeof___int32
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5
+$as_echo_n "checking size of intmax_t... " >&6; }
+if ${ac_cv_sizeof_intmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_intmax_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (intmax_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_intmax_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5
+$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintmax_t" >&5
+$as_echo_n "checking size of uintmax_t... " >&6; }
+if ${ac_cv_sizeof_uintmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintmax_t))" "ac_cv_sizeof_uintmax_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_uintmax_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (uintmax_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_uintmax_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintmax_t" >&5
+$as_echo "$ac_cv_sizeof_uintmax_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UINTMAX_T $ac_cv_sizeof_uintmax_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intptr_t" >&5
+$as_echo_n "checking size of intptr_t... " >&6; }
+if ${ac_cv_sizeof_intptr_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intptr_t))" "ac_cv_sizeof_intptr_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_intptr_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (intptr_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_intptr_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intptr_t" >&5
+$as_echo "$ac_cv_sizeof_intptr_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTPTR_T $ac_cv_sizeof_intptr_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5
+$as_echo_n "checking size of uintptr_t... " >&6; }
+if ${ac_cv_sizeof_uintptr_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_uintptr_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (uintptr_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_uintptr_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintptr_t" >&5
+$as_echo "$ac_cv_sizeof_uintptr_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t
+_ACEOF
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
+$as_echo_n "checking size of float... " >&6; }
+if ${ac_cv_sizeof_float+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_float" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (float)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_float=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5
+$as_echo "$ac_cv_sizeof_float" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_FLOAT $ac_cv_sizeof_float
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
+$as_echo_n "checking size of double... " >&6; }
+if ${ac_cv_sizeof_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_double" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (double)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_double=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5
+$as_echo "$ac_cv_sizeof_double" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DOUBLE $ac_cv_sizeof_double
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
+$as_echo_n "checking size of long double... " >&6; }
+if ${ac_cv_sizeof_long_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_double" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long double)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_double=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
+$as_echo "$ac_cv_sizeof_long_double" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
+_ACEOF
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_dev_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_dev_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
+$as_echo_n "checking size of fpos_t... " >&6; }
+if ${ac_cv_sizeof_fpos_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_fpos_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (fpos_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_fpos_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fpos_t" >&5
+$as_echo "$ac_cv_sizeof_fpos_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mode_t" >&5
+$as_echo_n "checking size of mode_t... " >&6; }
+if ${ac_cv_sizeof_mode_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (mode_t))" "ac_cv_sizeof_mode_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_mode_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (mode_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_mode_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mode_t" >&5
+$as_echo "$ac_cv_sizeof_mode_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_MODE_T $ac_cv_sizeof_mode_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5
+$as_echo_n "checking size of ssize_t... " >&6; }
+if ${ac_cv_sizeof_ssize_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_ssize_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ssize_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_ssize_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5
+$as_echo "$ac_cv_sizeof_ssize_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_time_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+
+
+
+# /***********************************************************************
+# // Checks for library functions
+# ************************************************************************/
+
+
+for ac_func in access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+if test "X$GCC" = Xyes; then
+case $host_os in
+cygwin* | mingw* | pw32*)
+ test "X$LIBS" != "X" && LIBS="$LIBS "
+ LIBS="${LIBS}-lwinmm" ;;
+esac
+fi
+
+
+
+# /***********************************************************************
+# // Checks for assembler
+# ************************************************************************/
+
+# Check whether --enable-asm was given.
+if test "${enable_asm+set}" = set; then :
+ enableval=$enable_asm;
+fi
+
+
+asm_arch=
+asm_dir=
+asm_msg_amd64=no
+asm_msg_i386=no
+
+case "$host_cpu-$ac_cv_sizeof_void_p" in
+ amd64-8 | x86_64-8) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64"; asm_mode="amd64_src_gas_elf64" ;;
+ i?86-4) asm_arch="i386"; asm_dir="asm/i386/src_gas"; asm_mode="i386_src_gas" ;;
+ *) enable_asm=no ;;
+esac
+LZO_USE_ASM_i386_src_gas=no
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build assembly versions" >&5
+$as_echo_n "checking whether to build assembly versions... " >&6; }
+if test "X$enable_asm" != Xno; then
+mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&5'
+cat > conftest.S <<EOF
+#if !defined(__i386__) && !defined(__i386)
+#error
+this+is+an+error
+#endif
+#include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
+EOF
+enable_asm=no
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$mfx_compile_S\""; } >&5
+ (eval $mfx_compile_S) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if { ac_try='test -s conftest.$ac_objext'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ enable_asm=yes
+ eval asm_msg_$asm_arch="'yes [$asm_dir]'"
+ eval LZO_USE_ASM_$asm_mode=yes
+ fi
+fi
+if test "X$enable_asm" = Xno; then
+ echo "configure: failed program was:" >&5
+ cat conftest.S >&5
+fi
+rm -rf conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_asm" >&5
+$as_echo "$enable_asm" >&6; }
+
+ if test "X$LZO_USE_ASM_i386_src_gas" != Xno; then
+ LZO_USE_ASM_i386_src_gas_TRUE=
+ LZO_USE_ASM_i386_src_gas_FALSE='#'
+else
+ LZO_USE_ASM_i386_src_gas_TRUE='#'
+ LZO_USE_ASM_i386_src_gas_FALSE=
+fi
+
+ if false; then
+ LZO_USE_ASM_i386_obj_elf32_TRUE=
+ LZO_USE_ASM_i386_obj_elf32_FALSE='#'
+else
+ LZO_USE_ASM_i386_obj_elf32_TRUE='#'
+ LZO_USE_ASM_i386_obj_elf32_FALSE=
+fi
+
+
+
+# /***********************************************************************
+# // Write output files
+# ************************************************************************/
+
+
+mfx_tmp="-I$srcdir"
+mfx_save_CPPFLAGS=$CPPFLAGS
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your compiler passes the LZO conformance test" >&5
+$as_echo_n "checking whether your compiler passes the LZO conformance test... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define LZO_CFG_NO_CONFIG_HEADER 1
+#define LZO_WANT_ACC_INCD_H 1
+#include "include/lzo/lzodefs.h"
+#include "src/lzo_supp.h"
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
+
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+static void test_lzo_compile_time_assert(void) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
+}
+
+#undef NDEBUG
+#include <assert.h>
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) assert(expr);
+static int test_lzo_run_time_assert(int r) {
+#define LZO_WANT_ACC_CHK_CH 1
+#include "src/lzo_supp.h"
+return r;
+}
+
+int
+main ()
+{
+
+test_lzo_compile_time_assert();
+if (test_lzo_run_time_assert(1) != 1) return 1;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+
+mfx_tmp=FAILED
+if ac_fn_c_try_compile "$LINENO"; then :
+ mfx_tmp=yes
+fi
+rm -f core conftest.err conftest.$ac_objext
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $mfx_tmp" >&5
+$as_echo "$mfx_tmp" >&6; }
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Your compiler failed the LZO conformance test - for details see " >&5
+$as_echo "$as_me: Your compiler failed the LZO conformance test - for details see " >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: \`config.log'. Please check that log file and consider sending" >&5
+$as_echo "$as_me: \`config.log'. Please check that log file and consider sending" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&5
+$as_echo "$as_me: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Thanks for your support." >&5
+$as_echo "$as_me: Thanks for your support." >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+ as_fn_error $? "LZO conformance test failed. Stop." "$LINENO" 5
+ ;;
+esac
+
+
+if test -r .Conf.settings2; then
+ . ./.Conf.settings2
+fi
+
+my_DEFS="-DLZO_HAVE_CONFIG_H=1"
+if test "X$enable_asm" != Xno; then
+ my_DEFS="$my_DEFS -DLZO_USE_ASM=1"
+fi
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${LZO_USE_ASM_i386_src_gas_TRUE}" && test -z "${LZO_USE_ASM_i386_src_gas_FALSE}"; then
+ as_fn_error $? "conditional \"LZO_USE_ASM_i386_src_gas\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LZO_USE_ASM_i386_obj_elf32_TRUE}" && test -z "${LZO_USE_ASM_i386_obj_elf32_FALSE}"; then
+ as_fn_error $? "conditional \"LZO_USE_ASM_i386_obj_elf32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+ test "X$DEFS" = "X-DHAVE_CONFIG_H" && DEFS=
+ test "X$DEFS" != "X" && DEFS="$DEFS "
+ DEFS="${DEFS}${my_DEFS}"
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by LZO $as_me 2.07, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <markus@oberhumer.com>.
+LZO home page: <http://www.oberhumer.com/opensource/lzo/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+LZO config.status 2.07
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options that 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) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=''
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### 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 set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+
+## enable AMD64 assembly code : ${asm_msg_amd64}
+cat <<EOF
+
+ LZO configuration summary
+ -------------------------
+ LZO version : ${PACKAGE_VERSION}
+ configured for host : ${host_cpu}-${host_vendor}-${host_os}
+ source code location : ${srcdir}
+ compiler : ${CC}
+ preprocessor definitions : ${DEFS}
+ preprocessor flags : ${CPPFLAGS}
+ compiler flags : ${CFLAGS}
+ build static library : ${enable_static}
+ build shared library : ${enable_shared}
+ enable i386 assembly code : ${asm_msg_i386}
+
+
+ LZO ${PACKAGE_VERSION} configured.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+
+
+Type \`make' to build LZO. Type \`make install' to install LZO.
+After installing LZO, please read the accompanied documentation.
+
+EOF
+
+# vi:ts=4:et
diff --git a/ics-openvpn-stripped/main/lzo/configure.ac b/ics-openvpn-stripped/main/lzo/configure.ac
new file mode 100644
index 00000000..e2dff5fc
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/configure.ac
@@ -0,0 +1,229 @@
+#
+# configure.ac -- autoconf configuration for the LZO library
+#
+# This file is part of the LZO data compression library.
+#
+# Copyright (C) 1996-2014 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 as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# 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/
+#
+
+
+# /***********************************************************************
+# // Init
+# ************************************************************************/
+
+AC_COPYRIGHT([Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
+All Rights Reserved.
+This configure script may be copied, distributed and modified under the
+terms of the GNU General Public License; see COPYING for more details.])
+
+AC_PREREQ(2.69)
+AC_INIT([LZO],[2.07],[markus@oberhumer.com],[lzo],[http://www.oberhumer.com/opensource/lzo/])
+AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION])
+AC_CONFIG_SRCDIR(src/lzo_init.c)
+AC_CONFIG_AUX_DIR(autoconf)
+m4_include([autoconf/local.m4])
+AC_PREFIX_DEFAULT(/usr/local)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AM_MAINTAINER_MODE
+
+if test -z "$ac_abs_top_srcdir"; then
+ _AC_SRCDIRS([.])
+fi
+if test -z "$ac_abs_top_srcdir"; then
+ as_fn_error 1 "internal error: ac_abs_top_srcdir is not set"
+fi
+if test -r .Conf.settings1; then
+ . ./.Conf.settings1
+fi
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_AS
+AC_PROG_CPP
+mfx_PROG_CPPFLAGS
+AC_C_CONST
+mfx_LZO_CHECK_ENDIAN
+AC_SYS_LARGEFILE
+
+AM_INIT_AUTOMAKE([1.14.1 gnu subdir-objects])
+AM_SILENT_RULES([yes])
+AC_CONFIG_HEADERS([config.h:config.hin])
+
+AC_ENABLE_STATIC
+AC_DISABLE_SHARED
+LT_INIT
+
+
+# /***********************************************************************
+# // Checks for header files
+# ************************************************************************/
+
+mfx_ACC_CHECK_HEADERS
+dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h])
+if test "X$ac_cv_header_limits_h" != Xyes; then
+ AC_MSG_ERROR([<limits.h> header not found])
+fi
+mfx_CHECK_HEADER_SANE_LIMITS_H
+if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
+ AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
+fi
+
+
+# /***********************************************************************
+# // Checks for typedefs and structures
+# ************************************************************************/
+
+AC_TYPE_OFF_T
+AC_CHECK_TYPE(ptrdiff_t,long)
+AC_TYPE_SIZE_T
+AC_TYPE_SIGNAL
+
+mfx_ACC_CHECK_SIZEOF
+mfx_CHECK_SIZEOF
+
+
+# /***********************************************************************
+# // Checks for library functions
+# ************************************************************************/
+
+mfx_ACC_CHECK_FUNCS
+mfx_CHECK_LIB_WINMM
+
+
+# /***********************************************************************
+# // Checks for assembler
+# ************************************************************************/
+
+AC_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable assembly versions))
+
+asm_arch=
+asm_dir=
+asm_msg_amd64=no
+asm_msg_i386=no
+
+case "$host_cpu-$ac_cv_sizeof_void_p" in
+ amd64-8 | x86_64-8) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64"; asm_mode="amd64_src_gas_elf64" ;;
+ i?86-4) asm_arch="i386"; asm_dir="asm/i386/src_gas"; asm_mode="i386_src_gas" ;;
+ *) enable_asm=no ;;
+esac
+LZO_USE_ASM_i386_src_gas=no
+
+AC_MSG_CHECKING([whether to build assembly versions])
+if test "X$enable_asm" != Xno; then
+mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
+cat > conftest.S <<EOF
+#if !defined(__i386__) && !defined(__i386)
+#error
+this+is+an+error
+#endif
+#include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
+EOF
+enable_asm=no
+if AC_TRY_EVAL(mfx_compile_S); then
+ if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
+ enable_asm=yes
+ eval asm_msg_$asm_arch="'yes [[$asm_dir]]'"
+ eval LZO_USE_ASM_$asm_mode=yes
+ fi
+fi
+if test "X$enable_asm" = Xno; then
+ echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.S >&AS_MESSAGE_LOG_FD
+fi
+rm -rf conftest*
+fi
+AC_MSG_RESULT([$enable_asm])
+
+AM_CONDITIONAL(LZO_USE_ASM_i386_src_gas, [test "X$LZO_USE_ASM_i386_src_gas" != Xno])
+AM_CONDITIONAL(LZO_USE_ASM_i386_obj_elf32, [false])
+
+
+# /***********************************************************************
+# // Write output files
+# ************************************************************************/
+
+mfx_LZO_LZOCHK(["-I$srcdir"],["include/lzo/lzodefs.h"],["src/lzo_supp.h"])
+
+if test -r .Conf.settings2; then
+ . ./.Conf.settings2
+fi
+
+my_DEFS="-DLZO_HAVE_CONFIG_H=1"
+if test "X$enable_asm" != Xno; then
+ my_DEFS="$my_DEFS -DLZO_USE_ASM=1"
+fi
+
+AC_CONFIG_COMMANDS_PRE([
+ test "X$DEFS" = "X-DHAVE_CONFIG_H" && DEFS=
+ test "X$DEFS" != "X" && DEFS="$DEFS "
+ DEFS="${DEFS}${my_DEFS}"
+])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
+
+## enable AMD64 assembly code : ${asm_msg_amd64}
+cat <<EOF
+
+ LZO configuration summary
+ -------------------------
+ LZO version : ${PACKAGE_VERSION}
+ configured for host : ${host_cpu}-${host_vendor}-${host_os}
+ source code location : ${srcdir}
+ compiler : ${CC}
+ preprocessor definitions : ${DEFS}
+ preprocessor flags : ${CPPFLAGS}
+ compiler flags : ${CFLAGS}
+ build static library : ${enable_static}
+ build shared library : ${enable_shared}
+ enable i386 assembly code : ${asm_msg_i386}
+
+
+ LZO ${PACKAGE_VERSION} configured.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+
+
+Type \`make' to build LZO. Type \`make install' to install LZO.
+After installing LZO, please read the accompanied documentation.
+
+EOF
+
+# vi:ts=4:et
diff --git a/ics-openvpn-stripped/main/lzo/doc/LZO.FAQ b/ics-openvpn-stripped/main/lzo/doc/LZO.FAQ
new file mode 100644
index 00000000..cb1f38aa
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/doc/LZO.FAQ
@@ -0,0 +1,213 @@
+============================================================================
+LZO Frequently Asked Questions
+============================================================================
+
+
+I hate reading docs - just tell me how to add compression to my program
+=======================================================================
+
+This is for the impatient: take a look at examples/simple.c and
+examples/lzopack.c and see how easy this is.
+
+But you will come back to read the documentation later, won't you ?
+
+
+Can you explain the naming conventions of the algorithms ?
+==========================================================
+
+Let's take a look at LZO1X:
+
+ The algorithm name is LZO1X.
+ The algorithm category is LZO1.
+ Various compression levels are implemented.
+
+ LZO1X-999
+ !---------- algorithm category
+ !--------- algorithm type
+ !!!----- compression level (1-9, 99, 999)
+
+ LZO1X-1(11)
+ !---------- algorithm category
+ !--------- algorithm type
+ !------- compression level (1-9, 99, 999)
+ !!---- memory level (memory requirements for compression)
+
+All compression/memory levels generate the same compressed data format,
+so e.g. the LZO1X decompressor handles all LZO1X-* compression levels
+(for more information about the decompressors see below).
+
+Category LZO1 algorithms: compressed data format is strictly byte aligned
+Category LZO2 algorithms: uses bit-shifting, slower decompression
+
+
+Why are there so many algorithms ?
+==================================
+
+Because of historical reasons - I want to support unlimited
+backward compatibility.
+
+Don't get misled by the size of the library - using one algorithm
+increases the size of your application by only a few KiB.
+
+If you just want to add a little bit of data compression to your
+application you may be looking for miniLZO.
+See minilzo/README.LZO for more information.
+
+
+Which algorithm should I use ?
+==============================
+
+LZO1X seems to be best choice in many cases, so:
+- when going for speed use LZO1X-1
+- when generating pre-compressed data use LZO1X-999
+- if you have little memory available for compression use LZO1X-1(11)
+ or LZO1X-1(12)
+
+Of course, your mileage may vary, and you are encouraged to run your
+own experiments. Try LZO1Y and LZO1F next.
+
+
+What's the difference between the decompressors per algorithm ?
+===============================================================
+
+Once again let's use LZO1X for explanation:
+
+- lzo1x_decompress
+ The 'standard' decompressor. Pretty fast - use this whenever possible.
+
+ This decompressor expects valid compressed data.
+ If the compressed data gets corrupted somehow (e.g. transmission
+ via an erroneous channel, disk errors, ...) it will probably crash
+ your application because absolutely no additional checks are done.
+
+- lzo1x_decompress_safe
+ The 'safe' decompressor. Somewhat slower.
+
+ This decompressor will catch all compressed data violations and
+ return an error code in this case - it will never crash.
+
+- lzo1x_decompress_asm
+ Same as lzo1x_decompress - written in assembler.
+
+- lzo1x_decompress_asm_safe
+ Same as lzo1x_decompress_safe - written in assembler.
+
+- lzo1x_decompress_asm_fast
+ Similar to lzo1x_decompress_asm - but even faster.
+
+ For reasons of speed this decompressor can write up to 3 bytes
+ past the end of the decompressed (output) block.
+ [ technical note: because data is transferred in 32-bit units ]
+
+ Use this when you are decompressing from one memory block to
+ another memory block - just provide output space for 3 extra bytes.
+ You shouldn't use it if e.g. you are directly decompressing to video
+ memory (because the extra bytes will be show up on the screen).
+
+- lzo1x_decompress_asm_fast_safe
+ This is the safe version of lzo1x_decompress_asm_fast.
+
+
+Notes:
+------
+- When using a safe decompressor you must pass the number of
+ bytes available in 'dst' via the parameter 'dst_len'.
+
+- If you want to be sure that your data is not corrupted you must
+ use a checksum - just using the safe decompressor is not enough,
+ because many data errors will not result in a compressed data violation.
+
+- Assembler versions are only available for the i386 family yet.
+ Please see also asm/i386/00README.TXT
+
+- You should test if the assembler versions are actually faster
+ than the C version on your machine - some compilers can do a very
+ good optimization job and they also can optimize the code
+ for a specific processor.
+
+
+What is this optimization thing ?
+=================================
+
+The compressors use a heuristic approach - they sometimes code
+information that doesn't improve compression ratio.
+
+Optimization removes this superfluos information in order to
+increase decompression speed.
+
+Optimization works similar to decompression except that the
+compressed data is modified as well. The length of the compressed
+data block will not change - only the compressed data-bytes will
+get rearranged a little bit.
+
+Don't expect too much, though - my tests have shown that the
+optimization step improves decompression speed by about 1-3%.
+
+
+I need even more decompression speed...
+=======================================
+
+Many RISC processors (like MIPS) can transfer 32-bit words much
+faster than bytes - this can significantly speed up decompression.
+So after verifying that everything works fine you can try if activating
+the LZO_ALIGNED_OK_4 macro improves LZO1X and LZO1Y decompression
+performance. Change the file config.h accordingly and recompile everything.
+
+On an i386 architecture you should evaluate the assembler versions.
+
+
+How can I reduce memory requirements when (de)compressing ?
+===========================================================
+
+If you cleverly arrange your data, you can do an overlapping (in-place)
+decompression which means that you can decompress to the *same*
+block where the compressed data resides. This effectively removes
+the space requirements for holding the compressed data block.
+
+This technique is essential e.g. for usage in an executable packer.
+
+You can also partly overlay the buffers when doing compression.
+
+See examples/overlap.c for a working example.
+
+
+Can you give a cookbook for using pre-compressed data ?
+=======================================================
+
+Let's assume you use LZO1X-999.
+
+1) pre-compression step
+ - call lzo_init()
+ - call lzo1x_999_compress()
+ - call lzo1x_optimize()
+ - compute an adler32 checksum of the *compressed* data
+ - store the compressed data and the checksum in a file
+ - if you are paranoid you should verify decompression now
+
+2) decompression step within your application
+ - call lzo_init()
+ - load your compressed data and the checksum
+ - optionally verify the checksum of the compressed data
+ (so that you can use the standard decompressor)
+ - decompress
+
+See examples/precomp.c and examples/precomp2.c for a working example.
+
+
+How much can my data expand during compression ?
+================================================
+
+LZO will expand incompressible data by a little amount.
+I still haven't computed the exact values, but I suggest using
+these formulas for a worst-case expansion calculation:
+
+ Algorithm LZO1, LZO1A, LZO1B, LZO1C, LZO1F, LZO1X, LZO1Y, LZO1Z:
+ ----------------------------------------------------------------
+ output_block_size = input_block_size + (input_block_size / 16) + 64 + 3
+
+ [This is about 106% for a large block size.]
+
+ Algorithm LZO2A:
+ ----------------
+ output_block_size = input_block_size + (input_block_size / 8) + 128 + 3
+
diff --git a/ics-openvpn-stripped/main/lzo/doc/LZO.TXT b/ics-openvpn-stripped/main/lzo/doc/LZO.TXT
new file mode 100644
index 00000000..2d3b5aa7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/doc/LZO.TXT
@@ -0,0 +1,291 @@
+
+ ============================================================================
+ LZO -- a real-time data compression library
+ ============================================================================
+
+ Author : Markus Franz Xaver Johannes Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ Version : 2.07
+ Date : 25 Jun 2014
+
+
+ Abstract
+ --------
+ LZO is a portable lossless data compression library written in ANSI C.
+ It offers pretty fast compression and very fast decompression.
+ Decompression requires no memory.
+
+ In addition there are slower compression levels achieving a quite
+ competitive compression ratio while still decompressing at
+ this very high speed.
+
+ The LZO algorithms and implementations are copyrighted OpenSource
+ distributed under the GNU General Public License.
+
+
+ Introduction
+ ------------
+ LZO is a data compression library which is suitable for data
+ de-/compression in real-time. This means it favours speed
+ over compression ratio.
+
+ The acronym LZO is standing for Lempel-Ziv-Oberhumer.
+
+ LZO is written in ANSI C. Both the source code and the compressed
+ data format are designed to be portable across platforms.
+
+ LZO implements a number of algorithms with the following features:
+
+ - Decompression is simple and *very* fast.
+ - Requires no memory for decompression.
+ - Compression is pretty fast.
+ - Requires 64 KiB of memory for compression.
+ - Allows you to dial up extra compression at a speed cost in the
+ compressor. The speed of the decompressor is not reduced.
+ - Includes compression levels for generating pre-compressed
+ data which achieve a quite competitive compression ratio.
+ - There is also a compression level which needs only 8 KiB for compression.
+ - Algorithm is thread safe.
+ - Algorithm is lossless.
+
+ LZO supports overlapping compression and in-place decompression.
+
+
+ Design criteria
+ ---------------
+ LZO was designed with speed in mind. Decompressor speed has been
+ favoured over compressor speed. Real-time decompression should be
+ possible for virtually any application. The implementation of the
+ LZO1X decompressor in optimized i386 assembler code runs about at
+ the third of the speed of a memcpy() - and even faster for many files.
+
+ In fact I first wrote the decompressor of each algorithm thereby
+ defining the compressed data format, verified it with manually
+ created test data and at last added the compressor.
+
+
+ Performance
+ -----------
+ To keep you interested, here is an overview of the average results
+ when compressing the Calgary Corpus test suite with a blocksize
+ of 256 KiB, originally done on an ancient Intel Pentium 133.
+
+ The naming convention of the various algorithms goes LZOxx-N, where N is
+ the compression level. Range 1-9 indicates the fast standard levels using
+ 64 KiB memory for compression. Level 99 offers better compression at the
+ cost of more memory (256 KiB), and is still reasonably fast.
+ Level 999 achieves nearly optimal compression - but it is slow
+ and uses much memory, and is mainly intended for generating
+ pre-compressed data.
+
+ The C version of LZO1X-1 is about 4-5 times faster than the fastest
+ zlib compression level, and it also outperforms other algorithms
+ like LZRW1-A and LZV in both compression ratio and compression speed
+ and decompression speed.
+
+ +------------------------------------------------------------------------+
+ | Algorithm Length CxB ComLen %Remn Bits Com K/s Dec K/s |
+ | --------- ------ --- ------ ----- ---- ------- ------- |
+ | |
+ | memcpy() 224401 1 224401 100.0 8.00 60956.83 59124.58 |
+ | |
+ | LZO1-1 224401 1 117362 53.1 4.25 4665.24 13341.98 |
+ | LZO1-99 224401 1 101560 46.7 3.73 1373.29 13823.40 |
+ | |
+ | LZO1A-1 224401 1 115174 51.7 4.14 4937.83 14410.35 |
+ | LZO1A-99 224401 1 99958 45.5 3.64 1362.72 14734.17 |
+ | |
+ | LZO1B-1 224401 1 109590 49.6 3.97 4565.53 15438.34 |
+ | LZO1B-2 224401 1 106235 48.4 3.88 4297.33 15492.79 |
+ | LZO1B-3 224401 1 104395 47.8 3.83 4018.21 15373.52 |
+ | LZO1B-4 224401 1 104828 47.4 3.79 3024.48 15100.11 |
+ | LZO1B-5 224401 1 102724 46.7 3.73 2827.82 15427.62 |
+ | LZO1B-6 224401 1 101210 46.0 3.68 2615.96 15325.68 |
+ | LZO1B-7 224401 1 101388 46.0 3.68 2430.89 15361.47 |
+ | LZO1B-8 224401 1 99453 45.2 3.62 2183.87 15402.77 |
+ | LZO1B-9 224401 1 99118 45.0 3.60 1677.06 15069.60 |
+ | LZO1B-99 224401 1 95399 43.6 3.48 1286.87 15656.11 |
+ | LZO1B-999 224401 1 83934 39.1 3.13 232.40 16445.05 |
+ | |
+ | LZO1C-1 224401 1 111735 50.4 4.03 4883.08 15570.91 |
+ | LZO1C-2 224401 1 108652 49.3 3.94 4424.24 15733.14 |
+ | LZO1C-3 224401 1 106810 48.7 3.89 4127.65 15645.69 |
+ | LZO1C-4 224401 1 105717 47.7 3.82 3007.92 15346.44 |
+ | LZO1C-5 224401 1 103605 47.0 3.76 2829.15 15153.88 |
+ | LZO1C-6 224401 1 102585 46.5 3.72 2631.37 15257.58 |
+ | LZO1C-7 224401 1 101937 46.2 3.70 2378.57 15492.49 |
+ | LZO1C-8 224401 1 100779 45.6 3.65 2171.93 15386.07 |
+ | LZO1C-9 224401 1 100255 45.4 3.63 1691.44 15194.68 |
+ | LZO1C-99 224401 1 97252 44.1 3.53 1462.88 15341.37 |
+ | LZO1C-999 224401 1 87740 40.2 3.21 306.44 16411.94 |
+ | |
+ | LZO1F-1 224401 1 113412 50.8 4.07 4755.97 16074.12 |
+ | LZO1F-999 224401 1 89599 40.3 3.23 280.68 16553.90 |
+ | |
+ | LZO1X-1(11) 224401 1 118810 52.6 4.21 4544.42 15879.04 |
+ | LZO1X-1(12) 224401 1 113675 50.6 4.05 4411.15 15721.59 |
+ | LZO1X-1 224401 1 109323 49.4 3.95 4991.76 15584.89 |
+ | LZO1X-1(15) 224401 1 108500 49.1 3.93 5077.50 15744.56 |
+ | LZO1X-999 224401 1 82854 38.0 3.04 135.77 16548.48 |
+ | |
+ | LZO1Y-1 224401 1 110820 49.8 3.98 4952.52 15638.82 |
+ | LZO1Y-999 224401 1 83614 38.2 3.05 135.07 16385.40 |
+ | |
+ | LZO1Z-999 224401 1 83034 38.0 3.04 133.31 10553.74 |
+ | |
+ | LZO2A-999 224401 1 87880 40.0 3.20 301.21 8115.75 |
+ +------------------------------------------------------------------------+
+
+ Notes:
+ - CxB is the number of blocks
+ - K/s is the speed measured in 1000 uncompressed bytes per second
+ - the assembler decompressors are even faster
+
+
+ Short documentation
+ -------------------
+ LZO is a block compression algorithm - it compresses and decompresses
+ a block of data. Block size must be the same for compression
+ and decompression.
+
+ LZO compresses a block of data into matches (a sliding dictionary)
+ and runs of non-matching literals. LZO takes care about long matches
+ and long literal runs so that it produces good results on highly
+ redundant data and deals acceptably with non-compressible data.
+
+ When dealing with incompressible data, LZO expands the input
+ block by a maximum of 64 bytes per 1024 bytes input.
+
+ I have verified LZO using such tools as valgrind and other memory checkers.
+ And in addition to compressing gigabytes of files when tuning some parameters
+ I have also consulted various 'lint' programs to spot potential portability
+ problems. LZO is free of any known bugs.
+
+
+ The algorithms
+ --------------
+ There are too many algorithms implemented. But I want to support
+ unlimited backward compatibility, so I will not reduce the LZO
+ distribution in the future.
+
+ As the many object files are mostly independent of each other, the
+ size overhead for an executable statically linked with the LZO library
+ is usually pretty low (just a few KiB) because the linker will only add
+ the modules that you are actually using.
+
+ I first published LZO1 and LZO1A in the Internet newsgroups
+ comp.compression and comp.compression.research in March 1996.
+ They are mainly included for compatibility reasons. The LZO2A
+ decompressor is too slow, and there is no fast compressor anyway.
+
+ My experiments have shown that LZO1B is good with a large blocksize
+ or with very redundant data, LZO1F is good with a small blocksize or
+ with binary data and that LZO1X is often the best choice of all.
+ LZO1Y and LZO1Z are almost identical to LZO1X - they can achieve a
+ better compression ratio on some files.
+ Beware, your mileage may vary.
+
+
+ Usage of the library
+ --------------------
+ Despite of its size, the basic usage of LZO is really very simple.
+
+ Let's assume you want to compress some data with LZO1X-1:
+ A) compression
+ * include <lzo/lzo1x.h>
+ call lzo_init()
+ compress your data with lzo1x_1_compress()
+ * link your application with the LZO library
+ B) decompression
+ * include <lzo/lzo1x.h>
+ call lzo_init()
+ decompress your data with lzo1x_decompress()
+ * link your application with the LZO library
+
+ The program examples/simple.c shows a fully working example.
+ See also LZO.FAQ for more information.
+
+
+ Building LZO
+ ------------
+ As LZO uses Autoconf+Automake+Libtool the building process under
+ UNIX systems should be very unproblematic. Shared libraries are
+ supported on many architectures as well.
+ For detailed instructions see the file INSTALL.
+
+ Please note that due to the design of the ELF executable format
+ the performance of a shared library on i386 systems (e.g. Linux)
+ is a little bit slower, so you may want to link your applications
+ with the static version (liblzo2.a) anyway.
+
+ For building under DOS, Win16, Win32, OS/2 and other systems
+ take a look at the file B/00readme.txt.
+
+ In case of troubles (like decompression data errors) try recompiling
+ everything without optimizations - LZO may break the optimizer
+ of your compiler. See the file BUGS.
+
+ LZO is written in ANSI C. In particular this means:
+ - your compiler must understand prototypes
+ - your compiler must understand prototypes in function pointers
+ - your compiler must correctly promote integrals ("value-preserving")
+ - your preprocessor must implement #elif, #error and stringizing
+ - you must have a conforming and correct <limits.h> header
+ - you must have <stddef.h>, <string.h> and other ANSI C headers
+ - you should have size_t and ptrdiff_t
+
+
+ Portability
+ -----------
+ I have built and tested LZO successfully on a variety of platforms
+ including DOS (16 + 32 bit), Windows 3.x (16-bit), Win32, Win64,
+ Linux, *BSD, HP-UX and many more.
+
+ LZO is also reported to work under AIX, ConvexOS, IRIX, MacOS, PalmOS (Pilot),
+ PSX (Sony Playstation), Solaris, SunOS, TOS (Atari ST) and VxWorks.
+ Furthermore it is said that its performance on a Cray is superior
+ to all other machines...
+
+ And I think it would be much fun to translate the decompressors
+ to Z-80 or 6502 assembly.
+
+
+ The future
+ ----------
+ Here is what I'm planning for the next months. No promises, though...
+
+ - interfaces to .NET and Mono
+ - interfaces to Perl, Java, Python, Delphi, Visual Basic, ...
+ - improve documentation and API reference
+
+
+ Some comments about the source code
+ -----------------------------------
+ Be warned: the main source code in the 'src' directory is a
+ real pain to understand as I've experimented with hundreds of slightly
+ different versions. It contains many #if and some gotos, and
+ is *completely optimized for speed* and not for readability.
+ Code sharing of the different algorithms is implemented by stressing
+ the preprocessor - this can be really confusing. Lots of marcos and
+ assertions don't make things better.
+
+ Nevertheless LZO compiles very quietly on a variety of
+ compilers with the highest warning levels turned on, even
+ in C++ mode.
+
+
+ Copyright
+ ---------
+ LZO is Copyright (C) 1996-2014 Markus Franz Xaver Oberhumer
+ All Rights Reserved.
+
+ LZO is 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/ics-openvpn-stripped/main/lzo/doc/LZOAPI.TXT b/ics-openvpn-stripped/main/lzo/doc/LZOAPI.TXT
new file mode 100644
index 00000000..547b0d70
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/doc/LZOAPI.TXT
@@ -0,0 +1,261 @@
+
+============================================================================
+LZO -- a real-time data compression library LIBRARY REFERENCE
+============================================================================
+
+
+[ please read LZO.FAQ first ]
+
+
+Table of Contents
+=================
+
+1 Introduction to the LZO Library Reference
+1.1 Preliminary notes
+1.2 Headers
+2 General
+2.1 The memory model
+2.2 Public integral types
+2.3 Public pointer types
+2.4 Public function types
+3 Function reference
+3.1 Initialization
+3.2 Compression
+3.3 Decompression
+3.4 Optimization
+3.5 String functions
+3.6 Checksum functions
+3.7 Version functions
+4 Variable reference
+
+
+
+1 Introduction to the LZO Library Reference
+=============================================
+
+
+1.1 Preliminary notes
+---------------------
+
+- 'C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C
+ programming language
+
+
+1.2 Headers
+-----------
+
+This section briefly describes the headers.
+
+<lzo/lzoconf.h>
+
+ Contains definitions for the basic integral and pointer types,
+ provides wrappers for the library calling conventions, defines
+ error codes and contains prototypes for the generic functions.
+ This file is automatically included by all LZO headers.
+
+<lzo/lzo1.h>
+<lzo/lzo1a.h>
+<lzo/lzo1b.h>
+<lzo/lzo1c.h>
+<lzo/lzo1f.h>
+<lzo/lzo1x.h>
+<lzo/lzo1y.h>
+<lzo/lzo1z.h>
+<lzo/lzo2a.h>
+
+ These files provide definitions and prototypes for the
+ actual (de-)compression functions.
+
+
+
+2 General
+=========
+
+
+2.1 The memory model
+--------------------
+
+LZO requires a flat 32-bit or 64-bit memory model.
+
+
+2.2 Public integral types
+-------------------------
+
+lzo_uint
+
+ must match size_t
+
+lzo_bool
+
+ can store the values 0 ("false") and 1 ("true")
+
+
+2.3 Public pointer types
+------------------------
+
+lzo_voidp
+
+ pointer to void
+
+lzo_bytep
+
+ pointer to unsigned char
+
+
+2.4 Public function types
+-------------------------
+
+lzo_compress_t
+
+lzo_decompress_t
+
+lzo_optimize_t
+
+lzo_callback_t
+
+
+
+3 Function reference
+====================
+
+
+3.1 Initialization
+------------------
+
+int lzo_init ( void );
+
+ This function initializes the LZO library. It must be the first LZO
+ function you call, and you cannot use any of the other LZO library
+ functions if the call fails.
+
+ Return value:
+ Returns LZO_E_OK on success, error code otherwise.
+
+ Note:
+ This function is actually implemented using a macro.
+
+
+3.2 Compression
+---------------
+
+All compressors compress the memory block at 'src' with the uncompressed
+length 'src_len' to the address given by 'dst'.
+The length of the compressed blocked will be returned in the variable
+pointed by 'dst_len'.
+
+The two blocks may overlap under certain conditions (see examples/overlap.c),
+thereby allowing "in-place" compression.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#include <lzo/lzo1x.h>
+
+int lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+ Algorithm: LZO1X
+ Compression level: LZO1X-1
+ Memory requirements: LZO1X_1_MEM_COMPRESS (64 KiB on 32-bit machines)
+
+ This compressor is pretty fast.
+
+ Return value:
+ Always returns LZO_E_OK (this function can never fail).
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#include <lzo/lzo1x.h>
+
+int lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+ Algorithm: LZO1X
+ Compression level: LZO1X-999
+ Memory requirements: LZO1X_999_MEM_COMPRESS (448 KiB on 32-bit machines)
+
+ This compressor is quite slow but achieves a good compression
+ ratio. It is mainly intended for generating pre-compressed data.
+
+ Return value:
+ Always returns LZO_E_OK (this function can never fail).
+
+
+[ ... lots of other compressors which all follow the same principle ... ]
+
+
+
+3.3 Decompression
+-----------------
+
+All decompressors decompress the memory block at 'src' with the compressed
+length 'src_len' to the address given by 'dst'.
+The length of the decompressed block will be returned in the variable
+pointed by 'dst_len' - on error the number of bytes that have
+been decompressed so far will be returned.
+
+The safe decompressors expect that the number of bytes available in
+the 'dst' block is passed via the variable pointed by 'dst_len'.
+
+The two blocks may overlap under certain conditions (see examples/overlap.c),
+thereby allowing "in-place" decompression.
+
+
+Description of return values:
+
+ LZO_E_OK
+ Success.
+
+ LZO_E_INPUT_NOT_CONSUMED
+ The end of the compressed block has been detected before all
+ bytes in the compressed block have been used.
+ This may actually not be an error (if 'src_len' is too large).
+
+ LZO_E_INPUT_OVERRUN
+ The decompressor requested more bytes from the compressed
+ block than available.
+ Your data is corrupted (or 'src_len' is too small).
+
+ LZO_E_OUTPUT_OVERRUN
+ The decompressor requested to write more bytes to the uncompressed
+ block than available.
+ Either your data is corrupted, or you should increase the number of
+ available bytes passed in the variable pointed by 'dst_len'.
+
+ LZO_E_LOOKBEHIND_OVERRUN
+ Your data is corrupted.
+
+ LZO_E_EOF_NOT_FOUND
+ No EOF code was found in the compressed block.
+ Your data is corrupted (or 'src_len' is too small).
+
+ LZO_E_ERROR
+ Any other error (data corrupted).
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#include <lzo1x.h>
+
+int lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+ Algorithm: LZO1X
+ Memory requirements: 0
+
+
+[ ... lots of other decompressors which all follow the same principle ... ]
+
+
+
+4 Variable reference
+====================
+
+The variables are listed alphabetically.
+
+[ no public variables yet ]
+
+
+
+--------------------------- END OF LZOAPI.TXT ------------------------------
+
diff --git a/ics-openvpn-stripped/main/lzo/doc/LZOTEST.TXT b/ics-openvpn-stripped/main/lzo/doc/LZOTEST.TXT
new file mode 100644
index 00000000..93c86591
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/doc/LZOTEST.TXT
@@ -0,0 +1,75 @@
+The test driver 'lzotest' has grown into a fairly powerful program
+of it's own. Here is a short description of the various options.
+
+[ to be written - this is only a very first draft ]
+
+
+Usage:
+======
+
+lzotest [option..] file...
+
+
+Basic options:
+==============
+
+ -m# compression method
+ -b# set input block size (default 262144, max 1310720)
+ -n# number of compression/decompression runs
+ -c# number of compression runs
+ -d# number of decompression runs
+ -S use safe decompressor (if available)
+ -A use assembler decompressor (if available)
+ -F use fast assembler decompressor (if available)
+ -O optimize compressed data (if available)
+ -s DIR process Calgary Corpus test suite in directory 'DIR'
+ -@ read list of files to compress from stdin
+ -q be quiet
+ -L display software license
+
+
+More about '-m':
+================
+
+Use '-m' to list all available methods.
+
+You can select methods by number:
+-m71
+
+You can select methods by name:
+-mlzo1x-1
+-mlzo1x-999
+-mlzo1x-1(11)
+
+You can select some predefined method groups:
+-mall
+-mlzo
+-mm1
+-mm99
+-mm999
+-m1x999
+-m1y999
+
+You can specify multiple methods/groups separated by ',':
+-m1,2,3,4
+-m1,2,3,4,lzo1x-1,m99,81
+
+And finally you can use multiple '-m' options:
+-m962,972 -mm99,982,m1
+
+
+Other options:
+==============
+
+--max-data-length=LEN
+
+--dict=FILENAME
+--max-dict-length=LEN
+
+--dump=FILENAME
+
+--adler32
+--crc32
+--execution-time
+--totals
+
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/dict.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/dict.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/dict.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/lzopack.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/lzopack.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/lzopack.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/overlap.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/overlap.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/overlap.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/precomp.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/precomp.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/precomp.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/precomp2.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/precomp2.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/precomp2.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/.deps/simple.Po b/ics-openvpn-stripped/main/lzo/examples/.deps/simple.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/.deps/simple.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/examples/Makefile.am b/ics-openvpn-stripped/main/lzo/examples/Makefile.am
new file mode 100644
index 00000000..2c5b527e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/Makefile.am
@@ -0,0 +1,21 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+
+noinst_PROGRAMS = dict lzopack overlap precomp precomp2 simple
+
+dict_SOURCES = dict.c
+lzopack_SOURCES = lzopack.c
+overlap_SOURCES = overlap.c
+precomp_SOURCES = precomp.c
+precomp2_SOURCES = precomp2.c
+simple_SOURCES = simple.c
+
+LDADD = ../src/liblzo2.la
+DEPENDENCIES = ../src/liblzo2.la
+
+EXTRA_DIST = portab.h portab_a.h
+
diff --git a/ics-openvpn-stripped/main/lzo/examples/Makefile.in b/ics-openvpn-stripped/main/lzo/examples/Makefile.in
new file mode 100644
index 00000000..4199078b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/Makefile.in
@@ -0,0 +1,491 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+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@
+noinst_PROGRAMS = dict$(EXEEXT) lzopack$(EXEEXT) overlap$(EXEEXT) \
+ precomp$(EXEEXT) precomp2$(EXEEXT) simple$(EXEEXT)
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_dict_OBJECTS = dict.$(OBJEXT)
+dict_OBJECTS = $(am_dict_OBJECTS)
+dict_LDADD = $(LDADD)
+dict_DEPENDENCIES = ../src/liblzo2.la
+am_lzopack_OBJECTS = lzopack.$(OBJEXT)
+lzopack_OBJECTS = $(am_lzopack_OBJECTS)
+lzopack_LDADD = $(LDADD)
+lzopack_DEPENDENCIES = ../src/liblzo2.la
+am_overlap_OBJECTS = overlap.$(OBJEXT)
+overlap_OBJECTS = $(am_overlap_OBJECTS)
+overlap_LDADD = $(LDADD)
+overlap_DEPENDENCIES = ../src/liblzo2.la
+am_precomp_OBJECTS = precomp.$(OBJEXT)
+precomp_OBJECTS = $(am_precomp_OBJECTS)
+precomp_LDADD = $(LDADD)
+precomp_DEPENDENCIES = ../src/liblzo2.la
+am_precomp2_OBJECTS = precomp2.$(OBJEXT)
+precomp2_OBJECTS = $(am_precomp2_OBJECTS)
+precomp2_LDADD = $(LDADD)
+precomp2_DEPENDENCIES = ../src/liblzo2.la
+am_simple_OBJECTS = simple.$(OBJEXT)
+simple_OBJECTS = $(am_simple_OBJECTS)
+simple_LDADD = $(LDADD)
+simple_DEPENDENCIES = ../src/liblzo2.la
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(dict_SOURCES) $(lzopack_SOURCES) $(overlap_SOURCES) \
+ $(precomp_SOURCES) $(precomp2_SOURCES) $(simple_SOURCES)
+DIST_SOURCES = $(dict_SOURCES) $(lzopack_SOURCES) $(overlap_SOURCES) \
+ $(precomp_SOURCES) $(precomp2_SOURCES) $(simple_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+dict_SOURCES = dict.c
+lzopack_SOURCES = lzopack.c
+overlap_SOURCES = overlap.c
+precomp_SOURCES = precomp.c
+precomp2_SOURCES = precomp2.c
+simple_SOURCES = simple.c
+LDADD = ../src/liblzo2.la
+DEPENDENCIES = ../src/liblzo2.la
+EXTRA_DIST = portab.h portab_a.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu examples/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu examples/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+dict$(EXEEXT): $(dict_OBJECTS) $(dict_DEPENDENCIES)
+ @rm -f dict$(EXEEXT)
+ $(LINK) $(dict_LDFLAGS) $(dict_OBJECTS) $(dict_LDADD) $(LIBS)
+lzopack$(EXEEXT): $(lzopack_OBJECTS) $(lzopack_DEPENDENCIES)
+ @rm -f lzopack$(EXEEXT)
+ $(LINK) $(lzopack_LDFLAGS) $(lzopack_OBJECTS) $(lzopack_LDADD) $(LIBS)
+overlap$(EXEEXT): $(overlap_OBJECTS) $(overlap_DEPENDENCIES)
+ @rm -f overlap$(EXEEXT)
+ $(LINK) $(overlap_LDFLAGS) $(overlap_OBJECTS) $(overlap_LDADD) $(LIBS)
+precomp$(EXEEXT): $(precomp_OBJECTS) $(precomp_DEPENDENCIES)
+ @rm -f precomp$(EXEEXT)
+ $(LINK) $(precomp_LDFLAGS) $(precomp_OBJECTS) $(precomp_LDADD) $(LIBS)
+precomp2$(EXEEXT): $(precomp2_OBJECTS) $(precomp2_DEPENDENCIES)
+ @rm -f precomp2$(EXEEXT)
+ $(LINK) $(precomp2_LDFLAGS) $(precomp2_OBJECTS) $(precomp2_LDADD) $(LIBS)
+simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES)
+ @rm -f simple$(EXEEXT)
+ $(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzopack.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overlap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@
+
+.c.o:
+@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@ 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@ 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 $@ $<
+
+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)
+ @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 $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+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 clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -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:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS 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-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
+
+# 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/ics-openvpn-stripped/main/lzo/examples/dict.c b/ics-openvpn-stripped/main/lzo/examples/dict.c
new file mode 100644
index 00000000..3ccc9a53
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/dict.c
@@ -0,0 +1,274 @@
+/* dict.c -- example program: how to use preset dictionaries
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// This program shows how to use preset dictionaries.
+//
+// Please study LZO.FAQ and simple.c first.
+**************************************************************************/
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+#define DICT_LEN 0xbfff
+static lzo_bytep dict;
+static lzo_uint dict_len = 0;
+static lzo_uint32_t dict_adler32;
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+static lzo_uint total_n = 0;
+static lzo_uint total_c_len = 0;
+static lzo_uint total_d_len = 0;
+
+static void print_info(const char *name, lzo_uint d_len, lzo_uint c_len)
+{
+ double perc;
+
+ perc = (d_len > 0) ? c_len * 100.0 / d_len : 0.0;
+ printf(" | %-30s %9ld -> %9ld %7.2f%% |\n",
+ name, (long) d_len, (long) c_len, perc);
+
+ total_n++;
+ total_c_len += c_len;
+ total_d_len += d_len;
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+static int do_file(const char *in_name, int compression_level)
+{
+ int r;
+ lzo_bytep in;
+ lzo_bytep out;
+ lzo_bytep newb;
+ lzo_voidp wrkmem;
+ lzo_uint in_len;
+ lzo_uint out_len;
+ lzo_uint new_len;
+ long l;
+ FILE *fp;
+
+/*
+ * Step 1: open the input file
+ */
+ fp = fopen(in_name,"rb");
+ if (fp == NULL)
+ {
+ printf("%s: %s: cannot open file\n", progname, in_name);
+ return 0; /* no error */
+ }
+ fseek(fp, 0, SEEK_END);
+ l = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ if (l <= 0)
+ {
+ printf("%s: %s: empty file -- skipping\n", progname, in_name);
+ fclose(fp); fp = NULL;
+ return 0; /* no error */
+ }
+ in_len = (lzo_uint) l;
+ if ((long) in_len != l || l > 256L * 1024L * 1024L)
+ {
+ printf("%s: %s: file is too big -- skipping\n", progname, in_name);
+ fclose(fp); fp = NULL;
+ return 0; /* no error */
+ }
+
+/*
+ * Step 2: allocate compression buffers and read the file
+ */
+ in = (lzo_bytep) xmalloc(in_len);
+ out = (lzo_bytep) xmalloc(in_len + in_len / 16 + 64 + 3);
+ newb = (lzo_bytep) xmalloc(in_len);
+ wrkmem = (lzo_voidp) xmalloc(LZO1X_999_MEM_COMPRESS);
+ if (in == NULL || out == NULL || newb == NULL || wrkmem == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+ in_len = (lzo_uint) lzo_fread(fp, in, in_len);
+ fclose(fp); fp = NULL;
+
+/*
+ * Step 3: compress from 'in' to 'out' with LZO1X-999
+ */
+ r = lzo1x_999_compress_level(in,in_len,out,&out_len,wrkmem,
+ dict, dict_len, 0, compression_level);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ return 1;
+ }
+
+ print_info(in_name, in_len, out_len);
+
+/*
+ * Step 4: decompress again, now going from 'out' to 'newb'
+ */
+ new_len = in_len;
+ r = lzo1x_decompress_dict_safe(out, out_len, newb, &new_len, NULL, dict, dict_len);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression failed: %d\n", r);
+ return 1;
+ }
+
+/*
+ * Step 5: verify decompression
+ */
+ if (new_len != in_len || lzo_memcmp(in, newb, in_len) != 0)
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression data error\n");
+ return 1;
+ }
+
+ /* free buffers in reverse order to help malloc() */
+ lzo_free(wrkmem);
+ lzo_free(newb);
+ lzo_free(out);
+ lzo_free(in);
+ return 0;
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int i = 1;
+ int r = 0;
+ const char *dict_name;
+ FILE *fp;
+ time_t t_total;
+ int compression_level = 7;
+
+ lzo_wildargv(&argc, &argv);
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+ progname = argv[0];
+
+ if (i < argc && argv[i][0] == '-' && isdigit(argv[i][1]))
+ compression_level = atoi(&argv[i++][1]);
+
+ if (i + 1 >= argc || compression_level < 1 || compression_level > 9)
+ {
+ printf("usage: %s [-level] [ dictionary-file | -n ] file...\n", progname);
+ exit(1);
+ }
+ printf("Compression level is LZO1X-999/%d\n", compression_level);
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+/*
+ * Step 2: prepare the dictionary
+ */
+ dict = (lzo_bytep) xmalloc(DICT_LEN);
+ if (dict == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+ dict_name = argv[i++];
+ if (strcmp(dict_name,"-n") == 0)
+ {
+ dict_name = "empty";
+ dict_len = 0;
+ }
+ else
+ {
+ fp = fopen(dict_name,"rb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open dictionary file %s\n", progname, dict_name);
+ exit(1);
+ }
+ dict_len = (lzo_uint) lzo_fread(fp, dict, DICT_LEN);
+ fclose(fp); fp = NULL;
+ }
+
+ dict_adler32 = lzo_adler32(0, NULL, 0);
+ dict_adler32 = lzo_adler32(dict_adler32, dict, dict_len);
+ printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n",
+ dict_name, (long) dict_len, (unsigned long) dict_adler32);
+
+/*
+ * Step 3: process files
+ */
+ t_total = time(NULL);
+ for ( ; i < argc; i++) {
+ if (do_file(argv[i], compression_level) != 0) {
+ r = 1;
+ break;
+ }
+ }
+ t_total = time(NULL) - t_total;
+
+ lzo_free(dict);
+
+ if (total_n > 1)
+ print_info("***TOTALS***", total_d_len, total_c_len);
+
+ printf("Dictionary compression test %s, execution time %lu seconds.\n",
+ r == 0 ? "passed" : "FAILED", (unsigned long) t_total);
+ return r;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/lzopack.c b/ics-openvpn-stripped/main/lzo/examples/lzopack.c
new file mode 100644
index 00000000..10e2c1dc
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/lzopack.c
@@ -0,0 +1,628 @@
+/* lzopack.c -- LZO example program: a simple file packer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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: this is an example program, so do not use to backup your data.
+//
+// This program lacks things like sophisticated file handling but is
+// pretty complete regarding compression - it should provide a good
+// starting point for adaption for your applications.
+//
+// Please study LZO.FAQ and simple.c first.
+**************************************************************************/
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+static unsigned long total_in = 0;
+static unsigned long total_out = 0;
+static lzo_bool opt_debug = 0;
+
+/* magic file header for lzopack-compressed files */
+static const unsigned char magic[7] =
+ { 0x00, 0xe9, 0x4c, 0x5a, 0x4f, 0xff, 0x1a };
+
+
+/*************************************************************************
+// file IO
+**************************************************************************/
+
+static lzo_uint xread(FILE *fp, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
+{
+ lzo_uint l;
+
+ l = (lzo_uint) lzo_fread(fp, buf, len);
+ if (l > len)
+ {
+ fprintf(stderr, "\nsomething's wrong with your C library !!!\n");
+ exit(1);
+ }
+ if (l != len && !allow_eof)
+ {
+ fprintf(stderr, "\nread error - premature end of file\n");
+ exit(1);
+ }
+ total_in += (unsigned long) l;
+ return l;
+}
+
+static lzo_uint xwrite(FILE *fp, const lzo_voidp buf, lzo_uint len)
+{
+ if (fp != NULL && lzo_fwrite(fp, buf, len) != len)
+ {
+ fprintf(stderr, "\nwrite error (disk full ?)\n");
+ exit(1);
+ }
+ total_out += (unsigned long) len;
+ return len;
+}
+
+
+static int xgetc(FILE *fp)
+{
+ unsigned char c;
+ xread(fp, (lzo_voidp) &c, 1, 0);
+ return c;
+}
+
+static void xputc(FILE *fp, int c)
+{
+ unsigned char cc = (unsigned char) (c & 0xff);
+ xwrite(fp, (const lzo_voidp) &cc, 1);
+}
+
+/* read and write portable 32-bit integers */
+
+static lzo_uint32_t xread32(FILE *fp)
+{
+ unsigned char b[4];
+ lzo_uint32_t v;
+
+ xread(fp, b, 4, 0);
+ v = (lzo_uint32_t) b[3] << 0;
+ v |= (lzo_uint32_t) b[2] << 8;
+ v |= (lzo_uint32_t) b[1] << 16;
+ v |= (lzo_uint32_t) b[0] << 24;
+ return v;
+}
+
+static void xwrite32(FILE *fp, lzo_xint v)
+{
+ unsigned char b[4];
+
+ b[3] = (unsigned char) ((v >> 0) & 0xff);
+ b[2] = (unsigned char) ((v >> 8) & 0xff);
+ b[1] = (unsigned char) ((v >> 16) & 0xff);
+ b[0] = (unsigned char) ((v >> 24) & 0xff);
+ xwrite(fp, b, 4);
+}
+
+
+/*************************************************************************
+// compress
+//
+// possible improvement: we could use overlapping compression to
+// save some memory - see overlap.c. This would require some minor
+// changes in the decompression code as well, because if a block
+// turns out to be incompressible we would still have to store it in its
+// "compressed" (i.e. then slightly enlarged) form because the original
+// (uncompressed) data would have been lost during the overlapping
+// compression.
+**************************************************************************/
+
+static int do_compress(FILE *fi, FILE *fo, int compression_level, lzo_uint block_size)
+{
+ int r = 0;
+ lzo_bytep in = NULL;
+ lzo_bytep out = NULL;
+ lzo_voidp wrkmem = NULL;
+ lzo_uint in_len;
+ lzo_uint out_len;
+ lzo_uint wrkmem_size;
+ lzo_uint32_t flags = 1; /* do compute a checksum */
+ int method = 1; /* compression method: LZO1X */
+ lzo_uint32_t checksum;
+
+ total_in = total_out = 0;
+
+/*
+ * Step 1: write magic header, flags & block size, init checksum
+ */
+ xwrite(fo, magic, sizeof(magic));
+ xwrite32(fo, flags);
+ xputc(fo, method); /* compression method */
+ xputc(fo, compression_level); /* compression level */
+ xwrite32(fo, block_size);
+ checksum = lzo_adler32(0, NULL, 0);
+
+/*
+ * Step 2: allocate compression buffers and work-memory
+ */
+ in = (lzo_bytep) xmalloc(block_size);
+ out = (lzo_bytep) xmalloc(block_size + block_size / 16 + 64 + 3);
+ if (compression_level == 9)
+ wrkmem_size = LZO1X_999_MEM_COMPRESS;
+ else
+ wrkmem_size = LZO1X_1_MEM_COMPRESS;
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
+ if (in == NULL || out == NULL || wrkmem == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ r = 1;
+ goto err;
+ }
+
+/*
+ * Step 3: process blocks
+ */
+ for (;;)
+ {
+ /* read block */
+ in_len = xread(fi, in, block_size, 1);
+ if (in_len == 0)
+ break;
+
+ /* update checksum */
+ if (flags & 1)
+ checksum = lzo_adler32(checksum, in, in_len);
+
+ /* clear wrkmem (not needed, only for debug/benchmark purposes) */
+ if (opt_debug)
+ lzo_memset(wrkmem, 0xff, wrkmem_size);
+
+ /* compress block */
+ if (compression_level == 9)
+ r = lzo1x_999_compress(in, in_len, out, &out_len, wrkmem);
+ else
+ r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem);
+ if (r != LZO_E_OK || out_len > in_len + in_len / 16 + 64 + 3)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ r = 2;
+ goto err;
+ }
+
+ /* write uncompressed block size */
+ xwrite32(fo, in_len);
+
+ if (out_len < in_len)
+ {
+ /* write compressed block */
+ xwrite32(fo, out_len);
+ xwrite(fo, out, out_len);
+ }
+ else
+ {
+ /* not compressible - write uncompressed block */
+ xwrite32(fo, in_len);
+ xwrite(fo, in, in_len);
+ }
+ }
+
+ /* write EOF marker */
+ xwrite32(fo, 0);
+
+ /* write checksum */
+ if (flags & 1)
+ xwrite32(fo, checksum);
+
+ r = 0;
+err:
+ lzo_free(wrkmem);
+ lzo_free(out);
+ lzo_free(in);
+ return r;
+}
+
+
+/*************************************************************************
+// decompress / test
+//
+// We are using overlapping (in-place) decompression to save some
+// memory - see overlap.c.
+**************************************************************************/
+
+static int do_decompress(FILE *fi, FILE *fo)
+{
+ int r = 0;
+ lzo_bytep buf = NULL;
+ lzo_uint buf_len;
+ unsigned char m [ sizeof(magic) ];
+ lzo_uint32_t flags;
+ int method;
+ int compression_level;
+ lzo_uint block_size;
+ lzo_uint32_t checksum;
+
+ total_in = total_out = 0;
+
+/*
+ * Step 1: check magic header, read flags & block size, init checksum
+ */
+ if (xread(fi, m, sizeof(magic),1) != sizeof(magic) ||
+ memcmp(m, magic, sizeof(magic)) != 0)
+ {
+ printf("%s: header error - this file is not compressed by lzopack\n", progname);
+ r = 1;
+ goto err;
+ }
+ flags = xread32(fi);
+ method = xgetc(fi);
+ compression_level = xgetc(fi);
+ if (method != 1)
+ {
+ printf("%s: header error - invalid method %d (level %d)\n",
+ progname, method, compression_level);
+ r = 2;
+ goto err;
+ }
+ block_size = xread32(fi);
+ if (block_size < 1024 || block_size > 8L * 1024L * 1024L)
+ {
+ printf("%s: header error - invalid block size %ld\n",
+ progname, (long) block_size);
+ r = 3;
+ goto err;
+ }
+ checksum = lzo_adler32(0,NULL,0);
+
+/*
+ * Step 2: allocate buffer for in-place decompression
+ */
+ buf_len = block_size + block_size / 16 + 64 + 3;
+ buf = (lzo_bytep) xmalloc(buf_len);
+ if (buf == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ r = 4;
+ goto err;
+ }
+
+/*
+ * Step 3: process blocks
+ */
+ for (;;)
+ {
+ lzo_bytep in;
+ lzo_bytep out;
+ lzo_uint in_len;
+ lzo_uint out_len;
+
+ /* read uncompressed size */
+ out_len = xread32(fi);
+
+ /* exit if last block (EOF marker) */
+ if (out_len == 0)
+ break;
+
+ /* read compressed size */
+ in_len = xread32(fi);
+
+ /* sanity check of the size values */
+ if (in_len > block_size || out_len > block_size ||
+ in_len == 0 || in_len > out_len)
+ {
+ printf("%s: block size error - data corrupted\n", progname);
+ r = 5;
+ goto err;
+ }
+
+ /* place compressed block at the top of the buffer */
+ in = buf + buf_len - in_len;
+ out = buf;
+
+ /* read compressed block data */
+ xread(fi, in, in_len, 0);
+
+ if (in_len < out_len)
+ {
+ /* decompress - use safe decompressor as data might be corrupted
+ * during a file transfer */
+ lzo_uint new_len = out_len;
+
+ r = lzo1x_decompress_safe(in, in_len, out, &new_len, NULL);
+ if (r != LZO_E_OK || new_len != out_len)
+ {
+ printf("%s: compressed data violation\n", progname);
+ r = 6;
+ goto err;
+ }
+ /* write decompressed block */
+ xwrite(fo, out, out_len);
+ /* update checksum */
+ if (flags & 1)
+ checksum = lzo_adler32(checksum, out, out_len);
+ }
+ else
+ {
+ /* write original (incompressible) block */
+ xwrite(fo, in, in_len);
+ /* update checksum */
+ if (flags & 1)
+ checksum = lzo_adler32(checksum, in, in_len);
+ }
+ }
+
+ /* read and verify checksum */
+ if (flags & 1)
+ {
+ lzo_uint32_t c = xread32(fi);
+ if (c != checksum)
+ {
+ printf("%s: checksum error - data corrupted\n", progname);
+ r = 7;
+ goto err;
+ }
+ }
+
+ r = 0;
+err:
+ lzo_free(buf);
+ return r;
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+static void usage(void)
+{
+ printf("usage: %s [-9] input-file output-file (compress)\n", progname);
+ printf("usage: %s -d input-file output-file (decompress)\n", progname);
+ printf("usage: %s -t input-file... (test)\n", progname);
+ exit(1);
+}
+
+
+/* open input file */
+static FILE *xopen_fi(const char *name)
+{
+ FILE *fp;
+
+ fp = fopen(name, "rb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open input file %s\n", progname, name);
+ exit(1);
+ }
+#if defined(HAVE_STAT) && defined(S_ISREG)
+ {
+ struct stat st;
+ int is_regular = 1;
+ if (stat(name, &st) != 0 || !S_ISREG(st.st_mode))
+ is_regular = 0;
+ if (!is_regular)
+ {
+ printf("%s: %s is not a regular file\n", progname, name);
+ fclose(fp); fp = NULL;
+ exit(1);
+ }
+ }
+#endif
+ return fp;
+}
+
+
+/* open output file */
+static FILE *xopen_fo(const char *name)
+{
+ FILE *fp;
+
+#if 0
+ /* this is an example program, so make sure we don't overwrite a file */
+ fp = fopen(name, "rb");
+ if (fp != NULL)
+ {
+ printf("%s: file %s already exists -- not overwritten\n", progname, name);
+ fclose(fp); fp = NULL;
+ exit(1);
+ }
+#endif
+ fp = fopen(name, "wb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open output file %s\n", progname, name);
+ exit(1);
+ }
+ return fp;
+}
+
+
+/* close file */
+static void xclose(FILE *fp)
+{
+ if (fp)
+ {
+ int err;
+ err = ferror(fp);
+ if (fclose(fp) != 0)
+ err = 1;
+ if (err)
+ {
+ printf("%s: error while closing file\n", progname);
+ exit(1);
+ }
+ }
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int i = 1;
+ int r = 0;
+ FILE *fi = NULL;
+ FILE *fo = NULL;
+ const char *in_name = NULL;
+ const char *out_name = NULL;
+ unsigned opt_decompress = 0;
+ unsigned opt_test = 0;
+ int opt_compression_level = 1;
+ lzo_uint opt_block_size;
+ const char *s;
+
+ lzo_wildargv(&argc, &argv);
+
+ progname = argv[0];
+ for (s = progname; *s; s++)
+ if ((*s == '/' || *s == '\\') && s[1])
+ progname = s + 1;
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+#if 0
+ printf(
+"*** DISCLAIMER ***\n"
+" This is an example program, do not use to backup your data !\n"
+" Get LZOP if you're interested into a full-featured packer.\n"
+" See http://www.oberhumer.com/opensource/lzop/\n"
+"\n");
+#endif
+
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+
+/*
+ * Step 2: setup memory
+ */
+ opt_block_size = 256 * 1024L;
+
+#if defined(LZO_MM_AHSHIFT)
+ /* reduce memory requirements for ancient 16-bit DOS 640kB real-mode */
+ if (LZO_MM_AHSHIFT != 3)
+ opt_block_size = 16 * 1024L;
+#endif
+
+
+/*
+ * Step 3: get options
+ */
+
+ while (i < argc && argv[i][0] == '-')
+ {
+ if (strcmp(argv[i],"-d") == 0)
+ opt_decompress = 1;
+ else if (strcmp(argv[i],"-t") == 0)
+ opt_test = 1;
+ else if (strcmp(argv[i],"-9") == 0)
+ opt_compression_level = 9;
+ else if (argv[i][1] == 'b' && argv[i][2])
+ {
+ long b = atol(&argv[i][2]);
+ if (b >= 1024L && b <= 8*1024*1024L)
+ opt_block_size = (lzo_uint) b;
+ else
+ {
+ printf("%s: invalid block_size in option '%s'.\n", progname, argv[i]);
+ usage();
+ }
+ }
+ else if (strcmp(argv[i],"--debug") == 0)
+ opt_debug += 1;
+ else
+ usage();
+ i++;
+ }
+ if (opt_test && i >= argc)
+ usage();
+ if (!opt_test && i + 2 != argc)
+ usage();
+
+
+/*
+ * Step 4: process file(s)
+ */
+
+ if (opt_test)
+ {
+ while (i < argc && r == 0)
+ {
+ in_name = argv[i++];
+ fi = xopen_fi(in_name);
+ r = do_decompress(fi, NULL);
+ if (r == 0)
+ printf("%s: %s tested ok (%lu -> %lu bytes)\n",
+ progname, in_name, total_in, total_out);
+ xclose(fi); fi = NULL;
+ }
+ }
+ else if (opt_decompress)
+ {
+ in_name = argv[i++];
+ out_name = argv[i++];
+ fi = xopen_fi(in_name);
+ fo = xopen_fo(out_name);
+ r = do_decompress(fi, fo);
+ if (r == 0)
+ printf("%s: decompressed %lu into %lu bytes\n",
+ progname, total_in, total_out);
+ }
+ else /* compress */
+ {
+ in_name = argv[i++];
+ out_name = argv[i++];
+ fi = xopen_fi(in_name);
+ fo = xopen_fo(out_name);
+ r = do_compress(fi, fo, opt_compression_level, opt_block_size);
+ if (r == 0)
+ printf("%s: compressed %lu into %lu bytes\n",
+ progname, total_in, total_out);
+ }
+
+ xclose(fi); fi = NULL;
+ xclose(fo); fo = NULL;
+ return r;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/overlap.c b/ics-openvpn-stripped/main/lzo/examples/overlap.c
new file mode 100644
index 00000000..114fe3b4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/overlap.c
@@ -0,0 +1,302 @@
+/* overlap.c -- example program: overlapping (de)compression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// This program shows how to do overlapping compression and
+// in-place decompression.
+//
+// Please study LZO.FAQ and simple.c first.
+**************************************************************************/
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+/* Overhead (in bytes) for the in-place decompression buffer.
+ * Most files need only 16 !
+ * (try 'overlap -16 file' or even 'overlap -8 file')
+ *
+ * Worst case (for files that are compressible by only a few bytes)
+ * is 'in_len / 16 + 64 + 3'. See step 5a) below.
+ *
+ * For overlapping compression '0xbfff + in_len / 16 + 64 + 3' bytes
+ * will be needed. See step 4a) below.
+ */
+
+static long opt_overhead = 0; /* assume worst case */
+
+static unsigned long total_files = 0;
+static unsigned long total_in = 0;
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+static int do_file(const char *in_name)
+{
+ int r;
+ FILE *fp = NULL;
+ long l;
+
+ lzo_voidp wrkmem = NULL;
+
+ lzo_bytep in = NULL;
+ lzo_uint in_len; /* uncompressed length */
+
+ lzo_bytep out = NULL;
+ lzo_uint out_len; /* compressed length */
+
+ lzo_bytep overlap = NULL;
+ lzo_uint overhead;
+ lzo_uint offset;
+
+ lzo_uint new_len = 0;
+
+/*
+ * Step 1: open the input file
+ */
+ fp = fopen(in_name, "rb");
+ if (fp == NULL)
+ {
+ printf("%s: %s: cannot open file\n", progname, in_name);
+ goto next_file;
+ }
+ fseek(fp, 0, SEEK_END);
+ l = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ if (l <= 0)
+ {
+ printf("%s: %s: empty file -- skipping\n", progname, in_name);
+ goto next_file;
+ }
+ in_len = (lzo_uint) l;
+ if ((long) in_len != l || l > 256L * 1024L * 1024L)
+ {
+ printf("%s: %s: file is too big -- skipping\n", progname, in_name);
+ goto next_file;
+ }
+
+/*
+ * Step 2: allocate compression buffers and read the file
+ */
+ in = (lzo_bytep) xmalloc(in_len);
+ out = (lzo_bytep) xmalloc(in_len + in_len / 16 + 64 + 3);
+ wrkmem = (lzo_voidp) xmalloc(LZO1X_1_MEM_COMPRESS);
+ in_len = (lzo_uint) lzo_fread(fp, in, in_len);
+ fclose(fp); fp = NULL;
+ printf("%s: %s: read %lu bytes\n", progname, in_name, (unsigned long) in_len);
+
+ total_files++;
+ total_in += (unsigned long) in_len;
+
+/*
+ * Step 3: compress from 'in' to 'out' with LZO1X-1
+ */
+ r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem);
+ if (r != LZO_E_OK || out_len > in_len + in_len / 16 + 64 + 3)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ exit(1);
+ }
+ printf("%-25s %8lu -> %8lu\n", "LZO1X-1:", (unsigned long) in_len, (unsigned long) out_len);
+
+
+/***** Step 4: overlapping compression *****/
+
+/*
+ * Step 4a: allocate the 'overlap' buffer for overlapping compression
+ */
+ overhead = in_len > 0xbfff ? 0xbfff : in_len;
+ overhead += in_len / 16 + 64 + 3;
+ overlap = (lzo_bytep) xmalloc(in_len + overhead);
+
+/*
+ * Step 4b: prepare data in 'overlap' buffer.
+ * copy uncompressed data at the top of the overlap buffer
+ */
+ /*** offset = in_len + overhead - in_len; ***/
+ offset = overhead;
+ lzo_memcpy(overlap + offset, in, in_len);
+
+/*
+ * Step 4c: do an in-place compression within the 'overlap' buffer
+ */
+ r = lzo1x_1_compress(overlap + offset, in_len, overlap, &new_len, wrkmem);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("in-place compression failed: %d\n", r);
+ exit(1);
+ }
+
+/*
+ * Step 4d: verify overlapping compression
+ */
+ if (new_len != out_len || lzo_memcmp(out, overlap, out_len) != 0)
+ {
+ /* As compression is non-deterministic there can be a difference
+ * in the representation of the compressed data (but this usually
+ * happens very seldom). So we have to verify the overlapping
+ * compression by doing a temporary decompression.
+ */
+ lzo_uint ll = in_len;
+ lzo_bytep tmp = (lzo_bytep) xmalloc(ll);
+ r = lzo1x_decompress_safe(overlap, new_len, tmp, &ll, NULL);
+ if (r != LZO_E_OK || ll != in_len || lzo_memcmp(in, tmp, ll) != 0)
+ {
+ /* this should NEVER happen */
+ printf("in-place compression data error\n");
+ exit(1);
+ }
+ lzo_free(tmp);
+ }
+
+ printf(" in-place compression: %8lu -> %8lu overhead: %7lu\n",
+ (unsigned long) in_len, (unsigned long) new_len, (unsigned long) overhead);
+ lzo_free(overlap); overlap = NULL;
+
+
+/***** Step 5: in-place decompression *****/
+
+/*
+ * Step 5a: allocate the 'overlap' buffer for in-place decompression
+ */
+ if (opt_overhead == 0 || out_len >= in_len)
+ overhead = in_len / 16 + 64 + 3;
+ else
+ overhead = (lzo_uint) opt_overhead;
+ overlap = (lzo_bytep) xmalloc(in_len + overhead);
+
+/*
+ * Step 5b: prepare data in 'overlap' buffer.
+ * copy compressed data at the top of the overlap buffer
+ */
+ offset = in_len + overhead - out_len;
+ lzo_memcpy(overlap + offset, out, out_len);
+
+/*
+ * Step 5c: do an in-place decompression within the 'overlap' buffer
+ */
+ new_len = in_len;
+ r = lzo1x_decompress_safe(overlap + offset, out_len, overlap, &new_len, NULL);
+ if (r != LZO_E_OK)
+ {
+ /* this may happen if overhead is too small */
+ printf("in-place decompression failed: %d - increase 'opt_overhead'\n", r);
+ exit(1);
+ }
+
+/*
+ * Step 5d: verify decompression
+ */
+ if (new_len != in_len || lzo_memcmp(in, overlap, in_len) != 0)
+ {
+ /* this may happen if overhead is too small */
+ printf("in-place decompression data error - increase 'opt_overhead'\n");
+ exit(1);
+ }
+ printf(" in-place decompression: %8lu -> %8lu overhead: %7lu\n",
+ (unsigned long) out_len, (unsigned long) new_len, (unsigned long) overhead);
+ lzo_free(overlap); overlap = NULL;
+
+
+next_file:
+ lzo_free(overlap);
+ lzo_free(wrkmem);
+ lzo_free(out);
+ lzo_free(in);
+ if (fp) fclose(fp);
+
+ return 0;
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int r;
+ int i = 1;
+
+ lzo_wildargv(&argc, &argv);
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+ progname = argv[0];
+ if (i < argc && argv[i][0] == '-')
+ opt_overhead = atol(&argv[i++][1]);
+#if 1
+ if (opt_overhead != 0 && opt_overhead < 4)
+ {
+ printf("%s: invalid overhead value %ld\n", progname, opt_overhead);
+ exit(1);
+ }
+#endif
+ if (i >= argc)
+ {
+ printf("usage: %s [-overhead_in_bytes] file..\n", progname);
+ exit(1);
+ }
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+/*
+ * Step 2: process files
+ */
+ for (r = 0; r == 0 && i < argc; i++)
+ r = do_file(argv[i]);
+
+ printf("\nDone. Successfully processed %lu bytes in %lu files.\n",
+ total_in, total_files);
+ return r;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/portab.h b/ics-openvpn-stripped/main/lzo/examples/portab.h
new file mode 100644
index 00000000..d8217ed3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/portab.h
@@ -0,0 +1,141 @@
+/* portab.h -- portability layer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo/lzoconf.h"
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1200))
+ /* avoid '-W4' warnings in system header files */
+# pragma warning(disable: 4201 4214 4514)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+ /* avoid '-Wall' warnings in system header files */
+# pragma warning(disable: 4163 4255 4820)
+ /* avoid warnings about inlining */
+# pragma warning(disable: 4710 4711)
+#endif
+/* disable silly warnings about using "deprecated" POSIX functions like "fopen" */
+#if (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1100))
+# pragma warning(disable: 1786)
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1000))
+# pragma warning(disable: 1478)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# pragma warning(disable: 4996)
+#endif
+#if (LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(disable:2002)
+#endif
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+#if defined(LZO_WANT_ACCLIB_GETOPT) || !(defined(LZO_LIBC_ISOC90) || defined(LZO_LIBC_ISOC99))
+
+#include "examples/portab_a.h"
+
+#else
+
+/* On any halfway modern machine we can use the following pure ANSI-C code. */
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#if defined(CLK_TCK) && !defined(CLOCKS_PER_SEC)
+# define CLOCKS_PER_SEC CLK_TCK
+#endif
+
+#if defined(WANT_LZO_MALLOC)
+# define lzo_malloc(a) (malloc(a))
+# define lzo_free(a) (free(a))
+#endif
+#if defined(WANT_LZO_FREAD)
+# define lzo_fread(f,b,s) (fread(b,1,s,f))
+# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
+#endif
+#if defined(WANT_LZO_PCLOCK)
+# define lzo_pclock_handle_t int
+# define lzo_pclock_t double
+# define lzo_pclock_open_default(a) ((void)(a))
+# define lzo_pclock_close(a) ((void)(a))
+# define lzo_pclock_read(a,b) *(b) = (clock() / (double)(CLOCKS_PER_SEC))
+# define lzo_pclock_get_elapsed(a,b,c) (*(c) - *(b))
+# define lzo_pclock_flush_cpu_cache(a,b) ((void)(a))
+#endif
+#if defined(WANT_LZO_WILDARGV)
+# define lzo_wildargv(a,b) ((void)0)
+#endif
+
+#endif
+
+
+/*************************************************************************
+// misc
+**************************************************************************/
+
+/* turn on assertions */
+#undef NDEBUG
+#include <assert.h>
+
+/* just in case */
+#undef xmalloc
+#undef xfree
+#undef xread
+#undef xwrite
+#undef xputc
+#undef xgetc
+#undef xread32
+#undef xwrite32
+
+
+#if defined(WANT_XMALLOC)
+static lzo_voidp xmalloc(lzo_uint len)
+{
+ lzo_voidp p;
+ lzo_uint align = (lzo_uint) sizeof(lzo_align_t);
+
+ p = (lzo_voidp) lzo_malloc(len > 0 ? len : 1);
+ if (p == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+ if (len >= align && __lzo_align_gap(p, align) != 0)
+ {
+ printf("%s: C library problem: malloc() returned misaligned pointer!\n", progname);
+ exit(1);
+ }
+ return p;
+}
+#endif
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/portab_a.h b/ics-openvpn-stripped/main/lzo/examples/portab_a.h
new file mode 100644
index 00000000..a3fbec90
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/portab_a.h
@@ -0,0 +1,61 @@
+/* portab_a.h -- advanced portability layer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+#if defined(LZO_HAVE_CONFIG_H)
+# define LZO_CFG_NO_CONFIG_HEADER 1
+#endif
+
+#define LZO_WANT_ACC_INCD_H 1
+#define LZO_WANT_ACC_INCE_H 1
+#if defined(LZO_WANT_ACCLIB_GETOPT) || defined(WANT_LZO_PCLOCK) || defined(WANT_LZO_WILDARGV)
+# define LZO_WANT_ACC_INCI_H 1
+# define LZO_WANT_ACC_LIB_H 1
+#endif
+#if defined(WANT_LZO_PCLOCK)
+# define LZO_WANT_ACCLIB_PCLOCK 1
+#endif
+#if defined(WANT_LZO_WILDARGV)
+# define LZO_WANT_ACCLIB_WILDARGV 1
+#endif
+#include "src/lzo_supp.h"
+
+#if defined(WANT_LZO_MALLOC)
+# define lzo_malloc(a) (malloc(a))
+# define lzo_free(a) (free(a))
+#endif
+#if defined(WANT_LZO_FREAD)
+# define lzo_fread(f,b,s) (fread(b,1,s,f))
+# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
+#endif
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/precomp.c b/ics-openvpn-stripped/main/lzo/examples/precomp.c
new file mode 100644
index 00000000..01b1e77f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/precomp.c
@@ -0,0 +1,330 @@
+/* precomp.c -- example program: how to generate pre-compressed data
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// This program shows how to generate pre-compressed data.
+//
+// Please study LZO.FAQ and simple.c first.
+//
+// We will be trying both LZO1X-999 and LZO1Y-999 and choose
+// the algorithm that achieves the best compression ratio.
+**************************************************************************/
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+#include "lzo/lzo1y.h"
+
+#define USE_LZO1X 1
+#define USE_LZO1Y 1
+
+#define PARANOID 1
+
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int r;
+
+ lzo_bytep in;
+ lzo_uint in_len;
+
+ lzo_bytep out;
+ lzo_uint out_bufsize;
+ lzo_uint out_len = 0;
+
+ lzo_voidp wrkmem;
+ lzo_uint wrkmem_size;
+
+ lzo_uint best_len;
+ int best_compress = -1;
+
+ lzo_uint orig_len;
+ lzo_uint32_t uncompressed_checksum;
+ lzo_uint32_t compressed_checksum;
+
+ FILE *fp;
+ const char *in_name = NULL;
+ const char *out_name = NULL;
+ long l;
+
+
+ lzo_wildargv(&argc, &argv);
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+ progname = argv[0];
+ if (argc < 2 || argc > 3)
+ {
+ printf("usage: %s file [output-file]\n", progname);
+ exit(1);
+ }
+ in_name = argv[1];
+ if (argc > 2) out_name = argv[2];
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+/*
+ * Step 2: allocate the work-memory
+ */
+ wrkmem_size = 1;
+#ifdef USE_LZO1X
+ wrkmem_size = (LZO1X_999_MEM_COMPRESS > wrkmem_size) ? LZO1X_999_MEM_COMPRESS : wrkmem_size;
+#endif
+#ifdef USE_LZO1Y
+ wrkmem_size = (LZO1Y_999_MEM_COMPRESS > wrkmem_size) ? LZO1Y_999_MEM_COMPRESS : wrkmem_size;
+#endif
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
+ if (wrkmem == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+
+/*
+ * Step 3: open the input file
+ */
+ fp = fopen(in_name,"rb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open file %s\n", progname, in_name);
+ exit(1);
+ }
+ fseek(fp, 0, SEEK_END);
+ l = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ if (l <= 0)
+ {
+ printf("%s: %s: empty file\n", progname, in_name);
+ fclose(fp); fp = NULL;
+ exit(1);
+ }
+ in_len = (lzo_uint) l;
+ out_bufsize = in_len + in_len / 16 + 64 + 3;
+ best_len = in_len;
+
+/*
+ * Step 4: allocate compression buffers and read the file
+ */
+ in = (lzo_bytep) xmalloc(in_len);
+ out = (lzo_bytep) xmalloc(out_bufsize);
+ if (in == NULL || out == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+ in_len = (lzo_uint) lzo_fread(fp, in, in_len);
+ printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len);
+ fclose(fp); fp = NULL;
+
+/*
+ * Step 5: compute a checksum of the uncompressed data
+ */
+ uncompressed_checksum = lzo_adler32(0,NULL,0);
+ uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len);
+
+/*
+ * Step 6a: compress from 'in' to 'out' with LZO1X-999
+ */
+#ifdef USE_LZO1X
+ out_len = out_bufsize;
+ r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ exit(1);
+ }
+ printf("LZO1X-999: %8lu -> %8lu\n", (unsigned long) in_len, (unsigned long) out_len);
+ if (out_len < best_len)
+ {
+ best_len = out_len;
+ best_compress = 1; /* LZO1X-999 */
+ }
+#endif /* USE_LZO1X */
+
+/*
+ * Step 6b: compress from 'in' to 'out' with LZO1Y-999
+ */
+#ifdef USE_LZO1Y
+ out_len = out_bufsize;
+ r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ exit(1);
+ }
+ printf("LZO1Y-999: %8lu -> %8lu\n", (unsigned long) in_len, (unsigned long) out_len);
+ if (out_len < best_len)
+ {
+ best_len = out_len;
+ best_compress = 2; /* LZO1Y-999 */
+ }
+#endif /* USE_LZO1Y */
+
+/*
+ * Step 7: check if compressible
+ */
+ if (best_len >= in_len)
+ {
+ printf("This file contains incompressible data.\n");
+ return 0;
+ }
+
+/*
+ * Step 8: compress data again using the best compressor found
+ */
+ out_len = out_bufsize;
+ if (best_compress == 1)
+ r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem);
+ else if (best_compress == 2)
+ r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem);
+ else
+ r = -100;
+ assert(r == LZO_E_OK);
+ assert(out_len == best_len);
+
+/*
+ * Step 9: optimize compressed data (compressed data is in 'out' buffer)
+ */
+#if 1
+ /* Optimization does not require any data in the buffer that will
+ * hold the uncompressed data. To prove this, we clear the buffer.
+ */
+ lzo_memset(in,0,in_len);
+#endif
+
+ orig_len = in_len;
+ r = -100;
+#ifdef USE_LZO1X
+ if (best_compress == 1)
+ r = lzo1x_optimize(out,out_len,in,&orig_len,NULL);
+#endif
+#ifdef USE_LZO1Y
+ if (best_compress == 2)
+ r = lzo1y_optimize(out,out_len,in,&orig_len,NULL);
+#endif
+ if (r != LZO_E_OK || orig_len != in_len)
+ {
+ /* this should NEVER happen */
+ printf("internal error - optimization failed: %d\n", r);
+ exit(1);
+ }
+
+/*
+ * Step 10: compute a checksum of the compressed data
+ */
+ compressed_checksum = lzo_adler32(0,NULL,0);
+ compressed_checksum = lzo_adler32(compressed_checksum,out,out_len);
+
+/*
+ * Step 11: write compressed data to a file
+ */
+ printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n",
+ progname, in_name, (long) in_len, (long) out_len,
+ (long) uncompressed_checksum, (long) compressed_checksum);
+
+ if (out_name && out_name[0])
+ {
+ printf("%s: writing to file %s\n", progname, out_name);
+ fp = fopen(out_name,"wb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open output file %s\n", progname, out_name);
+ exit(1);
+ }
+ if (lzo_fwrite(fp, out, out_len) != out_len || fclose(fp) != 0)
+ {
+ printf("%s: write error !!\n", progname);
+ exit(1);
+ }
+ }
+
+/*
+ * Step 12: verify decompression
+ */
+#ifdef PARANOID
+ lzo_memset(in,0,in_len); /* paranoia - clear output buffer */
+ orig_len = in_len;
+ r = -100;
+#ifdef USE_LZO1X
+ if (best_compress == 1)
+ r = lzo1x_decompress_safe(out,out_len,in,&orig_len,NULL);
+#endif
+#ifdef USE_LZO1Y
+ if (best_compress == 2)
+ r = lzo1y_decompress_safe(out,out_len,in,&orig_len,NULL);
+#endif
+ if (r != LZO_E_OK || orig_len != in_len)
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression failed: %d\n", r);
+ exit(1);
+ }
+ if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len))
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression data error\n");
+ exit(1);
+ }
+ /* Now you could also verify decompression under similar conditions as in
+ * your application, e.g. overlapping assembler decompression etc.
+ */
+#endif
+
+ lzo_free(in);
+ lzo_free(out);
+ lzo_free(wrkmem);
+
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/precomp2.c b/ics-openvpn-stripped/main/lzo/examples/precomp2.c
new file mode 100644
index 00000000..93dd8b55
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/precomp2.c
@@ -0,0 +1,382 @@
+/* precomp2.c -- example program: how to generate pre-compressed data
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// This program shows how to generate pre-compressed data.
+//
+// Please study precomp.c first.
+//
+// We will be trying LZO1X-999 and LZO1Y-999, and we will be trying
+// various parameters using the internal interface to squeeze out
+// a little bit of extra compression.
+//
+// NOTE: this program can be quite slow for highly redundant files
+**************************************************************************/
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+#include "lzo/lzo1y.h"
+
+LZO_EXTERN(int)
+lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_callback_p cb,
+ int try_lazy,
+ lzo_uint good_length,
+ lzo_uint max_lazy,
+ lzo_uint nice_length,
+ lzo_uint max_chain,
+ lzo_uint32_t flags );
+
+LZO_EXTERN(int)
+lzo1y_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_callback_p cb,
+ int try_lazy,
+ lzo_uint good_length,
+ lzo_uint max_lazy,
+ lzo_uint nice_length,
+ lzo_uint max_chain,
+ lzo_uint32_t flags );
+
+#define USE_LZO1X 1
+#define USE_LZO1Y 1
+
+#define PARANOID 1
+
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int r;
+ int lazy;
+ const int max_try_lazy = 5;
+ const lzo_uint big = 65536L; /* can result in very slow compression */
+ const lzo_uint32_t flags = 0x1;
+
+ lzo_bytep in;
+ lzo_uint in_len;
+
+ lzo_bytep out;
+ lzo_uint out_bufsize;
+ lzo_uint out_len = 0;
+
+ lzo_voidp wrkmem;
+ lzo_uint wrkmem_size;
+
+ lzo_uint best_len;
+ int best_compress = -1;
+ int best_lazy = -1;
+
+ lzo_uint orig_len;
+ lzo_uint32_t uncompressed_checksum;
+ lzo_uint32_t compressed_checksum;
+
+ FILE *fp;
+ const char *in_name = NULL;
+ const char *out_name = NULL;
+ long l;
+
+
+ lzo_wildargv(&argc, &argv);
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+ progname = argv[0];
+ if (argc < 2 || argc > 3)
+ {
+ printf("usage: %s file [output-file]\n", progname);
+ exit(1);
+ }
+ in_name = argv[1];
+ if (argc > 2) out_name = argv[2];
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+/*
+ * Step 2: allocate the work-memory
+ */
+ wrkmem_size = 1;
+#ifdef USE_LZO1X
+ wrkmem_size = (LZO1X_999_MEM_COMPRESS > wrkmem_size) ? LZO1X_999_MEM_COMPRESS : wrkmem_size;
+#endif
+#ifdef USE_LZO1Y
+ wrkmem_size = (LZO1Y_999_MEM_COMPRESS > wrkmem_size) ? LZO1Y_999_MEM_COMPRESS : wrkmem_size;
+#endif
+ wrkmem = (lzo_voidp) xmalloc(wrkmem_size);
+ if (wrkmem == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+
+/*
+ * Step 3: open the input file
+ */
+ fp = fopen(in_name,"rb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open file %s\n", progname, in_name);
+ exit(1);
+ }
+ fseek(fp, 0, SEEK_END);
+ l = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ if (l <= 0)
+ {
+ printf("%s: %s: empty file\n", progname, in_name);
+ fclose(fp); fp = NULL;
+ exit(1);
+ }
+ in_len = (lzo_uint) l;
+ out_bufsize = in_len + in_len / 16 + 64 + 3;
+ best_len = in_len;
+
+/*
+ * Step 4: allocate compression buffers and read the file
+ */
+ in = (lzo_bytep) xmalloc(in_len);
+ out = (lzo_bytep) xmalloc(out_bufsize);
+ if (in == NULL || out == NULL)
+ {
+ printf("%s: out of memory\n", progname);
+ exit(1);
+ }
+ in_len = (lzo_uint) lzo_fread(fp, in, in_len);
+ printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len);
+ fclose(fp); fp = NULL;
+
+/*
+ * Step 5: compute a checksum of the uncompressed data
+ */
+ uncompressed_checksum = lzo_adler32(0,NULL,0);
+ uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len);
+
+/*
+ * Step 6a: compress from 'in' to 'out' with LZO1X-999
+ */
+#ifdef USE_LZO1X
+ for (lazy = 0; lazy <= max_try_lazy; lazy++)
+ {
+ out_len = out_bufsize;
+ r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem,
+ NULL, 0, 0,
+ lazy, big, big, big, big, flags);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ exit(1);
+ }
+ printf("LZO1X-999: lazy =%2d: %8lu -> %8lu\n",
+ lazy, (unsigned long) in_len, (unsigned long) out_len);
+ if (out_len < best_len)
+ {
+ best_len = out_len;
+ best_lazy = lazy;
+ best_compress = 1; /* LZO1X-999 */
+ }
+ }
+#endif /* USE_LZO1X */
+
+/*
+ * Step 6b: compress from 'in' to 'out' with LZO1Y-999
+ */
+#ifdef USE_LZO1Y
+ for (lazy = 0; lazy <= max_try_lazy; lazy++)
+ {
+ out_len = out_bufsize;
+ r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem,
+ NULL, 0, 0,
+ lazy, big, big, big, big, flags);
+ if (r != LZO_E_OK)
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ exit(1);
+ }
+ printf("LZO1Y-999: lazy =%2d: %8lu -> %8lu\n",
+ lazy, (unsigned long) in_len, (unsigned long) out_len);
+ if (out_len < best_len)
+ {
+ best_len = out_len;
+ best_lazy = lazy;
+ best_compress = 2; /* LZO1Y-999 */
+ }
+ }
+#endif /* USE_LZO1Y */
+
+/*
+ * Step 7: check if compressible
+ */
+ if (best_len >= in_len)
+ {
+ printf("This file contains incompressible data.\n");
+ return 0;
+ }
+
+/*
+ * Step 8: compress data again using the best compressor found
+ */
+ out_len = out_bufsize;
+ if (best_compress == 1)
+ r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem,
+ NULL, 0, 0,
+ best_lazy, big, big, big, big, flags);
+ else if (best_compress == 2)
+ r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem,
+ NULL, 0, 0,
+ best_lazy, big, big, big, big, flags);
+ else
+ r = -100;
+ assert(r == LZO_E_OK);
+ assert(out_len == best_len);
+
+/*
+ * Step 9: optimize compressed data (compressed data is in 'out' buffer)
+ */
+#if 1
+ /* Optimization does not require any data in the buffer that will
+ * hold the uncompressed data. To prove this, we clear the buffer.
+ */
+ lzo_memset(in,0,in_len);
+#endif
+
+ orig_len = in_len;
+ r = -100;
+#ifdef USE_LZO1X
+ if (best_compress == 1)
+ r = lzo1x_optimize(out,out_len,in,&orig_len,NULL);
+#endif
+#ifdef USE_LZO1Y
+ if (best_compress == 2)
+ r = lzo1y_optimize(out,out_len,in,&orig_len,NULL);
+#endif
+ if (r != LZO_E_OK || orig_len != in_len)
+ {
+ /* this should NEVER happen */
+ printf("internal error - optimization failed: %d\n", r);
+ exit(1);
+ }
+
+/*
+ * Step 10: compute a checksum of the compressed data
+ */
+ compressed_checksum = lzo_adler32(0,NULL,0);
+ compressed_checksum = lzo_adler32(compressed_checksum,out,out_len);
+
+/*
+ * Step 11: write compressed data to a file
+ */
+ printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n",
+ progname, in_name, (long) in_len, (long) out_len,
+ (long) uncompressed_checksum, (long) compressed_checksum);
+
+ if (out_name && out_name[0])
+ {
+ printf("%s: writing to file %s\n", progname, out_name);
+ fp = fopen(out_name,"wb");
+ if (fp == NULL)
+ {
+ printf("%s: cannot open output file %s\n", progname, out_name);
+ exit(1);
+ }
+ if (lzo_fwrite(fp, out, out_len) != out_len || fclose(fp) != 0)
+ {
+ printf("%s: write error !!\n", progname);
+ exit(1);
+ }
+ }
+
+/*
+ * Step 12: verify decompression
+ */
+#ifdef PARANOID
+ lzo_memset(in,0,in_len); /* paranoia - clear output buffer */
+ orig_len = in_len;
+ r = -100;
+#ifdef USE_LZO1X
+ if (best_compress == 1)
+ r = lzo1x_decompress_safe(out,out_len,in,&orig_len,NULL);
+#endif
+#ifdef USE_LZO1Y
+ if (best_compress == 2)
+ r = lzo1y_decompress_safe(out,out_len,in,&orig_len,NULL);
+#endif
+ if (r != LZO_E_OK || orig_len != in_len)
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression failed: %d\n", r);
+ exit(1);
+ }
+ if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len))
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression data error\n");
+ exit(1);
+ }
+ /* Now you could also verify decompression under similar conditions as in
+ * your application, e.g. overlapping assembler decompression etc.
+ */
+#endif
+
+ lzo_free(in);
+ lzo_free(out);
+ lzo_free(wrkmem);
+
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/examples/simple.c b/ics-openvpn-stripped/main/lzo/examples/simple.c
new file mode 100644
index 00000000..42f814a7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/examples/simple.c
@@ -0,0 +1,156 @@
+/* simple.c -- the annotated simple example program for the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// This program shows the basic usage of the LZO library.
+// We will compress a block of data and decompress again.
+//
+// See also LZO.FAQ
+**************************************************************************/
+
+/* We will be using the LZO1X-1 algorithm, so we have
+ * to include <lzo1x.h>
+ */
+
+#include "lzo/lzoconf.h"
+#include "lzo/lzo1x.h"
+
+/* portability layer */
+static const char *progname = NULL;
+#define WANT_LZO_MALLOC 1
+#define WANT_XMALLOC 1
+#include "examples/portab.h"
+
+
+/* We want to compress the data block at 'in' with length 'IN_LEN' to
+ * the block at 'out'. Because the input block may be incompressible,
+ * we must provide a little more output space in case that compression
+ * is not possible.
+ */
+
+#ifndef IN_LEN
+#define IN_LEN (128*1024L)
+#endif
+#define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3)
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int r;
+ lzo_bytep in;
+ lzo_bytep out;
+ lzo_voidp wrkmem;
+ lzo_uint in_len;
+ lzo_uint out_len;
+ lzo_uint new_len;
+
+ if (argc < 0 && argv == NULL) /* avoid warning about unused args */
+ return 0;
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ return 4;
+ }
+
+/*
+ * Step 2: allocate blocks and the work-memory
+ */
+ in = (lzo_bytep) xmalloc(IN_LEN);
+ out = (lzo_bytep) xmalloc(OUT_LEN);
+ wrkmem = (lzo_voidp) xmalloc(LZO1X_1_MEM_COMPRESS);
+ if (in == NULL || out == NULL || wrkmem == NULL)
+ {
+ printf("out of memory\n");
+ return 3;
+ }
+
+/*
+ * Step 3: prepare the input block that will get compressed.
+ * We just fill it with zeros in this example program,
+ * but you would use your real-world data here.
+ */
+ in_len = IN_LEN;
+ lzo_memset(in,0,in_len);
+
+/*
+ * Step 4: compress from 'in' to 'out' with LZO1X-1
+ */
+ r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem);
+ if (r == LZO_E_OK)
+ printf("compressed %lu bytes into %lu bytes\n",
+ (unsigned long) in_len, (unsigned long) out_len);
+ else
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ return 2;
+ }
+ /* check for an incompressible block */
+ if (out_len >= in_len)
+ {
+ printf("This block contains incompressible data.\n");
+ return 0;
+ }
+
+/*
+ * Step 5: decompress again, now going from 'out' to 'in'
+ */
+ new_len = in_len;
+ r = lzo1x_decompress(out, out_len, in, &new_len, NULL);
+ if (r == LZO_E_OK && new_len == in_len)
+ printf("decompressed %lu bytes back into %lu bytes\n",
+ (unsigned long) out_len, (unsigned long) in_len);
+ else
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression failed: %d\n", r);
+ return 1;
+ }
+
+ lzo_free(wrkmem);
+ lzo_free(out);
+ lzo_free(in);
+ printf("Simple compression test passed.\n");
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/Makefile.am b/ics-openvpn-stripped/main/lzo/include/Makefile.am
new file mode 100644
index 00000000..5ad18f48
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/Makefile.am
@@ -0,0 +1,6 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+SUBDIRS = lzo
diff --git a/ics-openvpn-stripped/main/lzo/include/Makefile.in b/ics-openvpn-stripped/main/lzo/include/Makefile.in
new file mode 100644
index 00000000..c5cb4e79
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/Makefile.in
@@ -0,0 +1,487 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+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@
+subdir = include
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+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)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+SUBDIRS = lzo
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu include/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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:
+
+# 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) $(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
+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)
+ @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
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+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)
+
+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-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+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-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-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-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-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 --git a/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.am b/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.am
new file mode 100644
index 00000000..39537bb2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.am
@@ -0,0 +1,10 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+pkginclude_HEADERS = \
+ lzoconf.h lzodefs.h lzoutil.h lzo_asm.h \
+ lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \
+ lzo2a.h
+
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.in b/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.in
new file mode 100644
index 00000000..8bd26ceb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/Makefile.in
@@ -0,0 +1,412 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+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@
+subdir = include/lzo
+DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+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@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+pkginclude_HEADERS = \
+ lzoconf.h lzodefs.h lzoutil.h lzo_asm.h \
+ lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \
+ lzo2a.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu include/lzo/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu include/lzo/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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=$(am__strip_dir) \
+ 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=$(am__strip_dir) \
+ 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)
+ @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:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-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 --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1.h
new file mode 100644
index 00000000..433d91d9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1.h
@@ -0,0 +1,84 @@
+/* lzo1.h -- public interface of the LZO1 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1_H_INCLUDED
+#define __LZO1_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))
+#define LZO1_MEM_DECOMPRESS (0)
+
+
+LZO_EXTERN(int)
+lzo1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+LZO_EXTERN(int)
+lzo1_decompress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1_99_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1a.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1a.h
new file mode 100644
index 00000000..46d7e75d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1a.h
@@ -0,0 +1,84 @@
+/* lzo1a.h -- public interface of the LZO1A compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1A_H_INCLUDED
+#define __LZO1A_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1A_MEM_COMPRESS ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))
+#define LZO1A_MEM_DECOMPRESS (0)
+
+
+LZO_EXTERN(int)
+lzo1a_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+LZO_EXTERN(int)
+lzo1a_decompress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1A_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1a_99_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1b.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1b.h
new file mode 100644
index 00000000..3295b9e7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1b.h
@@ -0,0 +1,148 @@
+/* lzo1b.h -- public interface of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1B_H_INCLUDED
+#define __LZO1B_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1B_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
+#define LZO1B_MEM_DECOMPRESS (0)
+
+
+/* compression levels */
+#define LZO1B_BEST_SPEED 1
+#define LZO1B_BEST_COMPRESSION 9
+#define LZO1B_DEFAULT_COMPRESSION (-1) /* fastest by default */
+
+
+LZO_EXTERN(int)
+lzo1b_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ int compression_level );
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1b_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)
+lzo1b_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1b_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_2_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_3_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_4_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_5_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_6_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_7_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_8_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1b_9_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1B_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1b_99_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+#define LZO1B_999_MEM_COMPRESS ((lzo_uint32_t) (3 * 65536L * sizeof(lzo_xint)))
+
+LZO_EXTERN(int)
+lzo1b_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1c.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1c.h
new file mode 100644
index 00000000..6fa3cf92
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1c.h
@@ -0,0 +1,148 @@
+/* lzo1c.h -- public interface of the LZO1C compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1C_H_INCLUDED
+#define __LZO1C_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1C_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
+#define LZO1C_MEM_DECOMPRESS (0)
+
+
+/* compression levels */
+#define LZO1C_BEST_SPEED 1
+#define LZO1C_BEST_COMPRESSION 9
+#define LZO1C_DEFAULT_COMPRESSION (-1) /* fastest by default */
+
+
+LZO_EXTERN(int)
+lzo1c_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ int compression_level );
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1c_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)
+lzo1c_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1c_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_2_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_3_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_4_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_5_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_6_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_7_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_8_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+LZO_EXTERN(int)
+lzo1c_9_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1C_99_MEM_COMPRESS ((lzo_uint32_t) (65536L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1c_99_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+#define LZO1C_999_MEM_COMPRESS ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo1c_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1f.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1f.h
new file mode 100644
index 00000000..adc6b0d9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1f.h
@@ -0,0 +1,96 @@
+/* lzo1f.h -- public interface of the LZO1F compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1F_H_INCLUDED
+#define __LZO1F_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1F_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
+#define LZO1F_MEM_DECOMPRESS (0)
+
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1f_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)
+lzo1f_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1f_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1F_999_MEM_COMPRESS ((lzo_uint32_t) (5 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo1f_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1x.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1x.h
new file mode 100644
index 00000000..ef591db7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1x.h
@@ -0,0 +1,165 @@
+/* lzo1x.h -- public interface of the LZO1X compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1X_H_INCLUDED
+#define __LZO1X_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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_MEM_DECOMPRESS (0)
+#define LZO1X_MEM_OPTIMIZE (0)
+
+
+/* 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 */ );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// special compressor versions
+************************************************************************/
+
+/* this version needs only 8 KiB work memory */
+#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32_t) (2048L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/* this version needs 16 KiB work memory */
+#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32_t) (4096L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/* use this version if you need a little more compression speed */
+#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32_t) (32768L * lzo_sizeof_dict_t))
+
+LZO_EXTERN(int)
+lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1X_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1x_999_compress_dict ( 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 );
+
+LZO_EXTERN(int)
+lzo1x_999_compress_level ( 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,
+ lzo_callback_p cb,
+ int compression_level );
+
+LZO_EXTERN(int)
+lzo1x_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+
+/***********************************************************************
+// optimize a compressed data block
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1x_optimize ( 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 */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1y.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1y.h
new file mode 100644
index 00000000..37370c78
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1y.h
@@ -0,0 +1,133 @@
+/* lzo1y.h -- public interface of the LZO1Y compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1Y_H_INCLUDED
+#define __LZO1Y_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1Y_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
+#define LZO1Y_MEM_DECOMPRESS (0)
+#define LZO1Y_MEM_OPTIMIZE (0)
+
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1y_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)
+lzo1y_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1y_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo1y_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1y_999_compress_dict ( 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 );
+
+LZO_EXTERN(int)
+lzo1y_999_compress_level ( 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,
+ lzo_callback_p cb,
+ int compression_level );
+
+LZO_EXTERN(int)
+lzo1y_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+
+/***********************************************************************
+// optimize a compressed data block
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1y_optimize ( 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 */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo1z.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1z.h
new file mode 100644
index 00000000..b097e119
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo1z.h
@@ -0,0 +1,109 @@
+/* lzo1z.h -- public interface of the LZO1Z compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO1Z_H_INCLUDED
+#define __LZO1Z_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#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 LZO1Z_MEM_DECOMPRESS (0)
+
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1z_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)
+lzo1z_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo1z_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1z_999_compress_dict ( 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 );
+
+LZO_EXTERN(int)
+lzo1z_999_compress_level ( 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,
+ lzo_callback_p cb,
+ int compression_level );
+
+LZO_EXTERN(int)
+lzo1z_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo2a.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo2a.h
new file mode 100644
index 00000000..1c9ef2e9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo2a.h
@@ -0,0 +1,80 @@
+/* lzo2a.h -- public interface of the LZO2A compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO2A_H_INCLUDED
+#define __LZO2A_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO2A_MEM_DECOMPRESS (0)
+
+/* decompression */
+LZO_EXTERN(int)
+lzo2a_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)
+lzo2a_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+/***********************************************************************
+// better compression ratio at the cost of more memory and time
+************************************************************************/
+
+#define LZO2A_999_MEM_COMPRESS ((lzo_uint32_t) (8 * 16384L * sizeof(short)))
+
+LZO_EXTERN(int)
+lzo2a_999_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzo_asm.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzo_asm.h
new file mode 100644
index 00000000..d5f6ff63
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzo_asm.h
@@ -0,0 +1,140 @@
+/* lzo_asm.h -- assembler prototypes for the LZO data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO_ASM_H_INCLUDED
+#define __LZO_ASM_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+// i386 assembly decompressors
+//
+// NOTE:
+// ====
+//
+// - For reasons of speed all fast assembler decompressors (having '_fast'
+// in their name) can access (write to) up to 3 bytes past the end of
+// the decompressed ("dst") block. Data past the end of the compressed
+// ("src") block is never accessed (read from).
+// [ technical note: because data is transferred in 32-bit units ]
+//
+// - Please also see asm/i386/00README.TXT and doc/LZO.FAQ for more
+// important details about the assembler versions.
+//
+************************************************************************/
+
+LZO_EXTERN(int) lzo1c_decompress_asm
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1c_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+
+LZO_EXTERN(int) lzo1f_decompress_asm_fast
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1f_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+
+LZO_EXTERN(int) lzo1x_decompress_asm
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1x_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1x_decompress_asm_fast
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1x_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+
+LZO_EXTERN(int) lzo1y_decompress_asm
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1y_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1y_decompress_asm_fast
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+
+
+/***********************************************************************
+// checksum and misc functions
+************************************************************************/
+
+#if 0
+
+LZO_EXTERN(lzo_uint32_t)
+lzo_crc32_asm(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len,
+ const lzo_uint32_tp tab);
+
+LZO_EXTERN(lzo_uint32_t)
+lzo_crc32_asm_small(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
+
+LZO_EXTERN(int)
+lzo_cpuid_asm(lzo_uint32_tp /* lzo_uint32_t info[16] */ );
+
+LZO_EXTERN(lzo_uint32_t)
+lzo_rdtsc_asm(lzo_uint32_tp /* lzo_uint32_t ticks[2] */ );
+
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzoconf.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzoconf.h
new file mode 100644
index 00000000..02fb202d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzoconf.h
@@ -0,0 +1,444 @@
+/* lzoconf.h -- configuration of the LZO data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 1
+
+#define LZO_VERSION 0x2070
+#define LZO_VERSION_STRING "2.07"
+#define LZO_VERSION_DATE "Jun 25 2014"
+
+/* 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(USHRT_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
+************************************************************************/
+
+/* 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 must match size_t */
+#if !defined(LZO_UINT_MAX)
+# if (LZO_ABI_LLP64)
+# if (LZO_OS_WIN64)
+ typedef unsigned __int64 lzo_uint;
+ typedef __int64 lzo_int;
+# else
+ typedef lzo_ullong_t lzo_uint;
+ typedef lzo_llong_t lzo_int;
+# endif
+# define LZO_SIZEOF_LZO_UINT 8
+# define LZO_UINT_MAX 0xffffffffffffffffull
+# define LZO_INT_MAX 9223372036854775807LL
+# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
+# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
+ typedef unsigned int lzo_uint;
+ typedef int lzo_int;
+# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_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_SIZEOF_LZO_UINT LZO_SIZEOF_LONG
+# define LZO_UINT_MAX ULONG_MAX
+# define LZO_INT_MAX LONG_MAX
+# define LZO_INT_MIN LONG_MIN
+# else
+# error "lzo_uint"
+# endif
+#endif
+
+/* The larger type of lzo_uint and lzo_uint32_t. */
+#if (LZO_SIZEOF_LZO_UINT >= 4)
+# define lzo_xint lzo_uint
+#else
+# define lzo_xint lzo_uint32_t
+#endif
+
+typedef int lzo_bool;
+
+/* sanity checks */
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
+
+#ifndef __LZO_MMODEL
+#define __LZO_MMODEL /*empty*/
+#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_intp lzo_int __LZO_MMODEL *
+#define lzo_uintp lzo_uint __LZO_MMODEL *
+#define lzo_xintp lzo_xint __LZO_MMODEL *
+#define lzo_voidpp lzo_voidp __LZO_MMODEL *
+#define lzo_bytepp lzo_bytep __LZO_MMODEL *
+
+#define lzo_int8_tp lzo_int8_t __LZO_MMODEL *
+#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL *
+#define lzo_int16_tp lzo_int16_t __LZO_MMODEL *
+#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL *
+#define lzo_int32_tp lzo_int32_t __LZO_MMODEL *
+#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL *
+#if defined(lzo_int64_t)
+#define lzo_int64_tp lzo_int64_t __LZO_MMODEL *
+#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL *
+#endif
+
+/* Older LZO versions used to support ancient systems and memory models
+ * like 16-bit MSDOS with __huge pointers and Cray PVP, but these
+ * obsolete configurations are not supported any longer.
+ */
+#if defined(__LZO_MMODEL_HUGE)
+#error "__LZO_MMODEL_HUGE is unsupported"
+#endif
+#if (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#endif
+#if (LZO_SIZEOF_INT < 4)
+#error "LZO_SIZEOF_INT < 4 is unsupported"
+#endif
+#if (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
+/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
+ * work but have not received much testing lately, so be strict here.
+ */
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp))
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
+
+
+/***********************************************************************
+// 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 /*empty*/
+#endif
+#if !defined(__LZO_EXPORT2)
+# define __LZO_EXPORT2 /*empty*/
+#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;
+
+ /* INFO: 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) /* [lzo_alloc_func_t failure] */
+#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] */
+#define LZO_E_INVALID_ARGUMENT (-10)
+#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */
+#define LZO_E_OUTPUT_NOT_CONSUMED (-12)
+#define LZO_E_INTERNAL_ERROR (-99)
+
+
+#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_t),(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 a, const lzo_voidp b, lzo_uint len);
+LZO_EXTERN(lzo_voidp)
+ lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
+LZO_EXTERN(lzo_voidp)
+ lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
+LZO_EXTERN(lzo_voidp)
+ lzo_memset(lzo_voidp buf, int c, lzo_uint len);
+
+/* checksum functions */
+LZO_EXTERN(lzo_uint32_t)
+ lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
+LZO_EXTERN(lzo_uint32_t)
+ lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
+LZO_EXTERN(const lzo_uint32_tp)
+ lzo_get_crc32_table(void);
+
+/* misc. */
+LZO_EXTERN(int) _lzo_config_check(void);
+typedef union {
+ lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
+ void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
+#if defined(lzo_int64_t)
+ lzo_uint64_t a10;
+#endif
+} 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 p, lzo_uint size);
+#define LZO_PTR_ALIGN_UP(p,size) \
+ ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
+
+
+/***********************************************************************
+// deprecated macros - only for backward compatibility
+************************************************************************/
+
+/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
+#define lzo_byte unsigned char
+/* deprecated type names */
+#define lzo_int32 lzo_int32_t
+#define lzo_uint32 lzo_uint32_t
+#define lzo_int32p lzo_int32_t __LZO_MMODEL *
+#define lzo_uint32p lzo_uint32_t __LZO_MMODEL *
+#define LZO_INT32_MAX LZO_INT32_C(2147483647)
+#define LZO_UINT32_MAX LZO_UINT32_C(4294967295)
+#if defined(lzo_int64_t)
+#define lzo_int64 lzo_int64_t
+#define lzo_uint64 lzo_uint64_t
+#define lzo_int64p lzo_int64_t __LZO_MMODEL *
+#define lzo_uint64p lzo_uint64_t __LZO_MMODEL *
+#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807)
+#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615)
+#endif
+/* deprecated types */
+typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
+typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
+
+#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 /*empty*/
+#define __LZO_DMODEL /*empty*/
+#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/ics-openvpn-stripped/main/lzo/include/lzo/lzodefs.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzodefs.h
new file mode 100644
index 00000000..f4ae9487
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzodefs.h
@@ -0,0 +1,2998 @@
+/* lzodefs.h -- architecture, OS and compiler specific defines
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 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(LZO_CFG_NO_DISABLE_WUNDEF)
+#if defined(__ARMCC_VERSION)
+# pragma diag_suppress 193
+#elif defined(__clang__) && defined(__clang_minor__)
+# pragma clang diagnostic ignored "-Wundef"
+#elif defined(__INTEL_COMPILER)
+# pragma warning(disable: 193)
+#elif defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__)
+# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2))
+# pragma GCC diagnostic ignored "-Wundef"
+# endif
+#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if ((_MSC_VER-0) >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#endif
+#if 0 && defined(__POCC__) && defined(_WIN32)
+# if (__POCC__ >= 400)
+# pragma warn(disable: 2216)
+# 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 !(LZO_CFG_NO_DISABLE_WCRTNONSTDC)
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS 1
+#endif
+#endif
+#if 0
+#define LZO_0xffffUL 0xfffful
+#define LZO_0xffffffffUL 0xfffffffful
+#else
+#define LZO_0xffffUL 65535ul
+#define LZO_0xffffffffUL 4294967295ul
+#endif
+#define LZO_0xffffL LZO_0xffffUL
+#define LZO_0xffffffffL LZO_0xffffffffUL
+#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 defined(__COUNTER__)
+# ifndef LZO_CFG_USE_COUNTER
+# define LZO_CFG_USE_COUNTER 1
+# endif
+#else
+# undef LZO_CFG_USE_COUNTER
+#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 1
+#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
+#if defined(_CRAY) && defined(_CRAY1)
+# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
+#endif
+#define LZO_PP_STRINGIZE(x) #x
+#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT0() /*empty*/
+#define LZO_PP_CONCAT1(a) a
+#define LZO_PP_CONCAT2(a,b) a ## b
+#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0()
+#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a)
+#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
+#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
+#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
+#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f)
+#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g)
+#define LZO_PP_EMPTY /*empty*/
+#define LZO_PP_EMPTY0() /*empty*/
+#define LZO_PP_EMPTY1(a) /*empty*/
+#define LZO_PP_EMPTY2(a,b) /*empty*/
+#define LZO_PP_EMPTY3(a,b,c) /*empty*/
+#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/
+#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/
+#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/
+#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/
+#if 1
+#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_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#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_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f)
+#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g)
+#endif
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
+#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"
+# define LZO_EXTERN_C_BEGIN extern "C" {
+# define LZO_EXTERN_C_END }
+#else
+# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C_BEGIN /*empty*/
+# define LZO_EXTERN_C_END /*empty*/
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if (LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif (LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_OS_EMBEDDED 1
+# 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"
+# elif defined(__linux__) || defined(__LINUX__)
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+# 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) || defined(__LINUX__)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) && defined(__MACH__)
+# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000)
+# define LZO_OS_POSIX_DARWIN 1040
+# define LZO_INFO_OS_POSIX "darwin_iphone"
+# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040)
+# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# define LZO_INFO_OS_POSIX "darwin"
+# else
+# define LZO_OS_POSIX_DARWIN 1
+# define LZO_INFO_OS_POSIX "darwin"
+# endif
+# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN
+# elif defined(__minix__) || defined(__minix)
+# define LZO_OS_POSIX_MINIX 1
+# define LZO_INFO_OS_POSIX "minix"
+# 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"
+# elif defined(_UNICOS)
+# define LZO_OS_POSIX_UNICOS 1
+# define LZO_INFO_OS_POSIX "unicos"
+# 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 "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# 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_PP_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_PP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0))
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0)
+# define LZO_CC_INTELC __INTEL_COMPILER
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_INTELC_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
+#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# else
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# endif
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
+# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
+# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
+# else
+# define LZO_CC_CLANG 0x010000L
+# endif
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_CLANG_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+# define LZO_INFO_CC "clang"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# else
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# endif
+# define LZO_CC_LLVM LZO_CC_LLVM_GNUC
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__ACK__) && defined(_ACK)
+# define LZO_CC_ACK 1
+# define LZO_INFO_CC "Amsterdam Compiler Kit C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__ARMCC_VERSION) && !defined(__GNUC__)
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION)
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__CODEGEARC__)
+# define LZO_CC_CODEGEARC 1
+# define LZO_INFO_CC "CodeGear C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(_CRAYC) && defined(_RELEASE)
+# define LZO_CC_CRAYC 1
+# define LZO_INFO_CC "Cray C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0)
+# define LZO_CC_GHS 1
+# define LZO_INFO_CC "Green Hills C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_GHS_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0)
+# define LZO_CC_HPACC __HP_aCC
+# define LZO_INFO_CC "HP aCC"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC)
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define LZO_CC_IARC 1
+# define LZO_INFO_CC "IAR C"
+# if defined(__VER__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__IBMC__) && ((__IBMC__-0) > 0)
+# define LZO_CC_IBMC __IBMC__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0)
+# define LZO_CC_IBMC __IBMCPP__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_PP_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_PP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0)
+# define LZO_CC_MWERKS __MWERKS__
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_PP_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_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0))
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__)
+# else
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0"
+# endif
+# define LZO_INFO_CC "Portland Group PGI C"
+#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_PP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_C-0) > 0)
+# define LZO_CC_SUNPROC __SUNPRO_C
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__SUNPRO_CC)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_CC-0) > 0)
+# define LZO_CC_SUNPROC __SUNPRO_CC
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if ((__ZTC__-0) == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
+# endif
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_MSC _MSC_VER
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if (LZO_CC_GNUC) && defined(__OPEN64__)
+# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__)
+# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0))
+# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC
+# endif
+#endif
+#if (LZO_CC_GNUC) && defined(__PCC__)
+# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__)
+# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0))
+# define LZO_CC_PCC_GNUC LZO_CC_GNUC
+# endif
+#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) && !(LZO_ARCH_GENERIC) && defined(_CRAY)
+# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
+# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
+# define LZO_ARCH_CRAY_MPP 1
+# elif defined(_CRAY1)
+# define LZO_ARCH_CRAY_PVP 1
+# endif
+# endif
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if (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_INFO_ARCH "i086"
+#elif defined(__aarch64__)
+# define LZO_ARCH_ARM64 1
+# define LZO_INFO_ARCH "arm64"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
+# 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(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+# define LZO_ARCH_ARM 1
+# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1)
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2)
+# define LZO_INFO_ARCH "arm"
+# else
+# define LZO_INFO_ARCH "arm"
+# endif
+#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(__avr32__) || defined(__AVR32__)
+# define LZO_ARCH_AVR32 1
+# define LZO_INFO_ARCH "avr32"
+#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(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
+# define LZO_ARCH_EZ80 1
+# define LZO_INFO_ARCH "ez80"
+#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(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
+# 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(__mc68020__) || 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(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
+# 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(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
+# 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 defined(__SPU__)
+# define LZO_ARCH_SPU 1
+# define LZO_INFO_ARCH "spu"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#elif (LZO_ARCH_CRAY_PVP)
+# if defined(_CRAYSV1)
+# define LZO_ARCH_CRAY_SV1 1
+# define LZO_INFO_ARCH "cray_sv1"
+# elif (_ADDR64)
+# define LZO_ARCH_CRAY_T90 1
+# define LZO_INFO_ARCH "cray_t90"
+# elif (_ADDR32)
+# define LZO_ARCH_CRAY_YMP 1
+# define LZO_INFO_ARCH "cray_ymp"
+# else
+# define LZO_ARCH_CRAY_XMP 1
+# define LZO_INFO_ARCH "cray_xmp"
+# endif
+#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 LZO_OS_WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64)
+# define LZO_ARCH_X64 1
+#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_AMD64 1
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64)
+# define LZO_ARCH_AARCH64 1
+#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_ARM64 1
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86)
+# define LZO_ARCH_X86 1
+#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_I386 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086PM && !LZO_ARCH_I086)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if !defined(LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSE2__)
+# define LZO_TARGET_FEATURE_SSE2 1
+# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64))
+# define LZO_TARGET_FEATURE_SSE2 1
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSSE3)
+# if (LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSSE3__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# elif defined(_MSC_VER) && defined(__AVX__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSE4_2)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__SSE4_2__)
+# define LZO_TARGET_FEATURE_SSE4_2 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__AVX__)
+# define LZO_TARGET_FEATURE_AVX 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX2)
+# if (LZO_TARGET_FEATURE_AVX)
+# if defined(__AVX2__)
+# define LZO_TARGET_FEATURE_AVX2 1
+# endif
+# endif
+# endif
+#endif
+#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if defined(__ARM_NEON__)
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if 1
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#endif
+#if 0
+#elif !defined(__LZO_MM_OVERRIDE)
+#if (LZO_ARCH_I086)
+#if (UINT_MAX != LZO_0xffffL)
+# error "unexpected configuration - check your compiler defines"
+#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 LZO_ARCH_I086 memory model"
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#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) && !(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "unexpected configuration - check your compiler defines"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "unexpected configuration - check your compiler defines"
+# 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
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_MCS51 __MODEL__"
+#endif
+#elif (LZO_ARCH_CRAY_PVP)
+# define LZO_MM_PVP 1
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_PVP)
+# define LZO_INFO_MM "pvp"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_gnuc_extension__ __extension__
+#else
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+# define __lzo_gnuc_extension__ /*empty*/
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# else
+# define LZO_CFG_USE_NEW_STYLE_CASTS 1
+# endif
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(__cplusplus)
+# if defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# undef LZO_CFG_USE_NEW_STYLE_CASTS
+# endif
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# define LZO_REINTERPRET_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_STATIC_CAST(t,e) (static_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_STATIC_CAST)
+# define LZO_STATIC_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST2)
+# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e))
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e))))
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_PCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_PCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_PCAST)
+# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e))
+#endif
+#if !defined(LZO_CCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_CCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_CCAST)
+# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e))
+#endif
+#if !defined(LZO_ICONV)
+# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ICAST)
+# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ITRUNC)
+# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(__lzo_cte)
+# if (LZO_CC_MSC || LZO_CC_WATCOMC)
+# define __lzo_cte(e) ((void)0,(e))
+# elif 1
+# define __lzo_cte(e) ((void)0,(e))
+# endif
+#endif
+#if !defined(__lzo_cte)
+# define __lzo_cte(e) (e)
+#endif
+#if !defined(LZO_BLOCK_BEGIN)
+# define LZO_BLOCK_BEGIN do {
+# define LZO_BLOCK_END } while __lzo_cte(0)
+#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_CLANG && (LZO_CC_CLANG >= 0x030200ul))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_CLANG || 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) {LZO_EXTERN_C 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_CLANG || 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) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_CLANG >= 0x020800ul)
+# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l)))
+# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || 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_GHS)
+# define __lzo_inline __inline__
+#elif (LZO_CC_IBMC >= 600)
+# 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 (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_inline __inline__
+#endif
+#endif
+#if defined(__lzo_inline)
+# ifndef __lzo_HAVE_inline
+# define __lzo_HAVE_inline 1
+# endif
+#else
+# define __lzo_inline /*empty*/
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# ifndef __lzo_HAVE_forceinline
+# define __lzo_HAVE_forceinline 1
+# endif
+#else
+# define __lzo_forceinline __lzo_inline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || 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
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_noinline __attribute__((__noinline__))
+#endif
+#endif
+#if defined(__lzo_noinline)
+# ifndef __lzo_HAVE_noinline
+# define __lzo_HAVE_noinline 1
+# endif
+#else
+# define __lzo_noinline /*empty*/
+#endif
+#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_static_inline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline
+#endif
+#endif
+#if !defined(__lzo_static_inline)
+# define __lzo_static_inline static __lzo_inline
+#endif
+#if !defined(__lzo_static_forceinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline
+#endif
+#endif
+#if !defined(__lzo_static_forceinline)
+# define __lzo_static_forceinline static __lzo_forceinline
+#endif
+#if !defined(__lzo_static_noinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline
+#endif
+#endif
+#if !defined(__lzo_static_noinline)
+# define __lzo_static_noinline static __lzo_noinline
+#endif
+#if !defined(__lzo_c99_extern_inline)
+#if defined(__GNUC_GNU_INLINE__)
+# define __lzo_c99_extern_inline __lzo_inline
+#elif defined(__GNUC_STDC_INLINE__)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#endif
+#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline)
+# define __lzo_c99_extern_inline __lzo_inline
+#endif
+#endif
+#if defined(__lzo_c99_extern_inline)
+# ifndef __lzo_HAVE_c99_extern_inline
+# define __lzo_HAVE_c99_extern_inline 1
+# endif
+#else
+# define __lzo_c99_extern_inline /*empty*/
+#endif
+#if !defined(__lzo_may_alias)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_CLANG >= 0x020900ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#endif
+#endif
+#if defined(__lzo_may_alias)
+# ifndef __lzo_HAVE_may_alias
+# define __lzo_HAVE_may_alias 1
+# endif
+#else
+# define __lzo_may_alias /*empty*/
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# ifndef __lzo_HAVE_noreturn
+# define __lzo_HAVE_noreturn 1
+# endif
+#else
+# define __lzo_noreturn /*empty*/
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900))
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# ifndef __lzo_HAVE_nothrow
+# define __lzo_HAVE_nothrow 1
+# endif
+#else
+# define __lzo_nothrow /*empty*/
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 1210)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_restrict __restrict__
+#endif
+#endif
+#if defined(__lzo_restrict)
+# ifndef __lzo_HAVE_restrict
+# define __lzo_HAVE_restrict 1
+# endif
+#else
+# define __lzo_restrict /*empty*/
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_GHS) && !defined(__cplusplus)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_alignof(e) (__lzo_gnuc_extension__ __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)
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_alignof(e) __alignof__(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# ifndef __lzo_HAVE_alignof
+# define __lzo_HAVE_alignof 1
+# endif
+#endif
+#if !defined(__lzo_struct_packed)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__));
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s {
+# define __lzo_struct_packed_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_struct_packed(s) _Packed struct s {
+# define __lzo_struct_packed_end() };
+#endif
+#endif
+#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma)
+# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s)
+#endif
+#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end)
+# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end()
+#endif
+#if !defined(__lzo_byte_struct)
+#if defined(__lzo_struct_packed)
+# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end()
+# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end()
+#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__));
+# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__));
+#endif
+#endif
+#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma)
+# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n)
+#endif
+#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))
+#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_CILLY || LZO_CC_PCC)
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_align16(s) struct __declspec(align(16)) s {
+# define __lzo_struct_align16_end() };
+# define __lzo_struct_align32(s) struct __declspec(align(32)) s {
+# define __lzo_struct_align32_end() };
+# define __lzo_struct_align64(s) struct __declspec(align(64)) s {
+# define __lzo_struct_align64_end() };
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_struct_align16(s) struct s {
+# define __lzo_struct_align16_end() } __attribute__((__aligned__(16)));
+# define __lzo_struct_align32(s) struct s {
+# define __lzo_struct_align32_end() } __attribute__((__aligned__(32)));
+# define __lzo_struct_align64(s) struct s {
+# define __lzo_struct_align64_end() } __attribute__((__aligned__(64)));
+#endif
+#endif
+#if !defined(__lzo_union_um)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810))
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_union_am(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_union_um(s) __pragma(pack(push,1)) union s {
+# define __lzo_union_um_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_union_um(s) _Packed union s {
+# define __lzo_union_um_end() };
+#endif
+#endif
+#if !defined(__lzo_union_am)
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() };
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# ifndef __lzo_HAVE_constructor
+# define __lzo_HAVE_constructor 1
+# endif
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# ifndef __lzo_HAVE_destructor
+# define __lzo_HAVE_destructor 1
+# endif
+#endif
+#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_IBMC >= 1010)
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# ifndef __lzo_HAVE_likely
+# define __lzo_HAVE_likely 1
+# endif
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# ifndef __lzo_HAVE_unlikely
+# define __lzo_HAVE_unlikely 1
+# endif
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(__lzo_static_unused_void_func)
+# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void)
+# else
+# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void)
+# endif
+#endif
+#if !defined(__lzo_loop_forever)
+# if (LZO_CC_IBMC)
+# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END
+# else
+# define __lzo_loop_forever() do { ; } while __lzo_cte(1)
+# endif
+#endif
+#if !defined(__lzo_unreachable)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul))
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_GNUC >= 0x040500ul)
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1
+# define __lzo_unreachable() __builtin_unreachable();
+#endif
+#endif
+#if defined(__lzo_unreachable)
+# ifndef __lzo_HAVE_unreachable
+# define __lzo_HAVE_unreachable 1
+# endif
+#else
+# if 0
+# define __lzo_unreachable() ((void)0);
+# else
+# define __lzo_unreachable() __lzo_loop_forever();
+# endif
+#endif
+#ifndef __LZO_CTA_NAME
+#if (LZO_CFG_USE_COUNTER)
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__)
+#else
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__)
+#endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END
+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(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_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));}
+# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));}
+# elif (LZO_CC_GNUC >= 0x040700ul)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));}
+# 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_NAME(lzo_cta_t__)[1-2*!(e)];}
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1)
+#if defined(__cplusplus)
+extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) }
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3)
+#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 /*empty*/
+# 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_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#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 /*empty*/
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit /*empty*/
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main /*empty*/
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort /*empty*/
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler /*empty*/
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !(LZO_CFG_NO_WINDOWS_H)
+#if !defined(LZO_HAVE_WINDOWS_H)
+#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
+#endif
+#endif
+#ifndef LZO_SIZEOF_SHORT
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#elif defined(__SIZEOF_SHORT__)
+# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_INT
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#elif defined(__SIZEOF_INT__)
+# define LZO_SIZEOF_INT (__SIZEOF_INT__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_LONG
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#elif defined(__SIZEOF_LONG__)
+# define LZO_SIZEOF_LONG (__SIZEOF_LONG__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_LONG_LONG
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#elif defined(__SIZEOF_LONG_LONG__)
+# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT16
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT32
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT64
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#endif
+#ifndef LZO_SIZEOF_VOID_P
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#elif defined(__SIZEOF_POINTER__)
+# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_SIZE_T
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#elif defined(__SIZEOF_SIZE_T__)
+# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_PTRDIFF_T
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#elif defined(__SIZEOF_PTRDIFF_T__)
+# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__)
+#endif
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_SHORT 8
+# elif (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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short))
+#if !defined(LZO_SIZEOF_INT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_INT 8
+# elif (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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int))
+#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,39) == 1)
+# define LZO_SIZEOF_LONG 5
+# 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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long))
+#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
+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
+# define LZO_SIZEOF_LONG_LONG 4
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64 || defined(_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 || LZO_CC_SUNPROC))
+# 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 || defined(_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_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400 || defined(__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) && (LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if (LZO_CFG_NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(_NO_LONGLONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_WORDSIZE)
+#if (LZO_ARCH_ALPHA)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AMD64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AVR)
+# define LZO_WORDSIZE 1
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define LZO_WORDSIZE 4
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_WORDSIZE 4
+# else
+# define LZO_WORDSIZE 2
+# endif
+#elif (LZO_ARCH_I086)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_IA64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_M16C)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_SPU)
+# define LZO_WORDSIZE 4
+#elif (LZO_ARCH_Z80)
+# define LZO_WORDSIZE 1
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_WORDSIZE 8
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define LZO_WORDSIZE 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_WORDSIZE 8
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LP64__) || defined(__LP64) || defined(_LP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_ARCH_AVR)
+# 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_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# 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_I086)
+# 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 "invalid LZO_ARCH_I086 memory model"
+# endif
+#elif (LZO_ARCH_M16C)
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_ARCH_SPU)
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_ARCH_Z80)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# if defined(__LLP64_IFC__)
+# 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 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+# endif
+#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
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *))
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t))
+#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 "invalid LZO_ARCH_I086 memory model"
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
+#endif
+#if !defined(LZO_WORDSIZE)
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+#endif
+#if (LZO_ABI_NEUTRAL_ENDIAN)
+# undef LZO_ABI_BIG_ENDIAN
+# undef LZO_ABI_LITTLE_ENDIAN
+#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
+# if (__LITTLE_ENDIAN__ == 1)
+# define LZO_ABI_LITTLE_ENDIAN 1
+# else
+# define LZO_ABI_BIG_ENDIAN 1
+# endif
+#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_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC)
+# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+# elif defined(__BIG_ENDIAN)
+# define LZO_ABI_BIG_ENDIAN 1
+# else
+# define LZO_ABI_LITTLE_ENDIAN 1
+# endif
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
+# 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 (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif (LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif (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 == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_LP32 1
+# define LZO_INFO_ABI_PM "lp32"
+#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 0
+#elif !defined(__LZO_LIBC_OVERRIDE)
+#if (LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif (LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif (LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif (LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#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__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0))
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uc" "libc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if (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_GNUC == 0x011f00ul))
+#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_CC_GNUC)
+# 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"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000))
+# define __LZO_ASM_CLOBBER "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC : "cc"
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_ARM)
+# if defined(__ARM_FEATURE_UNALIGNED)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_CRIS)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_I386)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#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__)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# 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 (LZO_ABI_BIG_ENDIAN)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
+# endif
+#elif (LZO_ARCH_S390)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#ifndef LZO_CFG_NO_INLINE_ASM
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_INLINE_ASM 1
+#elif (LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if (LZO_CFG_NO_INLINE_ASM)
+# undef LZO_ASM_SYNTAX_MSC
+# undef LZO_ASM_SYNTAX_GNUC
+# undef __LZO_ASM_CLOBBER
+# undef __LZO_ASM_CLOBBER_LIST_CC
+# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY
+# undef __LZO_ASM_CLOBBER_LIST_EMPTY
+#endif
+#ifndef LZO_CFG_NO_UNALIGNED
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if (LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#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
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(lzo_llong_t)
+#if (LZO_SIZEOF_LONG_LONG+0 > 0)
+__lzo_gnuc_extension__ typedef long long lzo_llong_t__;
+__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__;
+# define lzo_llong_t lzo_llong_t__
+# define lzo_ullong_t lzo_ullong_t__
+#endif
+#endif
+#if !defined(lzo_int16e_t)
+#if (LZO_SIZEOF_LONG == 2)
+# define lzo_int16e_t long
+# define lzo_uint16e_t unsigned long
+#elif (LZO_SIZEOF_INT == 2)
+# define lzo_int16e_t int
+# define lzo_uint16e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 2)
+# define lzo_int16e_t short int
+# define lzo_uint16e_t unsigned short int
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM)
+ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__)));
+ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__)));
+# define lzo_int16e_t lzo_int16e_hi_t__
+# define lzo_uint16e_t lzo_uint16e_hi_t__
+#elif (LZO_SIZEOF___INT16 == 2)
+# define lzo_int16e_t __int16
+# define lzo_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(lzo_int16e_t)
+# define LZO_SIZEOF_LZO_INT16E_T 2
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+#endif
+#if !defined(lzo_int32e_t)
+#if (LZO_SIZEOF_LONG == 4)
+# define lzo_int32e_t long int
+# define lzo_uint32e_t unsigned long int
+#elif (LZO_SIZEOF_INT == 4)
+# define lzo_int32e_t int
+# define lzo_uint32e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 4)
+# define lzo_int32e_t short int
+# define lzo_uint32e_t unsigned short int
+#elif (LZO_SIZEOF_LONG_LONG == 4)
+# define lzo_int32e_t lzo_llong_t
+# define lzo_uint32e_t lzo_ullong_t
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+#elif (LZO_SIZEOF___INT32 == 4)
+# define lzo_int32e_t __int32
+# define lzo_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(lzo_int32e_t)
+# define LZO_SIZEOF_LZO_INT32E_T 4
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+#endif
+#if !defined(lzo_int64e_t)
+#if (LZO_SIZEOF___INT64 == 8)
+# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define LZO_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int64e_t int
+# define lzo_uint64e_t unsigned int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG == 8)
+# define lzo_int64e_t long int
+# define lzo_uint64e_t unsigned long int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define lzo_int64e_t lzo_llong_t
+# define lzo_uint64e_t lzo_ullong_t
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0ll)
+# define LZO_UINT64_C(c) ((c) + 0ull)
+# elif 0
+# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL))
+# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL))
+# else
+# define LZO_INT64_C(c) (c##LL)
+# define LZO_UINT64_C(c) (c##ULL)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG
+#elif (LZO_SIZEOF___INT64 == 8)
+# define lzo_int64e_t __int64
+# define lzo_uint64e_t unsigned __int64
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0i64)
+# define LZO_UINT64_C(c) ((c) + 0ui64)
+# else
+# define LZO_INT64_C(c) (c##i64)
+# define LZO_UINT64_C(c) (c##ui64)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64
+#else
+#endif
+#endif
+#if defined(lzo_int64e_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+#endif
+#if !defined(lzo_int32l_t)
+#if defined(lzo_int32e_t)
+# define lzo_int32l_t lzo_int32e_t
+# define lzo_uint32l_t lzo_uint32e_t
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T
+#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int32l_t int
+# define lzo_uint32l_t unsigned int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= 4)
+# define lzo_int32l_t long int
+# define lzo_uint32l_t unsigned long int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG
+#else
+# error "lzo_int32l_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+#endif
+#if !defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+# define lzo_int64l_t lzo_int64e_t
+# define lzo_uint64l_t lzo_uint64e_t
+# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T
+#else
+#endif
+#endif
+#if defined(lzo_int64l_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+#endif
+#if !defined(lzo_int32f_t)
+#if (LZO_SIZEOF_SIZE_T >= 8)
+# define lzo_int32f_t lzo_int64l_t
+# define lzo_uint32f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# define lzo_int32f_t lzo_int32l_t
+# define lzo_uint32f_t lzo_uint32l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+#endif
+#if !defined(lzo_int64f_t)
+#if defined(lzo_int64l_t)
+# define lzo_int64f_t lzo_int64l_t
+# define lzo_uint64f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+#endif
+#endif
+#if defined(lzo_int64f_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+#endif
+#if !defined(lzo_intptr_t)
+#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16))
+# define __LZO_INTPTR_T_IS_POINTER 1
+ typedef char* lzo_intptr_t;
+ typedef char* lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4))
+ typedef __w64 int lzo_intptr_t;
+ typedef __w64 unsigned int lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t short
+# define lzo_uintptr_t unsigned short
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT
+#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_intptr_t int
+# define lzo_uintptr_t unsigned int
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t long
+# define lzo_uintptr_t unsigned long
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t lzo_int64l_t
+# define lzo_uintptr_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# error "lzo_intptr_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#endif
+#if !defined(lzo_word_t)
+#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0)
+#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER)
+# define lzo_word_t lzo_uintptr_t
+# define lzo_sword_t lzo_intptr_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG)
+# define lzo_word_t unsigned long
+# define lzo_sword_t long
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG
+#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
+# define lzo_word_t unsigned int
+# define lzo_sword_t int
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
+#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT)
+# define lzo_word_t unsigned short
+# define lzo_sword_t short
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT
+#elif (LZO_WORDSIZE == 1)
+# define lzo_word_t unsigned char
+# define lzo_sword_t signed char
+# define LZO_SIZEOF_LZO_WORD_T 1
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T)
+# define lzo_word_t lzo_uint64l_t
+# define lzo_sword_t lzo_int64l_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T
+#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC)
+#if 0
+ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__)));
+# define lzo_word_t lzo_word_t
+# define lzo_sword_t lzo_sword_t
+# define LZO_SIZEOF_LZO_WORD_T 16
+#endif
+#else
+# error "lzo_word_t"
+#endif
+#endif
+#endif
+#if 1 && defined(lzo_word_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE)
+#endif
+#if 1
+#define lzo_int8_t signed char
+#define lzo_uint8_t unsigned char
+#define LZO_SIZEOF_LZO_INT8_T 1
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+#endif
+#if defined(lzo_int16e_t)
+#define lzo_int16_t lzo_int16e_t
+#define lzo_uint16_t lzo_uint16e_t
+#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t))
+#endif
+#if defined(lzo_int32e_t)
+#define lzo_int32_t lzo_int32e_t
+#define lzo_uint32_t lzo_uint32e_t
+#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t))
+#endif
+#if defined(lzo_int64e_t)
+#define lzo_int64_t lzo_int64e_t
+#define lzo_uint64_t lzo_uint64e_t
+#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t))
+#endif
+#if 1
+#define lzo_int_least32_t lzo_int32l_t
+#define lzo_uint_least32_t lzo_uint32l_t
+#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t))
+#endif
+#if defined(lzo_int64l_t)
+#define lzo_int_least64_t lzo_int64l_t
+#define lzo_uint_least64_t lzo_uint64l_t
+#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t))
+#endif
+#if 1
+#define lzo_int_fast32_t lzo_int32f_t
+#define lzo_uint_fast32_t lzo_uint32f_t
+#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t))
+#endif
+#if defined(lzo_int64f_t)
+#define lzo_int_fast64_t lzo_int64f_t
+#define lzo_uint_fast64_t lzo_uint64f_t
+#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t))
+#endif
+#if !defined(LZO_INT16_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) ((c) + 0)
+# define LZO_UINT16_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) ((c) + 0L)
+# define LZO_UINT16_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) (c)
+# define LZO_UINT16_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) (c##L)
+# define LZO_UINT16_C(c) (c##UL)
+# else
+# error "LZO_INT16_C"
+# endif
+#endif
+#if !defined(LZO_INT32_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) ((c) + 0)
+# define LZO_UINT32_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) ((c) + 0L)
+# define LZO_UINT32_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) (c)
+# define LZO_UINT32_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) (c##L)
+# define LZO_UINT32_C(c) (c##UL)
+# elif (LZO_SIZEOF_LONG_LONG >= 4)
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+# else
+# error "LZO_INT32_C"
+# endif
+#endif
+#if !defined(LZO_INT64_C) && defined(lzo_int64l_t)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) ((c) + 0)
+# define LZO_UINT64_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) ((c) + 0L)
+# define LZO_UINT64_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) (c)
+# define LZO_UINT64_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) (c##L)
+# define LZO_UINT64_C(c) (c##UL)
+# else
+# error "LZO_INT64_C"
+# endif
+#endif
+#endif
+
+#endif /* already included */
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/include/lzo/lzoutil.h b/ics-openvpn-stripped/main/lzo/include/lzo/lzoutil.h
new file mode 100644
index 00000000..23ea5229
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/include/lzo/lzoutil.h
@@ -0,0 +1,61 @@
+/* lzoutil.h -- utilitiy functions for use by applications [DEPRECATED]
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZOUTIL_H_INCLUDED
+#define __LZOUTIL_H_INCLUDED 1
+
+#ifndef __LZOCONF_H_INCLUDED
+#include "lzoconf.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+// LZO-v1 deprecated macros (which were used in the old example programs)
+// DO NOT USE
+************************************************************************/
+
+#define lzo_alloc(a,b) (malloc((a)*(b)))
+#define lzo_malloc(a) (malloc(a))
+#define lzo_free(a) (free(a))
+
+#define lzo_fread(f,b,s) (fread(b,1,s,f))
+#define lzo_fwrite(f,b,s) (fwrite(b,1,s,f))
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/libtool b/ics-openvpn-stripped/main/lzo/libtool
new file mode 100755
index 00000000..0130dbd5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/libtool
@@ -0,0 +1,7520 @@
+#! /bin/bash
+
+# libtoolT - Provide generalized library-building support services.
+# Generated automatically by (GNU lzo 2.03)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# 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
+# 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.
+
+# A sed program that does not truncate output.
+SED="/bin/sed"
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="/bin/sed -e 1s/^X//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=" CXX"
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host dune:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/bash"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=no
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=yes
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=needless
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# LTCC compiler flags.
+LTCFLAGS="-g -O2"
+
+# A language-specific compiler.
+CC="gcc"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# 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=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
+ cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
+ \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
+ \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=""
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=""
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# 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=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# 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=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/ /lib/i486-linux-gnu/4.3.2/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.3.2/ /usr/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../ /lib/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL CONFIG
+
+# 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, 2003, 2004, 2005
+# 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., 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.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.22
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
+
+# 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
+
+# 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 "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+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 X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ SP2NL='tr \040 \012'
+ NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ SP2NL='tr \100 \n'
+ NL2SP='tr \r\n \100\100'
+ ;;
+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
+lt_nl='
+'
+IFS=" $lt_nl"
+
+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 $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+duplicate_deps=no
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $mkdir "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || {
+ $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+ exit $EXIT_FAILURE
+ }
+ fi
+
+ $echo "X$my_tmpdir" | $Xsed
+}
+
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit $EXIT_FAILURE
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+
+ $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+ $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+ exit $EXIT_FAILURE
+ fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+ my_status=""
+
+ $show "${rm}r $my_gentop"
+ $run ${rm}r "$my_gentop"
+ $show "$mkdir $my_gentop"
+ $run $mkdir "$my_gentop"
+ my_status=$?
+ if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+ exit $my_status
+ fi
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+ my_xdir="$my_gentop/$my_xlib"
+
+ $show "${rm}r $my_xdir"
+ $run ${rm}r "$my_xdir"
+ $show "$mkdir $my_xdir"
+ $run $mkdir "$my_xdir"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+ exit $exit_status
+ fi
+ case $host in
+ *-darwin*)
+ $show "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ if test -z "$run"; then
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+ darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ $show "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ lipo -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ ${rm}r unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd "$darwin_orig_dir"
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ fi # $run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+disable_libs=no
+
+# 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"
+ ;;
+ tag)
+ tagname="$arg"
+ preserve_args="${preserve_args}=$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ 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"
+ $echo
+ $echo "Copyright (C) 2005 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit $?
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+ done
+ exit $?
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --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 $?
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --tag)
+ prevopt="--tag"
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+fi
+
+case $disable_libs in
+no)
+ ;;
+shared)
+ build_libtool_libs=no
+ build_old_libs=yes
+ ;;
+static)
+ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+ ;;
+esac
+
+# 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
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | 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 $EXIT_FAILURE
+ 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=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -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.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, and some SunOS ksh mistreat backslash-escaping
+ # in scan sets (worked around with variable expansion),
+ # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+ # at all, so we specify them separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit $EXIT_FAILURE
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ 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 $EXIT_FAILURE
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+ case $qlibobj in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qlibobj="\"$qlibobj\"" ;;
+ esac
+ test "X$libobj" != "X$qlibobj" \
+ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 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 $EXIT_FAILURE" 1 2 15
+ else
+ output_obj=
+ 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 "$progpath" "$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 $EXIT_FAILURE
+ fi
+ $echo "$srcfile" > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+ case $qsrcfile in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qsrcfile="\"$qsrcfile\"" ;;
+ esac
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # 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
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $exit_status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ 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 $qsrcfile"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && 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
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ # 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 invocation.
+ # 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"
+ base_compile="$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=
+ non_pic_objects=
+ notinst_path= # paths that contain not-installed libtool libraries
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+
+ func_infer_tag $base_compile
+
+ # 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
+ prefer_static_libs=yes
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ fi
+ build_libtool_libs=no
+ build_old_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 $EXIT_FAILURE
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ arg=$save_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 $EXIT_FAILURE
+ ;;
+ 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
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ darwin_framework|darwin_framework_skip)
+ test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ prev=
+ 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 $EXIT_FAILURE
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework|-arch|-isysroot)
+ case " $CC " in
+ *" ${arg} ${1} "* | *" ${arg} ${1} "*)
+ prev=darwin_framework_skip ;;
+ *) compiler_flags="$compiler_flags $arg"
+ prev=darwin_framework ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ 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* | /*-*-irix*)
+ 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
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ notinst_path="$notinst_path $dir"
+ 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*)
+ testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ -model)
+ compile_command="$compile_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ finalize_command="$finalize_command $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m* pass through architecture-specific compiler args for GCC
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -pg pass through profiling flag for GCC
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+ -t[45]*|-txscale*|@*)
+
+ # 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
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ 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
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -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 $EXIT_FAILURE
+ ;;
+ 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
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ 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
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ 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
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ 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 $EXIT_FAILURE
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ 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
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $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 $EXIT_FAILURE
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplications in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ 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
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # 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 $EXIT_FAILURE
+ ;;
+ 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,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ 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
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ 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
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_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
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ 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"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 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)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ if eval $echo \"$deplib\" 2>/dev/null \
+ | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; 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" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; 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"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ 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' or unhandled argument \`$deplib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ 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 variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ 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
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ 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 $EXIT_FAILURE
+ 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" # used for prog,scan pass
+ 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...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $absdir" ;;
+ esac
+ fi
+
+ # 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
+ 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
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes ; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on
+ # some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if 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
+ 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* | mingw*)
+ 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='~'
+ cmds=$extract_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $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='~'
+ cmds=$old_archive_from_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $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"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against
+ # it, someone is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null |
+ $EGREP ": [^:]* bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ 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 $EXIT_FAILURE
+ 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"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ 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
+ # 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
+ 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="$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 $EXIT_FAILURE
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs,
+ # but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ fi
+ path=""
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$depdepl $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_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
+ 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
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ 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
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ 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/-version-number' 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 shared_ext=\"$shrext_cmds\"
+ 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 $EXIT_FAILURE
+ 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 shared_ext=\"$shrext_cmds\"
+ 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 $EXIT_FAILURE
+ 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.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ 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/-version-number' 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 $EXIT_FAILURE
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor - 1`
+ age="$number_minor"
+ revision="$number_minor"
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ 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 $EXIT_FAILURE
+ 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$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" -ne 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" -ne 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 $EXIT_FAILURE
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ 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, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ 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* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # 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 behavior.
+ 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
+ $LTCC $LTCFLAGS -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 "$name" != "" && test "$name" -ne "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; 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
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred 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" != "" && test "$name" != "0"; then
+ $rm conftest
+ $LTCC $LTCFLAGS -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; 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 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
+ 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 "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; 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
+ fi
+ 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
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; 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 above 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
+ fi
+ 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=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -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
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+
+ # 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"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ 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 shared_ext=\"$shrext_cmds\"
+ 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
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ 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
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ 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
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ 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 "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$output_la-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadable object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~\$rm $delfiles\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_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 $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ 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 $EXIT_FAILURE
+ 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"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ 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"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $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 $EXIT_SUCCESS
+ 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 $EXIT_SUCCESS
+ 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"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ 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 /'`
+ ;;
+ esac
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ 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*)
+ testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ 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/$outputname.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ else
+ $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ 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. */
+"
+
+ case $host in
+ *cygwin* | *mingw* )
+ $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs */
+struct {
+"
+ ;;
+ * )
+ $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+ ;;
+ esac
+
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ 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 -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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.
+ case $host in
+ *cygwin* | *mingw* )
+ if test -f "$output_objdir/${outputname}.def" ; then
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+ else
+ 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}%"`
+ fi
+ ;;
+ * )
+ 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}%"`
+ ;;
+ esac
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ 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"
+ exit_status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $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 $EXIT_SUCCESS
+ 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 $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --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
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ output_name=`basename $output`
+ output_path=`dirname $output`
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable 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 executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+/* -DDEBUG is fairly common in CFLAGS. */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int check_executable(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ DEBUG("(main) argv[0] : %s\n",argv[0]);
+ DEBUG("(main) program_name : %s\n",program_name);
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = (char *) xstrdup("$SHELL");
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = find_executable(argv[0]);
+ if (newargz[1] == NULL)
+ lt_fatal("Couldn't find %s", argv[0]);
+ DEBUG("(main) found exe at : %s\n",newargz[1]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+
+ for (i=0; i<argc+1; i++)
+ {
+ DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
+ ;
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",(char const **)newargz);
+EOF
+ ;;
+ *)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+ ;;
+ esac
+
+ cat >> $cwrappersource <<"EOF"
+ return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char)name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable(const char * path)
+{
+ struct stat st;
+
+ DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0) &&
+ (
+ /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+ ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+ ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+ ((st.st_mode & S_IXUSR) == S_IXUSR))
+ )
+ return 1;
+ else
+ return 0;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise */
+char *
+find_executable (const char* wrapper)
+{
+ int has_slash = 0;
+ const char* p;
+ const char* p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char* concat_name;
+
+ DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char* path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char* q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR(*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ return NULL;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit $EXIT_FAILURE" 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.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+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 $EXIT_FAILURE
+ 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
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+ 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="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "copying selected object files to avoid basename conflicts..."
+
+ if test -z "$gentop"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+ exit $exit_status
+ fi
+ fi
+
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ counter=`expr $counter + 1`
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ $run ln "$obj" "$gentop/$newobj" ||
+ $run cp "$obj" "$gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ eval cmd=\"$cmd\"
+ 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 $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+
+ # 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ 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 | *mingw*,*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
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# 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 $EXIT_SUCCESS
+ ;;
+
+ # 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" | 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)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o) prev=$arg ;;
+ -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 $EXIT_FAILURE
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ ;;
+ 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 | grep "^# 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 $EXIT_FAILURE
+ 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.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ cmds=$postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_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 $EXIT_FAILURE
+ ;;
+ 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 $EXIT_SUCCESS
+ ;;
+
+ *)
+ # 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
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # 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 | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo and FILE.exe exist: automatic-append-.exe
+ # behavior happens only for exec(3), not for open(2)! Also, sourcing
+ # `FILE.' does not work on cygwin managed mounts.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper 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 $EXIT_FAILURE
+ 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=
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo and FILE.exe exist: automatic-append-.exe
+ # behavior happens only for exec(3), not for open(2)! Also, sourcing
+ # `FILE.' does not work on cygwin managed mounts.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper in
+ */* | *\\*) . ${wrapper} ;;
+ *) . ./${wrapper} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir=`func_mktempdir`
+ file=`$echo "X$file$stripped_ext" | $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$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ 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 "$old_striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ cmds=$old_postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $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 $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ 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.
+ cmds=$finish_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $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 $EXIT_SUCCESS
+
+ $echo "X----------------------------------------------------------------------" | $Xsed
+ $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 "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+ ;;
+
+ # 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# 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 $EXIT_FAILURE
+ 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 $EXIT_FAILURE
+ 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 | grep "^# 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 environment 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 $EXIT_SUCCESS
+ 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 $EXIT_FAILURE
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ 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 | grep "^# 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"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ cmds=$postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 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.
+ cmds=$old_postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # 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 $EXIT_FAILURE
+ ;;
+ esac
+
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit $EXIT_FAILURE
+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
+ --tag=TAG use configuration variables from tag TAG
+ --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.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit $EXIT_SUCCESS
+ ;;
+
+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
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -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 $EXIT_FAILURE
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+disable_libs=shared
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+disable_libs=static
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# Libtool was configured on host dune:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/bash"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=no
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=needless
+
+# The host system.
+host_alias=
+host=i686-pc-linux-gnu
+host_os=linux-gnu
+
+# The build system.
+build_alias=
+build=i686-pc-linux-gnu
+build_os=linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# LTCC compiler flags.
+LTCFLAGS="-g -O2"
+
+# A language-specific compiler.
+CC="g++"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="grep -E"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# 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=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=32768
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# 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="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.2/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../.."
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# 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=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# 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=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../i486-linux-gnu/4.3.2/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/ /lib/i486-linux-gnu/4.3.2/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.3.2/ /usr/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../ /lib/ /usr/lib/"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=""
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: CXX
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/.deps/lzotest.Po b/ics-openvpn-stripped/main/lzo/lzotest/.deps/lzotest.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/.deps/lzotest.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/Makefile.am b/ics-openvpn-stripped/main/lzo/lzotest/Makefile.am
new file mode 100644
index 00000000..842ccfb3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+
+noinst_PROGRAMS = lzotest
+
+lzotest_SOURCES = lzotest.c
+lzotest_LDADD = ../src/liblzo2.la
+lzotest_DEPENDENCIES = ../src/liblzo2.la
+
+EXTRA_DIST = asm.h db.h wrap.h wrapmisc.h mygetopt.ch mygetopt.h
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/Makefile.in b/ics-openvpn-stripped/main/lzo/lzotest/Makefile.in
new file mode 100644
index 00000000..d2df9024
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/Makefile.in
@@ -0,0 +1,441 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+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@
+noinst_PROGRAMS = lzotest$(EXEEXT)
+subdir = lzotest
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_lzotest_OBJECTS = lzotest.$(OBJEXT)
+lzotest_OBJECTS = $(am_lzotest_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(lzotest_SOURCES)
+DIST_SOURCES = $(lzotest_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+lzotest_SOURCES = lzotest.c
+lzotest_LDADD = ../src/liblzo2.la
+lzotest_DEPENDENCIES = ../src/liblzo2.la
+EXTRA_DIST = asm.h db.h wrap.h wrapmisc.h mygetopt.ch mygetopt.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu lzotest/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu lzotest/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+lzotest$(EXEEXT): $(lzotest_OBJECTS) $(lzotest_DEPENDENCIES)
+ @rm -f lzotest$(EXEEXT)
+ $(LINK) $(lzotest_LDFLAGS) $(lzotest_OBJECTS) $(lzotest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzotest.Po@am__quote@
+
+.c.o:
+@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@ 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@ 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 $@ $<
+
+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)
+ @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 $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+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 clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -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:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS 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-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
+
+# 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/ics-openvpn-stripped/main/lzo/lzotest/asm.h b/ics-openvpn-stripped/main/lzo/lzotest/asm.h
new file mode 100644
index 00000000..cbc07156
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/asm.h
@@ -0,0 +1,70 @@
+/* asm.h -- library assembler function prototypes
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+#if defined(LZO_USE_ASM)
+# include "lzo/lzo_asm.h"
+#else
+# define lzo1c_decompress_asm 0
+# define lzo1c_decompress_asm_safe 0
+# define lzo1f_decompress_asm_fast 0
+# define lzo1f_decompress_asm_fast_safe 0
+# define lzo1x_decompress_asm 0
+# define lzo1x_decompress_asm_safe 0
+# define lzo1x_decompress_asm_fast 0
+# define lzo1x_decompress_asm_fast_safe 0
+# define lzo1y_decompress_asm 0
+# define lzo1y_decompress_asm_safe 0
+# define lzo1y_decompress_asm_fast 0
+# define lzo1y_decompress_asm_fast_safe 0
+#endif
+
+
+/*************************************************************************
+// these are not yet implemented
+**************************************************************************/
+
+#define lzo1b_decompress_asm 0
+#define lzo1b_decompress_asm_safe 0
+#define lzo1b_decompress_asm_fast 0
+#define lzo1b_decompress_asm_fast_safe 0
+
+#define lzo1c_decompress_asm_fast 0
+#define lzo1c_decompress_asm_fast_safe 0
+
+#define lzo1f_decompress_asm 0
+#define lzo1f_decompress_asm_safe 0
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/db.h b/ics-openvpn-stripped/main/lzo/lzotest/db.h
new file mode 100644
index 00000000..9ce0a6ca
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/db.h
@@ -0,0 +1,485 @@
+/* db.h -- compression database
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+#if defined(HAVE_LZO1_H)
+{ "LZO1-1", M_LZO1, LZO1_MEM_COMPRESS, LZO1_MEM_DECOMPRESS,
+ lzo1_compress, 0,
+ lzo1_decompress, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0 },
+{ "LZO1-99", M_LZO1_99, LZO1_99_MEM_COMPRESS, LZO1_MEM_DECOMPRESS,
+ lzo1_99_compress, 0,
+ lzo1_decompress, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0 },
+#endif
+
+#if defined(HAVE_LZO1A_H)
+{ "LZO1A-1", M_LZO1A, LZO1A_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS,
+ lzo1a_compress, 0,
+ lzo1a_decompress, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0 },
+{ "LZO1A-99", M_LZO1A_99, LZO1A_99_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS,
+ lzo1a_99_compress, 0,
+ lzo1a_decompress, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0 },
+#endif
+
+#if defined(HAVE_LZO1B_H)
+{ "LZO1B-1", M_LZO1B_1, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_1_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-2", M_LZO1B_2, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_2_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-3", M_LZO1B_3, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_3_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-4", M_LZO1B_4, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_4_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-5", M_LZO1B_5, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_5_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-6", M_LZO1B_6, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_6_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-7", M_LZO1B_7, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_7_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-8", M_LZO1B_8, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_8_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-9", M_LZO1B_9, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_9_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-99", M_LZO1B_99, LZO1B_99_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_99_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1B-999", M_LZO1B_999, LZO1B_999_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS,
+ lzo1b_999_compress, 0,
+ lzo1b_decompress, lzo1b_decompress_safe,
+ lzo1b_decompress_asm, lzo1b_decompress_asm_safe,
+ lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe,
+ 0, 0 },
+#endif
+
+#if defined(HAVE_LZO1C_H)
+{ "LZO1C-1", M_LZO1C_1, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_1_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-2", M_LZO1C_2, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_2_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-3", M_LZO1C_3, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_3_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-4", M_LZO1C_4, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_4_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-5", M_LZO1C_5, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_5_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-6", M_LZO1C_6, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_6_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-7", M_LZO1C_7, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_7_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-8", M_LZO1C_8, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_8_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-9", M_LZO1C_9, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_9_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-99", M_LZO1C_99, LZO1C_99_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_99_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1C-999", M_LZO1C_999, LZO1C_999_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS,
+ lzo1c_999_compress, 0,
+ lzo1c_decompress, lzo1c_decompress_safe,
+ lzo1c_decompress_asm, lzo1c_decompress_asm_safe,
+ lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe,
+ 0, 0 },
+#endif
+
+#if defined(HAVE_LZO1F_H)
+{ "LZO1F-1", M_LZO1F_1, LZO1F_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS,
+ lzo1f_1_compress, 0,
+ lzo1f_decompress, lzo1f_decompress_safe,
+ lzo1f_decompress_asm, lzo1f_decompress_asm_safe,
+ lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1F-999", M_LZO1F_999, LZO1F_999_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS,
+ lzo1f_999_compress, 0,
+ lzo1f_decompress, lzo1f_decompress_safe,
+ lzo1f_decompress_asm, lzo1f_decompress_asm_safe,
+ lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe,
+ 0, 0 },
+#endif
+
+#if defined(HAVE_LZO1X_H)
+{ "LZO1X-1", M_LZO1X_1, LZO1X_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_1_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, 0 },
+#if 0
+{ "LZO1XT-1", M_LZO1XT_1, LZO1XT_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1xt_1_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, 0 },
+#endif
+{ "LZO1X-1(11)", M_LZO1X_1_11, LZO1X_1_11_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_1_11_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1X-1(12)", M_LZO1X_1_12, LZO1X_1_12_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_1_12_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1X-1(15)", M_LZO1X_1_15, LZO1X_1_15_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_1_15_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, 0 },
+{ "LZO1X-999", M_LZO1X_999, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ lzo1x_999_compress_dict, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/1", 9721, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_1_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/2", 9722, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_2_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/3", 9723, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_3_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/4", 9724, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_4_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/5", 9725, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_5_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/6", 9726, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_6_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/7", 9727, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_7_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/8", 9728, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_8_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+{ "LZO1X-999/9", 9729, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS,
+ lzo1x_999_9_compress, lzo1x_optimize,
+ lzo1x_decompress, lzo1x_decompress_safe,
+ lzo1x_decompress_asm, lzo1x_decompress_asm_safe,
+ lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe,
+ 0, lzo1x_decompress_dict_safe },
+#endif
+
+#if defined(HAVE_LZO1Y_H)
+{ "LZO1Y-1", M_LZO1Y_1, LZO1Y_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_1_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999", M_LZO1Y_999, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ lzo1y_999_compress_dict, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/1", 9821, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_1_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/2", 9822, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_2_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/3", 9823, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_3_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/4", 9824, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_4_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/5", 9825, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_5_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/6", 9826, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_6_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/7", 9827, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_7_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/8", 9828, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_8_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+{ "LZO1Y-999/9", 9829, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS,
+ lzo1y_999_9_compress, lzo1y_optimize,
+ lzo1y_decompress, lzo1y_decompress_safe,
+ lzo1y_decompress_asm, lzo1y_decompress_asm_safe,
+ lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe,
+ 0, lzo1y_decompress_dict_safe },
+#endif
+
+#if defined(HAVE_LZO1Z_H)
+{ "LZO1Z-999", M_LZO1Z_999, LZO1Z_999_MEM_COMPRESS, LZO1Z_MEM_DECOMPRESS,
+ lzo1z_999_compress, 0,
+ lzo1z_decompress, lzo1z_decompress_safe,
+ 0, 0,
+ 0, 0,
+ lzo1z_999_compress_dict, lzo1z_decompress_dict_safe },
+#endif
+
+#if defined(HAVE_LZO2A_H)
+{ "LZO2A-999", M_LZO2A_999, LZO2A_999_MEM_COMPRESS, LZO2A_MEM_DECOMPRESS,
+ lzo2a_999_compress, 0,
+ lzo2a_decompress, lzo2a_decompress_safe,
+ 0, 0,
+ 0, 0,
+ 0, 0 },
+#endif
+
+#if defined(ALG_ZLIB)
+{ "zlib-8/1", M_ZLIB_8_1, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_1_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/2", M_ZLIB_8_2, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_2_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/3", M_ZLIB_8_3, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_3_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/4", M_ZLIB_8_4, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_4_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/5", M_ZLIB_8_5, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_5_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/6", M_ZLIB_8_6, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_6_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/7", M_ZLIB_8_7, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_7_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/8", M_ZLIB_8_8, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_8_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "zlib-8/9", M_ZLIB_8_9, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS,
+ zlib_8_9_compress, 0,
+ zlib_decompress, 0, 0, 0, 0, 0, 0, 0 },
+#endif
+
+#if defined(ALG_BZIP2)
+{ "bzip2/1", M_BZIP2_1, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_1_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/2", M_BZIP2_2, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_2_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/3", M_BZIP2_3, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_3_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/4", M_BZIP2_4, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_4_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/5", M_BZIP2_5, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_5_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/6", M_BZIP2_6, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_6_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/7", M_BZIP2_7, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_7_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/8", M_BZIP2_8, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_8_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+{ "bzip2/9", M_BZIP2_9, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS,
+ bzip2_9_compress, 0,
+ bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 },
+#endif
+
+
+
+{ "memcpy()", M_MEMCPY, 0, 0, memcpy_x_compress, 0,
+ memcpy_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+{ "memset()", M_MEMSET, 0, 0, memset_x_compress, 0,
+ memset_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+{ "adler32()", M_ADLER32, 0, 0, adler32_x_compress, 0,
+ adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+{ "crc32()", M_CRC32, 0, 0, crc32_x_compress, 0,
+ crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+#if defined(ALG_ZLIB)
+{ "z_adler32()", M_Z_ADLER32, 0, 0, zlib_adler32_x_compress, 0,
+ zlib_adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+{ "z_crc32()", M_Z_CRC32, 0, 0, zlib_crc32_x_compress, 0,
+ zlib_crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 },
+#endif
+
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/t_db.ch"
+#endif
+
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/lzotest.c b/ics-openvpn-stripped/main/lzo/lzotest/lzotest.c
new file mode 100644
index 00000000..e4359d3e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/lzotest.c
@@ -0,0 +1,2095 @@
+/* lzotest.c -- very comprehensive test driver for the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo/lzoconf.h"
+
+
+/*************************************************************************
+// util
+**************************************************************************/
+
+/* portability layer */
+#define WANT_LZO_MALLOC 1
+#define WANT_LZO_FREAD 1
+#define WANT_LZO_WILDARGV 1
+#define WANT_LZO_PCLOCK 1
+#define LZO_WANT_ACCLIB_GETOPT 1
+#include "examples/portab.h"
+
+#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP)
+# define strncasecmp(a,b,c) strnicmp(a,b,c)
+# define HAVE_STRNCASECMP 1
+#endif
+
+#if 0
+# define is_digit(x) (isdigit((unsigned char)(x)))
+# define is_space(x) (isspace((unsigned char)(x)))
+#else
+# define is_digit(x) ((unsigned)(x) - '0' <= 9)
+# define is_space(x) ((x)==' ' || (x)=='\t' || (x)=='\r' || (x)=='\n')
+#endif
+
+
+/*************************************************************************
+// compression include section
+**************************************************************************/
+
+#define HAVE_LZO1_H 1
+#define HAVE_LZO1A_H 1
+#define HAVE_LZO1B_H 1
+#define HAVE_LZO1C_H 1
+#define HAVE_LZO1F_H 1
+#define HAVE_LZO1X_H 1
+#define HAVE_LZO1Y_H 1
+#define HAVE_LZO1Z_H 1
+#define HAVE_LZO2A_H 1
+
+#if defined(NO_ZLIB_H) || (SIZEOF_INT < 4)
+#undef HAVE_ZLIB_H
+#endif
+#if defined(NO_BZLIB_H) || (SIZEOF_INT != 4)
+#undef HAVE_BZLIB_H
+#endif
+
+#if 0 && defined(LZO_OS_DOS16)
+/* don't make this test program too big */
+#undef HAVE_LZO1_H
+#undef HAVE_LZO1A_H
+#undef HAVE_LZO1C_H
+#undef HAVE_LZO1Z_H
+#undef HAVE_LZO2A_H
+#undef HAVE_LZO2B_H
+#undef HAVE_ZLIB_H
+#endif
+
+
+/* LZO algorithms */
+#if defined(HAVE_LZO1_H)
+# include "lzo/lzo1.h"
+#endif
+#if defined(HAVE_LZO1A_H)
+# include "lzo/lzo1a.h"
+#endif
+#if defined(HAVE_LZO1B_H)
+# include "lzo/lzo1b.h"
+#endif
+#if defined(HAVE_LZO1C_H)
+# include "lzo/lzo1c.h"
+#endif
+#if defined(HAVE_LZO1F_H)
+# include "lzo/lzo1f.h"
+#endif
+#if defined(HAVE_LZO1X_H)
+# include "lzo/lzo1x.h"
+# if defined(__LZO_PROFESSIONAL__)
+# include "lzo/lzopro/lzo1x.h"
+# endif
+#endif
+#if defined(HAVE_LZO1Y_H)
+# include "lzo/lzo1y.h"
+# if defined(__LZO_PROFESSIONAL__)
+# include "lzo/lzopro/lzo1y.h"
+# endif
+#endif
+#if defined(HAVE_LZO1Z_H)
+# include "lzo/lzo1z.h"
+#endif
+#if defined(HAVE_LZO2A_H)
+# include "lzo/lzo2a.h"
+#endif
+#if defined(HAVE_LZO2B_H)
+# include "lzo/lzo2b.h"
+#endif
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/t_config.ch"
+#endif
+/* other compressors */
+#if defined(HAVE_ZLIB_H)
+# include <zlib.h>
+# define ALG_ZLIB 1
+#endif
+#if defined(HAVE_BZLIB_H)
+# include <bzlib.h>
+# define ALG_BZIP2 1
+#endif
+
+
+/*************************************************************************
+// enumerate all methods
+**************************************************************************/
+
+enum {
+/* compression algorithms */
+ M_LZO1B_1 = 1,
+ M_LZO1B_2, M_LZO1B_3, M_LZO1B_4, M_LZO1B_5,
+ M_LZO1B_6, M_LZO1B_7, M_LZO1B_8, M_LZO1B_9,
+
+ M_LZO1C_1 = 11,
+ M_LZO1C_2, M_LZO1C_3, M_LZO1C_4, M_LZO1C_5,
+ M_LZO1C_6, M_LZO1C_7, M_LZO1C_8, M_LZO1C_9,
+
+ M_LZO1 = 21,
+ M_LZO1A = 31,
+
+ M_LZO1B_99 = 901,
+ M_LZO1B_999 = 902,
+ M_LZO1C_99 = 911,
+ M_LZO1C_999 = 912,
+ M_LZO1_99 = 921,
+ M_LZO1A_99 = 931,
+
+ M_LZO1F_1 = 61,
+ M_LZO1F_999 = 962,
+ M_LZO1X_1 = 71,
+ M_LZO1X_1_11 = 111,
+ M_LZO1X_1_12 = 112,
+ M_LZO1X_1_15 = 115,
+ M_LZO1X_999 = 972,
+ M_LZO1Y_1 = 81,
+ M_LZO1Y_999 = 982,
+ M_LZO1Z_999 = 992,
+
+ M_LZO2A_999 = 942,
+ M_LZO2B_999 = 952,
+
+ M_LAST_LZO_COMPRESSOR = 998,
+
+/* other compressors */
+#if defined(ALG_ZLIB)
+ M_ZLIB_8_1 = 1101,
+ M_ZLIB_8_2, M_ZLIB_8_3, M_ZLIB_8_4, M_ZLIB_8_5,
+ M_ZLIB_8_6, M_ZLIB_8_7, M_ZLIB_8_8, M_ZLIB_8_9,
+#endif
+#if defined(ALG_BZIP2)
+ M_BZIP2_1 = 1201,
+ M_BZIP2_2, M_BZIP2_3, M_BZIP2_4, M_BZIP2_5,
+ M_BZIP2_6, M_BZIP2_7, M_BZIP2_8, M_BZIP2_9,
+#endif
+
+/* dummy compressor - for benchmarking */
+ M_MEMCPY = 999,
+
+ M_LAST_COMPRESSOR = 4999,
+
+/* dummy algorithms - for benchmarking */
+ M_MEMSET = 5001,
+
+/* checksum algorithms - for benchmarking */
+ M_ADLER32 = 6001,
+ M_CRC32 = 6002,
+#if defined(ALG_ZLIB)
+ M_Z_ADLER32 = 6011,
+ M_Z_CRC32 = 6012,
+#endif
+
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/m_enum.ch"
+#endif
+
+ M_UNUSED
+};
+
+
+/*************************************************************************
+// command line options
+**************************************************************************/
+
+int opt_verbose = 2;
+
+long opt_c_loops = 0;
+long opt_d_loops = 0;
+const char *opt_corpus_path = NULL;
+const char *opt_dump_compressed_data = NULL;
+
+lzo_bool opt_use_safe_decompressor = 0;
+lzo_bool opt_use_asm_decompressor = 0;
+lzo_bool opt_use_asm_fast_decompressor = 0;
+lzo_bool opt_optimize_compressed_data = 0;
+
+int opt_dict = 0;
+lzo_uint opt_max_dict_len = LZO_UINT_MAX;
+const char *opt_dictionary_file = NULL;
+
+lzo_bool opt_read_from_stdin = 0;
+
+/* set these to 1 to measure the speed impact of a checksum */
+lzo_bool opt_compute_adler32 = 0;
+lzo_bool opt_compute_crc32 = 0;
+static lzo_uint32_t adler_in, adler_out;
+static lzo_uint32_t crc_in, crc_out;
+
+lzo_bool opt_execution_time = 0;
+int opt_pclock = -1;
+lzo_bool opt_clear_wrkmem = 0;
+
+static const lzo_bool opt_try_to_compress_0_bytes = 1;
+
+
+/*************************************************************************
+// misc globals
+**************************************************************************/
+
+static const char *progname = "";
+static lzo_pclock_handle_t pch;
+
+/* for statistics and benchmark */
+int opt_totals = 0;
+static unsigned long total_n = 0;
+static unsigned long total_c_len = 0;
+static unsigned long total_d_len = 0;
+static unsigned long total_blocks = 0;
+static double total_perc = 0.0;
+static const char *total_method_name = NULL;
+static unsigned total_method_names = 0;
+/* Note: the average value of a rate (e.g. compression speed) is defined
+ * by the Harmonic Mean (and _not_ by the Arithmethic Mean ) */
+static unsigned long total_c_mbs_n = 0;
+static unsigned long total_d_mbs_n = 0;
+static double total_c_mbs_harmonic = 0.0;
+static double total_d_mbs_harmonic = 0.0;
+static double total_c_mbs_sum = 0.0;
+static double total_d_mbs_sum = 0.0;
+
+
+#if defined(HAVE_LZO1X_H)
+int default_method = M_LZO1X_1;
+#elif defined(HAVE_LZO1B_H)
+int default_method = M_LZO1B_1;
+#elif defined(HAVE_LZO1C_H)
+int default_method = M_LZO1C_1;
+#elif defined(HAVE_LZO1F_H)
+int default_method = M_LZO1F_1;
+#elif defined(HAVE_LZO1Y_H)
+int default_method = M_LZO1Y_1;
+#else
+int default_method = M_MEMCPY;
+#endif
+
+
+static const int benchmark_methods[] = {
+ M_LZO1B_1, M_LZO1B_9,
+ M_LZO1C_1, M_LZO1C_9,
+ M_LZO1F_1,
+ M_LZO1X_1,
+ 0
+};
+
+static const int x1_methods[] = {
+ M_LZO1, M_LZO1A, M_LZO1B_1, M_LZO1C_1, M_LZO1F_1, M_LZO1X_1, M_LZO1Y_1,
+ 0
+};
+
+static const int x99_methods[] = {
+ M_LZO1_99, M_LZO1A_99, M_LZO1B_99, M_LZO1C_99,
+ 0
+};
+
+static const int x999_methods[] = {
+ M_LZO1B_999, M_LZO1C_999, M_LZO1F_999, M_LZO1X_999, M_LZO1Y_999,
+ M_LZO1Z_999,
+ M_LZO2A_999,
+ 0
+};
+
+
+/* exit codes of this test program */
+#define EXIT_OK 0
+#define EXIT_USAGE 1
+#define EXIT_FILE 2
+#define EXIT_MEM 3
+#define EXIT_ADLER 4
+#define EXIT_LZO_ERROR 5
+#define EXIT_LZO_INIT 6
+#define EXIT_INTERNAL 7
+
+
+/*************************************************************************
+// memory setup
+**************************************************************************/
+
+static lzo_uint opt_block_size;
+static lzo_uint opt_max_data_len;
+
+typedef struct {
+ lzo_bytep ptr;
+ lzo_uint len;
+ lzo_uint32_t adler;
+ lzo_uint32_t crc;
+ lzo_bytep alloc_ptr;
+ lzo_uint alloc_len;
+ lzo_uint saved_len;
+} mblock_t;
+
+static mblock_t file_data; /* original uncompressed data */
+static mblock_t block_c; /* compressed data */
+static mblock_t block_d; /* decompressed data */
+static mblock_t block_w; /* wrkmem */
+static mblock_t dict;
+
+
+static void mb_alloc_extra(mblock_t *mb, lzo_uint len, lzo_uint extra_bottom, lzo_uint extra_top)
+{
+ lzo_uint align = (lzo_uint) sizeof(lzo_align_t);
+
+ mb->alloc_ptr = mb->ptr = NULL;
+ mb->alloc_len = mb->len = 0;
+
+ mb->alloc_len = extra_bottom + len + extra_top;
+ if (mb->alloc_len == 0) mb->alloc_len = 1;
+ mb->alloc_ptr = (lzo_bytep) lzo_malloc(mb->alloc_len);
+
+ if (mb->alloc_ptr == NULL) {
+ fprintf(stderr, "%s: out of memory (wanted %lu bytes)\n", progname, (unsigned long)mb->alloc_len);
+ exit(EXIT_MEM);
+ }
+ if (mb->alloc_len >= align && __lzo_align_gap(mb->alloc_ptr, align) != 0) {
+ fprintf(stderr, "%s: C library problem: malloc() returned misaligned pointer!\n", progname);
+ exit(EXIT_MEM);
+ }
+
+ mb->ptr = mb->alloc_ptr + extra_bottom;
+ mb->len = mb->saved_len = len;
+ mb->adler = 1;
+ mb->crc = 0;
+}
+
+
+static void mb_alloc(mblock_t *mb, lzo_uint len)
+{
+ mb_alloc_extra(mb, len, 0, 0);
+}
+
+
+static void mb_free(mblock_t *mb)
+{
+ if (!mb) return;
+ if (mb->alloc_ptr) lzo_free(mb->alloc_ptr);
+ mb->alloc_ptr = mb->ptr = NULL;
+ mb->alloc_len = mb->len = 0;
+}
+
+
+static lzo_uint get_max_compression_expansion(int m, lzo_uint bl)
+{
+ if (m == M_MEMCPY || m >= M_LAST_COMPRESSOR)
+ return 0;
+ if (m == M_LZO2A_999 || m == M_LZO2B_999)
+ return bl / 8 + 256;
+ if (m > 0 && m < M_LAST_LZO_COMPRESSOR)
+ return bl / 16 + 64 + 3;
+ return bl / 8 + 256;
+}
+
+static lzo_uint get_max_decompression_overrun(int m, lzo_uint bl)
+{
+ LZO_UNUSED(m);
+ LZO_UNUSED(bl);
+ /* may overwrite 3 bytes past the end of the decompressed block */
+ if (opt_use_asm_fast_decompressor)
+ return (lzo_uint) sizeof(lzo_voidp) - 1;
+ return 0;
+}
+
+
+/*************************************************************************
+// dictionary support
+**************************************************************************/
+
+static void dict_alloc(lzo_uint max_dict_len)
+{
+ lzo_uint l = 0xbfff; /* MAX_DICT_LEN */
+ if (max_dict_len > 0 && l > max_dict_len)
+ l = max_dict_len;
+ mb_alloc(&dict, l);
+}
+
+
+/* this default dictionary does not provide good contexts... */
+static void dict_set_default(void)
+{
+ lzo_uint d = 0;
+ unsigned i, j;
+
+ dict.len = 16 * 256;
+ if (dict.len > dict.alloc_len)
+ dict.len = dict.alloc_len;
+
+ lzo_memset(dict.ptr, 0, dict.len);
+
+ for (i = 0; i < 256; i++)
+ for (j = 0; j < 16; j++) {
+ if (d >= dict.len)
+ goto done;
+ dict.ptr[d++] = (unsigned char) i;
+ }
+
+done:
+ dict.adler = lzo_adler32(1, dict.ptr, dict.len);
+}
+
+
+static void dict_load(const char *file_name)
+{
+ FILE *fp;
+
+ dict.len = 0;
+ fp = fopen(file_name, "rb");
+ if (fp)
+ {
+ dict.len = (lzo_uint) lzo_fread(fp, dict.ptr, dict.alloc_len);
+ (void) fclose(fp);
+ dict.adler = lzo_adler32(1, dict.ptr, dict.len);
+ }
+}
+
+
+/*************************************************************************
+// compression database
+**************************************************************************/
+
+typedef struct
+{
+ const char * name;
+ int id;
+ lzo_uint32_t mem_compress;
+ lzo_uint32_t mem_decompress;
+ lzo_compress_t compress;
+ lzo_optimize_t optimize;
+ lzo_decompress_t decompress;
+ lzo_decompress_t decompress_safe;
+ lzo_decompress_t decompress_asm;
+ lzo_decompress_t decompress_asm_safe;
+ lzo_decompress_t decompress_asm_fast;
+ lzo_decompress_t decompress_asm_fast_safe;
+ lzo_compress_dict_t compress_dict;
+ lzo_decompress_dict_t decompress_dict_safe;
+}
+compress_t;
+
+#include "asm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "wrap.h"
+#define M_PRIVATE LZO_PRIVATE
+#define m_uint lzo_uint
+#define m_uint32_t lzo_uint32_t
+#define m_voidp lzo_voidp
+#define m_bytep lzo_bytep
+#define m_uintp lzo_uintp
+#include "wrapmisc.h"
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+static const compress_t compress_database[] = {
+#include "db.h"
+{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+
+/*************************************************************************
+// method info
+**************************************************************************/
+
+static
+lzo_decompress_t get_decomp_info ( const compress_t *c, const char **nn )
+{
+ lzo_decompress_t d = 0;
+ const char *n = NULL;
+
+ /* safe has priority over asm/fast */
+ if (!d && opt_use_safe_decompressor && opt_use_asm_fast_decompressor)
+ {
+ d = c->decompress_asm_fast_safe;
+ n = " [fs]";
+ }
+ if (!d && opt_use_safe_decompressor && opt_use_asm_decompressor)
+ {
+ d = c->decompress_asm_safe;
+ n = " [as]";
+ }
+ if (!d && opt_use_safe_decompressor)
+ {
+ d = c->decompress_safe;
+ n = " [s]";
+ }
+ if (!d && opt_use_asm_fast_decompressor)
+ {
+ d = c->decompress_asm_fast;
+ n = " [f]";
+ }
+ if (!d && opt_use_asm_decompressor)
+ {
+ d = c->decompress_asm;
+ n = " [a]";
+ }
+ if (!d)
+ {
+ d = c->decompress;
+ n = "";
+ }
+ if (!d)
+ n = "(null)";
+
+ if (opt_dict && c->decompress_dict_safe)
+ n = "";
+
+ if (nn)
+ *nn = n;
+ return d;
+}
+
+
+static
+const compress_t *find_method_by_id ( int method )
+{
+ const compress_t *db;
+ size_t size = sizeof(compress_database) / sizeof(*(compress_database));
+ size_t i;
+
+ db = compress_database;
+ for (i = 0; i < size && db->name != NULL; i++, db++)
+ {
+ if (method == db->id)
+ return db;
+ }
+ return NULL;
+}
+
+
+static
+const compress_t *find_method_by_name ( const char *name )
+{
+ const compress_t *db;
+ size_t size = sizeof(compress_database) / sizeof(*(compress_database));
+ size_t i;
+
+ db = compress_database;
+ for (i = 0; i < size && db->name != NULL; i++, db++)
+ {
+ size_t n = strlen(db->name);
+
+#if defined(HAVE_STRNCASECMP)
+ if (strncasecmp(name,db->name,n) == 0 && (!name[n] || name[n] == ','))
+ return db;
+#else
+ if (strncmp(name,db->name,n) == 0 && (!name[n] || name[n] == ','))
+ return db;
+#endif
+ }
+ return NULL;
+}
+
+
+static
+lzo_bool is_compressor ( const compress_t *c )
+{
+ return (c->id <= M_LAST_COMPRESSOR || c->id >= 9721);
+}
+
+
+/*************************************************************************
+// check that memory gets accessed within bounds
+**************************************************************************/
+
+static void memchecker_init ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
+{
+ lzo_uint i;
+ lzo_uint len = (lzo_uint) l;
+ lzo_bytep p;
+
+ assert(len <= mb->len);
+
+ /* bottom */
+ p = mb->ptr;
+ for (i = 0; i < 16 && p > mb->alloc_ptr; i++)
+ *--p = random_byte++;
+ /* top */
+ p = mb->ptr + len;
+ for (i = 0; i < 16 && p < mb->alloc_ptr + mb->alloc_len; i++)
+ *p++ = random_byte++;
+#if 0 || defined(LZO_DEBUG)
+ /* fill in garbage */
+ p = mb->ptr;
+ random_byte |= 1;
+ for (i = 0; i < len; i++, random_byte += 2)
+ *p++ = random_byte;
+#endif
+}
+
+
+static int memchecker_check ( mblock_t *mb, lzo_xint l, unsigned char random_byte )
+{
+ lzo_uint i;
+ lzo_uint len = (lzo_uint) l;
+ lzo_bytep p;
+
+ assert(len <= mb->len);
+
+ /* bottom */
+ p = mb->ptr;
+ for (i = 0; i < 16 && p > mb->alloc_ptr; i++)
+ if (*--p != random_byte++)
+ return -1;
+ /* top */
+ p = mb->ptr + len;
+ for (i = 0; i < 16 && p < mb->alloc_ptr + mb->alloc_len; i++)
+ if (*p++ != random_byte++)
+ return -1;
+ return 0;
+}
+
+
+/*************************************************************************
+// compress a block
+**************************************************************************/
+
+static
+int call_compressor ( const compress_t *c,
+ const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len )
+{
+ int r = -100;
+
+ if (c && c->compress && block_w.len >= c->mem_compress)
+ {
+ unsigned char random_byte = (unsigned char) src_len;
+ memchecker_init(&block_w, c->mem_compress, random_byte);
+ if (opt_clear_wrkmem)
+ lzo_memset(block_w.ptr, 0, c->mem_compress);
+
+ if (opt_dict && c->compress_dict)
+ r = c->compress_dict(src,src_len,dst,dst_len,block_w.ptr,dict.ptr,dict.len);
+ else
+ r = c->compress(src,src_len,dst,dst_len,block_w.ptr);
+
+ if (memchecker_check(&block_w, c->mem_compress, random_byte) != 0)
+ printf("WARNING: wrkmem overwrite error (compress) !!!\n");
+ }
+
+ if (r == 0 && opt_compute_adler32)
+ {
+ lzo_uint32_t adler;
+ adler = lzo_adler32(0, NULL, 0);
+ adler = lzo_adler32(adler, src, src_len);
+ adler_in = adler;
+ }
+ if (r == 0 && opt_compute_crc32)
+ {
+ lzo_uint32_t crc;
+ crc = lzo_crc32(0, NULL, 0);
+ crc = lzo_crc32(crc, src, src_len);
+ crc_in = crc;
+ }
+
+ return r;
+}
+
+
+/*************************************************************************
+// decompress a block
+**************************************************************************/
+
+static
+int call_decompressor ( const compress_t *c, lzo_decompress_t d,
+ const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len )
+{
+ int r = -100;
+
+ if (c && d && block_w.len >= c->mem_decompress)
+ {
+ unsigned char random_byte = (unsigned char) src_len;
+ memchecker_init(&block_w, c->mem_decompress, random_byte);
+ if (opt_clear_wrkmem)
+ lzo_memset(block_w.ptr, 0, c->mem_decompress);
+
+ if (opt_dict && c->decompress_dict_safe)
+ r = c->decompress_dict_safe(src,src_len,dst,dst_len,block_w.ptr,dict.ptr,dict.len);
+ else
+ r = d(src,src_len,dst,dst_len,block_w.ptr);
+
+ if (memchecker_check(&block_w, c->mem_decompress, random_byte) != 0)
+ printf("WARNING: wrkmem overwrite error (decompress) !!!\n");
+ }
+
+ if (r == 0 && opt_compute_adler32)
+ adler_out = lzo_adler32(1, dst, *dst_len);
+ if (r == 0 && opt_compute_crc32)
+ crc_out = lzo_crc32(0, dst, *dst_len);
+
+ return r;
+}
+
+
+/*************************************************************************
+// optimize a block
+**************************************************************************/
+
+static
+int call_optimizer ( const compress_t *c,
+ lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len )
+{
+ if (c && c->optimize && block_w.len >= c->mem_decompress)
+ return c->optimize(src,src_len,dst,dst_len,block_w.ptr);
+ return 0;
+}
+
+
+/***********************************************************************
+// read a file
+************************************************************************/
+
+static int load_file(const char *file_name, lzo_uint max_data_len)
+{
+ FILE *fp;
+#if (HAVE_FTELLO)
+ off_t ll = -1;
+#else
+ long ll = -1;
+#endif
+ lzo_uint l;
+ int r;
+ mblock_t *mb = &file_data;
+
+ mb_free(mb);
+
+ fp = fopen(file_name, "rb");
+ if (fp == NULL)
+ {
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "%s: ", file_name);
+ fflush(stderr);
+ perror("fopen");
+ fflush(stdout); fflush(stderr);
+ return EXIT_FILE;
+ }
+ r = fseek(fp, 0, SEEK_END);
+ if (r == 0)
+ {
+#if (HAVE_FTELLO)
+ ll = ftello(fp);
+#else
+ ll = ftell(fp);
+#endif
+ r = fseek(fp, 0, SEEK_SET);
+ }
+ if (r != 0 || ll < 0)
+ {
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "%s: ", file_name);
+ fflush(stderr);
+ perror("fseek");
+ fflush(stdout); fflush(stderr);
+ (void) fclose(fp);
+ return EXIT_FILE;
+ }
+
+ l = (lzo_uint) ll;
+ if (l > max_data_len) l = max_data_len;
+#if (HAVE_FTELLO)
+ if ((off_t) l != ll) l = max_data_len;
+#else
+ if ((long) l != ll) l = max_data_len;
+#endif
+
+ mb_alloc(mb, l);
+ mb->len = (lzo_uint) lzo_fread(fp, mb->ptr, mb->len);
+
+ r = ferror(fp);
+ if (fclose(fp) != 0 || r != 0)
+ {
+ mb_free(mb);
+ fflush(stdout); fflush(stderr);
+ fprintf(stderr, "%s: ", file_name);
+ fflush(stderr);
+ perror("fclose");
+ fflush(stdout); fflush(stderr);
+ return EXIT_FILE;
+ }
+
+ return EXIT_OK;
+}
+
+
+/***********************************************************************
+// print some compression statistics
+************************************************************************/
+
+static double t_div(double a, double b)
+{
+ return b > 0.00001 ? a / b : 0;
+}
+
+static double set_perc_d(double perc, char *s)
+{
+ if (perc <= 0.0) {
+ strcpy(s, "0.0");
+ return 0;
+ }
+ if (perc <= 100 - 1.0 / 16) {
+ sprintf(s, "%4.1f", perc);
+ }
+ else {
+ long p = (long) (perc + 0.5);
+ if (p < 100)
+ strcpy(s, "???");
+ else if (p >= 9999)
+ strcpy(s, "9999");
+ else
+ sprintf(s, "%ld", p);
+ }
+ return perc;
+}
+
+static double set_perc(unsigned long c_len, unsigned long d_len, char *s)
+{
+ double perc = 0.0;
+ if (d_len > 0)
+ perc = c_len * 100.0 / d_len;
+ return set_perc_d(perc, s);
+}
+
+
+static
+void print_stats ( const char *method_name, const char *file_name,
+ long t_loops, long c_loops, long d_loops,
+ double t_secs, double c_secs, double d_secs,
+ unsigned long c_len, unsigned long d_len,
+ unsigned long blocks )
+{
+ unsigned long x_len = d_len;
+ unsigned long t_bytes, c_bytes, d_bytes;
+ double c_mbs, d_mbs, t_mbs;
+ double perc;
+ char perc_str[4+1];
+
+ perc = set_perc(c_len, d_len, perc_str);
+
+ c_bytes = x_len * c_loops * t_loops;
+ d_bytes = x_len * d_loops * t_loops;
+ t_bytes = c_bytes + d_bytes;
+
+ if (opt_pclock == 0)
+ c_secs = d_secs = t_secs = 0.0;
+
+ /* speed in uncompressed megabytes per second (1 megabyte = 1.000.000 bytes) */
+ c_mbs = (c_secs > 0.001) ? (c_bytes / c_secs) / 1000000.0 : 0;
+ d_mbs = (d_secs > 0.001) ? (d_bytes / d_secs) / 1000000.0 : 0;
+ t_mbs = (t_secs > 0.001) ? (t_bytes / t_secs) / 1000000.0 : 0;
+
+ total_n++;
+ total_c_len += c_len;
+ total_d_len += d_len;
+ total_blocks += blocks;
+ total_perc += perc;
+ if (c_mbs > 0) {
+ total_c_mbs_n += 1;
+ total_c_mbs_harmonic += 1.0 / c_mbs;
+ total_c_mbs_sum += c_mbs;
+ }
+ if (d_mbs > 0) {
+ total_d_mbs_n += 1;
+ total_d_mbs_harmonic += 1.0 / d_mbs;
+ total_d_mbs_sum += d_mbs;
+ }
+
+ if (opt_verbose >= 2)
+ {
+ printf(" compressed into %lu bytes, %s%% (%s%.3f bits/byte)\n",
+ c_len, perc_str, "", perc * 0.08);
+
+#if 0
+ printf("%-15s %5ld: ","overall", t_loops);
+ printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n",
+ t_bytes, t_secs, t_mbs);
+#else
+ LZO_UNUSED(t_mbs);
+#endif
+ printf("%-15s %5ld: ","compress", c_loops);
+ printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n",
+ c_bytes, c_secs, c_mbs);
+ printf("%-15s %5ld: ","decompress", d_loops);
+ printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n",
+ d_bytes, d_secs, d_mbs);
+ printf("\n");
+ }
+
+ /* create a line for util/table.pl */
+ if (opt_verbose >= 1)
+ {
+ /* get basename */
+ const char *n, *nn, *b;
+ for (nn = n = b = file_name; *nn; nn++)
+ if (*nn == '/' || *nn == '\\' || *nn == ':')
+ b = nn + 1;
+ else
+ n = b;
+
+ printf("%-13s| %-14s %8lu %4lu %9lu %4s %s%8.3f %8.3f |\n",
+ method_name, n, d_len, blocks, c_len, perc_str, "", c_mbs, d_mbs);
+ }
+
+ if (opt_verbose >= 2)
+ printf("\n");
+}
+
+
+static
+void print_totals ( void )
+{
+ char perc_str[4+1];
+
+ if ((opt_verbose >= 1 && total_n > 1) || (opt_totals >= 2))
+ {
+ unsigned long n = total_n > 0 ? total_n : 1;
+ const char *t1 = "-------";
+ const char *t2 = total_method_names == 1 ? total_method_name : "";
+#if 1 && defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ char pclock_mode[32+1];
+ sprintf(pclock_mode, "[clock=%d]", pch.mode);
+ t1 = pclock_mode;
+ if (opt_pclock == 0) t1 = t2;
+#endif
+
+#if 1
+ set_perc_d(total_perc / n, perc_str);
+ printf("%-13s %-12s %10lu %4.1f %9lu %4s %8.3f %8.3f\n",
+ t1, "***AVG***",
+ total_d_len / n, total_blocks * 1.0 / n, total_c_len / n, perc_str,
+ t_div((double)total_c_mbs_n, total_c_mbs_harmonic),
+ t_div((double)total_d_mbs_n, total_d_mbs_harmonic));
+#endif
+ set_perc(total_c_len, total_d_len, perc_str);
+ printf("%-13s %-12s %10lu %4lu %9lu %4s %s%8.3f %8.3f\n",
+ t2, "***TOTALS***",
+ total_d_len, total_blocks, total_c_len, perc_str, "",
+ t_div((double)total_c_mbs_n, total_c_mbs_harmonic),
+ t_div((double)total_d_mbs_n, total_d_mbs_harmonic));
+ }
+}
+
+
+/*************************************************************************
+// compress and decompress a file
+**************************************************************************/
+
+static __lzo_noinline
+int process_file ( const compress_t *c, lzo_decompress_t decompress,
+ const char *method_name,
+ const char *file_name,
+ long t_loops, long c_loops, long d_loops )
+{
+ long t_i;
+ unsigned long blocks = 0;
+ unsigned long compressed_len = 0;
+ double t_time = 0, c_time = 0, d_time = 0;
+ lzo_pclock_t t_start, t_stop, x_start, x_stop;
+ FILE *fp_dump = NULL;
+
+ if (opt_dump_compressed_data)
+ fp_dump = fopen(opt_dump_compressed_data,"wb");
+
+/* process the file */
+
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &t_start);
+ for (t_i = 0; t_i < t_loops; t_i++)
+ {
+ lzo_uint len, c_len, c_len_max, d_len = 0;
+ const lzo_bytep d = file_data.ptr;
+
+ len = file_data.len;
+ c_len = 0;
+ blocks = 0;
+
+ /* process blocks */
+ if (len > 0 || opt_try_to_compress_0_bytes) do
+ {
+ lzo_uint bl;
+ long c_i;
+ int r;
+ unsigned char random_byte = (unsigned char) file_data.len;
+#if 1 && defined(CLOCKS_PER_SEC)
+ random_byte = (unsigned char) (random_byte ^ clock());
+#endif
+ blocks++;
+
+ bl = len > opt_block_size ? opt_block_size : len;
+ /* update lengths for memchecker_xxx() */
+ block_c.len = bl + get_max_compression_expansion(c->id, bl);
+ block_d.len = bl + get_max_decompression_overrun(c->id, bl);
+#if defined(__LZO_CHECKER)
+ /* malloc a block of the exact size to detect any overrun */
+ assert(block_c.alloc_ptr == NULL);
+ assert(block_d.alloc_ptr == NULL);
+ mb_alloc(&block_c, block_c.len);
+ mb_alloc(&block_d, block_d.len);
+#endif
+ assert(block_c.len <= block_c.saved_len);
+ assert(block_d.len <= block_d.saved_len);
+
+ memchecker_init(&block_c, block_c.len, random_byte);
+ memchecker_init(&block_d, block_d.len, random_byte);
+
+ /* compress the block */
+ c_len = c_len_max = 0;
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &x_start);
+ for (r = 0, c_i = 0; c_i < c_loops; c_i++)
+ {
+ c_len = block_c.len;
+ r = call_compressor(c, d, bl, block_c.ptr, &c_len);
+ if (r != 0)
+ break;
+ if (c_len > c_len_max)
+ c_len_max = c_len;
+ if (c_len > block_c.len)
+ goto compress_overrun;
+ }
+ lzo_pclock_read(&pch, &x_stop);
+ c_time += lzo_pclock_get_elapsed(&pch, &x_start, &x_stop);
+ if (r != 0)
+ {
+ printf(" compression failed in block %lu (%d) (%lu %lu)\n",
+ blocks, r, (unsigned long)c_len, (unsigned long)bl);
+ return EXIT_LZO_ERROR;
+ }
+ if (memchecker_check(&block_c, block_c.len, random_byte) != 0)
+ {
+compress_overrun:
+ printf(" compression overwrite error in block %lu "
+ "(%lu %lu %lu %lu)\n",
+ blocks, (unsigned long)c_len, (unsigned long)d_len, (unsigned long)bl, (unsigned long)block_c.len);
+ return EXIT_LZO_ERROR;
+ }
+
+ /* optimize the compressed block */
+ if (c_len < bl && opt_optimize_compressed_data)
+ {
+ d_len = bl;
+ r = call_optimizer(c, block_c.ptr, c_len, block_d.ptr, &d_len);
+ if (r != 0 || d_len != bl)
+ {
+ printf(" optimization failed in block %lu (%d) "
+ "(%lu %lu %lu)\n", blocks, r,
+ (unsigned long)c_len, (unsigned long)d_len, (unsigned long)bl);
+ return EXIT_LZO_ERROR;
+ }
+ if (memchecker_check(&block_c, block_c.len, random_byte) != 0 ||
+ memchecker_check(&block_d, block_d.len, random_byte) != 0)
+ {
+ printf(" optimize overwrite error in block %lu "
+ "(%lu %lu %lu %lu)\n",
+ blocks, (unsigned long)c_len, (unsigned long)d_len, (unsigned long)bl, (unsigned long)block_c.len);
+ return EXIT_LZO_ERROR;
+ }
+ }
+
+ /* dump compressed data to disk */
+ if (fp_dump)
+ {
+ lzo_uint l = (lzo_uint) lzo_fwrite(fp_dump, block_c.ptr, c_len);
+ if (l != c_len || fflush(fp_dump) != 0) {
+ /* write error */
+ (void) fclose(fp_dump); fp_dump = NULL;
+ }
+ }
+
+ /* decompress the block and verify */
+ lzo_pclock_flush_cpu_cache(&pch, 0);
+ lzo_pclock_read(&pch, &x_start);
+ for (r = 0, c_i = 0; c_i < d_loops; c_i++)
+ {
+ d_len = bl;
+ r = call_decompressor(c, decompress, block_c.ptr, c_len, block_d.ptr, &d_len);
+ if (r != 0 || d_len != bl)
+ break;
+ }
+ lzo_pclock_read(&pch, &x_stop);
+ d_time += lzo_pclock_get_elapsed(&pch, &x_start, &x_stop);
+ if (r != 0)
+ {
+ printf(" decompression failed in block %lu (%d) "
+ "(%lu %lu %lu)\n", blocks, r,
+ (unsigned long)c_len, (unsigned long)d_len, (unsigned long)bl);
+ return EXIT_LZO_ERROR;
+ }
+ if (d_len != bl)
+ {
+ printf(" decompression size error in block %lu (%lu %lu %lu)\n",
+ blocks, (unsigned long)c_len, (unsigned long)d_len, (unsigned long)bl);
+ return EXIT_LZO_ERROR;
+ }
+ if (is_compressor(c))
+ {
+ if (lzo_memcmp(d, block_d.ptr, bl) != 0)
+ {
+ lzo_uint x = 0;
+ while (x < bl && block_d.ptr[x] == d[x])
+ x++;
+ printf(" decompression data error in block %lu at offset "
+ "%lu (%lu %lu)\n", blocks, (unsigned long)x,
+ (unsigned long)c_len, (unsigned long)d_len);
+ if (opt_compute_adler32)
+ printf(" checksum: 0x%08lx 0x%08lx\n",
+ (unsigned long)adler_in, (unsigned long)adler_out);
+#if 0
+ printf("Orig: ");
+ r = (x >= 10) ? -10 : 0 - (int) x;
+ for (j = r; j <= 10 && x + j < bl; j++)
+ printf(" %02x", (int)d[x+j]);
+ printf("\nDecomp:");
+ for (j = r; j <= 10 && x + j < bl; j++)
+ printf(" %02x", (int)block_d.ptr[x+j]);
+ printf("\n");
+#endif
+ return EXIT_LZO_ERROR;
+ }
+ if ((opt_compute_adler32 && adler_in != adler_out) ||
+ (opt_compute_crc32 && crc_in != crc_out))
+ {
+ printf(" checksum error in block %lu (%lu %lu)\n",
+ blocks, (unsigned long)c_len, (unsigned long)d_len);
+ printf(" adler32: 0x%08lx 0x%08lx\n",
+ (unsigned long)adler_in, (unsigned long)adler_out);
+ printf(" crc32: 0x%08lx 0x%08lx\n",
+ (unsigned long)crc_in, (unsigned long)crc_out);
+ return EXIT_LZO_ERROR;
+ }
+ }
+
+ if (memchecker_check(&block_d, block_d.len, random_byte) != 0)
+ {
+ printf(" decompression overwrite error in block %lu "
+ "(%lu %lu %lu %lu)\n",
+ blocks, (unsigned long)c_len, (unsigned long)d_len,
+ (unsigned long)bl, (unsigned long)block_d.len);
+ return EXIT_LZO_ERROR;
+ }
+
+#if defined(__LZO_CHECKER)
+ /* free in reverse order of allocations */
+ mb_free(&block_d);
+ mb_free(&block_c);
+#endif
+
+ d += bl;
+ len -= bl;
+ compressed_len += (unsigned long) c_len_max;
+ }
+ while (len > 0);
+ }
+ lzo_pclock_read(&pch, &t_stop);
+ t_time += lzo_pclock_get_elapsed(&pch, &t_start, &t_stop);
+
+ if (fp_dump) {
+ (void) fclose(fp_dump); fp_dump = NULL;
+ }
+ opt_dump_compressed_data = NULL; /* only dump the first file */
+
+ print_stats(method_name, file_name,
+ t_loops, c_loops, d_loops,
+ t_time, c_time, d_time,
+ compressed_len, (unsigned long) file_data.len, blocks);
+ if (total_method_name != c->name) {
+ total_method_name = c->name;
+ total_method_names += 1;
+ }
+
+ return EXIT_OK;
+}
+
+
+
+static
+int do_file ( int method, const char *file_name,
+ long c_loops, long d_loops,
+ lzo_uint32_tp p_adler, lzo_uint32_tp p_crc )
+{
+ int r;
+ const compress_t *c;
+ lzo_decompress_t decompress;
+ lzo_uint32_t adler, crc;
+ char method_name[256+1];
+ const char *n;
+ const long t_loops = 1;
+
+ adler_in = adler_out = 0;
+ crc_in = crc_out = 0;
+ if (p_adler)
+ *p_adler = 0;
+ if (p_crc)
+ *p_crc = 0;
+
+ c = find_method_by_id(method);
+ if (c == NULL || c->name == NULL || c->compress == NULL)
+ return EXIT_INTERNAL;
+ decompress = get_decomp_info(c,&n);
+ if (!decompress || n == NULL || block_w.len < c->mem_decompress)
+ return EXIT_INTERNAL;
+ strcpy(method_name,c->name);
+ strcat(method_name,n);
+
+ if (c_loops < 1) c_loops = 1;
+ if (d_loops < 1) d_loops = 1;
+
+ fflush(stdout); fflush(stderr);
+
+ /* read the whole file */
+ r = load_file(file_name, opt_max_data_len);
+ if (r != 0)
+ return r;
+
+ /* compute some checksums */
+ adler = lzo_adler32(0, NULL, 0);
+ adler = lzo_adler32(adler, file_data.ptr, file_data.len);
+ if (p_adler)
+ *p_adler = adler;
+ crc = lzo_crc32(0, NULL, 0);
+ crc = lzo_crc32(crc, file_data.ptr, file_data.len);
+ if (p_crc)
+ *p_crc = crc;
+
+ if (opt_verbose >= 2)
+ {
+ printf("File %s: %lu bytes (0x%08lx, 0x%08lx)\n",
+ file_name, (unsigned long) file_data.len, (unsigned long) adler, (unsigned long) crc);
+ printf(" compressing %lu bytes (%ld/%ld/%ld loops, %lu block-size)\n",
+ (unsigned long) file_data.len, t_loops, c_loops, d_loops, (unsigned long) opt_block_size);
+ printf(" %s\n", method_name);
+ }
+
+ r = process_file(c, decompress, method_name, file_name,
+ t_loops, c_loops, d_loops);
+
+ return r;
+}
+
+
+/*************************************************************************
+// Calgary Corpus and Silesia Corpus test suite driver
+**************************************************************************/
+
+struct corpus_entry_t
+{
+ const char *name;
+ long loops;
+ lzo_uint32_t adler;
+ lzo_uint32_t crc;
+};
+
+const struct corpus_entry_t *opt_corpus = NULL;
+
+static const struct corpus_entry_t calgary_corpus[] =
+{
+ { "bib", 8, 0x4bd09e98L, 0xb856ebe8L },
+ { "book1", 1, 0xd4d3613eL, 0x24e19972L },
+ { "book2", 1, 0x6fe14cc3L, 0xba0f3f26L },
+ { "geo", 6, 0xf3cc5be0L, 0x4d3a6ed0L },
+ { "news", 2, 0x2ed405b8L, 0xcafac853L },
+ { "obj1", 35, 0x3887dd2cL, 0xc7b0cd26L },
+ { "obj2", 4, 0xf89407c4L, 0x3ae33007L },
+ { "paper1", 17, 0xfe65ce62L, 0x2b6baca0L },
+ { "paper2", 11, 0x1238b7c2L, 0xf76cba72L },
+ { "pic", 4, 0xf61a5702L, 0x4b17e59cL },
+ { "progc", 25, 0x4c00ba45L, 0x6fb16094L },
+ { "progl", 20, 0x4cba738eL, 0xddbf6baaL },
+ { "progp", 28, 0x7495b92bL, 0x493a1809L },
+ { "trans", 15, 0x52a2cec8L, 0xcdec06a6L },
+ { NULL, 0, 0x00000000L, 0x00000000L }
+};
+
+static const struct corpus_entry_t silesia_corpus[] =
+{
+ { "dickens", 1, 0x170f606fL, 0xaf3a6b76L },
+ { "mozilla", 1, 0x1188dd4eL, 0x7fb0ab7dL },
+ { "mr", 1, 0xaea14b97L, 0xa341883fL },
+ { "nci", 1, 0x0af16f1fL, 0x60ff63d3L },
+ { "ooffice", 1, 0x83c8f689L, 0xa023e1faL },
+ { "osdb", 1, 0xb825b790L, 0xa0ca388cL },
+ { "reymont", 1, 0xce5c82caL, 0x50d35f03L },
+ { "samba", 1, 0x19dbb9f5L, 0x2beac5f3L },
+ { "sao", 1, 0x7edfc4a9L, 0xfda125bfL },
+ { "webster", 1, 0xf2962fc6L, 0x01f5a2e9L },
+ { "xml", 1, 0xeccd03d6L, 0xff8f3051L },
+ { "x-ray", 1, 0xc95435a0L, 0xc86a35c6L },
+ { NULL, 0, 0x00000000L, 0x00000000L }
+};
+
+
+static
+int do_corpus ( const struct corpus_entry_t *corpus, int method, const char *path,
+ long c_loops, long d_loops )
+{
+ size_t i, n;
+ char name[256];
+
+ if (path == NULL || strlen(path) >= sizeof(name) - 12)
+ return EXIT_USAGE;
+
+ strcpy(name,path);
+ n = strlen(name);
+ if (n > 0 && name[n-1] != '/' && name[n-1] != '\\' && name[n-1] != ':')
+ {
+ strcat(name,"/");
+ n++;
+ }
+
+ for (i = 0; corpus[i].name != NULL; i++)
+ {
+ lzo_uint32_t adler, crc;
+ long c = c_loops * corpus[i].loops;
+ long d = d_loops * corpus[i].loops;
+ int r;
+
+ strcpy(name+n,corpus[i].name);
+ r = do_file(method, name, c, d, &adler, &crc);
+ if (r != 0)
+ return r;
+ if (adler != corpus[i].adler)
+ {
+ printf(" invalid test suite\n");
+ return EXIT_ADLER;
+ }
+ if (corpus[i].crc && crc != corpus[i].crc)
+ {
+ printf(" internal checksum error !! (0x%08lx 0x%08lx)\n",
+ (unsigned long) crc, (unsigned long) corpus[i].crc);
+ return EXIT_INTERNAL;
+ }
+ }
+ return EXIT_OK;
+}
+
+
+/*************************************************************************
+// usage
+**************************************************************************/
+
+static
+void usage ( const char *name, int exit_code, lzo_bool show_methods )
+{
+ FILE *fp;
+ int i;
+
+ fp = stdout;
+
+ fflush(stdout); fflush(stderr);
+
+ fprintf(fp,"Usage: %s [option..] file...\n", name);
+ fprintf(fp,"\n");
+ fprintf(fp,"Options:\n");
+ fprintf(fp," -m# compression method\n");
+ fprintf(fp," -b# set input block size (default %lu, max %lu)\n",
+ (unsigned long) opt_block_size, (unsigned long) opt_max_data_len);
+ fprintf(fp," -n# number of compression/decompression runs\n");
+ fprintf(fp," -c# number of compression runs\n");
+ fprintf(fp," -d# number of decompression runs\n");
+ fprintf(fp," -S use safe decompressor (if available)\n");
+ fprintf(fp," -A use assembler decompressor (if available)\n");
+ fprintf(fp," -F use fast assembler decompressor (if available)\n");
+ fprintf(fp," -O optimize compressed data (if available)\n");
+ fprintf(fp," -s DIR process Calgary Corpus test suite in directory `DIR'\n");
+ fprintf(fp," -@ read list of files to compress from stdin\n");
+ fprintf(fp," -q be quiet\n");
+ fprintf(fp," -Q be very quiet\n");
+ fprintf(fp," -v be verbose\n");
+ fprintf(fp," -L display software license\n");
+
+ if (show_methods)
+ {
+#if defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ lzo_pclock_t t_dummy;
+ lzo_pclock_read(&pch, &t_dummy);
+ (void) lzo_pclock_get_elapsed(&pch, &t_dummy, &t_dummy);
+ fprintf(fp,"\nAll timings are recorded using pclock mode %d %s.\n", pch.mode, pch.name);
+#endif
+ fprintf(fp,"\n\n");
+ fprintf(fp,"The following compression methods are available:\n");
+ fprintf(fp,"\n");
+ fprintf(fp," usage name memory available extras\n");
+ fprintf(fp," ----- ---- ------ ----------------\n");
+
+ for (i = 0; i <= M_LAST_COMPRESSOR; i++)
+ {
+ const compress_t *c;
+ c = find_method_by_id(i);
+ if (c)
+ {
+ char n[16];
+ const char *sep = " ";
+ unsigned long m = c->mem_compress;
+
+ sprintf(n,"-m%d",i);
+ fprintf(fp," %-6s %-13s",n,c->name);
+#if 1
+ fprintf(fp,"%9lu", m);
+#else
+ m = (m + 1023) / 1024;
+ fprintf(fp,"%6lu KiB", m);
+#endif
+
+ if (c->decompress_safe)
+ { fprintf(fp, "%s%s", sep, "safe"); sep = ", "; }
+ if (c->decompress_asm)
+ { fprintf(fp, "%s%s", sep, "asm"); sep = ", "; }
+ if (c->decompress_asm_safe)
+ { fprintf(fp, "%s%s", sep, "asm+safe"); sep = ", "; }
+ if (c->decompress_asm_fast)
+ { fprintf(fp, "%s%s", sep, "fastasm"); sep = ", "; }
+ if (c->decompress_asm_fast_safe)
+ { fprintf(fp, "%s%s", sep, "fastasm+safe"); sep = ", "; }
+ if (c->optimize)
+ { fprintf(fp, "%s%s", sep, "optimize"); sep = ", "; }
+ fprintf(fp, "\n");
+ }
+ }
+ }
+ else
+ {
+ fprintf(fp,"\n");
+ fprintf(fp,"Type '%s -m' to list all available methods.\n", name);
+ }
+
+ fflush(fp);
+ if (exit_code < 0)
+ exit_code = EXIT_USAGE;
+ exit(exit_code);
+}
+
+
+static
+void license(void)
+{
+ FILE *fp;
+
+ fp = stdout;
+ fflush(stdout); fflush(stderr);
+
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/license.ch"
+#else
+fprintf(fp,
+" The LZO library is free software; you can redistribute it and/or\n"
+" modify it under the terms of the GNU General Public License as\n"
+" published by the Free Software Foundation; either version 2 of\n"
+" the License, or (at your option) any later version.\n"
+"\n"
+" The LZO library is distributed in the hope that it will be useful,\n"
+" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+" GNU General Public License for more details.\n"
+ );
+fprintf(fp,
+"\n"
+" You should have received a copy of the GNU General Public License\n"
+" along with the LZO library; see the file COPYING.\n"
+" If not, write to the Free Software Foundation, Inc.,\n"
+" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
+"\n"
+" Markus F.X.J. Oberhumer\n"
+" <markus@oberhumer.com>\n"
+" http://www.oberhumer.com/opensource/lzo/\n"
+"\n"
+ );
+#endif
+
+ fflush(fp);
+ exit(EXIT_OK);
+}
+
+
+/*************************************************************************
+// parse method option '-m'
+**************************************************************************/
+
+static int methods[256+1];
+static int methods_n = 0;
+
+static void add_method(int m)
+{
+ int i;
+
+ if (m > 0)
+ {
+ if (!find_method_by_id(m)) {
+ fprintf(stdout,"%s: invalid method %d\n",progname,m);
+ exit(EXIT_USAGE);
+ }
+
+ for (i = 0; i < methods_n; i++)
+ if (methods[i] == m)
+ return;
+
+ if (methods_n >= 256)
+ {
+ fprintf(stderr,"%s: too many methods\n",progname);
+ exit(EXIT_USAGE);
+ }
+
+ methods[methods_n++] = m;
+ methods[methods_n] = 0;
+ }
+}
+
+
+static void add_methods(const int *ml)
+{
+ while (*ml != 0)
+ add_method(*ml++);
+}
+
+
+static void add_all_methods(int first, int last)
+{
+ int m;
+
+ for (m = first; m <= last; m++)
+ if (find_method_by_id(m) != NULL)
+ add_method(m);
+}
+
+
+static int m_strcmp(const char *a, const char *b)
+{
+ size_t n;
+
+ if (a[0] == 0 || b[0] == 0)
+ return 1;
+ n = strlen(b);
+ if (strncmp(a,b,n) == 0 && (a[n] == 0 || a[n] == ','))
+ return 0;
+ return 1;
+}
+
+
+static lzo_bool m_strisdigit(const char *s)
+{
+ for (;;)
+ {
+ if (!is_digit(*s))
+ return 0;
+ s++;
+ if (*s == 0 || *s == ',')
+ break;
+ }
+ return 1;
+}
+
+
+static void parse_methods(const char *p)
+{
+ const compress_t *c;
+
+ for (;;)
+ {
+ if (p == NULL || p[0] == 0)
+ usage(progname,-1,1);
+ else if ((c = find_method_by_name(p)) != NULL)
+ add_method(c->id);
+ else if (m_strcmp(p,"all") == 0 || m_strcmp(p,"avail") == 0)
+ add_all_methods(1,M_LAST_COMPRESSOR);
+ else if (m_strcmp(p,"ALL") == 0)
+ {
+ add_all_methods(1,M_LAST_COMPRESSOR);
+ add_all_methods(9721,9729);
+ add_all_methods(9781,9789);
+ }
+ else if (m_strcmp(p,"lzo") == 0)
+ add_all_methods(1,M_MEMCPY);
+ else if (m_strcmp(p,"bench") == 0)
+ add_methods(benchmark_methods);
+ else if (m_strcmp(p,"m1") == 0)
+ add_methods(x1_methods);
+ else if (m_strcmp(p,"m99") == 0)
+ add_methods(x99_methods);
+ else if (m_strcmp(p,"m999") == 0)
+ add_methods(x999_methods);
+ else if (m_strcmp(p,"1x999") == 0)
+ add_all_methods(9721,9729);
+ else if (m_strcmp(p,"1y999") == 0)
+ add_all_methods(9821,9829);
+#if defined(ALG_ZLIB)
+ else if (m_strcmp(p,"zlib") == 0)
+ add_all_methods(M_ZLIB_8_1,M_ZLIB_8_9);
+#endif
+#if defined(ALG_BZIP2)
+ else if (m_strcmp(p,"bzip2") == 0)
+ add_all_methods(M_BZIP2_1,M_BZIP2_9);
+#endif
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/t_opt_m.ch"
+#endif
+ else if (m_strisdigit(p))
+ add_method(atoi(p));
+ else
+ {
+ printf("%s: invalid method '%s'\n\n",progname,p);
+ exit(EXIT_USAGE);
+ }
+
+ while (*p && *p != ',')
+ p++;
+ while (*p == ',')
+ p++;
+ if (*p == 0)
+ return;
+ }
+}
+
+
+/*************************************************************************
+// options
+**************************************************************************/
+
+enum {
+ OPT_LONGOPT_ONLY = 512,
+ OPT_ADLER32,
+ OPT_CALGARY_CORPUS,
+ OPT_CLEAR_WRKMEM,
+ OPT_CRC32,
+ OPT_DICT,
+ OPT_DUMP,
+ OPT_EXECUTION_TIME,
+ OPT_MAX_DATA_LEN,
+ OPT_MAX_DICT_LEN,
+ OPT_SILESIA_CORPUS,
+ OPT_PCLOCK,
+ OPT_UNUSED
+};
+
+static const struct lzo_getopt_longopt_t longopts[] =
+{
+ /* { name has_arg *flag val } */
+ {"help", 0, 0, 'h'+256}, /* give help */
+ {"license", 0, 0, 'L'}, /* display software license */
+ {"quiet", 0, 0, 'q'}, /* quiet mode */
+ {"verbose", 0, 0, 'v'}, /* verbose mode */
+ {"version", 0, 0, 'V'+256}, /* display version number */
+
+ {"adler32", 0, 0, OPT_ADLER32},
+ {"calgary-corpus", 1, 0, OPT_CALGARY_CORPUS},
+ {"clear-wrkmem", 0, 0, OPT_CLEAR_WRKMEM},
+ {"clock", 1, 0, OPT_PCLOCK},
+ {"corpus", 1, 0, OPT_CALGARY_CORPUS},
+ {"crc32", 0, 0, OPT_CRC32},
+ {"dict", 1, 0, OPT_DICT},
+ {"dump-compressed", 1, 0, OPT_DUMP},
+ {"execution-time", 0, 0, OPT_EXECUTION_TIME},
+ {"max-data-length", 1, 0, OPT_MAX_DATA_LEN},
+ {"max-dict-length", 1, 0, OPT_MAX_DICT_LEN},
+ {"silesia-corpus", 1, 0, OPT_SILESIA_CORPUS},
+ {"uclock", 1, 0, OPT_PCLOCK},
+ {"methods", 1, 0, 'm'},
+ {"totals", 0, 0, 'T'},
+
+ { 0, 0, 0, 0 }
+};
+
+
+static int do_option(lzo_getopt_p g, int optc)
+{
+#define mfx_optarg g->optarg
+ switch (optc)
+ {
+ case 'A':
+ opt_use_asm_decompressor = 1;
+ break;
+ case 'b':
+ opt_block_size = 0; /* set to opt_max_data_len later */
+ if (mfx_optarg)
+ {
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_block_size = atol(mfx_optarg);
+ }
+ break;
+ case 'c':
+ case 'C':
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_c_loops = atol(mfx_optarg);
+ break;
+ case 'd':
+ case 'D':
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_d_loops = atol(mfx_optarg);
+ break;
+ case 'F':
+ opt_use_asm_fast_decompressor = 1;
+ break;
+ case 'h':
+ case 'H':
+ case '?':
+ case 'h'+256:
+ usage(progname,EXIT_OK,0);
+ break;
+ case 'L':
+ license();
+ break;
+ case 'm':
+ parse_methods(mfx_optarg);
+ break;
+ case 'n':
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_c_loops = opt_d_loops = atol(mfx_optarg);
+ break;
+ case 'O':
+ opt_optimize_compressed_data = 1;
+ break;
+ case 'q':
+ opt_verbose -= 1;
+ break;
+ case 'Q':
+ opt_verbose = 0;
+ break;
+ case 's':
+ case OPT_CALGARY_CORPUS:
+ if (!mfx_optarg || !mfx_optarg[0])
+ return optc;
+ opt_corpus_path = mfx_optarg;
+ opt_corpus = calgary_corpus;
+ break;
+ case OPT_SILESIA_CORPUS:
+ if (!mfx_optarg || !mfx_optarg[0])
+ return optc;
+ opt_corpus_path = mfx_optarg;
+ opt_corpus = silesia_corpus;
+ break;
+ case 'S':
+ opt_use_safe_decompressor = 1;
+ break;
+ case 'T':
+ opt_totals += 1;
+ break;
+ case 'v':
+ opt_verbose += 1;
+ break;
+ case 'V':
+ case 'V'+256:
+ exit(EXIT_OK);
+ break;
+ case '@':
+ opt_read_from_stdin = 1;
+ break;
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ /* this is a dirty hack... */
+ if (g->shortpos == 0) {
+ char m[2]; m[0] = (char) optc; m[1] = 0;
+ parse_methods(m);
+ } else {
+ const char *m = &g->argv[g->optind][g->shortpos-1];
+ parse_methods(m);
+ ++g->optind; g->shortpos = 0;
+ }
+ break;
+
+ case OPT_ADLER32:
+ opt_compute_adler32 = 1;
+ break;
+ case OPT_CLEAR_WRKMEM:
+ opt_clear_wrkmem = 1;
+ break;
+ case OPT_CRC32:
+ opt_compute_crc32 = 1;
+ break;
+ case OPT_DICT:
+ opt_dict = 1;
+ opt_dictionary_file = mfx_optarg;
+ break;
+ case OPT_EXECUTION_TIME:
+ opt_execution_time = 1;
+ break;
+ case OPT_DUMP:
+ opt_dump_compressed_data = mfx_optarg;
+ break;
+ case OPT_MAX_DATA_LEN:
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_max_data_len = atol(mfx_optarg);
+ break;
+ case OPT_MAX_DICT_LEN:
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_max_dict_len = atol(mfx_optarg);
+ break;
+ case OPT_PCLOCK:
+ if (!mfx_optarg || !is_digit(mfx_optarg[0]))
+ return optc;
+ opt_pclock = atoi(mfx_optarg);
+#if defined(__LZOLIB_PCLOCK_CH_INCLUDED)
+ if (opt_pclock > 0)
+ pch.mode = opt_pclock;
+#endif
+ break;
+
+ case '\0':
+ return -1;
+ case ':':
+ return -2;
+ default:
+ fprintf(stderr,"%s: internal error in getopt (%d)\n",progname,optc);
+ return -3;
+ }
+ return 0;
+#undef mfx_optarg
+}
+
+
+static void handle_opterr(lzo_getopt_p g, const char *f, void *v)
+{
+ struct A { va_list ap; };
+ struct A *a = (struct A *) v;
+ fprintf( stderr, "%s: ", g->progname);
+ if (a)
+ vfprintf(stderr, f, a->ap);
+ else
+ fprintf( stderr, "UNKNOWN GETOPT ERROR");
+ fprintf( stderr, "\n");
+}
+
+
+static int get_options(int argc, char **argv)
+{
+ lzo_getopt_t mfx_getopt;
+ int optc;
+ static const char shortopts[] =
+ "Ab::c:C:d:D:FhHLm::n:OqQs:STvV@123456789";
+
+ lzo_getopt_init(&mfx_getopt, 1, argc, argv);
+ mfx_getopt.progname = progname;
+ mfx_getopt.opterr = handle_opterr;
+ while ((optc = lzo_getopt(&mfx_getopt, shortopts, longopts, NULL)) >= 0)
+ {
+ if (do_option(&mfx_getopt, optc) != 0)
+ exit(EXIT_USAGE);
+ }
+
+ return mfx_getopt.optind;
+}
+
+
+/*************************************************************************
+// main
+**************************************************************************/
+
+int __lzo_cdecl_main main(int argc, char *argv[])
+{
+ int r = EXIT_OK;
+ int i, ii;
+ int m;
+ time_t t_total;
+ const char *s;
+
+ lzo_wildargv(&argc, &argv);
+ lzo_pclock_open_default(&pch);
+
+ progname = argv[0];
+ for (s = progname; *s; s++)
+ if ((*s == '/' || *s == '\\') && s[1])
+ progname = s + 1;
+
+#if defined(__LZO_PROFESSIONAL__)
+ printf("\nLZO Professional real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+#else
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+#endif
+
+
+/*
+ * Step 1: initialize the LZO library
+ */
+
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n");
+ exit(1);
+ }
+
+
+/*
+ * Step 2: setup default options
+ */
+
+ opt_max_data_len = 64 * 1024L * 1024L;
+ opt_block_size = 256 * 1024L;
+
+#if (LZO_ARCH_M68K && LZO_OS_TOS)
+ /* reduce memory requirements for 14 MB machines */
+ opt_max_data_len = 8 * 1024L * 1024L;
+#endif
+
+
+
+/*
+ * Step 3: parse options
+ */
+
+ if (argc < 2)
+ usage(progname,-1,0);
+ i = get_options(argc,argv);
+
+ if (methods_n == 0)
+ add_method(default_method);
+ if (methods_n > 1 && opt_read_from_stdin)
+ {
+ printf("%s: cannot use multiple methods and '-@'\n", progname);
+ exit(EXIT_USAGE);
+ }
+
+ if (opt_block_size == 0)
+ opt_block_size = opt_max_data_len;
+ if (opt_block_size > opt_max_data_len)
+ opt_block_size = opt_max_data_len;
+
+ if (opt_c_loops < 1)
+ opt_c_loops = 1;
+ if (opt_d_loops < 1)
+ opt_d_loops = 1;
+
+
+/*
+ * Step 4: start work
+ */
+
+ block_w.len = 0;
+ for (ii = 0; ii < methods_n; ii++) {
+ const compress_t *c = find_method_by_id(methods[ii]);
+ assert(c != NULL);
+ if (c->mem_compress > block_w.len)
+ block_w.len = c->mem_compress;
+ if (c->mem_decompress > block_w.len)
+ block_w.len = c->mem_decompress;
+ }
+
+ mb_alloc(&block_w, block_w.len);
+ lzo_memset(block_w.ptr, 0, block_w.len);
+
+#if !defined(__LZO_CHECKER)
+ mb_alloc_extra(&block_c, opt_block_size + get_max_compression_expansion(-1, opt_block_size), 16, 16);
+ mb_alloc_extra(&block_d, opt_block_size + get_max_decompression_overrun(-1, opt_block_size), 16, 16);
+#endif
+
+ if (opt_dict)
+ {
+ opt_optimize_compressed_data = 0;
+ dict_alloc(opt_max_dict_len);
+ if (opt_dictionary_file)
+ {
+ dict_load(opt_dictionary_file);
+ if (dict.len > 0)
+ printf("Using dictionary '%s', %lu bytes, ID 0x%08lx.\n",
+ opt_dictionary_file,
+ (unsigned long) dict.len, (unsigned long) dict.adler);
+ }
+ if (dict.len == 0)
+ {
+ dict_set_default();
+ printf("Using default dictionary, %lu bytes, ID 0x%08lx.\n",
+ (unsigned long) dict.len, (unsigned long) dict.adler);
+ }
+ }
+
+ t_total = time(NULL);
+ ii = i;
+ for (m = 0; m < methods_n && r == EXIT_OK; m++)
+ {
+ int method = methods[m];
+
+ i = ii;
+ if (i >= argc && opt_corpus_path == NULL && !opt_read_from_stdin)
+ usage(progname,-1,0);
+ if (m == 0 && opt_verbose >= 1)
+ printf("%lu block-size\n\n", (unsigned long) opt_block_size);
+
+ assert(find_method_by_id(method) != NULL);
+
+ if (opt_corpus_path != NULL)
+ r = do_corpus(opt_corpus, method, opt_corpus_path,
+ opt_c_loops, opt_d_loops);
+ else
+ {
+ for ( ; i < argc && r == EXIT_OK; i++)
+ {
+ r = do_file(method,argv[i],opt_c_loops,opt_d_loops,NULL,NULL);
+ if (r == EXIT_FILE) /* ignore file errors */
+ r = EXIT_OK;
+ }
+ if (opt_read_from_stdin)
+ {
+ char buf[512], *p;
+
+ while (r == EXIT_OK && fgets(buf,sizeof(buf)-1,stdin) != NULL)
+ {
+ buf[sizeof(buf)-1] = 0;
+ p = buf + strlen(buf);
+ while (p > buf && is_space(p[-1]))
+ *--p = 0;
+ p = buf;
+ while (*p && is_space(*p))
+ p++;
+ if (*p)
+ r = do_file(method,p,opt_c_loops,opt_d_loops,NULL,NULL);
+ if (r == EXIT_FILE) /* ignore file errors */
+ r = EXIT_OK;
+ }
+ opt_read_from_stdin = 0;
+ }
+ }
+ }
+ t_total = time(NULL) - t_total;
+
+ if (opt_totals)
+ print_totals();
+ if (opt_execution_time || (methods_n > 1 && opt_verbose >= 1))
+ printf("\n%s: execution time: %lu seconds\n", progname, (unsigned long) t_total);
+ if (r != EXIT_OK)
+ printf("\n%s: exit code: %d\n", progname, r);
+
+ lzo_pclock_close(&pch);
+ return r;
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.ch b/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.ch
new file mode 100644
index 00000000..af4d282c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.ch
@@ -0,0 +1,698 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
+ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+#ifndef EOF
+#include <stdio.h>
+#include <string.h>
+#endif
+
+
+#undef PROGNAME
+#define PROGNAME(x) (x)
+
+
+/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
+ long-named option. Because this is not POSIX.2 compliant, it is
+ being phased out. */
+/* #define GETOPT_COMPAT */
+#undef GETOPT_COMPAT
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "mygetopt.h"
+#define option mfx_option
+#define optarg mfx_optarg
+#define optind mfx_optind
+#define opterr mfx_opterr
+#define optopt mfx_optopt
+#undef BAD_OPTION
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* XXX 1003.2 says this must be 1 before any call. */
+int optind = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+#define BAD_OPTION '\0'
+int optopt = BAD_OPTION;
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved.
+
+ To perform the swap, we first reverse the order of all elements. So
+ all options now come before all non options, but they are in the
+ wrong order. So we put back the options and non options in original
+ order by reversing them again. For example:
+ original input: a b c -x -y
+ reverse all: -y -x c b a
+ reverse options: -x -y c b a
+ reverse non options: -x -y a b c
+*/
+
+
+static void exchange (char **argv)
+{
+ char *temp; char **first, **last;
+
+ /* Reverse all the elements [first_nonopt, optind) */
+ first = &argv[first_nonopt];
+ last = &argv[optind-1];
+ while (first < last) {
+ temp = *first; *first = *last; *last = temp; first++; last--;
+ }
+ /* Put back the options in order */
+ first = &argv[first_nonopt];
+ first_nonopt += (optind - last_nonopt);
+ last = &argv[first_nonopt - 1];
+ while (first < last) {
+ temp = *first; *first = *last; *last = temp; first++; last--;
+ }
+
+ /* Put back the non options in order */
+ first = &argv[first_nonopt];
+ last_nonopt = optind;
+ last = &argv[last_nonopt-1];
+ while (first < last) {
+ temp = *first; *first = *last; *last = temp; first++; last--;
+ }
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns `EOF'.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return BAD_OPTION after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return BAD_OPTION.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+static int _getopt_internal (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only)
+{
+ static char empty_string[1];
+ int option_index;
+
+ if (longind != NULL)
+ *longind = -1;
+
+ optarg = 0;
+
+ /* Initialize the internal data when the first call is made.
+ Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ if (optind == 0)
+ {
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+#if 0
+ else if (getenv ("POSIXLY_CORRECT") != NULL)
+ ordering = REQUIRE_ORDER;
+#endif
+ else
+ ordering = PERMUTE;
+ }
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange (argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Now skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc
+ && (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[optind][0] != '+' || argv[optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* Special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange (argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return EOF;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if ((argv[optind][0] != '-' || argv[optind][1] == '\0')
+#ifdef GETOPT_COMPAT
+ && (longopts == NULL
+ || argv[optind][0] != '+' || argv[optind][1] == '\0')
+#endif /* GETOPT_COMPAT */
+ )
+ {
+ if (ordering == REQUIRE_ORDER)
+ return EOF;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Start decoding its characters. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ if (longopts != NULL
+ && ((argv[optind][0] == '-'
+ && (argv[optind][1] == '-' || long_only))
+#ifdef GETOPT_COMPAT
+ || argv[optind][0] == '+'
+#endif /* GETOPT_COMPAT */
+ ))
+ {
+ const struct option *p;
+ char *s = nextchar;
+ int exact = 0;
+ int ambig = 0;
+ const struct option *pfound = NULL;
+ int indfound = 0;
+ int needexact = 0;
+
+ /* allow `--option#value' because you cannout assign a '='
+ to an environment variable under DOS command.com */
+ while (*s && *s != '=' && * s != '#')
+ s++;
+
+ /* Test all options for either exact match or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name;
+ p++, option_index++)
+ if (!strncmp (p->name, nextchar, (unsigned) (s - nextchar)))
+ {
+ if (p->has_arg & 0x10)
+ needexact = 1;
+ if ((unsigned) (s - nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second nonexact match found. */
+ ambig = 1;
+ }
+
+ /* don't allow nonexact longoptions */
+ if (needexact && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, "%s: unrecognized option `%s'\n",
+ PROGNAME(argv[0]), argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return BAD_OPTION;
+ }
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, "%s: option `%s' is ambiguous\n",
+ PROGNAME(argv[0]), argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return BAD_OPTION;
+ }
+
+ if (pfound != NULL)
+ {
+ int have_arg = (s[0] != '\0');
+ if (have_arg && (pfound->has_arg & 0xf))
+ have_arg = (s[1] != '\0');
+ option_index = indfound;
+ optind++;
+ if (have_arg)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg & 0xf)
+ optarg = s + 1;
+ else
+ {
+ if (opterr)
+ {
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ "%s: option `--%s' doesn't allow an argument\n",
+ PROGNAME(argv[0]), pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ "%s: option `%c%s' doesn't allow an argument\n",
+ PROGNAME(argv[0]), argv[optind - 1][0], pfound->name);
+ }
+ nextchar += strlen (nextchar);
+ return BAD_OPTION;
+ }
+ }
+ else if ((pfound->has_arg & 0xf) == 1)
+ {
+#if 0
+ if (optind < argc)
+#else
+ if (optind < argc && (pfound->has_arg & 0x20) == 0)
+#endif
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr, "%s: option `--%s%s' requires an argument\n",
+ PROGNAME(argv[0]), pfound->name,
+ (pfound->has_arg & 0x20) ? "=" : "");
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : BAD_OPTION;
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+#ifdef GETOPT_COMPAT
+ || argv[optind][0] == '+'
+#endif /* GETOPT_COMPAT */
+ || strchr (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, "%s: unrecognized option `--%s'\n",
+ PROGNAME(argv[0]), nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, "%s: unrecognized option `%c%s'\n",
+ PROGNAME(argv[0]), argv[optind][0], nextchar);
+ }
+ nextchar = empty_string;
+ optind++;
+ return BAD_OPTION;
+ }
+ (void) &ambig; /* UNUSED */
+ }
+
+ /* Look at and handle the next option-character. */
+
+ {
+ char c = *nextchar++;
+ const char *temp = strchr (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+#if 0
+ if (c < 040 || c >= 0177)
+ fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
+ PROGNAME(argv[0]), c);
+ else
+ fprintf (stderr, "%s: unrecognized option `-%c'\n", PROGNAME(argv[0]), c);
+#else
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: illegal option -- %c\n", PROGNAME(argv[0]), c);
+#endif
+ }
+ optopt = c;
+ return BAD_OPTION;
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = 0;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+#if 0
+ fprintf (stderr, "%s: option `-%c' requires an argument\n",
+ PROGNAME(argv[0]), c);
+#else
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: option requires an argument -- %c\n",
+ PROGNAME(argv[0]), c);
+#endif
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = BAD_OPTION;
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int mfx_getopt(int argc, char **argv, const char *optstring)
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+int mfx_getopt_long(int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case BAD_OPTION:
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
+
+
+/*
+vi:ts=4:et:nowrap
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.h b/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.h
new file mode 100644
index 00000000..a0de9af3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/mygetopt.h
@@ -0,0 +1,102 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 1990, 1991, 1992, 1993 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __MFX_GETOPT_H
+#define __MFX_GETOPT_H 1
+
+#ifdef __cplusplus
+/* extern "C" { */
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *mfx_optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int mfx_optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int mfx_opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int mfx_optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct mfx_option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define mfx_no_argument 0
+#define mfx_required_argument 1
+#define mfx_optional_argument 2
+#define mfx_exact_argument 0x10 /* no abbrev. */
+
+int mfx_getopt(int argc, char **argv, const char *shortopts);
+int mfx_getopt_long(int argc, char **argv, const char *shortopts,
+ const struct mfx_option *longopts, int *longind);
+
+#ifdef __cplusplus
+/* } */
+#endif
+
+#endif /* __MFX_GETOPT_H */
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/wrap.h b/ics-openvpn-stripped/main/lzo/lzotest/wrap.h
new file mode 100644
index 00000000..e85cd939
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/wrap.h
@@ -0,0 +1,272 @@
+/* wrap.h -- wrapper functions
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// compression levels of LZO1X-999 and LZO1Y-999
+**************************************************************************/
+
+#if defined(HAVE_LZO1X_H)
+
+LZO_PRIVATE(int)
+lzo1x_999_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 1);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_2_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 2);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_3_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 3);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_4_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 4);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_5_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 5);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_6_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 6);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_7_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 7);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_8_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 8);
+}
+
+LZO_PRIVATE(int)
+lzo1x_999_9_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 9);
+}
+
+#endif
+
+
+#if defined(HAVE_LZO1Y_H)
+
+LZO_PRIVATE(int)
+lzo1y_999_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 1);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_2_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 2);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_3_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 3);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_4_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 4);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_5_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 5);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_6_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 6);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_7_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 7);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_8_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 8);
+}
+
+LZO_PRIVATE(int)
+lzo1y_999_9_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem,
+ dict.ptr, dict.len, 0, 9);
+}
+
+#endif
+
+
+/*************************************************************************
+// other wrappers (pseudo compressors)
+**************************************************************************/
+
+LZO_PRIVATE(int)
+memcpy_x_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ lzo_memcpy(dst,src,src_len);
+ *dst_len = src_len;
+ if (wrkmem) wrkmem = 0; /* avoid warning */
+ return 0;
+}
+
+
+LZO_PRIVATE(int)
+memset_x_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ lzo_memset(dst,0,src_len);
+ *dst_len = src_len;
+ if (src) src = 0; /* avoid warning */
+ if (wrkmem) wrkmem = 0; /* avoid warning */
+ return 0;
+}
+
+
+LZO_PRIVATE(int)
+adler32_x_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ lzo_uint32_t adler;
+ adler = lzo_adler32(0, NULL, 0);
+ adler = lzo_adler32(adler, dst, src_len);
+ *dst_len = src_len;
+ if (src) src = 0; /* avoid warning */
+ if (wrkmem) wrkmem = 0; /* avoid warning */
+ return 0;
+}
+
+
+LZO_PRIVATE(int)
+crc32_x_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem )
+{
+ lzo_uint32_t crc;
+ crc = lzo_crc32(0, NULL, 0);
+ crc = lzo_crc32(crc, dst, src_len);
+ *dst_len = src_len;
+ if (src) src = 0; /* avoid warning */
+ if (wrkmem) wrkmem = 0; /* avoid warning */
+ return 0;
+}
+
+
+#if defined(__LZO_PROFESSIONAL__)
+# include "lzopro/t_wrap.ch"
+#endif
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/lzotest/wrapmisc.h b/ics-openvpn-stripped/main/lzo/lzotest/wrapmisc.h
new file mode 100644
index 00000000..dfcb9187
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/lzotest/wrapmisc.h
@@ -0,0 +1,276 @@
+/* wrapmisc.h -- misc wrapper functions for the test driver
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/*************************************************************************
+// compression levels of zlib
+**************************************************************************/
+
+#if defined(ALG_ZLIB)
+
+#define ZLIB_MEM_COMPRESS 0
+#define ZLIB_MEM_DECOMPRESS 0
+
+static
+int zlib_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem,
+ int method, int compression_level )
+{
+ int err;
+ uLong destLen;
+
+ assert(method == Z_DEFLATED);
+ destLen = (uLong) *dst_len;
+ err = compress2(dst, &destLen, src, (uLong) src_len, compression_level);
+ *dst_len = destLen;
+ LZO_UNUSED(method);
+ LZO_UNUSED(wrkmem);
+ return err;
+}
+
+
+M_PRIVATE(int)
+zlib_decompress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{
+ int err;
+ uLong destLen;
+
+ destLen = (uLong) *dst_len;
+ err = uncompress(dst, &destLen, src, (uLong) src_len);
+ *dst_len = destLen;
+ LZO_UNUSED(wrkmem);
+ return err;
+}
+
+
+M_PRIVATE(int)
+zlib_8_1_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,1); }
+
+M_PRIVATE(int)
+zlib_8_2_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,2); }
+
+M_PRIVATE(int)
+zlib_8_3_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,3); }
+
+M_PRIVATE(int)
+zlib_8_4_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,4); }
+
+M_PRIVATE(int)
+zlib_8_5_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,5); }
+
+M_PRIVATE(int)
+zlib_8_6_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,6); }
+
+M_PRIVATE(int)
+zlib_8_7_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,7); }
+
+M_PRIVATE(int)
+zlib_8_8_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,8); }
+
+M_PRIVATE(int)
+zlib_8_9_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,9); }
+
+
+#endif /* ALG_ZLIB */
+
+
+/*************************************************************************
+// compression levels of bzip2
+**************************************************************************/
+
+#if defined(ALG_BZIP2)
+
+#define BZIP2_MEM_COMPRESS 0
+#define BZIP2_MEM_DECOMPRESS 0
+
+static
+int bzip2_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem,
+ int compression_level )
+{
+ int err;
+ unsigned destLen;
+ union { const m_bytep csrc; char *src; } u;
+
+ u.csrc = src; /* UNCONST */
+ destLen = *dst_len;
+ err = BZ2_bzBuffToBuffCompress((char*)dst, &destLen, u.src, src_len, compression_level, 0, 0);
+ *dst_len = destLen;
+ LZO_UNUSED(wrkmem);
+ return err;
+}
+
+
+M_PRIVATE(int)
+bzip2_decompress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{
+ int err;
+ unsigned destLen;
+ union { const m_bytep csrc; char *src; } u;
+
+ u.csrc = src; /* UNCONST */
+ destLen = *dst_len;
+ err = BZ2_bzBuffToBuffDecompress((char*)dst, &destLen, u.src, src_len, 0, 0);
+ *dst_len = destLen;
+ LZO_UNUSED(wrkmem);
+ return err;
+}
+
+
+M_PRIVATE(int)
+bzip2_1_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,1); }
+
+M_PRIVATE(int)
+bzip2_2_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,2); }
+
+M_PRIVATE(int)
+bzip2_3_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,3); }
+
+M_PRIVATE(int)
+bzip2_4_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,4); }
+
+M_PRIVATE(int)
+bzip2_5_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,5); }
+
+M_PRIVATE(int)
+bzip2_6_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,6); }
+
+M_PRIVATE(int)
+bzip2_7_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,7); }
+
+M_PRIVATE(int)
+bzip2_8_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,8); }
+
+M_PRIVATE(int)
+bzip2_9_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,9); }
+
+
+#endif /* ALG_BZIP2 */
+
+
+/*************************************************************************
+// other wrappers (for benchmarking the checksum algorithms)
+**************************************************************************/
+
+#if defined(ALG_ZLIB)
+
+M_PRIVATE(int)
+zlib_adler32_x_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{
+ uLong adler;
+ adler = adler32(1L, src, (uInt) src_len);
+ *dst_len = src_len;
+ LZO_UNUSED(adler);
+ LZO_UNUSED(dst);
+ LZO_UNUSED(wrkmem);
+ return 0;
+}
+
+
+M_PRIVATE(int)
+zlib_crc32_x_compress ( const m_bytep src, m_uint src_len,
+ m_bytep dst, m_uintp dst_len,
+ m_voidp wrkmem )
+{
+ uLong crc;
+ crc = crc32(0L, src, (uInt) src_len);
+ *dst_len = src_len;
+ LZO_UNUSED(crc);
+ LZO_UNUSED(dst);
+ LZO_UNUSED(wrkmem);
+ return 0;
+}
+
+#endif /* ALG_ZLIB */
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/minilzo/.deps/minilzo.Po b/ics-openvpn-stripped/main/lzo/minilzo/.deps/minilzo.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/.deps/minilzo.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/minilzo/.deps/testmini.Po b/ics-openvpn-stripped/main/lzo/minilzo/.deps/testmini.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/.deps/testmini.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/minilzo/Makefile.am b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.am
new file mode 100644
index 00000000..4b3693c9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.am
@@ -0,0 +1,14 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+AM_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H
+INCLUDES = -I$(top_srcdir)/include/lzo -I$(top_srcdir)/include
+
+noinst_PROGRAMS = testmini
+
+testmini_SOURCES = testmini.c minilzo.c
+
+EXTRA_DIST = README.LZO Makefile.minilzo minilzo.h
+
diff --git a/ics-openvpn-stripped/main/lzo/minilzo/Makefile.in b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.in
new file mode 100644
index 00000000..c12dc8b4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.in
@@ -0,0 +1,442 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+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@
+noinst_PROGRAMS = testmini$(EXEEXT)
+subdir = minilzo
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_testmini_OBJECTS = testmini.$(OBJEXT) minilzo.$(OBJEXT)
+testmini_OBJECTS = $(am_testmini_OBJECTS)
+testmini_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(testmini_SOURCES)
+DIST_SOURCES = $(testmini_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+AM_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H
+INCLUDES = -I$(top_srcdir)/include/lzo -I$(top_srcdir)/include
+testmini_SOURCES = testmini.c minilzo.c
+EXTRA_DIST = README.LZO Makefile.minilzo minilzo.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu minilzo/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu minilzo/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+testmini$(EXEEXT): $(testmini_OBJECTS) $(testmini_DEPENDENCIES)
+ @rm -f testmini$(EXEEXT)
+ $(LINK) $(testmini_LDFLAGS) $(testmini_OBJECTS) $(testmini_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minilzo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmini.Po@am__quote@
+
+.c.o:
+@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@ 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@ 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 $@ $<
+
+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)
+ @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 $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+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 clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -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:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS 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-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
+
+# 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/ics-openvpn-stripped/main/lzo/minilzo/Makefile.minilzo b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.minilzo
new file mode 100644
index 00000000..e511e74e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/Makefile.minilzo
@@ -0,0 +1,100 @@
+#
+# a very simple Makefile for miniLZO
+#
+# Copyright (C) 1996-2014 Markus F.X.J. Oberhumer
+#
+
+PROGRAM = testmini
+SOURCES = testmini.c minilzo.c
+
+default:
+ @echo ""
+ @echo "Welcome to miniLZO. Please choose one of the following 'make' targets:"
+ @echo ""
+ @echo " gcc: gcc"
+ @echo " unix: hpux hpux9"
+ @echo " win32: win32-bc win32-cygwin win32-dm win32-lccwin32"
+ @echo " win32-intelc win32-mingw win32-vc win32-watcomc"
+ @echo " dos32: dos32-djgpp2 dos32-wc"
+ @echo ""
+
+
+# Make sure that minilzo.h, lzoconf.h and lzodefs.h are in the
+# current dircectory. Otherwise you may want to adjust CPPFLAGS.
+CPPFLAGS = -I. -I../include/lzo
+
+GCC_CFLAGS = -s -Wall -O2 -fomit-frame-pointer
+
+
+#
+# gcc (generic)
+#
+
+gcc:
+ gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM) $(SOURCES)
+
+cc:
+ cc $(CPPFLAGS) -o $(PROGRAM) $(SOURCES)
+
+
+#
+# UNIX
+#
+
+hpux:
+ cc -Ae $(CPPFLAGS) -o $(PROGRAM) $(SOURCES)
+
+hpux9:
+ cc -Aa -D_HPUX_SOURCE $(CPPFLAGS) -o $(PROGRAM) $(SOURCES)
+
+
+#
+# Windows (32-bit)
+#
+
+win32-borlandc win32-bc:
+ bcc32 -O2 -d -w -w-aus $(CPPFLAGS) $(SOURCES)
+
+win32-cygwin32 win32-cygwin:
+ gcc -mcygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES)
+
+win32-digitalmars win32-dm:
+ dmc -mn -o -w- $(CPPFLAGS) $(SOURCES)
+
+win32-intelc win32-ic:
+ icl -nologo -MT -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
+
+win32-lccwin32:
+ @echo "NOTE: need lcc 2002-07-25 or newer, older versions have bugs"
+ lc -A -unused -O $(CPPFLAGS) $(SOURCES)
+
+win32-mingw32 win32-mingw:
+ gcc -mno-cygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES)
+
+win32-visualc win32-vc:
+ cl -nologo -MT -W3 -O2 -GF $(CPPFLAGS) $(SOURCES)
+
+win32-watcomc win32-wc:
+ wcl386 -bt=nt -zq -mf -5r -zc -w5 -oneatx $(CPPFLAGS) $(SOURCES)
+
+
+#
+# DOS (32-bit)
+#
+
+dos32-djgpp2 dos32-dj2:
+ gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES)
+
+dos32-watcomc dos32-wc:
+ wcl386 -zq -mf -bt=dos -l=dos4g -5r -ox -zc $(CPPFLAGS) $(SOURCES)
+
+
+#
+# other targets
+#
+
+clean:
+ rm -f $(PROGRAM) $(PROGRAM).exe $(PROGRAM).map $(PROGRAM).tds
+ rm -f *.err *.o *.obj
+
+.PHONY: default clean
diff --git a/ics-openvpn-stripped/main/lzo/minilzo/README.LZO b/ics-openvpn-stripped/main/lzo/minilzo/README.LZO
new file mode 100644
index 00000000..9a8fbb40
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/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.07
+ Date : 25 Jun 2014
+
+ 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 KiB (using gcc or Visual C on an i386), and
+ the sources are about 30 KiB 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(void *) != sizeof(size_t)'.
+ After identifying the problem you can compile by adding some defines
+ like '-DSIZEOF_VOID_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.ac.
+
+
+ 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.ac' 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-2014 Markus Franz Xaver Oberhumer
+ All Rights Reserved.
+
+ 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/ics-openvpn-stripped/main/lzo/minilzo/minilzo.c b/ics-openvpn-stripped/main/lzo/minilzo/minilzo.c
new file mode 100644
index 00000000..26513174
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/minilzo.c
@@ -0,0 +1,6037 @@
+/* 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) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 1
+
+#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 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(LZO_CFG_NO_DISABLE_WUNDEF)
+#if defined(__ARMCC_VERSION)
+# pragma diag_suppress 193
+#elif defined(__clang__) && defined(__clang_minor__)
+# pragma clang diagnostic ignored "-Wundef"
+#elif defined(__INTEL_COMPILER)
+# pragma warning(disable: 193)
+#elif defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__)
+# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2))
+# pragma GCC diagnostic ignored "-Wundef"
+# endif
+#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if ((_MSC_VER-0) >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#endif
+#if 0 && defined(__POCC__) && defined(_WIN32)
+# if (__POCC__ >= 400)
+# pragma warn(disable: 2216)
+# 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 !(LZO_CFG_NO_DISABLE_WCRTNONSTDC)
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS 1
+#endif
+#endif
+#if 0
+#define LZO_0xffffUL 0xfffful
+#define LZO_0xffffffffUL 0xfffffffful
+#else
+#define LZO_0xffffUL 65535ul
+#define LZO_0xffffffffUL 4294967295ul
+#endif
+#define LZO_0xffffL LZO_0xffffUL
+#define LZO_0xffffffffL LZO_0xffffffffUL
+#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 defined(__COUNTER__)
+# ifndef LZO_CFG_USE_COUNTER
+# define LZO_CFG_USE_COUNTER 1
+# endif
+#else
+# undef LZO_CFG_USE_COUNTER
+#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 1
+#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
+#if defined(_CRAY) && defined(_CRAY1)
+# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1
+#endif
+#define LZO_PP_STRINGIZE(x) #x
+#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x)
+#define LZO_PP_CONCAT0() /*empty*/
+#define LZO_PP_CONCAT1(a) a
+#define LZO_PP_CONCAT2(a,b) a ## b
+#define LZO_PP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0()
+#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a)
+#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b)
+#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c)
+#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d)
+#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e)
+#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f)
+#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g)
+#define LZO_PP_EMPTY /*empty*/
+#define LZO_PP_EMPTY0() /*empty*/
+#define LZO_PP_EMPTY1(a) /*empty*/
+#define LZO_PP_EMPTY2(a,b) /*empty*/
+#define LZO_PP_EMPTY3(a,b,c) /*empty*/
+#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/
+#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/
+#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/
+#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/
+#if 1
+#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_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f
+#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g
+#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_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f)
+#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g)
+#endif
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
+#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"
+# define LZO_EXTERN_C_BEGIN extern "C" {
+# define LZO_EXTERN_C_END }
+#else
+# define LZO_EXTERN_C extern
+# define LZO_EXTERN_C_BEGIN /*empty*/
+# define LZO_EXTERN_C_END /*empty*/
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if (LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif (LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_OS_EMBEDDED 1
+# 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"
+# elif defined(__linux__) || defined(__LINUX__)
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+# 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) || defined(__LINUX__)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) && defined(__MACH__)
+# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000)
+# define LZO_OS_POSIX_DARWIN 1040
+# define LZO_INFO_OS_POSIX "darwin_iphone"
+# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040)
+# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# define LZO_INFO_OS_POSIX "darwin"
+# else
+# define LZO_OS_POSIX_DARWIN 1
+# define LZO_INFO_OS_POSIX "darwin"
+# endif
+# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN
+# elif defined(__minix__) || defined(__minix)
+# define LZO_OS_POSIX_MINIX 1
+# define LZO_INFO_OS_POSIX "minix"
+# 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"
+# elif defined(_UNICOS)
+# define LZO_OS_POSIX_UNICOS 1
+# define LZO_INFO_OS_POSIX "unicos"
+# 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 "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# 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_PP_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_PP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0))
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0)
+# define LZO_CC_INTELC __INTEL_COMPILER
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_INTELC_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__)
+#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# else
+# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# endif
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
+# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
+# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
+# else
+# define LZO_CC_CLANG 0x010000L
+# endif
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_CLANG_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+# define LZO_INFO_CC "clang"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# else
+# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# endif
+# define LZO_CC_LLVM LZO_CC_LLVM_GNUC
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__ACK__) && defined(_ACK)
+# define LZO_CC_ACK 1
+# define LZO_INFO_CC "Amsterdam Compiler Kit C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__ARMCC_VERSION) && !defined(__GNUC__)
+# define LZO_CC_ARMCC __ARMCC_VERSION
+# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION
+# define LZO_INFO_CC "ARM C Compiler"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION)
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__CODEGEARC__)
+# define LZO_CC_CODEGEARC 1
+# define LZO_INFO_CC "CodeGear C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(_CRAYC) && defined(_RELEASE)
+# define LZO_CC_CRAYC 1
+# define LZO_INFO_CC "Cray C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC)
+#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0)
+# define LZO_CC_GHS 1
+# define LZO_INFO_CC "Green Hills C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER)
+# if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_GHS_MSC _MSC_VER
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# endif
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0)
+# define LZO_CC_HPACC __HP_aCC
+# define LZO_INFO_CC "HP aCC"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC)
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define LZO_CC_IARC 1
+# define LZO_INFO_CC "IAR C"
+# if defined(__VER__)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__IBMC__) && ((__IBMC__-0) > 0)
+# define LZO_CC_IBMC __IBMC__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0)
+# define LZO_CC_IBMC __IBMCPP__
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_PP_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_PP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0)
+# define LZO_CC_MWERKS __MWERKS__
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_PP_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_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0))
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__)
+# else
+# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0"
+# endif
+# define LZO_INFO_CC "Portland Group PGI C"
+#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_PP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_C-0) > 0)
+# define LZO_CC_SUNPROC __SUNPRO_C
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__SUNPRO_CC)
+# define LZO_INFO_CC "SunPro C"
+# if ((__SUNPRO_CC-0) > 0)
+# define LZO_CC_SUNPROC __SUNPRO_CC
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
+# else
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if ((__ZTC__-0) == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__)
+# endif
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0)
+# define LZO_CC_MSC _MSC_VER
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if (LZO_CC_GNUC) && defined(__OPEN64__)
+# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__)
+# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0))
+# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC
+# endif
+#endif
+#if (LZO_CC_GNUC) && defined(__PCC__)
+# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__)
+# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0))
+# define LZO_CC_PCC_GNUC LZO_CC_GNUC
+# endif
+#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) && !(LZO_ARCH_GENERIC) && defined(_CRAY)
+# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY)
+# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
+# define LZO_ARCH_CRAY_MPP 1
+# elif defined(_CRAY1)
+# define LZO_ARCH_CRAY_PVP 1
+# endif
+# endif
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if (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_INFO_ARCH "i086"
+#elif defined(__aarch64__)
+# define LZO_ARCH_ARM64 1
+# define LZO_INFO_ARCH "arm64"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
+# 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(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+# define LZO_ARCH_ARM 1
+# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1)
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2)
+# define LZO_INFO_ARCH "arm"
+# else
+# define LZO_INFO_ARCH "arm"
+# endif
+#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(__avr32__) || defined(__AVR32__)
+# define LZO_ARCH_AVR32 1
+# define LZO_INFO_ARCH "avr32"
+#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(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
+# define LZO_ARCH_EZ80 1
+# define LZO_INFO_ARCH "ez80"
+#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(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
+# 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(__mc68020__) || 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(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
+# 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(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
+# 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 defined(__SPU__)
+# define LZO_ARCH_SPU 1
+# define LZO_INFO_ARCH "spu"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#elif (LZO_ARCH_CRAY_PVP)
+# if defined(_CRAYSV1)
+# define LZO_ARCH_CRAY_SV1 1
+# define LZO_INFO_ARCH "cray_sv1"
+# elif (_ADDR64)
+# define LZO_ARCH_CRAY_T90 1
+# define LZO_INFO_ARCH "cray_t90"
+# elif (_ADDR32)
+# define LZO_ARCH_CRAY_YMP 1
+# define LZO_INFO_ARCH "cray_ymp"
+# else
+# define LZO_ARCH_CRAY_XMP 1
+# define LZO_INFO_ARCH "cray_xmp"
+# endif
+#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 LZO_OS_WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64)
+# define LZO_ARCH_X64 1
+#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_AMD64 1
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64)
+# define LZO_ARCH_AARCH64 1
+#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_ARM64 1
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86)
+# define LZO_ARCH_X86 1
+#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE)
+# define LZO_ARCH_I386 1
+#endif
+#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086PM && !LZO_ARCH_I086)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "unexpected configuration - check your compiler defines"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "unexpected configuration - check your compiler defines"
+# endif
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if !defined(LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSE2__)
+# define LZO_TARGET_FEATURE_SSE2 1
+# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64))
+# define LZO_TARGET_FEATURE_SSE2 1
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSSE3)
+# if (LZO_TARGET_FEATURE_SSE2)
+# if defined(__SSSE3__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# elif defined(_MSC_VER) && defined(__AVX__)
+# define LZO_TARGET_FEATURE_SSSE3 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_SSE4_2)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__SSE4_2__)
+# define LZO_TARGET_FEATURE_SSE4_2 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX)
+# if (LZO_TARGET_FEATURE_SSSE3)
+# if defined(__AVX__)
+# define LZO_TARGET_FEATURE_AVX 1
+# endif
+# endif
+# endif
+# if !defined(LZO_TARGET_FEATURE_AVX2)
+# if (LZO_TARGET_FEATURE_AVX)
+# if defined(__AVX2__)
+# define LZO_TARGET_FEATURE_AVX2 1
+# endif
+# endif
+# endif
+#endif
+#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX))
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ARCH_ARM)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if defined(__ARM_NEON__)
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# if !defined(LZO_TARGET_FEATURE_NEON)
+# if 1
+# define LZO_TARGET_FEATURE_NEON 1
+# endif
+# endif
+#endif
+#if 0
+#elif !defined(__LZO_MM_OVERRIDE)
+#if (LZO_ARCH_I086)
+#if (UINT_MAX != LZO_0xffffL)
+# error "unexpected configuration - check your compiler defines"
+#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 LZO_ARCH_I086 memory model"
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#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) && !(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "unexpected configuration - check your compiler defines"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "unexpected configuration - check your compiler defines"
+# 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
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - LZO_ARCH_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 - LZO_ARCH_MCS51 __MODEL__"
+#endif
+#elif (LZO_ARCH_CRAY_PVP)
+# define LZO_MM_PVP 1
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_PVP)
+# define LZO_INFO_MM "pvp"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_gnuc_extension__ __extension__
+#else
+#endif
+#endif
+#if !defined(__lzo_gnuc_extension__)
+# define __lzo_gnuc_extension__ /*empty*/
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200))
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+# else
+# define LZO_CFG_USE_NEW_STYLE_CASTS 1
+# endif
+#endif
+#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(__cplusplus)
+# if defined(LZO_CFG_USE_NEW_STYLE_CASTS)
+# undef LZO_CFG_USE_NEW_STYLE_CASTS
+# endif
+# define LZO_CFG_USE_NEW_STYLE_CASTS 0
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_REINTERPRET_CAST)
+# define LZO_REINTERPRET_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_STATIC_CAST(t,e) (static_cast<t> (e))
+# endif
+#endif
+#if !defined(LZO_STATIC_CAST)
+# define LZO_STATIC_CAST(t,e) ((t) (e))
+#endif
+#if !defined(LZO_STATIC_CAST2)
+# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e))
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_CAST)
+# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e))))
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNCONST_VOLATILE_CAST)
+# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CAST)
+# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e))))
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# if (LZO_CFG_USE_NEW_STYLE_CASTS)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast<t> (e))
+# elif (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e))
+# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e)))))
+# endif
+#endif
+#if !defined(LZO_UNVOLATILE_CONST_CAST)
+# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e))))
+#endif
+#if !defined(LZO_PCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_PCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_PCAST)
+# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e))
+#endif
+#if !defined(LZO_CCAST)
+# if (LZO_HAVE_MM_HUGE_PTR)
+# define LZO_CCAST(t,e) ((t) (e))
+# endif
+#endif
+#if !defined(LZO_CCAST)
+# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e))
+#endif
+#if !defined(LZO_ICONV)
+# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ICAST)
+# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(LZO_ITRUNC)
+# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e)
+#endif
+#if !defined(__lzo_cte)
+# if (LZO_CC_MSC || LZO_CC_WATCOMC)
+# define __lzo_cte(e) ((void)0,(e))
+# elif 1
+# define __lzo_cte(e) ((void)0,(e))
+# endif
+#endif
+#if !defined(__lzo_cte)
+# define __lzo_cte(e) (e)
+#endif
+#if !defined(LZO_BLOCK_BEGIN)
+# define LZO_BLOCK_BEGIN do {
+# define LZO_BLOCK_END } while __lzo_cte(0)
+#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_CLANG && (LZO_CC_CLANG >= 0x030200ul))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_CLANG || 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) {LZO_EXTERN_C 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_CLANG || 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) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_CLANG >= 0x020800ul)
+# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l)))
+# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (LZO_CC_GNUC)
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(__lzo_inline)
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || 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_GHS)
+# define __lzo_inline __inline__
+#elif (LZO_CC_IBMC >= 600)
+# 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 (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_inline __inline__
+#endif
+#endif
+#if defined(__lzo_inline)
+# ifndef __lzo_HAVE_inline
+# define __lzo_HAVE_inline 1
+# endif
+#else
+# define __lzo_inline /*empty*/
+#endif
+#if !defined(__lzo_forceinline)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#endif
+#endif
+#if defined(__lzo_forceinline)
+# ifndef __lzo_HAVE_forceinline
+# define __lzo_HAVE_forceinline 1
+# endif
+#else
+# define __lzo_forceinline __lzo_inline
+#endif
+#if !defined(__lzo_noinline)
+#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul)
+# define __lzo_noinline __attribute__((__noinline__,__used__))
+#elif (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || 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
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_noinline __attribute__((__noinline__))
+#endif
+#endif
+#if defined(__lzo_noinline)
+# ifndef __lzo_HAVE_noinline
+# define __lzo_HAVE_noinline 1
+# endif
+#else
+# define __lzo_noinline /*empty*/
+#endif
+#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_static_inline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline
+#endif
+#endif
+#if !defined(__lzo_static_inline)
+# define __lzo_static_inline static __lzo_inline
+#endif
+#if !defined(__lzo_static_forceinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline
+#endif
+#endif
+#if !defined(__lzo_static_forceinline)
+# define __lzo_static_forceinline static __lzo_forceinline
+#endif
+#if !defined(__lzo_static_noinline)
+#if (LZO_CC_IBMC)
+# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline
+#endif
+#endif
+#if !defined(__lzo_static_noinline)
+# define __lzo_static_noinline static __lzo_noinline
+#endif
+#if !defined(__lzo_c99_extern_inline)
+#if defined(__GNUC_GNU_INLINE__)
+# define __lzo_c99_extern_inline __lzo_inline
+#elif defined(__GNUC_STDC_INLINE__)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L)
+# define __lzo_c99_extern_inline extern __lzo_inline
+#endif
+#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline)
+# define __lzo_c99_extern_inline __lzo_inline
+#endif
+#endif
+#if defined(__lzo_c99_extern_inline)
+# ifndef __lzo_HAVE_c99_extern_inline
+# define __lzo_HAVE_c99_extern_inline 1
+# endif
+#else
+# define __lzo_c99_extern_inline /*empty*/
+#endif
+#if !defined(__lzo_may_alias)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_CLANG >= 0x020900ul)
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0
+# define __lzo_may_alias __attribute__((__may_alias__))
+#endif
+#endif
+#if defined(__lzo_may_alias)
+# ifndef __lzo_HAVE_may_alias
+# define __lzo_HAVE_may_alias 1
+# endif
+#else
+# define __lzo_may_alias /*empty*/
+#endif
+#if !defined(__lzo_noreturn)
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#endif
+#endif
+#if defined(__lzo_noreturn)
+# ifndef __lzo_HAVE_noreturn
+# define __lzo_HAVE_noreturn 1
+# endif
+#else
+# define __lzo_noreturn /*empty*/
+#endif
+#if !defined(__lzo_nothrow)
+#if (LZO_CC_GNUC >= 0x030300ul)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900))
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_nothrow __attribute__((__nothrow__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __lzo_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__lzo_nothrow)
+# ifndef __lzo_HAVE_nothrow
+# define __lzo_HAVE_nothrow 1
+# endif
+#else
+# define __lzo_nothrow /*empty*/
+#endif
+#if !defined(__lzo_restrict)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_IBMC >= 1210)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600))
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM)
+# define __lzo_restrict __restrict__
+#elif (LZO_CC_MSC && (_MSC_VER >= 1400))
+# define __lzo_restrict __restrict
+#elif (LZO_CC_PGI >= 0x0d0a00ul)
+# define __lzo_restrict __restrict__
+#endif
+#endif
+#if defined(__lzo_restrict)
+# ifndef __lzo_HAVE_restrict
+# define __lzo_HAVE_restrict 1
+# endif
+#else
+# define __lzo_restrict /*empty*/
+#endif
+#if !defined(__lzo_alignof)
+#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_GHS) && !defined(__cplusplus)
+# define __lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_IBMC >= 600)
+# define __lzo_alignof(e) (__lzo_gnuc_extension__ __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)
+#elif (LZO_CC_SUNPROC >= 0x5100)
+# define __lzo_alignof(e) __alignof__(e)
+#endif
+#endif
+#if defined(__lzo_alignof)
+# ifndef __lzo_HAVE_alignof
+# define __lzo_HAVE_alignof 1
+# endif
+#endif
+#if !defined(__lzo_struct_packed)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__));
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_struct_packed(s) struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s {
+# define __lzo_struct_packed_end() } __attribute__((__packed__));
+# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s {
+# define __lzo_struct_packed_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_struct_packed(s) _Packed struct s {
+# define __lzo_struct_packed_end() };
+#endif
+#endif
+#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma)
+# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s)
+#endif
+#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end)
+# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end()
+#endif
+#if !defined(__lzo_byte_struct)
+#if defined(__lzo_struct_packed)
+# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end()
+# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end()
+#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__));
+# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__));
+#endif
+#endif
+#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma)
+# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n)
+#endif
+#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))
+#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_CILLY || LZO_CC_PCC)
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_struct_align16(s) struct __declspec(align(16)) s {
+# define __lzo_struct_align16_end() };
+# define __lzo_struct_align32(s) struct __declspec(align(32)) s {
+# define __lzo_struct_align32_end() };
+# define __lzo_struct_align64(s) struct __declspec(align(64)) s {
+# define __lzo_struct_align64_end() };
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_struct_align16(s) struct s {
+# define __lzo_struct_align16_end() } __attribute__((__aligned__(16)));
+# define __lzo_struct_align32(s) struct s {
+# define __lzo_struct_align32_end() } __attribute__((__aligned__(32)));
+# define __lzo_struct_align64(s) struct s {
+# define __lzo_struct_align64_end() } __attribute__((__aligned__(64)));
+#endif
+#endif
+#if !defined(__lzo_union_um)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul))
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810))
+#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul))
+#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus)
+#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100))
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_IBMC >= 700)
+# define __lzo_union_am(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_am_end() } __lzo_may_alias;
+# define __lzo_union_um(s) __lzo_gnuc_extension__ union s {
+# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__));
+#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_union_um(s) __pragma(pack(push,1)) union s {
+# define __lzo_union_um_end() } __pragma(pack(pop));
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900))
+# define __lzo_union_um(s) _Packed union s {
+# define __lzo_union_um_end() };
+#endif
+#endif
+#if !defined(__lzo_union_am)
+# define __lzo_union_am(s) union s {
+# define __lzo_union_am_end() };
+#endif
+#if !defined(__lzo_constructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__lzo_constructor)
+# ifndef __lzo_HAVE_constructor
+# define __lzo_HAVE_constructor 1
+# endif
+#endif
+#if !defined(__lzo_destructor)
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800))
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__lzo_destructor)
+# ifndef __lzo_HAVE_destructor
+# define __lzo_HAVE_destructor 1
+# endif
+#endif
+#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if !defined(__lzo_likely) && !defined(__lzo_unlikely)
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_IBMC >= 1010)
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__lzo_likely)
+# ifndef __lzo_HAVE_likely
+# define __lzo_HAVE_likely 1
+# endif
+#else
+# define __lzo_likely(e) (e)
+#endif
+#if defined(__lzo_unlikely)
+# ifndef __lzo_HAVE_unlikely
+# define __lzo_HAVE_unlikely 1
+# endif
+#else
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(__lzo_static_unused_void_func)
+# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void)
+# else
+# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void)
+# endif
+#endif
+#if !defined(__lzo_loop_forever)
+# if (LZO_CC_IBMC)
+# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END
+# else
+# define __lzo_loop_forever() do { ; } while __lzo_cte(1)
+# endif
+#endif
+#if !defined(__lzo_unreachable)
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul))
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_GNUC >= 0x040500ul)
+# define __lzo_unreachable() __builtin_unreachable();
+#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1
+# define __lzo_unreachable() __builtin_unreachable();
+#endif
+#endif
+#if defined(__lzo_unreachable)
+# ifndef __lzo_HAVE_unreachable
+# define __lzo_HAVE_unreachable 1
+# endif
+#else
+# if 0
+# define __lzo_unreachable() ((void)0);
+# else
+# define __lzo_unreachable() __lzo_loop_forever();
+# endif
+#endif
+#ifndef __LZO_CTA_NAME
+#if (LZO_CFG_USE_COUNTER)
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__)
+#else
+# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__)
+#endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END
+# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END
+# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(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_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__)
+# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));}
+# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus)
+# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));}
+# elif (LZO_CC_GNUC >= 0x040700ul)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));}
+# 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_NAME(lzo_cta_t__)[1-2*!(e)];}
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1)
+#if defined(__cplusplus)
+extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) }
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3)
+#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 /*empty*/
+# 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_I386) && (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+#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 /*empty*/
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit /*empty*/
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main /*empty*/
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort /*empty*/
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler /*empty*/
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if !(LZO_CFG_NO_WINDOWS_H)
+#if !defined(LZO_HAVE_WINDOWS_H)
+#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
+#endif
+#endif
+#ifndef LZO_SIZEOF_SHORT
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#elif defined(__SIZEOF_SHORT__)
+# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_INT
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#elif defined(__SIZEOF_INT__)
+# define LZO_SIZEOF_INT (__SIZEOF_INT__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_LONG
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#elif defined(__SIZEOF_LONG__)
+# define LZO_SIZEOF_LONG (__SIZEOF_LONG__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_LONG_LONG
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#elif defined(__SIZEOF_LONG_LONG__)
+# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT16
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT32
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#endif
+#ifndef LZO_SIZEOF___INT64
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#endif
+#ifndef LZO_SIZEOF_VOID_P
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#elif defined(__SIZEOF_POINTER__)
+# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_SIZE_T
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#elif defined(__SIZEOF_SIZE_T__)
+# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__)
+#endif
+#endif
+#ifndef LZO_SIZEOF_PTRDIFF_T
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#elif defined(__SIZEOF_PTRDIFF_T__)
+# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__)
+#endif
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_SHORT 8
+# elif (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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short))
+#if !defined(LZO_SIZEOF_INT)
+# if (LZO_ARCH_CRAY_PVP)
+# define LZO_SIZEOF_INT 8
+# elif (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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int))
+#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,39) == 1)
+# define LZO_SIZEOF_LONG 5
+# 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
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long))
+#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
+# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1)
+# define LZO_SIZEOF_LONG_LONG 4
+# 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_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64 || defined(_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 || LZO_CC_SUNPROC))
+# 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 || defined(_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_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400 || defined(__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) && (LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if (LZO_CFG_NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#elif defined(_NO_LONGLONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_WORDSIZE)
+#if (LZO_ARCH_ALPHA)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AMD64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_AVR)
+# define LZO_WORDSIZE 1
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define LZO_WORDSIZE 4
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_WORDSIZE 4
+# else
+# define LZO_WORDSIZE 2
+# endif
+#elif (LZO_ARCH_I086)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_IA64)
+# define LZO_WORDSIZE 8
+#elif (LZO_ARCH_M16C)
+# define LZO_WORDSIZE 2
+#elif (LZO_ARCH_SPU)
+# define LZO_WORDSIZE 4
+#elif (LZO_ARCH_Z80)
+# define LZO_WORDSIZE 1
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_WORDSIZE 8
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# define LZO_WORDSIZE 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_WORDSIZE 8
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
+# define LZO_SIZEOF_VOID_P 8
+#elif defined(__LP64__) || defined(__LP64) || defined(_LP64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8)
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_ARCH_AVR)
+# 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_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# 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_I086)
+# 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 "invalid LZO_ARCH_I086 memory model"
+# endif
+#elif (LZO_ARCH_M16C)
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_ARCH_SPU)
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_ARCH_Z80)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_SIZEOF_VOID_P 4
+#elif (LZO_OS_OS400 || defined(__OS400__))
+# if defined(__LLP64_IFC__)
+# 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 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+# endif
+#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
+#endif
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *))
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t))
+#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 "invalid LZO_ARCH_I086 memory model"
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#if defined(offsetof)
+LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
+#endif
+#if !defined(LZO_WORDSIZE)
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+#endif
+#if (LZO_ABI_NEUTRAL_ENDIAN)
+# undef LZO_ABI_BIG_ENDIAN
+# undef LZO_ABI_LITTLE_ENDIAN
+#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN)
+#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
+# if (__LITTLE_ENDIAN__ == 1)
+# define LZO_ABI_LITTLE_ENDIAN 1
+# else
+# define LZO_ABI_BIG_ENDIAN 1
+# endif
+#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_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC)
+# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+# elif defined(__BIG_ENDIAN)
+# define LZO_ABI_BIG_ENDIAN 1
+# else
+# define LZO_ABI_LITTLE_ENDIAN 1
+# endif
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__)
+# 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 (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN)
+# error "unexpected configuration - check your compiler defines"
+#endif
+#if (LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif (LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif (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 == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_LP32 1
+# define LZO_INFO_ABI_PM "lp32"
+#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 0
+#elif !defined(__LZO_LIBC_OVERRIDE)
+#if (LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif (LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif (LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif (LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#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__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0))
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uc" "libc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define LZO_LIBC_ISOC90 1
+# define LZO_INFO_LIBC "isoc90"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if (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_GNUC == 0x011f00ul))
+#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_CC_GNUC)
+# 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"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000))
+# define __LZO_ASM_CLOBBER "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_CC : "cc"
+# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory"
+# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/
+#endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_ARM)
+# if defined(__ARM_FEATURE_UNALIGNED)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# endif
+#elif (LZO_ARCH_ARM64)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_CRIS)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_I386)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#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__)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# 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 (LZO_ABI_BIG_ENDIAN)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
+# endif
+#elif (LZO_ARCH_S390)
+# ifndef LZO_OPT_UNALIGNED16
+# define LZO_OPT_UNALIGNED16 1
+# endif
+# ifndef LZO_OPT_UNALIGNED32
+# define LZO_OPT_UNALIGNED32 1
+# endif
+# if (LZO_WORDSIZE == 8)
+# ifndef LZO_OPT_UNALIGNED64
+# define LZO_OPT_UNALIGNED64 1
+# endif
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#ifndef LZO_CFG_NO_INLINE_ASM
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_INLINE_ASM 1
+#elif (LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if (LZO_CFG_NO_INLINE_ASM)
+# undef LZO_ASM_SYNTAX_MSC
+# undef LZO_ASM_SYNTAX_GNUC
+# undef __LZO_ASM_CLOBBER
+# undef __LZO_ASM_CLOBBER_LIST_CC
+# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY
+# undef __LZO_ASM_CLOBBER_LIST_EMPTY
+#endif
+#ifndef LZO_CFG_NO_UNALIGNED
+#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if (LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#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
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(lzo_llong_t)
+#if (LZO_SIZEOF_LONG_LONG+0 > 0)
+__lzo_gnuc_extension__ typedef long long lzo_llong_t__;
+__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__;
+# define lzo_llong_t lzo_llong_t__
+# define lzo_ullong_t lzo_ullong_t__
+#endif
+#endif
+#if !defined(lzo_int16e_t)
+#if (LZO_SIZEOF_LONG == 2)
+# define lzo_int16e_t long
+# define lzo_uint16e_t unsigned long
+#elif (LZO_SIZEOF_INT == 2)
+# define lzo_int16e_t int
+# define lzo_uint16e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 2)
+# define lzo_int16e_t short int
+# define lzo_uint16e_t unsigned short int
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM)
+ typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__)));
+ typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__)));
+# define lzo_int16e_t lzo_int16e_hi_t__
+# define lzo_uint16e_t lzo_uint16e_hi_t__
+#elif (LZO_SIZEOF___INT16 == 2)
+# define lzo_int16e_t __int16
+# define lzo_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(lzo_int16e_t)
+# define LZO_SIZEOF_LZO_INT16E_T 2
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+#endif
+#if !defined(lzo_int32e_t)
+#if (LZO_SIZEOF_LONG == 4)
+# define lzo_int32e_t long int
+# define lzo_uint32e_t unsigned long int
+#elif (LZO_SIZEOF_INT == 4)
+# define lzo_int32e_t int
+# define lzo_uint32e_t unsigned int
+#elif (LZO_SIZEOF_SHORT == 4)
+# define lzo_int32e_t short int
+# define lzo_uint32e_t unsigned short int
+#elif (LZO_SIZEOF_LONG_LONG == 4)
+# define lzo_int32e_t lzo_llong_t
+# define lzo_uint32e_t lzo_ullong_t
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
+ typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__)));
+# define lzo_int32e_t lzo_int32e_si_t__
+# define lzo_uint32e_t lzo_uint32e_si_t__
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+#elif (LZO_SIZEOF___INT32 == 4)
+# define lzo_int32e_t __int32
+# define lzo_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(lzo_int32e_t)
+# define LZO_SIZEOF_LZO_INT32E_T 4
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+#endif
+#if !defined(lzo_int64e_t)
+#if (LZO_SIZEOF___INT64 == 8)
+# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define LZO_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int64e_t int
+# define lzo_uint64e_t unsigned int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG == 8)
+# define lzo_int64e_t long int
+# define lzo_uint64e_t unsigned long int
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64)
+# define lzo_int64e_t lzo_llong_t
+# define lzo_uint64e_t lzo_ullong_t
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0ll)
+# define LZO_UINT64_C(c) ((c) + 0ull)
+# elif 0
+# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL))
+# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL))
+# else
+# define LZO_INT64_C(c) (c##LL)
+# define LZO_UINT64_C(c) (c##ULL)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG
+#elif (LZO_SIZEOF___INT64 == 8)
+# define lzo_int64e_t __int64
+# define lzo_uint64e_t unsigned __int64
+# if (LZO_CC_BORLANDC)
+# define LZO_INT64_C(c) ((c) + 0i64)
+# define LZO_UINT64_C(c) ((c) + 0ui64)
+# else
+# define LZO_INT64_C(c) (c##i64)
+# define LZO_UINT64_C(c) (c##ui64)
+# endif
+# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64
+#else
+#endif
+#endif
+#if defined(lzo_int64e_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+#endif
+#if !defined(lzo_int32l_t)
+#if defined(lzo_int32e_t)
+# define lzo_int32l_t lzo_int32e_t
+# define lzo_uint32l_t lzo_uint32e_t
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T
+#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_int32l_t int
+# define lzo_uint32l_t unsigned int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= 4)
+# define lzo_int32l_t long int
+# define lzo_uint32l_t unsigned long int
+# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG
+#else
+# error "lzo_int32l_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+#endif
+#if !defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+# define lzo_int64l_t lzo_int64e_t
+# define lzo_uint64l_t lzo_uint64e_t
+# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T
+#else
+#endif
+#endif
+#if defined(lzo_int64l_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+#endif
+#if !defined(lzo_int32f_t)
+#if (LZO_SIZEOF_SIZE_T >= 8)
+# define lzo_int32f_t lzo_int64l_t
+# define lzo_uint32f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# define lzo_int32f_t lzo_int32l_t
+# define lzo_uint32f_t lzo_uint32l_t
+# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+#endif
+#if !defined(lzo_int64f_t)
+#if defined(lzo_int64l_t)
+# define lzo_int64f_t lzo_int64l_t
+# define lzo_uint64f_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T
+#else
+#endif
+#endif
+#if defined(lzo_int64f_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+#endif
+#if !defined(lzo_intptr_t)
+#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16))
+# define __LZO_INTPTR_T_IS_POINTER 1
+ typedef char* lzo_intptr_t;
+ typedef char* lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4))
+ typedef __w64 int lzo_intptr_t;
+ typedef __w64 unsigned int lzo_uintptr_t;
+# define lzo_intptr_t lzo_intptr_t
+# define lzo_uintptr_t lzo_uintptr_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t short
+# define lzo_uintptr_t unsigned short
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT
+#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
+# define lzo_intptr_t int
+# define lzo_uintptr_t unsigned int
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
+#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t long
+# define lzo_uintptr_t unsigned long
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG
+#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P)
+# define lzo_intptr_t lzo_int64l_t
+# define lzo_uintptr_t lzo_uint64l_t
+# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T
+#else
+# error "lzo_intptr_t"
+#endif
+#endif
+#if 1
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#endif
+#if !defined(lzo_word_t)
+#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0)
+#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER)
+# define lzo_word_t lzo_uintptr_t
+# define lzo_sword_t lzo_intptr_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG)
+# define lzo_word_t unsigned long
+# define lzo_sword_t long
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG
+#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
+# define lzo_word_t unsigned int
+# define lzo_sword_t int
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
+#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT)
+# define lzo_word_t unsigned short
+# define lzo_sword_t short
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT
+#elif (LZO_WORDSIZE == 1)
+# define lzo_word_t unsigned char
+# define lzo_sword_t signed char
+# define LZO_SIZEOF_LZO_WORD_T 1
+#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T)
+# define lzo_word_t lzo_uint64l_t
+# define lzo_sword_t lzo_int64l_t
+# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T
+#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC)
+#if 0
+ typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int lzo_sword_t __attribute__((__mode__(__V16QI__)));
+# define lzo_word_t lzo_word_t
+# define lzo_sword_t lzo_sword_t
+# define LZO_SIZEOF_LZO_WORD_T 16
+#endif
+#else
+# error "lzo_word_t"
+#endif
+#endif
+#endif
+#if 1 && defined(lzo_word_t)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE)
+#endif
+#if 1
+#define lzo_int8_t signed char
+#define lzo_uint8_t unsigned char
+#define LZO_SIZEOF_LZO_INT8_T 1
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+#endif
+#if defined(lzo_int16e_t)
+#define lzo_int16_t lzo_int16e_t
+#define lzo_uint16_t lzo_uint16e_t
+#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t))
+#endif
+#if defined(lzo_int32e_t)
+#define lzo_int32_t lzo_int32e_t
+#define lzo_uint32_t lzo_uint32e_t
+#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t))
+#endif
+#if defined(lzo_int64e_t)
+#define lzo_int64_t lzo_int64e_t
+#define lzo_uint64_t lzo_uint64e_t
+#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t))
+#endif
+#if 1
+#define lzo_int_least32_t lzo_int32l_t
+#define lzo_uint_least32_t lzo_uint32l_t
+#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t))
+#endif
+#if defined(lzo_int64l_t)
+#define lzo_int_least64_t lzo_int64l_t
+#define lzo_uint_least64_t lzo_uint64l_t
+#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t))
+#endif
+#if 1
+#define lzo_int_fast32_t lzo_int32f_t
+#define lzo_uint_fast32_t lzo_uint32f_t
+#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t))
+#endif
+#if defined(lzo_int64f_t)
+#define lzo_int_fast64_t lzo_int64f_t
+#define lzo_uint_fast64_t lzo_uint64f_t
+#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t))
+#endif
+#if !defined(LZO_INT16_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) ((c) + 0)
+# define LZO_UINT16_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) ((c) + 0L)
+# define LZO_UINT16_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 2)
+# define LZO_INT16_C(c) (c)
+# define LZO_UINT16_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 2)
+# define LZO_INT16_C(c) (c##L)
+# define LZO_UINT16_C(c) (c##UL)
+# else
+# error "LZO_INT16_C"
+# endif
+#endif
+#if !defined(LZO_INT32_C)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) ((c) + 0)
+# define LZO_UINT32_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) ((c) + 0L)
+# define LZO_UINT32_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 4)
+# define LZO_INT32_C(c) (c)
+# define LZO_UINT32_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 4)
+# define LZO_INT32_C(c) (c##L)
+# define LZO_UINT32_C(c) (c##UL)
+# elif (LZO_SIZEOF_LONG_LONG >= 4)
+# define LZO_INT32_C(c) (c##LL)
+# define LZO_UINT32_C(c) (c##ULL)
+# else
+# error "LZO_INT32_C"
+# endif
+#endif
+#if !defined(LZO_INT64_C) && defined(lzo_int64l_t)
+# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) ((c) + 0)
+# define LZO_UINT64_C(c) ((c) + 0U)
+# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) ((c) + 0L)
+# define LZO_UINT64_C(c) ((c) + 0UL)
+# elif (LZO_SIZEOF_INT >= 8)
+# define LZO_INT64_C(c) (c)
+# define LZO_UINT64_C(c) (c##U)
+# elif (LZO_SIZEOF_LONG >= 8)
+# define LZO_INT64_C(c) (c##L)
+# define LZO_UINT64_C(c) (c##UL)
+# else
+# error "LZO_INT64_C"
+# endif
+#endif
+#endif
+
+#endif
+
+#endif
+
+#undef LZO_HAVE_CONFIG_H
+#include "minilzo.h"
+
+#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2070)
+# error "version mismatch in miniLZO source files"
+#endif
+
+#ifdef MINILZO_HAVE_CONFIG_H
+# define LZO_HAVE_CONFIG_H 1
+#endif
+
+#ifndef __LZO_CONF_H
+#define __LZO_CONF_H 1
+
+#if !defined(__LZO_IN_MINILZO)
+#if defined(LZO_CFG_FREESTANDING) && (LZO_CFG_FREESTANDING)
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+#endif
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
+# include LZO_CFG_EXTRA_CONFIG_HEADER
+#endif
+#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED)
+# error "include this file first"
+#endif
+#include "lzo/lzoconf.h"
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2)
+# include LZO_CFG_EXTRA_CONFIG_HEADER2
+#endif
+#endif
+
+#if (LZO_VERSION < 0x2070) || !defined(__LZOCONF_H_INCLUDED)
+# error "version mismatch"
+#endif
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100))
+# pragma warning(disable: 4702)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1000))
+# pragma warning(disable: 4127 4701)
+# pragma warning(disable: 4514 4710 4711)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+# pragma warning(disable: 4820)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1800))
+# pragma warning(disable: 4746)
+#endif
+
+#if (LZO_CC_SUNPROC)
+#if !defined(__cplusplus)
+# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
+# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
+# pragma error_messages(off,E_STATEMENT_NOT_REACHED)
+#endif
+#endif
+
+#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING)
+#elif 1
+# include <string.h>
+#else
+# define LZO_WANT_ACC_INCD_H 1
+#endif
+#if defined(LZO_HAVE_CONFIG_H)
+# define LZO_CFG_NO_CONFIG_HEADER 1
+#endif
+
+#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 1 || defined(lzo_int8_t) || defined(lzo_uint8_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1)
+#endif
+#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2)
+#endif
+#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4)
+#endif
+#if defined(lzo_int64_t) || defined(lzo_uint64_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8)
+#endif
+
+#if (LZO_CFG_FREESTANDING)
+# undef HAVE_MEMCMP
+# undef HAVE_MEMCPY
+# undef HAVE_MEMMOVE
+# undef HAVE_MEMSET
+#endif
+
+#if !(HAVE_MEMCMP)
+# undef memcmp
+# define memcmp(a,b,c) lzo_memcmp(a,b,c)
+#else
+# undef lzo_memcmp
+# define lzo_memcmp(a,b,c) memcmp(a,b,c)
+#endif
+#if !(HAVE_MEMCPY)
+# undef memcpy
+# define memcpy(a,b,c) lzo_memcpy(a,b,c)
+#else
+# undef lzo_memcpy
+# define lzo_memcpy(a,b,c) memcpy(a,b,c)
+#endif
+#if !(HAVE_MEMMOVE)
+# undef memmove
+# define memmove(a,b,c) lzo_memmove(a,b,c)
+#else
+# undef lzo_memmove
+# define lzo_memmove(a,b,c) memmove(a,b,c)
+#endif
+#if !(HAVE_MEMSET)
+# undef memset
+# define memset(a,b,c) lzo_memset(a,b,c)
+#else
+# undef lzo_memset
+# define lzo_memset(a,b,c) memset(a,b,c)
+#endif
+
+#undef NDEBUG
+#if (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 (LZO_CFG_PGO)
+# undef __lzo_likely
+# undef __lzo_unlikely
+# define __lzo_likely(e) (e)
+# define __lzo_unlikely(e) (e)
+#endif
+
+#undef _
+#undef __
+#undef ___
+#undef ____
+#undef _p0
+#undef _p1
+#undef _p2
+#undef _p3
+#undef _p4
+#undef _s0
+#undef _s1
+#undef _s2
+#undef _s3
+#undef _s4
+#undef _ww
+
+#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_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_t)(a) * (lzo_uint32_t)(b)))
+#else
+# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
+#endif
+#endif
+
+#ifndef __LZO_FUNC_H
+#define __LZO_FUNC_H 1
+
+#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN)
+#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC)
+#define LZO_BITOPS_USE_ASM_BITSCAN 1
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#define LZO_BITOPS_USE_GNUC_BITSCAN 1
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#define LZO_BITOPS_USE_MSC_BITSCAN 1
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#include <intrin.h>
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#pragma intrinsic(_BitScanReverse)
+#pragma intrinsic(_BitScanForward)
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64)
+#pragma intrinsic(_BitScanReverse64)
+#pragma intrinsic(_BitScanForward64)
+#endif
+#endif
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4)
+ unsigned r; r = (unsigned) __builtin_clz(v); return r;
+#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzl(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzll(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4)
+ unsigned r; r = (unsigned) __builtin_ctz(v); return r;
+#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzl(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzll(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_bitops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz32_func);
+#if defined(lzo_uint64_t)
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz64_func);
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+}
+
+#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED)
+#ifndef __lzo_memops_tcheck
+#define __lzo_memops_tcheck(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b))
+#endif
+#endif
+#ifndef lzo_memops_TU0p
+#define lzo_memops_TU0p void __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU1p
+#define lzo_memops_TU1p unsigned char __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU2p
+#if (LZO_OPT_UNALIGNED16)
+typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2;
+#define lzo_memops_TU2p volatile lzo_memops_TU2 *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU2_struct,2)
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#else
+struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias;
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#endif
+#ifndef lzo_memops_TU2p
+#define lzo_memops_TU2p lzo_memops_TU2 *
+#endif
+#endif
+#ifndef lzo_memops_TU4p
+#if (LZO_OPT_UNALIGNED32)
+typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4;
+#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU4_struct,4)
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#else
+struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias;
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#endif
+#ifndef lzo_memops_TU4p
+#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_TU8p
+#if (LZO_OPT_UNALIGNED64)
+typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8;
+#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU8_struct,8)
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#else
+struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias;
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#endif
+#ifndef lzo_memops_TU8p
+#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_set_TU1p
+#define lzo_memops_set_TU1p volatile lzo_memops_TU1p
+#endif
+#ifndef lzo_memops_move_TU1p
+#define lzo_memops_move_TU1p lzo_memops_TU1p
+#endif
+#define LZO_MEMOPS_SET1(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__1[0] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET2(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET3(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET4(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE1(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__1[0] = s__1[0]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE2(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__2[0] = s__2[0]; d__2[1] = s__2[1]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE3(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE4(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE8(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \
+ d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \
+ LZO_BLOCK_END
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1)
+#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss)
+#if (LZO_OPT_UNALIGNED16)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU2,2,1)) { \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss)
+#endif
+#if (LZO_OPT_UNALIGNED32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU4,4,1)) { \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss)
+#endif
+#if (LZO_WORDSIZE != 8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#else
+#if (LZO_OPT_UNALIGNED64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#elif (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU8,8,1)) { \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss)
+#endif
+#endif
+#define LZO_MEMOPS_COPYN(dd,ss,nn) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \
+ lzo_uint n__n = (nn); \
+ while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \
+ if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(&v, ss);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss;
+ unsigned long vv;
+ __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint16_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(&v, ss);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss;
+ unsigned long vv;
+ __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint32_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint32_t) (((lzo_uint32_t)s[0] << 24) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[3]));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+ LZO_MEMOPS_COPY2(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+ LZO_MEMOPS_COPY4(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64)
+#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(dd, &vv);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU2p d = (lzo_memops_TU2p) dd;
+ unsigned long v = vv;
+ __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(dd, &vv);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU4p d = (lzo_memops_TU4p) dd;
+ unsigned long v = vv;
+ __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+ d[2] = LZO_BYTE((vv >> 16) & 0xff);
+ d[3] = LZO_BYTE((vv >> 24) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv)
+{
+ LZO_MEMOPS_COPY2(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv)
+{
+ LZO_MEMOPS_COPY4(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv)
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_memops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_memops_get_le16);
+ LZO_UNUSED_FUNC(lzo_memops_get_le32);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_put_le16);
+ LZO_UNUSED_FUNC(lzo_memops_put_le32);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_unused_funcs);
+}
+
+#endif
+
+#ifndef UA_SET1
+#define UA_SET1 LZO_MEMOPS_SET1
+#endif
+#ifndef UA_SET2
+#define UA_SET2 LZO_MEMOPS_SET2
+#endif
+#ifndef UA_SET3
+#define UA_SET3 LZO_MEMOPS_SET3
+#endif
+#ifndef UA_SET4
+#define UA_SET4 LZO_MEMOPS_SET4
+#endif
+#ifndef UA_MOVE1
+#define UA_MOVE1 LZO_MEMOPS_MOVE1
+#endif
+#ifndef UA_MOVE2
+#define UA_MOVE2 LZO_MEMOPS_MOVE2
+#endif
+#ifndef UA_MOVE3
+#define UA_MOVE3 LZO_MEMOPS_MOVE3
+#endif
+#ifndef UA_MOVE4
+#define UA_MOVE4 LZO_MEMOPS_MOVE4
+#endif
+#ifndef UA_MOVE8
+#define UA_MOVE8 LZO_MEMOPS_MOVE8
+#endif
+#ifndef UA_COPY1
+#define UA_COPY1 LZO_MEMOPS_COPY1
+#endif
+#ifndef UA_COPY2
+#define UA_COPY2 LZO_MEMOPS_COPY2
+#endif
+#ifndef UA_COPY3
+#define UA_COPY3 LZO_MEMOPS_COPY3
+#endif
+#ifndef UA_COPY4
+#define UA_COPY4 LZO_MEMOPS_COPY4
+#endif
+#ifndef UA_COPY8
+#define UA_COPY8 LZO_MEMOPS_COPY8
+#endif
+#ifndef UA_COPYN
+#define UA_COPYN LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_COPYN_X
+#define UA_COPYN_X LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_GET_LE16
+#define UA_GET_LE16 LZO_MEMOPS_GET_LE16
+#endif
+#ifndef UA_GET_LE32
+#define UA_GET_LE32 LZO_MEMOPS_GET_LE32
+#endif
+#ifdef LZO_MEMOPS_GET_LE64
+#ifndef UA_GET_LE64
+#define UA_GET_LE64 LZO_MEMOPS_GET_LE64
+#endif
+#endif
+#ifndef UA_GET_NE16
+#define UA_GET_NE16 LZO_MEMOPS_GET_NE16
+#endif
+#ifndef UA_GET_NE32
+#define UA_GET_NE32 LZO_MEMOPS_GET_NE32
+#endif
+#ifdef LZO_MEMOPS_GET_NE64
+#ifndef UA_GET_NE64
+#define UA_GET_NE64 LZO_MEMOPS_GET_NE64
+#endif
+#endif
+#ifndef UA_PUT_LE16
+#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16
+#endif
+#ifndef UA_PUT_LE32
+#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32
+#endif
+#ifndef UA_PUT_NE16
+#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16
+#endif
+#ifndef UA_PUT_NE32
+#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32
+#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(const lzo_bytep) lzo_copyright(void);
+
+#ifndef __LZO_PTR_H
+#define __LZO_PTR_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if (LZO_ARCH_I086)
+#error "LZO_ARCH_I086 is unsupported"
+#elif (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#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_xint a_lzo_xint;
+ lzo_int16_t a_lzo_int16_t;
+ lzo_uint16_t a_lzo_uint16_t;
+ lzo_int32_t a_lzo_int32_t;
+ lzo_uint32_t a_lzo_uint32_t;
+#if defined(lzo_uint64_t)
+ lzo_int64_t a_lzo_int64_t;
+ lzo_uint64_t a_lzo_uint64_t;
+#endif
+ size_t a_size_t;
+ ptrdiff_t a_ptrdiff_t;
+ lzo_uintptr_t a_lzo_uintptr_t;
+ void * a_void_p;
+ char * a_char_p;
+ unsigned char * a_uchar_p;
+ const void * a_c_void_p;
+ const char * a_c_char_p;
+ const unsigned char * a_c_uchar_p;
+ lzo_voidp a_lzo_voidp;
+ lzo_bytep a_lzo_bytep;
+ const lzo_voidp a_c_lzo_voidp;
+ const lzo_bytep a_c_lzo_bytep;
+}
+lzo_full_align_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#ifndef LZO_DETERMINISTIC
+#define LZO_DETERMINISTIC 1
+#endif
+
+#ifndef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 1
+#endif
+
+#if (LZO_DICT_USE_PTR)
+# define lzo_dict_t const lzo_bytep
+# define lzo_dict_p lzo_dict_t *
+#else
+# define lzo_dict_t lzo_uint
+# define lzo_dict_p lzo_dict_t *
+#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)
+#error "LZO_ARCH_I086 is unsupported"
+#elif (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#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 (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
+#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 <= size);
+ return (unsigned)n;
+}
+
+#endif
+#if !defined(MINILZO_CFG_SKIP_LZO_UTIL)
+
+/* If you use the LZO library in a product, I would appreciate that you
+ * keep this copyright string in the executable of your product.
+ */
+
+static const char __lzo_copyright[] =
+#if !defined(__LZO_IN_MINLZO)
+ LZO_VERSION_STRING;
+#else
+ "\r\n\n"
+ "LZO data compression library.\n"
+ "$Copyright: LZO Copyright (C) 1996-2014 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"
+ "$Info: " LZO_INFO_STRING " $\n";
+#endif
+
+LZO_PUBLIC(const lzo_bytep)
+lzo_copyright(void)
+{
+ return (const lzo_bytep) __lzo_copyright;
+}
+
+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_t)
+lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len)
+{
+ lzo_uint32_t s1 = adler & 0xffff;
+ lzo_uint32_t 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
+
+#endif
+#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) || !(HAVE_MEMCMP)
+ const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMCPY)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMMOVE)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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 cc, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
+ lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s);
+ unsigned char c = LZO_ITRUNC(unsigned char, cc);
+ if __lzo_likely(len > 0) do
+ *p++ = c;
+ while __lzo_likely(--len > 0);
+ return s;
+#else
+ return memset(s, cc, len);
+#endif
+}
+#undef LZOLIB_PUBLIC
+#endif
+#if !defined(MINILZO_CFG_SKIP_LZO_INIT)
+
+#if !defined(__LZO_IN_MINILZO)
+
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+
+ LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+#if !(__LZO_UINTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
+
+#endif
+#undef LZOCHK_ASSERT
+
+union lzo_config_check_union {
+ lzo_uint a[2];
+ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))];
+#if defined(lzo_uint64_t)
+ lzo_uint64_t c[2];
+#endif
+};
+
+#if 0
+#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
+#else
+static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
+{
+ return (lzo_voidp) ((lzo_bytep) ptr + off);
+}
+#endif
+
+LZO_PUBLIC(int)
+_lzo_config_check(void)
+{
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul))
+# if 0
+ volatile
+# endif
+#endif
+ union lzo_config_check_union u;
+ lzo_voidp p;
+ unsigned r = 1;
+
+ u.a[0] = u.a[1] = 0;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_bytep) p) == 0);
+#if !(LZO_CFG_NO_CONFIG_CHECK)
+#if (LZO_ABI_BIG_ENDIAN)
+ u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
+#endif
+#if (LZO_ABI_LITTLE_ENDIAN)
+ u.a[0] = u.a[1] = 0; u.b[0] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
+#endif
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 1; u.b[3] = 2;
+ p = u2p(&u, 1);
+ r &= UA_GET_NE16(p) == 0;
+ r &= UA_GET_LE16(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE16(p) == 128;
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 3; u.b[5] = 4;
+ p = u2p(&u, 1);
+ r &= UA_GET_NE32(p) == 0;
+ r &= UA_GET_LE32(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE32(p) == 128;
+#if defined(UA_GET_NE64)
+ u.c[0] = u.c[1] = 0;
+ u.b[0] = 5; u.b[9] = 6;
+ p = u2p(&u, 1);
+ u.c[0] = u.c[1] = 0;
+ r &= UA_GET_NE64(p) == 0;
+#if defined(UA_GET_LE64)
+ r &= UA_GET_LE64(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE64(p) == 128;
+#endif
+#endif
+#if defined(lzo_bitops_ctlz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz32(v) == 31 - i;
+ r &= lzo_bitops_ctlz32_func(v) == 31 - i;
+ }}
+#endif
+#if defined(lzo_bitops_ctlz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz64(v) == 63 - i;
+ r &= lzo_bitops_ctlz64_func(v) == 63 - i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz32(v) == i;
+ r &= lzo_bitops_cttz32_func(v) == i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz64(v) == i;
+ r &= lzo_bitops_cttz64_func(v) == i;
+ }}
+#endif
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+
+ return r == 1 ? LZO_E_OK : LZO_E_ERROR;
+}
+
+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 LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+#endif
+#undef LZOCHK_ASSERT
+
+ 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_t)) &&
+ (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
+
+#endif
+
+#define LZO1X 1
+#define LZO_EOF_CODE 1
+#define M2_MAX_OFFSET 0x0800
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
+
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+#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)
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+
+#ifndef __LZO_CONFIG1X_H
+#define __LZO_CONFIG1X_H 1
+
+#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
+# define LZO1X 1
+#endif
+
+#if !defined(__LZO_IN_MINILZO)
+#include "lzo/lzo1x.h"
+#endif
+
+#ifndef LZO_EOF_CODE
+#define LZO_EOF_CODE 1
+#endif
+#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 1
+
+#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 < 6 || D_BITS > 18)
+# error "invalid D_BITS"
+#endif
+#if (DL_BITS < 6 || 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 1
+# 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 1
+# 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 1
+# 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)
+#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_LLVM)
+static void __attribute__((__unused__))
+#else
+static void
+#endif
+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 (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_dict_t) pd(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 (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 (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 LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1x_1_compress
+#endif
+
+#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
+# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core)
+#endif
+
+static __lzo_noinline lzo_uint
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_uint ti, lzo_voidp wrkmem)
+{
+ 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 - 20;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+ op = out;
+ ip = in;
+ ii = ip;
+
+ ip += ti < 4 ? 4 - ti : 0;
+ for (;;)
+ {
+ const lzo_bytep m_pos;
+#if !(LZO_DETERMINISTIC)
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+ lzo_uint m_len;
+ lzo_uint dindex;
+next:
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ 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 (LZO_OPT_UNALIGNED32)
+ if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip))
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
+#endif
+ {
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ ip += 1 + ((ip - ii) >> 5);
+ continue;
+ }
+ UPDATE_I(dict,0,dindex,ip,in);
+#else
+ lzo_uint m_off;
+ lzo_uint m_len;
+ {
+ lzo_uint32_t dv;
+ lzo_uint dindex;
+literal:
+ ip += 1 + ((ip - ii) >> 5);
+next:
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ dv = UA_GET_LE32(ip);
+ dindex = DINDEX(dv,ip);
+ GINDEX(m_off,m_pos,in+dict,dindex,in);
+ UPDATE_I(dict,0,dindex,ip,in);
+ if __lzo_unlikely(dv != UA_GET_LE32(m_pos))
+ goto literal;
+ }
+#endif
+
+ ii -= ti; ti = 0;
+ {
+ lzo_uint t = pd(ip,ii);
+ if (t != 0)
+ {
+ if (t <= 3)
+ {
+ op[-2] = LZO_BYTE(op[-2] | t);
+#if (LZO_OPT_UNALIGNED32)
+ UA_COPY4(op, ii);
+ op += t;
+#else
+ { do *op++ = *ii++; while (--t > 0); }
+#endif
+ }
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
+ else if (t <= 16)
+ {
+ *op++ = LZO_BYTE(t - 3);
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
+ op += t;
+ }
+#endif
+ else
+ {
+ if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+ *op++ = 0;
+ while __lzo_unlikely(tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
+ do {
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
+ op += 16; ii += 16; t -= 16;
+ } while (t >= 16); if (t > 0)
+#endif
+ { do *op++ = *ii++; while (--t > 0); }
+ }
+ }
+ }
+ m_len = 4;
+ {
+#if (LZO_OPT_UNALIGNED64)
+ lzo_uint64_t v;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 8;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64)
+ m_len += lzo_bitops_ctlz64(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (64 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (64 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64)
+ m_len += lzo_bitops_cttz64(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
+#endif
+#elif (LZO_OPT_UNALIGNED32)
+ lzo_uint32_t v;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if (v != 0)
+ break;
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32)
+ m_len += lzo_bitops_ctlz32(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (32 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (32 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32)
+ m_len += lzo_bitops_cttz32(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
+#endif
+#else
+ if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
+ do {
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (ip[m_len] == m_pos[m_len]);
+ }
+#endif
+ }
+m_len_done:
+ m_off = pd(ip,m_pos);
+ ip += m_len;
+ ii = ip;
+ if (m_len <= M2_MAX_LEN && 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;
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= M3_MAX_LEN;
+ *op++ = M3_MARKER | 0;
+ while __lzo_unlikely(m_len > 255)
+ {
+ m_len -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+ else
+ {
+ m_off -= 0x4000;
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2));
+ else
+ {
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8));
+ while __lzo_unlikely(m_len > 255)
+ {
+ m_len -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+ goto next;
+ }
+
+ *out_len = pd(op, out);
+ return pd(in_end,ii-ti);
+}
+
+LZO_PUBLIC(int)
+DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ const lzo_bytep ip = in;
+ lzo_bytep op = out;
+ lzo_uint l = in_len;
+ lzo_uint t = 0;
+
+ while (l > 20)
+ {
+ lzo_uint ll = l;
+ lzo_uintptr_t ll_end;
+#if 0 || (LZO_DETERMINISTIC)
+ ll = LZO_MIN(ll, 49152);
+#endif
+ ll_end = (lzo_uintptr_t)ip + ll;
+ if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll)
+ break;
+#if (LZO_DETERMINISTIC)
+ lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t));
+#endif
+ t = do_compress(ip,ll,op,out_len,t,wrkmem);
+ ip += ll;
+ op += *out_len;
+ l -= ll;
+ }
+ t += l;
+
+ 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(op[-2] | t);
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ UA_COPYN(op, ii, t);
+ op += t;
+ }
+
+ *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 1
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
+#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
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) 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
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(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 1
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP 1
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP 1
+#else
+# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP 1
+#else
+# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP 1
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP 1
+#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
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ 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;
+
+ NEED_IP(1);
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ for (;;)
+ {
+ NEED_IP(3);
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_IV(t);
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ t += 3;
+ if (t >= 8) do
+ {
+ UA_COPY8(op,ip);
+ op += 8; ip += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ }
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ UA_COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ UA_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 !(LZO_OPT_UNALIGNED32)
+ }
+ else
+#endif
+#endif
+#if !(LZO_OPT_UNALIGNED32)
+ {
+ *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;
+
+ for (;;) {
+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)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ NEED_IP(2);
+ }
+#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 (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= UA_GET_LE16(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)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ NEED_IP(2);
+ }
+#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 (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(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 (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ if (op - m_pos >= 8)
+ {
+ t += (3 - 1);
+ if (t >= 8) do
+ {
+ UA_COPY8(op,m_pos);
+ op += 8; m_pos += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = m_pos[0];
+ if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
+ }
+ }
+ else
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ 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
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ UA_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+3);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ }
+ }
+
+eof_found:
+ *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 1
+#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 1
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
+#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
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) 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
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(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 1
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP 1
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP 1
+#else
+# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP 1
+#else
+# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP 1
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP 1
+#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
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ 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;
+
+ NEED_IP(1);
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ for (;;)
+ {
+ NEED_IP(3);
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_IV(t);
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ t += 3;
+ if (t >= 8) do
+ {
+ UA_COPY8(op,ip);
+ op += 8; ip += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ }
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ UA_COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ UA_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 !(LZO_OPT_UNALIGNED32)
+ }
+ else
+#endif
+#endif
+#if !(LZO_OPT_UNALIGNED32)
+ {
+ *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;
+
+ for (;;) {
+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)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ NEED_IP(2);
+ }
+#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 (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= UA_GET_LE16(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)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ NEED_IP(2);
+ }
+#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 (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(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 (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ if (op - m_pos >= 8)
+ {
+ t += (3 - 1);
+ if (t >= 8) do
+ {
+ UA_COPY8(op,m_pos);
+ op += 8; m_pos += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = m_pos[0];
+ if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
+ }
+ }
+ else
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ 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
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ UA_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+3);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ }
+ }
+
+eof_found:
+ *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/ics-openvpn-stripped/main/lzo/minilzo/minilzo.h b/ics-openvpn-stripped/main/lzo/minilzo/minilzo.h
new file mode 100644
index 00000000..fd2fb321
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/minilzo.h
@@ -0,0 +1,94 @@
+/* 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) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 1
+
+#define MINILZO_VERSION 0x2070
+
+#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_t) (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/ics-openvpn-stripped/main/lzo/minilzo/testmini.c b/ics-openvpn-stripped/main/lzo/minilzo/testmini.c
new file mode 100644
index 00000000..581943ff
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/minilzo/testmini.c
@@ -0,0 +1,150 @@
+/* testmini.c -- very simple test program for the miniLZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/*************************************************************************
+// This program shows the basic usage of the LZO library.
+// We will compress a block of data and decompress again.
+//
+// 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/
+**************************************************************************/
+
+/* First let's include "minizo.h". */
+
+#include "minilzo.h"
+
+
+/* We want to compress the data block at 'in' with length 'IN_LEN' to
+ * the block at 'out'. Because the input block may be incompressible,
+ * we must provide a little more output space in case that compression
+ * is not possible.
+ */
+
+#define IN_LEN (128*1024ul)
+#define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3)
+
+static unsigned char __LZO_MMODEL in [ IN_LEN ];
+static unsigned char __LZO_MMODEL out [ OUT_LEN ];
+
+
+/* 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);
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int main(int argc, char *argv[])
+{
+ int r;
+ lzo_uint in_len;
+ lzo_uint out_len;
+ lzo_uint new_len;
+
+ if (argc < 0 && argv == NULL) /* avoid warning about unused args */
+ return 0;
+
+ printf("\nLZO real-time data compression library (v%s, %s).\n",
+ lzo_version_string(), lzo_version_date());
+ printf("Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n");
+
+
+/*
+ * Step 1: initialize the LZO library
+ */
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("internal error - lzo_init() failed !!!\n");
+ printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable '-DLZO_DEBUG' for diagnostics)\n");
+ return 3;
+ }
+
+/*
+ * Step 2: prepare the input block that will get compressed.
+ * We just fill it with zeros in this example program,
+ * but you would use your real-world data here.
+ */
+ in_len = IN_LEN;
+ lzo_memset(in,0,in_len);
+
+/*
+ * Step 3: compress from 'in' to 'out' with LZO1X-1
+ */
+ r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem);
+ if (r == LZO_E_OK)
+ printf("compressed %lu bytes into %lu bytes\n",
+ (unsigned long) in_len, (unsigned long) out_len);
+ else
+ {
+ /* this should NEVER happen */
+ printf("internal error - compression failed: %d\n", r);
+ return 2;
+ }
+ /* check for an incompressible block */
+ if (out_len >= in_len)
+ {
+ printf("This block contains incompressible data.\n");
+ return 0;
+ }
+
+/*
+ * Step 4: decompress again, now going from 'out' to 'in'
+ */
+ new_len = in_len;
+ r = lzo1x_decompress(out,out_len,in,&new_len,NULL);
+ if (r == LZO_E_OK && new_len == in_len)
+ printf("decompressed %lu bytes back into %lu bytes\n",
+ (unsigned long) out_len, (unsigned long) in_len);
+ else
+ {
+ /* this should NEVER happen */
+ printf("internal error - decompression failed: %d\n", r);
+ return 1;
+ }
+
+ printf("\nminiLZO simple compression test passed.\n");
+ return 0;
+}
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1_99.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1_99.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1_99.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a_99.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a_99.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1a_99.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_3.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_3.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_3.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_4.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_4.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_4.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_5.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_5.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_5.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_6.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_6.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_6.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_7.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_7.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_7.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_8.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_8.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_8.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_99.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_99.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_99.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_cc.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_cc.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_cc.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_rr.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_rr.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_rr.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_xx.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_xx.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1b_xx.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_3.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_3.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_3.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_4.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_4.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_4.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_5.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_5.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_5.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_6.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_6.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_6.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_7.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_7.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_7.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_8.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_8.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_8.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_99.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_99.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_99.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_cc.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_cc.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_cc.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_rr.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_rr.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_rr.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_xx.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_xx.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1c_xx.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1f_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1k.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1k.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1k.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1l.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1l.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1l.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1o.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1o.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_1o.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d3.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d3.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_d3.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_o.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_o.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1x_o.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d3.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d3.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_d3.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_o.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_o.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1y_o.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d3.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d3.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo1z_d3.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_9x.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_9x.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_9x.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d1.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d1.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d1.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d2.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d2.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo2a_d2.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo_crc.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_crc.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_crc.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo_init.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_init.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_init.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo_ptr.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_ptr.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_ptr.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo_str.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_str.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_str.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/.deps/lzo_util.Plo b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_util.Plo
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/.deps/lzo_util.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/src/Makefile.am b/ics-openvpn-stripped/main/lzo/src/Makefile.am
new file mode 100644
index 00000000..e5f6ca01
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/Makefile.am
@@ -0,0 +1,68 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+VPATH = @srcdir@@LZO_ASM_VPATH@
+SUFFIXES = .S
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+CPPFLAGS = $(LZO_CPPFLAGS) $(configure_CPPFLAGS) $(LZO_EXTRA_CPPFLAGS)
+CFLAGS = $(LZO_CFLAGS) $(configure_CFLAGS) $(LZO_EXTRA_CFLAGS)
+
+lib_LTLIBRARIES = liblzo2.la
+
+liblzo2_la_LDFLAGS = -version-info 2:0:0
+
+liblzo2_la_SOURCES = \
+ lzo_crc.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \
+ lzo1.c lzo1_99.c \
+ lzo1a.c lzo1a_99.c \
+ lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \
+ lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \
+ lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \
+ lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \
+ lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \
+ lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \
+ lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \
+ lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \
+ lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \
+ lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \
+ lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \
+ lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c
+
+EXTRA_DIST = \
+ lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \
+ lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \
+ lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \
+ lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch \
+ lzo_dll.ch lzo_mchw.ch lzo_swd.ch \
+ compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \
+ config1f.h config1x.h config1y.h config1z.h config2a.h \
+ lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \
+ lzo_ptr.h stats1a.h stats1b.h stats1c.h miniacc.h
+
+liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS)
+liblzo2_la_DEPENDENCIES = $(liblzo2_la_LIBADD)
+
+
+# /***********************************************************************
+# // assembler support
+# ************************************************************************/
+
+if LZO_USE_ASM
+
+LZO_ASM_OBJECTS = \
+ lzo1c_s1.lo lzo1c_s2.lo \
+ lzo1f_f1.lo lzo1f_f2.lo \
+ lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
+ lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo
+
+.S.o:
+ $(CC) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(CC) -c $<
+
+endif
+
diff --git a/ics-openvpn-stripped/main/lzo/src/Makefile.in b/ics-openvpn-stripped/main/lzo/src/Makefile.in
new file mode 100644
index 00000000..90cf4e22
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/Makefile.in
@@ -0,0 +1,600 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+srcdir = @srcdir@
+top_srcdir = @top_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@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+@LZO_USE_ASM_TRUE@am__DEPENDENCIES_1 = lzo1c_s1.lo lzo1c_s2.lo \
+@LZO_USE_ASM_TRUE@ lzo1f_f1.lo lzo1f_f2.lo lzo1x_f1.lo \
+@LZO_USE_ASM_TRUE@ lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
+@LZO_USE_ASM_TRUE@ lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo \
+@LZO_USE_ASM_TRUE@ lzo1y_s2.lo
+am_liblzo2_la_OBJECTS = lzo_crc.lo lzo_init.lo lzo_ptr.lo lzo_str.lo \
+ lzo_util.lo lzo1.lo lzo1_99.lo lzo1a.lo lzo1a_99.lo lzo1b_1.lo \
+ lzo1b_2.lo lzo1b_3.lo lzo1b_4.lo lzo1b_5.lo lzo1b_6.lo \
+ lzo1b_7.lo lzo1b_8.lo lzo1b_9.lo lzo1b_99.lo lzo1b_9x.lo \
+ lzo1b_cc.lo lzo1b_d1.lo lzo1b_d2.lo lzo1b_rr.lo lzo1b_xx.lo \
+ lzo1c_1.lo lzo1c_2.lo lzo1c_3.lo lzo1c_4.lo lzo1c_5.lo \
+ lzo1c_6.lo lzo1c_7.lo lzo1c_8.lo lzo1c_9.lo lzo1c_99.lo \
+ lzo1c_9x.lo lzo1c_cc.lo lzo1c_d1.lo lzo1c_d2.lo lzo1c_rr.lo \
+ lzo1c_xx.lo lzo1f_1.lo lzo1f_9x.lo lzo1f_d1.lo lzo1f_d2.lo \
+ lzo1x_1.lo lzo1x_9x.lo lzo1x_d1.lo lzo1x_d2.lo lzo1x_d3.lo \
+ lzo1x_o.lo lzo1x_1k.lo lzo1x_1l.lo lzo1x_1o.lo lzo1y_1.lo \
+ lzo1y_9x.lo lzo1y_d1.lo lzo1y_d2.lo lzo1y_d3.lo lzo1y_o.lo \
+ lzo1z_9x.lo lzo1z_d1.lo lzo1z_d2.lo lzo1z_d3.lo lzo2a_9x.lo \
+ lzo2a_d1.lo lzo2a_d2.lo
+liblzo2_la_OBJECTS = $(am_liblzo2_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(liblzo2_la_SOURCES)
+DIST_SOURCES = $(liblzo2_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+VPATH = @srcdir@@LZO_ASM_VPATH@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = $(LZO_CFLAGS) $(configure_CFLAGS) $(LZO_EXTRA_CFLAGS)
+CPP = @CPP@
+CPPFLAGS = $(LZO_CPPFLAGS) $(configure_CPPFLAGS) $(LZO_EXTRA_CPPFLAGS)
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+SUFFIXES = .S
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+lib_LTLIBRARIES = liblzo2.la
+liblzo2_la_LDFLAGS = -version-info 2:0:0
+liblzo2_la_SOURCES = \
+ lzo_crc.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \
+ lzo1.c lzo1_99.c \
+ lzo1a.c lzo1a_99.c \
+ lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \
+ lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \
+ lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \
+ lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \
+ lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \
+ lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \
+ lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \
+ lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \
+ lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \
+ lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \
+ lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \
+ lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c
+
+EXTRA_DIST = \
+ lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \
+ lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \
+ lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \
+ lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch \
+ lzo_dll.ch lzo_mchw.ch lzo_swd.ch \
+ compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \
+ config1f.h config1x.h config1y.h config1z.h config2a.h \
+ lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \
+ lzo_ptr.h stats1a.h stats1b.h stats1c.h miniacc.h
+
+liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS)
+liblzo2_la_DEPENDENCIES = $(liblzo2_la_LIBADD)
+
+# /***********************************************************************
+# // assembler support
+# ************************************************************************/
+@LZO_USE_ASM_TRUE@LZO_ASM_OBJECTS = \
+@LZO_USE_ASM_TRUE@ lzo1c_s1.lo lzo1c_s2.lo \
+@LZO_USE_ASM_TRUE@ lzo1f_f1.lo lzo1f_f2.lo \
+@LZO_USE_ASM_TRUE@ lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \
+@LZO_USE_ASM_TRUE@ lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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=$(am__strip_dir) \
+ 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)
+ @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ 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
+liblzo2.la: $(liblzo2_la_OBJECTS) $(liblzo2_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(liblzo2_la_LDFLAGS) $(liblzo2_la_OBJECTS) $(liblzo2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_6.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_7.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_cc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_rr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_xx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_6.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_7.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_99.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_cc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_rr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_xx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1k.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1l.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_o.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_9x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_crc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_ptr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_str.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_util.Plo@am__quote@
+
+.c.o:
+@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@ 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@ 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 $@ $<
+
+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)
+ @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:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -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:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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
+
+.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
+
+
+@LZO_USE_ASM_TRUE@.S.o:
+@LZO_USE_ASM_TRUE@ $(CC) -c $<
+
+@LZO_USE_ASM_TRUE@.S.lo:
+@LZO_USE_ASM_TRUE@ $(LIBTOOL) --mode=compile $(CC) -c $<
+# 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/ics-openvpn-stripped/main/lzo/src/compr1b.h b/ics-openvpn-stripped/main/lzo/src/compr1b.h
new file mode 100644
index 00000000..32b22669
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/compr1b.h
@@ -0,0 +1,69 @@
+/* compr1b.h --
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO_NEED_DICT_H 1
+#include "config1b.h"
+
+
+#if !defined(COMPRESS_ID)
+#define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL)
+#endif
+
+
+#include "lzo1b_c.ch"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_COMPRESS \
+ LZO_PP_ECONCAT3(lzo1b_,COMPRESS_ID,_compress)
+
+#define LZO_COMPRESS_FUNC \
+ LZO_PP_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func)
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+const lzo_compress_t LZO_COMPRESS_FUNC = do_compress;
+
+LZO_PUBLIC(int)
+LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return _lzo1b_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
+}
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/compr1c.h b/ics-openvpn-stripped/main/lzo/src/compr1c.h
new file mode 100644
index 00000000..566ba447
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/compr1c.h
@@ -0,0 +1,69 @@
+/* compr1c.h --
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO_NEED_DICT_H 1
+#include "config1c.h"
+
+
+#if !defined(COMPRESS_ID)
+#define COMPRESS_ID LZO_PP_ECONCAT2(DD_BITS,CLEVEL)
+#endif
+
+
+#include "lzo1b_c.ch"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_COMPRESS \
+ LZO_PP_ECONCAT3(lzo1c_,COMPRESS_ID,_compress)
+
+#define LZO_COMPRESS_FUNC \
+ LZO_PP_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func)
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+const lzo_compress_t LZO_COMPRESS_FUNC = do_compress;
+
+LZO_PUBLIC(int)
+LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return _lzo1c_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
+}
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/config1.h b/ics-openvpn-stripped/main/lzo/src/config1.h
new file mode 100644
index 00000000..592f4737
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1.h
@@ -0,0 +1,49 @@
+/* config1.h -- configuration for the LZO1 algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+#ifndef __LZO_CONFIG1_H
+#define __LZO_CONFIG1_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo1.h"
+
+#define LZO_NO_R1 1
+#include "config1a.h"
+
+#endif /* already included */
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1a.h b/ics-openvpn-stripped/main/lzo/src/config1a.h
new file mode 100644
index 00000000..3f0aa48f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1a.h
@@ -0,0 +1,184 @@
+/* config1a.h -- configuration for the LZO1A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1A_H
+#define __LZO_CONFIG1A_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo1a.h"
+
+#undef LZO_COLLECT_STATS /* no support for stats here */
+
+
+/***********************************************************************
+// algorithm configuration
+************************************************************************/
+
+/* run bits (4 - 5) - the compressor and the decompressor
+ * must use the same value. */
+#if !defined(RBITS)
+# define RBITS 5
+#endif
+
+/* dictionary depth (0 - 6) - this only affects the compressor.
+ * 0 is fastest, 6 is best compression ratio */
+#if !defined(DDBITS)
+# define DDBITS 0
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* check configuration */
+#if (RBITS < 4 || RBITS > 5)
+# error "invalid RBITS"
+#endif
+#if (DDBITS < 0 || DDBITS > 6)
+# error "invalid DDBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// internal configuration
+************************************************************************/
+
+/* add a special code so that the decompressor can detect the
+ * end of the compressed data block (overhead is 3 bytes per block) */
+#undef LZO_EOF_CODE
+
+
+/***********************************************************************
+// algorithm internal configuration
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+
+/* config */
+#define R_BITS RBITS
+#define DD_BITS DDBITS
+#ifndef D_BITS
+#define D_BITS 16
+#endif
+
+
+/***********************************************************************
+// optimization and debugging
+************************************************************************/
+
+/* Collect statistics */
+#if 0 && !defined(LZO_COLLECT_STATS)
+# define LZO_COLLECT_STATS 1
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define M3O_BITS M2O_BITS
+#define M3L_BITS CHAR_BIT
+#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 1)
+#define _MAX_OFFSET _M2_MAX_OFFSET
+#define LZO_NO_M3 1
+
+#include "lzo1b_de.h"
+#include "stats1b.h"
+
+#include "lzo1b_cc.h"
+
+
+/***********************************************************************
+// check for total LZO1/LZO1A compatibility
+************************************************************************/
+
+#undef M2_MARKER
+#define M2_MARKER (1 << M2O_BITS)
+
+#if (R_BITS != 5)
+# error
+#endif
+#if (M2O_BITS != 5)
+# error
+#endif
+#if (M3O_BITS != 5)
+# error
+#endif
+#if (M2_MIN_LEN != 3)
+# error
+#endif
+#if (M2_MAX_LEN != 8)
+# error
+#endif
+#if (M3_MIN_LEN != 9)
+# error
+#endif
+#if (M3_MAX_LEN != 264)
+# error
+#endif
+#if (_M2_MAX_OFFSET != (1u << 13))
+# error
+#endif
+#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
+# error
+#endif
+#if (_M2_MAX_OFFSET != _MAX_OFFSET)
+# error
+#endif
+#if (R0MIN != 32)
+# error
+#endif
+#if (R0MAX != 287)
+# error
+#endif
+#if (R0FAST != 280)
+# error
+#endif
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1b.h b/ics-openvpn-stripped/main/lzo/src/config1b.h
new file mode 100644
index 00000000..26f47cbe
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1b.h
@@ -0,0 +1,128 @@
+/* config1b.h -- configuration for the LZO1B algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1B_H
+#define __LZO_CONFIG1B_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo1b.h"
+
+
+/***********************************************************************
+// algorithm configuration
+************************************************************************/
+
+/* run bits (4 - 5) - the compressor and the decompressor
+ * must use the same value. */
+#if !defined(RBITS)
+# define RBITS 5
+#endif
+
+/* dictionary depth (0 - 6) - this only affects the compressor.
+ * 0 is fastest, 6 is best compression ratio */
+#if !defined(DDBITS)
+# define DDBITS 0
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* check configuration */
+#if (RBITS < 4 || RBITS > 5)
+# error "invalid RBITS"
+#endif
+#if (DDBITS < 0 || DDBITS > 6)
+# error "invalid DDBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// internal configuration
+************************************************************************/
+
+/* add a special code so that the decompressor can detect the
+ * end of the compressed data block (overhead is 3 bytes per block) */
+#define LZO_EOF_CODE 1
+
+
+/***********************************************************************
+// algorithm internal configuration
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+
+/* config */
+#define R_BITS RBITS
+#define DD_BITS DDBITS
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+
+
+/***********************************************************************
+// optimization and debugging
+************************************************************************/
+
+/* Collect statistics */
+#if 0 && !defined(LZO_COLLECT_STATS)
+# define LZO_COLLECT_STATS 1
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#include "lzo1b_de.h"
+#include "stats1b.h"
+
+#include "lzo1b_cc.h"
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1c.h b/ics-openvpn-stripped/main/lzo/src/config1c.h
new file mode 100644
index 00000000..a465eaf6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1c.h
@@ -0,0 +1,133 @@
+/* config1c.h -- configuration for the LZO1C algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1C_H
+#define __LZO_CONFIG1C_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo1c.h"
+
+
+/***********************************************************************
+// algorithm configuration
+************************************************************************/
+
+/* run bits (4 - 5) - the compressor and the decompressor
+ * must use the same value. */
+#if !defined(RBITS)
+# define RBITS 5
+#endif
+
+/* dictionary depth (0 - 6) - this only affects the compressor.
+ * 0 is fastest, 6 is best compression ratio */
+#if !defined(DDBITS)
+# define DDBITS 0
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* check configuration */
+#if (RBITS < 4 || RBITS > 5)
+# error "invalid RBITS"
+#endif
+#if (DDBITS < 0 || DDBITS > 6)
+# error "invalid DDBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// internal configuration
+************************************************************************/
+
+/* add a special code so that the decompressor can detect the
+ * end of the compressed data block (overhead is 3 bytes per block) */
+#define LZO_EOF_CODE 1
+
+
+/***********************************************************************
+// algorithm internal configuration
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+
+/* config */
+#define R_BITS RBITS
+#define DD_BITS DDBITS
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+
+
+/***********************************************************************
+// optimization and debugging
+************************************************************************/
+
+/* Collect statistics */
+#if 0 && !defined(LZO_COLLECT_STATS)
+# define LZO_COLLECT_STATS 1
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* good parameters when using a blocksize of 8kB */
+#define M3O_BITS 6
+#undef LZO_DETERMINISTIC
+
+
+#include "lzo1b_de.h"
+#include "stats1c.h"
+
+#include "lzo1c_cc.h"
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1f.h b/ics-openvpn-stripped/main/lzo/src/config1f.h
new file mode 100644
index 00000000..5e2a8e96
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1f.h
@@ -0,0 +1,85 @@
+/* config1f.h -- configuration for the LZO1F algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1F_H
+#define __LZO_CONFIG1F_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo1f.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_EOF_CODE 1
+#undef LZO_DETERMINISTIC
+
+#define M2_MAX_OFFSET 0x0800
+#define M3_MAX_OFFSET 0x3fff
+
+#define M2_MIN_LEN 3
+#define M2_MAX_LEN 8
+#define M3_MIN_LEN 3
+#define M3_MAX_LEN 33
+
+#define M3_MARKER 224
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#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_A
+#endif
+#define DL_MIN_LEN M2_MIN_LEN
+#include "lzo_dict.h"
+
+#endif
+
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1x.h b/ics-openvpn-stripped/main/lzo/src/config1x.h
new file mode 100644
index 00000000..cbbc1672
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1x.h
@@ -0,0 +1,108 @@
+/* config1x.h -- configuration for the LZO1X algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1X_H
+#define __LZO_CONFIG1X_H 1
+
+#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
+# define LZO1X 1
+#endif
+
+#include "lzo_conf.h"
+#if !defined(__LZO_IN_MINILZO)
+#include "lzo/lzo1x.h"
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#ifndef LZO_EOF_CODE
+#define LZO_EOF_CODE 1
+#endif
+#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
+#include "lzo_dict.h"
+
+#endif
+
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1y.h b/ics-openvpn-stripped/main/lzo/src/config1y.h
new file mode 100644
index 00000000..a36dac14
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1y.h
@@ -0,0 +1,54 @@
+/* config1y.h -- configuration for the LZO1Y algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1Y_H
+#define __LZO_CONFIG1Y_H 1
+
+#if !defined(LZO1Y)
+# define LZO1Y 1
+#endif
+
+#include "lzo_conf.h"
+#include "lzo/lzo1y.h"
+
+#define M2_MAX_LEN 14
+#define M2_MAX_OFFSET 0x0400
+#include "config1x.h"
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config1z.h b/ics-openvpn-stripped/main/lzo/src/config1z.h
new file mode 100644
index 00000000..fcbc8385
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config1z.h
@@ -0,0 +1,53 @@
+/* config1z.h -- configuration for the LZO1Z algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG1Z_H
+#define __LZO_CONFIG1Z_H 1
+
+#if !defined(LZO1Z)
+# define LZO1Z 1
+#endif
+
+#include "lzo_conf.h"
+#include "lzo/lzo1z.h"
+
+#define M2_MAX_OFFSET 0x0700
+#include "config1x.h"
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/config2a.h b/ics-openvpn-stripped/main/lzo/src/config2a.h
new file mode 100644
index 00000000..16b74b03
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/config2a.h
@@ -0,0 +1,143 @@
+/* config2a.h -- configuration for the LZO2A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONFIG2A_H
+#define __LZO_CONFIG2A_H 1
+
+#include "lzo_conf.h"
+#include "lzo/lzo2a.h"
+
+
+/***********************************************************************
+// algorithm configuration
+************************************************************************/
+
+/* dictionary depth (0 - 6) - this only affects the compressor.
+ * 0 is fastest, 6 is best compression ratio */
+#if !defined(DDBITS)
+# define DDBITS 0
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* check configuration */
+#if (DDBITS < 0 || DDBITS > 6)
+# error "invalid DDBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// internal configuration
+************************************************************************/
+
+#if 1
+#define SWD_N 8191 /* size of ring buffer */
+#else
+#define SWD_N 16383 /* size of ring buffer */
+#endif
+
+#define M1_MIN_LEN 2
+#define M1_MAX_LEN 5
+#define M2_MIN_LEN 3
+#define M3_MIN_LEN 3
+
+
+/* add a special code so that the decompressor can detect the
+ * end of the compressed data block (overhead is 3 bytes per block) */
+#define LZO_EOF_CODE 1
+
+#undef LZO_DETERMINISTIC
+
+
+/***********************************************************************
+// algorithm internal configuration
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+
+/* config */
+#define DD_BITS DDBITS
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+
+
+
+/***********************************************************************
+// optimization and debugging
+************************************************************************/
+
+/* Collect statistics */
+#if 0 && !defined(LZO_COLLECT_STATS)
+# define LZO_COLLECT_STATS 1
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* get bits */
+#define _NEEDBITS \
+ { _NEEDBYTE; b |= ((lzo_uint32_t) _NEXTBYTE) << k; k += 8; assert(k <= 32); }
+#define NEEDBITS(j) { assert((j) < 8); if (k < (j)) _NEEDBITS }
+
+/* set bits */
+#define SETBITS(j,x) { b |= ((lzo_uint32_t)(x)) << k; k += (j); assert(k <= 32); }
+
+/* access bits */
+#define MASKBITS(j) (b & ((((lzo_uint32_t)1 << (j)) - 1)))
+
+/* drop bits */
+#define DUMPBITS(j) { assert(k >= j); b >>= (j); k -= (j); }
+
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1.c b/ics-openvpn-stripped/main/lzo/src/lzo1.c
new file mode 100644
index 00000000..e629730c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1.c
@@ -0,0 +1,623 @@
+/* lzo1.c -- implementation of the LZO1 algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#include "lzo/lzo1.h"
+
+
+/***********************************************************************
+// The next two defines can be changed to customize LZO1.
+// The default version is LZO1-5/1.
+************************************************************************/
+
+/* run bits (3 - 5) - the compressor and the decompressor
+ * must use the same value. */
+#if !defined(RBITS)
+# define RBITS 5
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* check configuration */
+#if (RBITS < 3 || RBITS > 5)
+# error "invalid RBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// You should not have to change anything below this line.
+************************************************************************/
+
+/*
+ Format of the marker byte
+
+
+ 76543210
+ --------
+ 00000000 a long run (a 'R0' run) - there are short and long R0 runs
+ 000rrrrr a short run with len r
+ mmmooooo a short match (len = 2+m, o = offset low bits)
+ 111ooooo a long match (o = offset low bits)
+*/
+
+
+#define RSIZE (1 << RBITS)
+#define RMASK (RSIZE - 1)
+
+#define OBITS RBITS /* offset and run-length use same bits */
+#define OSIZE (1 << OBITS)
+#define OMASK (OSIZE - 1)
+
+#define MBITS (8 - OBITS)
+#define MSIZE (1 << MBITS)
+#define MMASK (MSIZE - 1)
+
+
+/* sanity checks */
+#if (OBITS < 3 || OBITS > 5)
+# error "invalid OBITS"
+#endif
+#if (MBITS < 3 || MBITS > 5)
+# error "invalid MBITS"
+#endif
+
+
+/***********************************************************************
+// some macros to improve readability
+************************************************************************/
+
+/* Minimum len of a match */
+#define MIN_MATCH 3
+#define THRESHOLD (MIN_MATCH - 1)
+
+/* Minimum len of match coded in 2 bytes */
+#define MIN_MATCH_SHORT MIN_MATCH
+
+/* Maximum len of match coded in 2 bytes */
+#define MAX_MATCH_SHORT (THRESHOLD + (MSIZE - 2))
+/* MSIZE - 2: 0 is used to indicate runs,
+ * MSIZE-1 is used to indicate a long match */
+
+/* Minimum len of match coded in 3 bytes */
+#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1)
+
+/* Maximum len of match coded in 3 bytes */
+#define MAX_MATCH_LONG (MIN_MATCH_LONG + 255)
+
+/* Maximum offset of a match */
+#define MAX_OFFSET (1 << (8 + OBITS))
+
+
+/*
+
+RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST
+======+===============================================================
+ 3 | 5 3 2 32 32 33 288 2048 263 256
+ 4 | 4 3 2 16 16 17 272 4096 271 264
+ 5 | 3 3 2 8 8 9 264 8192 287 280
+
+ */
+
+
+/***********************************************************************
+// internal configuration
+// all of these affect compression only
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,5,5)) >> 5)
+#define D_INDEX2(d,p) d = d ^ D_MASK
+
+#define DBITS (8 + RBITS)
+#include "lzo_dict.h"
+#define DVAL_LEN DVAL_LOOKAHEAD
+
+
+/***********************************************************************
+// get algorithm info, return memory required for compression
+************************************************************************/
+
+LZO_EXTERN(lzo_uint) lzo1_info ( int *rbits, int *clevel );
+
+LZO_PUBLIC(lzo_uint)
+lzo1_info ( int *rbits, int *clevel )
+{
+ if (rbits)
+ *rbits = RBITS;
+ if (clevel)
+ *clevel = CLEVEL;
+ return D_SIZE * lzo_sizeof(lzo_bytep);
+}
+
+
+/***********************************************************************
+// decode a R0 literal run (a long run)
+************************************************************************/
+
+#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */
+#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */
+#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */
+
+#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0)
+# error "something went wrong"
+#endif
+
+/* 7 special codes from R0FAST+1 .. R0MAX
+ * these codes mean long R0 runs with lengths
+ * 512, 1024, 2048, 4096, 8192, 16384, 32768 */
+
+
+/***********************************************************************
+// LZO1 decompress a block of data.
+//
+// Could be easily translated into assembly code.
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1_decompress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ const lzo_bytep const ip_end = in + in_len;
+ lzo_uint t;
+
+ LZO_UNUSED(wrkmem);
+
+ op = out;
+ ip = in;
+ while (ip < ip_end)
+ {
+ t = *ip++; /* get marker */
+
+ if (t < R0MIN) /* a literal run */
+ {
+ if (t == 0) /* a R0 literal run */
+ {
+ t = *ip++;
+ if (t >= R0FAST - R0MIN) /* a long R0 run */
+ {
+ t -= R0FAST - R0MIN;
+ if (t == 0)
+ t = R0FAST;
+ else
+ {
+#if 0
+ t = 256u << ((unsigned) t);
+#else
+ /* help the optimizer */
+ lzo_uint tt = 256;
+ do tt <<= 1; while (--t > 0);
+ t = tt;
+#endif
+ }
+ MEMCPY8_DS(op,ip,t);
+ continue;
+ }
+ t += R0MIN;
+ }
+ MEMCPY_DS(op,ip,t);
+ }
+ else /* a match */
+ {
+ lzo_uint tt;
+ /* get match offset */
+ const lzo_bytep m_pos = op - 1;
+ m_pos -= (lzo_uint)(t & OMASK) | (((lzo_uint) *ip++) << OBITS);
+
+ /* get match len */
+ if (t >= ((MSIZE - 1) << OBITS)) /* all m-bits set */
+ tt = (MIN_MATCH_LONG - THRESHOLD) + *ip++; /* a long match */
+ else
+ tt = t >> OBITS; /* a short match */
+
+ assert(m_pos >= out);
+ assert(m_pos < op);
+ /* a half unrolled loop */
+ *op++ = *m_pos++;
+ *op++ = *m_pos++;
+ MEMCPY_DS(op,m_pos,tt);
+ }
+ }
+
+ *out_len = pd(op, out);
+
+ /* the next line is the only check in the decompressor ! */
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+}
+
+
+/***********************************************************************
+// code a literal run
+************************************************************************/
+
+static
+#if LZO_ARCH_AVR
+__lzo_noinline
+#endif
+lzo_bytep
+store_run(lzo_bytep op, const lzo_bytep ii, lzo_uint r_len)
+{
+ assert(r_len > 0);
+
+ /* code a long R0 run */
+ if (r_len >= 512)
+ {
+ unsigned r_bits = 7; /* 256 << 7 == 32768 */
+ do {
+ while (r_len >= (256u << r_bits))
+ {
+ r_len -= (256u << r_bits);
+ *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
+ MEMCPY8_DS(op, ii, (256u << r_bits));
+ }
+ } while (--r_bits > 0);
+ }
+ while (r_len >= R0FAST)
+ {
+ r_len -= R0FAST;
+ *op++ = 0; *op++ = R0FAST - R0MIN;
+ MEMCPY8_DS(op, ii, R0FAST);
+ }
+
+ if (r_len >= R0MIN)
+ {
+ /* code a short R0 run */
+ *op++ = 0; *op++ = LZO_BYTE(r_len - R0MIN);
+ MEMCPY_DS(op, ii, r_len);
+ }
+ else if (r_len > 0)
+ {
+ /* code a 'normal' run */
+ *op++ = LZO_BYTE(r_len);
+ MEMCPY_DS(op, ii, r_len);
+ }
+
+ assert(r_len == 0);
+ return op;
+}
+
+
+
+/***********************************************************************
+// LZO1 compress a block of data.
+//
+// Could be translated into assembly code without too much effort.
+//
+// I apologize for the spaghetti code, but it really helps the optimizer.
+************************************************************************/
+
+static int
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ const lzo_bytep ip;
+#if defined(__LZO_HASH_INCREMENTAL)
+ lzo_xint dv;
+#endif
+ lzo_bytep op;
+ const lzo_bytep m_pos;
+ const lzo_bytep const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG;
+ const lzo_bytep const in_end = in+in_len - DVAL_LEN;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+#if !defined(NDEBUG)
+ const lzo_bytep m_pos_sav;
+#endif
+
+ op = out;
+ ip = in;
+ ii = ip; /* point to start of literal run */
+ if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
+ goto the_end;
+
+ /* init dictionary */
+#if (LZO_DETERMINISTIC)
+ BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
+#endif
+
+ DVAL_FIRST(dv,ip);
+ UPDATE_D(dict,0,dv,ip,in);
+ ip++;
+ DVAL_NEXT(dv,ip);
+
+ do {
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+ lzo_uint dindex;
+
+ DINDEX1(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET))
+ goto literal;
+ if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
+ goto match;
+ DINDEX2(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET))
+ goto literal;
+ if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
+ goto match;
+ goto literal;
+
+
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ if (++ip >= ip_end)
+ break;
+ continue;
+
+match:
+ UPDATE_I(dict,0,dindex,ip,in);
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
+ m_pos_sav = m_pos;
+#endif
+ m_pos += 3;
+ {
+ /* we have found a match (of at least length 3) */
+#if !defined(NDEBUG) && !(LZO_DICT_USE_PTR)
+ assert((m_pos_sav = ip - m_off) == (m_pos - 3));
+#endif
+ /* 1) store the current literal run */
+ if (pd(ip,ii) > 0)
+ {
+ lzo_uint t = pd(ip,ii);
+#if 1
+ /* OPTIMIZED: inline the copying of a short run */
+ if (t < R0MIN)
+ {
+ *op++ = LZO_BYTE(t);
+ MEMCPY_DS(op, ii, t);
+ }
+ else
+#endif
+ op = store_run(op,ii,t);
+ }
+
+ /* 2a) compute match len */
+ ii = ip; /* point to start of current match */
+
+ /* we already matched MIN_MATCH bytes,
+ * m_pos also already advanced MIN_MATCH bytes */
+ ip += MIN_MATCH;
+ assert(m_pos < ip);
+
+ /* try to match another MIN_MATCH_LONG - MIN_MATCH bytes
+ * to see if we get a long match */
+
+#define PS *m_pos++ != *ip++
+
+#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */
+ if (PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */
+ if (PS || PS || PS || PS || PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */
+ if (PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */
+ if (PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS)
+#else
+# error "MBITS not yet implemented"
+#endif
+ {
+ lzo_uint m_len;
+
+ /* 2b) code a short match */
+ assert(pd(ip,m_pos) == m_off);
+ --ip; /* ran one too far, point back to non-match */
+ m_len = pd(ip, ii);
+ assert(m_len >= MIN_MATCH_SHORT);
+ assert(m_len <= MAX_MATCH_SHORT);
+ assert(m_off > 0);
+ assert(m_off <= MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+ --m_off;
+ /* code short match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) |
+ (m_off & OMASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> OBITS);
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+
+#define SI /* nothing */
+#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in);
+#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
+
+#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+ UPDATE_D(dict,0,dv,ii,in);
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+
+ }
+ else
+ {
+ /* we've found a long match - see how far we can still go */
+ const lzo_bytep end;
+ lzo_uint m_len;
+
+ assert(ip <= in_end);
+ assert(ii == ip - MIN_MATCH_LONG);
+
+ if (pd(in_end,ip) <= (MAX_MATCH_LONG - MIN_MATCH_LONG))
+ end = in_end;
+ else
+ {
+ end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG);
+ assert(end < in_end);
+ }
+
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ assert(ip <= in_end);
+
+ /* 2b) code the long match */
+ m_len = pd(ip, ii);
+ assert(m_len >= MIN_MATCH_LONG);
+ assert(m_len <= MAX_MATCH_LONG);
+ assert(m_off > 0);
+ assert(m_off <= MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+ assert(pd(ip,m_pos) == m_off);
+ --m_off;
+ /* code long match flag + low offset bits */
+ *op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> OBITS);
+ /* code match len */
+ *op++ = LZO_BYTE(m_len - MIN_MATCH_LONG);
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+#if (CLEVEL == 9)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ /* This is not recommended because it is slow. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+ UPDATE_D(dict,0,dv,ii,in);
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 8)
+ SI DI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 7)
+ SI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 6)
+ SI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 5)
+ SI DI DI DI DI XI
+#elif (CLEVEL >= 4)
+ SI DI DI DI XI
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ /* ii now points to the start of next literal run */
+ assert(ii == ip);
+ }
+ } while (ip < ip_end);
+
+
+
+the_end:
+ assert(ip <= in_end);
+
+
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ /* return -1 if op == out to indicate that we
+ * couldn't compress and didn't copy anything.
+ */
+ if (op == out)
+ {
+ *out_len = 0;
+ return LZO_E_NOT_COMPRESSIBLE;
+ }
+#endif
+
+
+ /* store the final literal run */
+ if (pd(in_end+DVAL_LEN,ii) > 0)
+ op = store_run(op,ii,pd(in_end+DVAL_LEN,ii));
+
+ *out_len = pd(op, out);
+ return 0; /* compression went ok */
+}
+
+
+/***********************************************************************
+// compress public entry point.
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ int r = LZO_E_OK;
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ *out_len = 0;
+ else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(store_run(out,in,in_len), out);
+#endif
+ }
+ else
+ r = do_compress(in,in_len,out,out_len,wrkmem);
+
+ return r;
+}
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1_99.c b/ics-openvpn-stripped/main/lzo/src/lzo1_99.c
new file mode 100644
index 00000000..a0ebf369
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1_99.c
@@ -0,0 +1,118 @@
+/* lzo1_99.c -- implementation of the LZO1-99 algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+#define COMPRESS_ID 99
+
+#define DDBITS 3
+#define CLEVEL 9
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_NEED_DICT_H 1
+#include "config1.h"
+
+
+/***********************************************************************
+// compression internal entry point.
+************************************************************************/
+
+static int
+_lzo1_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func )
+{
+ int r;
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ {
+ *out_len = 0;
+ r = LZO_E_OK;
+ }
+ else if (in_len <= MIN_LOOKAHEAD + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ *out_len = 0;
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(STORE_RUN(out,in,in_len), out);
+ r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
+#endif
+ }
+ else
+ r = func(in,in_len,out,out_len,wrkmem);
+
+ return r;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if !defined(COMPRESS_ID)
+#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
+#endif
+
+
+#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1_cm.ch"
+#include "lzo1b_c.ch"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_COMPRESS \
+ LZO_PP_ECONCAT3(lzo1_,COMPRESS_ID,_compress)
+
+#define LZO_COMPRESS_FUNC \
+ LZO_PP_ECONCAT3(_lzo1_,COMPRESS_ID,_compress_func)
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return _lzo1_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
+}
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1_cm.ch b/ics-openvpn-stripped/main/lzo/src/lzo1_cm.ch
new file mode 100644
index 00000000..9e6ee32f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1_cm.ch
@@ -0,0 +1,40 @@
+/* lzo1_cm.ch -- implementation of the LZO1 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#include "lzo1a_cm.ch"
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1_d.ch b/ics-openvpn-stripped/main/lzo/src/lzo1_d.ch
new file mode 100644
index 00000000..e4dff04e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1_d.ch
@@ -0,0 +1,160 @@
+/* lzo1_d.ch -- common decompression stuff
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+#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 1
+# endif
+#endif
+
+
+/***********************************************************************
+// Overrun detection is internally handled by these macros:
+//
+// TEST_IP test input overrun at loop begin
+// NEED_IP test input overrun at every input byte
+//
+// TEST_OP test output overrun at loop begin
+// NEED_OP test output overrun at every output byte
+//
+// TEST_LB test match position
+//
+// The fastest decompressor results when testing for no overruns
+// and using LZO_EOF_CODE.
+************************************************************************/
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_IP_AND_TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef TEST_IV
+#undef TEST_OV
+#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
+# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) 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 /* don't need both of the tests here */
+# define NEED_OP(x) \
+ if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(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)
+ /* if we have no EOF code, we have to test for the end of the input */
+# define TEST_IP (ip < ip_end)
+#endif
+
+
+#if defined(TEST_IP)
+# define HAVE_TEST_IP 1
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP 1
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+#elif defined(HAVE_TEST_IP)
+# define TEST_IP_AND_TEST_OP TEST_IP
+#elif defined(HAVE_TEST_OP)
+# define TEST_IP_AND_TEST_OP TEST_OP
+#else
+# define TEST_IP_AND_TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP 1
+#else
+# define NEED_IP(x) ((void) 0)
+# define TEST_IV(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP 1
+#else
+# define NEED_OP(x) ((void) 0)
+# define TEST_OV(x) ((void) 0)
+#endif
+
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP 1
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP 1
+#endif
+
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1a.c b/ics-openvpn-stripped/main/lzo/src/lzo1a.c
new file mode 100644
index 00000000..e0894f60
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1a.c
@@ -0,0 +1,645 @@
+/* lzo1a.c -- implementation of the LZO1A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#include "lzo/lzo1a.h"
+
+
+/***********************************************************************
+// The next two defines can be changed to customize LZO1A.
+// The default version is LZO1A-5/1.
+************************************************************************/
+
+/* run bits (3 - 5) - the compressor and the decompressor
+ * must use the same value. */
+#if !defined(RBITS)
+# define RBITS 5
+#endif
+
+/* compression level (1 - 9) - this only affects the compressor.
+ * 1 is fastest, 9 is best compression ratio
+ */
+#if !defined(CLEVEL)
+# define CLEVEL 1 /* fastest by default */
+#endif
+
+
+/* Collect statistics */
+#if 0 && !defined(LZO_COLLECT_STATS)
+# define LZO_COLLECT_STATS 1
+#endif
+
+
+/***********************************************************************
+// You should not have to change anything below this line.
+************************************************************************/
+
+/* check configuration */
+#if (RBITS < 3 || RBITS > 5)
+# error "invalid RBITS"
+#endif
+#if (CLEVEL < 1 || CLEVEL > 9)
+# error "invalid CLEVEL"
+#endif
+
+
+/***********************************************************************
+// internal configuration
+// all of these affect compression only
+************************************************************************/
+
+/* choose the hashing strategy */
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,5,5)) >> 5)
+#define D_INDEX2(d,p) d = d ^ D_MASK
+
+#include "lzo1a_de.h"
+#include "stats1a.h"
+
+
+/* check other constants */
+#if (LBITS < 5 || LBITS > 8)
+# error "invalid LBITS"
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+ static lzo1a_stats_t lzo_statistics;
+ lzo1a_stats_t *lzo1a_stats = &lzo_statistics;
+# define lzo_stats lzo1a_stats
+#endif
+
+
+/***********************************************************************
+// get algorithm info, return memory required for compression
+************************************************************************/
+
+LZO_EXTERN(lzo_uint) lzo1a_info ( int *rbits, int *clevel );
+
+LZO_PUBLIC(lzo_uint)
+lzo1a_info ( int *rbits, int *clevel )
+{
+ if (rbits)
+ *rbits = RBITS;
+ if (clevel)
+ *clevel = CLEVEL;
+ return D_SIZE * lzo_sizeof(lzo_bytep);
+}
+
+
+/***********************************************************************
+// LZO1A decompress a block of data.
+//
+// Could be easily translated into assembly code.
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1a_decompress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
+ const lzo_bytep const ip_end = in + in_len;
+
+ LZO_UNUSED(wrkmem);
+
+ op = out;
+ ip = in;
+ while (ip < ip_end)
+ {
+ t = *ip++; /* get marker */
+ LZO_STATS(lzo_stats->marker[t]++);
+
+ if (t == 0) /* a R0 literal run */
+ {
+ t = *ip++;
+ if (t >= R0FAST - R0MIN) /* a long R0 run */
+ {
+ t -= R0FAST - R0MIN;
+ if (t == 0)
+ t = R0FAST;
+ else
+ {
+#if 0
+ t = 256u << ((unsigned) t);
+#else
+ /* help the optimizer */
+ lzo_uint tt = 256;
+ do tt <<= 1; while (--t > 0);
+ t = tt;
+#endif
+ }
+ MEMCPY8_DS(op,ip,t);
+ continue;
+ }
+ t += R0MIN;
+ goto literal;
+ }
+ else if (t < R0MIN) /* a short literal run */
+ {
+literal:
+ MEMCPY_DS(op,ip,t);
+
+ /* after a literal a match must follow */
+ while (ip < ip_end)
+ {
+ t = *ip++; /* get R1 marker */
+ if (t >= R0MIN)
+ goto match;
+
+ /* R1 match - a context sensitive 3 byte match + 1 byte literal */
+ assert((t & OMASK) == t);
+ m_pos = op - MIN_OFFSET;
+ m_pos -= t | (((lzo_uint) *ip++) << OBITS);
+ assert(m_pos >= out); assert(m_pos < op);
+ *op++ = m_pos[0];
+ *op++ = m_pos[1];
+ *op++ = m_pos[2];
+ *op++ = *ip++;
+ }
+ }
+ else /* a match */
+ {
+match:
+ /* get match offset */
+ m_pos = op - MIN_OFFSET;
+ m_pos -= (t & OMASK) | (((lzo_uint) *ip++) << OBITS);
+ assert(m_pos >= out); assert(m_pos < op);
+
+ /* get match len */
+ if (t < ((MSIZE - 1) << OBITS)) /* a short match */
+ {
+ t >>= OBITS;
+ *op++ = *m_pos++;
+ *op++ = *m_pos++;
+ MEMCPY_DS(op,m_pos,t);
+ }
+ else /* a long match */
+ {
+#if (LBITS < 8)
+ t = (MIN_MATCH_LONG - THRESHOLD) + ((lzo_uint)(*ip++) & LMASK);
+#else
+ t = (MIN_MATCH_LONG - THRESHOLD) + (lzo_uint)(*ip++);
+#endif
+ *op++ = *m_pos++;
+ *op++ = *m_pos++;
+ MEMCPY_DS(op,m_pos,t);
+#if (LBITS < 8)
+ /* a very short literal following a long match */
+ t = ip[-1] >> LBITS;
+ if (t) do
+ *op++ = *ip++;
+ while (--t);
+#endif
+ }
+ }
+ }
+
+ *out_len = pd(op, out);
+
+ /* the next line is the only check in the decompressor */
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+}
+
+
+
+/***********************************************************************
+// LZO1A compress a block of data.
+//
+// I apologize for the spaghetti code, but it really helps the optimizer.
+************************************************************************/
+
+#include "lzo1a_cr.ch"
+
+static int
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ const lzo_bytep ip;
+#if defined(__LZO_HASH_INCREMENTAL)
+ lzo_xint dv;
+#endif
+ const lzo_bytep m_pos;
+ lzo_bytep op;
+ const lzo_bytep const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG;
+ const lzo_bytep const in_end = in+in_len - DVAL_LEN;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+ const lzo_bytep r1 = ip_end; /* pointer for R1 match (none yet) */
+#if (LBITS < 8)
+ const lzo_bytep im = ip_end; /* pointer to last match start */
+#endif
+
+#if !defined(NDEBUG)
+ const lzo_bytep m_pos_sav;
+#endif
+
+ op = out;
+ ip = in;
+ ii = ip; /* point to start of current literal run */
+
+ /* init dictionary */
+#if (LZO_DETERMINISTIC)
+ BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
+#endif
+
+ DVAL_FIRST(dv,ip); UPDATE_D(dict,0,dv,ip,in); ip++;
+ DVAL_NEXT(dv,ip);
+
+ do {
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+ 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,MAX_OFFSET))
+ goto literal;
+ if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
+ goto match;
+ DINDEX2(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,MAX_OFFSET))
+ goto literal;
+ if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
+ goto match;
+ goto literal;
+
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ if (++ip >= ip_end)
+ break;
+ continue;
+
+match:
+ UPDATE_I(dict,0,dindex,ip,in);
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
+ assert(m_pos == NULL || m_pos >= in);
+ m_pos_sav = m_pos;
+#endif
+ m_pos += 3;
+ {
+ /* we have found a match (of at least length 3) */
+
+#if !defined(NDEBUG) && !(LZO_DICT_USE_PTR)
+ assert((m_pos_sav = ip - m_off) == (m_pos - 3));
+#endif
+
+ assert(m_pos >= in);
+ assert(ip < ip_end);
+
+ /* 1) store the current literal run */
+ if (pd(ip,ii) > 0)
+ {
+ lzo_uint t = pd(ip,ii);
+
+ if (ip - r1 == MIN_MATCH + 1)
+ {
+ /* Code a context sensitive R1 match.
+ * This is tricky and somewhat difficult to explain:
+ * multiplex a literal run of length 1 into the previous
+ * short match of length MIN_MATCH.
+ * The key idea is:
+ * - after a short run a match MUST follow
+ * - therefore the value m = 000 in the mmmooooo marker is free
+ * - use 000ooooo to indicate a MIN_MATCH match (this
+ * is already coded) plus a 1 byte literal
+ */
+ assert(t == 1);
+ /* modify marker byte */
+ assert((op[-2] >> OBITS) == (MIN_MATCH - THRESHOLD));
+ op[-2] &= OMASK;
+ assert((op[-2] >> OBITS) == 0);
+ /* copy 1 literal */
+ *op++ = *ii;
+ LZO_STATS(lzo_stats->r1_matches++);
+ r1 = ip; /* set new R1 pointer */
+ }
+ else if (t < R0MIN)
+ {
+ /* inline the copying of a short run */
+#if (LBITS < 8)
+ if (t < (1 << (8-LBITS)) && ii - im >= MIN_MATCH_LONG)
+ {
+ /* Code a very short literal run into the
+ * previous long match length byte.
+ */
+ LZO_STATS(lzo_stats->lit_runs_after_long_match++);
+ LZO_STATS(lzo_stats->lit_run_after_long_match[t]++);
+ assert(ii - im <= MAX_MATCH_LONG);
+ assert((op[-1] >> LBITS) == 0);
+ op[-1] = LZO_BYTE(op[-1] | (t << LBITS));
+ MEMCPY_DS(op, ii, t);
+ }
+ else
+#endif
+ {
+ LZO_STATS(lzo_stats->lit_runs++);
+ LZO_STATS(lzo_stats->lit_run[t]++);
+ *op++ = LZO_BYTE(t);
+ MEMCPY_DS(op, ii, t);
+ r1 = ip; /* set new R1 pointer */
+ }
+ }
+ else if (t < R0FAST)
+ {
+ /* inline the copying of a short R0 run */
+ LZO_STATS(lzo_stats->r0short_runs++);
+ *op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
+ MEMCPY_DS(op, ii, t);
+ r1 = ip; /* set new R1 pointer */
+ }
+ else
+ op = store_run(op,ii,t);
+ }
+#if (LBITS < 8)
+ im = ip;
+#endif
+
+
+ /* 2) compute match len */
+ ii = ip; /* point to start of current match */
+
+ /* we already matched MIN_MATCH bytes,
+ * m_pos also already advanced MIN_MATCH bytes */
+ ip += MIN_MATCH;
+ assert(m_pos < ip);
+
+ /* try to match another MIN_MATCH_LONG - MIN_MATCH bytes
+ * to see if we get a long match */
+
+#define PS *m_pos++ != *ip++
+
+#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */
+ if (PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */
+ if (PS || PS || PS || PS || PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */
+ if (PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS)
+#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */
+ if (PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS || PS || PS ||
+ PS || PS || PS || PS || PS || PS)
+#else
+# error "MBITS not yet implemented"
+#endif
+ {
+ /* we've found a short match */
+ lzo_uint m_len;
+
+ /* 2a) compute match parameters */
+ assert(ip-m_pos == (int)m_off);
+ --ip; /* ran one too far, point back to non-match */
+ m_len = pd(ip, ii);
+ assert(m_len >= MIN_MATCH_SHORT);
+ assert(m_len <= MAX_MATCH_SHORT);
+ assert(m_off >= MIN_OFFSET);
+ assert(m_off <= MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+ m_off -= MIN_OFFSET;
+
+ /* 2b) code a short match */
+ /* code short match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) |
+ (m_off & OMASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> OBITS);
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->short_matches++;
+ lzo_stats->short_match[m_len]++;
+ if (m_off < OSIZE)
+ lzo_stats->short_match_offset_osize[m_len]++;
+ if (m_off < 256)
+ lzo_stats->short_match_offset_256[m_len]++;
+ if (m_off < 1024)
+ lzo_stats->short_match_offset_1024[m_len]++;
+#endif
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+
+#define SI /* nothing */
+#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in);
+#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
+
+#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+ UPDATE_D(dict,0,dv,ii,in);
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+
+ }
+ else
+ {
+ /* we've found a long match - see how far we can still go */
+ const lzo_bytep end;
+ lzo_uint m_len;
+
+ assert(ip <= in_end);
+ assert(ii == ip - MIN_MATCH_LONG);
+
+ if (pd(in_end,ip) <= (MAX_MATCH_LONG - MIN_MATCH_LONG))
+ end = in_end;
+ else
+ {
+ end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG);
+ assert(end < in_end);
+ }
+
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ assert(ip <= in_end);
+
+ /* 2a) compute match parameters */
+ m_len = pd(ip, ii);
+ assert(m_len >= MIN_MATCH_LONG);
+ assert(m_len <= MAX_MATCH_LONG);
+ assert(m_off >= MIN_OFFSET);
+ assert(m_off <= MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+ assert(pd(ip,m_pos) == m_off);
+ m_off -= MIN_OFFSET;
+
+ /* 2b) code the long match */
+ /* code long match flag + low offset bits */
+ *op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> OBITS);
+ /* code match len */
+ *op++ = LZO_BYTE(m_len - MIN_MATCH_LONG);
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->long_matches++;
+ lzo_stats->long_match[m_len]++;
+#endif
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+#if (CLEVEL == 9)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ /* This is not recommended because it is slow. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+ UPDATE_D(dict,0,dv,ii,in);
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 8)
+ SI DI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 7)
+ SI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 6)
+ SI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 5)
+ SI DI DI DI DI XI
+#elif (CLEVEL >= 4)
+ SI DI DI DI XI
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ /* ii now points to the start of the next literal run */
+ assert(ii == ip);
+ }
+
+ } while (ip < ip_end);
+
+ assert(ip <= in_end);
+
+
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ /* return -1 if op == out to indicate that we
+ * couldn't compress and didn't copy anything.
+ */
+ if (op == out)
+ {
+ *out_len = 0;
+ return LZO_E_NOT_COMPRESSIBLE;
+ }
+#endif
+
+ /* store the final literal run */
+ if (pd(in_end+DVAL_LEN,ii) > 0)
+ op = store_run(op,ii,pd(in_end+DVAL_LEN,ii));
+
+ *out_len = pd(op, out);
+ return 0; /* compression went ok */
+}
+
+
+/***********************************************************************
+// LZO1A compress public entry point.
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1a_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ int r = LZO_E_OK;
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_memset(lzo_stats,0,sizeof(*lzo_stats));
+ lzo_stats->rbits = RBITS;
+ lzo_stats->clevel = CLEVEL;
+ lzo_stats->dbits = DBITS;
+ lzo_stats->lbits = LBITS;
+ lzo_stats->min_match_short = MIN_MATCH_SHORT;
+ lzo_stats->max_match_short = MAX_MATCH_SHORT;
+ lzo_stats->min_match_long = MIN_MATCH_LONG;
+ lzo_stats->max_match_long = MAX_MATCH_LONG;
+ lzo_stats->min_offset = MIN_OFFSET;
+ lzo_stats->max_offset = MAX_OFFSET;
+ lzo_stats->r0min = R0MIN;
+ lzo_stats->r0fast = R0FAST;
+ lzo_stats->r0max = R0MAX;
+ lzo_stats->in_len = in_len;
+#endif
+
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ *out_len = 0;
+ else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(store_run(out,in,in_len), out);
+#endif
+ }
+ else
+ r = do_compress(in,in_len,out,out_len,wrkmem);
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->short_matches -= lzo_stats->r1_matches;
+ lzo_stats->short_match[MIN_MATCH] -= lzo_stats->r1_matches;
+ lzo_stats->out_len = *out_len;
+#endif
+
+ return r;
+}
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1a_99.c b/ics-openvpn-stripped/main/lzo/src/lzo1a_99.c
new file mode 100644
index 00000000..0feddbda
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1a_99.c
@@ -0,0 +1,118 @@
+/* lzo1a_99.c -- implementation of the LZO1A-99 algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+#define COMPRESS_ID 99
+
+#define DDBITS 3
+#define CLEVEL 9
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_NEED_DICT_H 1
+#include "config1a.h"
+
+
+/***********************************************************************
+// compression internal entry point.
+************************************************************************/
+
+static int
+_lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func )
+{
+ int r;
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ {
+ *out_len = 0;
+ r = LZO_E_OK;
+ }
+ else if (in_len <= MIN_LOOKAHEAD + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ *out_len = 0;
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(STORE_RUN(out,in,in_len), out);
+ r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
+#endif
+ }
+ else
+ r = func(in,in_len,out,out_len,wrkmem);
+
+ return r;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if !defined(COMPRESS_ID)
+#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
+#endif
+
+
+#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1a_cm.ch"
+#include "lzo1b_c.ch"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define LZO_COMPRESS \
+ LZO_PP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
+
+#define LZO_COMPRESS_FUNC \
+ LZO_PP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return _lzo1a_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
+}
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1a_cm.ch b/ics-openvpn-stripped/main/lzo/src/lzo1a_cm.ch
new file mode 100644
index 00000000..75289d5b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1a_cm.ch
@@ -0,0 +1,230 @@
+/* lzo1a_cm.ch -- implementation of the LZO1A compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+
+/***********************************************************************
+// code the match in LZO1 compatible format
+************************************************************************/
+
+#define THRESHOLD (M2_MIN_LEN - 1)
+#define MSIZE LZO_SIZE(M2L_BITS)
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if (DD_BITS == 0)
+
+ /* we already matched M2_MIN_LEN bytes,
+ * m_pos also already advanced M2_MIN_LEN bytes */
+ ip += M2_MIN_LEN;
+ assert(m_pos < ip);
+
+ /* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
+ * to see if we get more than a M2 match */
+#define M2_OR_M3 (MATCH_M2)
+
+#else /* (DD_BITS == 0) */
+
+ /* we already matched m_len bytes */
+ assert(m_len >= M2_MIN_LEN);
+ ip += m_len;
+ assert(ip <= in_end);
+
+#define M2_OR_M3 (m_len <= M2_MAX_LEN)
+
+#endif /* (DD_BITS == 0) */
+
+
+ if (M2_OR_M3)
+ {
+ /* we've found a short match */
+ assert(ip <= in_end);
+
+ /* 2a) compute match parameters */
+#if (DD_BITS == 0)
+ assert(pd(ip,m_pos) == m_off);
+ --ip; /* ran one too far, point back to non-match */
+ m_len = ip - ii;
+#endif
+ assert(m_len >= M2_MIN_LEN);
+ assert(m_len <= M2_MAX_LEN);
+
+ assert(m_off >= M2_MIN_OFFSET);
+ assert(m_off <= M2_MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+
+ /* 2b) code the match */
+ m_off -= M2_MIN_OFFSET;
+ /* code short match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - THRESHOLD) << M2O_BITS) |
+ (m_off & M2O_MASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M2O_BITS);
+
+
+ if (ip >= ip_end)
+ {
+ ii = ip;
+ break;
+ }
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+
+#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+#if 0
+ UPDATE_D(dict,drun,dv,ii,in);
+#else
+ dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
+#endif
+ MI
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ else
+
+ {
+ /* we've found a long match - see how far we can still go */
+ const lzo_bytep end;
+
+ assert(ip <= in_end);
+ assert(ii == ip - (M2_MAX_LEN + 1));
+ assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0);
+
+#if (DD_BITS > 0)
+ assert(m_len == (lzo_uint)(ip-ii));
+ m_pos = ip - m_off;
+ assert(m_pos == m_pos_sav + m_len);
+#endif
+
+ if (pd(in_end,ip) <= (M3_MAX_LEN - M3_MIN_LEN))
+ end = in_end;
+ else
+ {
+ end = ip + (M3_MAX_LEN - M3_MIN_LEN);
+ assert(end < in_end);
+ }
+
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ assert(ip <= in_end);
+
+ /* 2a) compute match parameters */
+ m_len = pd(ip, ii);
+ assert(m_len >= M3_MIN_LEN);
+ assert(m_len <= M3_MAX_LEN);
+
+ assert(m_off >= M3_MIN_OFFSET);
+ assert(m_off <= M3_MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+ assert(pd(ip,m_pos) == m_off);
+
+ /* 2b) code the match */
+ m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
+ /* code long match flag + low offset bits */
+ *op++ = LZO_BYTE(((MSIZE - 1) << M3O_BITS) | (m_off & M3O_MASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M3O_BITS);
+ /* code match len */
+ *op++ = LZO_BYTE(m_len - M3_MIN_LEN);
+
+
+ if (ip >= ip_end)
+ {
+ ii = ip;
+ break;
+ }
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+#if (CLEVEL == 9)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ /* This is not recommended because it can be slow. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+#if 0
+ UPDATE_D(dict,drun,dv,ii,in);
+#else
+ dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
+#endif
+ MI
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 8)
+ SI DI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 7)
+ SI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 6)
+ SI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 5)
+ SI DI DI DI DI XI
+#elif (CLEVEL >= 4)
+ SI DI DI DI XI
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ /* ii now points to the start of the next literal run */
+ assert(ii == ip);
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1a_cr.ch b/ics-openvpn-stripped/main/lzo/src/lzo1a_cr.ch
new file mode 100644
index 00000000..cc1f7b4e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1a_cr.ch
@@ -0,0 +1,116 @@
+/* lzo1a_cr.ch -- literal run handling for the the LZO1A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the LZO package and is subject
+ to change.
+ */
+
+
+#ifndef __LZO1A_CR_H
+#define __LZO1A_CR_H 1
+
+
+/***********************************************************************
+// code a literal run
+************************************************************************/
+
+static lzo_bytep
+store_run(lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len)
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+
+ op = oo;
+ ip = ii;
+ assert(r_len > 0);
+
+ /* code a long R0 run */
+ if (r_len >= 512)
+ {
+ unsigned r_bits = 6; /* 256 << 6 == 16384 */
+ lzo_uint tt = 32768u;
+
+ while (r_len >= (t = tt))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = (R0MAX - R0MIN);
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0long_runs++);
+ }
+ tt >>= 1;
+ do {
+ if (r_len >= (t = tt))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0long_runs++);
+ }
+ tt >>= 1;
+ } while (--r_bits > 0);
+ }
+ assert(r_len < 512);
+
+ while (r_len >= (t = R0FAST))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = (R0FAST - R0MIN);
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0fast_runs++);
+ }
+
+ t = r_len;
+ if (t >= R0MIN)
+ {
+ /* code a short R0 run */
+ *op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
+ MEMCPY_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0short_runs++);
+ }
+ else if (t > 0)
+ {
+ /* code a short literal run */
+ LZO_STATS(lzo_stats->lit_runs++);
+ LZO_STATS(lzo_stats->lit_run[t]++);
+ *op++ = LZO_BYTE(t);
+ MEMCPY_DS(op, ip, t);
+ }
+
+ return op;
+}
+
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1a_de.h b/ics-openvpn-stripped/main/lzo/src/lzo1a_de.h
new file mode 100644
index 00000000..28c4be74
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1a_de.h
@@ -0,0 +1,146 @@
+/* lzo1a_de.h -- definitions for the the LZO1A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the LZO package and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_DEFS_H
+#define __LZO_DEFS_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/*
+ Format of the marker byte
+
+
+ 76543210
+ --------
+ 00000000 a long literal run ('R0' run) - there are short and long R0 runs
+ 000rrrrr a short literal run with len r
+ mmmooooo a short match (len = 2+m, o = offset low bits)
+ 111ooooo a long match (o = offset low bits)
+*/
+
+
+#define RSIZE (1 << RBITS)
+#define RMASK (RSIZE - 1)
+
+#define MBITS (8 - OBITS)
+#define MSIZE (1 << MBITS)
+#define MMASK (MSIZE - 1)
+
+#define OBITS RBITS /* offset and run-length use same bits */
+#define OSIZE (1 << OBITS)
+#define OMASK (OSIZE - 1)
+
+
+/* additional bits for coding the length in a long match */
+#define LBITS 8
+#define LSIZE (1 << LBITS)
+#define LMASK (LSIZE - 1)
+
+
+/***********************************************************************
+// some macros to improve readability
+************************************************************************/
+
+/* Minimum len of a match */
+#define MIN_MATCH 3
+#define THRESHOLD (MIN_MATCH - 1)
+
+/* Min-/Maximum len of a match coded in 2 bytes */
+#define MIN_MATCH_SHORT (MIN_MATCH)
+#define MAX_MATCH_SHORT (MIN_MATCH_SHORT + (MSIZE - 2) - 1)
+/* why (MSIZE - 2) ? because 0 is used to mark runs,
+ * and MSIZE-1 is used to mark a long match */
+
+/* Min-/Maximum len of a match coded in 3 bytes */
+#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1)
+#define MAX_MATCH_LONG (MIN_MATCH_LONG + LSIZE - 1)
+
+/* Min-/Maximum offset of a match */
+#define MIN_OFFSET 1
+#define MAX_OFFSET (1 << (CHAR_BIT + OBITS))
+
+
+/* R0 literal run (a long run) */
+
+#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */
+#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */
+#define R0FAST (R0MAX & ~7) /* R0MAX aligned to 8 byte boundary */
+
+#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0)
+# error "something went wrong"
+#endif
+
+/* 7 special codes from R0FAST+1 .. R0MAX
+ * these codes mean long R0 runs with lengths
+ * 512, 1024, 2048, 4096, 8192, 16384, 32768 */
+
+
+/*
+
+RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST
+======+===============================================================
+ 3 | 5 3 2 32 32 33 288 2048 263 256
+ 4 | 4 3 2 16 16 17 272 4096 271 264
+ 5 | 3 3 2 8 8 9 264 8192 287 280
+
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define DBITS 13
+#include "lzo_dict.h"
+#define DVAL_LEN DVAL_LOOKAHEAD
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_1.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_1.c
new file mode 100644
index 00000000..7dfa93a5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_1.c
@@ -0,0 +1,34 @@
+/* lzo1b_1.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 1
+
+#define DDBITS 0
+#define CLEVEL 1
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_2.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_2.c
new file mode 100644
index 00000000..cfe8adf2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_2.c
@@ -0,0 +1,34 @@
+/* lzo1b_2.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 2
+
+#define DDBITS 0
+#define CLEVEL 2
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_3.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_3.c
new file mode 100644
index 00000000..b1059950
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_3.c
@@ -0,0 +1,34 @@
+/* lzo1b_3.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 3
+
+#define DDBITS 0
+#define CLEVEL 3
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_4.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_4.c
new file mode 100644
index 00000000..c666d6d1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_4.c
@@ -0,0 +1,34 @@
+/* lzo1b_4.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 4
+
+#define DDBITS 1
+#define CLEVEL 2
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_5.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_5.c
new file mode 100644
index 00000000..67e9facd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_5.c
@@ -0,0 +1,34 @@
+/* lzo1b_5.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 5
+
+#define DDBITS 1
+#define CLEVEL 3
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_6.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_6.c
new file mode 100644
index 00000000..bdbcce8c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_6.c
@@ -0,0 +1,34 @@
+/* lzo1b_6.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 6
+
+#define DDBITS 1
+#define CLEVEL 5
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_7.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_7.c
new file mode 100644
index 00000000..1d415e05
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_7.c
@@ -0,0 +1,34 @@
+/* lzo1b_7.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 7
+
+#define DDBITS 2
+#define CLEVEL 3
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_8.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_8.c
new file mode 100644
index 00000000..a0cb8e12
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_8.c
@@ -0,0 +1,34 @@
+/* lzo1b_8.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 8
+
+#define DDBITS 2
+#define CLEVEL 8
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_9.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_9.c
new file mode 100644
index 00000000..9eb51d60
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_9.c
@@ -0,0 +1,34 @@
+/* lzo1b_9.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 9
+
+#define DDBITS 2
+#define CLEVEL 9
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_99.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_99.c
new file mode 100644
index 00000000..b39e145f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_99.c
@@ -0,0 +1,37 @@
+/* lzo1b_99.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 99
+
+#define DDBITS 3
+#define CLEVEL 9
+
+#define D_BITS 16
+#define MATCH_IP_END in_end
+#include "compr1b.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_9x.c
new file mode 100644
index 00000000..b1c9a1bd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_9x.c
@@ -0,0 +1,353 @@
+/* lzo1b_9x.c -- implementation of the LZO1B-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1b.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define SWD_N 0xffffL /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
+
+
+#define LZO1B 1
+#define LZO_COMPRESS_T lzo1b_999_t
+#define lzo_swd_t lzo1b_999_swd_t
+#include "lzo_mchw.ch"
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static lzo_bytep
+code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
+{
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+ {
+ assert(m_len >= M2_MIN_LEN);
+ assert(m_off >= M2_MIN_OFFSET);
+
+ m_off -= M2_MIN_OFFSET;
+ /* code match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
+ (m_off & M2O_MASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M2O_BITS);
+ c->m2_m++;
+ }
+ else
+ {
+ assert(m_len >= M3_MIN_LEN);
+ assert(m_off <= M3_MAX_OFFSET);
+
+ m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
+ /* code match len */
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
+ else
+ {
+ assert(m_len >= M4_MIN_LEN);
+ /* code M4 match len flag */
+ *op++ = M4_MARKER;
+ /* code match len */
+ m_len -= M4_MIN_LEN - 1;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ /* code low offset bits */
+ *op++ = LZO_BYTE(m_off & M3O_MASK);
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M3O_BITS);
+
+ c->r1_m_len = 0;
+ c->m3_m++;
+ }
+ return op;
+}
+
+
+/***********************************************************************
+// this is a public function, but there is no prototype in a header file
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain );
+
+LZO_PUBLIC(int)
+lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain )
+{
+ lzo_bytep op;
+ const lzo_bytep ii;
+ lzo_uint lit;
+ lzo_uint m_len, m_off;
+ LZO_COMPRESS_T cc;
+ LZO_COMPRESS_T * const c = &cc;
+ lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ int r;
+
+ /* sanity check */
+ LZO_COMPILE_TIME_ASSERT(LZO1B_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+
+ c->init = 0;
+ c->ip = c->in = in;
+ c->in_end = in + in_len;
+ c->cb = cb;
+ c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0;
+
+ op = out;
+ ii = c->ip; /* point to start of literal run */
+ lit = 0;
+ c->r1_m_len = 0;
+
+ r = init_match(c,swd,NULL,0,0);
+ if (r != 0)
+ return r;
+ if (max_chain > 0)
+ swd->max_chain = max_chain;
+
+ r = find_match(c,swd,0,0);
+ if (r != 0)
+ return r;
+ while (c->look > 0)
+ {
+ int lazy_match_min_gain = -1;
+ lzo_uint ahead = 0;
+
+ m_len = c->m_len;
+ m_off = c->m_off;
+
+#if 0
+ printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look,
+ m_len, m_off);
+#endif
+
+ assert(c->ip - c->look >= in);
+ if (lit == 0)
+ ii = c->ip - c->look;
+ assert(ii + lit == c->ip - c->look);
+ assert(swd->b_char == *(c->ip - c->look));
+
+ if ((m_len < M2_MIN_LEN) ||
+ (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
+ {
+ m_len = 0;
+ }
+ else
+ {
+ assert(c->ip - c->look - m_off >= in);
+ assert(c->ip - c->look - m_off + m_len < c->ip);
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+
+ if (lit > 0)
+ {
+ /* we have a current literal run: do not try a lazy match,
+ if the literal could be coded into a r1 match */
+ if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
+ lazy_match_min_gain = -1;
+ else
+ lazy_match_min_gain = 1;
+
+#if (M2_MIN_LEN == 2)
+ if (m_len == 2)
+ {
+ /* don't code a match of len 2 if we have to
+ code a literal run. Code a literal instead. */
+ m_len = 0;
+ }
+#endif
+#if (M2_MIN_LEN == M3_MIN_LEN)
+ if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET)
+ {
+ /* don't code a M3 match of len 3 if we have to
+ code a literal run. Code a literal instead. */
+ m_len = 0;
+ }
+#endif
+ }
+ else
+ {
+ /* no current literal run: only try a lazy match,
+ if the literal could be coded into a r1 match */
+ if (c->r1_m_len == M2_MIN_LEN)
+ lazy_match_min_gain = 0;
+ else
+ lazy_match_min_gain = -1;
+ }
+ }
+
+
+ /* try a lazy match */
+ if (m_len == 0)
+ lazy_match_min_gain = -1;
+ if (lazy_match_min_gain >= 0 && c->look > m_len)
+ {
+ assert(m_len > 0);
+
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ assert(c->look > 0);
+
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
+ c->m_off > M2_MAX_OFFSET)
+ lazy_match_min_gain += 1;
+
+ if (c->m_len >= m_len + lazy_match_min_gain)
+ {
+ c->lazy++;
+#if !defined(NDEBUG)
+ m_len = c->m_len;
+ m_off = c->m_off;
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+#endif
+ lit++;
+ assert(ii + lit == c->ip - c->look);
+ continue;
+ }
+ else
+ {
+ ahead = 1;
+ assert(ii + lit + 1 == c->ip - c->look);
+ }
+ assert(m_len > 0);
+ }
+ assert(ii + lit + ahead == c->ip - c->look);
+
+
+ if (m_len == 0)
+ {
+ /* a literal */
+ lit++;
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+ else
+ {
+ /* 1 - store run */
+ if (lit > 0)
+ {
+ /* code current literal run */
+ if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
+ {
+ /* Code a context sensitive R1 match. */
+ assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
+ op[-2] &= M2O_MASK;
+ assert((op[-2] >> M2O_BITS) == 0);
+ /* copy 1 literal */
+ *op++ = *ii++;
+ assert(ii + ahead == c->ip - c->look);
+ c->r1_r++;
+ }
+ else
+ {
+ op = STORE_RUN(op,ii,lit);
+ }
+ if (lit < R0FAST)
+ c->r1_m_len = m_len;
+ else
+ c->r1_m_len = 0;
+ lit = 0;
+ }
+ else
+ c->r1_m_len = 0;
+
+ /* 2 - code match */
+ op = code_match(c,op,m_len,m_off);
+ r = find_match(c,swd,m_len,1+ahead);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+
+ c->codesize = pd(op, out);
+ }
+
+
+ /* store final run */
+ if (lit > 0)
+ op = STORE_RUN(op,ii,lit);
+
+#if defined(LZO_EOF_CODE)
+ *op++ = M3_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+#endif
+
+ c->codesize = pd(op, out);
+ assert(c->textsize == in_len);
+
+ *out_len = pd(op, out);
+
+ if (c->cb && c->cb->nprogress)
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+
+#if 0
+ printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n",
+ (long) c->textsize, (long)in_len, (long) c->codesize,
+ c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy);
+#endif
+ return LZO_E_OK;
+}
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1b_999_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1b_999_compress_callback(in,in_len,out,out_len,wrkmem,
+ (lzo_callback_p) 0, 0);
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_c.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_c.ch
new file mode 100644
index 00000000..4fb79d46
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_c.ch
@@ -0,0 +1,264 @@
+/* lzo1b_c.ch -- implementation of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if !defined(LZO_HAVE_R1) && !defined(LZO_NO_R1)
+# define LZO_HAVE_R1 1
+#endif
+
+#if !defined(LZO_HAVE_M3) && !defined(LZO_NO_M3)
+# if (M3O_BITS < 8)
+# define LZO_HAVE_M3 1
+# endif
+#endif
+
+
+#define MI /*empty*/
+#define SI MI
+#if (DD_BITS > 0)
+#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,drun,dv,ii,in); MI
+#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip));
+#else
+#define DI ++ii; DINDEX1(dindex,ii); UPDATE_I(dict,0,dindex,ii,in); MI
+#define XI assert(ii < ip); ii = ip;
+#endif
+
+
+/***********************************************************************
+// compress a block of data.
+//
+// I really apologize for this spaghetti code.
+************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+LZO_PRIVATE(int)
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ const lzo_bytep ip;
+#if (DD_BITS > 0)
+#if defined(__LZO_HASH_INCREMENTAL)
+ lzo_xint dv;
+#endif
+ unsigned drun = 0;
+#endif
+ lzo_bytep op;
+ const lzo_bytep const in_end = in + in_len;
+ const lzo_bytep const ip_end = in + in_len - MIN_LOOKAHEAD;
+ const lzo_bytep ii;
+#if defined(LZO_HAVE_R1)
+ const lzo_bytep r1 = ip_end; /* pointer for R1 match (none yet) */
+#endif
+#if defined(LZO_HAVE_M3)
+ lzo_bytep m3 = out + 1; /* pointer after last m3/m4 match */
+#endif
+
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->r_bits = R_BITS;
+ lzo_stats->m3o_bits = M3O_BITS;
+ lzo_stats->dd_bits = DD_BITS;
+ lzo_stats->clevel = CLEVEL;
+ lzo_stats->d_bits = D_BITS;
+ lzo_stats->min_lookahead = MIN_LOOKAHEAD;
+ lzo_stats->max_lookbehind = MAX_LOOKBEHIND;
+ lzo_stats->compress_id = LZO_PP_MACRO_EXPAND(COMPRESS_ID);
+#endif
+
+ /* init dictionary */
+#if (LZO_DETERMINISTIC)
+ BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE);
+#endif
+
+
+ op = out;
+ ip = in;
+ ii = ip; /* point to start of current literal run */
+
+
+#if (DD_BITS > 0)
+ DVAL_FIRST(dv,ip);
+ UPDATE_D(dict,drun,dv,ip,in);
+ ip++;
+ DVAL_NEXT(dv,ip);
+#else
+ ip++;
+#endif
+
+ assert(ip < ip_end);
+ for (;;)
+ {
+ const lzo_bytep m_pos;
+#if !defined(NDEBUG)
+ const lzo_bytep m_pos_sav = NULL;
+#endif
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+#if (DD_BITS == 0)
+ lzo_uint dindex;
+#endif
+ lzo_uint m_len;
+
+
+/***********************************************************************
+// search for a match
+************************************************************************/
+
+#if !defined(LZO_SEARCH_MATCH_INCLUDE_FILE)
+# define LZO_SEARCH_MATCH_INCLUDE_FILE "lzo1b_sm.ch"
+#endif
+
+#include LZO_SEARCH_MATCH_INCLUDE_FILE
+
+
+#if !defined(LZO_TEST_MATCH_INCLUDE_FILE)
+# define LZO_TEST_MATCH_INCLUDE_FILE "lzo1b_tm.ch"
+#endif
+
+#include LZO_TEST_MATCH_INCLUDE_FILE
+
+
+
+/***********************************************************************
+// found a literal
+************************************************************************/
+
+
+ /* a literal */
+literal:
+#if (DD_BITS == 0)
+ UPDATE_I(dict,0,dindex,ip,in);
+#endif
+ if (++ip >= ip_end)
+ break;
+#if (DD_BITS > 0)
+ DVAL_NEXT(dv,ip);
+#endif
+ continue;
+
+
+
+/***********************************************************************
+// found a match
+************************************************************************/
+
+match:
+#if (DD_BITS == 0)
+ UPDATE_I(dict,0,dindex,ip,in);
+#endif
+ /* we have found a match of at least M2_MIN_LEN */
+
+
+#if !defined(LZO_CODE_RUN_INCLUDE_FILE)
+# define LZO_CODE_RUN_INCLUDE_FILE "lzo1b_cr.ch"
+#endif
+
+#include LZO_CODE_RUN_INCLUDE_FILE
+
+
+ /* ii now points to the start of the current match */
+ assert(ii == ip);
+
+
+/***********************************************************************
+// code the match
+************************************************************************/
+
+#if !defined(LZO_CODE_MATCH_INCLUDE_FILE)
+# define LZO_CODE_MATCH_INCLUDE_FILE "lzo1b_cm.ch"
+#endif
+
+#include LZO_CODE_MATCH_INCLUDE_FILE
+
+
+ /* ii now points to the start of the next literal run */
+ assert(ii == ip);
+
+ }
+
+
+/***********************************************************************
+// end of block
+************************************************************************/
+
+ assert(ip <= in_end);
+
+#if (LZO_COLLECT_STATS)
+ {
+ lzo_uint i;
+ const lzo_bytep p;
+
+ for (i = 0; i < D_SIZE; i++)
+ {
+ p = dict[i];
+ if (BOUNDS_CHECKING_OFF_IN_EXPR(p == NULL || p < in || p > in_end))
+ lzo_stats->unused_dict_entries++;
+ }
+ lzo_stats->unused_dict_entries_percent =
+ 100.0 * lzo_stats->unused_dict_entries / D_SIZE;
+ }
+#endif
+
+
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ /* return if op == out to indicate that we
+ * couldn't compress and didn't copy anything.
+ */
+ if (op == out)
+ {
+ *out_len = 0;
+ return LZO_E_NOT_COMPRESSIBLE;
+ }
+#endif
+
+ /* store the final literal run */
+ if (pd(in_end,ii) > 0)
+ {
+ lzo_uint t = pd(in_end,ii);
+ op = STORE_RUN(op,ii,t);
+ }
+
+ *out_len = pd(op, out);
+ return LZO_E_OK; /* compression went ok */
+}
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.c
new file mode 100644
index 00000000..cf597d52
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.c
@@ -0,0 +1,155 @@
+/* lzo1b_cc.c -- LZO1B compression internal entry point
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO_NEED_DICT_H 1
+#include "config1b.h"
+
+
+/***********************************************************************
+// compression internal entry point.
+************************************************************************/
+
+int _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func )
+{
+ int r;
+#if defined(LZO_TEST_COMPRESS_OVERRUN)
+ lzo_uint avail_out = *out_len;
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+ _lzo1b_stats_init(lzo_stats);
+ lzo_stats->in_len = in_len;
+#endif
+
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ {
+ *out_len = 0;
+ r = LZO_E_OK;
+ }
+ else if (in_len <= MIN_LOOKAHEAD + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ *out_len = 0;
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(STORE_RUN(out,in,in_len), out);
+ r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
+#endif
+ }
+ else
+ r = func(in,in_len,out,out_len,wrkmem);
+
+
+#if defined(LZO_EOF_CODE)
+#if defined(LZO_TEST_COMPRESS_OVERRUN)
+ if (r == LZO_E_OK && avail_out - *out_len < 3)
+ r = LZO_E_COMPRESS_OVERRUN;
+#endif
+ if (r == LZO_E_OK)
+ {
+ lzo_bytep op = out + *out_len;
+ op[0] = M3_MARKER | 1;
+ op[1] = 0;
+ op[2] = 0;
+ *out_len += 3;
+ }
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->out_len = *out_len;
+ lzo_stats->match_bytes =
+ 1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches +
+ 3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches;
+ _lzo1b_stats_calc(lzo_stats);
+#endif
+
+ return r;
+}
+
+
+/***********************************************************************
+// note: this is not thread safe, but as it is used for finetuning only
+// we don't care
+************************************************************************/
+
+#undef lzo_stats
+/* lzo_stats_t is still defined */
+
+
+#if (LZO_COLLECT_STATS)
+
+static lzo_stats_t lzo_statistics;
+lzo_stats_t * const lzo1b_stats = &lzo_statistics;
+
+
+void _lzo1b_stats_init(lzo_stats_t *lzo_stats)
+{
+ lzo_memset(lzo_stats,0,sizeof(*lzo_stats));
+}
+
+
+void _lzo1b_stats_calc(lzo_stats_t *lzo_stats)
+{
+ lzo_stats->matches =
+ lzo_stats->m1_matches + lzo_stats->m2_matches +
+ lzo_stats->m3_matches + lzo_stats->m4_matches;
+
+ lzo_stats->literal_overhead = lzo_stats->lit_runs +
+ 2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs +
+ lzo_stats->r0long_runs);
+ lzo_stats->literal_bytes = lzo_stats->literals +
+ lzo_stats->literal_overhead;
+
+#if 0
+ assert(lzo_stats->match_bytes + lzo_stats->literal_bytes ==
+ lzo_stats->out_len);
+#endif
+
+ lzo_stats->m2_matches -= lzo_stats->r1_matches;
+ lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches;
+
+ if (lzo_stats->literals > 0)
+ lzo_stats->literal_overhead_percent =
+ 100.0 * lzo_stats->literal_overhead / lzo_stats->literals;
+}
+
+
+#endif
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.h b/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.h
new file mode 100644
index 00000000..d92a095f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_cc.h
@@ -0,0 +1,81 @@
+/* lzo1b_cc.h -- definitions for the the LZO1B compression driver
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO1B_CC_H
+#define __LZO1B_CC_H 1
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+extern const lzo_compress_t _lzo1b_1_compress_func;
+extern const lzo_compress_t _lzo1b_2_compress_func;
+extern const lzo_compress_t _lzo1b_3_compress_func;
+extern const lzo_compress_t _lzo1b_4_compress_func;
+extern const lzo_compress_t _lzo1b_5_compress_func;
+extern const lzo_compress_t _lzo1b_6_compress_func;
+extern const lzo_compress_t _lzo1b_7_compress_func;
+extern const lzo_compress_t _lzo1b_8_compress_func;
+extern const lzo_compress_t _lzo1b_9_compress_func;
+
+extern const lzo_compress_t _lzo1b_99_compress_func;
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(lzo_bytep )
+_lzo1b_store_run ( lzo_bytep const oo, const lzo_bytep const ii,
+ lzo_uint r_len);
+
+#define STORE_RUN _lzo1b_store_run
+
+
+lzo_compress_t _lzo1b_get_compress_func(int clevel);
+
+int _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func );
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_cm.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_cm.ch
new file mode 100644
index 00000000..2a90b509
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_cm.ch
@@ -0,0 +1,282 @@
+/* lzo1b_cm.ch -- implementation of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+
+/***********************************************************************
+// code the match
+************************************************************************/
+
+#if (DD_BITS == 0)
+
+ /* we already matched M2_MIN_LEN bytes,
+ * m_pos also already advanced M2_MIN_LEN bytes */
+ ip += M2_MIN_LEN;
+ assert(m_pos < ip);
+
+ /* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
+ * to see if we get more than a M2 match */
+#define M2_OR_M3 (MATCH_M2)
+
+#else /* (DD_BITS == 0) */
+
+ /* we already matched m_len bytes */
+ assert(m_len >= M2_MIN_LEN);
+ ip += m_len;
+ assert(ip <= in_end);
+
+#define M2_OR_M3 (m_len <= M2_MAX_LEN)
+
+#endif /* (DD_BITS == 0) */
+
+
+
+ if (M2_OR_M3)
+ {
+ /* we've found a M2 or M3 match */
+ assert(ip <= in_end);
+
+ /* 2a) compute match parameters */
+#if (DD_BITS == 0)
+ assert(pd(ip,m_pos) == m_off);
+ --ip; /* ran one too far, point back to non-match */
+ m_len = pd(ip, ii);
+#endif
+
+ /* 2a2) verify match parameters */
+ assert(m_len >= M2_MIN_LEN);
+ assert(m_len <= M2_MAX_LEN);
+ assert(m_len <= M3_MAX_LEN);
+
+ assert(m_off >= M2_MIN_OFFSET);
+ assert(m_off >= M3_MIN_OFFSET);
+ assert(m_off <= M3_MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+
+ /* 2b) code the match */
+#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
+ if (m_off <= M2_MAX_OFFSET)
+ {
+#else
+ assert(m_off <= M2_MAX_OFFSET);
+#endif
+ m_off -= M2_MIN_OFFSET;
+ /* code match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
+ (m_off & M2O_MASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M2O_BITS);
+ LZO_STATS(lzo_stats->m2_matches++);
+ LZO_STATS(lzo_stats->m2_match[m_len]++);
+#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET)
+ }
+ else
+ {
+#if defined(LZO_HAVE_R1)
+#if (M3_MIN_LEN == M2_MIN_LEN)
+ r1 = ip_end; /* invalidate R1 pointer */
+#endif
+#endif
+ assert(m_len >= M3_MIN_LEN);
+ m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
+ /* code match len */
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
+ /* code low offset bits */
+ *op++ = LZO_BYTE(m_off & M3O_MASK);
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M3O_BITS);
+ LZO_STATS(lzo_stats->m3_matches++);
+ LZO_STATS(lzo_stats->m3_match[m_len]++);
+#if defined(LZO_HAVE_M3)
+ m3 = op; /* set M3 pointer */
+#endif
+ }
+#endif /* (_M2_MAX_OFFSET != _M3_MAX_OFFSET) */
+
+
+ if (ip >= ip_end)
+ {
+ ii = ip;
+ break;
+ }
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+
+#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+#if 0
+ UPDATE_D(dict,drun,dv,ii,in);
+#else
+ dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
+#endif
+ MI
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ else
+
+ {
+ /* we've found a M3 or M4 match - see how far we can still go */
+ assert(ip <= in_end);
+ assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0);
+
+ /* 2a) compute match parameters */
+#if !defined(MATCH_IP_END)
+ assert(ii == ip - (M2_MAX_LEN + 1));
+#if (DD_BITS > 0)
+ assert(m_len == (lzo_uint)(ip-ii));
+ m_pos = ip - m_off;
+ assert(m_pos == m_pos_sav + m_len);
+#endif
+ {
+ const lzo_bytep end;
+ end = in_end;
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ assert(ip <= in_end);
+ m_len = pd(ip, ii);
+ }
+ assert(pd(ip,m_pos) == m_off);
+#endif
+
+ /* 2a2) verify match parameters */
+ assert(m_len >= M3_MIN_LEN);
+
+ assert(m_off >= M3_MIN_OFFSET);
+ assert(m_off >= M4_MIN_OFFSET);
+ assert(m_off <= M3_MAX_OFFSET);
+ assert(m_off <= M4_MAX_OFFSET);
+ assert(ii-m_off == m_pos_sav);
+ assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
+
+ /* 2b) code the match */
+ if (m_len <= M3_MAX_LEN)
+ {
+ /* code match len */
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
+ LZO_STATS(lzo_stats->m3_matches++);
+ LZO_STATS(lzo_stats->m3_match[m_len]++);
+ }
+ else
+ {
+ assert(m_len >= M4_MIN_LEN);
+ /* code M4 match len flag */
+ *op++ = M4_MARKER;
+ /* code match len */
+ m_len -= M4_MIN_LEN - 1;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ LZO_STATS(lzo_stats->m4_matches++);
+ }
+
+ m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
+ /* code low offset bits */
+ *op++ = LZO_BYTE(m_off & M3O_MASK);
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M3O_BITS);
+
+#if defined(LZO_HAVE_M3)
+ m3 = op; /* set M3 pointer */
+#endif
+
+
+ if (ip >= ip_end)
+ {
+ ii = ip;
+ break;
+ }
+
+
+ /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
+#if (CLEVEL == 9)
+ /* Insert the whole match (ii+1)..(ip-1) into dictionary. */
+ /* This is not recommended because it can be slow. */
+ ++ii;
+ do {
+ DVAL_NEXT(dv,ii);
+#if 0
+ UPDATE_D(dict,drun,dv,ii,in);
+#else
+ dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
+#endif
+ MI
+ } while (++ii < ip);
+ DVAL_NEXT(dv,ii);
+ assert(ii == ip);
+ DVAL_ASSERT(dv,ip);
+#elif (CLEVEL >= 8)
+ SI DI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 7)
+ SI DI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 6)
+ SI DI DI DI DI DI DI XI
+#elif (CLEVEL >= 5)
+ SI DI DI DI DI XI
+#elif (CLEVEL >= 4)
+ SI DI DI DI XI
+#elif (CLEVEL >= 3)
+ SI DI DI XI
+#elif (CLEVEL >= 2)
+ SI DI XI
+#else
+ XI
+#endif
+ }
+
+ /* ii now points to the start of the next literal run */
+ assert(ii == ip);
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_cr.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_cr.ch
new file mode 100644
index 00000000..faf12e2a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_cr.ch
@@ -0,0 +1,114 @@
+/* lzo1b_cr.ch -- implementation of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+
+/***********************************************************************
+// store the current literal run
+************************************************************************/
+
+ assert(ip < ip_end);
+ if (pd(ip,ii) > 0)
+ {
+ lzo_uint t = pd(ip,ii);
+
+#if defined(LZO_HAVE_R1)
+ if (ip == r1)
+ {
+ /* Code a context sensitive R1 match. */
+ LZO_STATS(lzo_stats->literals += t);
+ LZO_STATS(lzo_stats->r1_matches++);
+ assert(t == 1);
+ /* modify marker byte */
+ assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
+ op[-2] &= M2O_MASK;
+ assert((op[-2] >> M2O_BITS) == 0);
+ /* copy 1 literal */
+ *op++ = *ii++;
+ r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
+ }
+ else
+#endif
+ if (t < R0MIN)
+ {
+ /* inline the copying of a short run */
+ LZO_STATS(lzo_stats->literals += t);
+ LZO_STATS(lzo_stats->lit_runs++);
+ LZO_STATS(lzo_stats->lit_run[t]++);
+#if defined(LZO_HAVE_M3)
+ if (t < LZO_SIZE(8-M3O_BITS) && op == m3)
+ {
+ /* Code a very short literal run into the low offset bits
+ * of the previous M3/M4 match.
+ */
+ LZO_STATS(lzo_stats->lit_runs_after_m3_match++);
+ LZO_STATS(lzo_stats->lit_run_after_m3_match[t]++);
+ assert((m3[-2] >> M3O_BITS) == 0);
+ m3[-2] = LZO_BYTE(m3[-2] | (t << M3O_BITS));
+ }
+ else
+#endif
+ {
+ *op++ = LZO_BYTE(t);
+ }
+ MEMCPY_DS(op, ii, t);
+#if defined(LZO_HAVE_R1)
+ r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
+#endif
+ }
+ else if (t < R0FAST)
+ {
+ /* inline the copying of a short R0 run */
+ LZO_STATS(lzo_stats->literals += t);
+ LZO_STATS(lzo_stats->r0short_runs++);
+ *op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
+ MEMCPY_DS(op, ii, t);
+#if defined(LZO_HAVE_R1)
+ r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */
+#endif
+ }
+ else
+ {
+ op = STORE_RUN(op,ii,t);
+ ii = ip;
+ }
+ }
+
+
+ /* ii now points to the start of the current match */
+ assert(ii == ip);
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_d.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_d.ch
new file mode 100644
index 00000000..cf253573
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_d.ch
@@ -0,0 +1,271 @@
+/* lzo1b_d.ch -- implementation of the LZO1B decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo1_d.ch"
+
+
+/***********************************************************************
+// decompress a block of data.
+************************************************************************/
+
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+ op = out;
+ ip = in;
+
+ while (TEST_IP_AND_TEST_OP)
+ {
+ t = *ip++; /* get marker */
+
+ if (t < R0MIN) /* a literal run */
+ {
+ if (t == 0) /* a R0 literal run */
+ {
+ NEED_IP(1);
+ t = *ip++;
+ if (t >= R0FAST - R0MIN) /* a long R0 run */
+ {
+ t -= R0FAST - R0MIN;
+ if (t == 0)
+ t = R0FAST;
+ else
+ {
+#if 0
+ t = 256u << ((unsigned) t);
+#else
+ /* help the optimizer */
+ lzo_uint tt = 256;
+ do tt <<= 1; while (--t > 0);
+ t = tt;
+#endif
+ }
+
+ NEED_IP(t); NEED_OP(t);
+#if 1 && (LZO_OPT_UNALIGNED32)
+ do {
+ UA_COPY4(op+0, ip+0);
+ UA_COPY4(op+4, ip+4);
+ op += 8; ip += 8;
+ t -= 8;
+ } while (t > 0);
+#else
+ MEMCPY8_DS(op,ip,t);
+#endif
+ continue;
+ }
+ t += R0MIN; /* a short R0 run */
+ }
+
+ NEED_IP(t); NEED_OP(t);
+ /* copy literal run */
+#if 1 && (LZO_OPT_UNALIGNED32)
+ if (t >= 4)
+ {
+ do {
+ UA_COPY4(op, ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+#endif
+ {
+#if (M3O_BITS < 7)
+literal1:
+#endif
+ do *op++ = *ip++; while (--t > 0);
+ }
+
+#if (M3O_BITS == 7)
+literal2:
+#endif
+
+ /* after a literal a match must follow */
+ while (TEST_IP_AND_TEST_OP)
+ {
+ t = *ip++; /* get R1 marker */
+ if (t >= R0MIN)
+ goto match;
+
+ NEED_IP(2); NEED_OP(M2_MIN_LEN + 1);
+
+ /* R1 match - a M2_MIN_LEN match + 1 byte literal */
+ assert((t & M2O_MASK) == t);
+ m_pos = op - M2_MIN_OFFSET;
+ m_pos -= t | (((lzo_uint) *ip++) << M2O_BITS);
+ assert(m_pos >= out); assert(m_pos < op);
+ TEST_LB(m_pos);
+ COPY_M2;
+ *op++ = *ip++;
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ break;
+#endif
+ }
+
+match:
+
+ if (t >= M2_MARKER) /* a M2 match */
+ {
+ /* get match offset */
+ NEED_IP(1);
+ m_pos = op - M2_MIN_OFFSET;
+ m_pos -= (t & M2O_MASK) | (((lzo_uint) *ip++) << M2O_BITS);
+ assert(m_pos >= out); assert(m_pos < op);
+ TEST_LB(m_pos);
+
+ /* get match len */
+ t = (t >> M2O_BITS) - 1;
+ NEED_OP(t + M2_MIN_LEN - 1);
+ COPY_M2X;
+ MEMCPY_DS(op,m_pos,t);
+ }
+ else /* a M3 or M4 match */
+ {
+ /* get match len */
+ t &= M3L_MASK;
+ if (t == 0) /* a M4 match */
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += (M4_MIN_LEN - M3_MIN_LEN) + *ip++;
+ }
+
+ /* get match offset */
+ NEED_IP(2);
+ m_pos = op - (M3_MIN_OFFSET - M3_EOF_OFFSET);
+ m_pos -= *ip++ & M3O_MASK;
+ m_pos -= (lzo_uint)(*ip++) << M3O_BITS;
+#if defined(LZO_EOF_CODE)
+ if (m_pos == op)
+ goto eof_found;
+#endif
+
+ /* copy match */
+ assert(m_pos >= out); assert(m_pos < op);
+ TEST_LB(m_pos); NEED_OP(t + M3_MIN_LEN - 1);
+#if (LZO_OPT_UNALIGNED32)
+ if (t >= 2 * 4 - (M3_MIN_LEN - 1) && (op - m_pos) >= 4)
+ {
+ UA_COPY4(op, m_pos);
+ op += 4; m_pos += 4; t -= 4 - (M3_MIN_LEN - 1);
+ do {
+ UA_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_M3X;
+ MEMCPY_DS(op,m_pos,t);
+ }
+
+
+#if (M3O_BITS < 7)
+ t = ip[-2] >> M3O_BITS;
+ if (t)
+ {
+ NEED_IP(t); NEED_OP(t);
+ goto literal1;
+ }
+#elif (M3O_BITS == 7)
+ /* optimized version */
+ if (ip[-2] & (1 << M3O_BITS))
+ {
+ NEED_IP(1); NEED_OP(1);
+ *op++ = *ip++;
+ goto literal2;
+ }
+#endif
+ }
+ }
+
+
+#if defined(LZO_EOF_CODE)
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ /* no EOF code was found */
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+#endif
+ *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
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_d1.c
new file mode 100644
index 00000000..cd52b250
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_d1.c
@@ -0,0 +1,34 @@
+/* lzo1b_d1.c -- LZO1B decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1b.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1b_decompress
+
+#include "lzo1b_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_d2.c
new file mode 100644
index 00000000..879b4aef
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_d2.c
@@ -0,0 +1,34 @@
+/* lzo1b_d2.c -- LZO1B decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1b.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1b_decompress_safe
+
+#include "lzo1b_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_de.h b/ics-openvpn-stripped/main/lzo/src/lzo1b_de.h
new file mode 100644
index 00000000..c88ee614
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_de.h
@@ -0,0 +1,332 @@
+/* lzo1b_de.h -- definitions for the the LZO1B/LZO1C algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_DEFS_H
+#define __LZO_DEFS_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/*
+ Format of the marker byte
+
+ 76543210
+ --------
+ 00000000 R0 - a long literal run ('R0' run)
+ 000rrrrr R - a short literal run with len r
+ 00100000 M4 - a very long match
+ 001mmmmm M3 - a long match (len = m+M3_MIN_LEN)
+ mmmooooo M2 - a short match (len = m+M2_MIN_LEN, o = offset low bits)
+
+ M1 is not used !
+*/
+
+
+#ifndef R_BITS
+#define R_BITS (5)
+#endif
+
+
+#ifndef M1L_BITS
+#define M1L_BITS (0)
+#endif
+#ifndef M2L_BITS
+#define M2L_BITS (CHAR_BIT - M2O_BITS)
+#endif
+#ifndef M3L_BITS
+#define M3L_BITS (R_BITS)
+#endif
+#ifndef M4L_BITS
+#define M4L_BITS (CHAR_BIT)
+#endif
+
+#ifndef M1O_BITS
+#define M1O_BITS (6)
+#endif
+#ifndef M2O_BITS
+#define M2O_BITS (R_BITS)
+#endif
+#ifndef M3O_BITS
+#define M3O_BITS (CHAR_BIT)
+#endif
+#ifndef M4O_BITS
+#define M4O_BITS (M3O_BITS) /* must be the same */
+#endif
+
+#ifndef M1X_BITS
+#define M1X_BITS (M1O_BITS)
+#endif
+#ifndef M2X_BITS
+#define M2X_BITS (M2O_BITS + CHAR_BIT)
+#endif
+#ifndef M3X_BITS
+#define M3X_BITS (M3O_BITS + CHAR_BIT)
+#endif
+#ifndef M4X_BITS
+#define M4X_BITS M3X_BITS
+#endif
+
+
+#define __MIN_OFFSET(bits) 1
+#define __MAX_OFFSET(bits) LZO_SIZE(bits)
+
+#define M1_MIN_OFFSET __MIN_OFFSET(M1X_BITS)
+#define M2_MIN_OFFSET __MIN_OFFSET(M2X_BITS)
+#define M3_MIN_OFFSET __MIN_OFFSET(M3X_BITS)
+#define M4_MIN_OFFSET M3_MIN_OFFSET
+
+#if defined(LZO_EOF_CODE) && !defined(M3_EOF_OFFSET)
+#define M3_EOF_OFFSET 1
+#else
+#define M3_EOF_OFFSET 0
+#endif
+
+#ifndef _M1_MAX_OFFSET
+#define _M1_MAX_OFFSET __MAX_OFFSET(M1X_BITS)
+#endif
+#ifndef _M2_MAX_OFFSET
+#define _M2_MAX_OFFSET __MAX_OFFSET(M2X_BITS)
+#endif
+#ifndef _M3_MAX_OFFSET
+#define _M3_MAX_OFFSET (__MAX_OFFSET(M3X_BITS) - M3_EOF_OFFSET)
+#endif
+#ifndef _M4_MAX_OFFSET
+#define _M4_MAX_OFFSET _M3_MAX_OFFSET
+#endif
+#ifndef _MAX_OFFSET
+#define _MAX_OFFSET _M4_MAX_OFFSET
+#endif
+
+#if (M3_EOF_OFFSET > 0) && (_M2_MAX_OFFSET == _M3_MAX_OFFSET + M3_EOF_OFFSET)
+# undef _M2_MAX_OFFSET
+# define _M2_MAX_OFFSET _M3_MAX_OFFSET
+#endif
+#if (_M2_MAX_OFFSET > _M3_MAX_OFFSET)
+# error
+#endif
+
+#define M1_MAX_OFFSET ((lzo_uint) _M1_MAX_OFFSET)
+#define M2_MAX_OFFSET ((lzo_uint) _M2_MAX_OFFSET)
+#define M3_MAX_OFFSET ((lzo_uint) _M3_MAX_OFFSET)
+#define M4_MAX_OFFSET ((lzo_uint) _M4_MAX_OFFSET)
+#define MAX_OFFSET ((lzo_uint) _MAX_OFFSET)
+
+
+#ifndef M1_MIN_LEN
+#define M1_MIN_LEN (2)
+#endif
+#ifndef M2_MIN_LEN
+#define M2_MIN_LEN (3)
+#endif
+#ifndef M3_MIN_LEN
+#if (M3X_BITS == M2X_BITS)
+#define M3_MIN_LEN (M2_MAX_LEN + 1)
+#else
+#define M3_MIN_LEN (4)
+#endif
+#endif
+#ifndef M4_MIN_LEN
+#define M4_MIN_LEN (M3_MAX_LEN + 1)
+#endif
+
+#ifndef M1_MAX_LEN
+#define M1_MAX_LEN (M1_MIN_LEN + LZO_SIZE(M1L_BITS) - 1)
+#endif
+#ifndef M2_MAX_LEN
+#define M2_MAX_LEN (M2_MIN_LEN + LZO_SIZE(M2L_BITS) - 3)
+#endif
+#ifndef M3_MAX_LEN
+#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 2)
+#endif
+#ifndef M4_MAX_LEN
+#define M4_MAX_LEN (ULONG_MAX)
+#endif
+
+
+#define M1O_MASK LZO_MASK(M1O_BITS)
+#define M1L_MASK LZO_MASK(M1L_BITS)
+#define M2O_MASK LZO_MASK(M2O_BITS)
+#define M2L_MASK LZO_MASK(M2L_BITS)
+#define M3O_MASK LZO_MASK(M3O_BITS)
+#define M3L_MASK LZO_MASK(M3L_BITS)
+#define M4O_MASK LZO_MASK(M4O_BITS)
+#define M4L_MASK LZO_MASK(M4L_BITS)
+
+
+#define M1_MARKER (1 << M1O_BITS)
+#define M2_MARKER (2 << M2O_BITS)
+#define M3_MARKER (1 << M3L_BITS)
+#define M4_MARKER M3_MARKER
+
+
+/***********************************************************************
+// R0 literal run (a long run)
+************************************************************************/
+
+#ifndef R0MIN
+#define R0MIN (LZO_SIZE(R_BITS)) /* Minimum len of R0 run of literals */
+#endif
+#define R0MAX (R0MIN + 256 - 1) /* Maximum len of R0 run of literals */
+
+#if (R0MAX - (R0MAX & ~7u) >= 7)
+#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */
+#else
+#define R0FAST (R0MAX & ~15u) /* R0MAX aligned to 8 byte boundary */
+#endif
+
+#if (R0MAX - R0FAST < 7) || ((R0FAST & 7) != 0)
+# error "something went wrong"
+#endif
+#if (R0FAST * 2 < 512)
+# error "R0FAST is not big enough"
+#endif
+
+/* 7 special codes from R0FAST+1 .. R0MAX
+ * these codes mean long R0 runs with lengths
+ * 512, 1024, 2048, 4096, 8192, 16384, 32768
+ */
+
+
+
+/***********************************************************************
+// matching
+************************************************************************/
+
+#define PS *m_pos++ != *ip++
+
+
+/* We already matched M2_MIN_LEN bytes.
+ * Try to match another M2_MAX_LEN - M2_MIN_LEN bytes. */
+
+#if (M2_MAX_LEN - M2_MIN_LEN == 4)
+# define MATCH_M2X (PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 5)
+# define MATCH_M2X (PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 6)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 7)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 13)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 14)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 16)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS || PS || PS || PS)
+#elif (M2_MAX_LEN - M2_MIN_LEN == 29)
+# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS || PS || PS || PS || \
+ PS || PS || PS || PS || PS)
+#else
+# error "MATCH_M2X not yet implemented"
+#endif
+
+
+/* We already matched M2_MIN_LEN bytes.
+ * Try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
+ * to see if we get more than a M2 match */
+
+#define MATCH_M2 (MATCH_M2X || PS)
+
+
+/***********************************************************************
+// copying
+************************************************************************/
+
+#define _CP *op++ = *m_pos++
+
+#if (M2_MIN_LEN == 2)
+# define COPY_M2X _CP
+#elif (M2_MIN_LEN == 3)
+# define COPY_M2X _CP; _CP
+#elif (M2_MIN_LEN == 4)
+# define COPY_M2X _CP; _CP; _CP
+#else
+# error "COPY_M2X not yet implemented"
+#endif
+
+#if (M3_MIN_LEN == 3)
+# define COPY_M3X _CP; _CP
+#elif (M3_MIN_LEN == 4)
+# define COPY_M3X _CP; _CP; _CP
+#elif (M3_MIN_LEN == 9)
+# define COPY_M3X _CP; _CP; _CP; _CP; _CP; _CP; _CP; _CP
+#else
+# error "COPY_M3X not yet implemented"
+#endif
+
+#define COPY_M2 COPY_M2X; *op++ = *m_pos++
+#define COPY_M3 COPY_M3X; *op++ = *m_pos++
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if defined(LZO_NEED_DICT_H)
+
+#define DL_MIN_LEN M2_MIN_LEN
+#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)
+#include "lzo_dict.h"
+
+#ifndef MIN_LOOKAHEAD
+#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
+#endif
+#ifndef MAX_LOOKBEHIND
+#define MAX_LOOKBEHIND (MAX_OFFSET)
+#endif
+
+#endif /* defined(LZO_NEED_DICT_H) */
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_r.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_r.ch
new file mode 100644
index 00000000..d6ca5fa2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_r.ch
@@ -0,0 +1,105 @@
+/* lzo1b_r.ch -- literal run handling for the the LZO1B/LZO1C algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+// store a literal run (internal)
+************************************************************************/
+
+LZO_PUBLIC(lzo_bytep )
+STORE_RUN ( lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len)
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+
+ LZO_STATS(lzo_stats->literals += r_len);
+
+ op = oo;
+ ip = ii;
+ assert(r_len > 0);
+
+ /* code a long R0 run */
+ if (r_len >= 512)
+ {
+ unsigned r_bits = 6; /* 256 << 6 == 16384 */
+ lzo_uint tt = 32768u;
+
+ while (r_len >= (t = tt))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = (R0FAST - R0MIN) + 7;
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0long_runs++);
+ }
+ tt >>= 1;
+ do {
+ if (r_len >= (t = tt))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0long_runs++);
+ }
+ tt >>= 1;
+ } while (--r_bits > 0);
+ }
+ assert(r_len < 512);
+
+ while (r_len >= (t = R0FAST))
+ {
+ r_len -= t;
+ *op++ = 0; *op++ = (R0FAST - R0MIN);
+ MEMCPY8_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0fast_runs++);
+ }
+
+ t = r_len;
+ if (t >= R0MIN)
+ {
+ /* code a short R0 run */
+ *op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
+ MEMCPY_DS(op, ip, t);
+ LZO_STATS(lzo_stats->r0short_runs++);
+ }
+ else if (t > 0)
+ {
+ /* code a short literal run */
+ LZO_STATS(lzo_stats->lit_runs++);
+ LZO_STATS(lzo_stats->lit_run[t]++);
+ *op++ = LZO_BYTE(t);
+ MEMCPY_DS(op, ip, t);
+ }
+
+ return op;
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_rr.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_rr.c
new file mode 100644
index 00000000..6442ea85
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_rr.c
@@ -0,0 +1,31 @@
+/* lzo1b_rr.c -- literal run handling
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1b.h"
+
+#include "lzo1b_r.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_sm.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_sm.ch
new file mode 100644
index 00000000..032ec41b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_sm.ch
@@ -0,0 +1,198 @@
+/* lzo1b_sm.ch -- implementation of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+
+/***********************************************************************
+// search for a match
+************************************************************************/
+
+#if (DD_BITS == 0)
+
+ /* search ip in the dictionary */
+ DINDEX1(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_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,M3_MAX_OFFSET))
+ goto literal;
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ goto literal;
+
+
+#else /* (DD_BITS == 0) */
+
+
+
+ /* search ip in the deepened dictionary */
+ {
+ lzo_dict_p d = &dict [ DINDEX(dv,ip) ];
+ const lzo_bytep ip_sav;
+ unsigned j = DD_SIZE;
+ lzo_uint x_len;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, x_off, 0);
+
+ DVAL_ASSERT(dv,ip);
+
+ ip_sav = ip;
+ m_len = 0;
+ do {
+#if !defined(NDEBUG)
+ const lzo_bytep z_pos = NULL;
+#endif
+#if (LZO_DICT_USE_PTR)
+ m_pos = *d;
+ assert((z_pos = m_pos) == *d);
+#if (LZO_DETERMINISTIC)
+ assert(m_pos == NULL || m_pos >= in);
+ assert(m_pos == NULL || m_pos < ip);
+#endif
+#else
+ x_off = *d;
+#endif
+ assert(ip == ip_sav);
+
+ if (LZO_CHECK_MPOS(m_pos,x_off,in,ip,MAX_OFFSET))
+#if (CLEVEL == 9)
+ *d = DENTRY(ip,in);
+#else
+ ((void)(0));
+#endif
+ else if (m_pos[m_len] != ip[m_len])
+ ((void)(0));
+ else if (*m_pos++ == *ip++ && *m_pos++ == *ip++ && *m_pos++ == *ip++)
+ {
+#if !(LZO_DICT_USE_PTR)
+ assert((z_pos = ip - 3 - x_off) == (m_pos - 3));
+#endif
+ /* a match */
+ if (MATCH_M2)
+ {
+ x_len = pd((ip - 1), ip_sav);
+ if (x_len > m_len)
+ {
+ m_len = x_len;
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ }
+#if (CLEVEL == 9)
+ /* try to find a closer match */
+ else if (x_len == m_len && x_off < m_off)
+ {
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ }
+#endif
+ }
+ else
+ {
+ assert((ip - ip_sav) == M2_MAX_LEN + 1);
+#if (CLEVEL == 9)
+#if defined(MATCH_IP_END)
+ {
+ const lzo_bytep end;
+ end = MATCH_IP_END;
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ assert(ip <= in_end);
+ x_len = pd(ip, ip_sav);
+ }
+ if (x_len > m_len)
+ {
+ m_len = x_len;
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ if (ip >= MATCH_IP_END)
+ {
+ ip = ip_sav;
+#if 0
+ /* not needed - we are at the end */
+ d -= DD_SIZE - j;
+ assert(d == &dict [ DINDEX(dv,ip) ]);
+ UPDATE_P(d,drun,ip,in);
+#endif
+ goto match;
+ }
+ }
+ else if (x_len == m_len && x_off < m_off)
+ {
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ }
+#else
+ /* try to find a closer match */
+ if (m_len < M2_MAX_LEN + 1 || x_off < m_off)
+ {
+ m_len = M2_MAX_LEN + 1;
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ }
+#endif
+#else
+ /* don't search for a longer/closer match */
+ m_len = M2_MAX_LEN + 1;
+ m_off = x_off;
+ assert((m_pos_sav = z_pos) != NULL);
+ ip = ip_sav;
+ d -= DD_SIZE - j;
+ assert(d == &dict [ DINDEX(dv,ip) ]);
+ UPDATE_P(d,drun,ip,in);
+ goto match;
+#endif
+ }
+ ip = ip_sav;
+ }
+ else
+ ip = ip_sav;
+ d++;
+ } while (--j > 0);
+ assert(ip == ip_sav);
+
+ d -= DD_SIZE;
+ assert(d == &dict [ DINDEX(dv,ip) ]);
+ UPDATE_P(d,drun,ip,in);
+ }
+
+#endif /* (DD_BITS == 0) */
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_tm.ch b/ics-openvpn-stripped/main/lzo/src/lzo1b_tm.ch
new file mode 100644
index 00000000..96b96f00
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_tm.ch
@@ -0,0 +1,87 @@
+/* lzo1b_tm.ch -- implementation of the LZO1B compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+
+/***********************************************************************
+// test for a potential match
+************************************************************************/
+
+
+#if (DD_BITS == 0)
+
+try_match:
+#if !defined(NDEBUG) && (LZO_DICT_USE_PTR)
+#if (LZO_DETERMINISTIC)
+ assert(m_pos == NULL || m_pos >= in);
+ assert(m_pos == NULL || m_pos < ip);
+#endif
+ m_pos_sav = m_pos;
+#endif
+ if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2])
+ {
+ m_pos += 3;
+ goto match;
+ }
+
+
+#else /* (DD_BITS == 0) */
+
+
+ /* test potential match */
+
+ if (m_len > M2_MIN_LEN)
+ goto match;
+ if (m_len == M2_MIN_LEN)
+ {
+#if (_MAX_OFFSET == _M2_MAX_OFFSET)
+ goto match;
+#else
+ if (m_off <= M2_MAX_OFFSET)
+ goto match;
+#if 0 && (M3_MIN_LEN == M2_MIN_LEN)
+ if (ip == ii)
+ goto match;
+#endif
+#endif
+ }
+ goto literal;
+
+
+#endif /* (DD_BITS == 0) */
+
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1b_xx.c b/ics-openvpn-stripped/main/lzo/src/lzo1b_xx.c
new file mode 100644
index 00000000..21eec0aa
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1b_xx.c
@@ -0,0 +1,86 @@
+/* lzo1b_xx.c -- LZO1B compression public entry point
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1b.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static const lzo_compress_t * const c_funcs [9] =
+{
+ &_lzo1b_1_compress_func,
+ &_lzo1b_2_compress_func,
+ &_lzo1b_3_compress_func,
+ &_lzo1b_4_compress_func,
+ &_lzo1b_5_compress_func,
+ &_lzo1b_6_compress_func,
+ &_lzo1b_7_compress_func,
+ &_lzo1b_8_compress_func,
+ &_lzo1b_9_compress_func
+};
+
+
+lzo_compress_t _lzo1b_get_compress_func(int clevel)
+{
+ const lzo_compress_t *f;
+
+ if (clevel < LZO1B_BEST_SPEED || clevel > LZO1B_BEST_COMPRESSION)
+ {
+ if (clevel == LZO1B_DEFAULT_COMPRESSION)
+ clevel = LZO1B_BEST_SPEED;
+ else
+ return 0;
+ }
+ f = c_funcs[clevel-1];
+ assert(f && *f);
+ return *f;
+}
+
+
+LZO_PUBLIC(int)
+lzo1b_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ int clevel )
+{
+ lzo_compress_t f;
+
+ f = _lzo1b_get_compress_func(clevel);
+ if (!f)
+ return LZO_E_ERROR;
+ return _lzo1b_do_compress(src,src_len,dst,dst_len,wrkmem,f);
+}
+
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_1.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_1.c
new file mode 100644
index 00000000..fa9ae7d6
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_1.c
@@ -0,0 +1,34 @@
+/* lzo1c_1.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 1
+
+#define DDBITS 0
+#define CLEVEL 1
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_2.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_2.c
new file mode 100644
index 00000000..eb48954e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_2.c
@@ -0,0 +1,34 @@
+/* lzo1c_2.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 2
+
+#define DDBITS 0
+#define CLEVEL 2
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_3.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_3.c
new file mode 100644
index 00000000..cd6b861d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_3.c
@@ -0,0 +1,34 @@
+/* lzo1c_3.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 3
+
+#define DDBITS 0
+#define CLEVEL 3
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_4.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_4.c
new file mode 100644
index 00000000..81eafa5f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_4.c
@@ -0,0 +1,34 @@
+/* lzo1c_4.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 4
+
+#define DDBITS 1
+#define CLEVEL 2
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_5.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_5.c
new file mode 100644
index 00000000..b2fa252a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_5.c
@@ -0,0 +1,34 @@
+/* lzo1c_5.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 5
+
+#define DDBITS 1
+#define CLEVEL 3
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_6.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_6.c
new file mode 100644
index 00000000..44760049
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_6.c
@@ -0,0 +1,34 @@
+/* lzo1c_6.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 6
+
+#define DDBITS 1
+#define CLEVEL 5
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_7.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_7.c
new file mode 100644
index 00000000..0b16c07d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_7.c
@@ -0,0 +1,34 @@
+/* lzo1c_7.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 7
+
+#define DDBITS 2
+#define CLEVEL 3
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_8.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_8.c
new file mode 100644
index 00000000..727f2fc1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_8.c
@@ -0,0 +1,34 @@
+/* lzo1c_8.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 8
+
+#define DDBITS 2
+#define CLEVEL 8
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_9.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_9.c
new file mode 100644
index 00000000..6705bd7d
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_9.c
@@ -0,0 +1,34 @@
+/* lzo1c_9.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 9
+
+#define DDBITS 2
+#define CLEVEL 9
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_99.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_99.c
new file mode 100644
index 00000000..bec243b0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_99.c
@@ -0,0 +1,37 @@
+/* lzo1c_99.c -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define COMPRESS_ID 99
+
+#define DDBITS 3
+#define CLEVEL 9
+
+#define D_BITS 16
+#define MATCH_IP_END in_end
+#include "compr1c.h"
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_9x.c
new file mode 100644
index 00000000..9a7d6d0e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_9x.c
@@ -0,0 +1,367 @@
+/* lzo1c_9x.c -- implementation of the LZO1C-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1c.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define SWD_N 16383 /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
+
+
+#define LZO1C 1
+#define LZO_COMPRESS_T lzo1c_999_t
+#define lzo_swd_t lzo1c_999_swd_t
+#include "lzo_mchw.ch"
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static lzo_bytep
+code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
+{
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+ {
+ assert(m_len >= M2_MIN_LEN);
+ assert(m_off >= M2_MIN_OFFSET);
+
+ m_off -= M2_MIN_OFFSET;
+ /* code match len + low offset bits */
+ *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) |
+ (m_off & M2O_MASK));
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M2O_BITS);
+ c->m2_m++;
+ }
+ else
+ {
+ assert(m_len >= M3_MIN_LEN);
+ assert(m_off <= M3_MAX_OFFSET);
+
+ m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
+ /* code match len */
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1)));
+ else
+ {
+ assert(m_len >= M4_MIN_LEN);
+ /* code M4 match len flag */
+ *op++ = M4_MARKER;
+ /* code match len */
+ m_len -= M4_MIN_LEN - 1;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ /* code low offset bits */
+ *op++ = LZO_BYTE(m_off & M3O_MASK);
+ /* code high offset bits */
+ *op++ = LZO_BYTE(m_off >> M3O_BITS);
+
+ c->r1_m_len = 0;
+ c->m3 = op;
+ c->m3_m++;
+ }
+ return op;
+}
+
+
+/***********************************************************************
+// this is a public function, but there is no prototype in a header file
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain );
+
+LZO_PUBLIC(int)
+lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain )
+{
+ lzo_bytep op;
+ const lzo_bytep ii;
+ lzo_uint lit;
+ lzo_uint m_len, m_off;
+ LZO_COMPRESS_T cc;
+ LZO_COMPRESS_T * const c = &cc;
+ lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ int r;
+
+ /* sanity check */
+ LZO_COMPILE_TIME_ASSERT(LZO1C_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+
+ c->init = 0;
+ c->ip = c->in = in;
+ c->in_end = in + in_len;
+ c->cb = cb;
+ c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0;
+
+ op = out;
+ ii = c->ip; /* point to start of literal run */
+ lit = 0;
+ c->r1_m_len = 0;
+ c->m3 = out + 1; /* pointer after last m3/m4 match */
+
+ r = init_match(c,swd,NULL,0,0);
+ if (r != 0)
+ return r;
+ if (max_chain > 0)
+ swd->max_chain = max_chain;
+
+ r = find_match(c,swd,0,0);
+ if (r != 0)
+ return r;
+ while (c->look > 0)
+ {
+ int lazy_match_min_gain = -1;
+ lzo_uint ahead = 0;
+
+ m_len = c->m_len;
+ m_off = c->m_off;
+
+#if 0
+ printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look,
+ m_len, m_off);
+#endif
+
+ assert(c->ip - c->look >= in);
+ if (lit == 0)
+ ii = c->ip - c->look;
+ assert(ii + lit == c->ip - c->look);
+ assert(swd->b_char == *(c->ip - c->look));
+
+ if ((m_len < M2_MIN_LEN) ||
+ (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
+ {
+ m_len = 0;
+ }
+ else
+ {
+ assert(c->ip - c->look - m_off >= in);
+ assert(c->ip - c->look - m_off + m_len < c->ip);
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+
+ if (lit > 0)
+ {
+ /* we have a current literal run: do not try a lazy match,
+ if the literal could be coded into a r1 or m3 match */
+ if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
+ lazy_match_min_gain = -1;
+ else if (lit == 3 && op == c->m3)
+ lazy_match_min_gain = -1;
+ else if (lit < 3 && op == c->m3)
+ lazy_match_min_gain = 0;
+ else
+ lazy_match_min_gain = 1;
+
+#if (M2_MIN_LEN == 2)
+ if (m_len == 2)
+ {
+ /* don't code a match of len 2 if we have to
+ code a literal run. Code a literal instead. */
+ m_len = 0;
+ }
+#endif
+#if (M2_MIN_LEN == M3_MIN_LEN)
+ if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET)
+ {
+ /* don't code a M3 match of len 3 if we have to
+ code a literal run. Code a literal instead. */
+ m_len = 0;
+ }
+#endif
+ }
+ else
+ {
+ /* no current literal run: only try a lazy match,
+ if the literal could be coded into a r1 or m3 match */
+ if (c->r1_m_len == M2_MIN_LEN || op == c->m3)
+ lazy_match_min_gain = 0;
+ else
+ lazy_match_min_gain = -1;
+ }
+ }
+
+
+ /* try a lazy match */
+ if (m_len == 0)
+ lazy_match_min_gain = -1;
+ if (lazy_match_min_gain >= 0 && c->look > m_len)
+ {
+ assert(m_len > 0);
+
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ assert(c->look > 0);
+
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
+ c->m_off > M2_MAX_OFFSET)
+ lazy_match_min_gain += 1;
+
+ if (c->m_len >= m_len + lazy_match_min_gain)
+ {
+ c->lazy++;
+#if !defined(NDEBUG)
+ m_len = c->m_len;
+ m_off = c->m_off;
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+#endif
+ lit++;
+ assert(ii + lit == c->ip - c->look);
+ continue;
+ }
+ else
+ {
+ ahead = 1;
+ assert(ii + lit + 1 == c->ip - c->look);
+ }
+ assert(m_len > 0);
+ }
+ assert(ii + lit + ahead == c->ip - c->look);
+
+
+ if (m_len == 0)
+ {
+ /* a literal */
+ lit++;
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+ else
+ {
+ /* 1 - store run */
+ if (lit > 0)
+ {
+ /* code current literal run */
+ if (lit == 1 && c->r1_m_len == M2_MIN_LEN)
+ {
+ /* Code a context sensitive R1 match. */
+ assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS));
+ op[-2] &= M2O_MASK;
+ assert((op[-2] >> M2O_BITS) == 0);
+ /* copy 1 literal */
+ *op++ = *ii++;
+ assert(ii + ahead == c->ip - c->look);
+ c->r1_r++;
+ }
+ else if (lit < 4 && op == c->m3)
+ {
+ assert((c->m3[-2] >> M3O_BITS) == 0);
+ c->m3[-2] = LZO_BYTE(c->m3[-2] | (lit << M3O_BITS));
+ MEMCPY_DS(op, ii, lit);
+ assert(ii + ahead == c->ip - c->look);
+ c->m3_r++;
+ }
+ else
+ {
+ op = STORE_RUN(op,ii,lit);
+ }
+ if (lit < R0FAST)
+ c->r1_m_len = m_len;
+ else
+ c->r1_m_len = 0;
+ lit = 0;
+ }
+ else
+ c->r1_m_len = 0;
+
+ /* 2 - code match */
+ op = code_match(c,op,m_len,m_off);
+ r = find_match(c,swd,m_len,1+ahead);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+
+ c->codesize = pd(op, out);
+ }
+
+
+ /* store final run */
+ if (lit > 0)
+ op = STORE_RUN(op,ii,lit);
+
+#if defined(LZO_EOF_CODE)
+ *op++ = M3_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+#endif
+
+ c->codesize = pd(op, out);
+ assert(c->textsize == in_len);
+
+ *out_len = pd(op, out);
+
+ if (c->cb && c->cb->nprogress)
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+
+#if 0
+ printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n",
+ (long) c->textsize, (long)in_len, (long) c->codesize,
+ c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy);
+#endif
+ return LZO_E_OK;
+}
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1c_999_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1c_999_compress_callback(in,in_len,out,out_len,wrkmem,
+ (lzo_callback_p) 0, 0);
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.c
new file mode 100644
index 00000000..f6999dba
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.c
@@ -0,0 +1,155 @@
+/* lzo1c_cc.c -- LZO1C compression internal entry point
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO_NEED_DICT_H 1
+#include "config1c.h"
+
+
+/***********************************************************************
+// compression internal entry point.
+************************************************************************/
+
+int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func )
+{
+ int r;
+#if defined(LZO_TEST_COMPRESS_OVERRUN)
+ lzo_uint avail_out = *out_len;
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+ _lzo1c_stats_init(lzo_stats);
+ lzo_stats->in_len = in_len;
+#endif
+
+
+ /* don't try to compress a block that's too short */
+ if (in_len == 0)
+ {
+ *out_len = 0;
+ r = LZO_E_OK;
+ }
+ else if (in_len <= MIN_LOOKAHEAD + 1)
+ {
+#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
+ *out_len = 0;
+ r = LZO_E_NOT_COMPRESSIBLE;
+#else
+ *out_len = pd(STORE_RUN(out,in,in_len), out);
+ r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
+#endif
+ }
+ else
+ r = func(in,in_len,out,out_len,wrkmem);
+
+
+#if defined(LZO_EOF_CODE)
+#if defined(LZO_TEST_COMPRESS_OVERRUN)
+ if (r == LZO_E_OK && avail_out - *out_len < 3)
+ r = LZO_E_COMPRESS_OVERRUN;
+#endif
+ if (r == LZO_E_OK)
+ {
+ lzo_bytep op = out + *out_len;
+ op[0] = M3_MARKER | 1;
+ op[1] = 0;
+ op[2] = 0;
+ *out_len += 3;
+ }
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+ lzo_stats->out_len = *out_len;
+ lzo_stats->match_bytes =
+ 1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches +
+ 3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches;
+ _lzo1c_stats_calc(lzo_stats);
+#endif
+
+ return r;
+}
+
+
+/***********************************************************************
+// note: this is not thread safe, but as it is used for finetuning only
+// we don't care
+************************************************************************/
+
+#undef lzo_stats
+/* lzo_stats_t is still defined */
+
+
+#if (LZO_COLLECT_STATS)
+
+static lzo_stats_t lzo_statistics;
+lzo_stats_t * const lzo1c_stats = &lzo_statistics;
+
+
+void _lzo1c_stats_init(lzo_stats_t *lzo_stats)
+{
+ lzo_memset(lzo_stats,0,sizeof(*lzo_stats));
+}
+
+
+void _lzo1c_stats_calc(lzo_stats_t *lzo_stats)
+{
+ lzo_stats->matches =
+ lzo_stats->m1_matches + lzo_stats->m2_matches +
+ lzo_stats->m3_matches + lzo_stats->m4_matches;
+
+ lzo_stats->literal_overhead = lzo_stats->lit_runs +
+ 2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs +
+ lzo_stats->r0long_runs);
+ lzo_stats->literal_bytes = lzo_stats->literals +
+ lzo_stats->literal_overhead;
+
+#if 0
+ assert(lzo_stats->match_bytes + lzo_stats->literal_bytes ==
+ lzo_stats->out_len);
+#endif
+
+ lzo_stats->m2_matches -= lzo_stats->r1_matches;
+ lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches;
+
+ if (lzo_stats->literals > 0)
+ lzo_stats->literal_overhead_percent =
+ 100.0 * lzo_stats->literal_overhead / lzo_stats->literals;
+}
+
+
+#endif
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.h b/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.h
new file mode 100644
index 00000000..ff63ff06
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_cc.h
@@ -0,0 +1,81 @@
+/* lzo1c_cc.h -- definitions for the the LZO1C compression driver
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO1C_CC_H
+#define __LZO1C_CC_H 1
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+extern const lzo_compress_t _lzo1c_1_compress_func;
+extern const lzo_compress_t _lzo1c_2_compress_func;
+extern const lzo_compress_t _lzo1c_3_compress_func;
+extern const lzo_compress_t _lzo1c_4_compress_func;
+extern const lzo_compress_t _lzo1c_5_compress_func;
+extern const lzo_compress_t _lzo1c_6_compress_func;
+extern const lzo_compress_t _lzo1c_7_compress_func;
+extern const lzo_compress_t _lzo1c_8_compress_func;
+extern const lzo_compress_t _lzo1c_9_compress_func;
+
+extern const lzo_compress_t _lzo1c_99_compress_func;
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_EXTERN(lzo_bytep )
+_lzo1c_store_run ( lzo_bytep const oo, const lzo_bytep const ii,
+ lzo_uint r_len);
+
+#define STORE_RUN _lzo1c_store_run
+
+
+lzo_compress_t _lzo1c_get_compress_func(int clevel);
+
+int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_compress_t func );
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_d1.c
new file mode 100644
index 00000000..63b6eaf4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_d1.c
@@ -0,0 +1,34 @@
+/* lzo1c_d1.c -- LZO1C decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1c.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1c_decompress
+
+#include "lzo1b_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_d2.c
new file mode 100644
index 00000000..64bc8e62
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_d2.c
@@ -0,0 +1,48 @@
+/* lzo1c_d2.c -- LZO1C decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1c.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1c_decompress_safe
+
+#include "lzo1b_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1c_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1c_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1c_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_rr.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_rr.c
new file mode 100644
index 00000000..860d36e1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_rr.c
@@ -0,0 +1,31 @@
+/* lzo1c_rr.c -- literal run handling
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1c.h"
+
+#include "lzo1b_r.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1c_xx.c b/ics-openvpn-stripped/main/lzo/src/lzo1c_xx.c
new file mode 100644
index 00000000..7a0e5940
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1c_xx.c
@@ -0,0 +1,86 @@
+/* lzo1c_xx.c -- LZO1C compression public entry point
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1c.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static const lzo_compress_t * const c_funcs [9] =
+{
+ &_lzo1c_1_compress_func,
+ &_lzo1c_2_compress_func,
+ &_lzo1c_3_compress_func,
+ &_lzo1c_4_compress_func,
+ &_lzo1c_5_compress_func,
+ &_lzo1c_6_compress_func,
+ &_lzo1c_7_compress_func,
+ &_lzo1c_8_compress_func,
+ &_lzo1c_9_compress_func
+};
+
+
+lzo_compress_t _lzo1c_get_compress_func(int clevel)
+{
+ const lzo_compress_t *f;
+
+ if (clevel < LZO1C_BEST_SPEED || clevel > LZO1C_BEST_COMPRESSION)
+ {
+ if (clevel == LZO1C_DEFAULT_COMPRESSION)
+ clevel = LZO1C_BEST_SPEED;
+ else
+ return 0;
+ }
+ f = c_funcs[clevel-1];
+ assert(f && *f);
+ return *f;
+}
+
+
+LZO_PUBLIC(int)
+lzo1c_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ int clevel )
+{
+ lzo_compress_t f;
+
+ f = _lzo1c_get_compress_func(clevel);
+ if (!f)
+ return LZO_E_ERROR;
+ return _lzo1c_do_compress(src,src_len,dst,dst_len,wrkmem,f);
+}
+
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1f_1.c b/ics-openvpn-stripped/main/lzo/src/lzo1f_1.c
new file mode 100644
index 00000000..0f8612e4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1f_1.c
@@ -0,0 +1,304 @@
+/* lzo1f_1.c -- implementation of the LZO1F-1 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#include "lzo/lzo1f.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define M2_MAX_OFFSET 0x0800
+#define M3_MAX_OFFSET 0x3fff
+#define M3_MARKER 224
+
+
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A
+#endif
+#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)
+#include "lzo_dict.h"
+
+
+/***********************************************************************
+// compress a block of data.
+************************************************************************/
+
+static __lzo_noinline
+int do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ 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 - 9;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+ op = out;
+ ip = in;
+ ii = ip;
+
+ ip++;
+ for (;;)
+ {
+ const lzo_bytep m_pos;
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+ lzo_uint m_len;
+ lzo_uint dindex;
+ lzo_uint lit;
+
+ DINDEX1(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_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,M3_MAX_OFFSET))
+ goto literal;
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ goto literal;
+
+
+try_match:
+#if 0 && (LZO_OPT_UNALIGNED16)
+ if (UA_GET_NE16(m_pos) != UA_GET_NE16(ip))
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
+#endif
+ {
+ }
+ else
+ {
+ if (m_pos[2] == ip[2])
+ {
+ m_pos += 3;
+#if 0
+ if (m_off <= M2_MAX_OFFSET)
+ goto match;
+ if (lit <= 3)
+ goto match;
+ if (lit == 3) /* better compression, but slower */
+ {
+ assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
+ *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
+ goto code_match;
+ }
+ if (*m_pos == ip[3])
+#endif
+ goto match;
+ }
+ }
+
+
+ /* a literal */
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ if (++ip >= ip_end)
+ break;
+ continue;
+
+
+ /* a match */
+match:
+ UPDATE_I(dict,0,dindex,ip,in);
+ /* store current literal run */
+ lit = pd(ip,ii);
+ if (lit > 0)
+ {
+ lzo_uint t = lit;
+
+ if (t < 4 && op > out)
+ op[-2] = LZO_BYTE(op[-2] | t);
+ else if (t <= 31)
+ *op++ = LZO_BYTE(t);
+ else
+ {
+ lzo_uint tt = t - 31;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+ }
+ assert(ii == ip);
+
+
+ /* code the match */
+ ip += 3;
+ if (*m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++ ||
+ *m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++)
+ {
+ --ip;
+ m_len = pd(ip, ii);
+ assert(m_len >= 3); assert(m_len <= 8);
+
+ if (m_off <= M2_MAX_OFFSET)
+ {
+ m_off -= 1;
+ *op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+ }
+ else if (m_len == 3 && m_off <= 2*M2_MAX_OFFSET && lit > 0)
+ {
+ m_off -= 1;
+ /* m_off -= M2_MAX_OFFSET; */
+ *op++ = LZO_BYTE(((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+ }
+ else
+ {
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+ }
+ else
+ {
+ {
+ const lzo_bytep end;
+ end = in_end;
+ while (ip < end && *m_pos == *ip)
+ m_pos++, ip++;
+ m_len = pd(ip, ii);
+ }
+ assert(m_len >= 3);
+
+ if (m_len <= 33)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= 33;
+ *op++ = M3_MARKER | 0;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+
+ ii = ip;
+ if (ip >= ip_end)
+ break;
+ }
+
+
+ /* store final literal run */
+ if (pd(in_end,ii) > 0)
+ {
+ lzo_uint t = pd(in_end,ii);
+
+ if (t < 4 && op > out)
+ op[-2] = LZO_BYTE(op[-2] | t);
+ else if (t <= 31)
+ *op++ = LZO_BYTE(t);
+ else
+ {
+ lzo_uint tt = t - 31;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ UA_COPYN(op, ii, t);
+ op += t;
+ }
+
+ *out_len = pd(op, out);
+ return LZO_E_OK;
+}
+
+
+/***********************************************************************
+// public entry point
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1f_1_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op = out;
+ int r = LZO_E_OK;
+
+ if (in_len == 0)
+ *out_len = 0;
+ else if (in_len <= 10)
+ {
+ *op++ = LZO_BYTE(in_len);
+ do *op++ = *in++; while (--in_len > 0);
+ *out_len = pd(op, out);
+ }
+ else
+ r = do_compress(in,in_len,out,out_len,wrkmem);
+
+ if (r == LZO_E_OK)
+ {
+ op = out + *out_len;
+ op[0] = M3_MARKER | 1;
+ op[1] = 0;
+ op[2] = 0;
+ *out_len += 3;
+ }
+
+ return r;
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1f_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1f_9x.c
new file mode 100644
index 00000000..eb78d8cb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1f_9x.c
@@ -0,0 +1,333 @@
+/* lzo1f_9x.c -- implementation of the LZO1F-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1f.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define SWD_N 16383 /* size of ring buffer */
+#define SWD_THRESHOLD 2 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
+
+
+#define LZO1F 1
+#define LZO_COMPRESS_T lzo1f_999_t
+#define lzo_swd_t lzo1f_999_swd_t
+#include "lzo_mchw.ch"
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static lzo_bytep
+code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
+{
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+ {
+ m_off -= 1;
+ *op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+ c->m2_m++;
+ }
+ else if (m_len == M2_MIN_LEN && m_off <= 2 * M2_MAX_OFFSET &&
+ c->r1_lit > 0)
+ {
+ assert(m_off > M2_MAX_OFFSET);
+ m_off -= 1 + M2_MAX_OFFSET;
+ *op++ = LZO_BYTE(((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+ c->r1_r++;
+ }
+ else
+ {
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= M3_MAX_LEN;
+ *op++ = M3_MARKER | 0;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ c->m3_m++;
+ }
+
+ return op;
+}
+
+
+static lzo_bytep
+STORE_RUN ( lzo_bytep op, const lzo_bytep ii, lzo_uint t, lzo_bytep out )
+{
+ if (t < 4 && op > out)
+ op[-2] = LZO_BYTE(op[-2] | t);
+ else if (t <= 31)
+ *op++ = LZO_BYTE(t);
+ else
+ {
+ lzo_uint tt = t - 31;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+
+ return op;
+}
+
+
+/***********************************************************************
+// this is a public function, but there is no prototype in a header file
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain );
+
+LZO_PUBLIC(int)
+lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain )
+{
+ lzo_bytep op;
+ const lzo_bytep ii;
+ lzo_uint lit;
+ lzo_uint m_len, m_off;
+ LZO_COMPRESS_T cc;
+ LZO_COMPRESS_T * const c = &cc;
+ lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ int r;
+
+ /* sanity check */
+ LZO_COMPILE_TIME_ASSERT(LZO1F_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+
+ c->init = 0;
+ c->ip = c->in = in;
+ c->in_end = in + in_len;
+ c->cb = cb;
+ c->r1_r = c->m2_m = c->m3_m = 0;
+
+ op = out;
+ ii = c->ip; /* point to start of literal run */
+ lit = 0;
+ c->r1_lit = c->r1_m_len = 0;
+
+ r = init_match(c,swd,NULL,0,0);
+ if (r != 0)
+ return r;
+ if (max_chain > 0)
+ swd->max_chain = max_chain;
+
+ r = find_match(c,swd,0,0);
+ if (r != 0)
+ return r;
+ while (c->look > 0)
+ {
+ int lazy_match_min_gain = -1;
+ lzo_uint ahead = 0;
+
+ m_len = c->m_len;
+ m_off = c->m_off;
+
+ assert(c->ip - c->look >= in);
+ if (lit == 0)
+ ii = c->ip - c->look;
+ assert(ii + lit == c->ip - c->look);
+ assert(swd->b_char == *(c->ip - c->look));
+
+ if ((m_len < M2_MIN_LEN) ||
+ (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET))
+ {
+ m_len = 0;
+ }
+ else
+ {
+ assert(c->ip - c->look - m_off >= in);
+ assert(c->ip - c->look - m_off + m_len < c->ip);
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+
+ if (lit < 3)
+ lazy_match_min_gain = 1;
+ else if (lit == 3)
+ lazy_match_min_gain = 3;
+ else if (lit == 31)
+ lazy_match_min_gain = 3;
+ else
+ lazy_match_min_gain = 1;
+ }
+
+ /* try a lazy match */
+ if (m_len > 0 && lazy_match_min_gain >= 0 && c->look > m_len)
+ {
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ assert(c->look > 0);
+
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET &&
+ c->m_off > M2_MAX_OFFSET)
+ {
+ lazy_match_min_gain += 1;
+ }
+ else if (c->m_len <= M2_MAX_LEN &&
+ c->m_off <= M2_MAX_OFFSET &&
+ m_off > M2_MAX_OFFSET)
+ {
+ if (lazy_match_min_gain > 0)
+ lazy_match_min_gain -= 1;
+ }
+ else if (m_len == M2_MIN_LEN && c->m_len == M2_MIN_LEN &&
+ c->m_off <= 2 * M2_MAX_OFFSET &&
+ m_off > M2_MAX_OFFSET)
+ {
+ if (lazy_match_min_gain > 0)
+ lazy_match_min_gain -= 1;
+ }
+
+ if (c->m_len >= m_len + lazy_match_min_gain)
+ {
+ c->lazy++;
+#if !defined(NDEBUG)
+ m_len = c->m_len;
+ m_off = c->m_off;
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+#endif
+ lit++;
+ assert(ii + lit == c->ip - c->look);
+ continue;
+ }
+ else
+ {
+ ahead = 1;
+ assert(ii + lit + 1 == c->ip - c->look);
+ }
+ assert(m_len > 0);
+ }
+ assert(ii + lit + ahead == c->ip - c->look);
+
+
+ if (m_len == 0)
+ {
+ /* a literal */
+ lit++;
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+ else
+ {
+ /* 1 - store run */
+ if (lit > 0)
+ {
+ op = STORE_RUN(op,ii,lit,out);
+ c->r1_m_len = m_len;
+ c->r1_lit = lit;
+ lit = 0;
+ }
+ else
+ c->r1_lit = c->r1_m_len = 0;
+
+ /* 2 - code match */
+ op = code_match(c,op,m_len,m_off);
+ r = find_match(c,swd,m_len,1+ahead);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+
+ c->codesize = pd(op, out);
+ }
+
+
+ /* store final run */
+ if (lit > 0)
+ op = STORE_RUN(op,ii,lit,out);
+
+#if defined(LZO_EOF_CODE)
+ *op++ = M3_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+#endif
+
+ c->codesize = pd(op, out);
+ assert(c->textsize == in_len);
+
+ *out_len = pd(op, out);
+
+ if (c->cb && c->cb->nprogress)
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+
+#if 0
+ printf("%ld %ld -> %ld: %ld %ld %ld %ld\n",
+ (long) c->textsize, (long)in_len, (long) c->codesize,
+ c->r1_r, c->m2_m, c->m3_m, c->lazy);
+#endif
+ return LZO_E_OK;
+}
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1f_999_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1f_999_compress_callback(in,in_len,out,out_len,wrkmem,
+ (lzo_callback_p) 0, 0);
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1f_d.ch b/ics-openvpn-stripped/main/lzo/src/lzo1f_d.ch
new file mode 100644
index 00000000..b22916e5
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1f_d.ch
@@ -0,0 +1,213 @@
+/* lzo1f_d.ch -- implementation of the LZO1F decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo1_d.ch"
+
+
+/***********************************************************************
+// decompress a block of data.
+************************************************************************/
+
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+ const lzo_bytep m_pos;
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ while (TEST_IP_AND_TEST_OP)
+ {
+ t = *ip++;
+ if (t > 31)
+ goto match;
+
+ /* a literal run */
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_IV(t);
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+ /* copy literals */
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+#if (LZO_OPT_UNALIGNED32)
+ if (t >= 4)
+ {
+ do {
+ UA_COPY4(op, ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+#endif
+ do *op++ = *ip++; while (--t > 0);
+
+ t = *ip++;
+
+ while (TEST_IP_AND_TEST_OP)
+ {
+ /* handle matches */
+ if (t < 32)
+ {
+ m_pos = op - 1 - 0x800;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
+ }
+ else
+ {
+match:
+ if (t < M3_MARKER)
+ {
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t >>= 5;
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+ }
+ else
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+ NEED_IP(2);
+ m_pos = op;
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(ip) >> 2;
+ ip += 2;
+#else
+ m_pos -= *ip++ >> 2;
+ m_pos -= *ip++ << 6;
+#endif
+ if (m_pos == op)
+ goto eof_found;
+ }
+
+ /* copy match */
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if (LZO_OPT_UNALIGNED32)
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+ UA_COPY4(op, m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ UA_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);
+ }
+ }
+ t = ip[-2] & 3;
+ if (t == 0)
+ break;
+
+ /* copy literals */
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ t = *ip++;
+ }
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ /* no EOF code was found */
+ *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
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1f_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1f_d1.c
new file mode 100644
index 00000000..0c505584
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1f_d1.c
@@ -0,0 +1,34 @@
+/* lzo1f_d1.c -- LZO1F decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1f.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1f_decompress
+
+#include "lzo1f_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1f_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1f_d2.c
new file mode 100644
index 00000000..b762a7af
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1f_d2.c
@@ -0,0 +1,48 @@
+/* lzo1f_d2.c -- LZO1F decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1f.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1f_decompress_safe
+
+#include "lzo1f_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1f_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1f_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1f_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_1.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_1.c
new file mode 100644
index 00000000..2bdecce0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_1.c
@@ -0,0 +1,55 @@
+/* lzo1x_1.c -- LZO1X-1 compression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+#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)
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1x_1_compress
+#endif
+
+#include "lzo1x_c.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_1k.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_1k.c
new file mode 100644
index 00000000..cbfa2344
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_1k.c
@@ -0,0 +1,55 @@
+/* lzo1x_1k.c -- LZO1X-1(11) compression (needs only 8kB work memory)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 11
+#endif
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,3,5)) >> 5)
+#define D_INDEX2(d,p) d = d ^ D_MASK
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1x_1_11_compress
+#endif
+
+#include "lzo1x_c.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_1l.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_1l.c
new file mode 100644
index 00000000..ee857bce
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_1l.c
@@ -0,0 +1,55 @@
+/* lzo1x_1l.c -- LZO1X-1(12) compression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 12
+#endif
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,4,5)) >> 5)
+#define D_INDEX2(d,p) d = d ^ D_MASK
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1x_1_12_compress
+#endif
+
+#include "lzo1x_c.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_1o.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_1o.c
new file mode 100644
index 00000000..28fdaffc
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_1o.c
@@ -0,0 +1,56 @@
+/* lzo1x_1o.c -- LZO1X-1(15) compression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#define D_BITS 13
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 15
+#endif
+#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)
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+#include "config1x.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1x_1_15_compress
+#endif
+
+#include "lzo1x_c.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_9x.c
new file mode 100644
index 00000000..9de75df0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_9x.c
@@ -0,0 +1,870 @@
+/* lzo1x_9x.c -- implementation of the LZO1X-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
+# define LZO1X 1
+#endif
+
+#if defined(LZO1X)
+# include "config1x.h"
+#elif defined(LZO1Y)
+# include "config1y.h"
+#elif defined(LZO1Z)
+# include "config1z.h"
+#else
+# error
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define SWD_N M4_MAX_OFFSET /* size of ring buffer */
+#define SWD_THRESHOLD 1 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
+
+#define SWD_BEST_OFF (LZO_MAX3( M2_MAX_LEN, M3_MAX_LEN, M4_MAX_LEN ) + 1)
+
+#if defined(LZO1X)
+# define LZO_COMPRESS_T lzo1x_999_t
+# define lzo_swd_t lzo1x_999_swd_t
+#elif defined(LZO1Y)
+# define LZO_COMPRESS_T lzo1y_999_t
+# define lzo_swd_t lzo1y_999_swd_t
+# define lzo1x_999_compress_internal lzo1y_999_compress_internal
+# define lzo1x_999_compress_dict lzo1y_999_compress_dict
+# define lzo1x_999_compress_level lzo1y_999_compress_level
+# define lzo1x_999_compress lzo1y_999_compress
+#elif defined(LZO1Z)
+# define LZO_COMPRESS_T lzo1z_999_t
+# define lzo_swd_t lzo1z_999_swd_t
+# define lzo1x_999_compress_internal lzo1z_999_compress_internal
+# define lzo1x_999_compress_dict lzo1z_999_compress_dict
+# define lzo1x_999_compress_level lzo1z_999_compress_level
+# define lzo1x_999_compress lzo1z_999_compress
+#else
+# error
+#endif
+
+#if 0
+# define HEAD3(b,p) \
+ ((((((lzo_xint)b[p]<<3)^b[p+1])<<3)^b[p+2]) & (SWD_HSIZE-1))
+#endif
+#if 0 && (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+# define HEAD3(b,p) \
+ (((* (lzo_uint32_tp) &b[p]) ^ ((* (lzo_uint32_tp) &b[p])>>10)) & (SWD_HSIZE-1))
+#endif
+
+#include "lzo_mchw.ch"
+
+
+/* this is a public functions, but there is no prototype in a header file */
+LZO_EXTERN(int)
+lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_callback_p cb,
+ int try_lazy_parm,
+ lzo_uint good_length,
+ lzo_uint max_lazy,
+ lzo_uint nice_length,
+ lzo_uint max_chain,
+ lzo_uint32_t flags );
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static lzo_bytep
+code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off )
+{
+ lzo_uint x_len = m_len;
+ lzo_uint x_off = m_off;
+
+ c->match_bytes += (unsigned long) m_len;
+
+#if 0
+/*
+ static lzo_uint last_m_len = 0, last_m_off = 0;
+ static lzo_uint prev_m_off[4];
+ static unsigned prev_m_off_ptr = 0;
+ unsigned i;
+
+ //if (m_len >= 3 && m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+ if (m_len >= 3 && m_len <= M2_MAX_LEN)
+ {
+ //if (m_len == last_m_len && m_off == last_m_off)
+ //printf("last_m_len + last_m_off\n");
+ //else
+ if (m_off == last_m_off)
+ printf("last_m_off\n");
+ else
+ {
+ for (i = 0; i < 4; i++)
+ if (m_off == prev_m_off[i])
+ printf("prev_m_off %u: %5ld\n",i,(long)m_off);
+ }
+ }
+ last_m_len = m_len;
+ last_m_off = prev_m_off[prev_m_off_ptr] = m_off;
+ prev_m_off_ptr = (prev_m_off_ptr + 1) & 3;
+*/
+#endif
+
+ assert(op > c->out);
+ if (m_len == 2)
+ {
+ assert(m_off <= M1_MAX_OFFSET);
+ assert(c->r1_lit > 0); assert(c->r1_lit < 4);
+ m_off -= 1;
+#if defined(LZO1Z)
+ *op++ = LZO_BYTE(M1_MARKER | (m_off >> 6));
+ *op++ = LZO_BYTE(m_off << 2);
+#else
+ *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+#endif
+ c->m1a_m++;
+ }
+#if defined(LZO1Z)
+ else if (m_len <= M2_MAX_LEN && (m_off <= M2_MAX_OFFSET || m_off == c->last_m_off))
+#else
+ else if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+#endif
+ {
+ assert(m_len >= 3);
+#if defined(LZO1X)
+ m_off -= 1;
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+ assert(op[-2] >= M2_MARKER);
+#elif defined(LZO1Y)
+ m_off -= 1;
+ *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+ assert(op[-2] >= M2_MARKER);
+#elif defined(LZO1Z)
+ if (m_off == c->last_m_off)
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | (0x700 >> 6));
+ else
+ {
+ m_off -= 1;
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | (m_off >> 6));
+ *op++ = LZO_BYTE(m_off << 2);
+ }
+#endif
+ c->m2_m++;
+ }
+ else if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && c->r1_lit >= 4)
+ {
+ assert(m_len == 3);
+ assert(m_off > M2_MAX_OFFSET);
+ m_off -= 1 + M2_MAX_OFFSET;
+#if defined(LZO1Z)
+ *op++ = LZO_BYTE(M1_MARKER | (m_off >> 6));
+ *op++ = LZO_BYTE(m_off << 2);
+#else
+ *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+#endif
+ c->m1b_m++;
+ }
+ else if (m_off <= M3_MAX_OFFSET)
+ {
+ assert(m_len >= 3);
+ m_off -= 1;
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= M3_MAX_LEN;
+ *op++ = M3_MARKER | 0;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+#if defined(LZO1Z)
+ *op++ = LZO_BYTE(m_off >> 6);
+ *op++ = LZO_BYTE(m_off << 2);
+#else
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+#endif
+ c->m3_m++;
+ }
+ else
+ {
+ lzo_uint k;
+
+ assert(m_len >= 3);
+ assert(m_off > 0x4000); assert(m_off <= 0xbfff);
+ m_off -= 0x4000;
+ k = (m_off & 0x4000) >> 11;
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER | k | (m_len - 2));
+ else
+ {
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | k | 0);
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+#if defined(LZO1Z)
+ *op++ = LZO_BYTE(m_off >> 6);
+ *op++ = LZO_BYTE(m_off << 2);
+#else
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+#endif
+ c->m4_m++;
+ }
+
+ c->last_m_len = x_len;
+ c->last_m_off = x_off;
+ return op;
+}
+
+
+static lzo_bytep
+STORE_RUN ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii, lzo_uint t )
+{
+ c->lit_bytes += (unsigned long) t;
+
+ if (op == c->out && t <= 238)
+ {
+ *op++ = LZO_BYTE(17 + t);
+ }
+ else if (t <= 3)
+ {
+#if defined(LZO1Z)
+ op[-1] = LZO_BYTE(op[-1] | t);
+#else
+ op[-2] = LZO_BYTE(op[-2] | t);
+#endif
+ c->lit1_r++;
+ }
+ else if (t <= 18)
+ {
+ *op++ = LZO_BYTE(t - 3);
+ c->lit2_r++;
+ }
+ else
+ {
+ lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ c->lit3_r++;
+ }
+ do *op++ = *ii++; while (--t > 0);
+
+ return op;
+}
+
+
+static lzo_bytep
+code_run ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii,
+ lzo_uint lit, lzo_uint m_len )
+{
+ if (lit > 0)
+ {
+ assert(m_len >= 2);
+ op = STORE_RUN(c,op,ii,lit);
+ c->r1_m_len = m_len;
+ c->r1_lit = lit;
+ }
+ else
+ {
+ assert(m_len >= 3);
+ c->r1_m_len = 0;
+ c->r1_lit = 0;
+ }
+
+ return op;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static lzo_uint
+len_of_coded_match ( lzo_uint m_len, lzo_uint m_off, lzo_uint lit )
+{
+ lzo_uint n = 4;
+
+ if (m_len < 2)
+ return 0;
+ if (m_len == 2)
+ return (m_off <= M1_MAX_OFFSET && lit > 0 && lit < 4) ? 2 : 0;
+ if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET)
+ return 2;
+ if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && lit >= 4)
+ return 2;
+ if (m_off <= M3_MAX_OFFSET)
+ {
+ if (m_len <= M3_MAX_LEN)
+ return 3;
+ m_len -= M3_MAX_LEN;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ n++;
+ }
+ return n;
+ }
+ if (m_off <= M4_MAX_OFFSET)
+ {
+ if (m_len <= M4_MAX_LEN)
+ return 3;
+ m_len -= M4_MAX_LEN;
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ n++;
+ }
+ return n;
+ }
+ return 0;
+}
+
+
+static lzo_uint
+min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, lzo_uint l1, lzo_uint l2, lzo_uint l3)
+{
+ lzo_uint lazy_match_min_gain;
+
+ assert (ahead >= 1);
+ lazy_match_min_gain = ahead;
+
+#if 0
+ if (l3)
+ lit2 -= ahead;
+#endif
+
+ if (lit1 <= 3)
+ lazy_match_min_gain += (lit2 <= 3) ? 0 : 2;
+ else if (lit1 <= 18)
+ lazy_match_min_gain += (lit2 <= 18) ? 0 : 1;
+
+ lazy_match_min_gain += (l2 - l1) * 2;
+ if (l3)
+ lazy_match_min_gain -= (ahead - l3) * 2;
+
+ if ((lzo_int) lazy_match_min_gain < 0)
+ lazy_match_min_gain = 0;
+
+#if 0
+ if (l1 == 2)
+ if (lazy_match_min_gain == 0)
+ lazy_match_min_gain = 1;
+#endif
+
+ return lazy_match_min_gain;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if !defined(NDEBUG)
+static
+void assert_match( const lzo_swd_p swd, lzo_uint m_len, lzo_uint m_off )
+{
+ const LZO_COMPRESS_T *c = swd->c;
+ lzo_uint d_off;
+
+ assert(m_len >= 2);
+ if (m_off <= (lzo_uint) (c->bp - c->in))
+ {
+ assert(c->bp - m_off + m_len < c->ip);
+ assert(lzo_memcmp(c->bp, c->bp - m_off, m_len) == 0);
+ }
+ else
+ {
+ assert(swd->dict != NULL);
+ d_off = m_off - (lzo_uint) (c->bp - c->in);
+ assert(d_off <= swd->dict_len);
+ if (m_len > d_off)
+ {
+ assert(lzo_memcmp(c->bp, swd->dict_end - d_off, d_off) == 0);
+ assert(c->in + m_len - d_off < c->ip);
+ assert(lzo_memcmp(c->bp + d_off, c->in, m_len - d_off) == 0);
+ }
+ else
+ {
+ assert(lzo_memcmp(c->bp, swd->dict_end - d_off, m_len) == 0);
+ }
+ }
+}
+#else
+# define assert_match(a,b,c) ((void)0)
+#endif
+
+
+#if defined(SWD_BEST_OFF)
+
+static void
+better_match ( const lzo_swd_p swd, lzo_uint *m_len, lzo_uint *m_off )
+{
+#if defined(LZO1Z)
+ const LZO_COMPRESS_T *c = swd->c;
+#endif
+
+ if (*m_len <= M2_MIN_LEN)
+ return;
+#if defined(LZO1Z)
+ if (*m_off == c->last_m_off && *m_len <= M2_MAX_LEN)
+ return;
+#if 1
+ if (*m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 &&
+ c->last_m_off && swd->best_off[*m_len-1] == c->last_m_off)
+ {
+ *m_len = *m_len - 1;
+ *m_off = swd->best_off[*m_len];
+ return;
+ }
+#endif
+#endif
+
+ if (*m_off <= M2_MAX_OFFSET)
+ return;
+
+#if 1
+ /* M3/M4 -> M2 */
+ if (*m_off > M2_MAX_OFFSET &&
+ *m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 &&
+ swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M2_MAX_OFFSET)
+ {
+ *m_len = *m_len - 1;
+ *m_off = swd->best_off[*m_len];
+ return;
+ }
+#endif
+
+#if 1
+ /* M4 -> M2 */
+ if (*m_off > M3_MAX_OFFSET &&
+ *m_len >= M4_MAX_LEN + 1 && *m_len <= M2_MAX_LEN + 2 &&
+ swd->best_off[*m_len-2] && swd->best_off[*m_len-2] <= M2_MAX_OFFSET)
+ {
+ *m_len = *m_len - 2;
+ *m_off = swd->best_off[*m_len];
+ return;
+ }
+#endif
+
+#if 1
+ /* M4 -> M3 */
+ if (*m_off > M3_MAX_OFFSET &&
+ *m_len >= M4_MAX_LEN + 1 && *m_len <= M3_MAX_LEN + 1 &&
+ swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M3_MAX_OFFSET)
+ {
+ *m_len = *m_len - 1;
+ *m_off = swd->best_off[*m_len];
+ }
+#endif
+}
+
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_callback_p cb,
+ int try_lazy_parm,
+ lzo_uint good_length,
+ lzo_uint max_lazy,
+ lzo_uint nice_length,
+ lzo_uint max_chain,
+ lzo_uint32_t flags )
+{
+ lzo_bytep op;
+ const lzo_bytep ii;
+ lzo_uint lit;
+ lzo_uint m_len, m_off;
+ LZO_COMPRESS_T cc;
+ LZO_COMPRESS_T * const c = &cc;
+ lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ lzo_uint try_lazy;
+ int r;
+
+ /* sanity check */
+#if defined(LZO1X)
+ LZO_COMPILE_TIME_ASSERT(LZO1X_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+#elif defined(LZO1Y)
+ LZO_COMPILE_TIME_ASSERT(LZO1Y_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+#elif defined(LZO1Z)
+ LZO_COMPILE_TIME_ASSERT(LZO1Z_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+#else
+# error
+#endif
+
+/* setup parameter defaults */
+ /* number of lazy match tries */
+ try_lazy = (lzo_uint) try_lazy_parm;
+ if (try_lazy_parm < 0)
+ try_lazy = 1;
+ /* reduce lazy match search if we already have a match with this length */
+ if (good_length == 0)
+ good_length = 32;
+ /* do not try a lazy match if we already have a match with this length */
+ if (max_lazy == 0)
+ max_lazy = 32;
+ /* stop searching for longer matches than this one */
+ if (nice_length == 0)
+ nice_length = 0;
+ /* don't search more positions than this */
+ if (max_chain == 0)
+ max_chain = SWD_MAX_CHAIN;
+
+ c->init = 0;
+ c->ip = c->in = in;
+ c->in_end = in + in_len;
+ c->out = out;
+ c->cb = cb;
+ c->m1a_m = c->m1b_m = c->m2_m = c->m3_m = c->m4_m = 0;
+ c->lit1_r = c->lit2_r = c->lit3_r = 0;
+
+ op = out;
+ ii = c->ip; /* point to start of literal run */
+ lit = 0;
+ c->r1_lit = c->r1_m_len = 0;
+
+ r = init_match(c,swd,dict,dict_len,flags);
+ if (r != 0)
+ return r;
+ if (max_chain > 0)
+ swd->max_chain = max_chain;
+ if (nice_length > 0)
+ swd->nice_length = nice_length;
+
+ r = find_match(c,swd,0,0);
+ if (r != 0)
+ return r;
+ while (c->look > 0)
+ {
+ lzo_uint ahead;
+ lzo_uint max_ahead;
+ lzo_uint l1, l2, l3;
+
+ c->codesize = pd(op, out);
+
+ m_len = c->m_len;
+ m_off = c->m_off;
+
+ assert(c->bp == c->ip - c->look);
+ assert(c->bp >= in);
+ if (lit == 0)
+ ii = c->bp;
+ assert(ii + lit == c->bp);
+ assert(swd->b_char == *(c->bp));
+
+ if ( m_len < 2 ||
+ (m_len == 2 && (m_off > M1_MAX_OFFSET || lit == 0 || lit >= 4)) ||
+#if 1
+ /* Do not accept this match for compressed-data compatibility
+ * with LZO v1.01 and before
+ * [ might be a problem for decompress() and optimize() ]
+ */
+ (m_len == 2 && op == out) ||
+#endif
+ (op == out && lit == 0))
+ {
+ /* a literal */
+ m_len = 0;
+ }
+ else if (m_len == M2_MIN_LEN)
+ {
+ /* compression ratio improves if we code a literal in some cases */
+ if (m_off > MX_MAX_OFFSET && lit >= 4)
+ m_len = 0;
+ }
+
+ if (m_len == 0)
+ {
+ /* a literal */
+ lit++;
+ swd->max_chain = max_chain;
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ continue;
+ }
+
+ /* a match */
+#if defined(SWD_BEST_OFF)
+ if (swd->use_best_off)
+ better_match(swd,&m_len,&m_off);
+#endif
+ assert_match(swd,m_len,m_off);
+
+
+ /* shall we try a lazy match ? */
+ ahead = 0;
+ if (try_lazy == 0 || m_len >= max_lazy)
+ {
+ /* no */
+ l1 = 0;
+ max_ahead = 0;
+ }
+ else
+ {
+ /* yes, try a lazy match */
+ l1 = len_of_coded_match(m_len,m_off,lit);
+ assert(l1 > 0);
+#if 1
+ max_ahead = LZO_MIN(try_lazy, l1 - 1);
+#else
+ max_ahead = LZO_MIN3(try_lazy, l1, m_len - 1);
+#endif
+ }
+
+
+ while (ahead < max_ahead && c->look > m_len)
+ {
+ lzo_uint lazy_match_min_gain;
+
+ if (m_len >= good_length)
+ swd->max_chain = max_chain >> 2;
+ else
+ swd->max_chain = max_chain;
+ r = find_match(c,swd,1,0);
+ ahead++;
+
+ assert(r == 0); LZO_UNUSED(r);
+ assert(c->look > 0);
+ assert(ii + lit + ahead == c->bp);
+
+#if defined(LZO1Z)
+ if (m_off == c->last_m_off && c->m_off != c->last_m_off)
+ if (m_len >= M2_MIN_LEN && m_len <= M2_MAX_LEN)
+ c->m_len = 0;
+#endif
+ if (c->m_len < m_len)
+ continue;
+#if 1
+ if (c->m_len == m_len && c->m_off >= m_off)
+ continue;
+#endif
+#if defined(SWD_BEST_OFF)
+ if (swd->use_best_off)
+ better_match(swd,&c->m_len,&c->m_off);
+#endif
+ l2 = len_of_coded_match(c->m_len,c->m_off,lit+ahead);
+ if (l2 == 0)
+ continue;
+#if 0
+ if (c->m_len == m_len && l2 >= l1)
+ continue;
+#endif
+
+
+#if 1
+ /* compressed-data compatibility [see above] */
+ l3 = (op == out) ? 0 : len_of_coded_match(ahead,m_off,lit);
+#else
+ l3 = len_of_coded_match(ahead,m_off,lit);
+#endif
+
+ lazy_match_min_gain = min_gain(ahead,lit,lit+ahead,l1,l2,l3);
+ if (c->m_len >= m_len + lazy_match_min_gain)
+ {
+ c->lazy++;
+ assert_match(swd,c->m_len,c->m_off);
+
+ if (l3)
+ {
+ /* code previous run */
+ op = code_run(c,op,ii,lit,ahead);
+ lit = 0;
+ /* code shortened match */
+ op = code_match(c,op,ahead,m_off);
+ }
+ else
+ {
+ lit += ahead;
+ assert(ii + lit == c->bp);
+ }
+ goto lazy_match_done;
+ }
+ }
+
+
+ assert(ii + lit + ahead == c->bp);
+
+ /* 1 - code run */
+ op = code_run(c,op,ii,lit,m_len);
+ lit = 0;
+
+ /* 2 - code match */
+ op = code_match(c,op,m_len,m_off);
+ swd->max_chain = max_chain;
+ r = find_match(c,swd,m_len,1+ahead);
+ assert(r == 0); LZO_UNUSED(r);
+
+lazy_match_done: ;
+ }
+
+
+ /* store final run */
+ if (lit > 0)
+ op = STORE_RUN(c,op,ii,lit);
+
+#if defined(LZO_EOF_CODE)
+ *op++ = M4_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+#endif
+
+ c->codesize = pd(op, out);
+ assert(c->textsize == in_len);
+
+ *out_len = pd(op, out);
+
+ if (c->cb && c->cb->nprogress)
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+
+#if 0
+ printf("%ld %ld -> %ld %ld: %ld %ld %ld %ld %ld %ld: %ld %ld %ld %ld\n",
+ (long) c->textsize, (long) in_len, (long) c->codesize,
+ c->match_bytes, c->m1a_m, c->m1b_m, c->m2_m, c->m3_m, c->m4_m,
+ c->lit_bytes, c->lit1_r, c->lit2_r, c->lit3_r, c->lazy);
+#endif
+ assert(c->lit_bytes + c->match_bytes == in_len);
+
+ return LZO_E_OK;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_callback_p cb,
+ int compression_level )
+{
+ static const struct
+ {
+ int try_lazy_parm;
+ lzo_uint good_length;
+ lzo_uint max_lazy;
+ lzo_uint nice_length;
+ lzo_uint max_chain;
+ lzo_uint32_t flags;
+ } c[9] = {
+ /* faster compression */
+ { 0, 0, 0, 8, 4, 0 },
+ { 0, 0, 0, 16, 8, 0 },
+ { 0, 0, 0, 32, 16, 0 },
+ { 1, 4, 4, 16, 16, 0 },
+ { 1, 8, 16, 32, 32, 0 },
+ { 1, 8, 16, 128, 128, 0 },
+ { 2, 8, 32, 128, 256, 0 },
+ { 2, 32, 128, SWD_F, 2048, 1 },
+ { 2, SWD_F, SWD_F, SWD_F, 4096, 1 }
+ /* max. compression */
+ };
+
+ if (compression_level < 1 || compression_level > 9)
+ return LZO_E_ERROR;
+
+ compression_level -= 1;
+ return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem,
+ dict, dict_len, cb,
+ c[compression_level].try_lazy_parm,
+ c[compression_level].good_length,
+ c[compression_level].max_lazy,
+#if 0
+ c[compression_level].nice_length,
+#else
+ 0,
+#endif
+ c[compression_level].max_chain,
+ c[compression_level].flags);
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo1x_999_compress_dict ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len )
+{
+ return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem,
+ dict, dict_len, 0, 8);
+}
+
+LZO_PUBLIC(int)
+lzo1x_999_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem,
+ NULL, 0, (lzo_callback_p) 0, 8);
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_c.ch b/ics-openvpn-stripped/main/lzo/src/lzo1x_c.ch
new file mode 100644
index 00000000..805f71d3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_c.ch
@@ -0,0 +1,405 @@
+/* lzo1x_c.ch -- implementation of the LZO1[XY]-1 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+#if 1 && defined(DO_COMPRESS) && !defined(do_compress)
+ /* choose a unique name to better help PGO optimizations */
+# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core)
+#endif
+
+
+/***********************************************************************
+// compress a block of data.
+************************************************************************/
+
+static __lzo_noinline lzo_uint
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_uint ti, lzo_voidp wrkmem)
+{
+ 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 - 20;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+ op = out;
+ ip = in;
+ ii = ip;
+
+ ip += ti < 4 ? 4 - ti : 0;
+ for (;;)
+ {
+ const lzo_bytep m_pos;
+#if !(LZO_DETERMINISTIC)
+ LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0);
+ lzo_uint m_len;
+ lzo_uint dindex;
+next:
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ 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 (LZO_OPT_UNALIGNED32)
+ if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip))
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3])
+#endif
+ {
+ /* a literal */
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ ip += 1 + ((ip - ii) >> 5);
+ continue;
+ }
+/*match:*/
+ UPDATE_I(dict,0,dindex,ip,in);
+#else
+ lzo_uint m_off;
+ lzo_uint m_len;
+ {
+ lzo_uint32_t dv;
+ lzo_uint dindex;
+literal:
+ ip += 1 + ((ip - ii) >> 5);
+next:
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ dv = UA_GET_LE32(ip);
+ dindex = DINDEX(dv,ip);
+ GINDEX(m_off,m_pos,in+dict,dindex,in);
+ UPDATE_I(dict,0,dindex,ip,in);
+ if __lzo_unlikely(dv != UA_GET_LE32(m_pos))
+ goto literal;
+ }
+#endif
+
+ /* a match */
+
+ ii -= ti; ti = 0;
+ {
+ lzo_uint t = pd(ip,ii);
+ if (t != 0)
+ {
+ if (t <= 3)
+ {
+ op[-2] = LZO_BYTE(op[-2] | t);
+#if (LZO_OPT_UNALIGNED32)
+ UA_COPY4(op, ii);
+ op += t;
+#else
+ { do *op++ = *ii++; while (--t > 0); }
+#endif
+ }
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
+ else if (t <= 16)
+ {
+ *op++ = LZO_BYTE(t - 3);
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
+ op += t;
+ }
+#endif
+ else
+ {
+ if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+ *op++ = 0;
+ while __lzo_unlikely(tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64)
+ do {
+ UA_COPY8(op, ii);
+ UA_COPY8(op+8, ii+8);
+ op += 16; ii += 16; t -= 16;
+ } while (t >= 16); if (t > 0)
+#endif
+ { do *op++ = *ii++; while (--t > 0); }
+ }
+ }
+ }
+ m_len = 4;
+ {
+#if (LZO_OPT_UNALIGNED64)
+ lzo_uint64_t v;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 8;
+ v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64)
+ m_len += lzo_bitops_ctlz64(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (64 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (64 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64)
+ m_len += lzo_bitops_cttz64(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
+#endif
+#elif (LZO_OPT_UNALIGNED32)
+ lzo_uint32_t v;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if __lzo_unlikely(v == 0) {
+ do {
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if (v != 0)
+ break;
+ m_len += 4;
+ v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len);
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (v == 0);
+ }
+#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32)
+ m_len += lzo_bitops_ctlz32(v) / CHAR_BIT;
+#elif (LZO_ABI_BIG_ENDIAN)
+ if ((v >> (32 - CHAR_BIT)) == 0) do {
+ v <<= CHAR_BIT;
+ m_len += 1;
+ } while ((v >> (32 - CHAR_BIT)) == 0);
+#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32)
+ m_len += lzo_bitops_cttz32(v) / CHAR_BIT;
+#elif (LZO_ABI_LITTLE_ENDIAN)
+ if ((v & UCHAR_MAX) == 0) do {
+ v >>= CHAR_BIT;
+ m_len += 1;
+ } while ((v & UCHAR_MAX) == 0);
+#else
+ if (ip[m_len] == m_pos[m_len]) do {
+ m_len += 1;
+ } while (ip[m_len] == m_pos[m_len]);
+#endif
+#else
+ if __lzo_unlikely(ip[m_len] == m_pos[m_len]) {
+ do {
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if (ip[m_len] != m_pos[m_len])
+ break;
+ m_len += 1;
+ if __lzo_unlikely(ip + m_len >= ip_end)
+ goto m_len_done;
+ } while (ip[m_len] == m_pos[m_len]);
+ }
+#endif
+ }
+m_len_done:
+ m_off = pd(ip,m_pos);
+ ip += m_len;
+ ii = ip;
+ if (m_len <= M2_MAX_LEN && 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;
+ if (m_len <= M3_MAX_LEN)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= M3_MAX_LEN;
+ *op++ = M3_MARKER | 0;
+ while __lzo_unlikely(m_len > 255)
+ {
+ m_len -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+ else
+ {
+ m_off -= 0x4000;
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2));
+ else
+ {
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8));
+ while __lzo_unlikely(m_len > 255)
+ {
+ m_len -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ *op++ = LZO_BYTE(m_len);
+ }
+ *op++ = LZO_BYTE(m_off << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+ goto next;
+ }
+
+ *out_len = pd(op, out);
+ return pd(in_end,ii-ti);
+}
+
+
+/***********************************************************************
+// public entry point
+************************************************************************/
+
+LZO_PUBLIC(int)
+DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ const lzo_bytep ip = in;
+ lzo_bytep op = out;
+ lzo_uint l = in_len;
+ lzo_uint t = 0;
+
+ while (l > 20)
+ {
+ lzo_uint ll = l;
+ lzo_uintptr_t ll_end;
+#if 0 || (LZO_DETERMINISTIC)
+ ll = LZO_MIN(ll, 49152);
+#endif
+ ll_end = (lzo_uintptr_t)ip + ll;
+ if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll)
+ break;
+#if (LZO_DETERMINISTIC)
+ lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t));
+#endif
+ t = do_compress(ip,ll,op,out_len,t,wrkmem);
+ ip += ll;
+ op += *out_len;
+ l -= ll;
+ }
+ t += l;
+
+ 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(op[-2] | t);
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ UA_SET1(op, 0);
+ op++;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ UA_COPYN(op, ii, t);
+ op += t;
+ }
+
+ *op++ = M4_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+
+ *out_len = pd(op, out);
+ return LZO_E_OK;
+}
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_d.ch b/ics-openvpn-stripped/main/lzo/src/lzo1x_d.ch
new file mode 100644
index 00000000..aa0a8e08
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_d.ch
@@ -0,0 +1,478 @@
+/* lzo1x_d.ch -- implementation of the LZO1X decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo1_d.ch"
+
+
+/***********************************************************************
+// decompress a block of data.
+************************************************************************/
+
+#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
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ 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 /* COPY_DICT */
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ NEED_IP(1);
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+3);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ for (;;)
+ {
+ NEED_IP(3);
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ /* a literal run */
+ if (t == 0)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_IV(t);
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ /* copy literals */
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+6);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ t += 3;
+ if (t >= 8) do
+ {
+ UA_COPY8(op,ip);
+ op += 8; ip += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+ }
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ UA_COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ UA_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 !(LZO_OPT_UNALIGNED32)
+ }
+ else
+#endif
+#endif
+#if !(LZO_OPT_UNALIGNED32)
+ {
+ *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 /* !COPY_DICT */
+#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 /* COPY_DICT */
+ goto match_done;
+
+
+ /* handle matches */
+ for (;;) {
+match:
+ if (t >= 64) /* a M2 match */
+ {
+#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 /* !COPY_DICT */
+#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 /* COPY_DICT */
+ }
+ else if (t >= 32) /* a M3 match */
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ NEED_IP(2);
+ }
+#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 /* !COPY_DICT */
+#if defined(LZO1Z)
+ {
+ lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= UA_GET_LE16(ip) >> 2;
+#else
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#endif /* COPY_DICT */
+ ip += 2;
+ }
+ else if (t >= 16) /* a M4 match */
+ {
+#if defined(COPY_DICT)
+ m_off = (t & 8) << 11;
+#else /* !COPY_DICT */
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif /* COPY_DICT */
+ t &= 7;
+ if (t == 0)
+ {
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ NEED_IP(2);
+ }
+#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 /* !COPY_DICT */
+#if defined(LZO1Z)
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= UA_GET_LE16(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 /* COPY_DICT */
+ }
+ else /* a M1 match */
+ {
+#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 /* !COPY_DICT */
+#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 /* COPY_DICT */
+ goto match_done;
+ }
+
+ /* copy match */
+#if defined(COPY_DICT)
+
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t,m_off)
+
+#else /* !COPY_DICT */
+
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32)
+ if (op - m_pos >= 8)
+ {
+ t += (3 - 1);
+ if (t >= 8) do
+ {
+ UA_COPY8(op,m_pos);
+ op += 8; m_pos += 8; t -= 8;
+ } while (t >= 8);
+ if (t >= 4)
+ {
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ }
+ if (t > 0)
+ {
+ *op++ = m_pos[0];
+ if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } }
+ }
+ }
+ else
+#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4)
+#if !(LZO_OPT_UNALIGNED32)
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
+ {
+ assert((op - m_pos) >= 4); /* both pointers are aligned */
+#else
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ UA_COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ UA_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 /* COPY_DICT */
+
+match_done:
+#if defined(LZO1Z)
+ t = ip[-1] & 3;
+#else
+ t = ip[-2] & 3;
+#endif
+ if (t == 0)
+ break;
+
+ /* copy literals */
+match_next:
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ }
+ }
+
+eof_found:
+ *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
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_d1.c
new file mode 100644
index 00000000..2342afdb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_d1.c
@@ -0,0 +1,34 @@
+/* lzo1x_d1.c -- LZO1X decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1x.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1x_decompress
+
+#include "lzo1x_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_d2.c
new file mode 100644
index 00000000..477522cb
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_d2.c
@@ -0,0 +1,59 @@
+/* lzo1x_d2.c -- LZO1X decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1x.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1x_decompress_safe
+
+#include "lzo1x_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1x_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1x_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+LZO_EXTERN(int) lzo1x_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1x_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1x_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_d3.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_d3.c
new file mode 100644
index 00000000..8da06923
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_d3.c
@@ -0,0 +1,96 @@
+/* lzo1x_d3.c -- LZO1X decompression with preset dictionary
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1x.h"
+
+#define LZO_TEST_OVERRUN 1
+
+
+#define SLOW_MEMCPY(a,b,l) { do *a++ = *b++; while (--l > 0); }
+#define FAST_MEMCPY(a,b,l) { lzo_memcpy(a,b,l); a += l; }
+
+#if 1 && defined(FAST_MEMCPY)
+# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \
+ if (m_off >= (m_len)) \
+ FAST_MEMCPY(op,m_pos,m_len) \
+ else \
+ SLOW_MEMCPY(op,m_pos,m_len)
+#else
+# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \
+ SLOW_MEMCPY(op,m_pos,m_len)
+#endif
+
+#if !defined(FAST_MEMCPY)
+# define FAST_MEMCPY SLOW_MEMCPY
+#endif
+
+
+#define COPY_DICT_DICT(m_len,m_off) \
+ { \
+ const lzo_bytep m_pos; \
+ m_off -= pd(op, out); assert(m_off > 0); \
+ if (m_off > dict_len) goto lookbehind_overrun; \
+ m_pos = dict_end - m_off; \
+ if (m_len > m_off) \
+ { \
+ m_len -= m_off; \
+ FAST_MEMCPY(op,m_pos,m_off) \
+ m_pos = out; \
+ SLOW_MEMCPY(op,m_pos,m_len) \
+ } \
+ else \
+ FAST_MEMCPY(op,m_pos,m_len) \
+ }
+
+#define COPY_DICT(m_len,m_off) \
+ assert(m_len >= 2); assert(m_off > 0); assert(op > out); \
+ if (m_off <= pd(op, out)) \
+ { \
+ const lzo_bytep m_pos = op - m_off; \
+ DICT_MEMMOVE(op,m_pos,m_len,m_off) \
+ } \
+ else \
+ COPY_DICT_DICT(m_len,m_off)
+
+
+
+
+LZO_PUBLIC(int)
+lzo1x_decompress_dict_safe ( const lzo_bytep in, lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem /* NOT USED */,
+ const lzo_bytep dict, lzo_uint dict_len)
+
+
+#include "lzo1x_d.ch"
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_o.c b/ics-openvpn-stripped/main/lzo/src/lzo1x_o.c
new file mode 100644
index 00000000..5b3dbafd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_o.c
@@ -0,0 +1,33 @@
+/* lzo1x_o.c -- LZO1X compressed data optimizer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1x.h"
+
+#define DO_OPTIMIZE lzo1x_optimize
+
+#include "lzo1x_oo.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1x_oo.ch b/ics-openvpn-stripped/main/lzo/src/lzo1x_oo.ch
new file mode 100644
index 00000000..ebb406ff
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1x_oo.ch
@@ -0,0 +1,355 @@
+/* lzo1x_oo.ch -- LZO1X compressed data optimizer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define TEST_IP (ip < ip_end)
+#define TEST_OP (op <= op_end)
+#define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP)
+
+#define NO_LIT LZO_UINT_MAX
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static void copy2(lzo_bytep ip, const lzo_bytep m_pos, lzo_uint off)
+{
+ assert(off > 0);
+ ip[0] = m_pos[0];
+ if (off == 1)
+ ip[1] = m_pos[0];
+ else
+ ip[1] = m_pos[1];
+}
+
+
+static void copy3(lzo_bytep ip, const lzo_bytep m_pos, lzo_uint off)
+{
+ assert(off > 0);
+ ip[0] = m_pos[0];
+ if (off == 1)
+ {
+ ip[2] = ip[1] = m_pos[0];
+ }
+ else if (off == 2)
+ {
+ ip[1] = m_pos[1];
+ ip[2] = m_pos[0];
+ }
+ else
+ {
+ ip[1] = m_pos[1];
+ ip[2] = m_pos[2];
+ }
+}
+
+
+/***********************************************************************
+// optimize a block of data.
+************************************************************************/
+
+LZO_PUBLIC(int)
+DO_OPTIMIZE ( lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ lzo_bytep ip;
+ lzo_uint t;
+ lzo_bytep m_pos;
+ lzo_bytep const ip_end = in + in_len;
+ lzo_bytep const op_end = out + *out_len;
+ lzo_bytep litp = NULL;
+ lzo_uint lit = 0;
+ lzo_uint next_lit = NO_LIT;
+ lzo_uint nl;
+ unsigned long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0;
+
+ LZO_UNUSED(wrkmem);
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ assert(in_len >= 3);
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ goto first_literal_run;
+ }
+ assert(*ip < 16 || (*ip == 17 && in_len == 3));
+
+ while (TEST_IP_AND_TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ /* a literal run */
+ litp = ip - 1;
+ if (t == 0)
+ {
+ t = 15;
+ while (*ip == 0)
+ t += 255, ip++;
+ t += *ip++;
+ }
+ lit = t + 3;
+ /* copy literals */
+copy_literal_run:
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+first_literal_run:
+ do *op++ = *ip++; while (--t > 0);
+
+
+ t = *ip++;
+
+ if (t >= 16)
+ goto match;
+#if defined(LZO1X)
+ m_pos = op - 1 - 0x800;
+#elif defined(LZO1Y)
+ m_pos = op - 1 - 0x400;
+#endif
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
+ lit = 0;
+ goto match_done;
+
+
+ /* handle matches */
+ do {
+ if (t < 16) /* a M1 match */
+ {
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+
+ if (litp == NULL)
+ goto copy_m1;
+
+ /* assert that there was a match just before */
+ assert(lit >= 1 && lit <= 3);
+ assert(litp == ip - 2 - lit - 2);
+ assert((lzo_uint)(*litp & 3) == lit);
+ nl = ip[-2] & 3;
+ /* test if a match follows */
+ if (nl == 0 && lit == 1 && ip[0] >= 16)
+ {
+ next_lit = nl;
+ /* adjust length of previous short run */
+ lit += 2;
+ *litp = LZO_BYTE((*litp & ~3) | lit);
+ /* copy over the 2 literals that replace the match */
+ copy2(ip-2,m_pos,pd(op,m_pos));
+ o_m1_a++;
+ }
+ /* test if a literal run follows */
+ else if (nl == 0 && ip[0] < 16 && ip[0] != 0 &&
+ (lit + 2 + ip[0] < 16))
+ {
+ t = *ip++;
+ /* remove short run */
+ *litp &= ~3;
+ /* copy over the 2 literals that replace the match */
+ copy2(ip-3+1,m_pos,pd(op,m_pos));
+ /* move literals 1 byte ahead */
+ litp += 2;
+ if (lit > 0)
+ lzo_memmove(litp+1,litp,lit);
+ /* insert new length of long literal run */
+ lit += 2 + t + 3; assert(lit <= 18);
+ *litp = LZO_BYTE(lit - 3);
+
+ o_m1_b++;
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ goto copy_literal_run;
+ }
+copy_m1:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ }
+ else
+ {
+match:
+ if (t >= 64) /* a M2 match */
+ {
+ m_pos = op - 1;
+#if defined(LZO1X)
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
+#endif
+ if (litp == NULL)
+ goto copy_m;
+
+ nl = ip[-2] & 3;
+ /* test if in beetween two long literal runs */
+ if (t == 1 && lit > 3 && nl == 0 &&
+ ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16))
+ {
+ assert(*litp == lit - 3);
+ t = *ip++;
+ /* copy over the 3 literals that replace the match */
+ copy3(ip-1-2,m_pos,pd(op,m_pos));
+ /* set new length of previous literal run */
+ lit += 3 + t + 3; assert(lit <= 18);
+ *litp = LZO_BYTE(lit - 3);
+ o_m2++;
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
+ goto copy_literal_run;
+ }
+ }
+ else
+ {
+ if (t >= 32) /* a M3 match */
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ t = 31;
+ while (*ip == 0)
+ t += 255, ip++;
+ t += *ip++;
+ }
+ m_pos = op - 1;
+ m_pos -= *ip++ >> 2;
+ m_pos -= *ip++ << 6;
+ }
+ else /* a M4 match */
+ {
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+ t &= 7;
+ if (t == 0)
+ {
+ t = 7;
+ while (*ip == 0)
+ t += 255, ip++;
+ t += *ip++;
+ }
+ m_pos -= *ip++ >> 2;
+ m_pos -= *ip++ << 6;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
+ }
+ if (litp == NULL)
+ goto copy_m;
+
+ nl = ip[-2] & 3;
+ /* test if in beetween two matches */
+ if (t == 1 && lit == 0 && nl == 0 && ip[0] >= 16)
+ {
+ assert(litp == ip - 3 - lit - 2);
+ assert((lzo_uint)(*litp & 3) == lit);
+ next_lit = nl;
+ /* make a previous short run */
+ lit += 3;
+ *litp = LZO_BYTE((*litp & ~3) | lit);
+ /* copy over the 3 literals that replace the match */
+ copy3(ip-3,m_pos,pd(op,m_pos));
+ o_m3_a++;
+ }
+ /* test if a literal run follows */
+ else if (t == 1 && lit <= 3 && nl == 0 &&
+ ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16))
+ {
+ assert(litp == ip - 3 - lit - 2);
+ assert((lzo_uint)(*litp & 3) == lit);
+ t = *ip++;
+ /* remove short run */
+ *litp &= ~3;
+ /* copy over the 3 literals that replace the match */
+ copy3(ip-4+1,m_pos,pd(op,m_pos));
+ /* move literals 1 byte ahead */
+ litp += 2;
+ if (lit > 0)
+ lzo_memmove(litp+1,litp,lit);
+ /* insert new length of long literal run */
+ lit += 3 + t + 3; assert(lit <= 18);
+ *litp = LZO_BYTE(lit - 3);
+
+ o_m3_b++;
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++;
+ goto copy_literal_run;
+ }
+ }
+copy_m:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
+
+match_done:
+ if (next_lit == NO_LIT)
+ {
+ t = ip[-2] & 3;
+ lit = t;
+ litp = ip - 2;
+ }
+ else
+ t = next_lit;
+ assert(t <= 3);
+ next_lit = NO_LIT;
+ if (t == 0)
+ break;
+ /* copy literals */
+match_next:
+ do *op++ = *ip++; while (--t > 0);
+ t = *ip++;
+ } while (TEST_IP_AND_TEST_OP);
+ }
+
+ /* no EOF code was found */
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+
+eof_found:
+ assert(t == 1);
+#if 0
+ printf("optimize: %5lu %5lu %5lu %5lu %5lu\n",
+ o_m1_a, o_m1_b, o_m2, o_m3_a, o_m3_b);
+#endif
+ LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2);
+ LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_1.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_1.c
new file mode 100644
index 00000000..dfa4487a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_1.c
@@ -0,0 +1,55 @@
+/* lzo1y_1.c -- LZO1Y-1 compression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+#if 1 && defined(UA_GET_LE32)
+#undef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 0
+#undef lzo_dict_t
+#define lzo_dict_t lzo_uint16_t
+#endif
+
+#define LZO_NEED_DICT_H 1
+#ifndef D_BITS
+#define D_BITS 14
+#endif
+#define D_INDEX1(d,p) d = DX3(p,5,5,6); d += d >> 5; d = DM(d)
+#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
+#if 1
+#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS)))
+#else
+#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS)))
+#endif
+#include "config1y.h"
+#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR)
+
+#ifndef DO_COMPRESS
+#define DO_COMPRESS lzo1y_1_compress
+#endif
+
+#include "lzo1x_c.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_9x.c
new file mode 100644
index 00000000..464d849e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_9x.c
@@ -0,0 +1,30 @@
+/* lzo1y_9x.c -- implementation of the LZO1Y-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO1Y 1
+#include "lzo1x_9x.c"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_d1.c
new file mode 100644
index 00000000..e10877e7
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_d1.c
@@ -0,0 +1,34 @@
+/* lzo1y_d1.c -- LZO1Y decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1y.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1y_decompress
+
+#include "lzo1x_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_d2.c
new file mode 100644
index 00000000..0aeeec6e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_d2.c
@@ -0,0 +1,59 @@
+/* lzo1y_d2.c -- LZO1Y decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1y.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1y_decompress_safe
+
+#include "lzo1x_d.ch"
+
+#if defined(LZO_ARCH_I386) && defined(LZO_USE_ASM)
+LZO_EXTERN(int) lzo1y_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1y_decompress_asm_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem);
+LZO_PUBLIC(int) lzo1y_decompress_asm_fast_safe
+ (const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem)
+{
+ return lzo1y_decompress_safe(src, src_len, dst, dst_len, wrkmem);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_d3.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_d3.c
new file mode 100644
index 00000000..494a5f52
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_d3.c
@@ -0,0 +1,33 @@
+/* lzo1y_d3.c -- LZO1Y decompression with preset dictionary
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1y.h"
+
+#define lzo1x_decompress_dict_safe lzo1y_decompress_dict_safe
+
+#include "lzo1x_d3.c"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1y_o.c b/ics-openvpn-stripped/main/lzo/src/lzo1y_o.c
new file mode 100644
index 00000000..27abd469
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1y_o.c
@@ -0,0 +1,33 @@
+/* lzo1y_o.c -- LZO1Y compressed data optimizer
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1y.h"
+
+#define DO_OPTIMIZE lzo1y_optimize
+
+#include "lzo1x_oo.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1z_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo1z_9x.c
new file mode 100644
index 00000000..579b161a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1z_9x.c
@@ -0,0 +1,30 @@
+/* lzo1z_9x.c -- implementation of the LZO1Z-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#define LZO1Z 1
+#include "lzo1x_9x.c"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1z_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo1z_d1.c
new file mode 100644
index 00000000..81cc02ac
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1z_d1.c
@@ -0,0 +1,34 @@
+/* lzo1z_d1.c -- LZO1Z decompression
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1z.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo1z_decompress
+
+#include "lzo1x_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1z_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo1z_d2.c
new file mode 100644
index 00000000..2a132e61
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1z_d2.c
@@ -0,0 +1,34 @@
+/* lzo1z_d2.c -- LZO1Z decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1z.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo1z_decompress_safe
+
+#include "lzo1x_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo1z_d3.c b/ics-openvpn-stripped/main/lzo/src/lzo1z_d3.c
new file mode 100644
index 00000000..d82dc324
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo1z_d3.c
@@ -0,0 +1,33 @@
+/* lzo1z_d3.c -- LZO1Z decompression with preset dictionary
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config1z.h"
+
+#define lzo1x_decompress_dict_safe lzo1z_decompress_dict_safe
+
+#include "lzo1x_d3.c"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo2a_9x.c b/ics-openvpn-stripped/main/lzo/src/lzo2a_9x.c
new file mode 100644
index 00000000..2fec38c2
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo2a_9x.c
@@ -0,0 +1,349 @@
+/* lzo2a_9x.c -- implementation of the LZO2A-999 compression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+
+#include "config2a.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define SWD_THRESHOLD 1 /* lower limit for match length */
+#define SWD_F 2048 /* upper limit for match length */
+
+
+#define LZO2A 1
+#define LZO_COMPRESS_T lzo2a_999_t
+#define lzo_swd_t lzo2a_999_swd_t
+#include "lzo_mchw.ch"
+
+
+#if (LZO_CC_BORLANDC && LZO_MM_FLAT)
+# if ((__BORLANDC__) >= 0x0450 && (__BORLANDC__) < 0x0460)
+ /* avoid internal compiler error */
+# pragma option -Od
+# endif
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#define putbyte(x) *op++ = LZO_BYTE(x)
+
+#define putbits(j,x) \
+ if (k == 0) bitp = op++; \
+ SETBITS(j,x); \
+ if (k >= 8) { *bitp = LZO_BYTE(MASKBITS(8)); DUMPBITS(8); \
+ if (k > 0) bitp = op++; }
+
+#define putbit(x) putbits(1,x)
+
+
+/***********************************************************************
+// this is a public function, but there is no prototype in a header file
+************************************************************************/
+
+LZO_EXTERN(int)
+lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain );
+
+LZO_PUBLIC(int)
+lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem,
+ lzo_callback_p cb,
+ lzo_uint max_chain )
+{
+ lzo_bytep op;
+ lzo_bytep bitp = 0;
+ lzo_uint m_len, m_off;
+ LZO_COMPRESS_T cc;
+ LZO_COMPRESS_T * const c = &cc;
+ lzo_swd_p const swd = (lzo_swd_p) wrkmem;
+ int r;
+
+ lzo_uint32_t b = 0; /* bit buffer */
+ unsigned k = 0; /* bits in bit buffer */
+
+ /* sanity check */
+ LZO_COMPILE_TIME_ASSERT(LZO2A_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T)
+
+ c->init = 0;
+ c->ip = c->in = in;
+ c->in_end = in + in_len;
+ c->cb = cb;
+ c->m1 = c->m2 = c->m3 = c->m4 = 0;
+
+ op = out;
+
+ r = init_match(c,swd,NULL,0,0);
+ if (r != 0)
+ return r;
+ if (max_chain > 0)
+ swd->max_chain = max_chain;
+
+ r = find_match(c,swd,0,0);
+ if (r != 0)
+ return r;
+ while (c->look > 0)
+ {
+ lzo_uint lazy_match_min_gain = 0;
+#if (SWD_N >= 8192)
+ lzo_uint extra1 = 0;
+#endif
+ lzo_uint extra2 = 0;
+ lzo_uint ahead = 0;
+
+ m_len = c->m_len;
+ m_off = c->m_off;
+
+#if (SWD_N >= 8192)
+ if (m_off >= 8192)
+ {
+ if (m_len < M3_MIN_LEN)
+ m_len = 0;
+ else
+ lazy_match_min_gain = 1;
+ }
+ else
+#endif
+ if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
+ {
+ lazy_match_min_gain = 2;
+#if (SWD_N >= 8192)
+ extra1 = 3;
+#endif
+ extra2 = 2;
+ }
+ else if (m_len >= 10)
+ lazy_match_min_gain = 1;
+ else if (m_len >= 3)
+ {
+ lazy_match_min_gain = 1;
+#if (SWD_N >= 8192)
+ extra1 = 1;
+#endif
+ }
+ else
+ m_len = 0;
+
+
+ /* try a lazy match */
+ if (lazy_match_min_gain > 0 && c->look > m_len)
+ {
+ unsigned char lit = LZO_BYTE(swd->b_char);
+
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ assert(c->look > 0);
+
+#if (SWD_N >= 8192)
+ if (m_off < 8192 && c->m_off >= 8192)
+ lazy_match_min_gain += extra1;
+ else
+#endif
+ if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
+ {
+ if (!(c->m_len >= M1_MIN_LEN &&
+ c->m_len <= M1_MAX_LEN && c->m_off <= 256))
+ lazy_match_min_gain += extra2;
+ }
+ if (c->m_len >= M1_MIN_LEN &&
+ c->m_len <= M1_MAX_LEN && c->m_off <= 256)
+ {
+ lazy_match_min_gain -= 1;
+ }
+
+ if ((lzo_int) lazy_match_min_gain < 1)
+ lazy_match_min_gain = 1;
+
+ if (c->m_len >= m_len + lazy_match_min_gain)
+ {
+ c->lazy++;
+#if !defined(NDEBUG)
+ m_len = c->m_len;
+ m_off = c->m_off;
+ assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off,
+ m_len) == 0);
+ assert(m_len >= 3 || (m_len >= 2 && m_off <= 256));
+#endif
+ /* code literal */
+ putbit(0);
+ putbyte(lit);
+ c->lit_bytes++;
+ continue;
+ }
+ else
+ ahead = 1;
+ assert(m_len > 0);
+ }
+
+
+ if (m_len == 0)
+ {
+ /* a literal */
+ putbit(0);
+ putbyte(swd->b_char);
+ c->lit_bytes++;
+ r = find_match(c,swd,1,0);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+ else
+ {
+ assert(m_len >= M1_MIN_LEN);
+ assert(m_off > 0);
+ assert(m_off <= SWD_N);
+
+ /* 2 - code match */
+ if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256)
+ {
+ putbit(1);
+ putbit(0);
+ putbits(2,m_len - M1_MIN_LEN);
+ putbyte(m_off - 1);
+ c->m1++;
+ }
+#if (SWD_N >= 8192)
+ else if (m_off >= 8192)
+ {
+ unsigned len = m_len;
+ assert(m_len >= M3_MIN_LEN);
+ putbit(1);
+ putbit(1);
+ putbyte(m_off & 31);
+ putbyte(m_off >> 5);
+ putbit(1);
+ len -= M3_MIN_LEN - 1;
+ while (len > 255)
+ {
+ len -= 255;
+ putbyte(0);
+ }
+ putbyte(len);
+ c->m4++;
+ }
+#endif
+ else
+ {
+ assert(m_len >= 3);
+
+ putbit(1);
+ putbit(1);
+ if (m_len <= 9)
+ {
+ putbyte(((m_len - 2) << 5) | (m_off & 31));
+ putbyte(m_off >> 5);
+ c->m2++;
+ }
+ else
+ {
+ lzo_uint len = m_len;
+ putbyte(m_off & 31);
+ putbyte(m_off >> 5);
+#if (SWD_N >= 8192)
+ putbit(0);
+#endif
+ len -= 10 - 1;
+ while (len > 255)
+ {
+ len -= 255;
+ putbyte(0);
+ }
+ putbyte(len);
+ c->m3++;
+ }
+ }
+ r = find_match(c,swd,m_len,1+ahead);
+ assert(r == 0); LZO_UNUSED(r);
+ }
+
+ c->codesize = pd(op, out);
+ }
+
+#if defined(LZO_EOF_CODE)
+ /* code EOF code */
+ putbit(1);
+ putbit(1);
+ putbyte(1 << 5);
+ putbyte(0);
+#endif
+
+ /* flush remaining bits */
+ assert(k < CHAR_BIT);
+ if (k > 0)
+ {
+ assert(b == MASKBITS(k));
+ assert(op - bitp > 1);
+ *bitp = LZO_BYTE(MASKBITS(k));
+ DUMPBITS(k);
+ assert(b == 0);
+ assert(k == 0);
+ }
+
+ assert(c->textsize == in_len);
+ c->codesize = pd(op, out);
+
+ *out_len = pd(op, out);
+
+ if (c->cb && c->cb->nprogress)
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+
+#if 0
+ printf("%ld -> %ld: %ld %ld %ld %ld %ld %ld\n",
+ (long) c->textsize, (long) c->codesize,
+ c->lit_bytes, c->m1, c->m2, c->m3, c->m4, c->lazy);
+#endif
+ return LZO_E_OK;
+}
+
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(int)
+lzo2a_999_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ return lzo2a_999_compress_callback(in,in_len,out,out_len,wrkmem,
+ (lzo_callback_p) 0, 0);
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo2a_d.ch b/ics-openvpn-stripped/main/lzo/src/lzo2a_d.ch
new file mode 100644
index 00000000..1f4acf12
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo2a_d.ch
@@ -0,0 +1,177 @@
+/* lzo2a_d.ch -- implementation of the LZO2A decompression algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo1_d.ch"
+
+
+/***********************************************************************
+// decompress a block of data.
+************************************************************************/
+
+#define _NEEDBYTE NEED_IP(1)
+#define _NEXTBYTE (*ip++)
+
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op;
+ const lzo_bytep ip;
+ const lzo_bytep m_pos;
+
+ lzo_uint t;
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+
+ lzo_uint32_t b = 0; /* bit buffer */
+ unsigned k = 0; /* bits in bit buffer */
+
+ LZO_UNUSED(wrkmem);
+
+ op = out;
+ ip = in;
+
+ while (TEST_IP_AND_TEST_OP)
+ {
+ NEEDBITS(1);
+ if (MASKBITS(1) == 0)
+ {
+ DUMPBITS(1);
+ /* a literal */
+ NEED_IP(1); NEED_OP(1);
+ *op++ = *ip++;
+ continue;
+ }
+ DUMPBITS(1);
+
+ NEEDBITS(1);
+ if (MASKBITS(1) == 0)
+ {
+ DUMPBITS(1);
+ /* a M1 match */
+ NEEDBITS(2);
+ t = M1_MIN_LEN + (lzo_uint) MASKBITS(2);
+ DUMPBITS(2);
+ NEED_IP(1); NEED_OP(t);
+ m_pos = op - 1 - *ip++;
+ assert(m_pos >= out); assert(m_pos < op);
+ TEST_LB(m_pos);
+ MEMCPY_DS(op,m_pos,t);
+ continue;
+ }
+ DUMPBITS(1);
+
+ NEED_IP(2);
+ t = *ip++;
+ m_pos = op;
+ m_pos -= (t & 31) | (((lzo_uint) *ip++) << 5);
+ t >>= 5;
+ if (t == 0)
+ {
+#if (SWD_N >= 8192)
+ NEEDBITS(1);
+ t = MASKBITS(1);
+ DUMPBITS(1);
+ if (t == 0)
+ t = 10 - 1;
+ else
+ {
+ /* a M3 match */
+ m_pos -= 8192; /* t << 13 */
+ t = M3_MIN_LEN - 1;
+ }
+#else
+ t = 10 - 1;
+#endif
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ TEST_OV(t);
+ NEED_IP(1);
+ }
+ t += *ip++;
+ }
+ else
+ {
+#if defined(LZO_EOF_CODE)
+ if (m_pos == op)
+ goto eof_found;
+#endif
+ t += 2;
+ }
+ assert(m_pos >= out); assert(m_pos < op);
+ TEST_LB(m_pos);
+ NEED_OP(t);
+ MEMCPY_DS(op,m_pos,t);
+ }
+
+
+#if defined(LZO_EOF_CODE)
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ /* no EOF code was found */
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+#endif
+ *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
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo2a_d1.c b/ics-openvpn-stripped/main/lzo/src/lzo2a_d1.c
new file mode 100644
index 00000000..a32f4cd4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo2a_d1.c
@@ -0,0 +1,34 @@
+/* lzo2a_d1.c -- LZO2A decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config2a.h"
+
+#undef LZO_TEST_OVERRUN
+#define DO_DECOMPRESS lzo2a_decompress
+
+#include "lzo2a_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo2a_d2.c b/ics-openvpn-stripped/main/lzo/src/lzo2a_d2.c
new file mode 100644
index 00000000..c3c3bed3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo2a_d2.c
@@ -0,0 +1,34 @@
+/* lzo2a_d2.c -- LZO2A decompression with overrun testing
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "config2a.h"
+
+#define LZO_TEST_OVERRUN 1
+#define DO_DECOMPRESS lzo2a_decompress_safe
+
+#include "lzo2a_d.ch"
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_conf.h b/ics-openvpn-stripped/main/lzo/src/lzo_conf.h
new file mode 100644
index 00000000..3543b140
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_conf.h
@@ -0,0 +1,390 @@
+/* lzo_conf.h -- main internal configuration file for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_CONF_H
+#define __LZO_CONF_H 1
+
+#if !defined(__LZO_IN_MINILZO)
+#if defined(LZO_CFG_FREESTANDING) && (LZO_CFG_FREESTANDING)
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+#endif
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER)
+# include LZO_CFG_EXTRA_CONFIG_HEADER
+#endif
+#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED)
+# error "include this file first"
+#endif
+#include "lzo/lzoconf.h"
+#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2)
+# include LZO_CFG_EXTRA_CONFIG_HEADER2
+#endif
+#endif
+
+#if (LZO_VERSION < 0x2070) || !defined(__LZOCONF_H_INCLUDED)
+# error "version mismatch"
+#endif
+
+
+/***********************************************************************
+// pragmas
+************************************************************************/
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100))
+ /* disable bogus "unreachable code" warnings */
+# pragma warning(disable: 4702)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1000))
+# pragma warning(disable: 4127 4701)
+ /* disable warnings about inlining */
+# pragma warning(disable: 4514 4710 4711)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+ /* disable '-Wall' warnings in system header files */
+# pragma warning(disable: 4820)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1800))
+ /* disable '-Wall' warnings in system header files */
+# pragma warning(disable: 4746)
+#endif
+
+#if (LZO_CC_SUNPROC)
+#if !defined(__cplusplus)
+# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
+# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
+# pragma error_messages(off,E_STATEMENT_NOT_REACHED)
+#endif
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING)
+#elif 1
+# include <string.h>
+#else
+# define LZO_WANT_ACC_INCD_H 1
+#endif
+#if defined(LZO_HAVE_CONFIG_H)
+# define LZO_CFG_NO_CONFIG_HEADER 1
+#endif
+#include "lzo_supp.h"
+
+/* Integral types */
+#if 1 || defined(lzo_int8_t) || defined(lzo_uint8_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1)
+#endif
+#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2)
+#endif
+#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4)
+#endif
+#if defined(lzo_int64_t) || defined(lzo_uint64_t)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8)
+#endif
+
+#if (LZO_CFG_FREESTANDING)
+# undef HAVE_MEMCMP
+# undef HAVE_MEMCPY
+# undef HAVE_MEMMOVE
+# undef HAVE_MEMSET
+#endif
+
+#if !(HAVE_MEMCMP)
+# undef memcmp
+# define memcmp(a,b,c) lzo_memcmp(a,b,c)
+#else
+# undef lzo_memcmp
+# define lzo_memcmp(a,b,c) memcmp(a,b,c)
+#endif
+#if !(HAVE_MEMCPY)
+# undef memcpy
+# define memcpy(a,b,c) lzo_memcpy(a,b,c)
+#else
+# undef lzo_memcpy
+# define lzo_memcpy(a,b,c) memcpy(a,b,c)
+#endif
+#if !(HAVE_MEMMOVE)
+# undef memmove
+# define memmove(a,b,c) lzo_memmove(a,b,c)
+#else
+# undef lzo_memmove
+# define lzo_memmove(a,b,c) memmove(a,b,c)
+#endif
+#if !(HAVE_MEMSET)
+# undef memset
+# define memset(a,b,c) lzo_memset(a,b,c)
+#else
+# undef lzo_memset
+# define lzo_memset(a,b,c) memset(a,b,c)
+#endif
+
+#undef NDEBUG
+#if (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 (LZO_CFG_PGO)
+# undef __lzo_likely
+# undef __lzo_unlikely
+# define __lzo_likely(e) (e)
+# define __lzo_unlikely(e) (e)
+#endif
+
+#undef _
+#undef __
+#undef ___
+#undef ____
+#undef _p0
+#undef _p1
+#undef _p2
+#undef _p3
+#undef _p4
+#undef _s0
+#undef _s1
+#undef _s2
+#undef _s3
+#undef _s4
+#undef _ww
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#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))))
+
+/* this always fits into 32 bits */
+#define LZO_SIZE(bits) (1u << (bits))
+#define LZO_MASK(bits) (LZO_SIZE(bits) - 1)
+
+#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits))
+#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1)
+
+#if !defined(DMUL)
+#if 0
+ /* 32*32 multiplies may be faster than 64*64 on some 64-bit machines,
+ * but then we need extra casts from unsigned<->size_t */
+# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b)))
+#else
+# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
+#endif
+#endif
+
+
+/***********************************************************************
+// compiler and architecture specific stuff
+************************************************************************/
+
+/* Some defines that indicate if memory can be accessed at unaligned
+ * memory addresses. You should also test that this is actually faster
+ * even if it is allowed by your system.
+ */
+
+#include "lzo_func.h"
+
+#ifndef UA_SET1
+#define UA_SET1 LZO_MEMOPS_SET1
+#endif
+#ifndef UA_SET2
+#define UA_SET2 LZO_MEMOPS_SET2
+#endif
+#ifndef UA_SET3
+#define UA_SET3 LZO_MEMOPS_SET3
+#endif
+#ifndef UA_SET4
+#define UA_SET4 LZO_MEMOPS_SET4
+#endif
+#ifndef UA_MOVE1
+#define UA_MOVE1 LZO_MEMOPS_MOVE1
+#endif
+#ifndef UA_MOVE2
+#define UA_MOVE2 LZO_MEMOPS_MOVE2
+#endif
+#ifndef UA_MOVE3
+#define UA_MOVE3 LZO_MEMOPS_MOVE3
+#endif
+#ifndef UA_MOVE4
+#define UA_MOVE4 LZO_MEMOPS_MOVE4
+#endif
+#ifndef UA_MOVE8
+#define UA_MOVE8 LZO_MEMOPS_MOVE8
+#endif
+#ifndef UA_COPY1
+#define UA_COPY1 LZO_MEMOPS_COPY1
+#endif
+#ifndef UA_COPY2
+#define UA_COPY2 LZO_MEMOPS_COPY2
+#endif
+#ifndef UA_COPY3
+#define UA_COPY3 LZO_MEMOPS_COPY3
+#endif
+#ifndef UA_COPY4
+#define UA_COPY4 LZO_MEMOPS_COPY4
+#endif
+#ifndef UA_COPY8
+#define UA_COPY8 LZO_MEMOPS_COPY8
+#endif
+#ifndef UA_COPYN
+#define UA_COPYN LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_COPYN_X
+#define UA_COPYN_X LZO_MEMOPS_COPYN
+#endif
+#ifndef UA_GET_LE16
+#define UA_GET_LE16 LZO_MEMOPS_GET_LE16
+#endif
+#ifndef UA_GET_LE32
+#define UA_GET_LE32 LZO_MEMOPS_GET_LE32
+#endif
+#ifdef LZO_MEMOPS_GET_LE64
+#ifndef UA_GET_LE64
+#define UA_GET_LE64 LZO_MEMOPS_GET_LE64
+#endif
+#endif
+#ifndef UA_GET_NE16
+#define UA_GET_NE16 LZO_MEMOPS_GET_NE16
+#endif
+#ifndef UA_GET_NE32
+#define UA_GET_NE32 LZO_MEMOPS_GET_NE32
+#endif
+#ifdef LZO_MEMOPS_GET_NE64
+#ifndef UA_GET_NE64
+#define UA_GET_NE64 LZO_MEMOPS_GET_NE64
+#endif
+#endif
+#ifndef UA_PUT_LE16
+#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16
+#endif
+#ifndef UA_PUT_LE32
+#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32
+#endif
+#ifndef UA_PUT_NE16
+#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16
+#endif
+#ifndef UA_PUT_NE32
+#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32
+#endif
+
+
+/* Fast memcpy that copies multiples of 8 byte chunks.
+ * len is the number of bytes.
+ * note: all parameters must be lvalues, len >= 8
+ * dest and src advance, len is undefined afterwards
+ */
+
+#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(const lzo_bytep) lzo_copyright(void);
+
+#include "lzo_ptr.h"
+
+/* Generate compressed data in a deterministic way.
+ * This is fully portable, and compression can be faster as well.
+ * A reason NOT to be deterministic is when the block size is
+ * very small (e.g. 8kB) or the dictionary is big, because
+ * then the initialization of the dictionary becomes a relevant
+ * magnitude for compression speed.
+ */
+#ifndef LZO_DETERMINISTIC
+#define LZO_DETERMINISTIC 1
+#endif
+
+
+#ifndef LZO_DICT_USE_PTR
+#define LZO_DICT_USE_PTR 1
+#endif
+
+#if (LZO_DICT_USE_PTR)
+# define lzo_dict_t const lzo_bytep
+# define lzo_dict_p lzo_dict_t *
+#else
+# define lzo_dict_t lzo_uint
+# define lzo_dict_p lzo_dict_t *
+#endif
+
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_crc.c b/ics-openvpn-stripped/main/lzo/src/lzo_crc.c
new file mode 100644
index 00000000..adb72381
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_crc.c
@@ -0,0 +1,155 @@
+/* lzo_crc.c -- crc checksum for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+
+
+/***********************************************************************
+// crc32 checksum
+// adapted from free code by Mark Adler <madler@alumni.caltech.edu>
+// see http://www.zlib.org/
+************************************************************************/
+
+static const lzo_uint32_t lzo_crc32_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+
+
+LZO_PUBLIC(const lzo_uint32_tp)
+lzo_get_crc32_table(void)
+{
+ return lzo_crc32_table;
+}
+
+
+#if 1
+#define LZO_DO1(buf,i) \
+ crc = table[((unsigned)crc ^ buf[i]) & 0xff] ^ (crc >> 8)
+#else
+#define LZO_DO1(buf,i) \
+ crc = table[(unsigned char)((unsigned char)crc ^ buf[i])] ^ (crc >> 8)
+#endif
+#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_t)
+lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len)
+{
+ lzo_uint32_t crc;
+#undef table
+#if 1
+# define table lzo_crc32_table
+#else
+ const lzo_uint32_t * table = lzo_crc32_table;
+#endif
+
+ if (buf == NULL)
+ return 0;
+
+ crc = (c & LZO_UINT32_C(0xffffffff)) ^ LZO_UINT32_C(0xffffffff);
+ if (len >= 16) do
+ {
+ LZO_DO16(buf,0);
+ buf += 16;
+ len -= 16;
+ } while (len >= 16);
+ if (len != 0) do
+ {
+ LZO_DO1(buf,0);
+ buf += 1;
+ len -= 1;
+ } while (len > 0);
+
+ return crc ^ LZO_UINT32_C(0xffffffff);
+#undef table
+}
+
+#undef LZO_DO1
+#undef LZO_DO2
+#undef LZO_DO4
+#undef LZO_DO8
+#undef LZO_DO16
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_dict.h b/ics-openvpn-stripped/main/lzo/src/lzo_dict.h
new file mode 100644
index 00000000..c3dd52bf
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_dict.h
@@ -0,0 +1,309 @@
+/* lzo_dict.h -- dictionary definitions for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_DICT_H
+#define __LZO_DICT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/***********************************************************************
+// dictionary size
+************************************************************************/
+
+/* dictionary needed for compression */
+#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)
+
+
+/* dictionary depth */
+#if !defined(DD_BITS)
+# define DD_BITS 0
+#endif
+#define DD_SIZE LZO_SIZE(DD_BITS)
+#define DD_MASK LZO_MASK(DD_BITS)
+
+/* dictionary length */
+#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 < 6 || D_BITS > 18)
+# error "invalid D_BITS"
+#endif
+#if (DL_BITS < 6 || 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
+
+
+
+/***********************************************************************
+// dictionary access
+************************************************************************/
+
+#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)
+ /* hash function like in gzip/zlib (deflate) */
+# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT))
+
+#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
+ /* incremental hash like in gzip/zlib (deflate) */
+# define __LZO_HASH_INCREMENTAL 1
+# 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)
+ /* incremental LZO hash version A */
+# define __LZO_HASH_INCREMENTAL 1
+# 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)
+ /* incremental LZO hash version B */
+# define __LZO_HASH_INCREMENTAL 1
+# 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)
+#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_LLVM)
+static void __attribute__((__unused__))
+#else
+static void
+#endif
+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
+
+
+
+/***********************************************************************
+// dictionary updating
+************************************************************************/
+
+#if (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_dict_t) pd(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
+
+
+/***********************************************************************
+// test for a match
+************************************************************************/
+
+#if (LZO_DICT_USE_PTR)
+
+/* m_pos is either NULL or a valid pointer */
+#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
+ (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset)
+
+/* m_pos may point anywhere... */
+#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 (LZO_DETERMINISTIC)
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
+#else
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
+#endif
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_dll.ch b/ics-openvpn-stripped/main/lzo/src/lzo_dll.ch
new file mode 100644
index 00000000..3b80edff
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_dll.ch
@@ -0,0 +1,52 @@
+/* lzo_dll.ch -- DLL initialization of the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+// Windows 16 bit + Watcom C + DLL
+************************************************************************/
+
+#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD)
+
+/* don't pull in <windows.h> - we don't need it */
+#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
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_func.ch b/ics-openvpn-stripped/main/lzo/src/lzo_func.ch
new file mode 100644
index 00000000..a85b71f0
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_func.ch
@@ -0,0 +1,122 @@
+/* lzo_func.ch -- functions
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+/***********************************************************************
+// bitops
+************************************************************************/
+
+#if (defined(_WIN32) || defined(_WIN64)) && ((LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#include <intrin.h>
+#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32) && 0
+#pragma intrinsic(_BitScanReverse)
+static __lzo_inline unsigned lzo_bitops_clz32(lzo_uint32 v)
+{
+ unsigned long r;
+ (void) _BitScanReverse(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_clz32 lzo_bitops_clz32
+#endif
+#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX) && 0
+#pragma intrinsic(_BitScanReverse64)
+static __lzo_inline unsigned lzo_bitops_clz64(lzo_uint64 v)
+{
+ unsigned long r;
+ (void) _BitScanReverse64(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_clz64 lzo_bitops_clz64
+#endif
+#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
+#pragma intrinsic(_BitScanForward)
+static __lzo_inline unsigned lzo_bitops_ctz32(lzo_uint32 v)
+{
+ unsigned long r;
+ (void) _BitScanForward(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_ctz32 lzo_bitops_ctz32
+#endif
+#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
+#pragma intrinsic(_BitScanForward64)
+static __lzo_inline unsigned lzo_bitops_ctz64(lzo_uint64 v)
+{
+ unsigned long r;
+ (void) _BitScanForward64(&r, v);
+ return (unsigned) r;
+}
+#define lzo_bitops_ctz64 lzo_bitops_ctz64
+#endif
+
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#if !defined(lzo_bitops_clz32) && defined(WANT_lzo_bitops_clz32)
+#define lzo_bitops_clz32(v) ((unsigned) __builtin_clz(v))
+#endif
+#if !defined(lzo_bitops_clz64) && defined(WANT_lzo_bitops_clz64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_clz64(v) ((unsigned) __builtin_clzll(v))
+#endif
+#if !defined(lzo_bitops_ctz32) && defined(WANT_lzo_bitops_ctz32)
+#define lzo_bitops_ctz32(v) ((unsigned) __builtin_ctz(v))
+#endif
+#if !defined(lzo_bitops_ctz64) && defined(WANT_lzo_bitops_ctz64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_ctz64(v) ((unsigned) __builtin_ctzll(v))
+#endif
+#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount32)
+#define lzo_bitops_popcount32(v) ((unsigned) __builtin_popcount(v))
+#endif
+#if !defined(lzo_bitops_popcount32) && defined(WANT_lzo_bitops_popcount64) && defined(LZO_UINT64_MAX)
+#define lzo_bitops_popcount64(v) ((unsigned) __builtin_popcountll(v))
+#endif
+#endif
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_func.h b/ics-openvpn-stripped/main/lzo/src/lzo_func.h
new file mode 100644
index 00000000..f11f2ae3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_func.h
@@ -0,0 +1,494 @@
+/* lzo_func.h -- functions
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_FUNC_H
+#define __LZO_FUNC_H 1
+
+
+/***********************************************************************
+// bitops
+************************************************************************/
+
+#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN)
+#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC)
+#define LZO_BITOPS_USE_ASM_BITSCAN 1
+#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul))))
+#define LZO_BITOPS_USE_GNUC_BITSCAN 1
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400)))
+#define LZO_BITOPS_USE_MSC_BITSCAN 1
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#include <intrin.h>
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+#pragma intrinsic(_BitScanReverse)
+#pragma intrinsic(_BitScanForward)
+#endif
+#if (LZO_CC_MSC) && (LZO_ARCH_AMD64)
+#pragma intrinsic(_BitScanReverse64)
+#pragma intrinsic(_BitScanForward64)
+#endif
+#endif
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 31;
+#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4)
+ unsigned r; r = (unsigned) __builtin_clz(v); return r;
+#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r ^ 63;
+#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzl(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_clzll(v); return r;
+#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+ unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint32_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4)
+ unsigned r; r = (unsigned) __builtin_ctz(v); return r;
+#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+
+#if defined(lzo_uint64_t)
+__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v)
+{
+#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64)
+ unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_uint64_t r;
+ __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC);
+ return (unsigned) r;
+#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v)
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzl(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v))
+#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8)
+ unsigned r; r = (unsigned) __builtin_ctzll(v); return r;
+#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v))
+#else
+ LZO_UNUSED(v); return 0;
+#endif
+}
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_bitops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz32_func);
+#if defined(lzo_uint64_t)
+ LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func);
+ LZO_UNUSED_FUNC(lzo_bitops_cttz64_func);
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+}
+
+
+/***********************************************************************
+// memops
+************************************************************************/
+
+#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED)
+#ifndef __lzo_memops_tcheck
+#define __lzo_memops_tcheck(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b))
+#endif
+#endif
+#ifndef lzo_memops_TU0p
+#define lzo_memops_TU0p void __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU1p
+#define lzo_memops_TU1p unsigned char __LZO_MMODEL *
+#endif
+#ifndef lzo_memops_TU2p
+#if (LZO_OPT_UNALIGNED16)
+typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2;
+#define lzo_memops_TU2p volatile lzo_memops_TU2 *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU2_struct,2)
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#else
+struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias;
+typedef struct lzo_memops_TU2_struct lzo_memops_TU2;
+#endif
+#ifndef lzo_memops_TU2p
+#define lzo_memops_TU2p lzo_memops_TU2 *
+#endif
+#endif
+#ifndef lzo_memops_TU4p
+#if (LZO_OPT_UNALIGNED32)
+typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4;
+#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU4_struct,4)
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#else
+struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias;
+typedef struct lzo_memops_TU4_struct lzo_memops_TU4;
+#endif
+#ifndef lzo_memops_TU4p
+#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_TU8p
+#if (LZO_OPT_UNALIGNED64)
+typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8;
+#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL *
+#elif defined(__lzo_byte_struct)
+__lzo_byte_struct(lzo_memops_TU8_struct,8)
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#else
+struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias;
+typedef struct lzo_memops_TU8_struct lzo_memops_TU8;
+#endif
+#ifndef lzo_memops_TU8p
+#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL *
+#endif
+#endif
+#ifndef lzo_memops_set_TU1p
+#define lzo_memops_set_TU1p volatile lzo_memops_TU1p
+#endif
+#ifndef lzo_memops_move_TU1p
+#define lzo_memops_move_TU1p lzo_memops_TU1p
+#endif
+#define LZO_MEMOPS_SET1(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__1[0] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET2(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET3(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_SET4(dd,cc) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \
+ d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE1(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__1[0] = s__1[0]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE2(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__2[0] = s__2[0]; d__2[1] = s__2[1]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE3(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE4(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \
+ LZO_BLOCK_END
+#define LZO_MEMOPS_MOVE8(dd,ss) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \
+ d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \
+ d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \
+ LZO_BLOCK_END
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1)
+#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss)
+#if (LZO_OPT_UNALIGNED16)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY2(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU2,2,1)) { \
+ * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss)
+#endif
+#if (LZO_OPT_UNALIGNED32)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY4(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU4,4,1)) { \
+ * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss)
+#endif
+#if (LZO_WORDSIZE != 8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#else
+#if (LZO_OPT_UNALIGNED64)
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#elif (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END
+#elif defined(__lzo_memops_tcheck)
+#define LZO_MEMOPS_COPY8(dd,ss) \
+ LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU8,8,1)) { \
+ * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \
+ } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END
+#else
+#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss)
+#endif
+#endif
+#define LZO_MEMOPS_COPYN(dd,ss,nn) \
+ LZO_BLOCK_BEGIN \
+ lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \
+ const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \
+ lzo_uint n__n = (nn); \
+ while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \
+ if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(&v, ss);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss;
+ unsigned long vv;
+ __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint16_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(&v, ss);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss;
+ unsigned long vv;
+ __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s));
+ v = (lzo_uint32_t) vv;
+#else
+ const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss;
+ v = (lzo_uint32_t) (((lzo_uint32_t)s[0] << 24) | ((lzo_uint32_t)s[1] << 16) | ((lzo_uint32_t)s[2] << 8) | ((lzo_uint32_t)s[3]));
+#endif
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss)
+{
+ lzo_uint16_t v;
+ LZO_MEMOPS_COPY2(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss)
+#endif
+
+__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss)
+{
+ lzo_uint32_t v;
+ LZO_MEMOPS_COPY4(&v, ss);
+ return v;
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss)
+#else
+#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss)
+#endif
+
+#if (LZO_OPT_UNALIGNED64)
+#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY2(dd, &vv);
+#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU2p d = (lzo_memops_TU2p) dd;
+ unsigned long v = vv;
+ __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv)
+{
+#if (LZO_ABI_LITTLE_ENDIAN)
+ LZO_MEMOPS_COPY4(dd, &vv);
+#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC)
+ lzo_memops_TU4p d = (lzo_memops_TU4p) dd;
+ unsigned long v = vv;
+ __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v));
+#else
+ lzo_memops_TU1p d = (lzo_memops_TU1p) dd;
+ d[0] = LZO_BYTE((vv ) & 0xff);
+ d[1] = LZO_BYTE((vv >> 8) & 0xff);
+ d[2] = LZO_BYTE((vv >> 16) & 0xff);
+ d[3] = LZO_BYTE((vv >> 24) & 0xff);
+#endif
+}
+#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN)
+#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv)
+{
+ LZO_MEMOPS_COPY2(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED16)
+#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv)
+#endif
+
+__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv)
+{
+ LZO_MEMOPS_COPY4(dd, &vv);
+}
+#if (LZO_OPT_UNALIGNED32)
+#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv))
+#else
+#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv)
+#endif
+
+#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+static void __attribute__((__unused__))
+#else
+__lzo_static_forceinline void
+#endif
+lzo_memops_unused_funcs(void)
+{
+ LZO_UNUSED_FUNC(lzo_memops_get_le16);
+ LZO_UNUSED_FUNC(lzo_memops_get_le32);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_get_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_put_le16);
+ LZO_UNUSED_FUNC(lzo_memops_put_le32);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne16);
+ LZO_UNUSED_FUNC(lzo_memops_put_ne32);
+ LZO_UNUSED_FUNC(lzo_memops_unused_funcs);
+}
+
+#endif /* already included */
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_init.c b/ics-openvpn-stripped/main/lzo/src/lzo_init.c
new file mode 100644
index 00000000..4128a602
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_init.c
@@ -0,0 +1,225 @@
+/* lzo_init.c -- initialization of the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+
+
+/***********************************************************************
+// Runtime check of the assumptions about the size of builtin types,
+// memory model, byte order and other low-level constructs.
+//
+// We are really paranoid here - LZO should either fail
+// at startup or not at all.
+//
+// Because of inlining much of these functions evaluates to nothing.
+//
+// And while many of the tests seem highly obvious and redundant they are
+// here to catch compiler/optimizer bugs. Yes, these do exist.
+************************************************************************/
+
+#if !defined(__LZO_IN_MINILZO)
+
+#define LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#include "lzo_supp.h"
+
+ LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+#if !(__LZO_UINTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
+
+#endif
+#undef LZOCHK_ASSERT
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+union lzo_config_check_union {
+ lzo_uint a[2];
+ unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))];
+#if defined(lzo_uint64_t)
+ lzo_uint64_t c[2];
+#endif
+};
+
+
+#if 0
+#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off)))
+#else
+static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off)
+{
+ return (lzo_voidp) ((lzo_bytep) ptr + off);
+}
+#endif
+
+
+LZO_PUBLIC(int)
+_lzo_config_check(void)
+{
+#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul))
+# if 0
+ /* work around a clang 3.1 and clang 3.2 compiler bug; clang 3.3 and 3.4 work */
+ volatile
+# endif
+#endif
+ union lzo_config_check_union u;
+ lzo_voidp p;
+ unsigned r = 1;
+
+ u.a[0] = u.a[1] = 0;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_bytep) p) == 0);
+#if !(LZO_CFG_NO_CONFIG_CHECK)
+#if (LZO_ABI_BIG_ENDIAN)
+ u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
+#endif
+#if (LZO_ABI_LITTLE_ENDIAN)
+ u.a[0] = u.a[1] = 0; u.b[0] = 128;
+ p = u2p(&u, 0);
+ r &= ((* (lzo_uintp) p) == 128);
+#endif
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 1; u.b[3] = 2;
+ p = u2p(&u, 1);
+ r &= UA_GET_NE16(p) == 0;
+ r &= UA_GET_LE16(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE16(p) == 128;
+ u.a[0] = u.a[1] = 0;
+ u.b[0] = 3; u.b[5] = 4;
+ p = u2p(&u, 1);
+ r &= UA_GET_NE32(p) == 0;
+ r &= UA_GET_LE32(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE32(p) == 128;
+#if defined(UA_GET_NE64)
+ u.c[0] = u.c[1] = 0;
+ u.b[0] = 5; u.b[9] = 6;
+ p = u2p(&u, 1);
+ u.c[0] = u.c[1] = 0;
+ r &= UA_GET_NE64(p) == 0;
+#if defined(UA_GET_LE64)
+ r &= UA_GET_LE64(p) == 0;
+ u.b[1] = 128;
+ r &= UA_GET_LE64(p) == 128;
+#endif
+#endif
+#if defined(lzo_bitops_ctlz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz32(v) == 31 - i;
+ r &= lzo_bitops_ctlz32_func(v) == 31 - i;
+ }}
+#endif
+#if defined(lzo_bitops_ctlz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_ctlz64(v) == 63 - i;
+ r &= lzo_bitops_ctlz64_func(v) == 63 - i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz32)
+ { unsigned i = 0; lzo_uint32_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz32(v) == i;
+ r &= lzo_bitops_cttz32_func(v) == i;
+ }}
+#endif
+#if defined(lzo_bitops_cttz64)
+ { unsigned i = 0; lzo_uint64_t v;
+ for (v = 1; v != 0 && r == 1; v <<= 1, i++) {
+ r &= lzo_bitops_cttz64(v) == i;
+ r &= lzo_bitops_cttz64_func(v) == i;
+ }}
+#endif
+#endif
+ LZO_UNUSED_FUNC(lzo_bitops_unused_funcs);
+
+ return r == 1 ? LZO_E_OK : LZO_E_ERROR;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+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 LZO_WANT_ACC_CHK_CH 1
+#undef LZOCHK_ASSERT
+#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+#include "lzo_supp.h"
+#endif
+#undef LZOCHK_ASSERT
+
+ 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_t)) &&
+ (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)
+#include "lzo_dll.ch"
+#endif
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_mchw.ch b/ics-openvpn-stripped/main/lzo/src/lzo_mchw.ch
new file mode 100644
index 00000000..8273612a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_mchw.ch
@@ -0,0 +1,225 @@
+/* lzo_mchw.ch -- matching functions using a window
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+typedef struct
+{
+ unsigned init;
+
+ lzo_uint look; /* bytes in lookahead buffer */
+
+ lzo_uint m_len;
+ lzo_uint m_off;
+
+ lzo_uint last_m_len;
+ lzo_uint last_m_off;
+
+ const lzo_bytep bp;
+ const lzo_bytep ip;
+ const lzo_bytep in;
+ const lzo_bytep in_end;
+ lzo_bytep out;
+
+ lzo_callback_p cb;
+
+ lzo_uint textsize; /* text size counter */
+ lzo_uint codesize; /* code size counter */
+ lzo_uint printcount; /* counter for reporting progress every 1K bytes */
+
+ /* some stats */
+ unsigned long lit_bytes;
+ unsigned long match_bytes;
+ unsigned long rep_bytes;
+ unsigned long lazy;
+
+#if defined(LZO1B)
+ lzo_uint r1_m_len;
+
+ /* some stats */
+ unsigned long r1_r, m3_r, m2_m, m3_m;
+#endif
+
+#if defined(LZO1C)
+ lzo_uint r1_m_len;
+ lzo_bytep m3;
+
+ /* some stats */
+ unsigned long r1_r, m3_r, m2_m, m3_m;
+#endif
+
+#if defined(LZO1F)
+ lzo_uint r1_lit;
+ lzo_uint r1_m_len;
+
+ /* some stats */
+ unsigned long r1_r, m2_m, m3_m;
+#endif
+
+#if defined(LZO1X) || defined(LZO1Y) || defined(LZO1Z)
+ lzo_uint r1_lit;
+ lzo_uint r1_m_len;
+
+ /* some stats */
+ unsigned long m1a_m, m1b_m, m2_m, m3_m, m4_m;
+ unsigned long lit1_r, lit2_r, lit3_r;
+#endif
+
+#if defined(LZO2A)
+ /* some stats */
+ unsigned long m1, m2, m3, m4;
+#endif
+}
+LZO_COMPRESS_T;
+
+
+#define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1))
+
+#include "lzo_swd.ch"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static int
+init_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
+ const lzo_bytep dict, lzo_uint dict_len,
+ lzo_uint32_t flags )
+{
+ int r;
+
+ assert(!c->init);
+ c->init = 1;
+
+ s->c = c;
+
+ c->last_m_len = c->last_m_off = 0;
+
+ c->textsize = c->codesize = c->printcount = 0;
+ c->lit_bytes = c->match_bytes = c->rep_bytes = 0;
+ c->lazy = 0;
+
+ r = swd_init(s,dict,dict_len);
+ if (r != LZO_E_OK)
+ {
+ swd_exit(s);
+ return r;
+ }
+
+ s->use_best_off = (flags & 1) ? 1 : 0;
+ return LZO_E_OK;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static int
+find_match ( LZO_COMPRESS_T *c, lzo_swd_p s,
+ lzo_uint this_len, lzo_uint skip )
+{
+ assert(c->init);
+
+ if (skip > 0)
+ {
+ assert(this_len >= skip);
+ swd_accept(s, this_len - skip);
+ c->textsize += this_len - skip + 1;
+ }
+ else
+ {
+ assert(this_len <= 1);
+ c->textsize += this_len - skip;
+ }
+
+ s->m_len = SWD_THRESHOLD;
+ s->m_off = 0;
+#ifdef SWD_BEST_OFF
+ if (s->use_best_off)
+ lzo_memset(s->best_pos,0,sizeof(s->best_pos));
+#endif
+ swd_findbest(s);
+ c->m_len = s->m_len;
+ c->m_off = s->m_off;
+
+ swd_getbyte(s);
+
+ if (s->b_char < 0)
+ {
+ c->look = 0;
+ c->m_len = 0;
+ swd_exit(s);
+ }
+ else
+ {
+ c->look = s->look + 1;
+ }
+ c->bp = c->ip - c->look;
+
+#if 0
+ /* brute force match search */
+ if (c->m_len > SWD_THRESHOLD && c->m_len + 1 <= c->look)
+ {
+ const lzo_bytep ip = c->bp;
+ const lzo_bytep m = c->bp - c->m_off;
+ const lzo_bytep in = c->in;
+
+ if (ip - in > s->swd_n)
+ in = ip - s->swd_n;
+ for (;;)
+ {
+ while (*in != *ip)
+ in++;
+ if (in == ip)
+ break;
+ if (in != m)
+ if (lzo_memcmp(in,ip,c->m_len+1) == 0)
+ printf("%p %p %p %5d\n",in,ip,m,c->m_len);
+ in++;
+ }
+ }
+#endif
+
+ if (c->cb && c->cb->nprogress && c->textsize > c->printcount)
+ {
+ (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0);
+ c->printcount += 1024;
+ }
+
+ return LZO_E_OK;
+}
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_ptr.c b/ics-openvpn-stripped/main/lzo/src/lzo_ptr.c
new file mode 100644
index 00000000..2896b70b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_ptr.c
@@ -0,0 +1,78 @@
+/* lzo_ptr.c -- low-level pointer constructs
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+LZO_PUBLIC(lzo_uintptr_t)
+__lzo_ptr_linear(const lzo_voidp ptr)
+{
+ lzo_uintptr_t p;
+
+#if (LZO_ARCH_I086)
+#error "LZO_ARCH_I086 is unsupported"
+#elif (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#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 (__LZO_UINTPTR_T_IS_POINTER)
+#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
+#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 <= size);
+ return (unsigned)n;
+}
+
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_ptr.h b/ics-openvpn-stripped/main/lzo/src/lzo_ptr.h
new file mode 100644
index 00000000..1e23548f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_ptr.h
@@ -0,0 +1,125 @@
+/* lzo_ptr.h -- low-level pointer constructs
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_PTR_H
+#define __LZO_PTR_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* Always use the safe (=integral) version for pointer-comparisons.
+ * The compiler should optimize away the additional casts anyway.
+ *
+ * Note that this only works if the representation and ordering
+ * of the pointer and the integral is the same (at bit level).
+ */
+
+#if (LZO_ARCH_I086)
+#error "LZO_ARCH_I086 is unsupported"
+#elif (LZO_MM_PVP)
+#error "LZO_MM_PVP is unsupported"
+#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_xint a_lzo_xint;
+ lzo_int16_t a_lzo_int16_t;
+ lzo_uint16_t a_lzo_uint16_t;
+ lzo_int32_t a_lzo_int32_t;
+ lzo_uint32_t a_lzo_uint32_t;
+#if defined(lzo_uint64_t)
+ lzo_int64_t a_lzo_int64_t;
+ lzo_uint64_t a_lzo_uint64_t;
+#endif
+ size_t a_size_t;
+ ptrdiff_t a_ptrdiff_t;
+ lzo_uintptr_t a_lzo_uintptr_t;
+ void * a_void_p;
+ char * a_char_p;
+ unsigned char * a_uchar_p;
+ const void * a_c_void_p;
+ const char * a_c_char_p;
+ const unsigned char * a_c_uchar_p;
+ lzo_voidp a_lzo_voidp;
+ lzo_bytep a_lzo_bytep;
+ const lzo_voidp a_c_lzo_voidp;
+ const lzo_bytep a_c_lzo_bytep;
+}
+lzo_full_align_t;
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_str.c b/ics-openvpn-stripped/main/lzo/src/lzo_str.c
new file mode 100644
index 00000000..a7ca638f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_str.c
@@ -0,0 +1,59 @@
+/* lzo_str.c -- string functions for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+
+#undef lzo_memcmp
+#undef lzo_memcpy
+#undef lzo_memmove
+#undef lzo_memset
+
+
+/***********************************************************************
+// slow but portable <string.h> stuff, only used in assertions
+************************************************************************/
+
+#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
+#ifndef __LZOLIB_FUNCNAME
+#define __LZOLIB_FUNCNAME(f) f
+#endif
+#define lzo_hmemcmp __LZOLIB_FUNCNAME(lzo_memcmp)
+#define lzo_hmemcpy __LZOLIB_FUNCNAME(lzo_memcpy)
+#define lzo_hmemmove __LZOLIB_FUNCNAME(lzo_memmove)
+#define lzo_hmemset __LZOLIB_FUNCNAME(lzo_memset)
+#define LZO_WANT_ACCLIB_HMEMCPY 1
+#include "lzo_supp.h"
+#undef LZOLIB_PUBLIC
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_supp.h b/ics-openvpn-stripped/main/lzo/src/lzo_supp.h
new file mode 100644
index 00000000..f7d0351e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_supp.h
@@ -0,0 +1,3685 @@
+/* lzo_supp.h -- architecture, OS and compiler specific defines
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __LZO_SUPP_H_INCLUDED
+#define __LZO_SUPP_H_INCLUDED 1
+#if (LZO_CFG_NO_CONFIG_HEADER)
+#elif defined(LZO_CFG_CONFIG_HEADER)
+#else
+#if !(LZO_CFG_AUTO_NO_HEADERS)
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_SETJMP_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+# define HAVE_STDIO_H 1
+# define HAVE_STRING_H 1
+#else
+#define STDC_HEADERS 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_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SETJMP_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_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#if (LZO_OS_POSIX)
+# if (LZO_OS_POSIX_AIX)
+# define HAVE_SYS_RESOURCE_H 1
+# elif (LZO_OS_POSIX_FREEBSD || LZO_OS_POSIX_MACOSX || LZO_OS_POSIX_NETBSD || LZO_OS_POSIX_OPENBSD)
+# define HAVE_STRINGS_H 1
+# undef HAVE_MALLOC_H
+# elif (LZO_OS_POSIX_HPUX || LZO_OS_POSIX_INTERIX)
+# define HAVE_ALLOCA_H 1
+# elif (LZO_OS_POSIX_MACOSX && LZO_LIBC_MSL)
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# elif (LZO_OS_POSIX_SOLARIS || LZO_OS_POSIX_SUNOS)
+# define HAVE_ALLOCA_H 1
+# endif
+# if (LZO_LIBC_DIETLIBC || LZO_LIBC_GLIBC || LZO_LIBC_UCLIBC)
+# define HAVE_STRINGS_H 1
+# define HAVE_SYS_MMAN_H 1
+# define HAVE_SYS_RESOURCE_H 1
+# define HAVE_SYS_WAIT_H 1
+# endif
+# if (LZO_LIBC_NEWLIB)
+# undef HAVE_STRINGS_H
+# endif
+#elif (LZO_OS_CYGWIN)
+# define HAVE_IO_H 1
+#elif (LZO_OS_EMX)
+# define HAVE_ALLOCA_H 1
+# define HAVE_IO_H 1
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_MALLOC_H
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+#define HAVE_CONIO_H 1
+#define HAVE_DIRECT_H 1
+#define HAVE_DOS_H 1
+#define HAVE_IO_H 1
+#define HAVE_SHARE_H 1
+#if (LZO_CC_AZTECC)
+# undef HAVE_CONIO_H
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_CC_BORLANDC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# if (LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# endif
+#elif (LZO_CC_DMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# define HAVE_SYS_DIRENT_H 1
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+#elif (LZO_CC_IBMC && LZO_OS_OS2)
+# undef HAVE_DOS_H
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_CC_GHS || LZO_CC_INTELC || LZO_CC_MSC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_CC_LCCWIN32)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_OS_WIN32 && LZO_LIBC_MSL)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DOS_H
+# undef HAVE_SHARE_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_CC_NDPC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#elif (LZO_CC_PACIFICC)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_IO_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_OS_WIN32 && LZO_CC_PELLESC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# if (__POCC__ < 280)
+# else
+# define HAVE_SYS_UTIME_H 1
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_PGI) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+#elif (LZO_CC_SYMANTECC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# if (__SC__ < 0x700)
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# endif
+#elif (LZO_CC_TOPSPEEDC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (LZO_CC_TURBOC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# if (LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_SIGNAL_H
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UTIME_H
+# endif
+#elif (LZO_CC_WATCOMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+# if (__WATCOMC__ < 950)
+# undef HAVE_UNISTD_H
+# endif
+#elif (LZO_CC_ZORTECHC)
+# undef HAVE_DIRENT_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#endif
+#endif
+#if (LZO_OS_CONSOLE)
+# undef HAVE_DIRENT_H
+#endif
+#if (LZO_OS_EMBEDDED)
+# undef HAVE_DIRENT_H
+#endif
+#if (LZO_LIBC_ISOC90 || LZO_LIBC_ISOC99)
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (LZO_LIBC_GLIBC >= 0x020100ul)
+# define HAVE_STDINT_H 1
+#elif (LZO_LIBC_DIETLIBC)
+# undef HAVE_STDINT_H
+#elif (LZO_LIBC_UCLIBC)
+# define HAVE_STDINT_H 1
+#elif (LZO_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
+# undef HAVE_STDINT_H
+#elif (LZO_CC_DMC) && (__DMC__ >= 0x825)
+# define HAVE_STDINT_H 1
+#endif
+#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
+# define TIME_WITH_SYS_TIME 1
+#endif
+#endif
+#endif
+#if !(LZO_CFG_AUTO_NO_FUNCTIONS)
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LONGJMP 1
+# define HAVE_MEMCMP 1
+# define HAVE_MEMCPY 1
+# define HAVE_MEMMOVE 1
+# define HAVE_MEMSET 1
+# define HAVE_SETJMP 1
+#else
+#define HAVE_ACCESS 1
+#define HAVE_ALLOCA 1
+#define HAVE_ATEXIT 1
+#define HAVE_ATOI 1
+#define HAVE_ATOL 1
+#define HAVE_CHMOD 1
+#define HAVE_CHOWN 1
+#define HAVE_CTIME 1
+#define HAVE_DIFFTIME 1
+#define HAVE_FILENO 1
+#define HAVE_FSTAT 1
+#define HAVE_GETENV 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GMTIME 1
+#define HAVE_ISATTY 1
+#define HAVE_LOCALTIME 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MEMCMP 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKTIME 1
+#define HAVE_QSORT 1
+#define HAVE_RAISE 1
+#define HAVE_RMDIR 1
+#define HAVE_SETJMP 1
+#define HAVE_SIGNAL 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STAT 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_TIME 1
+#define HAVE_UMASK 1
+#define HAVE_UTIME 1
+#define HAVE_VSNPRINTF 1
+#if (LZO_OS_BEOS || LZO_OS_CYGWIN || LZO_OS_POSIX || LZO_OS_QNX || LZO_OS_VMS)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#else
+# define HAVE_STRICMP 1
+# define HAVE_STRNICMP 1
+#endif
+#if (LZO_OS_POSIX)
+# if (LZO_OS_POSIX_AIX)
+# define HAVE_GETRUSAGE 1
+# elif (LZO_OS_POSIX_MACOSX && LZO_LIBC_MSL)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+# elif (LZO_OS_POSIX_UNICOS)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+# if (LZO_CC_TINYC)
+# undef HAVE_ALLOCA
+# endif
+# if (LZO_LIBC_DIETLIBC || LZO_LIBC_GLIBC || LZO_LIBC_UCLIBC)
+# define HAVE_GETRUSAGE 1
+# define HAVE_GETPAGESIZE 1
+# define HAVE_MMAP 1
+# define HAVE_MPROTECT 1
+# define HAVE_MUNMAP 1
+# endif
+#elif (LZO_OS_CYGWIN)
+# if (LZO_CC_GNUC < 0x025a00ul)
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# endif
+# if (LZO_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_OS_EMX)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# undef HAVE_ALLOCA
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_SNPRINTF
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+#undef HAVE_CHOWN
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_LSTAT
+#undef HAVE_UMASK
+#if (LZO_CC_AZTECC)
+# undef HAVE_ALLOCA
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_STRDUP
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_BORLANDC)
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_ALLOCA
+# undef HAVE_UTIME
+# endif
+# if ((__BORLANDC__ < 0x0410) && LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (__BORLANDC__ < 0x0550)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (LZO_CC_DMC)
+# if (LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_GHS)
+# undef HAVE_ALLOCA
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_IBMC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_INTELC)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_LCCWIN32)
+# define utime _utime
+#elif (LZO_CC_MSC)
+# if (_MSC_VER < 600)
+# undef HAVE_STRFTIME
+# endif
+# if (_MSC_VER < 700)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (_MSC_VER < 1500)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+# else
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# endif
+# if ((_MSC_VER < 800) && LZO_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (LZO_ARCH_I086) && defined(__cplusplus)
+# undef HAVE_LONGJMP
+# undef HAVE_SETJMP
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__MINGW32__)
+# if (LZO_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_OS_WIN32 && LZO_LIBC_MSL)
+# if (__MSL__ < 0x8000ul)
+# undef HAVE_CHMOD
+# endif
+#elif (LZO_CC_NDPC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_STRNICMP
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+# if defined(__cplusplus)
+# undef HAVE_STAT
+# endif
+#elif (LZO_CC_PACIFICC)
+# undef HAVE_ACCESS
+# undef HAVE_ALLOCA
+# undef HAVE_CHMOD
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_MKTIME
+# undef HAVE_RAISE
+# undef HAVE_SNPRINTF
+# undef HAVE_STRFTIME
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (LZO_OS_WIN32 && LZO_CC_PELLESC)
+# if (__POCC__ < 280)
+# define alloca _alloca
+# undef HAVE_UTIME
+# endif
+#elif (LZO_OS_WIN32 && LZO_CC_PGI) && defined(__MINGW32__)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_SYMANTECC)
+# if (LZO_OS_WIN16 && (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# if (__SC__ < 0x600)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+# if (__SC__ < 0x700)
+# undef HAVE_DIFFTIME
+# undef HAVE_UTIME
+# endif
+#elif (LZO_CC_TOPSPEEDC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (LZO_CC_TURBOC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_RAISE
+# undef HAVE_SIGNAL
+# endif
+# if (__TURBOC__ < 0x0295)
+# undef HAVE_MKTIME
+# undef HAVE_STRFTIME
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_UTIME
+# endif
+#elif (LZO_CC_WATCOMC)
+# if (__WATCOMC__ < 1100)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (__WATCOMC__ < 1200)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (LZO_CC_ZORTECHC)
+# if (LZO_OS_WIN16 && (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# undef HAVE_DIFFTIME
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#endif
+#if (LZO_OS_CONSOLE)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_TIME
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+#endif
+#if (LZO_LIBC_ISOC90 || LZO_LIBC_ISOC99)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FILENO
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_STAT
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# if 1
+# undef HAVE_ALLOCA
+# undef HAVE_ISATTY
+# undef HAVE_MKDIR
+# undef HAVE_RMDIR
+# undef HAVE_STRDUP
+# undef HAVE_STRICMP
+# undef HAVE_STRNICMP
+# endif
+#endif
+#endif
+#endif
+#if !(LZO_CFG_AUTO_NO_SIZES)
+#if !defined(SIZEOF_SHORT) && defined(LZO_SIZEOF_SHORT)
+# define SIZEOF_SHORT LZO_SIZEOF_SHORT
+#endif
+#if !defined(SIZEOF_INT) && defined(LZO_SIZEOF_INT)
+# define SIZEOF_INT LZO_SIZEOF_INT
+#endif
+#if !defined(SIZEOF_LONG) && defined(LZO_SIZEOF_LONG)
+# define SIZEOF_LONG LZO_SIZEOF_LONG
+#endif
+#if !defined(SIZEOF_LONG_LONG) && defined(LZO_SIZEOF_LONG_LONG)
+# define SIZEOF_LONG_LONG LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(SIZEOF___INT32) && defined(LZO_SIZEOF___INT32)
+# define SIZEOF___INT32 LZO_SIZEOF___INT32
+#endif
+#if !defined(SIZEOF___INT64) && defined(LZO_SIZEOF___INT64)
+# define SIZEOF___INT64 LZO_SIZEOF___INT64
+#endif
+#if !defined(SIZEOF_VOID_P) && defined(LZO_SIZEOF_VOID_P)
+# define SIZEOF_VOID_P LZO_SIZEOF_VOID_P
+#endif
+#if !defined(SIZEOF_SIZE_T) && defined(LZO_SIZEOF_SIZE_T)
+# define SIZEOF_SIZE_T LZO_SIZEOF_SIZE_T
+#endif
+#if !defined(SIZEOF_PTRDIFF_T) && defined(LZO_SIZEOF_PTRDIFF_T)
+# define SIZEOF_PTRDIFF_T LZO_SIZEOF_PTRDIFF_T
+#endif
+#endif
+#if (HAVE_SIGNAL) && !defined(RETSIGTYPE)
+# define RETSIGTYPE void
+#endif
+#endif
+#if !(LZO_CFG_SKIP_LZO_TYPES)
+#if 1 && !defined(lzo_signo_t) && defined(__linux__) && defined(__dietlibc__) && (LZO_SIZEOF_INT != 4)
+# define lzo_signo_t lzo_int32e_t
+#endif
+#if !defined(lzo_signo_t)
+# define lzo_signo_t int
+#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#if (LZO_BROKEN_CDECL_ALT_SYNTAX)
+typedef void __lzo_cdecl_sighandler (*lzo_sighandler_t)(lzo_signo_t);
+#elif defined(RETSIGTYPE)
+typedef RETSIGTYPE (__lzo_cdecl_sighandler *lzo_sighandler_t)(lzo_signo_t);
+#else
+typedef void (__lzo_cdecl_sighandler *lzo_sighandler_t)(lzo_signo_t);
+#endif
+#if defined(__cplusplus)
+}
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCD_H)
+# undef LZO_WANT_ACC_INCD_H
+#ifndef __LZO_INCD_H_INCLUDED
+#define __LZO_INCD_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#ifndef __LZO_FALLBACK_STDDEF_H_INCLUDED
+#define __LZO_FALLBACK_STDDEF_H_INCLUDED 1
+#if defined(__PTRDIFF_TYPE__)
+typedef __PTRDIFF_TYPE__ lzo_fallback_ptrdiff_t;
+#elif defined(__MIPS_PSX2__)
+typedef int lzo_fallback_ptrdiff_t;
+#else
+typedef long lzo_fallback_ptrdiff_t;
+#endif
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ lzo_fallback_size_t;
+#elif defined(__MIPS_PSX2__)
+typedef unsigned int lzo_fallback_size_t;
+#else
+typedef unsigned long lzo_fallback_size_t;
+#endif
+#if !defined(ptrdiff_t)
+typedef lzo_fallback_ptrdiff_t ptrdiff_t;
+#ifndef _PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED 1
+#endif
+#endif
+#if !defined(size_t)
+typedef lzo_fallback_size_t size_t;
+#ifndef _SIZE_T_DEFINED
+#define _SIZE_T_DEFINED 1
+#endif
+#endif
+#if !defined(__cplusplus) && !defined(wchar_t)
+typedef unsigned short wchar_t;
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED 1
+#endif
+#endif
+#ifndef NULL
+#if defined(__cplusplus) && defined(__GNUC__) && (__GNUC__ >= 4)
+#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void*)0)
+#endif
+#endif
+#ifndef offsetof
+#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
+#endif
+#endif
+#elif (LZO_LIBC_FREESTANDING)
+# if defined(HAVE_STDDEF_H) && (HAVE_STDDEF_H+0)
+# include <stddef.h>
+# endif
+# if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+# endif
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# if defined(HAVE_STDIO_H) && (HAVE_STDIO_H+0)
+# include <stdio.h>
+# endif
+# if defined(HAVE_STDDEF_H) && (HAVE_STDDEF_H+0)
+# include <stddef.h>
+# endif
+# if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+# endif
+#else
+#include <stdio.h>
+#if defined(HAVE_TIME_H) && (HAVE_TIME_H+0) && defined(__MSL__) && defined(__cplusplus)
+# include <time.h>
+#endif
+#if defined(HAVE_SYS_TYPES_H) && (HAVE_SYS_TYPES_H+0)
+# include <sys/types.h>
+#endif
+#if defined(HAVE_SYS_STAT_H) && (HAVE_SYS_STAT_H+0)
+# include <sys/stat.h>
+#endif
+#if defined(STDC_HEADERS) && (STDC_HEADERS+0)
+# include <stdlib.h>
+#elif defined(HAVE_STDLIB_H) && (HAVE_STDLIB_H+0)
+# include <stdlib.h>
+#endif
+#include <stddef.h>
+#if defined(HAVE_STRING_H) && (HAVE_STRING_H+0)
+# if defined(STDC_HEADERS) && (STDC_HEADERS+0)
+# elif defined(HAVE_MEMORY_H) && (HAVE_MEMORY_H+0)
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && (HAVE_STRINGS_H+0)
+# include <strings.h>
+#endif
+#if defined(HAVE_INTTYPES_H) && (HAVE_INTTYPES_H+0)
+# include <inttypes.h>
+#endif
+#if defined(HAVE_STDINT_H) && (HAVE_STDINT_H+0)
+# include <stdint.h>
+#endif
+#if defined(HAVE_UNISTD_H) && (HAVE_UNISTD_H+0)
+# include <unistd.h>
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCE_H)
+# undef LZO_WANT_ACC_INCE_H
+#ifndef __LZO_INCE_H_INCLUDED
+#define __LZO_INCE_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+# if (HAVE_SETJMP_H)
+# include <setjmp.h>
+# endif
+#else
+#if (HAVE_STDARG_H)
+# include <stdarg.h>
+#endif
+#if (HAVE_CTYPE_H)
+# include <ctype.h>
+#endif
+#if (HAVE_ERRNO_H)
+# include <errno.h>
+#endif
+#if (HAVE_MALLOC_H)
+# include <malloc.h>
+#endif
+#if (HAVE_ALLOCA_H)
+# include <alloca.h>
+#endif
+#if (HAVE_FCNTL_H)
+# include <fcntl.h>
+#endif
+#if (HAVE_DIRENT_H)
+# include <dirent.h>
+#endif
+#if (HAVE_SETJMP_H)
+# include <setjmp.h>
+#endif
+#if (HAVE_SIGNAL_H)
+# include <signal.h>
+#endif
+#if (TIME_WITH_SYS_TIME)
+# include <sys/time.h>
+# include <time.h>
+#elif (HAVE_TIME_H)
+# include <time.h>
+#endif
+#if (HAVE_UTIME_H)
+# include <utime.h>
+#elif (HAVE_SYS_UTIME_H)
+# include <sys/utime.h>
+#endif
+#if (HAVE_IO_H)
+# include <io.h>
+#endif
+#if (HAVE_DOS_H)
+# include <dos.h>
+#endif
+#if (HAVE_DIRECT_H)
+# include <direct.h>
+#endif
+#if (HAVE_SHARE_H)
+# include <share.h>
+#endif
+#if (LZO_CC_NDPC)
+# include <os.h>
+#endif
+#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
+# include <ext.h>
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_INCI_H)
+# undef LZO_WANT_ACC_INCI_H
+#ifndef __LZO_INCI_H_INCLUDED
+#define __LZO_INCI_H_INCLUDED 1
+#if (LZO_LIBC_NAKED)
+#elif (LZO_LIBC_FREESTANDING)
+#elif (LZO_LIBC_MOSTLY_FREESTANDING)
+#else
+#if (LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# include <tos.h>
+#elif (LZO_HAVE_WINDOWS_H)
+# if 1 && !defined(WIN32_LEAN_AND_MEAN)
+# define WIN32_LEAN_AND_MEAN 1
+# endif
+# if 1 && !defined(_WIN32_WINNT)
+# define _WIN32_WINNT 0x0400
+# endif
+# include <windows.h>
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# include <dir.h>
+# endif
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_WIN16)
+# if (LZO_CC_AZTECC)
+# include <model.h>
+# include <stat.h>
+# elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# include <alloc.h>
+# include <dir.h>
+# elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# include <sys/exceptn.h>
+# elif (LZO_CC_PACIFICC)
+# include <unixio.h>
+# include <stat.h>
+# include <sys.h>
+# elif (LZO_CC_WATCOMC)
+# include <i86.h>
+# endif
+#elif (LZO_OS_OS216)
+# if (LZO_CC_WATCOMC)
+# include <i86.h>
+# endif
+#endif
+#if (HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
+#if (HAVE_SYS_RESOURCE_H)
+# include <sys/resource.h>
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if defined(FP_OFF)
+# define LZO_PTR_FP_OFF(x) FP_OFF(x)
+# elif defined(_FP_OFF)
+# define LZO_PTR_FP_OFF(x) _FP_OFF(x)
+# else
+# define LZO_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# endif
+# if defined(FP_SEG)
+# define LZO_PTR_FP_SEG(x) FP_SEG(x)
+# elif defined(_FP_SEG)
+# define LZO_PTR_FP_SEG(x) _FP_SEG(x)
+# else
+# define LZO_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# endif
+# if defined(MK_FP)
+# define LZO_PTR_MK_FP(s,o) MK_FP(s,o)
+# elif defined(_MK_FP)
+# define LZO_PTR_MK_FP(s,o) _MK_FP(s,o)
+# else
+# define LZO_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+# endif
+# if 0
+# undef LZO_PTR_FP_OFF
+# undef LZO_PTR_FP_SEG
+# undef LZO_PTR_MK_FP
+# define LZO_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# define LZO_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# define LZO_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+# endif
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_LIB_H)
+# undef LZO_WANT_ACC_LIB_H
+#ifndef __LZO_LIB_H_INCLUDED
+#define __LZO_LIB_H_INCLUDED 1
+#if !defined(__LZOLIB_FUNCNAME)
+# define __LZOLIB_FUNCNAME(f) f
+#endif
+#if !defined(LZOLIB_EXTERN)
+# define LZOLIB_EXTERN(r,f) extern r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_EXTERN_NOINLINE)
+# if defined(__lzo_noinline)
+# define LZOLIB_EXTERN_NOINLINE(r,f) extern __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_EXTERN_NOINLINE(r,f) extern r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+#if (LZO_SIZEOF_LONG > LZO_SIZEOF_VOID_P)
+# define lzolib_handle_t long
+#else
+# define lzolib_handle_t lzo_intptr_t
+#endif
+#if 0
+LZOLIB_EXTERN(int, lzo_ascii_digit) (int);
+LZOLIB_EXTERN(int, lzo_ascii_islower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_isupper) (int);
+LZOLIB_EXTERN(int, lzo_ascii_tolower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_toupper) (int);
+LZOLIB_EXTERN(int, lzo_ascii_utolower) (int);
+LZOLIB_EXTERN(int, lzo_ascii_utoupper) (int);
+#endif
+#define lzo_ascii_isdigit(c) ((LZO_ICAST(unsigned, c) - 48) < 10)
+#define lzo_ascii_islower(c) ((LZO_ICAST(unsigned, c) - 97) < 26)
+#define lzo_ascii_isupper(c) ((LZO_ICAST(unsigned, c) - 65) < 26)
+#define lzo_ascii_tolower(c) (LZO_ICAST(int, c) + (lzo_ascii_isupper(c) << 5))
+#define lzo_ascii_toupper(c) (LZO_ICAST(int, c) - (lzo_ascii_islower(c) << 5))
+#define lzo_ascii_utolower(c) lzo_ascii_tolower(LZO_ITRUNC(unsigned char, c))
+#define lzo_ascii_utoupper(c) lzo_ascii_toupper(LZO_ITRUNC(unsigned char, c))
+#ifndef lzo_hsize_t
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define lzo_hsize_t unsigned long
+# define lzo_hvoid_p void __huge *
+# define lzo_hchar_p char __huge *
+# define lzo_hchar_pp char __huge * __huge *
+# define lzo_hbyte_p unsigned char __huge *
+#else
+# define lzo_hsize_t size_t
+# define lzo_hvoid_p void *
+# define lzo_hchar_p char *
+# define lzo_hchar_pp char **
+# define lzo_hbyte_p unsigned char *
+#endif
+#endif
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_halloc) (lzo_hsize_t);
+LZOLIB_EXTERN(void, lzo_hfree) (lzo_hvoid_p);
+#if (LZO_OS_DOS16 || LZO_OS_OS216)
+LZOLIB_EXTERN(void __far*, lzo_dos_alloc) (unsigned long);
+LZOLIB_EXTERN(int, lzo_dos_free) (void __far*);
+#endif
+LZOLIB_EXTERN(int, lzo_hmemcmp) (const lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlen) (const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_hstrcmp) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_hstrncmp)(const lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_ascii_hstricmp) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(int, lzo_ascii_hstrnicmp)(const lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_ascii_hmemicmp) (const lzo_hvoid_p, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrstr) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstristr) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemmem) (const lzo_hvoid_p, lzo_hsize_t, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemimem) (const lzo_hvoid_p, lzo_hsize_t, const lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrcpy) (lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrcat) (lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlcpy) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrlcat) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_hstrscpy) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(int, lzo_hstrscat) (lzo_hchar_p, const lzo_hchar_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrccpy) (lzo_hchar_p, const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemccpy) (lzo_hvoid_p, const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrchr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrchr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrichr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrrichr) (const lzo_hchar_p, int);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemchr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_hmemrchr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemichr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemrichr) (const lzo_hvoid_p, int, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrrspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrcspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hstrrcspn) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrpbrk) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrpbrk) (const lzo_hchar_p, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrsep) (lzo_hchar_pp, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_hstrrsep) (lzo_hchar_pp, const lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrlwr) (lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hchar_p, lzo_ascii_hstrupr) (lzo_hchar_p);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemlwr) (lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hvoid_p, lzo_ascii_hmemupr) (lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hfread) (void *, lzo_hvoid_p, lzo_hsize_t);
+LZOLIB_EXTERN(lzo_hsize_t, lzo_hfwrite) (void *, const lzo_hvoid_p, lzo_hsize_t);
+#if (LZO_HAVE_MM_HUGE_PTR)
+LZOLIB_EXTERN(long, lzo_hread) (int, lzo_hvoid_p, long);
+LZOLIB_EXTERN(long, lzo_hwrite) (int, const lzo_hvoid_p, long);
+#endif
+LZOLIB_EXTERN(long, lzo_safe_hread) (int, lzo_hvoid_p, long);
+LZOLIB_EXTERN(long, lzo_safe_hwrite) (int, const lzo_hvoid_p, long);
+LZOLIB_EXTERN(unsigned, lzo_ua_get_be16) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_be24) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_be32) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_be16) (lzo_hvoid_p, unsigned);
+LZOLIB_EXTERN(void, lzo_ua_set_be24) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(void, lzo_ua_set_be32) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(unsigned, lzo_ua_get_le16) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_le24) (const lzo_hvoid_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_ua_get_le32) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_le16) (lzo_hvoid_p, unsigned);
+LZOLIB_EXTERN(void, lzo_ua_set_le24) (lzo_hvoid_p, lzo_uint32l_t);
+LZOLIB_EXTERN(void, lzo_ua_set_le32) (lzo_hvoid_p, lzo_uint32l_t);
+#if defined(lzo_int64l_t)
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_ua_get_be64) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_be64) (lzo_hvoid_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_ua_get_le64) (const lzo_hvoid_p);
+LZOLIB_EXTERN(void, lzo_ua_set_le64) (lzo_hvoid_p, lzo_uint64l_t);
+#endif
+LZOLIB_EXTERN_NOINLINE(short, lzo_vget_short) (short, int);
+LZOLIB_EXTERN_NOINLINE(int, lzo_vget_int) (int, int);
+LZOLIB_EXTERN_NOINLINE(long, lzo_vget_long) (long, int);
+#if defined(lzo_int64l_t)
+LZOLIB_EXTERN_NOINLINE(lzo_int64l_t, lzo_vget_lzo_int64l_t) (lzo_int64l_t, int);
+#endif
+LZOLIB_EXTERN_NOINLINE(lzo_hsize_t, lzo_vget_lzo_hsize_t) (lzo_hsize_t, int);
+#if !(LZO_CFG_NO_FLOAT)
+LZOLIB_EXTERN_NOINLINE(float, lzo_vget_float) (float, int);
+#endif
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_EXTERN_NOINLINE(double, lzo_vget_double) (double, int);
+#endif
+LZOLIB_EXTERN_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_p) (lzo_hvoid_p, int);
+LZOLIB_EXTERN_NOINLINE(const lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p, int);
+#if !defined(LZO_FN_PATH_MAX)
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+# define LZO_FN_PATH_MAX 143
+#elif (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# define LZO_FN_PATH_MAX 259
+#elif (LZO_OS_TOS)
+# define LZO_FN_PATH_MAX 259
+#endif
+#endif
+#if !defined(LZO_FN_PATH_MAX)
+# define LZO_FN_PATH_MAX 1023
+#endif
+#if !defined(LZO_FN_NAME_MAX)
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+# define LZO_FN_NAME_MAX 12
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define LZO_FN_NAME_MAX 12
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+#elif (LZO_OS_DOS32)
+# define LZO_FN_NAME_MAX 12
+#endif
+#endif
+#if !defined(LZO_FN_NAME_MAX)
+# define LZO_FN_NAME_MAX LZO_FN_PATH_MAX
+#endif
+#define LZO_FNMATCH_NOESCAPE 1
+#define LZO_FNMATCH_PATHNAME 2
+#define LZO_FNMATCH_PATHSTAR 4
+#define LZO_FNMATCH_PERIOD 8
+#define LZO_FNMATCH_ASCII_CASEFOLD 16
+LZOLIB_EXTERN(int, lzo_fnmatch) (const lzo_hchar_p, const lzo_hchar_p, int);
+#undef __LZOLIB_USE_OPENDIR
+#if (HAVE_DIRENT_H || LZO_CC_WATCOMC)
+# define __LZOLIB_USE_OPENDIR 1
+# if (LZO_OS_DOS32 && defined(__BORLANDC__))
+# elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# elif (LZO_OS_OS2 || LZO_OS_OS216)
+# elif (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC)
+# elif (LZO_OS_WIN32 && !(LZO_HAVE_WINDOWS_H))
+# elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_TOS || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# undef __LZOLIB_USE_OPENDIR
+# endif
+#endif
+typedef struct
+{
+#if defined(__LZOLIB_USE_OPENDIR)
+ void* u_dirp;
+# if (LZO_CC_WATCOMC)
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned long f_size;
+# endif
+ char f_name[LZO_FN_NAME_MAX+1];
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64)
+ lzolib_handle_t u_handle;
+ unsigned f_attr;
+ unsigned f_size_low;
+ unsigned f_size_high;
+ char f_name[LZO_FN_NAME_MAX+1];
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_TOS || LZO_OS_WIN16)
+ char u_dta[21];
+ unsigned char f_attr;
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned short f_size_low;
+ unsigned short f_size_high;
+ char f_name[LZO_FN_NAME_MAX+1];
+ char u_dirp;
+#else
+ void* u_dirp;
+ char f_name[LZO_FN_NAME_MAX+1];
+#endif
+} lzo_dir_t;
+#ifndef lzo_dir_p
+#define lzo_dir_p lzo_dir_t *
+#endif
+LZOLIB_EXTERN(int, lzo_opendir) (lzo_dir_p, const char*);
+LZOLIB_EXTERN(int, lzo_readdir) (lzo_dir_p);
+LZOLIB_EXTERN(int, lzo_closedir) (lzo_dir_p);
+#if (LZO_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
+# define lzo_alloca(x) __builtin_alloca((x))
+#elif (LZO_CC_GNUC) && (LZO_OS_CONSOLE_PS2)
+# define lzo_alloca(x) __builtin_alloca((x))
+#elif (LZO_CC_BORLANDC || LZO_CC_LCC) && defined(__linux__)
+#elif (HAVE_ALLOCA)
+# define lzo_alloca(x) LZO_STATIC_CAST(void *, alloca((x)))
+#endif
+#if (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
+# if (LZO_OS_WIN16) && (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# else
+# define lzo_stackavail() stackavail()
+# endif
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086) && LZO_CC_MSC && (_MSC_VER >= 700))
+# define lzo_stackavail() _stackavail()
+#elif ((LZO_ARCH_I086) && LZO_CC_MSC)
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && LZO_CC_TURBOC && (__TURBOC__ >= 0x0450))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_TURBOC && (__TURBOC__ >= 0x0400))
+ LZO_EXTERN_C size_t __cdecl stackavail(void);
+# define lzo_stackavail() stackavail()
+#elif ((LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_CC_WATCOMC))
+# define lzo_stackavail() stackavail()
+#elif (LZO_ARCH_I086 && LZO_CC_ZORTECHC)
+# define lzo_stackavail() _chkstack()
+#endif
+LZOLIB_EXTERN(lzo_intptr_t, lzo_get_osfhandle) (int);
+LZOLIB_EXTERN(const char *, lzo_getenv) (const char *);
+LZOLIB_EXTERN(int, lzo_isatty) (int);
+LZOLIB_EXTERN(int, lzo_mkdir) (const char*, unsigned);
+LZOLIB_EXTERN(int, lzo_rmdir) (const char*);
+LZOLIB_EXTERN(int, lzo_response) (int*, char***);
+LZOLIB_EXTERN(int, lzo_set_binmode) (int, int);
+#if defined(lzo_int32e_t)
+LZOLIB_EXTERN(lzo_int32e_t, lzo_muldiv32s) (lzo_int32e_t, lzo_int32e_t, lzo_int32e_t);
+LZOLIB_EXTERN(lzo_uint32e_t, lzo_muldiv32u) (lzo_uint32e_t, lzo_uint32e_t, lzo_uint32e_t);
+#endif
+LZOLIB_EXTERN(void, lzo_wildargv) (int*, char***);
+LZOLIB_EXTERN_NOINLINE(void, lzo_debug_break) (void);
+LZOLIB_EXTERN_NOINLINE(void, lzo_debug_nop) (void);
+LZOLIB_EXTERN_NOINLINE(int, lzo_debug_align_check_query) (void);
+LZOLIB_EXTERN_NOINLINE(int, lzo_debug_align_check_enable) (int);
+LZOLIB_EXTERN_NOINLINE(unsigned, lzo_debug_running_on_qemu) (void);
+LZOLIB_EXTERN_NOINLINE(unsigned, lzo_debug_running_on_valgrind) (void);
+#if defined(lzo_int32e_t)
+LZOLIB_EXTERN(int, lzo_tsc_read) (lzo_uint32e_t*);
+#endif
+struct lzo_pclock_handle_t;
+struct lzo_pclock_t;
+typedef struct lzo_pclock_handle_t lzo_pclock_handle_t;
+typedef struct lzo_pclock_t lzo_pclock_t;
+#ifndef lzo_pclock_handle_p
+#define lzo_pclock_handle_p lzo_pclock_handle_t *
+#endif
+#ifndef lzo_pclock_p
+#define lzo_pclock_p lzo_pclock_t *
+#endif
+#define LZO_PCLOCK_REALTIME 0
+#define LZO_PCLOCK_MONOTONIC 1
+#define LZO_PCLOCK_PROCESS_CPUTIME_ID 2
+#define LZO_PCLOCK_THREAD_CPUTIME_ID 3
+typedef int (*lzo_pclock_gettime_t) (lzo_pclock_handle_p, lzo_pclock_p);
+struct lzo_pclock_handle_t {
+ lzolib_handle_t h;
+ int mode;
+ int read_error;
+ const char* name;
+ lzo_pclock_gettime_t gettime;
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t ticks_base;
+#endif
+};
+struct lzo_pclock_t {
+#if defined(lzo_int64l_t)
+ lzo_int64l_t tv_sec;
+#else
+ lzo_int32l_t tv_sec_high;
+ lzo_uint32l_t tv_sec_low;
+#endif
+ lzo_uint32l_t tv_nsec;
+};
+LZOLIB_EXTERN(int, lzo_pclock_open) (lzo_pclock_handle_p, int);
+LZOLIB_EXTERN(int, lzo_pclock_open_default) (lzo_pclock_handle_p);
+LZOLIB_EXTERN(int, lzo_pclock_close) (lzo_pclock_handle_p);
+LZOLIB_EXTERN(void, lzo_pclock_read) (lzo_pclock_handle_p, lzo_pclock_p);
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_EXTERN(double, lzo_pclock_get_elapsed) (lzo_pclock_handle_p, const lzo_pclock_p, const lzo_pclock_p);
+#endif
+LZOLIB_EXTERN(int, lzo_pclock_flush_cpu_cache) (lzo_pclock_handle_p, unsigned);
+struct lzo_getopt_t;
+typedef struct lzo_getopt_t lzo_getopt_t;
+#ifndef lzo_getopt_p
+#define lzo_getopt_p lzo_getopt_t *
+#endif
+struct lzo_getopt_longopt_t;
+typedef struct lzo_getopt_longopt_t lzo_getopt_longopt_t;
+#ifndef lzo_getopt_longopt_p
+#define lzo_getopt_longopt_p lzo_getopt_longopt_t *
+#endif
+struct lzo_getopt_longopt_t {
+ const char* name;
+ int has_arg;
+ int* flag;
+ int val;
+};
+typedef void (*lzo_getopt_opterr_t)(lzo_getopt_p, const char*, void *);
+struct lzo_getopt_t {
+ void *user;
+ const char *progname;
+ int bad_option;
+ char *optarg;
+ lzo_getopt_opterr_t opterr;
+ int optind;
+ int optopt;
+ int errcount;
+ int argc; char** argv;
+ int eof; int shortpos;
+ int pending_rotate_first, pending_rotate_middle;
+};
+enum { LZO_GETOPT_NO_ARG, LZO_GETOPT_REQUIRED_ARG, LZO_GETOPT_OPTIONAL_ARG, LZO_GETOPT_EXACT_ARG = 0x10 };
+enum { LZO_GETOPT_PERMUTE, LZO_GETOPT_RETURN_IN_ORDER, LZO_GETOPT_REQUIRE_ORDER };
+LZOLIB_EXTERN(void, lzo_getopt_init) (lzo_getopt_p g,
+ int start_argc, int argc, char** argv);
+LZOLIB_EXTERN(int, lzo_getopt) (lzo_getopt_p g,
+ const char* shortopts,
+ const lzo_getopt_longopt_p longopts,
+ int* longind);
+typedef struct {
+ lzo_uint32l_t seed;
+} lzo_rand31_t;
+#ifndef lzo_rand31_p
+#define lzo_rand31_p lzo_rand31_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand31) (lzo_rand31_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand31) (lzo_rand31_p);
+#if defined(lzo_int64l_t)
+typedef struct {
+ lzo_uint64l_t seed;
+} lzo_rand48_t;
+#ifndef lzo_rand48_p
+#define lzo_rand48_p lzo_rand48_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand48) (lzo_rand48_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand48) (lzo_rand48_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand48_r32) (lzo_rand48_p);
+#endif
+#if defined(lzo_int64l_t)
+typedef struct {
+ lzo_uint64l_t seed;
+} lzo_rand64_t;
+#ifndef lzo_rand64_p
+#define lzo_rand64_p lzo_rand64_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srand64) (lzo_rand64_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand64) (lzo_rand64_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_rand64_r32) (lzo_rand64_p);
+#endif
+typedef struct {
+ unsigned n;
+ lzo_uint32l_t s[624];
+} lzo_randmt_t;
+#ifndef lzo_randmt_p
+#define lzo_randmt_p lzo_randmt_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srandmt) (lzo_randmt_p, lzo_uint32l_t);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_randmt) (lzo_randmt_p);
+LZOLIB_EXTERN(lzo_uint32l_t, lzo_randmt_r32) (lzo_randmt_p);
+#if defined(lzo_int64l_t)
+typedef struct {
+ unsigned n;
+ lzo_uint64l_t s[312];
+} lzo_randmt64_t;
+#ifndef lzo_randmt64_p
+#define lzo_randmt64_p lzo_randmt64_t *
+#endif
+LZOLIB_EXTERN(void, lzo_srandmt64) (lzo_randmt64_p, lzo_uint64l_t);
+LZOLIB_EXTERN(lzo_uint64l_t, lzo_randmt64_r64) (lzo_randmt64_p);
+#endif
+#define LZO_SPAWN_P_WAIT 0
+#define LZO_SPAWN_P_NOWAIT 1
+LZOLIB_EXTERN(int, lzo_spawnv) (int mode, const char* fn, const char* const * argv);
+LZOLIB_EXTERN(int, lzo_spawnvp) (int mode, const char* fn, const char* const * argv);
+LZOLIB_EXTERN(int, lzo_spawnve) (int mode, const char* fn, const char* const * argv, const char * const envp);
+#endif
+#endif
+#if defined(LZO_WANT_ACC_CXX_H)
+# undef LZO_WANT_ACC_CXX_H
+#ifndef __LZO_CXX_H_INCLUDED
+#define __LZO_CXX_H_INCLUDED 1
+#if defined(__cplusplus)
+#if defined(LZO_CXX_NOTHROW)
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul))
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (LZO_CC_GHS && !defined(__EXCEPTIONS))
+#elif (LZO_CC_HIGHC)
+#elif (LZO_CC_MSC && (_MSC_VER < 1100))
+#elif (LZO_CC_NDPC)
+#elif (LZO_CC_TURBOC)
+#elif (LZO_CC_WATCOMC && !defined(_CPPUNWIND))
+#elif (LZO_CC_ZORTECHC)
+#else
+# define LZO_CXX_NOTHROW throw()
+#endif
+#if !defined(LZO_CXX_NOTHROW)
+# define LZO_CXX_NOTHROW /*empty*/
+#endif
+#if defined(__LZO_CXX_DO_NEW)
+#elif (LZO_CC_GHS || LZO_CC_NDPC || LZO_CC_PGI)
+# define __LZO_CXX_DO_NEW { return 0; }
+#elif ((LZO_CC_BORLANDC || LZO_CC_TURBOC) && LZO_ARCH_I086)
+# define __LZO_CXX_DO_NEW { return 0; }
+#else
+# define __LZO_CXX_DO_NEW ;
+#endif
+#if defined(__LZO_CXX_DO_DELETE)
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define __LZO_CXX_DO_DELETE { }
+#else
+# define __LZO_CXX_DO_DELETE LZO_CXX_NOTHROW { }
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (LZO_CC_MSC && LZO_MM_HUGE)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_MSC && (_MSC_VER < 1100))
+#elif (LZO_CC_NDPC)
+#elif (LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+#elif (LZO_CC_TURBOC)
+#elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1100))
+#else
+# define __LZO_CXX_HAVE_ARRAY_NEW 1
+#endif
+#if (__LZO_CXX_HAVE_ARRAY_NEW)
+# define __LZO_CXX_HAVE_PLACEMENT_NEW 1
+#endif
+#if (__LZO_CXX_HAVE_PLACEMENT_NEW)
+# if (LZO_CC_GNUC >= 0x030000ul)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_INTELC)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (LZO_CC_PGI)
+# define __LZO_CXX_HAVE_PLACEMENT_DELETE 1
+# endif
+#endif
+#if defined(LZO_CXX_DISABLE_NEW_DELETE)
+#elif defined(new) || defined(delete)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025b00ul))
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif (LZO_CC_HIGHC)
+# define LZO_CXX_DISABLE_NEW_DELETE private:
+#elif !(__LZO_CXX_HAVE_ARRAY_NEW)
+# define LZO_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __LZO_CXX_DO_DELETE \
+ protected: static void* operator new(size_t) __LZO_CXX_DO_NEW \
+ private:
+#else
+# define LZO_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __LZO_CXX_DO_DELETE \
+ static void operator delete[](void*) __LZO_CXX_DO_DELETE \
+ private: static void* operator new(size_t) __LZO_CXX_DO_NEW \
+ static void* operator new[](size_t) __LZO_CXX_DO_NEW
+#endif
+#if defined(LZO_CXX_TRIGGER_FUNCTION)
+#else
+# define LZO_CXX_TRIGGER_FUNCTION \
+ protected: virtual const void* lzo_cxx_trigger_function() const; \
+ private:
+#endif
+#if defined(LZO_CXX_TRIGGER_FUNCTION_IMPL)
+#else
+# define LZO_CXX_TRIGGER_FUNCTION_IMPL(klass) \
+ const void* klass::lzo_cxx_trigger_function() const { return LZO_STATIC_CAST(const void *, 0); }
+#endif
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACC_CHK_CH)
+# undef LZO_WANT_ACC_CHK_CH
+#if !defined(LZOCHK_ASSERT)
+# define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT_HEADER(expr)
+#endif
+#if !defined(LZOCHK_ASSERT_SIGN_T)
+# define LZOCHK_ASSERT_SIGN_T(type,relop) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, -1) relop LZO_STATIC_CAST(type, 0)) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, ~LZO_STATIC_CAST(type, 0)) relop LZO_STATIC_CAST(type, 0)) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, ~LZO_STATIC_CAST(type, 0)) == LZO_STATIC_CAST(type, -1))
+#endif
+#if !defined(LZOCHK_ASSERT_IS_SIGNED_T)
+# define LZOCHK_ASSERT_IS_SIGNED_T(type) LZOCHK_ASSERT_SIGN_T(type,<)
+#endif
+#if !defined(LZOCHK_ASSERT_IS_UNSIGNED_T)
+# if (LZO_BROKEN_INTEGRAL_PROMOTION)
+# define LZOCHK_ASSERT_IS_UNSIGNED_T(type) \
+ LZOCHK_ASSERT( LZO_STATIC_CAST(type, -1) > LZO_STATIC_CAST(type, 0) )
+# else
+# define LZOCHK_ASSERT_IS_UNSIGNED_T(type) LZOCHK_ASSERT_SIGN_T(type,>)
+# endif
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550) && (__BORLANDC__ < 0x0560))
+# pragma option push -w-8055
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0550))
+# pragma option push -w-osh
+#endif
+#endif
+#if (LZO_0xffffffffL - LZO_UINT32_C(4294967294) != 1)
+# error "preprocessor error"
+#endif
+#if (LZO_0xffffffffL - LZO_UINT32_C(0xfffffffd) != 2)
+# error "preprocessor error"
+#endif
+#if +0
+# error "preprocessor error"
+#endif
+#if -0
+# error "preprocessor error"
+#endif
+#if +0 != 0
+# error "preprocessor error"
+#endif
+#if -0 != 0
+# error "preprocessor error"
+#endif
+#define LZOCHK_VAL 1
+#define LZOCHK_TMP1 LZOCHK_VAL
+#undef LZOCHK_VAL
+#define LZOCHK_VAL 2
+#define LZOCHK_TMP2 LZOCHK_VAL
+#if (LZOCHK_TMP1 != 2)
+# error "preprocessor error 3a"
+#endif
+#if (LZOCHK_TMP2 != 2)
+# error "preprocessor error 3b"
+#endif
+#undef LZOCHK_VAL
+#if (LZOCHK_TMP2)
+# error "preprocessor error 3c"
+#endif
+#if (LZOCHK_TMP2 + 0 != 0)
+# error "preprocessor error 3d"
+#endif
+#undef LZOCHK_TMP1
+#undef LZOCHK_TMP2
+#if 0 || defined(LZOCHK_CFG_PEDANTIC)
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZINT)
+ LZOCHK_ASSERT((_MIPS_SZINT) == 8 * sizeof(int))
+# endif
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZLONG)
+ LZOCHK_ASSERT((_MIPS_SZLONG) == 8 * sizeof(long))
+# endif
+# if (LZO_ARCH_MIPS) && defined(_MIPS_SZPTR)
+ LZOCHK_ASSERT((_MIPS_SZPTR) == 8 * sizeof(void *))
+# endif
+#endif
+ LZOCHK_ASSERT(1 == 1)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,1) == 1)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,2) == 3)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,3) == 7)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,8) == 255)
+#if (SIZEOF_INT >= 2)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,15) == 32767)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,16) == 0xffffU)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0u,16) == 0u)
+#else
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,16) == 0xffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,16) == 0ul)
+#endif
+#if (SIZEOF_INT >= 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,31) == 2147483647)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,32) == 0xffffffffU)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0u,32) == 0u)
+#endif
+#if (SIZEOF_LONG >= 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,32) == 0xffffffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,32) == 0ul)
+#endif
+#if (SIZEOF_LONG >= 8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,64) == 0xffffffffffffffffUL)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0ul,64) == 0ul)
+#endif
+#if !(LZO_BROKEN_INTEGRAL_PROMOTION)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1u,SIZEOF_INT*8) == ~0u)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul)
+#endif
+#if 1
+ LZOCHK_ASSERT(__LZO_MASK_GEN(0,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(1,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,0) == 0)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,0) == 0)
+#endif
+#if 1
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,1) == 2)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,1) == 4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,1) == 8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,2) == 2+4)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,2) == 4+8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,2) == 8+16)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(2,3) == 2+4+8)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(4,3) == 4+8+16)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(8,3) == 8+16+32)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,1) == 7)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,2) == 7+14)
+ LZOCHK_ASSERT(__LZO_MASK_GEN(7,3) == 7+14+28)
+#endif
+#if !(LZO_BROKEN_SIGNED_RIGHT_SHIFT)
+ LZOCHK_ASSERT(((-1) >> 7) == -1)
+#endif
+ LZOCHK_ASSERT(((1) >> 7) == 0)
+#if (LZO_CC_INTELC && (__INTEL_COMPILER >= 900))
+# pragma warning(push)
+# pragma warning(disable: 1025)
+#endif
+ LZOCHK_ASSERT((~0l & ~0) == ~0l)
+ LZOCHK_ASSERT((~0l & ~0u) == ~0u)
+ LZOCHK_ASSERT((~0ul & ~0) == ~0ul)
+ LZOCHK_ASSERT((~0ul & ~0u) == ~0u)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#elif (SIZEOF_INT == 2)
+ LZOCHK_ASSERT((~0l & ~0u) == 0xffffU)
+ LZOCHK_ASSERT((~0ul & ~0u) == 0xffffU)
+#elif (SIZEOF_INT == 4)
+ LZOCHK_ASSERT((~0l & ~0u) == 0xffffffffU)
+ LZOCHK_ASSERT((~0ul & ~0u) == 0xffffffffU)
+#endif
+#if (LZO_CC_INTELC && (__INTEL_COMPILER >= 900))
+# pragma warning(pop)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(signed char)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
+ LZOCHK_ASSERT(sizeof(signed char) == sizeof(char))
+ LZOCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
+ LZOCHK_ASSERT(sizeof(char) == 1)
+#if (LZO_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ LZOCHK_ASSERT(sizeof(char) == sizeof(LZO_STATIC_CAST(char, 0)))
+#endif
+#if defined(__cplusplus)
+ LZOCHK_ASSERT(sizeof('\0') == sizeof(char))
+#else
+# if (LZO_CC_DMC)
+# else
+ LZOCHK_ASSERT(sizeof('\0') == sizeof(int))
+# endif
+#endif
+#if defined(__lzo_alignof)
+ LZOCHK_ASSERT(__lzo_alignof(char) == 1)
+ LZOCHK_ASSERT(__lzo_alignof(signed char) == 1)
+ LZOCHK_ASSERT(__lzo_alignof(unsigned char) == 1)
+#if defined(lzo_int16e_t)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int16e_t) >= 1)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int16e_t) <= 2)
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int32e_t) >= 1)
+ LZOCHK_ASSERT(__lzo_alignof(lzo_int32e_t) <= 4)
+#endif
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(short)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
+ LZOCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(short) >= 2)
+#endif
+ LZOCHK_ASSERT(sizeof(short) >= sizeof(char))
+#if (LZO_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ LZOCHK_ASSERT(sizeof(short) == sizeof(LZO_STATIC_CAST(short, 0)))
+#endif
+#if (SIZEOF_SHORT > 0)
+ LZOCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(int)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
+ LZOCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(int) >= 2)
+#endif
+ LZOCHK_ASSERT(sizeof(int) >= sizeof(short))
+ LZOCHK_ASSERT(sizeof(int) == sizeof(0))
+ LZOCHK_ASSERT(sizeof(int) == sizeof(LZO_STATIC_CAST(int, 0)))
+#if (SIZEOF_INT > 0)
+ LZOCHK_ASSERT(sizeof(int) == SIZEOF_INT)
+#endif
+ LZOCHK_ASSERT(sizeof(0) == sizeof(int))
+ LZOCHK_ASSERT_IS_SIGNED_T(long)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
+ LZOCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
+#if !(LZO_ABI_I8LP16)
+ LZOCHK_ASSERT(sizeof(long) >= 4)
+#endif
+ LZOCHK_ASSERT(sizeof(long) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(long) == sizeof(0L))
+ LZOCHK_ASSERT(sizeof(long) == sizeof(LZO_STATIC_CAST(long, 0)))
+#if (SIZEOF_LONG > 0)
+ LZOCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
+#endif
+ LZOCHK_ASSERT(sizeof(0L) == sizeof(long))
+ LZOCHK_ASSERT_IS_UNSIGNED_T(size_t)
+ LZOCHK_ASSERT(sizeof(size_t) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0)))
+#if (SIZEOF_SIZE_T > 0)
+ LZOCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
+#endif
+ LZOCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
+#if !(LZO_BROKEN_SIZEOF)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(LZO_STATIC_CAST(char*, 0) - LZO_STATIC_CAST(char*, 0)))
+# if (LZO_HAVE_MM_HUGE_PTR)
+ LZOCHK_ASSERT(4 == sizeof(LZO_STATIC_CAST(char __huge*, 0) - LZO_STATIC_CAST(char __huge*, 0)))
+# endif
+#endif
+#if (SIZEOF_PTRDIFF_T > 0)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
+#endif
+ LZOCHK_ASSERT(sizeof(void*) >= sizeof(char*))
+#if (SIZEOF_VOID_P > 0)
+ LZOCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
+ LZOCHK_ASSERT(sizeof(char*) == SIZEOF_VOID_P)
+#endif
+#if (LZO_HAVE_MM_HUGE_PTR)
+ LZOCHK_ASSERT(4 == sizeof(void __huge*))
+ LZOCHK_ASSERT(4 == sizeof(char __huge*))
+#endif
+#if (LZO_ABI_I8LP16)
+ LZOCHK_ASSERT((((1u << 7) + 1) >> 7) == 1)
+ LZOCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1)
+#else
+ LZOCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
+ LZOCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#else
+ LZOCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
+#endif
+#endif
+ LZOCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
+#endif
+ LZOCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
+#if defined(lzo_int16e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint16e_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_int16e_t) == sizeof(lzo_uint16e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int16e_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint16e_t)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#else
+ LZOCHK_ASSERT((LZO_STATIC_CAST(lzo_uint16e_t, (~LZO_STATIC_CAST(lzo_uint16e_t,0ul))) >> 15) == 1)
+#endif
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_int16e_t, (1 + ~LZO_STATIC_CAST(lzo_int16e_t, 0))) == 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_uint16e_t, (1 + ~LZO_STATIC_CAST(lzo_uint16e_t, 0))) == 0)
+#endif
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32e_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32e_t) == sizeof(lzo_uint32e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32e_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32e_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32e_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32e_t, 1) << 31) + 1) >> 31) == 1)
+ LZOCHK_ASSERT((LZO_STATIC_CAST(lzo_uint32e_t, (~LZO_STATIC_CAST(lzo_uint32e_t, 0ul))) >> 31) == 1)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_int32e_t, (1 + ~LZO_STATIC_CAST(lzo_int32e_t, 0))) == 0)
+#if defined(LZOCHK_CFG_PEDANTIC)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(lzo_uint32e_t, (1 + ~LZO_STATIC_CAST(lzo_uint32e_t, 0))) == 0)
+#endif
+#endif
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) >= sizeof(lzo_int32e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32l_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32l_t) == sizeof(lzo_uint32l_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32l_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32l_t, 1) << 31) + 1) >> 31) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(int))
+#if defined(lzo_int32e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) >= sizeof(lzo_int32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint32f_t) >= 4)
+ LZOCHK_ASSERT(sizeof(lzo_uint32f_t) >= sizeof(lzo_uint32l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int32f_t) == sizeof(lzo_uint32f_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int32f_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int32f_t, 1) << 30) + 1) >> 30) == 1)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32f_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint32f_t, 1) << 31) + 1) >> 31) == 1)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64e_t) == 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64e_t) == sizeof(lzo_uint64e_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64e_t)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64e_t)
+#endif
+#endif
+#if defined(lzo_int64l_t)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) >= sizeof(lzo_int64e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64l_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64l_t) == sizeof(lzo_uint64l_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64l_t)
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_int64l_t, 1) << 62) + 1) >> 62) == 1)
+ LZOCHK_ASSERT(((( LZO_INT64_C(1) << 62) + 1) >> 62) == 1)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64l_t)
+ LZOCHK_ASSERT(LZO_UINT64_C(18446744073709551615) > 0)
+#endif
+ LZOCHK_ASSERT(((( LZO_STATIC_CAST(lzo_uint64l_t, 1) << 63) + 1) >> 63) == 1)
+ LZOCHK_ASSERT(((( LZO_UINT64_C(1) << 63) + 1) >> 63) == 1)
+#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020600ul))
+ LZOCHK_ASSERT(LZO_INT64_C(9223372036854775807) > LZO_INT64_C(0))
+#else
+ LZOCHK_ASSERT(LZO_INT64_C(9223372036854775807) > 0)
+#endif
+ LZOCHK_ASSERT(LZO_INT64_C(-9223372036854775807) - 1 < 0)
+ LZOCHK_ASSERT( LZO_INT64_C(9223372036854775807) % LZO_INT32_C(2147483629) == 721)
+ LZOCHK_ASSERT( LZO_INT64_C(9223372036854775807) % LZO_INT32_C(2147483647) == 1)
+ LZOCHK_ASSERT(LZO_UINT64_C(9223372036854775807) % LZO_UINT32_C(2147483629) == 721)
+ LZOCHK_ASSERT(LZO_UINT64_C(9223372036854775807) % LZO_UINT32_C(2147483647) == 1)
+#endif
+#if defined(lzo_int64f_t)
+#if defined(lzo_int64e_t)
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64e_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) >= sizeof(lzo_int64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T)
+ LZOCHK_ASSERT(sizeof(lzo_uint64f_t) >= 8)
+ LZOCHK_ASSERT(sizeof(lzo_uint64f_t) >= sizeof(lzo_uint64l_t))
+ LZOCHK_ASSERT(sizeof(lzo_int64f_t) == sizeof(lzo_uint64f_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int64f_t)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint64f_t)
+#endif
+#endif
+#if !defined(__LZO_INTPTR_T_IS_POINTER)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_intptr_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) >= sizeof(void *))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == LZO_SIZEOF_LZO_INTPTR_T)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t))
+#if defined(lzo_word_t)
+ LZOCHK_ASSERT(LZO_WORDSIZE == LZO_SIZEOF_LZO_WORD_T)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_word_t)
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_sword_t)
+ LZOCHK_ASSERT(sizeof(lzo_word_t) == LZO_SIZEOF_LZO_WORD_T)
+ LZOCHK_ASSERT(sizeof(lzo_word_t) == sizeof(lzo_sword_t))
+#endif
+ LZOCHK_ASSERT(sizeof(lzo_int8_t) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_uint8_t) == 1)
+ LZOCHK_ASSERT(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t))
+ LZOCHK_ASSERT_IS_SIGNED_T(lzo_int8_t)
+ LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint8_t)
+#if defined(LZO_INT16_C)
+ LZOCHK_ASSERT(sizeof(LZO_INT16_C(0)) >= 2)
+ LZOCHK_ASSERT(sizeof(LZO_UINT16_C(0)) >= 2)
+ LZOCHK_ASSERT((LZO_UINT16_C(0xffff) >> 15) == 1)
+#endif
+#if defined(LZO_INT32_C)
+ LZOCHK_ASSERT(sizeof(LZO_INT32_C(0)) >= 4)
+ LZOCHK_ASSERT(sizeof(LZO_UINT32_C(0)) >= 4)
+ LZOCHK_ASSERT((LZO_UINT32_C(0xffffffff) >> 31) == 1)
+#endif
+#if defined(LZO_INT64_C)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ < 0x0560))
+#else
+ LZOCHK_ASSERT(sizeof(LZO_INT64_C(0)) >= 8)
+ LZOCHK_ASSERT(sizeof(LZO_UINT64_C(0)) >= 8)
+#endif
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) >> 63) == 1)
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & ~0) == LZO_UINT64_C(0xffffffffffffffff))
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & ~0l) == LZO_UINT64_C(0xffffffffffffffff))
+#if (SIZEOF_INT == 4)
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# else
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & (~0u+0u)) == 0xffffffffu)
+# endif
+#endif
+#if (SIZEOF_LONG == 4)
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# else
+ LZOCHK_ASSERT((LZO_UINT64_C(0xffffffffffffffff) & (~0ul+0ul)) == 0xfffffffful)
+# endif
+#endif
+#endif
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+ LZOCHK_ASSERT(sizeof(void*) == 2)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 2)
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+#endif
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_COMPACT)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 2)
+#elif (LZO_MM_MEDIUM || LZO_MM_LARGE || LZO_MM_HUGE)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#endif
+#if (LZO_ABI_ILP32)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_ILP64)
+ LZOCHK_ASSERT(sizeof(int) == 8)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_IP32L64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LLP64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LP32)
+ LZOCHK_ASSERT(sizeof(int) == 2)
+ LZOCHK_ASSERT(sizeof(long) == 4)
+ LZOCHK_ASSERT(sizeof(void*) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ABI_LP64)
+ LZOCHK_ASSERT(sizeof(int) == 4)
+ LZOCHK_ASSERT(sizeof(long) == 8)
+ LZOCHK_ASSERT(sizeof(void*) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_ARCH_I086)
+ LZOCHK_ASSERT(sizeof(size_t) == 2)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#elif (LZO_ARCH_I386 || LZO_ARCH_M68K)
+ LZOCHK_ASSERT(sizeof(size_t) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ LZOCHK_ASSERT(sizeof(lzo_intptr_t) == sizeof(void *))
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32)
+ LZOCHK_ASSERT(sizeof(size_t) == 4)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#elif (LZO_OS_WIN64)
+ LZOCHK_ASSERT(sizeof(size_t) == 8)
+ LZOCHK_ASSERT(sizeof(ptrdiff_t) == 8)
+ LZOCHK_ASSERT(sizeof(void (*)(void)) == 8)
+#endif
+#if (LZO_CC_NDPC)
+#elif (SIZEOF_INT > 1)
+ LZOCHK_ASSERT( LZO_STATIC_CAST(int, LZO_STATIC_CAST(unsigned char, LZO_STATIC_CAST(signed char, -1))) == 255)
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_KEILC)
+#elif (LZO_CC_NDPC)
+#elif !(LZO_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+ LZOCHK_ASSERT( ((LZO_STATIC_CAST(unsigned char, 128)) << LZO_STATIC_CAST(int, (8*sizeof(int)-8))) < 0)
+#endif
+#endif
+#if defined(LZOCHK_CFG_PEDANTIC)
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
+# pragma option pop
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_VGET)
+# undef LZO_WANT_ACCLIB_VGET
+#define __LZOLIB_VGET_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_PUBLIC_NOINLINE)
+# if !defined(__lzo_noinline)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) r __LZOLIB_FUNCNAME(f)
+# elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline __attribute__((__used__)) r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+extern void* volatile lzo_vget_ptr__;
+#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+void* volatile __attribute__((__used__)) lzo_vget_ptr__ = LZO_STATIC_CAST(void *, 0);
+#else
+void* volatile lzo_vget_ptr__ = LZO_STATIC_CAST(void *, 0);
+#endif
+#ifndef __LZOLIB_VGET_BODY
+#define __LZOLIB_VGET_BODY(T) \
+ if __lzo_unlikely(lzo_vget_ptr__) { \
+ typedef T __lzo_may_alias TT; \
+ unsigned char e; expr &= 255; e = LZO_STATIC_CAST(unsigned char, expr); \
+ * LZO_STATIC_CAST(TT *, lzo_vget_ptr__) = v; \
+ * LZO_STATIC_CAST(unsigned char *, lzo_vget_ptr__) = e; \
+ v = * LZO_STATIC_CAST(TT *, lzo_vget_ptr__); \
+ } \
+ return v;
+#endif
+LZOLIB_PUBLIC_NOINLINE(short, lzo_vget_short) (short v, int expr)
+{
+ __LZOLIB_VGET_BODY(short)
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_vget_int) (int v, int expr)
+{
+ __LZOLIB_VGET_BODY(int)
+}
+LZOLIB_PUBLIC_NOINLINE(long, lzo_vget_long) (long v, int expr)
+{
+ __LZOLIB_VGET_BODY(long)
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC_NOINLINE(lzo_int64l_t, lzo_vget_lzo_int64l_t) (lzo_int64l_t v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_int64l_t)
+}
+#endif
+LZOLIB_PUBLIC_NOINLINE(lzo_hsize_t, lzo_vget_lzo_hsize_t) (lzo_hsize_t v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_hsize_t)
+}
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_PUBLIC_NOINLINE(double, lzo_vget_double) (double v, int expr)
+{
+ __LZOLIB_VGET_BODY(double)
+}
+#endif
+LZOLIB_PUBLIC_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_p) (lzo_hvoid_p v, int expr)
+{
+ __LZOLIB_VGET_BODY(lzo_hvoid_p)
+}
+#if (LZO_ARCH_I086 && LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) && !defined(__cplusplus)
+LZOLIB_PUBLIC_NOINLINE(lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p vv, int expr)
+{
+ lzo_hvoid_p v = (lzo_hvoid_p) vv;
+ __LZOLIB_VGET_BODY(lzo_hvoid_p)
+}
+#else
+LZOLIB_PUBLIC_NOINLINE(const lzo_hvoid_p, lzo_vget_lzo_hvoid_cp) (const lzo_hvoid_p v, int expr)
+{
+ __LZOLIB_VGET_BODY(const lzo_hvoid_p)
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_HMEMCPY)
+# undef LZO_WANT_ACCLIB_HMEMCPY
+#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) || !(HAVE_MEMCMP)
+ const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMCPY)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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) || !(HAVE_MEMMOVE)
+ lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest);
+ const lzo_hbyte_p p2 = LZO_STATIC_CAST(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 cc, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
+ lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s);
+ unsigned char c = LZO_ITRUNC(unsigned char, cc);
+ if __lzo_likely(len > 0) do
+ *p++ = c;
+ while __lzo_likely(--len > 0);
+ return s;
+#else
+ return memset(s, cc, len);
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_RAND)
+# undef LZO_WANT_ACCLIB_RAND
+#define __LZOLIB_RAND_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(void, lzo_srand31) (lzo_rand31_p r, lzo_uint32l_t seed)
+{
+ r->seed = seed & LZO_UINT32_C(0xffffffff);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand31) (lzo_rand31_p r)
+{
+ r->seed = r->seed * LZO_UINT32_C(1103515245) + 12345;
+ r->seed &= LZO_UINT32_C(0x7fffffff);
+ return r->seed;
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srand48) (lzo_rand48_p r, lzo_uint32l_t seed)
+{
+ r->seed = seed & LZO_UINT32_C(0xffffffff);
+ r->seed <<= 16; r->seed |= 0x330e;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand48) (lzo_rand48_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(25214903917) + 11;
+ r->seed &= LZO_UINT64_C(0xffffffffffff);
+ a = r->seed >> 17;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand48_r32) (lzo_rand48_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(25214903917) + 11;
+ r->seed &= LZO_UINT64_C(0xffffffffffff);
+ a = r->seed >> 16;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+#endif
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srand64) (lzo_rand64_p r, lzo_uint64l_t seed)
+{
+ r->seed = seed & LZO_UINT64_C(0xffffffffffffffff);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand64) (lzo_rand64_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(6364136223846793005) + 1;
+#if (LZO_SIZEOF_LZO_INT64L_T > 8)
+ r->seed &= LZO_UINT64_C(0xffffffffffffffff);
+#endif
+ a = r->seed >> 33;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_rand64_r32) (lzo_rand64_p r)
+{
+ lzo_uint64l_t a;
+ r->seed = r->seed * LZO_UINT64_C(6364136223846793005) + 1;
+#if (LZO_SIZEOF_LZO_INT64L_T > 8)
+ r->seed &= LZO_UINT64_C(0xffffffffffffffff);
+#endif
+ a = r->seed >> 32;
+ return LZO_STATIC_CAST(lzo_uint32l_t, a);
+}
+#endif
+LZOLIB_PUBLIC(void, lzo_srandmt) (lzo_randmt_p r, lzo_uint32l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= LZO_UINT32_C(0xffffffff));
+ seed ^= seed >> 30;
+ seed = seed * LZO_UINT32_C(0x6c078965) + i;
+ } while (i != 624);
+ r->n = i;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt) (lzo_randmt_p r)
+{
+ return (__LZOLIB_FUNCNAME(lzo_randmt_r32)(r)) >> 1;
+}
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt_r32) (lzo_randmt_p r)
+{
+ lzo_uint32l_t v;
+ if __lzo_unlikely(r->n == 624) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 623; if (LZO_STATIC_CAST(int, j) < 0) j += 624;
+ v = (r->s[i] & LZO_UINT32_C(0x80000000)) ^ (r->s[j] & LZO_UINT32_C(0x7fffffff));
+ j = i - 227; if (LZO_STATIC_CAST(int, j) < 0) j += 624;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= LZO_UINT32_C(0x9908b0df);
+ } while (++i != 624);
+ }
+ { unsigned i = r->n++; v = r->s[i]; }
+ v ^= v >> 11; v ^= (v & LZO_UINT32_C(0x013a58ad)) << 7;
+ v ^= (v & LZO_UINT32_C(0x0001df8c)) << 15; v ^= v >> 18;
+ return v;
+}
+#if defined(lzo_int64l_t)
+LZOLIB_PUBLIC(void, lzo_srandmt64) (lzo_randmt64_p r, lzo_uint64l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= LZO_UINT64_C(0xffffffffffffffff));
+ seed ^= seed >> 62;
+ seed = seed * LZO_UINT64_C(0x5851f42d4c957f2d) + i;
+ } while (i != 312);
+ r->n = i;
+}
+#if 0
+LZOLIB_PUBLIC(lzo_uint32l_t, lzo_randmt64) (lzo_randmt64_p r)
+{
+ lzo_uint64l_t v;
+ v = (__LZOLIB_FUNCNAME(lzo_randmt64_r64)(r)) >> 33;
+ return LZO_STATIC_CAST(lzo_uint32l_t, v);
+}
+#endif
+LZOLIB_PUBLIC(lzo_uint64l_t, lzo_randmt64_r64) (lzo_randmt64_p r)
+{
+ lzo_uint64l_t v;
+ if __lzo_unlikely(r->n == 312) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 311; if (LZO_STATIC_CAST(int, j) < 0) j += 312;
+ v = (r->s[i] & LZO_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & LZO_UINT64_C(0x7fffffff));
+ j = i - 156; if (LZO_STATIC_CAST(int, j) < 0) j += 312;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= LZO_UINT64_C(0xb5026f5aa96619e9);
+ } while (++i != 312);
+ }
+ { unsigned i = r->n++; v = r->s[i]; }
+ v ^= (v & LZO_UINT64_C(0xaaaaaaaaa0000000)) >> 29;
+ v ^= (v & LZO_UINT64_C(0x38eb3ffff6d3)) << 17;
+ v ^= (v & LZO_UINT64_C(0x7ffbf77)) << 37;
+ return v ^ (v >> 43);
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_RDTSC)
+# undef LZO_WANT_ACCLIB_RDTSC
+#define __LZOLIB_RDTSC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if defined(lzo_int32e_t)
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_AMD64 && LZO_CC_INTELC)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "memory", "rax", "rdx"
+#elif (LZO_ARCH_AMD64)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "rax", "rdx"
+#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "ax", "dx"
+#elif (LZO_ARCH_I386 && LZO_CC_INTELC)
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "memory", "eax", "edx"
+#else
+# define __LZOLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "eax", "edx"
+#endif
+#endif
+LZOLIB_PUBLIC(int, lzo_tsc_read) (lzo_uint32e_t* t)
+{
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__(
+ "clc \n" ".byte 0x0f,0x31\n"
+ "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
+ __LZOLIB_RDTSC_REGS
+ );
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ LZO_UNUSED(t);
+ __asm {
+ mov ecx, t
+ clc
+# if (LZO_CC_MSC && (_MSC_VER < 1200))
+ _emit 0x0f
+ _emit 0x31
+# else
+ rdtsc
+# endif
+ mov [ecx], eax
+ mov [ecx+4], edx
+ }
+ return 0;
+#else
+ t[0] = t[1] = 0; return -1;
+#endif
+}
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_DOSALLOC)
+# undef LZO_WANT_ACCLIB_DOSALLOC
+#define __LZOLIB_DOSALLOC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_OS_OS216)
+LZO_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+LZO_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_WIN16)
+#if !(LZO_CC_AZTECC)
+LZOLIB_PUBLIC(void __far*, lzo_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ union REGS ri, ro;
+ if ((long)size <= 0)
+ return p;
+ size = (size + 15) >> 4;
+ if (size > 0xffffu)
+ return p;
+ ri.x.ax = 0x4800;
+ ri.x.bx = (unsigned short) size;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ p = (void __far*) LZO_PTR_MK_FP(ro.x.ax, 0);
+ return p;
+}
+LZOLIB_PUBLIC(int, lzo_dos_free) (void __far* p)
+{
+ union REGS ri, ro;
+ struct SREGS rs;
+ if (!p)
+ return 0;
+ if (LZO_PTR_FP_OFF(p) != 0)
+ return -1;
+ segread(&rs);
+ ri.x.ax = 0x4900;
+ rs.es = LZO_PTR_FP_SEG(p);
+ int86x(0x21, &ri, &ro, &rs);
+ if (ro.x.cflag & 1)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if (LZO_OS_OS216)
+LZOLIB_PUBLIC(void __far*, lzo_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ unsigned short sel = 0;
+ if ((long)size <= 0)
+ return p;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (void __far*) LZO_PTR_MK_FP(sel, 0);
+ return p;
+}
+LZOLIB_PUBLIC(int, lzo_dos_free) (void __far* p)
+{
+ if (!p)
+ return 0;
+ if (LZO_PTR_FP_OFF(p) != 0)
+ return -1;
+ if (DosFreeSeg(LZO_PTR_FP_SEG(p)) != 0)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_GETOPT)
+# undef LZO_WANT_ACCLIB_GETOPT
+#define __LZOLIB_GETOPT_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(void, lzo_getopt_init) (lzo_getopt_p g,
+ int start_argc, int argc, char** argv)
+{
+ memset(g, 0, sizeof(*g));
+ g->optind = start_argc;
+ g->argc = argc; g->argv = argv;
+ g->optopt = -1;
+}
+static int __LZOLIB_FUNCNAME(lzo_getopt_rotate) (char** p, int first, int middle, int last)
+{
+ int i = middle, n = middle - first;
+ if (first >= middle || middle >= last) return 0;
+ for (;;)
+ {
+ char* t = p[first]; p[first] = p[i]; p[i] = t;
+ if (++first == middle)
+ {
+ if (++i == last) break;
+ middle = i;
+ }
+ else if (++i == last)
+ i = middle;
+ }
+ return n;
+}
+static int __LZOLIB_FUNCNAME(lzo_getopt_perror) (lzo_getopt_p g, int ret, const char* f, ...)
+{
+ if (g->opterr)
+ {
+#if (HAVE_STDARG_H)
+ struct { va_list ap; } s;
+ va_start(s.ap, f);
+ g->opterr(g, f, &s);
+ va_end(s.ap);
+#else
+ g->opterr(g, f, NULL);
+#endif
+ }
+ ++g->errcount;
+ return ret;
+}
+LZOLIB_PUBLIC(int, lzo_getopt) (lzo_getopt_p g,
+ const char* shortopts,
+ const lzo_getopt_longopt_p longopts,
+ int* longind)
+{
+#define pe __LZOLIB_FUNCNAME(lzo_getopt_perror)
+ int ordering = LZO_GETOPT_PERMUTE;
+ int missing_arg_ret = g->bad_option;
+ char* a;
+ if (shortopts)
+ {
+ if (*shortopts == '-' || *shortopts == '+')
+ ordering = *shortopts++ == '-' ? LZO_GETOPT_RETURN_IN_ORDER : LZO_GETOPT_REQUIRE_ORDER;
+ if (*shortopts == ':')
+ missing_arg_ret = *shortopts++;
+ }
+ g->optarg = NULL;
+ if (g->optopt == -1)
+ g->optopt = g->bad_option;
+ if (longind)
+ *longind = -1;
+ if (g->eof)
+ return -1;
+ if (g->shortpos)
+ goto lzo_label_next_shortopt;
+ g->optind -= __LZOLIB_FUNCNAME(lzo_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ if (ordering == LZO_GETOPT_PERMUTE)
+ {
+ while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
+ ++g->optind;
+ g->pending_rotate_middle = g->optind;
+ }
+ if (g->optind >= g->argc)
+ {
+ g->optind = g->pending_rotate_first;
+ goto lzo_label_eof;
+ }
+ a = g->argv[g->optind];
+ if (a[0] == '-' && a[1] == '-')
+ {
+ size_t l = 0;
+ const lzo_getopt_longopt_p o;
+ const lzo_getopt_longopt_p o1 = NULL;
+ const lzo_getopt_longopt_p o2 = NULL;
+ int need_exact = 0;
+ ++g->optind;
+ if (!a[2])
+ goto lzo_label_eof;
+ for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
+ ++l;
+ for (o = longopts; l && o && o->name; ++o)
+ {
+ if (strncmp(a, o->name, l) != 0)
+ continue;
+ if (!o->name[l])
+ goto lzo_label_found_o;
+ need_exact |= o->has_arg & LZO_GETOPT_EXACT_ARG;
+ if (o1) o2 = o;
+ else o1 = o;
+ }
+ if (!o1 || need_exact)
+ return pe(g, g->bad_option, "unrecognized option '--%s'", a);
+ if (o2)
+ return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
+ o = o1;
+ lzo_label_found_o:
+ a += l;
+ switch (o->has_arg & 0x2f)
+ {
+ case LZO_GETOPT_OPTIONAL_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ break;
+ case LZO_GETOPT_REQUIRED_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ else if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
+ break;
+ case LZO_GETOPT_REQUIRED_ARG | 0x20:
+ if (a[0] && a[1])
+ g->optarg = a + 1;
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
+ break;
+ default:
+ if (a[0])
+ return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
+ break;
+ }
+ if (longind)
+ *longind = (int) (o - longopts);
+ if (o->flag)
+ {
+ *o->flag = o->val;
+ return 0;
+ }
+ return o->val;
+ }
+ if (a[0] == '-' && a[1])
+ {
+ unsigned char c;
+ const char* s;
+ lzo_label_next_shortopt:
+ a = g->argv[g->optind] + ++g->shortpos;
+ c = (unsigned char) *a++; s = NULL;
+ if (c != ':' && shortopts)
+ s = strchr(shortopts, c);
+ if (!s || s[1] != ':')
+ {
+ if (!a[0])
+ ++g->optind, g->shortpos = 0;
+ if (!s)
+ {
+ g->optopt = c;
+ return pe(g, g->bad_option, "invalid option '-%c'", c);
+ }
+ }
+ else
+ {
+ ++g->optind, g->shortpos = 0;
+ if (a[0])
+ g->optarg = a;
+ else if (s[2] != ':')
+ {
+ if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ else
+ {
+ g->optopt = c;
+ return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
+ }
+ }
+ }
+ return c;
+ }
+ if (ordering == LZO_GETOPT_RETURN_IN_ORDER)
+ {
+ ++g->optind;
+ g->optarg = a;
+ return 1;
+ }
+lzo_label_eof:
+ g->optind -= __LZOLIB_FUNCNAME(lzo_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ g->eof = 1;
+ return -1;
+#undef pe
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HALLOC)
+# undef LZO_WANT_ACCLIB_HALLOC
+#define __LZOLIB_HALLOC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_OS216)
+# define __LZOLIB_HALLOC_USE_DAH 1
+#elif 1 && (LZO_OS_WIN16)
+# define __LZOLIB_HALLOC_USE_GA 1
+#elif 1 && (LZO_OS_DOS16) && (LZO_CC_BORLANDC) && defined(__DPMI16__)
+# define __LZOLIB_HALLOC_USE_GA 1
+#endif
+#endif
+#if (__LZOLIB_HALLOC_USE_DAH)
+#if 0 && (LZO_OS_OS216)
+#include <os2.h>
+#else
+LZO_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+LZO_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#endif
+#if (__LZOLIB_HALLOC_USE_GA)
+#if 0
+#define STRICT 1
+#include <windows.h>
+#else
+LZO_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long);
+LZO_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*);
+LZO_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned);
+LZO_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*);
+LZO_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
+#endif
+#endif
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_halloc) (lzo_hsize_t size)
+{
+ lzo_hvoid_p p = LZO_STATIC_CAST(lzo_hvoid_p, 0);
+ if (!(size > 0))
+ return p;
+#if 0 && defined(__palmos__)
+ p = MemPtrNew(size);
+#elif !(LZO_HAVE_MM_HUGE_PTR)
+ if (size < LZO_STATIC_CAST(size_t, -1))
+ p = malloc(LZO_STATIC_CAST(size_t, size));
+#else
+ if (LZO_STATIC_CAST(long, size) <= 0)
+ return p;
+{
+#if (__LZOLIB_HALLOC_USE_DAH)
+ unsigned short sel = 0;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (lzo_hvoid_p) LZO_PTR_MK_FP(sel, 0);
+#elif (__LZOLIB_HALLOC_USE_GA)
+ const void __near* h = GlobalAlloc(2, size);
+ if (h) {
+ p = GlobalLock(h);
+ if (p && LZO_PTR_FP_OFF(p) != 0) {
+ GlobalUnlock(h);
+ p = 0;
+ }
+ if (!p)
+ GlobalFree(h);
+ }
+#elif (LZO_CC_MSC && (_MSC_VER >= 700))
+ p = _halloc(size, 1);
+#elif (LZO_CC_MSC || LZO_CC_WATCOMC)
+ p = halloc(size, 1);
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ p = farmalloc(size);
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+ p = farmalloc(size);
+#elif (LZO_CC_AZTECC)
+ p = lmalloc(size);
+#else
+ if (size < LZO_STATIC_CAST(size_t, -1))
+ p = malloc((size_t) size);
+#endif
+}
+#endif
+ return p;
+}
+LZOLIB_PUBLIC(void, lzo_hfree) (lzo_hvoid_p p)
+{
+ if (!p)
+ return;
+#if 0 && defined(__palmos__)
+ MemPtrFree(p);
+#elif !(LZO_HAVE_MM_HUGE_PTR)
+ free(p);
+#else
+#if (__LZOLIB_HALLOC_USE_DAH)
+ if (LZO_PTR_FP_OFF(p) == 0)
+ DosFreeSeg((unsigned short) LZO_PTR_FP_SEG(p));
+#elif (__LZOLIB_HALLOC_USE_GA)
+ if (LZO_PTR_FP_OFF(p) == 0) {
+ const void __near* h = (const void __near*) (unsigned) GlobalHandle(LZO_PTR_FP_SEG(p));
+ if (h) {
+ GlobalUnlock(h);
+ GlobalFree(h);
+ }
+ }
+#elif (LZO_CC_MSC && (_MSC_VER >= 700))
+ _hfree(p);
+#elif (LZO_CC_MSC || LZO_CC_WATCOMC)
+ hfree(p);
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ farfree((void __far*) p);
+#elif (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+ farfree((void __far*) p);
+#elif (LZO_CC_AZTECC)
+ lfree(p);
+#else
+ free(p);
+#endif
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HFREAD)
+# undef LZO_WANT_ACCLIB_HFREAD
+#define __LZOLIB_HFREAD_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(lzo_hsize_t, lzo_hfread) (void* vfp, lzo_hvoid_p buf, lzo_hsize_t size)
+{
+ FILE* fp = LZO_STATIC_CAST(FILE *, vfp);
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+#define __LZOLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ n = fread(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ __LZOLIB_FUNCNAME(lzo_hmemcpy)((lzo_hbyte_p)buf + l, tmp, (lzo_hsize_t)n);
+ l += n;
+ }
+ return l;
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ lzo_hbyte_p b = (lzo_hbyte_p) buf;
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = LZO_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((lzo_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fread((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fread(buf, 1, size, fp);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hsize_t, lzo_hfwrite) (void* vfp, const lzo_hvoid_p buf, lzo_hsize_t size)
+{
+ FILE* fp = LZO_STATIC_CAST(FILE *, vfp);
+#if (LZO_HAVE_MM_HUGE_PTR)
+#if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+#define __LZOLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ __LZOLIB_FUNCNAME(lzo_hmemcpy)(tmp, (const lzo_hbyte_p)buf + l, (lzo_hsize_t)n);
+ n = fwrite(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ l += n;
+ }
+ return l;
+#elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+ const lzo_hbyte_p b = (const lzo_hbyte_p) buf;
+ lzo_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = LZO_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((lzo_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fwrite((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fwrite(buf, 1, size, fp);
+#endif
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_HSREAD)
+# undef LZO_WANT_ACCLIB_HSREAD
+#define __LZOLIB_HSREAD_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(long, lzo_safe_hread) (int fd, lzo_hvoid_p buf, long size)
+{
+ lzo_hbyte_p b = (lzo_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define __LZOLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = lzo_hread(fd, b, n);
+#elif (LZO_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _read(fd, b, n);
+#else
+ errno = 0; n = read(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+LZOLIB_PUBLIC(long, lzo_safe_hwrite) (int fd, const lzo_hvoid_p buf, long size)
+{
+ const lzo_hbyte_p b = (const lzo_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (LZO_HAVE_MM_HUGE_PTR)
+# define __LZOLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = lzo_hwrite(fd, b, n);
+#elif (LZO_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _write(fd, b, n);
+#else
+ errno = 0; n = write(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+#endif
+#if defined(LZO_WANT_ACCLIB_PCLOCK)
+# undef LZO_WANT_ACCLIB_PCLOCK
+#define __LZOLIB_PCLOCK_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if 1 && (LZO_OS_POSIX_LINUX && LZO_ARCH_AMD64 && LZO_ASM_SYNTAX_GNUC)
+#ifndef lzo_pclock_syscall_clock_gettime
+#define lzo_pclock_syscall_clock_gettime lzo_pclock_syscall_clock_gettime
+#endif
+__lzo_static_noinline long lzo_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ unsigned long r = 228;
+ __asm__ __volatile__("syscall\n" : "=a" (r) : "0" (r), "D" (clockid), "S" (ts) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICAST(long, r);
+}
+#endif
+#if 1 && (LZO_OS_POSIX_LINUX && LZO_ARCH_I386 && LZO_ASM_SYNTAX_GNUC) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_syscall_clock_gettime
+#define lzo_pclock_syscall_clock_gettime lzo_pclock_syscall_clock_gettime
+#endif
+__lzo_static_noinline long lzo_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ unsigned long r = 265;
+ __asm__ __volatile__("pushl %%ebx\n pushl %%edx\n popl %%ebx\n int $0x80\n popl %%ebx\n" : "=a" (r) : "0" (r), "d" (clockid), "c" (ts) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICAST(long, r);
+}
+#endif
+#if 0 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_r_syscall
+#define lzo_pclock_read_clock_gettime_r_syscall lzo_pclock_read_clock_gettime_r_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_r_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(0, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETTIMEOFDAY)
+#ifndef lzo_pclock_read_gettimeofday
+#define lzo_pclock_read_gettimeofday lzo_pclock_read_gettimeofday
+#endif
+static int lzo_pclock_read_gettimeofday(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) != 0)
+ return -1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = tv.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = tv.tv_sec;
+#endif
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (tv.tv_usec * 1000u));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if defined(CLOCKS_PER_SEC) && !(LZO_CFG_NO_DOUBLE)
+#ifndef lzo_pclock_read_clock
+#define lzo_pclock_read_clock lzo_pclock_read_clock
+#endif
+static int lzo_pclock_read_clock(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ clock_t ticks;
+ double secs;
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t nsecs;
+ ticks = clock();
+ secs = LZO_STATIC_CAST(double, ticks) / (CLOCKS_PER_SEC);
+ nsecs = LZO_STATIC_CAST(lzo_uint64l_t, (secs * 1000000000.0));
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (nsecs / 1000000000ul));
+ nsecs = (nsecs % 1000000000ul);
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, nsecs);
+#else
+ ticks = clock();
+ secs = LZO_STATIC_CAST(double, ticks) / (CLOCKS_PER_SEC);
+ c->tv_sec_high = 0;
+ c->tv_sec_low = LZO_STATIC_CAST(lzo_uint32l_t, (secs + 0.5));
+ c->tv_nsec = 0;
+#endif
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_m_syscall
+#define lzo_pclock_read_clock_gettime_m_syscall lzo_pclock_read_clock_gettime_m_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_m_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(1, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC) && !(LZO_CFG_NO_DOUBLE)
+#ifndef lzo_pclock_read_uclock
+#define lzo_pclock_read_uclock lzo_pclock_read_uclock
+#endif
+static int lzo_pclock_read_uclock(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ lzo_uint64l_t ticks;
+ double secs;
+ lzo_uint64l_t nsecs;
+ ticks = uclock();
+ secs = LZO_STATIC_CAST(double, ticks) / (UCLOCKS_PER_SEC);
+ nsecs = LZO_STATIC_CAST(lzo_uint64l_t, (secs * 1000000000.0));
+ c->tv_sec = nsecs / 1000000000ul;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (nsecs % 1000000000ul));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_clock_gettime_p_libc
+#define lzo_pclock_read_clock_gettime_p_libc lzo_pclock_read_clock_gettime_p_libc
+#endif
+static int lzo_pclock_read_clock_gettime_p_libc(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_p_syscall
+#define lzo_pclock_read_clock_gettime_p_syscall lzo_pclock_read_clock_gettime_p_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_p_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(2, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_CYGWIN || LZO_OS_WIN32 || LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_getprocesstimes
+#define lzo_pclock_read_getprocesstimes lzo_pclock_read_getprocesstimes
+#endif
+static int lzo_pclock_read_getprocesstimes(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ lzo_uint64l_t ticks;
+ if (GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = (LZO_STATIC_CAST(lzo_uint64l_t, ut.dwHighDateTime) << 32) | ut.dwLowDateTime;
+ if __lzo_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (ticks / 10000000ul));
+ ticks = (ticks % 10000000ul) * 100u;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ticks);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
+#ifndef lzo_pclock_read_getrusage
+#define lzo_pclock_read_getrusage lzo_pclock_read_getrusage
+#endif
+static int lzo_pclock_read_getrusage(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) != 0)
+ return -1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = ru.ru_utime.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = ru.ru_utime.tv_sec;
+#endif
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, (ru.ru_utime.tv_usec * 1000u));
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_clock_gettime_t_libc
+#define lzo_pclock_read_clock_gettime_t_libc lzo_pclock_read_clock_gettime_t_libc
+#endif
+static int lzo_pclock_read_clock_gettime_t_libc(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = (lzo_uint32l_t) ts.tv_nsec;
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(lzo_pclock_syscall_clock_gettime)
+#ifndef lzo_pclock_read_clock_gettime_t_syscall
+#define lzo_pclock_read_clock_gettime_t_syscall lzo_pclock_read_clock_gettime_t_syscall
+#endif
+static int lzo_pclock_read_clock_gettime_t_syscall(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ struct timespec ts;
+ if (lzo_pclock_syscall_clock_gettime(3, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ts.tv_nsec);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+#if (LZO_OS_CYGWIN || LZO_OS_WIN32 || LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H) && defined(lzo_int64l_t)
+#ifndef lzo_pclock_read_getthreadtimes
+#define lzo_pclock_read_getthreadtimes lzo_pclock_read_getthreadtimes
+#endif
+static int lzo_pclock_read_getthreadtimes(lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ lzo_uint64l_t ticks;
+ if (GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = (LZO_STATIC_CAST(lzo_uint64l_t, ut.dwHighDateTime) << 32) | ut.dwLowDateTime;
+ if __lzo_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = LZO_STATIC_CAST(lzo_int64l_t, (ticks / 10000000ul));
+ ticks = (ticks % 10000000ul) * 100u;
+ c->tv_nsec = LZO_STATIC_CAST(lzo_uint32l_t, ticks);
+ LZO_UNUSED(h); return 0;
+}
+#endif
+LZOLIB_PUBLIC(int, lzo_pclock_open) (lzo_pclock_handle_p h, int mode)
+{
+ lzo_pclock_t c;
+ int i;
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 0);
+ h->mode = -1;
+ h->read_error = 2;
+ h->name = NULL;
+ h->gettime = LZO_STATIC_CAST(lzo_pclock_gettime_t, 0);
+#if defined(lzo_int64l_t)
+ h->ticks_base = 0;
+#endif
+ switch (mode)
+ {
+ case LZO_PCLOCK_REALTIME:
+# if defined(lzo_pclock_read_clock_gettime_r_syscall)
+ if (lzo_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_r_syscall;
+ h->name = "CLOCK_REALTIME/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_gettimeofday)
+ if (lzo_pclock_read_gettimeofday(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_gettimeofday;
+ h->name = "gettimeofday";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_MONOTONIC:
+# if defined(lzo_pclock_read_clock_gettime_m_syscall)
+ if (lzo_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_m_syscall;
+ h->name = "CLOCK_MONOTONIC/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_uclock)
+ if (lzo_pclock_read_uclock(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_uclock;
+ h->name = "uclock";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock)
+ if (lzo_pclock_read_clock(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock;
+ h->name = "clock";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_PROCESS_CPUTIME_ID:
+# if defined(lzo_pclock_read_getprocesstimes)
+ if (lzo_pclock_read_getprocesstimes(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getprocesstimes;
+ h->name = "GetProcessTimes";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_p_syscall)
+ if (lzo_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_p_syscall;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_p_libc)
+ if (lzo_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_p_libc;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_getrusage)
+ if (lzo_pclock_read_getrusage(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getrusage;
+ h->name = "getrusage";
+ break;
+ }
+# endif
+ break;
+ case LZO_PCLOCK_THREAD_CPUTIME_ID:
+# if defined(lzo_pclock_read_getthreadtimes)
+ if (lzo_pclock_read_getthreadtimes(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_getthreadtimes;
+ h->name = "GetThreadTimes";
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_t_syscall)
+ if (lzo_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_t_syscall;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(lzo_pclock_read_clock_gettime_t_libc)
+ if (lzo_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
+ h->gettime = lzo_pclock_read_clock_gettime_t_libc;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+ break;
+ }
+ if (!h->gettime)
+ return -1;
+ if (!h->h)
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 1);
+ h->mode = mode;
+ h->read_error = 0;
+ if (!h->name)
+ h->name = "unknown";
+ for (i = 0; i < 10; i++) {
+ __LZOLIB_FUNCNAME(lzo_pclock_read)(h, &c);
+ }
+ return 0;
+}
+LZOLIB_PUBLIC(int, lzo_pclock_open_default) (lzo_pclock_handle_p h)
+{
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_PROCESS_CPUTIME_ID) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_MONOTONIC) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_REALTIME) == 0)
+ return 0;
+ if (__LZOLIB_FUNCNAME(lzo_pclock_open)(h, LZO_PCLOCK_THREAD_CPUTIME_ID) == 0)
+ return 0;
+ return -1;
+}
+LZOLIB_PUBLIC(int, lzo_pclock_close) (lzo_pclock_handle_p h)
+{
+ h->h = LZO_STATIC_CAST(lzolib_handle_t, 0);
+ h->mode = -1;
+ h->name = NULL;
+ h->gettime = LZO_STATIC_CAST(lzo_pclock_gettime_t, 0);
+ return 0;
+}
+LZOLIB_PUBLIC(void, lzo_pclock_read) (lzo_pclock_handle_p h, lzo_pclock_p c)
+{
+ if (h->gettime) {
+ if (h->gettime(h, c) == 0)
+ return;
+ }
+ h->read_error = 1;
+#if defined(lzo_int64l_t)
+ c->tv_sec = 0;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = 0;
+#endif
+ c->tv_nsec = 0;
+}
+#if !(LZO_CFG_NO_DOUBLE)
+LZOLIB_PUBLIC(double, lzo_pclock_get_elapsed) (lzo_pclock_handle_p h, const lzo_pclock_p start, const lzo_pclock_p stop)
+{
+ if (!h->h) { h->mode = -1; return 0.0; }
+ {
+#if 1 && (LZO_ARCH_I386 && LZO_CC_GNUC) && defined(__STRICT_ALIGNMENT__)
+ float tstop, tstart;
+ tstop = LZO_STATIC_CAST(float, (stop->tv_sec + stop->tv_nsec / 1000000000.0));
+ tstart = LZO_STATIC_CAST(float, (start->tv_sec + start->tv_nsec / 1000000000.0));
+#elif defined(lzo_int64l_t)
+ double tstop, tstart;
+#if 1 && (LZO_CC_INTELC)
+ { lzo_int64l_t a = stop->tv_sec; lzo_uint32l_t b = stop->tv_nsec;
+ tstop = a + b / 1000000000.0; }
+ { lzo_int64l_t a = start->tv_sec; lzo_uint32l_t b = start->tv_nsec;
+ tstart = a + b / 1000000000.0; }
+#else
+ tstop = stop->tv_sec + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec + start->tv_nsec / 1000000000.0;
+#endif
+#else
+ double tstop, tstart;
+ tstop = stop->tv_sec_low + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec_low + start->tv_nsec / 1000000000.0;
+#endif
+ return tstop - tstart;
+ }
+}
+#endif
+LZOLIB_PUBLIC(int, lzo_pclock_flush_cpu_cache) (lzo_pclock_handle_p h, unsigned flags)
+{
+ LZO_UNUSED(h); LZO_UNUSED(flags);
+ return -1;
+}
+#if defined(__LZOLIB_PCLOCK_NEED_WARN_POP)
+# if (LZO_CC_MSC && (_MSC_VER >= 1200))
+# pragma warning(pop)
+# else
+# error "__LZOLIB_PCLOCK_NEED_WARN_POP"
+# endif
+# undef __LZOLIB_PCLOCK_NEED_WARN_POP
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_MISC)
+# undef LZO_WANT_ACCLIB_MISC
+#define __LZOLIB_MISC_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if !defined(LZOLIB_PUBLIC_NOINLINE)
+# if !defined(__lzo_noinline)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) r __LZOLIB_FUNCNAME(f)
+# elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || LZO_CC_LLVM)
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline __attribute__((__used__)) r __LZOLIB_FUNCNAME(f)
+# else
+# define LZOLIB_PUBLIC_NOINLINE(r,f) __lzo_noinline r __LZOLIB_FUNCNAME(f)
+# endif
+#endif
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+LZOLIB_PUBLIC(const char *, lzo_getenv) (const char *s)
+{
+#if (HAVE_GETENV)
+ return getenv(s);
+#else
+ LZO_UNUSED(s); return LZO_STATIC_CAST(const char *, 0);
+#endif
+}
+LZOLIB_PUBLIC(lzo_intptr_t, lzo_get_osfhandle) (int fd)
+{
+ if (fd < 0)
+ return -1;
+#if (LZO_OS_CYGWIN)
+ return get_osfhandle(fd);
+#elif (LZO_OS_EMX && defined(__RSXNT__))
+ return -1;
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ return -1;
+#elif (LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_PELLESC && (__POCC__ < 280))
+ return -1;
+# elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+ return -1;
+# elif (LZO_CC_WATCOMC && (__WATCOMC__ < 1100))
+ return _os_handle(fd);
+# else
+ return _get_osfhandle(fd);
+# endif
+#else
+ return fd;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_set_binmode) (int fd, int binary)
+{
+#if (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC) && defined(__MINT__)
+ FILE* fp; int old_binary;
+ if (fd == STDIN_FILENO) fp = stdin;
+ else if (fd == STDOUT_FILENO) fp = stdout;
+ else if (fd == STDERR_FILENO) fp = stderr;
+ else return -1;
+ old_binary = fp->__mode.__binary;
+ __set_binmode(fp, binary ? 1 : 0);
+ return old_binary ? 1 : 0;
+#elif (LZO_ARCH_M68K && LZO_OS_TOS)
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_DOS16 && (LZO_CC_AZTECC || LZO_CC_PACIFICC))
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+ int r; unsigned old_flags = __djgpp_hwint_flags;
+ LZO_COMPILE_TIME_ASSERT(O_BINARY > 0)
+ LZO_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u))
+ __djgpp_set_ctrl_c(!(old_flags & 1));
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ if (fd < 0) return -1;
+ LZO_UNUSED(binary);
+ return 1;
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC)
+ FILE* fp; int r;
+ if (fd == fileno(stdin)) fp = stdin;
+ else if (fd == fileno(stdout)) fp = stdout;
+ else if (fd == fileno(stderr)) fp = stderr;
+ else return -1;
+ r = _setmode(fp, binary ? _BINARY : _TEXT);
+ if (r == -1) return -1;
+ return (r & _BINARY) ? 1 : 0;
+#elif (LZO_OS_WIN32 && LZO_CC_MWERKS) && defined(__MSL__)
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_CYGWIN && (LZO_CC_GNUC < 0x025a00ul))
+ LZO_UNUSED(fd); LZO_UNUSED(binary);
+ return -1;
+#elif (LZO_OS_CYGWIN || LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_EMX || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+ int r;
+#if !(LZO_CC_ZORTECHC)
+ LZO_COMPILE_TIME_ASSERT(O_BINARY > 0)
+#endif
+ LZO_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#else
+ if (fd < 0) return -1;
+ LZO_UNUSED(binary);
+ return 1;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_isatty) (int fd)
+{
+ if (fd < 0)
+ return 0;
+#if (LZO_OS_DOS16 && !(LZO_CC_AZTECC))
+ {
+ union REGS ri, ro;
+ ri.x.ax = 0x4400; ri.x.bx = fd;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ if ((ro.x.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (LZO_OS_DOS32 && LZO_CC_WATCOMC)
+ {
+ union REGS ri, ro;
+ ri.w.ax = 0x4400; ri.w.bx = LZO_STATIC_CAST(unsigned short, fd);
+ int386(0x21, &ri, &ro);
+ if ((ro.w.cflag & 1) == 0)
+ if ((ro.w.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (LZO_HAVE_WINDOWS_H)
+ {
+ lzo_intptr_t h = __LZOLIB_FUNCNAME(lzo_get_osfhandle)(fd);
+ LZO_COMPILE_TIME_ASSERT(sizeof(h) == sizeof(HANDLE))
+ if (h != -1)
+ {
+ DWORD d = 0;
+ if (GetConsoleMode(LZO_REINTERPRET_CAST(HANDLE, h), &d) == 0)
+ return 0;
+ }
+ }
+#endif
+#if (HAVE_ISATTY)
+ return (isatty(fd)) ? 1 : 0;
+#else
+ return 0;
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_mkdir) (const char* name, unsigned mode)
+{
+#if !(HAVE_MKDIR)
+ LZO_UNUSED(name); LZO_UNUSED(mode);
+ return -1;
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+ LZO_UNUSED(mode);
+ return Dcreate(name);
+#elif (LZO_OS_DOS32 && LZO_CC_GNUC) && defined(__DJGPP__)
+ return mkdir(name, mode);
+#elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+ return mkdir(name, mode);
+#elif ((LZO_OS_DOS16 || LZO_OS_DOS32) && (LZO_CC_HIGHC || LZO_CC_PACIFICC))
+ LZO_UNUSED(mode);
+ return mkdir(LZO_UNCONST_CAST(char *, name));
+#elif (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+ LZO_UNUSED(mode);
+ return mkdir(name);
+#elif (LZO_CC_WATCOMC)
+ return mkdir(name, LZO_STATIC_CAST(mode_t, mode));
+#else
+ return mkdir(name, mode);
+#endif
+}
+LZOLIB_PUBLIC(int, lzo_rmdir) (const char* name)
+{
+#if !(HAVE_RMDIR)
+ LZO_UNUSED(name);
+ return -1;
+#elif ((LZO_OS_DOS16 || LZO_OS_DOS32) && (LZO_CC_HIGHC || LZO_CC_PACIFICC))
+ return rmdir(LZO_UNCONST_CAST(char *, name));
+#else
+ return rmdir(name);
+#endif
+}
+#if defined(lzo_int32e_t)
+LZOLIB_PUBLIC(lzo_int32e_t, lzo_muldiv32s) (lzo_int32e_t a, lzo_int32e_t b, lzo_int32e_t x)
+{
+ lzo_int32e_t r = 0;
+ if __lzo_likely(x != 0)
+ {
+#if defined(lzo_int64l_t)
+ lzo_int64l_t rr = (LZO_ICONV(lzo_int64l_t, a) * b) / x;
+ r = LZO_ITRUNC(lzo_int32e_t, rr);
+#else
+ LZO_UNUSED(a); LZO_UNUSED(b);
+#endif
+ }
+ return r;
+}
+LZOLIB_PUBLIC(lzo_uint32e_t, lzo_muldiv32u) (lzo_uint32e_t a, lzo_uint32e_t b, lzo_uint32e_t x)
+{
+ lzo_uint32e_t r = 0;
+ if __lzo_likely(x != 0)
+ {
+#if defined(lzo_int64l_t)
+ lzo_uint64l_t rr = (LZO_ICONV(lzo_uint64l_t, a) * b) / x;
+ r = LZO_ITRUNC(lzo_uint32e_t, rr);
+#else
+ LZO_UNUSED(a); LZO_UNUSED(b);
+#endif
+ }
+ return r;
+}
+#endif
+#if 0
+LZOLIB_PUBLIC_NOINLINE(int, lzo_syscall_clock_gettime) (int c)
+{
+}
+#endif
+#if (LZO_OS_WIN16)
+LZO_EXTERN_C void __far __pascal DebugBreak(void);
+#endif
+LZOLIB_PUBLIC_NOINLINE(void, lzo_debug_break) (void)
+{
+#if (LZO_OS_WIN16)
+ DebugBreak();
+#elif (LZO_ARCH_I086)
+#elif (LZO_OS_WIN64) && (LZO_HAVE_WINDOWS_H)
+ DebugBreak();
+#elif (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__("int $3\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ __asm { int 3 }
+#elif (LZO_OS_WIN32) && (LZO_HAVE_WINDOWS_H)
+ DebugBreak();
+#else
+ volatile lzo_intptr_t a = -1;
+ * LZO_STATIC_CAST(volatile unsigned long *, LZO_REINTERPRET_CAST(volatile void *, a)) = ~0ul;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(void, lzo_debug_nop) (void)
+{
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_debug_align_check_query) (void)
+{
+#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+# if (LZO_ARCH_AMD64)
+ lzo_uint64e_t r = 0;
+# else
+ size_t r = 0;
+# endif
+ __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ return LZO_ICONV(int, (r >> 18) & 1);
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ unsigned long r;
+ __asm {
+ pushf
+ pop eax
+ mov r,eax
+ }
+ return LZO_ICONV(int, (r >> 18) & 1);
+#else
+ return -1;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(int, lzo_debug_align_check_enable) (int v)
+{
+#if (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%rsp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%rsp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ }
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%esp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%esp)\n popf\n" : : __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+ }
+ return 0;
+#elif (LZO_ARCH_I386) && (LZO_ASM_SYNTAX_MSC)
+ if (v) { __asm {
+ pushf
+ or dword ptr [esp],262144
+ popf
+ }} else { __asm {
+ pushf
+ and dword ptr [esp],-262145
+ popf
+ }}
+ return 0;
+#else
+ LZO_UNUSED(v); return -1;
+#endif
+}
+LZOLIB_PUBLIC_NOINLINE(unsigned, lzo_debug_running_on_qemu) (void)
+{
+ unsigned r = 0;
+#if (LZO_OS_POSIX_LINUX || LZO_OS_WIN32 || LZO_OS_WIN64)
+ const char* p;
+ p = __LZOLIB_FUNCNAME(lzo_getenv)(LZO_PP_STRINGIZE(LZO_ENV_RUNNING_ON_QEMU));
+ if (p) {
+ if (p[0] == 0) r = 0;
+ else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = LZO_ICAST(unsigned, p[0]) - '0';
+ else r = 1;
+ }
+#endif
+ return r;
+}
+LZOLIB_PUBLIC_NOINLINE(unsigned, lzo_debug_running_on_valgrind) (void)
+{
+#if (LZO_ARCH_AMD64 && LZO_ABI_ILP32)
+ return 0;
+#elif (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC)
+ volatile size_t a[6];
+ size_t r = 0;
+ a[0] = 0x1001; a[1] = 0; a[2] = 0; a[3] = 0; a[4] = 0; a[5] = 0;
+# if (LZO_ARCH_AMD64)
+ __asm__ __volatile__(".byte 0x48,0xc1,0xc7,0x03,0x48,0xc1,0xc7,0x0d,0x48,0xc1,0xc7,0x3d,0x48,0xc1,0xc7,0x33,0x48,0x87,0xdb\n" : "=d" (r) : "a" (&a[0]), "d" (r) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+# elif (LZO_ARCH_I386)
+ __asm__ __volatile__(".byte 0xc1,0xc7,0x03,0xc1,0xc7,0x0d,0xc1,0xc7,0x1d,0xc1,0xc7,0x13,0x87,0xdb\n" : "=d" (r) : "a" (&a[0]), "d" (r) __LZO_ASM_CLOBBER_LIST_CC_MEMORY);
+# endif
+ return LZO_ITRUNC(unsigned, r);
+#else
+ return 0;
+#endif
+}
+#if (LZO_OS_WIN32 && LZO_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#if defined(LZO_WANT_ACCLIB_WILDARGV)
+# undef LZO_WANT_ACCLIB_WILDARGV
+#define __LZOLIB_WILDARGV_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#if 0 && (LZO_CC_MSC)
+LZO_EXTERN_C int __lzo_cdecl __setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (LZO_OS_WIN32 || LZO_OS_WIN64)
+#if (LZO_CC_INTELC || LZO_CC_MSC)
+LZO_EXTERN_C int __lzo_cdecl __setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void);
+LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (LZO_OS_EMX)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+ if (argc && argv) {
+ _response(argc, argv);
+ _wildcard(argc, argv);
+ }
+}
+#endif
+#if (LZO_OS_CONSOLE_PSP) && defined(__PSPSDK_DEBUG__)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZO_EXTERN_C int lzo_psp_init_module(int*, char***, int);
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+ lzo_psp_init_module(argc, argv, -1);
+}
+#endif
+#if !(__LZOLIB_HAVE_LZO_WILDARGV)
+#define __LZOLIB_HAVE_LZO_WILDARGV 1
+LZOLIB_PUBLIC(void, lzo_wildargv) (int* argc, char*** argv)
+{
+#if 1 && (LZO_ARCH_I086PM)
+ if (LZO_MM_AHSHIFT != 3) { exit(1); }
+#elif 1 && (LZO_ARCH_M68K && LZO_OS_TOS && LZO_CC_GNUC) && defined(__MINT__)
+ __binmode(1);
+ if (isatty(1)) __set_binmode(stdout, 0);
+ if (isatty(2)) __set_binmode(stderr, 0);
+#endif
+ LZO_UNUSED(argc); LZO_UNUSED(argv);
+}
+#endif
+#endif
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_swd.ch b/ics-openvpn-stripped/main/lzo/src/lzo_swd.ch
new file mode 100644
index 00000000..566aca45
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_swd.ch
@@ -0,0 +1,689 @@
+/* lzo_swd.ch -- sliding window dictionary
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#if (LZO_UINT_MAX < LZO_0xffffffffL)
+# error "LZO_UINT_MAX"
+#endif
+#if defined(LZO_DEBUG)
+# include <stdio.h>
+#endif
+#if defined(__LZO_CHECKER)
+# include <stdlib.h>
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* unsigned type for dictionary access - don't waste memory here */
+#if (0UL + SWD_N + SWD_F + SWD_F < 65535UL)
+ typedef lzo_uint16_t swd_uint;
+# define SWD_UINT_MAX 0xffffu
+#else
+ typedef lzo_uint32_t swd_uint;
+# define SWD_UINT_MAX 0xffffffffu
+#endif
+#define swd_uintp swd_uint *
+#define SWD_UINT(x) ((swd_uint)(x))
+
+
+#ifndef SWD_HSIZE
+# define SWD_HSIZE 16384
+#endif
+#ifndef SWD_MAX_CHAIN
+# define SWD_MAX_CHAIN 2048
+#endif
+
+#if !defined(HEAD3)
+#if 1
+# define HEAD3(b,p) \
+ ((DMUL(0x9f5f,(((((lzo_xint)b[p]<<5)^b[p+1])<<5)^b[p+2]))>>5) & (SWD_HSIZE-1))
+#else
+# define HEAD3(b,p) \
+ ((DMUL(0x9f5f,(((((lzo_xint)b[p+2]<<5)^b[p+1])<<5)^b[p]))>>5) & (SWD_HSIZE-1))
+#endif
+#endif
+
+#if !(SWD_NO_HEAD2) && (SWD_THRESHOLD == 1) && !defined(HEAD2)
+# if 1 && (LZO_OPT_UNALIGNED16)
+# define HEAD2(b,p) UA_GET_NE16((b)+(p))
+# else
+# define HEAD2(b,p) (b[p] ^ ((unsigned)b[(p)+1]<<8))
+# endif
+# define NIL2 SWD_UINT_MAX
+#endif
+#ifndef IF_HEAD2
+#define IF_HEAD2(s) /*empty*/
+#endif
+
+
+typedef struct
+{
+/* public - "built-in" */
+ lzo_uint swd_n;
+ lzo_uint swd_f;
+ lzo_uint swd_threshold;
+
+/* public - configuration */
+ lzo_uint max_chain;
+ lzo_uint nice_length;
+ lzo_bool use_best_off;
+ lzo_uint lazy_insert;
+
+/* public - output */
+ lzo_uint m_len;
+ lzo_uint m_off;
+ lzo_uint look;
+ int b_char;
+#if defined(SWD_BEST_OFF)
+ lzo_uint best_off[ SWD_BEST_OFF ];
+#endif
+
+/* semi public */
+ LZO_COMPRESS_T *c;
+ lzo_uint m_pos;
+#if defined(SWD_BEST_OFF)
+ lzo_uint best_pos[ SWD_BEST_OFF ];
+#endif
+
+/* private */
+ const lzo_bytep dict;
+ const lzo_bytep dict_end;
+ lzo_uint dict_len;
+
+/* private */
+ lzo_uint ip; /* input pointer (lookahead) */
+ lzo_uint bp; /* buffer pointer */
+ lzo_uint rp; /* remove pointer */
+ lzo_uint b_size;
+
+ lzo_bytep b_wrap;
+
+ lzo_uint node_count;
+ lzo_uint first_rp;
+
+#if defined(__LZO_CHECKER)
+ /* malloc arrays of the exact size to detect any overrun */
+ unsigned char *b;
+ swd_uint *head3;
+ swd_uint *succ3;
+ swd_uint *best3;
+ swd_uint *llen3;
+# ifdef HEAD2
+ swd_uint *head2;
+# endif
+
+#else
+ unsigned char b [ SWD_N + SWD_F + SWD_F ];
+ swd_uint head3 [ SWD_HSIZE ];
+ swd_uint succ3 [ SWD_N + SWD_F ];
+ swd_uint best3 [ SWD_N + SWD_F ];
+ swd_uint llen3 [ SWD_HSIZE ];
+# ifdef HEAD2
+ swd_uint head2 [ 65536L ];
+# endif
+#endif
+}
+lzo_swd_t;
+#define lzo_swd_p lzo_swd_t *
+
+
+#define s_b(s) s->b
+#define s_head3(s) s->head3
+#define s_succ3(s) s->succ3
+#define s_best3(s) s->best3
+#define s_llen3(s) s->llen3
+#ifdef HEAD2
+#define s_head2(s) s->head2
+#endif
+#define SIZEOF_LZO_SWD_T (sizeof(lzo_swd_t))
+
+
+/* Access macro for head3.
+ * head3[key] may be uninitialized if the list is emtpy,
+ * but then its value will never be used.
+ */
+#if 1 || defined(__LZO_CHECKER)
+# define s_get_head3(s,key) \
+ ((swd_uint)((s_llen3(s)[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key]))
+#else
+# define s_get_head3(s,key) (s_head3(s)[key])
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static
+void swd_initdict(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
+{
+ s->dict = s->dict_end = NULL;
+ s->dict_len = 0;
+
+ if (!dict || dict_len == 0)
+ return;
+ if (dict_len > s->swd_n)
+ {
+ dict += dict_len - s->swd_n;
+ dict_len = s->swd_n;
+ }
+
+ s->dict = dict;
+ s->dict_len = dict_len;
+ s->dict_end = dict + dict_len;
+ lzo_memcpy(s_b(s),dict,dict_len);
+ s->ip = dict_len;
+}
+
+
+static
+void swd_insertdict(lzo_swd_p s, lzo_uint node, lzo_uint len)
+{
+ lzo_uint key;
+
+ s->node_count = s->swd_n - len;
+ s->first_rp = node;
+
+ if (len) do
+ {
+ key = HEAD3(s_b(s),node);
+ s_succ3(s)[node] = s_get_head3(s,key);
+ s_head3(s)[key] = SWD_UINT(node);
+ s_best3(s)[node] = SWD_UINT(s->swd_f + 1);
+ s_llen3(s)[key]++;
+ assert(s_llen3(s)[key] <= s->swd_n);
+
+#ifdef HEAD2
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),node);
+ s_head2(s)[key] = SWD_UINT(node);
+ }
+#endif
+
+ node++;
+ }
+ while (--len != 0);
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static
+int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len)
+{
+#if defined(__LZO_CHECKER)
+ s->b = (lzo_bytep) malloc(SWD_N + SWD_F + SWD_F);
+ s->head3 = (swd_uintp) malloc(sizeof(swd_uint) * SWD_HSIZE);
+ s->succ3 = (swd_uintp) malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
+ s->best3 = (swd_uintp) malloc(sizeof(swd_uint) * (SWD_N + SWD_F));
+ s->llen3 = (swd_uintp) malloc(sizeof(swd_uint) * SWD_HSIZE);
+#ifdef HEAD2
+ IF_HEAD2(s) {
+ s->head2 = (swd_uintp) malloc(sizeof(swd_uint) * 65536L);
+ }
+#endif
+#endif
+
+ s->m_len = 0;
+ s->m_off = 0;
+#if defined(SWD_BEST_OFF)
+ {
+ unsigned i;
+ for (i = 0; i < SWD_BEST_OFF; i++)
+ s->best_off[i] = s->best_pos[i] = 0;
+ }
+#endif
+
+ s->swd_n = SWD_N;
+ s->swd_f = SWD_F;
+ s->swd_threshold = SWD_THRESHOLD;
+
+ /* defaults */
+ s->max_chain = SWD_MAX_CHAIN;
+ s->nice_length = s->swd_f;
+ s->use_best_off = 0;
+ s->lazy_insert = 0;
+
+ s->b_size = s->swd_n + s->swd_f;
+#if 0
+ if (2 * s->swd_f >= s->swd_n || s->b_size + s->swd_f >= SWD_UINT_MAX)
+ return LZO_E_ERROR;
+#else
+ LZO_COMPILE_TIME_ASSERT(!(0ul + 2 * SWD_F >= SWD_N))
+ LZO_COMPILE_TIME_ASSERT(!(0ul + SWD_N + SWD_F + SWD_F >= SWD_UINT_MAX))
+#endif
+ s->b_wrap = s_b(s) + s->b_size;
+ s->node_count = s->swd_n;
+
+ lzo_memset(s_llen3(s), 0, (lzo_uint)sizeof(s_llen3(s)[0]) * (lzo_uint)SWD_HSIZE);
+#ifdef HEAD2
+ IF_HEAD2(s) {
+#if 1
+ lzo_memset(s_head2(s), 0xff, (lzo_uint)sizeof(s_head2(s)[0]) * 65536L);
+ assert(s_head2(s)[0] == NIL2);
+#else
+ lzo_xint i;
+ for (i = 0; i < 65536L; i++)
+ s_head2(s)[i] = NIL2;
+#endif
+ }
+#endif
+
+ s->ip = 0;
+ swd_initdict(s,dict,dict_len);
+ s->bp = s->ip;
+ s->first_rp = s->ip;
+
+ assert(s->ip + s->swd_f <= s->b_size);
+#if 1
+ s->look = (lzo_uint) (s->c->in_end - s->c->ip);
+ if (s->look > 0)
+ {
+ if (s->look > s->swd_f)
+ s->look = s->swd_f;
+ lzo_memcpy(&s_b(s)[s->ip],s->c->ip,s->look);
+ s->c->ip += s->look;
+ s->ip += s->look;
+ }
+#else
+ s->look = 0;
+ while (s->look < s->swd_f)
+ {
+ int c;
+ if ((c = getbyte(*(s->c))) < 0)
+ break;
+ s_b(s)[s->ip] = LZO_BYTE(c);
+ s->ip++;
+ s->look++;
+ }
+#endif
+ if (s->ip == s->b_size)
+ s->ip = 0;
+
+ if (s->look >= 2 && s->dict_len > 0)
+ swd_insertdict(s,0,s->dict_len);
+
+ s->rp = s->first_rp;
+ if (s->rp >= s->node_count)
+ s->rp -= s->node_count;
+ else
+ s->rp += s->b_size - s->node_count;
+
+#if 1 || defined(__LZO_CHECKER)
+ /* initialize memory for the first few HEAD3 (if s->ip is not far
+ * enough ahead to do this job for us). The value doesn't matter. */
+ if (s->look < 3) {
+ lzo_bytep p = &s_b(s)[s->bp+s->look];
+ p[0] = p[1] = p[2] = 0;
+ }
+#endif
+
+ return LZO_E_OK;
+}
+
+
+static
+void swd_exit(lzo_swd_p s)
+{
+#if defined(__LZO_CHECKER)
+ /* free in reverse order of allocations */
+#ifdef HEAD2
+ free(s->head2); s->head2 = NULL;
+#endif
+ free(s->llen3); s->llen3 = NULL;
+ free(s->best3); s->best3 = NULL;
+ free(s->succ3); s->succ3 = NULL;
+ free(s->head3); s->head3 = NULL;
+ free(s->b); s->b = NULL;
+#else
+ LZO_UNUSED(s);
+#endif
+}
+
+
+#define swd_pos2off(s,pos) \
+ (s->bp > (pos) ? s->bp - (pos) : s->b_size - ((pos) - s->bp))
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static __lzo_inline
+void swd_getbyte(lzo_swd_p s)
+{
+ int c;
+
+ if ((c = getbyte(*(s->c))) < 0)
+ {
+ if (s->look > 0)
+ --s->look;
+#if 1 || defined(__LZO_CHECKER)
+ /* initialize memory - value doesn't matter */
+ s_b(s)[s->ip] = 0;
+ if (s->ip < s->swd_f)
+ s->b_wrap[s->ip] = 0;
+#endif
+ }
+ else
+ {
+ s_b(s)[s->ip] = LZO_BYTE(c);
+ if (s->ip < s->swd_f)
+ s->b_wrap[s->ip] = LZO_BYTE(c);
+ }
+ if (++s->ip == s->b_size)
+ s->ip = 0;
+ if (++s->bp == s->b_size)
+ s->bp = 0;
+ if (++s->rp == s->b_size)
+ s->rp = 0;
+}
+
+
+/***********************************************************************
+// remove node from lists
+************************************************************************/
+
+static __lzo_inline
+void swd_remove_node(lzo_swd_p s, lzo_uint node)
+{
+ if (s->node_count == 0)
+ {
+ lzo_uint key;
+
+#ifdef LZO_DEBUG
+ if (s->first_rp != LZO_UINT_MAX)
+ {
+ if (node != s->first_rp)
+ printf("Remove %5ld: %5ld %5ld %5ld %5ld %6ld %6ld\n",
+ (long)node, (long)s->rp, (long)s->ip, (long)s->bp,
+ (long)s->first_rp, (long)(s->ip - node),
+ (long)(s->ip - s->bp));
+ assert(node == s->first_rp);
+ s->first_rp = LZO_UINT_MAX;
+ }
+#endif
+
+ key = HEAD3(s_b(s),node);
+ assert(s_llen3(s)[key] > 0);
+ --s_llen3(s)[key];
+
+#ifdef HEAD2
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),node);
+ assert(s_head2(s)[key] != NIL2);
+ if ((lzo_uint) s_head2(s)[key] == node)
+ s_head2(s)[key] = NIL2;
+ }
+#endif
+ }
+ else
+ --s->node_count;
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static
+void swd_accept(lzo_swd_p s, lzo_uint n)
+{
+ assert(n <= s->look);
+
+ if (n) do
+ {
+ lzo_uint key;
+
+ swd_remove_node(s,s->rp);
+
+ /* add bp into HEAD3 */
+ key = HEAD3(s_b(s),s->bp);
+ s_succ3(s)[s->bp] = s_get_head3(s,key);
+ s_head3(s)[key] = SWD_UINT(s->bp);
+ s_best3(s)[s->bp] = SWD_UINT(s->swd_f + 1);
+ s_llen3(s)[key]++;
+ assert(s_llen3(s)[key] <= s->swd_n);
+
+#ifdef HEAD2
+ /* add bp into HEAD2 */
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),s->bp);
+ s_head2(s)[key] = SWD_UINT(s->bp);
+ }
+#endif
+
+ swd_getbyte(s);
+ } while (--n != 0);
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static
+void swd_search(lzo_swd_p s, lzo_uint node, lzo_uint cnt)
+{
+ const lzo_bytep p1;
+ const lzo_bytep p2;
+ const lzo_bytep px;
+ lzo_uint m_len = s->m_len;
+ const lzo_bytep b = s_b(s);
+ const lzo_bytep bp = s_b(s) + s->bp;
+ const lzo_bytep bx = s_b(s) + s->bp + s->look;
+ unsigned char scan_end1;
+
+ assert(s->m_len > 0);
+
+ scan_end1 = bp[m_len - 1];
+ for ( ; cnt-- > 0; node = s_succ3(s)[node])
+ {
+ p1 = bp;
+ p2 = b + node;
+ px = bx;
+
+ assert(m_len < s->look);
+
+ if (
+#if 1
+ p2[m_len - 1] == scan_end1 &&
+ p2[m_len] == p1[m_len] &&
+#endif
+ p2[0] == p1[0] &&
+ p2[1] == p1[1])
+ {
+ lzo_uint i;
+ assert(lzo_memcmp(bp,&b[node],3) == 0);
+
+#if 0 && (LZO_OPT_UNALIGNED32)
+ p1 += 3; p2 += 3;
+ while (p1 + 4 <= px && UA_GET_NE32(p1) == UA_GET_NE32(p2))
+ p1 += 4, p2 += 4;
+ while (p1 < px && *p1 == *p2)
+ p1 += 1, p2 += 1;
+#else
+ p1 += 2; p2 += 2;
+ do {} while (++p1 < px && *p1 == *++p2);
+#endif
+ i = pd(p1, bp);
+
+#ifdef LZO_DEBUG
+ if (lzo_memcmp(bp,&b[node],i) != 0)
+ printf("%5ld %5ld %5ld %02x/%02x %02x/%02x\n",
+ (long)s->bp, (long) node, (long) i,
+ bp[0], bp[1], b[node], b[node+1]);
+#endif
+ assert(lzo_memcmp(bp,&b[node],i) == 0);
+
+#if defined(SWD_BEST_OFF)
+ if (i < SWD_BEST_OFF)
+ {
+ if (s->best_pos[i] == 0)
+ s->best_pos[i] = node + 1;
+ }
+#endif
+ if (i > m_len)
+ {
+ s->m_len = m_len = i;
+ s->m_pos = node;
+ if (m_len == s->look)
+ return;
+ if (m_len >= s->nice_length)
+ return;
+ if (m_len > (lzo_uint) s_best3(s)[node])
+ return;
+ scan_end1 = bp[m_len - 1];
+ }
+ }
+ }
+}
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+#ifdef HEAD2
+
+static
+lzo_bool swd_search2(lzo_swd_p s)
+{
+ lzo_uint key;
+
+ assert(s->look >= 2);
+ assert(s->m_len > 0);
+
+ key = s_head2(s)[ HEAD2(s_b(s),s->bp) ];
+ if (key == NIL2)
+ return 0;
+#ifdef LZO_DEBUG
+ if (lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) != 0)
+ printf("%5ld %5ld %02x/%02x %02x/%02x\n", (long)s->bp, (long)key,
+ s_b(s)[s->bp], s_b(s)[s->bp+1], s_b(s)[key], s_b(s)[key+1]);
+#endif
+ assert(lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) == 0);
+#if defined(SWD_BEST_OFF)
+ if (s->best_pos[2] == 0)
+ s->best_pos[2] = key + 1;
+#endif
+
+ if (s->m_len < 2)
+ {
+ s->m_len = 2;
+ s->m_pos = key;
+ }
+ return 1;
+}
+
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+static
+void swd_findbest(lzo_swd_p s)
+{
+ lzo_uint key;
+ lzo_uint cnt, node;
+ lzo_uint len;
+
+ assert(s->m_len > 0);
+
+ /* get current head, add bp into HEAD3 */
+ key = HEAD3(s_b(s),s->bp);
+ node = s_succ3(s)[s->bp] = s_get_head3(s,key);
+ cnt = s_llen3(s)[key]++;
+ assert(s_llen3(s)[key] <= s->swd_n + s->swd_f);
+ if (cnt > s->max_chain && s->max_chain > 0)
+ cnt = s->max_chain;
+ s_head3(s)[key] = SWD_UINT(s->bp);
+
+ s->b_char = s_b(s)[s->bp];
+ len = s->m_len;
+ if (s->m_len >= s->look)
+ {
+ if (s->look == 0)
+ s->b_char = -1;
+ s->m_off = 0;
+ s_best3(s)[s->bp] = SWD_UINT(s->swd_f + 1);
+ }
+ else
+ {
+#if defined(HEAD2)
+ if (swd_search2(s) && s->look >= 3)
+ swd_search(s,node,cnt);
+#else
+ if (s->look >= 3)
+ swd_search(s,node,cnt);
+#endif
+ if (s->m_len > len)
+ s->m_off = swd_pos2off(s,s->m_pos);
+ s_best3(s)[s->bp] = SWD_UINT(s->m_len);
+
+#if defined(SWD_BEST_OFF)
+ if (s->use_best_off)
+ {
+ unsigned i;
+ for (i = 2; i < SWD_BEST_OFF; i++)
+ if (s->best_pos[i] > 0)
+ s->best_off[i] = swd_pos2off(s,s->best_pos[i]-1);
+ else
+ s->best_off[i] = 0;
+ }
+#endif
+ }
+
+ swd_remove_node(s,s->rp);
+
+#ifdef HEAD2
+ /* add bp into HEAD2 */
+ IF_HEAD2(s) {
+ key = HEAD2(s_b(s),s->bp);
+ s_head2(s)[key] = SWD_UINT(s->bp);
+ }
+#endif
+}
+
+
+#undef HEAD3
+#undef HEAD2
+#undef IF_HEAD2
+#undef s_get_head3
+
+
+/*
+vi:ts=4:et
+*/
+
diff --git a/ics-openvpn-stripped/main/lzo/src/lzo_util.c b/ics-openvpn-stripped/main/lzo/src/lzo_util.c
new file mode 100644
index 00000000..1f2a4d54
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/lzo_util.c
@@ -0,0 +1,148 @@
+/* lzo_util.c -- utilities for the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo_conf.h"
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* If you use the LZO library in a product, I would appreciate that you
+ * keep this copyright string in the executable of your product.
+.*/
+
+static const char __lzo_copyright[] =
+#if !defined(__LZO_IN_MINLZO)
+ /* save space as some people want a really small decompressor */
+ LZO_VERSION_STRING;
+#else
+ "\r\n\n"
+ "LZO data compression library.\n"
+ "$Copyright: LZO Copyright (C) 1996-2014 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"
+ "$Info: " LZO_INFO_STRING " $\n";
+#endif
+
+
+LZO_PUBLIC(const lzo_bytep)
+lzo_copyright(void)
+{
+ return (const lzo_bytep) __lzo_copyright;
+}
+
+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;
+}
+
+
+/***********************************************************************
+// adler32 checksum
+// adapted from free code by Mark Adler <madler@alumni.caltech.edu>
+// see http://www.zlib.org/
+************************************************************************/
+
+#define LZO_BASE 65521u /* largest prime smaller than 65536 */
+#define LZO_NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#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_t)
+lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len)
+{
+ lzo_uint32_t s1 = adler & 0xffff;
+ lzo_uint32_t 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
+
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/miniacc.h b/ics-openvpn-stripped/main/lzo/src/miniacc.h
new file mode 100644
index 00000000..0487a004
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/miniacc.h
@@ -0,0 +1,6922 @@
+/* ACC --- Automatic Compiler Configuration
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+ 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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 __ACC_H_INCLUDED
+#define __ACC_H_INCLUDED 1
+#define ACC_VERSION 20110125L
+#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 defined(__POCC__) && defined(_WIN32)
+# if (__POCC__ >= 400)
+# pragma warn(disable: 2216)
+# 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 (ACC_CFG_NO_CONFIG_HEADER)
+#elif defined(ACC_CFG_CONFIG_HEADER)
+# include ACC_CFG_CONFIG_HEADER
+#else
+#endif
+#if (ACC_CFG_NO_LIMITS_H)
+#elif (ACC_LIBC_NAKED) || (ACC_BROKEN_LIMITS_H)
+#ifndef __ACC_FALLBACK_LIMITS_H_INCLUDED
+#define __ACC_FALLBACK_LIMITS_H_INCLUDED 1
+#undef CHAR_BIT
+#define CHAR_BIT 8
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+#ifndef __SCHAR_MAX__
+#define __SCHAR_MAX__ 127
+#endif
+#ifndef __SHRT_MAX__
+#define __SHRT_MAX__ 32767
+#endif
+#ifndef __INT_MAX__
+#define __INT_MAX__ 2147483647
+#endif
+#ifndef __LONG_MAX__
+#if defined(__alpha__) || defined(_LP64) || defined(__MIPS_PSX2__)
+#define __LONG_MAX__ 9223372036854775807L
+#else
+#define __LONG_MAX__ 2147483647L
+#endif
+#endif
+#undef SCHAR_MIN
+#undef SCHAR_MAX
+#undef UCHAR_MAX
+#define SCHAR_MIN (-1 - SCHAR_MAX)
+#define SCHAR_MAX (__SCHAR_MAX__)
+#define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#undef SHRT_MIN
+#undef SHRT_MAX
+#undef USHRT_MAX
+#define SHRT_MIN (-1 - SHRT_MAX)
+#define SHRT_MAX (__SHRT_MAX__)
+#if ((__INT_MAX__) == (__SHRT_MAX__))
+#define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+#define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+#undef INT_MIN
+#undef INT_MAX
+#undef UINT_MAX
+#define INT_MIN (-1 - INT_MAX)
+#define INT_MAX (__INT_MAX__)
+#define UINT_MAX (INT_MAX * 2U + 1U)
+#undef LONG_MIN
+#undef LONG_MAX
+#undef ULONG_MAX
+#define LONG_MIN (-1L - LONG_MAX)
+#define LONG_MAX ((__LONG_MAX__) + 0L)
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+#undef CHAR_MIN
+#undef CHAR_MAX
+#if defined(__CHAR_UNSIGNED__) || defined(_CHAR_UNSIGNED)
+#define CHAR_MIN 0
+#define CHAR_MAX UCHAR_MAX
+#else
+#define CHAR_MIN SCHAR_MIN
+#define CHAR_MAX SCHAR_MAX
+#endif
+#endif
+#else
+# include <limits.h>
+#endif
+#if 0
+#define ACC_0xffffL 0xfffful
+#define ACC_0xffffffffL 0xfffffffful
+#else
+#define ACC_0xffffL 65535ul
+#define ACC_0xffffffffL 4294967295ul
+#endif
+#if (ACC_0xffffL == ACC_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 == ACC_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 == ACC_0xffffL)
+# define ptrdiff_t long
+# define _PTRDIFF_T_DEFINED 1
+#endif
+#if (UINT_MAX == ACC_0xffffL)
+# undef __ACC_RENAME_A
+# undef __ACC_RENAME_B
+# if defined(__AZTEC_C__) && defined(__DOS__)
+# define __ACC_RENAME_A 1
+# elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define __ACC_RENAME_A 1
+# elif (_MSC_VER < 700)
+# define __ACC_RENAME_B 1
+# endif
+# elif defined(__TSC__) && defined(__OS2__)
+# define __ACC_RENAME_A 1
+# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
+# define __ACC_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(__ACC_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(__ACC_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 __ACC_RENAME_A
+# undef __ACC_RENAME_B
+#endif
+#if (UINT_MAX == ACC_0xffffL)
+#if defined(__AZTEC_C__) && defined(__DOS__)
+# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
+#elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
+# endif
+# if (_MSC_VER < 700)
+# define ACC_BROKEN_INTEGRAL_PROMOTION 1
+# define ACC_BROKEN_SIZEOF 1
+# endif
+#elif defined(__PACIFIC__) && defined(DOS)
+# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
+#elif defined(__TURBOC__) && defined(__MSDOS__)
+# if (__TURBOC__ < 0x0150)
+# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
+# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
+# define ACC_BROKEN_INTEGRAL_PROMOTION 1
+# endif
+# if (__TURBOC__ < 0x0200)
+# define ACC_BROKEN_SIZEOF 1
+# endif
+# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
+# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
+# endif
+#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
+# define ACC_BROKEN_SIZEOF 1
+#endif
+#endif
+#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
+# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
+#endif
+#if defined(_CRAY) && defined(_CRAY1)
+# define ACC_BROKEN_SIGNED_RIGHT_SHIFT 1
+#endif
+#define ACC_PP_STRINGIZE(x) #x
+#define ACC_PP_MACRO_EXPAND(x) ACC_PP_STRINGIZE(x)
+#define ACC_PP_CONCAT2(a,b) a ## b
+#define ACC_PP_CONCAT3(a,b,c) a ## b ## c
+#define ACC_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define ACC_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define ACC_PP_ECONCAT2(a,b) ACC_PP_CONCAT2(a,b)
+#define ACC_PP_ECONCAT3(a,b,c) ACC_PP_CONCAT3(a,b,c)
+#define ACC_PP_ECONCAT4(a,b,c,d) ACC_PP_CONCAT4(a,b,c,d)
+#define ACC_PP_ECONCAT5(a,b,c,d,e) ACC_PP_CONCAT5(a,b,c,d,e)
+#if 1
+#define ACC_CPP_STRINGIZE(x) #x
+#define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x)
+#define ACC_CPP_CONCAT2(a,b) a ## b
+#define ACC_CPP_CONCAT3(a,b,c) a ## b ## c
+#define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b)
+#define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c)
+#define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d)
+#define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e)
+#endif
+#define __ACC_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 ACC_EXTERN_C extern "C"
+#else
+# define ACC_EXTERN_C extern
+#endif
+#if !defined(__ACC_OS_OVERRIDE)
+#if (ACC_OS_FREESTANDING)
+# define ACC_INFO_OS "freestanding"
+#elif (ACC_OS_EMBEDDED)
+# define ACC_INFO_OS "embedded"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define ACC_OS_EMBEDDED 1
+# define ACC_INFO_OS "embedded"
+#elif defined(__CYGWIN__) && defined(__GNUC__)
+# define ACC_OS_CYGWIN 1
+# define ACC_INFO_OS "cygwin"
+#elif defined(__EMX__) && defined(__GNUC__)
+# define ACC_OS_EMX 1
+# define ACC_INFO_OS "emx"
+#elif defined(__BEOS__)
+# define ACC_OS_BEOS 1
+# define ACC_INFO_OS "beos"
+#elif defined(__Lynx__)
+# define ACC_OS_LYNXOS 1
+# define ACC_INFO_OS "lynxos"
+#elif defined(__OS400__)
+# define ACC_OS_OS400 1
+# define ACC_INFO_OS "os400"
+#elif defined(__QNX__)
+# define ACC_OS_QNX 1
+# define ACC_INFO_OS "qnx"
+#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
+# define ACC_OS_DOS32 1
+# define ACC_INFO_OS "dos32"
+#elif defined(__BORLANDC__) && defined(__DPMI16__)
+# define ACC_OS_DOS16 1
+# define ACC_INFO_OS "dos16"
+#elif defined(__ZTC__) && defined(DOS386)
+# define ACC_OS_DOS32 1
+# define ACC_INFO_OS "dos32"
+#elif defined(__OS2__) || defined(__OS2V2__)
+# if (UINT_MAX == ACC_0xffffL)
+# define ACC_OS_OS216 1
+# define ACC_INFO_OS "os216"
+# elif (UINT_MAX == ACC_0xffffffffL)
+# define ACC_OS_OS2 1
+# define ACC_INFO_OS "os2"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
+# define ACC_OS_WIN64 1
+# define ACC_INFO_OS "win64"
+#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
+# define ACC_OS_WIN32 1
+# define ACC_INFO_OS "win32"
+#elif defined(__MWERKS__) && defined(__INTEL__)
+# define ACC_OS_WIN32 1
+# define ACC_INFO_OS "win32"
+#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
+# if (UINT_MAX == ACC_0xffffL)
+# define ACC_OS_WIN16 1
+# define ACC_INFO_OS "win16"
+# elif (UINT_MAX == ACC_0xffffffffL)
+# define ACC_OS_WIN32 1
+# define ACC_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 == ACC_0xffffL)
+# define ACC_OS_DOS16 1
+# define ACC_INFO_OS "dos16"
+# elif (UINT_MAX == ACC_0xffffffffL)
+# define ACC_OS_DOS32 1
+# define ACC_INFO_OS "dos32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WATCOMC__)
+# if defined(__NT__) && (UINT_MAX == ACC_0xffffL)
+# define ACC_OS_DOS16 1
+# define ACC_INFO_OS "dos16"
+# elif defined(__NT__) && (__WATCOMC__ < 1100)
+# define ACC_OS_WIN32 1
+# define ACC_INFO_OS "win32"
+# elif defined(__linux__) || defined(__LINUX__)
+# define ACC_OS_POSIX 1
+# define ACC_INFO_OS "posix"
+# else
+# error "please specify a target using the -bt compiler option"
+# endif
+#elif defined(__palmos__)
+# define ACC_OS_PALMOS 1
+# define ACC_INFO_OS "palmos"
+#elif defined(__TOS__) || defined(__atarist__)
+# define ACC_OS_TOS 1
+# define ACC_INFO_OS "tos"
+#elif defined(macintosh) && !defined(__ppc__)
+# define ACC_OS_MACCLASSIC 1
+# define ACC_INFO_OS "macclassic"
+#elif defined(__VMS)
+# define ACC_OS_VMS 1
+# define ACC_INFO_OS "vms"
+#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define ACC_OS_CONSOLE 1
+# define ACC_OS_CONSOLE_PS2 1
+# define ACC_INFO_OS "console"
+# define ACC_INFO_OS_CONSOLE "ps2"
+#elif (defined(__mips__) && defined(__psp__))
+# define ACC_OS_CONSOLE 1
+# define ACC_OS_CONSOLE_PSP 1
+# define ACC_INFO_OS "console"
+# define ACC_INFO_OS_CONSOLE "psp"
+#else
+# define ACC_OS_POSIX 1
+# define ACC_INFO_OS "posix"
+#endif
+#if (ACC_OS_POSIX)
+# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
+# define ACC_OS_POSIX_AIX 1
+# define ACC_INFO_OS_POSIX "aix"
+# elif defined(__FreeBSD__)
+# define ACC_OS_POSIX_FREEBSD 1
+# define ACC_INFO_OS_POSIX "freebsd"
+# elif defined(__hpux__) || defined(__hpux)
+# define ACC_OS_POSIX_HPUX 1
+# define ACC_INFO_OS_POSIX "hpux"
+# elif defined(__INTERIX)
+# define ACC_OS_POSIX_INTERIX 1
+# define ACC_INFO_OS_POSIX "interix"
+# elif defined(__IRIX__) || defined(__irix__)
+# define ACC_OS_POSIX_IRIX 1
+# define ACC_INFO_OS_POSIX "irix"
+# elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
+# define ACC_OS_POSIX_LINUX 1
+# define ACC_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) || defined(__MACOS__)
+# define ACC_OS_POSIX_MACOSX 1
+# define ACC_INFO_OS_POSIX "macosx"
+# elif defined(__minix__) || defined(__minix)
+# define ACC_OS_POSIX_MINIX 1
+# define ACC_INFO_OS_POSIX "minix"
+# elif defined(__NetBSD__)
+# define ACC_OS_POSIX_NETBSD 1
+# define ACC_INFO_OS_POSIX "netbsd"
+# elif defined(__OpenBSD__)
+# define ACC_OS_POSIX_OPENBSD 1
+# define ACC_INFO_OS_POSIX "openbsd"
+# elif defined(__osf__)
+# define ACC_OS_POSIX_OSF 1
+# define ACC_INFO_OS_POSIX "osf"
+# elif defined(__solaris__) || defined(__sun)
+# if defined(__SVR4) || defined(__svr4__)
+# define ACC_OS_POSIX_SOLARIS 1
+# define ACC_INFO_OS_POSIX "solaris"
+# else
+# define ACC_OS_POSIX_SUNOS 1
+# define ACC_INFO_OS_POSIX "sunos"
+# endif
+# elif defined(__ultrix__) || defined(__ultrix)
+# define ACC_OS_POSIX_ULTRIX 1
+# define ACC_INFO_OS_POSIX "ultrix"
+# elif defined(_UNICOS)
+# define ACC_OS_POSIX_UNICOS 1
+# define ACC_INFO_OS_POSIX "unicos"
+# else
+# define ACC_OS_POSIX_UNKNOWN 1
+# define ACC_INFO_OS_POSIX "unknown"
+# endif
+#endif
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
+# if (UINT_MAX != ACC_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != ACC_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32 || ACC_OS_WIN64)
+# if (UINT_MAX != ACC_0xffffffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != ACC_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+# define ACC_CC_CILLY 1
+# define ACC_INFO_CC "Cilly"
+# if defined(__CILLY__)
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CILLY__)
+# else
+# define ACC_INFO_CCVER "unknown"
+# endif
+#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
+# define ACC_CC_SDCC 1
+# define ACC_INFO_CC "sdcc"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define ACC_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define ACC_INFO_CC "Pathscale C"
+# define ACC_INFO_CCVER __PATHSCALE__
+#elif defined(__INTEL_COMPILER)
+# define ACC_CC_INTELC 1
+# define ACC_INFO_CC "Intel C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__INTEL_COMPILER)
+# if defined(_WIN32) || defined(_WIN64)
+# define ACC_CC_SYNTAX_MSC 1
+# else
+# define ACC_CC_SYNTAX_GNUC 1
+# endif
+#elif defined(__POCC__) && defined(_WIN32)
+# define ACC_CC_PELLESC 1
+# define ACC_INFO_CC "Pelles C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__POCC__)
+#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# else
+# define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# endif
+# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
+# define ACC_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
+# else
+# define ACC_CC_CLANG_CLANG 0x010000L
+# endif
+# define ACC_CC_CLANG ACC_CC_CLANG_GNUC
+# define ACC_INFO_CC "clang"
+# define ACC_INFO_CCVER __VERSION__
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# else
+# define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# endif
+# define ACC_CC_LLVM ACC_CC_LLVM_GNUC
+# define ACC_INFO_CC "llvm-gcc"
+# define ACC_INFO_CCVER __VERSION__
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# elif defined(__GNUC_MINOR__)
+# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# else
+# define ACC_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define ACC_INFO_CC "gcc"
+# define ACC_INFO_CCVER __VERSION__
+#elif defined(__ACK__) && defined(_ACK)
+# define ACC_CC_ACK 1
+# define ACC_INFO_CC "Amsterdam Compiler Kit C"
+# define ACC_INFO_CCVER "unknown"
+#elif defined(__AZTEC_C__)
+# define ACC_CC_AZTECC 1
+# define ACC_INFO_CC "Aztec C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__CODEGEARC__)
+# define ACC_CC_CODEGEARC 1
+# define ACC_INFO_CC "CodeGear C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CODEGEARC__)
+#elif defined(__BORLANDC__)
+# define ACC_CC_BORLANDC 1
+# define ACC_INFO_CC "Borland C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(_CRAYC) && defined(_RELEASE)
+# define ACC_CC_CRAYC 1
+# define ACC_INFO_CC "Cray C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_RELEASE)
+#elif defined(__DMC__) && defined(__SC__)
+# define ACC_CC_DMC 1
+# define ACC_INFO_CC "Digital Mars C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define ACC_CC_DECC 1
+# define ACC_INFO_CC "DEC C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DECC)
+#elif defined(__HIGHC__)
+# define ACC_CC_HIGHC 1
+# define ACC_INFO_CC "MetaWare High C"
+# define ACC_INFO_CCVER "unknown"
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define ACC_CC_IARC 1
+# define ACC_INFO_CC "IAR C"
+# if defined(__VER__)
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__VER__)
+# else
+# define ACC_INFO_CCVER "unknown"
+# endif
+#elif defined(__IBMC__)
+# define ACC_CC_IBMC 1
+# define ACC_INFO_CC "IBM C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__IBMC__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define ACC_CC_KEILC 1
+# define ACC_INFO_CC "Keil C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__C166__)
+#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
+# define ACC_CC_LCCWIN32 1
+# define ACC_INFO_CC "lcc-win32"
+# define ACC_INFO_CCVER "unknown"
+#elif defined(__LCC__)
+# define ACC_CC_LCC 1
+# define ACC_INFO_CC "lcc"
+# if defined(__LCC_VERSION__)
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define ACC_INFO_CCVER "unknown"
+# endif
+#elif defined(_MSC_VER)
+# define ACC_CC_MSC 1
+# define ACC_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER) "." ACC_PP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER)
+# endif
+#elif defined(__MWERKS__)
+# define ACC_CC_MWERKS 1
+# define ACC_INFO_CC "Metrowerks C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__MWERKS__)
+#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+# define ACC_CC_NDPC 1
+# define ACC_INFO_CC "Microway NDP C"
+# define ACC_INFO_CCVER "unknown"
+#elif defined(__PACIFIC__)
+# define ACC_CC_PACIFICC 1
+# define ACC_INFO_CC "Pacific C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+# define ACC_CC_PGI 1
+# define ACC_INFO_CC "Portland Group PGI C"
+# define ACC_INFO_CCVER "unknown"
+#elif defined(__PUREC__) && defined(__TOS__)
+# define ACC_CC_PUREC 1
+# define ACC_INFO_CC "Pure C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define ACC_CC_SYMANTECC 1
+# define ACC_INFO_CC "Symantec C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define ACC_INFO_CC "SunPro C"
+# if ((__SUNPRO_C)+0 > 0)
+# define ACC_CC_SUNPROC __SUNPRO_C
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_C)
+# else
+# define ACC_CC_SUNPROC 1
+# define ACC_INFO_CCVER "unknown"
+# endif
+#elif defined(__SUNPRO_CC)
+# define ACC_INFO_CC "SunPro C"
+# if ((__SUNPRO_CC)+0 > 0)
+# define ACC_CC_SUNPROC __SUNPRO_CC
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_CC)
+# else
+# define ACC_CC_SUNPROC 1
+# define ACC_INFO_CCVER "unknown"
+# endif
+#elif defined(__TINYC__)
+# define ACC_CC_TINYC 1
+# define ACC_INFO_CC "Tiny C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define ACC_CC_TOPSPEEDC 1
+# define ACC_INFO_CC "TopSpeed C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define ACC_CC_WATCOMC 1
+# define ACC_INFO_CC "Watcom C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define ACC_CC_TURBOC 1
+# define ACC_INFO_CC "Turbo C"
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define ACC_CC_ZORTECHC 1
+# define ACC_INFO_CC "Zortech C"
+# if (__ZTC__ == 0x310)
+# define ACC_INFO_CCVER "0x310"
+# else
+# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__ZTC__)
+# endif
+#else
+# define ACC_CC_UNKNOWN 1
+# define ACC_INFO_CC "unknown"
+# define ACC_INFO_CCVER "unknown"
+#endif
+#if 0 && (ACC_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+# error "ACC_CC_MSC: _MSC_FULL_VER is not defined"
+#endif
+#if !defined(__ACC_ARCH_OVERRIDE) && !(ACC_ARCH_GENERIC) && defined(_CRAY)
+# if (UINT_MAX > ACC_0xffffffffL) && defined(_CRAY)
+# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
+# define ACC_ARCH_CRAY_MPP 1
+# elif defined(_CRAY1)
+# define ACC_ARCH_CRAY_PVP 1
+# endif
+# endif
+#endif
+#if !defined(__ACC_ARCH_OVERRIDE)
+#if (ACC_ARCH_GENERIC)
+# define ACC_INFO_ARCH "generic"
+#elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
+# define ACC_ARCH_I086 1
+# define ACC_ARCH_IA16 1
+# define ACC_INFO_ARCH "i086"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define ACC_ARCH_ALPHA 1
+# define ACC_INFO_ARCH "alpha"
+#elif (ACC_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
+# define ACC_ARCH_ALPHA 1
+# define ACC_INFO_ARCH "alpha"
+#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# define ACC_ARCH_AMD64 1
+# define ACC_INFO_ARCH "amd64"
+#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+# define ACC_ARCH_ARM 1
+# define ACC_ARCH_ARM_THUMB 1
+# define ACC_INFO_ARCH "arm_thumb"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+# define ACC_ARCH_ARM 1
+# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
+# define ACC_ARCH_ARM_THUMB 1
+# define ACC_INFO_ARCH "arm_thumb"
+# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
+# define ACC_INFO_ARCH "arm"
+# else
+# define ACC_INFO_ARCH "arm"
+# endif
+#elif defined(__arm__) || defined(_M_ARM)
+# define ACC_ARCH_ARM 1
+# define ACC_INFO_ARCH "arm"
+#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
+# define ACC_ARCH_AVR 1
+# define ACC_INFO_ARCH "avr"
+#elif defined(__avr32__) || defined(__AVR32__)
+# define ACC_ARCH_AVR32 1
+# define ACC_INFO_ARCH "avr32"
+#elif defined(__bfin__)
+# define ACC_ARCH_BLACKFIN 1
+# define ACC_INFO_ARCH "blackfin"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__C166__)
+# define ACC_ARCH_C166 1
+# define ACC_INFO_ARCH "c166"
+#elif defined(__cris__)
+# define ACC_ARCH_CRIS 1
+# define ACC_INFO_ARCH "cris"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
+# define ACC_ARCH_EZ80 1
+# define ACC_INFO_ARCH "ez80"
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define ACC_ARCH_H8300 1
+# define ACC_INFO_ARCH "h8300"
+#elif defined(__hppa__) || defined(__hppa)
+# define ACC_ARCH_HPPA 1
+# define ACC_INFO_ARCH "hppa"
+#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
+# define ACC_ARCH_I386 1
+# define ACC_ARCH_IA32 1
+# define ACC_INFO_ARCH "i386"
+#elif (ACC_CC_ZORTECHC && defined(__I86__))
+# define ACC_ARCH_I386 1
+# define ACC_ARCH_IA32 1
+# define ACC_INFO_ARCH "i386"
+#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) && defined(_I386)
+# define ACC_ARCH_I386 1
+# define ACC_ARCH_IA32 1
+# define ACC_INFO_ARCH "i386"
+#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
+# define ACC_ARCH_IA64 1
+# define ACC_INFO_ARCH "ia64"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__m32c__)
+# define ACC_ARCH_M16C 1
+# define ACC_INFO_ARCH "m16c"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
+# define ACC_ARCH_M16C 1
+# define ACC_INFO_ARCH "m16c"
+#elif defined(__m32r__)
+# define ACC_ARCH_M32R 1
+# define ACC_INFO_ARCH "m32r"
+#elif (ACC_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
+# define ACC_ARCH_M68K 1
+# define ACC_INFO_ARCH "m68k"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
+# define ACC_ARCH_MCS251 1
+# define ACC_INFO_ARCH "mcs251"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
+# define ACC_ARCH_MCS51 1
+# define ACC_INFO_ARCH "mcs51"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
+# define ACC_ARCH_MCS51 1
+# define ACC_INFO_ARCH "mcs51"
+#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
+# define ACC_ARCH_MIPS 1
+# define ACC_INFO_ARCH "mips"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__MSP430__)
+# define ACC_ARCH_MSP430 1
+# define ACC_INFO_ARCH "msp430"
+#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
+# define ACC_ARCH_MSP430 1
+# define ACC_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
+# define ACC_ARCH_POWERPC 1
+# define ACC_INFO_ARCH "powerpc"
+#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
+# define ACC_ARCH_S390 1
+# define ACC_INFO_ARCH "s390"
+#elif defined(__sh__) || defined(_M_SH)
+# define ACC_ARCH_SH 1
+# define ACC_INFO_ARCH "sh"
+#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
+# define ACC_ARCH_SPARC 1
+# define ACC_INFO_ARCH "sparc"
+#elif defined(__SPU__)
+# define ACC_ARCH_SPU 1
+# define ACC_INFO_ARCH "spu"
+#elif (UINT_MAX == ACC_0xffffL) && defined(__z80)
+# define ACC_ARCH_Z80 1
+# define ACC_INFO_ARCH "z80"
+#elif (ACC_ARCH_CRAY_PVP)
+# if defined(_CRAYSV1)
+# define ACC_ARCH_CRAY_SV1 1
+# define ACC_INFO_ARCH "cray_sv1"
+# elif (_ADDR64)
+# define ACC_ARCH_CRAY_T90 1
+# define ACC_INFO_ARCH "cray_t90"
+# elif (_ADDR32)
+# define ACC_ARCH_CRAY_YMP 1
+# define ACC_INFO_ARCH "cray_ymp"
+# else
+# define ACC_ARCH_CRAY_XMP 1
+# define ACC_INFO_ARCH "cray_xmp"
+# endif
+#else
+# define ACC_ARCH_UNKNOWN 1
+# define ACC_INFO_ARCH "unknown"
+#endif
+#endif
+#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_DOS32 || ACC_OS_OS2)
+# error "FIXME - missing define for CPU architecture"
+#endif
+#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN32)
+# error "FIXME - missing WIN32 define for CPU architecture"
+#endif
+#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN64)
+# error "FIXME - missing WIN64 define for CPU architecture"
+#endif
+#if (ACC_OS_OS216 || ACC_OS_WIN16)
+# define ACC_ARCH_I086PM 1
+# define ACC_ARCH_IA16PM 1
+#elif 1 && (ACC_OS_DOS16 && defined(BLX286))
+# define ACC_ARCH_I086PM 1
+# define ACC_ARCH_IA16PM 1
+#elif 1 && (ACC_OS_DOS16 && defined(DOSX286))
+# define ACC_ARCH_I086PM 1
+# define ACC_ARCH_IA16PM 1
+#elif 1 && (ACC_OS_DOS16 && ACC_CC_BORLANDC && defined(__DPMI16__))
+# define ACC_ARCH_I086PM 1
+# define ACC_ARCH_IA16PM 1
+#endif
+#if (ACC_ARCH_ARM_THUMB) && !(ACC_ARCH_ARM)
+# error "this should not happen"
+#endif
+#if (ACC_ARCH_I086PM) && !(ACC_ARCH_I086)
+# error "this should not happen"
+#endif
+#if (ACC_ARCH_I086)
+# if (UINT_MAX != ACC_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != ACC_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (ACC_ARCH_I386)
+# if (UINT_MAX != ACC_0xffffL) && defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (UINT_MAX != ACC_0xffffffffL) && !defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != ACC_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if !defined(__ACC_MM_OVERRIDE)
+#if (ACC_ARCH_I086)
+#if (UINT_MAX != ACC_0xffffL)
+# error "this should not happen"
+#endif
+#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
+# define ACC_MM_TINY 1
+#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
+# define ACC_MM_HUGE 1
+#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
+# define ACC_MM_SMALL 1
+#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
+# define ACC_MM_MEDIUM 1
+#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
+# define ACC_MM_COMPACT 1
+#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
+# define ACC_MM_LARGE 1
+#elif (ACC_CC_AZTECC)
+# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
+# define ACC_MM_LARGE 1
+# elif defined(_LARGE_CODE)
+# define ACC_MM_MEDIUM 1
+# elif defined(_LARGE_DATA)
+# define ACC_MM_COMPACT 1
+# else
+# define ACC_MM_SMALL 1
+# endif
+#elif (ACC_CC_ZORTECHC && defined(__VCM__))
+# define ACC_MM_LARGE 1
+#else
+# error "unknown memory model"
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
+#define ACC_HAVE_MM_HUGE_PTR 1
+#define ACC_HAVE_MM_HUGE_ARRAY 1
+#if (ACC_MM_TINY)
+# undef ACC_HAVE_MM_HUGE_ARRAY
+#endif
+#if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC)
+# undef ACC_HAVE_MM_HUGE_PTR
+# undef ACC_HAVE_MM_HUGE_ARRAY
+#elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
+# undef ACC_HAVE_MM_HUGE_ARRAY
+#elif (ACC_CC_MSC && defined(_QC))
+# undef ACC_HAVE_MM_HUGE_ARRAY
+# if (_MSC_VER < 600)
+# undef ACC_HAVE_MM_HUGE_PTR
+# endif
+#elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295))
+# undef ACC_HAVE_MM_HUGE_ARRAY
+#endif
+#if (ACC_ARCH_I086PM) && !(ACC_HAVE_MM_HUGE_PTR)
+# if (ACC_OS_DOS16)
+# error "this should not happen"
+# elif (ACC_CC_ZORTECHC)
+# else
+# error "this should not happen"
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
+ extern void __near __cdecl _AHSHIFT(void);
+# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295))
+ extern void __near __cdecl _AHSHIFT(void);
+# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16)
+# define ACC_MM_AHSHIFT 12
+#elif (ACC_CC_WATCOMC)
+ extern unsigned char _HShift;
+# define ACC_MM_AHSHIFT ((unsigned) _HShift)
+#else
+# error "FIXME - implement ACC_MM_AHSHIFT"
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
+#elif (ACC_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - C166 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define ACC_MM_SMALL 1
+#elif ((__MODEL__) == 1)
+# define ACC_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define ACC_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define ACC_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define ACC_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define ACC_MM_XSMALL 1
+#else
+# error "FIXME - C166 __MODEL__"
+#endif
+#elif (ACC_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - MCS251 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define ACC_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define ACC_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define ACC_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define ACC_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define ACC_MM_XSMALL 1
+#else
+# error "FIXME - MCS251 __MODEL__"
+#endif
+#elif (ACC_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - MCS51 __MODEL__"
+#elif ((__MODEL__) == 1)
+# define ACC_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define ACC_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define ACC_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define ACC_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define ACC_MM_XSMALL 1
+#else
+# error "FIXME - MCS51 __MODEL__"
+#endif
+#elif (ACC_ARCH_CRAY_PVP)
+# define ACC_MM_PVP 1
+#else
+# define ACC_MM_FLAT 1
+#endif
+#if (ACC_MM_COMPACT)
+# define ACC_INFO_MM "compact"
+#elif (ACC_MM_FLAT)
+# define ACC_INFO_MM "flat"
+#elif (ACC_MM_HUGE)
+# define ACC_INFO_MM "huge"
+#elif (ACC_MM_LARGE)
+# define ACC_INFO_MM "large"
+#elif (ACC_MM_MEDIUM)
+# define ACC_INFO_MM "medium"
+#elif (ACC_MM_PVP)
+# define ACC_INFO_MM "pvp"
+#elif (ACC_MM_SMALL)
+# define ACC_INFO_MM "small"
+#elif (ACC_MM_TINY)
+# define ACC_INFO_MM "tiny"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if defined(SIZEOF_SHORT)
+# define ACC_SIZEOF_SHORT (SIZEOF_SHORT)
+#endif
+#if defined(SIZEOF_INT)
+# define ACC_SIZEOF_INT (SIZEOF_INT)
+#endif
+#if defined(SIZEOF_LONG)
+# define ACC_SIZEOF_LONG (SIZEOF_LONG)
+#endif
+#if defined(SIZEOF_LONG_LONG)
+# define ACC_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#endif
+#if defined(SIZEOF___INT16)
+# define ACC_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#if defined(SIZEOF___INT32)
+# define ACC_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#if defined(SIZEOF___INT64)
+# define ACC_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#if defined(SIZEOF_VOID_P)
+# define ACC_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#endif
+#if defined(SIZEOF_SIZE_T)
+# define ACC_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#endif
+#if defined(SIZEOF_PTRDIFF_T)
+# define ACC_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#endif
+#define __ACC_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(ACC_SIZEOF_SHORT)
+# if (ACC_ARCH_CRAY_PVP)
+# define ACC_SIZEOF_SHORT 8
+# elif (USHRT_MAX == ACC_0xffffL)
+# define ACC_SIZEOF_SHORT 2
+# elif (__ACC_LSR(USHRT_MAX,7) == 1)
+# define ACC_SIZEOF_SHORT 1
+# elif (__ACC_LSR(USHRT_MAX,15) == 1)
+# define ACC_SIZEOF_SHORT 2
+# elif (__ACC_LSR(USHRT_MAX,31) == 1)
+# define ACC_SIZEOF_SHORT 4
+# elif (__ACC_LSR(USHRT_MAX,63) == 1)
+# define ACC_SIZEOF_SHORT 8
+# elif (__ACC_LSR(USHRT_MAX,127) == 1)
+# define ACC_SIZEOF_SHORT 16
+# else
+# error "ACC_SIZEOF_SHORT"
+# endif
+#endif
+#if !defined(ACC_SIZEOF_INT)
+# if (ACC_ARCH_CRAY_PVP)
+# define ACC_SIZEOF_INT 8
+# elif (UINT_MAX == ACC_0xffffL)
+# define ACC_SIZEOF_INT 2
+# elif (UINT_MAX == ACC_0xffffffffL)
+# define ACC_SIZEOF_INT 4
+# elif (__ACC_LSR(UINT_MAX,7) == 1)
+# define ACC_SIZEOF_INT 1
+# elif (__ACC_LSR(UINT_MAX,15) == 1)
+# define ACC_SIZEOF_INT 2
+# elif (__ACC_LSR(UINT_MAX,31) == 1)
+# define ACC_SIZEOF_INT 4
+# elif (__ACC_LSR(UINT_MAX,63) == 1)
+# define ACC_SIZEOF_INT 8
+# elif (__ACC_LSR(UINT_MAX,127) == 1)
+# define ACC_SIZEOF_INT 16
+# else
+# error "ACC_SIZEOF_INT"
+# endif
+#endif
+#if !defined(ACC_SIZEOF_LONG)
+# if (ULONG_MAX == ACC_0xffffffffL)
+# define ACC_SIZEOF_LONG 4
+# elif (__ACC_LSR(ULONG_MAX,7) == 1)
+# define ACC_SIZEOF_LONG 1
+# elif (__ACC_LSR(ULONG_MAX,15) == 1)
+# define ACC_SIZEOF_LONG 2
+# elif (__ACC_LSR(ULONG_MAX,31) == 1)
+# define ACC_SIZEOF_LONG 4
+# elif (__ACC_LSR(ULONG_MAX,63) == 1)
+# define ACC_SIZEOF_LONG 8
+# elif (__ACC_LSR(ULONG_MAX,127) == 1)
+# define ACC_SIZEOF_LONG 16
+# else
+# error "ACC_SIZEOF_LONG"
+# endif
+#endif
+#if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64)
+#if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8)
+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
+# if (ACC_CC_GNUC >= 0x030300ul)
+# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
+# define ACC_SIZEOF_LONG_LONG ACC_SIZEOF_LONG
+# elif (__ACC_LSR(__LONG_LONG_MAX__,30) == 1)
+# define ACC_SIZEOF_LONG_LONG 4
+# endif
+# endif
+# endif
+#endif
+#endif
+#if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64)
+#if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8)
+#if (ACC_ARCH_I086 && ACC_CC_DMC)
+#elif (ACC_CC_CILLY) && defined(__GNUC__)
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define ACC_SIZEOF_LONG_LONG 8
+#elif ((ACC_OS_WIN32 || ACC_OS_WIN64 || defined(_WIN32)) && ACC_CC_MSC && (_MSC_VER >= 1400))
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_OS_WIN64 || defined(_WIN64))
+# define ACC_SIZEOF___INT64 8
+#elif (ACC_ARCH_I386 && (ACC_CC_DMC))
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_ARCH_I386 && (ACC_CC_SYMANTECC && (__SC__ >= 0x700)))
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_ARCH_I386 && (ACC_CC_INTELC && defined(__linux__)))
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_ARCH_I386 && (ACC_CC_MWERKS || ACC_CC_PELLESC || ACC_CC_PGI || ACC_CC_SUNPROC))
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_ARCH_I386 && (ACC_CC_INTELC || ACC_CC_MSC))
+# define ACC_SIZEOF___INT64 8
+#elif ((ACC_OS_WIN32 || defined(_WIN32)) && (ACC_CC_MSC))
+# define ACC_SIZEOF___INT64 8
+#elif (ACC_ARCH_I386 && (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
+# define ACC_SIZEOF___INT64 8
+#elif (ACC_ARCH_I386 && (ACC_CC_WATCOMC && (__WATCOMC__ >= 1100)))
+# define ACC_SIZEOF___INT64 8
+#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
+# define ACC_SIZEOF___INT64 8
+#elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define ACC_SIZEOF_LONG_LONG 8
+#elif (ACC_CC_SDCC) && (ACC_SIZEOF_INT == 2)
+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define ACC_SIZEOF_LONG_LONG 8
+#endif
+#endif
+#endif
+#if defined(__cplusplus) && (ACC_CC_GNUC)
+# if (ACC_CC_GNUC < 0x020800ul)
+# undef ACC_SIZEOF_LONG_LONG
+# endif
+#endif
+#if (ACC_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+# undef ACC_SIZEOF_LONG_LONG
+#endif
+#if !defined(ACC_SIZEOF_VOID_P)
+#if (ACC_ARCH_I086)
+# define __ACC_WORDSIZE 2
+# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
+# define ACC_SIZEOF_VOID_P 2
+# elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
+# define ACC_SIZEOF_VOID_P 4
+# else
+# error "ACC_MM"
+# endif
+#elif (ACC_ARCH_AVR || ACC_ARCH_Z80)
+# define __ACC_WORDSIZE 1
+# define ACC_SIZEOF_VOID_P 2
+#elif (ACC_ARCH_C166 || ACC_ARCH_MCS51 || ACC_ARCH_MCS251 || ACC_ARCH_MSP430)
+# define ACC_SIZEOF_VOID_P 2
+#elif (ACC_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define __ACC_WORDSIZE 4
+# define ACC_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define __ACC_WORDSIZE 4
+# define ACC_SIZEOF_VOID_P 4
+# else
+# define __ACC_WORDSIZE 2
+# define ACC_SIZEOF_VOID_P 2
+# endif
+# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x040000ul)) && (ACC_SIZEOF_INT == 4)
+# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_INT
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_INT
+# endif
+#elif (ACC_ARCH_M16C)
+# define __ACC_WORDSIZE 2
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define ACC_SIZEOF_VOID_P 4
+# else
+# define ACC_SIZEOF_VOID_P 2
+# endif
+#elif (ACC_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define __ACC_WORDSIZE 8
+# define ACC_SIZEOF_VOID_P 4
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+# define __ACC_WORDSIZE 8
+# define ACC_SIZEOF_VOID_P 8
+#elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
+# define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG
+# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
+#elif (ACC_OS_OS400 || defined(__OS400__))
+# define __ACC_WORDSIZE ACC_SIZEOF_LONG
+# define ACC_SIZEOF_VOID_P 16
+# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define ACC_SIZEOF_VOID_P 8
+# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
+#elif (ACC_ARCH_SPU)
+# if 0
+# define __ACC_WORDSIZE 16
+# endif
+# define ACC_SIZEOF_VOID_P 4
+#else
+# define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG
+#endif
+#endif
+#if !defined(ACC_WORDSIZE)
+# if defined(__ACC_WORDSIZE)
+# define ACC_WORDSIZE __ACC_WORDSIZE
+# else
+# define ACC_WORDSIZE ACC_SIZEOF_VOID_P
+# endif
+#endif
+#if !defined(ACC_SIZEOF_SIZE_T)
+#if (ACC_ARCH_I086 || ACC_ARCH_M16C)
+# define ACC_SIZEOF_SIZE_T 2
+#else
+# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_VOID_P
+#endif
+#endif
+#if !defined(ACC_SIZEOF_PTRDIFF_T)
+#if (ACC_ARCH_I086)
+# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM || ACC_MM_HUGE)
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_VOID_P
+# elif (ACC_MM_COMPACT || ACC_MM_LARGE)
+# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+# define ACC_SIZEOF_PTRDIFF_T 4
+# else
+# define ACC_SIZEOF_PTRDIFF_T 2
+# endif
+# else
+# error "ACC_MM"
+# endif
+#else
+# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_SIZE_T
+#endif
+#endif
+#if (ACC_ABI_NEUTRAL_ENDIAN)
+# undef ACC_ABI_BIG_ENDIAN
+# undef ACC_ABI_LITTLE_ENDIAN
+#elif !(ACC_ABI_BIG_ENDIAN) && !(ACC_ABI_LITTLE_ENDIAN)
+#if (ACC_ARCH_ALPHA) && (ACC_ARCH_CRAY_MPP)
+# define ACC_ABI_BIG_ENDIAN 1
+#elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
+# define ACC_ABI_LITTLE_ENDIAN 1
+#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430)
+# define ACC_ABI_LITTLE_ENDIAN 1
+#elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390)
+# define ACC_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
+# if (__LITTLE_ENDIAN__ == 1)
+# define ACC_ABI_LITTLE_ENDIAN 1
+# else
+# define ACC_ABI_BIG_ENDIAN 1
+# endif
+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
+# define ACC_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# define ACC_ABI_LITTLE_ENDIAN 1
+#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
+# define ACC_ABI_BIG_ENDIAN 1
+#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
+# define ACC_ABI_LITTLE_ENDIAN 1
+#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
+# define ACC_ABI_BIG_ENDIAN 1
+#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
+# define ACC_ABI_LITTLE_ENDIAN 1
+#endif
+#endif
+#if (ACC_ABI_BIG_ENDIAN) && (ACC_ABI_LITTLE_ENDIAN)
+# error "this should not happen"
+#endif
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_INFO_ABI_ENDIAN "be"
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_INFO_ABI_ENDIAN "le"
+#elif (ACC_ABI_NEUTRAL_ENDIAN)
+# define ACC_INFO_ABI_ENDIAN "neutral"
+#endif
+#if (ACC_SIZEOF_INT == 1 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2)
+# define ACC_ABI_I8LP16 1
+# define ACC_INFO_ABI_PM "i8lp16"
+#elif (ACC_SIZEOF_INT == 2 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2)
+# define ACC_ABI_ILP16 1
+# define ACC_INFO_ABI_PM "ilp16"
+#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 4)
+# define ACC_ABI_ILP32 1
+# define ACC_INFO_ABI_PM "ilp32"
+#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 8 && ACC_SIZEOF_SIZE_T == 8)
+# define ACC_ABI_LLP64 1
+# define ACC_INFO_ABI_PM "llp64"
+#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8)
+# define ACC_ABI_LP64 1
+# define ACC_INFO_ABI_PM "lp64"
+#elif (ACC_SIZEOF_INT == 8 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8)
+# define ACC_ABI_ILP64 1
+# define ACC_INFO_ABI_PM "ilp64"
+#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 4)
+# define ACC_ABI_IP32L64 1
+# define ACC_INFO_ABI_PM "ip32l64"
+#endif
+#if !defined(__ACC_LIBC_OVERRIDE)
+#if (ACC_LIBC_NAKED)
+# define ACC_INFO_LIBC "naked"
+#elif (ACC_LIBC_FREESTANDING)
+# define ACC_INFO_LIBC "freestanding"
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# define ACC_INFO_LIBC "mfreestanding"
+#elif (ACC_LIBC_ISOC90)
+# define ACC_INFO_LIBC "isoc90"
+#elif (ACC_LIBC_ISOC99)
+# define ACC_INFO_LIBC "isoc99"
+#elif defined(__dietlibc__)
+# define ACC_LIBC_DIETLIBC 1
+# define ACC_INFO_LIBC "dietlibc"
+#elif defined(_NEWLIB_VERSION)
+# define ACC_LIBC_NEWLIB 1
+# define ACC_INFO_LIBC "newlib"
+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
+# if defined(__UCLIBC_SUBLEVEL__)
+# define ACC_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
+# else
+# define ACC_LIBC_UCLIBC 0x00090bL
+# endif
+# define ACC_INFO_LIBC "uclibc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define ACC_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define ACC_INFO_LIBC "glibc"
+#elif (ACC_CC_MWERKS) && defined(__MSL__)
+# define ACC_LIBC_MSL __MSL__
+# define ACC_INFO_LIBC "msl"
+#elif 1 && defined(__IAR_SYSTEMS_ICC__)
+# define ACC_LIBC_ISOC90 1
+# define ACC_INFO_LIBC "isoc90"
+#else
+# define ACC_LIBC_DEFAULT 1
+# define ACC_INFO_LIBC "default"
+#endif
+#endif
+#if !defined(__acc_gnuc_extension__)
+#if (ACC_CC_GNUC >= 0x020800ul)
+# define __acc_gnuc_extension__ __extension__
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_gnuc_extension__ __extension__
+#else
+# define __acc_gnuc_extension__ /*empty*/
+#endif
+#endif
+#if !defined(__acc_ua_volatile)
+# define __acc_ua_volatile volatile
+#endif
+#if !defined(__acc_alignof)
+#if (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
+# define __acc_alignof(e) __alignof__(e)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
+# define __acc_alignof(e) __alignof__(e)
+#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
+# define __acc_alignof(e) __alignof(e)
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_alignof(e) __alignof__(e)
+#endif
+#endif
+#if defined(__acc_alignof)
+# define __acc_HAVE_alignof 1
+#endif
+#if !defined(__acc_constructor)
+#if (ACC_CC_GNUC >= 0x030400ul)
+# define __acc_constructor __attribute__((__constructor__,__used__))
+#elif (ACC_CC_GNUC >= 0x020700ul)
+# define __acc_constructor __attribute__((__constructor__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_constructor __attribute__((__constructor__))
+#endif
+#endif
+#if defined(__acc_constructor)
+# define __acc_HAVE_constructor 1
+#endif
+#if !defined(__acc_destructor)
+#if (ACC_CC_GNUC >= 0x030400ul)
+# define __acc_destructor __attribute__((__destructor__,__used__))
+#elif (ACC_CC_GNUC >= 0x020700ul)
+# define __acc_destructor __attribute__((__destructor__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_destructor __attribute__((__destructor__))
+#endif
+#endif
+#if defined(__acc_destructor)
+# define __acc_HAVE_destructor 1
+#endif
+#if (__acc_HAVE_destructor) && !(__acc_HAVE_constructor)
+# error "this should not happen"
+#endif
+#if !defined(__acc_inline)
+#if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __acc_inline inline
+#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __acc_inline __inline
+#elif (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
+# define __acc_inline __inline__
+#elif (ACC_CC_DMC)
+# define __acc_inline __inline
+#elif (ACC_CC_INTELC)
+# define __acc_inline __inline
+#elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x2405))
+# define __acc_inline __inline
+#elif (ACC_CC_MSC && (_MSC_VER >= 900))
+# define __acc_inline __inline
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_inline __inline__
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define __acc_inline inline
+#endif
+#endif
+#if defined(__acc_inline)
+# define __acc_HAVE_inline 1
+#else
+# define __acc_inline /*empty*/
+#endif
+#if !defined(__acc_forceinline)
+#if (ACC_CC_GNUC >= 0x030200ul)
+# define __acc_forceinline __inline__ __attribute__((__always_inline__))
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC)
+# define __acc_forceinline __forceinline
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
+# define __acc_forceinline __inline__ __attribute__((__always_inline__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_forceinline __inline__ __attribute__((__always_inline__))
+#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
+# define __acc_forceinline __forceinline
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_forceinline __inline__ __attribute__((__always_inline__))
+#endif
+#endif
+#if defined(__acc_forceinline)
+# define __acc_HAVE_forceinline 1
+#else
+# define __acc_forceinline /*empty*/
+#endif
+#if !defined(__acc_noinline)
+#if 1 && (ACC_ARCH_I386) && (ACC_CC_GNUC >= 0x040000ul) && (ACC_CC_GNUC < 0x040003ul)
+# define __acc_noinline __attribute__((__noinline__,__used__))
+#elif (ACC_CC_GNUC >= 0x030200ul)
+# define __acc_noinline __attribute__((__noinline__))
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_MSC)
+# define __acc_noinline __declspec(noinline)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
+# define __acc_noinline __attribute__((__noinline__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_noinline __attribute__((__noinline__))
+#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
+# define __acc_noinline __declspec(noinline)
+#elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3200) && (ACC_OS_WIN32 || ACC_OS_WIN64))
+# if defined(__cplusplus)
+# else
+# define __acc_noinline __declspec(noinline)
+# endif
+#elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
+# define __acc_noinline __attribute__((__noinline__))
+#endif
+#endif
+#if defined(__acc_noinline)
+# define __acc_HAVE_noinline 1
+#else
+# define __acc_noinline /*empty*/
+#endif
+#if (__acc_HAVE_forceinline || __acc_HAVE_noinline) && !(__acc_HAVE_inline)
+# error "this should not happen"
+#endif
+#if !defined(__acc_noreturn)
+#if (ACC_CC_GNUC >= 0x020700ul)
+# define __acc_noreturn __attribute__((__noreturn__))
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC)
+# define __acc_noreturn __declspec(noreturn)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
+# define __acc_noreturn __attribute__((__noreturn__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_noreturn __attribute__((__noreturn__))
+#elif (ACC_CC_MSC && (_MSC_VER >= 1200))
+# define __acc_noreturn __declspec(noreturn)
+#endif
+#endif
+#if defined(__acc_noreturn)
+# define __acc_HAVE_noreturn 1
+#else
+# define __acc_noreturn /*empty*/
+#endif
+#if !defined(__acc_nothrow)
+#if (ACC_CC_GNUC >= 0x030300ul)
+# define __acc_nothrow __attribute__((__nothrow__))
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) && defined(__cplusplus)
+# define __acc_nothrow __declspec(nothrow)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 900) && ACC_CC_SYNTAX_GNUC)
+# define __acc_nothrow __attribute__((__nothrow__))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_nothrow __attribute__((__nothrow__))
+#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
+# define __acc_nothrow __declspec(nothrow)
+#endif
+#endif
+#if defined(__acc_nothrow)
+# define __acc_HAVE_nothrow 1
+#else
+# define __acc_nothrow /*empty*/
+#endif
+#if !defined(__acc_restrict)
+#if (ACC_CC_GNUC >= 0x030400ul)
+# define __acc_restrict __restrict__
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
+# define __acc_restrict __restrict__
+#elif (ACC_CC_CLANG || ACC_CC_LLVM)
+# define __acc_restrict __restrict__
+#elif (ACC_CC_MSC && (_MSC_VER >= 1400))
+# define __acc_restrict __restrict
+#endif
+#endif
+#if defined(__acc_restrict)
+# define __acc_HAVE_restrict 1
+#else
+# define __acc_restrict /*empty*/
+#endif
+#if !defined(__acc_likely) && !defined(__acc_unlikely)
+#if (ACC_CC_GNUC >= 0x030200ul)
+# define __acc_likely(e) (__builtin_expect(!!(e),1))
+# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __acc_likely(e) (__builtin_expect(!!(e),1))
+# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __acc_likely(e) (__builtin_expect(!!(e),1))
+# define __acc_unlikely(e) (__builtin_expect(!!(e),0))
+#endif
+#endif
+#if defined(__acc_likely)
+# define __acc_HAVE_likely 1
+#else
+# define __acc_likely(e) (e)
+#endif
+#if defined(__acc_unlikely)
+# define __acc_HAVE_unlikely 1
+#else
+# define __acc_unlikely(e) (e)
+#endif
+#if !defined(ACC_UNUSED)
+# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define ACC_UNUSED(var) ((void) &var)
+# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PELLESC || ACC_CC_TURBOC)
+# define ACC_UNUSED(var) if (&var) ; else
+# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define ACC_UNUSED(var) ((void) var)
+# elif (ACC_CC_MSC && (_MSC_VER < 900))
+# define ACC_UNUSED(var) if (&var) ; else
+# elif (ACC_CC_KEILC)
+# define ACC_UNUSED(var) {extern int __acc_unused[1-2*!(sizeof(var)>0)];}
+# elif (ACC_CC_PACIFICC)
+# define ACC_UNUSED(var) ((void) sizeof(var))
+# elif (ACC_CC_WATCOMC) && defined(__cplusplus)
+# define ACC_UNUSED(var) ((void) var)
+# else
+# define ACC_UNUSED(var) ((void) &var)
+# endif
+#endif
+#if !defined(ACC_UNUSED_FUNC)
+# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define ACC_UNUSED_FUNC(func) ((void) func)
+# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
+# define ACC_UNUSED_FUNC(func) if (func) ; else
+# elif (ACC_CC_CLANG || ACC_CC_LLVM)
+# define ACC_UNUSED_FUNC(func) ((void) &func)
+# elif (ACC_CC_MSC && (_MSC_VER < 900))
+# define ACC_UNUSED_FUNC(func) if (func) ; else
+# elif (ACC_CC_MSC)
+# define ACC_UNUSED_FUNC(func) ((void) &func)
+# elif (ACC_CC_KEILC || ACC_CC_PELLESC)
+# define ACC_UNUSED_FUNC(func) {extern int __acc_unused[1-2*!(sizeof((int)func)>0)];}
+# else
+# define ACC_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(ACC_UNUSED_LABEL)
+# if (ACC_CC_WATCOMC) && defined(__cplusplus)
+# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
+# elif (ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC)
+# define ACC_UNUSED_LABEL(l) if (0) goto l
+# else
+# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
+# endif
+#endif
+#if !defined(ACC_DEFINE_UNINITIALIZED_VAR)
+# if 0
+# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
+# elif 0 && (ACC_CC_GNUC)
+# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
+# else
+# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
+# endif
+#endif
+#if !defined(ACC_UNCONST_CAST)
+# if 0 && defined(__cplusplus)
+# define ACC_UNCONST_CAST(t,e) (const_cast<t> (e))
+# elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((acc_uintptr_t) ((const void *) (e))))))
+# else
+# define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
+# endif
+#endif
+#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
+# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
+# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
+# elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
+# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)];
+# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
+# else
+# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)];
+# endif
+#endif
+#if !defined(ACC_COMPILE_TIME_ASSERT)
+# if (ACC_CC_AZTECC)
+# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];}
+# elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (ACC_CC_MSC && (_MSC_VER < 900))
+# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# else
+# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];}
+# endif
+#endif
+#if (ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
+# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+# define __acc_cdecl __cdecl
+# define __acc_cdecl_atexit /*empty*/
+# define __acc_cdecl_main __cdecl
+# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
+# define __acc_cdecl_qsort __pascal
+# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
+# define __acc_cdecl_qsort _stdcall
+# else
+# define __acc_cdecl_qsort __cdecl
+# endif
+# elif (ACC_CC_WATCOMC)
+# define __acc_cdecl __cdecl
+# else
+# define __acc_cdecl __cdecl
+# define __acc_cdecl_atexit __cdecl
+# define __acc_cdecl_main __cdecl
+# define __acc_cdecl_qsort __cdecl
+# endif
+# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC)
+# elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
+# define __acc_cdecl_sighandler __pascal
+# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
+# define __acc_cdecl_sighandler _stdcall
+# elif (ACC_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
+# define __acc_cdecl_sighandler __clrcall
+# elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
+# if defined(_DLL)
+# define __acc_cdecl_sighandler _far _cdecl _loadds
+# elif defined(_MT)
+# define __acc_cdecl_sighandler _far _cdecl
+# else
+# define __acc_cdecl_sighandler _cdecl
+# endif
+# else
+# define __acc_cdecl_sighandler __cdecl
+# endif
+#elif (ACC_ARCH_I386) && (ACC_CC_WATCOMC)
+# define __acc_cdecl __cdecl
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+# define __acc_cdecl cdecl
+#endif
+#if !defined(__acc_cdecl)
+# define __acc_cdecl /*empty*/
+#endif
+#if !defined(__acc_cdecl_atexit)
+# define __acc_cdecl_atexit /*empty*/
+#endif
+#if !defined(__acc_cdecl_main)
+# define __acc_cdecl_main /*empty*/
+#endif
+#if !defined(__acc_cdecl_qsort)
+# define __acc_cdecl_qsort /*empty*/
+#endif
+#if !defined(__acc_cdecl_sighandler)
+# define __acc_cdecl_sighandler /*empty*/
+#endif
+#if !defined(__acc_cdecl_va)
+# define __acc_cdecl_va __acc_cdecl
+#endif
+#if !(ACC_CFG_NO_WINDOWS_H)
+#if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64)
+# if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
+# elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul)))
+# else
+# define ACC_HAVE_WINDOWS_H 1
+# endif
+#endif
+#endif
+#if (ACC_ARCH_ALPHA)
+# define ACC_OPT_AVOID_UINT_INDEX 1
+# define ACC_OPT_AVOID_SHORT 1
+# define ACC_OPT_AVOID_USHORT 1
+#elif (ACC_ARCH_AMD64)
+# define ACC_OPT_AVOID_INT_INDEX 1
+# define ACC_OPT_AVOID_UINT_INDEX 1
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+# define ACC_OPT_UNALIGNED64 1
+#elif (ACC_ARCH_ARM && ACC_ARCH_ARM_THUMB)
+#elif (ACC_ARCH_ARM)
+# define ACC_OPT_AVOID_SHORT 1
+# define ACC_OPT_AVOID_USHORT 1
+#elif (ACC_ARCH_CRIS)
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+#elif (ACC_ARCH_I386)
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+#elif (ACC_ARCH_IA64)
+# define ACC_OPT_AVOID_INT_INDEX 1
+# define ACC_OPT_AVOID_UINT_INDEX 1
+# define ACC_OPT_PREFER_POSTINC 1
+#elif (ACC_ARCH_M68K)
+# define ACC_OPT_PREFER_POSTINC 1
+# define ACC_OPT_PREFER_PREDEC 1
+# if defined(__mc68020__) && !defined(__mcoldfire__)
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+# endif
+#elif (ACC_ARCH_MIPS)
+# define ACC_OPT_AVOID_UINT_INDEX 1
+#elif (ACC_ARCH_POWERPC)
+# define ACC_OPT_PREFER_PREINC 1
+# define ACC_OPT_PREFER_PREDEC 1
+# if (ACC_ABI_BIG_ENDIAN)
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+# endif
+#elif (ACC_ARCH_S390)
+# define ACC_OPT_UNALIGNED16 1
+# define ACC_OPT_UNALIGNED32 1
+# if (ACC_SIZEOF_SIZE_T == 8)
+# define ACC_OPT_UNALIGNED64 1
+# endif
+#elif (ACC_ARCH_SH)
+# define ACC_OPT_PREFER_POSTINC 1
+# define ACC_OPT_PREFER_PREDEC 1
+#endif
+#ifndef ACC_CFG_NO_INLINE_ASM
+#if (ACC_CC_LLVM)
+# define ACC_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#ifndef ACC_CFG_NO_UNALIGNED
+#if (ACC_ABI_NEUTRAL_ENDIAN) || (ACC_ARCH_GENERIC)
+# define ACC_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if (ACC_CFG_NO_UNALIGNED)
+# undef ACC_OPT_UNALIGNED16
+# undef ACC_OPT_UNALIGNED32
+# undef ACC_OPT_UNALIGNED64
+#endif
+#if (ACC_CFG_NO_INLINE_ASM)
+#elif (ACC_ARCH_I386 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
+# define ACC_ASM_SYNTAX_MSC 1
+#elif (ACC_OS_WIN64 && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
+#elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC == 0x011f00ul))
+#elif (ACC_ARCH_I386 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
+# define ACC_ASM_SYNTAX_GNUC 1
+#elif (ACC_ARCH_AMD64 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
+# define ACC_ASM_SYNTAX_GNUC 1
+#endif
+#if (ACC_ASM_SYNTAX_GNUC)
+#if (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
+# define __ACC_ASM_CLOBBER "ax"
+#elif (ACC_CC_INTELC)
+# define __ACC_ASM_CLOBBER "memory"
+#else
+# define __ACC_ASM_CLOBBER "cc", "memory"
+#endif
+#endif
+#if defined(__ACC_INFOSTR_MM)
+#elif (ACC_MM_FLAT) && (defined(__ACC_INFOSTR_PM) || defined(ACC_INFO_ABI_PM))
+# define __ACC_INFOSTR_MM ""
+#elif defined(ACC_INFO_MM)
+# define __ACC_INFOSTR_MM "." ACC_INFO_MM
+#else
+# define __ACC_INFOSTR_MM ""
+#endif
+#if defined(__ACC_INFOSTR_PM)
+#elif defined(ACC_INFO_ABI_PM)
+# define __ACC_INFOSTR_PM "." ACC_INFO_ABI_PM
+#else
+# define __ACC_INFOSTR_PM ""
+#endif
+#if defined(__ACC_INFOSTR_ENDIAN)
+#elif defined(ACC_INFO_ABI_ENDIAN)
+# define __ACC_INFOSTR_ENDIAN "." ACC_INFO_ABI_ENDIAN
+#else
+# define __ACC_INFOSTR_ENDIAN ""
+#endif
+#if defined(__ACC_INFOSTR_OSNAME)
+#elif defined(ACC_INFO_OS_CONSOLE)
+# define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_CONSOLE
+#elif defined(ACC_INFO_OS_POSIX)
+# define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_POSIX
+#else
+# define __ACC_INFOSTR_OSNAME ACC_INFO_OS
+#endif
+#if defined(__ACC_INFOSTR_LIBC)
+#elif defined(ACC_INFO_LIBC)
+# define __ACC_INFOSTR_LIBC "." ACC_INFO_LIBC
+#else
+# define __ACC_INFOSTR_LIBC ""
+#endif
+#if defined(__ACC_INFOSTR_CCVER)
+#elif defined(ACC_INFO_CCVER)
+# define __ACC_INFOSTR_CCVER " " ACC_INFO_CCVER
+#else
+# define __ACC_INFOSTR_CCVER ""
+#endif
+#define ACC_INFO_STRING \
+ ACC_INFO_ARCH __ACC_INFOSTR_MM __ACC_INFOSTR_PM __ACC_INFOSTR_ENDIAN \
+ " " __ACC_INFOSTR_OSNAME __ACC_INFOSTR_LIBC " " ACC_INFO_CC __ACC_INFOSTR_CCVER
+#if (ACC_CFG_NO_CONFIG_HEADER)
+#elif defined(ACC_CFG_CONFIG_HEADER)
+#else
+#if !(ACC_CFG_AUTO_NO_HEADERS)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LIMITS_H 1
+# define HAVE_SETJMP_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_STDDEF_H 1
+# define HAVE_STDIO_H 1
+# define HAVE_STRING_H 1
+#else
+#define STDC_HEADERS 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_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SETJMP_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_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#if (ACC_OS_POSIX)
+# if (ACC_OS_POSIX_AIX)
+# define HAVE_SYS_RESOURCE_H 1
+# elif (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD)
+# define HAVE_STRINGS_H 1
+# undef HAVE_MALLOC_H
+# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
+# define HAVE_ALLOCA_H 1
+# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# elif (ACC_OS_POSIX_SOLARIS || ACC_OS_POSIX_SUNOS)
+# define HAVE_ALLOCA_H 1
+# endif
+# if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC)
+# define HAVE_STRINGS_H 1
+# define HAVE_SYS_MMAN_H 1
+# define HAVE_SYS_RESOURCE_H 1
+# define HAVE_SYS_WAIT_H 1
+# endif
+# if (ACC_LIBC_NEWLIB)
+# undef HAVE_STRINGS_H
+# endif
+#elif (ACC_OS_CYGWIN)
+# define HAVE_IO_H 1
+#elif (ACC_OS_EMX)
+# define HAVE_ALLOCA_H 1
+# define HAVE_IO_H 1
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_MALLOC_H
+# endif
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+#define HAVE_CONIO_H 1
+#define HAVE_DIRECT_H 1
+#define HAVE_DOS_H 1
+#define HAVE_IO_H 1
+#define HAVE_SHARE_H 1
+#if (ACC_CC_AZTECC)
+# undef HAVE_CONIO_H
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (ACC_CC_BORLANDC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# if (ACC_OS_WIN32 || ACC_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# endif
+#elif (ACC_CC_DMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# define HAVE_SYS_DIRENT_H 1
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+#elif (ACC_CC_IBMC && ACC_OS_OS2)
+# undef HAVE_DOS_H
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (ACC_CC_INTELC || ACC_CC_MSC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (ACC_CC_LCCWIN32)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (ACC_OS_WIN32 && ACC_LIBC_MSL)
+# define HAVE_ALLOCA_H 1
+# undef HAVE_DOS_H
+# undef HAVE_SHARE_H
+# undef HAVE_SYS_TIME_H
+#elif (ACC_CC_NDPC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#elif (ACC_CC_PACIFICC)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_IO_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
+# undef HAVE_DIRENT_H
+# undef HAVE_DOS_H
+# undef HAVE_MALLOC_H
+# undef HAVE_SHARE_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# if (__POCC__ < 280)
+# else
+# define HAVE_SYS_UTIME_H 1
+# endif
+#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
+# undef HAVE_UTIME_H
+# define HAVE_SYS_UTIME_H 1
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+#elif (ACC_CC_SYMANTECC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# if (__SC__ < 0x700)
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# endif
+#elif (ACC_CC_TOPSPEEDC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#elif (ACC_CC_TURBOC)
+# undef HAVE_UNISTD_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+# if (ACC_OS_WIN32 || ACC_OS_WIN64)
+# undef HAVE_DIRENT_H
+# endif
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_SIGNAL_H
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_DIRECT_H
+# undef HAVE_DIRENT_H
+# undef HAVE_MALLOC_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UTIME_H
+# endif
+#elif (ACC_CC_WATCOMC)
+# undef HAVE_DIRENT_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+# define HAVE_SYS_UTIME_H 1
+# if (__WATCOMC__ < 950)
+# undef HAVE_UNISTD_H
+# endif
+#elif (ACC_CC_ZORTECHC)
+# undef HAVE_DIRENT_H
+# undef HAVE_MEMORY_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_TIME_H
+#endif
+#endif
+#if (ACC_OS_CONSOLE)
+# undef HAVE_DIRENT_H
+#endif
+#if (ACC_OS_EMBEDDED)
+# undef HAVE_DIRENT_H
+#endif
+#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
+# undef HAVE_DIRENT_H
+# undef HAVE_FCNTL_H
+# undef HAVE_MALLOC_H
+# undef HAVE_UNISTD_H
+# undef HAVE_UTIME_H
+# undef HAVE_SYS_STAT_H
+# undef HAVE_SYS_TIME_H
+# undef HAVE_SYS_TYPES_H
+#endif
+#if (ACC_LIBC_GLIBC >= 0x020100ul)
+# define HAVE_STDINT_H 1
+#elif (ACC_LIBC_DIETLIBC)
+# undef HAVE_STDINT_H
+#elif (ACC_LIBC_UCLIBC)
+# define HAVE_STDINT_H 1
+#elif (ACC_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
+# undef HAVE_STDINT_H
+#elif (ACC_CC_DMC) && (__DMC__ >= 0x825)
+# define HAVE_STDINT_H 1
+#endif
+#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
+# define TIME_WITH_SYS_TIME 1
+#endif
+#endif
+#endif
+#if !(ACC_CFG_AUTO_NO_FUNCTIONS)
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# define HAVE_LONGJMP 1
+# define HAVE_MEMCMP 1
+# define HAVE_MEMCPY 1
+# define HAVE_MEMMOVE 1
+# define HAVE_MEMSET 1
+# define HAVE_SETJMP 1
+#else
+#define HAVE_ACCESS 1
+#define HAVE_ALLOCA 1
+#define HAVE_ATEXIT 1
+#define HAVE_ATOI 1
+#define HAVE_ATOL 1
+#define HAVE_CHMOD 1
+#define HAVE_CHOWN 1
+#define HAVE_CTIME 1
+#define HAVE_DIFFTIME 1
+#define HAVE_FILENO 1
+#define HAVE_FSTAT 1
+#define HAVE_GETENV 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GMTIME 1
+#define HAVE_ISATTY 1
+#define HAVE_LOCALTIME 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MEMCMP 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKTIME 1
+#define HAVE_QSORT 1
+#define HAVE_RAISE 1
+#define HAVE_RMDIR 1
+#define HAVE_SETJMP 1
+#define HAVE_SIGNAL 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STAT 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_TIME 1
+#define HAVE_UMASK 1
+#define HAVE_UTIME 1
+#define HAVE_VSNPRINTF 1
+#if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX || ACC_OS_VMS)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+# define HAVE_STRCASECMP 1
+# define HAVE_STRNCASECMP 1
+#else
+# define HAVE_STRICMP 1
+# define HAVE_STRNICMP 1
+#endif
+#if (ACC_OS_POSIX)
+# if (ACC_OS_POSIX_AIX)
+# define HAVE_GETRUSAGE 1
+# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+# elif (ACC_OS_POSIX_UNICOS)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+# if (ACC_CC_TINYC)
+# undef HAVE_ALLOCA
+# endif
+# if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC)
+# define HAVE_GETRUSAGE 1
+# define HAVE_GETPAGESIZE 1
+# define HAVE_MMAP 1
+# define HAVE_MPROTECT 1
+# define HAVE_MUNMAP 1
+# endif
+#elif (ACC_OS_CYGWIN)
+# if (ACC_CC_GNUC < 0x025a00ul)
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# endif
+# if (ACC_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (ACC_OS_EMX)
+# undef HAVE_CHOWN
+# undef HAVE_LSTAT
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
+# if !defined(__MINT__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+# undef HAVE_ALLOCA
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_SNPRINTF
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+#undef HAVE_CHOWN
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_LSTAT
+#undef HAVE_UMASK
+#if (ACC_CC_AZTECC)
+# undef HAVE_ALLOCA
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_STRDUP
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (ACC_CC_BORLANDC)
+# if (__BORLANDC__ < 0x0400)
+# undef HAVE_ALLOCA
+# undef HAVE_UTIME
+# endif
+# if ((__BORLANDC__ < 0x0410) && ACC_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (__BORLANDC__ < 0x0550)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# endif
+#elif (ACC_CC_DMC)
+# if (ACC_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (ACC_CC_IBMC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (ACC_CC_INTELC)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (ACC_CC_LCCWIN32)
+# define utime _utime
+#elif (ACC_CC_MSC)
+# if (_MSC_VER < 600)
+# undef HAVE_STRFTIME
+# endif
+# if (_MSC_VER < 700)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (_MSC_VER < 1500)
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# ifndef vsnprintf
+# define vsnprintf _vsnprintf
+# endif
+# else
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
+# endif
+# if ((_MSC_VER < 800) && ACC_OS_WIN16)
+# undef HAVE_ALLOCA
+# endif
+# if (ACC_ARCH_I086) && defined(__cplusplus)
+# undef HAVE_LONGJMP
+# undef HAVE_SETJMP
+# endif
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
+# if (ACC_CC_GNUC < 0x025f00ul)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (ACC_OS_WIN32 && ACC_LIBC_MSL)
+# if (__MSL__ < 0x8000ul)
+# undef HAVE_CHMOD
+# endif
+#elif (ACC_CC_NDPC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_STRNICMP
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+# if defined(__cplusplus)
+# undef HAVE_STAT
+# endif
+#elif (ACC_CC_PACIFICC)
+# undef HAVE_ACCESS
+# undef HAVE_ALLOCA
+# undef HAVE_CHMOD
+# undef HAVE_DIFFTIME
+# undef HAVE_FSTAT
+# undef HAVE_MKTIME
+# undef HAVE_RAISE
+# undef HAVE_SNPRINTF
+# undef HAVE_STRFTIME
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
+# if (__POCC__ < 280)
+# define alloca _alloca
+# undef HAVE_UTIME
+# endif
+#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (ACC_CC_SYMANTECC)
+# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# if (__SC__ < 0x600)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# else
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+# if (__SC__ < 0x700)
+# undef HAVE_DIFFTIME
+# undef HAVE_UTIME
+# endif
+#elif (ACC_CC_TOPSPEEDC)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+#elif (ACC_CC_TURBOC)
+# undef HAVE_ALLOCA
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# if (__TURBOC__ < 0x0200)
+# undef HAVE_RAISE
+# undef HAVE_SIGNAL
+# endif
+# if (__TURBOC__ < 0x0295)
+# undef HAVE_MKTIME
+# undef HAVE_STRFTIME
+# endif
+# if (__TURBOC__ < 0x0400)
+# undef HAVE_UTIME
+# endif
+#elif (ACC_CC_WATCOMC)
+# if (__WATCOMC__ < 1100)
+# undef HAVE_SNPRINTF
+# undef HAVE_VSNPRINTF
+# elif (__WATCOMC__ < 1200)
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+# endif
+#elif (ACC_CC_ZORTECHC)
+# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
+# undef HAVE_ALLOCA
+# endif
+# undef HAVE_DIFFTIME
+# undef HAVE_SNPRINTF
+# undef HAVE_UTIME
+# undef HAVE_VSNPRINTF
+#endif
+#endif
+#if (ACC_OS_CONSOLE)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_TIME
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+#endif
+#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
+# undef HAVE_ACCESS
+# undef HAVE_CHMOD
+# undef HAVE_CHOWN
+# undef HAVE_FSTAT
+# undef HAVE_GETTIMEOFDAY
+# undef HAVE_LSTAT
+# undef HAVE_STAT
+# undef HAVE_UMASK
+# undef HAVE_UTIME
+# if 1
+# undef HAVE_ALLOCA
+# undef HAVE_ISATTY
+# undef HAVE_MKDIR
+# undef HAVE_RMDIR
+# undef HAVE_STRDUP
+# undef HAVE_STRICMP
+# undef HAVE_STRNICMP
+# endif
+#endif
+#endif
+#endif
+#if !(ACC_CFG_AUTO_NO_SIZES)
+#if !defined(SIZEOF_SHORT) && defined(ACC_SIZEOF_SHORT)
+# define SIZEOF_SHORT ACC_SIZEOF_SHORT
+#endif
+#if !defined(SIZEOF_INT) && defined(ACC_SIZEOF_INT)
+# define SIZEOF_INT ACC_SIZEOF_INT
+#endif
+#if !defined(SIZEOF_LONG) && defined(ACC_SIZEOF_LONG)
+# define SIZEOF_LONG ACC_SIZEOF_LONG
+#endif
+#if !defined(SIZEOF_LONG_LONG) && defined(ACC_SIZEOF_LONG_LONG)
+# define SIZEOF_LONG_LONG ACC_SIZEOF_LONG_LONG
+#endif
+#if !defined(SIZEOF___INT32) && defined(ACC_SIZEOF___INT32)
+# define SIZEOF___INT32 ACC_SIZEOF___INT32
+#endif
+#if !defined(SIZEOF___INT64) && defined(ACC_SIZEOF___INT64)
+# define SIZEOF___INT64 ACC_SIZEOF___INT64
+#endif
+#if !defined(SIZEOF_VOID_P) && defined(ACC_SIZEOF_VOID_P)
+# define SIZEOF_VOID_P ACC_SIZEOF_VOID_P
+#endif
+#if !defined(SIZEOF_SIZE_T) && defined(ACC_SIZEOF_SIZE_T)
+# define SIZEOF_SIZE_T ACC_SIZEOF_SIZE_T
+#endif
+#if !defined(SIZEOF_PTRDIFF_T) && defined(ACC_SIZEOF_PTRDIFF_T)
+# define SIZEOF_PTRDIFF_T ACC_SIZEOF_PTRDIFF_T
+#endif
+#endif
+#if (HAVE_SIGNAL) && !defined(RETSIGTYPE)
+# define RETSIGTYPE void
+#endif
+#endif
+#if (ACC_CFG_NO_ACC_TYPE_H)
+#else
+#if (ACC_SIZEOF_LONG_LONG+0 > 0)
+__acc_gnuc_extension__ typedef long long acc_llong_t;
+__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
+#endif
+#if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(acc_int16e_t)
+#if (ACC_SIZEOF_LONG == 2)
+# define acc_int16e_t long
+# define acc_uint16e_t unsigned long
+#elif (ACC_SIZEOF_INT == 2)
+# define acc_int16e_t int
+# define acc_uint16e_t unsigned int
+#elif (ACC_SIZEOF_SHORT == 2)
+# define acc_int16e_t short int
+# define acc_uint16e_t unsigned short int
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
+ typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
+ typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
+# define acc_int16e_t __acc_int16e_hi_t
+# define acc_uint16e_t __acc_uint16e_hi_t
+#elif (ACC_SIZEOF___INT16 == 2)
+# define acc_int16e_t __int16
+# define acc_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(acc_int16e_t)
+# define ACC_SIZEOF_ACC_INT16E_T 2
+#endif
+#if !defined(acc_int32e_t)
+#if (ACC_SIZEOF_LONG == 4)
+# define acc_int32e_t long int
+# define acc_uint32e_t unsigned long int
+#elif (ACC_SIZEOF_INT == 4)
+# define acc_int32e_t int
+# define acc_uint32e_t unsigned int
+#elif (ACC_SIZEOF_SHORT == 4)
+# define acc_int32e_t short int
+# define acc_uint32e_t unsigned short int
+#elif (ACC_SIZEOF_LONG_LONG == 4)
+# define acc_int32e_t acc_llong_t
+# define acc_uint32e_t acc_ullong_t
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
+ typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
+# define acc_int32e_t __acc_int32e_si_t
+# define acc_uint32e_t __acc_uint32e_si_t
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
+ typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
+# define acc_int32e_t __acc_int32e_si_t
+# define acc_uint32e_t __acc_uint32e_si_t
+# define ACC_INT32_C(c) c##LL
+# define ACC_UINT32_C(c) c##ULL
+#elif (ACC_SIZEOF___INT32 == 4)
+# define acc_int32e_t __int32
+# define acc_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(acc_int32e_t)
+# define ACC_SIZEOF_ACC_INT32E_T 4
+#endif
+#if !defined(acc_int64e_t)
+#if (ACC_SIZEOF___INT64 == 8)
+# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
+# define ACC_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_int64e_t int
+# define acc_uint64e_t unsigned int
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG == 8)
+# define acc_int64e_t long int
+# define acc_uint64e_t unsigned long int
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
+#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
+# define acc_int64e_t acc_llong_t
+# define acc_uint64e_t acc_ullong_t
+# if (ACC_CC_BORLANDC)
+# define ACC_INT64_C(c) ((c) + 0ll)
+# define ACC_UINT64_C(c) ((c) + 0ull)
+# else
+# define ACC_INT64_C(c) c##LL
+# define ACC_UINT64_C(c) c##ULL
+# endif
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG
+#elif (ACC_SIZEOF___INT64 == 8)
+# define acc_int64e_t __int64
+# define acc_uint64e_t unsigned __int64
+# if (ACC_CC_BORLANDC)
+# define ACC_INT64_C(c) ((c) + 0i64)
+# define ACC_UINT64_C(c) ((c) + 0ui64)
+# else
+# define ACC_INT64_C(c) c##i64
+# define ACC_UINT64_C(c) c##ui64
+# endif
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64
+#else
+#endif
+#endif
+#if !defined(acc_int32l_t)
+#if defined(acc_int32e_t)
+# define acc_int32l_t acc_int32e_t
+# define acc_uint32l_t acc_uint32e_t
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T
+#elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_int32l_t int
+# define acc_uint32l_t unsigned int
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG >= 4)
+# define acc_int32l_t long int
+# define acc_uint32l_t unsigned long int
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG
+#else
+# error "acc_int32l_t"
+#endif
+#endif
+#if !defined(acc_int64l_t)
+#if defined(acc_int64e_t)
+# define acc_int64l_t acc_int64e_t
+# define acc_uint64l_t acc_uint64e_t
+# define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T
+#else
+#endif
+#endif
+#if !defined(acc_int32f_t)
+#if (ACC_SIZEOF_SIZE_T >= 8)
+# define acc_int32f_t acc_int64l_t
+# define acc_uint32f_t acc_uint64l_t
+# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T
+#else
+# define acc_int32f_t acc_int32l_t
+# define acc_uint32f_t acc_uint32l_t
+# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T
+#endif
+#endif
+#if !defined(acc_intptr_t)
+#if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16))
+# define __ACC_INTPTR_T_IS_POINTER 1
+ typedef char* acc_intptr_t;
+ typedef char* acc_uintptr_t;
+# define acc_intptr_t acc_intptr_t
+# define acc_uintptr_t acc_uintptr_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P
+#elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4))
+ typedef __w64 int acc_intptr_t;
+ typedef __w64 unsigned int acc_uintptr_t;
+# define acc_intptr_t acc_intptr_t
+# define acc_uintptr_t acc_uintptr_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P)
+# define acc_intptr_t short
+# define acc_uintptr_t unsigned short
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT
+#elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_intptr_t int
+# define acc_uintptr_t unsigned int
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P)
+# define acc_intptr_t long
+# define acc_uintptr_t unsigned long
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG
+#elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P)
+# define acc_intptr_t acc_int64l_t
+# define acc_uintptr_t acc_uint64l_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T
+#else
+# error "acc_intptr_t"
+#endif
+#endif
+#if !defined(acc_word_t)
+#if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0)
+#if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER)
+# define acc_word_t acc_uintptr_t
+# define acc_sword_t acc_intptr_t
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T
+#elif (ACC_WORDSIZE == ACC_SIZEOF_LONG)
+# define acc_word_t unsigned long
+# define acc_sword_t long
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG
+#elif (ACC_WORDSIZE == ACC_SIZEOF_INT)
+# define acc_word_t unsigned int
+# define acc_sword_t int
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT
+#elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT)
+# define acc_word_t unsigned short
+# define acc_sword_t short
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT
+#elif (ACC_WORDSIZE == 1)
+# define acc_word_t unsigned char
+# define acc_sword_t signed char
+# define ACC_SIZEOF_ACC_WORD_T 1
+#elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T)
+# define acc_word_t acc_uint64l_t
+# define acc_sword_t acc_int64l_t
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T
+#elif (ACC_ARCH_SPU) && (ACC_CC_GNUC)
+#if 0
+ typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int acc_sword_t __attribute__((__mode__(__V16QI__)));
+# define acc_word_t acc_word_t
+# define acc_sword_t acc_sword_t
+# define ACC_SIZEOF_ACC_WORD_T 16
+#endif
+#else
+# error "acc_word_t"
+#endif
+#endif
+#endif
+#if !defined(ACC_INT16_C)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2)
+# define ACC_INT16_C(c) ((c) + 0)
+# define ACC_UINT16_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2)
+# define ACC_INT16_C(c) ((c) + 0L)
+# define ACC_UINT16_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 2)
+# define ACC_INT16_C(c) c
+# define ACC_UINT16_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 2)
+# define ACC_INT16_C(c) c##L
+# define ACC_UINT16_C(c) c##UL
+# else
+# error "ACC_INT16_C"
+# endif
+#endif
+#if !defined(ACC_INT32_C)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4)
+# define ACC_INT32_C(c) ((c) + 0)
+# define ACC_UINT32_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4)
+# define ACC_INT32_C(c) ((c) + 0L)
+# define ACC_UINT32_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 4)
+# define ACC_INT32_C(c) c
+# define ACC_UINT32_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 4)
+# define ACC_INT32_C(c) c##L
+# define ACC_UINT32_C(c) c##UL
+# elif (ACC_SIZEOF_LONG_LONG >= 4)
+# define ACC_INT32_C(c) c##LL
+# define ACC_UINT32_C(c) c##ULL
+# else
+# error "ACC_INT32_C"
+# endif
+#endif
+#if !defined(ACC_INT64_C) && defined(acc_int64l_t)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8)
+# define ACC_INT64_C(c) ((c) + 0)
+# define ACC_UINT64_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8)
+# define ACC_INT64_C(c) ((c) + 0L)
+# define ACC_UINT64_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 8)
+# define ACC_INT64_C(c) c
+# define ACC_UINT64_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 8)
+# define ACC_INT64_C(c) c##L
+# define ACC_UINT64_C(c) c##UL
+# else
+# error "ACC_INT64_C"
+# endif
+#endif
+#if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T)
+# define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T
+#endif
+#if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T)
+# define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T
+#endif
+#if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T)
+# define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T
+#endif
+#if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T)
+# define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T
+#endif
+#if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T)
+# define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T
+#endif
+#if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T)
+# define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T
+#endif
+#if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T)
+# define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T
+#endif
+#if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T)
+# define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T
+#endif
+#if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4)
+# define acc_signo_t acc_int32e_t
+#endif
+#if !defined(acc_signo_t)
+# define acc_signo_t int
+#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
+typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
+#elif defined(RETSIGTYPE)
+typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+#else
+typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+#endif
+#if defined(__cplusplus)
+}
+#endif
+# if (ACC_CFG_NO_ACC_UA_H)
+# else
+#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul))
+#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (ACC_CC_INTELC) && defined(_WIN32)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700))
+#elif (ACC_CC_LLVM)
+#elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
+#if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
+ typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t;
+# define __acc_ua16_t __acc_ua16_t
+#endif
+#if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
+ typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t;
+# define __acc_ua32_t __acc_ua32_t
+#endif
+#if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
+ typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t;
+# define __acc_ua64_t __acc_ua64_t
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
+#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
+# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
+# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
+#endif
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+#if !defined(ACC_UA_GET_LE16)
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+ return v;
+}
+#define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
+#endif
+#if !defined(ACC_UA_SET_LE16)
+extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+ __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+}
+#define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v)
+#endif
+#endif
+#endif
+#if !defined(ACC_UA_COPY16)
+# define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s))
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
+#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
+# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
+# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
+#endif
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+#if !defined(ACC_UA_GET_LE32)
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+ return v;
+}
+#define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
+#endif
+#if !defined(ACC_UA_SET_LE32)
+extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+ __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+}
+#define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v)
+#endif
+#endif
+#endif
+#if !defined(ACC_UA_COPY32)
+# define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s))
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
+#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
+# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE64(p) ACC_UA_GET64(p)
+# define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v)
+#endif
+#if !defined(ACC_UA_COPY64)
+# define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s))
+#endif
+#endif
+# endif
+#endif
+#endif
+#if defined(ACC_WANT_ACC_TYPE_H)
+# undef ACC_WANT_ACC_TYPE_H
+# if defined(ACC_CFG_NO_ACC_TYPE_H)
+# error "ACC_WANT_ACC_TYPE_H with ACC_CFG_NO_ACC_TYPE_H"
+# endif
+#if (ACC_SIZEOF_LONG_LONG+0 > 0)
+__acc_gnuc_extension__ typedef long long acc_llong_t;
+__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
+#endif
+#if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0))
+# error "missing defines for sizes"
+#endif
+#if !defined(acc_int16e_t)
+#if (ACC_SIZEOF_LONG == 2)
+# define acc_int16e_t long
+# define acc_uint16e_t unsigned long
+#elif (ACC_SIZEOF_INT == 2)
+# define acc_int16e_t int
+# define acc_uint16e_t unsigned int
+#elif (ACC_SIZEOF_SHORT == 2)
+# define acc_int16e_t short int
+# define acc_uint16e_t unsigned short int
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
+ typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
+ typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
+# define acc_int16e_t __acc_int16e_hi_t
+# define acc_uint16e_t __acc_uint16e_hi_t
+#elif (ACC_SIZEOF___INT16 == 2)
+# define acc_int16e_t __int16
+# define acc_uint16e_t unsigned __int16
+#else
+#endif
+#endif
+#if defined(acc_int16e_t)
+# define ACC_SIZEOF_ACC_INT16E_T 2
+#endif
+#if !defined(acc_int32e_t)
+#if (ACC_SIZEOF_LONG == 4)
+# define acc_int32e_t long int
+# define acc_uint32e_t unsigned long int
+#elif (ACC_SIZEOF_INT == 4)
+# define acc_int32e_t int
+# define acc_uint32e_t unsigned int
+#elif (ACC_SIZEOF_SHORT == 4)
+# define acc_int32e_t short int
+# define acc_uint32e_t unsigned short int
+#elif (ACC_SIZEOF_LONG_LONG == 4)
+# define acc_int32e_t acc_llong_t
+# define acc_uint32e_t acc_ullong_t
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
+ typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
+ typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
+# define acc_int32e_t __acc_int32e_si_t
+# define acc_uint32e_t __acc_uint32e_si_t
+#elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
+ typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
+ typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
+# define acc_int32e_t __acc_int32e_si_t
+# define acc_uint32e_t __acc_uint32e_si_t
+# define ACC_INT32_C(c) c##LL
+# define ACC_UINT32_C(c) c##ULL
+#elif (ACC_SIZEOF___INT32 == 4)
+# define acc_int32e_t __int32
+# define acc_uint32e_t unsigned __int32
+#else
+#endif
+#endif
+#if defined(acc_int32e_t)
+# define ACC_SIZEOF_ACC_INT32E_T 4
+#endif
+#if !defined(acc_int64e_t)
+#if (ACC_SIZEOF___INT64 == 8)
+# if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
+# define ACC_CFG_TYPE_PREFER___INT64 1
+# endif
+#endif
+#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_int64e_t int
+# define acc_uint64e_t unsigned int
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG == 8)
+# define acc_int64e_t long int
+# define acc_uint64e_t unsigned long int
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
+#elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
+# define acc_int64e_t acc_llong_t
+# define acc_uint64e_t acc_ullong_t
+# if (ACC_CC_BORLANDC)
+# define ACC_INT64_C(c) ((c) + 0ll)
+# define ACC_UINT64_C(c) ((c) + 0ull)
+# else
+# define ACC_INT64_C(c) c##LL
+# define ACC_UINT64_C(c) c##ULL
+# endif
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG
+#elif (ACC_SIZEOF___INT64 == 8)
+# define acc_int64e_t __int64
+# define acc_uint64e_t unsigned __int64
+# if (ACC_CC_BORLANDC)
+# define ACC_INT64_C(c) ((c) + 0i64)
+# define ACC_UINT64_C(c) ((c) + 0ui64)
+# else
+# define ACC_INT64_C(c) c##i64
+# define ACC_UINT64_C(c) c##ui64
+# endif
+# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64
+#else
+#endif
+#endif
+#if !defined(acc_int32l_t)
+#if defined(acc_int32e_t)
+# define acc_int32l_t acc_int32e_t
+# define acc_uint32l_t acc_uint32e_t
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T
+#elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_int32l_t int
+# define acc_uint32l_t unsigned int
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG >= 4)
+# define acc_int32l_t long int
+# define acc_uint32l_t unsigned long int
+# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG
+#else
+# error "acc_int32l_t"
+#endif
+#endif
+#if !defined(acc_int64l_t)
+#if defined(acc_int64e_t)
+# define acc_int64l_t acc_int64e_t
+# define acc_uint64l_t acc_uint64e_t
+# define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T
+#else
+#endif
+#endif
+#if !defined(acc_int32f_t)
+#if (ACC_SIZEOF_SIZE_T >= 8)
+# define acc_int32f_t acc_int64l_t
+# define acc_uint32f_t acc_uint64l_t
+# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T
+#else
+# define acc_int32f_t acc_int32l_t
+# define acc_uint32f_t acc_uint32l_t
+# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T
+#endif
+#endif
+#if !defined(acc_intptr_t)
+#if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16))
+# define __ACC_INTPTR_T_IS_POINTER 1
+ typedef char* acc_intptr_t;
+ typedef char* acc_uintptr_t;
+# define acc_intptr_t acc_intptr_t
+# define acc_uintptr_t acc_uintptr_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P
+#elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4))
+ typedef __w64 int acc_intptr_t;
+ typedef __w64 unsigned int acc_uintptr_t;
+# define acc_intptr_t acc_intptr_t
+# define acc_uintptr_t acc_uintptr_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P)
+# define acc_intptr_t short
+# define acc_uintptr_t unsigned short
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT
+#elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
+# define acc_intptr_t int
+# define acc_uintptr_t unsigned int
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
+#elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P)
+# define acc_intptr_t long
+# define acc_uintptr_t unsigned long
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG
+#elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P)
+# define acc_intptr_t acc_int64l_t
+# define acc_uintptr_t acc_uint64l_t
+# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T
+#else
+# error "acc_intptr_t"
+#endif
+#endif
+#if !defined(acc_word_t)
+#if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0)
+#if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER)
+# define acc_word_t acc_uintptr_t
+# define acc_sword_t acc_intptr_t
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T
+#elif (ACC_WORDSIZE == ACC_SIZEOF_LONG)
+# define acc_word_t unsigned long
+# define acc_sword_t long
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG
+#elif (ACC_WORDSIZE == ACC_SIZEOF_INT)
+# define acc_word_t unsigned int
+# define acc_sword_t int
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT
+#elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT)
+# define acc_word_t unsigned short
+# define acc_sword_t short
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT
+#elif (ACC_WORDSIZE == 1)
+# define acc_word_t unsigned char
+# define acc_sword_t signed char
+# define ACC_SIZEOF_ACC_WORD_T 1
+#elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T)
+# define acc_word_t acc_uint64l_t
+# define acc_sword_t acc_int64l_t
+# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T
+#elif (ACC_ARCH_SPU) && (ACC_CC_GNUC)
+#if 0
+ typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__)));
+ typedef int acc_sword_t __attribute__((__mode__(__V16QI__)));
+# define acc_word_t acc_word_t
+# define acc_sword_t acc_sword_t
+# define ACC_SIZEOF_ACC_WORD_T 16
+#endif
+#else
+# error "acc_word_t"
+#endif
+#endif
+#endif
+#if !defined(ACC_INT16_C)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2)
+# define ACC_INT16_C(c) ((c) + 0)
+# define ACC_UINT16_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2)
+# define ACC_INT16_C(c) ((c) + 0L)
+# define ACC_UINT16_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 2)
+# define ACC_INT16_C(c) c
+# define ACC_UINT16_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 2)
+# define ACC_INT16_C(c) c##L
+# define ACC_UINT16_C(c) c##UL
+# else
+# error "ACC_INT16_C"
+# endif
+#endif
+#if !defined(ACC_INT32_C)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4)
+# define ACC_INT32_C(c) ((c) + 0)
+# define ACC_UINT32_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4)
+# define ACC_INT32_C(c) ((c) + 0L)
+# define ACC_UINT32_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 4)
+# define ACC_INT32_C(c) c
+# define ACC_UINT32_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 4)
+# define ACC_INT32_C(c) c##L
+# define ACC_UINT32_C(c) c##UL
+# elif (ACC_SIZEOF_LONG_LONG >= 4)
+# define ACC_INT32_C(c) c##LL
+# define ACC_UINT32_C(c) c##ULL
+# else
+# error "ACC_INT32_C"
+# endif
+#endif
+#if !defined(ACC_INT64_C) && defined(acc_int64l_t)
+# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8)
+# define ACC_INT64_C(c) ((c) + 0)
+# define ACC_UINT64_C(c) ((c) + 0U)
+# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8)
+# define ACC_INT64_C(c) ((c) + 0L)
+# define ACC_UINT64_C(c) ((c) + 0UL)
+# elif (ACC_SIZEOF_INT >= 8)
+# define ACC_INT64_C(c) c
+# define ACC_UINT64_C(c) c##U
+# elif (ACC_SIZEOF_LONG >= 8)
+# define ACC_INT64_C(c) c##L
+# define ACC_UINT64_C(c) c##UL
+# else
+# error "ACC_INT64_C"
+# endif
+#endif
+#if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T)
+# define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T
+#endif
+#if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T)
+# define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T
+#endif
+#if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T)
+# define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T
+#endif
+#if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T)
+# define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T
+#endif
+#if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T)
+# define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T
+#endif
+#if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T)
+# define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T
+#endif
+#if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T)
+# define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T
+#endif
+#if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T)
+# define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T
+#endif
+#if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4)
+# define acc_signo_t acc_int32e_t
+#endif
+#if !defined(acc_signo_t)
+# define acc_signo_t int
+#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
+typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
+#elif defined(RETSIGTYPE)
+typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+#else
+typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+#endif
+#if defined(__cplusplus)
+}
+#endif
+# if !defined(ACC_CFG_NO_ACC_UA_H)
+#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul))
+#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
+#elif (ACC_CC_INTELC) && defined(_WIN32)
+#elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700))
+#elif (ACC_CC_LLVM)
+#elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
+#if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
+ typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t;
+# define __acc_ua16_t __acc_ua16_t
+#endif
+#if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
+ typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t;
+# define __acc_ua32_t __acc_ua32_t
+#endif
+#if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
+ typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t;
+# define __acc_ua64_t __acc_ua64_t
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
+#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
+# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
+# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
+#endif
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+#if !defined(ACC_UA_GET_LE16)
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+ return v;
+}
+#define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
+#endif
+#if !defined(ACC_UA_SET_LE16)
+extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+ __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+}
+#define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v)
+#endif
+#endif
+#endif
+#if !defined(ACC_UA_COPY16)
+# define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s))
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
+#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
+# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
+# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
+#endif
+#if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+#if !defined(ACC_UA_GET_LE32)
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+ return v;
+}
+#define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
+#endif
+#if !defined(ACC_UA_SET_LE32)
+extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+ __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+}
+#define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v)
+#endif
+#endif
+#endif
+#if !defined(ACC_UA_COPY32)
+# define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s))
+#endif
+#endif
+#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
+#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
+#define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
+#if (ACC_ABI_BIG_ENDIAN)
+# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
+# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
+#elif (ACC_ABI_LITTLE_ENDIAN)
+# define ACC_UA_GET_LE64(p) ACC_UA_GET64(p)
+# define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v)
+#endif
+#if !defined(ACC_UA_COPY64)
+# define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s))
+#endif
+#endif
+# endif
+#endif
+#if defined(ACC_WANT_ACC_INCD_H)
+# undef ACC_WANT_ACC_INCD_H
+#ifndef __ACC_INCD_H_INCLUDED
+#define __ACC_INCD_H_INCLUDED 1
+#if (ACC_LIBC_NAKED)
+#ifndef __ACC_FALLBACK_STDDEF_H_INCLUDED
+#define __ACC_FALLBACK_STDDEF_H_INCLUDED 1
+#if defined(__PTRDIFF_TYPE__)
+typedef __PTRDIFF_TYPE__ acc_fallback_ptrdiff_t;
+#elif defined(__MIPS_PSX2__)
+typedef int acc_fallback_ptrdiff_t;
+#else
+typedef long acc_fallback_ptrdiff_t;
+#endif
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ acc_fallback_size_t;
+#elif defined(__MIPS_PSX2__)
+typedef unsigned int acc_fallback_size_t;
+#else
+typedef unsigned long acc_fallback_size_t;
+#endif
+#if !defined(ptrdiff_t)
+typedef acc_fallback_ptrdiff_t ptrdiff_t;
+#ifndef _PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED 1
+#endif
+#endif
+#if !defined(size_t)
+typedef acc_fallback_size_t size_t;
+#ifndef _SIZE_T_DEFINED
+#define _SIZE_T_DEFINED 1
+#endif
+#endif
+#if !defined(__cplusplus) && !defined(wchar_t)
+typedef unsigned short wchar_t;
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED 1
+#endif
+#endif
+#ifndef NULL
+#if defined(__cplusplus) && defined(__GNUC__) && (__GNUC__ >= 4)
+#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0
+#else
+#define NULL ((void*)0)
+#endif
+#endif
+#ifndef offsetof
+#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
+#endif
+#endif
+#elif (ACC_LIBC_FREESTANDING)
+# if HAVE_STDDEF_H
+# include <stddef.h>
+# endif
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# if HAVE_STDIO_H
+# include <stdio.h>
+# endif
+# if HAVE_STDDEF_H
+# include <stddef.h>
+# endif
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#else
+#include <stdio.h>
+#if (HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
+# include <time.h>
+#endif
+#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
+#endif
+#endif
+#endif
+#if defined(ACC_WANT_ACC_INCE_H)
+# undef ACC_WANT_ACC_INCE_H
+#ifndef __ACC_INCE_H_INCLUDED
+#define __ACC_INCE_H_INCLUDED 1
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+# if (HAVE_SETJMP_H)
+# include <setjmp.h>
+# endif
+#else
+#if (HAVE_STDARG_H)
+# include <stdarg.h>
+#endif
+#if (HAVE_CTYPE_H)
+# include <ctype.h>
+#endif
+#if (HAVE_ERRNO_H)
+# include <errno.h>
+#endif
+#if (HAVE_MALLOC_H)
+# include <malloc.h>
+#endif
+#if (HAVE_ALLOCA_H)
+# include <alloca.h>
+#endif
+#if (HAVE_FCNTL_H)
+# include <fcntl.h>
+#endif
+#if (HAVE_DIRENT_H)
+# include <dirent.h>
+#endif
+#if (HAVE_SETJMP_H)
+# include <setjmp.h>
+#endif
+#if (HAVE_SIGNAL_H)
+# include <signal.h>
+#endif
+#if (TIME_WITH_SYS_TIME)
+# include <sys/time.h>
+# include <time.h>
+#elif (HAVE_TIME_H)
+# include <time.h>
+#endif
+#if (HAVE_UTIME_H)
+# include <utime.h>
+#elif (HAVE_SYS_UTIME_H)
+# include <sys/utime.h>
+#endif
+#if (HAVE_IO_H)
+# include <io.h>
+#endif
+#if (HAVE_DOS_H)
+# include <dos.h>
+#endif
+#if (HAVE_DIRECT_H)
+# include <direct.h>
+#endif
+#if (HAVE_SHARE_H)
+# include <share.h>
+#endif
+#if (ACC_CC_NDPC)
+# include <os.h>
+#endif
+#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
+# include <ext.h>
+#endif
+#endif
+#endif
+#endif
+#if defined(ACC_WANT_ACC_INCI_H)
+# undef ACC_WANT_ACC_INCI_H
+#ifndef __ACC_INCI_H_INCLUDED
+#define __ACC_INCI_H_INCLUDED 1
+#if (ACC_LIBC_NAKED)
+#elif (ACC_LIBC_FREESTANDING)
+#elif (ACC_LIBC_MOSTLY_FREESTANDING)
+#else
+#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+# include <tos.h>
+#elif (ACC_HAVE_WINDOWS_H)
+# if 1 && !defined(WIN32_LEAN_AND_MEAN)
+# define WIN32_LEAN_AND_MEAN 1
+# endif
+# if 1 && !defined(_WIN32_WINNT)
+# define _WIN32_WINNT 0x0400
+# endif
+# include <windows.h>
+# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+# include <dir.h>
+# endif
+#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16)
+# if (ACC_CC_AZTECC)
+# include <model.h>
+# include <stat.h>
+# elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+# include <alloc.h>
+# include <dir.h>
+# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+# include <sys/exceptn.h>
+# elif (ACC_CC_PACIFICC)
+# include <unixio.h>
+# include <stat.h>
+# include <sys.h>
+# elif (ACC_CC_WATCOMC)
+# include <i86.h>
+# endif
+#elif (ACC_OS_OS216)
+# if (ACC_CC_WATCOMC)
+# include <i86.h>
+# endif
+#endif
+#if (HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
+#if (HAVE_SYS_RESOURCE_H)
+# include <sys/resource.h>
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
+# if defined(FP_OFF)
+# define ACC_PTR_FP_OFF(x) FP_OFF(x)
+# elif defined(_FP_OFF)
+# define ACC_PTR_FP_OFF(x) _FP_OFF(x)
+# else
+# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# endif
+# if defined(FP_SEG)
+# define ACC_PTR_FP_SEG(x) FP_SEG(x)
+# elif defined(_FP_SEG)
+# define ACC_PTR_FP_SEG(x) _FP_SEG(x)
+# else
+# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# endif
+# if defined(MK_FP)
+# define ACC_PTR_MK_FP(s,o) MK_FP(s,o)
+# elif defined(_MK_FP)
+# define ACC_PTR_MK_FP(s,o) _MK_FP(s,o)
+# else
+# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+# endif
+# if 0
+# undef ACC_PTR_FP_OFF
+# undef ACC_PTR_FP_SEG
+# undef ACC_PTR_MK_FP
+# 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
+#endif
+#endif
+#endif
+#endif
+#if defined(ACC_WANT_ACC_LIB_H)
+# undef ACC_WANT_ACC_LIB_H
+#ifndef __ACC_LIB_H_INCLUDED
+#define __ACC_LIB_H_INCLUDED 1
+#if !defined(__ACCLIB_FUNCNAME)
+# define __ACCLIB_FUNCNAME(f) f
+#endif
+#if !defined(ACCLIB_EXTERN)
+# define ACCLIB_EXTERN(r,f) extern r __ACCLIB_FUNCNAME(f)
+#endif
+#if !defined(ACCLIB_EXTERN_NOINLINE)
+# if defined(__acc_noinline)
+# define ACCLIB_EXTERN_NOINLINE(r,f) extern __acc_noinline r __ACCLIB_FUNCNAME(f)
+# else
+# define ACCLIB_EXTERN_NOINLINE(r,f) extern r __ACCLIB_FUNCNAME(f)
+# endif
+#endif
+#if !defined(__ACCLIB_CONST_CAST_RETURN)
+#if 1 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (acc_uintptr_t) (var);
+#elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __ACCLIB_CONST_CAST_RETURN(type,var) \
+ { union { type a; const type b; } u; u.b = (var); return u.a; }
+#else
+# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (var);
+#endif
+#endif
+#if (ACC_OS_WIN64)
+# define acclib_handle_t acc_int64l_t
+# define acclib_uhandle_t acc_uint64l_t
+#elif (ACC_ARCH_I386 && ACC_CC_MSC && (_MSC_VER >= 1300))
+ typedef __w64 long acclib_handle_t;
+ typedef __w64 unsigned long acclib_uhandle_t;
+# define acclib_handle_t acclib_handle_t
+# define acclib_uhandle_t acclib_uhandle_t
+#else
+# define acclib_handle_t long
+# define acclib_uhandle_t unsigned long
+#endif
+#if 0
+ACCLIB_EXTERN(int, acc_ascii_digit) (int);
+ACCLIB_EXTERN(int, acc_ascii_islower) (int);
+ACCLIB_EXTERN(int, acc_ascii_isupper) (int);
+ACCLIB_EXTERN(int, acc_ascii_tolower) (int);
+ACCLIB_EXTERN(int, acc_ascii_toupper) (int);
+ACCLIB_EXTERN(int, acc_ascii_utolower) (int);
+ACCLIB_EXTERN(int, acc_ascii_utoupper) (int);
+#endif
+#define acc_ascii_isdigit(c) (((unsigned)(c) - 48) < 10)
+#define acc_ascii_islower(c) (((unsigned)(c) - 97) < 26)
+#define acc_ascii_isupper(c) (((unsigned)(c) - 65) < 26)
+#define acc_ascii_tolower(c) ((int)(c) + (acc_ascii_isupper(c) << 5))
+#define acc_ascii_toupper(c) ((int)(c) - (acc_ascii_islower(c) << 5))
+#define acc_ascii_utolower(c) acc_ascii_tolower((unsigned char)(c))
+#define acc_ascii_utoupper(c) acc_ascii_toupper((unsigned char)(c))
+#ifndef acc_hsize_t
+#if (ACC_HAVE_MM_HUGE_PTR)
+# define acc_hsize_t unsigned long
+# define acc_hvoid_p void __huge *
+# define acc_hchar_p char __huge *
+# define acc_hchar_pp char __huge * __huge *
+# define acc_hbyte_p unsigned char __huge *
+#else
+# define acc_hsize_t size_t
+# define acc_hvoid_p void *
+# define acc_hchar_p char *
+# define acc_hchar_pp char **
+# define acc_hbyte_p unsigned char *
+#endif
+#endif
+ACCLIB_EXTERN(acc_hvoid_p, acc_halloc) (acc_hsize_t);
+ACCLIB_EXTERN(void, acc_hfree) (acc_hvoid_p);
+#if (ACC_OS_DOS16 || ACC_OS_OS216)
+ACCLIB_EXTERN(void __far*, acc_dos_alloc) (unsigned long);
+ACCLIB_EXTERN(int, acc_dos_free) (void __far*);
+#endif
+ACCLIB_EXTERN(int, acc_hmemcmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemset) (acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrlen) (const acc_hchar_p);
+ACCLIB_EXTERN(int, acc_hstrcmp) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(int, acc_hstrncmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(int, acc_ascii_hstricmp) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(int, acc_ascii_hstrnicmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(int, acc_ascii_hmemicmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrstr) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrcpy) (acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrcat) (acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(int, acc_hstrscpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(int, acc_hstrscat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrccpy) (acc_hchar_p, const acc_hchar_p, int);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p, const acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrchr) (const acc_hchar_p, int);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p, int);
+ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p, int);
+ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p, int);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p, int, acc_hsize_t);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrspn) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrsep) (acc_hchar_pp, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp, const acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p);
+ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p);
+ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hsize_t, acc_hfread) (void *, acc_hvoid_p, acc_hsize_t);
+ACCLIB_EXTERN(acc_hsize_t, acc_hfwrite) (void *, const acc_hvoid_p, acc_hsize_t);
+#if (ACC_HAVE_MM_HUGE_PTR)
+ACCLIB_EXTERN(long, acc_hread) (int, acc_hvoid_p, long);
+ACCLIB_EXTERN(long, acc_hwrite) (int, const acc_hvoid_p, long);
+#endif
+ACCLIB_EXTERN(long, acc_safe_hread) (int, acc_hvoid_p, long);
+ACCLIB_EXTERN(long, acc_safe_hwrite) (int, const acc_hvoid_p, long);
+ACCLIB_EXTERN(unsigned, acc_ua_get_be16) (const acc_hvoid_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p);
+ACCLIB_EXTERN(void, acc_ua_set_be16) (acc_hvoid_p, unsigned);
+ACCLIB_EXTERN(void, acc_ua_set_be24) (acc_hvoid_p, acc_uint32l_t);
+ACCLIB_EXTERN(void, acc_ua_set_be32) (acc_hvoid_p, acc_uint32l_t);
+ACCLIB_EXTERN(unsigned, acc_ua_get_le16) (const acc_hvoid_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p);
+ACCLIB_EXTERN(void, acc_ua_set_le16) (acc_hvoid_p, unsigned);
+ACCLIB_EXTERN(void, acc_ua_set_le24) (acc_hvoid_p, acc_uint32l_t);
+ACCLIB_EXTERN(void, acc_ua_set_le32) (acc_hvoid_p, acc_uint32l_t);
+#if defined(acc_int64l_t)
+ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p);
+ACCLIB_EXTERN(void, acc_ua_set_be64) (acc_hvoid_p, acc_uint64l_t);
+ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p);
+ACCLIB_EXTERN(void, acc_ua_set_le64) (acc_hvoid_p, acc_uint64l_t);
+#endif
+ACCLIB_EXTERN_NOINLINE(short, acc_vget_short) (short, int);
+ACCLIB_EXTERN_NOINLINE(int, acc_vget_int) (int, int);
+ACCLIB_EXTERN_NOINLINE(long, acc_vget_long) (long, int);
+#if defined(acc_int64l_t)
+ACCLIB_EXTERN_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t, int);
+#endif
+ACCLIB_EXTERN_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t, int);
+#if !(ACC_CFG_NO_FLOAT)
+ACCLIB_EXTERN_NOINLINE(float, acc_vget_float) (float, int);
+#endif
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_EXTERN_NOINLINE(double, acc_vget_double) (double, int);
+#endif
+ACCLIB_EXTERN_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p, int);
+ACCLIB_EXTERN_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p, int);
+#if !defined(ACC_FN_PATH_MAX)
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+# define ACC_FN_PATH_MAX 143
+#elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN32 || ACC_OS_WIN64)
+# define ACC_FN_PATH_MAX 259
+#elif (ACC_OS_TOS)
+# define ACC_FN_PATH_MAX 259
+#endif
+#endif
+#if !defined(ACC_FN_PATH_MAX)
+# define ACC_FN_PATH_MAX 1023
+#endif
+#if !defined(ACC_FN_NAME_MAX)
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+# define ACC_FN_NAME_MAX 12
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+# define ACC_FN_NAME_MAX 12
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+#elif (ACC_OS_DOS32)
+# define ACC_FN_NAME_MAX 12
+#endif
+#endif
+#if !defined(ACC_FN_NAME_MAX)
+# define ACC_FN_NAME_MAX ACC_FN_PATH_MAX
+#endif
+#define ACC_FNMATCH_NOESCAPE 1
+#define ACC_FNMATCH_PATHNAME 2
+#define ACC_FNMATCH_PATHSTAR 4
+#define ACC_FNMATCH_PERIOD 8
+#define ACC_FNMATCH_ASCII_CASEFOLD 16
+ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
+#undef __ACCLIB_USE_OPENDIR
+#if (HAVE_DIRENT_H || ACC_CC_WATCOMC)
+# define __ACCLIB_USE_OPENDIR 1
+# if (ACC_OS_DOS32 && defined(__BORLANDC__))
+# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+# elif (ACC_OS_OS2 || ACC_OS_OS216)
+# elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
+# elif (ACC_OS_WIN32 && !(ACC_HAVE_WINDOWS_H))
+# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+# undef __ACCLIB_USE_OPENDIR
+# endif
+#endif
+typedef struct
+{
+#if defined(__ACCLIB_USE_OPENDIR)
+ void* u_dirp;
+# if (ACC_CC_WATCOMC)
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned long f_size;
+# endif
+ char f_name[ACC_FN_NAME_MAX+1];
+#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
+ acclib_handle_t u_handle;
+ unsigned f_attr;
+ unsigned f_size_low;
+ unsigned f_size_high;
+ char f_name[ACC_FN_NAME_MAX+1];
+#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_TOS || ACC_OS_WIN16)
+ char u_dta[21];
+ unsigned char f_attr;
+ unsigned short f_time;
+ unsigned short f_date;
+ unsigned short f_size_low;
+ unsigned short f_size_high;
+ char f_name[ACC_FN_NAME_MAX+1];
+ char u_dirp;
+#else
+ void* u_dirp;
+ char f_name[ACC_FN_NAME_MAX+1];
+#endif
+} acc_dir_t;
+#ifndef acc_dir_p
+#define acc_dir_p acc_dir_t *
+#endif
+ACCLIB_EXTERN(int, acc_opendir) (acc_dir_p, const char*);
+ACCLIB_EXTERN(int, acc_readdir) (acc_dir_p);
+ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p);
+#if (ACC_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
+# define acc_alloca(x) __builtin_alloca((x))
+#elif (ACC_CC_GNUC) && (ACC_OS_CONSOLE_PS2)
+# define acc_alloca(x) __builtin_alloca((x))
+#elif (ACC_CC_BORLANDC || ACC_CC_LCC) && defined(__linux__)
+#elif (HAVE_ALLOCA)
+# define acc_alloca(x) ((void *) (alloca((x))))
+#endif
+#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+# define acc_stackavail() stackavail()
+#elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
+# define acc_stackavail() stackavail()
+#elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
+# if (ACC_OS_WIN16) && (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
+# else
+# define acc_stackavail() stackavail()
+# endif
+#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_DMC || ACC_CC_SYMANTECC))
+# define acc_stackavail() stackavail()
+#elif ((ACC_ARCH_I086) && ACC_CC_MSC && (_MSC_VER >= 700))
+# define acc_stackavail() _stackavail()
+#elif ((ACC_ARCH_I086) && ACC_CC_MSC)
+# define acc_stackavail() stackavail()
+#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && ACC_CC_TURBOC && (__TURBOC__ >= 0x0450))
+# define acc_stackavail() stackavail()
+#elif (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ >= 0x0400))
+ ACC_EXTERN_C size_t __cdecl stackavail(void);
+# define acc_stackavail() stackavail()
+#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_WATCOMC))
+# define acc_stackavail() stackavail()
+#elif (ACC_ARCH_I086 && ACC_CC_ZORTECHC)
+# define acc_stackavail() _chkstack()
+#endif
+ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
+ACCLIB_EXTERN(const char *, acc_getenv) (const char *);
+ACCLIB_EXTERN(int, acc_isatty) (int);
+ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
+ACCLIB_EXTERN(int, acc_rmdir) (const char*);
+ACCLIB_EXTERN(int, acc_response) (int*, char***);
+ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
+#if defined(acc_int32e_t)
+ACCLIB_EXTERN(acc_int32e_t, acc_muldiv32s) (acc_int32e_t, acc_int32e_t, acc_int32e_t);
+ACCLIB_EXTERN(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t, acc_uint32e_t, acc_uint32e_t);
+#endif
+ACCLIB_EXTERN(void, acc_wildargv) (int*, char***);
+ACCLIB_EXTERN_NOINLINE(void, acc_debug_break) (void);
+ACCLIB_EXTERN_NOINLINE(void, acc_debug_nop) (void);
+ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_query) (void);
+ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_enable) (int);
+ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_qemu) (void);
+ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void);
+#if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
+# undef __ACCLIB_PCLOCK_USE_RDTSC
+# undef __ACCLIB_PCLOCK_USE_PERFCTR
+# undef __ACCLIB_UCLOCK_USE_RDTSC
+# undef __ACCLIB_UCLOCK_USE_PERFCTR
+#else
+typedef struct {
+ void* h;
+ int mode;
+ double tsc_to_seconds;
+ unsigned cpu_type, cpu_features, cpu_khz, cpu_nrctrs;
+ const char* cpu_name;
+} acc_perfctr_handle_t;
+typedef struct {
+ acc_uint64l_t tsc;
+#if (ACC_OS_POSIX_LINUX)
+ acc_uint64l_t pmc[18];
+#else
+ acc_uint64l_t pmc[1];
+#endif
+} acc_perfctr_clock_t;
+#ifndef acc_perfctr_handle_p
+#define acc_perfctr_handle_p acc_perfctr_handle_t *
+#endif
+#ifndef acc_perfctr_clock_p
+#define acc_perfctr_clock_p acc_perfctr_clock_t *
+#endif
+ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p);
+ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p);
+ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p);
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p);
+ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t);
+#endif
+ACCLIB_EXTERN(int, acc_perfctr_flush_cpu_cache) (acc_perfctr_handle_p, unsigned);
+#endif
+#if defined(acc_int32e_t)
+ACCLIB_EXTERN(int, acc_tsc_read) (acc_uint32e_t*);
+#else
+# undef __ACCLIB_PCLOCK_USE_RDTSC
+# undef __ACCLIB_UCLOCK_USE_RDTSC
+#endif
+struct acc_pclock_handle_t;
+struct acc_pclock_t;
+typedef struct acc_pclock_handle_t acc_pclock_handle_t;
+typedef struct acc_pclock_t acc_pclock_t;
+#ifndef acc_pclock_handle_p
+#define acc_pclock_handle_p acc_pclock_handle_t *
+#endif
+#ifndef acc_pclock_p
+#define acc_pclock_p acc_pclock_t *
+#endif
+#define ACC_PCLOCK_REALTIME 0
+#define ACC_PCLOCK_MONOTONIC 1
+#define ACC_PCLOCK_PROCESS_CPUTIME_ID 2
+#define ACC_PCLOCK_THREAD_CPUTIME_ID 3
+struct acc_pclock_handle_t {
+ acclib_handle_t h;
+ int mode;
+ int read_error;
+ const char* name;
+ int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
+#if defined(acc_int64l_t)
+ acc_uint64l_t ticks_base;
+#endif
+#if (__ACCLIB_PCLOCK_USE_PERFCTR)
+ acc_perfctr_handle_t pch;
+#endif
+};
+struct acc_pclock_t {
+#if defined(acc_int64l_t)
+ acc_int64l_t tv_sec;
+#else
+ acc_int32l_t tv_sec_high;
+ acc_uint32l_t tv_sec_low;
+#endif
+ acc_uint32l_t tv_nsec;
+};
+ACCLIB_EXTERN(int, acc_pclock_open) (acc_pclock_handle_p, int);
+ACCLIB_EXTERN(int, acc_pclock_open_default) (acc_pclock_handle_p);
+ACCLIB_EXTERN(int, acc_pclock_close) (acc_pclock_handle_p);
+ACCLIB_EXTERN(void, acc_pclock_read) (acc_pclock_handle_p, acc_pclock_p);
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_EXTERN(double, acc_pclock_get_elapsed) (acc_pclock_handle_p, const acc_pclock_p, const acc_pclock_p);
+#endif
+ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned);
+#if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
+# undef __ACCLIB_UCLOCK_USE_QPC
+#elif (ACC_OS_CYGWIN || ACC_OS_EMX || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
+# define __ACCLIB_UCLOCK_USE_QPC 1
+#else
+# undef __ACCLIB_UCLOCK_USE_QPC
+#endif
+typedef struct {
+ acclib_handle_t h;
+ int mode;
+ int read_error;
+ const char* name;
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ acc_perfctr_handle_t pch;
+#endif
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ double qpf;
+#endif
+} acc_uclock_handle_t;
+typedef struct {
+ union {
+ acc_uint32l_t t32;
+#if !(ACC_OS_DOS16 || ACC_OS_WIN16)
+# if !(ACC_CFG_NO_DOUBLE)
+ double td;
+# endif
+# if defined(acc_int64l_t)
+ acc_int64l_t t64;
+# endif
+#endif
+ } ticks;
+#if (__ACCLIB_UCLOCK_USE_RDTSC)
+ acc_uint64l_t tsc;
+#endif
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ acc_perfctr_clock_t pcc;
+#endif
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ acc_int64l_t qpc;
+#endif
+} acc_uclock_t;
+#ifndef acc_uclock_handle_p
+#define acc_uclock_handle_p acc_uclock_handle_t *
+#endif
+#ifndef acc_uclock_p
+#define acc_uclock_p acc_uclock_t *
+#endif
+ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p);
+ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p);
+ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p);
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p);
+#endif
+ACCLIB_EXTERN(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p, unsigned);
+struct acc_getopt_t;
+typedef struct acc_getopt_t acc_getopt_t;
+#ifndef acc_getopt_p
+#define acc_getopt_p acc_getopt_t *
+#endif
+struct acc_getopt_longopt_t;
+typedef struct acc_getopt_longopt_t acc_getopt_longopt_t;
+#ifndef acc_getopt_longopt_p
+#define acc_getopt_longopt_p acc_getopt_longopt_t *
+#endif
+struct acc_getopt_longopt_t {
+ const char* name;
+ int has_arg;
+ int* flag;
+ int val;
+};
+struct acc_getopt_t {
+ void *user;
+ const char *progname;
+ int bad_option;
+ char *optarg;
+ void (*opterr)(acc_getopt_p, const char*, void *);
+ int optind;
+ int optopt;
+ int errcount;
+ int argc; char** argv;
+ int eof; int shortpos;
+ int pending_rotate_first, pending_rotate_middle;
+};
+enum { ACC_GETOPT_NO_ARG, ACC_GETOPT_REQUIRED_ARG, ACC_GETOPT_OPTIONAL_ARG, ACC_GETOPT_EXACT_ARG = 0x10 };
+enum { ACC_GETOPT_PERMUTE, ACC_GETOPT_RETURN_IN_ORDER, ACC_GETOPT_REQUIRE_ORDER };
+ACCLIB_EXTERN(void, acc_getopt_init) (acc_getopt_p g,
+ int start_argc, int argc, char** argv);
+ACCLIB_EXTERN(int, acc_getopt) (acc_getopt_p g,
+ const char* shortopts,
+ const acc_getopt_longopt_p longopts,
+ int* longind);
+typedef struct {
+ acc_uint32l_t seed;
+} acc_rand31_t;
+#ifndef acc_rand31_p
+#define acc_rand31_p acc_rand31_t *
+#endif
+ACCLIB_EXTERN(void, acc_srand31) (acc_rand31_p, acc_uint32l_t);
+ACCLIB_EXTERN(acc_uint32l_t, acc_rand31) (acc_rand31_p);
+#if defined(acc_int64l_t)
+typedef struct {
+ acc_uint64l_t seed;
+} acc_rand48_t;
+#ifndef acc_rand48_p
+#define acc_rand48_p acc_rand48_t *
+#endif
+ACCLIB_EXTERN(void, acc_srand48) (acc_rand48_p, acc_uint32l_t);
+ACCLIB_EXTERN(acc_uint32l_t, acc_rand48) (acc_rand48_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p);
+#endif
+#if defined(acc_int64l_t)
+typedef struct {
+ acc_uint64l_t seed;
+} acc_rand64_t;
+#ifndef acc_rand64_p
+#define acc_rand64_p acc_rand64_t *
+#endif
+ACCLIB_EXTERN(void, acc_srand64) (acc_rand64_p, acc_uint64l_t);
+ACCLIB_EXTERN(acc_uint32l_t, acc_rand64) (acc_rand64_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p);
+#endif
+typedef struct {
+ unsigned n;
+ acc_uint32l_t s[624];
+} acc_randmt_t;
+#ifndef acc_randmt_p
+#define acc_randmt_p acc_randmt_t *
+#endif
+ACCLIB_EXTERN(void, acc_srandmt) (acc_randmt_p, acc_uint32l_t);
+ACCLIB_EXTERN(acc_uint32l_t, acc_randmt) (acc_randmt_p);
+ACCLIB_EXTERN(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p);
+#if defined(acc_int64l_t)
+typedef struct {
+ unsigned n;
+ acc_uint64l_t s[312];
+} acc_randmt64_t;
+#ifndef acc_randmt64_p
+#define acc_randmt64_p acc_randmt64_t *
+#endif
+ACCLIB_EXTERN(void, acc_srandmt64) (acc_randmt64_p, acc_uint64l_t);
+ACCLIB_EXTERN(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p);
+#endif
+#define ACC_SPAWN_P_WAIT 0
+#define ACC_SPAWN_P_NOWAIT 1
+ACCLIB_EXTERN(int, acc_spawnv) (int mode, const char* fn, const char* const * argv);
+ACCLIB_EXTERN(int, acc_spawnvp) (int mode, const char* fn, const char* const * argv);
+ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * argv, const char * const envp);
+#endif
+#endif
+#if defined(ACC_WANT_ACC_CXX_H)
+# undef ACC_WANT_ACC_CXX_H
+#ifndef __ACC_CXX_H_INCLUDED
+#define __ACC_CXX_H_INCLUDED 1
+#if defined(__cplusplus)
+#if defined(ACC_CXX_NOTHROW)
+#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul))
+#elif (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (ACC_CC_HIGHC)
+#elif (ACC_CC_MSC && (_MSC_VER < 1100))
+#elif (ACC_CC_NDPC)
+#elif (ACC_CC_TURBOC)
+#elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND))
+#elif (ACC_CC_ZORTECHC)
+#else
+# define ACC_CXX_NOTHROW throw()
+#endif
+#if !defined(ACC_CXX_NOTHROW)
+# define ACC_CXX_NOTHROW /*empty*/
+#endif
+#if defined(__ACC_CXX_DO_NEW)
+#elif (ACC_CC_NDPC || ACC_CC_PGI)
+# define __ACC_CXX_DO_NEW { return 0; }
+#elif ((ACC_CC_BORLANDC || ACC_CC_TURBOC) && ACC_ARCH_I086)
+# define __ACC_CXX_DO_NEW { return 0; }
+#else
+# define __ACC_CXX_DO_NEW ;
+#endif
+#if defined(__ACC_CXX_DO_DELETE)
+#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+# define __ACC_CXX_DO_DELETE { }
+#else
+# define __ACC_CXX_DO_DELETE ACC_CXX_NOTHROW { }
+#endif
+#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
+#elif (ACC_CC_MSC && ACC_MM_HUGE)
+# define ACC_CXX_DISABLE_NEW_DELETE private:
+#elif (ACC_CC_MSC && (_MSC_VER < 1100))
+#elif (ACC_CC_NDPC)
+#elif (ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+#elif (ACC_CC_TURBOC)
+#elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
+#else
+# define __ACC_CXX_HAVE_ARRAY_NEW 1
+#endif
+#if (__ACC_CXX_HAVE_ARRAY_NEW)
+# define __ACC_CXX_HAVE_PLACEMENT_NEW 1
+#endif
+#if (__ACC_CXX_HAVE_PLACEMENT_NEW)
+# if (ACC_CC_GNUC >= 0x030000ul)
+# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (ACC_CC_INTELC)
+# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
+# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
+# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
+# elif (ACC_CC_PGI)
+# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
+# endif
+#endif
+#if defined(ACC_CXX_DISABLE_NEW_DELETE)
+#elif defined(new) || defined(delete)
+# define ACC_CXX_DISABLE_NEW_DELETE private:
+#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025b00ul))
+# define ACC_CXX_DISABLE_NEW_DELETE private:
+#elif (ACC_CC_HIGHC)
+# define ACC_CXX_DISABLE_NEW_DELETE private:
+#elif !(__ACC_CXX_HAVE_ARRAY_NEW)
+# define ACC_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
+ protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \
+ private:
+#else
+# define ACC_CXX_DISABLE_NEW_DELETE \
+ protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
+ static void operator delete[](void*) __ACC_CXX_DO_DELETE \
+ private: static void* operator new(size_t) __ACC_CXX_DO_NEW \
+ static void* operator new[](size_t) __ACC_CXX_DO_NEW
+#endif
+#if defined(ACC_CXX_TRIGGER_FUNCTION)
+#else
+# define ACC_CXX_TRIGGER_FUNCTION \
+ protected: virtual const void* acc_cxx_trigger_function() const; \
+ private:
+#endif
+#if defined(ACC_CXX_TRIGGER_FUNCTION_IMPL)
+#else
+# define ACC_CXX_TRIGGER_FUNCTION_IMPL(klass) \
+ const void* klass::acc_cxx_trigger_function() const { return 0; }
+#endif
+#endif
+#endif
+#endif
+#if defined(ACC_WANT_ACC_CHK_CH)
+# undef ACC_WANT_ACC_CHK_CH
+#if !defined(ACCCHK_ASSERT)
+# define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#endif
+#if !defined(ACCCHK_ASSERT_SIGN_T)
+# define ACCCHK_ASSERT_SIGN_T(type,relop) \
+ ACCCHK_ASSERT( (type) (-1) relop (type) 0 ) \
+ ACCCHK_ASSERT( (type) (~(type)0) relop (type) 0 ) \
+ ACCCHK_ASSERT( (type) (~(type)0) == (type) (-1) )
+#endif
+#if !defined(ACCCHK_ASSERT_IS_SIGNED_T)
+# define ACCCHK_ASSERT_IS_SIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,<)
+#endif
+#if !defined(ACCCHK_ASSERT_IS_UNSIGNED_T)
+# if (ACC_BROKEN_INTEGRAL_PROMOTION)
+# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) \
+ ACCCHK_ASSERT( (type) (-1) > (type) 0 )
+# else
+# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,>)
+# endif
+#endif
+#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550) && (__BORLANDC__ < 0x0560))
+# pragma option push -w-8055
+#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0550))
+# pragma option push -w-osh
+#endif
+#if (ACC_0xffffffffL - ACC_UINT32_C(4294967294) != 1)
+# error "preprocessor error 1"
+#endif
+#if (ACC_0xffffffffL - ACC_UINT32_C(0xfffffffd) != 2)
+# error "preprocessor error 2"
+#endif
+#define ACCCHK_VAL 1
+#define ACCCHK_TMP1 ACCCHK_VAL
+#undef ACCCHK_VAL
+#define ACCCHK_VAL 2
+#define ACCCHK_TMP2 ACCCHK_VAL
+#if (ACCCHK_TMP1 != 2)
+# error "preprocessor error 3a"
+#endif
+#if (ACCCHK_TMP2 != 2)
+# error "preprocessor error 3b"
+#endif
+#undef ACCCHK_VAL
+#if (ACCCHK_TMP2)
+# error "preprocessor error 3c"
+#endif
+#if (ACCCHK_TMP2 + 0 != 0)
+# error "preprocessor error 3d"
+#endif
+#undef ACCCHK_TMP1
+#undef ACCCHK_TMP2
+#if 0 || defined(ACCCHK_CFG_PEDANTIC)
+# if (ACC_ARCH_MIPS) && defined(_MIPS_SZINT)
+ ACCCHK_ASSERT((_MIPS_SZINT) == 8 * sizeof(int))
+# endif
+# if (ACC_ARCH_MIPS) && defined(_MIPS_SZLONG)
+ ACCCHK_ASSERT((_MIPS_SZLONG) == 8 * sizeof(long))
+# endif
+# if (ACC_ARCH_MIPS) && defined(_MIPS_SZPTR)
+ ACCCHK_ASSERT((_MIPS_SZPTR) == 8 * sizeof(void *))
+# endif
+#endif
+ ACCCHK_ASSERT(1 == 1)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1u,2) == 3)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1u,8) == 255)
+#if (SIZEOF_INT >= 2)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1,15) == 32767)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1u,16) == 0xffffU)
+#else
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,16) == 0xffffUL)
+#endif
+#if (SIZEOF_INT >= 4)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1,31) == 2147483647)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1u,32) == 0xffffffffU)
+#endif
+#if (SIZEOF_LONG >= 4)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,32) == 0xffffffffUL)
+#endif
+#if (SIZEOF_LONG >= 8)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,64) == 0xffffffffffffffffUL)
+#endif
+#if !(ACC_BROKEN_INTEGRAL_PROMOTION)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1u,SIZEOF_INT*8) == ~0u)
+ ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul)
+#endif
+#if !(ACC_BROKEN_SIGNED_RIGHT_SHIFT)
+ ACCCHK_ASSERT(((-1) >> 7) == -1)
+#endif
+ ACCCHK_ASSERT(((1) >> 7) == 0)
+ ACCCHK_ASSERT((~0l & ~0) == ~0l)
+ ACCCHK_ASSERT((~0l & ~0u) == ~0u)
+ ACCCHK_ASSERT((~0ul & ~0) == ~0ul)
+ ACCCHK_ASSERT((~0ul & ~0u) == ~0u)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#elif (SIZEOF_INT == 2)
+ ACCCHK_ASSERT((~0l & ~0u) == 0xffffU)
+ ACCCHK_ASSERT((~0ul & ~0u) == 0xffffU)
+#elif (SIZEOF_INT == 4)
+ ACCCHK_ASSERT((~0l & ~0u) == 0xffffffffU)
+ ACCCHK_ASSERT((~0ul & ~0u) == 0xffffffffU)
+#endif
+ ACCCHK_ASSERT_IS_SIGNED_T(signed char)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
+ ACCCHK_ASSERT(sizeof(signed char) == sizeof(char))
+ ACCCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
+ ACCCHK_ASSERT(sizeof(char) == 1)
+#if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ ACCCHK_ASSERT(sizeof(char) == sizeof((char)0))
+#endif
+#if defined(__cplusplus)
+ ACCCHK_ASSERT(sizeof('\0') == sizeof(char))
+#else
+# if (ACC_CC_DMC)
+# else
+ ACCCHK_ASSERT(sizeof('\0') == sizeof(int))
+# endif
+#endif
+#if defined(__acc_alignof)
+ ACCCHK_ASSERT(__acc_alignof(char) == 1)
+ ACCCHK_ASSERT(__acc_alignof(signed char) == 1)
+ ACCCHK_ASSERT(__acc_alignof(unsigned char) == 1)
+#if defined(acc_int16e_t)
+ ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) >= 1)
+ ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) <= 2)
+#endif
+#if defined(acc_int32e_t)
+ ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) >= 1)
+ ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) <= 4)
+#endif
+#endif
+ ACCCHK_ASSERT_IS_SIGNED_T(short)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
+ ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
+#if !(ACC_ABI_I8LP16)
+ ACCCHK_ASSERT(sizeof(short) >= 2)
+#endif
+ ACCCHK_ASSERT(sizeof(short) >= sizeof(char))
+#if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
+#else
+ ACCCHK_ASSERT(sizeof(short) == sizeof((short)0))
+#endif
+#if (SIZEOF_SHORT > 0)
+ ACCCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
+#endif
+ ACCCHK_ASSERT_IS_SIGNED_T(int)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
+ ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
+#if !(ACC_ABI_I8LP16)
+ ACCCHK_ASSERT(sizeof(int) >= 2)
+#endif
+ ACCCHK_ASSERT(sizeof(int) >= sizeof(short))
+ ACCCHK_ASSERT(sizeof(int) == sizeof(0))
+ ACCCHK_ASSERT(sizeof(int) == sizeof((int)0))
+#if (SIZEOF_INT > 0)
+ ACCCHK_ASSERT(sizeof(int) == SIZEOF_INT)
+#endif
+ ACCCHK_ASSERT(sizeof(0) == sizeof(int))
+ ACCCHK_ASSERT_IS_SIGNED_T(long)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
+ ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
+#if !(ACC_ABI_I8LP16)
+ ACCCHK_ASSERT(sizeof(long) >= 4)
+#endif
+ ACCCHK_ASSERT(sizeof(long) >= sizeof(int))
+ ACCCHK_ASSERT(sizeof(long) == sizeof(0L))
+ ACCCHK_ASSERT(sizeof(long) == sizeof((long)0))
+#if (SIZEOF_LONG > 0)
+ ACCCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
+#endif
+ ACCCHK_ASSERT(sizeof(0L) == sizeof(long))
+ ACCCHK_ASSERT_IS_UNSIGNED_T(size_t)
+ ACCCHK_ASSERT(sizeof(size_t) >= sizeof(int))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0)))
+#if (SIZEOF_SIZE_T > 0)
+ ACCCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
+#endif
+ ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
+#if !(ACC_BROKEN_SIZEOF)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0))
+# if (ACC_HAVE_MM_HUGE_PTR)
+ ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0))
+# endif
+#endif
+#if (SIZEOF_PTRDIFF_T > 0)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
+#endif
+ ACCCHK_ASSERT(sizeof(void*) >= sizeof(char*))
+#if (SIZEOF_VOID_P > 0)
+ ACCCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
+ ACCCHK_ASSERT(sizeof(char*) == SIZEOF_VOID_P)
+#endif
+#if (ACC_HAVE_MM_HUGE_PTR)
+ ACCCHK_ASSERT(4 == sizeof(void __huge*))
+ ACCCHK_ASSERT(4 == sizeof(char __huge*))
+#endif
+#if (ACC_ABI_I8LP16)
+ ACCCHK_ASSERT((((1u << 7) + 1) >> 7) == 1)
+ ACCCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1)
+#else
+ ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
+ ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
+#endif
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+#else
+ ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
+#endif
+ ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
+#if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+#else
+ ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
+#endif
+ ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
+#if defined(acc_int16e_t)
+ ACCCHK_ASSERT(sizeof(acc_int16e_t) == 2)
+ ACCCHK_ASSERT(sizeof(acc_int16e_t) == SIZEOF_ACC_INT16E_T)
+ ACCCHK_ASSERT(sizeof(acc_uint16e_t) == 2)
+ ACCCHK_ASSERT(sizeof(acc_int16e_t) == sizeof(acc_uint16e_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int16e_t)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint16e_t)
+#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+#else
+ ACCCHK_ASSERT(((acc_uint16e_t)(~(acc_uint16e_t)0ul) >> 15) == 1)
+#endif
+ ACCCHK_ASSERT( (acc_int16e_t) (1 + ~(acc_int16e_t)0) == 0)
+#if defined(ACCCHK_CFG_PEDANTIC)
+ ACCCHK_ASSERT( (acc_uint16e_t)(1 + ~(acc_uint16e_t)0) == 0)
+#endif
+#endif
+#if defined(acc_int32e_t)
+ ACCCHK_ASSERT(sizeof(acc_int32e_t) == 4)
+ ACCCHK_ASSERT(sizeof(acc_int32e_t) == SIZEOF_ACC_INT32E_T)
+ ACCCHK_ASSERT(sizeof(acc_uint32e_t) == 4)
+ ACCCHK_ASSERT(sizeof(acc_int32e_t) == sizeof(acc_uint32e_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int32e_t)
+ ACCCHK_ASSERT(((( (acc_int32e_t)1 << 30) + 1) >> 30) == 1)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32e_t)
+ ACCCHK_ASSERT(((( (acc_uint32e_t)1 << 31) + 1) >> 31) == 1)
+ ACCCHK_ASSERT(((acc_uint32e_t)(~(acc_uint32e_t)0ul) >> 31) == 1)
+ ACCCHK_ASSERT( (acc_int32e_t) (1 + ~(acc_int32e_t)0) == 0)
+#if defined(ACCCHK_CFG_PEDANTIC)
+ ACCCHK_ASSERT( (acc_uint32e_t)(1 + ~(acc_uint32e_t)0) == 0)
+#endif
+#endif
+#if defined(acc_int32e_t)
+ ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(acc_int32e_t))
+#endif
+ ACCCHK_ASSERT(sizeof(acc_int32l_t) >= 4)
+ ACCCHK_ASSERT(sizeof(acc_int32l_t) == SIZEOF_ACC_INT32L_T)
+ ACCCHK_ASSERT(sizeof(acc_uint32l_t) >= 4)
+ ACCCHK_ASSERT(sizeof(acc_int32l_t) == sizeof(acc_uint32l_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int32l_t)
+ ACCCHK_ASSERT(((( (acc_int32l_t)1 << 30) + 1) >> 30) == 1)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32l_t)
+ ACCCHK_ASSERT(((( (acc_uint32l_t)1 << 31) + 1) >> 31) == 1)
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(int))
+#if defined(acc_int32e_t)
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32e_t))
+#endif
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) >= 4)
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) == SIZEOF_ACC_INT32F_T)
+ ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= 4)
+ ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= sizeof(acc_uint32l_t))
+ ACCCHK_ASSERT(sizeof(acc_int32f_t) == sizeof(acc_uint32f_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int32f_t)
+ ACCCHK_ASSERT(((( (acc_int32f_t)1 << 30) + 1) >> 30) == 1)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32f_t)
+ ACCCHK_ASSERT(((( (acc_uint32f_t)1 << 31) + 1) >> 31) == 1)
+#if defined(acc_int64e_t)
+ ACCCHK_ASSERT(sizeof(acc_int64e_t) == 8)
+ ACCCHK_ASSERT(sizeof(acc_int64e_t) == SIZEOF_ACC_INT64E_T)
+ ACCCHK_ASSERT(sizeof(acc_uint64e_t) == 8)
+ ACCCHK_ASSERT(sizeof(acc_int64e_t) == sizeof(acc_uint64e_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int64e_t)
+#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64e_t)
+#endif
+#endif
+#if defined(acc_int64l_t)
+#if defined(acc_int64e_t)
+ ACCCHK_ASSERT(sizeof(acc_int64l_t) >= sizeof(acc_int64e_t))
+#endif
+ ACCCHK_ASSERT(sizeof(acc_int64l_t) >= 8)
+ ACCCHK_ASSERT(sizeof(acc_int64l_t) == SIZEOF_ACC_INT64L_T)
+ ACCCHK_ASSERT(sizeof(acc_uint64l_t) >= 8)
+ ACCCHK_ASSERT(sizeof(acc_int64l_t) == sizeof(acc_uint64l_t))
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_int64l_t)
+ ACCCHK_ASSERT(((( (acc_int64l_t)1 << 62) + 1) >> 62) == 1)
+ ACCCHK_ASSERT(((( ACC_INT64_C(1) << 62) + 1) >> 62) == 1)
+#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
+#else
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64l_t)
+ ACCCHK_ASSERT(ACC_UINT64_C(18446744073709551615) > 0)
+#endif
+ ACCCHK_ASSERT(((( (acc_uint64l_t)1 << 63) + 1) >> 63) == 1)
+ ACCCHK_ASSERT(((( ACC_UINT64_C(1) << 63) + 1) >> 63) == 1)
+#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020600ul))
+ ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > ACC_INT64_C(0))
+#else
+ ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > 0)
+#endif
+ ACCCHK_ASSERT(ACC_INT64_C(-9223372036854775807) - 1 < 0)
+ ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483629) == 721)
+ ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483647) == 1)
+ ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483629) == 721)
+ ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483647) == 1)
+#endif
+#if !defined(__ACC_INTPTR_T_IS_POINTER)
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_intptr_t)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uintptr_t)
+#endif
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) >= sizeof(void *))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == SIZEOF_ACC_INTPTR_T)
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(acc_uintptr_t))
+#if defined(acc_word_t)
+ ACCCHK_ASSERT(ACC_WORDSIZE == SIZEOF_ACC_WORD_T)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(acc_word_t)
+ ACCCHK_ASSERT_IS_SIGNED_T(acc_sword_t)
+ ACCCHK_ASSERT(sizeof(acc_word_t) == SIZEOF_ACC_WORD_T)
+ ACCCHK_ASSERT(sizeof(acc_word_t) == sizeof(acc_sword_t))
+#endif
+#if defined(ACC_INT16_C)
+ ACCCHK_ASSERT(sizeof(ACC_INT16_C(0)) >= 2)
+ ACCCHK_ASSERT(sizeof(ACC_UINT16_C(0)) >= 2)
+ ACCCHK_ASSERT((ACC_UINT16_C(0xffff) >> 15) == 1)
+#endif
+#if defined(ACC_INT32_C)
+ ACCCHK_ASSERT(sizeof(ACC_INT32_C(0)) >= 4)
+ ACCCHK_ASSERT(sizeof(ACC_UINT32_C(0)) >= 4)
+ ACCCHK_ASSERT((ACC_UINT32_C(0xffffffff) >> 31) == 1)
+#endif
+#if defined(ACC_INT64_C)
+#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0560))
+#else
+ ACCCHK_ASSERT(sizeof(ACC_INT64_C(0)) >= 8)
+ ACCCHK_ASSERT(sizeof(ACC_UINT64_C(0)) >= 8)
+#endif
+ ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) >> 63) == 1)
+ ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0) == ACC_UINT64_C(0xffffffffffffffff))
+ ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0l) == ACC_UINT64_C(0xffffffffffffffff))
+#if (SIZEOF_INT == 4)
+# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
+# else
+ ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0u) == 0xffffffffu)
+# endif
+#endif
+#if (SIZEOF_LONG == 4)
+# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
+# else
+ ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0ul) == 0xfffffffful)
+# endif
+#endif
+#endif
+#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
+ ACCCHK_ASSERT(sizeof(void*) == 2)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == 2)
+#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
+ ACCCHK_ASSERT(sizeof(void*) == 4)
+#endif
+#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_COMPACT)
+ ACCCHK_ASSERT(sizeof(void (*)(void)) == 2)
+#elif (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)
+ ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#endif
+#if (ACC_ABI_ILP32)
+ ACCCHK_ASSERT(sizeof(int) == 4)
+ ACCCHK_ASSERT(sizeof(long) == 4)
+ ACCCHK_ASSERT(sizeof(void*) == 4)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ABI_ILP64)
+ ACCCHK_ASSERT(sizeof(int) == 8)
+ ACCCHK_ASSERT(sizeof(long) == 8)
+ ACCCHK_ASSERT(sizeof(void*) == 8)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ABI_IP32L64)
+ ACCCHK_ASSERT(sizeof(int) == 4)
+ ACCCHK_ASSERT(sizeof(long) == 8)
+ ACCCHK_ASSERT(sizeof(void*) == 4)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ABI_LLP64)
+ ACCCHK_ASSERT(sizeof(int) == 4)
+ ACCCHK_ASSERT(sizeof(long) == 4)
+ ACCCHK_ASSERT(sizeof(void*) == 8)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ABI_LP32)
+ ACCCHK_ASSERT(sizeof(int) == 2)
+ ACCCHK_ASSERT(sizeof(long) == 4)
+ ACCCHK_ASSERT(sizeof(void*) == 4)
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ABI_LP64)
+ ACCCHK_ASSERT(sizeof(int) == 4)
+ ACCCHK_ASSERT(sizeof(long) == 8)
+ ACCCHK_ASSERT(sizeof(void*) == 8)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_ARCH_I086)
+ ACCCHK_ASSERT(sizeof(size_t) == 2)
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#elif (ACC_ARCH_I386 || ACC_ARCH_M68K)
+ ACCCHK_ASSERT(sizeof(size_t) == 4)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
+#endif
+#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32)
+ ACCCHK_ASSERT(sizeof(size_t) == 4)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
+ ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
+#elif (ACC_OS_WIN64)
+ ACCCHK_ASSERT(sizeof(size_t) == 8)
+ ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
+ ACCCHK_ASSERT(sizeof(void (*)(void)) == 8)
+#endif
+#if (ACC_CC_NDPC)
+#elif (SIZEOF_INT > 1)
+ ACCCHK_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255)
+#endif
+#if (ACC_CC_KEILC)
+#elif (ACC_CC_NDPC)
+#elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
+#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+#elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+ ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
+#endif
+#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
+# pragma option pop
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_UA)
+# undef ACC_WANT_ACCLIB_UA
+#define __ACCLIB_UA_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(unsigned, acc_ua_get_be16) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_BE16)
+ return ACC_UA_GET_BE16(p);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((unsigned)b[1]) | ((unsigned)b[0] << 8);
+#endif
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p p)
+{
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint32l_t)b[2]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[0] << 16);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_BE32)
+ return ACC_UA_GET_BE32(p);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_be16) (acc_hvoid_p p, unsigned v)
+{
+#if defined(ACC_UA_SET_BE16)
+ ACC_UA_SET_BE16(p, v);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[1] = (unsigned char) ((v >> 0) & 0xff);
+ b[0] = (unsigned char) ((v >> 8) & 0xff);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_be24) (acc_hvoid_p p, acc_uint32l_t v)
+{
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[2] = (unsigned char) ((v >> 0) & 0xff);
+ b[1] = (unsigned char) ((v >> 8) & 0xff);
+ b[0] = (unsigned char) ((v >> 16) & 0xff);
+}
+ACCLIB_PUBLIC(void, acc_ua_set_be32) (acc_hvoid_p p, acc_uint32l_t v)
+{
+#if defined(ACC_UA_SET_BE32)
+ ACC_UA_SET_BE32(p, v);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[3] = (unsigned char) ((v >> 0) & 0xff);
+ b[2] = (unsigned char) ((v >> 8) & 0xff);
+ b[1] = (unsigned char) ((v >> 16) & 0xff);
+ b[0] = (unsigned char) ((v >> 24) & 0xff);
+#endif
+}
+ACCLIB_PUBLIC(unsigned, acc_ua_get_le16) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_LE16)
+ return ACC_UA_GET_LE16(p);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((unsigned)b[0]) | ((unsigned)b[1] << 8);
+#endif
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p p)
+{
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_LE32)
+ return ACC_UA_GET_LE32(p);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_le16) (acc_hvoid_p p, unsigned v)
+{
+#if defined(ACC_UA_SET_LE16)
+ ACC_UA_SET_LE16(p, v);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[0] = (unsigned char) ((v >> 0) & 0xff);
+ b[1] = (unsigned char) ((v >> 8) & 0xff);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_le24) (acc_hvoid_p p, acc_uint32l_t v)
+{
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[0] = (unsigned char) ((v >> 0) & 0xff);
+ b[1] = (unsigned char) ((v >> 8) & 0xff);
+ b[2] = (unsigned char) ((v >> 16) & 0xff);
+}
+ACCLIB_PUBLIC(void, acc_ua_set_le32) (acc_hvoid_p p, acc_uint32l_t v)
+{
+#if defined(ACC_UA_SET_LE32)
+ ACC_UA_SET_LE32(p, v);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[0] = (unsigned char) ((v >> 0) & 0xff);
+ b[1] = (unsigned char) ((v >> 8) & 0xff);
+ b[2] = (unsigned char) ((v >> 16) & 0xff);
+ b[3] = (unsigned char) ((v >> 24) & 0xff);
+#endif
+}
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_BE64)
+ return ACC_UA_GET_BE64(p);
+#elif defined(ACC_UA_GET_BE32)
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ acc_uint32e_t v0, v1;
+ v1 = ACC_UA_GET_BE32(b + 0);
+ v0 = ACC_UA_GET_BE32(b + 4);
+ return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
+#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint64l_t)b[7]) | ((acc_uint64l_t)b[6] << 8) | ((acc_uint64l_t)b[5] << 16) | ((acc_uint64l_t)b[4] << 24) | ((acc_uint64l_t)b[3] << 32) | ((acc_uint64l_t)b[2] << 40) | ((acc_uint64l_t)b[1] << 48) | ((acc_uint64l_t)b[0] << 56);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ acc_uint32l_t v0, v1;
+ v1 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
+ b += 4;
+ v0 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
+ return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_be64) (acc_hvoid_p p, acc_uint64l_t v)
+{
+#if defined(ACC_UA_SET_BE64)
+ ACC_UA_SET_BE64(p, v);
+#elif defined(ACC_UA_SET_BE32)
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ ACC_UA_SET_BE32(b + 4, (v >> 0));
+ ACC_UA_SET_BE32(b + 0, (v >> 32));
+#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[7] = (unsigned char) ((v >> 0) & 0xff);
+ b[6] = (unsigned char) ((v >> 8) & 0xff);
+ b[5] = (unsigned char) ((v >> 16) & 0xff);
+ b[4] = (unsigned char) ((v >> 24) & 0xff);
+ b[3] = (unsigned char) ((v >> 32) & 0xff);
+ b[2] = (unsigned char) ((v >> 40) & 0xff);
+ b[1] = (unsigned char) ((v >> 48) & 0xff);
+ b[0] = (unsigned char) ((v >> 56) & 0xff);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ acc_uint32l_t x;
+ x = (acc_uint32l_t) (v >> 0);
+ b[7] = (unsigned char) ((x >> 0) & 0xff);
+ b[6] = (unsigned char) ((x >> 8) & 0xff);
+ b[5] = (unsigned char) ((x >> 16) & 0xff);
+ b[4] = (unsigned char) ((x >> 24) & 0xff);
+ x = (acc_uint32l_t) (v >> 32);
+ b[3] = (unsigned char) ((x >> 0) & 0xff);
+ b[2] = (unsigned char) ((x >> 8) & 0xff);
+ b[1] = (unsigned char) ((x >> 16) & 0xff);
+ b[0] = (unsigned char) ((x >> 24) & 0xff);
+#endif
+}
+#endif
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p p)
+{
+#if defined(ACC_UA_GET_LE64)
+ return ACC_UA_GET_LE64(p);
+#elif defined(ACC_UA_GET_LE32)
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ acc_uint32e_t v0, v1;
+ v0 = ACC_UA_GET_LE32(b + 0);
+ v1 = ACC_UA_GET_LE32(b + 4);
+ return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
+#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ return ((acc_uint64l_t)b[0]) | ((acc_uint64l_t)b[1] << 8) | ((acc_uint64l_t)b[2] << 16) | ((acc_uint64l_t)b[3] << 24) | ((acc_uint64l_t)b[4] << 32) | ((acc_uint64l_t)b[5] << 40) | ((acc_uint64l_t)b[6] << 48) | ((acc_uint64l_t)b[7] << 56);
+#else
+ const acc_hbyte_p b = (const acc_hbyte_p) p;
+ acc_uint32l_t v0, v1;
+ v0 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
+ b += 4;
+ v1 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
+ return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
+#endif
+}
+ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
+{
+#if defined(ACC_UA_SET_LE64)
+ ACC_UA_SET_LE64(p, v);
+#elif defined(ACC_UA_SET_LE32)
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ ACC_UA_SET_LE32(b + 0, (v >> 0));
+ ACC_UA_SET_LE32(b + 4, (v >> 32));
+#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ b[0] = (unsigned char) ((v >> 0) & 0xff);
+ b[1] = (unsigned char) ((v >> 8) & 0xff);
+ b[2] = (unsigned char) ((v >> 16) & 0xff);
+ b[3] = (unsigned char) ((v >> 24) & 0xff);
+ b[4] = (unsigned char) ((v >> 32) & 0xff);
+ b[5] = (unsigned char) ((v >> 40) & 0xff);
+ b[6] = (unsigned char) ((v >> 48) & 0xff);
+ b[7] = (unsigned char) ((v >> 56) & 0xff);
+#else
+ acc_hbyte_p b = (acc_hbyte_p) p;
+ acc_uint32l_t x;
+ x = (acc_uint32l_t) (v >> 0);
+ b[0] = (unsigned char) ((x >> 0) & 0xff);
+ b[1] = (unsigned char) ((x >> 8) & 0xff);
+ b[2] = (unsigned char) ((x >> 16) & 0xff);
+ b[3] = (unsigned char) ((x >> 24) & 0xff);
+ x = (acc_uint32l_t) (v >> 32);
+ b[4] = (unsigned char) ((x >> 0) & 0xff);
+ b[5] = (unsigned char) ((x >> 8) & 0xff);
+ b[6] = (unsigned char) ((x >> 16) & 0xff);
+ b[7] = (unsigned char) ((x >> 24) & 0xff);
+#endif
+}
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_VGET)
+# undef ACC_WANT_ACCLIB_VGET
+#define __ACCLIB_VGET_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if !defined(ACCLIB_PUBLIC_NOINLINE)
+# if !defined(__acc_noinline)
+# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
+# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
+# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
+# else
+# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
+# endif
+#endif
+#if (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
+extern void* volatile __acc_vget_ptr;
+void* volatile __attribute__((__used__)) __acc_vget_ptr = (void *) 0;
+#else
+extern void* volatile __acc_vget_ptr;
+void* volatile __acc_vget_ptr = (void *) 0;
+#endif
+#ifndef __ACCLIB_VGET_BODY
+#define __ACCLIB_VGET_BODY(T) \
+ if __acc_unlikely(__acc_vget_ptr) { \
+ * (T *) __acc_vget_ptr = v; \
+ * (int *) __acc_vget_ptr = expr; \
+ v = * (T *) __acc_vget_ptr; \
+ } \
+ return v;
+#endif
+ACCLIB_PUBLIC_NOINLINE(short, acc_vget_short) (short v, int expr)
+{
+ __ACCLIB_VGET_BODY(short)
+}
+ACCLIB_PUBLIC_NOINLINE(int, acc_vget_int) (int v, int expr)
+{
+ __ACCLIB_VGET_BODY(int)
+}
+ACCLIB_PUBLIC_NOINLINE(long, acc_vget_long) (long v, int expr)
+{
+ __ACCLIB_VGET_BODY(long)
+}
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t v, int expr)
+{
+ __ACCLIB_VGET_BODY(acc_int64l_t)
+}
+#endif
+ACCLIB_PUBLIC_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t v, int expr)
+{
+ __ACCLIB_VGET_BODY(acc_hsize_t)
+}
+#if !(ACC_CFG_NO_FLOAT)
+ACCLIB_PUBLIC_NOINLINE(float, acc_vget_float) (float v, int expr)
+{
+ __ACCLIB_VGET_BODY(float)
+}
+#endif
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_PUBLIC_NOINLINE(double, acc_vget_double) (double v, int expr)
+{
+ __ACCLIB_VGET_BODY(double)
+}
+#endif
+ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p v, int expr)
+{
+ __ACCLIB_VGET_BODY(acc_hvoid_p)
+}
+#if (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) && !defined(__cplusplus)
+ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p vv, int expr)
+{
+ acc_hvoid_p v = (acc_hvoid_p) vv;
+ __ACCLIB_VGET_BODY(acc_hvoid_p)
+}
+#else
+ACCLIB_PUBLIC_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p v, int expr)
+{
+ __ACCLIB_VGET_BODY(const acc_hvoid_p)
+}
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_HMEMCPY)
+# undef ACC_WANT_ACCLIB_HMEMCPY
+#define __ACCLIB_HMEMCPY_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc_hsize_t len)
+{
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP)
+ const acc_hbyte_p p1 = (const acc_hbyte_p) s1;
+ const acc_hbyte_p p2 = (const acc_hbyte_p) s2;
+ if __acc_likely(len > 0) do
+ {
+ int d = *p1 - *p2;
+ if (d != 0)
+ return d;
+ p1++; p2++;
+ } while __acc_likely(--len > 0);
+ return 0;
+#else
+ return memcmp(s1, s2, len);
+#endif
+}
+ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
+{
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY)
+ acc_hbyte_p p1 = (acc_hbyte_p) dest;
+ const acc_hbyte_p p2 = (const acc_hbyte_p) src;
+ if (!(len > 0) || p1 == p2)
+ return dest;
+ do
+ *p1++ = *p2++;
+ while __acc_likely(--len > 0);
+ return dest;
+#else
+ return memcpy(dest, src, len);
+#endif
+}
+ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
+{
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE)
+ acc_hbyte_p p1 = (acc_hbyte_p) dest;
+ const acc_hbyte_p p2 = (const acc_hbyte_p) src;
+ if (!(len > 0) || p1 == p2)
+ return dest;
+ if (p1 < p2)
+ {
+ do
+ *p1++ = *p2++;
+ while __acc_likely(--len > 0);
+ }
+ else
+ {
+ p1 += len;
+ p2 += len;
+ do
+ *--p1 = *--p2;
+ while __acc_likely(--len > 0);
+ }
+ return dest;
+#else
+ return memmove(dest, src, len);
+#endif
+}
+ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemset) (acc_hvoid_p s, int c, acc_hsize_t len)
+{
+#if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
+ acc_hbyte_p p = (acc_hbyte_p) s;
+ if __acc_likely(len > 0) do
+ *p++ = (unsigned char) c;
+ while __acc_likely(--len > 0);
+ return s;
+#else
+ return memset(s, c, len);
+#endif
+}
+#endif
+#if defined(ACC_WANT_ACCLIB_RAND)
+# undef ACC_WANT_ACCLIB_RAND
+#define __ACCLIB_RAND_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(void, acc_srand31) (acc_rand31_p r, acc_uint32l_t seed)
+{
+ r->seed = seed & ACC_UINT32_C(0xffffffff);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_rand31) (acc_rand31_p r)
+{
+ r->seed = r->seed * ACC_UINT32_C(1103515245) + 12345;
+ r->seed &= ACC_UINT32_C(0x7fffffff);
+ return r->seed;
+}
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC(void, acc_srand48) (acc_rand48_p r, acc_uint32l_t seed)
+{
+ r->seed = seed & ACC_UINT32_C(0xffffffff);
+ r->seed <<= 16; r->seed |= 0x330e;
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48) (acc_rand48_p r)
+{
+ r->seed = r->seed * ACC_UINT64_C(25214903917) + 11;
+ r->seed &= ACC_UINT64_C(0xffffffffffff);
+ return (acc_uint32l_t) (r->seed >> 17);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p r)
+{
+ r->seed = r->seed * ACC_UINT64_C(25214903917) + 11;
+ r->seed &= ACC_UINT64_C(0xffffffffffff);
+ return (acc_uint32l_t) (r->seed >> 16);
+}
+#endif
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC(void, acc_srand64) (acc_rand64_p r, acc_uint64l_t seed)
+{
+ r->seed = seed & ACC_UINT64_C(0xffffffffffffffff);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64) (acc_rand64_p r)
+{
+ r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1;
+#if (ACC_SIZEOF_ACC_INT64L_T > 8)
+ r->seed &= ACC_UINT64_C(0xffffffffffffffff);
+#endif
+ return (acc_uint32l_t) (r->seed >> 33);
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p r)
+{
+ r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1;
+#if (ACC_SIZEOF_ACC_INT64L_T > 8)
+ r->seed &= ACC_UINT64_C(0xffffffffffffffff);
+#endif
+ return (acc_uint32l_t) (r->seed >> 32);
+}
+#endif
+ACCLIB_PUBLIC(void, acc_srandmt) (acc_randmt_p r, acc_uint32l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= ACC_UINT32_C(0xffffffff));
+ seed ^= seed >> 30;
+ seed = seed * ACC_UINT32_C(0x6c078965) + i;
+ } while (i != 624);
+ r->n = i;
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt) (acc_randmt_p r)
+{
+ return (__ACCLIB_FUNCNAME(acc_randmt_r32)(r)) >> 1;
+}
+ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r)
+{
+ acc_uint32l_t v;
+ if __acc_unlikely(r->n == 624) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 623; if ((int) j < 0) j += 624;
+ v = (r->s[i] & ACC_UINT32_C(0x80000000)) ^ (r->s[j] & ACC_UINT32_C(0x7fffffff));
+ j = i - 227; if ((int) j < 0) j += 624;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= ACC_UINT32_C(0x9908b0df);
+ } while (++i != 624);
+ }
+ v = r->s[r->n++];
+ v ^= v >> 11; v ^= (v & ACC_UINT32_C(0x013a58ad)) << 7;
+ v ^= (v & ACC_UINT32_C(0x0001df8c)) << 15; v ^= v >> 18;
+ return v;
+}
+#if defined(acc_int64l_t)
+ACCLIB_PUBLIC(void, acc_srandmt64) (acc_randmt64_p r, acc_uint64l_t seed)
+{
+ unsigned i = 0;
+ do {
+ r->s[i++] = (seed &= ACC_UINT64_C(0xffffffffffffffff));
+ seed ^= seed >> 62;
+ seed = seed * ACC_UINT64_C(0x5851f42d4c957f2d) + i;
+ } while (i != 312);
+ r->n = i;
+}
+#if 0
+ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt64) (acc_randmt64_p r)
+{
+ acc_uint64l_t v;
+ v = (__ACCLIB_FUNCNAME(acc_randmt64_r64)(r)) >> 33;
+ return (acc_uint32l_t) v;
+}
+#endif
+ACCLIB_PUBLIC(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p r)
+{
+ acc_uint64l_t v;
+ if __acc_unlikely(r->n == 312) {
+ unsigned i = 0, j;
+ r->n = 0;
+ do {
+ j = i - 311; if ((int) j < 0) j += 312;
+ v = (r->s[i] & ACC_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & ACC_UINT64_C(0x7fffffff));
+ j = i - 156; if ((int) j < 0) j += 312;
+ r->s[i] = r->s[j] ^ (v >> 1);
+ if (v & 1) r->s[i] ^= ACC_UINT64_C(0xb5026f5aa96619e9);
+ } while (++i != 312);
+ }
+ v = r->s[r->n++];
+ v ^= (v & ACC_UINT64_C(0xaaaaaaaaa0000000)) >> 29;
+ v ^= (v & ACC_UINT64_C(0x38eb3ffff6d3)) << 17;
+ v ^= (v & ACC_UINT64_C(0x7ffbf77)) << 37;
+ return v ^ (v >> 43);
+}
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_RDTSC)
+# undef ACC_WANT_ACCLIB_RDTSC
+#define __ACCLIB_RDTSC_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if defined(acc_int32e_t)
+#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+#if (ACC_ARCH_AMD64 && ACC_CC_PATHSCALE)
+# define __ACCLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "rax", "rdx"
+#elif (ACC_ARCH_AMD64 && ACC_CC_INTELC)
+# define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "rax", "rdx"
+#elif (ACC_ARCH_AMD64)
+# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "rax", "rdx"
+#elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
+# define __ACCLIB_RDTSC_REGS : : "r" (t) : "ax", "dx"
+#elif (ACC_ARCH_I386 && ACC_CC_INTELC)
+# define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "eax", "edx"
+#elif (ACC_ARCH_I386 && ACC_CC_PATHSCALE)
+# define __ACCLIB_RDTSC_REGS : : "c" (t) : "memory", "eax", "edx"
+#else
+# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx"
+#endif
+#endif
+ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
+{
+#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__(
+ "clc \n" ".byte 0x0f,0x31\n"
+ "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
+ __ACCLIB_RDTSC_REGS
+ );
+ return 0;
+#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
+ ACC_UNUSED(t);
+ __asm {
+ mov ecx, t
+ clc
+# if (ACC_CC_MSC && (_MSC_VER < 1200))
+ _emit 0x0f
+ _emit 0x31
+# else
+ rdtsc
+# endif
+ mov [ecx], eax
+ mov [ecx+4], edx
+ }
+ return 0;
+#else
+ t[0] = t[1] = 0; return -1;
+#endif
+}
+#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_DOSALLOC)
+# undef ACC_WANT_ACCLIB_DOSALLOC
+#define __ACCLIB_DOSALLOC_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if (ACC_OS_OS216)
+ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+#if !(ACC_CC_AZTECC)
+ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ union REGS ri, ro;
+ if ((long)size <= 0)
+ return p;
+ size = (size + 15) >> 4;
+ if (size > 0xffffu)
+ return p;
+ ri.x.ax = 0x4800;
+ ri.x.bx = (unsigned short) size;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ p = (void __far*) ACC_PTR_MK_FP(ro.x.ax, 0);
+ return p;
+}
+ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
+{
+ union REGS ri, ro;
+ struct SREGS rs;
+ if (!p)
+ return 0;
+ if (ACC_PTR_FP_OFF(p) != 0)
+ return -1;
+ segread(&rs);
+ ri.x.ax = 0x4900;
+ rs.es = ACC_PTR_FP_SEG(p);
+ int86x(0x21, &ri, &ro, &rs);
+ if (ro.x.cflag & 1)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if (ACC_OS_OS216)
+ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
+{
+ void __far* p = 0;
+ unsigned short sel = 0;
+ if ((long)size <= 0)
+ return p;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (void __far*) ACC_PTR_MK_FP(sel, 0);
+ return p;
+}
+ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
+{
+ if (!p)
+ return 0;
+ if (ACC_PTR_FP_OFF(p) != 0)
+ return -1;
+ if (DosFreeSeg(ACC_PTR_FP_SEG(p)) != 0)
+ return -1;
+ return 0;
+}
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_GETOPT)
+# undef ACC_WANT_ACCLIB_GETOPT
+#define __ACCLIB_GETOPT_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(void, acc_getopt_init) (acc_getopt_p g,
+ int start_argc, int argc, char** argv)
+{
+ memset(g, 0, sizeof(*g));
+ g->optind = start_argc;
+ g->argc = argc; g->argv = argv;
+ g->optopt = -1;
+}
+static int __ACCLIB_FUNCNAME(acc_getopt_rotate) (char** p, int first, int middle, int last)
+{
+ int i = middle, n = middle - first;
+ if (first >= middle || middle >= last) return 0;
+ for (;;)
+ {
+ char* t = p[first]; p[first] = p[i]; p[i] = t;
+ if (++first == middle)
+ {
+ if (++i == last) break;
+ middle = i;
+ }
+ else if (++i == last)
+ i = middle;
+ }
+ return n;
+}
+static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const char* f, ...)
+{
+ if (g->opterr)
+ {
+#if (HAVE_STDARG_H)
+ struct { va_list ap; } s;
+ va_start(s.ap, f);
+ g->opterr(g, f, &s);
+ va_end(s.ap);
+#else
+ g->opterr(g, f, NULL);
+#endif
+ }
+ ++g->errcount;
+ return ret;
+}
+ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
+ const char* shortopts,
+ const acc_getopt_longopt_p longopts,
+ int* longind)
+{
+#define pe __ACCLIB_FUNCNAME(acc_getopt_perror)
+ int ordering = ACC_GETOPT_PERMUTE;
+ int missing_arg_ret = g->bad_option;
+ char* a;
+ if (shortopts)
+ {
+ if (*shortopts == '-' || *shortopts == '+')
+ ordering = *shortopts++ == '-' ? ACC_GETOPT_RETURN_IN_ORDER : ACC_GETOPT_REQUIRE_ORDER;
+ if (*shortopts == ':')
+ missing_arg_ret = *shortopts++;
+ }
+ g->optarg = NULL;
+ if (g->optopt == -1)
+ g->optopt = g->bad_option;
+ if (longind)
+ *longind = -1;
+ if (g->eof)
+ return -1;
+ if (g->shortpos)
+ goto acc_label_next_shortopt;
+ g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ if (ordering == ACC_GETOPT_PERMUTE)
+ {
+ while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
+ ++g->optind;
+ g->pending_rotate_middle = g->optind;
+ }
+ if (g->optind >= g->argc)
+ {
+ g->optind = g->pending_rotate_first;
+ goto acc_label_eof;
+ }
+ a = g->argv[g->optind];
+ if (a[0] == '-' && a[1] == '-')
+ {
+ size_t l = 0;
+ const acc_getopt_longopt_p o;
+ const acc_getopt_longopt_p o1 = NULL;
+ const acc_getopt_longopt_p o2 = NULL;
+ int need_exact = 0;
+ ++g->optind;
+ if (!a[2])
+ goto acc_label_eof;
+ for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
+ ++l;
+ for (o = longopts; l && o && o->name; ++o)
+ {
+ if (strncmp(a, o->name, l) != 0)
+ continue;
+ if (!o->name[l])
+ goto acc_label_found_o;
+ need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG;
+ if (o1) o2 = o;
+ else o1 = o;
+ }
+ if (!o1 || need_exact)
+ return pe(g, g->bad_option, "unrecognized option '--%s'", a);
+ if (o2)
+ return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
+ o = o1;
+ acc_label_found_o:
+ a += l;
+ switch (o->has_arg & 0x2f)
+ {
+ case ACC_GETOPT_OPTIONAL_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ break;
+ case ACC_GETOPT_REQUIRED_ARG:
+ if (a[0])
+ g->optarg = a + 1;
+ else if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
+ break;
+ case ACC_GETOPT_REQUIRED_ARG | 0x20:
+ if (a[0] && a[1])
+ g->optarg = a + 1;
+ if (!g->optarg)
+ return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
+ break;
+ default:
+ if (a[0])
+ return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
+ break;
+ }
+ if (longind)
+ *longind = (int) (o - longopts);
+ if (o->flag)
+ {
+ *o->flag = o->val;
+ return 0;
+ }
+ return o->val;
+ }
+ if (a[0] == '-' && a[1])
+ {
+ unsigned char c;
+ const char* s;
+ acc_label_next_shortopt:
+ a = g->argv[g->optind] + ++g->shortpos;
+ c = (unsigned char) *a++; s = NULL;
+ if (c != ':' && shortopts)
+ s = strchr(shortopts, c);
+ if (!s || s[1] != ':')
+ {
+ if (!a[0])
+ ++g->optind, g->shortpos = 0;
+ if (!s)
+ {
+ g->optopt = c;
+ return pe(g, g->bad_option, "invalid option '-%c'", c);
+ }
+ }
+ else
+ {
+ ++g->optind, g->shortpos = 0;
+ if (a[0])
+ g->optarg = a;
+ else if (s[2] != ':')
+ {
+ if (g->optind < g->argc)
+ g->optarg = g->argv[g->optind++];
+ else
+ {
+ g->optopt = c;
+ return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
+ }
+ }
+ }
+ return c;
+ }
+ if (ordering == ACC_GETOPT_RETURN_IN_ORDER)
+ {
+ ++g->optind;
+ g->optarg = a;
+ return 1;
+ }
+acc_label_eof:
+ g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
+ g->pending_rotate_first = g->pending_rotate_middle = g->optind;
+ g->eof = 1;
+ return -1;
+#undef pe
+}
+#endif
+#if defined(ACC_WANT_ACCLIB_HALLOC)
+# undef ACC_WANT_ACCLIB_HALLOC
+#define __ACCLIB_HALLOC_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if (ACC_HAVE_MM_HUGE_PTR)
+#if 1 && (ACC_OS_DOS16 && defined(BLX286))
+# define __ACCLIB_HALLOC_USE_DAH 1
+#elif 1 && (ACC_OS_DOS16 && defined(DOSX286))
+# define __ACCLIB_HALLOC_USE_DAH 1
+#elif 1 && (ACC_OS_OS216)
+# define __ACCLIB_HALLOC_USE_DAH 1
+#elif 1 && (ACC_OS_WIN16)
+# define __ACCLIB_HALLOC_USE_GA 1
+#elif 1 && (ACC_OS_DOS16) && (ACC_CC_BORLANDC) && defined(__DPMI16__)
+# define __ACCLIB_HALLOC_USE_GA 1
+#endif
+#endif
+#if (__ACCLIB_HALLOC_USE_DAH)
+#if 0 && (ACC_OS_OS216)
+#include <os2.h>
+#else
+ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
+ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
+#endif
+#endif
+#if (__ACCLIB_HALLOC_USE_GA)
+#if 0
+#define STRICT 1
+#include <windows.h>
+#else
+ACC_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long);
+ACC_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*);
+ACC_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned);
+ACC_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*);
+ACC_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
+#endif
+#endif
+ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
+{
+ acc_hvoid_p p = 0;
+ if (!(size > 0))
+ return p;
+#if 0 && defined(__palmos__)
+ p = MemPtrNew(size);
+#elif !(ACC_HAVE_MM_HUGE_PTR)
+ if (size < (size_t) -1)
+ p = malloc((size_t) size);
+#else
+ if ((long)size <= 0)
+ return p;
+{
+#if (__ACCLIB_HALLOC_USE_DAH)
+ unsigned short sel = 0;
+ if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
+ p = (acc_hvoid_p) ACC_PTR_MK_FP(sel, 0);
+#elif (__ACCLIB_HALLOC_USE_GA)
+ const void __near* h = GlobalAlloc(2, size);
+ if (h) {
+ p = GlobalLock(h);
+ if (p && ACC_PTR_FP_OFF(p) != 0) {
+ GlobalUnlock(h);
+ p = 0;
+ }
+ if (!p)
+ GlobalFree(h);
+ }
+#elif (ACC_CC_MSC && (_MSC_VER >= 700))
+ p = _halloc(size, 1);
+#elif (ACC_CC_MSC || ACC_CC_WATCOMC)
+ p = halloc(size, 1);
+#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+ p = farmalloc(size);
+#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+ p = farmalloc(size);
+#elif (ACC_CC_AZTECC)
+ p = lmalloc(size);
+#else
+ if (size < (size_t) -1)
+ p = malloc((size_t) size);
+#endif
+}
+#endif
+ return p;
+}
+ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p)
+{
+ if (!p)
+ return;
+#if 0 && defined(__palmos__)
+ MemPtrFree(p);
+#elif !(ACC_HAVE_MM_HUGE_PTR)
+ free(p);
+#else
+#if (__ACCLIB_HALLOC_USE_DAH)
+ if (ACC_PTR_FP_OFF(p) == 0)
+ DosFreeSeg((unsigned short) ACC_PTR_FP_SEG(p));
+#elif (__ACCLIB_HALLOC_USE_GA)
+ if (ACC_PTR_FP_OFF(p) == 0) {
+ const void __near* h = (const void __near*) (unsigned) GlobalHandle(ACC_PTR_FP_SEG(p));
+ if (h) {
+ GlobalUnlock(h);
+ GlobalFree(h);
+ }
+ }
+#elif (ACC_CC_MSC && (_MSC_VER >= 700))
+ _hfree(p);
+#elif (ACC_CC_MSC || ACC_CC_WATCOMC)
+ hfree(p);
+#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
+ farfree((void __far*) p);
+#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
+ farfree((void __far*) p);
+#elif (ACC_CC_AZTECC)
+ lfree(p);
+#else
+ free(p);
+#endif
+#endif
+}
+#endif
+#if defined(ACC_WANT_ACCLIB_HFREAD)
+# undef ACC_WANT_ACCLIB_HFREAD
+#define __ACCLIB_HFREAD_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(acc_hsize_t, acc_hfread) (void* vfp, acc_hvoid_p buf, acc_hsize_t size)
+{
+ FILE* fp = (FILE *) vfp;
+#if (ACC_HAVE_MM_HUGE_PTR)
+#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
+#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ acc_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ n = fread(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ __ACCLIB_FUNCNAME(acc_hmemcpy)((acc_hbyte_p)buf + l, tmp, (acc_hsize_t)n);
+ l += n;
+ }
+ return l;
+#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
+ acc_hbyte_p b = (acc_hbyte_p) buf;
+ acc_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((acc_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fread((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fread(buf, 1, size, fp);
+#endif
+}
+ACCLIB_PUBLIC(acc_hsize_t, acc_hfwrite) (void* vfp, const acc_hvoid_p buf, acc_hsize_t size)
+{
+ FILE* fp = (FILE *) vfp;
+#if (ACC_HAVE_MM_HUGE_PTR)
+#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
+#define __ACCLIB_REQUIRE_HMEMCPY_CH 1
+ unsigned char tmp[512];
+ acc_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
+ __ACCLIB_FUNCNAME(acc_hmemcpy)(tmp, (const acc_hbyte_p)buf + l, (acc_hsize_t)n);
+ n = fwrite(tmp, 1, n, fp);
+ if (n == 0)
+ break;
+ l += n;
+ }
+ return l;
+#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
+ const acc_hbyte_p b = (const acc_hbyte_p) buf;
+ acc_hsize_t l = 0;
+ while (l < size)
+ {
+ size_t n;
+ n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
+ if ((acc_hsize_t) n > size - l)
+ n = (size_t) (size - l);
+ n = fwrite((void __far*)b, 1, n, fp);
+ if (n == 0)
+ break;
+ b += n; l += n;
+ }
+ return l;
+#else
+# error "unknown memory model"
+#endif
+#else
+ return fwrite(buf, 1, size, fp);
+#endif
+}
+#endif
+#if defined(ACC_WANT_ACCLIB_HSREAD)
+# undef ACC_WANT_ACCLIB_HSREAD
+#define __ACCLIB_HSREAD_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+ACCLIB_PUBLIC(long, acc_safe_hread) (int fd, acc_hvoid_p buf, long size)
+{
+ acc_hbyte_p b = (acc_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (ACC_HAVE_MM_HUGE_PTR)
+# define __ACCLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = acc_hread(fd, b, n);
+#elif (ACC_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _read(fd, b, n);
+#else
+ errno = 0; n = read(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size)
+{
+ const acc_hbyte_p b = (const acc_hbyte_p) buf;
+ long l = 0;
+ int saved_errno;
+ saved_errno = errno;
+ while (l < size)
+ {
+ long n = size - l;
+#if (ACC_HAVE_MM_HUGE_PTR)
+# define __ACCLIB_REQUIRE_HREAD_CH 1
+ errno = 0; n = acc_hwrite(fd, b, n);
+#elif (ACC_OS_DOS32) && defined(__DJGPP__)
+ errno = 0; n = _write(fd, b, n);
+#else
+ errno = 0; n = write(fd, b, n);
+#endif
+ if (n == 0)
+ break;
+ if (n < 0) {
+#if defined(EAGAIN)
+ if (errno == (EAGAIN)) continue;
+#endif
+#if defined(EINTR)
+ if (errno == (EINTR)) continue;
+#endif
+ if (errno == 0) errno = 1;
+ return l;
+ }
+ b += n; l += n;
+ }
+ errno = saved_errno;
+ return l;
+}
+#endif
+#if defined(ACC_WANT_ACCLIB_PCLOCK)
+# undef ACC_WANT_ACCLIB_PCLOCK
+#define __ACCLIB_PCLOCK_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_AMD64 && ACC_ASM_SYNTAX_GNUC)
+#ifndef acc_pclock_syscall_clock_gettime
+#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
+#endif
+static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ long r;
+ __asm__ __volatile__("syscall\n" : "=a" (r) : "0" (228), "D" (clockid), "S" (ts) : __ACC_ASM_CLOBBER);
+ return r;
+}
+#endif
+#if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_I386 && ACC_ASM_SYNTAX_GNUC)
+#ifndef acc_pclock_syscall_clock_gettime
+#define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
+#endif
+static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
+{
+ long r;
+ __asm__ __volatile__("int $0x80\n" : "=a" (r) : "0" (265), "b" (clockid), "c" (ts) : __ACC_ASM_CLOBBER);
+ return r;
+}
+#endif
+#if 0 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_r_syscall
+#define acc_pclock_read_clock_gettime_r_syscall acc_pclock_read_clock_gettime_r_syscall
+#endif
+static int acc_pclock_read_clock_gettime_r_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(0, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETTIMEOFDAY)
+#ifndef acc_pclock_read_gettimeofday
+#define acc_pclock_read_gettimeofday acc_pclock_read_gettimeofday
+#endif
+static int acc_pclock_read_gettimeofday(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timeval tv;
+ if (gettimeofday(&tv, 0) != 0)
+ return -1;
+#if defined(acc_int64l_t)
+ c->tv_sec = tv.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = tv.tv_sec;
+#endif
+ c->tv_nsec = (acc_uint32l_t) (tv.tv_usec * 1000u);
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if defined(CLOCKS_PER_SEC)
+#ifndef acc_pclock_read_clock
+#define acc_pclock_read_clock acc_pclock_read_clock
+#endif
+static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ clock_t ticks;
+ double secs;
+#if defined(acc_int64l_t)
+ acc_uint64l_t nsecs;
+ ticks = clock();
+ secs = (double)ticks / (CLOCKS_PER_SEC);
+ nsecs = (acc_uint64l_t) (secs * 1000000000.0);
+ c->tv_sec = (acc_int64l_t) (nsecs / 1000000000ul);
+ c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
+#else
+ ticks = clock();
+ secs = (double)ticks / (CLOCKS_PER_SEC);
+ c->tv_sec_high = 0;
+ c->tv_sec_low = (acc_uint32l_t) (secs + 0.5);
+ c->tv_nsec = 0;
+#endif
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_m_syscall
+#define acc_pclock_read_clock_gettime_m_syscall acc_pclock_read_clock_gettime_m_syscall
+#endif
+static int acc_pclock_read_clock_gettime_m_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(1, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC)
+#ifndef acc_pclock_read_uclock
+#define acc_pclock_read_uclock acc_pclock_read_uclock
+#endif
+static int acc_pclock_read_uclock(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ acc_uint64l_t ticks;
+ double secs;
+ acc_uint64l_t nsecs;
+ ticks = uclock();
+ secs = (double)ticks / (UCLOCKS_PER_SEC);
+ nsecs = (acc_uint64l_t) (secs * 1000000000.0);
+ c->tv_sec = nsecs / 1000000000ul;
+ c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_clock_gettime_p_libc
+#define acc_pclock_read_clock_gettime_p_libc acc_pclock_read_clock_gettime_p_libc
+#endif
+static int acc_pclock_read_clock_gettime_p_libc(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_p_syscall
+#define acc_pclock_read_clock_gettime_p_syscall acc_pclock_read_clock_gettime_p_syscall
+#endif
+static int acc_pclock_read_clock_gettime_p_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(2, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_getprocesstimes
+#define acc_pclock_read_getprocesstimes acc_pclock_read_getprocesstimes
+#endif
+static int acc_pclock_read_getprocesstimes(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ acc_uint64l_t ticks;
+ if (GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime;
+ if __acc_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
+ c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100u;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
+#ifndef acc_pclock_read_getrusage
+#define acc_pclock_read_getrusage acc_pclock_read_getrusage
+#endif
+static int acc_pclock_read_getrusage(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) != 0)
+ return -1;
+#if defined(acc_int64l_t)
+ c->tv_sec = ru.ru_utime.tv_sec;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = ru.ru_utime.tv_sec;
+#endif
+ c->tv_nsec = (acc_uint32l_t) (ru.ru_utime.tv_usec * 1000u);
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (__ACCLIB_PCLOCK_USE_PERFCTR)
+#ifndef acc_pclock_read_perfctr
+#define acc_pclock_read_perfctr acc_pclock_read_perfctr
+#endif
+static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ acc_perfctr_clock_t pcc;
+ double secs;
+ acc_uint64l_t nsecs;
+ __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &pcc);
+ if __acc_unlikely(h->ticks_base == 0)
+ h->ticks_base = pcc.tsc;
+ else
+ pcc.tsc -= h->ticks_base;
+ secs = pcc.tsc * h->pch.tsc_to_seconds;
+ nsecs = (acc_uint64l_t) (secs * 1000000000.0);
+ c->tv_sec = nsecs / 1000000000ul;
+ c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_clock_gettime_t_libc
+#define acc_pclock_read_clock_gettime_t_libc acc_pclock_read_clock_gettime_t_libc
+#endif
+static int acc_pclock_read_clock_gettime_t_libc(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if 1 && defined(acc_pclock_syscall_clock_gettime)
+#ifndef acc_pclock_read_clock_gettime_t_syscall
+#define acc_pclock_read_clock_gettime_t_syscall acc_pclock_read_clock_gettime_t_syscall
+#endif
+static int acc_pclock_read_clock_gettime_t_syscall(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ struct timespec ts;
+ if (acc_pclock_syscall_clock_gettime(3, &ts) != 0)
+ return -1;
+ c->tv_sec = ts.tv_sec;
+ c->tv_nsec = ts.tv_nsec;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
+#ifndef acc_pclock_read_getthreadtimes
+#define acc_pclock_read_getthreadtimes acc_pclock_read_getthreadtimes
+#endif
+static int acc_pclock_read_getthreadtimes(acc_pclock_handle_p h, acc_pclock_p c)
+{
+ FILETIME ct, et, kt, ut;
+ acc_uint64l_t ticks;
+ if (GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut) == 0)
+ return -1;
+ ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime;
+ if __acc_unlikely(h->ticks_base == 0)
+ h->ticks_base = ticks;
+ else
+ ticks -= h->ticks_base;
+ c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
+ c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100;
+ ACC_UNUSED(h); return 0;
+}
+#endif
+ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
+{
+ acc_pclock_t c;
+ int i;
+ h->h = (acclib_handle_t) 0;
+ h->mode = -1;
+ h->read_error = 2;
+ h->name = NULL;
+ h->gettime = 0;
+#if defined(acc_int64l_t)
+ h->ticks_base = 0;
+#endif
+ switch (mode)
+ {
+ case ACC_PCLOCK_REALTIME:
+# if defined(acc_pclock_read_clock_gettime_r_syscall)
+ if (acc_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_r_syscall;
+ h->name = "CLOCK_REALTIME/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_gettimeofday)
+ if (acc_pclock_read_gettimeofday(h, &c) == 0) {
+ h->gettime = acc_pclock_read_gettimeofday;
+ h->name = "gettimeofday";
+ break;
+ }
+# endif
+ break;
+ case ACC_PCLOCK_MONOTONIC:
+# if defined(acc_pclock_read_clock_gettime_m_syscall)
+ if (acc_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_m_syscall;
+ h->name = "CLOCK_MONOTONIC/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_uclock)
+ if (acc_pclock_read_uclock(h, &c) == 0) {
+ h->gettime = acc_pclock_read_uclock;
+ h->name = "uclock";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock)
+ if (acc_pclock_read_clock(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock;
+ h->name = "clock";
+ break;
+ }
+# endif
+ break;
+ case ACC_PCLOCK_PROCESS_CPUTIME_ID:
+# if defined(acc_pclock_read_perfctr)
+ if (__ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0) {
+ h->gettime = acc_pclock_read_perfctr;
+ h->name = "perfctr";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_getprocesstimes)
+ if (acc_pclock_read_getprocesstimes(h, &c) == 0) {
+ h->gettime = acc_pclock_read_getprocesstimes;
+ h->name = "GetProcessTimes";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_p_syscall)
+ if (acc_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_p_syscall;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_p_libc)
+ if (acc_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_p_libc;
+ h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_getrusage)
+ if (acc_pclock_read_getrusage(h, &c) == 0) {
+ h->gettime = acc_pclock_read_getrusage;
+ h->name = "getrusage";
+ break;
+ }
+# endif
+ break;
+ case ACC_PCLOCK_THREAD_CPUTIME_ID:
+# if defined(acc_pclock_read_getthreadtimes)
+ if (acc_pclock_read_getthreadtimes(h, &c) == 0) {
+ h->gettime = acc_pclock_read_getthreadtimes;
+ h->name = "GetThreadTimes";
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_t_syscall)
+ if (acc_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_t_syscall;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
+ break;
+ }
+# endif
+# if defined(acc_pclock_read_clock_gettime_t_libc)
+ if (acc_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
+ h->gettime = acc_pclock_read_clock_gettime_t_libc;
+ h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
+ break;
+ }
+# endif
+ break;
+ }
+ if (!h->gettime)
+ return -1;
+ if (!h->h)
+ h->h = (acclib_handle_t) 1;
+ h->mode = mode;
+ h->read_error = 0;
+ if (!h->name)
+ h->name = "unknown";
+ for (i = 0; i < 10; i++) {
+ __ACCLIB_FUNCNAME(acc_pclock_read)(h, &c);
+ }
+ return 0;
+}
+ACCLIB_PUBLIC(int, acc_pclock_open_default) (acc_pclock_handle_p h)
+{
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0)
+ return 0;
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_MONOTONIC) == 0)
+ return 0;
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_REALTIME) == 0)
+ return 0;
+ if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_THREAD_CPUTIME_ID) == 0)
+ return 0;
+ return -1;
+}
+ACCLIB_PUBLIC(int, acc_pclock_close) (acc_pclock_handle_p h)
+{
+ h->h = (acclib_handle_t) 0;
+ h->mode = -1;
+ h->name = NULL;
+ h->gettime = 0;
+#if (__ACCLIB_PCLOCK_USE_PERFCTR)
+ __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
+#endif
+ return 0;
+}
+ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c)
+{
+ if (h->gettime) {
+ if (h->gettime(h, c) == 0)
+ return;
+ }
+ h->read_error = 1;
+#if defined(acc_int64l_t)
+ c->tv_sec = 0;
+#else
+ c->tv_sec_high = 0;
+ c->tv_sec_low = 0;
+#endif
+ c->tv_nsec = 0;
+}
+#if !(ACC_CFG_NO_DOUBLE)
+ACCLIB_PUBLIC(double, acc_pclock_get_elapsed) (acc_pclock_handle_p h, const acc_pclock_p start, const acc_pclock_p stop)
+{
+ double tstop, tstart;
+ if (!h->h) {
+ h->mode = -1;
+ return 0.0;
+ }
+#if defined(acc_int64l_t)
+ tstop = stop->tv_sec + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec + start->tv_nsec / 1000000000.0;
+#else
+ tstop = stop->tv_sec_low + stop->tv_nsec / 1000000000.0;
+ tstart = start->tv_sec_low + start->tv_nsec / 1000000000.0;
+#endif
+ return tstop - tstart;
+}
+#endif
+ACCLIB_PUBLIC(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p h, unsigned flags)
+{
+ if (h->h) {
+#if (__ACCLIB_PCLOCK_USE_PERFCTR)
+ return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
+#endif
+ }
+ ACC_UNUSED(h); ACC_UNUSED(flags);
+ return -1;
+}
+#if defined(__ACCLIB_PCLOCK_NEED_WARN_POP)
+# if (ACC_CC_MSC && (_MSC_VER >= 1200))
+# pragma warning(pop)
+# else
+# error "__ACCLIB_PCLOCK_NEED_WARN_POP"
+# endif
+# undef __ACCLIB_PCLOCK_NEED_WARN_POP
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_UCLOCK)
+# undef ACC_WANT_ACCLIB_UCLOCK
+#define __ACCLIB_UCLOCK_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+#elif (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
+# if ((ACC_CC_DMC && (__DMC__ < 0x838)) || ACC_CC_LCCWIN32)
+# define __ACCLIB_UCLOCK_USE_CLOCK 1
+# else
+# define __ACCLIB_UCLOCK_USE_WINMM 1
+# if (ACC_CC_MSC && (_MSC_VER >= 1200))
+# pragma warning(push)
+# define __ACCLIB_UCLOCK_NEED_WARN_POP 1
+# endif
+# if (ACC_CC_MSC && (_MSC_VER >= 900))
+# pragma warning(disable: 4201)
+# elif (ACC_CC_MWERKS)
+# define LPUINT __ACC_MMSYSTEM_H_LPUINT
+# endif
+# if 1
+# include <mmsystem.h>
+# else
+# if (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
+ ACC_EXTERN_C __declspec(dllimport) unsigned long __stdcall timeGetTime(void);
+# else
+ ACC_EXTERN_C unsigned long __stdcall timeGetTime(void);
+# endif
+# endif
+# if (ACC_CC_DMC)
+# pragma DMC includelib "winmm.lib"
+# elif (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
+# pragma comment(lib, "winmm.lib")
+# elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3000))
+# pragma comment(lib, "winmm.lib")
+# elif (ACC_CC_SYMANTECC)
+# pragma SC includelib "winmm.lib"
+# elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1050))
+# pragma library("winmm.lib")
+# endif
+# endif
+#elif (ACC_OS_CYGWIN || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN32 || ACC_OS_WIN64)
+# define __ACCLIB_UCLOCK_USE_CLOCK 1
+#elif (ACC_OS_CONSOLE) && defined(CLOCKS_PER_SEC)
+# define __ACCLIB_UCLOCK_USE_CLOCK 1
+#elif (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99) && defined(CLOCKS_PER_SEC)
+# define __ACCLIB_UCLOCK_USE_CLOCK 1
+#endif
+#if (__ACCLIB_UCLOCK_USE_CLOCK) && !defined(CLOCKS_PER_SEC)
+# if defined(CLK_TCK)
+# define CLOCKS_PER_SEC CLK_TCK
+# else
+# undef __ACCLIB_UCLOCK_USE_CLOCK
+# endif
+#endif
+#if (__ACCLIB_UCLOCK_USE_GETRUSAGE)
+# if !defined(RUSAGE_SELF)
+# undef __ACCLIB_UCLOCK_USE_GETRUSAGE
+# endif
+#endif
+ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
+{
+ int i;
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ LARGE_INTEGER li;
+#endif
+ h->h = (acclib_handle_t) 1;
+ h->mode = 0;
+ h->read_error = 0;
+ h->name = NULL;
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ h->pch.h = 0;
+ if (h->mode == 0 && __ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0)
+ h->mode = 2;
+#endif
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ h->qpf = 0.0;
+ if (h->mode == 0 && QueryPerformanceFrequency(&li) != 0) {
+ double d = (double) li.QuadPart;
+ if (d > 0.0 && QueryPerformanceCounter(&li) != 0) {
+ h->mode = 3;
+ h->qpf = d;
+ }
+ }
+#endif
+ for (i = 0; i < 10; i++) {
+ acc_uclock_t c;
+ __ACCLIB_FUNCNAME(acc_uclock_read)(h, &c);
+ }
+ return 0;
+}
+ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h)
+{
+ h->h = (acclib_handle_t) 0;
+ h->mode = -1;
+ h->name = NULL;
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
+#endif
+ return 0;
+}
+ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
+{
+#if (__ACCLIB_UCLOCK_USE_RDTSC)
+ __ACCLIB_FUNCNAME(acc_tsc_read)((acc_uint32e_t*) (void*) &c->tsc);
+#endif
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ if (h->pch.h) {
+ __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &c->pcc);
+ if (h->mode > 0 && h->mode <= 2)
+ return;
+ }
+#endif
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ if (h->qpf > 0.0) {
+ LARGE_INTEGER li;
+ if (QueryPerformanceCounter(&li) != 0) {
+ c->qpc = (acc_int64l_t) li.QuadPart;
+ if (h->mode > 0 && h->mode <= 3)
+ return;
+ } else {
+ h->mode = 0; h->qpf = 0.0; c->qpc = 0;
+ h->read_error = 1;
+ }
+ }
+#endif
+ {
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+# if (ACC_CC_AZTECC)
+ c->ticks.t32 = 0;
+# else
+ union REGS ri, ro;
+ ri.x.ax = 0x2c00; int86(0x21, &ri, &ro);
+ c->ticks.t32 = ro.h.ch*60UL*60UL*100UL + ro.h.cl*60UL*100UL + ro.h.dh*100UL + ro.h.dl;
+# endif
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+ c->ticks.t64 = uclock();
+#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
+ c->ticks.t64 = clock();
+#elif (__ACCLIB_UCLOCK_USE_CLOCK)
+ c->ticks.t32 = clock();
+#elif (__ACCLIB_UCLOCK_USE_WINMM)
+ c->ticks.t32 = timeGetTime();
+#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) != 0) c->ticks.td = 0;
+ else c->ticks.td = ru.ru_utime.tv_sec + ru.ru_utime.tv_usec / 1000000.0;
+#elif (HAVE_GETTIMEOFDAY)
+ struct timeval tv;
+ if (gettimeofday(&tv, 0) != 0) c->ticks.td = 0;
+ else c->ticks.td = tv.tv_sec + tv.tv_usec / 1000000.0;
+#else
+ ACC_UNUSED(c);
+#endif
+ }
+ ACC_UNUSED(h);
+}
+ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_uclock_p start, const acc_uclock_p stop)
+{
+ double d;
+ if (!h->h) {
+ h->mode = -1;
+ return 0.0;
+ }
+#if (__ACCLIB_UCLOCK_USE_RDTSC)
+ if (h->mode == 1) {
+ if (!h->name) h->name = "rdtsc";
+ d = (double) ((acc_int64l_t)stop->tsc - (acc_int64l_t)start->tsc);
+ return d / 1000000000.0;
+ }
+#endif
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ if (h->pch.h && h->mode == 2) {
+ if (!h->name) h->name = "perfctr";
+ return __ACCLIB_FUNCNAME(acc_perfctr_get_elapsed)(&h->pch, &start->pcc, &stop->pcc);
+ }
+#endif
+#if (__ACCLIB_UCLOCK_USE_QPC)
+ if (h->qpf > 0.0 && h->mode == 3) {
+ if (!h->name) h->name = "qpc";
+ if (start->qpc == 0 || stop->qpc == 0) return 0.0;
+ return (double) (stop->qpc - start->qpc) / h->qpf;
+ }
+#endif
+#if (ACC_OS_DOS16 || ACC_OS_WIN16)
+ h->mode = 11;
+ if (!h->name) h->name = "uclock";
+ d = (double) (stop->ticks.t32 - start->ticks.t32) / 100.0;
+ if (d < 0.0) d += 86400.0;
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+ h->mode = 12;
+ if (!h->name) h->name = "uclock";
+ d = (double) (stop->ticks.t64 - start->ticks.t64) / (UCLOCKS_PER_SEC);
+#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
+ h->mode = 13;
+ if (!h->name) h->name = "clock";
+ {
+ acc_int64l_t t;
+ t = stop->ticks.t64 - start->ticks.t64;
+ if (t < 0)
+ t += sizeof(clock_t) == 4 ? ACC_INT64_C(0x100000000) : ACC_INT64_C(0);
+ d = (double) t / (CLOCKS_PER_SEC);
+ }
+#elif (__ACCLIB_UCLOCK_USE_CLOCK)
+ h->mode = 14;
+ if (!h->name) h->name = "clock";
+ d = (double) (stop->ticks.t32 - start->ticks.t32) / (CLOCKS_PER_SEC);
+#elif (__ACCLIB_UCLOCK_USE_WINMM)
+ h->mode = 15;
+ if (!h->name) h->name = "timeGetTime";
+ d = (double) (stop->ticks.t32 - start->ticks.t32) / 1000.0;
+#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
+ h->mode = 16;
+ if (!h->name) h->name = "getrusage";
+ d = stop->ticks.td - start->ticks.td;
+#elif (HAVE_GETTIMEOFDAY)
+ h->mode = 17;
+ if (!h->name) h->name = "gettimeofday";
+ d = stop->ticks.td - start->ticks.td;
+#else
+ h->mode = 0;
+ d = 0.0;
+#endif
+ return d;
+}
+ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned flags)
+{
+ if (h->h) {
+#if (__ACCLIB_UCLOCK_USE_PERFCTR)
+ return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
+#endif
+ }
+ ACC_UNUSED(h); ACC_UNUSED(flags);
+ return -1;
+}
+#if defined(__ACCLIB_UCLOCK_NEED_WARN_POP)
+# if (ACC_CC_MSC && (_MSC_VER >= 1200))
+# pragma warning(pop)
+# else
+# error "__ACCLIB_UCLOCK_NEED_WARN_POP"
+# endif
+# undef __ACCLIB_UCLOCK_NEED_WARN_POP
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_MISC)
+# undef ACC_WANT_ACCLIB_MISC
+#define __ACCLIB_MISC_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if !defined(ACCLIB_PUBLIC_NOINLINE)
+# if !defined(__acc_noinline)
+# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
+# elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
+# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
+# else
+# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
+# endif
+#endif
+#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(push)
+# pragma warn(disable:2007)
+#endif
+ACCLIB_PUBLIC(const char *, acc_getenv) (const char *s)
+{
+#if (HAVE_GETENV)
+ return getenv(s);
+#else
+ ACC_UNUSED(s); return (const char *) 0;
+#endif
+}
+ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd)
+{
+ if (fd < 0)
+ return -1;
+#if (ACC_OS_CYGWIN)
+ return get_osfhandle(fd);
+#elif (ACC_OS_EMX && defined(__RSXNT__))
+ return -1;
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+ return -1;
+#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
+# if (ACC_CC_PELLESC && (__POCC__ < 280))
+ return -1;
+# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
+ return -1;
+# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
+ return _os_handle(fd);
+# else
+ return _get_osfhandle(fd);
+# endif
+#else
+ return fd;
+#endif
+}
+ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
+{
+#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
+ FILE* fp; int old_binary;
+ if (fd == STDIN_FILENO) fp = stdin;
+ else if (fd == STDOUT_FILENO) fp = stdout;
+ else if (fd == STDERR_FILENO) fp = stderr;
+ else return -1;
+ old_binary = fp->__mode.__binary;
+ __set_binmode(fp, binary ? 1 : 0);
+ return old_binary ? 1 : 0;
+#elif (ACC_ARCH_M68K && ACC_OS_TOS)
+ ACC_UNUSED(fd); ACC_UNUSED(binary);
+ return -1;
+#elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC))
+ ACC_UNUSED(fd); ACC_UNUSED(binary);
+ return -1;
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+ int r; unsigned old_flags = __djgpp_hwint_flags;
+ ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
+ ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u))
+ __djgpp_set_ctrl_c(!(old_flags & 1));
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+ if (fd < 0) return -1;
+ ACC_UNUSED(binary);
+ return 1;
+#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
+ FILE* fp; int r;
+ if (fd == fileno(stdin)) fp = stdin;
+ else if (fd == fileno(stdout)) fp = stdout;
+ else if (fd == fileno(stderr)) fp = stderr;
+ else return -1;
+ r = _setmode(fp, binary ? _BINARY : _TEXT);
+ if (r == -1) return -1;
+ return (r & _BINARY) ? 1 : 0;
+#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
+ ACC_UNUSED(fd); ACC_UNUSED(binary);
+ return -1;
+#elif (ACC_OS_CYGWIN && (ACC_CC_GNUC < 0x025a00ul))
+ ACC_UNUSED(fd); ACC_UNUSED(binary);
+ return -1;
+#elif (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+ int r;
+#if !(ACC_CC_ZORTECHC)
+ ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
+#endif
+ ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
+ if (fd < 0) return -1;
+ r = setmode(fd, binary ? O_BINARY : O_TEXT);
+ if (r == -1) return -1;
+ return (r & O_TEXT) ? 0 : 1;
+#else
+ if (fd < 0) return -1;
+ ACC_UNUSED(binary);
+ return 1;
+#endif
+}
+ACCLIB_PUBLIC(int, acc_isatty) (int fd)
+{
+ if (fd < 0)
+ return 0;
+#if (ACC_OS_DOS16 && !(ACC_CC_AZTECC))
+ {
+ union REGS ri, ro;
+ ri.x.ax = 0x4400; ri.x.bx = fd;
+ int86(0x21, &ri, &ro);
+ if ((ro.x.cflag & 1) == 0)
+ if ((ro.x.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (ACC_OS_DOS32 && ACC_CC_WATCOMC)
+ {
+ union REGS ri, ro;
+ ri.w.ax = 0x4400; ri.w.bx = (unsigned short) fd;
+ int386(0x21, &ri, &ro);
+ if ((ro.w.cflag & 1) == 0)
+ if ((ro.w.ax & 0x83) != 0x83)
+ return 0;
+ }
+#elif (ACC_HAVE_WINDOWS_H)
+ {
+ acclib_handle_t h = __ACCLIB_FUNCNAME(acc_get_osfhandle)(fd);
+ if ((HANDLE)h != INVALID_HANDLE_VALUE)
+ {
+ DWORD d = 0;
+ if (GetConsoleMode((HANDLE)h, &d) == 0)
+ return 0;
+ }
+ }
+#endif
+#if (HAVE_ISATTY)
+ return (isatty(fd)) ? 1 : 0;
+#else
+ return 0;
+#endif
+}
+ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
+{
+#if !(HAVE_MKDIR)
+ ACC_UNUSED(name); ACC_UNUSED(mode);
+ return -1;
+#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
+ ACC_UNUSED(mode);
+ return Dcreate(name);
+#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
+ return mkdir(name, mode);
+#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
+ return mkdir(name, mode);
+#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
+ ACC_UNUSED(mode);
+# if (ACC_CC_HIGHC || ACC_CC_PACIFICC)
+ return mkdir((char*) name);
+# else
+ return mkdir(name);
+# endif
+#elif (ACC_CC_WATCOMC)
+ return mkdir(name, (mode_t) mode);
+#else
+ return mkdir(name, mode);
+#endif
+}
+ACCLIB_PUBLIC(int, acc_rmdir) (const char* name)
+{
+#if !(HAVE_RMDIR)
+ ACC_UNUSED(name);
+ return -1;
+#elif ((ACC_OS_DOS16 || ACC_OS_DOS32) && (ACC_CC_HIGHC || ACC_CC_PACIFICC))
+ return rmdir((char *) name);
+#else
+ return rmdir(name);
+#endif
+}
+#if defined(acc_int32e_t)
+ACCLIB_PUBLIC(acc_int32e_t, acc_muldiv32s) (acc_int32e_t a, acc_int32e_t b, acc_int32e_t x)
+{
+ acc_int32e_t r = 0;
+ if __acc_likely(x != 0)
+ {
+#if defined(acc_int64l_t)
+ r = (acc_int32e_t) (((acc_int64l_t) a * b) / x);
+#else
+ ACC_UNUSED(a); ACC_UNUSED(b);
+#endif
+ }
+ return r;
+}
+ACCLIB_PUBLIC(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t a, acc_uint32e_t b, acc_uint32e_t x)
+{
+ acc_uint32e_t r = 0;
+ if __acc_likely(x != 0)
+ {
+#if defined(acc_int64l_t)
+ r = (acc_uint32e_t) (((acc_uint64l_t) a * b) / x);
+#else
+ ACC_UNUSED(a); ACC_UNUSED(b);
+#endif
+ }
+ return r;
+}
+#endif
+#if 0
+ACCLIB_PUBLIC_NOINLINE(int, acc_syscall_clock_gettime) (int c)
+{
+}
+#endif
+#if (ACC_OS_WIN16)
+ACC_EXTERN_C void __far __pascal DebugBreak(void);
+#endif
+ACCLIB_PUBLIC_NOINLINE(void, acc_debug_break) (void)
+{
+#if (ACC_OS_WIN16)
+ DebugBreak();
+#elif (ACC_ARCH_I086)
+#elif (ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
+ DebugBreak();
+#elif (ACC_CFG_NO_INLINE_ASM) && (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
+ DebugBreak();
+#elif (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+ __asm__ __volatile__("int $3\n" : : : __ACC_ASM_CLOBBER);
+#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
+ __asm { int 3 }
+#elif (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
+ DebugBreak();
+#else
+ * (volatile unsigned long *) (volatile void *) (size_t) 0x1 = ~0ul;
+#endif
+}
+ACCLIB_PUBLIC_NOINLINE(void, acc_debug_nop) (void)
+{
+}
+ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_query) (void)
+{
+#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+ size_t r;
+ __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : : __ACC_ASM_CLOBBER);
+ return (int)(r >> 18) & 1;
+#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
+ unsigned long r;
+ __asm {
+ pushf
+ pop eax
+ mov r,eax
+ }
+ return (int)(r >> 18) & 1;
+#else
+ return -1;
+#endif
+}
+ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_enable) (int v)
+{
+ int r;
+#if (ACC_ARCH_AMD64) && (ACC_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER);
+ }
+ r = 0;
+#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+ if (v) {
+ __asm__ __volatile__("pushf\n orl $262144,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER);
+ } else {
+ __asm__ __volatile__("pushf\n andl $-262145,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER);
+ }
+ r = 0;
+#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
+ if (v) { __asm {
+ pushf
+ or dword ptr [esp],262144
+ popf
+ }} else { __asm {
+ pushf
+ and dword ptr [esp],-262145
+ popf
+ }}
+ r = 0;
+#else
+ r = -1;
+#endif
+ ACC_UNUSED(v); return r;
+}
+ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_qemu) (void)
+{
+ unsigned r = 0;
+#if (ACC_OS_POSIX_LINUX || ACC_OS_WIN32 || ACC_OS_WIN64)
+ const char* p;
+ p = __ACCLIB_FUNCNAME(acc_getenv)("ACC_ENV_RUNNING_ON_QEMU");
+ if (p) {
+ if (p[0] == 0) r = 0;
+ else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = p[0] - '0';
+ else r = 1;
+ }
+#endif
+ return r;
+}
+ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void)
+{
+#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
+ volatile unsigned long args[5] = { 0x1001, 0, 0, 0, 0 };
+ unsigned long r = 0;
+ __asm__ __volatile__(".byte 0xc1,0xc0,0x1d,0xc1,0xc0,0x03,0xc1,0xc8,0x1b,0xc1,0xc8,0x05,0xc1,0xc0,0x0d,0xc1,0xc0,0x13\n" : "=d" (r) : "a" (&args[0]), "d" (r) : __ACC_ASM_CLOBBER);
+ return (unsigned) r;
+#else
+ return 0;
+#endif
+}
+#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
+# pragma warn(pop)
+#endif
+#endif
+#if defined(ACC_WANT_ACCLIB_WILDARGV)
+# undef ACC_WANT_ACCLIB_WILDARGV
+#define __ACCLIB_WILDARGV_CH_INCLUDED 1
+#if !defined(ACCLIB_PUBLIC)
+# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
+#endif
+#if (ACC_OS_DOS16 || ACC_OS216 || ACC_OS_WIN16)
+#if 0 && (ACC_CC_MSC)
+ACC_EXTERN_C int __acc_cdecl __setargv(void);
+ACC_EXTERN_C int __acc_cdecl _setargv(void);
+ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (ACC_OS_WIN32 || ACC_OS_WIN64)
+#if (ACC_CC_INTELC || ACC_CC_MSC)
+ACC_EXTERN_C int __acc_cdecl __setargv(void);
+ACC_EXTERN_C int __acc_cdecl _setargv(void);
+ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); }
+#endif
+#endif
+#if (ACC_OS_EMX)
+#define __ACCLIB_HAVE_ACC_WILDARGV 1
+ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
+{
+ if (argc && argv) {
+ _response(argc, argv);
+ _wildcard(argc, argv);
+ }
+}
+#endif
+#if (ACC_OS_CONSOLE_PSP) && defined(__PSPSDK_DEBUG__)
+#define __ACCLIB_HAVE_ACC_WILDARGV 1
+ACC_EXTERN_C int acc_psp_init_module(int*, char***, int);
+ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
+{
+ acc_psp_init_module(argc, argv, -1);
+}
+#endif
+#if !(__ACCLIB_HAVE_ACC_WILDARGV)
+#define __ACCLIB_HAVE_ACC_WILDARGV 1
+ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
+{
+#if 1 && (ACC_ARCH_I086PM)
+ if (ACC_MM_AHSHIFT != 3) { exit(1); }
+#elif 1 && (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
+ __binmode(1);
+ if (isatty(1)) __set_binmode(stdout, 0);
+ if (isatty(2)) __set_binmode(stderr, 0);
+#endif
+ ACC_UNUSED(argc); ACC_UNUSED(argv);
+}
+#endif
+#endif
+
+/* vim:set ts=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/src/stats1a.h b/ics-openvpn-stripped/main/lzo/src/stats1a.h
new file mode 100644
index 00000000..5c2af38c
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/stats1a.h
@@ -0,0 +1,125 @@
+/* stats1a.h -- statistics for the the LZO1A algorithm
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the LZO package and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_STATS1A_H
+#define __LZO_STATS1A_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/***********************************************************************
+// collect statistical information when compressing
+// used for finetuning, view with a debugger
+************************************************************************/
+
+#if (LZO_COLLECT_STATS)
+# define LZO_STATS(expr) expr
+#else
+# define LZO_STATS(expr) ((void) 0)
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+typedef struct {
+
+/* configuration */
+ unsigned rbits;
+ unsigned clevel;
+
+/* internal configuration */
+ unsigned dbits;
+ unsigned lbits;
+
+/* constants */
+ unsigned min_match_short;
+ unsigned max_match_short;
+ unsigned min_match_long;
+ unsigned max_match_long;
+ unsigned min_offset;
+ unsigned max_offset;
+ unsigned r0min;
+ unsigned r0fast;
+ unsigned r0max;
+
+/* counts */
+ long short_matches;
+ long long_matches;
+ long r1_matches;
+ long lit_runs;
+ long lit_runs_after_long_match;
+ long r0short_runs;
+ long r0fast_runs;
+ long r0long_runs;
+
+/* */
+ long lit_run[RSIZE];
+ long lit_run_after_long_match[RSIZE];
+ long short_match[MAX_MATCH_SHORT + 1];
+ long long_match[MAX_MATCH_LONG + 1];
+ long marker[256];
+
+/* these could prove useful for further optimizations */
+ long short_match_offset_osize[MAX_MATCH_SHORT + 1];
+ long short_match_offset_256[MAX_MATCH_SHORT + 1];
+ long short_match_offset_1024[MAX_MATCH_SHORT + 1];
+ long matches_out_of_range;
+ long matches_out_of_range_2;
+ long matches_out_of_range_4;
+ long match_out_of_range[MAX_MATCH_SHORT + 1];
+
+/* */
+ long in_len;
+ long out_len;
+}
+lzo1a_stats_t;
+
+extern lzo1a_stats_t *lzo1a_stats;
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/stats1b.h b/ics-openvpn-stripped/main/lzo/src/stats1b.h
new file mode 100644
index 00000000..453e7ab3
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/stats1b.h
@@ -0,0 +1,130 @@
+/* stats1b.h -- statistics for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_STATS1B_H
+#define __LZO_STATS1B_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+// Collect statistical information when compressing.
+// Useful for finetuning the compression algorithm.
+// Examine the symbol 'lzo1b_stats' with a debugger.
+************************************************************************/
+
+#if (LZO_COLLECT_STATS)
+# define LZO_STATS(expr) expr
+#else
+# define LZO_STATS(expr) ((void) 0)
+#endif
+
+
+#if (LZO_COLLECT_STATS)
+
+typedef struct
+{
+/* algorithm configuration */
+ unsigned r_bits;
+ unsigned m3o_bits;
+ unsigned dd_bits;
+ unsigned clevel;
+
+/* internal configuration */
+ unsigned d_bits;
+ long min_lookahead;
+ long max_lookbehind;
+ const char *compress_id;
+
+/* counts */
+ long lit_runs;
+ long r0short_runs;
+ long r0fast_runs;
+ long r0long_runs;
+ long m1_matches;
+ long m2_matches;
+ long m3_matches;
+ long m4_matches;
+ long r1_matches;
+
+/* */
+ long lit_run[R0MIN];
+ long m2_match[M2_MAX_LEN + 1];
+ long m3_match[M3_MAX_LEN + 1];
+#if (M3O_BITS < 8)
+ long lit_runs_after_m3_match;
+ long lit_run_after_m3_match[LZO_SIZE(8-M3O_BITS)];
+#endif
+
+/* */
+ long matches;
+ long match_bytes;
+ long literals;
+ long literal_overhead;
+ long literal_bytes;
+ double literal_overhead_percent;
+
+/* */
+ long unused_dict_entries;
+ double unused_dict_entries_percent;
+
+/* */
+ long in_len;
+ long out_len;
+}
+lzo1b_stats_t;
+
+
+void _lzo1b_stats_init(lzo1b_stats_t *lzo_stats);
+void _lzo1b_stats_calc(lzo1b_stats_t *lzo_stats);
+
+extern lzo1b_stats_t * const lzo1b_stats;
+
+#define lzo_stats_t lzo1b_stats_t
+#define lzo_stats lzo1b_stats
+
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/src/stats1c.h b/ics-openvpn-stripped/main/lzo/src/stats1c.h
new file mode 100644
index 00000000..7f1f4cd9
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/src/stats1c.h
@@ -0,0 +1,49 @@
+/* stats1c.h -- statistics for the the LZO library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the library and is subject
+ to change.
+ */
+
+
+#ifndef __LZO_STATS1C_H
+#define __LZO_STATS1C_H 1
+
+#define lzo1b_stats_t lzo1c_stats_t
+#define lzo1b_stats lzo1c_stats
+#define _lzo1b_stats_init _lzo1c_stats_init
+#define _lzo1b_stats_calc _lzo1c_stats_calc
+
+#include "stats1b.h"
+
+#endif /* already included */
+
+/*
+vi:ts=4:et
+*/
diff --git a/ics-openvpn-stripped/main/lzo/stamp-h1 b/ics-openvpn-stripped/main/lzo/stamp-h1
new file mode 100644
index 00000000..4547fe1b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/stamp-h1
@@ -0,0 +1 @@
+timestamp for config.h
diff --git a/ics-openvpn-stripped/main/lzo/tests/.deps/align.Po b/ics-openvpn-stripped/main/lzo/tests/.deps/align.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/.deps/align.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/tests/.deps/chksum.Po b/ics-openvpn-stripped/main/lzo/tests/.deps/chksum.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/.deps/chksum.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/tests/.deps/promote.Po b/ics-openvpn-stripped/main/lzo/tests/.deps/promote.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/.deps/promote.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/tests/.deps/sizes.Po b/ics-openvpn-stripped/main/lzo/tests/.deps/sizes.Po
new file mode 100644
index 00000000..9ce06a81
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/.deps/sizes.Po
@@ -0,0 +1 @@
+# dummy
diff --git a/ics-openvpn-stripped/main/lzo/tests/Makefile.am b/ics-openvpn-stripped/main/lzo/tests/Makefile.am
new file mode 100644
index 00000000..08246b33
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/Makefile.am
@@ -0,0 +1,17 @@
+## Process this file with automake to create Makefile.in
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+
+noinst_PROGRAMS = align chksum promote sizes
+
+align_SOURCES = align.c
+chksum_SOURCES = chksum.c
+promote_SOURCES = promote.c
+sizes_SOURCES = sizes.c
+
+align_LDADD = ../src/liblzo2.la
+chksum_LDADD = ../src/liblzo2.la
+
diff --git a/ics-openvpn-stripped/main/lzo/tests/Makefile.in b/ics-openvpn-stripped/main/lzo/tests/Makefile.in
new file mode 100644
index 00000000..d86aa1f4
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/Makefile.in
@@ -0,0 +1,468 @@
+# 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 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@
+
+#
+# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer
+#
+
+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@
+noinst_PROGRAMS = align$(EXEEXT) chksum$(EXEEXT) promote$(EXEEXT) \
+ sizes$(EXEEXT)
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+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)
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_align_OBJECTS = align.$(OBJEXT)
+align_OBJECTS = $(am_align_OBJECTS)
+align_DEPENDENCIES = ../src/liblzo2.la
+am_chksum_OBJECTS = chksum.$(OBJEXT)
+chksum_OBJECTS = $(am_chksum_OBJECTS)
+chksum_DEPENDENCIES = ../src/liblzo2.la
+am_promote_OBJECTS = promote.$(OBJEXT)
+promote_OBJECTS = $(am_promote_OBJECTS)
+promote_LDADD = $(LDADD)
+am_sizes_OBJECTS = sizes.$(OBJEXT)
+sizes_OBJECTS = $(am_sizes_OBJECTS)
+sizes_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(align_SOURCES) $(chksum_SOURCES) $(promote_SOURCES) \
+ $(sizes_SOURCES)
+DIST_SOURCES = $(align_SOURCES) $(chksum_SOURCES) $(promote_SOURCES) \
+ $(sizes_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_ASM_VPATH = @LZO_ASM_VPATH@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_CPPFLAGS = @LZO_CPPFLAGS@
+LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@
+LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@
+LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@
+LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+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_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+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__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@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+configure_CFLAGS = @configure_CFLAGS@
+configure_CPPFLAGS = @configure_CPPFLAGS@
+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@
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
+align_SOURCES = align.c
+chksum_SOURCES = chksum.c
+promote_SOURCES = promote.c
+sizes_SOURCES = sizes.c
+align_LDADD = ../src/liblzo2.la
+chksum_LDADD = ../src/liblzo2.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(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) --gnu tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tests/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+align$(EXEEXT): $(align_OBJECTS) $(align_DEPENDENCIES)
+ @rm -f align$(EXEEXT)
+ $(LINK) $(align_LDFLAGS) $(align_OBJECTS) $(align_LDADD) $(LIBS)
+chksum$(EXEEXT): $(chksum_OBJECTS) $(chksum_DEPENDENCIES)
+ @rm -f chksum$(EXEEXT)
+ $(LINK) $(chksum_LDFLAGS) $(chksum_OBJECTS) $(chksum_LDADD) $(LIBS)
+promote$(EXEEXT): $(promote_OBJECTS) $(promote_DEPENDENCIES)
+ @rm -f promote$(EXEEXT)
+ $(LINK) $(promote_LDFLAGS) $(promote_OBJECTS) $(promote_LDADD) $(LIBS)
+sizes$(EXEEXT): $(sizes_OBJECTS) $(sizes_DEPENDENCIES)
+ @rm -f sizes$(EXEEXT)
+ $(LINK) $(sizes_LDFLAGS) $(sizes_OBJECTS) $(sizes_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/align.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chksum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/promote.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sizes.Po@am__quote@
+
+.c.o:
+@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@ 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@ 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 $@ $<
+
+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)
+ @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 $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+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 clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -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:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS 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-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
+
+# 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/ics-openvpn-stripped/main/lzo/tests/align.c b/ics-openvpn-stripped/main/lzo/tests/align.c
new file mode 100644
index 00000000..a4c5f7db
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/align.c
@@ -0,0 +1,196 @@
+/* align.c -- test alignment (important for 16-bit systems)
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#if 0
+#include "src/lzo_conf.h"
+#include "src/lzo_ptr.h"
+#endif
+#include "lzo/lzoconf.h"
+
+/* utility layer */
+#define WANT_LZO_MALLOC 1
+#include "examples/portab.h"
+
+
+static int opt_verbose = 0;
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+static unsigned long align_test(lzo_bytep block, lzo_uint len, lzo_uint step)
+{
+ lzo_bytep b1 = block;
+ lzo_bytep b2 = block;
+ lzo_bytep k1 = NULL;
+ lzo_bytep k2 = NULL;
+ lzo_bytep k;
+ lzo_bytep x;
+ lzo_uint offset = 0;
+ unsigned long i = 0;
+
+ assert(step > 0);
+ assert(step <= 65536L);
+ assert((step & (step - 1)) == 0);
+
+ for (offset = step; offset < len; offset += step)
+ {
+ k1 = LZO_PTR_ALIGN_UP(b1+1,step);
+ k2 = b2 + offset;
+ if (k1 != k2)
+ {
+ printf("error 1: i %lu step %ld offset %ld: "
+ "%p (%ld) %p (%ld)\n",
+ i, (long) step, (long) offset,
+ k1, (long) (k1 - block),
+ k2, (long) (k2 - block));
+ return 0;
+ }
+ if (k1 - step != b1)
+ {
+ printf("error 2: i %lu step %ld offset %ld: "
+ "%p (%ld) %p (%ld)\n",
+ i, (long) step, (long) offset,
+ b1, (long) (b1 - block),
+ k1, (long) (k1 - block));
+ return 0;
+ }
+
+ assert(k1 > b1);
+ assert(k2 > b2);
+ assert((lzo_uint)(k2 - b2) == offset);
+ assert(k1 - offset == b2);
+#if defined(PTR_ALIGNED_4)
+ if (step == 4)
+ {
+ assert(PTR_ALIGNED_4(k1));
+ assert(PTR_ALIGNED_4(k2));
+ assert(PTR_ALIGNED2_4(k1,k2));
+ }
+#endif
+#if defined(PTR_ALIGNED_8)
+ if (step == 8)
+ {
+ assert(PTR_ALIGNED_8(k1));
+ assert(PTR_ALIGNED_8(k2));
+ assert(PTR_ALIGNED2_8(k1,k2));
+ }
+#endif
+#if defined(PTR_LINEAR)
+ assert((PTR_LINEAR(k1) & (step-1)) == 0);
+ assert((PTR_LINEAR(k2) & (step-1)) == 0);
+#endif
+
+ for (k = b1 + 1; k <= k1; k++)
+ {
+ x = LZO_PTR_ALIGN_UP(k,step);
+ if (x != k1)
+ {
+ printf("error 3: base: %p %p %p i %lu step %ld offset %ld: "
+ "%p (%ld) %p (%ld) %p (%ld)\n",
+ block, b1, b2,
+ i, (long) step, (long) offset,
+ k1, (long) (k1 - block),
+ k, (long) (k - block),
+ x, (long) (x - block));
+ return 0;
+ }
+ }
+
+ b1 = k1;
+ i++;
+ }
+
+ return i;
+}
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+#define BLOCK_LEN (128*1024ul)
+
+int main(int argc, char *argv[])
+{
+ lzo_bytep buf;
+ lzo_uint step;
+
+ if (argc >= 2 && strcmp(argv[1],"-v") == 0)
+ opt_verbose = 1;
+
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("lzo_init() failed !!!\n");
+ return 3;
+ }
+ buf = (lzo_bytep) lzo_malloc(2*BLOCK_LEN + 256);
+ if (buf == NULL)
+ {
+ printf("out of memory\n");
+ return 2;
+ }
+
+#if defined(lzo_uintptr_t)
+ printf("Align init: %p ( 0x%lx )\n", buf, (unsigned long) (lzo_uintptr_t) buf);
+#elif defined(__LZO_MMODEL_HUGE)
+ printf("Align init: %p ( 0x%lx )\n", buf, (unsigned long) buf);
+#else
+ printf("Align init: %p ( 0x%lx )\n", buf, (unsigned long) (size_t) buf);
+#endif
+
+ for (step = 1; step <= 65536L; step *= 2)
+ {
+ lzo_bytep block = buf;
+ unsigned long n;
+ unsigned gap;
+
+ gap = __lzo_align_gap(block,step);
+ block = LZO_PTR_ALIGN_UP(block,step);
+ if (opt_verbose >= 1)
+ printf("STEP %5lu: GAP: %5lu %p %p %5lu\n",
+ (unsigned long) step, (unsigned long) gap, buf, block,
+ (unsigned long) (block - buf));
+ n = align_test(block,BLOCK_LEN,step);
+ if (n == 0)
+ return 1;
+ if ((n + 1) * step != BLOCK_LEN)
+ {
+ printf("error 4: %ld %lu\n", (long)step, n);
+ return 1;
+ }
+ }
+
+ lzo_free(buf);
+ printf("Alignment test passed.\n");
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/tests/chksum.c b/ics-openvpn-stripped/main/lzo/tests/chksum.c
new file mode 100644
index 00000000..bb5b502b
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/chksum.c
@@ -0,0 +1,89 @@
+/* chksum.c -- compute a checksum
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#include "lzo/lzoconf.h"
+
+/* utility layer */
+#define WANT_LZO_MALLOC 1
+#include "examples/portab.h"
+
+
+/*************************************************************************
+//
+**************************************************************************/
+
+int main(int argc, char *argv[])
+{
+ lzo_bytep block;
+ lzo_uint block_len;
+ lzo_uint32_t adler, crc;
+
+ if (argc < 0 && argv == NULL) /* avoid warning about unused args */
+ return 0;
+
+ if (lzo_init() != LZO_E_OK)
+ {
+ printf("lzo_init() failed !!!\n");
+ return 4;
+ }
+
+/* prepare the block */
+ block_len = 128 * 1024L;
+ block = (lzo_bytep) lzo_malloc(block_len);
+ if (block == NULL)
+ {
+ printf("out of memory\n");
+ return 3;
+ }
+ lzo_memset(block, 0, block_len);
+
+/* adler32 checksum */
+ adler = lzo_adler32(0, NULL, 0);
+ adler = lzo_adler32(adler, block, block_len);
+ if (adler != 0x001e0001UL)
+ {
+ printf("adler32 checksum error !!! (0x%08lx)\n", (long) adler);
+ return 2;
+ }
+
+/* crc32 checksum */
+ crc = lzo_crc32(0, NULL, 0);
+ crc = lzo_crc32(crc, block, block_len);
+ if (crc != 0x7ee8cdcdUL)
+ {
+ printf("crc32 checksum error !!! (0x%08lx)\n", (long) crc);
+ return 1;
+ }
+
+ lzo_free(block);
+ printf("Checksum test passed.\n");
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/tests/promote.c b/ics-openvpn-stripped/main/lzo/tests/promote.c
new file mode 100644
index 00000000..30c6da60
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/promote.c
@@ -0,0 +1,64 @@
+/* promote.c -- test intergral promotion
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+#include <stdio.h>
+
+#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
+ /* disable "unreachable code" warnings */
+# pragma warning(disable: 4702)
+#endif
+
+int main(int argc, char *argv[])
+{
+ unsigned char c;
+ int s;
+
+ if (argc < 0 && argv == NULL) /* avoid warning about unused args */
+ return 0;
+
+ c = (unsigned char) (1 << (8 * sizeof(char) - 1));
+ s = 8 * (int) (sizeof(int) - sizeof(char));
+
+ printf("Integral promotion: ");
+ {
+ const int u = (c << s) > 0;
+ if (u)
+ {
+ printf("Classic C (unsigned-preserving)\n");
+ printf("%d %d %uU\n", c, s, (unsigned)c << s);
+ return 1;
+ }
+ else
+ {
+ printf("ANSI C (value-preserving)\n");
+ printf("%d %d %d\n", c, s, c << s);
+ return 0;
+ }
+ }
+}
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/tests/sizes.c b/ics-openvpn-stripped/main/lzo/tests/sizes.c
new file mode 100644
index 00000000..3840fe2a
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/tests/sizes.c
@@ -0,0 +1,138 @@
+/* sizes.c -- print sizes of various types
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 1996-2014 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 as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ 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/
+ */
+
+
+#if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER)
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_NONSTDC_NO_WARNINGS
+#define _CRT_NONSTDC_NO_WARNINGS 1
+#endif
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS 1
+#endif
+#endif
+
+#include "lzo/lzoconf.h"
+#include <stdio.h>
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+ /* disable warning C4310: cast truncates constant value */
+# pragma warning(disable: 4310)
+#endif
+
+
+union _lzo_align1_t
+{
+ char a_char;
+};
+
+struct _lzo_align2_t
+{
+ char a_char;
+};
+
+struct _lzo_align3_t
+{
+ char a_char;
+ long a_long;
+};
+
+struct _lzo_align4_t
+{
+ char a_char;
+ char * a_char_p;
+};
+
+struct _lzo_align5_t
+{
+ char a_char1;
+ long a_long;
+ char a_char2;
+ char * a_char_p;
+};
+
+union _lzo_align6_t
+{
+ char a_char;
+ long a_long;
+ char * a_char_p;
+ lzo_bytep a_lzobytep;
+};
+
+
+#define print_size(type) \
+ sprintf(s,"sizeof(%s)",#type); \
+ printf("%-30s %2ld\n", s, (long)sizeof(type));
+
+#define print_ssize(type,m) \
+ sprintf(s,"sizeof(%s)",#type); \
+ printf("%-30s %2ld %20ld\n", s, (long)sizeof(type), (long)(m));
+
+#define print_usize(type,m) \
+ sprintf(s,"sizeof(%s)",#type); \
+ printf("%-30s %2ld %20lu\n", s, (long)sizeof(type), (unsigned long)(m));
+
+
+int main(int argc, char *argv[])
+{
+ char s[80];
+
+ print_ssize(char,CHAR_MAX);
+ print_usize(unsigned char,UCHAR_MAX);
+ print_ssize(short,SHRT_MAX);
+ print_usize(unsigned short,USHRT_MAX);
+ print_ssize(int,INT_MAX);
+ print_usize(unsigned int,UINT_MAX);
+ print_ssize(long,LONG_MAX);
+ print_usize(unsigned long,ULONG_MAX);
+ printf("\n");
+ print_size(char *);
+ print_size(void (*)(void));
+ printf("\n");
+ print_ssize(lzo_int,LZO_INT_MAX);
+ print_usize(lzo_uint,LZO_UINT_MAX);
+ print_size(lzo_bytep);
+ printf("\n");
+ print_size(union _lzo_align1_t);
+ print_size(struct _lzo_align2_t);
+ print_size(struct _lzo_align3_t);
+ print_size(struct _lzo_align4_t);
+ print_size(struct _lzo_align5_t);
+ print_size(union _lzo_align6_t);
+
+ if (argc < 0 && argv == NULL) /* avoid warning about unused args */
+ return 0;
+ return 0;
+}
+
+
+/* vim:set ts=4 sw=4 et: */
diff --git a/ics-openvpn-stripped/main/lzo/util/check.sh b/ics-openvpn-stripped/main/lzo/util/check.sh
new file mode 100644
index 00000000..f412803f
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/check.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+set -e
+
+#
+# usage: util/check.sh [directory]
+#
+# This script runs lzotest with all algorithms on a complete directory tree.
+# It is not suitable for accurate timings.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+#
+
+LZOTEST="lzotest"
+test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest"
+test -x ./lzotest.exe && LZOTEST="./lzotest.exe"
+test -x ./lzotest.out && LZOTEST="./lzotest.out"
+
+dir="${*-.}"
+
+TMPFILE="/tmp/lzo_$$.tmp"
+rm -f $TMPFILE
+(find $dir/ -type f -print > $TMPFILE) || true
+
+## methods=`$LZOTEST -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'`
+## methods="9721 9722 9723 9724 9725 9726 9727 9728 9729"
+methods="21 31 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 61 71 81"
+methods="$methods 111 112 115"
+methods="$methods 921 931 901 911"
+methods="$methods 902 912 942 962 972 982 992"
+##methods="71 972"
+##methods="1101 1102 1103 1104 1105 1106 1107"
+
+LFLAGS="-q -T -n2 -S"
+LFLAGS="-q -T -n2"
+
+for i in $methods; do
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS
+done
+
+rm -f $TMPFILE
+echo "Done."
+exit 0
+
diff --git a/ics-openvpn-stripped/main/lzo/util/checkasm.sh b/ics-openvpn-stripped/main/lzo/util/checkasm.sh
new file mode 100644
index 00000000..4fee682e
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/checkasm.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+set -e
+
+#
+# usage: util/checkasm.sh [directory]
+#
+# This script runs lzotest with all assembler decompressors
+# on a complete directory tree.
+# It is not suitable for accurate timings.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+#
+
+LZOTEST="lzotest"
+test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest"
+test -x ./lzotest.exe && LZOTEST="./lzotest.exe"
+test -x ./lzotest.out && LZOTEST="./lzotest.out"
+LFLAGS="-q"
+
+dir="${*-.}"
+
+TMPFILE="/tmp/lzo_$$.tmp"
+rm -f $TMPFILE
+(find $dir/ -type f -print > $TMPFILE) || true
+
+for i in 11; do
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
+done
+
+for i in 61; do
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
+done
+
+for i in 71 81; do
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F
+ cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S
+done
+
+rm -f $TMPFILE
+echo "Done."
+exit 0
+
diff --git a/ics-openvpn-stripped/main/lzo/util/notime.pl b/ics-openvpn-stripped/main/lzo/util/notime.pl
new file mode 100644
index 00000000..5fa7d4d1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/notime.pl
@@ -0,0 +1,26 @@
+#! /usr/bin/perl
+##
+## vi:ts=4
+##
+##---------------------------------------------------------------------------##
+##
+## Author:
+## Markus F.X.J. Oberhumer <markus@oberhumer.com>
+##
+## Description:
+## Remove timing values from a table created by table.pl
+##
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+##
+##---------------------------------------------------------------------------##
+
+
+while (<>) {
+ if (substr($_,56) =~ /^\s+[\d\.]+\s+[\d\.]+\s+\|\s*\n$/) {
+ substr($_,56) = " 0.000 0.000 |\n";
+ }
+ print;
+}
+
+exit(0);
+
diff --git a/ics-openvpn-stripped/main/lzo/util/overlap.sh b/ics-openvpn-stripped/main/lzo/util/overlap.sh
new file mode 100644
index 00000000..8f3b16b1
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/overlap.sh
@@ -0,0 +1,27 @@
+#! /bin/sh
+set -e
+
+#
+# usage: util/overlap.sh [directory]
+#
+# This script runs the overlap example program on a complete directory tree.
+#
+# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+#
+
+OVERLAP="overlap"
+test -x ./examples/overlap && OVERLAP="./examples/overlap"
+test -x ./overlap.exe && OVERLAP="./overlap.exe"
+
+dir="${*-.}"
+
+TMPFILE="/tmp/lzo_$$.tmp"
+rm -f $TMPFILE
+(find $dir/ -type f -print0 > $TMPFILE) || true
+
+cat $TMPFILE | xargs -0 -r $OVERLAP
+
+rm -f $TMPFILE
+echo "Done."
+exit 0
+
diff --git a/ics-openvpn-stripped/main/lzo/util/shortf.pl b/ics-openvpn-stripped/main/lzo/util/shortf.pl
new file mode 100644
index 00000000..3e447cdd
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/shortf.pl
@@ -0,0 +1,31 @@
+#! /usr/bin/perl
+##
+## vi:ts=4
+##
+##---------------------------------------------------------------------------##
+##
+## Author:
+## Markus F.X.J. Oberhumer <markus@oberhumer.com>
+##
+## Description:
+## Create short files for compression test
+##
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+##
+##---------------------------------------------------------------------------##
+
+$c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+$c = "\x00\x01\x02";
+$c = "\x00";
+
+$x = $c x 1024;
+
+for $i (0 .. 50) {
+ $name = sprintf("f%04d.dat",$i);
+ open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
+ binmode(OUTFILE);
+ print OUTFILE substr($x,0,$i);
+ close(OUTFILE);
+}
+
+exit(0);
diff --git a/ics-openvpn-stripped/main/lzo/util/table.pl b/ics-openvpn-stripped/main/lzo/util/table.pl
new file mode 100644
index 00000000..8b352073
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/table.pl
@@ -0,0 +1,360 @@
+#! /usr/bin/perl
+##
+## vi:ts=4:et
+##
+##---------------------------------------------------------------------------##
+##
+## Author:
+## Markus F.X.J. Oberhumer <markus@oberhumer.com>
+##
+## Description:
+## Convert the output of the LZO lzotest program into a nice table.
+##
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+##
+##---------------------------------------------------------------------------##
+
+$PROG = $0;
+require 'ctime.pl';
+
+#
+# get options
+#
+
+while ($_ = $ARGV[ $[ ], /^-/) {
+ shift(@ARGV);
+ /^--$/ && ($opt_last = 1, last);
+
+ /^--sort=name/ && ($opt_sort_summary_by_name++, next);
+ /^--sort=ratio/ && ($opt_sort_summary_by_ratio++, next);
+ /^-s/ && ($opt_summary_only++, next);
+ /^-t/ && ($opt_clear_time++, next);
+}
+
+
+$alg = '';
+$sep = "+" . ("-" x 76) . "+\n";
+
+$block_size = -1;
+
+$n = 0;
+@algs = ();
+%average = ();
+%total = ();
+
+$lzo_version_string = '';
+$lzo_version_date = '';
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+while (<>) {
+
+ if (/(^|\s)(\d+)\s+block\-size/i) {
+ if ($block_size < 0) {
+ $block_size = $2;
+ &intro($block_size);
+ } elsif ($block_size != $2) {
+ die "$PROG: block-size: $block_size != $2\n";
+ }
+ next;
+ }
+
+ if (/^\s*LZO\s.*library\s+\(v\s*([\w\.\s]+)\s*\,\s*([^\)]+)\)/) {
+ $lzo_version_string = $1;
+ $lzo_version_date = $2;
+ next;
+ }
+
+ if (/^\s*(\S+(\s+\[\S+\])?)\s*(\|.*\|)\s*$/i) {
+ if ($1 ne $alg) {
+ &footer($1);
+ &header($1);
+ }
+ $line = $3;
+ &stats(*line);
+ print "$line\n" if (!$opt_summary_only);
+ }
+}
+&footer($1);
+
+&summary();
+
+exit(0);
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+sub stats {
+ local (*l) = @_;
+ local ($x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8);
+
+ if ($l !~ /^\|\s*(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d\.]+\s+)?([\d\.]+\s+)?([\d\.]+)\s+([\d\.]+)\s*\|/) {
+ die $_;
+ }
+
+ $n++;
+
+ $x1 = $1; $x2 = $2; $x3 = $3; $x4 = $4;
+ $x5 = ($x2 > 0) ? $x4 * 100.0 / $x2 : 0.0;
+ $x6 = ($x2 > 0) ? $x4 * 8.0 / $x2 : 0.0;
+ $x7 = $7; $x8 = $8;
+
+ # convert from kB/s to MB/s (for old versions of lzotest)
+ if ($x7 =~ /\.\d\d$/) { $x7 = $x7 / 1000.0; }
+ if ($x8 =~ /\.\d\d$/) { $x8 = $x8 / 1000.0; }
+
+ if ($opt_clear_time) {
+ $x7 = $x8 = 0.0;
+ }
+
+ $s[0] += $x2;
+ $s[1] += $x3;
+ $s[2] += $x4;
+ $s[3] += $x5;
+ $s[4] += $x6;
+ if ($x7 > 0) {
+ $s[5] += 1.0 / $x7; $sn[5] += 1;
+ }
+ if ($x8 > 0) {
+ $s[6] += 1.0/ $x8; $sn[6] += 1;
+ }
+
+ $x1 =~ s/\s+$//;
+ $l = sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |",
+ $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8);
+}
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+sub header {
+ local ($t) = @_;
+
+ $alg = $t;
+
+ # reset stats
+ $n = 0;
+ @s = (0, 0, 0, 0.0, 0.0, 0.0, 0.0);
+ @sn = (0, 0, 0, 0, 0, 0, 0);
+
+ return if $opt_summary_only;
+
+ print "\n$alg\n\n";
+ print $sep;
+print <<EndOfString;
+| File Name Length CxB ComLen Ratio% Bits Com MB/s Dec MB/s |
+| --------- ------ --- ------ ----- ---- -------- -------- |
+EndOfString
+}
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+sub footer {
+ local ($t) = @_;
+ local ($shm5, $shm6);
+
+ return unless $alg;
+ die if $n <= 0;
+ die if $s[0] <= 0;
+
+ # harmonic mean
+ $shm5 = $s[5] > 0 ? $sn[5] / $s[5] : 0.0;
+ $shm6 = $s[6] > 0 ? $sn[6] / $s[6] : 0.0;
+
+ push(@algs,$alg);
+
+ $average{$alg} =
+ sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n",
+ "Average", $s[0]/$n, $s[1]/$n, $s[2]/$n,
+ $s[3]/$n, $s[4]/$n,
+ $shm5, $shm6);
+
+ $total{$alg} =
+ sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n",
+ "Total", $s[0], $s[1], $s[2],
+ $s[2]/$s[0]*100, $s[2]/$s[0]*8,
+ $shm5, $shm6);
+
+ return if $opt_summary_only;
+
+ print $sep;
+ print $average{$alg};
+ print $total{$alg};
+ print $sep, "\n";
+}
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+$sort_mode = 0;
+
+sub cmp_by_ratio {
+ local ($aa, $bb);
+
+ if ($sort_mode == 0) {
+ $aa = $average{$a};
+ $bb = $average{$b};
+ } elsif ($sort_mode == 1) {
+ $aa = $total{$a};
+ $bb = $total{$b};
+ } else {
+ die;
+ }
+
+ ($aa =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die;
+ $aa = $1;
+ ($bb =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die;
+ $bb = $1;
+
+ # $aa < $bb;
+ $aa cmp $bb;
+}
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+sub summary {
+ local ($l);
+ local (@k);
+
+ $sort_mode = 0;
+ if ($opt_sort_summary_by_name) {
+ @k = sort(@algs);
+ } elsif ($opt_sort_summary_by_ratio) {
+ @k = sort(cmp_by_ratio @algs);
+ } else {
+ @k = @algs;
+ }
+
+ print "\n\n";
+ print "Summary of average values\n\n";
+ print $sep;
+print <<EndOfString;
+| Algorithm Length CxB ComLen Ratio% Bits Com MB/s Dec MB/s |
+| --------- ------ --- ------ ----- ---- -------- -------- |
+EndOfString
+
+ for (@k) {
+ $l = $average{$_};
+ $l =~ s/Average[\s]{7}/sprintf("%-14s",$_)/e;
+ print $l;
+ }
+ print $sep;
+
+
+
+ $sort_mode = 1;
+ if ($opt_sort_summary_by_name) {
+ @k = sort(@algs);
+ } elsif ($opt_sort_summary_by_ratio) {
+ @k = sort(cmp_by_ratio @algs);
+ } else {
+ @k = @algs;
+ }
+
+ print "\n\n";
+ print "Summary of total values\n\n";
+ print $sep;
+print <<EndOfString;
+| Algorithm Length CxB ComLen Ratio% Bits Com MB/s Dec MB/s |
+| --------- ------ --- ------ ----- ---- -------- -------- |
+EndOfString
+
+ for (@k) {
+ $l = $total{$_};
+ $l =~ s/Total[\s]{9}/sprintf("%-14s",$_)/e;
+ print $l;
+ }
+ print $sep;
+}
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+sub intro {
+ local ($bs) = @_;
+ local ($v, $t, $x);
+ local ($u, $uname_m, $uname_s, $uname_r);
+
+ $t = &ctime(time); chop($t);
+ $t = sprintf("%-55s |", $t);
+
+ $v='';
+ if ($lzo_version_string) {
+ $v = $lzo_version_string;
+ $v .= ', ' . $lzo_version_date if $lzo_version_date;
+ $v = sprintf("%-55s |", $v);
+ $v = sprintf("| LZO version : %s\n", $v);
+ }
+
+ if ($bs % 1024 == 0) {
+ $x = sprintf("%d (= %d kB)", $bs, $bs / 1024);
+ } else {
+ $x = sprintf("%d (= %.3f kB)", $bs, $bs / 1024.0);
+ }
+ $x = sprintf("%-55s |", $x);
+
+ $u='';
+ if (1 == 1) {
+ $uname_s = `uname -s`; $uname_s =~ s/^\s+//; $uname_s =~ s/\s+$//;
+ $uname_r = `uname -r`; $uname_r =~ s/^\s+//; $uname_r =~ s/\s+$//;
+ $uname_m = `uname -m`; $uname_m =~ s/^\s+//; $uname_m =~ s/\s+$//;
+ if ($uname_s && $uname_m) {
+ $u = $uname_s;
+ $u .= ' ' . $uname_r if $uname_r;
+ $u .= ' ' . $uname_m;
+ $u = sprintf("%-55s |", $u);
+ $u = sprintf("| Operating system : %s\n", $u);
+ }
+ }
+ print <<EndOfString;
+
++----------------------------------------------------------------------------+
+| DATA COMPRESSION TEST |
+| ===================== |
+| Time of run : $t
+$v$u| Context length : $x
++----------------------------------------------------------------------------+
+
+
+Notes:
+- CxB is the number of independent blocks a file was splitted
+- MB/s is the speed measured in 1,000,000 uncompressed bytes per second
+- all averages are calculated from the un-rounded values
+- the average ratio & bits are calculated by the arithmetic mean
+- the average speed is calculated by the harmonic mean
+
+
+EndOfString
+}
+
+__END__
+
+
+### insert something like this after 'Time of run':
+
+| Hardware : Intel Pentium 133, 64 MB RAM, 256 kB Cache |
+| Operating system : MS-DOS 7.10, HIMEM.SYS 3.95, DOS/4GW 1.97 |
+| Compiler : Watcom C32 10.5 |
+| Compiler flags : -mf -5r -oneatx |
+| Test suite : Calgary Corpus Suite |
+| Files in suite : 14 |
+| Timing accuracy : One part in 100 |
+
+
diff --git a/ics-openvpn-stripped/main/lzo/util/uncompr.pl b/ics-openvpn-stripped/main/lzo/util/uncompr.pl
new file mode 100644
index 00000000..54ec9e06
--- /dev/null
+++ b/ics-openvpn-stripped/main/lzo/util/uncompr.pl
@@ -0,0 +1,32 @@
+#! /usr/bin/perl
+##
+## vi:ts=4
+##
+##---------------------------------------------------------------------------##
+##
+## Author:
+## Markus F.X.J. Oberhumer <markus@oberhumer.com>
+##
+## Description:
+## Create incompressible files for compression test
+##
+## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+##
+##---------------------------------------------------------------------------##
+
+$x = ' ' x 65536;
+$i = 0;
+while ($i < 65536) {
+ substr($x,$i,1) = pack('C',rand(256));
+ $i++;
+}
+
+for $i (1,2,4,8,16,32,64) {
+ $name = sprintf("u%04d.dat",$i);
+ open(OUTFILE,">$name") || die "$0: cannot open '$name': $!";
+ binmode(OUTFILE);
+ print OUTFILE substr($x,0,$i*1024);
+ close(OUTFILE);
+}
+
+exit(0);
diff --git a/ics-openvpn-stripped/main/misc/build-native.bat b/ics-openvpn-stripped/main/misc/build-native.bat
new file mode 100644
index 00000000..73a19a00
--- /dev/null
+++ b/ics-openvpn-stripped/main/misc/build-native.bat
@@ -0,0 +1,22 @@
+
+@echo on
+echo Currently broken, feel free to fix and send me a patch, see .sh file
+exit 1
+
+call ndk-build APP_API=all -j 8
+
+
+cd libs
+mkdir ..\assets
+mkdir ..\build\
+
+for /D %%f in (*) do (
+ copy %%f\minivpn ..\assets\minivpn.%%f
+ del %%f\libcrypto.so
+ del %%f\libssl.so
+
+ mkdir ..\build\native-libs\%%f\
+ copy %%f\*.so ..\build\native-libs\%%f\
+)
+
+cd ..
diff --git a/ics-openvpn-stripped/main/misc/build-native.sh b/ics-openvpn-stripped/main/misc/build-native.sh
new file mode 100755
index 00000000..f27384cd
--- /dev/null
+++ b/ics-openvpn-stripped/main/misc/build-native.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Exit on errors
+set -e
+
+# Generate git config if the openvpn directory is checked out from git
+if [ -d openvpn/.git ]; then
+ GIT=git
+ cd openvpn
+ CONFIGURE_GIT_CHFILES=$($GIT diff-files --name-status -r --ignore-submodules --quiet -- || echo "+")
+ CONFIGURE_GIT_UNCOMMITTED=$($GIT diff-index --cached --quiet --ignore-submodules HEAD || echo "*")
+ CONFIGURE_GIT_REVISION=$($GIT rev-parse --symbolic-full-name HEAD | cut -d/ -f3)-$($GIT rev-parse --short=16 HEAD)
+ echo "#define CONFIGURE_GIT_REVISION \"${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \
+ echo "#define CONFIGURE_GIT_FLAGS \"${CONFIGURE_GIT_CHFILES}${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp
+
+ if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \
+ echo "replacing config-version.h"
+ mv config-version.h.tmp config-version.h
+ else
+ rm -f config-version.h.tmp
+ fi
+ cd ..
+fi
+
+if [ "x$1" = "x" ]; then
+ ndk-build APP_API=all -j 8
+else
+ ndk-build $@
+fi
+
+if [ $? = 0 ]; then
+ rm -rf ovpnlibs/
+
+ cd libs
+ mkdir -p ../ovpnlibs/assets
+ for i in *
+ do
+ cp -v $i/nopievpn ../ovpnlibs/assets/nopievpn.$i
+ cp -v $i/pievpn ../ovpnlibs/assets/pievpn.$i
+ done
+ # Removed compiled openssl libs, will use platform so libs
+ # Reduces size of apk
+ #
+ rm -v */libcrypto.so */libssl.so
+
+ for arch in *
+ do
+ builddir=../ovpnlibs/jniLibs/$arch
+ mkdir -p $builddir
+ cp -v $arch/*.so $builddir
+ done
+else
+ exit $?
+fi
diff --git a/ics-openvpn-stripped/main/misc/fetchtranslations.sh b/ics-openvpn-stripped/main/misc/fetchtranslations.sh
new file mode 100755
index 00000000..3529a646
--- /dev/null
+++ b/ics-openvpn-stripped/main/misc/fetchtranslations.sh
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+
+if [ "$ICSCROWDAPIKEY" != "" ]
+then
+ echo "Generating new translation archives"
+ fetch -q -1 -o - http://api.crowdin.net/api/project/ics-openvpn/export?key=$ICSCROWDAPIKEY
+fi
+
+echo "Fetch translation archive"
+fetch -q http://crowdin.net/download/project/ics-openvpn.zip
+
+langtoinclude="ca cs de es et fr hu it ja ko no nl pl ro ru sv tr uk"
+
+for lang in $langtoinclude
+do
+ tar -xvf ics-openvpn.zip -C src/main res/values-$lang/
+done
+
+# Chinese language require zh-CN and zh-TW
+
+for lang in zh-CN zh-TW id
+do
+ if [ $lang = "zh-CN" ] ; then
+ rlang="zh-rCN"
+ elif [ $lang = "zh-TW" ] ; then
+ rlang="zh-rTW"
+ elif [ $lang = "id" ] ; then
+ rlang="in"
+ fi
+
+ echo "Fetch archive for $lang"
+ fetch http://crowdin.net/download/project/ics-openvpn/$lang.zip
+ tar -xv -C src/main/res/values-$rlang/ --strip-components 3 -f $lang.zip
+ rm $lang.zip
+done
+
+rm -v ics-openvpn.zip
diff --git a/ics-openvpn-stripped/main/misc/genFAQ.py b/ics-openvpn-stripped/main/misc/genFAQ.py
new file mode 100755
index 00000000..b1506420
--- /dev/null
+++ b/ics-openvpn-stripped/main/misc/genFAQ.py
@@ -0,0 +1,118 @@
+#!/usr/bin/env python
+# Quick and dirty script to generate googlecode wiki pages
+
+import codecs
+import xml.dom.minidom as dom
+import os.path
+
+faqpath = "/Users/arne/oss/ics-openvpn.wiki"
+
+header="""
+<wiki:comment>
+This page is autogenerated. Do not edit
+</wiki:comment>
+
+= Frequently aksed questions =
+"""
+
+def getString(strid,lang):
+ ostr=""
+ if strid in strres[lang]:
+ ostr=strres[lang][strid]
+ else:
+ ostr=strres["default"][strid]
+
+ ostr = ostr.replace("&lt;","<")
+ ostr = ostr.replace("&gt;",">")
+ ostr = ostr.replace("\\\"","\"")
+ ostr = ostr.replace("\\'","'")
+ ostr = ostr.replace("\\n","<p>")
+ return ostr
+
+def genPage(faqdom,lang):
+ out =""
+
+ #out+="#summary %s\n" % getString("faq_summary",lang)
+ out+= header
+
+ for xmld in faqdom.firstChild.childNodes:
+ for xmle in xmld.childNodes:
+ if xmle.nodeName == "TextView":
+ style = xmle.getAttribute("style")
+
+ textstyle = None
+ if style == "@style/faqhead":
+ textstyle = "== %s ==\n"
+ elif style == "@style/faqitem":
+ textstyle = "%s\n"
+
+ atext = xmle.getAttribute("android:text")
+ aid = xmle.getAttribute("android:id")
+ if atext:
+ atextid = atext.replace("@string/","")
+ else:
+ atextid = aid.replace("@+id/","")
+
+ out += textstyle % getString(atextid,lang)
+
+ return out
+
+
+strres={}
+
+def loadstrres(filename,lang):
+ xmlstr = dom.parse(filename)
+ strres[lang]={}
+ for xmld in xmlstr.childNodes:
+ for xmle in xmld.childNodes:
+ if xmle.nodeName == "string":
+ strname= xmle.getAttribute("name")
+ strdata = xmle.firstChild.data
+ strres[lang][strname]=strdata
+
+
+def main():
+
+ loadstrres("src/main/res/values/strings.xml","default")
+
+ faqdom = dom.parse("src/main/res/layout/faq.xml")
+ faq= genPage(faqdom,"default")
+
+ open(faqpath + "/FAQ.wiki","w").write(faq)
+
+ for directory in os.listdir("src/main/res"):
+ if directory.startswith("values-") and directory.find("-sw")==-1:
+ lang = directory.split("-",1)[1]
+ print lang
+ loadstrres("src/main/res/values-%s/strings.xml" % lang,lang)
+
+ langdir= "%s/%s" %(faqpath,lang)
+ if lang=="zh-rCN":
+ langdir= "%s/%s" %(faqpath,"zh-Hans")
+ elif lang=="zh-rTW":
+ langdir= "%s/%s" %(faqpath,"zh-Hant")
+
+
+ if not os.path.exists(langdir):
+ os.mkdir(langdir)
+
+ faq= genPage(faqdom,lang)
+ open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8"))
+
+ checkFormatString(lang)
+
+def checkFormatString(lang):
+ for strid in strres["default"]:
+ ostr = getString(strid,"default")
+ tstr = getString(strid,lang)
+
+
+ for f in ["%s", "%d", "%f"] + ["%%%d$s" % d for d in range(0,10)] + ["%%%d$d" % d for d in range(0,10)]:
+ ino = ostr.find(f)==-1
+ int = tstr.find(f)==-1
+
+ if ino != int:
+ print "Mismatch",strid,f,ostr,tstr
+
+if __name__=="__main__":
+ main()
diff --git a/ics-openvpn-stripped/main/misc/prepareovpn3.sh b/ics-openvpn-stripped/main/misc/prepareovpn3.sh
new file mode 100755
index 00000000..15982727
--- /dev/null
+++ b/ics-openvpn-stripped/main/misc/prepareovpn3.sh
@@ -0,0 +1,3 @@
+export O3=$PWD/openvpn3
+mkdir -p src/ovpn3/java/net/openvpn/ovpn3
+swig -outdir src/ovpn3/java/net/openvpn/ovpn3/ -c++ -java -package net.openvpn.ovpn3 -I$O3/client -I$O3 $O3/javacli/ovpncli.i \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/.mailmap b/ics-openvpn-stripped/main/openvpn/.mailmap
new file mode 100644
index 00000000..91ff5537
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/.mailmap
@@ -0,0 +1 @@
+James Yonan <james@openvpn.net> james <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
diff --git a/ics-openvpn-stripped/main/openvpn/.svncommitters b/ics-openvpn-stripped/main/openvpn/.svncommitters
new file mode 100644
index 00000000..0772102d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/.svncommitters
@@ -0,0 +1 @@
+james = James Yonan <james@openvpn.net>
diff --git a/ics-openvpn-stripped/main/openvpn/AUTHORS b/ics-openvpn-stripped/main/openvpn/AUTHORS
new file mode 100644
index 00000000..0f90aa2a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/AUTHORS
@@ -0,0 +1 @@
+James Yonan <jim@yonan.net>
diff --git a/ics-openvpn-stripped/main/openvpn/Android.mk b/ics-openvpn-stripped/main/openvpn/Android.mk
new file mode 100644
index 00000000..6dfe6777
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/Android.mk
@@ -0,0 +1,121 @@
+LOCAL_PATH:= $(call my-dir)/
+
+include $(CLEAR_VARS)
+
+LOCAL_LDLIBS := -lz
+LOCAL_C_INCLUDES := openssl/include lzo/include openssl/crypto openssl openvpn/src/compat openvpn/src/openvpn openvpn/include google-breakpad/src google-breakpad/src/common/android/include polarssl/include snappy
+
+
+
+
+LOCAL_CFLAGS= -DHAVE_CONFIG_H -DTARGET_ABI=\"${TARGET_ABI}\"
+LOCAL_STATIC_LIBRARIES := liblzo-static snappy-static
+
+ifeq ($(WITH_POLAR),1)
+LOCAL_STATIC_LIBRARIES += polarssl-static
+LOCAL_CFLAGS += -DENABLE_CRYPTO_POLARSSL=1
+else
+#LOCAL_SHARED_LIBRARIES := libssl libcrypto
+LOCAL_STATIC_LIBRARIES += libssl_static libcrypto_static
+LOCAL_CFLAGS += -DENABLE_CRYPTO_OPENSSL=1
+endif
+
+ifeq ($(WITH_BREAKPAD),1)
+LOCAL_STATIC_LIBRARIES += breakpad_client
+LOCAL_CFLAGS += -DGOOGLE_BREAKPAD=1
+endif
+
+LOCAL_MODULE = openvpn
+
+
+
+LOCAL_SRC_FILES:= \
+ src/compat/compat-basename.c \
+ src/compat/compat-daemon.c \
+ src/compat/compat-dirname.c \
+ src/compat/compat-gettimeofday.c \
+ src/compat/compat-inet_ntop.c \
+ src/compat/compat-inet_pton.c \
+ src/compat/compat-lz4.c \
+ src/openvpn/base64.c \
+ src/openvpn/buffer.c \
+ src/openvpn/clinat.c \
+ src/openvpn/console.c \
+ src/openvpn/crypto.c \
+ src/openvpn/crypto_openssl.c \
+ src/openvpn/crypto_polarssl.c \
+ src/openvpn/cryptoapi.c \
+ src/openvpn/dhcp.c \
+ src/openvpn/error.c \
+ src/openvpn/event.c \
+ src/openvpn/fdmisc.c \
+ src/openvpn/forward.c \
+ src/openvpn/fragment.c \
+ src/openvpn/gremlin.c \
+ src/openvpn/helper.c \
+ src/openvpn/httpdigest.c \
+ src/openvpn/init.c \
+ src/openvpn/interval.c \
+ src/openvpn/list.c \
+ src/openvpn/lladdr.c \
+ src/openvpn/lzo.c \
+ src/openvpn/manage.c \
+ src/openvpn/mbuf.c \
+ src/openvpn/misc.c \
+ src/openvpn/mroute.c \
+ src/openvpn/mss.c \
+ src/openvpn/mstats.c \
+ src/openvpn/mtcp.c \
+ src/openvpn/mtu.c \
+ src/openvpn/mudp.c \
+ src/openvpn/multi.c \
+ src/openvpn/ntlm.c \
+ src/openvpn/occ.c \
+ src/openvpn/openvpn.c \
+ src/openvpn/options.c \
+ src/openvpn/otime.c \
+ src/openvpn/packet_id.c \
+ src/openvpn/perf.c \
+ src/openvpn/pf.c \
+ src/openvpn/ping.c \
+ src/openvpn/pkcs11.c \
+ src/openvpn/pkcs11_openssl.c \
+ src/openvpn/platform.c \
+ src/openvpn/plugin.c \
+ src/openvpn/pool.c \
+ src/openvpn/proto.c \
+ src/openvpn/proxy.c \
+ src/openvpn/ps.c \
+ src/openvpn/push.c \
+ src/openvpn/reliable.c \
+ src/openvpn/route.c \
+ src/openvpn/schedule.c \
+ src/openvpn/session_id.c \
+ src/openvpn/shaper.c \
+ src/openvpn/sig.c \
+ src/openvpn/socket.c \
+ src/openvpn/socks.c \
+ src/openvpn/ssl.c \
+ src/openvpn/ssl_openssl.c \
+ src/openvpn/ssl_polarssl.c \
+ src/openvpn/ssl_verify.c \
+ src/openvpn/ssl_verify_openssl.c \
+ src/openvpn/ssl_verify_polarssl.c \
+ src/openvpn/status.c \
+ src/openvpn/tun.c \
+ src/openvpn/snappy.c \
+ src/openvpn/comp-lz4.c \
+ src/openvpn/comp.c \
+ src/openvpn/compstub.c \
+
+
+ifeq ($(WITH_BREAKPAD),1)
+LOCAL_SRC_FILES+=src/openvpn/breakpad.cpp
+endif
+
+
+include $(BUILD_SHARED_LIBRARY)
+#include $(BUILD_EXECUTABLE)
+
+
+
diff --git a/ics-openvpn-stripped/main/openvpn/COPYING b/ics-openvpn-stripped/main/openvpn/COPYING
new file mode 100644
index 00000000..f6e5c431
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/COPYING
@@ -0,0 +1,217 @@
+OpenVPN (TM) -- An Open Source VPN daemon
+
+Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+
+This distribution contains multiple components, some
+of which fall under different licenses. By using OpenVPN
+or any of the bundled components enumerated below, you
+agree to be bound by the conditions of the license for
+each respective component.
+
+OpenVPN trademark
+-----------------
+
+ "OpenVPN" is a trademark of OpenVPN Technologies, Inc.
+
+
+OpenVPN license:
+----------------
+
+ OpenVPN is distributed under the GPL license version 2 (see Below).
+
+ Special exception for linking OpenVPN with OpenSSL:
+
+ In addition, as a special exception, OpenVPN Technologies, Inc. gives
+ permission to link the code of this program with the OpenSSL
+ library (or with modified versions of OpenSSL that use the same
+ license as OpenSSL), and distribute linked combinations including
+ the two. You must obey the GNU General Public License in all
+ respects for all of the code used other than OpenSSL. If you modify
+ this file, you may extend this exception to your version of the
+ file, but you are not obligated to do so. If you do not wish to
+ do so, delete this exception statement from your version.
+
+LZO license:
+------------
+
+ LZO is Copyright (C) Markus F.X.J. Oberhumer,
+ and is licensed under the GPL.
+
+ Special exception for linking OpenVPN with both OpenSSL and LZO:
+
+ Hereby I grant a special exception to the OpenVPN project
+ (http://openvpn.net/) to link the LZO library with
+ the OpenSSL library (http://www.openssl.org).
+
+ Markus F.X.J. Oberhumer
+
+TAP-Win32/TAP-Win64 Driver license:
+-----------------------------------
+
+ This device driver was inspired by the CIPE-Win32 driver by
+ Damion K. Wilson.
+
+ The source and object code of the TAP-Win32/TAP-Win64 driver
+ is Copyright (C) 2002-2010 OpenVPN Technologies, Inc., and is released under
+ the GPL version 2.
+
+Windows DDK Samples:
+--------------------
+
+ The Windows binary distribution includes devcon.exe, a
+ Microsoft DDK sample which is redistributed under the terms
+ of the DDK EULA.
+
+NSIS License:
+-------------
+
+ Copyright (C) 2002-2003 Joost Verburg
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute
+ it freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented;
+ you must not claim that you wrote the original software.
+ If you use this software in a product, an acknowledgment in the
+ product documentation would be appreciated but is not required.
+ 2. Altered versions must be plainly marked as such,
+ and must not be misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any distribution.
+
+OpenSSL License:
+----------------
+
+ The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
+ See below for the actual license texts. Actually both licenses are BSD-style
+ Open Source licenses. In case of any license issues related to OpenSSL
+ please contact openssl-core@openssl.org.
+
+/* ====================================================================
+ * Copyright (c) 1998-2003 The OpenSSL 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. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS 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.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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 cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+GNU Public License (GPL)
+------------------------
+
+ OpenVPN, LZO, and the TAP-Win32 distributions are
+ licensed under the GPL version 2 (see COPYRIGHT.GPL).
+
+ In the Windows binary distribution of OpenVPN, the
+ GPL is reproduced below.
+
diff --git a/ics-openvpn-stripped/main/openvpn/COPYRIGHT.GPL b/ics-openvpn-stripped/main/openvpn/COPYRIGHT.GPL
new file mode 100644
index 00000000..ff8a7f00
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/COPYRIGHT.GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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 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
+
+
+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 Library General
+Public License instead of this License.
diff --git a/ics-openvpn-stripped/main/openvpn/ChangeLog b/ics-openvpn-stripped/main/openvpn/ChangeLog
new file mode 100644
index 00000000..7b945c80
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/ChangeLog
@@ -0,0 +1,4071 @@
+OpenVPN Change Log
+Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+
+2012.09.12 -- Version 2.3_beta1
+Arne Schwabe (7):
+ Fixes error: --key fails with EXTERNAL_PRIVATE_KEY: No such file or directory if --management-external-key is used
+ Merge almost identical create_socket_tcp and create_socket_tcp6
+ Document the inlining of files in openvpn and document key-direction
+ Merge getaddr_multi and getaddr6 into one function
+ Document --management-client and --management-signal a bit better
+ Document that keep alive will double the second value in server mode and give a short explanation why the value is chosen.
+ Add checks for external-key-managements
+
+David Sommerseth (1):
+ Fix reconnect issues when --push and UDP is used on the server
+
+Gert Doering (4):
+ Reduce --version string detail about IPv6 to just "[IPv6]".
+ Put actual OpenVPN command line on top of corresponding log file.
+ Keep pre-existing tun/tap devices around on *BSD
+ make "ipv6 ifconfig" on linux compatible with busybox ifconfig
+
+Heiko Hund (6):
+ fix regression with --http-proxy[-*] options
+ add x_msg_va() log function
+ add API for plug-ins to write to openvpn log
+ remove stale _openssl_get_subject() prototype
+ remove unused flag SSLF_NO_NAME_REMAPPING
+ Add --compat-names option
+
+2012.07.20 -- Version 2.3_alpha3
+Arne Schwabe (1):
+ Fix compiling with --disable-management
+
+Gert Doering (1):
+ Repair "tap server" mode brokenness caused by <stdbool.h> fallout
+
+Heiko Hund (4):
+ make non-blocking connect work on Windows
+ don't treat socket related errors special anymore
+ remove unused show_connection_list debug function
+ add option --management-query-proxy
+
+2012.06.29 -- Version 2.3_alpha2
+Adriaan de Jong (11):
+ Fixed off-by-one in serial length calculation
+ Migrated x509_get_subject to use of the garbage collector
+ Migrated x509_get_serial to use the garbage collector
+ Migrated x509_get_sha1_hash to use the garbage collector
+ Ensure sys/un.h autoconf detection includes sys/socket.h
+ Added support for new PolarSSL 1.1 RNG
+ Added a configuration option to enable prediction resistance in the PolarSSL random number generator.
+ Use POLARSSL_CFLAGS instead of POLARSSL_CRYPTO_CFLAGS in configure.ac
+ Removed support for PolarSSL < 1.1
+ Updated README.polarssl with build system changes.
+ Removed stray "Fox-IT hardening" string.
+
+Alon Bar-Lev (94):
+ build: version should not contain '-'
+ package: rpm: strip should be handled by package management
+ cleanup: options.c: remove redundant include
+ cleanup: remove C++ warnings
+ cleanup: win32.c: wrong printf format
+ cleanup: remove redundant ';'
+ cleanup: crypto_openssl.c: remove support for pre-openssl-0.9.6
+ cleanup: tun.c: fix incorrect option in message (ip-win32)
+ cleanup: memcmp.c: remove unused source
+ fixup: init.c: add missing conditional for ENABLE_CLIENT_CR
+ build: correct place to alter WINVER is at build system
+ Update .gitignore
+ build: handle printf style format in mingw
+ build: rename plugin directory to plugins
+ build: plugins: properly use CC, CFLAGS and LDFLAGS
+ build: we need the sample.ovpn in future
+ Remove install-win32
+ Remove easy-rsa
+ Remove tap-win32
+ cleanup: rename tap-windows function from win32 to win
+ build: remove windows specific build system
+ build: split acinclude.m4 into m4/*
+ build: m4/ax_varargs.m4: cleanup
+ build: m4/ax_emptyarray.m4: cleanup
+ build: m4/ax_socklen_t.m4: cleanup
+ build: autotools: first pass of trivial autotools changes
+ build: autoconf: remove OPENVPN_ADD_LIBS useless macro
+ build: remove awk and non-standard autoconf output processing
+ build: standard directory layout
+ build: add libtool + windows resources for executables
+ build: autoconf: commands as environment
+ build: libdl usage
+ build: properly detect and use socket libs
+ build: autoconf: minor cleanups
+ build: proper selinux detection and usage
+ build: distribute pkg.m4
+ build: proper pkcs11-helper detection and usage
+ build: properly process lzo-stub
+ build: proper lzo detection and usage
+ build: proper crypto detection and usage
+ build: autoconf: update defaults for options
+ build: win-msvc: msbuild format
+ build: move out config.h include from syshead
+ build: split out compat
+ build: move gettimeofday() emulation to compat
+ build: move daemon() emulation into compat
+ build: move inet_ntop(), inet_pton() emulation into compat
+ cleanup: move console related function into its own module
+ build: move wrappers into platform module
+ build: windows: install version.sh to allow installer read version
+ build: distribute samples in windows
+ build: use tap-windows.h as external dependency
+ build: ax_varargs.m4: fixups
+ build: autoconf: misc sockets fixups
+ build: enable lzo by default
+ build: windows: set vendor to openvpn project + cleanups
+ build: assume dlfcn is available on all supported platforms
+ build: openbsd: detect netinet/ip.h correctly
+ build: tap: search for tap header
+ build: msvc: upgrade to Visual Studio 2010 + fixups
+ Enable pedantic in windows compilation
+ cleanup: flags should not be bool
+ cleanup: avoid using ~0 - generic
+ cleanup: avoid using ~0 - ipv6
+ cleanup: avoid using ~0 - netmask
+ cleanup: avoid using ~0 - windows
+ cleanup: gc usage
+ build: fix some statement left from conversion
+ build: properly detect netinet/ip.h structs
+ build: properly detect TUNSETPERSIST
+ cleanup: plugin: support C++ plugin
+ cleanup: remove C++ comments
+ cleanup: add .gitattributes to control eol style explicitly
+ crash: packet_id_debug_print: sl may be null
+ build: use stdbool.h if available
+ build: fix typo in --enable-save-password
+ build: windows: convert resources to UTF-8
+ build: check minimum polarssl version
+ cleanup: update .gitignore
+ cleanup: spec: make space/tab consistent
+ build: spec: we support openssl >= 0.9.7
+ build: insall README* document using build system
+ build: detect sys/wait.h required for *bsd
+ build: add git revision to --version output if build from git repository
+ build: cleanup: yet another forgotten brackets
+ build: update INSTALL to recent changes
+ build: support platforms that does not need explicit tun headers
+ build: do not support <polarssl-1.1.0
+ build: add --with-special-build to provide special build string
+ cleanup: pkcs11.c: resolve wanings
+ build: integrate plugins build into core build
+ build: plugins: set defaults based on platform
+ cleanup: windows: convert argv (UCS-2 to UTF-8) at earliest
+ build: msvc: chdir with change drive to script location
+
+Arne Schwabe (7):
+ Add the query to the error message.
+ Explain that route-nopull also causes the client to ignore dhcp options.
+ Add the name of the context where option is not allowed to the error message.
+ Only use tmpdir if tmp_dir is really used.
+ Completely remove ancient IANA port warning.
+ Remove ENABLE_INLINE_FILES conditionals
+ Remove ENABLE_CONNECTIONS ifdefs
+
+David Sommerseth (5):
+ Clean-up: Presume that Linux is always IPv6 capable at build time
+ Simplify check_cmd_access() function
+ Change version to indicate the master branch is not a version
+ Some filesystems don't like ':', which is a path 'make dist' would use
+ Remove two unused functions
+
+Frank de Brabander (1):
+ Fix reported compile issues on OSX 10.6.8
+
+Gert Doering (10):
+ repair t_client.sh test after build system revolution
+ t_client.sh iproute2 script fixes
+ t_client.sh - fix for iproute2, print summary line
+ Implement search for "first free" tun/tap device on Solaris
+ cleanup and redefine metric handling for IPv6 routes
+ remove "*option" element in "struct route_ipv6"
+ Remove warning about explicit support for IPv6 support not provided MacOS X
+ Add missing pieces to IPv6 route gateway handling.
+ Update TODO.IPv6 list
+ Remove #include "config.h" from ssl_polarssl.h
+
+Heiko Hund (3):
+ remove wrapper code for Windows CryptoAPI function
+ fix warnings in event.c when building for win32-64
+ remove the --auto-proxy option from openvpn
+
+Igor Novgorodov (1):
+ Remove calls to OpenSSL when building with --disable-ssl
+
+Jonathan K. Bullard (2):
+ Fix file access checks on commands
+ Clarified the docs and help screen about what a 'cmd' is
+
+Samuli Seppänen (1):
+ Added notes about upgrading from 2.3-alpha1 and earlier to INSTALL-win32.txt
+
+2012.02.21 -- Version 2.3-alpha1
+Adriaan de Jong (127):
+ Added Doxygen doxyfile
+ Changed configure to accept --with-ssl-type=openssl
+ Refactored to rand_bytes for OpenSSL-independency
+ Refactored OpenSSL-specific constants
+ Refactored maximum cipher and hmac length constants
+ Refactored show_available_* functions
+ Refactored SSL_clear_error()
+ Refactored crypto initialisation functions
+ Refactored DES key manipulation functions
+ Refactored NTLM DES key generation
+ Refactored message digest type functions
+ Refactored message digest functions
+ Refactored HMAC functions
+ Refactored cipher key types
+ Refactored cipher functions
+ Added PRNG doxygen
+ Refactored: Moved crypto.h inline functions to end of file
+ Removed stale OpenSSL defines from crypto.h
+ Added a check for Openssl or PolarSSL defines
+ Refactored: Added stubs for new files
+ Refactored SSL initialisation functions
+ Refactored TLS_PRF to new hmac and md primitives
+ Refactored tls_show_available_ciphers
+ Refactored get_highest_preference_tls_cipher
+ Refactored root SSL context initialisation
+ Refactored new external key code
+ Refactored DH paramater loading
+ Refactored root TLS option settings
+ Refactored PKCS#12 key loading
+ Refactored PKCS#11 loading
+ Refactored windows cert loading
+ Refactored load certificate functions
+ Refactored private key loading code
+ Refactored external key loading from management
+ Refactored CA and extra certs code
+ Refactored cipher restriction code
+ Refactored tls_options, key_state, and key_source data structures
+ Refactored initalisation of key_states
+ Refactored key_state free code
+ Refactored print_details
+ Refactored key_state read code (including bio_read())
+ Refactored key_state write functions
+ Refactored: Moved BIO debug functions to OpenSSL backend
+ Refactored: removed ks and ks_lame macro for clarity
+ Refactored: moved write_empty_string function back
+ Refactored Doxygen for tls_multi functions
+ Migrated data structures needed by verification functions to ssl_common.h
+ Refactored client_config_dir_exclusive function
+ Refactored certificate hash lock checks
+ Refactored common name locking functions
+ Refactored username and password authentication code
+ Add some extra comments
+ Refactored: split verify_callback into two parts
+ Added function to extract and verify the subject from a certificate
+ Added function to verify and extract the username
+ Refactored: removed global x509_username_field
+ Refactored: separated environment setup during verification
+ Refactored: Netscape certificate type verification
+ Refactored key usage verification code
+ Refactored EKU verification
+ Refactored tls-remote checking
+ Refactored tls-verify-plugin code
+ Refactored tls-verify script code
+ Refactored CRL checks
+ Minor cleanup in verify_cert:
+ Refactored: Moved verify_cert to ssl_verify
+ Cleaned up ssl.h
+ Refactored: made M_SSL dependent on USE_OPENSSL
+ Refactored: renamed X509 functions from verify_*
+ Separated OpenSSL-specific parts of the PKCS#11 driver
+ Modified base64 code in preparation for PolarSSL merge
+ Final cleanup before PolarSSL addition:
+ Refactored X509 track feature to be contained within the openssl backend
+ Added PolarSSL support:
+ Fixed a missing include in ssl_backend.h
+ Fixed a bug in the hash generation in ssl_verify_openssl.c
+ Added SHA_DIGEST_SIZE definition
+ Changed PolarSSL crypto backend to support v0.99-pre5
+ Updated ssl_polarssl.c to work with 0.99-pre5
+ Fixed a compilation warning for size_t key sizes
+ Added a warning that the PolarSSL library does not support pkcs12 files.
+ Added warning that --capath is not available with PolarSSL
+ Disable CryptoAPI when not using OpenSSL, and document that fact.
+ Removed support for management external keys in PolarSSL
+ Removed stray X509_free from ssl.c
+ Refactored (and disabled for PolarSSL) support for writing external cert files in scripts
+ Added an extra define to allow building without PKCS#11
+ Added SSL library to title string
+ Disabled X.509 track and username selection for PolarSSL
+ Hardening: periodically reset the PRNG's nonce value
+ Fixes for the plugin system:
+ Further improvements to plugin support:
+ Fixed an unintentional change in the options calculated key size.
+ Moved print messages back to generic crypto.c from cipher backends
+ Moved HMAC prints back to main crypto module
+ Added back checks for ks->authenticated in verify_user_pass
+ Moved gc_new and gc_free to begin end of function
+ Fixed a bug in the return value of ssl_verify when pre_verify failed
+ Unified verification function return values:
+ Removed a stray Fox-IT tag
+ Fixed a typo: print the subject instead of the serial for verification errors
+ Made SSL_CIPHER const in print_details, to fix warning
+ Moved to PolarSSL 1.0.0:
+ Added missing #ifdef to allow --disable-managent to work again
+ Fixed disabling crypto and SSL
+ Got rid of a few magic numbers in ntlm.c
+ Removed obsolete des_cblock and des_keyschedule
+ Further removal of des_old.h based calls
+ Fixed missing comma in plugin.h
+ Moved prng_uninit out of crypto_uninit_lib
+ Moved CryptoAPI header include to the ssl_openssl.c
+ Reordered functions to ensure warning-free Windows build
+ Added options to switch between OpenSSL and PolarSSL and PKCS11...
+ Moved from strsep to strtok, for Windows compatibility
+ Minor cleanup to enable warning-free Windows build:
+ Fixed a typo when initialising cryptoapi certs
+ Minor code cleanup: cleaned up error handling in verify_cert.
+ Moved out of memory prototype to error.h, as the definition is in error.c
+ Removed support for calling gc_malloc with a NULL gc_arena struct
+
+ (The follwing patches from Adriaan was mistakenly merged with
+ the wrong commit author in the git tree)
+ Doxygen: Added data channel crypto docs
+ Added control channel crypto docs
+ Added compression docs
+ Added reliability layer documentation
+ Added memory management documentation
+ Added data channel fragmentation docs
+ Added main/control docs
+ Moved doxygen-specific files to a separate directory
+
+Byron Ellacott (1):
+ autoconf fixes for building on OSX
+
+David Sommerseth (50):
+ Provide 'dev_type' environment variable to plug-ins and script hooks
+ Define the new openvpn_plugin_{open,func}_v3() API
+ Implement the core v3 plug-in function calls.
+ Extend the v3 plug-in API to send over X509 certificates
+ Added a simple plug-in demonstrating the v3 plug-in API.
+ Separate the general plug-in version constant and v3 plug-in structs version
+ Use a version-less version identifier on the master branch
+ Fix the --client-cert-not-required feature
+ Change the default --tmp-dir path to a more suitable path
+ Improve the mysprintf() issue in openvpnserv.c
+ Add a simple comment regarding openvpn_snprintf() is duplicated
+ Merge branch 'feat_ipv6_transport'
+ Merge branch 'feat_ipv6_payload'
+ Merge branch 'svn-branch-2.1' into merge
+ Solved hidden merge conflicts between master and svn-branch-2.1
+ Fix const declarations in plug-in v3 structs
+ Merge remote-tracking branch 'cron2/feat_ipv6_payload_2.3'
+ Don't define ENABLE_PUSH_PEER_INFO if SSL is not available
+ Fix compiling issues with pkcs11 when --disable-management is configured
+ Remove support for Linux 2.2 configuration fallback
+ Revert "Add new openssl.cnf to easy-rsa/Windows"
+ Merge remote branch SVN 2.1 into the git tree
+ Merge branch 'svn-merger'
+ Fix Microsoft Visual Studio incompatibility in plugin.c
+ Fixed compile issues on FreeBSD and Solaris
+ Fix PolarSSL and --pkcs12 option issues
+ Fix FreeBSD/OpenBSD/NetBSD compiler warnings in get_default_gateway()
+ Make '--win-sys env' default
+ Do some file/directory tests before really starting openvpn
+ Fix bug after removing Linux 2.2 support
+ Don't look for 'stdin' file when using --auth-user-pass
+ Fix compiling with --disable-crypto and/or --disable-ssl
+ Fix a couple of issues in openvpn_execve()
+ Move away from openvpn_basename() over to platform provided basename()
+ Enable access() when building in Visual Studio
+ New Windows build fixes
+ Fix compilation errors on Linux platforms without SO_MARK
+ autotools ./configure don't like compat.h
+ Fix pool logging when IPv6 is not enabled
+ Don't check for file presence on inline files
+ Add --route-pre-down/OPENVPN_PLUGIN_ROUTE_PREDOWN script/plug-in hook
+ Enhance the error handling in _openssl_get_subject()
+ Fix assert() situations where gc_malloc() is called without a gc_arena object
+ Fix compile issues when plug-ins are disabled.
+ Remove --show-gateway if debug info is not enabled (--disable-debug)
+ Fix compile issues with status.c
+ Connection entry {tun,link}_mtu_defined not set correctly
+ Makefile.am referenced a now non-existing config-win32.h
+ Makefile.am was missing ssl_common.h
+ Revamp check_file_access() checks in stdin scenarios
+
+Davide Guerri (1):
+ New feauture: Add --stale-routes-check
+
+Frank de Brabander (1):
+ Fixed wrong return type of cipher_kt_mode
+
+Frederic Crozat (1):
+ Add support to forward console query to systemd
+
+Gert Doering (45):
+ Add more detailed explanation regarding the function of "--rdns-internal"
+ Enable IPv6 Payload in OpenVPN p2mp tun server mode. 20100104-1 release.
+ remove NOTES file from commit - private scribbling
+ NetBSD fixes - on 4.0 and up, use multi-af mode.
+ new feature: "ifconfig-ipv6-push" (from ccd/ config)
+ add some TODOs to TODO.IPv6
+ undo accidential duplication of existing "--iroute" line in the help text
+ basic documentation of IPv6 related options and their syntax
+ Enable IPv6 Payload in OpenVPN p2mp tun server mode.
+ remove NOTES file from commit - private scribbling
+ env_block(): if PATH is not set, add standard PATH setting to env
+ add IPv6 route add / route delete code for windows (using "netsh")
+ - Win32 IPv6 ifconfig support, using "netsh" calls
+ drop "book ipv6" from open_tun() and tuncfg() prototypes
+ document recent changes and open TODOs, adapt --version info, tag release
+ Win32: set next-hop for IPv6 routes according to TUN/TAP mode
+ when deleting a route on win32, also add gateway address
+ WIN32: if IPv6 requested in TUN mode, check if TUN/TAP driver < 9.7
+ revert unconditionally-enabling of setenv_es() logging
+ implement IPv6 ifconfig + route setup/deletion on OpenBSD
+ full "VPN client connect" test framework for OpenVPN t_client.rc-sample
+ renamed t_client.sh to t_client.sh.in
+ 2.2-beta3 has a signed TAP driver with the IPv6 code - test for 9.8
+ correct URL for "more information about IPv6 patch is *here*"
+ bugfix for linux/iproute2: IPv6 ifconfig code block was not called for "dev tun"+"topology subnet"
+ bump IPv6 version number (openvpn --version) to 20100922-1
+ Implement "ipv6 ifconfig" for TAP interfaces on Solaris interfaces
+ rebased to 2.2RC2 (beta 2.2 branch)
+ Windows IPv6 cleanup - properly remove IPv6 routes and interface config
+ For all accesses to "struct route_list * rl", check first that rl is non-NULL
+ Replace 32-bit-based add_in6_addr() implementation by an 8-bit based one
+ Platform cleanup for NetBSD
+ Move block for "stale-routes-check" config inside #ifdef P2MP_SERVER block
+ add missing break between "case IPv4" and "case IPv6"
+ bump tap driver version from 9.8 to 9.9
+ log error message and exit for "win32, tun mode, tap driver version 9.8"
+ work around inet_ntop/inet_pton problems for MSVC builds on WinXP
+ Fix build-up of duplicate IPv6 routes on reconnect.
+ Fix list-overrun checks in copy_route_[ipv6_]option_list()
+ add "print test titles" and "use sudo" functionality to t_client.rc
+ Platform cleanup for FreeBSD
+ Implement IPv6 interface config with non-/64 prefix lengths.
+ Fix RUN_SUDO functionality for t_client.sh
+ Document IPv6-related environment variables.
+ Platform cleanup for OpenBSD
+
+Gisle Vanem (1):
+ Avoid re-defining uint32_t when using mingw compiler
+
+Gustavo Zacarias (1):
+ Fix compile issues when using --enable-small and --disable-ssl/--disable-crypto
+
+Heiko Hund (16):
+ add .gitignore to official repository
+ remove function is_proto_tcp()
+ remove legacy code to query IE proxy information
+ lowercase include header name in syshead.h
+ define IN6_ARE_ADDR_EQUAL macro for WIN32
+ add --mark option to set SO_MARK sockopt
+ Windows UTF-8 input/output
+ UTF-8 X.509 distinguished names
+ set Windows environment variables as UCS-2
+ handle Windows unicode paths
+ replace check for TARGET_WIN32 with WIN32
+ do not use mode_t on Windows
+ use the underscore version of stat on Windows
+ make MSVC link against shell32 as well
+ move variable declaration to top of function
+ define access mode flag X_OK as 0 on Windows
+
+Igor Novgorodov (1):
+ The code blocks enabled by ENABLE_CLIENT_CR depends on management
+
+James Yonan (57):
+ Added "management-external-key" option.
+ Minor addition of logging info before and after execution of Windows net commands.
+ Misc fixes to r6708.
+ Added --x509-track option.
+ * added --management-up-down option to allow management interface to be notified of tunnel up/down events.
+ Fixed minor compile issue triggered on builds where MANAGEMENT_DEF_AUTH is not enabled.
+ Implemented get_default_gateway_mac_addr for Mac OS X
+ Fixes to r6925.
+ Properly handle certificate serial numbers > 32 bits.
+ Added "client-nat" option for stateless, one-to-one NAT on the client side.
+ Renamed branch to reflect that it is no longer beta.
+ env_filter_match now includes the serial number of all certs
+ Fixed issue where a client might receive multiple push replies from a server
+ Fixed bug introduced in r7031 that might cause this error message:
+ Extended "client-kill" management interface command (server-side)
+ Client will now try to reconnect if no push reply received within handshake-window seconds.
+ Version 2.1.3n
+ Fixed compiling issues when using --disable-crypto
+ Added "management-external-key" option.
+ Misc fixes to r6708.
+ win/sign.py now accepts an optional tap-dir argument.
+ Added "auth-token" client directive
+ Added ./configure --enable-osxipconfig option for Mac OS X
+ Added more packet ID debug info at debug level 3 for debugging false positive packet replays.
+ Fixed bug that incorrectly placed stricter TCP packet replay rules on UDP sessions
+ Fixed bug in port-share that could cause port share process to crash
+ For Mac OSX, when DARWIN_USE_IPCONFIG is defined, retry ipconfig command on failure
+ Version 2.1.3t
+ Revert r7092 and r7151, i.e. remove --enable-osxipconfig configure option.
+ Added 'dir' flag to "crl-verify" (see man page for info).
+ Added new "extra-certs" and "verify-hash" options
+ Fixed compile issues on Windows.
+ Added --enable-lzo-stub configure option to build an OpenVPN client without LZO
+ Added optional journal directory argument to "port-share" directive
+ Reduce log verbosity at level 3, with a focus on removing excessive log verbosity generated by port-share activity.
+ env_filter_match now includes the serial number of all certs in chain
+ Added support for static challenge/response protocol.
+ r7316 fixes.
+ Added redirect-gateway block-local flag, with support for Linux, Mac OS X
+ Extended x509-track to allow SHA1 certificate hash to be extracted
+ Added "management-query-remote" directive (client) to allow the management interface to override the "remote" directive.
+ Version 2.1.5.
+ Fixed MSVC compile error related to r7408.
+ Redact "echo" directive strings from log, since these strings (going forward) could conceivably contain security-sensitive data.
+ Modified sanitize_control_message to remove redacted data from control string rather than blotting it out with "_" chars.
+ Changed CC_PRINT character class to allow UTF-8 chars.
+ Increased the --verb threshold for "PID_ERR replay" messages to 4 from 3.
+ Fixed issue where redirect-gateway block-local code was not correctly calculating...
+ CC_PRINT character class now allows any 8-bit character value >= 32.
+ "status" management interface command (version >= 2) will now include the username for each connected user.
+ Minor fix to CC_PRINT char class
+ Fixed management interface bug where >FATAL notifications were not being output properly
+ Raised D_PID_DEBUG_LOW from level 3 to 4 to reduce replay error verbosity at level 3.
+ Added "memstats" option to maintain real-time operating stats in a memory-mapped file.
+ Fixed client issues with DHCP Router option extraction/deletion when using layer 2 with DHCP proxy:
+ Allow "tap-win32 dynamic <offset>" to be used in topology subnet mode.
+ Added support for "on-link" routes on Linux client
+
+Jan Just Keijser (1):
+ Made some options connection-entry specific
+
+Joe Patterson (1):
+ common_name passing in auth_pam plugin
+
+JuanJo Ciarlante (40):
+ * rebased openvpn-2.1_rc1b.jjo.20061206.d.patch
+ * created getaddr6(), use it from resolve_remote()
+ * migrated all getaddrinfo() to getaddr6
+ * socket.c: use USE_PF_INET6 in switch constructs to actually toss them out,
+ * support --disable-ipv6 build properly:
+ * important fix for tcp6 reconnection was incorrectly creating a PF_INET socket
+ * added README.ipv6.txt
+ * fixed win32 non-ipv6 build
+ * ipv6 on win32 "milestone": 1st snapshot that passes all unittests
+ * document ipv6 milestone status
+ * doc update w/unittests results
+ * make possible to x-compile openvpn/win32 in Linux
+ * correctly setup hints.ai_socktype for getaddrinfo(), althought sorta hacky, see TODO.ipv6.
+ * renamed README.ipv6{.txt,}
+ * updated {README,TODO}.ipv6 from feedback at openvpn-devel mlist
+ * init.c: document the ENABLE_MANAGEMENT place to work on
+ * init.c: small in-doc tweaks
+ * fix multi-tcp crash (corrected assertion)
+ * TODO.ipv6 update
+ * socket.c: better buf logic in print_sockaddr_ex
+ * fixed segfault for undef address family in print_sockaddr_ex (thanks Marcel!)
+ * doc updates
+ * openbsd: no IFF_MULTICAST, #ifdef around it
+ * no new funcionality, just small cleanups
+ * (prototype) fix for supporting "redirect-gateway" for tunneled ipv4 over ipv6 endpoints
+ * polished redirect-gateway (ipv4 on ipv6 endpoints) support
+ * updated doc
+ * fix --disable-ipv6 build
+ * doc updates
+ * rebased to v2.1.1 release
+ * undo mroute.c changes related to ipv6 payload
+ * fix --multihome for ipv4
+ * fix --multihome for ipv6
+ * ipv6-0.4.14: fix xinetd usage
+ * ipv6-0.4.15: add --multihome support to xBSD
+ * ipv6-0.4.15b: rebase over openvpn-testing-master
+ * ipv6-0.4.16: fix mingw32 build
+ * make ipv6_payload compile under windowze
+ USE_PF_INET6 by default for v2.3
+ fix ipv6 compilation under macosx >= 1070 - v3
+
+Markus Koetter (1):
+ Add extv3 X509 field support to --x509-username-field
+
+Matthew L. Creech (1):
+ Fix 2.2.0 build failure when management interface disabled
+
+Matthias Andree (1):
+ Skip rather than fail test in addressless FreeBSD jails.
+
+Robert Fischer (8):
+ Update man page with info about --capath
+ Update man page with info about --connect-timeout
+ Added info about --show-proxy-settings
+ Documented --x509-username-field option
+ Documented --errors-to-stderr option
+ Documented --push-peer-info option
+ Update man page with info about --remote-random-hostname
+ Added man page entry for --management-client
+
+Samuli Seppänen (19):
+ Add man page entry for --redirect-private
+ Change all CRLF linefeeds to LF linefeeds
+ Fix a bug in devcon source code handling
+ Removed Win2k from supported platforms list in INSTALL and win/openvpn.nsi
+ Fixed copying of tapinstall.exe to dist/bin when using prebuilt TAP-drivers
+ Fixed a bug with GUI icon deletion on upgrade from 2.2-RC or earlier
+ Fix a build-ca issue on Windows
+ Add new openssl.cnf to easy-rsa/Windows
+ Updated "easy-rsa" for OpenSSL 1.0.0
+ Made domake-win builds to use easy-rsa/2.0/openssl-1.0.0.cnf
+ Fixes to easy-rsa/2.0
+ Merged TODO.IPv6 with TODO.ipv6 and README.IPv6 with README.ipv6
+ Fixed a number of fatal build errors on Visual Studio 2008
+ Fix a Visual Studio 2008 build issue in socket.c
+ Additional Visual Studio 2008 build fixes to tun.c
+ Fixed a typo in win32.h that prevented building with Visual Studio
+ Fixed a regression causing VS2008/Python build failure
+ Fix a Visual Studio 2008 build error in tun.c
+ Fix a Visual Studio 2008 build error in options.c
+
+Simon Matter (1):
+ Fix issues with some older GCC compilers
+
+Stefan Hellermann (2):
+ plugin.h: update prototype of plugin_call dummy in !ENABLE_PLUGIN case
+ Fixed typo in plugin.h
+
+chantra (1):
+ Clarify --tmp-dir option
+
+smos (1):
+ Change the netsh.exe command from "add" to "set".
+
+2011.12.25 -- Version 2.x-master
+James Yonan (1):
+ Added support for "on-link" routes on Linux client -- these are
+ routes where the gateway is specified as an interface rather than
+ an address. This allows redirect-gateway to work on Linux clients
+ whose connection to the internet is via a point-to-point link
+ such as PPP.
+
+ Note that at the moment, this capability is incompatible with
+ the "redirect-gateway block-local" directive -- this is because
+ the block-local directive blocks all traffic from the local LAN
+ except for the local and gateway addresses. Since a PPP link
+ is essentially a subnet of two addresses, local and remote (i.e.
+ gateway), the set of addresses that would be blocked by block-local
+ is empty. Therefore, the "redirect-gateway block-local" directive
+ will be ignored on PPP links.
+
+ To view the OpenVPN client's current determination of the default
+ gateway, use this command:
+
+ ./openvpn --show-gateway
+
+2011.03.24 -- Version 2.2-RC2
+Alon Bar-Lev (1):
+ Windows cross-compile cleanup
+
+David Sommerseth (2):
+ Open log files as text files on Windows
+ Clarify default value for the --inactive option.
+
+Gert Doering (1):
+ Implement IPv6 in TUN mode for Windows TAP driver.
+
+Samuli Seppänen (6):
+ Added support for prebuilt TAP-drivers. Automated embedding manifests.
+ Fixes to win/openvpn.nsi
+ Replaced config-win32.h with win/config.h.in
+ Updated INSTALL-win32.txt
+ Fixes to Makefile.am
+ Clarified --client-config-dir section on the man-page.
+
+Ville Skyttä (1):
+ Fix line continuation in chkconfig init script description.
+
+2011.02.28 -- Version 2.2-RC
+David Sommerseth (3):
+ Make the --x509-username-field feature an opt-in feature
+ Fix compiler warning when compiling against OpenSSL 1.0.0
+ Fix packaging of config-win32.h and service-win32/msvc.mak
+
+James Yonan (1):
+ Minor addition of logging info before and after execution of Windows net commands.
+
+Matthias Andree (1):
+ Change variadic macros to C99 style.
+
+Samuli Seppänen (15):
+ Added ENABLE_PASSWORD_SAVE to config-win32.h
+ Added a nmake makefile for openvpnserv.exe building
+ Moved TAP-driver version info to version.m4. Cleaned up win/settings.in.
+ Added helper functionality to win/wb.py
+ Added support for viewing config-win32.h paramters to win/show.py
+ Added comments and made small modifications to win/msvc.mak.in
+ Added command-line switch to win/build_all.py to skip TAP driver building
+ Added configure.h and version.m4 variable parsing to win/config.py
+ Added openvpnserv.exe building to win/build.py
+ Added comments to win/build_ddk.py
+ Several modifications to win/make_dist.py to allow building the NSI installer
+ Copied install-win32/setpath.nsi to win/setpath.nsi
+ Added first version of NSI installer script to win/openvpn.nsi
+ Changes to buildsystem patchset
+ Temporary snprintf-related fix to service-win32/openvpnserv.c
+
+2010.11.25 -- Version 2.2-beta5
+
+Samuli Seppänen (1):
+ Fixed an issue causing a build failure with MS Visual Studio 2008.
+
+2010.11.18 -- Version 2.2-beta4
+
+David Sommerseth (10):
+ Clarified --explicit-exit-notify man page entry
+ Clean-up: Remove pthread and mutex locking code
+ Clean-up: Remove more dead and inactive code paths
+ Clean-up: Removing useless code - hash related functions
+ Use stricter snprintf() formatting in socks_username_password_auth() (v3)
+ Fix compiler warnings about not used dummy() functions
+ Fixed potential misinterpretation of boolean logic
+ Only add some functions when really needed
+ Removed functions not being used anywhere
+ Merged add_bypass_address() and add_host_route_if_nonlocal()
+
+Gert Doering (3):
+ Integrate support for TAP mode on Solaris, written by Kazuyoshi Aizawa <admin2@whiteboard.ne.jp>.
+ Make "topology subnet" work on Solaris
+ Improved man page entry for script_type
+
+James Yonan (5):
+ Fixed initialization bug in route_list_add_default_gateway (Gert Doering).
+ Implement challenge/response authentication support in client mode
+ Make base64.h have the same conditional compilation expression as base64.c.
+ Fixed compiling issues when using --disable-crypto
+ In verify_callback, the subject var should be freed by OPENSSL_free, not free
+
+Jesse Young (1):
+ Remove hardcoded path to resolvconf
+
+Lars Hupel (1):
+ Add HTTP/1.1 Host header
+
+Pierre Bourdon (1):
+ Adding support for SOCKS plain text authentication
+
+Samuli Seppänen (2):
+ Added check for variable CONFIGURE_DEFINES into options.c
+ Added command-line option parser and an unsigned build option to build_all.py
+
+2010.08.21 -- Version 2.2-beta3
+
+* Attempt to fix issue where domake-win build system was not properly
+ signing drivers and .exe files.
+
+ Added win/tap_span.py for building multiple versions of the TAP driver
+ and tapinstall binaries using different DDK versions to span from Win2K
+ to Win7 and beyond.
+
+* Community patches
+ David Sommerseth (2):
+ Test framework improvment - Do not FAIL if t_client.rc is missing
+ More t_client.sh updates - exit with SKIP when we want to skip
+
+ Gert Doering (4):
+ Fix compile problems on NetBSD and OpenBSD
+ Fix <net/if.h> compile time problems on OpenBSD for good
+ full "VPN client connect" test framework for OpenVPN
+ Build t_client.sh by configure at run-time.
+
+ chantra (1):
+ Fixes openssl-1.0.0 compilation warning
+
+2010.08.16 -- Version 2.2-beta2
+
+* Windows security issue:
+ Fixed potential local privilege escalation vulnerability in
+ Windows service. The Windows service did not properly quote the
+ executable filename passed to CreateService. A local attacker
+ with write access to the root directory C:\ could create an
+ executable that would be run with the same privilege level as
+ the OpenVPN Windows service. However, since non-Administrative
+ users normally lack write permission on C:\, this vulnerability
+ is generally not exploitable except on older versions of Windows
+ (such as Win2K) where the default permissions on C:\ would allow
+ any user to create files there.
+ Credit: Scott Laurie, MWR InfoSecurity
+
+* Added Python-based based alternative build system for Windows using
+ Visual Studio 2008 (in win directory).
+
+* When aborting in a non-graceful way, try to execute do_close_tun in
+ init.c prior to daemon exit to ensure that the tun/tap interface is
+ closed and any added routes are deleted.
+
+* Fixed an issue where AUTH_FAILED was not being properly delivered
+ to the client when a bad password is given for mid-session reauth,
+ causing the connection to fail without an error indication.
+
+* Don't advance to the next connection profile on AUTH_FAILED errors.
+
+* Fixed an issue in the Management Interface that could cause
+ a process hang with 100% CPU utilization in --management-client
+ mode if the management interface client disconnected at the
+ point where credentials are queried.
+
+* Fixed an issue where if reneg-sec was set to 0 on the client,
+ so that the server-side value would take precedence,
+ the auth_deferred_expire_window function would incorrectly
+ return a window period of 0 seconds. In this case, the
+ correct window period should be the handshake window
+ period.
+
+* Modified ">PASSWORD:Verification Failed" management interface
+ notification to include a client reason string:
+
+ >PASSWORD:Verification Failed: 'AUTH_TYPE' ['REASON_STRING']
+
+* Enable exponential backoff in reliability layer
+ retransmits.
+
+* Set socket buffers (SO_SNDBUF and SO_RCVBUF) immediately after
+ socket is created rather than waiting until after connect/listen.
+
+* Management interface performance optimizations:
+
+ 1. Added env-filter MI command to perform filtering on env vars
+ passed through as a part of --management-client-auth
+
+ 2. man_write will now try to aggregate output into larger blocks
+ (up to 1024 bytes) for more efficient i/o
+
+* Fixed minor issue in Windows TAP driver DEBUG builds
+ where non-null-terminated unicode strings were being
+ printed incorrectly.
+
+* Fixed issue on Windows with MSVC compiler, where TCP_NODELAY support
+ was not being compiled in.
+
+* Proxy improvements:
+
+ Improved the ability of http-auth "auto" flag to dynamically detect
+ the auth method required by the proxy.
+
+ Added http-auth "auto-nct" flag to reject weak proxy auth methods.
+
+ Added HTTP proxy digest authentication method.
+
+ Removed extraneous openvpn_sleep calls from proxy.c.
+
+* Implemented http-proxy-override and http-proxy-fallback directives to make it
+ easier for OpenVPN client UIs to start a pre-existing client config file with
+ proxy options, or to adaptively fall back to a proxy connection if a direct
+ connection fails.
+
+* Implemented a key/value auth channel from client to server.
+
+* Fixed issue where bad creds provided by the management interface
+ for HTTP Proxy Basic Authentication would go into an infinite
+ retry-fail loop instead of requerying the management interface for
+ new creds.
+
+* Added support for MSVC debugging of openvpn.exe in settings.in:
+
+ # Build debugging version of openvpn.exe
+ !define PRODUCT_OPENVPN_DEBUG
+
+* Implemented multi-address DNS expansion on the network field of route
+ commands.
+
+ When only a single IP address is desired from a multi-address DNS
+ expansion, use the first address rather than a random selection.
+
+* Added --register-dns option for Windows.
+
+ Fixed some issues on Windows with --log, subprocess creation
+ for command execution, and stdout/stderr redirection.
+
+* Fixed an issue where application payload transmissions on the
+ TLS control channel (such as AUTH_FAILED) that occur during
+ or immediately after a TLS renegotiation might be dropped.
+
+* Added warning about tls-remote option in man page.
+
+2009.12.11 -- Version 2.1.1
+
+* Fixed some breakage in openvpn.spec (which is required to build an
+ RPM distribution) where it was referencing a non-existent
+ subdirectory in the tarball, causing it to fail (patch from
+ David Sommerseth).
+
+2009.12.11 -- Version 2.1.0
+
+* Fixed a couple issues in sample plugins auth-pam.c and down-root.c.
+ (1) Fail gracefully rather than segfault if calloc returns NULL.
+ (2) The openvpn_plugin_abort_v1 function can potentially be called
+ with handle == NULL. Add code to detect this case, and if so, avoid
+ dereferencing pointers derived from handle (Thanks to David
+ Sommerseth for finding this bug).
+
+* Documented "multihome" option in the man page.
+
+2009.11.20 -- Version 2.1_rc22
+
+* Fixed a client-side bug on Windows that occurred when the
+ "dhcp-pre-release" or "dhcp-renew" options were combined with
+ "route-gateway dhcp". The release/renew would not occur
+ because the Windows DHCP renew function is blocking and
+ therefore must be called from another process or thread
+ so as not to stall the tunnel.
+
+* Added a hard failure when peer provides a certificate chain
+ with depth > 16. Previously, a warning was issued.
+
+2009.11.12 -- Version 2.1_rc21
+
+* Rebuilt OpenVPN Windows installer with OpenSSL 0.9.8l to address
+ CVE-2009-3555. Note that OpenVPN has never relied on the session
+ renegotiation capabilities that are built into the SSL/TLS protocol,
+ therefore the fix in OpenSSL 0.9.8l (disable SSL/TLS renegotiation
+ completely) will not adversely affect OpenVPN mid-session SSL/TLS
+ renegotation or any other OpenVPN capabilities.
+
+* Added additional session renegotiation hardening. OpenVPN has always
+ required that mid-session renegotiations build up a new SSL/TLS
+ session from scratch. While the client certificate common name is
+ already locked against changes in mid-session TLS renegotiations, we
+ now extend this locking to the auth-user-pass username as well as all
+ certificate content in the full client certificate chain.
+
+2009.10.01 -- Version 2.1_rc20
+
+* Fixed a bug introduced in 2.1_rc17 (svn r4436) where using the
+ redirect-gateway option by itself, without any extra parameters,
+ would cause the option to be ignored.
+
+* Fixed build problem when ./configure --disable-server is used.
+
+* Fixed ifconfig command for "topology subnet" on FreeBSD (Stefan Bethke).
+
+* Added --remote-random-hostname option.
+
+* Added "load-stats" management interface command to get global server
+ load statistics.
+
+* Added new ./configure flags:
+
+ --disable-def-auth Disable deferred authentication
+ --disable-pf Disable internal packet filter
+
+* Added "setcon" directive for interoperability with SELinux (Sebastien
+ Raveau).
+
+* Optimized PUSH_REQUEST handshake sequence to shave several seconds
+ off of a typical client connection initiation.
+
+* The maximum number of "route" directives (specified in the config
+ file or pulled from a server) can now be configured via the new
+ "max-routes" directive.
+
+* Eliminated the limitation on the number of options that can be pushed
+ to clients, including routes. Previously, all pushed options needed
+ to fit within a 1024 byte options string.
+
+* Added --server-poll-timeout option : when polling possible remote
+ servers to connect to in a round-robin fashion, spend no more than
+ n seconds waiting for a response before trying the next server.
+
+* Added the ability for the server to provide a custom reason string
+ when an AUTH_FAILED message is returned to the client. This
+ string can be set by the server-side managment interface and read
+ by the client-side management interface.
+
+* client-kill management interface command, when issued on server, will
+ now send a RESTART message to client.
+ This feature is intended to make UDP clients respond the same as TCP
+ clients in the case where the server issues a RESTART message in
+ order to force the client to reconnect and pull a new options/route
+ list.
+
+2009.07.16 -- Version 2.1_rc19
+
+* In Windows TAP driver, refactor DHCP/ARP packet injection code to
+ use a DPC (deferred procedure call) to defer packet injection until
+ IRQL < DISPATCH_LEVEL, rather than calling NdisMEthIndicateReceive
+ in the context of AdapterTransmit. This is an attempt to reduce kernel
+ stack usage, and prevent EXCEPTION_DOUBLE_FAULT BSODs that have been
+ observed on Vista. Updated TAP driver version number to 9.6.
+
+* In configure.ac, use datadir instead of datarootdir for compatibility
+ with <autoconf-2.60.
+
+2009.06.07 -- Version 2.1_rc18
+
+* Fixed compile error on ./configure --enable-small
+
+* Fixed issue introduced in r4475 (2.1-rc17) where cryptoapi.c change
+ does not build on Windows on non-MINGW32.
+
+2009.05.30 -- Version 2.1_rc17
+
+* Reduce the debug level (--verb) at which received management interface
+ commands are echoed from 7 to 3. Passwords will be filtered.
+
+* Fixed race condition in management interface recv code on
+ Windows, where sending a set of several commands to the
+ management interface in quick succession might cause the
+ latter commands in the set to be ignored.
+
+* Increased management interface input command buffer size
+ from 256 to 1024 bytes.
+
+* Minor tweaks to Windows build system.
+
+* Added "redirect-private" option which allows private subnets
+ to be pushed to the client in such a way that they don't accidently
+ obscure critical local addresses such as the DHCP server address and
+ DNS server addresses.
+
+* Added new 'autolocal' redirect-gateway flag. When enabled, the OpenVPN
+ client will examine the routing table and determine whether (a) the
+ OpenVPN server is reachable via a locally connected interface, or (b)
+ traffic to the server must be forwarded through the default router.
+ Only add a special bypass route for the OpenVPN server if (b) is true.
+ If (a) is true, behave as if the 'local' flag is specified, and do not
+ add a bypass route.
+
+ The new 'autolocal' flag depends on the non-portable test_local_addr()
+ function in route.c, which is currently only implemented for Windows.
+ The 'autolocal' flag will act as a no-op on platforms that have not
+ yet defined a test_local_addr() function.
+
+* Increased TLS_CHANNEL_BUF_SIZE to 2048 from 1024 (this will allow for
+ more option content to be pushed from server to client).
+
+* Raised D_MULTI_DROPPED debug level to 4 from 3 to filter out (at debug
+ levels <=3) a common and usually innocuous warning.
+
+* Fixed issue of symbol conflicts interfering with Windows CryptoAPI
+ functionality (Alon Bar-Lev).
+
+* Fixed bug where the remote_X environmental variables were not being
+ set correctly when the 'local' option is specifed.
+
+2009.05.17 -- Version 2.1_rc16
+
+* Windows installer changes:
+
+ 1. ifdefed out the check Windows version code which is causing
+ problems on Windows 7
+
+ 2. don't define SF_SELECTED if it is already defined
+
+ 3. Use LZMA instead of BZIP2 compression for better compression
+
+ 4. Upgraded OpenSSL to 0.9.8k
+
+* Added the ability to read the configuration file
+ from stdin, when "stdin" is given as the config
+ file name.
+
+* Allow "management-client" directive to be used
+ with unix domain sockets.
+
+* Added errors-to-stderr option. When enabled, fatal errors
+ that result in the termination of the daemon will be written
+ to stderr.
+
+* Added optional "nogw" (no gateway) flag to --server-bridge
+ to inhibit the pushing of the route-gateway parameter to
+ clients.
+
+* Added new management interface command "pid" to show the
+ process ID of the current OpenVPN process (Angelo Laub).
+
+* Fixed issue where SIGUSR1 restarts would fail if private
+ key was specified as an inline file.
+
+* Added daemon_start_time and daemon_pid environmental variables.
+
+* In management interface, added new ">CLIENT:ESTABLISHED" notification.
+
+* Build fixes:
+
+ 1. Fixed some issues with C++ style comments that leaked into the code.
+
+ 2. Updated configure.ac to work on MinGW64.
+
+ 3. Updated common.h types for _WIN64.
+
+ 4. Fixed issue involving an #ifdef in a macro reference that breaks early gcc
+ compilers.
+
+ 5. In cryptoapi.c, renamed CryptAcquireCertificatePrivateKey to
+ OpenVPNCryptAcquireCertificatePrivateKey to work around
+ a symbol conflict in MinGW-5.1.4.
+
+2008.11.19 -- Version 2.1_rc15
+
+* Fixed issue introduced in 2.1_rc14 that may cause a
+ segfault when a --plugin module is used.
+
+* Added server-side --opt-verify option: clients that connect
+ with options that are incompatible with those of the server
+ will be disconnected (without this option, incompatible
+ clients would trigger a warning message in the server log
+ but would not be disconnected).
+
+* Added --tcp-nodelay option: Macro that sets TCP_NODELAY socket
+ flag on the server as well as pushes it to connecting clients.
+
+* Minor options check fix: --no-name-remapping is a
+ server-only option and should therefore generate an
+ error when used on the client.
+
+* Added --prng option to control PRNG (pseudo-random
+ number generator) parameters. In previous OpenVPN
+ versions, the PRNG was hardcoded to use the SHA1
+ hash. Now any OpenSSL hash may be used. This is
+ part of an effort to remove hardcoded references to
+ a specific cipher or cryptographic hash algorithm.
+
+* Cleaned up man page synopsis.
+
+2008.11.16 -- Version 2.1_rc14
+
+* Added AC_GNU_SOURCE to configure.ac to enable struct ucred,
+ with the goal of fixing a build issue on Fedora 9 that was
+ introduced in 2.1_rc13.
+
+* Added additional method parameter to --script-security to preserve
+ backward compatibility with system() call semantics used in OpenVPN
+ 2.1_rc8 and earlier. To preserve backward compatibility use:
+
+ script-security 3 system
+
+* Added additional warning messages about --script-security 2
+ or higher being required to execute user-defined scripts or
+ executables.
+
+* Windows build system changes:
+
+ Modified Windows domake-win build system to write all openvpn.nsi
+ input files to gen, so that gen can be disconnected from
+ the rest of the source tree and makensis openvpn.nsi will
+ still function correctly.
+
+ Added additional SAMPCONF_(CA|CRT|KEY) macros to settings.in
+ (commented out by default).
+
+ Added optional files SAMPCONF_CONF2 (second sample configuration
+ file) and SAMPCONF_DH (Diffie-Helman parameters) to Windows
+ build system, and may be defined in settings.in.
+
+* Extended Management Interface "bytecount" command
+ to work when OpenVPN is running as a server.
+ Documented Management Interface "bytecount" command in
+ management/management-notes.txt.
+
+* Fixed informational message in ssl.c to properly indicate
+ deferred authentication.
+
+* Added server-side --auth-user-pass-optional directive, to allow
+ connections by clients that do not specify a username/password, when a
+ user-defined authentication script/module is in place (via
+ --auth-user-pass-verify, --management-client-auth, or a plugin module).
+
+* Changes to easy-rsa/2.0/pkitool and related openssl.cnf:
+
+ Calling scripts can set the KEY_NAME environmental variable to set
+ the "name" X509 subject field in generated certificates.
+
+ Modified pkitool to allow flexibility in separating the Common Name
+ convention from the cert/key filename convention.
+
+ For example:
+
+ KEY_CN="James's Laptop" KEY_NAME="james" ./pkitool james
+
+ will create a client certificate/key pair of james.crt/james.key
+ having a Common Name of "James's Laptop" and a Name of "james".
+
+* Added --no-name-remapping option to allow Common Name, X509 Subject,
+ and username strings to include any printable character including
+ space, but excluding control characters such as tab, newline, and
+ carriage-return (this is important for compatibility with external
+ authentication systems).
+
+ As a related change, added --status-version 3 format (and "status 3"
+ in the management interface) which uses the version 2 format except
+ that tabs are used as delimiters instead of commas so that there
+ is no ambiguity when parsing a Common Name that contains a comma.
+
+ Also, save X509 Subject fields to environment, using the naming
+ convention:
+
+ X509_{cert_depth}_{name}={value}
+
+ This is to avoid ambiguities when parsing out the X509 subject string
+ since "/" characters could potentially be used in the common name.
+
+* Fixed some ifconfig-pool issues that precluded it from being combined
+ with --server directive.
+
+ Now, for example, we can configure thusly:
+
+ server 10.8.0.0 255.255.255.0 nopool
+ ifconfig-pool 10.8.0.2 10.8.0.99 255.255.255.0
+
+ to have ifconfig-pool manage only a subset
+ of the VPN subnet.
+
+* Added config file option "setenv FORWARD_COMPATIBLE 1" to relax
+ config file syntax checking to allow directives for future OpenVPN
+ versions to be ignored.
+
+2008.10.07 -- Version 2.1_rc13
+
+* Bundled OpenSSL 0.9.8i with Windows installer.
+
+* Management interface can now listen on a unix
+ domain socket, for example:
+
+ management /tmp/openvpn unix
+
+ Also added management-client-user and management-client-group
+ directives to control which processes are allowed to connect
+ to the socket.
+
+* Copyright change to OpenVPN Technologies, Inc.
+
+2008.09.23 -- Version 2.1_rc12
+
+* Patched Makefile.am so that the new t_cltsrv-down.sh script becomes
+ part of the tarball (Matthias Andree).
+
+* Fixed --lladdr bug introduced in 2.1-rc9 where input validation code
+ was incorrectly expecting the lladdr parameter to be an IP address
+ when it is actually a MAC address (HoverHell).
+
+2008.09.14 -- Version 2.1_rc11
+
+* Fixed a bug that can cause SSL/TLS negotiations in UDP mode
+ to fail if UDP packets are dropped.
+
+2008.09.10 -- Version 2.1_rc10
+
+* Added "--server-bridge" (without parameters) to enable
+ DHCP proxy mode: Configure server mode for ethernet
+ bridging using a DHCP-proxy, where clients talk to the
+ OpenVPN server-side DHCP server to receive their IP address
+ allocation and DNS server addresses.
+
+* Added "--route-gateway dhcp", to enable the extraction
+ of the gateway address from a DHCP negotiation with the
+ OpenVPN server-side LAN.
+
+* Fixed minor issue with --redirect-gateway bypass-dhcp or bypass-dns
+ on Windows. If the bypass IP address is 0.0.0.0 or 255.255.255.255,
+ ignore it.
+
+* Warn when ethernet bridging that the IP address of the bridge adapter
+ is probably not the same address that the LAN adapter was set to
+ previously.
+
+* When running as a server, warn if the LAN network address is
+ the all-popular 192.168.[0|1].x, since this condition commonly
+ leads to subnet conflicts down the road.
+
+* Primarily on the client, check for subnet conflicts between
+ the local LAN and the VPN subnet.
+
+* Added a 'netmask' parameter to get_default_gateway, to return
+ the netmask of the adapter containing the default gateway.
+ Only implemented on Windows so far. Other platforms will
+ return 255.255.255.0. Currently the netmask information is
+ only used to warn about subnet conflicts.
+
+* Minor fix to cryptoapi.c to not compile itself unless USE_CRYPTO
+ and USE_SSL flags are enabled (Alon Bar-Lev).
+
+* Updated openvpn/t_cltsrv.sh (used by "make check") to conform to new
+ --script-security rules. Also adds retrying if the addresses are in
+ use (Matthias Andree).
+
+* Fixed build issue with ./configure --disable-socks --disable-http.
+
+* Fixed separate compile errors in options.c and ntlm.c that occur
+ on strict C compilers (such as old versions of gcc) that require
+ that C variable declarations occur at the start of a {} block,
+ not in the middle.
+
+* Workaround bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8, which
+ the new implementation of extract_x509_field_ssl depends on.
+
+* LZO compression buffer overflow errors will now invalidate
+ the packet rather than trigger a fatal assertion.
+
+* Fixed minor compile issue in ntlm.c (mid-block declaration).
+
+* Added --allow-pull-fqdn option which allows client to pull DNS names
+ from server (rather than only IP address) for --ifconfig, --route, and
+ --route-gateway. OpenVPN versions 2.1_rc7 and earlier allowed DNS names
+ for these options to be pulled and translated to IP addresses by default.
+ Now --allow-pull-fqdn will be explicitly required on the client to enable
+ DNS-name-to-IP-address translation of pulled options.
+
+* 2.1_rc8 and earlier did implicit shell expansion on script
+ arguments since all scripts were called by system().
+ The security hardening changes made to 2.1_rc9 no longer
+ use system(), but rather use the safer execve or CreateProcess
+ system calls. The security hardening also introduced a
+ backward incompatibility with 2.1_rc8 and earlier in that
+ script parameters were no longer shell-expanded, so
+ for example:
+
+ client-connect "docc CLIENT-CONNECT"
+
+ would fail to work because execve would try to execute
+ a script called "docc CLIENT-CONNECT" instead of "docc"
+ with "CLIENT-CONNECT" as the first argument.
+
+ This patch fixes the issue, bringing the script argument
+ semantics back to pre 2.1_rc9 behavior in order to preserve
+ backward compatibility while still using execve or CreateProcess
+ to execute the script/executable.
+
+* Modified ip_or_dns_addr_safe, which validates pulled DNS names,
+ to more closely conform to RFC 3696:
+
+ (1) DNS name length must not exceed 255 characters
+
+ (2) DNS name characters must be limited to alphanumeric,
+ dash ('-'), and dot ('.')
+
+* Fixed bug in intra-session TLS key rollover that was introduced with
+ deferred authentication features in 2.1_rc8.
+
+2008.07.31 -- Version 2.1_rc9
+
+* Security Fix -- affects non-Windows OpenVPN clients running
+ OpenVPN 2.1-beta14 through 2.1-rc8 (OpenVPN 2.0.x clients are NOT
+ vulnerable nor are any versions of the OpenVPN server vulnerable).
+ An OpenVPN client connecting to a malicious or compromised
+ server could potentially receive an "lladdr" or "iproute" configuration
+ directive from the server which could cause arbitrary code execution on
+ the client. A successful attack requires that (a) the client has agreed
+ to allow the server to push configuration directives to it by including
+ "pull" or the macro "client" in its configuration file, (b) the client
+ successfully authenticates the server, (c) the server is malicious or has
+ been compromised and is under the control of the attacker, and (d) the
+ client is running a non-Windows OS. Credit: David Wagner.
+ CVE-2008-3459
+
+* Miscellaneous defensive programming changes to multiple
+ areas of the code. In particular, use of the system() call
+ for calling executables such as ifconfig, route, and
+ user-defined scripts has been completely revamped in favor
+ of execve() on unix and CreateProcess() on Windows.
+
+* In Windows build, package a statically linked openssl.exe to work around
+ observed instabilities in the dynamic build since the migration to
+ OpenSSL 0.9.8h.
+
+2008.06.11 -- Version 2.1_rc8
+
+* Added client authentication and packet filtering capability
+ to management interface. In addition, allow OpenVPN plugins
+ to take advantage of deferred authentication and packet
+ filtering capability.
+
+* Added support for client-side connection profiles.
+
+* Fixed unbounded memory growth bug in environmental variable
+ code that could have caused long-running OpenVPN sessions
+ with many TLS renegotiations to incrementally
+ increase memory usage over time.
+
+* Windows release now packages openssl-0.9.8h.
+
+* Build system changes -- allow building on Windows using
+ autoconf/automake scripts (Alon Bar-Lev).
+
+* Changes to Windows build system to make it easier to do
+ partial builds, with a reduced set of prerequisites,
+ where only a subset of OpenVPN installer
+ components are built. See ./domake-win comments.
+
+* Cleanup IP address for persistence interfaces for tap and also
+ using ifconfig, gentoo#209055 (Alon Bar-Lev).
+
+* Fall back to old version of extract_x509_field for OpenSSL 0.9.6.
+
+* Clarified tcp-queue-limit man page entry (Matti Linnanvuori).
+
+* Added new OpenVPN icon and installer graphic.
+
+* Minor pkitool changes.
+
+* Added --pkcs11-id-management option, which will cause OpenVPN to
+ query the management interface via the new NEED-STR asynchronous
+ notification query to get additional PKCS#11 options (Alon Bar-Lev).
+
+* Added NEED-STR management interface asynchronous query and
+ "needstr" management interface command to respond to the query
+ (Alon Bar-Lev).
+
+* Added Dragonfly BSD support (Francis-Gudin).
+
+* Quote device names before passing to up/down script (Josh Cepek).
+
+* Bracketed struct openvpn_pktinfo with #pragma pack(1) to
+ prevent structure padding from causing an incorrect length
+ to be returned by sizeof (struct openvpn_pktinfo) on 64-bit
+ platforms.
+
+* On systems that support res_init, always call it
+ before calling gethostbyname to ensure that
+ resolver configuration state is current.
+
+* Added NTLMv2 proxy support (Miroslav Zajic).
+
+* Fixed an issue in extract_x509_field_ssl where the extraction
+ would fail on the first field of the subject name, such as
+ the common name in: /CN=foo/emailAddress=foo@bar.com
+
+* Made "Linux ip addr del failed" error nonfatal.
+
+* Amplified --client-cert-not-required warning.
+
+* Added #pragma pack to proto.h.
+
+2008.01.29 -- Version 2.1_rc7
+
+* Added a few extra files that exist in the svn repo but were
+ not being copied into the tarball by make dist.
+
+* Fixup null interface on close, don't use ip addr flush (Alon Bar-Lev).
+
+2008.01.24 -- Version 2.1_rc6
+
+* Fixed options checking bug introduced in rc5 where legitimate configuration
+ files might elicit the error: "Options error: Parameter pkcs11_private_mode
+ can only be specified in TLS-mode, i.e. where --tls-server or --tls-client
+ is also specified."
+
+2008.01.23 -- Version 2.1_rc5
+
+* Fixed Win2K TAP driver bug that was introduced by Vista fixes,
+ incremented driver version to 9.4.
+
+* Windows build system changes:
+
+ Incremented included OpenSSL version to openssl-0.9.7m.
+
+ Updated openssl.patch for openssl-0.9.7m and added some
+ brief usage comments to the head of the patch.
+
+ Added build-pkcs11-helper.sh for building the pkcs11-helper
+ library.
+
+ Integrated inclusion of pkcs11-helper into Windows build
+ system.
+
+ Upgraded TAP build scripts to use WDK 6001.17121
+ (Windows 2008 Server pre-RTM).
+
+* Windows installer changes:
+
+ Clean up the start menu folder.
+
+ Allow for a site-specific sample configuration file and keys
+ to be included in a custom installer (see SAMPCONF macros
+ in settings.in).
+
+ New icon (temporary).
+
+* Added "forget-passwords" command to the management interface
+ (Alon Bar-Lev).
+
+* Added --management-signal option to signal SIGUSR1 when the
+ management interface disconnects (Alon Bar-Lev).
+
+* Modified command line and config file parser to allow
+ quoted strings using single quotes ('') (Alon Bar-Lev).
+
+* Use pkcs11-helper as external library, can be downloaded from
+ https://www.opensc-project.org/pkcs11-helper (Alon Bar-Lev).
+
+* Fixed interim memory growth issue in TCP connect loop where
+ "TCP: connect to %s failed, will try again in %d seconds: %s"
+ is output.
+
+* Fixed bug in epoll driver in event.c, where the lack of a
+ handler for EPOLLHUP could cause 99% CPU usage.
+
+* Defined ALLOW_NON_CBC_CIPHERS for people who don't
+ want to use a CBC cipher for OpenVPN's data channel.
+
+* Added PLUGIN_LIBDIR preprocessor string to prepend a default
+ plugin directory to the dlopen search list when the user
+ specifies the basename of the plugin only (Marius Tomaschewski).
+
+* Rewrote extract_x509_field and modified COMMON_NAME_CHAR_CLASS
+ to allow forward slash characters ("/") in the X509 common name
+ (Pavel Shramov).
+
+* Allow OpenVPN to run completely unprivileged under Linux
+ by allowing openvpn --mktun to be used with --user and --group
+ to set the UID/GID of the tun device node. Also added --iproute
+ option to allow an alternative command to be executed in place
+ of the default iproute2 command (Alon Bar-Lev).
+
+* Fixed --disable-iproute2 in ./configure to actually disable
+ iproute2 usage (Alon Bar-Lev).
+
+* Added --management-forget-disconnect option -- forget
+ passwords when management session disconnects (Alon Bar-Lev).
+
+2007.04.25 -- Version 2.1_rc4
+
+* Worked out remaining issues with TAP driver signing
+ on Vista x64. OpenVPN will now run on Vista x64
+ with driver signing enforcement enabled.
+
+* Fixed 64-bit portability bug in time_string function
+ (Thomas Habets).
+
+2007.04.22 -- Version 2.1_rc3
+
+* Additional fixes to TAP driver for Windows x64. Driver
+ now runs successfully on Vista x64 if driver signing
+ enforcement is disabled.
+
+* The Windows Installer and TAP driver are now signed by
+ OpenVPN Solutions LLC (in addition to the usual GnuPG
+ signatures).
+
+* Added OpenVPN GUI (Mathias Sundman version) as install
+ option in Windows installer.
+
+* Clean up configure on FreeBSD for recent autotool versions
+ that require that all .h files have to be compiled.
+ Also, FreeBSD install does not support GNU long options
+ which the Makefile in easy-rsa/2.0 uses (not checked the
+ others as we don't install those on Gentoo) (Roy Marples).
+
+* Added additional scripts to easy-rsa/Windows for working
+ with password-protected keys; also add -extensions server
+ option when generating server cert via
+ build-key-server-pass.bat (Daniel Zauft).
+
+2007.02.27 -- Version 2.1_rc2
+
+* auth-pam change: link with -lpam rather
+ than dlopen (Roy Marples).
+
+* Prevent SIGUSR1 or SIGHUP from causing program
+ exit from initial management hold.
+
+* SO_REUSEADDR should not be set on Windows TCP sockets
+ because it will cause bind to succeed on port conflicts.
+
+* Added time_ascii, time_duration, and time_unix
+ environmental variables for plugins and callback
+ scripts.
+
+* Fixed issue where OpenVPN does not apply the --txqueuelen option
+ to persistent interfaces made with --mktun (Roy Marples).
+
+* Attempt at rational signal handling when in the
+ management hold state. During management hold, ignore
+ SIGUSR1/SIGHUP signals thrown with the "signal" command.
+ Also, "signal" command will now apply remapping as
+ specified with the --remap-usr1 option.
+ When a signal entered using the "signal" command from a management
+ hold is ignored, output: >HOLD:Waiting for hold release
+
+* Fixed issue where struct env_set methods that
+ change the value of an existing name=value pair
+ would delay the freeing of the memory held by
+ the previous name=value pair until the underlying
+ client instance object is closed.
+ This could cause a server that handles long-term
+ client connections, resulting in many periodic calls
+ to verify_callback, to needlessly grow the env_set
+ memory allocation until the underlying client instance
+ object is closed.
+
+* Renamed TAP-Win32 driver from tap0801.sys to tap0901.sys
+ to reflect the fact that Vista has blacklisted the tap0801.sys
+ file name due to previous compatibility issues which have now
+ been resolved. TAP-Win32 major/minor version number is now 9/1.
+
+* Windows installer will delete a previously installed
+ tap0801.sys TAP driver before installing tap0901.sys.
+
+* Added code to Windows installer to fail gracefully on 64 bit
+ installs until 64-bit TAP driver issues can be resolved.
+
+* Added code to Windows installer to fail gracefully on
+ versions of Windows which are not explicitly supported.
+
+* The Windows version will now use a default route-delay
+ of 5 seconds to deal with an apparent routing table race
+ condition on Vista.
+
+* Worked around an incompatibility in the Windows Vista
+ version of CreateIpForwardEntry as described in
+ http://www.nynaeve.net/?p=59
+ This issue would cause route additions using the
+ IP Helper API to fail on Vista.
+
+* On Windows, revert to "ip-win32 dynamic" as the default.
+
+2006.10.31 -- Version 2.1_rc1
+
+* Support recovery (return to hold) from signal at
+ management password prompt.
+
+* Added workaround for OpenSC PKCS#11 bug#108
+ (Alon Bar-Lev).
+
+2006.10.01 -- Version 2.1-beta16
+
+* Windows installer updated with OpenSSL 0.9.7l DLLs to fix
+ published vulnerabilities.
+
+* Fixed TAP-Win32 bug that caused BSOD on Windows Vista
+ (Henry Nestler).
+
+* Autodetect 32/64 bit Windows in installer and install
+ appropriate TAP driver (Mathias Sundman, Hypherion).
+
+* Fixed bug in loopback self-test introduced
+ in 2.1-beta15 where self test as invoked by
+ "make check" would not properly exit after
+ 2 minutes (Paul Howarth).
+
+2006.09.12 -- Version 2.1-beta15
+
+* Windows installer updated with OpenSSL 0.9.7k DLLs to fix
+ RSA Signature Forgery (CVE-2006-4339).
+
+* Fixed bug introduced with the --port-share directive
+ (back in 2.1-beta9 which causes TLS soft resets
+ (1 per hour by default) in TCP server mode to force
+ a blockage of tunnel packets and later time-out and
+ restart the connection.
+
+* easy-rsa update (Alon Bar-Lev)
+ Makefile (install) is now available so that
+ distribs will be able to install it safely.
+
+* PKCS#11 changes: (Alon Bar-Lev)
+ - Modified ssl.c to not FATAL and return to init.c
+ so auth-retry will work.
+ - Modifed pkcs11-helper.c to fix some problem with
+ multiple providers.
+ - Added retry counter to PKCS#11 PIN hook.
+ - Modified PKCS#11 PIN retry loop to return correct error
+ code when PIN is incorrect.
+ - Fix handling (ignoring) zero sized attributes.
+ - Fix gcc-2 issues.
+ - Fix openssl 0.9.6 (first version) issues.
+
+* Minor fixes of lladdr (Alon Bar-Lev)
+ Updated makefile.w32-vc to include lladdr.*, updated
+ linkage libraries.
+ Modified lladdr.c to be compiled under visual C.
+
+* Added two new management states:
+ OPENVPN_STATE_RESOLVE -- DNS lookup
+ OPENVPN_STATE_TCP_CONNECT -- Connecting to TCP server
+
+* Echo management state change to log.
+
+* Minor syshead.h change for NetBSD to allow
+ TCP_NODELAY flag to work.
+
+* Modified --port-share code to remove the assumption that
+ CMSG_SPACE always evaluates to a constant, to enable
+ compilation on NetBSD and possibly other BSDs as well.
+
+* Eliminated gcc 3.3.3 warnings on NetBSD
+ when ./configure --enable-strict is used.
+
+* Added optional minimum-number-of-bytes parameter
+ to --inactive directive.
+
+2006.04.13 -- Version 2.1-beta14
+
+* Fixed Windows server bug in time backtrack handling code which
+ could cause TLS negotiation failures on legitimate clients.
+
+* Rewrote gettimeofday function for Windows to be
+ simpler and more efficient.
+
+* Merged PKCS#11 extensions to easy-rsa/2.0 (Alon Bar-Lev).
+
+* Added --route-metric option to set a default route metric
+ for --route (Roy Marples).
+
+* Added --lladdr option to specify the link layer (MAC) address
+ for the tap interface on non-Windows platforms (Roy Marples).
+
+2006.04.12 -- Version 2.1-beta13
+
+* Code added in 2.1-beta7 and 2.0.6-rc1 to extend byte counters
+ to 64 bits caused a bug in the Windows version which has now
+ been fixed. The bug could cause intermittent crashes.
+
+2006.04.05 -- Version 2.1-beta12
+
+* Security Vulnerability -- An OpenVPN client connecting to a
+ malicious or compromised server could potentially receive
+ "setenv" configuration directives from the server which could
+ cause arbitrary code execution on the client via a LD_PRELOAD
+ attack. A successful attack appears to require that (a) the
+ client has agreed to allow the server to push configuration
+ directives to it by including "pull" or the macro "client" in
+ its configuration file, (b) the client configuration file uses
+ a scripting directive such as "up" or "down", (c) the client
+ succesfully authenticates the server, (d) the server is
+ malicious or has been compromised and is under the control of
+ the attacker, and (e) the attacker has at least some level of
+ pre-existing control over files on the client (this might be
+ accomplished by having the server respond to a client web request
+ with a specially crafted file). Credit: Hendrik Weimer.
+ CVE-2006-1629.
+
+ The fix is to disallow "setenv" to be pushed to clients from
+ the server, and to add a new directive "setenv-safe" which is
+ pushable from the server, but which appends "OPENVPN_" to the
+ name of each remotely set environmental variable.
+
+* "topology subnet" fix for FreeBSD (Benoit Bourdin).
+
+* PKCS11 fixes (Alon Bar-Lev). For full description:
+ svn log -r990 http://svn.openvpn.net/projects/openvpn/branches/BETA21
+
+* When deleting routes under Linux, use the route metric
+ as a differentiator to ensure that the route teardown
+ process only deletes the identical route which was originally
+ added via the "route" directive (Roy Marples).
+
+* Fix the t_cltsrv.sh file in FreeBSD 4 jails
+ (Matthias Andree, Dirk Meyer, Vasil Dimov).
+
+* Extended tun device configure code to support ethernet
+ bridging on NetBSD (Emmanuel Kasper).
+
+2006.02.19 -- Version 2.1-beta11
+
+* Fixed --port-share bug that caused premature closing
+ of proxied sessions.
+
+2006.02.17 -- Version 2.1-beta10
+
+* Fixed --port-share breakage introduced in 2.1-beta9.
+
+2006.02.16 -- Version 2.1-beta9
+
+* Added --port-share option for allowing OpenVPN and HTTPS
+ server to share the same port number.
+* Added --management-client option to connect as a client
+ to management GUI app rather than be connected to as a
+ server.
+* Added "bytecount" command to management interface.
+* --remote-cert-tls fixes (Alon Bar-Lev).
+
+2006.01.03 -- Version 2.1-beta8
+
+* --remap-usr1 will now also remap signals thrown during
+ initialization.
+* Added --connect-timeout option to control the timeout
+ on TCP client connection attempts (doesn't work on all
+ OSes). This patch also makes OpenVPN signalable during
+ TCP connection attempts.
+* Fixed bug in acinclude.m4 where capability of compiler
+ to handle zero-length arrays in structs is tested
+ (David Stipp).
+* Fixed typo in manage.c where inline function declaration
+ was declared without the "static" keyword (David Stipp).
+* Patch to support --topology subnet on Mac OS X (Mathias Sundman).
+* Added --auto-proxy directive to auto-detect HTTP or SOCKS
+ proxy settings (currently Windows only).
+* Removed redundant base64 code.
+* Better sanity checking of --server and --server-bridge
+ IP pool ranges, so as not to hit the assertion at
+ pool.c:119 (2.0.5).
+* Fixed bug where --daemon and --management-query-passwords
+ used together would cause OpenVPN to block prior to
+ daemonization.
+* Fixed client/server race condition which could occur
+ when --auth-retry interact is set and the initially
+ provided auth-user-pass credentials are incorrect,
+ forcing a username/password re-query.
+* Fixed bug where if --daemon and --management-hold are
+ used together, --user or --group options would be ignored.
+* --ip-win32 adaptive is now the default.
+* --ip-win32 netsh (or --ip-win32 adaptive when in netsh
+ mode) can now set DNS/WINS addresses on the TAP-Win32
+ adapter.
+* Added new option --route-method adaptive (Win32)
+ which tries IP helper API first, then falls back to
+ route.exe.
+* Made --route-method adaptive the default.
+
+2005.11.12 -- Version 2.1-beta7
+
+* Allow blank passwords to be passed via the management
+ interface.
+* Fixed bug where "make check" inside a FreeBSD "jail"
+ would never complete (Matthias Andree).
+* Fixed bug where --server directive in --dev tap mode
+ claimed that it would support subnets of /30 or less
+ but actually would only accept /29 or less.
+* Extend byte counters to 64 bits (M. van Cuijk).
+* Fixed bug in Linux get_default_gateway function
+ introduced in 2.0.4, which would cause redirect-gateway
+ on Linux clients to fail.
+* Moved easy-rsa 2.0 scripts to easy-rsa/2.0 to
+ be compatible with 2.0.x distribution.
+* Documented --route-nopull.
+* Documented --ip-win32 adaptive.
+* Windows build now linked with LZO2.
+* Allow ca, cert, key, and dh files to be specified
+ inline via XML-like syntax without needing to
+ reference an explicit file.
+ For example:
+ <ca>
+ data here...
+ </ca>
+* Allow plugin and push directives to have multi-line
+ parameter lists such as:
+ <plugin>
+ my-plugin.so
+ parm1
+ parm2
+ </plugin>
+* Added connect-retry-max option (Alon Bar-Lev).
+* Fixed problems where signals thrown during initialization
+ were not returning to a management-hold state.
+* Added a backtrack-hardened system time algorithm.
+* Added --remote-cert-ku, --remote-cert-eku, and
+ --remote-cert-tls options for verifying certificate
+ attributes (Alon Bar-Lev).
+* For Windows, reverted --ip-win32 default back to "dynamic".
+ To use new adaptive mode, set explicitly.
+
+2005.11.01 -- Version 2.1-beta6
+
+* Security fix (merged from 2.0.4) -- Affects non-Windows
+ OpenVPN clients of version 2.0 or higher which connect to
+ a malicious or compromised server. A format string
+ vulnerability in the foreign_option function in options.c
+ could potentially allow a malicious or compromised server
+ to execute arbitrary code on the client. Only
+ non-Windows clients are affected. The vulnerability
+ only exists if (a) the client's TLS negotiation with
+ the server succeeds, (b) the server is malicious or
+ has been compromised such that it is configured to
+ push a maliciously crafted options string to the client,
+ and (c) the client indicates its willingness to accept
+ pushed options from the server by having "pull" or
+ "client" in its configuration file (Credit: Vade79).
+ CVE-2005-3393
+* Security fix -- (merged from 2.0.4) Potential DoS
+ vulnerability on the server in TCP mode. If the TCP
+ server accept() call returns an error status, the resulting
+ exception handler may attempt to indirect through a NULL
+ pointer, causing a segfault. Affects all OpenVPN 2.0 versions.
+ CVE-2005-3409
+* Fix attempt of assertion at multi.c:1586 (note that
+ this precise line number will vary across different
+ versions of OpenVPN).
+* Windows reliability changes:
+ (a) Added code to make sure that the local PATH environmental
+ variable points to the Windows system32 directory.
+ (b) Added new --ip-win32 adaptive mode which tries 'dynamic'
+ and then fails over to 'netsh' if the DHCP negotiation fails.
+ (c) Made --ip-win32 adaptive the default.
+* More PKCS#11 additions/changes (Alon Bar-Lev).
+* Added ".PHONY: plugin" to Makefile.am to work around
+ "make dist" issue.
+* Fixed double fork issue that occurs when --management-hold
+ is used.
+* Moved TUN/TAP read/write log messages from --verb 8 to 6.
+* Warn when multiple clients having the same common name or
+ username usurp each other when --duplicate-cn is not used.
+* Modified Windows and Linux versions of get_default_gateway
+ to return the route with the smallest metric
+ if multiple 0.0.0.0/0.0.0.0 entries are present.
+* Added ">NEED-OK" alert and "needok" command to management
+ interface to provide a general interface for sending
+ alerts to the end-user. Used by the PKCS#11 code
+ to send Token Insertion Requests to the user.
+* Added actual remote address used to the ">STATE" alert
+ in the management interface (Rolf Fokkens).
+
+2005.10.17 -- Version 2.1-beta4
+
+* Fixed bug introduced in 2.1-beta3 where management
+ socket bind would fail.
+* --capath fix in ssl.c (Zhuang Yuyao).
+* Added ".PHONY: plugin" to Makefile.am, reverted
+ location of "plugin" directory (thanks to
+ Matthias Andree for figuring this out).
+
+2005.10.16 -- Version 2.1-beta3
+
+* Added PKCS#11 support (Alon Bar-Lev).
+* Enable the use of --ca together with --pkcs12. If --ca is
+ used at the same time as --pkcs12, the CA certificate is loaded
+ from the file specified by --ca regardless if the pkcs12 file
+ contains a CA cert or not (Mathias Sundman).
+* Merged --capath patch (Thomas Noel).
+* Merged --multihome patch.
+* Added --bind option for TCP client connections (Ewan Bhamrah
+ Harley).
+* Moved "plugin" directory to "plugins" to deal with strange
+ automake problem that ended up being also fixable with
+ ".PHONY: plugin" in Makefile.am.
+
+2005.10.13 -- Version 2.1-beta2
+
+* Made --sndbuf and --rcvbuf pushable.
+
+2005.10.01 -- Version 2.1-beta1
+
+* Made LZO setting pushable.
+* Renamed sample-keys/tmp-ca.crt to ca.crt.
+* Fixed bug where remove_iroutes_from_push_route_list
+ was missing routes if those routes had
+ an implied netmask (by omission) of 255.255.255.255.
+* Merged with 2.0.3-rc1
+* easy-rsa/2.0 moved to easy-rsa
+* old easy-rsa moved to easy-rsa/1.0
+
+2005.09.23 -- Version 2.0.2-TO4
+
+* Added feature to TAP-Win32 adapter to allow it to be
+ opened from non-administrator mode. This feature
+ is enabled by default, and can be enabled/disabled
+ in the adapter advanced properties dialog.
+* Added --allow-nonadmin standalone option for Windows to
+ set TAP adapter to allow non-admin access. This
+ is a user-mode version of the code, and duplicates
+ the same feature as the above entry.
+* Added fix that attempts to solve corner case of tunnel not
+ forwarding packets when system clock is reset to an earlier time.
+* Added --redirect-gateway bypass-dns option. (Developers:
+ To add bypass-dhcp or bypass-dns support to other OSes,
+ add a get_bypass_addresses function to route.c for
+ your OS.)
+* Added OPENVPN_PLUGIN_CLIENT_CONNECT_V2 plugin callback, which
+ allows a client-connect plugin to return configuration text
+ in memory, rather than via a file.
+* Fixed a bug where --mode server --proto tcp-server --cipher none
+ operation could cause tunnel packet truncation.
+* openvpn --version will show [LZO1] or [LZO2], depending on
+ version that was linked.
+
+2005.09.07 -- Version 2.0.2-TO1
+
+* Added --topology directive. See man page.
+* Added --redirect-gateway bypass-dhcp option to add a route
+ allowing DHCP packets to bypass the tunnel, when the
+ DHCP server is non-local. Currently only implemented
+ on Windows clients.
+* Modified OpenVPN Service on Windows to declare the DHCP
+ client service as a dependency.
+* Extended the plugin interface to allow plugins to declare
+ per-client constructor and destructor functions, to make
+ it simpler for plugins to maintain per-client state.
+
+2005.09.25 -- Version 2.0.3-rc1
+
+* openvpn_plugin_abort_v1 function wasn't being properly
+ registered on Windows.
+* Fixed a bug where --mode server --proto tcp-server --cipher none
+ operation could cause tunnel packet truncation.
+
+2005.08.25 -- Version 2.0.2
+
+* No change from 2.0.2-rc1.
+
+2005.08.24 -- Version 2.0.2-rc1
+
+* Fixed regression bug in Win32 installer, introduced in 2.0.1,
+ which incorrectly set OpenVPN service to autostart.
+* Don't package source code zip file in Windows installer
+ in order to reduce the size of the installer. The source
+ zip file can always be downloaded separately if needed.
+* Fixed bug in route.c in FreeBSD, Darwin, OpenBSD and NetBSD
+ version of get_default_gateway. Allocated socket for route
+ manipulation is never freed so number of mbufs continuously
+ grow and exhaust system resources after a while (Jaroslav Klaus).
+* Fixed bug where "--proto tcp-server --mode p2p --management
+ host port" would cause the management port to not respond until
+ the OpenVPN peer connects.
+* Modified pkitool script to be /bin/sh compatible (Johnny Lam).
+
+2005.08.16 -- Version 2.0.1
+
+* Security Fix -- DoS attack against server when run with "verb 0" and
+ without "tls-auth". If a client connection to the server fails
+ certificate verification, the OpenSSL error queue is not properly
+ flushed, which can result in another unrelated client instance on the
+ server seeing the error and responding to it, resulting in disconnection
+ of the unrelated client (CAN-2005-2531).
+* Security Fix -- DoS attack against server by authenticated client.
+ This bug presents a potential DoS attack vector against the server
+ which can only be initiated by a connected and authenticated client.
+ If the client sends a packet which fails to decrypt on the server,
+ the OpenSSL error queue is not properly flushed, which can result in
+ another unrelated client instance on the server seeing the error and
+ responding to it, resulting in disconnection of the unrelated client
+ (CAN-2005-2532). Credit: Mike Ireton.
+* Security Fix -- DoS attack against server by authenticated client.
+ A malicious client in "dev tap" ethernet bridging mode could
+ theoretically flood the server with packets appearing to come from
+ hundreds of thousands of different MAC addresses, causing the OpenVPN
+ process to deplete system virtual memory as it expands its internal
+ routing table. A --max-routes-per-client directive has been added
+ (default=256) to limit the maximum number of routes in OpenVPN's
+ internal routing table which can be associated with a given client
+ (CAN-2005-2533).
+* Security Fix -- DoS attack against server by authenticated client.
+ If two or more client machines try to connect to the server at the
+ same time via TCP, using the same client certificate, and when
+ --duplicate-cn is not enabled on the server, a race condition can
+ crash the server with "Assertion failed at mtcp.c:411"
+ (CAN-2005-2534).
+* Fixed server bug where under certain circumstances, the client instance
+ object deletion function would try to delete iroutes which had never been
+ added in the first place, triggering "Assertion failed at mroute.c:349".
+* Added --auth-retry option to prevent auth errors from being fatal
+ on the client side, and to permit username/password requeries in case
+ of error. Also controllable via new "auth-retry" management interface
+ command. See man page for more info.
+* Added easy-rsa 2.0 scripts to the tarball in easy-rsa/2.0
+* Fixed bug in openvpn.spec where rpmbuild --define 'without_pam 1'
+ would fail to build.
+* Implement "make check" to perform loopback tests (Matthias Andree).
+
+2005.07.21 -- Version 2.0.1-rc7
+
+* Support LZO 2.01 which renamed its library to lzo2 (Matthias Andree).
+* Include linux/types.h before checking for linux/errqueue.h (Matthias
+ Andree).
+
+2005.07.15 -- Version 2.0.1-rc6
+
+* Commented out "user nobody" and "group nobody" in sample
+ client/server config files.
+* Allow '@' character to be used in --client-config-dir
+ file names.
+
+2005.07.04 -- Version 2.0.1-rc5
+
+* Windows version will log a for-further-info URL when
+ initialization sequence is completed with errors.
+* Added DLOPEN_PAM parameter to plugin/auth-pam/Makefile
+ to control whether auth-pam plugin links to PAM via
+ dlopen or -lpam. By default, DLOPEN_PAM=1 so pre-existing
+ behavior should be preserved. DLOPEN_PAM=0 is the preferred
+ setting to link via -lpam, but DLOPEN_PAM=1 works around
+ a bug in SuSE 9.1 (and possibly other distros as well)
+ where the PAM modules are not linked with -lpam. See
+ thread on openvpn-devel for more discussion about this
+ patch (Simon Perreault).
+
+2005.06.15 -- Version 2.0.1-rc4
+
+* Support LZO 2.00, including changes to configure script to
+ autodetect LZO version.
+
+2005.06.12 -- Version 2.0.1-rc3
+
+* Fixed a bug which caused standard file handles to not be closed
+ after daemonization when --plugin and --daemon are used together,
+ and if the plugin initialization function forks (as does auth-pam
+ and down-root) (Simon Perreault).
+* Added client-side up/down scripts in contrib/pull-resolv-conf
+ for accepting server-pushed "dhcp-option DOMAIN" and "dhcp-option DNS"
+ on Linux/Unix systems (Jesse Adelman).
+* Fixed bug where if client-connect scripts/plugins were cascaded,
+ and one (but not all) of them returned an error status, there might
+ be cases where for an individual script/plugin, client-connect was
+ called but not client-disconnect. The goal of this fix is to
+ ensure that if client-connect is called on a given client instance,
+ then client-disconnect will definitely be called. A potential
+ complication of this fix is that when client-connect functions are
+ cascaded, it's possible that the client-disconnect function would
+ be called in cases where the related client-connect function returned
+ an error status. This fix should not alter OpenVPN behavior when
+ scripts/plugins are not cascaded.
+* Changed the hard-to-reproduce "Assertion failed at fragment.c:312"
+ fatal error to a warning: "FRAG: outgoing buffer is not empty".
+ Need more info on how to reproduce this one.
+* When --duplicate-cn is used, the --ifconfig-pool allocation
+ algorithm will now allocate the first available IP address.
+* When --daemon and --management-hold are used together,
+ OpenVPN will daemonize before it enters the management hold state.
+
+2005.05.16 -- Version 2.0.1-rc2
+
+* Modified vendor test in openvpn.spec file to match against
+ "Mandrakesoft" in addition to "MandrakeSoft".
+* Using --iroute in a --client-config-dir file while in --dev tap
+ mode is not currently supported and will produce a warning
+ message. Fixed bug where in certain cases, in addition to
+ generating a warning message, this combination of options
+ would also produce a fatal assertion in mroute.c.
+* Pass --auth-user-pass username to server-side plugin without
+ performing any string remapping (plugins, unlike scripts,
+ don't get any security benefit from string remapping).
+ This is intended to fix an issue with openvpn-auth-pam/pam_winbind
+ where backslash characters in a username ('\') were being remapped
+ to underscore ('_').
+* Updated OpenSSL DLLs in Windows build to 0.9.7g.
+* Documented --explicit-exit-notify in man page.
+* --explicit-exit-notify seconds parameter defaults to 1 if
+ unspecified.
+
+2005.04.30 -- Version 2.0.1-rc1
+
+* Fixed bug where certain kinds of fatal errors after
+ initialization (such as port in use) would leave plugin
+ processes (such as openvpn-auth-pam) still running.
+* Added optional openvpn_plugin_abort_v1 plugin function for
+ closing initialized plugin objects in the event of a fatal
+ error by main OpenVPN process.
+* When the --remote list is > 1, and --resolv-retry is not
+ specified (meaning that it defaults to "infinite"), apply the
+ infinite timeout to the --remote list as a whole, but try each
+ list item only once before moving on to the next item.
+* Added new --syslog directive which redirects output
+ to syslog without requiring the use of the --daemon or --inetd
+ directives.
+* Added openvpn.spec option to allow RPM to be built with support
+ for passwords read from a file:
+ rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
+
+2005.04.17 -- Version 2.0
+
+* Fixed minor options string typo in options.c.
+
+2005.04.10 -- Version 2.0-rc21
+
+* Change license description from "GPL Version 2 or (at your
+ option) any later version" to just "GPL Version 2".
+
+2005.04.04 -- Version 2.0-rc20
+
+* Dag Wieers has put together an OpenVPN/LZO binary RPM set with
+ excellent distro/version coverage for RH/EL/Fedora, though
+ using his own SPEC. I modified openvpn.spec to follow some of
+ the same conventions such as putting sample scripts and doc
+ files in %doc rather than /usr/share/openvpn.
+* Minor change to init scripts to run the user-defined script
+ /etc/openvpn/openvpn-startup (if it exists) before any OpenVPN
+ configs are started, and to run /etc/openvpn/openvpn-shutdown
+ after all OpenVPN configs have been stopped. The
+ openvpn-startup script can be used for stuff like
+ insmod tun.o, setting up firewall rules, or starting
+ ethernet bridges.
+
+2005.03.29 -- Version 2.0-rc19
+
+* Omit additions of routes where the network and
+ gateway are equal and the netmask is 255.255.255.255.
+ This can come up if you are using both
+ server/ifconfig-pool and client-config-dir with
+ ifconfig-push static addresses for some subset of clients
+ which directly reference the server IP address as the
+ remote endpoint.
+
+2005.03.28 -- Version 2.0-rc18
+
+* Packaged Windows installer with OpenSSL 0.9.7f.
+* Built Windows installer with NSIS 2.06.
+
+2005.03.12 -- Version 2.0-rc17
+
+* "MANAGEMENT: CMD" log file output will now only occur
+ at --verb 7 or greater.
+* Added an optional name/value configuration list to
+ the openvpn-auth-pam plugin module argument list. See
+ plugin/auth-pam/README for documentation. This is necessary
+ in order for openvpn-auth-pam to work with queries generated
+ by arbitrary PAM modules.
+* In both auth-pam and down-root plugins, in the forked process,
+ a read error on the parent process socket is no longer fatal.
+* MandrakeSoft liblzo1 RPM only Provides for a 'liblzo1'.
+ A conditional test of the vendor has been added to
+ Require the appropriately named 'lzo' (liblzo1 / lzo).
+ (Tom Walsh - http://openhardware.net)
+
+
+2005.02.20 -- Version 2.0-rc16
+
+* Fixed bug introduced in rc13 where Windows service wrapper
+ would be installed with a startup type of Automatic.
+ This fix restores the previous behavior of installing
+ with a startup type of Manual.
+
+2005.02.19 -- Version 2.0-rc15
+
+* Added warning when --keepalive is not used in a server
+ configuration.
+* Don't include OpenSSL md4.h file if we are not building
+ NTLM proxy support (Waldemar Brodkorb).
+* Added easy-rsa/build-key-pkcs12 and
+ easy-rsa/Windows/build-key-pkcs12.bat scripts
+ (Mathias Sundman).
+
+2005.02.16 -- Version 2.0-rc14
+
+* Fixed small memory leak that occurs when --crl-verify
+ is used.
+* Upgraded Windows installer and .nsi script to NSIS 2.05
+ (Mathias Sundman).
+* Changed #include backslash usage in cryptoapi.c to use
+ forward slashes instead (Gisle Vanem).
+* Created easy-rsa/revoke-full to handle revocations in
+ a single step: (a) revoke crt, (b) regenerate CRL, and
+ (c) verify that revocation succeeded.
+* Renamed easy-rsa/Windows/revoke-key to revoke-full so
+ that both *nix and Windows scripts are equivalent.
+
+2005.02.11 -- Version 2.0-rc13
+
+* Improve human-readability of local/remote options
+ diff, when inconsistencies are present.
+* For Windows easy-rsa, distribute vars.bat.sample and
+ openssl.cnf.sample, then copy them to their normal
+ filenames (without the .sample) when init-config.bat
+ is run. This is to prevent OpenVPN upgrades from
+ wiping out vars.bat and openssl.cnf edits.
+* Modified service wrapper (Windows) to use a
+ case-insensitive search when scanning for .ovpn files
+ in \Program Files\OpenVPN\config. Prior versions
+ required an all-lower-case .ovpn file extension.
+* Miscellaneous service wrapper code cleanup.
+* If --user/--group is used on Windows, treat it
+ as a no-op with a warning (this makes it easier to
+ distribute the same client config file to Windows
+ and *nix users).
+* Warn if --ifconfig-pool-persist is used with
+ --duplicate-cn.
+
+2005.02.05 -- Version 2.0-rc12
+
+* Removed some debugging code inadvertently included
+ in rc11 which would print the --auth-user-pass
+ username/password provided by clients in the server
+ logfile.
+* Client code for cycling through --remote list will
+ retry the last address which successfully authenticated
+ before moving on through the list.
+* Windows installer will now install sample configuration
+ files in \Program Files\OpenVPN\sample-configs as well
+ as generate a start menu shortcut to this directory.
+* Minor type change in buffer.[ch] to work around char-type
+ ambiguity bug. Caused management interface lock-ups on
+ ARM when building with armv4b-hardhat-linux-gcc 2.95.3.
+
+2005.02.03 -- Version 2.0-rc11
+
+* Windows installer will now install easy-rsa directory
+ in \Program Files\OpenVPN
+* Allow syslog facility to be controlled at compile time,
+ e.g. -DLOG_OPENVPN=LOG_LOCAL6 (P Kern).
+* Changed certain shell scripts in distribution to use
+ #!/bin/sh rather than #!/bin/bash for better portability.
+* If --ifconfig-pool-persist seconds parameter is 0, treat
+ persist file as an allocation of fixed IP addresses
+ (previous versions took IP-to-common-name associations
+ from this list as hints, not mandatory static allocations).
+* Fixed bug on *nix where if --auth-user-pass and --log
+ were used together, the username prompt would be sent to
+ the log file rather than /dev/tty.
+* Spurious text in openvpn.8 detected by doclifter
+ (Eric S. Raymond).
+* Call closelog later on daemon kill so that process
+ exit message is written to syslog.
+
+2005.01.27 -- Version 2.0-rc10
+
+* When ./configure is run with plugins enabled (the default),
+ check whether or not dlopen exists in libc before testing
+ for libdl. This is to fix an issue on FreeBSD and possibly
+ other OSes which bundle libdl functions in libc.
+* On Windows, filter initial WSAEINVAL warning which occurs
+ on the initial read attempt of an unbound socket.
+* The easy-rsa scripts build-key, build-key-pass, and
+ build-key-server will now chmod the .key file
+ to 0600. This is in addition to the fact the generated
+ keys directory has always been similarly protected
+ (Pete Harlan).
+
+2005.01.23 -- Version 2.0-rc9
+
+* Fixed error "ROUTE: route addition failed using
+ CreateIpForwardEntry ..." on Windows when --redirect-gateway
+ is used over a RRAS internet link.
+* When using --route-method exe on Windows, include the
+ gateway parameter on route delete commands (Mathias Sundman).
+* Try not to do a hard reset (i.e. SIGHUP) when two
+ SIGUSR1 signals are received in close succession.
+* If the push list tries to grow beyond its buffer capacity,
+ the resulting error will be non-fatal.
+* To increase the push list capacity (must be done on both
+ client and server), increase TLS_CHANNEL_BUF_SIZE in
+ common.h (default=1024).
+
+2005.01.15 -- Version 2.0-rc8
+
+* Fixed bug introduced in rc7 where options error
+ "--auth-user-pass requires --pull" might occur even
+ if --pull was correctly specified.
+* Changed management interface code to bind once
+ to TCP socket, rather than rebinding after every
+ client disconnect.
+* Added "disable" directive for client-config-dir
+ files.
+* Windows binary install is now distributed with
+ OpenSSL 0.9.7e.
+* Query the management interface for --http-proxy
+ username/password if authfile is set to "stdin".
+* Added current OpenVPN version number to "Unrecognized
+ option or missing parameter" error message.
+* Added "-extensions server" to "openssl req" command
+ in easy-rsa/build-key-server (Nir Yeffet).
+
+2005.01.10 -- Version 2.0-rc7
+
+* Fixed bug in management interface which could cause
+ 100% CPU utilization in --proto tcp-server mode
+ on all *nix OSes except for Linux 2.6.
+* --ifconfig-push now accepts DNS names as well as
+ IP addresses.
+* Added sanity check errors when --pull or
+ --auth-user-pass is used in an incorrect mode.
+* Updated man page entries for --client-connect and
+ --ifconfig-push.
+* Added "String Types and Remapping" section to man
+ page to consisely document the way which OpenVPN
+ may convert certain types of characters in strings
+ to ('_').
+* Modified bridging description in HOWTO to emphasize
+ the fact that bridging allows Windows file and print
+ sharing without a WINS server (Charles Duffy).
+
+2004.12.20 -- Version 2.0-rc6
+
+* Improved checking for epoll support in ./configure
+ to fix false positive on RH9 (Jan Just Keijser).
+* Made the "MULTI TCP: I/O wait required blocking in
+ multi_tcp_action, action=7" error nonfatal and replaced
+ with "MULTI: Outgoing TUN queue full, dropped packet".
+ So far the issue only seems to occur on Linux 2.2
+ in --mode server --proto tcp mode. It occurs when
+ the TUN/TAP driver locks up and refuses to accept
+ new packet writes for a second or more.
+* Fixed bug where if a --client-config-dir file tried
+ to include another file using "config", and if that
+ include failed, OpenVPN would abort with a fatal
+ error. Now such inclusion failures will be logged
+ but are no longer fatal.
+* Global changes to the way that packet buffer alignment
+ is handled. Previously we didn't care about alignment
+ and took care, when handling 16 and 32 bit words
+ in buffers, to always use alignment-safe transfers.
+ This approach appears to be inadequate on some
+ architectures such as alpha. The new approach is
+ to initialize packet buffers in a way that anticipates
+ how component structures will be allocated within
+ them, to maintain correct alignment.
+* Added --dhcp-option DISABLE-NBT to disable NetBIOS
+ over TCP (Jan Just Keijser).
+* Added --http-proxy-option directive for controlling
+ miscellaneous HTTP proxy options.
+* Management state will no longer transition to "WAIT"
+ during TLS renegotiations.
+
+2004.12.16 -- Version 2.0-rc5
+
+* The --client-config-dir option will now try to open
+ a default file called "DEFAULT" if no file matching
+ the common name of the incoming client was found.
+* The --client-connect script/plugin can now veto client
+ authentication by returning a failure code.
+* The --learn-address script/plugin can now prevent a
+ client-instance/address association from being learned
+ by returning a failure code.
+* Changed RPM group in .spec file to Applications/Internet.
+
+2004.12.14 -- Version 2.0-rc4
+
+* SuSE only -- Fixed interaction between openvpn.spec and
+ suse/openvpn.init where the .spec file was writing the
+ OpenVPN binary to a different location than where the
+ .init script was referencing it (Stefan Engel).
+* Solaris only -- Split Solaris ifconfig command into two
+ parts (Jan Just Keijser).
+* Some cleanup in add_option().
+* Better error checking on input dotted quad IP addresses.
+* Verify that --push argument is quoted, if there is
+ more than one.
+* More miscellaneous option sanity checks.
+
+2004.12.13 -- Version 2.0-rc3
+
+* On Windows, when --log or --log-append is used,
+ save the original stderr for username and password
+ prompts.
+* Fixed a bug introduced in the late 2.0 betas where
+ if a "verb" parameter >= 16 was used, it would be
+ ignored and the actual verb level would remain at 1.
+* Fixed a bug mostly seen on OS X where --management-hold
+ or --management-query-passwords would cause the management
+ interface to be unresponsive to incoming client connections.
+* Trigger an options error if one of the management-modifying
+ options is used without "management" itself.
+
+2004.12.12 -- Version 2.0-rc2
+
+* Amplified warnings in documentation about possible
+ man-in-the-middle attack when clients do not properly
+ verify server certificate. Changes to easy-rsa README,
+ FAQ, HOWTO, man page, and sample client config file.
+* Added a warning message if --tls-client or --client
+ is used without also specifying one of either
+ --ns-cert-type, --tls-remote, or --tls-verify.
+* status_open() fixes for MSVC builds (Blaine Fleming).
+* Fix attempt of "ntlm.c:55: error: `des_cblock' undeclared"
+ compiler error which has been reported on some platforms.
+* The openvpn.spec file for rpmbuild has several
+ new build-time options. See comments in the file.
+* Plugins are now built and packaged in the RPM and
+ will be saved in /usr/share/openvpn/plugin/lib.
+* Added --management-hold directive to start OpenVPN
+ in a hibernating state until released by the
+ management interface. Also added "hold" command
+ to the management interface.
+
+2004.12.07 -- Version 2.0-rc1
+
+* openvpn.spec workaround for SuSE confusion regarding
+ /etc/init.d vs. /etc/rc.d/init.d (Stefan Engel).
+
+2004.12.05 -- Version 2.0-beta20
+
+* The ability to read --askpass and --auth-user-pass
+ passwords from a file has been disabled by default.
+ To re-enable, use ./configure --enable-password-save.
+* Added additional pre-connected states to management
+ interface. See management/management-notes.txt
+ for more info.
+* State history is now recorded by the management
+ interface, and the "state" command now works like
+ the log or echo commands.
+* State history and real-time state change notifications
+ are now prepended with an integer unix timestamp.
+* Added --http-proxy-timeout option, previously
+ the timeout was hardcoded to 5 seconds.
+
+2004.12.02 -- Version 2.0-beta19
+
+* Fixed bug in management interface line termination
+ where output lines incorrectly contained a \00 char
+ after the customary \0d \0a.
+* Fixed bug introduced in beta18 where Windows version
+ would segfault on options errors.
+* Fixed bug in management interface where an empty
+ quoted string ("") entered as a parameter would cause
+ a segfault.
+* Fixed bug where --resolv-retry was not working
+ properly with multiple --remote hosts.
+* Added additional ./configure options to reduce
+ executable size for embedded applications.
+ See ./configure --help.
+
+2004.11.28 -- Version 2.0-beta18
+
+* Added management interface. See new --management-*
+ options or the full management interface documentation
+ in management/management-notes.txt in the tarball.
+ Management interface inclusion can be disabled by
+ ./configure --disable-management.
+* Added two new plugin modules: auth-pam and down-root.
+ Auth-pam supports pam-based authentication using a
+ split privilege execution model, while down-root enables
+ a down script to be executed with root privileges, even
+ when --user/--group is used to drop root privileges.
+ See the plugin directory in the tarball for READMEs,
+ source code, and Makefiles.
+* Plugin developers should note that some changes were
+ made to the plugin interface since beta17. See
+ openvpn-plugin.h for details.
+ Plugin interface inclusion can be disabled with
+ ./configure --disable-plugins
+* Added easy-rsa/build-key-server script which will
+ build a certificate with with nsCertType=server.
+* Added --ns-cert-type option for verification
+ of nsCertType field in peer certificate.
+* If --fragment n is specified and --mssfix is specified
+ without a parameter, default --mssfix to n. This restores
+ the 1.6 behavior when using --mssfix without a parameter.
+* Fixed SSL context initialization bug introduced in beta14
+ where this error might occur on restarts: "Cannot load
+ certificate chain ... PEM_read_bio:no start line".
+
+2004.11.11 -- Version 2.0-beta17
+
+* Changed default port number to 1194 per IANA official
+ port number assignment.
+* Added --plugin directive which allows compiled
+ modules to intercept script callbacks. See
+ plugin folder in tarball for more info.
+* Fixed bug introduced in beta12 where --key-method 1
+ authentications which should have succeeded would fail.
+* Ignore SIGUSR1 during DNS resolution.
+* Added SuSE support to openvpn.spec (Umberto Nicoletti).
+* Fixed --cryptoapicert SUBJ: parsing bug (Peter 'Luna'
+ Runestig).
+
+2004.11.07 -- Version 2.0-beta16
+
+* Modified sample-scripts/auth-pam.pl to get username
+ and password from OpenVPN via a file rather than
+ via environmental variables.
+* Added bytes_sent and bytes_received environmental
+ variables to be set prior to client-disconnect script.
+* Changed client virtual IP derivation precedence:
+ (1) use --ifconfig-push directive from --client-connect
+ script, (2) use --ifconfig-push directive from
+ --client-config-dir, and (3) use --ifconfig-pool
+ address.
+* If a --client-config-dir file specifies --ifconfig-push,
+ it will be visible to the --client-connect-script in
+ the ifconfig_pool_remote_ip environmental variable.
+* For tun-style tunnels, the ifconfig_pool_local_ip
+ environmental variable will be set, while for
+ tap-style tunnels, the ifconfig_pool_netmask variable
+ will be set.
+* Added intelligence to autoconf script to test
+ compiler for the accepted form of zero-length arrays.
+* Fixed a bug introduced in beta12 where --ip-win32
+ netsh would fail if --dev-node was not explicitly
+ specified.
+* --ip-win32 netsh will now work on hidden adapters.
+* Fix attempt of "Assertion failed at crypto.c:149".
+ This assertion has also been reported on 1.x with a
+ slightly different line number. The fix is twofold:
+ (1) In previous releases, --mtu-test may trigger this
+ assertion -- this bug has been fixed. (2) If something
+ else causes the assertion to be thrown, don't panic,
+ just output a nonfatal warning to the log and drop
+ the packet which generated the error.
+* Support TAP interfaces on Mac OS X (Waldemar Brodkorb).
+* Added --echo directive.
+* Added --auth-nocache directive.
+
+2004.10.28 -- Version 2.0-beta15
+
+* Changed environmental variable character classes
+ so that names must consist of alphanumeric or
+ underbar chars and values must consist of printable
+ characters. Illegal chars will be deleted.
+ Versions prior to 2.0-beta12 were more restrictive
+ and would map spaces to '.'.
+* On Windows, when the TAP adapter fails to
+ initialize with the correct IP address, output
+ "Initialization Sequence Completed with Errors"
+ to the console or log file.
+* Added a warning when user/group/chroot is used
+ without persist-tun and persist-key.
+* Added cryptoapi.[ch] to tarball and source zip.
+* --tls-remote option now works with common name
+ prefixes as well as with the full X509 subject
+ string. This is a useful alternative to using
+ a CRL on the client.
+* common names associated with a static
+ --ifconfig-push setting will no longer leave
+ any state in the --ifconfig-pool-persist file.
+* Hard TLS errors (TLS handshake failed) will now
+ trigger either a SIGUSR1 signal by default
+ or SIGTERM (if --tls-exit is specified). In TCP
+ mode, all TLS errors are considered to be hard.
+ In server mode, the signal will be local to the
+ client instance.
+* Added method parameter to --auth-user-pass-verify
+ directive to select whether username/password
+ is passed to script via environment or a temporary
+ file.
+* Added --status-version option to control format
+ of --status file. The --mode server
+ --status-version 2 format now includes a line
+ type token, the virtual IP address is shown
+ in the client list (even in --dev tap mode),
+ and the integer time_t value is shown anywhere
+ an ascii-formatted time/date is also shown.
+* Added --remap-usr1 directive which can be used
+ to control whether internally or externally
+ generated SIGUSR1 signals are remapped to
+ SIGHUP (restart without persisting state) or
+ SIGTERM (exit).
+* When running as a Windows service (using
+ --service option), check the exit event before
+ and after reading one line of input from
+ stdin, when reading username/password info.
+* For developers: Extended the --gremlin function
+ to better stress-test the new 2.0 features,
+ added Valgrind support on Linux and Dmalloc
+ support on Windows.
+
+2004.10.19 -- Version 2.0-beta14
+
+* Fixed a bug introduced in Beta12 that would occur
+ if you use a --client-connect script without also
+ defining --tmp-dir.
+* Fixed a bug introduced in Beta12 where a learn-address
+ script might segfault on the delete method.
+* Added Crypto API support in Windows version via
+ the --cryptoapicert option (Peter 'Luna' Runestig).
+
+2004.10.18 -- Version 2.0-beta13
+
+* Fixed an issue introduced in Beta12 where the private
+ key password would not be prompted for unless --askpass
+ was explicitly specified in the config.
+
+2004.10.17 -- Version 2.0-beta12
+
+* Added support for username/password-based authentication.
+ Clients can now authentication themselves with the server
+ using either a certificate, a username/password, or both.
+ New directives: --auth-user-pass, --auth-user-pass-verify,
+ --client-cert-not-required, and --username-as-common-name.
+* Added NTLM proxy patch (William Preston).
+* Added --ifconfig-pool-linear server flag to allocate
+ individual tun addresses for clients rather than /30
+ subnets (won't work with Windows clients).
+* Modified --http-proxy code to cache username/password
+ across restarts.
+* Modified --http-proxy code to read username/password
+ from the console when the auth file is given as "stdin".
+* Modified --askpass to take an optional filename argument.
+* --persist-tun and --persist-key now work in client mode
+ and can be pushed to clients as well.
+* Added --ifconfig-pool-persist directive, to maintain
+ ifconfig-pool info in a file which is persistent across
+ daemon instantiations.
+* --user and --group privilege downgrades as well as
+ --chroot now also work in client mode (the
+ dowgrade/chroot will be delayed until the initialization
+ sequence is completed).
+* Added --show-engines standalone directive to show
+ available OpenSSL crypto accelerator engine support.
+* --engine directive now accepts an optional engine-ID
+ parameter to control which engine is used.
+* "Connection reset, restarting" log message now shows
+ which client is being reset.
+* Added --dhcp-pre-release directive in Windows version.
+* Second parm to --ip-win32 can be "default", e.g.
+ --ip-win32 dynamic default 60.
+* Fixed documentation bug regarding environmental
+ variable settings for --ifconfig-pool IP addresses.
+ The correct environmental variable names are:
+ ifconfig_pool_local_ip and ifconfig_pool_remote_ip.
+* ifconfig_pool_local_ip and ifconfig_pool_remote_ip
+ environmental variables are now passed to the
+ client-disconnect script.
+* In server mode, environmental variables are now scoped
+ according to the client they are associated with,
+ to solve the problem of "crosstalk" between different
+ client's environmental variable sets.
+* Added --down-pre flag to cause --down script to be
+ called before TUN/TAP close (rather than after).
+* Added --tls-exit flag which will cause OpenVPN
+ to exit on any TLS errors.
+* Don't push a route to a client if it exactly
+ matches an iroute (this lets you push routes to
+ all clients, and OpenVPN will automatically remove
+ the route from the route push list only for that client
+ which the route actually belongs to).
+* Made '--resolv-retry infinite' the default.
+ --resolv-retry can be disabled by using a parameter of 0.
+* For clients which plan to pull config info from server,
+ set an initial default ping-restart of 60 seconds.
+* Optimized mute code to lessen the load on the processor
+ when messages are being muted at a higher frequency.
+* Made route log messages non-mutable.
+* Silence the Linux "No buffer space available" message.
+* Added miscellaneous additional option sanity checks.
+* Added Windows version of easy-rsa scripts in
+ easy-rsa/Windows directory (Andrew J. Richardson).
+* Added NetBSD route patch (Ed Ravin).
+* Added OpenBSD patch for TAP + --redirect-gateway
+ (Waldemar Brodkorb).
+* Directives which prompt for a username and/or password
+ will now work with --daemon (OpenVPN will prompt
+ before forking).
+* Warn if CRL is from a different issuer than the
+ issuer of the peer certificate (Bernhard Weisshuhn).
+* Changed init script chkconfig parameters to start
+ OpenVPN daemon(s) before NFS.
+* Bug fix attempt of "too many I/O wait events" which occurs
+ on OSes which prefer select() over poll() such as Mac OS X.
+* Added --ccd-exclusive flag. This flag will require, as a
+ condition of authentication, that a connecting client has
+ a --client-config-dir file.
+* TAP-Win32 open code will attempt to open a free adapter
+ if --dev-node is not specified (Mathias Sundman).
+* Resequenced --nice and --chroot ordering so that --nice
+ occurs first.
+* Added --suppress-timestamps flag (Charles Duffy).
+* Source code changes to allow compilation by MSVC
+ (Peter 'Luna' Runestig).
+* Added experimental --fast-io flag which optimizes
+ TUN/TAP/UDP writes on non-Windows systems.
+
+2004.08.18 -- Version 2.0-beta11
+
+* Added --server, --server-bridge, --client, and
+ --keepalive helper directives. See client.conf
+ and server.conf in sample-config-files for sample
+ configurations which use the new directives.
+* On Windows, added --route-method to control
+ whether IP Helper API or route.exe is used
+ to add/delete routes.
+* On Windows, added a second parameter to
+ --route-delay to control the maximum time period
+ to wait for the TAP-Win32 adapter to come up
+ before adding routes.
+* Fixed bug in Windows version where configurations
+ which omit --ifconfig might fail to recognize when
+ the TAP adapter is up.
+* Proxy connection failures will now retry according
+ to the --connect-retry parameter.
+* Fixed --dev null handling on Windows so that TLS
+ loopback test described in INSTALL file works
+ correctly on Windows.
+* Added "Initialization Sequence Completed" message
+ after all initialization steps have been completed
+ and the VPN can be considered "up".
+* Better sanity-checking on --ifconfig-pool parameters.
+* Added --tcp-queue-limit option to control
+ TUN/TAP -> TCP socket overflow.
+* --ifconfig-nowarn flag will now silence general
+ warnings about possible --ifconfig address
+ conflicts, including the warning about --ifconfig
+ and --remote addresses being in same /24 subnet.
+* Fixed case where server mode did not correctly
+ identify certain types of ethernet multicast packets
+ (Marcel de Kogel).
+* Added --explicit-exit-notify option (experimental).
+
+2004.08.02 -- Version 2.0-beta10
+
+* Fixed possible reference after free of option strings
+ after a restart, bug was introduced in beta8.
+* Fixed segfault at route.c:919 in the beta9
+ Windows version that was being caused by indirection
+ through a NULL pointer.
+* Mistakenly built debug version of TAP-Win32 driver
+ for beta9. Beta10 has correct release build.
+
+2004.07.30 -- Version 2.0-beta9
+
+* Fixed --route issue on Windows that was introduced with
+ the new beta8 route implementation based on the
+ IP Helper API.
+
+2004.07.27 -- Version 2.0-beta8
+
+* Added TCP support in server mode.
+* Added PKCS #12 support (Mathias Sundman).
+* Added patch to make revoke-crt and make-crl work
+ seamlessly within the easy-rsa environment (Jan Kiszka).
+* Modified --mode server ethernet bridge code to forward
+ special IEEE 802.1d MAC Groups, i.e. 01:80:C2:XX:XX:XX.
+* Added --dhcp-renew and --dhcp-release flags to Windows
+ version. Normally DHCP renewal and release on the TAP
+ adapter occurs automatically under Windows, however
+ if you set the TAP-Win32 adapter Media Status property
+ to "Always Connected", you may need these flags.
+* Added --show-net standalone flag to Windows version to
+ show OpenVPN's view of the system adapter and routing
+ tables.
+* Added --show-net-up flag to Windows version to output
+ the system routing table and network adapter list to
+ the log file after the TAP-Win32 adapter has been brought
+ up and any routes have been added.
+* Modified Windows version to add routes using the IP Helper
+ API rather than by calling route.exe.
+* Fixed bug where --route-up script was not being called
+ if no --route options were specified.
+* Added --mute-replay-warnings to suppress packet replay
+ warnings. This is a common false alarm on WiFi nets.
+* Added "def1" flag to --redirect-gateway option to override
+ the default gateway by using 0.0.0.0/1 and 128.0.0.0/1
+ rather than 0.0.0.0/0. This has the benefit of overriding
+ but not wiping out the original default gateway.
+ (Thanks to Jim Carter for pointing out this idea).
+* You can now run OpenVPN with a single config file argument.
+ For example, you can now say "openvpn config.conf"
+ rather than "openvpn --config config.conf".
+* On Windows, made --route and --route-delay more adaptive
+ with respect to waiting for interfaces referenced by the
+ route destination to come up. Routes added by --route
+ should now be added as soon as the interface comes up,
+ rather than after an obligatory 10 second delay. The
+ way this works internally is that --route-delay now
+ defaults to 0 on Windows. Previous versions would
+ wait for --route-delay seconds then add the routes.
+ This version will wait --route-delay seconds and then
+ test the routing table at one second intervals for the
+ next 30 seconds and will not add the routes until they
+ can be added without errors.
+* On Windows, don't setsockopt SO_SNDBUF or SO_RCVBUF by
+ default on TCP/UDP socket in light of reports that this
+ action can have undesirable global side effects on the
+ MTU settings of other adapters. These parameters can
+ still be set, but you need to explicitly specify
+ --sndbuf and/or --rcvbuf.
+* Added --max-clients option to limit the maximum number
+ of simultaneously connected clients in server mode.
+* Added error message to illuminate shell escape gotcha when
+ single backslashes are used in Windows path names.
+* Added optional netmask parm to --ifconfig-pool.
+* Fixed bug where http-proxy connect retry attempts were
+ incorrectly going to the remote OpenVPN server,
+ not to the HTTP proxy server.
+
+2004.06.29 -- Version 2.0-beta7
+
+* Fixed bug in link_socket_verify_incoming_addr() which
+ under certain circumstances could have caused --float
+ behavior even if --float was not specified.
+* --tls-auth option now works with --mode server.
+ All clients and the server should use the same
+ --tls-auth key when operating in client/server mode.
+* Added --engine option to make use of OpenSSL-supported
+ crypto acceleration hardware.
+* Fixed some high verbosity print format size issues
+ in event.c for 64 bit platforms (Janne Johansson).
+* Made failure to open --log or --log-append file
+ a non-fatal error.
+
+2004.06.23 -- Version 2.0-beta6
+
+* Fixed Windows installer to intelligently put
+ up a reboot dialog only if tapinstall tells
+ us that it's really necessary.
+* Fixed "Assertion failed at fragment.c:309"
+ bug when --mode server and --fragment are used
+ together.
+* Ignore HUP, USR1, and USR2 signals during
+ initialization. Prior versions would abort.
+* Fixed bug on OS X: "Assertion failed at event.c:406".
+* Added --service option to Windows version, for use
+ when OpenVPN is being programmatically instantiated
+ by another process (see man page for info).
+* --log and --log-append options now work on Windows.
+* Update OpenBSD INSTALL notes (Janne Johansson).
+* Enable multicast on tun interface when running on
+ OpenBSD (Pavlin Radoslavov).
+* Fixed recent --test-crypto breakage, where options
+ such as --cipher were not being parsed correctly.
+* Modified options compatibility string by removing
+ ifconfig substring if it is empty. Incremented
+ options compatibility string version number to 4.
+* Fixed typo in --tls-timeout option parsing
+ (Mikael Lonnroth).
+
+2004.06.13 -- Version 2.0-beta5
+
+* Fixed rare --mode server crash that could occur
+ if data was being routed to a client at
+ high bandwidth at the precise moment that the
+ client instance object on the server was being
+ deleted.
+* Fixed issue on machines which have epoll.h and
+ the epoll_create glibc call defined, but which
+ don't actually implement epoll in the kernel.
+ OpenVPN will now gracefully fall back to the
+ poll API in this case.
+* Fixed Windows bug which would cause the following
+ error in a --mode server --dev tap configuration:
+ "resource limit WSA_MAXIMUM_WAIT_EVENTS has been
+ exceeded".
+* Added CRL (certificate revocation list) management
+ scripts to easy-rsa directory (Jon Bendtsen).
+* Do a better job of getting the ifconfig component
+ of the options consistency check to work correctly
+ when --up-delay is used.
+* De-inlined some functions which were too complex
+ to be inlined anyway with gcc.
+* If a --dhcp-option option is pushed to a non-windows
+ client, the option will be saved in the client's
+ environment before the --up script is called, under
+ the name "foreign_option_{n}".
+* Added --learn-address script (see man page) which
+ allows for firewall access through the VPN to be
+ controlled based on the client common name.
+* In mode --server mode, when a client connects to
+ the server, the server will disconnect any
+ still-active clients which use the same common
+ name. Use --duplicate-cn flag to revert to
+ previous behavior of allowing multiple clients
+ to concurrently connect with the same common name.
+
+2004.06.08 -- Version 2.0-beta4
+
+* Fixed issue with beta3 where Win32 service wrapper
+ was keying off of old TAP HWID as a dependency. To
+ ensure that the new service wrapper is correctly
+ installed, the Windows install script will uninstall
+ the old wrapper before installing the new one,
+ causing a reset of service properties.
+* Fixed permissions issue on --status output file,
+ with default access permissions of owner read/write
+ only (default permissions can be changed of course with
+ chmod).
+
+2004.06.05 -- Version 2.0-beta3
+
+* More changes to TAP-Win32 driver's INF file which
+ affects the placement of the driver in the Windows
+ device namespace. This is done to work around an
+ apparent bug in Windows when short HWIDs are used,
+ and will also ease the upgrade from 1.x to 2.0 by
+ reducing the chances that a reboot will be needed
+ on upgrade. Like beta2, this upgrade will
+ delete existing TAP-Win32 interfaces, and reinstall
+ a single new interface with default properties.
+* Major rewrite of I/O event wait layer in the style
+ of libevent. This is a precursor to TCP support
+ in --mode server.
+* New feature: --status. Outputs a SIGUSR2-like
+ status summary to a given file, updated once
+ per n seconds. The status file is comma delimited
+ for easy machine parsing.
+* --ifconfig-pool now remembers common names and
+ will try to assign a consistent IP to a given
+ common name. Still to do: persist --ifconfig-pool
+ memory across restarts by saving state in file.
+* Fixed bug in event timer queue which could cause
+ recurring timer events such as --ping to not
+ correctly schedule again after firing. This in
+ turn would cause spurrious ping restarts and possible
+ connection outages. Thanks to Denis Vlasenko for
+ tracking this down.
+* Possible fix to reported bug where --daemon argument
+ was not printing to syslog correctly after restart.
+* Fixed bug where pulling --route or --dhcp-option
+ directives from a server would problematically
+ interact with --persist-tun on the client.
+* Updated contrib/multilevel-init.patch (Farkas Levente).
+* Added RPM build option to .spec and .spec.in files
+ to optionally disable LZO inclusion (Ian Pilcher).
+* The latest MingW runtime and headers define
+ 'ssize_t', so a patch is needed (Gisle Vanem).
+
+2004.05.14 -- Version 2.0-beta2
+
+* Fixed signal handling bug in --mode server, where
+ SIGHUP and SIGUSR1 were treated as SIGTERM.
+* Changed the TAP-Win32 HWID from "TAP" to "TAPDEV".
+ Apparently the larger string may work around
+ a problem where the TAP adapter is sometimes missing
+ from the network connections panel, especially under
+ XP SP2. Also note that installing this upgrade will
+ uninstall any pre-existing TAP-Win32 adapters, and then
+ install a single new adapter, meaning that old adapter
+ properties will be lost. Thanks to Md5Chap for solving
+ this one.
+* For --mode server --dev tap, the options --ifconfig and
+ --ifconfig-pool are now optional. This allows address
+ assignment via DHCP or use of a TAP VPN without
+ IP support, as has always been possible with 1.x.
+* Fixed bug where --ifconfig may not work correctly on
+ Linux 2.2.
+* Added 'local' flag to --redirect-gateway for use on
+ networks where both OpenVPN daemons are connected
+ to a shared subnet, such as wireless.
+
+2004.05.09 -- Version 2.0-beta1
+
+* Unchanged from test29 except for version number
+ upgrade.
+
+2004.05.08 -- Version 2.0-test29
+
+* Modified --dev-node on Windows to accept a TAP-Win32
+ GUID name. In addition, --show-adapters will now
+ display the high-level name and GUID of each adapter.
+ This is an attempt to work around an issue in Windows
+ where sometimes the TAP-Win32 adapter installs correctly
+ but has no icon in the network connections control
+ panel. In such cases, being able to specify
+ --dev-node {TAP-GUID} can work around the missing icon.
+
+2004.05.07 -- Version 2.0-test28
+
+* Fixed bug which could cause segfault on program
+ shutdown if --route and --persist-tun are used
+ together.
+
+2004.05.06 -- Version 2.0-test27
+
+* Fixed bug in close_instance() which might cause
+ memory to be accessed after it had already been freed.
+* Fixed bug in verify_callback() that might have
+ caused uninitialized data to be referenced.
+* --iroute now allows full CIDR subnet routing.
+* In "--mode server --dev tun" usage, source addresses
+ on VPN packets coming from a particular client must
+ be associated with that client in the OpenVPN internal
+ routing table.
+
+2004.04.28 -- Version 2.0-test26
+
+* Optimized broadcast path in multi-client mode.
+* Added socket buffer size options --rcvbuf & --sndbuf.
+* Configure Linux tun/tap driver to use a more sensible
+ txqueuelen default. Also allow explicit setting
+ via --txqueuelen option (Harald Roelle).
+* The --remote option now allows the port number
+ to be specified as the second parameter. If
+ unspecified, the port number defaults to the
+ --rport value.
+* Multiple --remote options on the client can now be
+ specified for load balancing and failover. The
+ --remote-random flag can be used to initially randomize
+ the --remote list for basic load balancing.
+* If a remote DNS name resolves to multiple DNS addresses,
+ one will be chosen by random as a kind of basic
+ load-balancing feature if --remote-random is used.
+* Added --connect-freq option to control maximum
+ new connection frequency in multi-client mode.
+* In multi-client mode, all syslog messages associated
+ with a specific client now include a client-ID prefix.
+* For Windows, use a gettimeofday() function based
+ on QueryPerformanceCounter (Derek Burdick).
+* Fixed bug in interaction between --key-method 2
+ and DES ciphers, where dynamic keys would be generated
+ with bad parity and then be rejected.
+
+2004.04.17 -- Version 2.0-test24
+
+* Reworked multi-client broadcast handling.
+
+2004.04.13 -- Version 2.0-test23
+
+* Fixed bug in --dev tun --client-to-client routing.
+* Fixed a potential deadlock in --pull.
+* Fixed a problem with select() usage which could
+ cause a repeating sequence of "select : Invalid
+ argument (code=22)"
+
+2004.04.11 -- Version 2.0-test22
+
+* Fixed bug where --mode server + --daemon was
+ prematurely closing syslog connection.
+* Added support for --redirect-gateway on Mac OS X
+ (Jeremy Apple).
+* Minor changes to TAP-Win32 driver based on feedback
+ from the NDISTest tool.
+
+2004.04.11 -- Version 2.0-test21
+
+* Optimizations in multi-client server event loop.
+
+2004.04.10 -- Version 2.0-test20
+
+* --mode server capability now works with either tun
+ or tap interfaces. When used with tap interfaces,
+ OpenVPN will internally bridge all client tap
+ interfaces with the server tap interface.
+* Connecting clients can now have a client-specific
+ configuration on the server, based on the client
+ common name embedded in the client certificate.
+ See --client-config-dir and --client-connect.
+ These options can be used to configure client-specific
+ routes.
+* Added an option --client-to-client that enables
+ internal client-to-client routing or bridging.
+ Otherwise, clients will only "see" the server,
+ not other connected clients.
+* Fixed bug in route scheduling which would have caused
+ --mode server to not work on Windows in test18
+ and test19 with the sample config file.
+* Man page is up to date with all new options.
+* OpenVPN 2.0 release notes on web site updated
+ with tap-style tunnel examples.
+
+2004.04.02 -- Version 2.0-test19
+
+* Fixed bug where routes pushed from server were
+ not working correctly on Windows clients.
+* Added Mac OS X route patch (Jeremy Apple).
+
+2004.03.30 -- Version 2.0-test18
+
+* Minor fixes + Windows self-install modified
+ to use OpenSSL 0.9.7d.
+
+2004.03.29 -- Version 2.0-test17
+
+* Fixed some bugs related to instance timeout and deletion.
+* Extended --push/--pull option to support additional
+ option classes.
+
+2004.03.28 -- Version 2.0-test16
+
+* Successful test of --mode udp-server, --push,
+ --pull, and --ifconfig-pool with server on
+ Linux 2.4 and clients on Linux and Windows.
+
+2004.03.25 -- Version 2.0-test15
+
+* Implemented hash-table lookup of client instances
+ based either on remote UDP address/port or remote
+ ifconfig endpoint.
+* Implemented a randomized binary tree based
+ scheduler for scalably scheduling a large number
+ of client instance events. Uses the treap
+ data structure and node rotation algorithm
+ to keep the tree balanced.
+* Initial implementation of ifconfig-pool.
+* Made --key-method 2 the default.
+
+2004.03.20 -- Version 2.0-test14
+
+* Implemented --push and --pull.
+
+2004.03.20 -- Version 2.0-test13
+
+* Reduced struct tls_multi and --single-session
+ memory footprint.
+* Modified --single-session flag to be used
+ in multi-client UDP server client instances.
+
+2004.03.19 -- Version 2.0-test12
+
+* Added the key multi-client UDP server options,
+ --mode, --push, --pull, and --ifconfig-pool.
+* Revamped GC (garbage collection) code to not rely
+ on any global data.
+* Modifications to thread.[ch] to allow a more
+ flexible thread model.
+
+2004.03.16 -- Version 2.0-test11
+
+* Moved all timer code to interval.h, added new file
+ interval.c.
+* Fixed missing include.
+
+2004.03.16 -- Version 2.0-test10
+
+* More TAP-Win32 fixes.
+* Initial debugging and testing of multi.[ch].
+
+2004.03.14 -- Version 2.0-test9
+
+* Branch merge with 1.6-rc3
+* More point-to-multipoint work in multi.[ch].
+* Major TAP-Win32 driver restructuring to use
+ NdisMRegisterDevice instead of
+ IoCreateDevice/IoCreateSymbolicLink.
+* Changed TAP-Win32 symbolic links to use \DosDevices\Global\
+ pathname prefix.
+* In the majority of cases, TAP-Win32 should now be
+ able to install and uninstall on Win2K without requiring
+ a reboot.
+* TAP-Win32 MAC address can now be explicitly set in the
+ adapter advanced properties page.
+
+2004.03.04 -- Version 2.0-test8
+
+* Branch merge with 1.6-rc2.
+
+2004.03.03 -- Version 2.0-test7
+
+* Branch merge with 1.6-rc1.2.
+
+2004.03.02 -- Version 2.0-test6
+
+* Branch merge with 1.6-rc1.
+
+2004.03.02 -- Version 2.0-test5
+
+* Move Socks5 UDP header append/remove to socks.c, and is
+ called from forward.c.
+* Moved verify statics from ssl.c into struct tls_session.
+* Wrote multi.[ch] to handle top level of point-to-multipoint
+ mode.
+* Wrote some code to allow a struct link_socket in a child context
+ to be slaved to the parent context.
+* Broke up packet read and process functions in forward.c
+ (from socket or tuntap) into separate functions for read
+ and process, so that point-to-point and point-to-multipoint can
+ share the same code.
+* Expand TLS control channel to allow the passing of configuration
+ commands.
+* Wrote mroute.[ch] to handle internal packet routing for
+ point-to-multipoint mode.
+
+2004.02.22 -- Version 2.0-test3
+
+* Initial work on UDP multi-client server.
+* Branch merge of 1.6-beta7
+
+2004.02.14 -- Version 2.0-test2
+
+* Refactorization of openvpn.c into openvpn.[ch]
+ init.[ch] forward.[ch] forward-inline.h
+ occ.[ch] occ-inline.h ping.[ch] ping-inline.h
+ sig.[ch]. Created a master per-tunnel
+ struct context in openvpn.h.
+* Branch merge of 1.6-beta6.2
+
+2003.11.06 -- Version 2.0-test1
+
+* Initial testbed for 2.0.
+
+2004.05.09 -- Version 1.6.0
+
+* Unchanged from 1.6-rc4 except for version number
+ upgrade.
+
+2004.04.01 -- Version 1.6-rc4
+
+* Made minor customizations to devcon and
+ renamed as tapinstall.exe for Windows version.
+* Fixed "storage size of `iv' isn't known" build
+ problem on FreeBSD.
+* OpenSSL 0.9.7d bundled with Windows self-install.
+
+2004.03.13 -- Version 1.6-rc3
+
+* Minor Windows fixes for --ip-win32 dynamic, relating to
+ the way the TAP-Win32 driver responds to a DHCP request
+ from the Windows DHCP client.
+* The net_gateway environmental variable wasn't being
+ set correctly for called scripts (Paul Zuber).
+* Added code to determine the default gateway on FreeBSD,
+ allowing the --redirect-gateway option to work
+ (Juan Rodriguez Hervella).
+
+2004.03.04 -- Version 1.6-rc2
+
+* Fixed bug in Windows version where the NetBIOS node-type
+ DHCP option might have been passed even if it was not
+ specified.
+* Fixed bug in Windows version introduced in 1.6-rc1, where
+ DHCP timeout would be set to 0 seconds if --ifconfig option
+ was used and --ip-win32 option was not explicitly specified.
+* Added some new --dhcp-option types for Windows version.
+
+2004.03.02 -- Version 1.6-rc1
+
+* For Windows, make "--ip-win32 dynamic" the default.
+* For Windows, make "--route-delay 10" the default
+ unless --ip-win32 dynamic is not used or --route-delay
+ is explicitly specified.
+* L_TLS mutex could have been left in a locked state
+ for certain kinds of TLS errors.
+
+2004.02.22 -- Version 1.6-beta7
+
+* Allow scheduling priority increase (--nice) together
+ with UID/GID downgrade (--user/--group).
+* Code that causes SIGUSR1 restart on TLS errors in TCP
+ mode was not activated in pthread builds.
+* Save the certificate serial number in an environmental
+ variable called tls_serial_{n} prior to calling the
+ --tls-verify script. n is the current cert chain level.
+* Added NetBSD IPv6 tunnel capability (also requires
+ a kernel patch) (Horst Laschinsky).
+* Fixed bug in checking the return value of the nice()
+ function (Ian Pilcher).
+* Bug fix in new FreeBSD IPv6 over TUN code which was
+ originally added in 1.6-beta5 (Nathanael Rensen).
+* More Socks5 fixes -- extended the struct frame
+ infrastructure to accomodate proxy-based encapsulation
+ overhead.
+* Added --dhcp-option to Windows version for setting
+ adapter properties such as WINS & DNS servers.
+* Use a default route-delay of 5 seconds when
+ --ip-win32 dynamic is specified (only applicable when
+ --route-delay is not explicitly specified).
+* Added "log_append" registry variable to control
+ whether the OpenVPN service wrapper on Windows
+ opens log files in append (log_append="1") or
+ truncate (log_append="0") mode. The default
+ is truncate.
+
+2004.02.05 -- Version 1.6-beta6
+
+* UDP over Socks5 fix to accomodate Socks5 encapsulation
+ overhead (Christof Meerwald).
+* Minor --ip-win32 dynamic tweaks (use long lease time,
+ invalidate existing lease with DHCPNAK).
+
+2004.02.01 -- Version 1.6-beta5
+
+* Added Socks5 proxy support (Christof Meerwald).
+* IPv6 tun support for FreeBSD (Thomas Glanzmann).
+* Special TAP-Win32 debug mode for Windows self-install that was
+ enabled in beta4 is now turned off.
+* Added some new Solaris notes to INSTALL (Koen Maris).
+* More work on --ip-win32 dynamic.
+
+2004.01.27 -- Version 1.6-beta4
+
+* For this beta, the Windows self-install is a debug version
+ and will run slower -- use only for testing.
+* Reverted the --ip-win32 default back to 'ipapi'
+ from 'dynamic'.
+* Added the offset parameter to '--ip-win32 dynamic' which
+ can be used to control the address of the masqueraded
+ DHCP server which replies to Windows DHCP requests.
+* Added a wait/nowait option to --inetd (nowait can only
+ be used with TCP sockets, TLS authentication, and over
+ a bridged configuration -- see FAQ for more info)
+ (Stefan `Sec` Zehl).
+* Added a build-time capability where TAP-Win32 driver
+ debug messages can be output by OpenVPN at --verb 6
+ or higher.
+
+2004.01.20 -- Version 1.6-beta2
+
+* Added ./configure --enable-iproute2 flag which
+ uses iproute2 instead of route + ifconfig --
+ this is necessary for the LEAF Linux distro
+ (Martin Hejl).
+* Added renewal-time and rebind-time to set of
+ DHCP options returned by the TAP-Win32 driver when
+ "--ip-win32 dynamic" is used.
+
+2004.01.14 -- Version 1.6-beta1
+
+* Fixed --proxy bug that sometimes caused plaintext
+ control info generated by the proxy prior to http
+ CONNECT method establishment to be incorrectly
+ parsed as OpenVPN data.
+* For Windows version, implemented the
+ "--ip-win32 dynamic" method and made it the default.
+ This method sets the TAP-Win32 adapter IP address
+ and netmask by replying to the kernel's DHCP queries.
+ See the man page for more detailed info.
+* Added --connect-retry parameter which controls
+ the time interval (in seconds) between connect()
+ retries when --proto tcp-client is used. Previously,
+ this value was hardcoded to 5 seconds, and still
+ defaults as such.
+* --resolv-retry can now be used with a parameter
+ of "infinite" to retry indefinitely.
+* Added SSL_CTX_use_certificate_chain_file() to ssl.c
+ for support of multi-level certificate chains
+ (Sten Kalenda).
+* Fixed --tls-auth incompatibility with 1.4.x and earlier
+ versions of OpenVPN when the passphrase file is an
+ OpenVPN static key file (as generated by --genkey).
+* Added shell-escape support in config files using
+ the backslash character ("\") so that (for example)
+ double quotes can be passed to the shell.
+* Added "contrib" subdirectory on tarball, source zip,
+ and CVS containing user-submitted contributions.
+* Added an optional patch to the Redhat init script to
+ allow the configuration file directory to be a
+ multi-level directory hierarchy (Farkas Levente).
+ See contrib/multilevel-init.patch
+* Added some scripts and documentation on using
+ Linux "fwmark" iptables rules to enable
+ fine-grained routing control over the VPN
+ (Sean Reifschneider, <jafo@tummy.com>).
+ See contrib/openvpn-fwmarkroute-1.00
+
+2003.11.20 -- Version 1.5.0
+
+* Minor documentation changes.
+
+2003.11.04 -- Version 1.5-beta14
+
+* Fixed build problem with ./configure --disable-ssl
+ that was reported on Debian woody.
+* Fixed bug where --redirect-gateway could not be used
+ together with --resolv-retry.
+
+2003.11.03 -- Version 1.5-beta13
+
+* Added CRL (certificate revocation list) capability using
+ --crl-verify option (Stefano Bracalenti).
+* Added --replay-window option for variable replay-protection
+ window sizes.
+* Fixed --fragment bug which might have caused certain large
+ packets to be sent unfragmented.
+* Modified --secret and --tls-auth to permit different cipher and
+ HMAC keys to be used for each data flow direction. Also
+ increased static key file size generated by --genkey from
+ 1024 to 2048 bits, where 512 bits each are reserved for
+ send-HMAC, encrypt, receive-HMAC, and decrypt. Key file forward
+ and backward compatibility is maintained. See --secret option
+ documentation on the man page for more info.
+* Added --tls-remote option (Teemu Kiviniemi).
+* Fixed --tls-cipher documention regarding correct delimiter
+ usage (Teemu Kiviniemi).
+* Added --key-method option for selecting alternative data
+ channel key negotiation methods. Method 1 is the default.
+ Method 2 has been added (see man page for more info).
+* Added French translation of HOWTO to web site
+ (Guillaume Lehmann).
+* Fixed problem caused by late resolver library load on
+ certain platforms when --resolv-retry and --chroot are
+ used together (Teemu Kiviniemi).
+* In TCP mode, all decryption or TLS errors will abort the current
+ connection (this is not done in UDP mode because UDP is
+ "connectionless").
+* Fixed a TCP client reconnect bug that only occurs on the
+ BSDs, where connect() fails with an invalid argument. This
+ bug was partially (but not completely) fixed in beta7.
+* Added "route_net_gateway" environmental variable which contains
+ the pre-existing default gateway address from the routing table
+ (there's no standard API for getting the default gateway, so
+ right now this feature only works on Windows or Linux).
+* Renamed the "route_default_gateway" enviromental variable to
+ "route_vpn_gateway" -- this is the remote VPN endpoint.
+* The special keywords vpn_gateway, net_gateway, and remote_host
+ can now be used for the network or gateway components of the
+ --route option. See the man page for more info.
+* Added the --redirect-gateway option to configure the VPN
+ as the default gateway (implemented on Linux and Windows only).
+* Added the --http-proxy option with basic authentication
+ support for use in TCP client mode. Successfully tested
+ using Squid as the HTTP proxy, with and without authentication.
+
+2003.10.12 -- Version 1.5-beta12
+
+* Fixed Linux-only bug in --mktun and --rmtun which was
+ introduced around beta8 or so, which would cause
+ an error such as "I don't recognize device tun0 as a
+ tun or tap device1".
+* Added --ifconfig-nowarn option to disable options
+ consistency warnings about --ifconfig parameters.
+* Don't allow any kind of sequence number backtracking or
+ message reordering when in TCP mode.
+* Changed beta naming convention to use '_' (underscore)
+ rather than '-' (dash) to pacify rpmbuild.
+
+2003.10.08 -- Version 1.5-beta11
+
+* Modified code in the Windows version which sets the IP address
+ and netmask of the TAP-Win32 adapter using the IP Helper API.
+ Most of the changes involve better error recovery when
+ the IP Helper API returns an error status. See the
+ manual page entry on --ip-win32 for more info.
+
+2003.10.08 -- Version 1.5-beta10
+
+* Added getpass() function for Windows version so that --askpass
+ option works correctly (Stefano Bracalenti).
+* Added reboot advisory to end of Win32 install script.
+* Changed crypto code to use pseudo-random IVs rather than
+ carrying forward the IV state from the previous packet.
+ This is in response to item 2 in the following document:
+ http://www.openssl.org/~bodo/tls-cbc.txt which points
+ out weaknesses in TLS's use of the same IV carryforward
+ approach. This change does not break protocol compatibility
+ with previous versions of OpenVPN.
+* Made a change to the crypto replay protection code to also
+ protect against certain kinds of packet reordering attacks.
+ This change does not break protocol compatibility with
+ previous versions of OpenVPN.
+* Added --ip-win32 option to provide several choices for
+ setting the IP address on the TAP-Win32 adapter.
+* #ifdefed out non-CBC crypto modes by default.
+* Added --up-delay option to delay TUN/TAP open and --up script
+ execution until after connection establishment. This option
+ replaces the earlier windows-only option --tap-delay.
+
+2003.10.01 -- Version 1.5-beta9
+
+* Fixed --route-noexec bug where option was not parsed correctly.
+* Complain if --dev tun is specified without --ifconfig on Windows.
+* Fixed bug where TCP connections on windows would sometimes cause
+ an assertion failure.
+* Added a new flag to TAP-Win32 advanced properties that allows one
+ to set the adapter to be always "connected" even when an OpenVPN
+ process doesn't have it open. The default behavior is to report
+ a media status of connected only when an OpenVPN process has the
+ adapter open.
+* Rebuilt the Windows self-install distribution with OpenSSL 0.9.7c
+ DLLs in response to an OpenSSL security advisory.
+
+2003.09.30 -- Version 1.5-beta8
+
+* Extended the --ifconfig option to work on tap devices as well
+ as tun devices.
+* Implemented the --ifconfig option for Windows, by calling the
+ netsh tool.
+* By default, do an "arp -d *" on Windows after TAP-Win32 open to
+ refresh the MAC cache. This behaviour can be disabled with
+ --no-arp-del.
+* On Windows, allow the --dev-node parameter (which specifies
+ the name of the TAP-Win32 adapter) to be omitted in cases where
+ there is a single TAP-Win32 adapter on the system which can be
+ assumed to be the default.
+* Modified the diagnostic --verb 5 debugging level to print 'R'
+ for TCP/UDP read, 'W' for TCP/UDP write, 'r' for TUN/TAP read,
+ and 'w' for TUN/TAP write.
+* Conditionalize OpenBSD read_tun and write_tun based on tun or tap
+ mode.
+* Added IPv6 tun support to OpenBSD (Thomas Glanzmann).
+* Make the --enable-mtu-dynamic ./configure option enabled by
+ default.
+* Deprecated the --mtu-dynamic run-time option, in favor of
+ --fragment.
+* DNS names can now be used as --ifconfig parameters.
+* Significant work on TAP-Win32 driver to bring up to SMP standards.
+* On Windows, fixed dangling IRP problem if TAP-Win32 driver is
+ unloaded or disabled, while a user-space process has it open.
+* On Windows, if --tun-mtu is not specified, it will be read from
+ the TAP-Win32 driver via ioctl.
+* On Windows, added TAP-Win32 driver status info to "F2" keyboard
+ signal (only when run from a console window).
+* Added --mssfix option to control TCP MSS size (YANO Hirokuni).
+* Renamed --mtu-dynamic option to --fragment to more accurately
+ reflect its function. Fragment accepts a single parameter which
+ is the upper limit on acceptable UDP packet size.
+* Changed default --tun-mtu-extra parameter to 32 from 64.
+* Eliminated reference to malloc.o in configure.ac.
+* Added tun device emulation to the TAP-Win32 driver.
+* Added --route and related options.
+* Added init script for SuSE Linux (Frank Plohmann).
+* Extended option consistency check between peers to function
+ in all crypto modes, including static-key and cleartext modes.
+ Previously only TLS mode was supported. Disable with
+ --disable-occ.
+* Overall, increased the amount of configuration option sanity
+ checking, especially of networking parameters.
+* Added --mtu-test option for empirical MTU measurement.
+* Added Windows-only option --tap-delay to not set the TAP-Win32
+ adapter media state to 'connected' until TCP/UDP connection
+ establishment with peer.
+* Slightly modified --route/--route-delay semantics so that when
+ --route is given without --route-delay, routes are added
+ immediately after tun/tap device open. When --route-delay is
+ specified, routes will be added n seconds after connection
+ initiation, where n is the --route-delay parameter (which
+ can be set to 0).
+* Made TCP framing error into a non-fatal error that triggers a
+ connection reset.
+
+2003.08.28 -- Version 1.5-beta7
+
+* Fixed bug that caused OpenVPN not to respond to exit/restart
+ signals when --resolv-retry is used and a local or remote DNS
+ name cannot be resolved.
+* Exported a series of environmental variables with useful
+ info for scripts. See man page for more info. Based
+ on a suggestion by Anthony Ciaravalo.
+* Moved TCP/UDP socket bind to a point in the initialization
+ before the --up script gets called. This is desirable
+ because (a) a socket bind failure will happen before
+ daemonization, allowing an error status code to be returned
+ to the shell and (b) the possibility is eliminated of a
+ socket bind failure causing the --up script to be run
+ but not the --down script. This change has a side effect
+ that --resolv-retry will no longer work with --local.
+* Fixed bug where if an OpenVPN TCP server went down and back
+ up again, Solaris or FreeBSD clients would fail to reconnect
+ to it.
+* Fixed bug that prevented OpenVPN from being run by
+ inetd/xinetd in TCP mode.
+* Added --log and --log-append options for logging messages to
+ a file.
+* On Windows, check that the current user is a member of the
+ Administrator group before attempting install or uninstall.
+
+2003.08.16 -- Version 1.5-beta6
+
+* Fixed TAP-Win32 driver to properly increment the Rx/Tx count.
+
+2003.08.14 -- Version 1.5-beta5
+
+* Added user-configurability of the TAP-Win32 adapter MTU
+ through the adapter advanced properties page.
+* Added Windows Service support.
+* On Windows, added file association and right-clickability
+ for .ovpn files (OpenVPN config files).
+
+2003.08.05 -- Version 1.5-beta4
+
+* Extra refinements and error checking added to Windows
+ NSIS install script.
+
+2003.08.05 -- Version 1.5-beta3
+
+* Added md5.h include to crypto.c to fix build problem on
+ OpenBSD.
+* Created a Win32 installer using NSIS.
+* Removed DelService command from TAP-Win32 INF file. It appears
+ to be not necessary and it interfered with the ability to
+ uninstall and reinstall the driver without needing to reboot.
+* On Windows version, added "addtap" and "deltapall" batch
+ files to add and delete TAP-Win32 adapter instances.
+
+2003.07.31 -- Version 1.5-beta2
+
+* Renamed INSTALL.w32 to INSTALL-win32.txt and reformatted
+ in Windows ASCII so it's easier to click and view.
+* Added postscript and PDF versions of the HOWTO to the web
+ site (C R Zamana).
+* Merged Michael Clarke's stability patch into TAP-Win32
+ driver which appears to fix the suspend/resume driver bug
+ and significantly improve driver stability.
+* Added Christof Meerwald's Media Status patch to the
+ TAP-Win32 driver which shows the TAP adapter to be
+ disconnected when OpenVPN is not running.
+* Moved socket connect and TCP server listen code to a later
+ point in openvpn() function so that the TCP server listen
+ state is entered after daemonization.
+* Added keyboard shortcuts to simulate signals in the Windows
+ version, see the window title bar for descriptions.
+
+2003.07.24 -- Version 1.5-beta1
+
+* Added TCP support via the new --proto option.
+* Renamed udp-centric options such as --udp-mtu to
+ --link-mtu (old option names preserved for compatibility).
+* Ported to Windows 2000 + XP using mingw and a TAP driver
+ derived from the Cipe-Win32 project by Damion K. Wilson.
+* Added --show-adapters flag for windows version.
+* Reworked the SSL/TLS packet acknowledge code to better
+ handle certain corner cases.
+* Turned off the default enabling of IP forwarding in the
+ sample-scripts/openvpn.init script for Redhat.
+ Forwarding can be enabled by users in their --up scripts
+ or firewall config.
+* Added --up-restart option based on suggestion from Sean
+ Reifschneider.
+* If --dev tap or --dev-type tap is specified, --tun-mtu
+ defaults to 1500 and --tun-mtu-extra defaults to 64.
+* Enabled --verb 5 debugging mode that prints 'R' and 'W'
+ for each packet read or write on the TCP/UDP socket.
+
+2003.08.04 -- Version 1.4.3
+
+* Added md5.h include to crypto.c
+ to fix build problem on OpenBSD.
+
+2003.07.15 -- Version 1.4.2
+
+* Removed adaptive bandwidth from
+ --mtu-dynamic -- its absence appears
+ to work better than its existence (1.4.1.2).
+* Minor changes to --shaper to fix long
+ retransmit timeouts at low bandwidth
+ (1.4.1.2).
+* Added LOG_RW flag to openvpn.h for
+ debugging (1.4.1.2).
+* Silenced spurious configure warnings (1.4.1.2).
+* Backed out --dev-name patch, modified --dev
+ to offer equivalent functionality (1.4.1.4).
+* Added an optional parameter to --daemon and
+ --inetd to support the passing of a custom
+ program name to the system logger (1.4.1.5).
+* Add compiled-in options to the program title
+ (1.4.1.5).
+* Coded the beginnings of a WIN32 port (1.4.1.5).
+* Succeeded in porting to Win32 Mingw environment
+ and running loopback tests (1.4.1.6). Still
+ need a kernel driver for full Win32
+ functionality.
+* Fixed a bug in error.h where
+ HAVE_CPP_VARARG_MACRO_GCC was misspelled.
+ This would have caused a significant slowdown
+ of OpenVPN when built by compilers that
+ lack ISO C99 vararg macros (1.4.1.6).
+* Created an init script for Gentoo Linux
+ in ./gentoo directory (1.4.1.6).
+
+2003.05.15 -- Version 1.4.1
+
+* Modified the Linux 2.4 TUN/TAP open code to
+ fall back to the 2.2 TUN/TAP interface if the
+ open or ioctl fails.
+* Fixed bug when --verb is set to 0 and non-fatal
+ socket errors occur, causing 100% CPU utilization.
+ Occurs on platorms where
+ EXTENDED_SOCKET_ERROR_CAPABILITY is defined,
+ such as Linux 2.4.
+* Fixed typo in tun.c that was preventing
+ OpenBSD build.
+* Added --enable-mtu-dynamic configure option
+ to enable --mtu-dynamic experimental option.
+
+2003.05.07 -- Version 1.4.0
+
+* Added --replay-persist feature to allow replay
+ protection across sessions.
+* Fixed bug where --ifconfig could not be used
+ with --tun-mtu.
+* Added --tun-mtu-extra parameter to deal with
+ the situation where a read on a TUN/TAP device
+ returns more data than the device's MTU size.
+* Fixed bug where some IPv6 support code for
+ Linux was not being properly ifdefed out for
+ Linux 2.2, causing compile errors.
+* Added OPENVPN_EXIT_STATUS_x codes to
+ openvpn.h to control which status value
+ openvpn returns to its caller (such as
+ a shell or inetd/xinetd) for various conditions.
+* Added OPENVPN_DEBUG_COMMAND_LINE flag to
+ openvpn.h to allow debugging in situations
+ where stdout, stderr, and syslog cannot be used
+ for message output, such as when OpenVPN is
+ instantiated by inetd/xinetd.
+* Removed owner-execute permission from file
+ created by static key generator (Herbert Xu
+ and Alberto Gonzalez Iniesta).
+* Added --passtos option to allow IPv4 TOS bits
+ to be passed from TUN/TAP input packets to
+ the outgoing UDP socket (Craig Knox).
+* Added code to prevent open socket file descriptors
+ from being accessible to called scripts.
+* Added --dev-name option (Christian Lademann).
+* Added --mtu-disc option for manual control
+ over MTU options.
+* Show OS MTU value on UDP socket write failures
+ (linux only).
+* Numerous build system and portability
+ fixes (Matthias Andree).
+* Added better sensing of compiler support for
+ variable argument macros, including (a) gcc
+ style, (b) ISO C 1999 style, and (c) no support.
+* Removed generated files from CVS. Note INSTALL
+ file for new CVS build commands.
+* Changed certain internal symbol names
+ for C standards compliance.
+* Added TUN/TAP open code to cycle dynamically
+ through unit numbers until it finds a free
+ unit (based on code from Thomas Gielfeldt
+ and VTun).
+* Added dynamic MTU and fragmenting infrastructure
+ (Experimental). Rebuild with FRAGMENT_ENABLE
+ defined to enable.
+* Minor changes to SSL/TLS negotiation, use
+ exponential backoff on retransmits, and use
+ a smaller MTU size (note that no protocol
+ changes have been made which would break
+ compatibility with 1.3.x).
+* Added --enable-strict-options flag
+ to ./configure. This option will cause
+ a more strict check for options compatibility
+ between peers when SSL/TLS negotiation is used,
+ but should only be used when both OpenVPN peers
+ are of the same version.
+* Reorganization of debugging levels.
+* Added a workaround in configure.ac for
+ default SSL header location on Linux
+ to fix RH9 build problem.
+* Fixed potential deadlock when pthread support
+ is used on OSes that allocate a small socketpair()
+ message buffer.
+* Fixed openvpn.init to be sh compliant
+ (Bishop Clark).
+* Changed --daemon to wait until all
+ initialization is finished before becoming a
+ daemon, for the benefit of initialization
+ scripts that want a useful return status from
+ the openvpn command.
+* Made openvpn.init script more robust, including
+ positive indication of initialization errors
+ in the openvpn daemon and better sanity checks.
+* Changed --chroot to wait until initialization
+ is finished before calling chroot(), and allow
+ the use of --user and --group with --chroot.
+* When syslog logging is enabled (--daemon or
+ --inetd), set stdin/stdout/stderr to point
+ to /dev/null.
+* For inetd instantiations, dup socket descriptor
+ to a >2 value.
+* Fixed bug in verify-cn script, where test would
+ incorrectly fail if CN=x was the last component
+ of the X509 composite string (Anonymous).
+* Added Markus F.X.J. Oberhumer's special
+ license exception to COPYING.
+
+2002.10.23 -- Version 1.3.2
+
+* Added SSL_CTX_set_client_CA_list call
+ to follow the canonical form for TLS initialization
+ recommended by the OpenSSL docs. This change allows
+ better support for intermediate CAs and has no impact
+ on security.
+* Added build-inter script to easy-rsa package, to
+ facilitate the generation of intermediate CAs.
+* Ported to NetBSD (Dimitri Goldin).
+* Fixed minor bug in easy-rsa/sign-req. It refers to
+ openssl.cnf file, instead of $KEY_CONFIG, like all
+ other scripts (Ernesto Baschny).
+* Added --days 3650 to the root CA generation command
+ in the HOWTO to override the woefully small 30 day
+ default (Dominik 'Aeneas' Schnitzer).
+* Fixed bug where --ping-restart would sometimes
+ not re-resolve remote DNS hostname.
+* Added --tun-ipv6 option and related infrastructure
+ support for IPv6 over tun.
+* Added IPv6 over tun support for Linux (Aaron Sethman).
+* Added FreeBSD 4.1.1+ TUN/TAP driver notes to
+ INSTALL (Matthias Andree).
+* Added inetd/xinetd support (--inetd) including
+ documentation in the HOWTO.
+* Added "Important Note on the use of commercial certificate
+ authorities (CAs) with OpenVPN" to HOWTO based on
+ issues raised on the openvpn-users list.
+
+2002.07.10 -- Version 1.3.1
+
+* Fixed bug in openvpn.spec and openvpn.init
+ which caused RPM upgrade to fail.
+
+2002.07.10 -- Version 1.3.0
+
+* Added --dev-node option to allow explicit selection of
+ tun/tap device node.
+* Removed mlockall call from child thread, as it doesn't
+ appear to be necessary (child thread inherits mlockall
+ state from parent).
+* Added --ping-timer-rem which causes timer for --ping-exit
+ and --ping-restart not to run unless we have a remote IP
+ address.
+* Added condrestart to openvpn.init and openvpn.spec
+ (Bishop Clark).
+* Added --ifconfig case for FreeBSD (Matthias Andree).
+* Call openlog with facility=LOG_DAEMON (Matthias Andree).
+* Changed LOG_INFO messages to LOG_NOTICE.
+* Added warning when key files are group/others accessible.
+* Added --single-session flag for TLS mode.
+* Fixed bug where --writepid would segfault if used with
+ an invalid filename.
+* Fixed bug where --ipchange status message was formatted
+ incorrectly.
+* Print more concise error message when system() call
+ fails.
+* Added --disable-occ option.
+* Added --local, --remote, and --ifconfig options sanity
+ check.
+* Changed default UDP MTU to 1300 and TUN/TAP MTU to
+ 1300.
+* Successfully tested with OpenSSL 0.9.7 Beta 2.
+* Broke out debug level definitions to errlevel.h
+* Minor documentation and web site changes.
+* All changes maintain protocol compatibility
+ with OpenVPN versions since 1.1.0, however default
+ MTU changes will require setting the MTU explicitly
+ by command line option, if you want 1.3.0 to
+ communicate with previous versions.
+
+2002.06.12 -- Version 1.2.1
+
+* Added --ping-restart option to restart
+ connection on ping timeout using SIGUSR1
+ logic (Matthias Andree).
+* Added --persist-tun, --persist-key,
+ --persist-local-ip, and --persist-remote-ip
+ options for finer-grained control over SIGUSR1
+ and --ping-restart restarts. To
+ replicate previous SIGUSR1 functionality,
+ use --persist-remote-ip.
+* Changed residual IV fetching code to take
+ IV from tail of ciphertext.
+* Added check to make sure that CFB or OFB
+ cipher modes are only used with SSL/TLS
+ authentication mode, and added a caveat
+ to INSTALL.
+* Changed signal handling during initialization
+ (including re-initialization during restarts)
+ to exit on SIGTERM or SIGINT and ignore other
+ signals which would ordinarily be caught.
+* Added --resolv-retry option to allow
+ retries on hostname resolution.
+* Expanded the --float option to also
+ allow dynamic changes in source port number
+ on incoming datagrams.
+* Added --mute option to limit repetitive
+ logging of similar message types.
+* Added --group option to downgrade GID
+ after initialization.
+* Try to set ifconfig path automatically
+ in configure.
+* Added --ifconfig code for Mac OS X
+ (Christoph Pfisterer).
+* Moved "Peer Connection Initiated" message
+ to --verb level 1.
+* Successfully tested with
+ OpenSSL 0.9.7 Beta 1 and AES cipher.
+* Added RPM notes to INSTALL.
+* Added ACX_PTHREAD (from the autoconf
+ macro archive) to configure.ac
+ to figure out the right pthread
+ options for a given platform.
+* Broke out macro definitions from
+ configure.ac to acinclude.m4.
+* Minor changes to docs and HOWTO.
+* All changes maintain protocol compatibility
+ with OpenVPN versions since 1.1.0.
+
+2002.05.22 -- Version 1.2.0
+
+* Added configuration file support via
+ the --config option.
+* Added pthread support to improve latency.
+ With pthread support, OpenVPN
+ will offload CPU-intensive tasks such as RSA
+ key number crunching to a background thread
+ to improve tunnel packet forwarding
+ latency. pthread support can be enabled
+ with the --enable-pthread configure option.
+ Pthread support is currently available
+ only for Linux and Solaris.
+* Added --dev-type option so that tun/tap
+ device names don't need to begin with
+ "tun" or "tap".
+* Added --writepid option to write main
+ process ID to a file.
+* Numerous portability fixes to ease
+ porting to other OSes including changing
+ all network types to uint8_t and uint32_t,
+ and not assuming that time_t is 32 bits.
+* Backported to OpenSSL 0.9.5.
+* Ported to Solaris.
+* Finished OpenBSD port except for
+ pthread support.
+* Added initialization script:
+ sample-scripts/openvpn.init
+ (Douglas Keller)
+* Ported to Mac OS X (Christoph Pfisterer).
+* Improved resilience to DoS attacks when
+ TLS mode is used without --remote or
+ --tls-auth, or when --float is used
+ with --remote. Note however that the best
+ defense against DoS attacks in TLS mode
+ is to use --tls-auth.
+* Eliminated automake/autoconf dependency
+ for non-developers.
+* Ported configure.in to configure.ac
+ and autoconf 2.50+.
+* SIGHUP signal now causes OpenVPN to restart
+ and re-read command line and or config file,
+ in conformance with canonical daemon behaviour.
+* SIGUSR1 now does what SIGHUP did in
+ version 1.1.1 and earlier -- close and reopen
+ the UDP socket for use when DHCP changes
+ host's IP address and preserve most recently
+ authenticated peer address without rereading
+ config file.
+* SIGUSR2 added -- outputs current statistics,
+ including compression statistics.
+* All changes maintain protocol compatibility
+ with 1.1.1 and 1.1.0.
+
+2002.04.22 -- Version 1.1.1
+
+* Added --ifconfig option to automatically configure
+ TUN device.
+* Added inactivity disconnect (--inactive
+ and --ping-exit options).
+* Added --ping option to keep stateful firewalls
+ from timing out.
+* Added sanity check to command line parser to
+ err if any TLS options are used in non-TLS mode.
+* Fixed build problem with compiler environments that
+ define printf as a macro.
+* Fixed build problem on linux systems that have
+ an integrated TUN/TAP driver but lack the persistent
+ tunnel feature (TUNSETPERSIST). Some linux kernels
+ >= 2.4.0 and < 2.4.7 fall into this category.
+* Changed all calls to EVP_CipherInit to use explicit
+ encrypt/decrypt mode in order to fix problem with
+ IDEA-CBC and AES-256-CBC ciphers.
+* Minor changes to control channel transmit limiter
+ algorithm to fix problem where TLS control channel
+ might not renegotiate within the default 60 second window.
+* Simplified man page examples by taking advantage
+ of the new --ifconfig option.
+* Minor changes to configure.in to check more
+ rigourously for OpenSSL 0.9.6 or greater.
+* Put back openvpn.spec, eliminated
+ openvpn.spec.in.
+* Modified openvpn.spec to reflect new automake-based
+ build environment (Bishop Clark).
+* Other documentation changes.
+* Added --test-crypto option for debugging.
+* Added "missing" and "mkinstalldirs" automake
+ support files.
+
+
+2002.04.09 -- Version 1.1.0
+
+* Strengthened replay protection and IV handling,
+ extending it fully to both static key and
+ TLS dynamic key exchange modes.
+* Added --mlock option to disable paging and ensure that key
+ material and tunnel data is never paged to disk.
+* Added optional traffic shaping feature to cap the maximum
+ data rate of the tunnel.
+* Converted to automake (The Platypus Brothers 2002-04-01).
+* Ported to OpenBSD by Janne Johansson.
+* Added --tun-af-inet option to work around an incompatibility
+ between Linux and BSD tun drivers.
+* Sequence number-based replay protection using the
+ IPSec sliding window model is now the default,
+ disable with --no-replay.
+* Explicit IV is now the default, disable with --no-iv.
+* Disabled all cipher modes except CBC, CFB, and OFB.
+* In CBC mode, use explicit IV and carry forward residuals,
+ using IPSec model.
+* In CFB/OFB mode, IV is timestamp, sequence number.
+* Eliminated --packet-id, --timestamp, and max-delta parameter to
+ the --tls-auth option as they are now supplanted by improved
+ replay code which is enabled by default.
+* Eliminated --rand-iv as it is now obsolete with improved
+ IV code.
+* Eliminated --reneg-err option as it increases vulnerability
+ to DoS attacks.
+* Added weak key check for DES ciphers.
+* --tls-freq option is no longer specified on the command line,
+ instead it now inherits its parameter from the
+ --tls-timeout option.
+* Fixed bug that would try to free memory on exit that was
+ never malloced if --comp-lzo was not specified.
+* Errata fixed in the man page examples: "test-ca" should be
+ "tmp-ca".
+* Updated manual page.
+* Preliminary work in porting to OpenSSL 0.9.7.
+* Changed license to allowing linking with OpenSSL.
+
+2002.03.29 -- Version 1.0.3
+
+* Fixed a problem in configure with library ordering on the
+ command line.
+
+2002.03.28 -- Version 1.0.2
+
+* Improved the efficiency of the inner event loop.
+* Fixed a minor bug with timeout handling.
+* Improved the build system to build on RH 6.2 through 7.2.
+* Added an openvpn.spec file for RPM builders (Bishop Clark).
+
+2002.03.23 -- Version 1.0
+
+* Added TLS-based authentication and key exchange.
+* Added gremlin mode to stress test.
+* Wrote man page.
+
+2001.12.26 -- Version 0.91
+
+* Added any choice of cipher or HMAC digest.
+
+2001.5.13 -- Version 0.90
+
+* Initial release.
+* IP tunnel over UDP, with blowfish cipher and SHA1 HMAC signature.
diff --git a/ics-openvpn-stripped/main/openvpn/INSTALL b/ics-openvpn-stripped/main/openvpn/INSTALL
new file mode 100644
index 00000000..2ef7904b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/INSTALL
@@ -0,0 +1,336 @@
+Installation instructions for OpenVPN, a Secure Tunneling Daemon
+
+Copyright (C) 2002-2010 OpenVPN Technologies, 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.
+
+*************************************************************************
+
+QUICK START:
+
+ Unix:
+ ./configure && make && make-install
+
+ Cross-compile for Windows on Unix
+
+ See INSTALL-win32.txt
+
+*************************************************************************
+
+To download OpenVPN, go to:
+
+ http://openvpn.net/download.html
+
+OpenVPN releases are also available as Debian/RPM packages:
+
+ https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
+
+To download easy-rsa go to:
+
+ https://github.com/OpenVPN/easy-rsa
+
+To download tap-windows driver source code go to:
+
+ https://github.com/OpenVPN/tap-windows
+
+To get the cross-compilation environment go to:
+
+ https://github.com/OpenVPN/openvpn-build
+
+For step-by-step instructions with real-world examples see:
+
+ http://openvpn.net/howto.html
+ https://community.openvpn.net/openvpn/wiki
+
+For examples see:
+
+ http://openvpn.net/examples.html
+
+Also see the man page for more information, usage examples, and information on
+firewall configuration.
+
+*************************************************************************
+
+SUPPORTED PLATFORMS:
+ (1) Linux (kernel 2.6+)
+ (2) Solaris
+ (3) OpenBSD 5.1+
+ (4) Mac OS X Darwin 10.5+
+ (5) FreeBSD 7.4+
+ (6) NetBSD 5.0+
+ (7) Windows (WinXP and higher)
+
+SUPPORTED PROCESSOR ARCHITECTURES:
+ In general, OpenVPN is word size and endian independent, so
+ most processors should be supported. Architectures known to
+ work include Intel x86, Alpha, Sparc, Amd64, and ARM.
+
+REQUIRES:
+ (1) TUN and/or TAP driver to allow user-space programs to control
+ a virtual point-to-point IP or Ethernet device. See
+ TUN/TAP Driver Configuration section below for more info.
+
+OPTIONAL (but recommended):
+ (1) OpenSSL library, necessary for encryption, version 0.9.8 or higher
+ required, available from http://www.openssl.org/
+ (2) PolarSSL library, an alternative for encryption, version 1.1 or higher
+ required, available from https://polarssl.org/
+ (3) LZO real-time compression library, required for link compression,
+ available from http://www.oberhumer.com/opensource/lzo/
+ OpenBSD users can use ports or packages to install lzo, but remember
+ to add CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
+ directives to "configure", since gcc will not find them otherwise.
+
+OPTIONAL (for developers only):
+ (1) Autoconf 2.59 or higher + Automake 1.9 or higher
+ -- available from http://www.gnu.org/software/software.html
+ (2) Dmalloc library
+ -- available from http://dmalloc.com/
+ (3) If using t_client.sh test framework, fping/fping6 is needed
+ -- Available from http://www.fping.org/
+ Note: t_client.sh needs an external configured OpenVPN server.
+ See t_client.rc-sample for more info.
+
+*************************************************************************
+
+CHECK OUT SOURCE FROM SOURCE REPOSITORY:
+
+ Clone the repository:
+
+ git clone https://github.com/OpenVPN/openvpn
+ git clone git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn
+
+ Check out stable version:
+
+ git checkout -b 2.2 remotes/origin/release/2.2
+
+ Check out master (unstable) branch:
+
+ git checkout master
+
+
+*************************************************************************
+
+BUILD COMMANDS FROM TARBALL:
+
+ ./configure
+ make
+ make install
+
+*************************************************************************
+
+BUILD COMMANDS FROM SOURCE REPOSITORY CHECKOUT:
+
+ autoreconf -i -v -f
+ ./configure
+ make
+ make install
+
+*************************************************************************
+
+BUILD A TARBALL FROM SOURCE REPOSITORY CHECKOUT:
+
+ autoreconf -i -v -f
+ ./configure
+ make dist
+
+*************************************************************************
+
+TESTS (after BUILD):
+
+make check (Run all tests below)
+
+Test Crypto:
+
+./openvpn --genkey --secret key
+./openvpn --test-crypto --secret key
+
+Test SSL/TLS negotiations (runs for 2 minutes):
+
+./openvpn --config sample/sample-config-files/loopback-client (In one window)
+./openvpn --config sample/sample-config-files/loopback-server (Simultaneously in another window)
+
+For more thorough client-server tests you can configure your own, private test
+environment. See tests/t_client.rc-sample for details.
+
+*************************************************************************
+
+OPTIONS for ./configure:
+
+ --disable-lzo disable LZO compression support [default=yes]
+ --enable-lzo-stub don't compile LZO compression support but still
+ allow limited interoperability with LZO-enabled
+ peers [default=no]
+ --disable-crypto disable crypto support [default=yes]
+ --disable-ssl disable SSL support for TLS-based key exchange
+ [default=yes]
+ --enable-x509-alt-username
+ enable the --x509-username-field feature
+ [default=no]
+ --disable-multi disable client/server support (--mode server +
+ client mode) [default=yes]
+ --disable-server disable server support only (but retain client
+ support) [default=yes]
+ --disable-plugins disable plug-in support [default=yes]
+ --disable-management disable management server support [default=yes]
+ --enable-pkcs11 enable pkcs11 support [default=no]
+ --disable-socks disable Socks support [default=yes]
+ --disable-http-proxy disable HTTP proxy support [default=yes]
+ --disable-fragment disable internal fragmentation support (--fragment)
+ [default=yes]
+ --disable-multihome disable multi-homed UDP server support (--multihome)
+ [default=yes]
+ --disable-port-share disable TCP server port-share support (--port-share)
+ [default=yes]
+ --disable-debug disable debugging support (disable gremlin and verb
+ 7+ messages) [default=yes]
+ --enable-small enable smaller executable size (disable OCC, usage
+ message, and verb 4 parm list) [default=yes]
+ --enable-password-save allow --askpass and --auth-user-pass passwords to be
+ read from a file [default=yes]
+ --enable-iproute2 enable support for iproute2 [default=no]
+ --disable-def-auth disable deferred authentication [default=yes]
+ --disable-pf disable internal packet filter [default=yes]
+ --enable-strict enable strict compiler warnings (debugging option)
+ [default=no]
+ --enable-pedantic enable pedantic compiler warnings, will not generate
+ a working executable (debugging option) [default=no]
+ --enable-strict-options enable strict options check between peers (debugging
+ option) [default=no]
+ --enable-selinux enable SELinux support [default=no]
+ --enable-systemd enable systemd suppport [default=no]
+
+ENVIRONMENT for ./configure:
+
+ IFCONFIG full path to ipconfig utility
+ ROUTE full path to route utility
+ IPROUTE full path to ip utility
+ NETSTAT path to netstat utility
+ MAN2HTML path to man2html utility
+ GIT path to git utility
+ TAP_CFLAGS C compiler flags for tap
+ OPENSSL_CRYPTO_CFLAGS
+ C compiler flags for OPENSSL_CRYPTO, overriding pkg-config
+ OPENSSL_CRYPTO_LIBS
+ linker flags for OPENSSL_CRYPTO, overriding pkg-config
+ OPENSSL_SSL_CFLAGS
+ C compiler flags for OPENSSL_SSL, overriding pkg-config
+ OPENSSL_SSL_LIBS
+ linker flags for OPENSSL_SSL, overriding pkg-config
+ POLARSSL_CFLAGS
+ C compiler flags for polarssl
+ POLARSSL_LIBS
+ linker flags for polarssl
+ LZO_CFLAGS C compiler flags for lzo
+ LZO_LIBS linker flags for lzo
+ PKCS11_HELPER_CFLAGS
+ C compiler flags for PKCS11_HELPER, overriding pkg-config
+ PKCS11_HELPER_LIBS
+ linker flags for PKCS11_HELPER, overriding pkg-config
+
+*************************************************************************
+
+BUILDING ON LINUX 2.6+ FROM RPM
+
+You can build a binary RPM directly from the OpenVPN tarball file:
+
+ rpmbuild -tb [tarball]
+
+This command will build a binary RPM file and place it in the system
+RPM directory. You can then install the RPM with the standard RPM
+install command:
+
+ rpm -ivh [binary-rpm]
+
+When you install the binary RPM, it will install
+sample-scripts/openvpn.init, which can be used to
+automatically start or stop one or more OpenVPN tunnels on system
+startup or shutdown, based on OpenVPN .conf files in /etc/openvpn.
+See the comments in openvpn.init for more information.
+
+Installing the RPM will also configure the TUN/TAP device node
+for linux 2.6.
+
+Note that the current openvpn.spec file, which instructs the rpm tool
+how to build a package, will build OpenVPN with all options enabled,
+including OpenSSL, LZO, and pthread linkage. Therefore all of
+these packages will need to be present prior to the RPM build, unless
+you edit the openvpn.spec file.
+
+*************************************************************************
+
+TUN/TAP Driver Configuration:
+
+* Linux 2.6 or higher (with integrated TUN/TAP driver):
+
+ (1) load driver: modprobe tun
+ (2) enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward
+
+ Note that (1) needs to be done once per reboot. If you install from RPM (see
+ above) and use the openvpn.init script, these steps are taken care of for you.
+
+* FreeBSD:
+
+ FreeBSD ships with the TUN/TAP driver, and the device nodes for tap0,
+ tap1, tap2, tap3, tun0, tun1, tun2 and tun3 are made by default.
+ However, only the TUN driver is linked into the GENERIC kernel.
+
+ To load the TAP driver, enter:
+
+ kldload if_tap
+
+ See man rc(8) to find out how you can do this at boot time.
+
+ The easiest way is to install OpenVPN from the FreeBSD ports system,
+ the port includes a sample script to automatically load the TAP driver
+ at boot-up time.
+
+* OpenBSD:
+
+ OpenBSD has dynamically created tun* devices so you only need
+ to create an empty /etc/hostname.tun0 (tun1, tun2 and so on) for each tun
+ you plan to use to create the device(s) at boot.
+
+* Solaris:
+
+ You need a TUN/TAP kernel driver for OpenVPN to work:
+
+ http://www.whiteboard.ne.jp/~admin2/tuntap/
+
+* Windows XP/2003/Vista/7:
+
+ OpenVPN on Windows needs a TUN/TAP kernel driver to work. OpenVPN installers
+ include this driver, so installing it separately is not usually required.
+ The driver source code is available here:
+
+ https://github.com/OpenVPN/tap-windows
+
+*************************************************************************
+
+CAVEATS & BUGS:
+
+* I have noticed cases where TCP sessions tunneled over the Linux
+ TAP driver (kernel 2.4.21 and 2.4.22) stall when lower --mssfix
+ values are used. The TCP sessions appear to unstall and resume
+ normally when the remote VPN endpoint is pinged.
+
+* If run through a firewall using OpenBSDs packet filter PF and the
+ filter rules include a "scrub" directive, you may get problems talking
+ to Linux hosts over the tunnel, since the scrubbing will kill packets
+ sent from Linux hosts if they are fragmented. This is usually seen as
+ tunnels where small packets and pings get through but large packets
+ and "regular traffic" don't. To circumvent this, add "no-df" to
+ the scrub directive so that the packet filter will let fragments with
+ the "dont fragment"-flag set through anyway.
+
+* Mixing OFB or CFB cipher modes with static key mode is not recommended,
+ and is flagged as an error on OpenVPN versions 1.2.1 and greater.
+ If you use the --cipher option to explicitly select an OFB or CFB
+ cipher AND you are using static key mode, it is possible that there
+ could be an IV collision if the OpenVPN daemons on both sides
+ of the connection are started at exactly the same time, since
+ OpenVPN uses a timestamp combined with a sequence number as the cipher
+ IV for OFB and CFB modes. This is not an issue if you are
+ using CBC cipher mode (the default), or if you are using OFB or CFB
+ cipher mode with SSL/TLS authentication.
diff --git a/ics-openvpn-stripped/main/openvpn/INSTALL-win32.txt b/ics-openvpn-stripped/main/openvpn/INSTALL-win32.txt
new file mode 100644
index 00000000..7c056858
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/INSTALL-win32.txt
@@ -0,0 +1,77 @@
+UPGRADING FROM 2.3-ALPHA1 AND EARLIER
+
+OpenVPN Windows installer went through major changes in
+2.3-alpha2. To avoid any unexpected behavior, it is strongly
+suggested to upgrade as follows.
+
+First backup configuration files and certificates from your
+current installation; by default they're in
+
+ C:\Program Files\OpenVPN\config (32-bit Windows)
+ C:\Program Files (x86)\OpenVPN\config (64-bit Windows)
+
+After this, stop the openvpn-gui or the openvpn service
+wrapper, if either of them is running and uninstall OpenVPN.
+Finally, remove the OpenVPN install directory entirely (e.g.
+using Windows Explorer as administrator).
+
+Finally, install the new version of OpenVPN and copy over
+your configuration files and certificates, which now go to
+
+ C:\Program Files\OpenVPN\config
+
+provided you did not install the 32-bit version on 64-bit
+Windows.
+
+IMPORTANT NOTE FOR WINDOWS VISTA/7 USERS
+
+Note that on Windows Vista, you will need to run the OpenVPN
+GUI with administrator privileges, so that it can add routes
+to the routing table that are pulled from the OpenVPN server.
+You can do this by right-clicking on the OpenVPN GUI
+desktop icon, and selecting "Run as administrator".
+
+GENERAL QUICKSTART FOR WINDOWS
+
+The OpenVPN Client requires a configuration file
+and key/certificate files. You should obtain
+these and save them to OpenVPN's configuration
+directory, usually C:\Program Files\OpenVPN\config.
+
+You can run OpenVPN as a Windows system service or by using
+the client GUI. To use the OpenVPN GUI, double click on the
+desktop icon or start menu icon. The OpenVPN GUI is a
+system-tray applet, so an icon for the GUI will appear in
+the lower-right corner of the screen. Right click on the
+system tray icon, and a menu should appear showing the names
+of your OpenVPN configuration files, and giving you the
+option to connect.
+
+BUILDING OPENVPN FOR WINDOWS
+
+Official OpenVPN Windows releases are cross-compiled on Linux using the
+openvpn-build buildsystem:
+
+ https://community.openvpn.net/openvpn/wiki/BuildingUsingGenericBuildsystem
+
+First setup the build environment as shown in the above article. Then fetch the
+openvpn-build repository:
+
+ git clone https://github.com/OpenVPN/openvpn-build.git
+
+Review the build configuration:
+
+ openvpn-build/generic/build.vars
+ openvpn-build/windows-nsis/build-complete.vars
+
+Build (unsigned):
+
+ cd openvpn-build/windows-nsis
+ ./build-complete
+
+Build (signed):
+
+ cd openvpn-build/windows-nsis
+ ./build-complete --sign --sign-pkcs12=<pkcs12-file>\
+ --sign-pkcs12-pass=<pkcs12-file-password> \
+ --sign-timestamp="<timestamp-url>"
diff --git a/ics-openvpn-stripped/main/openvpn/Makefile.am b/ics-openvpn-stripped/main/openvpn/Makefile.am
new file mode 100644
index 00000000..66d9f23a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/Makefile.am
@@ -0,0 +1,104 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2010 David Sommerseth <dazo@users.sourceforge.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.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.
+#
+# 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 (see the file COPYING included with this
+# distribution); if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# This option prevents autoreconf from overriding our COPYING and
+# INSTALL targets:
+AUTOMAKE_OPTIONS = foreign 1.9
+ACLOCAL_AMFLAGS = -I m4
+
+MAINTAINERCLEANFILES = \
+ config.log config.status \
+ $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \
+ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
+ $(srcdir)/m4/libtool.m4 $(srcdir)/m4/lt~obsolete.m4 \
+ $(srcdir)/m4/ltoptions.m4 $(srcdir)/m4/ltsugar.m4 \
+ $(srcdir)/m4/ltversion.m4 \
+ $(srcdir)/depcomp $(srcdir)/aclocal.m4 \
+ $(srcdir)/config.guess $(srcdir)/config.sub
+
+CLEANFILES = \
+ config-version.h tests/t_client.sh
+
+EXTRA_DIST = \
+ contrib \
+ debug
+
+.PHONY: config-version.h
+
+if GIT_CHECKOUT
+BUILT_SOURCES = \
+ config-version.h
+endif
+
+SUBDIRS = build distro include src sample doc tests
+
+dist_doc_DATA = \
+ README \
+ README.IPv6 \
+ README.polarssl \
+ COPYRIGHT.GPL \
+ COPYING
+
+dist_noinst_DATA = \
+ .gitignore \
+ .gitattributes \
+ PORTS \
+ README.IPv6 TODO.IPv6 \
+ README.polarssl \
+ openvpn.sln \
+ msvc-env.bat \
+ msvc-dev.bat \
+ msvc-build.bat
+
+if WIN32
+dist_doc_DATA += INSTALL-win32.txt
+else
+dist_noinst_DATA += INSTALL-win32.txt
+endif
+
+dist_noinst_HEADERS = \
+ config-msvc.h \
+ config-msvc-version.h.in
+
+if WIN32
+rootdir=$(prefix)
+root_DATA = version.sh
+endif
+
+config-version.h:
+ @CONFIGURE_GIT_CHFILES="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \
+ CONFIGURE_GIT_UNCOMMITTED="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \
+ CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \
+ echo "#define CONFIGURE_GIT_REVISION \"$${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \
+ echo "#define CONFIGURE_GIT_FLAGS \"$${CONFIGURE_GIT_CHFILES}$${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp
+
+ @if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \
+ echo "replacing config-version.h"; \
+ mv config-version.h.tmp config-version.h; \
+ else \
+ rm -f config-version.h.tmp; \
+ fi
diff --git a/ics-openvpn-stripped/main/openvpn/NEWS b/ics-openvpn-stripped/main/openvpn/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/NEWS
diff --git a/ics-openvpn-stripped/main/openvpn/PORTS b/ics-openvpn-stripped/main/openvpn/PORTS
new file mode 100644
index 00000000..735493c7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/PORTS
@@ -0,0 +1,94 @@
+OpenVPN
+Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+
+ OpenVPN has been written to try to avoid features
+ that are not standardized well across different
+ OSes, so porting OpenVPN itself will probably be
+ straightforward if a tun or tap driver already exists.
+
+ Where special OS features are used, they are usually
+ bracketed with #ifdef HAVE_SOME_FUNCTION.
+
+PLATFORM STATUS:
+
+ * Linux 2.2+ (supported)
+ * Solaris (supported)
+ * OpenBSD 3.0 (supported but pthreads are broken)
+ * Max OS X Darwin
+ * FreeBSD
+ * NetBSD
+ * Windows
+ * 64 bit platforms -- I have heard reports that
+ OpenVPN runs on Alpha Linux and FreeBSD.
+ * ARM -- I have heard of at least one case
+ where OpenVPN was successfully built and
+ run on the ARM architecture.
+
+PORTING NOTES:
+
+ * Make sure that OpenSSL will build on your
+ platform.
+ * Make sure that a tun or tap virtual device
+ driver exists for your platform. See
+ http://vtun.sourceforge.net/tun/ for examples
+ of tun and tap drivers that have been written
+ for Linux, Solaris, and FreeBSD.
+ * Make sure you have autoconf 2.50+ and
+ automake 1.6+.
+ * Edit configure.ac, adding platform specific
+ config code, and a TARGET_YOUROS define.
+ * Add platform-specific includes to syshead.h.
+ * Add an #ifdef TARGET_YOUROS to the do_ifconfig()
+ function in tun.c to generate a correct "ifconfig"
+ command for your platform. Note that OpenVPN
+ determines the ifconfig path at ./configure time.
+ * Add an ifconfig_order() variant for your OS so
+ openvpn knows whether to call ifconfig before
+ or after tun/tap dev open.
+ * Add an #ifdef TARGET_YOUROS block in tun.c and define
+ the open_tun, close_tun, read_tun, and write_tun
+ functions. If your tun/tap virtual device is
+ sufficiently generic, you may be able to use the
+ default case.
+ * Add appropriate code to route.c to handle
+ the route command on your platform. This
+ is necessary for the --route option to
+ work correctly.
+ * After you successfully build OpenVPN, run
+ the loopback tests as described in INSTALL.
+ * For the next test, confirm that the UDP socket
+ functionality is working independently of the
+ tun device, by doing something like:
+ ./openvpn --remote localhost --verb 9 --ping 1 --dev null
+ * Now try with --remote [a real host]
+ * Now try with a real tun/tap device, you will
+ need to figure out the appropriate ifconfig
+ command to use once openvpn has opened the tun/tap
+ device.
+ * Once you have simple tests working on the tun device,
+ try more complex tests such as using TLS mode.
+ * Stress test the link by doing ping -f across it.
+ * Make sure that packet fragmenting is happening
+ correctly by doing a ping -s 2000 or higher.
+ * Ensure that OpenVPN on your platform will talk
+ to OpenVPN on other platforms such as Linux.
+ Some tun/tap driver implementations will prepend
+ unnecessary stuff onto the datagram that must be
+ disabled with an explicit ioctl call if cross-platform
+ compatibility is to be preserved. You can see some
+ examples of this in tun.c.
+ * If your system supports pthreads, try building
+ with ./configure --enable-pthread and do a stress
+ test in TLS mode.
+ * Try the ultimate stress test which is --gremlin
+ --reneg-sec 10 in TLS mode (preferably with pthreads
+ enabled), then do a flood ping across the tunnel
+ (ping -f remote-endpoint) in both directions and let
+ it run overnight. --gremlin will induce massive
+ corruption and packet loss, but you win if you
+ wake up the next morning and both peers are still
+ running and occasionally even succeeding in their
+ attempted once-per-10-seconds TLS handshake.
+ * When it's working, submit your patch to
+ <openvpn-devel@lists.sourceforge.net>
+ and rejoice :)
diff --git a/ics-openvpn-stripped/main/openvpn/README b/ics-openvpn-stripped/main/openvpn/README
new file mode 100644
index 00000000..349e08af
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/README
@@ -0,0 +1,72 @@
+OpenVPN -- A Secure tunneling daemon
+
+Copyright (C) 2002-2010 OpenVPN Technologies, 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.
+
+*************************************************************************
+
+For the latest version of OpenVPN, go to:
+
+ http://openvpn.net/
+
+To Build and Install,
+
+ ./configure
+ make
+ make install
+
+or see the file INSTALL for more info.
+
+*************************************************************************
+
+For detailed information on OpenVPN, including examples, see the man page
+ http://openvpn.net/man.html
+
+For a sample VPN configuration, see
+ http://openvpn.net/howto.html
+
+For a description of OpenVPN's underlying protocol,
+ see the file ssl.h included in the source distribution.
+
+*************************************************************************
+
+Other Files & Directories:
+
+* INSTALL-win32.txt -- installation instructions
+ for Windows
+
+* configure.ac -- script to rebuild our configure
+ script and makefile.
+
+* sample/sample-scripts/verify-cn
+
+ A sample perl script which can be used with OpenVPN's
+ --tls-verify option to provide a customized authentication
+ test on embedded X509 certificate fields.
+
+* sample/sample-keys/
+
+ Sample RSA keys and certificates. DON'T USE THESE FILES
+ FOR ANYTHING OTHER THAN TESTING BECAUSE THEY ARE TOTALLY INSECURE.
+
+* sample/sample-config-files/
+
+ A collection of OpenVPN config files and scripts from
+ the HOWTO at http://openvpn.net/howto.html
+
+*************************************************************************
+
+Note that easy-rsa and tap-windows are now maintained in their own subprojects.
+Their source code is available here:
+
+ https://github.com/OpenVPN/easy-rsa
+ https://github.com/OpenVPN/tap-windows
+
+The old cross-compilation environment (domake-win) and the Python-based
+buildsystem have been replaced with openvpn-build:
+
+ https://github.com/OpenVPN/openvpn-build
+
+See the INSTALL file for usage information.
diff --git a/ics-openvpn-stripped/main/openvpn/README.IPv6 b/ics-openvpn-stripped/main/openvpn/README.IPv6
new file mode 100644
index 00000000..18068fee
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/README.IPv6
@@ -0,0 +1,56 @@
+Since 2.3.0, OpenVPN officially supports IPv6, and all widely used
+patches floating around for older versions have been integrated.
+
+IPv6 payload support
+--------------------
+
+This is for "IPv6 inside OpenVPN", with server-pushed IPv6 configuration
+on the client, and support for IPv6 configuration on the tun/tap interface
+from within the openvpn config.
+
+The code in 2.3.0 supersedes the IPv6 payload patches from Gert Doering,
+formerly located at http://www.greenie.net/ipv6/openvpn.html
+
+
+The following options have been added to handle IPv6 configuration,
+analogous to their IPv4 counterparts (--server <-> --server-ipv6, etc.)
+
+ - server-ipv6
+ - ifconfig-ipv6
+ - ifconfig-ipv6-pool
+ - ifconfig-ipv6-push
+ - route-ipv6
+ - iroute-ipv6
+
+see "man openvpn" for details how they are used.
+
+
+
+IPv6 transport support
+----------------------
+
+This is to enable OpenVPN peers or client/servers to talk to each other
+over an IPv6 network ("OpenVPN over IPv6").
+
+The code in 2.3.0 supersedes the IPv6 transport patches from JuanJo Ciarlante,
+formerly located at http://github.com/jjo/openvpn-ipv6
+
+OpenVPN 2.4.0 includes a big overhaul of the IPv6 transport patches
+originally implemented for the Android client (ics-openvpn)
+
+IPv4/IPv6 transport is automatically is selected when resolving addresses.
+Use a 6 or 4 suffix to force IPv6/IPv4:
+
+ --proto udp6
+ --proto tcp4
+ --proto tcp6-client
+ --proto tcp4-server
+ --proto tcp6 --client / --proto tcp6 --server
+
+On systems that allow IPv4 connections on IPv6 sockets
+(all systems supporting IPV6_V6ONLY setsockopt), an OpenVPN server can
+handle IPv4 connections on the IPv6 socket as well, making it a true
+dual-stacked server. Use bind ipv6only to disable this behaviour.
+
+On other systems, as of 2.3.0, you need to run separate server instances
+for IPv4 and IPv6.
diff --git a/ics-openvpn-stripped/main/openvpn/README.ec b/ics-openvpn-stripped/main/openvpn/README.ec
new file mode 100644
index 00000000..32938017
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/README.ec
@@ -0,0 +1,35 @@
+Since 2.4.0, OpenVPN has official support for elliptic curve crypto. Elliptic
+curves are an alternative to RSA for asymmetric encryption.
+
+Elliptic curve crypto ('ECC') can be used for the ('TLS') control channel only
+in OpenVPN; the data channel (encrypting the actual network traffic) uses
+symmetric encryption. ECC can be used in TLS for authentication (ECDSA) and key
+exchange (ECDH).
+
+Key exchange (ECDH)
+-------------------
+OpenVPN 2.4.0 and newer automatically initialize ECDH parameters. When ECDSA is
+used for authentication, the curve used for the server certificate will be used
+for ECDH too. When autodetection fails (e.g. when using RSA certificates)
+OpenVPN lets the crypto library decide if possible, or falls back to the
+secp384r1 curve.
+
+An administrator can force an OpenVPN/OpenSSL server to use a specific curve
+using the --ecdh-curve <curvename> option with one of the curves listed as
+available by the --show-curves option. Clients will use the same curve as
+selected by the server.
+
+Note that not all curves listed by --show-curves are available for use with TLS;
+in that case connecting will fail with a 'no shared cipher' TLS error.
+
+Authentication (ECDSA)
+----------------------
+Since OpenVPN 2.4.0, using ECDSA certificates works 'out of the box'. Which
+specific curves and cipher suites are available depends on your version and
+configuration of the crypto library. The crypto library will automatically
+select a cipher suite for the TLS control channel.
+
+Support for generating an ECDSA certificate chain is available in EasyRSA (in
+spite of it's name) since EasyRSA 3.0. The parameters you're looking for are
+'--use-algo=ec' and '--curve=<curve_name>'. See the EasyRSA documentation for
+more details on generating ECDSA certificates.
diff --git a/ics-openvpn-stripped/main/openvpn/README.polarssl b/ics-openvpn-stripped/main/openvpn/README.polarssl
new file mode 100644
index 00000000..6f1fa51a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/README.polarssl
@@ -0,0 +1,26 @@
+This version of OpenVPN has PolarSSL support. To enable follow the following
+instructions:
+
+To Build and Install,
+
+ ./configure --with-crypto-library=polarssl
+ make
+ make install
+
+This version depends on PolarSSL 1.3 (and requires at least 1.3.3).
+
+*************************************************************************
+
+Due to limitations in the PolarSSL library, the following features are missing
+in the PolarSSL version of OpenVPN:
+
+ * PKCS#12 file support
+ * --capath support - Loading certificate authorities from a directory
+ * Windows CryptoAPI support
+ * X.509 alternative username fields (must be "CN")
+
+Plugin/Script features:
+
+ * X.509 subject line has a different format than the OpenSSL subject line
+ * X.509 certificate export does not work
+ * X.509 certificate tracking
diff --git a/ics-openvpn-stripped/main/openvpn/TODO.IPv6 b/ics-openvpn-stripped/main/openvpn/TODO.IPv6
new file mode 100644
index 00000000..24bf865a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/TODO.IPv6
@@ -0,0 +1,215 @@
+TODO for IPv6 payload support
+-----------------------------
+
+1.) "--topology subnet" doesn't work together with IPv6 payload on FreeBSD
+ (verified for FreeBSD server, Linux/ifconfig client, problems
+ with ICMP6 neighbor solicitations from BSD not being answered by Linux)
+
+ * 2012-01-22 fixed in platform cleanup, commit 62c613d46dc495d74
+
+2.) NetBSD IPv6 support doesn't work
+ ("connected" route is not auto-created, "route-ipv6" adding fails)
+
+ * fixed, 3.1.10 *
+
+3.) route deletion for IPv6 routes is not yet done
+
+ * fixed for configured routes, 3.1.10 *
+ * missing for manual-ifconfig-connected (NetBSD, Darwin, Win32)
+
+ * 2012-06-10 - fixed somewhere in 2010
+
+4.) do "ifconfig tun0 inet6 unplumb" or "ifconfig tun0 destroy" for
+ Solaris, *BSD, ... at program termination time, to clean up leftovers
+ (unless tunnel persistance is desired).
+
+ For Solaris, only the "ipv6 tun0" is affected, for the *BSDs all tun0
+ stay around.
+
+ * 2012-06-10 - fixed in individual platform cleanups early-2012
+
+4a.) deconfigure IPv6 on tun interface on session termination, otherwise
+ one could end up with something like this (on NetBSD):
+
+tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
+ inet 10.9.0.18 -> 10.9.0.17 netmask 0xffffffff
+ inet6 fe80::a00:20ff:fece:d299%tun0 -> prefixlen 64 scopeid 0x3
+ inet6 2001:608:4:eff::2000:3 -> prefixlen 64
+ inet6 2001:608:4:eff::1:3 -> prefixlen 64
+
+ (pool was changed, previous address still active on tun0, breakage)
+
+ * semi-fixed for NetBSD, 28.2.10, always do tun0 destroy / tun0 create
+ before actual ifconfig -- tunnel still lingers after OpenVPN quits
+
+ * 2011-09-16 fixed in platform cleanup, commit 8ca19c014c149cf69
+
+4b.) verify this - on FreeBSD, tun0 is auto-destroyed if created by
+ opening /dev/tun (and lingers if created by "ifconfig tun0 create")
+
+ -> use for persistant tunnels on not-linux?
+
+ * 2012-06-10 tun interface behaviour is documented in "man tun(4)"
+
+5.) add new option "ifconfig-ipv6-push"
+ (per-client static IPv6 assignment, -> radiusplugin, etc)
+
+ * implemented, 14.1.10 *
+
+6.) add new option "route-ipv6-gateway"
+
+ * 2012-06-09 - decided there is no current need (but fairly trivial)
+
+7.) add "full" gateway handling for IPv6 in route.c
+ (right now, the routes are just sent down the tun interface, if the
+ operating system in questions supports that, without care for the
+ gateway address - which does not work for gateways that are supposed
+ to point elsewhere. Also, it doesn't work for TAP interfaces.
+
+ * 2012-06-09 use "dev tun" for tun devices, "via $gateway" for tap
+ (and purposely do not support off-link routes)
+
+8.) full IPv6 support for TAP interfaces
+ (main issue should be routes+gateway - and testing :-) )
+
+ test 2010/09/24: TAP itself works on linux/ifconfig+iproute2, but
+ route-via-tap doesn't work at all (route points to "tap0" which fails)
+
+17:51:14.075412 fe:ab:6e:c5:53:71 > 33:33:ff:00:00:01, ethertype IPv6 (0x86dd), length 86: 2001:608:4:a053::1:0 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2001:608:4:a001::1, length 32
+
+ * 2012-06-09 missing gateway support implemented
+
+8a.)
+ how is iroute-via-tap supposed to work??
+
+ * 2012-06-10 - answer: not at all, OpenVPN doesn't do "iroute" in
+ tap mode - set up "route-ipv6" with gateway address = individual
+ client's tap0 address to get the per-client routes
+
+
+9.) verify that iroute-ipv6 and route-ipv6 interact in the same way as
+ documented for iroute/route:
+
+ A's subnet, OpenVPN must push this route to all clients
+ EXCEPT for A, since the subnet is already owned by A.
+ OpenVPN accomplishes this by not
+ not pushing a route to a client
+ if it matches one of the client's iroutes.
+
+10.) extend "ifconfig-ipv6" to handle specification of /netbits, pushing
+ of /netbits, and correctly ifconfig'ing this
+ (default, if not specified: /64)
+
+ * done * 2012-02-03
+
+11.) do not add ipv6-routes if tun-ipv6 is not set - complain instead
+
+ * done * 12.1.10
+
+12.) handle incoming [::] and [fe80:...] packets in tun-p2mp MULTI mode
+ (most likely those are DAD packets)
+ silently ignore DAD?
+ Or accept-and-forward iff (multicast && client2client)?
+ handle NS/NA
+
+13.) from Martin List-Petersen:
+
+ One thing, and I guess this requires modifications in
+ network-manager-openvpn: It also works, BUT ignores "push
+ route-ipv6-gateway" and "push route-ipv6 ...." (obviously routes pushed
+ from the server) entirely.
+
+14.) from ##openvpn-discussion:
+
+ new features should be #ifdef'ed
+
+ (check whether this is feasible at all)
+
+15.) IPv6 related environment variables
+
+ - document all of them in openvpn.8
+ - make sure that all existing IPv4 stuff has IPv6 counterparts
+
+16.) OpenBSD
+ - implement ifconfig/route for IPv6
+ - revert ifconfig/open_tun order to "normal" (separate commit!!!)
+ (openvpn-devel, Subject: OpenBSD)
+ - test
+
+ * 2012-02-05 platform cleanup, commit 82d4e12068774b0a6ca
+
+17.) client-option (Elwood)
+ - ignore-v6-push-options yes/no
+ - ignore-v6-route-push ("as for IPv4 routes")
+
+18.) fail-save? "what if 'ip -6 addr add' fails" -> fail, or fallback to v4?
+ (-> recomment setting "ignore-v6-push-options yes")
+
+19.) safety check: if connecting over IPv6 (v6 transport) and the pushed
+ route-ipv6 network encompasses the server IPv6 address, make sure
+ we at least log a warning (until we can fiddle with external routing
+ to make this work correctly).
+
+20.) show "route add" / "route delete" commands for IPv6 in log file
+ (we show the "ifconfig" commands, so why not the routes?)
+
+ 2010-08-07: this is a null-feature - it's already there, but with
+ different debug level (M_INFO vs. D_ROUTE) so user
+ didn't notice
+
+21.) enable ipv6-only server operations
+ - decouple ipv6 pool handling from ipv4 pool
+ - make sure Rest of OpenVPN doesn't assume "there will always be IPv4"
+
+22.) implement --learn-address for IPv6
+
+23.) FreeBSD 8 seems to require explicit setting of the "ifconfig" IPv6
+ route, while FreeBSD 6+7 don't --> more testing, and code fix
+
+ workaround for the time being: just add
+
+ server-ipv6 2001:608:4:a051::/64
+ route-ipv6 2001:608:4:a051::/64
+
+ to the config
+
+ (problem + workaround applies both to tun and tap style devices)
+
+ * 2012-06-09 - this got fixed in one of the platform cleanups
+
+
+
+
+TODO for IPv6 transport support
+-------------------------------
+
+[ Last updated: 2014-01-03. ]
+
+* All platforms:
+ o mgmt console: as currently passes straight in_addr_t bits around
+
+ o make possible to get AF from getaddrinfo() answer, ie allow openvpn to
+ use ipv4/6 if DNS returns A/AAAA without specifying protocol.
+ Hard: requires deep changes in initialization/calling logic
+ - Done by dual stack patches
+
+ o use AI_PASSIVE
+ - Done by dual stack patches
+
+ o the getaddr()/getaddr6() interface is not prepared for handling socktype
+ "tagging", currently I abuse the sockflags bits for getting the ai_socktype
+ downstream.
+ - Still done by flags, seems clean enough.
+
+ o implement comparison for mapped addesses: server in dual stack
+ listening IPv6 must permit incoming streams from allowed IPv4 peer,
+ currently you need to pass eg: --remote ffff::1.2.3.4
+ - OpenVPN will compare all address of a remote
+ but will still fail on mapped addresses
+
+* win32:
+ o find out about mapped addresses, as I can't make it work
+ with bound at ::1 and connect to 127.0.0.1
+ - Should be fixed by 8832c6c - "Implement listing on IPv4/IPv6 dual
+ socket on all platform"
+
diff --git a/ics-openvpn-stripped/main/openvpn/compat.m4 b/ics-openvpn-stripped/main/openvpn/compat.m4
new file mode 100644
index 00000000..4c132544
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/compat.m4
@@ -0,0 +1,75 @@
+dnl OpenVPN -- An application to securely tunnel IP networks
+dnl over a single UDP port, with support for SSL/TLS-based
+dnl session authentication and key exchange,
+dnl packet encryption, packet authentication, and
+dnl packet compression.
+dnl
+dnl Copyright (C) 2008-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program (see the file COPYING included with this
+dnl distribution); if not, write to the Free Software Foundation, Inc.,
+dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+dnl Compatibility layer for <autoconf-2.60 <automake-1.10
+dnl REMOVE THIS IN FUTURE!
+
+ifdef(
+ [AS_VAR_IF],
+ ,
+ [
+ AC_DEFUN([AS_VAR_IF], [dnl
+ if test "$$1" = "$2"; then
+ m4_ifval([$3], [$3], [:])
+ else
+ m4_ifval([$4], [$4], [:])
+ fi
+ ])
+ ]
+)
+ifdef(
+ [AC_USE_SYSTEM_EXTENSIONS],
+ ,
+ [AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [GNU_SOURCE])]
+)
+ifdef(
+ [AC_PROG_SED],
+ ,
+ [AC_DEFUN([AC_PROG_SED], [AC_CHECK_PROGS([SED], [sed])])]
+)
+ifdef(
+ [AC_TYPE_INT8_T],
+ ,
+ [
+ AC_CHECK_HEADERS([inttypes.h stdint.h])
+ test -z "${ac_cv_header_inttypes_h}${ac_cv_header_stdint_h}" && \
+ AC_MSG_ERROR([Required inttypes.h stdint.h not found])
+
+ AC_DEFUN([AC_TYPE_INT8_T], [])
+ AC_DEFUN([AC_TYPE_INT16_T], [])
+ AC_DEFUN([AC_TYPE_INT32_T], [])
+ AC_DEFUN([AC_TYPE_INT64_T], [])
+ AC_DEFUN([AC_TYPE_UINT8_T], [])
+ AC_DEFUN([AC_TYPE_UINT16_T], [])
+ AC_DEFUN([AC_TYPE_UINT32_T], [])
+ AC_DEFUN([AC_TYPE_UINT64_T], [])
+ ]
+)
+if test -z "${docdir}"; then
+ docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
+ AC_SUBST([docdir])
+fi
+if test -z "${htmldir}"; then
+ htmldir="\$(docdir)"
+ AC_SUBST([htmldir])
+fi
diff --git a/ics-openvpn-stripped/main/openvpn/config-msvc-version.h.in b/ics-openvpn-stripped/main/openvpn/config-msvc-version.h.in
new file mode 100644
index 00000000..4bc89e7b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/config-msvc-version.h.in
@@ -0,0 +1,10 @@
+#define PACKAGE_NAME "@PRODUCT_NAME@"
+#define PACKAGE_STRING "@PRODUCT_NAME@ @PRODUCT_VERSION@"
+#define PACKAGE_TARNAME "@PRODUCT_TARNAME@"
+#define PACKAGE "@PRODUCT_TARNAME@"
+#define PACKAGE_VERSION "@PRODUCT_VERSION@"
+#define PRODUCT_BUGREPORT "@PRODUCT_BUGREPORT@"
+#define OPENVPN_VERSION_RESOURCE @PRODUCT_VERSION_RESOURCE@
+#define TAP_WIN_COMPONENT_ID "@PRODUCT_TAP_WIN_COMPONENT_ID@"
+#define TAP_WIN_MIN_MAJOR @PRODUCT_TAP_WIN_MIN_MAJOR@
+#define TAP_WIN_MIN_MINOR @PRODUCT_TAP_WIN_MIN_MINOR@
diff --git a/ics-openvpn-stripped/main/openvpn/config-msvc.h b/ics-openvpn-stripped/main/openvpn/config-msvc.h
new file mode 100644
index 00000000..fa993843
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/config-msvc.h
@@ -0,0 +1,128 @@
+#include <config-msvc-version.h>
+
+#define CONFIGURE_DEFINES "N/A"
+
+#define ENABLE_DEF_AUTH 1
+#define ENABLE_PF 1
+#define ENABLE_CLIENT_SERVER 1
+#define ENABLE_CRYPTO 1
+#define ENABLE_CRYPTO_OPENSSL 1
+#define ENABLE_DEBUG 1
+#define ENABLE_EUREPHIA 1
+#define ENABLE_FRAGMENT 1
+#define ENABLE_HTTP_PROXY 1
+#define ENABLE_LZO 1
+#define ENABLE_MANAGEMENT 1
+#define ENABLE_MULTIHOME 1
+#define ENABLE_PKCS11 1
+#define ENABLE_PLUGIN 1
+#define ENABLE_PORT_SHARE 1
+#define ENABLE_SOCKS 1
+#define ENABLE_SSL 1
+
+#define HAVE_ERRNO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_SYSTEM 1
+#define HAVE_TIME 1
+#define HAVE_TIME_H 1
+#define HAVE_UNLINK 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_WINDOWS_H 1
+#define HAVE_WINSOCK2_H 1
+#define HAVE_WS2TCPIP_H 1
+#define HAVE_IO_H 1
+#define HAVE_DIRECT_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_LZO_LZO1X_H 1
+#define HAVE_LZO_LZOUTIL_H 1
+
+#define HAVE_ACCESS 1
+#define HAVE_CHDIR 1
+#define HAVE_CHSIZE 1
+#define HAVE_CPP_VARARG_MACRO_ISO 1
+#define HAVE_CTIME 1
+#define HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH 1
+#define HAVE_IN_PKTINFO 1
+#define HAVE_MEMSET 1
+#define HAVE_PUTENV 1
+#define HAVE_STAT 1
+
+#define HAVE_SOCKET 1
+#define HAVE_RECV 1
+#define HAVE_RECVFROM 1
+#define HAVE_SEND 1
+#define HAVE_SENDTO 1
+#define HAVE_LISTEN 1
+#define HAVE_ACCEPT 1
+#define HAVE_CONNECT 1
+#define HAVE_BIND 1
+#define HAVE_SELECT 1
+#define HAVE_GETHOSTBYNAME 1
+#define HAVE_INET_NTOA 1
+#define HAVE_SETSOCKOPT 1
+#define HAVE_GETSOCKOPT 1
+#define HAVE_GETSOCKNAME 1
+#define HAVE_POLL 1
+
+#define HAVE_OPENSSL_ENGINE 1
+
+#define PATH_SEPARATOR '\\'
+#define PATH_SEPARATOR_STR "\\"
+
+#ifndef __cplusplus
+#define inline __inline
+#endif
+
+#define EMPTY_ARRAY_SIZE 0
+#define TARGET_WIN32 1
+#define TARGET_ALIAS "Windows-MSVC"
+
+#define HAVE_DECL_SO_MARK 0
+
+#define strncasecmp strnicmp
+#define strcasecmp _stricmp
+#define snprintf _snprintf
+
+#if _MSC_VER < 1800
+#define strtoull strtoul
+#endif
+
+#define in_addr_t uint32_t
+#define ssize_t SSIZE_T
+
+#define S_IRUSR 0
+#define S_IWUSR 0
+#define R_OK 4
+#define W_OK 2
+#define X_OK 1
+#define F_OK 0
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGUSR1 10
+#define SIGUSR2 12
+#define SIGTERM 15
+
+typedef unsigned __int64 uint64_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int8 uint8_t;
+typedef __int64 int64_t;
+typedef __int32 int32_t;
+typedef __int16 int16_t;
+typedef __int8 int8_t;
+
+#ifdef HAVE_CONFIG_MSVC_LOCAL_H
+#include <config-msvc-local.h>
+#endif
+
diff --git a/ics-openvpn-stripped/main/openvpn/config-version.h b/ics-openvpn-stripped/main/openvpn/config-version.h
new file mode 100644
index 00000000..762b9dc6
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/config-version.h
@@ -0,0 +1,2 @@
+#define CONFIGURE_GIT_REVISION "icsopenvpn_618-e63b88d330782d14"
+#define CONFIGURE_GIT_FLAGS ""
diff --git a/ics-openvpn-stripped/main/openvpn/config.h b/ics-openvpn-stripped/main/openvpn/config.h
new file mode 100644
index 00000000..b825e2bd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/config.h
@@ -0,0 +1,633 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+
+/* DISABLE PERSISTEN TUN */
+#undef TUNSETPERSIST
+
+/* Enable deferred authentication */
+#define CONFIGURE_DEF_AUTH 1
+
+/* Enable internal packet filter */
+#undef CONFIGURE_PF //1
+
+/* enable iproute2 support */
+#undef CONFIG_FEATURE_IPROUTE
+
+/* Use memory debugging function in OpenSSL */
+/* #undef CRYPTO_MDEBUG */
+
+/* Use dmalloc memory debugging library */
+/* #undef DMALLOC */
+
+/* Dimension to use for empty array declaration */
+#define EMPTY_ARRAY_SIZE 0
+
+/* Enable client capability only */
+#define ENABLE_CLIENT_ONLY 1
+
+/* Enable client/server capability */
+#define ENABLE_CLIENT_SERVER 1
+
+/* Enable debugging support */
+#define ENABLE_DEBUG 1
+
+/* Enable internal fragmentation support */
+#define ENABLE_FRAGMENT 1
+
+/* Enable HTTP proxy support */
+#define ENABLE_HTTP_PROXY 1
+
+/* Enable management server capability */
+#define ENABLE_MANAGEMENT 1
+
+/* Enable multi-homed UDP server capability */
+#define ENABLE_MULTIHOME 0
+
+/* Allow --askpass and --auth-user-pass passwords to be read from a file */
+#define ENABLE_PASSWORD_SAVE 1
+
+/* Enable TCP Server port sharing */
+#define ENABLE_PORT_SHARE 1
+
+/* Enable smaller executable size */
+/* #undef ENABLE_SMALL */
+
+/* Enable Socks proxy support */
+#define ENABLE_SOCKS 1
+
+/* Define to 1 if you have the `accept' function. */
+#define HAVE_ACCEPT 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the `bind' function. */
+#define HAVE_BIND 1
+
+/* Define to 1 if you have the `chdir' function. */
+#define HAVE_CHDIR 1
+
+/* Define to 1 if you have the `chroot' function. */
+#define HAVE_CHROOT 1
+
+/* Define to 1 if you have the `chsize' function. */
+/* #undef HAVE_CHSIZE */
+
+/* struct cmsghdr needed for extended socket error support */
+#define HAVE_CMSGHDR 1
+
+/* Define to 1 if you have the `connect' function. */
+#define HAVE_CONNECT 1
+
+/* Define to 1 if your compiler supports GNU GCC-style variadic macros */
+#define HAVE_CPP_VARARG_MACRO_GCC 1
+
+/* Define to 1 if your compiler supports ISO C99 variadic macros */
+#define HAVE_CPP_VARARG_MACRO_ISO 1
+
+/* Define to 1 if you have the `ctime' function. */
+#define HAVE_CTIME 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the `daemon' function. */
+#define HAVE_DAEMON 1
+
+/* Define to 1 if you have the `dup' function. */
+#define HAVE_DUP 1
+
+/* Define to 1 if you have the `dup2' function. */
+#define HAVE_DUP2 1
+
+/* Define to 1 if you have the `ENGINE_cleanup' function. */
+#define HAVE_ENGINE_CLEANUP 0
+
+/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
+#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 0
+
+/* Define to 1 if you have the `ENGINE_register_all_complete' function. */
+#define HAVE_ENGINE_REGISTER_ALL_COMPLETE 0
+
+/* epoll_create function is defined */
+#define HAVE_EPOLL_CREATE 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <err.h> header file. */
+#define HAVE_ERR_H 1
+
+/* Define to 1 if you have the `EVP_CIPHER_CTX_set_key_length' function. */
+#define HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH 1
+
+/* Define to 1 if you have the `execve' function. */
+#define HAVE_EXECVE 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `flock' function. */
+#define HAVE_FLOCK 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `getgrnam' function. */
+#define HAVE_GETGRNAM 1
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define to 1 if you have the `getpass' function. */
+/* #define HAVE_GETPASS 1 */
+
+/* Define to 1 if you have the `getpeereid' function. */
+/* #undef HAVE_GETPEEREID */
+
+/* Define to 1 if you have the `getpeername' function. */
+#define HAVE_GETPEERNAME 1
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getpwnam' function. */
+#define HAVE_GETPWNAM 1
+
+/* Define to 1 if you have the `getsockname' function. */
+#define HAVE_GETSOCKNAME 1
+
+/* Define to 1 if you have the `getsockopt' function. */
+#define HAVE_GETSOCKOPT 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <grp.h> header file. */
+#define HAVE_GRP_H 1
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#define HAVE_INET_NTOA 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* struct in_pktinfo needed for IP_PKTINFO support */
+#define HAVE_IN_PKTINFO 1
+
+/* struct iovec needed for IPv6 support */
+#define HAVE_IOVEC 1
+
+/* struct iphdr needed for IPv6 support */
+#define HAVE_IPHDR 1
+
+/* Define to 1 if you have the <linux/errqueue.h> header file. */
+#define HAVE_LINUX_ERRQUEUE_H 1
+
+/* Define to 1 if you have the <linux/if_tun.h> header file. */
+#define HAVE_LINUX_IF_TUN_H 1
+
+/* Define to 1 if you have the <linux/sockios.h> header file. */
+#define HAVE_LINUX_SOCKIOS_H 1
+
+/* Define to 1 if you have the <linux/types.h> header file. */
+#define HAVE_LINUX_TYPES_H 1
+
+/* Define to 1 if you have the `listen' function. */
+#define HAVE_LISTEN 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 you have the `mlockall' function. */
+/* #define HAVE_MLOCKALL 1*/
+
+/* struct msghdr needed for extended socket error support */
+#define HAVE_MSGHDR 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+#define HAVE_NETINET_IF_ETHER_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#define HAVE_NETINET_IN_SYSTM_H 1
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#define HAVE_NETINET_IP_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#define HAVE_NET_IF_H 1
+
+/* Define to 1 if you have the <net/if_tun.h> header file. */
+/* #undef HAVE_NET_IF_TUN_H */
+
+/* Define to 1 if you have the <net/tun/if_tun.h> header file. */
+/* #undef HAVE_NET_TUN_IF_TUN_H */
+
+/* Define to 1 if you have the `nice' function. */
+#define HAVE_NICE 1
+
+/* Define to 1 if you have the `openlog' function. */
+#define HAVE_OPENLOG 1
+
+/* Define to 1 if you have the <openssl/engine.h> header file. */
+#define HAVE_OPENSSL_ENGINE_H 0
+
+/* Define to 1 if you have the `poll' function. */
+#define HAVE_POLL 1
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef HAVE_PTHREAD */
+
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Define to 1 if you have the `readv' function. */
+#define HAVE_READV 1
+
+/* Define to 1 if you have the `recv' function. */
+#define HAVE_RECV 1
+
+/* Define to 1 if you have the `recvfrom' function. */
+#define HAVE_RECVFROM 1
+
+/* Define to 1 if you have the `recvmsg' function. */
+#define HAVE_RECVMSG 1
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#define HAVE_RESOLV_H 1
+
+/* Indicates if res_init is available */
+#define HAVE_RES_INIT 1
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the `send' function. */
+#define HAVE_SEND 1
+
+/* Define to 1 if you have the `sendmsg' function. */
+#define HAVE_SENDMSG 1
+
+/* Define to 1 if you have the `sendto' function. */
+#define HAVE_SENDTO 1
+
+/* SELinux support */
+/* #undef HAVE_SETCON */
+
+/* Define to 1 if you have the `setgid' function. */
+#define HAVE_SETGID 1
+
+/* Define to 1 if you have the `setgroups' function. */
+#define HAVE_SETGROUPS 1
+
+/* Define to 1 if you have the `setsid' function. */
+#define HAVE_SETSID 1
+
+/* Define to 1 if you have the `setsockopt' function. */
+#define HAVE_SETSOCKOPT 1
+
+/* Define to 1 if you have the `setuid' function. */
+#define HAVE_SETUID 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* struct sock_extended_err needed for extended socket error support */
+#define HAVE_SOCK_EXTENDED_ERR 1
+
+/* Define to 1 if you have the `stat' function. */
+#define HAVE_STAT 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_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 `strdup' function. */
+#define HAVE_STRDUP 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 <stropts.h> header file. */
+#define HAVE_STROPTS_H 1
+
+/* Define to 1 if you have the `syslog' function. */
+ #define HAVE_SYSLOG 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#define HAVE_SYSLOG_H 1
+
+/* Define to 1 if you have the `system' function. */
+#define HAVE_SYSTEM 1
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#define HAVE_SYS_EPOLL_H 1
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#define HAVE_SYS_FILE_H 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#define HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
+/* 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/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_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' function. */
+#define HAVE_TIME 1
+
+/* struct tun_pi needed for IPv6 support */
+#define HAVE_TUN_PI 1
+
+/* Define to 1 if you have the `umask' function. */
+#define HAVE_UMASK 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unlink' function. */
+#define HAVE_UNLINK 1
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the <vfork.h> header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if `fork' works. */
+#define HAVE_WORKING_FORK 1
+
+/* Define to 1 if `vfork' works. */
+#define HAVE_WORKING_VFORK 1
+
+/* Define to 1 if you have the `writev' function. */
+#define HAVE_WRITEV 1
+
+/* Path to ifconfig tool */
+#define IFCONFIG_PATH "/system/xbin/ifconfig"
+
+/* Path to iproute tool */
+#define IPROUTE_PATH "ip"
+
+/* Use lzo/ directory prefix for LZO header files (for LZO 2.0) */
+#define LZO_HEADER_DIR 1
+
+/* LZO version number */
+#define LZO_VERSION_NUM "2"
+
+/* Name of package */
+#define PACKAGE "openvpn"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "OpenVPN"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "OpenVPN 2.4-icsopenvpn"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "openvpn"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.4_master"
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Path to route tool */
+#define ROUTE_PATH "/system/xbin/route"
+
+/* The size of `unsigned int', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_INT 4
+
+/* The size of `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 4
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Enable strict options check between peers */
+/* #undef STRICT_OPTIONS_CHECK */
+
+/* The TAP-Win32 id defined in tap-win32/SOURCES */
+#define TAP_ID "tap0901"
+
+/* The TAP-Win32 version number is defined in tap-win32/SOURCES */
+#define TAP_WIN32_MIN_MAJOR 9
+
+/* The TAP-Win32 version number is defined in tap-win32/SOURCES */
+#define TAP_WIN32_MIN_MINOR 1
+
+/* A string representing our target */
+#define TARGET_ALIAS TARGET_ABI
+
+/* Are we running on Mac OS X? */
+/* #undef TARGET_DARWIN */
+
+/* Are we running on DragonFlyBSD? */
+/* #undef TARGET_DRAGONFLY */
+
+/* Are we running on FreeBSD? */
+/* #undef TARGET_FREEBSD */
+
+/* Are we running on Android Linux? */
+/* TARGET_LINUX is not enable since the TARGET_XXX options mainly
+ control different tun/tap, ifconfig behaviour and Android VpnProvider
+ is very different from Linux */
+#define TARGET_ANDROID
+
+/* Are we running on Linux? */
+/* #define TARGET_LINUX 1 */
+
+/* Are we running NetBSD? */
+/* #undef TARGET_NETBSD */
+
+/* Are we running on OpenBSD? */
+/* #undef TARGET_OPENBSD */
+
+/* Are we running on Solaris? */
+/* #undef TARGET_SOLARIS */
+
+/* Are we running WIN32? */
+/* #undef TARGET_WIN32 */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Win32 builtin */
+/* #undef UF */
+
+/* Use OpenSSL crypto library */
+#define USE_CRYPTO 1
+
+/* Use libdl for dynamic library loading */
+#define USE_LIBDL 1
+
+/* Use LoadLibrary to load DLLs on Windows */
+/* #undef USE_LOAD_LIBRARY */
+
+/* Use LZO compression library */
+#define ENABLE_LZO 1
+#define ENABLE_SNAPPY 1
+#define ENABLE_LZ4 1
+#define NEED_COMPAT_LZ4 1
+
+/* Enable PKCS11 capability */
+/* #undef USE_PKCS11 */
+
+/* Use pthread-based multithreading */
+/* #undef USE_PTHREAD */
+
+/* Use OpenSSL SSL library */
+#define ENABLE_SSL 1
+#define USE_SSL 1
+#define ENABLE_CRYPTO 1
+
+/* via android.mk */
+/*#define ENABLE_CRYPTO_OPENSSL 1*/
+/* #define ENABLE_CRYPTO_POLARSSL 1 */
+
+/* Use valgrind memory debugging library */
+/* #undef USE_VALGRIND */
+
+/* Version number of package */
+#define VERSION "2.3.1"
+
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Some systems don't define in_addr_t */
+/* #undef in_addr_t */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* 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 */
+
+/* type to use in place of socklen_t if not defined */
+/* #undef socklen_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+/* 16-bit unsigned type */
+/* #undef uint16_t */
+
+/* 32-bit unsigned type */
+/* #undef uint32_t */
+
+/* 8-bit unsigned type */
+/* #undef uint8_t */
+
+/* Define as `fork' if `vfork' does not work. */
+/* #undef vfork */
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
+
+// New version
+#define HAVE_INET_NTOP 1
+#define HAVE_INET_PTON 1
+#define HAVE_LZO_LZOUTIL_H 1
+#define HAVE_LZO_LZO1X_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_TIME_H 1
+#define HAVE_CONFIG_VERSION_H 1
+#define PATH_SEPARATOR_STR "/"
+#define HAVE_SA_FAMILY_T 1
+
+
+// Workaround for bionc
+#define IPPROTO_IP IPPROTO_IP
+#define IPPROTO_TCP IPPROTO_TCP
+
diff --git a/ics-openvpn-stripped/main/openvpn/configure.ac b/ics-openvpn-stripped/main/openvpn/configure.ac
new file mode 100644
index 00000000..ffba3749
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/configure.ac
@@ -0,0 +1,1208 @@
+dnl OpenVPN -- An application to securely tunnel IP networks
+dnl over a single UDP port, with support for SSL/TLS-based
+dnl session authentication and key exchange,
+dnl packet encryption, packet authentication, and
+dnl packet compression.
+dnl
+dnl Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+dnl Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program (see the file COPYING included with this
+dnl distribution); if not, write to the Free Software Foundation, Inc.,
+dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+
+m4_include(version.m4)
+AC_INIT([PRODUCT_NAME], [PRODUCT_VERSION], [PRODUCT_BUGREPORT], [PRODUCT_TARNAME])
+m4_include(compat.m4)
+AC_DEFINE([OPENVPN_VERSION_RESOURCE], [PRODUCT_VERSION_RESOURCE], [Version in windows resource format])
+
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR([src/openvpn/syshead.h])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+AC_CANONICAL_HOST
+AC_USE_SYSTEM_EXTENSIONS
+
+AC_ARG_ENABLE(
+ [lzo],
+ [AS_HELP_STRING([--disable-lzo], [disable LZO compression support @<:@default=yes@:>@])],
+ ,
+ [enable_lzo="yes"]
+)
+
+AC_ARG_ENABLE(snappy,
+ [ --disable-snappy Disable Snappy compression support],
+ [enable_snappy="$enableval"],
+ [enable_snappy="yes"]
+)
+
+AC_ARG_ENABLE(lz4,
+ [ --disable-lz4 Disable LZ4 compression support],
+ [enable_lz4="$enableval"],
+ [enable_lz4="yes"]
+)
+
+AC_ARG_ENABLE(comp-stub,
+ [ --enable-comp-stub Don't compile compression support but still allow limited interoperability with compression-enabled peers],
+ [enable_comp_stub="$enableval"],
+ [enable_comp_stub="no"]
+)
+
+AC_ARG_ENABLE(
+ [crypto],
+ [AS_HELP_STRING([--disable-crypto], [disable crypto support @<:@default=yes@:>@])],
+ ,
+ [enable_crypto="yes"]
+)
+
+AC_ARG_ENABLE(
+ [ofb-cfb],
+ [AS_HELP_STRING([--enable-ofb-cfb], [enable support for OFB and CFB cipher modes @<:@default=yes@:>@])],
+ ,
+ [enable_crypto_ofb_cfb="yes"]
+)
+
+AC_ARG_ENABLE(
+ [ssl],
+ [AS_HELP_STRING([--disable-ssl], [disable SSL support for TLS-based key exchange @<:@default=yes@:>@])],
+ ,
+ [enable_ssl="yes"]
+)
+
+AC_ARG_ENABLE(
+ [x509-alt-username],
+ [AS_HELP_STRING([--enable-x509-alt-username], [enable the --x509-username-field feature @<:@default=no@:>@])],
+ ,
+ [enable_x509_alt_username="no"]
+)
+
+AC_ARG_ENABLE(
+ [multi],
+ [AS_HELP_STRING([--disable-multi], [disable client/server support (--mode server + client mode) @<:@default=yes@:>@])],
+ ,
+ [enable_multi="yes"]
+)
+
+AC_ARG_ENABLE(
+ [server],
+ [AS_HELP_STRING([--disable-server], [disable server support only (but retain client support) @<:@default=yes@:>@])],
+ ,
+ [enable_server="yes"]
+)
+
+AC_ARG_ENABLE(
+ [plugins],
+ [AS_HELP_STRING([--disable-plugins], [disable plug-in support @<:@default=yes@:>@])],
+ ,
+ [enable_plugins="yes"]
+)
+
+AC_ARG_ENABLE(
+ [management],
+ [AS_HELP_STRING([--disable-management], [disable management server support @<:@default=yes@:>@])],
+ ,
+ [enable_management="yes"]
+)
+
+AC_ARG_ENABLE(
+ [pkcs11],
+ [AS_HELP_STRING([--enable-pkcs11], [enable pkcs11 support @<:@default=no@:>@])],
+ ,
+ [enable_pkcs11="no"]
+)
+
+AC_ARG_ENABLE(
+ [fragment],
+ [AS_HELP_STRING([--disable-fragment], [disable internal fragmentation support (--fragment) @<:@default=yes@:>@])],
+ ,
+ [enable_fragment="yes"]
+)
+
+AC_ARG_ENABLE(
+ [multihome],
+ [AS_HELP_STRING([--disable-multihome], [disable multi-homed UDP server support (--multihome) @<:@default=yes@:>@])],
+ ,
+ [enable_multihome="yes"]
+)
+
+AC_ARG_ENABLE(
+ [port-share],
+ [AS_HELP_STRING([--disable-port-share], [disable TCP server port-share support (--port-share) @<:@default=yes@:>@])],
+ ,
+ [enable_port_share="yes"]
+)
+
+AC_ARG_ENABLE(
+ [debug],
+ [AS_HELP_STRING([--disable-debug], [disable debugging support (disable gremlin and verb 7+ messages) @<:@default=yes@:>@])],
+ ,
+ [enable_debug="yes"]
+)
+
+AC_ARG_ENABLE(
+ [small],
+ [AS_HELP_STRING([--enable-small], [enable smaller executable size (disable OCC, usage message, and verb 4 parm list) @<:@default=yes@:>@])],
+ ,
+ [enable_small="no"]
+)
+
+AC_ARG_ENABLE(
+ [password-save],
+ [AS_HELP_STRING([--enable-password-save], [allow --askpass and --auth-user-pass passwords to be read from a file @<:@default=yes@:>@])],
+ ,
+ [enable_password_save="no"]
+)
+
+AC_ARG_ENABLE(
+ [iproute2],
+ [AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 @<:@default=no@:>@])],
+ ,
+ [enable_iproute2="no"]
+)
+
+AC_ARG_ENABLE(
+ [def-auth],
+ [AS_HELP_STRING([--disable-def-auth], [disable deferred authentication @<:@default=yes@:>@])],
+ ,
+ [enable_def_auth="yes"]
+)
+
+AC_ARG_ENABLE(
+ [pf],
+ [AS_HELP_STRING([--disable-pf], [disable internal packet filter @<:@default=yes@:>@])],
+ ,
+ [enable_pf="yes"]
+)
+
+AC_ARG_ENABLE(
+ [plugin-auth-pam],
+ [AS_HELP_STRING([--disable-plugin-auth-pam], [disable auth-pam plugin @<:@default=platform specific@:>@])],
+ ,
+ [
+ case "$host" in
+ *-*-openbsd*) enable_plugin_auth_pam="no";;
+ *-mingw*) enable_plugin_auth_pam="no";;
+ *) enable_plugin_auth_pam="yes";;
+ esac
+ ]
+)
+
+AC_ARG_ENABLE(
+ [plugin-down-root],
+ [AS_HELP_STRING([--disable-plugin-down-root], [disable down-root plugin @<:@default=platform specific@:>@])],
+ ,
+ [
+ case "$host" in
+ *-mingw*) enable_plugin_down_root="no";;
+ *) enable_plugin_down_root="yes";;
+ esac
+ ]
+)
+
+AC_ARG_ENABLE(
+ [pam-dlopen],
+ [AS_HELP_STRING([--enable-pam-dlopen], [dlopen libpam @<:@default=no@:>@])],
+ ,
+ [enable_pam_dlopen="no"]
+)
+
+AC_ARG_ENABLE(
+ [strict],
+ [AS_HELP_STRING([--enable-strict], [enable strict compiler warnings (debugging option) @<:@default=no@:>@])],
+ ,
+ [enable_strict="no"]
+)
+
+AC_ARG_ENABLE(
+ [pedantic],
+ [AS_HELP_STRING([--enable-pedantic], [enable pedantic compiler warnings, will not generate a working executable (debugging option) @<:@default=no@:>@])],
+ ,
+ [enable_pedantic="no"]
+)
+
+AC_ARG_ENABLE(
+ [werror],
+ [AS_HELP_STRING([--enable-werror], [promote compiler warnings to errors, will cause builds to fail is the compiler issues warnings (debugging option) @<:@default=no@:>@])],
+ ,
+ [enable_werror="no"]
+)
+
+AC_ARG_ENABLE(
+ [strict-options],
+ [AS_HELP_STRING([--enable-strict-options], [enable strict options check between peers (debugging option) @<:@default=no@:>@])],
+ ,
+ [enable_strict_options="no"]
+)
+
+AC_ARG_ENABLE(
+ [selinux],
+ [AS_HELP_STRING([--enable-selinux], [enable SELinux support @<:@default=no@:>@])],
+ ,
+ [enable_selinux="no"]
+)
+
+AC_ARG_ENABLE(
+ [systemd],
+ [AS_HELP_STRING([--enable-systemd], [enable systemd suppport @<:@default=no@:>@])],
+ ,
+ [enable_systemd="no"]
+)
+
+AC_ARG_WITH(
+ [special-build],
+ [AS_HELP_STRING([--with-special-build=STRING], [specify special build string])],
+ [test -n "${withval}" && AC_DEFINE_UNQUOTED([CONFIGURE_SPECIAL_BUILD], ["${withval}"], [special build string])]
+)
+
+AC_ARG_WITH(
+ [mem-check],
+ [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])],
+ [
+ case "${withval}" in
+ dmalloc|valgrind|ssl|no) ;;
+ *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;;
+ esac
+ ],
+ [with_mem_check="no"]
+)
+
+AC_ARG_WITH(
+ [crypto-library],
+ [AS_HELP_STRING([--with-crypto-library=library], [build with the given crypto library, TYPE=openssl|polarssl @<:@default=openssl@:>@])],
+ [
+ case "${withval}" in
+ openssl|polarssl) ;;
+ *) AC_MSG_ERROR([bad value ${withval} for --with-crypto-library]) ;;
+ esac
+ ],
+ [with_crypto_library="openssl"]
+)
+
+AC_ARG_WITH(
+ [plugindir],
+ [AS_HELP_STRING([--with-plugindir], [plugin directory @<:@default=LIBDIR/openvpn@:>@])],
+ ,
+ [with_plugindir="\$(libdir)/openvpn/plugins"]
+)
+
+
+AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our host])
+case "$host" in
+ *-*-linux*)
+ AC_DEFINE([TARGET_LINUX], [1], [Are we running on Linux?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["L"], [Target prefix])
+ ;;
+ *-*-solaris*)
+ AC_DEFINE([TARGET_SOLARIS], [1], [Are we running on Solaris?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["S"], [Target prefix])
+ ;;
+ *-*-openbsd*)
+ AC_DEFINE([TARGET_OPENBSD], [1], [Are we running on OpenBSD?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["O"], [Target prefix])
+ ;;
+ *-*-freebsd*)
+ AC_DEFINE([TARGET_FREEBSD], [1], [Are we running on FreeBSD?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["F"], [Target prefix])
+ ;;
+ *-*-netbsd*)
+ AC_DEFINE([TARGET_NETBSD], [1], [Are we running NetBSD?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["N"], [Target prefix])
+ ;;
+ *-*-darwin*)
+ AC_DEFINE([TARGET_DARWIN], [1], [Are we running on Mac OS X?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["M"], [Target prefix])
+ have_tap_header="yes"
+ dnl some Mac OS X tendering (we use vararg macros...)
+ CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+ ;;
+ *-mingw*)
+ AC_DEFINE([TARGET_WIN32], [1], [Are we running WIN32?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["W"], [Target prefix])
+ CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
+ CPPFLAGS="${CPPFLAGS} -DNTDDI_VERSION=NTDDI_WINXP -D_WIN32_WINNT=_WIN32_WINNT_WINXP"
+ WIN32=yes
+ ;;
+ *-*-dragonfly*)
+ AC_DEFINE([TARGET_DRAGONFLY], [1], [Are we running on DragonFlyBSD?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["D"], [Target prefix])
+ ;;
+ *-aix*)
+ AC_DEFINE([TARGET_AIX], [1], [Are we running AIX?])
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["A"], [Target prefix])
+ ROUTE="/usr/sbin/route"
+ have_tap_header="yes"
+ ac_cv_header_net_if_h="no" # exists, but breaks things
+ ;;
+ *)
+ AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["X"], [Target prefix])
+ have_tap_header="yes"
+ ;;
+esac
+
+PKG_PROG_PKG_CONFIG
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_SED
+AC_PROG_MAKE_SET
+
+AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility])
+AC_ARG_VAR([ROUTE], [full path to route utility])
+AC_ARG_VAR([IPROUTE], [full path to ip utility])
+AC_ARG_VAR([NETSTAT], [path to netstat utility]) # tests
+AC_ARG_VAR([MAN2HTML], [path to man2html utility])
+AC_ARG_VAR([GIT], [path to git utility])
+AC_PATH_PROGS([IFCONFIG], [ifconfig],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_PATH_PROGS([ROUTE], [route],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_PATH_PROGS([IPROUTE], [ip],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_CHECK_PROGS([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc]) # tests
+AC_CHECK_PROGS([MAN2HTML], [man2html])
+AC_CHECK_PROGS([GIT], [git]) # optional
+AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool])
+AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool])
+AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool])
+
+#
+# Libtool
+#
+ifdef(
+ [LT_INIT],
+ [
+ LT_INIT([win32-dll])
+ LT_LANG([Windows Resource])
+ ],
+ [
+ AC_LIBTOOL_WIN32_DLL
+ AC_LIBTOOL_RC
+ AC_PROG_LIBTOOL
+ ]
+)
+
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_SIGNAL
+AX_CPP_VARARG_MACRO_ISO
+AX_CPP_VARARG_MACRO_GCC
+AX_TYPE_SOCKLEN_T
+AX_EMPTY_ARRAY
+AC_CHECK_SIZEOF([unsigned int])
+AC_CHECK_SIZEOF([unsigned long])
+AC_CHECK_HEADERS([ \
+ stdio.h stdarg.h stdbool.h limits.h \
+ time.h errno.h fcntl.h io.h direct.h \
+ ctype.h sys/types.h sys/socket.h \
+ signal.h unistd.h dlfcn.h \
+ netinet/in.h netinet/in_systm.h \
+ netinet/tcp.h arpa/inet.h netdb.h \
+ windows.h winsock2.h ws2tcpip.h \
+])
+AC_CHECK_HEADERS([ \
+ sys/time.h sys/ioctl.h sys/stat.h \
+ sys/mman.h sys/file.h sys/wait.h \
+ unistd.h signal.h libgen.h stropts.h \
+ syslog.h pwd.h grp.h \
+ sys/sockio.h sys/uio.h linux/sockios.h \
+ linux/types.h sys/poll.h sys/epoll.h err.h \
+])
+
+SOCKET_INCLUDES="
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+"
+
+AC_CHECK_HEADERS(
+ [net/if.h netinet/ip.h netinet/if_ether.h resolv.h sys/un.h net/if_utun.h sys/kern_control.h],
+ ,
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+
+AC_CHECK_TYPES(
+ [in_addr_t],
+ ,
+ [AC_DEFINE([in_addr_t], [uint32_t], [Workaround missing in_addr_t])],
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct iphdr],
+ [AC_DEFINE([HAVE_IPHDR], [1], [struct iphdr needed for IPv6 support])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct sock_extended_err],
+ [AC_DEFINE([HAVE_SOCK_EXTENDED_ERR], [1], [struct sock_extended_err needed for extended socket error support])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct msghdr],
+ [AC_DEFINE([HAVE_MSGHDR], [1], [struct msghdr needed for extended socket error support])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct cmsghdr],
+ [AC_DEFINE([HAVE_CMSGHDR], [1], [struct cmsghdr needed for extended socket error support])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct in_pktinfo],
+ [AC_DEFINE([HAVE_IN_PKTINFO], [1], [struct in_pktinfo needed for IP_PKTINFO support])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [sa_family_t],
+ [AC_DEFINE([HAVE_SA_FAMILY_T], [1], [sa_family_t, needed to hold AF_* info])],
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_TYPE(
+ [struct sockaddr_in6],
+ ,
+ [AC_MSG_ERROR([struct sockaddr_in6 not found, needed for ipv6 transport support.])],
+ [[${SOCKET_INCLUDES}]]
+)
+AC_CHECK_DECLS(
+ [SO_MARK],
+ ,
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
+
+dnl We emulate signals in Windows
+AC_CHECK_DECLS(
+ [SIGHUP],
+ ,
+ [AC_DEFINE([SIGHUP], [1], [SIGHUP replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGINT],
+ ,
+ [AC_DEFINE([SIGINT], [2], [SIGINT replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGUSR1],
+ ,
+ [AC_DEFINE([SIGUSR1], [10], [SIGUSR1 replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGUSR2],
+ ,
+ [AC_DEFINE([SIGUSR2], [12], [SIGUSR2 replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGTERM],
+ ,
+ [AC_DEFINE([SIGTERM], [15], [SIGTERM replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+
+AC_FUNC_FORK
+
+AC_CHECK_FUNCS([ \
+ daemon chroot getpwnam setuid nice system getpid dup dup2 \
+ getpass strerror syslog openlog mlockall getgrnam setgid \
+ setgroups stat flock readv writev time gettimeofday \
+ ctime memset vsnprintf strdup \
+ setsid chdir putenv getpeername unlink \
+ chsize ftruncate execve getpeereid umask basename dirname access \
+ epoll_create \
+])
+
+AC_CHECK_LIB(
+ [dl],
+ [dlopen],
+ [DL_LIBS="-ldl"]
+)
+AC_SUBST([DL_LIBS])
+
+AC_CHECK_LIB(
+ [nsl],
+ [inet_ntoa],
+ [SOCKETS_LIBS="${SOCKETS_LIBS} -lnsl"]
+)
+AC_CHECK_LIB(
+ [socket],
+ [socket],
+ [SOCKETS_LIBS="${SOCKETS_LIBS} -lsocket"]
+)
+AC_CHECK_LIB(
+ [resolv],
+ [gethostbyname],
+ [SOCKETS_LIBS="${SOCKETS_LIBS} -lresolv"]
+)
+AC_SUBST([SOCKETS_LIBS])
+
+old_LIBS="${LIBS}"
+LIBS="${LIBS} ${SOCKETS_LIBS}"
+AC_CHECK_FUNCS([sendmsg recvmsg inet_ntop inet_pton])
+AC_CHECK_FUNCS(
+ [res_init],
+ ,
+ ,
+ [[#include <resolv.h>]]
+)
+# Windows use stdcall for winsock so we cannot auto detect these
+m4_define(
+ [SOCKET_FUNCS],
+[socket recv recvfrom send sendto listen dnl
+accept connect bind select gethostbyname inet_ntoa]dnl
+)
+m4_define(
+ [SOCKET_OPT_FUNCS],
+ [setsockopt getsockopt getsockname poll]dnl
+)
+if test "${WIN32}" = "yes"; then
+ m4_foreach(
+ [F],
+ m4_split(SOCKET_FUNCS SOCKET_OPT_FUNCS),
+ m4_define([UF], [[m4_join([_], [HAVE], m4_toupper(F))]])
+ AC_DEFINE([UF], [1], [Win32 builtin])
+ )
+else
+ AC_CHECK_FUNCS(
+ SOCKET_FUNCS,
+ ,
+ [AC_MSG_ERROR([Required library function not found])]
+ )
+ AC_CHECK_FUNCS(SOCKET_OPT_FUNCS)
+fi
+LIBS="${old_LIBS}"
+
+AC_ARG_VAR([TAP_CFLAGS], [C compiler flags for tap])
+old_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} ${TAP_CFLAGS}"
+AC_CHECK_HEADERS(
+ [ \
+ net/if_tun.h net/tun/if_tun.h \
+ linux/if_tun.h \
+ tap-windows.h \
+ ],
+ [have_tap_header="yes"]
+)
+AC_CHECK_DECLS(
+ [TUNSETPERSIST],
+ [AC_DEFINE([ENABLE_FEATURE_TUN_PERSIST], [1], [We have persist tun capability])],
+ ,
+ [[
+ #ifdef HAVE_LINUX_IF_TUN_H
+ #include <linux/if_tun.h>
+ #endif
+ ]]
+)
+CFLAGS="${old_CFLAGS}"
+test "${have_tap_header}" = "yes" || AC_MSG_ERROR([no tap header could be found])
+
+AC_CHECK_LIB(
+ [selinux],
+ [setcon],
+ [SELINUX_LIBS="-lselinux"]
+)
+AC_SUBST([SELINUX_LIBS])
+
+AC_ARG_VAR([LIBPAM_CFLAGS], [C compiler flags for libpam])
+AC_ARG_VAR([LIBPAM_LIBS], [linker flags for libpam])
+if test -z "${LIBPAM_LIBS}"; then
+ AC_CHECK_LIB(
+ [pam],
+ [pam_start],
+ [LIBPAM_LIBS="-lpam"]
+ )
+fi
+
+case "${with_mem_check}" in
+ valgrind)
+ AC_CHECK_HEADERS(
+ [valgrind/memcheck.h],
+ [
+ CFLAGS="${CFLAGS} -g -fno-inline"
+ AC_DEFINE(
+ [USE_VALGRIND],
+ [1],
+ [Use valgrind memory debugging library]
+ )
+ ],
+ [AC_MSG_ERROR([valgrind headers not found.])]
+ )
+ ;;
+ dmalloc)
+ AC_CHECK_HEADERS(
+ [dmalloc.h],
+ [AC_CHECK_LIB(
+ [dmalloc],
+ [malloc],
+ [
+ LIBS="${LIBS} -ldmalloc"
+ AC_DEFINE(
+ [DMALLOC],
+ [1],
+ [Use dmalloc memory debugging library]
+ )
+ ],
+ [AC_MSG_ERROR([dmalloc library not found.])]
+ )],
+ [AC_MSG_ERROR([dmalloc headers not found.])]
+ )
+ ;;
+ ssl)
+ AC_CHECK_LIB(
+ [ssl],
+ [CRYPTO_mem_ctrl],
+ [
+ AC_DEFINE(
+ [CRYPTO_MDEBUG],
+ [1],
+ [Use memory debugging function in OpenSSL]
+ )
+ AC_MSG_NOTICE([NOTE: OpenSSL library must be compiled with CRYPTO_MDEBUG])
+ ],
+ [AC_MSG_ERROR([Memory Debugging function in OpenSSL library not found.])]
+ )
+ ;;
+esac
+
+PKG_CHECK_MODULES(
+ [PKCS11_HELPER],
+ [libpkcs11-helper-1 >= 1.11],
+ [have_pkcs11_helper="yes"],
+ []
+)
+
+PKG_CHECK_MODULES(
+ [OPENSSL_CRYPTO],
+ [libcrypto >= 0.9.8],
+ [have_openssl_crypto="yes"],
+ [AC_CHECK_LIB(
+ [crypto],
+ [RSA_new],
+ [
+ have_openssl_crypto="yes"
+ OPENSSL_CRYPTO_LIBS="-lcrypto"
+ ]
+ )]
+)
+
+PKG_CHECK_MODULES(
+ [OPENSSL_SSL],
+ [libssl >= 0.9.8],
+ [have_openssl_ssl="yes"],
+ [AC_CHECK_LIB(
+ [ssl],
+ [SSL_CTX_new],
+ [
+ have_openssl_ssl="yes"
+ OPENSSL_SSL_LIBS="-lssl"
+ ],
+ [],
+ [-lcrypto]
+ )]
+)
+
+if test "${have_openssl_crypto}" = "yes"; then
+ saved_CFLAGS="${CFLAGS}"
+ saved_LIBS="${LIBS}"
+ CFLAGS="${CFLAGS} ${OPENSSL_CRYPTO_CFLAGS}"
+ LIBS="${LIBS} ${OPENSSL_CRYPTO_LIBS}"
+ AC_CHECK_FUNCS([EVP_CIPHER_CTX_set_key_length])
+ have_openssl_engine="yes"
+ AC_CHECK_FUNCS(
+ [ \
+ ENGINE_load_builtin_engines \
+ ENGINE_register_all_complete \
+ ENGINE_cleanup \
+ ],
+ ,
+ [have_openssl_engine="no"; break]
+ )
+
+ CFLAGS="${saved_CFLAGS}"
+ LIBS="${saved_LIBS}"
+fi
+
+AC_ARG_VAR([POLARSSL_CFLAGS], [C compiler flags for polarssl])
+AC_ARG_VAR([POLARSSL_LIBS], [linker flags for polarssl])
+have_polarssl_ssl="yes"
+have_polarssl_crypto="yes"
+if test -z "${POLARSSL_LIBS}"; then
+ AC_CHECK_LIB(
+ [polarssl],
+ [ssl_init],
+ [POLARSSL_LIBS="-lpolarssl"],
+ [
+ have_polarssl_ssl="no"
+ AC_CHECK_LIB(
+ [polarssl],
+ [aes_crypt_cbc],
+ ,
+ [have_polarssl_crypto="no"],
+ [${PKCS11_HELPER_LIBS}]
+ )
+ ],
+ [${PKCS11_HELPER_LIBS}]
+ )
+fi
+
+if test "${with_crypto_library}" = "polarssl" ; then
+ AC_MSG_CHECKING([polarssl version])
+ old_CFLAGS="${CFLAGS}"
+ CFLAGS="${POLARSSL_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <polarssl/version.h>
+ ]],
+ [[
+#if POLARSSL_VERSION_NUMBER < 0x01030300 || POLARSSL_VERSION_NUMBER >= 0x01040000
+#error invalid version
+#endif
+ ]]
+ )],
+ [AC_MSG_RESULT([ok])],
+ [AC_MSG_ERROR([PolarSSL 1.3.x required and must be 1.3.3 or later])]
+ )
+
+ polarssl_with_pkcs11="no"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <polarssl/config.h>
+ ]],
+ [[
+#ifndef POLARSSL_PKCS11_C
+#error pkcs11 wrapper missing
+#endif
+ ]]
+ )],
+ polarssl_with_pkcs11="yes")
+ CFLAGS="${old_CFLAGS}"
+
+ AC_MSG_CHECKING([polarssl pkcs11 support])
+ if test "${enable_pkcs11}" = "yes"; then
+ if test "${polarssl_with_pkcs11}" = "yes"; then
+ AC_MSG_RESULT([ok])
+ else
+ AC_MSG_ERROR([polarssl has no pkcs11 wrapper compiled in])
+ fi
+ else
+ if test "${polarssl_with_pkcs11}" != "yes"; then
+ AC_MSG_RESULT([ok])
+ else
+ AC_MSG_ERROR([PolarSSL compiled with PKCS11, while OpenVPN is not])
+ fi
+ fi
+
+fi
+
+AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo])
+AC_ARG_VAR([LZO_LIBS], [linker flags for lzo])
+have_lzo="yes"
+if test -z "${LZO_LIBS}"; then
+ AC_CHECK_LIB(
+ [lzo2],
+ [lzo1x_1_15_compress],
+ [LZO_LIBS="-llzo2"],
+ [AC_CHECK_LIB(
+ [lzo],
+ [lzo1x_1_15_compress],
+ [LZO_LIBS="-llzo"],
+ [have_lzo="no"]
+ )]
+ )
+fi
+if test "${have_lzo}" = "yes"; then
+ saved_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} ${LZO_CFLAGS}"
+ AC_CHECK_HEADERS(
+ [lzo/lzoutil.h],
+ ,
+ [AC_CHECK_HEADERS(
+ [lzoutil.h],
+ ,
+ [AC_MSG_ERROR([lzoutil.h is missing])]
+ )]
+ )
+ AC_CHECK_HEADERS(
+ [lzo/lzo1x.h],
+ ,
+ [AC_CHECK_HEADERS(
+ [lzo1x.h],
+ ,
+ [AC_MSG_ERROR([lzo1x.h is missing])]
+ )]
+ )
+ CFLAGS="${saved_CFLAGS}"
+fi
+
+dnl
+dnl check for Snappy library
+dnl
+
+AC_ARG_VAR([SNAPPY_CFLAGS], [C compiler flags for snappy])
+AC_ARG_VAR([SNAPPY_LIBS], [linker flags for snappy])
+if test "$enable_snappy" = "yes" && test "$enable_comp_stub" = "no"; then
+ AC_CHECKING([for Snappy Library and Header files])
+ havesnappylib=1
+
+ # if SNAPPY_LIBS is set, we assume it will work, otherwise test
+ if test -z "${SNAPPY_LIBS}"; then
+ AC_CHECK_LIB(snappy, snappy_compress,
+ [ SNAPPY_LIBS="-lsnappy" ],
+ [
+ AC_MSG_RESULT([Snappy library not found.])
+ havesnappylib=0
+ ])
+ fi
+
+ saved_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} ${SNAPPY_CFLAGS}"
+ AC_CHECK_HEADERS(snappy-c.h,
+ ,
+ [
+ AC_MSG_RESULT([Snappy headers not found.])
+ havesnappylib=0
+ ])
+
+ if test $havesnappylib = 0 ; then
+ AC_MSG_RESULT([Snappy library available from http://code.google.com/p/snappy/])
+ AC_MSG_ERROR([Or try ./configure --disable-snappy OR ./configure --enable-comp-stub])
+ fi
+ OPTIONAL_SNAPPY_CFLAGS="${SNAPPY_CFLAGS}"
+ OPTIONAL_SNAPPY_LIBS="${SNAPPY_LIBS}"
+ AC_DEFINE(ENABLE_SNAPPY, 1, [Enable Snappy compression library])
+ CFLAGS="${saved_CFLAGS}"
+fi
+
+dnl
+dnl check for LZ4 library
+dnl
+
+AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4])
+AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4])
+if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then
+ AC_CHECKING([for LZ4 Library and Header files])
+ havelz4lib=1
+
+ # if LZ4_LIBS is set, we assume it will work, otherwise test
+ if test -z "${LZ4_LIBS}"; then
+ AC_CHECK_LIB(lz4, LZ4_compress,
+ [ LZ4_LIBS="-llz4" ],
+ [
+ AC_MSG_RESULT([LZ4 library not found.])
+ havelz4lib=0
+ ])
+ fi
+
+ saved_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} ${LZ4_CFLAGS}"
+ AC_CHECK_HEADERS(lz4.h,
+ ,
+ [
+ AC_MSG_RESULT([LZ4 headers not found.])
+ havelz4lib=0
+ ])
+
+ if test $havelz4lib = 0 ; then
+ AC_MSG_RESULT([LZ4 library or header not found, using version in src/compat/compat-lz4.*])
+ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
+ LZ4_LIBS=""
+ fi
+ OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
+ OPTIONAL_LZ4_LIBS="${LZ4_LIBS}"
+ AC_DEFINE(ENABLE_LZ4, 1, [Enable LZ4 compression library])
+ CFLAGS="${saved_CFLAGS}"
+fi
+
+
+
+
+AC_MSG_CHECKING([git checkout])
+GIT_CHECKOUT="no"
+if test -n "${GIT}" -a -d "${srcdir}/.git"; then
+ AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h])
+ GIT_CHECKOUT="yes"
+fi
+AC_MSG_RESULT([${GIT_CHECKOUT}])
+
+if test -n "${SP_PLATFORM_WINDOWS}"; then
+ AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['\\\\'], [Path separator]) #"
+ AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["\\\\"], [Path separator]) #"
+else
+ AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['/'], [Path separator])
+ AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["/"], [Path separator])
+fi
+
+dnl enable --x509-username-field feature if requested
+if test "${enable_x509_alt_username}" = "yes"; then
+ if test "${with_crypto_library}" = "polarssl" ; then
+ AC_MSG_ERROR([PolarSSL does not support the --x509-username-field feature])
+ fi
+
+ AC_DEFINE([ENABLE_X509ALTUSERNAME], [1], [Enable --x509-username-field feature])
+fi
+
+test "${ac_cv_header_sys_uio_h}" = "yes" && AC_DEFINE([HAVE_IOVEC], [1], [struct iovec needed for IPv6 support])
+test "${enable_multi}" = "yes" && AC_DEFINE([ENABLE_CLIENT_SERVER], [1], [Enable client/server capability])
+test "${enable_server}" = "no" && AC_DEFINE([ENABLE_CLIENT_ONLY], [1], [Enable client capability only])
+test "${enable_management}" = "yes" && AC_DEFINE([ENABLE_MANAGEMENT], [1], [Enable management server capability])
+test "${enable_multihome}" = "yes" && AC_DEFINE([ENABLE_MULTIHOME], [1], [Enable multi-homed UDP server capability])
+test "${enable_debug}" = "yes" && AC_DEFINE([ENABLE_DEBUG], [1], [Enable debugging support])
+test "${enable_small}" = "yes" && AC_DEFINE([ENABLE_SMALL], [1], [Enable smaller executable size])
+test "${enable_fragment}" = "yes" && AC_DEFINE([ENABLE_FRAGMENT], [1], [Enable internal fragmentation support])
+test "${enable_port_share}" = "yes" && AC_DEFINE([ENABLE_PORT_SHARE], [1], [Enable TCP Server port sharing])
+test "${enable_def_auth}" = "yes" && AC_DEFINE([ENABLE_DEF_AUTH], [1], [Enable deferred authentication])
+test "${enable_pf}" = "yes" && AC_DEFINE([ENABLE_PF], [1], [Enable internal packet filter])
+test "${enable_strict_options}" = "yes" && AC_DEFINE([ENABLE_STRICT_OPTIONS_CHECK], [1], [Enable strict options check between peers])
+test "${enable_password_save}" = "yes" && AC_DEFINE([ENABLE_PASSWORD_SAVE], [1], [Allow --askpass and --auth-user-pass passwords to be read from a file])
+test "${enable_systemd}" = "yes" && AC_DEFINE([ENABLE_SYSTEMD], [1], [Enable systemd support])
+
+case "${with_crypto_library}" in
+ openssl)
+ have_crypto_crypto="${have_openssl_crypto}"
+ have_crypto_ssl="${have_openssl_ssl}"
+ CRYPTO_CRYPTO_CFLAGS="${OPENSSL_CRYPTO_CFLAGS}"
+ CRYPTO_CRYPTO_LIBS="${OPENSSL_CRYPTO_LIBS}"
+ CRYPTO_SSL_CFLAGS="${OPENSSL_SSL_CFLAGS}"
+ CRYPTO_SSL_LIBS="${OPENSSL_SSL_LIBS}"
+ AC_DEFINE([ENABLE_CRYPTO_OPENSSL], [1], [Use OpenSSL library])
+ test "${have_openssl_engine}" = "yes" && AC_DEFINE([HAVE_OPENSSL_ENGINE], [1], [Use crypto library])
+ ;;
+ polarssl)
+ have_crypto_crypto="${have_polarssl_crypto}"
+ have_crypto_ssl="${have_polarssl_ssl}"
+ CRYPTO_CRYPTO_CFLAGS="${POLARSSL_CFLAGS}"
+ CRYPTO_CRYPTO_LIBS="${POLARSSL_LIBS}"
+ AC_DEFINE([ENABLE_CRYPTO_POLARSSL], [1], [Use PolarSSL library])
+ ;;
+esac
+
+if test "${enable_ssl}" = "yes"; then
+ test "${enable_crypto}" != "yes" && AC_MSG_ERROR([crypto must be enabled for ssl])
+ test "${have_crypto_ssl}" != "yes" && AC_MSG_ERROR([${with_ssl_library} ssl is required but missing])
+ OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_SSL_CFLAGS}"
+ OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_SSL_LIBS}"
+ AC_DEFINE([ENABLE_SSL], [1], [Enable ssl library])
+fi
+
+if test "${enable_crypto}" = "yes"; then
+ test "${have_crypto_crypto}" != "yes" && AC_MSG_ERROR([${with_crypto_library} crypto is required but missing])
+ test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes])
+ OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CRYPTO_CFLAGS}"
+ OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_CRYPTO_LIBS}"
+ AC_DEFINE([ENABLE_CRYPTO], [1], [Enable crypto library])
+fi
+
+if test "${enable_plugins}" = "yes"; then
+ OPTIONAL_DL_LIBS="${DL_LIBS}"
+ AC_DEFINE([ENABLE_PLUGIN], [1], [Enable plug-in support])
+else
+ enable_plugin_auth_pam="no"
+ enable_plugin_down_root="no"
+fi
+
+if test "${enable_iproute2}" = "yes"; then
+ test -z "${IPROUTE}" && AC_MSG_ERROR([ip utility is required but missing])
+ AC_DEFINE([ENABLE_IPROUTE], [1], [enable iproute2 support])
+else
+ if test "${WIN32}" != "yes"; then
+ test -z "${ROUTE}" && AC_MSG_ERROR([route utility is required but missing])
+ test -z "${IFCONFIG}" && AC_MSG_ERROR([ifconfig utility is required but missing])
+ fi
+fi
+
+if test "${enable_selinux}" = "yes"; then
+ test -z "${SELINUX_LIBS}" && AC_MSG_ERROR([libselinux required but missing])
+ OPTIONAL_SELINUX_LIBS="${SELINUX_LIBS}"
+ AC_DEFINE([ENABLE_SELINUX], [1], [SELinux support])
+fi
+
+if test "${enable_lzo}" = "yes"; then
+ test "${have_lzo}" != "yes" && AC_MSG_ERROR([lzo enabled but missing])
+ OPTIONAL_LZO_CFLAGS="${LZO_CFLAGS}"
+ OPTIONAL_LZO_LIBS="${LZO_LIBS}"
+ AC_DEFINE([ENABLE_LZO], [1], [Enable LZO compression library])
+fi
+if test "${enable_comp_stub}" = "yes"; then
+ test "${enable_lzo}" = "yes" && AC_MSG_ERROR([Cannot have both comp stub and lzo enabled (use --disable-lzo)])
+ test "${enable_snappy}" = "yes" && AC_MSG_ERROR([Cannot have both comp stub and snappy enabled (use --disable-snappy)])
+ test "${enable_lz4}" = "yes" && AC_MSG_ERROR([Cannot have both comp stub and LZ4 enabled (use --disable-lz4)])
+ AC_DEFINE([ENABLE_COMP_STUB], [1], [Enable compression stub capability])
+fi
+
+if test "${enable_pkcs11}" = "yes"; then
+ test "${have_pkcs11_helper}" != "yes" && AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])
+ test "${enable_ssl}" != "yes" && AC_MSG_ERROR([PKCS11 can be enabled only if SSL is enabled])
+ OPTIONAL_PKCS11_HELPER_CFLAGS="${PKCS11_HELPER_CFLAGS}"
+ OPTIONAL_PKCS11_HELPER_LIBS="${PKCS11_HELPER_LIBS}"
+ AC_DEFINE([ENABLE_PKCS11], [1], [Enable PKCS11])
+fi
+
+if test "${enable_pedantic}" = "yes"; then
+ enable_strict="yes"
+ CFLAGS="${CFLAGS} -pedantic"
+ test "${WIN32}" != "yes" && CFLAGS="${CFLAGS} -ansi"
+fi
+if test "${enable_strict}" = "yes"; then
+ CFLAGS="${CFLAGS} -Wall -Wno-unused-parameter -Wno-unused-function"
+fi
+if test "${enable_werror}" = "yes"; then
+ CFLAGS="${CFLAGS} -Werror"
+fi
+
+if test "${WIN32}" = "yes"; then
+ test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
+fi
+
+if test "${enable_plugin_auth_pam}" = "yes"; then
+ PLUGIN_AUTH_PAM_CFLAGS="${LIBPAM_CFLAGS}"
+ if test "${enable_pam_dlopen}" = "yes"; then
+ AC_DEFINE([USE_PAM_DLOPEN], [1], [dlopen libpam])
+ PLUGIN_AUTH_PAM_LIBS="${DL_LIBS}"
+ else
+ test -z "${LIBPAM_LIBS}" && AC_MSG_ERROR([libpam required but missing])
+ PLUGIN_AUTH_PAM_LIBS="${LIBPAM_LIBS}"
+ fi
+fi
+
+CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
+AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings])
+
+TAP_WIN_COMPONENT_ID="PRODUCT_TAP_WIN_COMPONENT_ID"
+TAP_WIN_MIN_MAJOR="PRODUCT_TAP_WIN_MIN_MAJOR"
+TAP_WIN_MIN_MINOR="PRODUCT_TAP_WIN_MIN_MINOR"
+AC_DEFINE_UNQUOTED([TAP_WIN_COMPONENT_ID], ["${TAP_WIN_COMPONENT_ID}"], [The tap-windows id])
+AC_DEFINE_UNQUOTED([TAP_WIN_MIN_MAJOR], [${TAP_WIN_MIN_MAJOR}], [The tap-windows version number is required for OpenVPN])
+AC_DEFINE_UNQUOTED([TAP_WIN_MIN_MINOR], [${TAP_WIN_MIN_MINOR}], [The tap-windows version number is required for OpenVPN])
+AC_SUBST([TAP_WIN_COMPONENT_ID])
+AC_SUBST([TAP_WIN_MIN_MAJOR])
+AC_SUBST([TAP_WIN_MIN_MINOR])
+
+AC_SUBST([OPTIONAL_DL_LIBS])
+AC_SUBST([OPTIONAL_SELINUX_LIBS])
+AC_SUBST([OPTIONAL_CRYPTO_CFLAGS])
+AC_SUBST([OPTIONAL_CRYPTO_LIBS])
+AC_SUBST([OPTIONAL_LZO_CFLAGS])
+AC_SUBST([OPTIONAL_LZO_LIBS])
+AC_SUBST([OPTIONAL_SNAPPY_CFLAGS])
+AC_SUBST([OPTIONAL_SNAPPY_LIBS])
+AC_SUBST([OPTIONAL_LZ4_CFLAGS])
+AC_SUBST([OPTIONAL_LZ4_LIBS])
+AC_SUBST([OPTIONAL_PKCS11_HELPER_CFLAGS])
+AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS])
+
+AC_SUBST([PLUGIN_AUTH_PAM_CFLAGS])
+AC_SUBST([PLUGIN_AUTH_PAM_LIBS])
+
+AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
+AM_CONDITIONAL([GIT_CHECKOUT], [test "${GIT_CHECKOUT}" = "yes"])
+AM_CONDITIONAL([ENABLE_PLUGIN_AUTH_PAM], [test "${enable_plugin_auth_pam}" = "yes"])
+AM_CONDITIONAL([ENABLE_PLUGIN_DOWN_ROOT], [test "${enable_plugin_down_root}" = "yes"])
+
+plugindir="${with_plugindir}"
+sampledir="\$(docdir)/sample"
+AC_SUBST([plugindir])
+AC_SUBST([sampledir])
+
+AC_CONFIG_FILES([
+ version.sh
+ Makefile
+ build/Makefile
+ build/msvc/Makefile
+ build/msvc/msvc-generate/Makefile
+ distro/Makefile
+ distro/rpm/Makefile
+ distro/rpm/openvpn.spec
+ include/Makefile
+ src/Makefile
+ src/compat/Makefile
+ src/openvpn/Makefile
+ src/openvpnserv/Makefile
+ src/plugins/Makefile
+ src/plugins/auth-pam/Makefile
+ src/plugins/down-root/Makefile
+ tests/Makefile
+ sample/Makefile
+ doc/Makefile
+])
+AC_CONFIG_FILES([tests/t_client.sh], [chmod +x tests/t_client.sh])
+AC_OUTPUT
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/OCSP_check/OCSP_check.sh b/ics-openvpn-stripped/main/openvpn/contrib/OCSP_check/OCSP_check.sh
new file mode 100644
index 00000000..553c3dce
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/OCSP_check/OCSP_check.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+# Sample script to perform OCSP queries with OpenSSL
+# given a certificate serial number.
+
+# If you run your own CA, you can set up a very simple
+# OCSP server using the -port option to "openssl ocsp".
+
+# Full documentation and examples:
+# http://www.openssl.org/docs/apps/ocsp.html
+
+
+# Edit the following values to suit your needs
+
+# OCSP responder URL (mandatory)
+# YOU MUST UNCOMMENT ONE OF THESE AND SET IT TO A VALID SERVER
+#ocsp_url="http://ocsp.example.com/"
+#ocsp_url="https://ocsp.secure.example.com/"
+
+# Path to issuer certificate (mandatory)
+# YOU MUST SET THIS TO THE PATH TO THE CA CERTIFICATE
+issuer="/path/to/CAcert.crt"
+
+# use a nonce in the query, set to "-no_nonce" to not use it
+nonce="-nonce"
+
+# Verify the response
+# YOU MUST SET THIS TO THE PATH TO THE RESPONSE VERIFICATION CERT
+verify="/path/to/CAcert.crt"
+
+# Depth in the certificate chain where the cert to verify is.
+# Set to -1 to run the verification at every level (NOTE that
+# in that case you need a more complex script as the various
+# parameters for the query will likely be different at each level)
+# "0" is the usual value here, where the client certificate is
+check_depth=0
+
+cur_depth=$1 # this is the *CURRENT* depth
+common_name=$2 # CN in case you need it
+
+# minimal sanity checks
+
+err=0
+if [ -z "$issuer" ] || [ ! -e "$issuer" ]; then
+ echo "Error: issuer certificate undefined or not found!" >&2
+ err=1
+fi
+
+if [ -z "$verify" ] || [ ! -e "$verify" ]; then
+ echo "Error: verification certificate undefined or not found!" >&2
+ err=1
+fi
+
+if [ -z "$ocsp_url" ]; then
+ echo "Error: OCSP server URL not defined!" >&2
+ err=1
+fi
+
+if [ $err -eq 1 ]; then
+ echo "Did you forget to customize the variables in the script?" >&2
+ exit 1
+fi
+
+# begin
+if [ $check_depth -eq -1 ] || [ $cur_depth -eq $check_depth ]; then
+
+ eval serial="\$tls_serial_${cur_depth}"
+
+ # To successfully complete, the following must happen:
+ #
+ # - The serial number must not be empty
+ # - The exit status of "openssl ocsp" must be zero
+ # - The output of the above command must contain the line
+ # "${serial}: good"
+ #
+ # Everything else fails with exit status 1.
+
+ if [ -n "$serial" ]; then
+
+ # This is only an example; you are encouraged to run this command (without
+ # redirections) manually against your or your CA's OCSP server to see how
+ # it responds, and adapt accordingly.
+ # Sample output that is assumed here:
+ #
+ # Response verify OK
+ # 4287405: good
+ # This Update: Apr 24 19:38:49 2010 GMT
+ # Next Update: May 2 14:23:42 2010 GMT
+ #
+ # NOTE: It is needed to check the exit code of OpenSSL explicitly. OpenSSL
+ # can in some circumstances give a "good" result if it could not
+ # reach the the OSCP server. In this case, the exit code will indicate
+ # if OpenSSL itself failed or not. If OpenSSL's exit code is not 0,
+ # don't trust the OpenSSL status.
+
+ status=$(openssl ocsp -issuer "$issuer" \
+ "$nonce" \
+ -CAfile "$verify" \
+ -url "$ocsp_url" \
+ -serial "${serial}" 2>/dev/null)
+
+ if [ $? -eq 0 ]; then
+ # check that it's good
+ if echo "$status" | grep -Fq "^${serial}: good"; then
+ exit 0
+ fi
+ fi
+ fi
+ # if we get here, something was wrong
+ exit 1
+fi
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/README b/ics-openvpn-stripped/main/openvpn/contrib/README
new file mode 100644
index 00000000..e1a57d0e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/README
@@ -0,0 +1,2 @@
+This directory contains scripts and patches contributed
+by users.
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/README b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/README
new file mode 100644
index 00000000..66fe61ad
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/README
@@ -0,0 +1,44 @@
+OpenVPN fwmark Routing
+Sean Reifschneider, <jafo@tummy.com>
+Thursday November 27, 2003
+==========================
+
+These scripts can be used with OpenVPN up and down scripts to set up
+routing on a Linux system such that the VPN traffic is sent via normal
+network connectivity, but other traffic to that network runs over the VPN.
+The idea is to allow encryption of data to the network the remote host is
+on, without interfering with the VPN traffic. You can't simply add a route
+to the remote network, becaues that will cause the VPN traffic to also try
+to run over the VPN, and breaks the VPN.
+
+These scripts use the Linux "fwmark" iptables rules to specify routing
+based not only on IP address, but also by port and protocol. This allows
+you to effectively say "if the packet is to this IP address on this port
+using this protocol, then use the normal default gateway, otherwise use the
+VPN gateway.
+
+This is set up on the client VPN system, not the VPN server. These scripts
+also set up all ICMP echo-responses to run across the VPN. You can
+comment the lines in the scripts to disable this, but I find this useful
+at coffee shops which have networks that block ICMP.
+
+To configure this, you need to set up these scripts as your up and down
+scripts in the config file. You will need to set these values in the
+config file:
+
+ up /etc/openvpn/fwmarkroute.up
+ down /etc/openvpn/fwmarkroute.down
+ up-restart
+ up-delay
+
+ setenv remote_netmask_bits 24
+
+Note: For this to work, you can't set the "user" or "group" config options,
+because then the scripts will not run as root.
+
+The last setting allows you to control the size of the network the remote
+system is on. The remote end has to be set up to route, probably with
+masquerading or NAT. The network this netmask relates to is calculated
+using the value of "remote" in the conf file.
+
+Sean
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.down b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.down
new file mode 100755
index 00000000..87d67d4d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.down
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Bring down vpn routing.
+
+# calculate the network address
+remote_network=`ipcalc -n "$remote"/"$remote_netmask_bits"`
+remote_network="${remote_network#*=}"
+
+# clear routing via VPN
+ip route del "$remote_network"/"$remote_netmask_bits" via "$5" table vpn.out
+ip route del table vpnonly.out via "$5"
+iptables -D OUTPUT -t mangle -p "$proto" \
+ -d "$remote_network"/"$remote_netmask_bits" \
+ --dport "$remote_port" -j ACCEPT
+iptables -D OUTPUT -t mangle -d "$remote" -j MARK --set-mark 2
+
+# undo the ICMP ping tunneling
+iptables -D OUTPUT -t mangle --protocol icmp --icmp-type echo-request \
+ -j MARK --set-mark 3
+
+# flush route cache
+ip route flush cache
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.up b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.up
new file mode 100755
index 00000000..661ec313
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.up
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Bring up vpn routing.
+
+# calculate the network address
+remote_network=`ipcalc -n "$remote"/"$remote_netmask_bits"`
+remote_network="${remote_network#*=}"
+
+# add the stuff that doesn't change if it's not already there
+grep -q '^202 ' /etc/iproute2/rt_tables
+if [ "$?" -ne 0 ]
+then
+ echo 202 vpn.out >> /etc/iproute2/rt_tables
+fi
+grep -q '^203 ' /etc/iproute2/rt_tables
+if [ "$?" -ne 0 ]
+then
+ echo 203 vpnonly.out >> /etc/iproute2/rt_tables
+fi
+ip rule ls | grep -q 'lookup vpn.out *$'
+if [ "$?" -ne 0 ]
+then
+ ip rule add fwmark 2 table vpn.out
+fi
+ip rule ls | grep -q 'lookup vpnonly.out *$'
+if [ "$?" -ne 0 ]
+then
+ ip rule add fwmark 3 table vpnonly.out
+fi
+
+# route VPN traffic using the normal table
+iptables -A OUTPUT -t mangle -p "$proto" -d "$remote" --dport "$remote_port" \
+ -j ACCEPT
+
+# route all other traffic to that host via VPN
+iptables -A OUTPUT -t mangle -d "$remote_network"/"$remote_netmask_bits" \
+ -j MARK --set-mark 2
+
+# route all ICMP pings over the VPN
+iptables -A OUTPUT -t mangle --protocol icmp --icmp-type echo-request \
+ -j MARK --set-mark 3
+
+# NAT traffic going over the VPN, so it doesn't have an unknown address
+iptables -t nat -A POSTROUTING -o "$1" -j SNAT --to-source "$4"
+
+# add routing commands
+ip route add "$remote_network"/"$remote_netmask_bits" via "$5" table vpn.out
+ip route add table vpnonly.out via "$5"
+ip route flush cache
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.down b/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.down
new file mode 100644
index 00000000..05f2d4d5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.down
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Copyright (c) 2005-2010 OpenVPN Technologies, Inc.
+# Licensed under the GPL version 2
+
+# First version by Jesse Adelman
+# someone at boldandbusted dink com
+# http://www.boldandbusted.com/
+
+# PURPOSE: This script automatically removes the /etc/resolv.conf entries previously
+# set by the companion script "client.up".
+
+# INSTALL NOTES:
+# Place this in /etc/openvpn/client.down
+# Then, add the following to your /etc/openvpn/<clientconfig>.conf:
+# client
+# up /etc/openvpn/client.up
+# down /etc/openvpn/client.down
+# Next, "chmod a+x /etc/openvpn/client.down"
+
+# USAGE NOTES:
+# Note that this script is best served with the companion "client.up"
+# script.
+
+# Tested under Debian lenny with OpenVPN 2.1_rc11
+# It should work with any UNIX with a POSIX sh, /etc/resolv.conf or resolvconf
+
+# This runs with the context of the OpenVPN UID/GID
+# at the time of execution. This generally means that
+# the client "up" script will run fine, but the "down" script
+# will require the use of the OpenVPN "down-root" plugin
+# which is in the plugins/ directory of the OpenVPN source tree
+
+# A horrid work around, from a security perspective,
+# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
+# been WARNED.
+PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
+
+if type resolvconf >/dev/null 2>&1; then
+ resolvconf -d "${1}" -f
+elif [ -e /etc/resolv.conf.ovpnsave ] ; then
+ # cp + rm rather than mv in case it's a symlink
+ cp /etc/resolv.conf.ovpnsave /etc/resolv.conf
+ rm -f /etc/resolv.conf.ovpnsave
+fi
+
+exit 0
diff --git a/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.up b/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.up
new file mode 100644
index 00000000..b28d4d19
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/contrib/pull-resolv-conf/client.up
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+# Copyright (c) 2005-2010 OpenVPN Technologies, Inc.
+# Licensed under the GPL version 2
+
+# First version by Jesse Adelman
+# someone at boldandbusted dink com
+# http://www.boldandbusted.com/
+
+# PURPOSE: This script automatically sets the proper /etc/resolv.conf entries
+# as pulled down from an OpenVPN server.
+
+# INSTALL NOTES:
+# Place this in /etc/openvpn/client.up
+# Then, add the following to your /etc/openvpn/<clientconfig>.conf:
+# client
+# up /etc/openvpn/client.up
+# Next, "chmod a+x /etc/openvpn/client.up"
+
+# USAGE NOTES:
+# Note that this script is best served with the companion "client.down"
+# script.
+
+# Tested under Debian lenny with OpenVPN 2.1_rc11
+# It should work with any UNIX with a POSIX sh, /etc/resolv.conf or resolvconf
+
+# This runs with the context of the OpenVPN UID/GID
+# at the time of execution. This generally means that
+# the client "up" script will run fine, but the "down" script
+# will require the use of the OpenVPN "down-root" plugin
+# which is in the plugins/ directory of the OpenVPN source tree
+
+# A horrid work around, from a security perspective,
+# is to run OpenVPN as root. THIS IS NOT RECOMMENDED. You have
+# been WARNED.
+PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
+
+# init variables
+
+i=1
+domains=
+fopt=
+ndoms=0
+nns=0
+nl='
+'
+
+# $foreign_option_<n> is something like
+# "dhcp-option DOMAIN example.com" (multiple allowed)
+# or
+# "dhcp-option DNS 10.10.10.10" (multiple allowed)
+
+# each DNS option becomes a "nameserver" option in resolv.con
+# if we get one DOMAIN, that becomes "domain" in resolv.conf
+# if we get multiple DOMAINS, those become "search" lines in resolv.conf
+
+while true; do
+ eval fopt=\$foreign_option_${i}
+ [ -z "${fopt}" ] && break
+
+ case ${fopt} in
+ dhcp-option\ DOMAIN\ *)
+ ndoms=$((ndoms + 1))
+ domains="${domains} ${fopt#dhcp-option DOMAIN }"
+ ;;
+ dhcp-option\ DNS\ *)
+ nns=$((nns + 1))
+ if [ $nns -le 3 ]; then
+ dns="${dns}${dns:+$nl}nameserver ${fopt#dhcp-option DNS }"
+ else
+ printf "%s\n" "Too many nameservers - ignoring after third" >&2
+ fi
+ ;;
+ *)
+ printf "%s\n" "Unknown option \"${fopt}\" - ignored" >&2
+ ;;
+ esac
+ i=$((i + 1))
+done
+
+ds=domain
+if [ $ndoms -gt 1 ]; then
+ ds=search
+fi
+
+# This is the complete file - "$domains" has a leading space already
+out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
+
+# use resolvconf if it's available
+if type resolvconf >/dev/null 2>&1; then
+ printf "%s\n" "${out}" | resolvconf -p -a "${1}"
+else
+ # Preserve the existing resolv.conf
+ if [ -e /etc/resolv.conf ] ; then
+ cp /etc/resolv.conf /etc/resolv.conf.ovpnsave
+ fi
+ printf "%s\n" "${out}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+fi
+
+exit 0
diff --git a/ics-openvpn-stripped/main/openvpn/debug/doval b/ics-openvpn-stripped/main/openvpn/debug/doval
new file mode 100755
index 00000000..e2155107
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/debug/doval
@@ -0,0 +1,4 @@
+#!/bin/bash
+PROGDIR=`dirname $0`
+unset LD_LIBRARY_PATH
+valgrind --tool=memcheck --error-limit=no --suppressions=$PROGDIR/debug/valgrind-suppress --gen-suppressions=all --leak-check=full --show-reachable=yes --num-callers=32 $PROGDIR/openvpn "$@"
diff --git a/ics-openvpn-stripped/main/openvpn/debug/dovalns b/ics-openvpn-stripped/main/openvpn/debug/dovalns
new file mode 100755
index 00000000..482ae3fd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/debug/dovalns
@@ -0,0 +1,2 @@
+#!/bin/bash
+valgrind --tool=memcheck --error-limit=no --gen-suppressions=all --leak-check=full --show-reachable=yes --num-callers=32 $*
diff --git a/ics-openvpn-stripped/main/openvpn/debug/valgrind-suppress b/ics-openvpn-stripped/main/openvpn/debug/valgrind-suppress
new file mode 100644
index 00000000..d7de12fd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/debug/valgrind-suppress
@@ -0,0 +1,1182 @@
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ fun:__nss_next
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlopen
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlopen
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlsym
+ fun:libdl_resolve_symbol
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlopen
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/libc-2.7.so
+ obj:/lib/ld-2.7.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.7.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/libc-2.7.so
+ obj:/lib/ld-2.7.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.7.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/libc-2.7.so
+ obj:/lib/ld-2.7.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.7.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Addr8
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/ld-2.7.so
+ obj:/lib/libc-2.7.so
+ obj:/lib/ld-2.7.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.7.so
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_verify
+ fun:EVP_VerifyFinal
+ fun:ASN1_item_verify
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:X509_verify_cert
+ fun:ssl_verify_cert_chain
+ fun:ssl3_get_client_certificate
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_sign
+ fun:ssl3_send_server_key_exchange
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_MONT_CTX_set
+ fun:BN_mod_exp_mont
+ fun:BN_BLINDING_create_param
+ fun:RSA_setup_blinding
+ obj:/usr/lib/libcrypto.so.0.9.8
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_sign
+ fun:ssl3_send_server_key_exchange
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_nnmod
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+ fun:BN_nnmod
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_verify
+ fun:EVP_VerifyFinal
+ fun:ASN1_item_verify
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:X509_verify_cert
+ fun:ssl_verify_cert_chain
+ fun:ssl3_get_client_certificate
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:ssl3_ctx_ctrl
+ fun:init_ssl
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_MONT_CTX_set_locked
+ obj:/usr/lib/libcrypto.so.0.9.8
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_sign
+ fun:ssl3_send_server_key_exchange
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+ fun:BN_MONT_CTX_set
+ fun:BN_mod_exp_mont
+ fun:BN_BLINDING_create_param
+ fun:RSA_setup_blinding
+ obj:/usr/lib/libcrypto.so.0.9.8
+ obj:/usr/lib/libcrypto.so.0.9.8
+ fun:RSA_sign
+ fun:ssl3_send_server_key_exchange
+ fun:ssl3_accept
+ fun:ssl3_read_bytes
+ fun:ssl3_read
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:BIO_read
+ fun:bio_read
+ fun:tls_process
+ fun:tls_multi_process
+ fun:check_tls_dowork
+ fun:pre_select
+ fun:multi_process_post
+ fun:multi_process_incoming_link
+ fun:multi_tcp_action
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:*
+ obj:*
+ obj:*
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ fun:__nss_next
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ fun:__nss_next
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ fun:__nss_next
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:gethostbyname_r
+ fun:gethostbyname
+ fun:getaddr
+ fun:resolve_remote
+ fun:link_socket_init_phase1
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/ld-2.5.so
+ fun:__libc_dlopen_mode
+ fun:__nss_lookup_function
+ obj:/lib/libc-2.5.so
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libc-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlsym
+ fun:libdl_resolve_symbol
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ obj:/lib/ld-2.5.so
+ obj:/lib/libdl-2.5.so
+ fun:dlopen
+ fun:plugin_list_init
+ fun:init_plugins
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:CRYPTO_malloc
+ fun:sk_new
+ obj:/usr/lib/libssl.so.0.9.8
+ fun:SSL_COMP_get_compression_methods
+ fun:SSL_library_init
+ fun:init_ssl_lib
+ fun:init_static
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:getdelim
+ fun:getpass
+ fun:get_console_input
+ fun:get_user_pass
+ fun:context_init_1
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:tsearch
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:tsearch
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:tsearch
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:tsearch
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ fun:tsearch
+ fun:__nss_lookup_function
+ obj:*
+ obj:*
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.5.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.5.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.5.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.5.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.7.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_tcp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.7.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getgrnam_r
+ fun:getgrnam
+ fun:get_group
+ fun:do_init_first_time
+ fun:init_instance
+ fun:init_instance_handle_signals
+ fun:tunnel_server_udp
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Leak
+ fun:malloc
+ obj:/lib/libc-2.7.so
+ fun:__nss_database_lookup
+ obj:*
+ obj:*
+ fun:getpwnam_r
+ fun:getpwnam
+ fun:get_user
+ fun:management_open
+ fun:open_management
+ fun:main
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_mod_inverse
+}
+
+{
+ <insert a suppression name here>
+ Memcheck:Cond
+ fun:BN_div
+}
diff --git a/ics-openvpn-stripped/main/openvpn/distro/Makefile.am b/ics-openvpn-stripped/main/openvpn/distro/Makefile.am
new file mode 100644
index 00000000..2dd6a6ee
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/Makefile.am
@@ -0,0 +1,15 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+SUBDIRS = rpm
diff --git a/ics-openvpn-stripped/main/openvpn/distro/rpm/Makefile.am b/ics-openvpn-stripped/main/openvpn/distro/rpm/Makefile.am
new file mode 100644
index 00000000..536061dd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/rpm/Makefile.am
@@ -0,0 +1,18 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+dist_noinst_DATA = \
+ openvpn.spec \
+ openvpn.init.d.rhel \
+ openvpn.init.d.suse
diff --git a/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.rhel b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.rhel
new file mode 100755
index 00000000..cdf3e9de
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.rhel
@@ -0,0 +1,244 @@
+#!/bin/sh
+#
+# openvpn This shell script takes care of starting and stopping
+# openvpn on RedHat or other chkconfig-based system.
+#
+# chkconfig: 345 24 76
+#
+# description: OpenVPN is a robust and highly flexible tunneling application \
+# that uses all of the encryption, authentication, and \
+# certification features of the OpenSSL library to securely \
+# tunnel IP networks over a single UDP port.
+#
+
+# Contributed to the OpenVPN project by
+# Douglas Keller <doug@voidstar.dyndns.org>
+# 2002.05.15
+
+# To install:
+# copy this file to /etc/rc.d/init.d/openvpn
+# shell> chkconfig --add openvpn
+# shell> mkdir /etc/openvpn
+# make .conf or .sh files in /etc/openvpn (see below)
+
+# To uninstall:
+# run: chkconfig --del openvpn
+
+# Author's Notes:
+#
+# I have created an /etc/init.d init script and enhanced openvpn.spec to
+# automatically register the init script. Once the RPM is installed you
+# can start and stop OpenVPN with "service openvpn start" and "service
+# openvpn stop".
+#
+# The init script does the following:
+#
+# - Starts an openvpn process for each .conf file it finds in
+# /etc/openvpn.
+#
+# - If /etc/openvpn/xxx.sh exists for a xxx.conf file then it executes
+# it before starting openvpn (useful for doing openvpn --mktun...).
+#
+# - In addition to start/stop you can do:
+#
+# service openvpn reload - SIGHUP
+# service openvpn reopen - SIGUSR1
+# service openvpn status - SIGUSR2
+#
+# Modifications:
+#
+# 2003.05.02
+# * Changed == to = for sh compliance (Bishop Clark).
+# * If condrestart|reload|reopen|status, check that we were
+# actually started (James Yonan).
+# * Added lock, piddir, and work variables (James Yonan).
+# * If start is attempted twice, without an intervening stop, or
+# if start is attempted when previous start was not properly
+# shut down, then kill any previously started processes, before
+# commencing new start operation (James Yonan).
+# * Do a better job of flagging errors on start, and properly
+# returning success or failure status to caller (James Yonan).
+#
+# 2005.04.04
+# * Added openvpn-startup and openvpn-shutdown script calls
+# (James Yonan).
+#
+
+# Location of openvpn binary
+openvpn=""
+openvpn_locations="/usr/sbin/openvpn /usr/local/sbin/openvpn"
+for location in $openvpn_locations
+do
+ if [ -f "$location" ]
+ then
+ openvpn=$location
+ fi
+done
+
+# Lockfile
+lock="/var/lock/subsys/openvpn"
+
+# PID directory
+piddir="/var/run/openvpn"
+
+# Our working directory
+work=/etc/openvpn
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if [ ${NETWORKING} = "no" ]
+then
+ echo "Networking is down"
+ exit 0
+fi
+
+# Check that binary exists
+if ! [ -f $openvpn ]
+then
+ echo "openvpn binary not found"
+ exit 0
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n $"Starting openvpn: "
+
+ /sbin/modprobe tun >/dev/null 2>&1
+
+ # From a security perspective, I think it makes
+ # sense to remove this, and have users who need
+ # it explictly enable in their --up scripts or
+ # firewall setups.
+
+ #echo 1 > /proc/sys/net/ipv4/ip_forward
+
+ # Run startup script, if defined
+ if [ -f $work/openvpn-startup ]; then
+ $work/openvpn-startup
+ fi
+
+ if [ ! -d $piddir ]; then
+ mkdir $piddir
+ fi
+
+ if [ -f $lock ]; then
+ # we were not shut down correctly
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill `cat $pidf` >/dev/null 2>&1
+ fi
+ rm -f $pidf
+ done
+ rm -f $lock
+ sleep 2
+ fi
+
+ rm -f $piddir/*.pid
+ cd $work
+
+ # Start every .conf in $work and run .sh if exists
+ errors=0
+ successes=0
+ for c in `/bin/ls *.conf 2>/dev/null`; do
+ bn=${c%%.conf}
+ if [ -f "$bn.sh" ]; then
+ . ./$bn.sh
+ fi
+ rm -f $piddir/$bn.pid
+ $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
+ if [ $? = 0 ]; then
+ successes=1
+ else
+ errors=1
+ fi
+ done
+
+ if [ $errors = 1 ]; then
+ failure; echo
+ else
+ success; echo
+ fi
+
+ if [ $successes = 1 ]; then
+ touch $lock
+ fi
+ ;;
+ stop)
+ echo -n $"Shutting down openvpn: "
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill `cat $pidf` >/dev/null 2>&1
+ fi
+ rm -f $pidf
+ done
+
+ # Run shutdown script, if defined
+ if [ -f $work/openvpn-shutdown ]; then
+ $work/openvpn-shutdown
+ fi
+
+ success; echo
+ rm -f $lock
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ reload)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -HUP `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+ ;;
+ reopen)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -USR1 `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+ ;;
+ condrestart)
+ if [ -f $lock ]; then
+ $0 stop
+ # avoid race
+ sleep 2
+ $0 start
+ fi
+ ;;
+ status)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -USR2 `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ echo "Status written to /var/log/messages"
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Usage: openvpn {start|stop|restart|condrestart|reload|reopen|status}"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.suse b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.suse
new file mode 100644
index 00000000..270024e8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.init.d.suse
@@ -0,0 +1,264 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: openvpn
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: This shell script takes care of starting and stopping OpenVPN.
+# Description: OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authentication, and certification features of the OpenSSL library to securely tunnel IP networks over a single UDP port.
+### END INIT INFO
+
+# Contributed to the OpenVPN project by
+# Douglas Keller <doug@voidstar.dyndns.org>
+# 2002.05.15
+
+# Modified for SuSE by
+# Frank Plohmann <openvpn@franks-planet.de>
+# 2003.08.24
+# Please feel free to contact me if you have problems or suggestions
+# using this script.
+
+# To install:
+# copy this file to /etc/rc.d/init.d/openvpn
+# use the runlevel editor in Yast to add it to runlevel 3 and/or 5
+# shell> mkdir /etc/openvpn
+# make .conf or .sh files in /etc/openvpn (see below)
+
+# To uninstall:
+# use also Yast and the runlevel editor to uninstall
+
+# Author's Notes:
+#
+# I have created an /etc/init.d init script and enhanced openvpn.spec to
+# automatically register the init script. Once the RPM is installed you
+# can start and stop OpenVPN with "service openvpn start" and "service
+# openvpn stop".
+#
+# The init script does the following:
+#
+# - Starts an openvpn process for each .conf file it finds in
+# /etc/openvpn.
+#
+# - If /etc/openvpn/xxx.sh exists for a xxx.conf file then it executes
+# it before starting openvpn (useful for doing openvpn --mktun...).
+#
+# - In addition to start/stop you can do:
+#
+# /etc/init.d/openvpn reload - SIGHUP
+# /etc/init.d/openvpn reopen - SIGUSR1
+# /etc/init.d/openvpn status - SIGUSR2
+
+# Modifications 2003.05.02
+# * Changed == to = for sh compliance (Bishop Clark).
+# * If condrestart|reload|reopen|status, check that we were
+# actually started (James Yonan).
+# * Added lock, piddir, and work variables (James Yonan).
+# * If start is attempted twice, without an intervening stop, or
+# if start is attempted when previous start was not properly
+# shut down, then kill any previously started processes, before
+# commencing new start operation (James Yonan).
+# * Do a better job of flagging errors on start, and properly
+# returning success or failure status to caller (James Yonan).
+#
+# Modifications 2003.08.24
+# * Converted the script for SuSE Linux distribution.
+# Tested with version 8.2 (Frank Plohmann).
+# - removed "chkconfig" header
+# - added Yast header
+# - changed installation notes
+# - corrected path to openvpn binary
+# - removes sourcing "functions"
+# - removed sourcing "network"
+# - removed network checking. it seemed not to work with SuSE.
+# - added sourcing "rc.status", comments and "rc_reset" command
+# - removed "succes; echo" and "failure; echo" lines
+# - added "rc_status" lines at the end of each section
+# - changed "service" to "/etc/init.d/" in "In addition to start/stop"
+# section above.
+#
+# Modifications 2005.04.04
+# * Added openvpn-startup and openvpn-shutdown script calls (James Yonan).
+#
+
+# Location of openvpn binary
+openvpn="/usr/sbin/openvpn"
+
+# Lockfile
+lock="/var/lock/subsys/openvpn"
+
+# PID directory
+piddir="/var/run/openvpn"
+
+# Our working directory
+work=/etc/openvpn
+
+# Source rc functions
+. /etc/rc.status
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+# First reset status of this service
+rc_reset
+
+[ -f $openvpn ] || exit 0
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n $"Starting openvpn: "
+
+ /sbin/modprobe tun >/dev/null 2>&1
+
+ # From a security perspective, I think it makes
+ # sense to remove this, and have users who need
+ # it explictly enable in their --up scripts or
+ # firewall setups.
+
+ #echo 1 > /proc/sys/net/ipv4/ip_forward
+
+ # Run startup script, if defined
+ if [ -f $work/openvpn-startup ]; then
+ $work/openvpn-startup
+ fi
+
+ if [ ! -d $piddir ]; then
+ mkdir $piddir
+ fi
+
+ if [ -f $lock ]; then
+ # we were not shut down correctly
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill `cat $pidf` >/dev/null 2>&1
+ fi
+ rm -f $pidf
+ done
+ rm -f $lock
+ sleep 2
+ fi
+
+ rm -f $piddir/*.pid
+ cd $work
+
+ # Start every .conf in $work and run .sh if exists
+ errors=0
+ successes=0
+ for c in `/bin/ls *.conf 2>/dev/null`; do
+ bn=${c%%.conf}
+ if [ -f "$bn.sh" ]; then
+ . ./$bn.sh
+ fi
+ rm -f $piddir/$bn.pid
+ $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
+ if [ $? = 0 ]; then
+ successes=1
+ else
+ errors=1
+ fi
+ done
+
+ if [ $successes = 1 ]; then
+ touch $lock
+ fi
+
+ rc_status -v
+ ;;
+ stop)
+ echo -n $"Shutting down openvpn: "
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill `cat $pidf` >/dev/null 2>&1
+ fi
+ rm -f $pidf
+ done
+
+ # Run shutdown script, if defined
+ if [ -f $work/openvpn-shutdown ]; then
+ $work/openvpn-shutdown
+ fi
+
+ rm -f $lock
+
+ rc_status -v
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+
+ rc_status
+ ;;
+ reload)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -HUP `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+
+ rc_status -v
+ ;;
+ reopen)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -USR1 `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+
+ rc_status -v
+ ;;
+ condrestart)
+ if [ -f $lock ]; then
+ $0 stop
+ # avoid race
+ sleep 2
+ $0 start
+ fi
+
+ rc_status
+ ;;
+ status)
+ if [ -f $lock ]; then
+ for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
+ if [ -s $pidf ]; then
+ kill -USR2 `cat $pidf` >/dev/null 2>&1
+ fi
+ done
+ echo "Status written to /var/log/messages"
+ else
+ echo "openvpn: service not started"
+ exit 1
+ fi
+
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: openvpn {start|stop|restart|condrestart|reload|reopen|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec
new file mode 100644
index 00000000..86ed85c9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec
@@ -0,0 +1,248 @@
+# OpenVPN spec file, used to drive rpmbuild
+
+# OPTIONS
+#
+# Disable LZO
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'without_lzo 1'
+#
+# Disable PAM plugin
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'without_pam 1'
+#
+# Allow passwords to be read from files
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
+
+Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+Name: openvpn
+Version: 2.3_master
+Release: 1
+URL: http://openvpn.net/
+Source0: http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz
+
+License: GPL
+Group: Applications/Internet
+Vendor: James Yonan <jim@yonan.net>
+Packager: James Yonan <jim@yonan.net>
+BuildRoot: %{_tmppath}/%{name}-%(id -un)
+
+#
+# Include dependencies manually
+#
+
+AutoReq: 0
+
+BuildRequires: openssl-devel >= 0.9.7
+Requires: openssl >= 0.9.7
+
+%if "%{_vendor}" == "Mandrakesoft"
+%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
+%{!?without_lzo:Requires: liblzo1 >= 1.07}
+%else
+%if "%{_vendor}" == "MandrakeSoft"
+%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
+%{!?without_lzo:Requires: liblzo1 >= 1.07}
+%else
+%{!?without_lzo:BuildRequires: lzo-devel >= 1.07}
+%{!?without_lzo:Requires: lzo >= 1.07}
+%endif
+%endif
+
+%{!?without_pam:BuildRequires: pam-devel}
+%{!?without_pam:Requires: pam}
+
+%{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
+%{?with_pkcs11:Requires: pkcs11-helper}
+
+#
+# Description
+#
+
+%description
+OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+OpenVPN supports SSL/TLS security,
+ethernet bridging,
+TCP or UDP tunnel transport through proxies or NAT,
+support for dynamic IP addresses and DHCP,
+scalability to hundreds or thousands of users,
+and portability to most major OS platforms.
+
+%package devel
+Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+Group: Applications/Internet
+Requires: %{name}
+%description devel
+Development support for OpenVPN.
+
+#
+# Define vendor type
+#
+
+%if "%{_vendor}" == "suse" || "%{_vendor}" == "pc"
+%define VENDOR SuSE
+%else
+%define VENDOR %_vendor
+%endif
+
+#
+# Other definitions
+#
+
+%define debug_package %{nil}
+
+#
+# Build OpenVPN binary
+#
+
+%prep
+%setup -q
+
+%build
+%configure \
+ --disable-dependency-tracking \
+ --docdir="%{_docdir}/%{name}-%{version}" \
+ %{?with_password_save:--enable-password-save} \
+ %{!?without_lzo:--enable-lzo} \
+ %{?with_pkcs11:--enable-pkcs11} \
+ %{?without_pam:--disable-plugin-auth-pam}
+%__make
+
+#
+# Installation section
+#
+
+%install
+[ %{buildroot} != "/" ] && rm -rf %{buildroot}
+%__make install DESTDIR="%{buildroot}"
+
+# Install init script
+%if "%{VENDOR}" == "SuSE"
+%__install -c -d -m 755 "%{buildroot}/etc/init.d"
+%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
+%else
+%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
+%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
+%endif
+
+# Install /etc/openvpn
+%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
+
+# Install extra %doc stuff
+cp -r AUTHORS ChangeLog NEWS contrib/ sample/ \
+ "%{buildroot}/%{_docdir}/%{name}-%{version}"
+
+#
+# Clean section
+#
+
+%clean
+[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
+
+#
+# On Linux 2.4, make the device node
+#
+
+%post
+case "`uname -r`" in
+2.4*)
+ /bin/mkdir /dev/net >/dev/null 2>&1
+ /bin/mknod /dev/net/tun c 10 200 >/dev/null 2>&1
+ ;;
+esac
+
+#
+# Handle the init script
+#
+
+/sbin/chkconfig --add %{name}
+%if "%{VENDOR}" == "SuSE"
+/etc/init.d/openvpn restart
+%else
+/sbin/service %{name} condrestart
+%endif
+%preun
+if [ "$1" = 0 ]
+then
+ %if "%{VENDOR}" == "SuSE"
+ /etc/init.d/openvpn stop
+ %else
+ /sbin/service %{name} stop
+ %endif
+ /sbin/chkconfig --del %{name}
+fi
+
+#
+# Files section
+#
+# don't use %doc as old rpmbuild removes it[1].
+# [1] http://rpm.org/ticket/836
+
+%files
+%defattr(-,root,root)
+%{_mandir}
+%{_sbindir}/%{name}
+%{_libdir}/%{name}
+%{_docdir}/%{name}-%{version}
+%dir /etc/%{name}
+%if "%{VENDOR}" == "SuSE"
+/etc/init.d/%{name}
+%else
+/etc/rc.d/init.d/%{name}
+%endif
+
+%files devel
+%defattr(-,root,root)
+%{_includedir}/*
+
+%changelog
+* Thu Jul 30 2009 David Sommerseth <dazo@users.sourceforge.net>
+- Removed management/ directory from %doc
+
+* Thu Dec 14 2006 Alon Bar-Lev
+- Added with_pkcs11
+
+* Mon Aug 2 2005 James Yonan
+- Fixed build problem with --define 'without_pam 1'
+
+* Mon Apr 4 2005 James Yonan
+- Moved some files from /usr/share/openvpn to %doc for compatibility
+ with Dag Wieers' RPM repository
+
+* Sat Mar 12 2005 Tom Walsh
+- Added MandrakeSoft liblzo1 require
+
+* Fri Dec 10 2004 James Yonan
+- Added AutoReq: 0 for manual dependencies
+
+* Fri Dec 10 2004 James Yonan
+- Packaged the plugins
+
+* Sun Nov 7 2004 Umberto Nicoletti
+- SuSE support
+
+* Wed Aug 18 2004 Bishop Clark (LC957) <bishop@platypus.bc.ca>
+- restrict what we claim in /etc/ to avoid ownership conflicts
+
+* Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1.
+- Have the version number filled in by autoconf.
+
+* Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
+- Fixed %preun to only remove service on final uninstall
+
+* Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
+- Added condrestart to openvpn.spec & openvpn.init.
+
+* Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
+- Added mknod for Linux 2.4.
+
+* Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
+- Added init scripts
+- Added conf file support
+
+* Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
+- Added new directories for config examples and such
+
+* Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
+- Updated buildroot directive and cleanup command
+- added easy-rsa utilities
+
+* Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
+- Initial build.
diff --git a/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec.in b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec.in
new file mode 100644
index 00000000..20a8c890
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/distro/rpm/openvpn.spec.in
@@ -0,0 +1,248 @@
+# OpenVPN spec file, used to drive rpmbuild
+
+# OPTIONS
+#
+# Disable LZO
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'without_lzo 1'
+#
+# Disable PAM plugin
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'without_pam 1'
+#
+# Allow passwords to be read from files
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
+
+Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+Name: @PACKAGE@
+Version: @VERSION@
+Release: 1
+URL: http://openvpn.net/
+Source0: http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz
+
+License: GPL
+Group: Applications/Internet
+Vendor: James Yonan <jim@yonan.net>
+Packager: James Yonan <jim@yonan.net>
+BuildRoot: %{_tmppath}/%{name}-%(id -un)
+
+#
+# Include dependencies manually
+#
+
+AutoReq: 0
+
+BuildRequires: openssl-devel >= 0.9.7
+Requires: openssl >= 0.9.7
+
+%if "%{_vendor}" == "Mandrakesoft"
+%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
+%{!?without_lzo:Requires: liblzo1 >= 1.07}
+%else
+%if "%{_vendor}" == "MandrakeSoft"
+%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
+%{!?without_lzo:Requires: liblzo1 >= 1.07}
+%else
+%{!?without_lzo:BuildRequires: lzo-devel >= 1.07}
+%{!?without_lzo:Requires: lzo >= 1.07}
+%endif
+%endif
+
+%{!?without_pam:BuildRequires: pam-devel}
+%{!?without_pam:Requires: pam}
+
+%{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
+%{?with_pkcs11:Requires: pkcs11-helper}
+
+#
+# Description
+#
+
+%description
+OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+OpenVPN supports SSL/TLS security,
+ethernet bridging,
+TCP or UDP tunnel transport through proxies or NAT,
+support for dynamic IP addresses and DHCP,
+scalability to hundreds or thousands of users,
+and portability to most major OS platforms.
+
+%package devel
+Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+Group: Applications/Internet
+Requires: %{name}
+%description devel
+Development support for OpenVPN.
+
+#
+# Define vendor type
+#
+
+%if "%{_vendor}" == "suse" || "%{_vendor}" == "pc"
+%define VENDOR SuSE
+%else
+%define VENDOR %_vendor
+%endif
+
+#
+# Other definitions
+#
+
+%define debug_package %{nil}
+
+#
+# Build OpenVPN binary
+#
+
+%prep
+%setup -q
+
+%build
+%configure \
+ --disable-dependency-tracking \
+ --docdir="%{_docdir}/%{name}-%{version}" \
+ %{?with_password_save:--enable-password-save} \
+ %{!?without_lzo:--enable-lzo} \
+ %{?with_pkcs11:--enable-pkcs11} \
+ %{?without_pam:--disable-plugin-auth-pam}
+%__make
+
+#
+# Installation section
+#
+
+%install
+[ %{buildroot} != "/" ] && rm -rf %{buildroot}
+%__make install DESTDIR="%{buildroot}"
+
+# Install init script
+%if "%{VENDOR}" == "SuSE"
+%__install -c -d -m 755 "%{buildroot}/etc/init.d"
+%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
+%else
+%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
+%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
+%endif
+
+# Install /etc/openvpn
+%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
+
+# Install extra %doc stuff
+cp -r AUTHORS ChangeLog NEWS contrib/ sample/ \
+ "%{buildroot}/%{_docdir}/%{name}-%{version}"
+
+#
+# Clean section
+#
+
+%clean
+[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
+
+#
+# On Linux 2.4, make the device node
+#
+
+%post
+case "`uname -r`" in
+2.4*)
+ /bin/mkdir /dev/net >/dev/null 2>&1
+ /bin/mknod /dev/net/tun c 10 200 >/dev/null 2>&1
+ ;;
+esac
+
+#
+# Handle the init script
+#
+
+/sbin/chkconfig --add %{name}
+%if "%{VENDOR}" == "SuSE"
+/etc/init.d/openvpn restart
+%else
+/sbin/service %{name} condrestart
+%endif
+%preun
+if [ "$1" = 0 ]
+then
+ %if "%{VENDOR}" == "SuSE"
+ /etc/init.d/openvpn stop
+ %else
+ /sbin/service %{name} stop
+ %endif
+ /sbin/chkconfig --del %{name}
+fi
+
+#
+# Files section
+#
+# don't use %doc as old rpmbuild removes it[1].
+# [1] http://rpm.org/ticket/836
+
+%files
+%defattr(-,root,root)
+%{_mandir}
+%{_sbindir}/%{name}
+%{_libdir}/%{name}
+%{_docdir}/%{name}-%{version}
+%dir /etc/%{name}
+%if "%{VENDOR}" == "SuSE"
+/etc/init.d/%{name}
+%else
+/etc/rc.d/init.d/%{name}
+%endif
+
+%files devel
+%defattr(-,root,root)
+%{_includedir}/*
+
+%changelog
+* Thu Jul 30 2009 David Sommerseth <dazo@users.sourceforge.net>
+- Removed management/ directory from %doc
+
+* Thu Dec 14 2006 Alon Bar-Lev
+- Added with_pkcs11
+
+* Mon Aug 2 2005 James Yonan
+- Fixed build problem with --define 'without_pam 1'
+
+* Mon Apr 4 2005 James Yonan
+- Moved some files from /usr/share/openvpn to %doc for compatibility
+ with Dag Wieers' RPM repository
+
+* Sat Mar 12 2005 Tom Walsh
+- Added MandrakeSoft liblzo1 require
+
+* Fri Dec 10 2004 James Yonan
+- Added AutoReq: 0 for manual dependencies
+
+* Fri Dec 10 2004 James Yonan
+- Packaged the plugins
+
+* Sun Nov 7 2004 Umberto Nicoletti
+- SuSE support
+
+* Wed Aug 18 2004 Bishop Clark (LC957) <bishop@platypus.bc.ca>
+- restrict what we claim in /etc/ to avoid ownership conflicts
+
+* Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1.
+- Have the version number filled in by autoconf.
+
+* Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
+- Fixed %preun to only remove service on final uninstall
+
+* Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
+- Added condrestart to openvpn.spec & openvpn.init.
+
+* Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
+- Added mknod for Linux 2.4.
+
+* Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
+- Added init scripts
+- Added conf file support
+
+* Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
+- Added new directories for config examples and such
+
+* Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
+- Updated buildroot directive and cleanup command
+- added easy-rsa utilities
+
+* Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
+- Initial build.
diff --git a/ics-openvpn-stripped/main/openvpn/doc/Makefile.am b/ics-openvpn-stripped/main/openvpn/doc/Makefile.am
new file mode 100644
index 00000000..d33e1edd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/Makefile.am
@@ -0,0 +1,31 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+CLEANFILES = openvpn.8.html
+
+dist_doc_DATA = \
+ management-notes.txt
+
+dist_noinst_DATA = \
+ README.plugins
+
+if WIN32
+dist_noinst_DATA += openvpn.8
+nodist_html_DATA = openvpn.8.html
+openvpn.8.html: $(srcdir)/openvpn.8
+ $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html
+else
+dist_man_MANS = openvpn.8
+endif
+
diff --git a/ics-openvpn-stripped/main/openvpn/doc/README.plugins b/ics-openvpn-stripped/main/openvpn/doc/README.plugins
new file mode 100644
index 00000000..6e490c5a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/README.plugins
@@ -0,0 +1,47 @@
+OpenVPN Plugins
+---------------
+
+Starting with OpenVPN 2.0-beta17, compiled plugin modules are
+supported on any *nix OS which includes libdl or on Windows.
+One or more modules may be loaded into OpenVPN using
+the --plugin directive, and each plugin module is capable of
+intercepting any of the script callbacks which OpenVPN supports:
+
+(1) up
+(2) down
+(3) route-up
+(4) ipchange
+(5) tls-verify
+(6) auth-user-pass-verify
+(7) client-connect
+(8) client-disconnect
+(9) learn-address
+
+See the openvpn-plugin.h file in the top-level directory of the
+OpenVPN source distribution for more detailed information
+on the plugin interface.
+
+Included Plugins
+----------------
+
+auth-pam -- Authenticate using PAM and a split privilege
+ execution model which functions even if
+ root privileges or the execution environment
+ have been altered with --user/--group/--chroot.
+ Tested on Linux only.
+
+down-root -- Enable the running of down scripts with root privileges
+ even if --user/--group/--chroot have been used
+ to drop root privileges or change the execution
+ environment. Not applicable on Windows.
+
+examples -- A simple example that demonstrates a portable
+ plugin, i.e. one which can be built for *nix
+ or Windows from the same source.
+
+Building Plugins
+----------------
+
+cd to the top-level directory of a plugin, and use the
+"make" command to build it. The examples plugin is
+built using a build script, not a makefile.
diff --git a/ics-openvpn-stripped/main/openvpn/doc/android.txt b/ics-openvpn-stripped/main/openvpn/doc/android.txt
new file mode 100644
index 00000000..871e3997
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/android.txt
@@ -0,0 +1,76 @@
+This file documents the support in OpenVPN for Android 4.0 and up.
+
+This support is primarily used in the "OpenVPN for Android" app
+(http://code.google.com/p/ics-openvpn/). For building see the developer
+README: http://code.google.com/p/ics-openvpn/source/browse/README.txt.
+
+Android provides the VPNService API
+(http://developer.android.com/reference/android/net/VpnService.html)
+which allows establishing VPN connections without rooting the device.
+
+Since all the interfaces are are Android specific the calls to this
+interface are made from the UI instead of OpenVPN directly. The API
+needs the following parameters:
+
+- IP and netmask of tun interface
+- Networks that should be routed to the tun interface
+- DNS Servers and DNS Domain
+- MTU
+
+All IPs/Routes are in CIDR style. Non CIDR routes are not supported.
+Notable is the lack of support for setting routes to other interfaces
+usually used to avoid the server connection going over the tun
+interface. The Android VPNService API has the concept of protecting
+a socket from being routed over a interface. Calling protect (fd)
+will internally bind the socket to the interface used for the
+external connection (usually WiFi or mobile data).
+
+To use OpenVPN with the VPNService API OpenVPN must be build with
+the TARGET_ANDROID compile option. Also the UI must use a UNIX
+domain socket to connect to OpenVPN. When compiled as TARGET_ANDROID
+OpenVPN will use management callbacks instead of executing traditional
+ifconfig/route commands use the need-ok callback mechanism which
+will ask
+
+> NEED-OK command
+
+where command can be:
+
+IFCONFIG6 IPv6/netmask
+IFCONFIG local remoteOrNetmask MTU topology
+
+To tell the UI which IPs addresses OpenVPN expects on the interface.
+Topology is one of "net30","p2p","subnet" or "undef".
+
+ROUTE6 network/netmask
+ROUTE network netmask
+
+To tell the UI which routes should be set on the tun interface.
+
+DNSSERVER serverip
+DNSDOMAIN searchdomain
+
+To set the DNS server and search domain.
+
+The GUI will then respond with a "needok 'command' ok' or "needok
+'command' cancel', e.g. "needok 'IFCONFIG' ok".
+
+To protect a socket the OpenVPN will send a PROTECTFD to the UI.
+When sending the PROTECTFD command command to the UI it will send
+the fd of the socket as ancillary message over the UNIX socket.
+The UI will then call protect(fd) on the received socket protecting
+it from being routed over the VPN.
+
+When opening a tun device the OpenVPN process will first send all
+route, ifconfig and DNS related configuration to the UI and after
+that calls the OPENTUN command to receive a tun fd with the requested
+configuration. The UI will than use the collected information to
+call the VPNService's establish() method to receive a fd which in
+turn is send to the OpenVPN process as ancillary message to the
+"needok 'OPENTUN' ok' response.
+
+The OpenVPN for Android UI extensively uses other features that
+are not specific to Android but are rarely used on other platform.
+For example using SIGUSR1 and management-hold to restart, pause,
+continue the VPN on network changes or the external key management
+--management-external-key option and inline files.
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_compression.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_compression.h
new file mode 100644
index 00000000..bdc4a7ed
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_compression.h
@@ -0,0 +1,92 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Compression module documentation file.
+ */
+
+/**
+ * @defgroup compression Data Channel Compression module
+ *
+ * This module offers compression of data channel packets.
+ *
+ * @par State structures
+ * The Data Channel Compression module stores its internal state in a \c
+ * lzo_compress_workspace structure. This state includes flags which
+ * control the module's behavior and preallocated working memory. One
+ * such structure is present for each VPN tunnel, and is stored in the \c
+ * context.c2.lzo_compwork of the \c context associated with that VPN
+ * tunnel.
+ *
+ * @par Initialization and cleanup
+ * Every time a new \c lzo_compress_workspace is needed, it must be
+ * initialized using the \c lzo_compress_init() function. Similarly,
+ * every time a \c lzo_compress_workspace is no longer needed, it must be
+ * cleaned up using the \c lzo_compress_uninit() function. These
+ * functions take care of the allocation and freeing of internal working
+ * memory, but not of the \c lzo_compress_workspace structures themselves.
+ *
+ * @par
+ * Because of the one-to-one relationship between \c
+ * lzo_compress_workspace structures and VPN tunnels, the above-mentioned
+ * initialization and cleanup functions are called directly from the \c
+ * init_instance() and \c close_instance() functions, which control the
+ * initialization and cleanup of VPN tunnel instances and their associated
+ * \c context structures.
+ *
+ * @par Packet processing functions
+ * This module receives data channel packets from the \link data_control
+ * Data Channel Control module\endlink and processes them according to the
+ * settings of the packet's VPN tunnel. The \link data_control Data
+ * Channel Control module\endlink uses the following interface functions:
+ * - For packets which will be sent to a remote OpenVPN peer: \c
+ * lzo_compress()
+ * - For packets which have been received from a remote OpenVPN peer: \c
+ * lzo_decompress()
+ *
+ * @par Settings that control this module's activity
+ * Whether or not the Data Channel Compression module is active depends on
+ * the compile-time \c ENABLE_LZO preprocessor macro and the runtime flags
+ * stored in \c lzo_compress_workspace.flags of the associated VPN tunnel.
+ * The latter are initialized from \c options.lzo, which gets its value
+ * from the process's configuration sources, such as its configuration
+ * file or command line %options.
+ *
+ * @par Adaptive compression
+ * The compression module supports adaptive compression. If this feature
+ * is enabled, the compression routines monitor their own performance and
+ * turn compression on or off depending on whether it is leading to
+ * significantly reduced payload size.
+ *
+ * @par Compression algorithms
+ * This module uses the Lempel-Ziv-Oberhumer (LZO) compression algorithms.
+ * These offer lossless compression and are designed for high-performance
+ * decompression. This module uses the external \c lzo library's
+ * implementation of the algorithms.
+ *
+ * @par
+ * For more information on the LZO library, see:\n
+ * http://www.oberhumer.com/opensource/lzo/
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_processor.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_processor.h
new file mode 100644
index 00000000..072dc372
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_processor.h
@@ -0,0 +1,189 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Control Channel Processor module documentation file.
+ */
+
+/**
+ * @defgroup control_processor Control Channel Processor module
+ *
+ * This module controls the setup and maintenance of VPN tunnels and the
+ * associated security parameters.
+ *
+ * @par This module's role
+ * The Control Channel Processor module lies at the core of OpenVPN's
+ * activities. It handles the setup of new VPN tunnels, the negotiation
+ * of data channel security parameters, the managing of active VPN
+ * tunnels, and finally the cleanup of expired VPN tunnels.
+ *
+ * @par State structures
+ * A large amount of VPN tunnel state information must be stored within an
+ * OpenVPN process. A wide variety of container structures are used by
+ * this module for that purpose. Several of these structures are listed
+ * below, and the function of the first three VPN tunnel state containers
+ * is described in more detail later.
+ * - VPN tunnel state containers:
+ * - \c tls_multi, security parameter state for a single VPN tunnel.
+ * Contains three instances of the \c tls_session structure.
+ * - \c tls_session, security parameter state of a single session
+ * within a VPN tunnel. Contains two instances of the \c key_state
+ * structure.
+ * - \c key_state, security parameter state of one TLS and data
+ * channel %key set.
+ * - Data channel security parameter containers:
+ * - \c key_ctx_bi, container for two sets of OpenSSL cipher and/or
+ * HMAC context (both directions). Contains two instances of the \c
+ * key_ctx structure.
+ * - \c key_ctx, container for one set of OpenSSL cipher and/or HMAC
+ * context (one directions.
+ * - Key material containers:
+ * - \c key2, container for two sets of cipher and/or HMAC %key
+ * material (both directions). Contains two instances of the \c key
+ * structure.
+ * - \c key, container for one set of cipher and/or HMAC %key material
+ * (one direction).
+ * - \c key_direction_state, ordering of %key material within the \c
+ * key2.key array.
+ * - Key method 2 random material containers:
+ * - \c key_source2, container for both halves of random material used
+ * for %key method 2. Contains two instances of the \c key_source
+ * structure.
+ * - \c key_source, container for one half of random material used for
+ * %key method 2.
+ *
+ * @par The life of a \c tls_multi object
+ * A \c tls_multi structure contains all the security parameter state
+ * information related to the control and data channels of one VPN tunnel.
+ * Its life cycle can be summarized as follows:
+ * -# Initialization: \c tls_multi_init() and \c
+ * tls_multi_init_finalize(), which are called (indirectly) from \c
+ * init_instance() when initializing a new \c context structure.
+ * - Initializes a \c tls_multi structure.
+ * - Allocates the three \c tls_session objects contained by the \c
+ * tls_multi structure, and initializes as appropriate.
+ * -# Management: \c tls_multi_process() and \c tls_pre_decrypt()
+ * - If a new session is initiated by the remote peer, then \c
+ * tls_pre_decrypt() starts the new session negotiation in the
+ * un-trusted \c tls_session.
+ * - If the, as yet, un-trusted \c tls_session authenticates
+ * successfully, then \c tls_multi_process() moves it so as to be
+ * the active \c tls_session.
+ * - If an error occurs during processing of a \c key_state object,
+ * then \c tls_multi_process() cleans up and initializes the
+ * associated \c tls_session object. If the error occurred in the
+ * active \c key_state of the active \c tls_session and the
+ * lame-duck \c key_state of that \c tls_session has not yet
+ * expired, it is preserved as fallback.
+ * -# Cleanup: \c tls_multi_free(), which is called (indirectly) from \c
+ * close_instance() when cleaning up a \c context structure.
+ * - Cleans up a \c tls_multi structure.
+ * - Cleans up the three \c tls_session objects contained by the \c
+ * tls_multi structure.
+ *
+ * @par The life of a \c tls_session object
+ * A \c tls_session structure contains the state information related to an
+ * active and a lame-duck \c key_state. Its life cycle can be summarized
+ * as follows:
+ * -# Initialization: \c tls_session_init()
+ * - Initializes a \c tls_session structure.
+ * - Initializes the primary \c key_state by calling \c
+ * key_state_init().
+ * -# Renegotiation: \c key_state_soft_reset()
+ * - Cleans up the old lame-duck \c key_state by calling \c
+ * key_state_free().
+ * - Moves the old primary \c key_state to be the new lame-duck \c
+ * key_state.
+ * - Initializes a new primary \c key_state by calling \c
+ * key_state_init().
+ * -# Cleanup: \c tls_session_free()
+ * - Cleans up a \c tls_session structure.
+ * - Cleans up all \c key_state objects associated with the session by
+ * calling \c key_state_free() for each.
+ *
+ * @par The life of a \c key_state object
+ * A \c key_state structure represents one control and data channel %key
+ * set. It contains an OpenSSL TLS object that encapsulates the control
+ * channel, and the data channel security parameters needed by the \link
+ * data_crypto Data Channel Crypto module\endlink to perform cryptographic
+ * operations on data channel packets. Its life cycle can be summarized
+ * as follows:
+ * -# Initialization: \c key_state_init()
+ * - Initializes a \c key_state structure.
+ * - Creates a new OpenSSL TLS object to encapsulate this new control
+ * channel session.
+ * - Sets \c key_state.state to \c S_INITIAL.
+ * - Allocates several internal buffers.
+ * - Initializes new reliability layer structures for this key set.
+ * -# Negotiation: \c tls_process()
+ * - The OpenSSL TLS object negotiates a TLS session between itself
+ * and the remote peer's TLS object.
+ * - Key material is generated and exchanged through the TLS session
+ * between OpenVPN peers.
+ * - Both peers initialize their data channel cipher and HMAC key
+ * contexts.
+ * - On successful negotiation, the \c key_state.state will progress
+ * from \c S_INITIAL to \c S_ACTIVE and \c S_NORMAL.
+ * -# Active tunneling: \link data_crypto Data Channel Crypto
+ * module\endlink
+ * - Data channel packet to be sent to a remote OpenVPN peer:
+ * - \c tls_pre_encrypt() loads the security parameters from the \c
+ * key_state into a \c crypto_options structure.
+ * - \c openvpn_encrypt() uses the \c crypto_options to an encrypt
+ * and HMAC sign the data channel packet.
+ * - Data channel packet received from a remote OpenVPN peer:
+ * - \c tls_pre_decrypt() loads the security parameters from the \c
+ * key_state into a \c crypto_options structure.
+ * - \c openvpn_encrypt() uses the \c crypto_options to
+ * authenticate and decrypt the data channel packet.
+ * -# Cleanup: \c key_state_free()
+ * - Cleans up a \c key_state structure together with its OpenSSL TLS
+ * object, key material, internal buffers, and reliability layer
+ * structures.
+ *
+ * @par Control functions
+ * The following two functions drive the Control Channel Processor's
+ * activities.
+ * - \c tls_multi_process(), iterates through the \c tls_session objects
+ * within a given \c tls_multi of a VPN tunnel, and calls \c
+ * tls_process() for each \c tls_session which is being set up, is
+ * already active, or is busy expiring.
+ * - \c tls_process(), performs the Control Channel Processor module's
+ * core handling of received control channel messages, and generates
+ * appropriate messages to be sent.
+ *
+ * @par Functions which control data channel key generation
+ * - Key method 1 key exchange functions:
+ * - \c key_method_1_write(), generates and processes key material to
+ * be sent to the remote OpenVPN peer.
+ * - \c key_method_1_read(), processes key material received from the
+ * remote OpenVPN peer.
+ * - Key method 2 key exchange functions:
+ * - \c key_method_2_write(), generates and processes key material to
+ * be sent to the remote OpenVPN peer.
+ * - \c key_method_2_read(), processes key material received from the
+ * remote OpenVPN peer.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_tls.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_tls.h
new file mode 100644
index 00000000..aba55f77
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_control_tls.h
@@ -0,0 +1,105 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Control Channel TLS module documentation file.
+ */
+
+/**
+ * @defgroup control_tls Control Channel TLS module
+ *
+ * This module provides secure encapsulation of control channel messages
+ * exchanged between OpenVPN peers.
+ *
+ * The Control Channel TLS module uses the Transport Layer Security (TLS)
+ * protocol to provide an encrypted communication channel between the
+ * local OpenVPN process and a remote peer. This protocol simultaneously
+ * offers certificate-based authentication of the communicating parties.
+ *
+ * @par This module's roles
+ * The Control Channel TLS module is essential for the security of any
+ * OpenVPN-based system. On the one hand, it performs the security
+ * operations necessary to protect control channel messages exchanged
+ * between OpenVPN peers. On the other hand, before the control and data
+ * channels are even setup, it controls the exchange of certificates and
+ * verification of the remote's identity during negotiation of VPN
+ * tunnels.
+ *
+ * @par
+ * The former role is described below. The latter is described in the
+ * documentation for the \c verify_callback() function.
+ *
+ * @par
+ * In other words, this module takes care of the confidentiality and
+ * integrity of data channel communications, and the authentication of
+ * both the communicating parties and the control channel messages
+ * exchanged.
+ *
+ * @par Initialization and cleanup
+ * Because of the one-to-one relationship between control channel TLS
+ * state and \c key_state structures, the initialization and cleanup of an
+ * instance of the Control Channel TLS module's state happens within the
+ * \c key_state_init() and \c key_state_free() functions. In other words,
+ * each \c key_state object contains exactly one OpenSSL SSL-BIO object,
+ * which is initialized and cleaned up together with the rest of the \c
+ * key_state object.
+ *
+ * @par Packet processing functions
+ * This object behaves somewhat like a black box with a ciphertext and a
+ * plaintext I/O port. Its interaction with OpenVPN's control channel
+ * during operation takes place within the \c tls_process() function of
+ * the \link control_processor Control Channel Processor\endlink. The
+ * following functions are available for processing packets:
+ * - If ciphertext received from the remote peer is available in the \link
+ * reliable Reliability Layer\endlink:
+ * - Insert it into the ciphertext-side of the SSL-BIO.
+ * - Use function: \c key_state_write_ciphertext()
+ * - If ciphertext can be extracted from the ciphertext-side of the
+ * SSL-BIO:
+ * - Pass it to the \link reliable Reliability Layer\endlink for sending
+ * to the remote peer.
+ * - Use function: \c key_state_read_ciphertext()
+ * - If plaintext can be extracted from the plaintext-side of the SSL-BIO:
+ * - Pass it on to the \link control_processor Control Channel
+ * Processor\endlink for local processing.
+ * - Use function: \c key_state_read_plaintext()
+ * - If plaintext from the \link control_processor Control Channel
+ * Processor\endlink is available to be sent to the remote peer:
+ * - Insert it into the plaintext-side of the SSL-BIO.
+ * - Use function: \c key_state_write_plaintext() or \c
+ * key_state_write_plaintext_const()
+ *
+ * @par Transport Layer Security protocol implementation
+ * This module uses the OpenSSL library's implementation of the TLS
+ * protocol in the form of an OpenSSL SSL-BIO object.
+ *
+ * @par
+ * For more information on the OpenSSL library's BIO objects, please see:
+ * - OpenSSL's generic BIO objects:
+ * http://www.openssl.org/docs/crypto/bio.html
+ * - OpenSSL's SSL-BIO object:
+ * http://www.openssl.org/docs/crypto/BIO_f_ssl.html
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_control.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_control.h
new file mode 100644
index 00000000..d0f65ba3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_control.h
@@ -0,0 +1,103 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Data Channel Control module documentation file.
+ */
+
+/**
+ * @defgroup data_control Data Channel Control module
+ *
+ * This module controls the processing of packets as they pass through the
+ * data channel.
+ *
+ * The Data Channel Control module controls the processing of packets as
+ * they pass through the data channel. The processing includes packet
+ * compression, fragmentation, and the performing of security operations
+ * on the packets. This module does not do the processing itself, but
+ * passes the packet to other data channel modules to perform the
+ * appropriate actions.
+ *
+ * Packets can travel in two directions through the data channel. They
+ * can be going to a remote destination which is reachable through a VPN
+ * tunnel, in which case this module prepares them to be sent out through
+ * a VPN tunnel. On the other hand, they can have been received through a
+ * VPN tunnel from a remote OpenVPN peer, in which case this module
+ * retrieves the packet in its original form as it was before entering the
+ * VPN tunnel on the remote OpenVPN peer. How this module processes
+ * packets traveling in the two directions is discussed in more detail
+ * below.
+ *
+ * @par Packets to be sent to a remote OpenVPN peer
+ * This module's main function for processing packets traveling in this
+ * direction is \c encrypt_sign(), which performs the following processing
+ * steps:
+ * - Call the \link compression Data Channel Compression module\endlink to
+ * perform packet compression if necessary.
+ * - Call the \link fragmentation Data Channel Fragmentation
+ * module\endlink to perform packet fragmentation if necessary.
+ * - Call the \link data_crypto Data Channel Crypto module\endlink to
+ * perform the required security operations.
+ *
+ * @par
+ * See the \c encrypt_sign() documentation for details of these
+ * interactions.
+ *
+ * @par
+ * After the above processing is complete, the packet is ready to be sent
+ * to a remote OpenVPN peer as a VPN tunnel packet. The actual sending of
+ * the packet is handled by the \link external_multiplexer External
+ * Multiplexer\endlink.
+ *
+ * @par Packets received from a remote OpenVPN peer
+ * The function that controls how packets traveling in this direction are
+ * processed is \c process_incoming_link(). That function, however, also
+ * performs some of the tasks required for the \link external_multiplexer
+ * External Multiplexer\endlink and is therefore listed as part of that
+ * module, instead of here.
+ *
+ * @par
+ * After the \c process_incoming_link() function has determined that a
+ * received packet is a data channel packet, it performs the following
+ * processing steps:
+ * - Call the \link data_crypto Data Channel Crypto module\endlink to
+ * perform the required security operations.
+ * - Call the \link fragmentation Data Channel Fragmentation
+ * module\endlink to perform packet reassembly if necessary.
+ * - Call the \link compression Data Channel Compression module\endlink to
+ * perform packet decompression if necessary.
+ *
+ * @par
+ * See the \c process_incoming_link() documentation for details of these
+ * interactions.
+ *
+ * @par
+ * After the above processing is complete, the packet is in its original
+ * form again as it was received by the remote OpenVPN peer. It can now
+ * be routed further to its final destination. If that destination is a
+ * locally reachable host, then the \link internal_multiplexer Internal
+ * Multiplexer\endlink will send it there.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_crypto.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_crypto.h
new file mode 100644
index 00000000..ee72b8cd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_data_crypto.h
@@ -0,0 +1,75 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Data Channel Crypto module documentation file.
+ */
+
+/**
+ * @addtogroup data_crypto Data Channel Crypto module
+ *
+ * The Data Channel Crypto Module performs cryptographic operations on
+ * data channel packets.
+ *
+ * @par Security parameters
+ * This module is merely the user of a VPN tunnel's security parameters.
+ * It does not perform the negotiation and setup of the security
+ * parameters, nor the %key generation involved. These actions are done
+ * by the \link control_processor Control Channel Processor\endlink. This
+ * module receives the appropriate security parameters from that module in
+ * the form of a \c crypto_options structure when they are necessary for
+ * processing a packet.
+ *
+ * @par Packet processing functions
+ * This module receives data channel packets from the \link data_control
+ * Data Channel Control module\endlink and processes them according to the
+ * security parameters of the packet's VPN tunnel. The \link data_control
+ * Data Channel Control module\endlink uses the following interface
+ * functions:
+ * - For packets which will be sent to a remote OpenVPN peer:
+ * - \c tls_pre_encrypt()
+ * - \c openvpn_encrypt()
+ * - \c tls_post_encrypt()
+ * - For packets which have been received from a remote OpenVPN peer:
+ * - \c tls_pre_decrypt() (documented as part of the \link
+ * external_multiplexer External Multiplexer\endlink)
+ * - \c openvpn_decrypt()
+ *
+ * @par Settings that control this module's activity
+ * Whether or not the Data Channel Crypto module is active depends on the
+ * compile-time \c ENABLE_CRYPTO and \c ENABLE_SSL preprocessor macros. How it
+ * processes packets received from the \link data_control Data Channel
+ * Control module\endlink at runtime depends on the associated \c
+ * crypto_options structure. To perform cryptographic operations, the \c
+ * crypto_options.key_ctx_bi must contain the correct cipher and HMAC
+ * security parameters for the direction the packet is traveling in.
+ *
+ * @par Crypto algorithms
+ * This module uses the crypto algorithm implementations of the external
+ * OpenSSL library. More precisely, it uses the OpenSSL library's \c
+ * EVP_Cipher* and \c HMAC_* set of functions to perform cryptographic
+ * operations on data channel packets.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_eventloop.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_eventloop.h
new file mode 100644
index 00000000..a860db68
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_eventloop.h
@@ -0,0 +1,67 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Main Event Loop module documentation file.
+ */
+
+/**
+ * @defgroup eventloop Main Event Loop module
+ *
+ * This main event loop module drives the packet processing of OpenVPN.
+ *
+ * OpenVPN is an event driven system. Its activities are driven by a main
+ * event loop, which repeatedly waits for one of several predefined events
+ * to occur, and then calls the appropriate module to handle the event.
+ * The major types of network events that OpenVPN processes are:
+ * - A packet can be read from the external network interface.
+ * - The main event loop activates the \link external_multiplexer
+ * External Multiplexer\endlink to read and process the packet.
+ * - A packet can be read from the virtual tun/tap network interface.
+ * - The main event loop activates the \link internal_multiplexer
+ * Internal Multiplexer\endlink to read and process the packet.
+ * - If a packet is ready to be sent out as a VPN tunnel packet: the
+ * external network interface can be written to.
+ * - The main event loop activates the \link external_multiplexer
+ * External Multiplexer\endlink to send the packet.
+ * - If a packet is ready to be sent to a locally reachable destination:
+ * the virtual tun/tap network interface can be written to.
+ * - The main event loop activates the \link internal_multiplexer
+ * Internal Multiplexer\endlink to send the packet.
+ *
+ * Beside these external events, OpenVPN also processes other types of
+ * internal events. These include scheduled events, such as resending of
+ * non-acknowledged control channel messages.
+ *
+ * @par Main event loop implementations
+ *
+ * Depending on the mode in which OpenVPN is running, a different main
+ * event loop function is called to drive the event processing. The
+ * following implementations are available:
+ * - Client mode using UDP or TCP: \c tunnel_point_to_point()
+ * - Server mode using UDP: \c tunnel_server_udp_single_threaded()
+ * - Server mode using TCP: \c tunnel_server_tcp()
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_external_multiplexer.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_external_multiplexer.h
new file mode 100644
index 00000000..76532557
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_external_multiplexer.h
@@ -0,0 +1,46 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * External Multiplexer module documentation file.
+ */
+
+/**
+ * @addtogroup external_multiplexer External Multiplexer module
+ *
+ * The External Multiplexer is the link between the external network
+ * interface and the other OpenVPN modules. It reads packets from the
+ * external network interface, determines which remote OpenVPN peer and
+ * VPN tunnel they are associated with, and whether they are data channel
+ * or control channel packets. It then passes the packets on to the
+ * appropriate processing module.
+ *
+ * This module also handles packets traveling in the reverse direction,
+ * which have been generated by the local control channel or which have
+ * already been processed by the \link data_control Data Channel Control
+ * module\endlink and are destined for a remote host reachable through a
+ * VPN tunnel.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_fragmentation.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_fragmentation.h
new file mode 100644
index 00000000..ef34cdb2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_fragmentation.h
@@ -0,0 +1,96 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Data Channel Fragmentation module documentation file.
+ */
+
+/**
+ * @defgroup fragmentation Data Channel Fragmentation module
+ *
+ * The Data Channel Fragmentation module offers fragmentation of data
+ * channel packets.
+ *
+ * @par State structures
+ * The Data Channel Fragmentation module stores its internal state in a \c
+ * fragment_master structure. One such structure is present for each VPN
+ * tunnel, and is stored in \c context.c2.fragment of the \c context
+ * associated with that VPN tunnel.
+ *
+ * @par
+ * The \c fragment_master structure contains one \c fragment_list
+ * structure \c fragment_master.incoming. This is a list of \c fragment
+ * structures, each of which can store the parts of one fragmented packet
+ * while it is being reassembled. The \c fragment_master structure also
+ * contains one \c buffer called \c fragment_master.outgoing, in which a
+ * data channel large packet to be sent to a remote OpenVPN peer can be
+ * broken up into parts to be sent one by one.
+ *
+ * @par Initialization and cleanup
+ * Every time a new \c fragment_master is needed, it must be allocated and
+ * initialized by the \c fragment_init() function. Similarly, every time
+ * a \c fragment_master is no longer needed, it must be cleaned up using
+ * the \c fragment_free() function. These functions take care of the
+ * allocation and freeing of the \c fragment_master structure itself and
+ * all internal memory required for the use of that structure. Note that
+ * this behavior is different from that displayed by the \link compression
+ * Data Channel Compression module\endlink.
+ *
+ * @par
+ * Because of the one-to-one relationship between \c fragment_master
+ * structures and VPN tunnels, the above-mentioned initialization and
+ * cleanup functions are called directly from the \c init_instance() and
+ * \c close_instance() functions, which control the initialization and
+ * cleanup of VPN tunnel instances and their associated \c context
+ * structures.
+ *
+ * @par Packet processing functions
+ * This module receives data channel packets from the \link data_control
+ * Data Channel Control module\endlink and processes them according to the
+ * settings of the packet's VPN tunnel. The \link data_control Data
+ * Channel Control module\endlink uses the following interface functions:
+ * - For packets which will be sent to a remote OpenVPN peer: \c
+ * fragment_outgoing() \n This function inspects data channel packets as
+ * they are being made ready to be sent as VPN tunnel packets to a
+ * remote OpenVPN peer. If a packet's size is larger than its
+ * destination VPN tunnel's maximum transmission unit (MTU), then this
+ * module breaks that packet up into smaller parts, each of which is
+ * smaller than or equal to the VPN tunnel's MTU. See \c
+ * fragment_outgoing() for details.
+ * - For packets which have been received from a remote OpenVPN peer: \c
+ * fragment_incoming() \n This function inspects data channel packets
+ * that have been received from a remote OpenVPN peer through a VPN
+ * tunnel. It reads the fragmentation header of the packet, and
+ * depending on its value performs the appropriate action. See \c
+ * fragment_incoming() for details.
+ *
+ * @par Settings that control this module's activity
+ * Whether the Data Channel Fragmentation module is active or not depends
+ * on the compile-time \c ENABLE_FRAGMENT preprocessor macro and the
+ * runtime flag \c options.fragment, which gets its value from the
+ * process's configuration sources, such as the configuration file and
+ * commandline %options.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_internal_multiplexer.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_internal_multiplexer.h
new file mode 100644
index 00000000..5142dd0d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_internal_multiplexer.h
@@ -0,0 +1,44 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Internal Multiplexer module documentation file.
+ */
+
+/**
+ * @addtogroup internal_multiplexer Internal Multiplexer module
+ *
+ * The Internal Multiplexer is the link between the virtual tun/tap
+ * network interface and the \link data_control Data Channel Control
+ * module\endlink. It reads packets from the virtual network interface,
+ * determines for which remote OpenVPN peer they are destined, and then
+ * passes the packets on to the Data Channel Control module together with
+ * information about their destination VPN tunnel instance.
+ *
+ * This module also handles packets traveling in the reverse direction,
+ * which have already been processed by the Data Channel Control module
+ * and are destined for a locally reachable host.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_key_generation.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_key_generation.h
new file mode 100644
index 00000000..903a4652
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_key_generation.h
@@ -0,0 +1,153 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Key generation documentation file.
+ */
+
+/**
+ * @page key_generation Data channel %key generation
+ *
+ * This section describes how OpenVPN peers generate and exchange %key
+ * material necessary for the security operations performed on data
+ * channel packets.
+ *
+ * The %key generation and exchange process between OpenVPN client and
+ * server occurs every time data channel security parameters are
+ * negotiated, for example during the initial setup of a VPN tunnel or
+ * when the active security parameters expire. In source code terms, this
+ * is when a new key_state structure is initialized.
+ *
+ * @section key_generation_method Key methods
+ *
+ * OpenVPN supports two different ways of generating and exchanging %key
+ * material between client and server. These are known as %key method 1
+ * and %key method 2. %Key method 2 is the recommended method. Both are
+ * explained below.
+ *
+ * @subsection key_generation_method_1 Key method 1
+ *
+ * -# Each host generates its own random material.
+ * -# Each host uses its locally generated random material as %key data
+ * for encrypting and signing packets sent to the remote peer.
+ * -# Each host then sends its random material to the remote peer, so that
+ * the remote peer can use that %key data for authenticating and
+ * decrypting received packets.
+ *
+ * @subsection key_generation_method_2 Key method 2
+ *
+ * -# The client generates random material in the following amounts:
+ * - Pre-master secret: 48 bytes
+ * - Client's PRF seed for master secret: 32 bytes
+ * - Client's PRF seed for %key expansion: 32 bytes
+ * -# The client sends its share of random material to the server.
+ * -# The server generates random material in the following amounts:
+ * - Server's PRF seed for master secret: 32 bytes
+ * - Server's PRF seed for %key expansion: 32 bytes
+ * -# The server computes the %key expansion using its own and the
+ * client's random material.
+ * -# The server sends its share of random material to the client.
+ * -# The client computes the %key expansion using its own and the
+ * server's random material.
+ *
+ * %Key method 2 %key expansion is performed by the \c
+ * generate_key_expansion() function. Please refer to its source code for
+ * details of the %key expansion process.
+ *
+ * @subsection key_generation_random Source of random material
+ *
+ * OpenVPN uses the either the OpenSSL library or the PolarSSL library as its
+ * source of random material.
+ *
+ * In OpenSSL, the \c RAND_bytes() function is called
+ * to supply cryptographically strong pseudo-random data. The following links
+ * contain more information on this subject:
+ * - For OpenSSL's \c RAND_bytes() function:
+ * http://www.openssl.org/docs/crypto/RAND_bytes.html
+ * - For OpenSSL's pseudo-random number generating system:
+ * http://www.openssl.org/docs/crypto/rand.html
+ * - For OpenSSL's support for external crypto modules:
+ * http://www.openssl.org/docs/crypto/engine.html
+ *
+ * In PolarSSL, the Havege random number generator is used. For details, see
+ * the PolarSSL documentation.
+ *
+ * @section key_generation_exchange Key exchange:
+ *
+ * The %key exchange process is initiated by the OpenVPN process running
+ * in client mode. After the initial three-way handshake has successfully
+ * completed, the client sends its share of random material to the server,
+ * after which the server responds with its part. This process is
+ * depicted below:
+ *
+@verbatim
+ Client Client Server Server
+ State Action Action State
+---------- -------------------- -------------------- ----------
+
+ ... waiting until three-way handshake complete ...
+S_START S_START
+ key_method_?_write()
+ send to server --> --> --> --> receive from client
+S_SENT_KEY key_method_?_read()
+ S_GOT_KEY
+ key_method_?_write()
+ receive from server <-- <-- <-- <-- send to client
+ key_method_?_read() S_SENT_KEY
+S_GOT_KEY
+ ... waiting until control channel fully synchronized ...
+S_ACTIVE S_ACTIVE
+@endverbatim
+ *
+ * For more information about the client and server state values, see the
+ * \link control_processor Control Channel Processor module\endlink.
+ *
+ * Depending on which %key method is used, the \c ? in the function names
+ * of the diagram above is a \c 1 or a \c 2. For example, if %key method
+ * 2 is used, that %key exchange would be started by the client calling \c
+ * key_method_2_write(). These functions are called from the \link
+ * control_processor Control Channel Processor module's\endlink \c
+ * tls_process() function and control the %key generation and exchange
+ * process as follows:
+ * - %Key method 1:
+ * - \c key_method_1_write(): generate random material locally, and load
+ * as "sending" keys.
+ * - \c key_method_1_read(): read random material received from remote
+ * peer, and load as "receiving" keys.
+ * - %Key method 2:
+ * - \c key_method_2_write(): generate random material locally, and if
+ * in server mode generate %key expansion.
+ * - \c key_method_2_read(): read random material received from remote
+ * peer, and if in client mode generate %key expansion.
+ *
+ * @subsection key_generation_encapsulation Transmission of key material
+ *
+ * The OpenVPN client and server communicate with each other through their
+ * control channel. This means that all of the data transmitted over the
+ * network, such as random material for %key generation, is encapsulated
+ * in a TLS layer. For more details, see the \link control_tls Control
+ * Channel TLS module\endlink documentation.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_mainpage.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_mainpage.h
new file mode 100644
index 00000000..821b2e87
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_mainpage.h
@@ -0,0 +1,162 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Main page documentation file.
+ */
+
+/**
+ * @mainpage OpenVPN v2.1 source code documentation
+ *
+ * This documentation describes the internal structure of OpenVPN. It was
+ * automatically generated from specially formatted comment blocks in
+ * OpenVPN's source code using Doxygen. (See
+ * http://www.stack.nl/~dimitri/doxygen/ for more information on Doxygen)
+ *
+ * The \ref mainpage_modules "Modules section" below gives an introduction
+ * into the high-level module concepts used throughout this documentation.
+ * The \ref mainpage_relatedpages "Related Pages section" below describes
+ * various special subjects related to OpenVPN's implementation which are
+ * discussed in the related pages section.
+ *
+ * @section mainpage_modules Modules
+ *
+ * For the purpose of describing the internal structure of OpenVPN, this
+ * documentation and the underlying source code has been broken up into a
+ * number of conceptually well-defined parts, known as modules. Each
+ * module plays a specific role within the OpenVPN process, and in most
+ * cases each module has a clear interfacing strategy for interacting with
+ * other modules.
+ *
+ * The following modules have been defined:
+ * - Driver module:
+ * - The \link eventloop Main Event Loop\endlink: this module drives the
+ * event handling of OpenVPN. It implements various types of
+ * select-loop which wait until an event happens, and then delegate
+ * the handling of that event to the appropriate module.
+ * - Network interface modules:
+ * - The \link external_multiplexer External Multiplexer\endlink: this
+ * module sends and receives packets to and from remote OpenVPN peers
+ * over the external network interface. It also takes care of
+ * demultiplexing received packets to their appropriate VPN tunnel and
+ * splitting control channel and data channel packets.
+ * - The \link internal_multiplexer Internal Multiplexer\endlink: this
+ * module sends and receives packets to and from locally reachable
+ * posts over the virtual tun/tap network interface. It also takes
+ * care of determining through which VPN tunnel a received packet must
+ * be sent to reach its destination.
+ * - Control channel modules:
+ * - The \link reliable Reliability Layer\endlink: this module offers a
+ * %reliable and sequential transport layer for control channel
+ * messages.
+ * - The \link control_tls Control Channel TLS module\endlink: this
+ * module offers a secure encapsulation of control channel messages
+ * using the TLS protocol.
+ * - The \link control_processor Control Channel Processor\endlink: his
+ * module manages the setup, maintenance, and shut down of VPN
+ * tunnels.
+ * - Data channel modules:
+ * - The \link data_control Data Channel Control module\endlink: this
+ * module controls the processing of data channel packets and,
+ * depending on the settings of the packet's VPN tunnel, passes the
+ * packet to the three modules below for handling.
+ * - The \link data_crypto Data Channel Crypto module\endlink: this
+ * module performs security operations on data channel packets.
+ * - The \link fragmentation Data Channel Fragmentation module\endlink:
+ * this module offers fragmentation of data channel packets larger
+ * than the VPN tunnel's MTU.
+ * - The \link compression Data Channel Compression module\endlink: this
+ * module offers compression of data channel packets.
+ *
+ * @subsection mainpage_modules_example Example event: receiving a packet
+ *
+ * OpenVPN handles many types of events during operation. These include
+ * external events, such as network traffic being received, and internal
+ * events, such as a %key session timing out causing renegotiation. An
+ * example event, receiving a packet over the network, is described here
+ * together with which modules play what roles:
+ * -# The \link eventloop Main Event Loop\endlink detects that a packet
+ * can be read from the external or the virtual tun/tap network
+ * interface.
+ * -# The \link eventloop Main Event Loop\endlink calls the \link
+ * external_multiplexer External Multiplexer\endlink or \link
+ * internal_multiplexer Internal Multiplexer\endlink to read and
+ * process the packet.
+ * -# The multiplexer module determines the type of packet and its
+ * destination, and passes the packet on to the appropriate handling
+ * module:
+ * - A control channel packet received by the \link
+ * external_multiplexer External Multiplexer\endlink is passed on
+ * through the \link reliable Reliability Layer\endlink and the \link
+ * control_tls Control Channel TLS module\endlink to the \link
+ * control_processor Control Channel Processor\endlink.
+ * - A data channel packet received by either multiplexer module is
+ * passed on to the \link data_control Data Channel Control
+ * module\endlink.
+ * -# The packet is processed by the appropriate control channel or data
+ * channel modules.
+ * -# If, after processing the packet, a resulting packet is generated
+ * that needs to be sent to a local or remote destination, it is given
+ * to the \link external_multiplexer External Multiplexer\endlink or
+ * \link internal_multiplexer Internal Multiplexer\endlink for sending.
+ * -# If a packet is waiting to be sent by either multiplexer module and
+ * the \link eventloop Main Event Loop\endlink detects that data can be
+ * written to the associated network interface, it calls the
+ * multiplexer module to send the packet.
+ *
+ * @section mainpage_relatedpages Related pages
+ *
+ * This documentation includes a number of descriptions of various aspects
+ * of OpenVPN and its implementation. These are not directly related to
+ * one module, function, or data structure, and are therefore listed
+ * separately under "Related Pages".
+ *
+ * @subsection mainpage_relatedpages_key_generation Data channel key generation
+ *
+ * The @ref key_generation "Data channel key generation" related page
+ * describes how, during VPN tunnel setup and renegotiation, OpenVPN peers
+ * generate and exchange the %key material required for the symmetric
+ * encryption/decryption and HMAC signing/verifying security operations
+ * performed on data channel packets.
+ *
+ * @subsection mainpage_relatedpages_tunnel_state VPN tunnel state
+ *
+ * The @ref tunnel_state "Structure of VPN tunnel state storage" related
+ * page describes how an OpenVPN process manages the state information
+ * associated with its active VPN tunnels.
+ *
+ * @subsection mainpage_relatedpages_network_protocol Network protocol
+ *
+ * The @ref network_protocol "Network protocol" related page describes the
+ * format and content of VPN tunnel packets exchanged between OpenVPN
+ * peers.
+ *
+ * @subsection mainpage_relatedpages_memory_management Memory management
+ *
+ * The @ref memory_management "Memory management strategies" related page
+ * gives a brief introduction into OpenVPN's memory %buffer library and
+ * garbage collection facilities.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_memory_management.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_memory_management.h
new file mode 100644
index 00000000..f948783e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_memory_management.h
@@ -0,0 +1,99 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Memory management strategies documentation file.
+ */
+
+/**
+ * @page memory_management OpenVPN's memory management strategies
+ *
+ * This section describes several implementation details relating to
+ * OpenVPN's memory management strategies.
+ *
+ * During operation, the OpenVPN process performs all kinds of operations
+ * on blocks of data. Receiving packets, encrypting content, prepending
+ * headers, etc. To make the programmer's job easier and to decrease the
+ * likelihood of memory-related bugs, OpenVPN uses its own memory %buffer
+ * library and garbage collection facilities. These are described in
+ * brief here.
+ *
+ * @section memory_management_buffer The buffer structure
+ *
+ * The \c buffer structure is a wrapper around a block of dynamically
+ * allocated memory which keeps track of the block's capacity \c
+ * buffer.capacity and location in memory \c buffer.data. This structure
+ * supports efficient prepending and appending within the allocated memory
+ * through the use of offset \c buffer.offset and length \c buffer.len
+ * fields. See the \c buffer documentation for more details on the
+ * structure itself.
+ *
+ * OpenVPN's %buffer library, implemented in the \c buffer.h and \c
+ * buffer.c files, contains many utility functions for working with \c
+ * buffer structures. These functions facilitate common operations, such
+ * as allocating, freeing, reading and writing to \c buffer structures,
+ * and even offer several more advanced operations, such as string
+ * matching and creating sub-buffers.
+ *
+ * Not only do these utility functions make working with \c buffer
+ * structures easy, they also perform extensive error checking. Each
+ * function, where necessary, checks whether enough space is available
+ * before performing its actions. This minimizes the chance of bugs
+ * leading to %buffer overflows and other vulnerabilities.
+ *
+ * @section memory_management_frame The frame structure
+ *
+ * The \c frame structure keeps track of the maximum allowed packet
+ * geometries of a network connection.
+ *
+ * It is used, for example, to determine the size of \c buffer structures
+ * in which to store data channel packets. This is done by having each
+ * data channel processing module register the maximum amount of extra
+ * space it will need for header prepending and content expansion in the
+ * \c frame structure. Once these parameters are known, \c buffer
+ * structures can be allocated, based on the \c frame parameters, so that
+ * they are large enough to allow efficient prepending of headers and
+ * processing of content.
+ *
+ * @section memory_management_garbage Garbage collection
+ *
+ * OpenVPN has many sizable functions which perform various actions
+ * depending on their %context. This makes it difficult to know in advance
+ * exactly how much memory must be allocated. The garbage collection
+ * facilities are used to keep track of dynamic allocations, thereby
+ * allowing easy collective freeing of the allocated memory.
+ *
+ * The garbage collection system is implemented by the \c gc_arena and \c
+ * gc_entry structures. The arena represents a garbage collecting unit,
+ * and contains a linked list of entries. Each entry represents one block
+ * of dynamically allocated memory.
+ *
+ * The garbage collection system also contains various utility functions
+ * for working with the garbage collection structures. These include
+ * functions for initializing new arenas, allocating memory of a given
+ * size and registering the allocation in an arena, and freeing all the
+ * allocated memory associated with an arena.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_protocol_overview.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_protocol_overview.h
new file mode 100644
index 00000000..26fed331
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_protocol_overview.h
@@ -0,0 +1,199 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Network protocol overview documentation file.
+ */
+
+/**
+ * @page network_protocol OpenVPN's network protocol
+ *
+ * Description of packet structure in OpenVPN's network protocol.
+ *
+ * This document describes the structure of packets exchanged between
+ * OpenVPN peers. It is based on the protocol description in the \c ssl.h
+ * file.
+ *
+ * @section network_protocol_external Outer structure of packets exchanged between OpenVPN peers
+ *
+ * VPN tunnel packets are transported between OpenVPN peers using the UDP
+ * or TCP protocols. Their structure is described below.
+ *
+ * @subsection network_protocol_external_structure External packet structure
+ *
+ * - packet length (16 bits, unsigned) [TCP-mode only]: always sent as
+ * plain text. Since TCP is a stream protocol, this packet length
+ * defines the packetization of the stream.
+ * - packet opcode and key_id (8 bits) [TLS-mode only]:
+ * - package message type (high 5 bits)
+ * - key_id (low 3 bits): the key_id refers to an already negotiated
+ * TLS session. OpenVPN seamlessly renegotiates the TLS session by
+ * using a new key_id for the new session. Overlap (controlled by
+ * user definable parameters) between old and new TLS sessions is
+ * allowed, providing a seamless transition during tunnel operation.
+ * - payload (n bytes)
+ *
+ * @subsection network_protocol_external_types Message types
+ *
+ * The type of a VPN tunnel packet is indicated by its opcode. The
+ * following describes the various opcodes available.
+ *
+ * - Control channel messages:
+ * - \c P_CONTROL_HARD_RESET_CLIENT_V1 -- %Key method 1, initial %key
+ * from client, forget previous state.
+ * - \c P_CONTROL_HARD_RESET_SERVER_V1 -- %Key method 1, initial %key
+ * from server, forget previous state.
+ * - \c P_CONTROL_HARD_RESET_CLIENT_V2 -- %Key method 2, initial %key
+ * from client, forget previous state.
+ * - \c P_CONTROL_HARD_RESET_SERVER_V2 -- %Key method 2, initial %key
+ * from server, forget previous state.
+ * - \c P_CONTROL_SOFT_RESET_V1 -- New %key, with a graceful
+ * transition from old to new %key in the sense that a transition
+ * window exists where both the old or new key_id can be used.
+ * - \c P_CONTROL_V1 -- Control channel packet (usually TLS
+ * ciphertext).
+ * - \c P_ACK_V1 -- Acknowledgement for control channel packets
+ * received.
+ * - Data channel messages:
+ * - \c P_DATA_V1 -- Data channel packet containing data channel
+ * ciphertext.
+ *
+ * @subsection network_protocol_external_key_id Session IDs and Key IDs
+ *
+ * OpenVPN uses two different forms of packet identifiers:
+ * - The first form is 64 bits and is used for all control channel
+ * messages. This form is referred to as a \c session_id.
+ * - Data channel messages on the other hand use a shortened form of 3
+ * bits for efficiency reasons since the vast majority of OpenVPN
+ * packets in an active tunnel will be data channel messages. This
+ * form is referred to as a \c key_id.
+ *
+ * The control and data channels use independent packet-id sequences,
+ * because the data channel is an unreliable channel while the control
+ * channel is a %reliable channel. Each use their own independent HMAC
+ * keys.
+ *
+ * @subsection network_protocol_external_reliable Control channel reliability layer
+ *
+ * Control channel messages (\c P_CONTROL_* and \c P_ACK_* message types)
+ * are TLS ciphertext packets which have been encapsulated inside of a
+ * reliability layer. The reliability layer is implemented as a
+ * straightforward acknowledge and retransmit model.
+ *
+ * Acknowledgments of received messages can be encoded in either the
+ * dedicated \c P_ACK_* record or they can be prepended to a \c
+ * P_CONTROL_* message.
+ *
+ * See the \link reliable Reliability Layer\endlink module for a detailed
+ * description.
+ *
+ * @section network_protocol_control Structure of control channel messages
+ *
+ * @subsection network_protocol_control_ciphertext Structure of ciphertext control channel messages
+ *
+ * Control channel packets in ciphertext form consist of the following
+ * parts:
+ *
+ * - local \c session_id (random 64 bit value to identify TLS session).
+ * - HMAC signature of entire encapsulation header for HMAC firewall
+ * [only if \c --tls-auth is specified] (usually 16 or 20 bytes).
+ * - packet-id for replay protection (4 or 8 bytes, includes sequence
+ * number and optional \c time_t timestamp).
+ * - acknowledgment packet-id array length (1 byte).
+ * - acknowledgment packet-id array (if length > 0).
+ * - acknowledgment remote session-id (if length > 0).
+ * - packet-id of this message (4 bytes).
+ * - TLS payload ciphertext (n bytes) (only for \c P_CONTROL_V1).
+ *
+ * Note that when \c --tls-auth is used, all message types are protected
+ * with an HMAC signature, even the initial packets of the TLS handshake.
+ * This makes it easy for OpenVPN to throw away bogus packets quickly,
+ * without wasting resources on attempting a TLS handshake which will
+ * ultimately fail.
+ *
+ * @subsection network_protocol_control_key_methods Control channel key methods and
+ *
+ * Once the TLS session has been initialized and authenticated, the TLS
+ * channel is used to exchange random %key material for bidirectional
+ * cipher and HMAC keys which will be used to secure data channel packets.
+ * OpenVPN currently implements two %key methods. %Key method 1 directly
+ * derives keys using random bits obtained from the \c RAND_bytes()
+ * OpenSSL function. %Key method 2 mixes random %key material from both
+ * sides of the connection using the TLS PRF mixing function. %Key method
+ * 2 is the preferred method and is the default for OpenVPN 2.0.
+ *
+ * The @ref key_generation "Data channel key generation" related page
+ * describes the %key methods in more detail.
+ *
+ * @subsection network_protocol_control_plaintext Structure of plaintext control channel messages
+ *
+ * - %Key method 1:
+ * - Cipher %key length in bytes (1 byte).
+ * - Cipher %key (n bytes).
+ * - HMAC %key length in bytes (1 byte).
+ * - HMAC %key (n bytes).
+ * - %Options string (n bytes, null terminated, client/server %options
+ * string should match).
+ * - %Key method 2:
+ * - Literal 0 (4 bytes).
+ * - %Key method (1 byte).
+ * - \c key_source structure (\c key_source.pre_master only defined
+ * for client -> server).
+ * - %Options string length, including null (2 bytes).
+ * - %Options string (n bytes, null terminated, client/server %options
+ * string must match).
+ * - [The username/password data below is optional, record can end at
+ * this point.]
+ * - Username string length, including null (2 bytes).
+ * - Username string (n bytes, null terminated).
+ * - Password string length, including null (2 bytes).
+ * - Password string (n bytes, null terminated).
+ *
+ * @section network_protocol_data Structure of data channel messages
+ *
+ * @subsection network_protocol_data_ciphertext Structure of ciphertext data channel messages
+ *
+ * The P_DATA_* payload represents encrypted, encapsulated tunnel packets
+ * which tend to be either IP packets or Ethernet frames. This is
+ * essentially the "payload" of the VPN.
+ *
+ * Data channel packets in ciphertext form consist of the following parts:
+ * - HMAC of ciphertext IV + ciphertext (if not disabled by \c --auth
+ * none).
+ * - Ciphertext IV (size is cipher-dependent, if not disabled by \c
+ * --no-iv).
+ * - Tunnel packet ciphertext.
+ *
+ * @subsection network_protocol_data_plaintext Structure of plaintext data channel messages
+ *
+ * Data channel packets in plaintext form consist of the following parts:
+ * - packet-id (4 or 8 bytes, if not disabled by --no-replay).
+ * - In TLS mode, 4 bytes are used because the implementation can
+ * force a TLS renegotation before \c 2^32 packets are sent.
+ * - In pre-shared %key mode, 8 bytes are used (sequence number and \c
+ * time_t value) to allow long-term %key usage without packet-id
+ * collisions.
+ * - User plaintext (n bytes).
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_reliable.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_reliable.h
new file mode 100644
index 00000000..5264906a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_reliable.h
@@ -0,0 +1,49 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * Reliability Layer module documentation file.
+ */
+
+/**
+ * @defgroup reliable Reliability Layer module
+ *
+ * The Reliability Layer is part of OpenVPN's control channel. It
+ * provides a reliable and sequential transport mechanism for control
+ * channel messages between OpenVPN peers. This module forms the
+ * interface between the \link external_multiplexer External
+ * Multiplexer\endlink and the \link control_tls Control Channel TLS
+ * module\endlink.
+ *
+ * @par UDP or TCP as VPN tunnel transport
+ *
+ * This is especially important when OpenVPN is configured to communicate
+ * over UDP, because UDP does not offer a reliable and sequential
+ * transport. OpenVPN endpoints can also communicate over TCP which does
+ * provide a reliable and sequential transport. In both cases, using UDP
+ * or TCP as an external transport, the internal Reliability Layer is
+ * active.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_tunnel_state.h b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_tunnel_state.h
new file mode 100644
index 00000000..6c93e71b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/doc_tunnel_state.h
@@ -0,0 +1,155 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * VPN tunnel state documentation file.
+ */
+
+/**
+ * @page tunnel_state Structure of the VPN tunnel state storage
+ *
+ * This section describes how OpenVPN stores its VPN tunnel state during
+ * operation.
+ *
+ * OpenVPN uses several data structures as storage containers for state
+ * information of active VPN tunnels. These are described in this
+ * section, together with a little bit of history to help understand the
+ * origin of the current architecture.
+ *
+ * Whether an OpenVPN process is running in client-mode or server-mode
+ * determines whether it can support only one or multiple simultaneously
+ * active VPN tunnels. This consequently also determines how the
+ * associated state information is wrapped up internally. This section
+ * gives an overview of the differences.
+ *
+ * @section tunnel_state_history Historic developments
+ *
+ * In the old v1.x series, an OpenVPN process managed only one single VPN
+ * tunnel. This allowed the VPN tunnel state to be stored together with
+ * process-global information in one single \c context structure.
+ *
+ * This changed, however, in the v2.x series, as new OpenVPN versions
+ * running in server-mode can support multiple simultaneously active VPN
+ * tunnels. This necessitated a redesign of the VPN tunnel state
+ * container structures, and modification of the \link
+ * external_multiplexer External Multiplexer\endlink and \link
+ * internal_multiplexer Internal Multiplexer\endlink systems. The
+ * majority of these changes are only relevant for OpenVPN processes
+ * running in server-mode, and the client-mode structure has remained very
+ * similar to the v1.x single-tunnel form.
+ *
+ * @section tunnel_state_client Client-mode state
+ *
+ * An OpenVPN process running in client-mode can manage at most one single
+ * VPN tunnel at any one time. The state information for a client's VPN
+ * tunnel is stored in a \c context structure.
+ *
+ * The \c context structure is created in the \c main() function. That is
+ * also where process-wide initialization takes place, such as parsing
+ * command line %options and reading configuration files. The \c context
+ * is then passed to \c tunnel_point_to_point() which drives OpenVPN's
+ * main event processing loop. These functions are both part of the \link
+ * eventloop Main Event Loop\endlink module.
+ *
+ * @subsection tunnel_state_client_init Initialization and cleanup
+ *
+ * Because there is only one \c context structure present, it can be
+ * initialized and cleaned up from the client's main event processing
+ * function. Before the \c tunnel_point_to_point() function enters its
+ * event loop, it calls \c init_instance_handle_signals() which calls \c
+ * init_instance() to initialize the single \c context structure. After
+ * the event loop stops, it calls \c close_instance() to clean up the \c
+ * context.
+ *
+ * @subsection tunnel_state_client_event Event processing
+ *
+ * When the main event processing loop activates the external or internal
+ * multiplexer to handle a network event, it is not necessary to determine
+ * which VPN tunnel the event is associated with, because there is only
+ * one VPN tunnel active.
+ *
+ * @section tunnel_state_server Server-mode state
+ *
+ * An OpenVPN process running in server-mode can manage multiple
+ * simultaneously active VPN tunnels. For every VPN tunnel active, in
+ * other words for every OpenVPN client which is connected to a server,
+ * the OpenVPN server has one \c context structure in which it stores that
+ * particular VPN tunnel's state information.
+ *
+ * @subsection tunnel_state_server_multi Multi_context and multi_instance structures
+ *
+ * To support multiple \c context structures, each is wrapped in a \c
+ * multi_instance structure, and all the \c multi_instance structures are
+ * registered in one single \c multi_context structure. The \link
+ * external_multiplexer External Multiplexer\endlink and \link
+ * internal_multiplexer Internal Multiplexer\endlink then use the \c
+ * multi_context to retrieve the correct \c multi_instance and \c context
+ * associated with a given network address.
+ *
+ * @subsection tunnel_state_server_init Startup and initialization
+ *
+ * An OpenVPN process running in server-mode starts in the same \c main()
+ * function as it would in client-mode. The same process-wide
+ * initialization is performed, and the resulting state and configuration
+ * is stored in a \c context structure. The server-mode and client-mode
+ * processes diverge when the \c main() function calls one of \c
+ * tunnel_point_to_point() or \c tunnel_server().
+ *
+ * In server-mode, \c main() calls the \c tunnel_server() function, which
+ * transfers control to \c tunnel_server_udp_single_threaded() or \c
+ * tunnel_server_tcp() depending on the external transport protocol.
+ *
+ * These functions receive the \c context created in \c main(). This
+ * object has a special status in server-mode, as it does not represent an
+ * active VPN tunnel, but does contain process-wide configuration
+ * parameters. In the source code, it is often stored in "top" variables.
+ * To distinguish this object from other instances of the same type, its
+ * \c context.mode value is set to \c CM_TOP. Other \c context objects,
+ * which do represent active VPN tunnels, have a \c context.mode set to \c
+ * CM_CHILD_UDP or \c CM_CHILD_TCP, depending on the external transport
+ * protocol.
+ *
+ * Both \c tunnel_server_udp_single_threaded() and \c tunnel_server_tcp()
+ * perform similar initialization. In either case, a \c multi_context
+ * structure is created, and it is initialized according to the
+ * configuration stored in the top \c context by the \c multi_init() and
+ * \c multi_top_init() functions.
+ *
+ * @subsection tunnel_state_server_tunnels Creating and destroying VPN tunnels
+ *
+ * When an OpenVPN client makes a new connection to a server, the server
+ * creates a new \c context and \c multi_instance. The latter is
+ * registered in the \c multi_context, which makes it possible for the
+ * external and internal multiplexers to retrieve the correct \c
+ * multi_instance and \c context when a network event occurs.
+ *
+ * @subsection tunnel_state_server_cleanup Final cleanup
+ *
+ * After the main event loop exits, both \c
+ * tunnel_server_udp_single_threaded() and \c tunnel_server_tcp() perform
+ * similar cleanup. They call \c multi_uninit() followed by \c
+ * multi_top_free() to clean up the \c multi_context structure.
+ */
diff --git a/ics-openvpn-stripped/main/openvpn/doc/doxygen/openvpn.doxyfile b/ics-openvpn-stripped/main/openvpn/doc/doxygen/openvpn.doxyfile
new file mode 100644
index 00000000..cf26c42a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/doxygen/openvpn.doxyfile
@@ -0,0 +1,279 @@
+# Doxyfile 1.5.5
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = "OpenVPN"
+PROJECT_NUMBER =
+OUTPUT_DIRECTORY = doxygen
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = ""
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES # NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = YES
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+TYPEDEF_HIDES_STRUCT = NO
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = YES
+EXTRACT_ANON_NSPACES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+FILE_VERSION_FILTER =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = .
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.vhd \
+ *.vhdl
+RECURSIVE = YES
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS = *
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+GENERATE_DOCSET = NO
+DOCSET_FEEDNAME = "Doxygen generated docs"
+DOCSET_BUNDLE_ID = org.doxygen.Project
+HTML_DYNAMIC_SECTIONS = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = YES # NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = WIN32 NTLM USE_LZO ENABLE_FRAGMENT P2MP P2MP_SERVER ENABLE_CRYPTO ENABLE_CRYPTO_OPENSSL ENABLE_SSL ENABLE_PLUGIN ENABLE_MANAGEMENT ENABLE_OCC HAVE_GETTIMEOFDAY
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO # YES
+CALLER_GRAPH = NO # YES
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH = "/usr/bin/dot"
+DOTFILE_DIRS =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 1000
+DOT_TRANSPARENT = YES
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/ics-openvpn-stripped/main/openvpn/doc/management-notes.txt b/ics-openvpn-stripped/main/openvpn/doc/management-notes.txt
new file mode 100644
index 00000000..ef39b855
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/management-notes.txt
@@ -0,0 +1,1039 @@
+OpenVPN Management Interface Notes
+----------------------------------
+
+The OpenVPN Management interface allows OpenVPN to
+be administratively controlled from an external program via
+a TCP or unix domain socket.
+
+The interface has been specifically designed for developers
+who would like to programmatically or remotely control
+an OpenVPN daemon, and can be used when OpenVPN is running
+as a client or server.
+
+The management interface is implemented using a client/server TCP
+connection or unix domain socket where OpenVPN will listen on a
+provided IP address and port for incoming management client connections.
+
+The management protocol is currently cleartext without an explicit
+security layer. For this reason, it is recommended that the
+management interface either listen on a unix domain socket,
+localhost (127.0.0.1), or on the local VPN address. It's possible
+to remotely connect to the management interface over the VPN itself,
+though some capabilities will be limited in this mode, such as the
+ability to provide private key passwords.
+
+The management interface is enabled in the OpenVPN
+configuration file using the following directive:
+
+--management
+
+See the man page for documentation on this and related
+directives.
+
+Once OpenVPN has started with the management layer enabled,
+you can telnet to the management port (make sure to use
+a telnet client which understands "raw" mode).
+
+Once connected to the management port, you can use
+the "help" command to list all commands.
+
+COMMAND -- bytecount
+--------------------
+
+The bytecount command is used to request real-time notification
+of OpenVPN bandwidth usage.
+
+Command syntax:
+
+ bytecount n (where n > 0) -- set up automatic notification of
+ bandwidth usage once every n seconds
+ bytecount 0 -- turn off bytecount notifications
+
+If OpenVPN is running as a client, the bytecount notification
+will look like this:
+
+ >BYTECOUNT:{BYTES_IN},{BYTES_OUT}
+
+BYTES_IN is the number of bytes that have been received from
+the server and BYTES_OUT is the number of bytes that have been
+sent to the server.
+
+If OpenVPN is running as a server, the bytecount notification
+will look like this:
+
+ >BYTECOUNT_CLI:{CID},{BYTES_IN},{BYTES_OUT}
+
+CID is the Client ID, BYTES_IN is the number of bytes that have
+been received from the client and BYTES_OUT is the number of
+bytes that have been sent to the client.
+
+Note that when the bytecount command is used on the server, every
+connected client will report its bandwidth numbers once every n
+seconds.
+
+When the client disconnects, the final bandwidth numbers will be
+placed in the 'bytes_received' and 'bytes_sent' environmental variables
+as included in the >CLIENT:DISCONNECT notification.
+
+COMMAND -- echo
+---------------
+
+The echo capability is used to allow GUI-specific
+parameters to be either embedded in the OpenVPN config file
+or pushed to an OpenVPN client from a server.
+
+Command examples:
+
+ echo on -- turn on real-time notification of echo messages
+ echo all -- print the current echo history list
+ echo off -- turn off real-time notification of echo messages
+ echo on all -- atomically enable real-time notification,
+ plus show any messages in history buffer
+
+For example, suppose you are developing a OpenVPN GUI and
+you want to give the OpenVPN server the ability to ask
+the GUI to forget any saved passwords.
+
+In the OpenVPN server config file, add:
+
+ push "echo forget-passwords"
+
+When the OpenVPN client receives its pulled list of directives
+from the server, the "echo forget-passwords" directive will
+be in the list, and it will cause the management interface
+to save the "forget-passwords" string in its list of echo
+parameters.
+
+The management client can use "echo all" to output the full
+list of echoed parameters, "echo on" to turn on real-time
+notification of echoed parameters via the ">ECHO:" prefix,
+or "echo off" to turn off real-time notification.
+
+When the GUI connects to the OpenVPN management socket, it
+can issue an "echo all" command, which would produce output
+like this:
+
+ 1101519562,forget-passwords
+ END
+
+Essentially the echo command allowed us to pass parameters from
+the OpenVPN server to the OpenVPN client, and then to the
+management client (such as a GUI). The large integer is the
+unix date/time when the echo parameter was received.
+
+If the management client had issued the command "echo on",
+it would have enabled real-time notifications of echo
+parameters. In this case, our "forget-passwords" message
+would be output like this:
+
+ >ECHO:1101519562,forget-passwords
+
+Like the log command, the echo command can atomically show
+history while simultaneously activating real-time updates:
+
+ echo on all
+
+The size of the echo buffer is currently hardcoded to 100
+messages.
+
+COMMAND -- exit, quit
+---------------------
+
+Close the managment session, and resume listening on the
+management port for connections from other clients. Currently,
+the OpenVPN daemon can at most support a single management client
+any one time.
+
+COMMAND -- help
+---------------
+
+Print a summary of commands.
+
+COMMAND -- hold
+---------------
+
+The hold command can be used to manipulate the hold flag,
+or release OpenVPN from a hold state.
+
+If the hold flag is set on initial startup or
+restart, OpenVPN will hibernate prior to initializing
+the tunnel until the management interface receives
+a "hold release" command.
+
+The --management-hold directive of OpenVPN can be used
+to start OpenVPN with the hold flag set.
+
+The hold flag setting is persistent and will not
+be reset by restarts.
+
+OpenVPN will indicate that it is in a hold state by
+sending a real-time notification to the management
+client:
+
+ >HOLD:Waiting for hold release
+
+Command examples:
+
+ hold -- show current hold flag, 0=off, 1=on.
+ hold on -- turn on hold flag so that future restarts
+ will hold.
+ hold off -- turn off hold flag so that future restarts will
+ not hold.
+ hold release -- leave hold state and start OpenVPN, but
+ do not alter the current hold flag setting.
+
+COMMAND -- kill
+---------------
+
+In server mode, kill a particlar client instance.
+
+Command examples:
+
+ kill Test-Client -- kill the client instance having a
+ common name of "Test-Client".
+ kill 1.2.3.4:4000 -- kill the client instance having a
+ source address and port of 1.2.3.4:4000
+
+Use the "status" command to see which clients are connected.
+
+COMMAND -- log
+--------------
+
+Show the OpenVPN log file. Only the most recent n lines
+of the log file are cached by the management interface, where
+n is controlled by the OpenVPN --management-log-cache directive.
+
+Command examples:
+
+ log on -- Enable real-time output of log messages.
+ log all -- Show currently cached log file history.
+ log on all -- Atomically show all currently cached log file
+ history then enable real-time notification of
+ new log file messages.
+ log off -- Turn off real-time notification of log messages.
+ log 20 -- Show the most recent 20 lines of log file history.
+
+Real-time notification format:
+
+Real-time log messages begin with the ">LOG:" prefix followed
+by the following comma-separated fields:
+
+ (a) unix integer date/time,
+ (b) zero or more message flags in a single string:
+ I -- informational
+ F -- fatal error
+ N -- non-fatal error
+ W -- warning
+ D -- debug, and
+ (c) message text.
+
+COMMAND -- mute
+---------------
+
+Change the OpenVPN --mute parameter. The mute parameter is
+used to silence repeating messages of the same message
+category.
+
+Command examples:
+
+ mute 40 -- change the mute parameter to 40
+ mute -- show the current mute setting
+
+COMMAND -- net
+--------------
+
+(Windows Only) Produce output equivalent to the OpenVPN
+--show-net directive. The output includes OpenVPN's view
+of the system network adapter list and routing table based
+on information returned by the Windows IP helper API.
+
+COMMAND -- pid
+--------------
+
+Shows the process ID of the current OpenVPN process.
+
+COMMAND -- password and username
+--------------------------------
+
+ The password command is used to pass passwords to OpenVPN.
+
+ If OpenVPN is run with the --management-query-passwords
+ directive, it will query the management interface for RSA
+ private key passwords and the --auth-user-pass
+ username/password.
+
+ When OpenVPN needs a password from the management interface,
+ it will produce a real-time ">PASSWORD:" message.
+
+ Example 1:
+
+ >PASSWORD:Need 'Private Key' password
+
+ OpenVPN is indicating that it needs a password of type
+ "Private Key".
+
+ The management client should respond to this query as follows:
+
+ password "Private Key" foo
+
+ Example 2:
+
+ >PASSWORD:Need 'Auth' username/password
+
+ OpenVPN needs a --auth-user-pass password. The management
+ client should respond:
+
+ username "Auth" foo
+ password "Auth" bar
+
+ The username/password itself can be in quotes, and special
+ characters such as double quote or backslash must be escaped,
+ for example,
+
+ password "Private Key" "foo\"bar"
+
+ The escaping rules are the same as for the config file.
+ See the "Command Parsing" section below for more info.
+
+ The PASSWORD real-time message type can also be used to
+ indicate password or other types of authentication failure:
+
+ Example 3: The private key password is incorrect and OpenVPN
+ is exiting:
+
+ >PASSWORD:Verification Failed: 'Private Key'
+
+ Example 4: The --auth-user-pass username/password failed,
+ and OpenVPN is exiting:
+
+ >PASSWORD:Verification Failed: 'Auth'
+
+ Example 5: The --auth-user-pass username/password failed,
+ and the server provided a custom client-reason-text string
+ using the client-deny server-side management interface command.
+
+ >PASSWORD:Verification Failed: 'custom server-generated string'
+
+COMMAND -- forget-passwords
+---------------------------
+
+The forget-passwords command will cause the daemon to forget passwords
+entered during the session.
+
+Command example:
+
+ forget-passwords -- forget passwords entered so far.
+
+COMMAND -- signal
+-----------------
+
+The signal command will send a signal to the OpenVPN daemon.
+The signal can be one of SIGHUP, SIGTERM, SIGUSR1, or SIGUSR2.
+
+Command example:
+
+ signal SIGUSR1 -- send a SIGUSR1 signal to daemon
+
+COMMAND -- state
+----------------
+
+Show the current OpenVPN state, show state history, or
+enable real-time notification of state changes.
+
+These are the OpenVPN states:
+
+CONNECTING -- OpenVPN's initial state.
+WAIT -- (Client only) Waiting for initial response
+ from server.
+AUTH -- (Client only) Authenticating with server.
+GET_CONFIG -- (Client only) Downloading configuration options
+ from server.
+ASSIGN_IP -- Assigning IP address to virtual network
+ interface.
+ADD_ROUTES -- Adding routes to system.
+CONNECTED -- Initialization Sequence Completed.
+RECONNECTING -- A restart has occurred.
+EXITING -- A graceful exit is in progress.
+
+Command examples:
+
+ state -- Print current OpenVPN state.
+ state on -- Enable real-time notification of state changes.
+ state off -- Disable real-time notification of state changes.
+ state all -- Print current state history.
+ state 3 -- Print the 3 most recent state transitions.
+ state on all -- Atomically show state history while at the
+ same time enable real-time state notification
+ of future state transitions.
+
+The output format consists of 4 comma-separated parameters:
+ (a) the integer unix date/time,
+ (b) the state name,
+ (c) optional descriptive string (used mostly on RECONNECTING
+ and EXITING to show the reason for the disconnect),
+ (d) optional TUN/TAP local IP address (shown for ASSIGN_IP
+ and CONNECTED), and
+ (e) optional address of remote server (OpenVPN 2.1 or higher).
+
+Real-time state notifications will have a ">STATE:" prefix
+prepended to them.
+
+COMMAND -- status
+-----------------
+
+Show current daemon status information, in the same format as
+that produced by the OpenVPN --status directive.
+
+Command examples:
+
+status -- Show status information using the default status
+ format version.
+
+status 3 -- Show status information using the format of
+ --status-version 3.
+
+COMMAND -- username
+-------------------
+
+See the "password" section above.
+
+COMMAND -- verb
+---------------
+
+Change the OpenVPN --verb parameter. The verb parameter
+controls the output verbosity, and may range from 0 (no output)
+to 15 (maximum output). See the OpenVPN man page for additional
+info on verbosity levels.
+
+Command examples:
+
+ verb 4 -- change the verb parameter to 4
+ mute -- show the current verb setting
+
+COMMAND -- version
+------------------
+
+Show the current OpenVPN and Management Interface versions.
+
+
+COMMAND -- auth-retry
+---------------------
+
+Set the --auth-retry setting to control how OpenVPN responds to
+username/password authentication errors. See the manual page
+for more info.
+
+Command examples:
+
+ auth-retry interact -- Don't exit when bad username/passwords are entered.
+ Query for new input and retry.
+
+COMMAND -- needok (OpenVPN 2.1 or higher)
+------------------------------------------
+
+Confirm a ">NEED-OK" real-time notification, normally used by
+OpenVPN to block while waiting for a specific user action.
+
+Example:
+
+ OpenVPN needs the user to insert a cryptographic token,
+ so it sends a real-time notification:
+
+ >NEED-OK:Need 'token-insertion-request' confirmation MSG:Please insert your cryptographic token
+
+ The management client, if it is a GUI, can flash a dialog
+ box containing the text after the "MSG:" marker to the user.
+ When the user acknowledges the dialog box,
+ the management client can issue this command:
+
+ needok token-insertion-request ok
+ or
+ needok token-insertion-request cancel
+
+COMMAND -- needstr (OpenVPN 2.1 or higher)
+-------------------------------------------
+
+Confirm a ">NEED-STR" real-time notification, normally used by
+OpenVPN to block while waiting for a specific user input.
+
+Example:
+
+ OpenVPN needs the user to specify some input, so it sends a
+ real-time notification:
+
+ >NEED-STR:Need 'name' input MSG:Please specify your name
+
+ The management client, if it is a GUI, can flash a dialog
+ box containing the text after the "MSG:" marker to the user.
+ When the user acknowledges the dialog box,
+ the management client can issue this command:
+
+ needstr name "John"
+
+COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher)
+---------------------------------------------------
+
+Retrieve available number of certificates.
+
+Example:
+
+ pkcs11-id-count
+ >PKCS11ID-COUNT:5
+
+COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher)
+-------------------------------------------------
+
+Retrieve certificate by index, the ID string should be provided
+as PKCS#11 identity, the blob is BASE64 encoded certificate.
+
+Example:
+
+ pkcs11-id-get 1
+ PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>'
+
+COMMAND -- client-auth (OpenVPN 2.1 or higher)
+-----------------------------------------------
+
+Authorize a ">CLIENT:CONNECT" or ">CLIENT:REAUTH" request and specify
+"client-connect" configuration directives in a subsequent text block.
+
+The OpenVPN server should have been started with the
+--management-client-auth directive so that it will ask the management
+interface to approve client connections.
+
+
+ client-auth {CID} {KID}
+ line_1
+ line_2
+ ...
+ line_n
+ END
+
+CID,KID -- client ID and Key ID. See documentation for ">CLIENT:"
+notification for more info.
+
+line_1 to line_n -- client-connect configuration text block, as would be
+returned by a --client-connect script. The text block may be null, with
+"END" immediately following the "client-auth" line (using a null text
+block is equivalent to using the client-auth-nt command).
+
+A client-connect configuration text block contains OpenVPN directives
+that will be applied to the client instance object representing a newly
+connected client.
+
+COMMAND -- client-auth-nt (OpenVPN 2.1 or higher)
+--------------------------------------------------
+
+Authorize a ">CLIENT:CONNECT" or ">CLIENT:REAUTH" request without specifying
+client-connect configuration text.
+
+The OpenVPN server should have been started with the
+--management-client-auth directive so that it will ask the management
+interface to approve client connections.
+
+ client-auth-nt {CID} {KID}
+
+CID,KID -- client ID and Key ID. See documentation for ">CLIENT:"
+notification for more info.
+
+COMMAND -- client-deny (OpenVPN 2.1 or higher)
+-----------------------------------------------
+
+Deny a ">CLIENT:CONNECT" or ">CLIENT:REAUTH" request.
+
+ client-deny {CID} {KID} "reason-text" ["client-reason-text"]
+
+CID,KID -- client ID and Key ID. See documentation for ">CLIENT:"
+notification for more info.
+
+reason-text: a human-readable message explaining why the authentication
+request was denied. This message will be output to the OpenVPN log
+file or syslog.
+
+client-reason-text: a message that will be sent to the client as
+part of the AUTH_FAILED message.
+
+Note that client-deny denies a specific Key ID (pertaining to a
+TLS renegotiation). A client-deny command issued in response to
+an initial TLS key negotiation (notified by ">CLIENT:CONNECT") will
+terminate the client session after returning "AUTH-FAILED" to the client.
+On the other hand, a client-deny command issued in response to
+a TLS renegotiation (">CLIENT:REAUTH") will invalidate the renegotiated
+key, however the TLS session associated with the currently active
+key will continue to live for up to --tran-window seconds before
+expiration.
+
+To immediately kill a client session, use "client-kill".
+
+COMMAND -- client-kill (OpenVPN 2.1 or higher)
+-----------------------------------------------
+
+Immediately kill a client instance by CID.
+
+ client-kill {CID}
+
+CID -- client ID. See documentation for ">CLIENT:" notification for more
+info.
+
+COMMAND -- client-pf (OpenVPN 2.1 or higher)
+---------------------------------------------
+
+Push a packet filter file to a specific client.
+
+The OpenVPN server should have been started with the
+--management-client-pf directive so that it will require that
+VPN tunnel packets sent or received by client instances must
+conform to that client's packet filter configuration.
+
+ client-pf {CID}
+ line_1
+ line_2
+ ...
+ line_n
+ END
+
+CID -- client ID. See documentation for ">CLIENT:" notification for
+more info.
+
+line_1 to line_n -- the packet filter configuration file for this
+client.
+
+Packet filter file grammar:
+
+ [CLIENTS DROP|ACCEPT]
+ {+|-}common_name1
+ {+|-}common_name2
+ . . .
+ [SUBNETS DROP|ACCEPT]
+ {+|-}subnet1
+ {+|-}subnet2
+ . . .
+ [END]
+
+ Subnet: IP-ADDRESS | IP-ADDRESS/NUM_NETWORK_BITS | "unknown"
+
+ CLIENTS refers to the set of clients (by their common-name) which
+ this instance is allowed ('+') to connect to, or is excluded ('-')
+ from connecting to. Note that in the case of client-to-client
+ connections, such communication must be allowed by the packet filter
+ configuration files of both clients AND the --client-to-client
+ directive must have been specified in the OpenVPN server config.
+
+ SUBNETS refers to IP addresses or IP address subnets which this
+ client instance may connect to ('+') or is excluded ('-') from
+ connecting to, and applies to IPv4 and ARP packets. The special
+ "unknown" tag refers to packets of unknown type, i.e. a packet that
+ is not IPv4 or ARP.
+
+ DROP or ACCEPT defines default policy when there is no explicit match
+ for a common-name or subnet. The [END] tag must exist.
+
+ Notes:
+
+ * The SUBNETS section currently only supports IPv4 addresses and
+ subnets.
+
+ * A given client or subnet rule applies to both incoming and
+ outgoing packets.
+
+ * The CLIENTS list is order-invariant. Because the list is stored
+ as a hash-table, the order of the list does not affect its function.
+
+ * The SUBNETS table is scanned sequentially, and the first item to
+ match is chosen. Therefore the SUBNETS table is NOT order-invariant.
+
+ * No client-to-client communication is allowed unless the
+ --client-to-client configuration directive is enabled AND
+ the CLIENTS list of BOTH clients allows the communication.
+
+Example packet filter spec, as transmitted to the management interface:
+
+ client-pf 42
+ [CLIENTS ACCEPT]
+ -accounting
+ -enigma
+ [SUBNETS DROP]
+ -10.46.79.9
+ +10.0.0.0/8
+ [END]
+ END
+
+The above example sets the packet filter policy for the client
+identified by CID=42. This client may connect to all other clients
+except those having a common name of "accounting" or "enigma".
+The client may only interact with external IP addresses in the
+10.0.0.0/8 subnet, however access to 10.46.79.9 is specifically
+excluded.
+
+Another example packet filter spec, as transmitted to the
+management interface:
+
+ client-pf 99
+ [CLIENTS DENY]
+ +public
+ [SUBNETS ACCEPT]
+ +10.10.0.1
+ -10.0.0.0/8
+ -unknown
+ [END]
+ END
+
+The above example sets the packet filter policy for the client
+identified by CID=99. This client may not connect to any other
+clients except those having a common name of "public". It may
+interact with any external IP address except those in the
+10.0.0.0/8 netblock. However interaction with one address in
+the 10.0.0.0/8 netblock is allowed: 10.10.0.1. Also, the client
+may not interact with external IP addresses using an "unknown"
+protocol (i.e. one that is not IPv4 or ARP).
+
+COMMAND -- remote (OpenVPN AS 2.1.5/OpenVPN 2.3 or higher)
+--------------------------------------------
+
+Provide remote host/port in response to a >REMOTE notification
+(client only). Requires that the --management-query-remote
+directive is used.
+
+ remote ACTION [HOST PORT]
+
+The "remote" command should only be given in response to a >REMOTE
+notification. For example, the following >REMOTE notification
+indicates that the client config file would ordinarily connect
+to vpn.example.com port 1194 (UDP):
+
+ >REMOTE:vpn.example.com,1194,udp
+
+Now, suppose we want to override the host and port, connecting
+instead to vpn.otherexample.com port 1234. After receiving
+the above notification, use this command:
+
+ remote MOD vpn.otherexample.com 1234
+
+To accept the same host and port as the client would ordinarily
+have connected to, use this command:
+
+ remote ACCEPT
+
+To skip the current connection entry and advance to the next one,
+use this command:
+
+ remote SKIP
+
+COMMAND -- proxy (OpenVPN 2.3 or higher)
+--------------------------------------------
+
+Provide proxy server host/port and flags in response to a >PROXY
+notification (client only). Requires that the --management-query-proxy
+directive is used.
+
+ proxy TYPE HOST PORT ["nct"]
+
+The "proxy" command must only be given in response to a >PROXY
+notification. Use the "nct" flag if you only want to allow
+non-cleartext auth with the proxy server. The following >PROXY
+notification indicates that the client config file would ordinarily
+connect to the first --remote configured, vpn.example.com using TCP:
+
+ >PROXY:1,TCP,vpn.example.com
+
+Now, suppose we want to connect to the remote host using the proxy server
+proxy.intranet port 8080 with secure authentication only, if required.
+After receiving the above notification, use this command:
+
+ proxy HTTP proxy.intranet 8080 nct
+
+You can also use the SOCKS keyword to pass a SOCKS server address, like:
+
+ proxy SOCKS fe00::1 1080
+
+To accept connecting to the host and port directly, use this command:
+
+ proxy NONE
+
+COMMAND -- rsa-sig (OpenVPN 2.3 or higher)
+------------------------------------------
+Provides support for external storage of the private key. Requires the
+--management-external-key option. This option can be used instead of "key"
+in client mode, and allows the client to run without the need to load the
+actual private key. When the SSL protocol needs to perform an RSA sign
+operation, the data to be signed will be sent to the management interface
+via a notification as follows:
+
+>RSA_SIGN:[BASE64_DATA]
+
+The management interface client should then sign BASE64_DATA
+using the private key and return the SSL signature as follows:
+
+rsa-sig
+[BASE64_SIG_LINE]
+.
+.
+.
+END
+
+Base64 encoded output of RSA_sign(NID_md5_sha1,... will provide a
+correct signature.
+
+This capability is intended to allow the use of arbitrary cryptographic
+service providers with OpenVPN via the management interface.
+
+
+OUTPUT FORMAT
+-------------
+
+(1) Command success/failure indicated by "SUCCESS: [text]" or
+ "ERROR: [text]".
+
+(2) For commands which print multiple lines of output,
+ the last line will be "END".
+
+(3) Real-time messages will be in the form ">[source]:[text]",
+ where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
+ "NEED-OK", "PASSWORD", or "STATE".
+
+REAL-TIME MESSAGE FORMAT
+------------------------
+
+The OpenVPN management interface produces two kinds of
+output: (a) output from a command, or (b) asynchronous,
+real-time output which can be generated at any time.
+
+Real-time messages start with a '>' character in the first
+column and are immediately followed by a type keyword
+indicating the type of real-time message. The following
+types are currently defined:
+
+BYTECOUNT -- Real-time bandwidth usage notification, as enabled
+ by "bytecount" command when OpenVPN is running as
+ a client.
+
+BYTECOUNT_CLI -- Real-time bandwidth usage notification per-client,
+ as enabled by "bytecount" command when OpenVPN is
+ running as a server.
+
+CLIENT -- Notification of client connections and disconnections
+ on an OpenVPN server. Enabled when OpenVPN is started
+ with the --management-client-auth option. CLIENT
+ notifications may be multi-line. See "The CLIENT
+ notification" section below for detailed info.
+
+ECHO -- Echo messages as controlled by the "echo" command.
+
+FATAL -- A fatal error which is output to the log file just
+ prior to OpenVPN exiting.
+
+HOLD -- Used to indicate that OpenVPN is in a holding state
+ and will not start until it receives a
+ "hold release" command.
+
+INFO -- Informational messages such as the welcome message.
+
+LOG -- Log message output as controlled by the "log" command.
+
+NEED-OK -- OpenVPN needs the end user to do something, such as
+ insert a cryptographic token. The "needok" command can
+ be used to tell OpenVPN to continue.
+
+NEED-STR -- OpenVPN needs information from end, such as
+ a certificate to use. The "needstr" command can
+ be used to tell OpenVPN to continue.
+
+PASSWORD -- Used to tell the management client that OpenVPN
+ needs a password, also to indicate password
+ verification failure.
+
+STATE -- Shows the current OpenVPN state, as controlled
+ by the "state" command.
+
+The CLIENT notification
+-----------------------
+
+The ">CLIENT:" notification is enabled by the --management-client-auth
+OpenVPN configuration directive that gives the management interface client
+the responsibility to authenticate OpenVPN clients after their client
+certificate has been verified. CLIENT notifications may be multi-line, and
+the sequentiality of a given CLIENT notification, its associated environmental
+variables, and the terminating ">CLIENT:ENV,END" line are guaranteed to be
+atomic.
+
+CLIENT notification types:
+
+(1) Notify new client connection ("CONNECT") or existing client TLS session
+ renegotiation ("REAUTH"). Information about the client is provided
+ by a list of environmental variables which are documented in the OpenVPN
+ man page. The environmental variables passed are equivalent to those
+ that would be passed to an --auth-user-pass-verify script.
+
+ >CLIENT:CONNECT|REAUTH,{CID},{KID}
+ >CLIENT:ENV,name1=val1
+ >CLIENT:ENV,name2=val2
+ >CLIENT:ENV,...
+ >CLIENT:ENV,END
+
+(2) Notify successful client authentication and session initiation.
+ Called after CONNECT.
+
+ >CLIENT:ESTABLISHED,{CID}
+ >CLIENT:ENV,name1=val1
+ >CLIENT:ENV,name2=val2
+ >CLIENT:ENV,...
+ >CLIENT:ENV,END
+
+(3) Notify existing client disconnection. The environmental variables passed
+ are equivalent to those that would be passed to a --client-disconnect
+ script.
+
+ >CLIENT:DISCONNECT,{CID}
+ >CLIENT:ENV,name1=val1
+ >CLIENT:ENV,name2=val2
+ >CLIENT:ENV,...
+ >CLIENT:ENV,END
+
+(4) Notify that a particular virtual address or subnet
+ is now associated with a specific client.
+
+ >CLIENT:ADDRESS,{CID},{ADDR},{PRI}
+
+Variables:
+
+CID -- Client ID, numerical ID for each connecting client, sequence = 0,1,2,...
+KID -- Key ID, numerical ID for the key associated with a given client TLS session,
+ sequence = 0,1,2,...
+PRI -- Primary (1) or Secondary (0) VPN address/subnet. All clients have at least
+ one primary IP address. Secondary address/subnets are associated with
+ client-specific "iroute" directives.
+ADDR -- IPv4 address/subnet in the form 1.2.3.4 or 1.2.3.0/255.255.255.0
+
+In the unlikely scenario of an extremely long-running OpenVPN server,
+CID and KID should be assumed to recycle to 0 after (2^32)-1, however this
+recycling behavior is guaranteed to be collision-free.
+
+Command Parsing
+---------------
+
+The management interface uses the same command line lexical analyzer
+as is used by the OpenVPN config file parser.
+
+Whitespace is a parameter separator.
+
+Double quotation or single quotation characters ("", '') can be used
+to enclose parameters containing whitespace.
+
+Backslash-based shell escaping is performed, using the following
+mappings, when not in single quotations:
+
+\\ Maps to a single backslash character (\).
+\" Pass a literal doublequote character ("), don't
+ interpret it as enclosing a parameter.
+\[SPACE] Pass a literal space or tab character, don't
+ interpret it as a parameter delimiter.
+
+Challenge/Response Protocol
+---------------------------
+
+The OpenVPN Challenge/Response Protocol allows an OpenVPN server to
+generate challenge questions that are shown to the user, and to see
+the user's responses to those challenges. Based on the responses, the
+server can allow or deny access.
+
+In this way, the OpenVPN Challenge/Response Protocol can be used
+to implement multi-factor authentication. Two different
+variations on the challenge/response protocol are supported: the
+"Dynamic" and "Static" protocols.
+
+The basic idea of Challenge/Response is that the user must enter an
+additional piece of information, in addition to the username and
+password, to successfully authenticate. Normally, this information
+is used to prove that the user posesses a certain key-like device
+such as cryptographic token or a particular mobile phone.
+
+Dynamic protocol:
+
+The OpenVPN dynamic challenge/response protocol works by returning
+a specially formatted error message after initial successful
+authentication. This error message contains the challenge question,
+and is formatted as such:
+
+ CRV1:<flags>:<state_id>:<username_base64>:<challenge_text>
+
+flags: a series of optional, comma-separated flags:
+ E : echo the response when the user types it
+ R : a response is required
+
+state_id: an opaque string that should be returned to the server
+ along with the response.
+
+username_base64 : the username formatted as base64
+
+challenge_text : the challenge text to be shown to the user
+
+Example challenge:
+
+ CRV1:R,E:Om01u7Fh4LrGBS7uh0SWmzwabUiGiW6l:Y3Ix:Please enter token PIN
+
+After showing the challenge_text and getting a response from the user
+(if R flag is specified), the client should submit the following
+auth creds back to the OpenVPN server:
+
+Username: [username decoded from username_base64]
+Password: CRV1::<state_id>::<response_text>
+
+Where state_id is taken from the challenge request and response_text
+is what the user entered in response to the challenge_text.
+If the R flag is not present, response_text may be the empty
+string.
+
+Example response (suppose the user enters "8675309" for the token PIN):
+
+ Username: cr1 ("Y3Ix" base64 decoded)
+ Password: CRV1::Om01u7Fh4LrGBS7uh0SWmzwabUiGiW6l::8675309
+
+Static protocol:
+
+The static protocol differs from the dynamic protocol in that the
+challenge question and response field is given to the user in the
+initial username/password dialog, and the username, password, and
+response are delivered back to the server in a single transaction.
+
+The "static-challenge" directive is used to give the challenge text
+to OpenVPN and indicate whether or not the response should be echoed.
+
+When the "static-challenge" directive is used, the management
+interface will respond as such when credentials are needed:
+
+ >PASSWORD:Need 'Auth' username/password SC:<ECHO>,<TEXT>
+
+ ECHO: "1" if response should be echoed, "0" to not echo
+ TEXT: challenge text that should be shown to the user to
+ facilitate their response
+
+For example:
+
+ >PASSWORD:Need 'Auth' username/password SC:1,Please enter token PIN
+
+The above notification indicates that OpenVPN needs a --auth-user-pass
+password plus a response to a static challenge ("Please enter token PIN").
+The "1" after the "SC:" indicates that the response should be echoed.
+
+The management interface client in this case should add the static
+challenge text to the auth dialog followed by a field for the user to
+enter a response. Then the client should pack the password and response
+together into an encoded password:
+
+ username "Auth" foo
+ password "Auth" "SCRV1:<BASE64_PASSWORD>:<BASE64_RESPONSE>"
+
+For example, if the user entered "bar" as the password and 8675309
+as the PIN, the following management interface commands should be
+issued:
+
+ username "Auth" foo
+ password "Auth" "SCRV1:Zm9v:ODY3NTMwOQ=="
+
+Client-side support for challenge/response protocol:
+
+Currently, the Access Server client and standalone OpenVPN
+client support both static and dynamic challenge/response
+protocols. However, any OpenVPN client UI that drives OpenVPN
+via the management interface needs to add explicit support
+for the challenge/response protocol.
diff --git a/ics-openvpn-stripped/main/openvpn/doc/openvpn.8 b/ics-openvpn-stripped/main/openvpn/doc/openvpn.8
new file mode 100644
index 00000000..aee0bc83
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/doc/openvpn.8
@@ -0,0 +1,6701 @@
+.\" 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,
+.\" packet encryption, packet authentication, and
+.\" packet compression.
+.\"
+.\" Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+.\"
+.\" 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 (see the file COPYING included with this
+.\" distribution); if not, write to the Free Software Foundation, Inc.,
+.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+.\"
+.\" Manual page for openvpn
+.\
+.\" SH section heading
+.\" SS subsection heading
+.\" LP paragraph
+.\" IP indented paragraph
+.\" TP hanging label
+.\
+.\" .nf -- no formatting
+.\" .fi -- resume formatting
+.\" .ft 3 -- boldface
+.\" .ft -- normal face
+.\" .in +|-{n} -- indent
+.\"
+.TH openvpn 8 "17 November 2008"
+.\"*********************************************************
+.SH NAME
+openvpn \- secure IP tunnel daemon.
+.\"*********************************************************
+.SH SYNOPSIS
+.ft 3
+openvpn [ options ... ]
+.ft
+.\"*********************************************************
+.SH INTRODUCTION
+.LP
+OpenVPN is an open source VPN daemon by James Yonan.
+Because OpenVPN tries to
+be a universal VPN tool offering a great deal of flexibility,
+there are a lot of options on this manual page.
+If you're new to OpenVPN, you might want to skip ahead to the
+examples section where you will see how to construct simple
+VPNs on the command line without even needing a configuration file.
+
+Also note that there's more documentation and examples on
+the OpenVPN web site:
+.I http://openvpn.net/
+
+And if you would like to see a shorter version of this manual,
+see the openvpn usage message which can be obtained by
+running
+.B openvpn
+without any parameters.
+.\"*********************************************************
+.SH DESCRIPTION
+.LP
+OpenVPN is a robust and highly flexible VPN daemon.
+OpenVPN supports SSL/TLS security, ethernet bridging,
+TCP or UDP tunnel transport through proxies or NAT,
+support for dynamic IP addresses and DHCP,
+scalability to hundreds or thousands of users,
+and portability to most major OS platforms.
+
+OpenVPN is tightly bound to the OpenSSL library, and derives much
+of its crypto capabilities from it.
+
+OpenVPN supports
+conventional encryption
+using a pre-shared secret key
+.B (Static Key mode)
+or
+public key security
+.B (SSL/TLS mode)
+using client & server certificates.
+OpenVPN also
+supports non-encrypted TCP/UDP tunnels.
+
+OpenVPN is designed to work with the
+.B TUN/TAP
+virtual networking interface that exists on most platforms.
+
+Overall, OpenVPN aims to offer many of the key features of IPSec but
+with a relatively lightweight footprint.
+.\"*********************************************************
+.SH OPTIONS
+OpenVPN allows any option to be placed either on the command line
+or in a configuration file. Though all command line options are preceded
+by a double-leading-dash ("\-\-"), this prefix can be removed when
+an option is placed in a configuration file.
+.\"*********************************************************
+.TP
+.B \-\-help
+Show options.
+.\"*********************************************************
+.TP
+.B \-\-config file
+Load additional config options from
+.B file
+where each line corresponds to one command line option,
+but with the leading '\-\-' removed.
+
+If
+.B \-\-config file
+is the only option to the openvpn command,
+the
+.B \-\-config
+can be removed, and the command can be given as
+.B openvpn file
+
+Note that
+configuration files can be nested to a reasonable depth.
+
+Double quotation or single quotation characters ("", '')
+can be used to enclose single parameters containing whitespace,
+and "#" or ";" characters in the first column
+can be used to denote comments.
+
+Note that OpenVPN 2.0 and higher performs backslash-based shell
+escaping for characters not in single quotations,
+so the following mappings should be observed:
+
+.nf
+.ft 3
+.in +4
+\\\\ Maps to a single backslash character (\\).
+\\" Pass a literal doublequote character ("), don't
+ interpret it as enclosing a parameter.
+\\[SPACE] Pass a literal space or tab character, don't
+ interpret it as a parameter delimiter.
+.in -4
+.ft
+.fi
+
+For example on Windows, use double backslashes to
+represent pathnames:
+
+.nf
+.ft 3
+.in +4
+secret "c:\\\\OpenVPN\\\\secret.key"
+.in -4
+.ft
+.fi
+
+For examples of configuration files,
+see
+.I http://openvpn.net/examples.html
+
+Here is an example configuration file:
+
+.nf
+.ft 3
+.in +4
+#
+# Sample OpenVPN configuration file for
+# using a pre-shared static key.
+#
+# '#' or ';' may be used to delimit comments.
+
+# Use a dynamic tun device.
+dev tun
+
+# Our remote peer
+remote mypeer.mydomain
+
+# 10.1.0.1 is our local VPN endpoint
+# 10.1.0.2 is our remote VPN endpoint
+ifconfig 10.1.0.1 10.1.0.2
+
+# Our pre-shared static key
+secret static.key
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.SS Tunnel Options:
+.TP
+.B \-\-mode m
+Set OpenVPN major mode. By default, OpenVPN runs in
+point-to-point mode ("p2p"). OpenVPN 2.0 introduces
+a new mode ("server") which implements a multi-client
+server capability.
+.\"*********************************************************
+.TP
+.B \-\-local host
+Local host name or IP address for bind.
+If specified, OpenVPN will bind to this address only.
+If unspecified, OpenVPN will bind to all interfaces.
+.\"*********************************************************
+.TP
+.B \-\-remote host [port] [proto]
+Remote host name or IP address. On the client, multiple
+.B \-\-remote
+options may be specified for redundancy, each referring
+to a different OpenVPN server. Specifying multiple
+.B \-\-remote
+options for this purpose is a special case of the more
+general connection-profile feature. See the
+.B <connection>
+documentation below.
+
+The OpenVPN client will try to connect to a server at
+.B host:port
+in the order specified by the list of
+.B \-\-remote
+options.
+
+.B proto
+indicates the protocol to use when connecting with the
+remote, and may be "tcp" or "udp".
+
+For forcing IPv4 or IPv6 connection suffix tcp or udp
+with 4/6 like udp4/udp6/tcp4/tcp6.
+
+The client will move on to the next host in the list,
+in the event of connection failure.
+Note that at any given time, the OpenVPN client
+will at most be connected to
+one server.
+
+Note that since UDP is connectionless, connection failure
+is defined by the
+.B \-\-ping
+and
+.B \-\-ping-restart
+options.
+
+Note the following corner case: If you use multiple
+.B \-\-remote
+options, AND you are dropping root privileges on
+the client with
+.B \-\-user
+and/or
+.B \-\-group,
+AND the client is running a non-Windows OS, if the client needs
+to switch to a different server, and that server pushes
+back different TUN/TAP or route settings, the client may lack
+the necessary privileges to close and reopen the TUN/TAP interface.
+This could cause the client to exit with a fatal error.
+
+If
+.B \-\-remote
+is unspecified, OpenVPN will listen
+for packets from any IP address, but will not act on those packets unless
+they pass all authentication tests. This requirement for authentication
+is binding on all potential peers, even those from known and supposedly
+trusted IP addresses (it is very easy to forge a source IP address on
+a UDP packet).
+
+When used in TCP mode,
+.B \-\-remote
+will act as a filter, rejecting connections from any host which does
+not match
+.B host.
+
+If
+.B host
+is a DNS name which resolves to multiple IP addresses,
+one will be randomly
+chosen, providing a sort of basic load-balancing and
+failover capability.
+.\"*********************************************************
+.TP
+.B \-\-remote-random-hostname
+Prepend a random string (6 bytes, 12 hex characters) to hostname to prevent
+DNS caching. For example, "foo.bar.gov" would be modified to
+"<random-chars>.foo.bar.gov".
+.\"*********************************************************
+.TP
+.B <connection>
+Define a client connection
+profile. Client connection profiles are groups of OpenVPN options that
+describe how to connect to a given OpenVPN server. Client connection
+profiles are specified within an OpenVPN configuration file, and
+each profile is bracketed by
+.B <connection>
+and
+.B </connection>.
+
+An OpenVPN client will try each connection profile sequentially
+until it achieves a successful connection.
+
+.B \-\-remote-random
+can be used to initially "scramble" the connection
+list.
+
+Here is an example of connection profile usage:
+
+.nf
+.ft 3
+.in +4
+client
+dev tun
+
+<connection>
+remote 198.19.34.56 1194 udp
+</connection>
+
+<connection>
+remote 198.19.34.56 443 tcp
+</connection>
+
+<connection>
+remote 198.19.34.56 443 tcp
+http-proxy 192.168.0.8 8080
+http-proxy-retry
+</connection>
+
+<connection>
+remote 198.19.36.99 443 tcp
+http-proxy 192.168.0.8 8080
+http-proxy-retry
+</connection>
+
+persist-key
+persist-tun
+pkcs12 client.p12
+ns-cert-type server
+verb 3
+.in -4
+.ft
+.fi
+
+First we try to connect to a server at 198.19.34.56:1194 using UDP.
+If that fails, we then try to connect to 198.19.34.56:443 using TCP.
+If that also fails, then try connecting through an HTTP proxy at
+192.168.0.8:8080 to 198.19.34.56:443 using TCP. Finally, try to
+connect through the same proxy to a server at 198.19.36.99:443
+using TCP.
+
+The following OpenVPN options may be used inside of
+a
+.B <connection>
+block:
+
+.B bind,
+.B connect-retry,
+.B connect-retry-max,
+.B connect-timeout,
+.B explicit-exit-notify,
+.B float,
+.B fragment,
+.B http-proxy,
+.B http-proxy-option,
+.B http-proxy-retry,
+.B http-proxy-timeout,
+.B link-mtu,
+.B local,
+.B lport,
+.B mssfix,
+.B mtu-disc,
+.B nobind,
+.B port,
+.B proto,
+.B remote,
+.B rport,
+.B socks-proxy,
+.B socks-proxy-retry,
+.B tun-mtu and
+.B tun-mtu-extra.
+
+A defaulting mechanism exists for specifying options to apply to
+all
+.B <connection>
+profiles. If any of the above options (with the exception of
+.B remote
+) appear outside of a
+.B <connection>
+block, but in a configuration file which has one or more
+.B <connection>
+blocks, the option setting will be used as a default for
+.B <connection>
+blocks which follow it in the configuration file.
+
+For example, suppose the
+.B nobind
+option were placed in the sample configuration file above, near
+the top of the file, before the first
+.B <connection>
+block. The effect would be as if
+.B nobind
+were declared in all
+.B <connection>
+blocks below it.
+.\"*********************************************************
+.TP
+.B \-\-proto-force p
+When iterating through connection profiles,
+only consider profiles using protocol
+.B p
+('tcp'|'udp').
+.\"*********************************************************
+.TP
+.B \-\-remote-random
+When multiple
+.B \-\-remote
+address/ports are specified, or if connection profiles are being
+used, initially randomize the order of the list
+as a kind of basic load-balancing measure.
+.\"*********************************************************
+.TP
+.B \-\-proto p
+Use protocol
+.B p
+for communicating with remote host.
+.B p
+can be
+.B udp,
+.B tcp-client,
+or
+.B tcp-server.
+
+The default protocol is
+.B udp
+when
+.B \-\-proto
+is not specified.
+
+For UDP operation,
+.B \-\-proto udp
+should be specified on both peers.
+
+For TCP operation, one peer must use
+.B \-\-proto tcp-server
+and the other must use
+.B \-\-proto tcp-client.
+A peer started with
+.B tcp-server
+will wait indefinitely for an incoming connection. A peer
+started with
+.B tcp-client
+will attempt to connect, and if that fails, will sleep for 5
+seconds (adjustable via the
+.B \-\-connect-retry
+option) and try again infinite or up to N retries (adjustable via the
+.B \-\-connect-retry-max
+option). Both TCP client and server will simulate
+a SIGUSR1 restart signal if either side resets the connection.
+
+OpenVPN is designed to operate optimally over UDP, but TCP capability is provided
+for situations where UDP cannot be used.
+In comparison with UDP, TCP will usually be
+somewhat less efficient and less robust when used over unreliable or congested
+networks.
+
+This article outlines some of problems with tunneling IP over TCP:
+
+.I http://sites.inka.de/sites/bigred/devel/tcp-tcp.html
+
+There are certain cases, however, where using TCP may be advantageous from
+a security and robustness perspective, such as tunneling non-IP or
+application-level UDP protocols, or tunneling protocols which don't
+possess a built-in reliability layer.
+.\"*********************************************************
+.TP
+.B \-\-connect-retry n
+Wait
+.B n
+seconds between connection attempts (default=5).
+.\"*********************************************************
+.TP
+.B \-\-connect-timeout n
+For
+.B \-\-proto tcp-client,
+set connection timeout to
+.B n
+seconds (default=10).
+.\"*********************************************************
+.TP
+.B \-\-connect-retry-max n
+.B n
+specifies the number of times all
+.B \-\-remote
+respectively
+.B <connection>
+statements are tried. Specifiying
+.B n
+as one would try each entry exactly once. A sucessful connection
+resets the counter. (default=umlimited).
+.\"*********************************************************
+.TP
+.B \-\-show-proxy-settings
+Show sensed HTTP or SOCKS proxy settings. Currently, only Windows clients
+support this option.
+.\"*********************************************************
+.TP
+.B \-\-http-proxy server port [authfile|'auto'|'auto-nct'] [auth-method]
+Connect to remote host through an HTTP proxy at address
+.B server
+and port
+.B port.
+If HTTP Proxy-Authenticate is required,
+.B authfile
+is a file containing a username and password on 2 lines, or
+"stdin" to prompt from console.
+
+.B auth-method
+should be one of "none", "basic", or "ntlm".
+
+HTTP Digest authentication is supported as well, but only via
+the
+.B auto
+or
+.B auto-nct
+flags (below).
+
+The
+.B auto
+flag causes OpenVPN to automatically determine the
+.B auth-method
+and query stdin or the management interface for
+username/password credentials, if required. This flag
+exists on OpenVPN 2.1 or higher.
+
+The
+.B auto-nct
+flag (no clear-text auth) instructs OpenVPN to automatically
+determine the authentication method, but to reject weak
+authentication protocols such as HTTP Basic Authentication.
+.\"*********************************************************
+.TP
+.B \-\-http-proxy-retry
+Retry indefinitely on HTTP proxy errors. If an HTTP proxy error
+occurs, simulate a SIGUSR1 reset.
+.\"*********************************************************
+.TP
+.B \-\-http-proxy-timeout n
+Set proxy timeout to
+.B n
+seconds, default=5.
+.\"*********************************************************
+.TP
+.B \-\-http-proxy-option type [parm]
+Set extended HTTP proxy options.
+Repeat to set multiple options.
+
+.B VERSION version \-\-
+Set HTTP version number to
+.B version
+(default=1.0).
+
+.B AGENT user-agent \-\-
+Set HTTP "User-Agent" string to
+.B user-agent.
+
+.B CUSTOM\-HEADER name content \-\-
+Adds the custom Header with
+.B name
+as name and
+.B content
+as the content of the custom HTTP header.
+.\"*********************************************************
+.TP
+.B \-\-socks-proxy server [port] [authfile]
+Connect to remote host through a Socks5 proxy at address
+.B server
+and port
+.B port
+(default=1080).
+.B authfile
+(optional) is a file containing a username and password on 2 lines, or
+"stdin" to prompt from console.
+.\"*********************************************************
+.TP
+.B \-\-socks-proxy-retry
+Retry indefinitely on Socks proxy errors. If a Socks proxy error
+occurs, simulate a SIGUSR1 reset.
+.\"*********************************************************
+.TP
+.B \-\-resolv-retry n
+If hostname resolve fails for
+.B \-\-remote,
+retry resolve for
+.B n
+seconds before failing.
+
+Set
+.B n
+to "infinite" to retry indefinitely.
+
+By default,
+.B \-\-resolv-retry infinite
+is enabled. You can disable by setting n=0.
+.\"*********************************************************
+.TP
+.B \-\-float
+Allow remote peer to change its IP address and/or port number, such as due to
+DHCP (this is the default if
+.B \-\-remote
+is not used).
+.B \-\-float
+when specified with
+.B \-\-remote
+allows an OpenVPN session to initially connect to a peer
+at a known address, however if packets arrive from a new
+address and pass all authentication tests, the new address
+will take control of the session. This is useful when
+you are connecting to a peer which holds a dynamic address
+such as a dial-in user or DHCP client.
+
+Essentially,
+.B \-\-float
+tells OpenVPN to accept authenticated packets
+from any address, not only the address which was specified in the
+.B \-\-remote
+option.
+.\"*********************************************************
+.TP
+.B \-\-ipchange cmd
+Run command
+.B cmd
+when our remote ip-address is initially authenticated or
+changes.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+When
+.B cmd
+is executed two arguments are appended after any arguments specified in
+.B cmd
+, as follows:
+
+.B cmd ip_address port_number
+
+Don't use
+.B \-\-ipchange
+in
+.B \-\-mode server
+mode. Use a
+.B \-\-client-connect
+script instead.
+
+See the "Environmental Variables" section below for
+additional parameters passed as environmental variables.
+
+If you are running in a dynamic IP address environment where
+the IP addresses of either peer could change without notice,
+you can use this script, for example, to edit the
+.I /etc/hosts
+file with the current address of the peer. The script will
+be run every time the remote peer changes its IP address.
+
+Similarly if
+.I our
+IP address changes due to DHCP, we should configure
+our IP address change script (see man page for
+.BR dhcpcd (8)
+) to deliver a
+.B SIGHUP
+or
+.B SIGUSR1
+signal to OpenVPN. OpenVPN will then
+reestablish a connection with its most recently authenticated
+peer on its new IP address.
+.\"*********************************************************
+.TP
+.B \-\-port port
+TCP/UDP port number or port name for both local and remote. The current
+default of 1194 represents the official IANA port number
+assignment for OpenVPN and has been used since version 2.0-beta17.
+Previous versions used port 5000 as the default.
+.\"*********************************************************
+.TP
+.B \-\-lport port
+TCP/UDP port number or name for bind.
+.\"*********************************************************
+.TP
+.B \-\-rport port
+TCP/UDP port number or name for remote.
+.\"*********************************************************
+.TP
+.B \-\-bind [ipv6only]
+Bind to local address and port. This is the default unless any of
+.B \-\-proto tcp-client
+,
+.B \-\-http-proxy
+or
+.B \-\-socks-proxy
+are used.
+
+If the
+.B ipv6only
+keyword is present OpenVPN will bind only to IPv6 (as oposed
+to IPv6 and IPv4) when a IPv6 socket is opened.
+
+.\"*********************************************************
+.TP
+.B \-\-nobind
+Do not bind to local address and port. The IP stack will allocate
+a dynamic port for returning packets. Since the value of the dynamic port
+could not be known in advance by a peer, this option is only suitable for
+peers which will be initiating connections by using the
+.B \-\-remote
+option.
+.\"*********************************************************
+.TP
+.B \-\-dev tunX | tapX | null
+TUN/TAP virtual network device (
+.B X
+can be omitted for a dynamic device.)
+
+See examples section below
+for an example on setting up a TUN device.
+
+You must use either tun devices on both ends of the connection
+or tap devices on both ends. You cannot mix them, as they
+represent different underlying network layers.
+
+.B tun
+devices encapsulate IPv4 or IPv6 (OSI Layer 3) while
+.B tap
+devices encapsulate Ethernet 802.3 (OSI Layer 2).
+.\"*********************************************************
+.TP
+.B \-\-dev-type device-type
+Which device type are we using?
+.B device-type
+should be
+.B tun
+(OSI Layer 3)
+or
+.B tap
+(OSI Layer 2).
+Use this option only if the TUN/TAP device used with
+.B \-\-dev
+does not begin with
+.B tun
+or
+.B tap.
+.\"*********************************************************
+.TP
+.B \-\-topology mode
+Configure virtual addressing topology when running in
+.B \-\-dev tun
+mode. This directive has no meaning in
+.B \-\-dev tap
+mode, which always uses a
+.B subnet
+topology.
+
+If you set this directive on the server, the
+.B \-\-server
+and
+.B \-\-server-bridge
+directives will automatically push your chosen topology setting to clients
+as well. This directive can also be manually pushed to clients. Like the
+.B \-\-dev
+directive, this directive must always be compatible between client and server.
+
+.B mode
+can be one of:
+
+.B net30 \-\-
+Use a point-to-point topology, by allocating one /30 subnet per client.
+This is designed to allow point-to-point semantics when some
+or all of the connecting clients might be Windows systems. This is the
+default on OpenVPN 2.0.
+
+.B p2p \-\-
+Use a point-to-point topology where the remote endpoint of the client's
+tun interface always points to the local endpoint of the server's tun interface.
+This mode allocates a single IP address per connecting client.
+Only use
+when none of the connecting clients are Windows systems. This mode
+is functionally equivalent to the
+.B \-\-ifconfig-pool-linear
+directive which is available in OpenVPN 2.0 and is now deprecated.
+
+.B subnet \-\-
+Use a subnet rather than a point-to-point topology by
+configuring the tun interface with a local IP address and subnet mask,
+similar to the topology used in
+.B \-\-dev tap
+and ethernet bridging mode.
+This mode allocates a single IP address per connecting client and works on
+Windows as well. Only available when server and clients are OpenVPN 2.1 or
+higher, or OpenVPN 2.0.x which has been manually patched with the
+.B \-\-topology
+directive code. When used on Windows, requires version 8.2 or higher
+of the TAP-Win32 driver. When used on *nix, requires that the tun
+driver supports an
+.BR ifconfig (8)
+command which sets a subnet instead of a remote endpoint IP address.
+
+This option exists in OpenVPN 2.1 or higher.
+.\"*********************************************************
+.TP
+.B \-\-tun-ipv6
+Build a tun link capable of forwarding IPv6 traffic.
+Should be used in conjunction with
+.B \-\-dev tun
+or
+.B \-\-dev tunX.
+A warning will be displayed
+if no specific IPv6 TUN support for your OS has been compiled into OpenVPN.
+
+See below for further IPv6-related configuration options.
+.\"*********************************************************
+.TP
+.B \-\-dev-node node
+Explicitly set the device node rather than using
+/dev/net/tun, /dev/tun, /dev/tap, etc. If OpenVPN
+cannot figure out whether
+.B node
+is a TUN or TAP device based on the name, you should
+also specify
+.B \-\-dev-type tun
+or
+.B \-\-dev-type tap.
+
+Under Mac OS X this option can be used to specify the default tun
+implementation. Using
+.B \-\-dev\-node utun
+forces usage of the native Darwin tun kernel support. Use
+.B \-\-dev\-node utunN
+to select a specific utun instance. To force using the tun.kext (/dev/tunX) use
+.B \-\-dev\-node tun\fR.
+When not specifying a
+.B \-\-dev\-node
+option openvpn will first try to open utun, and fall back to tun.kext.
+
+On Windows systems, select the TAP-Win32 adapter which
+is named
+.B node
+in the Network Connections Control Panel or the
+raw GUID of the adapter enclosed by braces.
+The
+.B \-\-show-adapters
+option under Windows can also be used
+to enumerate all available TAP-Win32
+adapters and will show both the network
+connections control panel name and the GUID for
+each TAP-Win32 adapter.
+.TP
+.B \-\-lladdr address
+Specify the link layer address, more commonly known as the MAC address.
+Only applied to TAP devices.
+.\"*********************************************************
+.TP
+.B \-\-iproute cmd
+Set alternate command to execute instead of default iproute2 command.
+May be used in order to execute OpenVPN in unprivileged environment.
+.\"*********************************************************
+.TP
+.B \-\-ifconfig l rn
+Set TUN/TAP adapter parameters.
+.B l
+is the IP address of the local VPN endpoint.
+For TUN devices,
+.B rn
+is the IP address of the remote VPN endpoint.
+For TAP devices,
+.B rn
+is the subnet mask of the virtual ethernet segment
+which is being created or connected to.
+
+For TUN devices, which facilitate virtual
+point-to-point IP connections,
+the proper usage of
+.B \-\-ifconfig
+is to use two private IP addresses
+which are not a member of any
+existing subnet which is in use.
+The IP addresses may be consecutive
+and should have their order reversed
+on the remote peer. After the VPN
+is established, by pinging
+.B rn,
+you will be pinging across the VPN.
+
+For TAP devices, which provide
+the ability to create virtual
+ethernet segments,
+.B \-\-ifconfig
+is used to set an IP address and
+subnet mask just as a physical
+ethernet adapter would be
+similarly configured. If you are
+attempting to connect to a remote
+ethernet bridge, the IP address
+and subnet should be set to values
+which would be valid on the
+the bridged ethernet segment (note
+also that DHCP can be used for the
+same purpose).
+
+This option, while primarily a proxy for the
+.BR ifconfig (8)
+command, is designed to simplify TUN/TAP
+tunnel configuration by providing a
+standard interface to the different
+ifconfig implementations on different
+platforms.
+
+.B \-\-ifconfig
+parameters which are IP addresses can
+also be specified as a DNS or /etc/hosts
+file resolvable name.
+
+For TAP devices,
+.B \-\-ifconfig
+should not be used if the TAP interface will be
+getting an IP address lease from a DHCP
+server.
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-noexec
+Don't actually execute ifconfig/netsh commands, instead
+pass
+.B \-\-ifconfig
+parameters to scripts using environmental variables.
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-nowarn
+Don't output an options consistency check warning
+if the
+.B \-\-ifconfig
+option on this side of the
+connection doesn't match the remote side. This is useful
+when you want to retain the overall benefits of the
+options consistency check (also see
+.B \-\-disable-occ
+option) while only disabling the ifconfig component of
+the check.
+
+For example,
+if you have a configuration where the local host uses
+.B \-\-ifconfig
+but the remote host does not, use
+.B \-\-ifconfig-nowarn
+on the local host.
+
+This option will also silence warnings about potential
+address conflicts which occasionally annoy more experienced
+users by triggering "false positive" warnings.
+.\"*********************************************************
+.TP
+.B \-\-route network/IP [netmask] [gateway] [metric]
+Add route to routing table after connection is established.
+Multiple routes can be specified. Routes will be
+automatically torn down in reverse order prior to
+TUN/TAP device close.
+
+This option is intended as
+a convenience proxy for the
+.BR route (8)
+shell command,
+while at the same time providing portable semantics
+across OpenVPN's platform space.
+
+.B netmask
+default \-\- 255.255.255.255
+
+.B gateway
+default \-\- taken from
+.B \-\-route-gateway
+or the second parameter to
+.B \-\-ifconfig
+when
+.B \-\-dev tun
+is specified.
+
+.B metric
+default \-\- taken from
+.B \-\-route-metric
+otherwise 0.
+
+The default can be specified by leaving an option blank or setting
+it to "default".
+
+The
+.B network
+and
+.B gateway
+parameters can
+also be specified as a DNS or /etc/hosts
+file resolvable name, or as one of three special keywords:
+
+.B vpn_gateway
+\-\- The remote VPN endpoint address
+(derived either from
+.B \-\-route-gateway
+or the second parameter to
+.B \-\-ifconfig
+when
+.B \-\-dev tun
+is specified).
+
+.B net_gateway
+\-\- The pre-existing IP default gateway, read from the routing
+table (not supported on all OSes).
+
+.B remote_host
+\-\- The
+.B \-\-remote
+address if OpenVPN is being run in client mode, and is undefined in server mode.
+.\"*********************************************************
+.TP
+.B \-\-max-routes n
+Allow a maximum number of n
+.B \-\-route
+options to be specified, either in the local configuration file,
+or pulled from an OpenVPN server. By default, n=100.
+.\"*********************************************************
+.TP
+.B \-\-route-gateway gw|'dhcp'
+Specify a default gateway
+.B gw
+for use with
+.B \-\-route.
+
+If
+.B dhcp
+is specified as the parameter,
+the gateway address will be extracted from a DHCP
+negotiation with the OpenVPN server-side LAN.
+.\"*********************************************************
+.TP
+.B \-\-route-metric m
+Specify a default metric
+.B m
+for use with
+.B \-\-route.
+.\"*********************************************************
+.TP
+.B \-\-route-delay [n] [w]
+Delay
+.B n
+seconds (default=0) after connection
+establishment, before adding routes. If
+.B n
+is 0, routes will be added immediately upon connection
+establishment. If
+.B \-\-route-delay
+is omitted, routes will be added immediately after TUN/TAP device
+open and
+.B \-\-up
+script execution, before any
+.B \-\-user
+or
+.B \-\-group
+privilege downgrade (or
+.B \-\-chroot
+execution.)
+
+This option is designed to be useful in scenarios where DHCP is
+used to set
+tap adapter addresses. The delay will give the DHCP handshake
+time to complete before routes are added.
+
+On Windows,
+.B \-\-route-delay
+tries to be more intelligent by waiting
+.B w
+seconds (w=30 by default)
+for the TAP-Win32 adapter to come up before adding routes.
+.\"*********************************************************
+.TP
+.B \-\-route-up cmd
+Run command
+.B cmd
+after routes are added, subject to
+.B \-\-route-delay.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+See the "Environmental Variables" section below for
+additional parameters passed as environmental variables.
+.\"*********************************************************
+.TP
+.B \-\-route-pre-down cmd
+Run command
+.B cmd
+before routes are removed upon disconnection.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+See the "Environmental Variables" section below for
+additional parameters passed as environmental variables.
+.\"*********************************************************
+.TP
+.B \-\-route-noexec
+Don't add or remove routes automatically. Instead pass routes to
+.B \-\-route-up
+script using environmental variables.
+.\"*********************************************************
+.TP
+.B \-\-route-nopull
+When used with
+.B \-\-client
+or
+.B \-\-pull,
+accept options pushed by server EXCEPT for routes and dhcp options
+like DNS servers.
+
+When used on the client, this option effectively bars the
+server from adding routes to the client's routing table,
+however note that this option still allows the server
+to set the TCP/IP properties of the client's TUN/TAP interface.
+.\"*********************************************************
+.TP
+.B \-\-allow-pull-fqdn
+Allow client to pull DNS names from server (rather than being limited
+to IP address) for
+.B \-\-ifconfig,
+.B \-\-route,
+and
+.B \-\-route-gateway.
+.\"*********************************************************
+.TP
+.B \-\-client-nat snat|dnat network netmask alias
+This pushable client option sets up a stateless one-to-one NAT
+rule on packet addresses (not ports), and is useful in cases
+where routes or ifconfig settings pushed to the client would
+create an IP numbering conflict.
+
+.B network/netmask
+(for example 192.168.0.0/255.255.0.0)
+defines the local view of a resource from the client perspective, while
+.B alias/netmask
+(for example 10.64.0.0/255.255.0.0)
+defines the remote view from the server perspective.
+
+Use
+.B snat
+(source NAT) for resources owned by the client and
+.B dnat
+(destination NAT) for remote resources.
+
+Set
+.B \-\-verb 6
+for debugging info showing the transformation of src/dest
+addresses in packets.
+.\"*********************************************************
+.TP
+.B \-\-redirect-gateway flags...
+Automatically execute routing commands to cause all outgoing IP traffic
+to be redirected over the VPN. This is a client-side option.
+
+This option performs three steps:
+
+.B (1)
+Create a static route for the
+.B \-\-remote
+address which forwards to the pre-existing default gateway.
+This is done so that
+.B (3)
+will not create a routing loop.
+
+.B (2)
+Delete the default gateway route.
+
+.B (3)
+Set the new default gateway to be the VPN endpoint address (derived either from
+.B \-\-route-gateway
+or the second parameter to
+.B \-\-ifconfig
+when
+.B \-\-dev tun
+is specified).
+
+When the tunnel is torn down, all of the above steps are reversed so
+that the original default route is restored.
+
+Option flags:
+
+.B local \-\-
+Add the
+.B local
+flag if both OpenVPN servers are directly connected via a common subnet,
+such as with wireless. The
+.B local
+flag will cause step
+.B 1
+above to be omitted.
+
+.B autolocal \-\-
+Try to automatically determine whether to enable
+.B local
+flag above.
+
+.B def1 \-\-
+Use this flag to override
+the default gateway by using 0.0.0.0/1 and 128.0.0.0/1
+rather than 0.0.0.0/0. This has the benefit of overriding
+but not wiping out the original default gateway.
+
+.B bypass-dhcp \-\-
+Add a direct route to the DHCP server (if it is non-local) which
+bypasses the tunnel
+(Available on Windows clients, may not be available
+on non-Windows clients).
+
+.B bypass-dns \-\-
+Add a direct route to the DNS server(s) (if they are non-local) which
+bypasses the tunnel
+(Available on Windows clients, may not be available
+on non-Windows clients).
+
+.B block-local \-\-
+Block access to local LAN when the tunnel is active, except for
+the LAN gateway itself. This is accomplished by routing the local
+LAN (except for the LAN gateway address) into the tunnel.
+.\"*********************************************************
+.TP
+.B \-\-link-mtu n
+Sets an upper bound on the size of UDP packets which are sent
+between OpenVPN peers. It's best not to set this parameter unless
+you know what you're doing.
+.\"*********************************************************
+.\"*********************************************************
+.TP
+.B \-\-redirect-private [flags]
+Like \-\-redirect-gateway, but omit actually changing the default
+gateway. Useful when pushing private subnets.
+.\"*********************************************************
+.TP
+.B \-\-tun-mtu n
+Take the TUN device MTU to be
+.B n
+and derive the link MTU
+from it (default=1500). In most cases, you will probably want to
+leave this parameter set to its default value.
+
+The MTU (Maximum Transmission Units) is
+the maximum datagram size in bytes that can be sent unfragmented
+over a particular network path. OpenVPN requires that packets
+on the control or data channels be sent unfragmented.
+
+MTU problems often manifest themselves as connections which
+hang during periods of active usage.
+
+It's best to use the
+.B \-\-fragment
+and/or
+.B \-\-mssfix
+options to deal with MTU sizing issues.
+.\"*********************************************************
+.TP
+.B \-\-tun-mtu-extra n
+Assume that the TUN/TAP device might return as many as
+.B n
+bytes more than the
+.B \-\-tun-mtu
+size on read. This parameter defaults to 0, which is sufficient for
+most TUN devices. TAP devices may introduce additional overhead in excess
+of the MTU size, and a setting of 32 is the default when TAP devices are used.
+This parameter only controls internal OpenVPN buffer sizing,
+so there is no transmission overhead associated with using a larger value.
+.\"*********************************************************
+.TP
+.B \-\-mtu-disc type
+Should we do Path MTU discovery on TCP/UDP channel? Only supported on OSes such
+as Linux that supports the necessary system call to set.
+
+.B 'no'
+\-\- Never send DF (Don't Fragment) frames
+.br
+.B 'maybe'
+\-\- Use per-route hints
+.br
+.B 'yes'
+\-\- Always DF (Don't Fragment)
+.br
+.\"*********************************************************
+.TP
+.B \-\-mtu-test
+To empirically measure MTU on connection startup,
+add the
+.B \-\-mtu-test
+option to your configuration.
+OpenVPN will send ping packets of various sizes
+to the remote peer and measure the largest packets
+which were successfully received. The
+.B \-\-mtu-test
+process normally takes about 3 minutes to complete.
+.\"*********************************************************
+.TP
+.B \-\-fragment max
+Enable internal datagram fragmentation so
+that no UDP datagrams are sent which
+are larger than
+.B max
+bytes.
+
+The
+.B max
+parameter is interpreted in the same way as the
+.B \-\-link-mtu
+parameter, i.e. the UDP packet size after encapsulation
+overhead has been added in, but not including
+the UDP header itself.
+
+The
+.B \-\-fragment
+option only makes sense when you are using the UDP protocol (
+.B \-\-proto udp
+).
+
+.B \-\-fragment
+adds 4 bytes of overhead per datagram.
+
+See the
+.B \-\-mssfix
+option below for an important related option to
+.B \-\-fragment.
+
+It should also be noted that this option is not meant to replace
+UDP fragmentation at the IP stack level. It is only meant as a
+last resort when path MTU discovery is broken. Using this option
+is less efficient than fixing path MTU discovery for your IP link and
+using native IP fragmentation instead.
+
+Having said that, there are circumstances where using OpenVPN's
+internal fragmentation capability may be your only option, such
+as tunneling a UDP multicast stream which requires fragmentation.
+.\"*********************************************************
+.TP
+.B \-\-mssfix max
+Announce to TCP sessions running over the tunnel that they should limit
+their send packet sizes such that after OpenVPN has encapsulated them,
+the resulting UDP packet size that OpenVPN sends to its peer will not
+exceed
+.B max
+bytes. The default value is
+.B 1450.
+
+The
+.B max
+parameter is interpreted in the same way as the
+.B \-\-link-mtu
+parameter, i.e. the UDP packet size after encapsulation
+overhead has been added in, but not including
+the UDP header itself.
+
+The
+.B \-\-mssfix
+option only makes sense when you are using the UDP protocol
+for OpenVPN peer-to-peer communication, i.e.
+.B \-\-proto udp.
+
+.B \-\-mssfix
+and
+.B \-\-fragment
+can be ideally used together, where
+.B \-\-mssfix
+will try to keep TCP from needing
+packet fragmentation in the first place,
+and if big packets come through anyhow
+(from protocols other than TCP),
+.B \-\-fragment
+will internally fragment them.
+
+Both
+.B \-\-fragment
+and
+.B \-\-mssfix
+are designed to work around cases where Path MTU discovery
+is broken on the network path between OpenVPN peers.
+
+The usual symptom of such a breakdown is an OpenVPN
+connection which successfully starts, but then stalls
+during active usage.
+
+If
+.B \-\-fragment
+and
+.B \-\-mssfix
+are used together,
+.B \-\-mssfix
+will take its default
+.B max
+parameter from the
+.B \-\-fragment max
+option.
+
+Therefore, one could lower the maximum UDP packet size
+to 1300 (a good first try for solving MTU-related
+connection problems) with the following options:
+
+.B \-\-tun-mtu 1500 \-\-fragment 1300 \-\-mssfix
+.\"*********************************************************
+.TP
+.B \-\-sndbuf size
+Set the TCP/UDP socket send buffer size.
+Currently defaults to 65536 bytes.
+.\"*********************************************************
+.TP
+.B \-\-rcvbuf size
+Set the TCP/UDP socket receive buffer size.
+Currently defaults to 65536 bytes.
+.\"*********************************************************
+.TP
+.B \-\-mark value
+Mark encrypted packets being sent with value. The mark value can be
+matched in policy routing and packetfilter rules. This option is
+only supported in Linux and does nothing on other operating systems.
+.\"*********************************************************
+.TP
+.B \-\-socket-flags flags...
+Apply the given flags to the OpenVPN transport socket.
+Currently, only
+.B TCP_NODELAY
+is supported.
+
+The
+.B TCP_NODELAY
+socket flag is useful in TCP mode, and causes the kernel
+to send tunnel packets immediately over the TCP connection without
+trying to group several smaller packets into a larger packet.
+This can result in a considerably improvement in latency.
+
+This option is pushable from server to client, and should be used
+on both client and server for maximum effect.
+.\"*********************************************************
+.TP
+.B \-\-txqueuelen n
+(Linux only) Set the TX queue length on the TUN/TAP interface.
+Currently defaults to 100.
+.\"*********************************************************
+.TP
+.B \-\-shaper n
+Limit bandwidth of outgoing tunnel data to
+.B n
+bytes per second on the TCP/UDP port.
+If you want to limit the bandwidth
+in both directions, use this option on both peers.
+
+OpenVPN uses the following algorithm to implement
+traffic shaping: Given a shaper rate of
+.I n
+bytes per second, after a datagram write of
+.I b
+bytes is queued on the TCP/UDP port, wait a minimum of
+.I (b / n)
+seconds before queuing the next write.
+
+It should be noted that OpenVPN supports multiple
+tunnels between the same two peers, allowing you
+to construct full-speed and reduced bandwidth tunnels
+at the same time,
+routing low-priority data such as off-site backups
+over the reduced bandwidth tunnel, and other data
+over the full-speed tunnel.
+
+Also note that for low bandwidth tunnels
+(under 1000 bytes per second), you should probably
+use lower MTU values as well (see above), otherwise
+the packet latency will grow so large as to trigger
+timeouts in the TLS layer and TCP connections running
+over the tunnel.
+
+OpenVPN allows
+.B n
+to be between 100 bytes/sec and 100 Mbytes/sec.
+.\"*********************************************************
+.TP
+.B \-\-inactive n [bytes]
+Causes OpenVPN to exit after
+.B n
+seconds of inactivity on the TUN/TAP device. The time length of
+inactivity is measured since the last incoming or outgoing tunnel
+packet. The default value is 0 seconds, which disables this feature.
+
+If the optional
+.B bytes
+parameter is included,
+exit if less than
+.B bytes
+of combined in/out traffic are produced on the tun/tap device
+in
+.B n
+seconds.
+
+In any case, OpenVPN's internal ping packets (which are just
+keepalives) and TLS control packets are not considered
+"activity", nor are they counted as traffic, as they are used
+internally by OpenVPN and are not an indication of actual user
+activity.
+.\"*********************************************************
+.TP
+.B \-\-ping n
+Ping remote over the TCP/UDP control channel
+if no packets have been sent for at least
+.B n
+seconds (specify
+.B \-\-ping
+on both peers to cause ping packets to be sent in both directions since
+OpenVPN ping packets are not echoed like IP ping packets).
+When used in one of OpenVPN's secure modes (where
+.B \-\-secret, \-\-tls-server,
+or
+.B \-\-tls-client
+is specified), the ping packet
+will be cryptographically secure.
+
+This option has two intended uses:
+
+(1) Compatibility
+with stateful firewalls. The periodic ping will ensure that
+a stateful firewall rule which allows OpenVPN UDP packets to
+pass will not time out.
+
+(2) To provide a basis for the remote to test the existence
+of its peer using the
+.B \-\-ping-exit
+option.
+.\"*********************************************************
+.TP
+.B \-\-ping-exit n
+Causes OpenVPN to exit after
+.B n
+seconds pass without reception of a ping
+or other packet from remote.
+This option can be combined with
+.B \-\-inactive, \-\-ping,
+and
+.B \-\-ping-exit
+to create a two-tiered inactivity disconnect.
+
+For example,
+
+.B openvpn [options...] \-\-inactive 3600 \-\-ping 10 \-\-ping-exit 60
+
+when used on both peers will cause OpenVPN to exit within 60
+seconds if its peer disconnects, but will exit after one
+hour if no actual tunnel data is exchanged.
+.\"*********************************************************
+.TP
+.B \-\-ping-restart n
+Similar to
+.B \-\-ping-exit,
+but trigger a
+.B SIGUSR1
+restart after
+.B n
+seconds pass without reception of a ping
+or other packet from remote.
+
+This option is useful in cases
+where the remote peer has a dynamic IP address and
+a low-TTL DNS name is used to track the IP address using
+a service such as
+.I http://dyndns.org/
++ a dynamic DNS client such
+as
+.B ddclient.
+
+If the peer cannot be reached, a restart will be triggered, causing
+the hostname used with
+.B \-\-remote
+to be re-resolved (if
+.B \-\-resolv-retry
+is also specified).
+
+In server mode,
+.B \-\-ping-restart, \-\-inactive,
+or any other type of internally generated signal will always be
+applied to
+individual client instance objects, never to whole server itself.
+Note also in server mode that any internally generated signal
+which would normally cause a restart, will cause the deletion
+of the client instance object instead.
+
+In client mode, the
+.B \-\-ping-restart
+parameter is set to 120 seconds by default. This default will
+hold until the client pulls a replacement value from the server, based on
+the
+.B \-\-keepalive
+setting in the server configuration.
+To disable the 120 second default, set
+.B \-\-ping-restart 0
+on the client.
+
+See the signals section below for more information
+on
+.B SIGUSR1.
+
+Note that the behavior of
+.B SIGUSR1
+can be modified by the
+.B \-\-persist-tun, \-\-persist-key, \-\-persist-local-ip,
+and
+.B \-\-persist-remote-ip
+options.
+
+Also note that
+.B \-\-ping-exit
+and
+.B \-\-ping-restart
+are mutually exclusive and cannot be used together.
+.\"*********************************************************
+.TP
+.B \-\-keepalive n m
+A helper directive designed to simplify the expression of
+.B \-\-ping
+and
+.B \-\-ping-restart
+in server mode configurations.
+
+The server timeout is set twice the value of the second argument.
+This ensures that a timeout is detected on client side
+before the server side drops the connection.
+
+For example,
+.B \-\-keepalive 10 60
+expands as follows:
+
+.nf
+.ft 3
+.in +4
+ if mode server:
+ ping 10
+ ping-restart 120
+ push "ping 10"
+ push "ping-restart 60"
+ else
+ ping 10
+ ping-restart 60
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.TP
+.B \-\-ping-timer-rem
+Run the
+.B \-\-ping-exit
+/
+.B \-\-ping-restart
+timer only if we have a remote address. Use this option if you are
+starting the daemon in listen mode (i.e. without an explicit
+.B \-\-remote
+peer), and you don't want to start clocking timeouts until a remote
+peer connects.
+.\"*********************************************************
+.TP
+.B \-\-persist-tun
+Don't close and reopen TUN/TAP device or run up/down scripts
+across
+.B SIGUSR1
+or
+.B \-\-ping-restart
+restarts.
+
+.B SIGUSR1
+is a restart signal similar to
+.B SIGHUP,
+but which offers finer-grained control over
+reset options.
+.\"*********************************************************
+.TP
+.B \-\-persist-key
+Don't re-read key files across
+.B SIGUSR1
+or
+.B \-\-ping-restart.
+
+This option can be combined with
+.B \-\-user nobody
+to allow restarts triggered by the
+.B SIGUSR1
+signal.
+Normally if you drop root privileges in OpenVPN,
+the daemon cannot be restarted since it will now be unable to re-read protected
+key files.
+
+This option solves the problem by persisting keys across
+.B SIGUSR1
+resets, so they don't need to be re-read.
+.\"*********************************************************
+.TP
+.B \-\-persist-local-ip
+Preserve initially resolved local IP address and port number
+across
+.B SIGUSR1
+or
+.B \-\-ping-restart
+restarts.
+.\"*********************************************************
+.TP
+.B \-\-persist-remote-ip
+Preserve most recently authenticated remote IP address and port number
+across
+.B SIGUSR1
+or
+.B \-\-ping-restart
+restarts.
+.\"*********************************************************
+.TP
+.B \-\-mlock
+Disable paging by calling the POSIX mlockall function.
+Requires that OpenVPN be initially run as root (though
+OpenVPN can subsequently downgrade its UID using the
+.B \-\-user
+option).
+
+Using this option ensures that key material and tunnel
+data are never written to disk due to virtual
+memory paging operations which occur under most
+modern operating systems. It ensures that even if an
+attacker was able to crack the box running OpenVPN, he
+would not be able to scan the system swap file to
+recover previously used
+ephemeral keys, which are used for a period of time
+governed by the
+.B \-\-reneg
+options (see below), then are discarded.
+
+The downside
+of using
+.B \-\-mlock
+is that it will reduce the amount of physical
+memory available to other applications.
+.\"*********************************************************
+.TP
+.B \-\-up cmd
+Run command
+.B cmd
+after successful TUN/TAP device open
+(pre
+.B \-\-user
+UID change).
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+The up command is useful for specifying route
+commands which route IP traffic destined for
+private subnets which exist at the other
+end of the VPN connection into the tunnel.
+
+For
+.B \-\-dev tun
+execute as:
+
+.B cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]
+
+For
+.B \-\-dev tap
+execute as:
+
+.B cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]
+
+See the "Environmental Variables" section below for
+additional parameters passed as environmental variables.
+
+Note that if
+.B cmd
+includes arguments, all OpenVPN-generated arguments will be appended
+to them to build an argument list with which the executable will be
+called.
+
+Typically,
+.B cmd
+will run a script to add routes to the tunnel.
+
+Normally the up script is called after the TUN/TAP device is opened.
+In this context, the last command line parameter passed to the script
+will be
+.I init.
+If the
+.B \-\-up-restart
+option is also used, the up script will be called for restarts as
+well. A restart is considered to be a partial reinitialization
+of OpenVPN where the TUN/TAP instance is preserved (the
+.B \-\-persist-tun
+option will enable such preservation). A restart
+can be generated by a SIGUSR1 signal, a
+.B \-\-ping-restart
+timeout, or a connection reset when the TCP protocol is enabled
+with the
+.B \-\-proto
+option. If a restart occurs, and
+.B \-\-up-restart
+has been specified, the up script will be called with
+.I restart
+as the last parameter.
+
+The following standalone example shows how the
+.B \-\-up
+script can be called in both an initialization and restart context.
+(NOTE: for security reasons, don't run the following example unless UDP port
+9999 is blocked by your firewall. Also, the example will run indefinitely,
+so you should abort with control-c).
+
+.B openvpn \-\-dev tun \-\-port 9999 \-\-verb 4 \-\-ping-restart 10 \-\-up 'echo up' \-\-down 'echo down' \-\-persist-tun \-\-up-restart
+
+Note that OpenVPN also provides the
+.B \-\-ifconfig
+option to automatically ifconfig the TUN device,
+eliminating the need to define an
+.B \-\-up
+script, unless you also want to configure routes
+in the
+.B \-\-up
+script.
+
+If
+.B \-\-ifconfig
+is also specified, OpenVPN will pass the ifconfig local
+and remote endpoints on the command line to the
+.B \-\-up
+script so that they can be used to configure routes such as:
+
+.B route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
+.\"*********************************************************
+.TP
+.B \-\-up-delay
+Delay TUN/TAP open and possible
+.B \-\-up
+script execution
+until after TCP/UDP connection establishment with peer.
+
+In
+.B \-\-proto udp
+mode, this option normally requires the use of
+.B \-\-ping
+to allow connection initiation to be sensed in the absence
+of tunnel data, since UDP is a "connectionless" protocol.
+
+On Windows, this option will delay the TAP-Win32 media state
+transitioning to "connected" until connection establishment,
+i.e. the receipt of the first authenticated packet from the peer.
+.\"*********************************************************
+.TP
+.B \-\-down cmd
+Run command
+.B cmd
+after TUN/TAP device close
+(post
+.B \-\-user
+UID change and/or
+.B \-\-chroot
+).
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+Called with the same parameters and environmental
+variables as the
+.B \-\-up
+option above.
+
+Note that if you reduce privileges by using
+.B \-\-user
+and/or
+.B \-\-group,
+your
+.B \-\-down
+script will also run at reduced privilege.
+.\"*********************************************************
+.TP
+.B \-\-down-pre
+Call
+.B \-\-down
+cmd/script before, rather than after, TUN/TAP close.
+.\"*********************************************************
+.TP
+.B \-\-up-restart
+Enable the
+.B \-\-up
+and
+.B \-\-down
+scripts to be called for restarts as well as initial program start.
+This option is described more fully above in the
+.B \-\-up
+option documentation.
+.\"*********************************************************
+.TP
+.B \-\-setenv name value
+Set a custom environmental variable
+.B name=value
+to pass to script.
+.\"*********************************************************
+.TP
+.B \-\-setenv FORWARD_COMPATIBLE 1
+Relax config file syntax checking so that unknown directives
+will trigger a warning but not a fatal error,
+on the assumption that a given unknown directive might be valid
+in future OpenVPN versions.
+
+This option should be used with caution, as there are good security
+reasons for having OpenVPN fail if it detects problems in a
+config file. Having said that, there are valid reasons for wanting
+new software features to gracefully degrade when encountered by
+older software versions.
+
+It is also possible to tag a single directive so as not to trigger
+a fatal error if the directive isn't recognized. To do this,
+prepend the following before the directive:
+.B setenv opt
+
+Versions prior to OpenVPN 2.3.3 will always ignore options set with the
+.B setenv opt
+directive.
+
+See also
+.B \-\-ignore-unknown-option
+.\"*********************************************************
+.TP
+.B \-\-setenv-safe name value
+Set a custom environmental variable
+.B OPENVPN_name=value
+to pass to script.
+
+This directive is designed to be pushed by the server to clients,
+and the prepending of "OPENVPN_" to the environmental variable
+is a safety precaution to prevent a LD_PRELOAD style attack
+from a malicious or compromised server.
+.\"*********************************************************
+.TP
+.B \-\-ignore-unknown-option opt1 opt2 opt3 ... optN
+When one of options
+.B opt1 ... optN
+is encountered in the configuration file the configuration
+file parsing does not fail if this OpenVPN version does not
+support the option. Multiple
+.B \-\-ignore-unknown-option
+options can be given to support a larger number of options to ignore.
+
+This option should be used with caution, as there are good security
+reasons for having OpenVPN fail if it detects problems in a
+config file. Having said that, there are valid reasons for wanting
+new software features to gracefully degrade when encountered by
+older software versions.
+
+.B \-\-ignore-unknown-option
+is available since OpenVPN 2.3.3.
+.\"*********************************************************
+.TP
+.B \-\-script-security level
+This directive offers policy-level control over OpenVPN's usage of external programs
+and scripts. Lower
+.B level
+values are more restrictive, higher values are more permissive. Settings for
+.B level:
+
+.B 0 \-\-
+Strictly no calling of external programs.
+.br
+.B 1 \-\-
+(Default) Only call built-in executables such as ifconfig, ip, route, or netsh.
+.br
+.B 2 \-\-
+Allow calling of built-in executables and user-defined scripts.
+.br
+.B 3 \-\-
+Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
+
+OpenVPN releases before v2.3 also supported a
+.B method
+flag which indicated how OpenVPN should call external commands and scripts. This
+could be either
+.B execve
+or
+.B system.
+As of OpenVPN v2.3, this flag is no longer accepted. In most *nix environments the execve()
+approach has been used without any issues.
+
+To run scripts in Windows in earlier OpenVPN
+versions you needed to either add a full path to the script interpreter which can parse the
+script or use the
+.B system
+flag to run these scripts. As of OpenVPN v2.3 it is now a strict requirement to have
+full path to the script interpreter when running non-executables files.
+This is not needed for executable files, such as .exe, .com, .bat or .cmd files. For
+example, if you have a Visual Basic script, you must use this syntax now:
+
+.nf
+.ft 3
+.in +4
+\-\-up 'C:\\\\Windows\\\\System32\\\\wscript.exe C:\\\\Program\\ Files\\\\OpenVPN\\\\config\\\\my-up-script.vbs'
+.in -4
+.ft
+.fi
+
+Please note the single quote marks and the escaping of the backslashes (\\) and
+the space character.
+
+The reason the support for the
+.B system
+flag was removed is due to the security implications with shell expansions
+when executing scripts via the system() call.
+.\"*********************************************************
+.TP
+.B \-\-disable-occ
+Don't output a warning message if option inconsistencies are detected between
+peers. An example of an option inconsistency would be where one peer uses
+.B \-\-dev tun
+while the other peer uses
+.B \-\-dev tap.
+
+Use of this option is discouraged, but is provided as
+a temporary fix in situations where a recent version of OpenVPN must
+connect to an old version.
+.\"*********************************************************
+.TP
+.B \-\-user user
+Change the user ID of the OpenVPN process to
+.B user
+after initialization, dropping privileges in the process.
+This option is useful to protect the system
+in the event that some hostile party was able to gain control of
+an OpenVPN session. Though OpenVPN's security features make
+this unlikely, it is provided as a second line of defense.
+
+By setting
+.B user
+to
+.I nobody
+or somebody similarly unprivileged, the hostile party would be
+limited in what damage they could cause. Of course once
+you take away privileges, you cannot return them
+to an OpenVPN session. This means, for example, that if
+you want to reset an OpenVPN daemon with a
+.B SIGUSR1
+signal
+(for example in response
+to a DHCP reset), you should make use of one or more of the
+.B \-\-persist
+options to ensure that OpenVPN doesn't need to execute any privileged
+operations in order to restart (such as re-reading key files
+or running
+.BR ifconfig
+on the TUN device).
+.\"*********************************************************
+.TP
+.B \-\-group group
+Similar to the
+.B \-\-user
+option,
+this option changes the group ID of the OpenVPN process to
+.B group
+after initialization.
+.\"*********************************************************
+.TP
+.B \-\-cd dir
+Change directory to
+.B dir
+prior to reading any files such as
+configuration files, key files, scripts, etc.
+.B dir
+should be an absolute path, with a leading "/",
+and without any references
+to the current directory such as "." or "..".
+
+This option is useful when you are running
+OpenVPN in
+.B \-\-daemon
+mode, and you want to consolidate all of
+your OpenVPN control files in one location.
+.\"*********************************************************
+.TP
+.B \-\-chroot dir
+Chroot to
+.B dir
+after initialization.
+.B \-\-chroot
+essentially redefines
+.B dir
+as being the top
+level directory tree (/). OpenVPN will therefore
+be unable to access any files outside this tree.
+This can be desirable from a security standpoint.
+
+Since the chroot operation is delayed until after
+initialization, most OpenVPN options that reference
+files will operate in a pre-chroot context.
+
+In many cases, the
+.B dir
+parameter can point to an empty directory, however
+complications can result when scripts or restarts
+are executed after the chroot operation.
+
+Note: if OpenVPN is built using the PolarSSL SSL
+library,
+.B \-\-chroot
+will only work if a /dev/urandom device node is available
+inside the chroot directory
+.B dir.
+This is due to the way PolarSSL works (it wants to open
+/dev/urandom every time randomness is needed, not just once
+at startup) and nothing OpenVPN can influence.
+.\"*********************************************************
+.TP
+.B \-\-setcon context
+Apply SELinux
+.B context
+after initialization. This
+essentially provides the ability to restrict OpenVPN's
+rights to only network I/O operations, thanks to
+SELinux. This goes further than
+.B \-\-user
+and
+.B \-\-chroot
+in that those two, while being great security features,
+unfortunately do not protect against privilege escalation
+by exploitation of a vulnerable system call. You can of
+course combine all three, but please note that since
+setcon requires access to /proc you will have to provide
+it inside the chroot directory (e.g. with mount \-\-bind).
+
+Since the setcon operation is delayed until after
+initialization, OpenVPN can be restricted to just
+network-related system calls, whereas by applying the
+context before startup (such as the OpenVPN one provided
+in the SELinux Reference Policies) you will have to
+allow many things required only during initialization.
+
+Like with chroot, complications can result when scripts
+or restarts are executed after the setcon operation,
+which is why you should really consider using the
+.B \-\-persist-key
+and
+.B \-\-persist-tun
+options.
+.\"*********************************************************
+.TP
+.B \-\-daemon [progname]
+Become a daemon after all initialization functions are completed.
+This option will cause all message and error output to
+be sent to the syslog file (such as /var/log/messages),
+except for the output of scripts and
+ifconfig commands,
+which will go to /dev/null unless otherwise redirected.
+The syslog redirection occurs immediately at the point
+that
+.B \-\-daemon
+is parsed on the command line even though
+the daemonization point occurs later. If one of the
+.B \-\-log
+options is present, it will supercede syslog
+redirection.
+
+The optional
+.B progname
+parameter will cause OpenVPN to report its program name
+to the system logger as
+.B progname.
+This can be useful in linking OpenVPN messages
+in the syslog file with specific tunnels.
+When unspecified,
+.B progname
+defaults to "openvpn".
+
+When OpenVPN is run with the
+.B \-\-daemon
+option, it will try to delay daemonization until the majority of initialization
+functions which are capable of generating fatal errors are complete. This means
+that initialization scripts can test the return status of the
+openvpn command for a fairly reliable indication of whether the command
+has correctly initialized and entered the packet forwarding event loop.
+
+In OpenVPN, the vast majority of errors which occur after initialization are non-fatal.
+.\"*********************************************************
+.TP
+.B \-\-syslog [progname]
+Direct log output to system logger, but do not become a daemon.
+See
+.B \-\-daemon
+directive above for description of
+.B progname
+parameter.
+.TP
+.B \-\-errors-to-stderr
+Output errors to stderr instead of stdout unless log output is redirected by one of the
+.B \-\-log
+options.
+.\"*********************************************************
+.TP
+.B \-\-passtos
+Set the TOS field of the tunnel packet to what the payload's TOS is.
+.\"*********************************************************
+.TP
+.B \-\-inetd [wait|nowait] [progname]
+Use this option when OpenVPN is being run from the inetd or
+.BR xinetd(8)
+server.
+
+The
+.B wait/nowait
+option must match what is specified in the inetd/xinetd
+config file. The
+.B nowait
+mode can only be used with
+.B \-\-proto tcp-server.
+The default is
+.B wait.
+The
+.B nowait
+mode can be used to instantiate the OpenVPN daemon as a classic TCP server,
+where client connection requests are serviced on a single
+port number. For additional information on this kind of configuration,
+see the OpenVPN FAQ:
+.I http://openvpn.net/faq.html#oneport
+
+This option precludes the use of
+.B \-\-daemon, \-\-local,
+or
+.B \-\-remote.
+Note that this option causes message and error output to be handled in the same
+way as the
+.B \-\-daemon
+option. The optional
+.B progname
+parameter is also handled exactly as in
+.B \-\-daemon.
+
+Also note that in
+.B wait
+mode, each OpenVPN tunnel requires a separate TCP/UDP port and
+a separate inetd or xinetd entry. See the OpenVPN 1.x HOWTO for an example
+on using OpenVPN with xinetd:
+.I http://openvpn.net/1xhowto.html
+.\"*********************************************************
+.TP
+.B \-\-log file
+Output logging messages to
+.B file,
+including output to stdout/stderr which
+is generated by called scripts.
+If
+.B file
+already exists it will be truncated.
+This option takes effect
+immediately when it is parsed in the command line
+and will supercede syslog output if
+.B \-\-daemon
+or
+.B \-\-inetd
+is also specified.
+This option is persistent over the entire course of
+an OpenVPN instantiation and will not be reset by SIGHUP,
+SIGUSR1, or
+.B \-\-ping-restart.
+
+Note that on Windows, when OpenVPN is started as a service,
+logging occurs by default without the need to specify
+this option.
+.\"*********************************************************
+.TP
+.B \-\-log-append file
+Append logging messages to
+.B file.
+If
+.B file
+does not exist, it will be created.
+This option behaves exactly like
+.B \-\-log
+except that it appends to rather
+than truncating the log file.
+.\"*********************************************************
+.TP
+.B \-\-suppress-timestamps
+Avoid writing timestamps to log messages, even when they
+otherwise would be prepended. In particular, this applies to
+log messages sent to stdout.
+.\"*********************************************************
+.TP
+.B \-\-machine-readable-output
+Always write timestamps and message flags to log messages, even when they
+otherwise would not be prefixed. In particular, this applies to
+log messages sent to stdout.
+.\"*********************************************************
+.TP
+.B \-\-writepid file
+Write OpenVPN's main process ID to
+.B file.
+.\"*********************************************************
+.TP
+.B \-\-nice n
+Change process priority after initialization
+(
+.B n
+greater than 0 is lower priority,
+.B n
+less than zero is higher priority).
+.\"*********************************************************
+.\".TP
+.\".B \-\-nice-work n
+.\"Change priority of background TLS work thread. The TLS thread
+.\"feature is enabled when OpenVPN is built
+.\"with pthread support, and you are running OpenVPN
+.\"in TLS mode (i.e. with
+.\".B \-\-tls-client
+.\"or
+.\".B \-\-tls-server
+.\"specified).
+.\"
+.\"Using a TLS thread offloads the CPU-intensive process of SSL/TLS-based
+.\"key exchange to a background thread so that it does not become
+.\"a latency bottleneck in the tunnel packet forwarding process.
+.\"
+.\"The parameter
+.\".B n
+.\"is interpreted exactly as with the
+.\".B \-\-nice
+.\"option above, but in relation to the work thread rather
+.\"than the main thread.
+.\"*********************************************************
+.TP
+.B \-\-fast-io
+(Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding
+a call to poll/epoll/select prior to the write operation. The purpose
+of such a call would normally be to block until the device
+or socket is ready to accept the write. Such blocking is unnecessary
+on some platforms which don't support write blocking on UDP sockets
+or TUN/TAP devices. In such cases, one can optimize the event loop
+by avoiding the poll/epoll/select call, improving CPU efficiency
+by 5% to 10%.
+
+This option can only be used on non-Windows systems, when
+.B \-\-proto udp
+is specified, and when
+.B \-\-shaper
+is NOT specified.
+.\"*********************************************************
+.TP
+.B \-\-multihome
+Configure a multi-homed UDP server. This option needs to be used when
+a server has more than one IP address (e.g. multiple interfaces, or
+secondary IP addresses), and is not using
+.B \-\-local
+to force binding to one specific address only. This option will
+add some extra lookups to the packet path to ensure that the UDP reply
+packets are always sent from the address that the client is
+talking to. This is not supported on all platforms, and it adds more
+processing, so it's not enabled by default.
+
+Note: this option is only relevant for UDP servers.
+
+Note 2: if you do an IPv6+IPv4 dual-stack bind on a Linux machine with
+multiple IPv4 address, connections to IPv4 addresses will not work
+right on kernels before 3.15, due to missing kernel support for the
+IPv4-mapped case (some distributions have ported this to earlier kernel
+versions, though).
+.\"*********************************************************
+.TP
+.B \-\-echo [parms...]
+Echo
+.B parms
+to log output.
+
+Designed to be used to send messages to a controlling application
+which is receiving the OpenVPN log output.
+.\"*********************************************************
+.TP
+.B \-\-remap-usr1 signal
+Control whether internally or externally
+generated SIGUSR1 signals are remapped to
+SIGHUP (restart without persisting state) or
+SIGTERM (exit).
+
+.B signal
+can be set to "SIGHUP" or "SIGTERM". By default, no remapping
+occurs.
+.\"*********************************************************
+.TP
+.B \-\-verb n
+Set output verbosity to
+.B n
+(default=1). Each level shows all info from the previous levels.
+Level 3 is recommended if you want a good summary
+of what's happening without being swamped by output.
+
+.B 0 \-\-
+No output except fatal errors.
+.br
+.B 1 to 4 \-\-
+Normal usage range.
+.br
+.B 5 \-\-
+Output
+.B R
+and
+.B W
+characters to the console for each packet read and write, uppercase is
+used for TCP/UDP packets and lowercase is used for TUN/TAP packets.
+.br
+.B 6 to 11 \-\-
+Debug info range (see errlevel.h for additional
+information on debug levels).
+.\"*********************************************************
+.TP
+.B \-\-status file [n]
+Write operational status to
+.B file
+every
+.B n
+seconds.
+
+Status can also be written to the syslog by sending a
+.B SIGUSR2
+signal.
+.\"*********************************************************
+.TP
+.B \-\-status-version [n]
+Choose the status file format version number. Currently
+.B n
+can be 1, 2, or 3 and defaults to 1.
+.\"*********************************************************
+.TP
+.B \-\-mute n
+Log at most
+.B n
+consecutive messages in the same category. This is useful to
+limit repetitive logging of similar message types.
+.\"*********************************************************
+.TP
+.B \-\-compress [algorithm]
+Enable a compression algorithm.
+
+The
+.B algorithm
+parameter may be "snappy", "lzo", "lz4", or empty. Snappy, LZO and LZ4
+are different compression algorithms, with Snappy generally
+offering the best performance while LZ4 is faster with less CPU usage.
+For backwards compatibility with OpenVPN versions before 2.4, use "lzo"
+(which is identical to the older option "\-\-comp-lzo yes").
+
+If the
+.B algorithm
+parameter is empty, compression will be turned off, but the packet
+framing for compression will still be enabled, allowing a different
+setting to be pushed later.
+.\"*********************************************************
+.TP
+.B \-\-comp-lzo [mode]
+Use LZO compression \-\- may add up to 1 byte per
+packet for incompressible data.
+.B mode
+may be "yes", "no", or "adaptive" (default).
+
+This option is deprecated in favor of the newer
+.B --compress
+option.
+
+In a server mode setup, it is possible to selectively turn
+compression on or off for individual clients.
+
+First, make sure the client-side config file enables selective
+compression by having at least one
+.B \-\-comp-lzo
+directive, such as
+.B \-\-comp-lzo no.
+This will turn off compression by default,
+but allow a future directive push from the server to
+dynamically change the
+on/off/adaptive setting.
+
+Next in a
+.B \-\-client-config-dir
+file, specify the compression setting for the client,
+for example:
+
+.nf
+.ft 3
+.in +4
+comp-lzo yes
+push "comp-lzo yes"
+.in -4
+.ft
+.fi
+
+The first line sets the
+.B comp-lzo
+setting for the server
+side of the link, the second sets the client side.
+.\"*********************************************************
+.TP
+.B \-\-comp-noadapt
+When used in conjunction with
+.B \-\-comp-lzo,
+this option will disable OpenVPN's adaptive compression algorithm.
+Normally, adaptive compression is enabled with
+.B \-\-comp-lzo.
+
+Adaptive compression tries to optimize the case where you have
+compression enabled, but you are sending predominantly incompressible
+(or pre-compressed) packets over the tunnel, such as an FTP or rsync transfer
+of a large, compressed file. With adaptive compression,
+OpenVPN will periodically sample the compression process to measure its
+efficiency. If the data being sent over the tunnel is already compressed,
+the compression efficiency will be very low, triggering openvpn to disable
+compression for a period of time until the next re-sample test.
+.\"*********************************************************
+.TP
+.B \-\-management IP port [pw-file]
+Enable a TCP server on
+.B IP:port
+to handle daemon management functions.
+.B pw-file,
+if specified,
+is a password file (password on first line)
+or "stdin" to prompt from standard input. The password
+provided will set the password which TCP clients will need
+to provide in order to access management functions.
+
+The management interface can also listen on a unix domain socket,
+for those platforms that support it. To use a unix domain socket, specify
+the unix socket pathname in place of
+.B IP
+and set
+.B port
+to 'unix'. While the default behavior is to create a unix domain socket
+that may be connected to by any process, the
+.B \-\-management-client-user
+and
+.B \-\-management-client-group
+directives can be used to restrict access.
+
+The management interface provides a special mode where the TCP
+management link can operate over the tunnel itself. To enable this mode,
+set
+.B IP
+= "tunnel". Tunnel mode will cause the management interface
+to listen for a TCP connection on the local VPN address of the
+TUN/TAP interface.
+
+While the management port is designed for programmatic control
+of OpenVPN by other applications, it is possible to telnet
+to the port, using a telnet client in "raw" mode. Once connected,
+type "help" for a list of commands.
+
+For detailed documentation on the management interface, see
+the management-notes.txt file in the
+.B management
+folder of
+the OpenVPN source distribution.
+
+It is strongly recommended that
+.B IP
+be set to 127.0.0.1
+(localhost) to restrict accessibility of the management
+server to local clients.
+.TP
+.B \-\-management-client
+Management interface will connect as a TCP/unix domain client to
+.B IP:port
+specified by
+.B \-\-management
+rather than listen as a TCP server or on a unix domain socket.
+
+If the client connection fails to connect or is disconnected,
+a SIGTERM signal will be generated causing OpenVPN to quit.
+.\"*********************************************************
+.TP
+.B \-\-management-query-passwords
+Query management channel for private key password and
+.B \-\-auth-user-pass
+username/password. Only query the management channel
+for inputs which ordinarily would have been queried from the
+console.
+.\"*********************************************************
+.TP
+.B \-\-management-query-proxy
+Query management channel for proxy server information for a specific
+.B \-\-remote
+(client-only).
+.\"*********************************************************
+.TP
+.B \-\-management-query-remote
+Allow management interface to override
+.B \-\-remote
+directives (client-only).
+.\"*********************************************************
+.TP
+.B \-\-management-external-key
+Allows usage for external private key file instead of
+.B \-\-key
+option (client-only).
+.\"*********************************************************
+.TP
+.B \-\-management-forget-disconnect
+Make OpenVPN forget passwords when management session
+disconnects.
+
+This directive does not affect the
+.B \-\-http-proxy
+username/password. It is always cached.
+.\"*********************************************************
+.TP
+.B \-\-management-hold
+Start OpenVPN in a hibernating state, until a client
+of the management interface explicitly starts it
+with the
+.B hold release
+command.
+.\"*********************************************************
+.TP
+.B \-\-management-signal
+Send SIGUSR1 signal to OpenVPN if management session disconnects.
+This is useful when you wish to disconnect an OpenVPN session on
+user logoff. For --management-client this option is not needed since
+a disconnect will always generate a SIGTERM.
+.\"*********************************************************
+.TP
+.B \-\-management-log-cache n
+Cache the most recent
+.B n
+lines of log file history for usage
+by the management channel.
+.\"*********************************************************
+.TP
+.B \-\-management-up-down
+Report tunnel up/down events to management interface.
+.B
+.\"*********************************************************
+.TP
+.B \-\-management-client-auth
+Gives management interface client the responsibility
+to authenticate clients after their client certificate
+has been verified. See management-notes.txt in OpenVPN
+distribution for detailed notes.
+.\"*********************************************************
+.TP
+.B \-\-management-client-pf
+Management interface clients must specify a packet
+filter file for each connecting client. See management-notes.txt
+in OpenVPN distribution for detailed notes.
+.\"*********************************************************
+.TP
+.B \-\-management-client-user u
+When the management interface is listening on a unix domain socket,
+only allow connections from user
+.B u.
+.\"*********************************************************
+.TP
+.B \-\-management-client-group g
+When the management interface is listening on a unix domain socket,
+only allow connections from group
+.B g.
+.\"*********************************************************
+.TP
+.B \-\-plugin module-pathname [init-string]
+Load plug-in module from the file
+.B module-pathname,
+passing
+.B init-string
+as an argument
+to the module initialization function. Multiple
+plugin modules may be loaded into one OpenVPN
+process.
+
+For more information and examples on how to build OpenVPN
+plug-in modules, see the README file in the
+.B plugin
+folder of the OpenVPN source distribution.
+
+If you are using an RPM install of OpenVPN, see
+/usr/share/openvpn/plugin. The documentation is
+in
+.B doc
+and the actual plugin modules are in
+.B lib.
+
+Multiple plugin modules can be cascaded, and modules can be
+used in tandem with scripts. The modules will be called by
+OpenVPN in the order that they are declared in the config
+file. If both a plugin and script are configured for the same
+callback, the script will be called last. If the
+return code of the module/script controls an authentication
+function (such as tls-verify, auth-user-pass-verify, or
+client-connect), then
+every module and script must return success (0) in order for
+the connection to be authenticated.
+.\"*********************************************************
+.SS Server Mode
+Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode
+is supported, and can be enabled with the
+.B \-\-mode server
+option. In server mode, OpenVPN will listen on a single
+port for incoming client connections. All client
+connections will be routed through a single tun or tap
+interface. This mode is designed for scalability and should
+be able to support hundreds or even thousands of clients
+on sufficiently fast hardware. SSL/TLS authentication must
+be used in this mode.
+.\"*********************************************************
+.TP
+.B \-\-server network netmask ['nopool']
+A helper directive designed to simplify the configuration
+of OpenVPN's server mode. This directive will set up an
+OpenVPN server which will allocate addresses to clients
+out of the given network/netmask. The server itself
+will take the ".1" address of the given network
+for use as the server-side endpoint of the local
+TUN/TAP interface.
+
+For example,
+.B \-\-server 10.8.0.0 255.255.255.0
+expands as follows:
+
+.nf
+.ft 3
+.in +4
+ mode server
+ tls-server
+ push "topology [topology]"
+
+ if dev tun AND (topology == net30 OR topology == p2p):
+ ifconfig 10.8.0.1 10.8.0.2
+ if !nopool:
+ ifconfig-pool 10.8.0.4 10.8.0.251
+ route 10.8.0.0 255.255.255.0
+ if client-to-client:
+ push "route 10.8.0.0 255.255.255.0"
+ else if topology == net30:
+ push "route 10.8.0.1"
+
+ if dev tap OR (dev tun AND topology == subnet):
+ ifconfig 10.8.0.1 255.255.255.0
+ if !nopool:
+ ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
+ push "route-gateway 10.8.0.1"
+ if route-gateway unset:
+ route-gateway 10.8.0.2
+
+.in -4
+.ft
+.fi
+
+Don't use
+.B \-\-server
+if you are ethernet bridging. Use
+.B \-\-server-bridge
+instead.
+.\"*********************************************************
+.TP
+.B \-\-server-bridge gateway netmask pool-start-IP pool-end-IP
+.TP
+.B \-\-server-bridge ['nogw']
+
+A helper directive similar to
+.B \-\-server
+which is designed to simplify the configuration
+of OpenVPN's server mode in ethernet bridging configurations.
+
+If
+.B \-\-server-bridge
+is used without any parameters, it will enable a DHCP-proxy
+mode, where connecting OpenVPN clients will receive an IP
+address for their TAP adapter from the DHCP server running
+on the OpenVPN server-side LAN.
+Note that only clients that support
+the binding of a DHCP client with the TAP adapter (such as
+Windows) can support this mode. The optional
+.B nogw
+flag (advanced) indicates that gateway information should not be
+pushed to the client.
+
+To configure ethernet bridging, you
+must first use your OS's bridging capability
+to bridge the TAP interface with the ethernet
+NIC interface. For example, on Linux this is done
+with the
+.B brctl
+tool, and with Windows XP it is done in the Network
+Connections Panel by selecting the ethernet and
+TAP adapters and right-clicking on "Bridge Connections".
+
+Next you you must manually set the
+IP/netmask on the bridge interface. The
+.B gateway
+and
+.B netmask
+parameters to
+.B \-\-server-bridge
+can be set to either the IP/netmask of the
+bridge interface, or the IP/netmask of the
+default gateway/router on the bridged
+subnet.
+
+Finally, set aside a IP range in the bridged
+subnet,
+denoted by
+.B pool-start-IP
+and
+.B pool-end-IP,
+for OpenVPN to allocate to connecting
+clients.
+
+For example,
+.B server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 10.8.0.254
+expands as follows:
+
+.nf
+.ft 3
+.in +4
+mode server
+tls-server
+
+ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0
+push "route-gateway 10.8.0.4"
+.in -4
+.ft
+.fi
+
+In another example,
+.B \-\-server-bridge
+(without parameters) expands as follows:
+
+.nf
+.ft 3
+.in +4
+mode server
+tls-server
+
+push "route-gateway dhcp"
+.in -4
+.ft
+.fi
+
+Or
+.B \-\-server-bridge nogw
+expands as follows:
+
+.nf
+.ft 3
+.in +4
+mode server
+tls-server
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.TP
+.B \-\-push "option"
+Push a config file option back to the client for remote
+execution. Note that
+.B
+option
+must be enclosed in double quotes (""). The client must specify
+.B \-\-pull
+in its config file. The set of options which can be
+pushed is limited by both feasibility and security.
+Some options such as those which would execute scripts
+are banned, since they would effectively allow a compromised
+server to execute arbitrary code on the client.
+Other options such as TLS or MTU parameters
+cannot be pushed because the client needs to know
+them before the connection to the server can be initiated.
+
+This is a partial list of options which can currently be pushed:
+.B \-\-route, \-\-route-gateway, \-\-route-delay, \-\-redirect-gateway,
+.B \-\-ip-win32, \-\-dhcp-option,
+.B \-\-inactive, \-\-ping, \-\-ping-exit, \-\-ping-restart,
+.B \-\-setenv,
+.B \-\-persist-key, \-\-persist-tun, \-\-echo,
+.B \-\-comp-lzo,
+.B \-\-socket-flags,
+.B \-\-sndbuf, \-\-rcvbuf
+.\"*********************************************************
+.TP
+.B \-\-push-reset
+Don't inherit the global push list for a specific client instance.
+Specify this option in a client-specific context such
+as with a
+.B \-\-client-config-dir
+configuration file. This option will ignore
+.B \-\-push
+options at the global config file level.
+.TP
+.B \-\-push-peer-info
+Push additional information about the client to server. The additional information
+consists of the following data:
+
+IV_VER=<version> -- the client OpenVPN version
+
+IV_PLAT=[linux|solaris|openbsd|mac|netbsd|freebsd|win] -- the client OS platform
+
+IV_HWADDR=<mac address> -- the MAC address of clients default gateway
+
+IV_LZO_STUB=1 -- if client was built with LZO stub capability
+
+UV_<name>=<value> -- client environment variables whose names start with "UV_"
+.\"*********************************************************
+.TP
+.B \-\-disable
+Disable a particular client (based on the common name)
+from connecting. Don't use this option to disable a client
+due to key or password compromise. Use a CRL (certificate
+revocation list) instead (see the
+.B \-\-crl-verify
+option).
+
+This option must be associated with a specific client instance,
+which means that it must be specified either in a client
+instance config file using
+.B \-\-client-config-dir
+or dynamically generated using a
+.B \-\-client-connect
+script.
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-pool start-IP end-IP [netmask]
+Set aside a pool of subnets to be
+dynamically allocated to connecting clients, similar
+to a DHCP server. For tun-style
+tunnels, each client will be given a /30 subnet (for
+interoperability with Windows clients). For tap-style
+tunnels, individual addresses will be allocated, and the
+optional
+.B netmask
+parameter will also be pushed to clients.
+
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-pool-persist file [seconds]
+Persist/unpersist ifconfig-pool
+data to
+.B file,
+at
+.B seconds
+intervals (default=600), as well as on program startup and
+shutdown.
+
+The goal of this option is to provide a long-term association
+between clients (denoted by their common name) and the virtual
+IP address assigned to them from the ifconfig-pool.
+Maintaining a long-term
+association is good for clients because it allows them
+to effectively use the
+.B \-\-persist-tun
+option.
+
+.B file
+is a comma-delimited ASCII file, formatted as
+<Common-Name>,<IP-address>.
+
+If
+.B seconds
+= 0,
+.B file
+will be treated as read-only. This is useful if
+you would like to treat
+.B file
+as a configuration file.
+
+Note that the entries in this file are treated by OpenVPN as
+suggestions only, based on past associations between
+a common name and IP address. They do not guarantee that the given common
+name will always receive the given IP address. If you want guaranteed
+assignment, use
+.B \-\-ifconfig-push
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-pool-linear
+Modifies the
+.B \-\-ifconfig-pool
+directive to
+allocate individual TUN interface addresses for
+clients rather than /30 subnets. NOTE: This option
+is incompatible with Windows clients.
+
+This option is deprecated, and should be replaced with
+.B \-\-topology p2p
+which is functionally equivalent.
+.\"*********************************************************
+.TP
+.B \-\-ifconfig-push local remote-netmask [alias]
+Push virtual IP endpoints for client tunnel,
+overriding the \-\-ifconfig-pool dynamic allocation.
+
+The parameters
+.B local
+and
+.B remote-netmask
+are set according to the
+.B \-\-ifconfig
+directive which you want to execute on the client machine to
+configure the remote end of the tunnel. Note that the parameters
+.B local
+and
+.B remote-netmask
+are from the perspective of the client, not the server. They may be
+DNS names rather than IP addresses, in which case they will be resolved
+on the server at the time of client connection.
+
+The optional
+.B alias
+parameter may be used in cases where NAT causes the client view
+of its local endpoint to differ from the server view. In this case
+.B local/remote-netmask
+will refer to the server view while
+.B alias/remote-netmask
+will refer to the client view.
+
+This option must be associated with a specific client instance,
+which means that it must be specified either in a client
+instance config file using
+.B \-\-client-config-dir
+or dynamically generated using a
+.B \-\-client-connect
+script.
+
+Remember also to include a
+.B \-\-route
+directive in the main OpenVPN config file which encloses
+.B local,
+so that the kernel will know to route it
+to the server's TUN/TAP interface.
+
+OpenVPN's internal client IP address selection algorithm works as
+follows:
+
+.B 1
+\-\- Use
+.B \-\-client-connect script
+generated file for static IP (first choice).
+.br
+.B 2
+\-\- Use
+.B \-\-client-config-dir
+file for static IP (next choice).
+.br
+.B 3
+\-\- Use
+.B \-\-ifconfig-pool
+allocation for dynamic IP (last choice).
+.br
+.\"*********************************************************
+.TP
+.B \-\-iroute network [netmask]
+Generate an internal route to a specific
+client. The
+.B netmask
+parameter, if omitted, defaults to 255.255.255.255.
+
+This directive can be used to route a fixed subnet from
+the server to a particular client, regardless
+of where the client is connecting from. Remember
+that you must also add the route to the system
+routing table as well (such as by using the
+.B \-\-route
+directive). The reason why two routes are needed
+is that the
+.B \-\-route
+directive routes the packet from the kernel
+to OpenVPN. Once in OpenVPN, the
+.B \-\-iroute
+directive routes to the specific client.
+
+This option must be specified either in a client
+instance config file using
+.B \-\-client-config-dir
+or dynamically generated using a
+.B \-\-client-connect
+script.
+
+The
+.B \-\-iroute
+directive also has an important interaction with
+.B \-\-push
+"route ...".
+.B \-\-iroute
+essentially defines a subnet which is owned by a
+particular client (we will call this client A).
+If you would like other clients to be able to reach A's
+subnet, you can use
+.B \-\-push
+"route ..."
+together with
+.B \-\-client-to-client
+to effect this. In order for all clients to see
+A's subnet, OpenVPN must push this route to all clients
+EXCEPT for A, since the subnet is already owned by A.
+OpenVPN accomplishes this by not
+not pushing a route to a client
+if it matches one of the client's iroutes.
+.\"*********************************************************
+.TP
+.B \-\-client-to-client
+Because the OpenVPN server mode handles multiple clients
+through a single tun or tap interface, it is effectively
+a router. The
+.B \-\-client-to-client
+flag tells OpenVPN to internally route client-to-client
+traffic rather than pushing all client-originating traffic
+to the TUN/TAP interface.
+
+When this option is used, each client will "see" the other
+clients which are currently connected. Otherwise, each
+client will only see the server. Don't use this option
+if you want to firewall tunnel traffic using
+custom, per-client rules.
+.\"*********************************************************
+.TP
+.B \-\-duplicate-cn
+Allow multiple clients with the same common name to concurrently connect.
+In the absence of this option, OpenVPN will disconnect a client instance
+upon connection of a new client having the same common name.
+.\"*********************************************************
+.TP
+.B \-\-client-connect cmd
+Run
+.B command cmd
+on client connection.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+The command is passed the common name
+and IP address of the just-authenticated client
+as environmental variables (see environmental variable section
+below). The command is also passed
+the pathname of a freshly created temporary file as the last argument
+(after any arguments specified in
+.B cmd
+), to be used by the command
+to pass dynamically generated config file directives back to OpenVPN.
+
+If the script wants to generate a dynamic config file
+to be applied on the server when the client connects,
+it should write it to the file named by the last argument.
+
+See the
+.B \-\-client-config-dir
+option below for options which
+can be legally used in a dynamically generated config file.
+
+Note that the return value of
+.B script
+is significant. If
+.B script
+returns a non-zero error status, it will cause the client
+to be disconnected.
+.\"*********************************************************
+.TP
+.B \-\-client-disconnect cmd
+Like
+.B \-\-client-connect
+but called on client instance shutdown. Will not be called
+unless the
+.B \-\-client-connect
+script and plugins (if defined)
+were previously called on this instance with
+successful (0) status returns.
+
+The exception to this rule is if the
+.B \-\-client-disconnect
+command or plugins are cascaded, and at least one client-connect
+function succeeded, then ALL of the client-disconnect functions for
+scripts and plugins will be called on client instance object deletion,
+even in cases where some of the related client-connect functions returned
+an error status.
+
+The
+.B \-\-client-disconnect
+command is passed the same pathname as the corresponding
+.B \-\-client-connect
+command as its last argument. (after any arguments specified in
+.B cmd
+).
+.B
+.\"*********************************************************
+.TP
+.B \-\-client-config-dir dir
+Specify a directory
+.B dir
+for custom client config files. After
+a connecting client has been authenticated, OpenVPN will
+look in this directory for a file having the same name
+as the client's X509 common name. If a matching file
+exists, it will be opened and parsed for client-specific
+configuration options. If no matching file is found, OpenVPN
+will instead try to open and parse a default file called
+"DEFAULT", which may be provided but is not required. Note that
+the configuration files must be readable by the OpenVPN process
+after it has dropped it's root privileges.
+
+This file can specify a fixed IP address for a given
+client using
+.B \-\-ifconfig-push,
+as well as fixed subnets owned by the client using
+.B \-\-iroute.
+
+One of the useful properties of this option is that it
+allows client configuration files to be conveniently
+created, edited, or removed while the server is live,
+without needing to restart the server.
+
+The following
+options are legal in a client-specific context:
+.B \-\-push, \-\-push-reset, \-\-iroute, \-\-ifconfig-push,
+and
+.B \-\-config.
+.\"*********************************************************
+.TP
+.B \-\-ccd-exclusive
+Require, as a
+condition of authentication, that a connecting client has a
+.B \-\-client-config-dir
+file.
+.\"*********************************************************
+.TP
+.B \-\-tmp-dir dir
+Specify a directory
+.B dir
+for temporary files. This directory will be used by
+openvpn processes and script to communicate temporary
+data with openvpn main process. Note that
+the directory must be writable by the OpenVPN process
+after it has dropped it's root privileges.
+
+This directory will be used by in the following cases:
+
+*
+.B \-\-client-connect
+scripts to dynamically generate client-specific
+configuration files.
+
+*
+.B OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
+plugin hook to return success/failure via auth_control_file
+when using deferred auth method
+
+*
+.B OPENVPN_PLUGIN_ENABLE_PF
+plugin hook to pass filtering rules via pf_file
+.\"*********************************************************
+.TP
+.B \-\-hash-size r v
+Set the size of the real address hash table to
+.B r
+and the virtual address table to
+.B v.
+By default, both tables are sized at 256 buckets.
+.\"*********************************************************
+.TP
+.B \-\-bcast-buffers n
+Allocate
+.B n
+buffers for broadcast datagrams (default=256).
+.\"*********************************************************
+.TP
+.B \-\-tcp-queue-limit n
+Maximum number of output packets queued before TCP (default=64).
+
+When OpenVPN is tunneling data from a TUN/TAP device to a
+remote client over a TCP connection, it is possible that the TUN/TAP device
+might produce data at a faster rate than the TCP connection
+can support. When the number of output packets queued before sending to
+the TCP socket reaches this limit for a given client connection,
+OpenVPN will start to drop outgoing packets directed
+at this client.
+.\"*********************************************************
+.TP
+.B \-\-tcp-nodelay
+This macro sets the TCP_NODELAY socket flag on the server
+as well as pushes it to connecting clients. The TCP_NODELAY
+flag disables the Nagle algorithm on TCP sockets causing
+packets to be transmitted immediately with low latency,
+rather than waiting a short period of time in order
+to aggregate several packets into a larger containing
+packet. In VPN applications over TCP, TCP_NODELAY
+is generally a good latency optimization.
+
+The macro expands as follows:
+
+.nf
+.ft 3
+.in +4
+ if mode server:
+ socket-flags TCP_NODELAY
+ push "socket-flags TCP_NODELAY"
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.TP
+.B \-\-max-clients n
+Limit server to a maximum of
+.B n
+concurrent clients.
+.\"*********************************************************
+.TP
+.B \-\-max-routes-per-client n
+Allow a maximum of
+.B n
+internal routes per client (default=256).
+This is designed to
+help contain DoS attacks where an authenticated client floods the
+server with packets appearing to come from many unique MAC addresses,
+forcing the server to deplete
+virtual memory as its internal routing table expands.
+This directive can be used in a
+.B \-\-client-config-dir
+file or auto-generated by a
+.B \-\-client-connect
+script to override the global value for a particular client.
+
+Note that this
+directive affects OpenVPN's internal routing table, not the
+kernel routing table.
+.\"*********************************************************
+.TP
+.B \-\-stale-routes-check n [t]
+Remove routes haven't had activity for
+.B n
+seconds (i.e. the ageing time).
+
+This check is ran every
+.B t
+seconds (i.e. check interval).
+
+If
+.B t
+is not present it defaults to
+.B n
+
+This option helps to keep the dynamic routing table small.
+See also
+.B \-\-max-routes-per-client
+.\"*********************************************************
+.TP
+.B \-\-connect-freq n sec
+Allow a maximum of
+.B n
+new connections per
+.B sec
+seconds from clients. This is designed to contain DoS attacks which flood
+the server with connection requests using certificates which
+will ultimately fail to authenticate.
+
+This is an imperfect solution however, because in a real
+DoS scenario, legitimate connections might also be refused.
+
+For the best protection against DoS attacks in server mode,
+use
+.B \-\-proto udp
+and
+.B \-\-tls-auth.
+.\"*********************************************************
+.TP
+.B \-\-learn-address cmd
+Run command
+.B cmd
+to validate client virtual addresses or routes.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+Three arguments will be appended to any arguments in
+.B cmd
+as follows:
+
+.B [1] operation \-\-
+"add", "update", or "delete" based on whether or not
+the address is being added to, modified, or deleted from
+OpenVPN's internal routing table.
+.br
+.B [2] address \-\-
+The address being learned or unlearned. This can be
+an IPv4 address such as "198.162.10.14", an IPv4 subnet
+such as "198.162.10.0/24", or an ethernet MAC address (when
+.B \-\-dev tap
+is being used) such as "00:FF:01:02:03:04".
+.br
+.B [3] common name \-\-
+The common name on the certificate associated with the
+client linked to this address. Only present for "add"
+or "update" operations, not "delete".
+
+On "add" or "update" methods, if the script returns
+a failure code (non-zero), OpenVPN will reject the address
+and will not modify its internal routing table.
+
+Normally, the
+.B cmd
+script will use the information provided above to set
+appropriate firewall entries on the VPN TUN/TAP interface.
+Since OpenVPN provides the association between virtual IP
+or MAC address and the client's authenticated common name,
+it allows a user-defined script to configure firewall access
+policies with regard to the client's high-level common name,
+rather than the low level client virtual addresses.
+.\"*********************************************************
+.TP
+.B \-\-auth-user-pass-verify cmd method
+Require the client to provide a username/password (possibly
+in addition to a client certificate) for authentication.
+
+OpenVPN will run
+.B command cmd
+to validate the username/password
+provided by the client.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+If
+.B method
+is set to "via-env", OpenVPN will call
+.B script
+with the environmental variables
+.B username
+and
+.B password
+set to the username/password strings provided by the client.
+Be aware that this method is insecure on some platforms which
+make the environment of a process publicly visible to other
+unprivileged processes.
+
+If
+.B method
+is set to "via-file", OpenVPN will write the username and
+password to the first two lines of a temporary file. The filename
+will be passed as an argument to
+.B script,
+and the file will be automatically deleted by OpenVPN after
+the script returns. The location of the temporary file is
+controlled by the
+.B \-\-tmp-dir
+option, and will default to the current directory if unspecified.
+For security, consider setting
+.B \-\-tmp-dir
+to a volatile storage medium such as
+.B /dev/shm
+(if available) to prevent the username/password file from touching the hard drive.
+
+The script should examine the username
+and password,
+returning a success exit code (0) if the
+client's authentication request is to be accepted, or a failure
+code (1) to reject the client.
+
+This directive is designed to enable a plugin-style interface
+for extending OpenVPN's authentication capabilities.
+
+To protect against a client passing a maliciously formed
+username or password string, the username string must
+consist only of these characters: alphanumeric, underbar
+('_'), dash ('-'), dot ('.'), or at ('@'). The password
+string can consist of any printable characters except for
+CR or LF. Any illegal characters in either the username
+or password string will be converted to underbar ('_').
+
+Care must be taken by any user-defined scripts to avoid
+creating a security vulnerability in the way that these
+strings are handled. Never use these strings in such a way
+that they might be escaped or evaluated by a shell interpreter.
+
+For a sample script that performs PAM authentication, see
+.B sample-scripts/auth-pam.pl
+in the OpenVPN source distribution.
+.\"*********************************************************
+.TP
+.B \-\-opt-verify
+Clients that connect with options that are incompatible
+with those of the server will be disconnected.
+
+Options that will be compared for compatibility include
+dev-type, link-mtu, tun-mtu, proto, tun-ipv6, ifconfig,
+comp-lzo, fragment, keydir, cipher, auth, keysize, secret,
+no-replay, no-iv, tls-auth, key-method, tls-server, and tls-client.
+
+This option requires that
+.B \-\-disable-occ
+NOT be used.
+.\"*********************************************************
+.TP
+.B \-\-auth-user-pass-optional
+Allow connections by clients that do not specify a username/password.
+Normally, when
+.B \-\-auth-user-pass-verify
+or
+.B \-\-management-client-auth
+is specified (or an authentication plugin module), the
+OpenVPN server daemon will require connecting clients to specify a
+username and password. This option makes the submission of a username/password
+by clients optional, passing the responsibility to the user-defined authentication
+module/script to accept or deny the client based on other factors
+(such as the setting of X509 certificate fields). When this option is used,
+and a connecting client does not submit a username/password, the user-defined
+authentication module/script will see the username and password as being set
+to empty strings (""). The authentication module/script MUST have logic
+to detect this condition and respond accordingly.
+.\"*********************************************************
+.TP
+.B \-\-client-cert-not-required
+Don't require client certificate, client will authenticate
+using username/password only. Be aware that using this directive
+is less secure than requiring certificates from all clients.
+
+If you use this directive, the
+entire responsibility of authentication will rest on your
+.B \-\-auth-user-pass-verify
+script, so keep in mind that bugs in your script
+could potentially compromise the security of your VPN.
+
+If you don't use this directive, but you also specify an
+.B \-\-auth-user-pass-verify
+script, then OpenVPN will perform double authentication. The
+client certificate verification AND the
+.B \-\-auth-user-pass-verify
+script will need to succeed in order for a client to be
+authenticated and accepted onto the VPN.
+.\"*********************************************************
+.TP
+.B \-\-username-as-common-name
+For
+.B \-\-auth-user-pass-verify
+authentication, use
+the authenticated username as the common name,
+rather than the common name from the client cert.
+.\"*********************************************************
+.TP
+.B \-\-compat\-names [no\-remapping] (DEPRECATED)
+Until OpenVPN v2.3 the format of the X.509 Subject fields was formatted
+like this:
+.IP
+.B
+/C=US/L=Somewhere/CN=John Doe/emailAddress=john@example.com
+.IP
+In addition the old behaviour was to remap any character other than
+alphanumeric, underscore ('_'), dash ('-'), dot ('.'), and slash ('/') to
+underscore ('_'). The X.509 Subject string as returned by the
+.B tls_id
+environmental variable, could additionally contain colon (':') or equal ('=').
+.IP
+When using the
+.B \-\-compat\-names
+option, this old formatting and remapping will be re-enabled again. This is
+purely implemented for compatibility reasons when using older plug-ins or
+scripts which does not handle the new formatting or UTF-8 characters.
+.IP
+In OpenVPN v2.3 the formatting of these fields changed into a more
+standardised format. It now looks like:
+.IP
+.B
+C=US, L=Somewhere, CN=John Doe, emailAddress=john@example.com
+.IP
+The new default format in OpenVPN v2.3 also does not do the character remapping
+which happened earlier. This new format enables proper support for UTF\-8
+characters in the usernames, X.509 Subject fields and Common Name variables and
+it complies to the RFC 2253, UTF\-8 String Representation of Distinguished
+Names.
+
+The
+.B no\-remapping
+mode flag can be used with the
+.B
+\-\-compat\-names
+option to be compatible with the now deprecated \-\-no\-name\-remapping option.
+It is only available at the server. When this mode flag is used, the Common Name,
+Subject, and username strings are allowed to include any printable character
+including space, but excluding control characters such as tab, newline, and
+carriage-return. no-remapping is only available on the server side.
+
+.B Please note:
+This option is immediately deprecated. It is only implemented
+to make the transition to the new formatting less intrusive. It will be
+removed either in OpenVPN v2.4 or v2.5. So please make sure you use the
+.B \-\-verify-x509-name
+option instead of
+.B \-\-tls-remote
+as soon as possible and update your scripts where necessary.
+.\"*********************************************************
+.TP
+.B \-\-no\-name\-remapping (DEPRECATED)
+The
+.B \-\-no\-name\-remapping
+option is an alias for
+.B \-\-compat\-names\ no\-remapping.
+It ensures compatibility with server configurations using the
+.B \-\-no\-name\-remapping
+option.
+
+.B Please note:
+This option is now deprecated. It will be removed either in OpenVPN v2.4
+or v2.5. So please make sure you support the new X.509 name formatting
+described with the
+.B \-\-compat\-names
+option as soon as possible.
+.\"*********************************************************
+.TP
+.B \-\-port-share host port [dir]
+When run in TCP server mode, share the OpenVPN port with
+another application, such as an HTTPS server. If OpenVPN
+senses a connection to its port which is using a non-OpenVPN
+protocol, it will proxy the connection to the server at
+.B host:port.
+Currently only designed to work with HTTP/HTTPS,
+though it would be theoretically possible to extend to
+other protocols such as ssh.
+
+.B dir
+specifies an optional directory where a temporary file with name N
+containing content C will be dynamically generated for each proxy
+connection, where N is the source IP:port of the client connection
+and C is the source IP:port of the connection to the proxy
+receiver. This directory can be used as a dictionary by
+the proxy receiver to determine the origin of the connection.
+Each generated file will be automatically deleted when the proxied
+connection is torn down.
+
+Not implemented on Windows.
+.\"*********************************************************
+.SS Client Mode
+Use client mode when connecting to an OpenVPN server
+which has
+.B \-\-server, \-\-server-bridge,
+or
+.B \-\-mode server
+in it's configuration.
+.\"*********************************************************
+.TP
+.B \-\-client
+A helper directive designed to simplify the configuration
+of OpenVPN's client mode. This directive is equivalent to:
+
+.nf
+.ft 3
+.in +4
+ pull
+ tls-client
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.TP
+.B \-\-pull
+This option must be used on a client which is connecting
+to a multi-client server. It indicates to OpenVPN that it
+should accept options pushed by the server, provided they
+are part of the legal set of pushable options (note that the
+.B \-\-pull
+option is implied by
+.B \-\-client
+).
+
+In particular,
+.B \-\-pull
+allows the server to push routes to the client, so you should
+not use
+.B \-\-pull
+or
+.B \-\-client
+in situations where you don't trust the server to have control
+over the client's routing table.
+.\"*********************************************************
+.TP
+.B \-\-auth-user-pass [up]
+Authenticate with server using username/password.
+.B up
+is a file containing username/password on 2 lines (Note: OpenVPN
+will only read passwords from a file if it has been built
+with the \-\-enable-password-save configure option, or on Windows
+by defining ENABLE_PASSWORD_SAVE in win/settings.in).
+
+If
+.B up
+is omitted, username/password will be prompted from the
+console.
+
+The server configuration must specify an
+.B \-\-auth-user-pass-verify
+script to verify the username/password provided by
+the client.
+.\"*********************************************************
+.TP
+.B \-\-auth-retry type
+Controls how OpenVPN responds to username/password verification
+errors such as the client-side response to an AUTH_FAILED message from the server
+or verification failure of the private key password.
+
+Normally used to prevent auth errors from being fatal
+on the client side, and to permit username/password requeries in case
+of error.
+
+An AUTH_FAILED message is generated by the server if the client
+fails
+.B \-\-auth-user-pass
+authentication, or if the server-side
+.B \-\-client-connect
+script returns an error status when the client
+tries to connect.
+
+.B type
+can be one of:
+
+.B none \-\-
+Client will exit with a fatal error (this is the default).
+.br
+.B nointeract \-\-
+Client will retry the connection without requerying for an
+.B \-\-auth-user-pass
+username/password. Use this option for unattended clients.
+.br
+.B interact \-\-
+Client will requery for an
+.B \-\-auth-user-pass
+username/password and/or private key password before attempting a reconnection.
+
+Note that while this option cannot be pushed, it can be controlled
+from the management interface.
+.\"*********************************************************
+.TP
+.B \-\-static\-challenge t e
+Enable static challenge/response protocol using challenge text
+.B t,
+with
+echo flag given by
+.B e
+(0|1).
+
+The echo flag indicates whether or not the user's response
+to the challenge should be echoed.
+
+See management\-notes.txt in the OpenVPN distribution for a
+description of the OpenVPN challenge/response protocol.
+.\"*********************************************************
+.TP
+.B \-\-server-poll-timeout n
+when polling possible remote servers to connect to
+in a round-robin fashion, spend no more than
+.B n
+seconds waiting for a response before trying the next server.
+.\"*********************************************************
+.TP
+.B \-\-explicit-exit-notify [n]
+In UDP client mode or point-to-point mode, send server/peer an exit notification
+if tunnel is restarted or OpenVPN process is exited. In client mode, on
+exit/restart, this
+option will tell the server to immediately close its client instance object
+rather than waiting for a timeout. The
+.B n
+parameter (default=1) controls the maximum number of attempts that the client
+will try to resend the exit notification message. OpenVPN will not send any exit
+notifications unless this option is enabled.
+.\"*********************************************************
+.SS Data Channel Encryption Options:
+These options are meaningful for both Static & TLS-negotiated key modes
+(must be compatible between peers).
+.\"*********************************************************
+.TP
+.B \-\-secret file [direction]
+Enable Static Key encryption mode (non-TLS).
+Use pre-shared secret
+.B file
+which was generated with
+.B \-\-genkey.
+
+The optional
+.B direction
+parameter enables the use of 4 distinct keys
+(HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so that
+each data flow direction has a different set of HMAC and cipher keys.
+This has a number of desirable security properties including
+eliminating certain kinds of DoS and message replay attacks.
+
+When the
+.B direction
+parameter is omitted, 2 keys are used bidirectionally, one for HMAC
+and the other for encryption/decryption.
+
+The
+.B direction
+parameter should always be complementary on either side of the connection,
+i.e. one side should use "0" and the other should use "1", or both sides
+should omit it altogether.
+
+The
+.B direction
+parameter requires that
+.B file
+contains a 2048 bit key. While pre-1.5 versions of OpenVPN
+generate 1024 bit key files, any version of OpenVPN which
+supports the
+.B direction
+parameter, will also support 2048 bit key file generation
+using the
+.B \-\-genkey
+option.
+
+Static key encryption mode has certain advantages,
+the primary being ease of configuration.
+
+There are no certificates
+or certificate authorities or complicated negotiation handshakes and protocols.
+The only requirement is that you have a pre-existing secure channel with
+your peer (such as
+.B ssh
+) to initially copy the key. This requirement, along with the
+fact that your key never changes unless you manually generate a new one,
+makes it somewhat less secure than TLS mode (see below). If an attacker
+manages to steal your key, everything that was ever encrypted with
+it is compromised. Contrast that to the perfect forward secrecy features of
+TLS mode (using Diffie Hellman key exchange), where even if an attacker
+was able to steal your private key, he would gain no information to help
+him decrypt past sessions.
+
+Another advantageous aspect of Static Key encryption mode is that
+it is a handshake-free protocol
+without any distinguishing signature or feature
+(such as a header or protocol handshake sequence)
+that would mark the ciphertext packets as being
+generated by OpenVPN. Anyone eavesdropping on the wire
+would see nothing
+but random-looking data.
+.\"*********************************************************
+.TP
+.B \-\-key-direction
+Alternative way of specifying the optional direction parameter for the
+.B \-\-tls-auth
+and
+.B \-\-secret
+options. Useful when using inline files (See section on inline files).
+.\"*********************************************************
+.TP
+.B \-\-auth alg
+Authenticate packets with HMAC using message
+digest algorithm
+.B alg.
+(The default is
+.B SHA1
+).
+HMAC is a commonly used message authentication algorithm (MAC) that uses
+a data string, a secure hash algorithm, and a key, to produce
+a digital signature.
+
+OpenVPN's usage of HMAC is to first encrypt a packet, then HMAC the resulting ciphertext.
+
+In static-key encryption mode, the HMAC key
+is included in the key file generated by
+.B \-\-genkey.
+In TLS mode, the HMAC key is dynamically generated and shared
+between peers via the TLS control channel. If OpenVPN receives a packet with
+a bad HMAC it will drop the packet.
+HMAC usually adds 16 or 20 bytes per packet.
+Set
+.B alg=none
+to disable authentication.
+
+For more information on HMAC see
+.I http://www.cs.ucsd.edu/users/mihir/papers/hmac.html
+.\"*********************************************************
+.TP
+.B \-\-cipher alg
+Encrypt packets with cipher algorithm
+.B alg.
+The default is
+.B BF-CBC,
+an abbreviation for Blowfish in Cipher Block Chaining mode.
+Blowfish has the advantages of being fast, very secure, and allowing key sizes
+of up to 448 bits. Blowfish is designed to be used in situations where
+keys are changed infrequently.
+
+For more information on blowfish, see
+.I http://www.counterpane.com/blowfish.html
+
+To see other ciphers that are available with
+OpenVPN, use the
+.B \-\-show-ciphers
+option.
+
+OpenVPN supports the CBC, CFB, and OFB cipher modes,
+however CBC is recommended and CFB and OFB should
+be considered advanced modes.
+
+Set
+.B alg=none
+to disable encryption.
+.\"*********************************************************
+.TP
+.B \-\-keysize n
+Size of cipher key in bits (optional).
+If unspecified, defaults to cipher-specific default. The
+.B \-\-show-ciphers
+option (see below) shows all available OpenSSL ciphers,
+their default key sizes, and whether the key size can
+be changed. Use care in changing a cipher's default
+key size. Many ciphers have not been extensively
+cryptanalyzed with non-standard key lengths, and a
+larger key may offer no real guarantee of greater
+security, or may even reduce security.
+.\"*********************************************************
+.TP
+.B \-\-prng alg [nsl]
+(Advanced) For PRNG (Pseudo-random number generator),
+use digest algorithm
+.B alg
+(default=sha1), and set
+.B nsl
+(default=16)
+to the size in bytes of the nonce secret length (between 16 and 64).
+
+Set
+.B alg=none
+to disable the PRNG and use the OpenSSL RAND_bytes function
+instead for all of OpenVPN's pseudo-random number needs.
+.\"*********************************************************
+.TP
+.B \-\-engine [engine-name]
+Enable OpenSSL hardware-based crypto engine functionality.
+
+If
+.B engine-name
+is specified,
+use a specific crypto engine. Use the
+.B \-\-show-engines
+standalone option to list the crypto engines which are
+supported by OpenSSL.
+.\"*********************************************************
+.TP
+.B \-\-no-replay
+(Advanced) Disable OpenVPN's protection against replay attacks.
+Don't use this option unless you are prepared to make
+a tradeoff of greater efficiency in exchange for less
+security.
+
+OpenVPN provides datagram replay protection by default.
+
+Replay protection is accomplished
+by tagging each outgoing datagram with an identifier
+that is guaranteed to be unique for the key being used.
+The peer that receives the datagram will check for
+the uniqueness of the identifier. If the identifier
+was already received in a previous datagram, OpenVPN
+will drop the packet. Replay protection is important
+to defeat attacks such as a SYN flood attack, where
+the attacker listens in the wire, intercepts a TCP
+SYN packet (identifying it by the context in which
+it occurs in relation to other packets), then floods
+the receiving peer with copies of this packet.
+
+OpenVPN's replay protection is implemented in slightly
+different ways, depending on the key management mode
+you have selected.
+
+In Static Key mode
+or when using an CFB or OFB mode cipher, OpenVPN uses a
+64 bit unique identifier that combines a time stamp with
+an incrementing sequence number.
+
+When using TLS mode for key exchange and a CBC cipher
+mode, OpenVPN uses only a 32 bit sequence number without
+a time stamp, since OpenVPN can guarantee the uniqueness
+of this value for each key. As in IPSec, if the sequence number is
+close to wrapping back to zero, OpenVPN will trigger
+a new key exchange.
+
+To check for replays, OpenVPN uses
+the
+.I sliding window
+algorithm used
+by IPSec.
+.\"*********************************************************
+.TP
+.B \-\-replay-window n [t]
+Use a replay protection sliding-window of size
+.B n
+and a time window of
+.B t
+seconds.
+
+By default
+.B n
+is 64 (the IPSec default) and
+.B t
+is 15 seconds.
+
+This option is only relevant in UDP mode, i.e.
+when either
+.B \-\-proto udp
+is specifed, or no
+.B \-\-proto
+option is specified.
+
+When OpenVPN tunnels IP packets over UDP, there is the possibility that
+packets might be dropped or delivered out of order. Because OpenVPN, like IPSec,
+is emulating the physical network layer,
+it will accept an out-of-order packet sequence, and
+will deliver such packets in the same order they were received to
+the TCP/IP protocol stack, provided they satisfy several constraints.
+
+.B (a)
+The packet cannot be a replay (unless
+.B \-\-no-replay
+is specified, which disables replay protection altogether).
+
+.B (b)
+If a packet arrives out of order, it will only be accepted if the difference
+between its sequence number and the highest sequence number received
+so far is less than
+.B n.
+
+.B (c)
+If a packet arrives out of order, it will only be accepted if it arrives no later
+than
+.B t
+seconds after any packet containing a higher sequence number.
+
+If you are using a network link with a large pipeline (meaning that
+the product of bandwidth and latency is high), you may want to use
+a larger value for
+.B n.
+Satellite links in particular often require this.
+
+If you run OpenVPN at
+.B \-\-verb 4,
+you will see the message "Replay-window backtrack occurred [x]"
+every time the maximum sequence number backtrack seen thus far
+increases. This can be used to calibrate
+.B n.
+
+There is some controversy on the appropriate method of handling packet
+reordering at the security layer.
+
+Namely, to what extent should the
+security layer protect the encapsulated protocol from attacks which masquerade
+as the kinds of normal packet loss and reordering that occur over IP networks?
+
+The IPSec and OpenVPN approach is to allow packet reordering within a certain
+fixed sequence number window.
+
+OpenVPN adds to the IPSec model by limiting the window size in time as well as
+sequence space.
+
+OpenVPN also adds TCP transport as an option (not offered by IPSec) in which
+case OpenVPN can adopt a very strict attitude towards message deletion and
+reordering: Don't allow it. Since TCP guarantees reliability, any packet
+loss or reordering event can be assumed to be an attack.
+
+In this sense, it could be argued that TCP tunnel transport is preferred when
+tunneling non-IP or UDP application protocols which might be vulnerable to a
+message deletion or reordering attack which falls within the normal
+operational parameters of IP networks.
+
+So I would make the statement that one should never tunnel a non-IP protocol
+or UDP application protocol over UDP, if the protocol might be vulnerable to a
+message deletion or reordering attack that falls within the normal operating
+parameters of what is to be expected from the physical IP layer. The problem
+is easily fixed by simply using TCP as the VPN transport layer.
+.\"*********************************************************
+.TP
+.B \-\-mute-replay-warnings
+Silence the output of replay warnings, which are a common
+false alarm on WiFi networks. This option preserves
+the security of the replay protection code without
+the verbosity associated with warnings about duplicate
+packets.
+.\"*********************************************************
+.TP
+.B \-\-replay-persist file
+Persist replay-protection state across sessions using
+.B file
+to save and reload the state.
+
+This option will strengthen protection against replay attacks,
+especially when you are using OpenVPN in a dynamic context (such
+as with
+.B \-\-inetd)
+when OpenVPN sessions are frequently started and stopped.
+
+This option will keep a disk copy of the current replay protection
+state (i.e. the most recent packet timestamp and sequence number
+received from the remote peer), so that if an OpenVPN session
+is stopped and restarted, it will reject any replays of packets
+which were already received by the prior session.
+
+This option only makes sense when replay protection is enabled
+(the default) and you are using either
+.B \-\-secret
+(shared-secret key mode) or TLS mode with
+.B \-\-tls-auth.
+.\"*********************************************************
+.TP
+.B \-\-no-iv
+(Advanced) Disable OpenVPN's use of IV (cipher initialization vector).
+Don't use this option unless you are prepared to make
+a tradeoff of greater efficiency in exchange for less
+security.
+
+OpenVPN uses an IV by default, and requires it for CFB and
+OFB cipher modes (which are totally insecure without it).
+Using an IV is important for security when multiple
+messages are being encrypted/decrypted with the same key.
+
+IV is implemented differently depending on the cipher mode used.
+
+In CBC mode, OpenVPN uses a pseudo-random IV for each packet.
+
+In CFB/OFB mode, OpenVPN uses a unique sequence number and time stamp
+as the IV. In fact, in CFB/OFB mode, OpenVPN uses a datagram
+space-saving optimization that uses the unique identifier for
+datagram replay protection as the IV.
+.\"*********************************************************
+.TP
+.B \-\-use-prediction-resistance
+Enable prediction resistance on PolarSSL's RNG.
+
+Enabling prediction resistance causes the RNG to reseed in each
+call for random. Reseeding this often can quickly deplete the kernel
+entropy pool.
+
+If you need this option, please consider running a daemon that adds
+entropy to the kernel pool.
+
+Note that this option only works with PolarSSL versions greater
+than 1.1.
+.\"*********************************************************
+.TP
+.B \-\-test-crypto
+Do a self-test of OpenVPN's crypto options by encrypting and
+decrypting test packets using the data channel encryption options
+specified above. This option does not require a peer to function,
+and therefore can be specified without
+.B \-\-dev
+or
+.B \-\-remote.
+
+The typical usage of
+.B \-\-test-crypto
+would be something like this:
+
+.B openvpn \-\-test-crypto \-\-secret key
+
+or
+
+.B openvpn \-\-test-crypto \-\-secret key \-\-verb 9
+
+This option is very useful to test OpenVPN after it has been ported to
+a new platform, or to isolate problems in the compiler, OpenSSL
+crypto library, or OpenVPN's crypto code. Since it is a self-test mode,
+problems with encryption and authentication can be debugged independently
+of network and tunnel issues.
+.\"*********************************************************
+.SS TLS Mode Options:
+TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility.
+TLS mode works by establishing control and
+data channels which are multiplexed over a single TCP/UDP port. OpenVPN initiates
+a TLS session over the control channel and uses it to exchange cipher
+and HMAC keys to protect the data channel. TLS mode uses a robust reliability
+layer over the UDP connection for all control channel communication, while
+the data channel, over which encrypted tunnel data passes, is forwarded without
+any mediation. The result is the best of both worlds: a fast data channel
+that forwards over UDP with only the overhead of encrypt,
+decrypt, and HMAC functions,
+and a control channel that provides all of the security features of TLS,
+including certificate-based authentication and Diffie Hellman forward secrecy.
+
+To use TLS mode, each peer that runs OpenVPN should have its own local
+certificate/key pair (
+.B \-\-cert
+and
+.B \-\-key
+), signed by the root certificate which is specified
+in
+.B \-\-ca.
+
+When two OpenVPN peers connect, each presents its local certificate to the
+other. Each peer will then check that its partner peer presented a
+certificate which was signed by the master root certificate as specified in
+.B \-\-ca.
+
+If that check on both peers succeeds, then the TLS negotiation
+will succeed, both OpenVPN
+peers will exchange temporary session keys, and the tunnel will begin
+passing data.
+
+The OpenVPN distribution contains a set of scripts for
+managing RSA certificates & keys,
+located in the
+.I easy-rsa
+subdirectory.
+
+The easy-rsa package is also rendered in web form here:
+.I http://openvpn.net/easyrsa.html
+.\"*********************************************************
+.TP
+.B \-\-tls-server
+Enable TLS and assume server role during TLS handshake. Note that
+OpenVPN is designed as a peer-to-peer application. The designation
+of client or server is only for the purpose of negotiating the TLS
+control channel.
+.\"*********************************************************
+.TP
+.B \-\-tls-client
+Enable TLS and assume client role during TLS handshake.
+.\"*********************************************************
+.TP
+.B \-\-ca file
+Certificate authority (CA) file in .pem format, also referred to as the
+.I root
+certificate. This file can have multiple
+certificates in .pem format, concatenated together. You can construct your own
+certificate authority certificate and private key by using a command such as:
+
+.B openssl req -nodes -new -x509 -keyout ca.key -out ca.crt
+
+Then edit your openssl.cnf file and edit the
+.B certificate
+variable to point to your new root certificate
+.B ca.crt.
+
+For testing purposes only, the OpenVPN distribution includes a sample
+CA certificate (ca.crt).
+Of course you should never use
+the test certificates and test keys distributed with OpenVPN in a
+production environment, since by virtue of the fact that
+they are distributed with OpenVPN, they are totally insecure.
+.\"*********************************************************
+.TP
+.B \-\-capath dir
+Directory containing trusted certificates (CAs and CRLs).
+Available with OpenSSL version >= 0.9.7 dev.
+Not available with PolarSSL.
+.\"*********************************************************
+.TP
+.B \-\-dh file
+File containing Diffie Hellman parameters
+in .pem format (required for
+.B \-\-tls-server
+only). Use
+
+.B openssl dhparam -out dh1024.pem 1024
+
+to generate your own, or use the existing dh1024.pem file
+included with the OpenVPN distribution. Diffie Hellman parameters
+may be considered public.
+.\"*********************************************************
+.TP
+.B \-\-ecdh-curve name
+Specify the curve to use for elliptic curve Diffie Hellman. Available
+curves can be listed with
+.B \-\-show-curves
+. The specified curve will only be used for ECDH TLS-ciphers.
+.\"*********************************************************
+.TP
+.B \-\-cert file
+Local peer's signed certificate in .pem format \-\- must be signed
+by a certificate authority whose certificate is in
+.B \-\-ca file.
+Each peer in an OpenVPN link running in TLS mode should have its own
+certificate and private key file. In addition, each certificate should
+have been signed by the key of a certificate
+authority whose public key resides in the
+.B \-\-ca
+certificate authority file.
+You can easily make your own certificate authority (see above) or pay money
+to use a commercial service such as thawte.com (in which case you will be
+helping to finance the world's second space tourist :).
+To generate a certificate,
+you can use a command such as:
+
+.B openssl req -nodes -new -keyout mycert.key -out mycert.csr
+
+If your certificate authority private key lives on another machine, copy
+the certificate signing request (mycert.csr) to this other machine (this can
+be done over an insecure channel such as email). Now sign the certificate
+with a command such as:
+
+.B openssl ca -out mycert.crt -in mycert.csr
+
+Now copy the certificate (mycert.crt)
+back to the peer which initially generated the .csr file (this
+can be over a public medium).
+Note that the
+.B openssl ca
+command reads the location of the certificate authority key from its
+configuration file such as
+.B /usr/share/ssl/openssl.cnf
+\-\- note also
+that for certificate authority functions, you must set up the files
+.B index.txt
+(may be empty) and
+.B serial
+(initialize to
+.B
+01
+).
+.\"*********************************************************
+.TP
+.B \-\-extra-certs file
+Specify a
+.B file
+containing one or more PEM certs (concatenated together)
+that complete the
+local certificate chain.
+
+This option is useful for "split" CAs, where the CA for server
+certs is different than the CA for client certs. Putting certs
+in this file allows them to be used to complete the local
+certificate chain without trusting them to verify the peer-submitted
+certificate, as would be the case if the certs were placed in the
+.B ca
+file.
+.\"*********************************************************
+.TP
+.B \-\-key file
+Local peer's private key in .pem format. Use the private key which was generated
+when you built your peer's certificate (see
+.B -cert file
+above).
+.\"*********************************************************
+.TP
+.B \-\-tls-version-min version ['or-highest']
+Sets the minimum
+TLS version we will accept from the peer (default is "1.0").
+Examples for version
+include "1.0", "1.1", or "1.2". If 'or-highest' is specified
+and version is not recognized, we will only accept the highest TLS
+version supported by the local SSL implementation.
+.\"*********************************************************
+.TP
+.B \-\-pkcs12 file
+Specify a PKCS #12 file containing local private key,
+local certificate, and root CA certificate.
+This option can be used instead of
+.B \-\-ca, \-\-cert,
+and
+.B \-\-key.
+Not available with PolarSSL.
+.\"*********************************************************
+.TP
+.B \-\-verify-hash hash
+Specify SHA1 fingerprint for level-1 cert. The level-1 cert is the
+CA (or intermediate cert) that signs the leaf certificate, and is
+one removed from the leaf certificate in the direction of the root.
+When accepting a connection from a peer, the level-1 cert
+fingerprint must match
+.B hash
+or certificate verification will fail. Hash is specified
+as XX:XX:... For example: AD:B0:95:D8:09:C8:36:45:12:A9:89:C8:90:09:CB:13:72:A6:AD:16
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-cert-private [0|1]...
+Set if access to certificate object should be performed after login.
+Every provider has its own setting.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-id name
+Specify the serialized certificate id to be used. The id can be gotten
+by the standalone
+.B \-\-show-pkcs11-ids
+option.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-id-management
+Acquire PKCS#11 id from management interface. In this case a NEED-STR 'pkcs11-id-request'
+real-time message will be triggered, application may use pkcs11-id-count command to
+retrieve available number of certificates, and pkcs11-id-get command to retrieve certificate
+id and certificate body.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-pin-cache seconds
+Specify how many seconds the PIN can be cached, the default is until the token is removed.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-protected-authentication [0|1]...
+Use PKCS#11 protected authentication path, useful for biometric and external
+keypad devices.
+Every provider has its own setting.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-providers provider...
+Specify a RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) providers
+to load.
+This option can be used instead of
+.B \-\-cert, \-\-key,
+and
+.B \-\-pkcs12.
+.\"*********************************************************
+.TP
+.B \-\-pkcs11-private-mode mode...
+Specify which method to use in order to perform private key operations.
+A different mode can be specified for each provider.
+Mode is encoded as hex number, and can be a mask one of the following:
+
+.B 0
+(default) \-\- Try to determine automatically.
+.br
+.B 1
+\-\- Use sign.
+.br
+.B 2
+\-\- Use sign recover.
+.br
+.B 4
+\-\- Use decrypt.
+.br
+.B 8
+\-\- Use unwrap.
+.br
+.\"*********************************************************
+.TP
+.B \-\-cryptoapicert select-string
+Load the certificate and private key from the
+Windows Certificate System Store (Windows/OpenSSL Only).
+
+Use this option instead of
+.B \-\-cert
+and
+.B \-\-key.
+
+This makes
+it possible to use any smart card, supported by Windows, but also any
+kind of certificate, residing in the Cert Store, where you have access to
+the private key. This option has been tested with a couple of different
+smart cards (GemSAFE, Cryptoflex, and Swedish Post Office eID) on the
+client side, and also an imported PKCS12 software certificate on the
+server side.
+
+To select a certificate, based on a substring search in the
+certificate's subject:
+
+.B cryptoapicert
+"SUBJ:Peter Runestig"
+
+To select a certificate, based on certificate's thumbprint:
+
+.B cryptoapicert
+"THUMB:f6 49 24 41 01 b4 ..."
+
+The thumbprint hex string can easily be copy-and-pasted from the Windows
+Certificate Store GUI.
+
+.\"*********************************************************
+.TP
+.B \-\-key-method m
+Use data channel key negotiation method
+.B m.
+The key method must match on both sides of the connection.
+
+After OpenVPN negotiates a TLS session, a new set of keys
+for protecting the tunnel data channel is generated and
+exchanged over the TLS session.
+
+In method 1 (the default for OpenVPN 1.x), both sides generate
+random encrypt and HMAC-send keys which are forwarded to
+the other host over the TLS channel.
+
+In method 2, (the default for OpenVPN 2.0)
+the client generates a random key. Both client
+and server also generate some random seed material. All key source
+material is exchanged over the TLS channel. The actual
+keys are generated using the TLS PRF function, taking source
+entropy from both client and server. Method 2 is designed to
+closely parallel the key generation process used by TLS 1.0.
+
+Note that in TLS mode, two separate levels
+of keying occur:
+
+(1) The TLS connection is initially negotiated, with both sides
+of the connection producing certificates and verifying the certificate
+(or other authentication info provided) of
+the other side. The
+.B \-\-key-method
+parameter has no effect on this process.
+
+(2) After the TLS connection is established, the tunnel session keys are
+separately negotiated over the existing secure TLS channel. Here,
+.B \-\-key-method
+determines the derivation of the tunnel session keys.
+.\"*********************************************************
+.TP
+.B \-\-tls-cipher l
+A list
+.B l
+of allowable TLS ciphers delimited by a colon (":").
+If you require a high level of security,
+you may want to set this parameter manually, to prevent a
+version rollback attack where a man-in-the-middle attacker tries
+to force two peers to negotiate to the lowest level
+of security they both support.
+Use
+.B \-\-show-tls
+to see a list of supported TLS ciphers.
+.\"*********************************************************
+.TP
+.B \-\-tls-timeout n
+Packet retransmit timeout on TLS control channel
+if no acknowledgment from remote within
+.B n
+seconds (default=2). When OpenVPN sends a control
+packet to its peer, it will expect to receive an
+acknowledgement within
+.B n
+seconds or it will retransmit the packet, subject
+to a TCP-like exponential backoff algorithm. This parameter
+only applies to control channel packets. Data channel
+packets (which carry encrypted tunnel data) are never
+acknowledged, sequenced, or retransmitted by OpenVPN because
+the higher level network protocols running on top of the tunnel
+such as TCP expect this role to be left to them.
+.\"*********************************************************
+.TP
+.B \-\-reneg-bytes n
+Renegotiate data channel key after
+.B n
+bytes sent or received (disabled by default).
+OpenVPN allows the lifetime of a key
+to be expressed as a number of bytes encrypted/decrypted, a number of packets, or
+a number of seconds. A key renegotiation will be forced
+if any of these three criteria are met by either peer.
+.\"*********************************************************
+.TP
+.B \-\-reneg-pkts n
+Renegotiate data channel key after
+.B n
+packets sent and received (disabled by default).
+.\"*********************************************************
+.TP
+.B \-\-reneg-sec n
+Renegotiate data channel key after
+.B n
+seconds (default=3600).
+
+When using dual-factor authentication, note that this default value may
+cause the end user to be challenged to reauthorize once per hour.
+
+Also, keep in mind that this option can be used on both the client and server,
+and whichever uses the lower value will be the one to trigger the renegotiation.
+A common mistake is to set
+.B \-\-reneg-sec
+to a higher value on either the client or server, while the other side of the connection
+is still using the default value of 3600 seconds, meaning that the renegotiation will
+still occur once per 3600 seconds. The solution is to increase \-\-reneg-sec on both the
+client and server, or set it to 0 on one side of the connection (to disable), and to
+your chosen value on the other side.
+.\"*********************************************************
+.TP
+.B \-\-hand-window n
+Handshake Window \-\- the TLS-based key exchange must finalize within
+.B n
+seconds
+of handshake initiation by any peer (default = 60 seconds).
+If the handshake fails
+we will attempt to reset our connection with our peer and try again.
+Even in the event of handshake failure we will still use
+our expiring key for up to
+.B \-\-tran-window
+seconds to maintain continuity of transmission of tunnel
+data.
+.\"*********************************************************
+.TP
+.B \-\-tran-window n
+Transition window \-\- our old key can live this many seconds
+after a new a key renegotiation begins (default = 3600 seconds).
+This feature allows for a graceful transition from old to new
+key, and removes the key renegotiation sequence from the critical
+path of tunnel data forwarding.
+.\"*********************************************************
+.TP
+.B \-\-single-session
+After initially connecting to a remote peer, disallow any new connections.
+Using this
+option means that a remote peer cannot connect, disconnect, and then
+reconnect.
+
+If the daemon is reset by a signal or
+.B \-\-ping-restart,
+it will allow one new connection.
+
+.B \-\-single-session
+can be used with
+.B \-\-ping-exit
+or
+.B \-\-inactive
+to create a single dynamic session that will exit when finished.
+.\"*********************************************************
+.TP
+.B \-\-tls-exit
+Exit on TLS negotiation failure.
+.\"*********************************************************
+.TP
+.B \-\-tls-auth file [direction]
+Add an additional layer of HMAC authentication on top of the TLS
+control channel to protect against DoS attacks.
+
+In a nutshell,
+.B \-\-tls-auth
+enables a kind of "HMAC firewall" on OpenVPN's TCP/UDP port,
+where TLS control channel packets
+bearing an incorrect HMAC signature can be dropped immediately without
+response.
+
+.B file
+(required) is a key file which can be in one of two formats:
+
+.B (1)
+An OpenVPN static key file generated by
+.B \-\-genkey
+(required if
+.B direction
+parameter is used).
+
+.B (2)
+A freeform passphrase file. In this case the HMAC key will
+be derived by taking a secure hash of this file, similar to
+the
+.BR md5sum (1)
+or
+.BR sha1sum (1)
+commands.
+
+OpenVPN will first try format (1), and if the file fails to parse as
+a static key file, format (2) will be used.
+
+See the
+.B \-\-secret
+option for more information on the optional
+.B direction
+parameter.
+
+.B \-\-tls-auth
+is recommended when you are running OpenVPN in a mode where
+it is listening for packets from any IP address, such as when
+.B \-\-remote
+is not specified, or
+.B \-\-remote
+is specified with
+.B \-\-float.
+
+The rationale for
+this feature is as follows. TLS requires a multi-packet exchange
+before it is able to authenticate a peer. During this time
+before authentication, OpenVPN is allocating resources (memory
+and CPU) to this potential peer. The potential peer is also
+exposing many parts of OpenVPN and the OpenSSL library to the packets
+it is sending. Most successful network attacks today seek
+to either exploit bugs in programs (such as buffer overflow attacks) or
+force a program to consume so many resources that it becomes unusable.
+Of course the first line of defense is always to produce clean,
+well-audited code. OpenVPN has been written with buffer overflow
+attack prevention as a top priority.
+But as history has shown, many of the most widely used
+network applications have, from time to time,
+fallen to buffer overflow attacks.
+
+So as a second line of defense, OpenVPN offers
+this special layer of authentication on top of the TLS control channel so that
+every packet on the control channel is authenticated by an
+HMAC signature and a unique ID for replay protection.
+This signature will also help protect against DoS (Denial of Service) attacks.
+An important rule of thumb in reducing vulnerability to DoS attacks is to
+minimize the amount of resources a potential, but as yet unauthenticated,
+client is able to consume.
+
+.B \-\-tls-auth
+does this by signing every TLS control channel packet with an HMAC signature,
+including packets which are sent before the TLS level has had a chance
+to authenticate the peer.
+The result is that packets without
+the correct signature can be dropped immediately upon reception,
+before they have a chance to consume additional system resources
+such as by initiating a TLS handshake.
+.B \-\-tls-auth
+can be strengthened by adding the
+.B \-\-replay-persist
+option which will keep OpenVPN's replay protection state
+in a file so that it is not lost across restarts.
+
+It should be emphasized that this feature is optional and that the
+passphrase/key file used with
+.B \-\-tls-auth
+gives a peer nothing more than the power to initiate a TLS
+handshake. It is not used to encrypt or authenticate any tunnel data.
+.\"*********************************************************
+.TP
+.B \-\-askpass [file]
+Get certificate password from console or
+.B file
+before we daemonize.
+
+For the extremely
+security conscious, it is possible to protect your private key with
+a password. Of course this means that every time the OpenVPN
+daemon is started you must be there to type the password. The
+.B \-\-askpass
+option allows you to start OpenVPN from the command line. It will
+query you for a password before it daemonizes. To protect a private
+key with a password you should omit the
+.B -nodes
+option when you use the
+.B openssl
+command line tool to manage certificates and private keys.
+
+If
+.B file
+is specified, read the password from the first line of
+.B file.
+Keep in mind that storing your password in a file
+to a certain extent invalidates the extra security provided by
+using an encrypted key (Note: OpenVPN
+will only read passwords from a file if it has been built
+with the \-\-enable-password-save configure option, or on Windows
+by defining ENABLE_PASSWORD_SAVE in win/settings.in).
+.\"*********************************************************
+.TP
+.B \-\-auth-nocache
+Don't cache
+.B \-\-askpass
+or
+.B \-\-auth-user-pass
+username/passwords in virtual memory.
+
+If specified, this directive will cause OpenVPN to immediately
+forget username/password inputs after they are used. As a result,
+when OpenVPN needs a username/password, it will prompt for input
+from stdin, which may be multiple times during the duration of an
+OpenVPN session.
+
+This directive does not affect the
+.B \-\-http-proxy
+username/password. It is always cached.
+.\"*********************************************************
+.TP
+.B \-\-tls-verify cmd
+Run command
+.B cmd
+to verify the X509 name of a
+pending TLS connection that has otherwise passed all other
+tests of certification (except for revocation via
+.B \-\-crl-verify
+directive; the revocation test occurs after the
+.B \-\-tls-verify
+test).
+
+.B cmd
+should return 0 to allow the TLS handshake to proceed, or 1 to fail.
+
+.B cmd
+consists of a path to script (or executable program), optionally
+followed by arguments. The path and arguments may be single- or double-quoted
+and/or escaped using a backslash, and should be separated by one or more spaces.
+
+When
+.B cmd
+is executed two arguments are appended after any arguments specified in
+.B cmd
+, as follows:
+
+.B cmd certificate_depth subject
+
+These arguments are, respectively, the current certificate depth and
+the X509 common name (cn) of the peer.
+
+This feature is useful if the peer you want to trust has a certificate
+which was signed by a certificate authority who also signed many
+other certificates, where you don't necessarily want to trust all of them,
+but rather be selective about which
+peer certificate you will accept. This feature allows you to write a script
+which will test the X509 name on a certificate and decide whether or
+not it should be accepted. For a simple perl script which will test
+the common name field on the certificate, see the file
+.B verify-cn
+in the OpenVPN distribution.
+
+See the "Environmental Variables" section below for
+additional parameters passed as environmental variables.
+.\"*********************************************************
+.TP
+.B \-\-tls-export-cert directory
+Store the certificates the clients uses upon connection to this
+directory. This will be done before \-\-tls-verify is called. The
+certificates will use a temporary name and will be deleted when
+the tls-verify script returns. The file name used for the certificate
+is available via the peer_cert environment variable.
+.\"*********************************************************
+.TP
+.B \-\-x509-username-field [ext:\]fieldname
+Field in the X.509 certificate subject to be used as the username (default=CN).
+Typically, this option is specified with
+.B fieldname
+as either of the following:
+
+.B \-\-x509-username-field
+emailAddress
+.br
+.B \-\-x509-username-field ext:\fRsubjectAltName
+
+The first example uses the value of the "emailAddress" attribute in the
+certificate's Subject field as the username. The second example uses
+the
+.B ext:
+prefix to signify that the X.509 extension
+.B fieldname
+"subjectAltName" be searched for an rfc822Name (email) field to be used
+as the username. In cases where there are multiple email addresses
+in
+.B ext:fieldname\fR,
+the last occurrence is chosen.
+
+When this option is used, the
+.B \-\-verify-x509-name
+option will match against the chosen
+.B fieldname
+instead of the Common Name.
+
+.B Please note:
+This option has a feature which will convert an all-lowercase
+.B fieldname
+to uppercase characters, e.g., ou -> OU. A mixed-case
+.B fieldname
+or one having the
+.B ext:
+prefix will be left as-is. This automatic upcasing feature
+is deprecated and will be removed in a future release.
+.\"*********************************************************
+.TP
+.B \-\-tls-remote name (DEPRECATED)
+Accept connections only from a host with X509 name
+or common name equal to
+.B name.
+The remote host must also pass all other tests
+of verification.
+
+.B NOTE:
+Because tls-remote may test against a common name prefix,
+only use this option when you are using OpenVPN with a custom CA
+certificate that is under your control.
+Never use this option when your client certificates are signed by
+a third party, such as a commercial web CA.
+
+Name can also be a common name prefix, for example if you
+want a client to only accept connections to "Server-1",
+"Server-2", etc., you can simply use
+.B \-\-tls-remote Server
+
+Using a common name prefix is a useful alternative to managing
+a CRL (Certificate Revocation List) on the client, since it allows the client
+to refuse all certificates except for those associated
+with designated servers.
+
+.B \-\-tls-remote
+is a useful replacement for the
+.B \-\-tls-verify
+option to verify the remote host, because
+.B \-\-tls-remote
+works in a
+.B \-\-chroot
+environment too.
+
+.B Please also note:
+This option is now deprecated. It will be removed either in OpenVPN v2.4
+or v2.5. So please make sure you support the new X.509 name formatting
+described with the
+.B \-\-compat-names
+option as soon as possible by updating your configurations to use
+.B \-\-verify-x509-name
+instead.
+.\"*********************************************************
+.TP
+.B \-\-verify-x509-name name type
+Accept connections only if a host's X.509 name is equal to
+.B name.
+The remote host must also pass all other tests of verification.
+
+Which X.509 name is compared to
+.B name
+depends on the setting of type.
+.B type
+can be "subject" to match the complete subject DN (default),
+"name" to match a subject RDN or "name-prefix" to match a subject RDN prefix.
+Which RDN is verified as name depends on the
+.B \-\-x509-username-field
+option. But it defaults to the common name (CN), e.g. a certificate with a
+subject DN "C=KG, ST=NA, L=Bishkek, CN=Server-1" would be matched by:
+
+.B \-\-verify-x509-name 'C=KG, ST=NA, L=Bishkek, CN=Server-1'
+and
+.B \-\-verify-x509-name Server-1 name
+or you could use
+.B \-\-verify-x509-name Server- name-prefix
+if you want a client to only accept connections to "Server-1", "Server-2", etc.
+
+.B \-\-verify-x509-name
+is a useful replacement for the
+.B \-\-tls-verify
+option to verify the remote host, because
+.B \-\-verify-x509-name
+works in a
+.B \-\-chroot
+environment without any dependencies.
+
+Using a name prefix is a useful alternative to managing
+a CRL (Certificate Revocation List) on the client, since it allows the client
+to refuse all certificates except for those associated
+with designated servers.
+
+.B NOTE:
+Test against a name prefix only when you are using OpenVPN with
+a custom CA certificate that is under your control.
+Never use this option with type "name-prefix" when your client certificates
+are signed by a third party, such as a commercial web CA.
+.\"*********************************************************
+.TP
+.B \-\-x509-track attribute
+Save peer X509
+.B attribute
+value in environment for use by plugins and management interface.
+Prepend a '+' to
+.B attribute
+to save values from full cert chain. Values will be encoded
+as X509_<depth>_<attribute>=<value>. Multiple
+.B \-\-x509-track
+options can be defined to track multiple attributes.
+Not available with PolarSSL.
+.\"*********************************************************
+.TP
+.B \-\-ns-cert-type client|server
+Require that peer certificate was signed with an explicit
+.B nsCertType
+designation of "client" or "server".
+
+This is a useful security option for clients, to ensure that
+the host they connect with is a designated server.
+
+See the easy-rsa/build-key-server script for an example
+of how to generate a certificate with the
+.B nsCertType
+field set to "server".
+
+If the server certificate's nsCertType field is set
+to "server", then the clients can verify this with
+.B \-\-ns-cert-type server.
+
+This is an important security precaution to protect against
+a man-in-the-middle attack where an authorized client
+attempts to connect to another client by impersonating the server.
+The attack is easily prevented by having clients verify
+the server certificate using any one of
+.B \-\-ns-cert-type, \-\-verify-x509-name,
+or
+.B \-\-tls-verify.
+.\"*********************************************************
+.TP
+.B \-\-remote-cert-ku v...
+Require that peer certificate was signed with an explicit
+.B key usage.
+
+This is a useful security option for clients, to ensure that
+the host they connect to is a designated server.
+
+The key usage should be encoded in hex, more than one key
+usage can be specified.
+.\"*********************************************************
+.TP
+.B \-\-remote-cert-eku oid
+Require that peer certificate was signed with an explicit
+.B extended key usage.
+
+This is a useful security option for clients, to ensure that
+the host they connect to is a designated server.
+
+The extended key usage should be encoded in oid notation, or
+OpenSSL symbolic representation.
+.\"*********************************************************
+.TP
+.B \-\-remote-cert-tls client|server
+Require that peer certificate was signed with an explicit
+.B key usage
+and
+.B extended key usage
+based on RFC3280 TLS rules.
+
+This is a useful security option for clients, to ensure that
+the host they connect to is a designated server.
+
+The
+.B \-\-remote-cert-tls client
+option is equivalent to
+.B
+\-\-remote-cert-ku 80 08 88 \-\-remote-cert-eku "TLS Web Client Authentication"
+
+The key usage is digitalSignature and/or keyAgreement.
+
+The
+.B \-\-remote-cert-tls server
+option is equivalent to
+.B
+\-\-remote-cert-ku a0 88 \-\-remote-cert-eku "TLS Web Server Authentication"
+
+The key usage is digitalSignature and ( keyEncipherment or keyAgreement ).
+
+This is an important security precaution to protect against
+a man-in-the-middle attack where an authorized client
+attempts to connect to another client by impersonating the server.
+The attack is easily prevented by having clients verify
+the server certificate using any one of
+.B \-\-remote-cert-tls, \-\-verify-x509-name,
+or
+.B \-\-tls-verify.
+.\"*********************************************************
+.TP
+.B \-\-crl-verify crl ['dir']
+Check peer certificate against the file
+.B crl
+in PEM format.
+
+A CRL (certificate revocation list) is used when a particular key is
+compromised but when the overall PKI is still intact.
+
+Suppose you had a PKI consisting of a CA, root certificate, and a number of
+client certificates. Suppose a laptop computer containing a client key and
+certificate was stolen. By adding the stolen certificate to the CRL file,
+you could reject any connection which attempts to use it, while preserving the
+overall integrity of the PKI.
+
+The only time when it would be necessary to rebuild the entire PKI from scratch would be
+if the root certificate key itself was compromised.
+
+If the optional
+.B dir
+flag is specified, enable a different mode where
+.B crl
+is a directory containing files named as revoked serial numbers
+(the files may be empty, the contents are never read). If a client
+requests a connection, where the client certificate serial number
+(decimal string) is the name of a file present in the directory,
+it will be rejected.
+.\"*********************************************************
+.SS SSL Library information:
+.\"*********************************************************
+.TP
+.B \-\-show-ciphers
+(Standalone)
+Show all cipher algorithms to use with the
+.B \-\-cipher
+option.
+.\"*********************************************************
+.TP
+.B \-\-show-digests
+(Standalone)
+Show all message digest algorithms to use with the
+.B \-\-auth
+option.
+.\"*********************************************************
+.TP
+.B \-\-show-tls
+(Standalone)
+Show all TLS ciphers (TLS used only as a control channel). The TLS
+ciphers will be sorted from highest preference (most secure) to
+lowest.
+.\"*********************************************************
+.TP
+.B \-\-show-engines
+(Standalone)
+Show currently available hardware-based crypto acceleration
+engines supported by the OpenSSL library.
+.\"*********************************************************
+.TP
+.B \-\-show-curves
+(Standalone)
+Show all available elliptic curves to use with the
+.B \-\-ecdh-curve
+option.
+.\"*********************************************************
+.SS Generate a random key:
+Used only for non-TLS static key encryption mode.
+.\"*********************************************************
+.TP
+.B \-\-genkey
+(Standalone)
+Generate a random key to be used as a shared secret,
+for use with the
+.B \-\-secret
+option. This file must be shared with the
+peer over a pre-existing secure channel such as
+.BR scp (1)
+.
+.\"*********************************************************
+.TP
+.B \-\-secret file
+Write key to
+.B file.
+.\"*********************************************************
+.SS TUN/TAP persistent tunnel config mode:
+Available with linux 2.4.7+. These options comprise a standalone mode
+of OpenVPN which can be used to create and delete persistent tunnels.
+.\"*********************************************************
+.TP
+.B \-\-mktun
+(Standalone)
+Create a persistent tunnel on platforms which support them such
+as Linux. Normally TUN/TAP tunnels exist only for
+the period of time that an application has them open. This option
+takes advantage of the TUN/TAP driver's ability to build persistent
+tunnels that live through multiple instantiations of OpenVPN and die
+only when they are deleted or the machine is rebooted.
+
+One of the advantages of persistent tunnels is that they eliminate the
+need for separate
+.B \-\-up
+and
+.B \-\-down
+scripts to run the appropriate
+.BR ifconfig (8)
+and
+.BR route (8)
+commands. These commands can be placed in the the same shell script
+which starts or terminates an OpenVPN session.
+
+Another advantage is that open connections through the TUN/TAP-based tunnel
+will not be reset if the OpenVPN peer restarts. This can be useful to
+provide uninterrupted connectivity through the tunnel in the event of a DHCP
+reset of the peer's public IP address (see the
+.B \-\-ipchange
+option above).
+
+One disadvantage of persistent tunnels is that it is harder to automatically
+configure their MTU value (see
+.B \-\-link-mtu
+and
+.B \-\-tun-mtu
+above).
+
+On some platforms such as Windows, TAP-Win32 tunnels are persistent by
+default.
+.\"*********************************************************
+.TP
+.B \-\-rmtun
+(Standalone)
+Remove a persistent tunnel.
+.\"*********************************************************
+.TP
+.B \-\-dev tunX | tapX
+TUN/TAP device
+.\"*********************************************************
+.TP
+.B \-\-user user
+Optional user to be owner of this tunnel.
+.\"*********************************************************
+.TP
+.B \-\-group group
+Optional group to be owner of this tunnel.
+.\"*********************************************************
+.SS Windows-Specific Options:
+.\"*********************************************************
+.TP
+.B \-\-win-sys path
+Set the Windows system directory pathname to use when looking for system
+executables such as
+.B route.exe
+and
+.B netsh.exe.
+By default, if this directive is
+not specified, OpenVPN will use the SystemRoot environment variable.
+
+This option have changed behaviour in OpenVPN 2.3. Earlier you had to
+define
+.B --win-sys env
+to use the SystemRoot environment variable, otherwise it defaulted to C:\\WINDOWS.
+It is not needed to use the
+.B env
+keyword any more, and it will just be ignored. A warning is logged when this
+is found in the configuration file.
+.\"*********************************************************
+.TP
+.B \-\-ip-win32 method
+When using
+.B \-\-ifconfig
+on Windows, set the TAP-Win32 adapter
+IP address and netmask using
+.B method.
+Don't use this option unless you are also using
+.B \-\-ifconfig.
+
+.B manual \-\-
+Don't set the IP address or netmask automatically.
+Instead output a message
+to the console telling the user to configure the
+adapter manually and indicating the IP/netmask which
+OpenVPN expects the adapter to be set to.
+
+.B dynamic [offset] [lease-time] \-\-
+Automatically set the IP address and netmask by replying to
+DHCP query messages generated by the kernel. This mode is
+probably the "cleanest" solution
+for setting the TCP/IP properties since it uses the well-known
+DHCP protocol. There are, however, two prerequisites for using
+this mode: (1) The TCP/IP properties for the TAP-Win32
+adapter must be set to "Obtain an IP address automatically," and
+(2) OpenVPN needs to claim an IP address in the subnet for use
+as the virtual DHCP server address. By default in
+.B \-\-dev tap
+mode, OpenVPN will
+take the normally unused first address in the subnet. For example,
+if your subnet is 192.168.4.0 netmask 255.255.255.0, then
+OpenVPN will take the IP address 192.168.4.0 to use as the
+virtual DHCP server address. In
+.B \-\-dev tun
+mode, OpenVPN will cause the DHCP server to masquerade as if it were
+coming from the remote endpoint. The optional offset parameter is
+an integer which is > -256 and < 256 and which defaults to 0.
+If offset is positive, the DHCP server will masquerade as the IP
+address at network address + offset.
+If offset is negative, the DHCP server will masquerade as the IP
+address at broadcast address + offset. The Windows
+.B ipconfig /all
+command can be used to show what Windows thinks the DHCP server
+address is. OpenVPN will "claim" this address, so make sure to
+use a free address. Having said that, different OpenVPN instantiations,
+including different ends of the same connection, can share the same
+virtual DHCP server address. The
+.B lease-time
+parameter controls the lease time of the DHCP assignment given to
+the TAP-Win32 adapter, and is denoted in seconds.
+Normally a very long lease time is preferred
+because it prevents routes involving the TAP-Win32 adapter from
+being lost when the system goes to sleep. The default
+lease time is one year.
+
+.B netsh \-\-
+Automatically set the IP address and netmask using
+the Windows command-line "netsh"
+command. This method appears to work correctly on
+Windows XP but not Windows 2000.
+
+.B ipapi \-\-
+Automatically set the IP address and netmask using the
+Windows IP Helper API. This approach
+does not have ideal semantics, though testing has indicated
+that it works okay in practice. If you use this option,
+it is best to leave the TCP/IP properties for the TAP-Win32
+adapter in their default state, i.e. "Obtain an IP address
+automatically."
+
+.B adaptive \-\-
+(Default) Try
+.B dynamic
+method initially and fail over to
+.B netsh
+if the DHCP negotiation with the TAP-Win32 adapter does
+not succeed in 20 seconds. Such failures have been known
+to occur when certain third-party firewall packages installed
+on the client machine block the DHCP negotiation used by
+the TAP-Win32 adapter.
+Note that if the
+.B netsh
+failover occurs, the TAP-Win32 adapter
+TCP/IP properties will be reset from DHCP to static, and this
+will cause future OpenVPN startups using the
+.B adaptive
+mode to use
+.B netsh
+immediately, rather than trying
+.B dynamic
+first. To "unstick" the
+.B adaptive
+mode from using
+.B netsh,
+run OpenVPN at least once using the
+.B dynamic
+mode to restore the TAP-Win32 adapter TCP/IP properties
+to a DHCP configuration.
+.\"*********************************************************
+.TP
+.B \-\-route-method m
+Which method
+.B m
+to use for adding routes on Windows?
+
+.B adaptive
+(default) \-\- Try IP helper API first. If that fails, fall
+back to the route.exe shell command.
+.br
+.B ipapi
+\-\- Use IP helper API.
+.br
+.B exe
+\-\- Call the route.exe shell command.
+.\"*********************************************************
+.TP
+.B \-\-dhcp-option type [parm]
+Set extended TAP-Win32 TCP/IP properties, must
+be used with
+.B \-\-ip-win32 dynamic
+or
+.B \-\-ip-win32 adaptive.
+This option can be used to set additional TCP/IP properties
+on the TAP-Win32 adapter, and is particularly useful for
+configuring an OpenVPN client to access a Samba server
+across the VPN.
+
+.B DOMAIN name \-\-
+Set Connection-specific DNS Suffix.
+
+.B DNS addr \-\-
+Set primary domain name server address. Repeat
+this option to set secondary DNS server addresses.
+
+.B WINS addr \-\-
+Set primary WINS server address (NetBIOS over TCP/IP Name Server).
+Repeat this option to set secondary WINS server addresses.
+
+.B NBDD addr \-\-
+Set primary NBDD server address (NetBIOS over TCP/IP Datagram Distribution Server)
+Repeat this option
+to set secondary NBDD server addresses.
+
+.B NTP addr \-\-
+Set primary NTP server address (Network Time Protocol).
+Repeat this option
+to set secondary NTP server addresses.
+
+.B NBT type \-\-
+Set NetBIOS over TCP/IP Node type. Possible options:
+.B 1
+= b-node (broadcasts),
+.B 2
+= p-node (point-to-point
+name queries to a WINS server),
+.B 4
+= m-node (broadcast
+then query name server), and
+.B 8
+= h-node (query name server, then broadcast).
+
+.B NBS scope-id \-\-
+Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended
+naming service for the NetBIOS over TCP/IP (Known as NBT) module. The
+primary purpose of a NetBIOS scope ID is to isolate NetBIOS traffic on
+a single network to only those nodes with the same NetBIOS scope ID.
+The NetBIOS scope ID is a character string that is appended to the NetBIOS
+name. The NetBIOS scope ID on two hosts must match, or the two hosts
+will not be able to communicate. The NetBIOS Scope ID also allows
+computers to use the same computer name, as they have different
+scope IDs. The Scope ID becomes a part of the NetBIOS name, making the name unique.
+(This description of NetBIOS scopes courtesy of NeonSurge@abyss.com)
+
+.B DISABLE-NBT \-\-
+Disable Netbios-over-TCP/IP.
+
+Note that if
+.B \-\-dhcp-option
+is pushed via
+.B \-\-push
+to a non-windows client, the option will be saved in the client's
+environment before the up script is called, under
+the name "foreign_option_{n}".
+.\"*********************************************************
+.TP
+.B \-\-tap-sleep n
+Cause OpenVPN to sleep for
+.B n
+seconds immediately after the TAP-Win32 adapter state
+is set to "connected".
+
+This option is intended to be used to troubleshoot problems
+with the
+.B \-\-ifconfig
+and
+.B \-\-ip-win32
+options, and is used to give
+the TAP-Win32 adapter time to come up before
+Windows IP Helper API operations are applied to it.
+.\"*********************************************************
+.TP
+.B \-\-show-net-up
+Output OpenVPN's view of the system routing table and network
+adapter list to the syslog or log file after the TUN/TAP adapter
+has been brought up and any routes have been added.
+.\"*********************************************************
+.TP
+.B \-\-dhcp-renew
+Ask Windows to renew the TAP adapter lease on startup.
+This option is normally unnecessary, as Windows automatically
+triggers a DHCP renegotiation on the TAP adapter when it
+comes up, however if you set the TAP-Win32 adapter
+Media Status property to "Always Connected", you may need this
+flag.
+.\"*********************************************************
+.TP
+.B \-\-dhcp-release
+Ask Windows to release the TAP adapter lease on shutdown.
+This option has the same caveats as
+.B \-\-dhcp-renew
+above.
+.\"*********************************************************
+.TP
+.B \-\-register-dns
+Run net stop dnscache, net start dnscache, ipconfig /flushdns
+and ipconfig /registerdns on connection initiation.
+This is known to kick Windows into
+recognizing pushed DNS servers.
+.\"*********************************************************
+.TP
+.B \-\-pause-exit
+Put up a "press any key to continue" message on the console prior
+to OpenVPN program exit. This option is automatically used by the
+Windows explorer when OpenVPN is run on a configuration
+file using the right-click explorer menu.
+.\"*********************************************************
+.TP
+.B \-\-service exit-event [0|1]
+Should be used when OpenVPN is being automatically executed by another
+program in such
+a context that no interaction with the user via display or keyboard
+is possible. In general, end-users should never need to explicitly
+use this option, as it is automatically added by the OpenVPN service wrapper
+when a given OpenVPN configuration is being run as a service.
+
+.B exit-event
+is the name of a Windows global event object, and OpenVPN will continuously
+monitor the state of this event object and exit when it becomes signaled.
+
+The second parameter indicates the initial state of
+.B exit-event
+and normally defaults to 0.
+
+Multiple OpenVPN processes can be simultaneously executed with the same
+.B exit-event
+parameter. In any case, the controlling process can signal
+.B exit-event,
+causing all such OpenVPN processes to exit.
+
+When executing an OpenVPN process using the
+.B \-\-service
+directive, OpenVPN will probably not have a console
+window to output status/error
+messages, therefore it is useful to use
+.B \-\-log
+or
+.B \-\-log-append
+to write these messages to a file.
+.\"*********************************************************
+.TP
+.B \-\-show-adapters
+(Standalone)
+Show available TAP-Win32 adapters which can be selected using the
+.B \-\-dev-node
+option. On non-Windows systems, the
+.BR ifconfig (8)
+command provides similar functionality.
+.\"*********************************************************
+.TP
+.B \-\-allow-nonadmin [TAP-adapter]
+(Standalone)
+Set
+.B TAP-adapter
+to allow access from non-administrative accounts. If
+.B TAP-adapter
+is omitted, all TAP adapters on the system will be configured to allow
+non-admin access.
+The non-admin access setting will only persist for the length of time that
+the TAP-Win32 device object and driver remain loaded, and will need
+to be re-enabled after a reboot, or if the driver is unloaded
+and reloaded.
+This directive can only be used by an administrator.
+.\"*********************************************************
+.TP
+.B \-\-show-valid-subnets
+(Standalone)
+Show valid subnets for
+.B \-\-dev tun
+emulation. Since the TAP-Win32 driver
+exports an ethernet interface to Windows, and since TUN devices are
+point-to-point in nature, it is necessary for the TAP-Win32 driver
+to impose certain constraints on TUN endpoint address selection.
+
+Namely, the point-to-point endpoints used in TUN device emulation
+must be the middle two addresses of a /30 subnet (netmask 255.255.255.252).
+.\"*********************************************************
+.TP
+.B \-\-show-net
+(Standalone)
+Show OpenVPN's view of the system routing table and network
+adapter list.
+.\"*********************************************************
+.SS PKCS#11 Standalone Options:
+.\"*********************************************************
+.TP
+.B \-\-show-pkcs11-ids provider [cert_private]
+(Standalone)
+Show PKCS#11 token object list. Specify cert_private as 1
+if certificates are stored as private objects.
+
+.B \-\-verb
+option can be used BEFORE this option to produce debugging information.
+.\"*********************************************************
+.SS IPv6 Related Options
+.\"*********************************************************
+The following options exist to support IPv6 tunneling in peer-to-peer
+and client-server mode. All options are modeled after their IPv4
+counterparts, so more detailed explanations given there apply here
+as well (except for
+.B \-\-topology
+, which has no effect on IPv6).
+.TP
+.B --ifconfig-ipv6 ipv6addr/bits ipv6remote
+configure IPv6 address
+.B ipv6addr/bits
+on the ``tun'' device. The second parameter is used as route target for
+.B --route-ipv6
+if no gateway is specified.
+.TP
+.B --route-ipv6 ipv6addr/bits [gateway] [metric]
+setup IPv6 routing in the system to send the specified IPv6 network
+into OpenVPN's ``tun''. The gateway parameter is only used for
+IPv6 routes across ``tap'' devices, and if missing, the ``ipv6remote''
+field from
+.B --ifconfig-ipv6
+is used.
+.TP
+.B --server-ipv6 ipv6addr/bits
+convenience-function to enable a number of IPv6 related options at
+once, namely
+.B --ifconfig-ipv6, --ifconfig-ipv6-pool, --tun-ipv6
+and
+.B --push tun-ipv6
+Is only accepted if ``--mode server'' or ``--server'' is set.
+.TP
+.B --ifconfig-ipv6-pool ipv6addr/bits
+Specify an IPv6 address pool for dynamic assignment to clients. The
+pool starts at
+.B ipv6addr
+and increments by +1 for every new client (linear mode). The
+.B /bits
+setting controls the size of the pool. Due to implementation details,
+the pool size must be between /64 and /112.
+.TP
+.B --ifconfig-ipv6-push ipv6addr/bits ipv6remote
+for ccd/ per-client static IPv6 interface configuration, see
+.B --client-config-dir
+and
+.B --ifconfig-push
+for more details.
+.TP
+.B --iroute-ipv6 ipv6addr/bits
+for ccd/ per-client static IPv6 route configuration, see
+.B --iroute
+for more details how to setup and use this, and how
+.B --iroute
+and
+.B --route
+interact.
+
+.\"*********************************************************
+.SH SCRIPTING AND ENVIRONMENTAL VARIABLES
+OpenVPN exports a series
+of environmental variables for use by user-defined scripts.
+.\"*********************************************************
+.SS Script Order of Execution
+.\"*********************************************************
+.TP
+.B \-\-up
+Executed after TCP/UDP socket bind and TUN/TAP open.
+.\"*********************************************************
+.TP
+.B \-\-tls-verify
+Executed when we have a still untrusted remote peer.
+.\"*********************************************************
+.TP
+.B \-\-ipchange
+Executed after connection authentication, or remote IP address change.
+.\"*********************************************************
+.TP
+.B \-\-client-connect
+Executed in
+.B \-\-mode server
+mode immediately after client authentication.
+.\"*********************************************************
+.TP
+.B \-\-route-up
+Executed after connection authentication, either
+immediately after, or some number of seconds after
+as defined by the
+.B \-\-route-delay
+option.
+.\"*********************************************************
+.TP
+.B \-\-route-pre-down
+Executed right before the routes are removed.
+.\"*********************************************************
+.TP
+.B \-\-client-disconnect
+Executed in
+.B \-\-mode server
+mode on client instance shutdown.
+.\"*********************************************************
+.TP
+.B \-\-down
+Executed after TCP/UDP and TUN/TAP close.
+.\"*********************************************************
+.TP
+.B \-\-learn-address
+Executed in
+.B \-\-mode server
+mode whenever an IPv4 address/route or MAC address is added to OpenVPN's
+internal routing table.
+.\"*********************************************************
+.TP
+.B \-\-auth-user-pass-verify
+Executed in
+.B \-\-mode server
+mode on new client connections, when the client is
+still untrusted.
+.\"*********************************************************
+.SS String Types and Remapping
+In certain cases, OpenVPN will perform remapping of characters
+in strings. Essentially, any characters outside the set of
+permitted characters for each string type will be converted
+to underbar ('_').
+
+.B Q:
+Why is string remapping necessary?
+
+.B A:
+It's an important security feature to prevent the malicious coding of
+strings from untrusted sources to be passed as parameters to scripts,
+saved in the environment, used as a common name, translated to a filename,
+etc.
+
+.B Q:
+Can string remapping be disabled?
+
+.B A:
+Yes, by using the
+.B \-\-no-name-remapping
+option, however this should be considered an advanced option.
+
+Here is a brief rundown of OpenVPN's current string types and the
+permitted character class for each string:
+
+.B X509 Names:
+Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), at
+('@'), colon (':'), slash ('/'), and equal ('='). Alphanumeric is defined
+as a character which will cause the C library isalnum() function to return
+true.
+
+.B Common Names:
+Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), and at
+('@').
+
+.B \-\-auth-user-pass username:
+Same as Common Name, with one exception: starting with OpenVPN 2.0.1,
+the username is passed to the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY plugin in its raw form,
+without string remapping.
+
+.B \-\-auth-user-pass password:
+Any "printable" character except CR or LF.
+Printable is defined to be a character which will cause the C library
+isprint() function to return true.
+
+.B \-\-client-config-dir filename as derived from common name or username:
+Alphanumeric, underbar ('_'), dash ('-'), and dot ('.') except for "." or
+".." as standalone strings. As of 2.0.1-rc6, the at ('@') character has
+been added as well for compatibility with the common name character class.
+
+.B Environmental variable names:
+Alphanumeric or underbar ('_').
+
+.B Environmental variable values:
+Any printable character.
+
+For all cases, characters in a string which are not members of the legal
+character class for that string type will be remapped to underbar ('_').
+.\"*********************************************************
+.SS Environmental Variables
+Once set, a variable is persisted
+indefinitely until it is reset by a new value or a restart,
+
+As of OpenVPN 2.0-beta12, in server mode, environmental
+variables set by OpenVPN
+are scoped according to the client objects
+they are
+associated with, so there should not be any issues with
+scripts having access to stale, previously set variables
+which refer to different client instances.
+.\"*********************************************************
+.TP
+.B bytes_received
+Total number of bytes received from client during VPN session.
+Set prior to execution of the
+.B \-\-client-disconnect
+script.
+.\"*********************************************************
+.TP
+.B bytes_sent
+Total number of bytes sent to client during VPN session.
+Set prior to execution of the
+.B \-\-client-disconnect
+script.
+.\"*********************************************************
+.TP
+.B common_name
+The X509 common name of an authenticated client.
+Set prior to execution of
+.B \-\-client-connect, \-\-client-disconnect,
+and
+.B \-\-auth-user-pass-verify
+scripts.
+.\"*********************************************************
+.TP
+.B config
+Name of first
+.B \-\-config
+file.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B daemon
+Set to "1" if the
+.B \-\-daemon
+directive is specified, or "0" otherwise.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B daemon_log_redirect
+Set to "1" if the
+.B \-\-log
+or
+.B \-\-log-append
+directives are specified, or "0" otherwise.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B dev
+The actual name of the TUN/TAP device, including
+a unit number if it exists.
+Set prior to
+.B \-\-up
+or
+.B \-\-down
+script execution.
+.\"*********************************************************
+.TP
+.B foreign_option_{n}
+An option pushed via
+.B \-\-push
+to a client which does not natively support it,
+such as
+.B \-\-dhcp-option
+on a non-Windows system, will be recorded to this
+environmental variable sequence prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_broadcast
+The broadcast address for the virtual
+ethernet segment which is derived from the
+.B \-\-ifconfig
+option when
+.B \-\-dev tap
+is used.
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_ipv6_local
+The local VPN endpoint IPv6 address specified in the
+.B \-\-ifconfig-ipv6
+option (first parameter).
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_ipv6_netbits
+The prefix length of the IPv6 network on the VPN interface. Derived from
+the /nnn parameter of the IPv6 address in the
+.B \-\-ifconfig-ipv6
+option (first parameter).
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_ipv6_remote
+The remote VPN endpoint IPv6 address specified in the
+.B \-\-ifconfig-ipv6
+option (second parameter).
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_local
+The local VPN endpoint IP address specified in the
+.B \-\-ifconfig
+option (first parameter).
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_remote
+The remote VPN endpoint IP address specified in the
+.B \-\-ifconfig
+option (second parameter) when
+.B \-\-dev tun
+is used.
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_netmask
+The subnet mask of the virtual ethernet segment
+that is specified as the second parameter to
+.B \-\-ifconfig
+when
+.B \-\-dev tap
+is being used.
+Set prior to OpenVPN calling the
+.I ifconfig
+or
+.I netsh
+(windows version of ifconfig) commands which
+normally occurs prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B ifconfig_pool_local_ip
+The local
+virtual IP address for the TUN/TAP tunnel taken from an
+.B \-\-ifconfig-push
+directive if specified, or otherwise from
+the ifconfig pool (controlled by the
+.B \-\-ifconfig-pool
+config file directive).
+Only set for
+.B \-\-dev tun
+tunnels.
+This option is set on the server prior to execution
+of the
+.B \-\-client-connect
+and
+.B \-\-client-disconnect
+scripts.
+.\"*********************************************************
+.TP
+.B ifconfig_pool_netmask
+The
+virtual IP netmask for the TUN/TAP tunnel taken from an
+.B \-\-ifconfig-push
+directive if specified, or otherwise from
+the ifconfig pool (controlled by the
+.B \-\-ifconfig-pool
+config file directive).
+Only set for
+.B \-\-dev tap
+tunnels.
+This option is set on the server prior to execution
+of the
+.B \-\-client-connect
+and
+.B \-\-client-disconnect
+scripts.
+.\"*********************************************************
+.TP
+.B ifconfig_pool_remote_ip
+The remote
+virtual IP address for the TUN/TAP tunnel taken from an
+.B \-\-ifconfig-push
+directive if specified, or otherwise from
+the ifconfig pool (controlled by the
+.B \-\-ifconfig-pool
+config file directive).
+This option is set on the server prior to execution
+of the
+.B \-\-client-connect
+and
+.B \-\-client-disconnect
+scripts.
+.\"*********************************************************
+.TP
+.B link_mtu
+The maximum packet size (not including the IP header)
+of tunnel data in UDP tunnel transport mode.
+Set prior to
+.B \-\-up
+or
+.B \-\-down
+script execution.
+.\"*********************************************************
+.TP
+.B local
+The
+.B \-\-local
+parameter.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B local_port
+The local port number or name, specified by
+.B \-\-port
+or
+.B \-\-lport.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B password
+The password provided by a connecting client.
+Set prior to
+.B \-\-auth-user-pass-verify
+script execution only when the
+.B via-env
+modifier is specified, and deleted from the environment
+after the script returns.
+.\"*********************************************************
+.TP
+.B proto
+The
+.B \-\-proto
+parameter.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B remote_{n}
+The
+.B \-\-remote
+parameter.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B remote_port_{n}
+The remote port number, specified by
+.B \-\-port
+or
+.B \-\-rport.
+Set on program initiation and reset on SIGHUP.
+.\"*********************************************************
+.TP
+.B route_net_gateway
+The pre-existing default IP gateway in the system routing
+table.
+Set prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B route_vpn_gateway
+The default gateway used by
+.B \-\-route
+options, as specified in either the
+.B \-\-route-gateway
+option or the second parameter to
+.B \-\-ifconfig
+when
+.B \-\-dev tun
+is specified.
+Set prior to
+.B \-\-up
+script execution.
+.\"*********************************************************
+.TP
+.B route_{parm}_{n}
+A set of variables which define each route to be added, and
+are set prior to
+.B \-\-up
+script execution.
+
+.B parm
+will be one of "network", "netmask", "gateway", or "metric".
+
+.B n
+is the OpenVPN route number, starting from 1.
+
+If the network or gateway are resolvable DNS names,
+their IP address translations will be recorded rather
+than their names as denoted on the command line
+or configuration file.
+.\"*********************************************************
+.TP
+.B route_ipv6_{parm}_{n}
+A set of variables which define each IPv6 route to be added, and
+are set prior to
+.B \-\-up
+script execution.
+
+.B parm
+will be one of "network" or "gateway" ("netmask" is contained as "/nnn"
+in the route_ipv6_network_{n}, unlike IPv4 where it is passed in a separate
+environment variable).
+
+.B n
+is the OpenVPN route number, starting from 1.
+
+If the network or gateway are resolvable DNS names,
+their IP address translations will be recorded rather
+than their names as denoted on the command line
+or configuration file.
+.\"*********************************************************
+.TP
+.B peer_cert
+Temporary file name containing the client certificate upon
+connection. Useful in conjunction with --tls-verify
+.\"*********************************************************
+.TP
+.B script_context
+Set to "init" or "restart" prior to up/down script execution.
+For more information, see
+documentation for
+.B \-\-up.
+.\"*********************************************************
+.TP
+.B script_type
+Prior to execution of any script, this variable is set to the type of
+script being run. It can be one of the following:
+.B up, down, ipchange, route-up, tls-verify, auth-user-pass-verify,
+.B client-connect, client-disconnect,
+or
+.B learn-address.
+Set prior to execution of any script.
+.\"*********************************************************
+.TP
+.B signal
+The reason for exit or restart. Can be one of
+.B sigusr1, sighup, sigterm, sigint, inactive
+(controlled by
+.B \-\-inactive
+option),
+.B ping-exit
+(controlled by
+.B \-\-ping-exit
+option),
+.B ping-restart
+(controlled by
+.B \-\-ping-restart
+option),
+.B connection-reset
+(triggered on TCP connection reset),
+.B error,
+or
+.B unknown
+(unknown signal). This variable is set just prior to down script execution.
+.\"*********************************************************
+.TP
+.B time_ascii
+Client connection timestamp, formatted as a human-readable
+time string.
+Set prior to execution of the
+.B \-\-client-connect
+script.
+.\"*********************************************************
+.TP
+.B time_duration
+The duration (in seconds) of the client session which is now
+disconnecting.
+Set prior to execution of the
+.B \-\-client-disconnect
+script.
+.\"*********************************************************
+.TP
+.B time_unix
+Client connection timestamp, formatted as a unix integer
+date/time value.
+Set prior to execution of the
+.B \-\-client-connect
+script.
+.\"*********************************************************
+.TP
+.B tls_digest_{n}
+Contains the certificate SHA1 fingerprint/digest hash value,
+where
+.B n
+is the verification level. Only set for TLS connections. Set prior
+to execution of
+.B \-\-tls-verify
+script.
+.\"*********************************************************
+.TP
+.B tls_id_{n}
+A series of certificate fields from the remote peer,
+where
+.B n
+is the verification level. Only set for TLS connections. Set prior
+to execution of
+.B \-\-tls-verify
+script.
+.\"*********************************************************
+.TP
+.B tls_serial_{n}
+The serial number of the certificate from the remote peer,
+where
+.B n
+is the verification level. Only set for TLS connections. Set prior
+to execution of
+.B \-\-tls-verify
+script. This is in the form of a decimal string like "933971680", which is
+suitable for doing serial-based OCSP queries (with OpenSSL, do not
+prepend "0x" to the string) If something goes wrong while reading
+the value from the certificate it will be an empty string, so your
+code should check that.
+See the contrib/OCSP_check/OCSP_check.sh script for an example.
+.\"*********************************************************
+.TP
+.B tls_serial_hex_{n}
+Like
+.B tls_serial_{n}\fR,
+but in hex form (e.g. "12:34:56:78:9A").
+.\"*********************************************************
+.TP
+.B tun_mtu
+The MTU of the TUN/TAP device.
+Set prior to
+.B \-\-up
+or
+.B \-\-down
+script execution.
+.\"*********************************************************
+.TP
+.B trusted_ip (or trusted_ip6)
+Actual IP address of connecting client or peer which has been authenticated.
+Set prior to execution of
+.B \-\-ipchange, \-\-client-connect,
+and
+.B \-\-client-disconnect
+scripts.
+If using ipv6 endpoints (udp6, tcp6),
+.B trusted_ip6
+will be set instead.
+.\"*********************************************************
+.TP
+.B trusted_port
+Actual port number of connecting client or peer which has been authenticated.
+Set prior to execution of
+.B \-\-ipchange, \-\-client-connect,
+and
+.B \-\-client-disconnect
+scripts.
+.\"*********************************************************
+.TP
+.B untrusted_ip (or untrusted_ip6)
+Actual IP address of connecting client or peer which has not been authenticated
+yet. Sometimes used to
+.B nmap
+the connecting host in a
+.B \-\-tls-verify
+script to ensure it is firewalled properly.
+Set prior to execution of
+.B \-\-tls-verify
+and
+.B \-\-auth-user-pass-verify
+scripts.
+If using ipv6 endpoints (udp6, tcp6),
+.B untrusted_ip6
+will be set instead.
+.\"*********************************************************
+.TP
+.B untrusted_port
+Actual port number of connecting client or peer which has not been authenticated
+yet.
+Set prior to execution of
+.B \-\-tls-verify
+and
+.B \-\-auth-user-pass-verify
+scripts.
+.\"*********************************************************
+.TP
+.B username
+The username provided by a connecting client.
+Set prior to
+.B \-\-auth-user-pass-verify
+script execution only when the
+.B via-env
+modifier is specified.
+.\"*********************************************************
+.TP
+.B X509_{n}_{subject_field}
+An X509 subject field from the remote peer certificate,
+where
+.B n
+is the verification level. Only set for TLS connections. Set prior
+to execution of
+.B \-\-tls-verify
+script. This variable is similar to
+.B tls_id_{n}
+except the component X509 subject fields are broken out, and
+no string remapping occurs on these field values (except for remapping
+of control characters to "_").
+For example, the following variables would be set on the
+OpenVPN server using the sample client certificate
+in sample-keys (client.crt).
+Note that the verification level is 0 for the client certificate
+and 1 for the CA certificate.
+
+.nf
+.ft 3
+.in +4
+X509_0_emailAddress=me@myhost.mydomain
+X509_0_CN=Test-Client
+X509_0_O=OpenVPN-TEST
+X509_0_ST=NA
+X509_0_C=KG
+X509_1_emailAddress=me@myhost.mydomain
+X509_1_O=OpenVPN-TEST
+X509_1_L=BISHKEK
+X509_1_ST=NA
+X509_1_C=KG
+.in -4
+.ft
+.fi
+.\"*********************************************************
+.SH INLINE FILE SUPPORT
+OpenVPN allows including files in the main configuration for the
+.B \-\-ca, \-\-cert, \-\-dh, \-\-extra-certs, \-\-key, \-\-pkcs12, \-\-secret
+and
+.B \-\-tls-auth
+options.
+
+Each inline file started by the line
+.B <option>
+and ended by the line
+.B </option>
+
+Here is an example of an inline file usage
+
+.nf
+.ft 3
+.in +4
+<cert>
+-----BEGIN CERTIFICATE-----
+[...]
+-----END CERTIFICATE-----
+</cert>
+.in -4
+.ft
+.fi
+
+When using the inline file feature with
+.B \-\-pkcs12
+the inline file has to be base64 encoded. Encoding of a .p12 file into base64 can be done for example with OpenSSL by running
+.B openssl base64 -in input.p12
+
+.SH SIGNALS
+.TP
+.B SIGHUP
+Cause OpenVPN to close all TUN/TAP and
+network connections,
+restart, re-read the configuration file (if any),
+and reopen TUN/TAP and network connections.
+.\"*********************************************************
+.TP
+.B SIGUSR1
+Like
+.B SIGHUP,
+except don't re-read configuration file, and possibly don't close and reopen TUN/TAP
+device, re-read key files, preserve local IP address/port, or preserve most recently authenticated
+remote IP address/port based on
+.B \-\-persist-tun, \-\-persist-key, \-\-persist-local-ip,
+and
+.B \-\-persist-remote-ip
+options respectively (see above).
+
+This signal may also be internally generated by a timeout condition, governed
+by the
+.B \-\-ping-restart
+option.
+
+This signal, when combined with
+.B \-\-persist-remote-ip,
+may be
+sent when the underlying parameters of the host's network interface change
+such as when the host is a DHCP client and is assigned a new IP address.
+See
+.B \-\-ipchange
+above for more information.
+.\"*********************************************************
+.TP
+.B SIGUSR2
+Causes OpenVPN to display its current statistics (to the syslog
+file if
+.B \-\-daemon
+is used, or stdout otherwise).
+.\"*********************************************************
+.TP
+.B SIGINT, SIGTERM
+Causes OpenVPN to exit gracefully.
+.\"*********************************************************
+.SH TUN/TAP DRIVER SETUP
+If you are running Linux 2.4.7 or higher, you probably have the TUN/TAP driver
+already installed. If so, there are still a few things you need to do:
+
+Make device:
+.B mknod /dev/net/tun c 10 200
+
+Load driver:
+.B modprobe tun
+.\"*********************************************************
+.SH EXAMPLES
+Prior to running these examples, you should have OpenVPN installed on two
+machines with network connectivity between them. If you have not
+yet installed OpenVPN, consult the INSTALL file included in the OpenVPN
+distribution.
+.\"*********************************************************
+.SS TUN/TAP Setup:
+If you are using Linux 2.4 or higher,
+make the tun device node and load the tun module:
+.IP
+.B mknod /dev/net/tun c 10 200
+.LP
+.IP
+.B modprobe tun
+.LP
+If you installed from RPM, the
+.B mknod
+step may be omitted, because the RPM install does that for you.
+
+Only Linux 2.4 and newer are supported.
+
+For other platforms, consult the INSTALL file at
+.I http://openvpn.net/install.html
+for more information.
+.\"*********************************************************
+.SS Firewall Setup:
+If firewalls exist between
+the two machines, they should be set to forward UDP port 1194
+in both directions. If you do not have control over the firewalls
+between the two machines, you may still be able to use OpenVPN by adding
+.B \-\-ping 15
+to each of the
+.B openvpn
+commands used below in the examples (this will cause each peer to send out
+a UDP ping to its remote peer once every 15 seconds which will cause many
+stateful firewalls to forward packets in both directions
+without an explicit firewall rule).
+
+If you are using a Linux iptables-based firewall, you may need to enter
+the following command to allow incoming packets on the TUN device:
+.IP
+.B iptables -A INPUT -i tun+ -j ACCEPT
+.LP
+See the firewalls section below for more information on configuring firewalls
+for use with OpenVPN.
+.\"*********************************************************
+.SS VPN Address Setup:
+For purposes
+of our example, our two machines will be called
+.B may.kg
+and
+.B june.kg.
+If you are constructing a VPN over the internet, then replace
+.B may.kg
+and
+.B june.kg
+with the internet hostname or IP address that each machine will use
+to contact the other over the internet.
+
+Now we will choose the tunnel endpoints. Tunnel endpoints are
+private IP addresses that only have meaning in the context of
+the VPN. Each machine will use the tunnel endpoint of the other
+machine to access it over the VPN. In our example,
+the tunnel endpoint for may.kg
+will be 10.4.0.1 and for june.kg, 10.4.0.2.
+
+Once the VPN is established, you have essentially
+created a secure alternate path between the two hosts
+which is addressed by using the tunnel endpoints. You can
+control which network
+traffic passes between the hosts
+(a) over the VPN or (b) independently of the VPN, by choosing whether to use
+(a) the VPN endpoint address or (b) the public internet address,
+to access the remote host. For example if you are on may.kg and you wish to connect to june.kg
+via
+.B ssh
+without using the VPN (since
+.B ssh
+has its own built-in security) you would use the command
+.B ssh june.kg.
+However in the same scenario, you could also use the command
+.B telnet 10.4.0.2
+to create a telnet session with june.kg over the VPN, that would
+use the VPN to secure the session rather than
+.B ssh.
+
+You can use any address you wish for the
+tunnel endpoints
+but make sure that they are private addresses
+(such as those that begin with 10 or 192.168) and that they are
+not part of any existing subnet on the networks of
+either peer, unless you are bridging. If you use an address that is part of
+your local subnet for either of the tunnel endpoints,
+you will get a weird feedback loop.
+.\"*********************************************************
+.SS Example 1: A simple tunnel without security
+.LP
+On may:
+.IP
+.B openvpn \-\-remote june.kg \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 9
+.LP
+On june:
+.IP
+.B openvpn \-\-remote may.kg \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 9
+.LP
+Now verify the tunnel is working by pinging across the tunnel.
+.LP
+On may:
+.IP
+.B ping 10.4.0.2
+.LP
+On june:
+.IP
+.B ping 10.4.0.1
+.LP
+The
+.B \-\-verb 9
+option will produce verbose output, similar to the
+.BR tcpdump (8)
+program. Omit the
+.B \-\-verb 9
+option to have OpenVPN run quietly.
+.\"*********************************************************
+.SS Example 2: A tunnel with static-key security (i.e. using a pre-shared secret)
+First build a static key on may.
+.IP
+.B openvpn \-\-genkey \-\-secret key
+.LP
+This command will build a random key file called
+.B key
+(in ascii format).
+Now copy
+.B key
+to june over a secure medium such as by
+using the
+.BR scp (1)
+program.
+.LP
+On may:
+.IP
+.B openvpn \-\-remote june.kg \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 5 \-\-secret key
+.LP
+On june:
+.IP
+.B openvpn \-\-remote may.kg \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 5 \-\-secret key
+.LP
+Now verify the tunnel is working by pinging across the tunnel.
+.LP
+On may:
+.IP
+.B ping 10.4.0.2
+.LP
+On june:
+.IP
+.B ping 10.4.0.1
+.\"*********************************************************
+.SS Example 3: A tunnel with full TLS-based security
+For this test, we will designate
+.B may
+as the TLS client and
+.B june
+as the TLS server.
+.I Note that client or server designation only has meaning for the TLS subsystem. It has no bearing on OpenVPN's peer-to-peer, UDP-based communication model.
+
+First, build a separate certificate/key pair
+for both may and june (see above where
+.B \-\-cert
+is discussed for more info). Then construct
+Diffie Hellman parameters (see above where
+.B \-\-dh
+is discussed for more info). You can also use the
+included test files client.crt, client.key,
+server.crt, server.key and ca.crt.
+The .crt files are certificates/public-keys, the .key
+files are private keys, and ca.crt is a certification
+authority who has signed both
+client.crt and server.crt. For Diffie Hellman
+parameters you can use the included file dh1024.pem.
+.I Note that all client, server, and certificate authority certificates and keys included in the OpenVPN distribution are totally insecure and should be used for testing only.
+.LP
+On may:
+.IP
+.B openvpn \-\-remote june.kg \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-tls-client \-\-ca ca.crt \-\-cert client.crt \-\-key client.key \-\-reneg-sec 60 \-\-verb 5
+.LP
+On june:
+.IP
+.B openvpn \-\-remote may.kg \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-tls-server \-\-dh dh1024.pem \-\-ca ca.crt \-\-cert server.crt \-\-key server.key \-\-reneg-sec 60 \-\-verb 5
+.LP
+Now verify the tunnel is working by pinging across the tunnel.
+.LP
+On may:
+.IP
+.B ping 10.4.0.2
+.LP
+On june:
+.IP
+.B ping 10.4.0.1
+.LP
+Notice the
+.B \-\-reneg-sec 60
+option we used above. That tells OpenVPN to renegotiate
+the data channel keys every minute.
+Since we used
+.B \-\-verb 5
+above, you will see status information on each new key negotiation.
+
+For production operations, a key renegotiation interval of 60 seconds
+is probably too frequent. Omit the
+.B \-\-reneg-sec 60
+option to use OpenVPN's default key renegotiation interval of one hour.
+.\"*********************************************************
+.SS Routing:
+Assuming you can ping across the tunnel,
+the next step is to route a real subnet over
+the secure tunnel. Suppose that may and june have two network
+interfaces each, one connected
+to the internet, and the other to a private
+network. Our goal is to securely connect
+both private networks. We will assume that may's private subnet
+is 10.0.0.0/24 and june's is 10.0.1.0/24.
+.LP
+First, ensure that IP forwarding is enabled on both peers.
+On Linux, enable routing:
+.IP
+.B echo 1 > /proc/sys/net/ipv4/ip_forward
+.LP
+and enable TUN packet forwarding through the firewall:
+.IP
+.B iptables -A FORWARD -i tun+ -j ACCEPT
+.LP
+On may:
+.IP
+.B route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2
+.LP
+On june:
+.IP
+.B route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1
+.LP
+Now any machine on the 10.0.0.0/24 subnet can
+access any machine on the 10.0.1.0/24 subnet
+over the secure tunnel (or vice versa).
+
+In a production environment, you could put the route command(s)
+in a script and execute with the
+.B \-\-up
+option.
+.\"*********************************************************
+.SH FIREWALLS
+OpenVPN's usage of a single UDP port makes it fairly firewall-friendly.
+You should add an entry to your firewall rules to allow incoming OpenVPN
+packets. On Linux 2.4+:
+.IP
+.B iptables -A INPUT -p udp -s 1.2.3.4 \-\-dport 1194 -j ACCEPT
+.LP
+This will allow incoming packets on UDP port 1194 (OpenVPN's default UDP port)
+from an OpenVPN peer at 1.2.3.4.
+
+If you are using HMAC-based packet authentication (the default in any of
+OpenVPN's secure modes), having the firewall filter on source
+address can be considered optional, since HMAC packet authentication
+is a much more secure method of verifying the authenticity of
+a packet source. In that case:
+.IP
+.B iptables -A INPUT -p udp \-\-dport 1194 -j ACCEPT
+.LP
+would be adequate and would not render the host inflexible with
+respect to its peer having a dynamic IP address.
+
+OpenVPN also works well on stateful firewalls. In some cases, you may
+not need to add any static rules to the firewall list if you are
+using a stateful firewall that knows how to track UDP connections.
+If you specify
+.B \-\-ping n,
+OpenVPN will be guaranteed
+to send a packet to its peer at least once every
+.B n
+seconds. If
+.B n
+is less than the stateful firewall connection timeout, you can
+maintain an OpenVPN connection indefinitely without explicit
+firewall rules.
+
+You should also add firewall rules to allow incoming IP traffic on
+TUN or TAP devices such as:
+.IP
+.B iptables -A INPUT -i tun+ -j ACCEPT
+.LP
+to allow input packets from tun devices,
+.IP
+.B iptables -A FORWARD -i tun+ -j ACCEPT
+.LP
+to allow input packets from tun devices to be forwarded to
+other hosts on the local network,
+.IP
+.B iptables -A INPUT -i tap+ -j ACCEPT
+.LP
+to allow input packets from tap devices, and
+.IP
+.B iptables -A FORWARD -i tap+ -j ACCEPT
+.LP
+to allow input packets from tap devices to be forwarded to
+other hosts on the local network.
+
+These rules are secure if you use packet authentication,
+since no incoming packets will arrive on a TUN or TAP
+virtual device
+unless they first pass an HMAC authentication test.
+.\"*********************************************************
+.SH FAQ
+.I http://openvpn.net/faq.html
+.\"*********************************************************
+.SH HOWTO
+For a more comprehensive guide to setting up OpenVPN
+in a production setting, see the OpenVPN HOWTO at
+.I http://openvpn.net/howto.html
+.\"*********************************************************
+.SH PROTOCOL
+For a description of OpenVPN's underlying protocol,
+see
+.I http://openvpn.net/security.html
+.\"*********************************************************
+.SH WEB
+OpenVPN's web site is at
+.I http://openvpn.net/
+
+Go here to download the latest version of OpenVPN, subscribe
+to the mailing lists, read the mailing list
+archives, or browse the SVN repository.
+.\"*********************************************************
+.SH BUGS
+Report all bugs to the OpenVPN team <info@openvpn.net>.
+.\"*********************************************************
+.SH "SEE ALSO"
+.BR dhcpcd (8),
+.BR ifconfig (8),
+.BR openssl (1),
+.BR route (8),
+.BR scp (1)
+.BR ssh (1)
+.\"*********************************************************
+.SH NOTES
+.LP
+This product includes software developed by the
+OpenSSL Project (
+.I http://www.openssl.org/
+)
+
+For more information on the TLS protocol, see
+.I http://www.ietf.org/rfc/rfc2246.txt
+
+For more information on the LZO real-time compression library see
+.I http://www.oberhumer.com/opensource/lzo/
+.\"*********************************************************
+.SH COPYRIGHT
+Copyright (C) 2002-2010 OpenVPN Technologies, 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.
+.\"*********************************************************
+.SH AUTHORS
+James Yonan <jim@yonan.net>
diff --git a/ics-openvpn-stripped/main/openvpn/include/Makefile.am b/ics-openvpn-stripped/main/openvpn/include/Makefile.am
new file mode 100644
index 00000000..13dee61d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/include/Makefile.am
@@ -0,0 +1,15 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+include_HEADERS = openvpn-plugin.h
diff --git a/ics-openvpn-stripped/main/openvpn/include/openvpn-plugin.h b/ics-openvpn-stripped/main/openvpn/include/openvpn-plugin.h
new file mode 100644
index 00000000..5f2d4079
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/include/openvpn-plugin.h
@@ -0,0 +1,813 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_PLUGIN_H_
+#define OPENVPN_PLUGIN_H_
+
+#define OPENVPN_PLUGIN_VERSION 3
+
+#ifdef ENABLE_SSL
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include <polarssl/x509_crt.h>
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef x509_crt openvpn_x509_cert_t;
+#endif
+#else
+#include <openssl/x509.h>
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef X509 openvpn_x509_cert_t;
+#endif
+#endif
+#endif
+
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Plug-in types. These types correspond to the set of script callbacks
+ * supported by OpenVPN.
+ *
+ * This is the general call sequence to expect when running in server mode:
+ *
+ * Initial Server Startup:
+ *
+ * FUNC: openvpn_plugin_open_v1
+ * FUNC: openvpn_plugin_client_constructor_v1 (this is the top-level "generic"
+ * client template)
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_UP
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_ROUTE_UP
+ *
+ * New Client Connection:
+ *
+ * FUNC: openvpn_plugin_client_constructor_v1
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_ENABLE_PF
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_TLS_VERIFY (called once for every cert
+ * in the server chain)
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_TLS_FINAL
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_IPCHANGE
+ *
+ * [If OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY returned OPENVPN_PLUGIN_FUNC_DEFERRED,
+ * we don't proceed until authentication is verified via auth_control_file]
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_CLIENT_CONNECT_V2
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_LEARN_ADDRESS
+ *
+ * [Client session ensues]
+ *
+ * For each "TLS soft reset", according to reneg-sec option (or similar):
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_ENABLE_PF
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_TLS_VERIFY (called once for every cert
+ * in the server chain)
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_TLS_FINAL
+ *
+ * [If OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY returned OPENVPN_PLUGIN_FUNC_DEFERRED,
+ * we expect that authentication is verified via auth_control_file within
+ * the number of seconds defined by the "hand-window" option. Data channel traffic
+ * will continue to flow uninterrupted during this period.]
+ *
+ * [Client session continues]
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_CLIENT_DISCONNECT
+ * FUNC: openvpn_plugin_client_destructor_v1
+ *
+ * [ some time may pass ]
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_LEARN_ADDRESS (this coincides with a
+ * lazy free of initial
+ * learned addr object)
+ * Server Shutdown:
+ *
+ * FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_DOWN
+ * FUNC: openvpn_plugin_client_destructor_v1 (top-level "generic" client)
+ * FUNC: openvpn_plugin_close_v1
+ */
+#define OPENVPN_PLUGIN_UP 0
+#define OPENVPN_PLUGIN_DOWN 1
+#define OPENVPN_PLUGIN_ROUTE_UP 2
+#define OPENVPN_PLUGIN_IPCHANGE 3
+#define OPENVPN_PLUGIN_TLS_VERIFY 4
+#define OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY 5
+#define OPENVPN_PLUGIN_CLIENT_CONNECT 6
+#define OPENVPN_PLUGIN_CLIENT_DISCONNECT 7
+#define OPENVPN_PLUGIN_LEARN_ADDRESS 8
+#define OPENVPN_PLUGIN_CLIENT_CONNECT_V2 9
+#define OPENVPN_PLUGIN_TLS_FINAL 10
+#define OPENVPN_PLUGIN_ENABLE_PF 11
+#define OPENVPN_PLUGIN_ROUTE_PREDOWN 12
+#define OPENVPN_PLUGIN_N 13
+
+/*
+ * Build a mask out of a set of plug-in types.
+ */
+#define OPENVPN_PLUGIN_MASK(x) (1<<(x))
+
+/*
+ * A pointer to a plugin-defined object which contains
+ * the object state.
+ */
+typedef void *openvpn_plugin_handle_t;
+
+/*
+ * Return value for openvpn_plugin_func_v1 function
+ */
+#define OPENVPN_PLUGIN_FUNC_SUCCESS 0
+#define OPENVPN_PLUGIN_FUNC_ERROR 1
+#define OPENVPN_PLUGIN_FUNC_DEFERRED 2
+
+/*
+ * For Windows (needs to be modified for MSVC)
+ */
+#if defined(WIN32) && !defined(OPENVPN_PLUGIN_H)
+# define OPENVPN_EXPORT __declspec(dllexport)
+#else
+# define OPENVPN_EXPORT
+#endif
+
+/*
+ * If OPENVPN_PLUGIN_H is defined, we know that we are being
+ * included in an OpenVPN compile, rather than a plugin compile.
+ */
+#ifdef OPENVPN_PLUGIN_H
+
+/*
+ * We are compiling OpenVPN.
+ */
+#define OPENVPN_PLUGIN_DEF typedef
+#define OPENVPN_PLUGIN_FUNC(name) (*name)
+
+#else
+
+/*
+ * We are compiling plugin.
+ */
+#define OPENVPN_PLUGIN_DEF OPENVPN_EXPORT
+#define OPENVPN_PLUGIN_FUNC(name) name
+
+#endif
+
+/*
+ * Used by openvpn_plugin_func to return structured
+ * data. The plugin should allocate all structure
+ * instances, name strings, and value strings with
+ * malloc, since OpenVPN will assume that it
+ * can free the list by calling free() over the same.
+ */
+struct openvpn_plugin_string_list
+{
+ struct openvpn_plugin_string_list *next;
+ char *name;
+ char *value;
+};
+
+
+/* openvpn_plugin_{open,func}_v3() related structs */
+
+/* Defines version of the v3 plugin argument structs
+ *
+ * Whenever one or more of these structs are modified, this constant
+ * must be updated. A changelog should be appended in this comment
+ * as well, to make it easier to see what information is available
+ * in the different versions.
+ *
+ * Version Comment
+ * 1 Initial plugin v3 structures providing the same API as
+ * the v2 plugin interface, X509 certificate information +
+ * a logging API for plug-ins.
+ *
+ * 2 Added ssl_api member in struct openvpn_plugin_args_open_in
+ * which identifies the SSL implementation OpenVPN is compiled
+ * against.
+ *
+ */
+#define OPENVPN_PLUGINv3_STRUCTVER 2
+
+/**
+ * Definitions needed for the plug-in callback functions.
+ */
+typedef enum
+{
+ PLOG_ERR = (1 << 0), /* Error condition message */
+ PLOG_WARN = (1 << 1), /* General warning message */
+ PLOG_NOTE = (1 << 2), /* Informational message */
+ PLOG_DEBUG = (1 << 3), /* Debug message, displayed if verb >= 7 */
+
+ PLOG_ERRNO = (1 << 8), /* Add error description to message */
+ PLOG_NOMUTE = (1 << 9), /* Mute setting does not apply for message */
+
+} openvpn_plugin_log_flags_t;
+
+
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+# define _ovpn_chk_fmt(a, b) __attribute__ ((format(gnu_printf, (a), (b))))
+#else
+# define _ovpn_chk_fmt(a, b) __attribute__ ((format(__printf__, (a), (b))))
+#endif
+#else
+# define _ovpn_chk_fmt(a, b)
+#endif
+
+typedef void (*plugin_log_t) (openvpn_plugin_log_flags_t flags,
+ const char *plugin_name,
+ const char *format, ...) _ovpn_chk_fmt(3, 4);
+
+typedef void (*plugin_vlog_t) (openvpn_plugin_log_flags_t flags,
+ const char *plugin_name,
+ const char *format,
+ va_list arglist) _ovpn_chk_fmt(3, 0);
+
+#undef _ovpn_chk_fmt
+
+/**
+ * Used by the openvpn_plugin_open_v3() function to pass callback
+ * function pointers to the plug-in.
+ *
+ * plugin_log
+ * plugin_vlog : Use these functions to add information to the OpenVPN log file.
+ * Messages will only be displayed if the plugin_name parameter
+ * is set. PLOG_DEBUG messages will only be displayed with plug-in
+ * debug log verbosity (at the time of writing that's verb >= 7).
+ */
+struct openvpn_plugin_callbacks
+{
+ plugin_log_t plugin_log;
+ plugin_vlog_t plugin_vlog;
+};
+
+/**
+ * Used by the openvpn_plugin_open_v3() function to indicate to the
+ * plug-in what kind of SSL implementation OpenVPN uses. This is
+ * to avoid SEGV issues when OpenVPN is complied against PolarSSL
+ * and the plug-in against OpenSSL.
+ */
+typedef enum {
+ SSLAPI_NONE,
+ SSLAPI_OPENSSL,
+ SSLAPI_POLARSSL
+} ovpnSSLAPI;
+
+/**
+ * Arguments used to transport variables to the plug-in.
+ * The struct openvpn_plugin_args_open_in is only used
+ * by the openvpn_plugin_open_v3() function.
+ *
+ * STRUCT MEMBERS
+ *
+ * type_mask : Set by OpenVPN to the logical OR of all script
+ * types which this version of OpenVPN supports.
+ *
+ * argv : a NULL-terminated array of options provided to the OpenVPN
+ * "plug-in" directive. argv[0] is the dynamic library pathname.
+ *
+ * envp : a NULL-terminated array of OpenVPN-set environmental
+ * variables in "name=value" format. Note that for security reasons,
+ * these variables are not actually written to the "official"
+ * environmental variable store of the process.
+ *
+ * callbacks : a pointer to the plug-in callback function struct.
+ *
+ */
+struct openvpn_plugin_args_open_in
+{
+ const int type_mask;
+ const char ** const argv;
+ const char ** const envp;
+ struct openvpn_plugin_callbacks *callbacks;
+ const ovpnSSLAPI ssl_api;
+};
+
+
+/**
+ * Arguments used to transport variables from the plug-in back
+ * to the OpenVPN process. The struct openvpn_plugin_args_open_return
+ * is only used by the openvpn_plugin_open_v3() function.
+ *
+ * STRUCT MEMBERS
+ *
+ * *type_mask : The plug-in should set this value to the logical OR of all script
+ * types which the plug-in wants to intercept. For example, if the
+ * script wants to intercept the client-connect and client-disconnect
+ * script types:
+ *
+ * *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT)
+ * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT)
+ *
+ * *handle : Pointer to a global plug-in context, created by the plug-in. This pointer
+ * is passed on to the other plug-in calls.
+ *
+ * return_list : used to return data back to OpenVPN.
+ *
+ */
+struct openvpn_plugin_args_open_return
+{
+ int type_mask;
+ openvpn_plugin_handle_t *handle;
+ struct openvpn_plugin_string_list **return_list;
+};
+
+/**
+ * Arguments used to transport variables to and from the
+ * plug-in. The struct openvpn_plugin_args_func is only used
+ * by the openvpn_plugin_func_v3() function.
+ *
+ * STRUCT MEMBERS:
+ *
+ * type : one of the PLUGIN_x types.
+ *
+ * argv : a NULL-terminated array of "command line" options which
+ * would normally be passed to the script. argv[0] is the dynamic
+ * library pathname.
+ *
+ * envp : a NULL-terminated array of OpenVPN-set environmental
+ * variables in "name=value" format. Note that for security reasons,
+ * these variables are not actually written to the "official"
+ * environmental variable store of the process.
+ *
+ * *handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3().
+ *
+ * *per_client_context : the per-client context pointer which was returned by
+ * openvpn_plugin_client_constructor_v1, if defined.
+ *
+ * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_SSL defined)
+ *
+ * *current_cert : X509 Certificate object received from the client (only if compiled with ENABLE_SSL defined)
+ *
+ */
+struct openvpn_plugin_args_func_in
+{
+ const int type;
+ const char ** const argv;
+ const char ** const envp;
+ openvpn_plugin_handle_t handle;
+ void *per_client_context;
+#ifdef ENABLE_SSL
+ int current_cert_depth;
+ openvpn_x509_cert_t *current_cert;
+#else
+ int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */
+ void *__current_cert_disabled; /* Unused, for compatibility purposes only */
+#endif
+};
+
+
+/**
+ * Arguments used to transport variables to and from the
+ * plug-in. The struct openvpn_plugin_args_func is only used
+ * by the openvpn_plugin_func_v3() function.
+ *
+ * STRUCT MEMBERS:
+ *
+ * return_list : used to return data back to OpenVPN for further processing/usage by
+ * the OpenVPN executable.
+ *
+ */
+struct openvpn_plugin_args_func_return
+{
+ struct openvpn_plugin_string_list **return_list;
+};
+
+/*
+ * Multiple plugin modules can be cascaded, and modules can be
+ * used in tandem with scripts. The order of operation is that
+ * the module func() functions are called in the order that
+ * the modules were specified in the config file. If a script
+ * was specified as well, it will be called last. If the
+ * return code of the module/script controls an authentication
+ * function (such as tls-verify or auth-user-pass-verify), then
+ * every module and script must return success (0) in order for
+ * the connection to be authenticated.
+ *
+ * Notes:
+ *
+ * Plugins which use a privilege-separation model (by forking in
+ * their initialization function before the main OpenVPN process
+ * downgrades root privileges and/or executes a chroot) must
+ * daemonize after a fork if the "daemon" environmental variable is
+ * set. In addition, if the "daemon_log_redirect" variable is set,
+ * the plugin should preserve stdout/stderr across the daemon()
+ * syscall. See the daemonize() function in plugin/auth-pam/auth-pam.c
+ * for an example.
+ */
+
+/*
+ * Prototypes for functions which OpenVPN plug-ins must define.
+ */
+
+/*
+ * FUNCTION: openvpn_plugin_open_v2
+ *
+ * REQUIRED: YES
+ *
+ * Called on initial plug-in load. OpenVPN will preserve plug-in state
+ * across SIGUSR1 restarts but not across SIGHUP restarts. A SIGHUP reset
+ * will cause the plugin to be closed and reopened.
+ *
+ * ARGUMENTS
+ *
+ * *type_mask : Set by OpenVPN to the logical OR of all script
+ * types which this version of OpenVPN supports. The plug-in
+ * should set this value to the logical OR of all script types
+ * which the plug-in wants to intercept. For example, if the
+ * script wants to intercept the client-connect and
+ * client-disconnect script types:
+ *
+ * *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT)
+ * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT)
+ *
+ * argv : a NULL-terminated array of options provided to the OpenVPN
+ * "plug-in" directive. argv[0] is the dynamic library pathname.
+ *
+ * envp : a NULL-terminated array of OpenVPN-set environmental
+ * variables in "name=value" format. Note that for security reasons,
+ * these variables are not actually written to the "official"
+ * environmental variable store of the process.
+ *
+ * return_list : used to return data back to OpenVPN.
+ *
+ * RETURN VALUE
+ *
+ * An openvpn_plugin_handle_t value on success, NULL on failure
+ */
+OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v2)
+ (unsigned int *type_mask,
+ const char *argv[],
+ const char *envp[],
+ struct openvpn_plugin_string_list **return_list);
+
+/*
+ * FUNCTION: openvpn_plugin_func_v2
+ *
+ * Called to perform the work of a given script type.
+ *
+ * REQUIRED: YES
+ *
+ * ARGUMENTS
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * type : one of the PLUGIN_x types
+ *
+ * argv : a NULL-terminated array of "command line" options which
+ * would normally be passed to the script. argv[0] is the dynamic
+ * library pathname.
+ *
+ * envp : a NULL-terminated array of OpenVPN-set environmental
+ * variables in "name=value" format. Note that for security reasons,
+ * these variables are not actually written to the "official"
+ * environmental variable store of the process.
+ *
+ * per_client_context : the per-client context pointer which was returned by
+ * openvpn_plugin_client_constructor_v1, if defined.
+ *
+ * return_list : used to return data back to OpenVPN.
+ *
+ * RETURN VALUE
+ *
+ * OPENVPN_PLUGIN_FUNC_SUCCESS on success, OPENVPN_PLUGIN_FUNC_ERROR on failure
+ *
+ * In addition, OPENVPN_PLUGIN_FUNC_DEFERRED may be returned by
+ * OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY. This enables asynchronous
+ * authentication where the plugin (or one of its agents) may indicate
+ * authentication success/failure some number of seconds after the return
+ * of the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY handler by writing a single
+ * char to the file named by auth_control_file in the environmental variable
+ * list (envp).
+ *
+ * first char of auth_control_file:
+ * '0' -- indicates auth failure
+ * '1' -- indicates auth success
+ *
+ * OpenVPN will delete the auth_control_file after it goes out of scope.
+ *
+ * If an OPENVPN_PLUGIN_ENABLE_PF handler is defined and returns success
+ * for a particular client instance, packet filtering will be enabled for that
+ * instance. OpenVPN will then attempt to read the packet filter configuration
+ * from the temporary file named by the environmental variable pf_file. This
+ * file may be generated asynchronously and may be dynamically updated during the
+ * client session, however the client will be blocked from sending or receiving
+ * VPN tunnel packets until the packet filter file has been generated. OpenVPN
+ * will periodically test the packet filter file over the life of the client
+ * instance and reload when modified. OpenVPN will delete the packet filter file
+ * when the client instance goes out of scope.
+ *
+ * Packet filter file grammar:
+ *
+ * [CLIENTS DROP|ACCEPT]
+ * {+|-}common_name1
+ * {+|-}common_name2
+ * . . .
+ * [SUBNETS DROP|ACCEPT]
+ * {+|-}subnet1
+ * {+|-}subnet2
+ * . . .
+ * [END]
+ *
+ * Subnet: IP-ADDRESS | IP-ADDRESS/NUM_NETWORK_BITS
+ *
+ * CLIENTS refers to the set of clients (by their common-name) which
+ * this instance is allowed ('+') to connect to, or is excluded ('-')
+ * from connecting to. Note that in the case of client-to-client
+ * connections, such communication must be allowed by the packet filter
+ * configuration files of both clients.
+ *
+ * SUBNETS refers to IP addresses or IP address subnets which this
+ * instance may connect to ('+') or is excluded ('-') from connecting
+ * to.
+ *
+ * DROP or ACCEPT defines default policy when there is no explicit match
+ * for a common-name or subnet. The [END] tag must exist. A special
+ * purpose tag called [KILL] will immediately kill the client instance.
+ * A given client or subnet rule applies to both incoming and outgoing
+ * packets.
+ *
+ * See plugin/defer/simple.c for an example on using asynchronous
+ * authentication and client-specific packet filtering.
+ */
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v2)
+ (openvpn_plugin_handle_t handle,
+ const int type,
+ const char *argv[],
+ const char *envp[],
+ void *per_client_context,
+ struct openvpn_plugin_string_list **return_list);
+
+
+/*
+ * FUNCTION: openvpn_plugin_open_v3
+ *
+ * REQUIRED: YES
+ *
+ * Called on initial plug-in load. OpenVPN will preserve plug-in state
+ * across SIGUSR1 restarts but not across SIGHUP restarts. A SIGHUP reset
+ * will cause the plugin to be closed and reopened.
+ *
+ * ARGUMENTS
+ *
+ * version : fixed value, defines the API version of the OpenVPN plug-in API. The plug-in
+ * should validate that this value is matching the OPENVPN_PLUGINv3_STRUCTVER
+ * value.
+ *
+ * arguments : Structure with all arguments available to the plug-in.
+ *
+ * retptr : used to return data back to OpenVPN.
+ *
+ * RETURN VALUE
+ *
+ * OPENVPN_PLUGIN_FUNC_SUCCESS on success, OPENVPN_PLUGIN_FUNC_ERROR on failure
+ */
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v3)
+ (const int version,
+ struct openvpn_plugin_args_open_in const *arguments,
+ struct openvpn_plugin_args_open_return *retptr);
+
+/*
+ * FUNCTION: openvpn_plugin_func_v3
+ *
+ * Called to perform the work of a given script type.
+ *
+ * REQUIRED: YES
+ *
+ * ARGUMENTS
+ *
+ * version : fixed value, defines the API version of the OpenVPN plug-in API. The plug-in
+ * should validate that this value is matching the OPENVPN_PLUGIN_VERSION value.
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * return_list : used to return data back to OpenVPN.
+ *
+ * RETURN VALUE
+ *
+ * OPENVPN_PLUGIN_FUNC_SUCCESS on success, OPENVPN_PLUGIN_FUNC_ERROR on failure
+ *
+ * In addition, OPENVPN_PLUGIN_FUNC_DEFERRED may be returned by
+ * OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY. This enables asynchronous
+ * authentication where the plugin (or one of its agents) may indicate
+ * authentication success/failure some number of seconds after the return
+ * of the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY handler by writing a single
+ * char to the file named by auth_control_file in the environmental variable
+ * list (envp).
+ *
+ * first char of auth_control_file:
+ * '0' -- indicates auth failure
+ * '1' -- indicates auth success
+ *
+ * OpenVPN will delete the auth_control_file after it goes out of scope.
+ *
+ * If an OPENVPN_PLUGIN_ENABLE_PF handler is defined and returns success
+ * for a particular client instance, packet filtering will be enabled for that
+ * instance. OpenVPN will then attempt to read the packet filter configuration
+ * from the temporary file named by the environmental variable pf_file. This
+ * file may be generated asynchronously and may be dynamically updated during the
+ * client session, however the client will be blocked from sending or receiving
+ * VPN tunnel packets until the packet filter file has been generated. OpenVPN
+ * will periodically test the packet filter file over the life of the client
+ * instance and reload when modified. OpenVPN will delete the packet filter file
+ * when the client instance goes out of scope.
+ *
+ * Packet filter file grammar:
+ *
+ * [CLIENTS DROP|ACCEPT]
+ * {+|-}common_name1
+ * {+|-}common_name2
+ * . . .
+ * [SUBNETS DROP|ACCEPT]
+ * {+|-}subnet1
+ * {+|-}subnet2
+ * . . .
+ * [END]
+ *
+ * Subnet: IP-ADDRESS | IP-ADDRESS/NUM_NETWORK_BITS
+ *
+ * CLIENTS refers to the set of clients (by their common-name) which
+ * this instance is allowed ('+') to connect to, or is excluded ('-')
+ * from connecting to. Note that in the case of client-to-client
+ * connections, such communication must be allowed by the packet filter
+ * configuration files of both clients.
+ *
+ * SUBNETS refers to IP addresses or IP address subnets which this
+ * instance may connect to ('+') or is excluded ('-') from connecting
+ * to.
+ *
+ * DROP or ACCEPT defines default policy when there is no explicit match
+ * for a common-name or subnet. The [END] tag must exist. A special
+ * purpose tag called [KILL] will immediately kill the client instance.
+ * A given client or subnet rule applies to both incoming and outgoing
+ * packets.
+ *
+ * See plugin/defer/simple.c for an example on using asynchronous
+ * authentication and client-specific packet filtering.
+ */
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v3)
+ (const int version,
+ struct openvpn_plugin_args_func_in const *arguments,
+ struct openvpn_plugin_args_func_return *retptr);
+
+/*
+ * FUNCTION: openvpn_plugin_close_v1
+ *
+ * REQUIRED: YES
+ *
+ * ARGUMENTS
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * Called immediately prior to plug-in unload.
+ */
+OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_close_v1)
+ (openvpn_plugin_handle_t handle);
+
+/*
+ * FUNCTION: openvpn_plugin_abort_v1
+ *
+ * REQUIRED: NO
+ *
+ * ARGUMENTS
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * Called when OpenVPN is in the process of aborting due to a fatal error.
+ * Will only be called on an open context returned by a prior successful
+ * openvpn_plugin_open callback.
+ */
+OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_abort_v1)
+ (openvpn_plugin_handle_t handle);
+
+/*
+ * FUNCTION: openvpn_plugin_client_constructor_v1
+ *
+ * Called to allocate a per-client memory region, which
+ * is then passed to the openvpn_plugin_func_v2 function.
+ * This function is called every time the OpenVPN server
+ * constructs a client instance object, which normally
+ * occurs when a session-initiating packet is received
+ * by a new client, even before the client has authenticated.
+ *
+ * This function should allocate the private memory needed
+ * by the plugin to track individual OpenVPN clients, and
+ * return a void * to this memory region.
+ *
+ * REQUIRED: NO
+ *
+ * ARGUMENTS
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * RETURN VALUE
+ *
+ * void * pointer to plugin's private per-client memory region, or NULL
+ * if no memory region is required.
+ */
+OPENVPN_PLUGIN_DEF void * OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_constructor_v1)
+ (openvpn_plugin_handle_t handle);
+
+/*
+ * FUNCTION: openvpn_plugin_client_destructor_v1
+ *
+ * This function is called on client instance object destruction.
+ *
+ * REQUIRED: NO
+ *
+ * ARGUMENTS
+ *
+ * handle : the openvpn_plugin_handle_t value which was returned by
+ * openvpn_plugin_open.
+ *
+ * per_client_context : the per-client context pointer which was returned by
+ * openvpn_plugin_client_constructor_v1, if defined.
+ */
+OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_destructor_v1)
+ (openvpn_plugin_handle_t handle, void *per_client_context);
+
+/*
+ * FUNCTION: openvpn_plugin_select_initialization_point_v1
+ *
+ * Several different points exist in OpenVPN's initialization sequence where
+ * the openvpn_plugin_open function can be called. While the default is
+ * OPENVPN_PLUGIN_INIT_PRE_DAEMON, this function can be used to select a
+ * different initialization point. For example, if your plugin needs to
+ * return configuration parameters to OpenVPN, use
+ * OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE.
+ *
+ * REQUIRED: NO
+ *
+ * RETURN VALUE:
+ *
+ * An OPENVPN_PLUGIN_INIT_x value.
+ */
+#define OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE 1
+#define OPENVPN_PLUGIN_INIT_PRE_DAEMON 2 /* default */
+#define OPENVPN_PLUGIN_INIT_POST_DAEMON 3
+#define OPENVPN_PLUGIN_INIT_POST_UID_CHANGE 4
+
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_select_initialization_point_v1)
+ (void);
+
+/*
+ * FUNCTION: openvpn_plugin_min_version_required_v1
+ *
+ * This function is called by OpenVPN to query the minimum
+ plugin interface version number required by the plugin.
+ *
+ * REQUIRED: NO
+ *
+ * RETURN VALUE
+ *
+ * The minimum OpenVPN plugin interface version number necessary to support
+ * this plugin.
+ */
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_min_version_required_v1)
+ (void);
+
+/*
+ * Deprecated functions which are still supported for backward compatibility.
+ */
+
+OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v1)
+ (unsigned int *type_mask,
+ const char *argv[],
+ const char *envp[]);
+
+OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v1)
+ (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[]);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OPENVPN_PLUGIN_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/m4/.keep b/ics-openvpn-stripped/main/openvpn/m4/.keep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/m4/.keep
diff --git a/ics-openvpn-stripped/main/openvpn/m4/ax_emptyarray.m4 b/ics-openvpn-stripped/main/openvpn/m4/ax_emptyarray.m4
new file mode 100644
index 00000000..c6781c17
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/m4/ax_emptyarray.m4
@@ -0,0 +1,40 @@
+dnl @synopsis AX_EMPTY_ARRAY
+dnl
+dnl Define EMPTY_ARRAY_SIZE to be either "0"
+dnl or "" depending on which syntax the compiler
+dnl prefers for empty arrays in structs.
+dnl
+dnl @version
+dnl @author James Yonan <jim@yonan.net>
+AC_DEFUN([AX_EMPTY_ARRAY], [
+ AS_VAR_PUSHDEF([VAR],[ax_cv_c_empty_array])dnl
+ AC_CACHE_CHECK(
+ [for C compiler empty array size],
+ [VAR],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ ,
+ [[
+struct { int foo; int bar[0]; } mystruct;
+ ]]
+ )],
+ [VAR=0],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ ,
+ [[
+struct { int foo; int bar[]; } mystruct;
+ ]]
+ )],
+ [VAR=],
+ [AC_MSG_ERROR([C compiler is unable to creaty empty arrays])]
+ )]
+ )]
+ )dnl
+ AC_DEFINE_UNQUOTED(
+ [EMPTY_ARRAY_SIZE],
+ [$VAR],
+ [Dimension to use for empty array declaration]
+ )dnl
+ AS_VAR_POPDEF([VAR])dnl
+])
diff --git a/ics-openvpn-stripped/main/openvpn/m4/ax_socklen_t.m4 b/ics-openvpn-stripped/main/openvpn/m4/ax_socklen_t.m4
new file mode 100644
index 00000000..cd7cad8a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/m4/ax_socklen_t.m4
@@ -0,0 +1,65 @@
+dnl -- The following is base of curl's acinclude.m4 --
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc. So we
+dnl have to test to find something that will work.
+AC_DEFUN([AX_TYPE_SOCKLEN_T], [
+ AC_CHECK_TYPE(
+ [socklen_t],
+ ,
+ [
+ AS_VAR_PUSHDEF([VAR],[ax_cv_socklen_t_equiv])dnl
+ AC_CACHE_CHECK(
+ [for socklen_t equivalent],
+ [VAR],
+ [
+ #AS_CASE is not supported on <autoconf-2.60
+ case "${host}" in
+ *-mingw*) VAR=int ;;
+ *)
+ # Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t unsigned long "unsigned long"; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/types.h>
+#include <sys/socket.h>
+int getpeername (int, $arg2 *, $t *);
+ ]],
+ [[
+$t len;
+getpeername(0,0,&len);
+ ]]
+ )],
+ [VAR="$t"; break]
+ )
+ done
+ test -n "$VAR" && break
+ done
+ ;;
+ esac
+ ]
+ AS_VAR_IF(
+ [VAR],
+ [],
+ [AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])],
+ [AC_DEFINE_UNQUOTED(
+ [socklen_t],
+ [$VAR],
+ [type to use in place of socklen_t if not defined]
+ )]
+ )
+ )
+ ],
+ [[
+#include <sys/types.h>
+#ifdef WIN32
+#include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
+#endif
+ ]]
+ )
+])
diff --git a/ics-openvpn-stripped/main/openvpn/m4/ax_varargs.m4 b/ics-openvpn-stripped/main/openvpn/m4/ax_varargs.m4
new file mode 100644
index 00000000..c295d21f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/m4/ax_varargs.m4
@@ -0,0 +1,77 @@
+dnl @synopsis AX_CPP_VARARG_MACRO_GCC
+dnl
+dnl Test if the preprocessor understands GNU GCC-style vararg macros.
+dnl If it does, defines HAVE_CPP_VARARG_MACRO_GCC to 1.
+dnl
+dnl @version
+dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
+AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl
+ AS_VAR_PUSHDEF([VAR], [ax_cv_cpp_vararg_macro_gcc])dnl
+ AC_CACHE_CHECK(
+ [for GNU GCC vararg macro support],
+ [VAR],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#define macro(a, b...) func(a, b)
+int func(int a, int b, int c);
+ ]],
+ [[
+int i = macro(1, 2, 3);
+ ]]
+ )],
+ [VAR=yes],
+ [VAR=no]
+ )]
+ )dnl
+
+ AS_VAR_IF(
+ [VAR],
+ [yes],
+ [AC_DEFINE(
+ [HAVE_CPP_VARARG_MACRO_GCC],
+ [1],
+ [Define to 1 if your compiler supports GNU GCC-style variadic macros]
+ )]
+ )dnl
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+dnl @synopsis AX_CPP_VARARG_MACRO_ISO
+dnl
+dnl Test if the preprocessor understands ISO C 1999 vararg macros.
+dnl If it does, defines HAVE_CPP_VARARG_MACRO_ISO to 1.
+dnl
+dnl @version
+dnl @author James Yonan <jim@yonan.net>, Matthias Andree <matthias.andree@web.de>
+AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl
+ AS_VAR_PUSHDEF([VAR],[ax_cv_cpp_vararg_macro_iso])dnl
+ AC_CACHE_CHECK(
+ [for ISO C 1999 vararg macro support],
+ [VAR],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#define macro(a, ...) func(a, __VA_ARGS__)
+int func(int a, int b, int c);
+ ]],
+ [[
+int i = macro(1, 2, 3);
+ ]]
+ )],
+ [VAR=yes],
+ [VAR=no]
+ )]
+ )dnl
+
+ AS_VAR_IF(
+ [VAR],
+ [yes],
+ [AC_DEFINE(
+ [HAVE_CPP_VARARG_MACRO_ISO],
+ [1],
+ [Define to 1 if your compiler supports ISO C99 variadic macros]
+ )]
+ )dnl
+ AS_VAR_POPDEF([VAR])dnl
+])
diff --git a/ics-openvpn-stripped/main/openvpn/m4/pkg.m4 b/ics-openvpn-stripped/main/openvpn/m4/pkg.m4
new file mode 100644
index 00000000..9a71878c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/m4/pkg.m4
@@ -0,0 +1,159 @@
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.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., 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.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
diff --git a/ics-openvpn-stripped/main/openvpn/msvc-build.bat b/ics-openvpn-stripped/main/openvpn/msvc-build.bat
new file mode 100644
index 00000000..fd6d5588
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/msvc-build.bat
@@ -0,0 +1,48 @@
+@echo off
+rem Copyright (C) 2008-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+
+@rem this stupid command needed for SetEnv.cmd to operate
+setlocal ENABLEDELAYEDEXPANSION
+
+cd /d %0\..
+call msvc-env.bat
+
+set PLATFORMS=Win32
+set CONFIGURATIONS=Release
+
+if exist "%VCHOME%\vcvarsall.bat" (
+ call "%VCHOME%\vcvarsall.bat"
+) else if exist "%VCHOME%\bin\vcvars32.bat" (
+ call "%VCHOME%\bin\vcvars32.bat"
+) else (
+ echo Cannot detect visual studio
+ goto error
+)
+
+msbuild /help > nul 2>&1
+if errorlevel 1 set DO_VCBUILD=1
+
+for %%p in (%PLATFORMS%) do (
+ for %%c in (%CONFIGURATIONS%) do (
+ rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1
+
+ if "%DO_VCBUILD%" NEQ "" (
+ vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p"
+ for %%f in (error.log) do if %%~zf GTR 0 goto error
+ ) else (
+ msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p"
+ if errorlevel 1 goto error
+ )
+ )
+)
+
+exit /b 0
+goto end
+
+:error
+exit /b 1
+goto end
+
+:end
+
+endlocal
diff --git a/ics-openvpn-stripped/main/openvpn/msvc-dev.bat b/ics-openvpn-stripped/main/openvpn/msvc-dev.bat
new file mode 100644
index 00000000..dbd7be07
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/msvc-dev.bat
@@ -0,0 +1,26 @@
+@echo off
+
+setlocal
+cd /d %0\..
+call msvc-env.bat
+
+if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (
+ set IDE=%VSHOME%\Common7\IDE\VCExpress.exe
+) else if exist "%VSHOME%\Common7\IDE\devenv.exe" (
+ set IDE=%VSHOME%\Common7\IDE\devenv.exe
+) else (
+ echo "Cannot detect visual studio environment"
+ goto error
+)
+start "" "%IDE%" "%SOLUTION%"
+
+exit /b 0
+goto end
+
+:error
+exit /b 1
+goto end
+
+:end
+
+endlocal
diff --git a/ics-openvpn-stripped/main/openvpn/msvc-env.bat b/ics-openvpn-stripped/main/openvpn/msvc-env.bat
new file mode 100644
index 00000000..2dd0f00d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/msvc-env.bat
@@ -0,0 +1,30 @@
+@echo off
+
+rem Put your own settings at msvc-env-local.bat
+if exist msvc-env-local.bat call msvc-env-local.bat
+
+if "%ProgramFiles(x86)%"=="" set ProgramFiles(x86)=%ProgramFiles%
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools
+if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools
+if "%VSHOME%"=="" SET VSHOME=%VSCOMNTOOLS%\..\..
+if "%VCHOME%"=="" SET VCHOME=%VSHOME%\VC
+
+set SOURCEBASE=%cd%
+set SOLUTION=openvpn.sln
+set CPPFLAGS=%CPPFLAGS%;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS
+set CPPFLAGS=%CPPFLAGS%;NTDDI_VERSION=NTDDI_WINXP;_WIN32_WINNT=_WIN32_WINNT_WINXP
+set CPPFLAGS=%CPPFLAGS%;_USE_32BIT_TIME_T
+set CPPFLAGS=%CPPFLAGS%;%EXTRA_CPPFLAGS%
+
+if exist config-msvc-local.h set CPPFLAGS="%CPPFLAGS%;HAVE_CONFIG_MSVC_LOCAL_H"
+
+if "%OPENVPN_DEPROOT%" == "" set OPENVPN_DEPROOT=c:\Temp\openvpn-deps
+if "%OPENSSL_HOME%" == "" set OPENSSL_HOME=%OPENVPN_DEPROOT%
+if "%LZO_HOME%" == "" set LZO_HOME=%OPENVPN_DEPROOT%
+if "%PKCS11H_HOME%" == "" set PKCS11H_HOME=%OPENVPN_DEPROOT%
+if "%TAP_WINDOWS_HOME%" == "" set TAP_WINDOWS_HOME=%OPENVPN_DEPROOT%
+
+if not exist "%OPENSSL_HOME%" echo WARNING: openssl '%OPENSSL_HOME%' does not exist
+if not exist "%LZO_HOME%" echo WARNING: lzo '%LZO_HOME%' does not exist
+if not exist "%PKCS11H_HOME%" echo WARNING: pkcs11-helper '%PKCS11H_HOME%' does not exist
+if not exist "%TAP_WINDOWS_HOME%" echo WARNING: tap-windows '%TAP_WINDOWS_HOME%' does not exist
diff --git a/ics-openvpn-stripped/main/openvpn/openvpn.sln b/ics-openvpn-stripped/main/openvpn/openvpn.sln
new file mode 100644
index 00000000..90c01b89
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/openvpn.sln
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32
+ {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32
+ {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32
+ {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32
+ {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ics-openvpn-stripped/main/openvpn/sample/Makefile.am b/ics-openvpn-stripped/main/openvpn/sample/Makefile.am
new file mode 100644
index 00000000..be30c88a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/Makefile.am
@@ -0,0 +1,34 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ sample-plugins \
+ sample-config-files \
+ sample-windows \
+ sample-keys \
+ sample-scripts
+
+if WIN32
+sample_DATA = \
+ client.ovpn \
+ server.ovpn \
+ sample-windows/sample.ovpn
+
+client.ovpn: sample-config-files/client.conf
+ -rm -f client.ovpn
+ cp "$(srcdir)/sample-config-files/client.conf" client.ovpn
+server.ovpn: sample-config-files/server.conf
+ -rm -f server.ovpn
+ cp "$(srcdir)/sample-config-files/server.conf" server.ovpn
+endif
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/README b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/README
new file mode 100644
index 00000000..d53ac79a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/README
@@ -0,0 +1,6 @@
+Sample OpenVPN Configuration Files.
+
+These files are part of the OpenVPN HOWTO
+which is located at:
+
+http://openvpn.net/howto.html
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/client.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/client.conf
new file mode 100644
index 00000000..58b2038b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/client.conf
@@ -0,0 +1,123 @@
+##############################################
+# Sample client-side OpenVPN 2.0 config file #
+# for connecting to multi-client server. #
+# #
+# This configuration can be used by multiple #
+# clients, however each client should have #
+# its own cert and key files. #
+# #
+# On Windows, you might want to rename this #
+# file so it has a .ovpn extension #
+##############################################
+
+# Specify that we are a client and that we
+# will be pulling certain config file directives
+# from the server.
+client
+
+# Use the same setting as you are using on
+# the server.
+# On most systems, the VPN will not function
+# unless you partially or fully disable
+# the firewall for the TUN/TAP interface.
+;dev tap
+dev tun
+
+# Windows needs the TAP-Win32 adapter name
+# from the Network Connections panel
+# if you have more than one. On XP SP2,
+# you may need to disable the firewall
+# for the TAP adapter.
+;dev-node MyTap
+
+# Are we connecting to a TCP or
+# UDP server? Use the same setting as
+# on the server.
+;proto tcp
+proto udp
+
+# The hostname/IP and port of the server.
+# You can have multiple remote entries
+# to load balance between the servers.
+remote my-server-1 1194
+;remote my-server-2 1194
+
+# Choose a random host from the remote
+# list for load-balancing. Otherwise
+# try hosts in the order specified.
+;remote-random
+
+# Keep trying indefinitely to resolve the
+# host name of the OpenVPN server. Very useful
+# on machines which are not permanently connected
+# to the internet such as laptops.
+resolv-retry infinite
+
+# Most clients don't need to bind to
+# a specific local port number.
+nobind
+
+# Downgrade privileges after initialization (non-Windows only)
+;user nobody
+;group nobody
+
+# Try to preserve some state across restarts.
+persist-key
+persist-tun
+
+# If you are connecting through an
+# HTTP proxy to reach the actual OpenVPN
+# server, put the proxy server/IP and
+# port number here. See the man page
+# if your proxy server requires
+# authentication.
+;http-proxy-retry # retry on connection failures
+;http-proxy [proxy server] [proxy port #]
+
+# Wireless networks often produce a lot
+# of duplicate packets. Set this flag
+# to silence duplicate packet warnings.
+;mute-replay-warnings
+
+# SSL/TLS parms.
+# See the server config file for more
+# description. It's best to use
+# a separate .crt/.key file pair
+# for each client. A single ca
+# file can be used for all clients.
+ca ca.crt
+cert client.crt
+key client.key
+
+# Verify server certificate by checking
+# that the certicate has the nsCertType
+# field set to "server". This is an
+# important precaution to protect against
+# a potential attack discussed here:
+# http://openvpn.net/howto.html#mitm
+#
+# To use this feature, you will need to generate
+# your server certificates with the nsCertType
+# field set to "server". The build-key-server
+# script in the easy-rsa folder will do this.
+ns-cert-type server
+
+# If a tls-auth key is used on the server
+# then every client must also have the key.
+;tls-auth ta.key 1
+
+# Select a cryptographic cipher.
+# If the cipher option is used on the server
+# then you must also specify it here.
+;cipher x
+
+# Enable compression on the VPN link.
+# Don't enable this unless it is also
+# enabled in the server config file.
+comp-lzo
+
+# Set log file verbosity.
+verb 3
+
+# Silence repeating messages
+;mute 20
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/firewall.sh b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/firewall.sh
new file mode 100755
index 00000000..19d75ee9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/firewall.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# A Sample OpenVPN-aware firewall.
+
+# eth0 is connected to the internet.
+# eth1 is connected to a private subnet.
+
+# Change this subnet to correspond to your private
+# ethernet subnet. Home will use HOME_NET/24 and
+# Office will use OFFICE_NET/24.
+PRIVATE=10.0.0.0/24
+
+# Loopback address
+LOOP=127.0.0.1
+
+# Delete old iptables rules
+# and temporarily block all traffic.
+iptables -P OUTPUT DROP
+iptables -P INPUT DROP
+iptables -P FORWARD DROP
+iptables -F
+
+# Set default policies
+iptables -P OUTPUT ACCEPT
+iptables -P INPUT DROP
+iptables -P FORWARD DROP
+
+# Prevent external packets from using loopback addr
+iptables -A INPUT -i eth0 -s $LOOP -j DROP
+iptables -A FORWARD -i eth0 -s $LOOP -j DROP
+iptables -A INPUT -i eth0 -d $LOOP -j DROP
+iptables -A FORWARD -i eth0 -d $LOOP -j DROP
+
+# Anything coming from the Internet should have a real Internet address
+iptables -A FORWARD -i eth0 -s 192.168.0.0/16 -j DROP
+iptables -A FORWARD -i eth0 -s 172.16.0.0/12 -j DROP
+iptables -A FORWARD -i eth0 -s 10.0.0.0/8 -j DROP
+iptables -A INPUT -i eth0 -s 192.168.0.0/16 -j DROP
+iptables -A INPUT -i eth0 -s 172.16.0.0/12 -j DROP
+iptables -A INPUT -i eth0 -s 10.0.0.0/8 -j DROP
+
+# Block outgoing NetBios (if you have windows machines running
+# on the private subnet). This will not affect any NetBios
+# traffic that flows over the VPN tunnel, but it will stop
+# local windows machines from broadcasting themselves to
+# the internet.
+iptables -A FORWARD -p tcp --sport 137:139 -o eth0 -j DROP
+iptables -A FORWARD -p udp --sport 137:139 -o eth0 -j DROP
+iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP
+iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP
+
+# Check source address validity on packets going out to internet
+iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP
+
+# Allow local loopback
+iptables -A INPUT -s $LOOP -j ACCEPT
+iptables -A INPUT -d $LOOP -j ACCEPT
+
+# Allow incoming pings (can be disabled)
+iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
+
+# Allow services such as www and ssh (can be disabled)
+iptables -A INPUT -p tcp --dport http -j ACCEPT
+iptables -A INPUT -p tcp --dport ssh -j ACCEPT
+
+# Allow incoming OpenVPN packets
+# Duplicate the line below for each
+# OpenVPN tunnel, changing --dport n
+# to match the OpenVPN UDP port.
+#
+# In OpenVPN, the port number is
+# controlled by the --port n option.
+# If you put this option in the config
+# file, you can remove the leading '--'
+#
+# If you taking the stateful firewall
+# approach (see the OpenVPN HOWTO),
+# then comment out the line below.
+
+iptables -A INPUT -p udp --dport 1194 -j ACCEPT
+
+# Allow packets from TUN/TAP devices.
+# When OpenVPN is run in a secure mode,
+# it will authenticate packets prior
+# to their arriving on a tun or tap
+# interface. Therefore, it is not
+# necessary to add any filters here,
+# unless you want to restrict the
+# type of packets which can flow over
+# the tunnel.
+
+iptables -A INPUT -i tun+ -j ACCEPT
+iptables -A FORWARD -i tun+ -j ACCEPT
+iptables -A INPUT -i tap+ -j ACCEPT
+iptables -A FORWARD -i tap+ -j ACCEPT
+
+# Allow packets from private subnets
+iptables -A INPUT -i eth1 -j ACCEPT
+iptables -A FORWARD -i eth1 -j ACCEPT
+
+# Keep state of connections from local machine and private subnets
+iptables -A OUTPUT -m state --state NEW -o eth0 -j ACCEPT
+iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
+iptables -A FORWARD -m state --state NEW -o eth0 -j ACCEPT
+iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
+
+# Masquerade local subnet
+iptables -t nat -A POSTROUTING -s $PRIVATE -o eth0 -j MASQUERADE
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/home.up b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/home.up
new file mode 100755
index 00000000..9c347cc5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/home.up
@@ -0,0 +1,2 @@
+#!/bin/sh
+route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-client b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-client
new file mode 100644
index 00000000..d7f59e69
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-client
@@ -0,0 +1,25 @@
+# Perform a TLS loopback test -- client side.
+#
+# This test performs a TLS negotiation once every 10 seconds,
+# and will terminate after 2 minutes.
+#
+# From the root directory of the OpenVPN distribution,
+# after openvpn has been built, run:
+#
+# ./openvpn --config sample-config-files/loopback-client (In one window)
+# ./openvpn --config sample-config-files/loopback-server (Simultaneously in another window)
+
+rport 16000
+lport 16001
+remote localhost
+local localhost
+dev null
+verb 3
+reneg-sec 10
+tls-client
+ca sample-keys/ca.crt
+key sample-keys/client.key
+cert sample-keys/client.crt
+cipher DES-EDE3-CBC
+ping 1
+inactive 120 10000000
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-server b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-server
new file mode 100644
index 00000000..9d21bcec
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/loopback-server
@@ -0,0 +1,26 @@
+# Perform a TLS loopback test -- server side.
+#
+# This test performs a TLS negotiation once every 10 seconds,
+# and will terminate after 2 minutes.
+#
+# From the root directory of the OpenVPN distribution,
+# after openvpn has been built, run:
+#
+# ./openvpn --config sample-config-files/loopback-client (In one window)
+# ./openvpn --config sample-config-files/loopback-server (Simultaneously in another window)
+
+rport 16001
+lport 16000
+remote localhost
+local localhost
+dev null
+verb 3
+reneg-sec 10
+tls-server
+dh sample-keys/dh1024.pem
+ca sample-keys/ca.crt
+key sample-keys/server.key
+cert sample-keys/server.crt
+cipher DES-EDE3-CBC
+ping 1
+inactive 120 10000000
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/office.up b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/office.up
new file mode 100755
index 00000000..74a71a33
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/office.up
@@ -0,0 +1,2 @@
+#!/bin/sh
+route add -net 10.0.1.0 netmask 255.255.255.0 gw $5
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-shutdown.sh b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-shutdown.sh
new file mode 100755
index 00000000..8ed2d1d5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-shutdown.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# stop all openvpn processes
+
+killall -TERM openvpn
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-startup.sh b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-startup.sh
new file mode 100755
index 00000000..0ee006bc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/openvpn-startup.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# A sample OpenVPN startup script
+# for Linux.
+
+# openvpn config file directory
+dir=/etc/openvpn
+
+# load the firewall
+$dir/firewall.sh
+
+# load TUN/TAP kernel module
+modprobe tun
+
+# enable IP forwarding
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# Invoke openvpn for each VPN tunnel
+# in daemon mode. Alternatively,
+# you could remove "--daemon" from
+# the command line and add "daemon"
+# to the config file.
+#
+# Each tunnel should run on a separate
+# UDP port. Use the "port" option
+# to control this. Like all of
+# OpenVPN's options, you can
+# specify "--port 8000" on the command
+# line or "port 8000" in the config
+# file.
+
+openvpn --cd $dir --daemon --config vpn1.conf
+openvpn --cd $dir --daemon --config vpn2.conf
+openvpn --cd $dir --daemon --config vpn2.conf
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/server.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/server.conf
new file mode 100644
index 00000000..467d5b8a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/server.conf
@@ -0,0 +1,306 @@
+#################################################
+# Sample OpenVPN 2.0 config file for #
+# multi-client server. #
+# #
+# This file is for the server side #
+# of a many-clients <-> one-server #
+# OpenVPN configuration. #
+# #
+# OpenVPN also supports #
+# single-machine <-> single-machine #
+# configurations (See the Examples page #
+# on the web site for more info). #
+# #
+# This config should work on Windows #
+# or Linux/BSD systems. Remember on #
+# Windows to quote pathnames and use #
+# double backslashes, e.g.: #
+# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
+# #
+# Comments are preceded with '#' or ';' #
+#################################################
+
+# Which local IP address should OpenVPN
+# listen on? (optional)
+;local a.b.c.d
+
+# Which TCP/UDP port should OpenVPN listen on?
+# If you want to run multiple OpenVPN instances
+# on the same machine, use a different port
+# number for each one. You will need to
+# open up this port on your firewall.
+port 1194
+
+# TCP or UDP server?
+;proto tcp
+proto udp
+
+# "dev tun" will create a routed IP tunnel,
+# "dev tap" will create an ethernet tunnel.
+# Use "dev tap0" if you are ethernet bridging
+# and have precreated a tap0 virtual interface
+# and bridged it with your ethernet interface.
+# If you want to control access policies
+# over the VPN, you must create firewall
+# rules for the the TUN/TAP interface.
+# On non-Windows systems, you can give
+# an explicit unit number, such as tun0.
+# On Windows, use "dev-node" for this.
+# On most systems, the VPN will not function
+# unless you partially or fully disable
+# the firewall for the TUN/TAP interface.
+;dev tap
+dev tun
+
+# Windows needs the TAP-Win32 adapter name
+# from the Network Connections panel if you
+# have more than one. On XP SP2 or higher,
+# you may need to selectively disable the
+# Windows firewall for the TAP adapter.
+# Non-Windows systems usually don't need this.
+;dev-node MyTap
+
+# SSL/TLS root certificate (ca), certificate
+# (cert), and private key (key). Each client
+# and the server must have their own cert and
+# key file. The server and all clients will
+# use the same ca file.
+#
+# See the "easy-rsa" directory for a series
+# of scripts for generating RSA certificates
+# and private keys. Remember to use
+# a unique Common Name for the server
+# and each of the client certificates.
+#
+# Any X509 key management system can be used.
+# OpenVPN can also use a PKCS #12 formatted key file
+# (see "pkcs12" directive in man page).
+ca ca.crt
+cert server.crt
+key server.key # This file should be kept secret
+
+# Diffie hellman parameters.
+# Generate your own with:
+# openssl dhparam -out dh1024.pem 1024
+# Substitute 2048 for 1024 if you are using
+# 2048 bit keys.
+dh dh1024.pem
+
+# Network topology
+# Should be subnet (addressing via IP)
+# unless Windows clients v2.0.9 and lower have to
+# be supported (then net30, i.e. a /30 per client)
+# Defaults to net30 (not recommended)
+;topology subnet
+
+# Configure server mode and supply a VPN subnet
+# for OpenVPN to draw client addresses from.
+# The server will take 10.8.0.1 for itself,
+# the rest will be made available to clients.
+# Each client will be able to reach the server
+# on 10.8.0.1. Comment this line out if you are
+# ethernet bridging. See the man page for more info.
+server 10.8.0.0 255.255.255.0
+
+# Maintain a record of client <-> virtual IP address
+# associations in this file. If OpenVPN goes down or
+# is restarted, reconnecting clients can be assigned
+# the same virtual IP address from the pool that was
+# previously assigned.
+ifconfig-pool-persist ipp.txt
+
+# Configure server mode for ethernet bridging.
+# You must first use your OS's bridging capability
+# to bridge the TAP interface with the ethernet
+# NIC interface. Then you must manually set the
+# IP/netmask on the bridge interface, here we
+# assume 10.8.0.4/255.255.255.0. Finally we
+# must set aside an IP range in this subnet
+# (start=10.8.0.50 end=10.8.0.100) to allocate
+# to connecting clients. Leave this line commented
+# out unless you are ethernet bridging.
+;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
+
+# Configure server mode for ethernet bridging
+# using a DHCP-proxy, where clients talk
+# to the OpenVPN server-side DHCP server
+# to receive their IP address allocation
+# and DNS server addresses. You must first use
+# your OS's bridging capability to bridge the TAP
+# interface with the ethernet NIC interface.
+# Note: this mode only works on clients (such as
+# Windows), where the client-side TAP adapter is
+# bound to a DHCP client.
+;server-bridge
+
+# Push routes to the client to allow it
+# to reach other private subnets behind
+# the server. Remember that these
+# private subnets will also need
+# to know to route the OpenVPN client
+# address pool (10.8.0.0/255.255.255.0)
+# back to the OpenVPN server.
+;push "route 192.168.10.0 255.255.255.0"
+;push "route 192.168.20.0 255.255.255.0"
+
+# To assign specific IP addresses to specific
+# clients or if a connecting client has a private
+# subnet behind it that should also have VPN access,
+# use the subdirectory "ccd" for client-specific
+# configuration files (see man page for more info).
+
+# EXAMPLE: Suppose the client
+# having the certificate common name "Thelonious"
+# also has a small subnet behind his connecting
+# machine, such as 192.168.40.128/255.255.255.248.
+# First, uncomment out these lines:
+;client-config-dir ccd
+;route 192.168.40.128 255.255.255.248
+# Then create a file ccd/Thelonious with this line:
+# iroute 192.168.40.128 255.255.255.248
+# This will allow Thelonious' private subnet to
+# access the VPN. This example will only work
+# if you are routing, not bridging, i.e. you are
+# using "dev tun" and "server" directives.
+
+# EXAMPLE: Suppose you want to give
+# Thelonious a fixed VPN IP address of 10.9.0.1.
+# First uncomment out these lines:
+;client-config-dir ccd
+;route 10.9.0.0 255.255.255.252
+# Then add this line to ccd/Thelonious:
+# ifconfig-push 10.9.0.1 10.9.0.2
+
+# Suppose that you want to enable different
+# firewall access policies for different groups
+# of clients. There are two methods:
+# (1) Run multiple OpenVPN daemons, one for each
+# group, and firewall the TUN/TAP interface
+# for each group/daemon appropriately.
+# (2) (Advanced) Create a script to dynamically
+# modify the firewall in response to access
+# from different clients. See man
+# page for more info on learn-address script.
+;learn-address ./script
+
+# If enabled, this directive will configure
+# all clients to redirect their default
+# network gateway through the VPN, causing
+# all IP traffic such as web browsing and
+# and DNS lookups to go through the VPN
+# (The OpenVPN server machine may need to NAT
+# or bridge the TUN/TAP interface to the internet
+# in order for this to work properly).
+;push "redirect-gateway def1 bypass-dhcp"
+
+# Certain Windows-specific network settings
+# can be pushed to clients, such as DNS
+# or WINS server addresses. CAVEAT:
+# http://openvpn.net/faq.html#dhcpcaveats
+# The addresses below refer to the public
+# DNS servers provided by opendns.com.
+;push "dhcp-option DNS 208.67.222.222"
+;push "dhcp-option DNS 208.67.220.220"
+
+# Uncomment this directive to allow different
+# clients to be able to "see" each other.
+# By default, clients will only see the server.
+# To force clients to only see the server, you
+# will also need to appropriately firewall the
+# server's TUN/TAP interface.
+;client-to-client
+
+# Uncomment this directive if multiple clients
+# might connect with the same certificate/key
+# files or common names. This is recommended
+# only for testing purposes. For production use,
+# each client should have its own certificate/key
+# pair.
+#
+# IF YOU HAVE NOT GENERATED INDIVIDUAL
+# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
+# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
+# UNCOMMENT THIS LINE OUT.
+;duplicate-cn
+
+# The keepalive directive causes ping-like
+# messages to be sent back and forth over
+# the link so that each side knows when
+# the other side has gone down.
+# Ping every 10 seconds, assume that remote
+# peer is down if no ping received during
+# a 120 second time period.
+keepalive 10 120
+
+# For extra security beyond that provided
+# by SSL/TLS, create an "HMAC firewall"
+# to help block DoS attacks and UDP port flooding.
+#
+# Generate with:
+# openvpn --genkey --secret ta.key
+#
+# The server and each client must have
+# a copy of this key.
+# The second parameter should be '0'
+# on the server and '1' on the clients.
+;tls-auth ta.key 0 # This file is secret
+
+# Select a cryptographic cipher.
+# This config item must be copied to
+# the client config file as well.
+;cipher BF-CBC # Blowfish (default)
+;cipher AES-128-CBC # AES
+;cipher DES-EDE3-CBC # Triple-DES
+
+# Enable compression on the VPN link.
+# If you enable it here, you must also
+# enable it in the client config file.
+comp-lzo
+
+# The maximum number of concurrently connected
+# clients we want to allow.
+;max-clients 100
+
+# It's a good idea to reduce the OpenVPN
+# daemon's privileges after initialization.
+#
+# You can uncomment this out on
+# non-Windows systems.
+;user nobody
+;group nobody
+
+# The persist options will try to avoid
+# accessing certain resources on restart
+# that may no longer be accessible because
+# of the privilege downgrade.
+persist-key
+persist-tun
+
+# Output a short status file showing
+# current connections, truncated
+# and rewritten every minute.
+status openvpn-status.log
+
+# By default, log messages will go to the syslog (or
+# on Windows, if running as a service, they will go to
+# the "\Program Files\OpenVPN\log" directory).
+# Use log or log-append to override this default.
+# "log" will truncate the log file on OpenVPN startup,
+# while "log-append" will append to it. Use one
+# or the other (but not both).
+;log openvpn.log
+;log-append openvpn.log
+
+# Set the appropriate level of log
+# file verbosity.
+#
+# 0 is silent, except for fatal errors
+# 4 is reasonable for general usage
+# 5 and 6 can help to debug connection problems
+# 9 is extremely verbose
+verb 3
+
+# Silence repeating messages. At most 20
+# sequential messages of the same message
+# category will be output to the log.
+;mute 20
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-home.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-home.conf
new file mode 100644
index 00000000..c9666874
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-home.conf
@@ -0,0 +1,72 @@
+#
+# Sample OpenVPN configuration file for
+# home using a pre-shared static key.
+#
+# '#' or ';' may be used to delimit comments.
+
+# Use a dynamic tun device.
+# For Linux 2.2 or non-Linux OSes,
+# you may want to use an explicit
+# unit number such as "tun1".
+# OpenVPN also supports virtual
+# ethernet "tap" devices.
+dev tun
+
+# Our OpenVPN peer is the office gateway.
+remote 1.2.3.4
+
+# 10.1.0.2 is our local VPN endpoint (home).
+# 10.1.0.1 is our remote VPN endpoint (office).
+ifconfig 10.1.0.2 10.1.0.1
+
+# Our up script will establish routes
+# once the VPN is alive.
+up ./home.up
+
+# Our pre-shared static key
+secret static.key
+
+# OpenVPN 2.0 uses UDP port 1194 by default
+# (official port assignment by iana.org 11/04).
+# OpenVPN 1.x uses UDP port 5000 by default.
+# Each OpenVPN tunnel must use
+# a different port number.
+# lport or rport can be used
+# to denote different ports
+# for local and remote.
+; port 1194
+
+# Downgrade UID and GID to
+# "nobody" after initialization
+# for extra security.
+; user nobody
+; group nobody
+
+# If you built OpenVPN with
+# LZO compression, uncomment
+# out the following line.
+; comp-lzo
+
+# Send a UDP ping to remote once
+# every 15 seconds to keep
+# stateful firewall connection
+# alive. Uncomment this
+# out if you are using a stateful
+# firewall.
+; ping 15
+
+# Uncomment this section for a more reliable detection when a system
+# loses its connection. For example, dial-ups or laptops that
+# travel to other locations.
+; ping 15
+; ping-restart 45
+; ping-timer-rem
+; persist-tun
+; persist-key
+
+# Verbosity level.
+# 0 -- quiet except for fatal errors.
+# 1 -- mostly quiet, but display non-fatal network errors.
+# 3 -- medium output, good for normal operation.
+# 9 -- verbose, good for troubleshooting
+verb 3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-office.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-office.conf
new file mode 100644
index 00000000..68030cc9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/static-office.conf
@@ -0,0 +1,69 @@
+#
+# Sample OpenVPN configuration file for
+# office using a pre-shared static key.
+#
+# '#' or ';' may be used to delimit comments.
+
+# Use a dynamic tun device.
+# For Linux 2.2 or non-Linux OSes,
+# you may want to use an explicit
+# unit number such as "tun1".
+# OpenVPN also supports virtual
+# ethernet "tap" devices.
+dev tun
+
+# 10.1.0.1 is our local VPN endpoint (office).
+# 10.1.0.2 is our remote VPN endpoint (home).
+ifconfig 10.1.0.1 10.1.0.2
+
+# Our up script will establish routes
+# once the VPN is alive.
+up ./office.up
+
+# Our pre-shared static key
+secret static.key
+
+# OpenVPN 2.0 uses UDP port 1194 by default
+# (official port assignment by iana.org 11/04).
+# OpenVPN 1.x uses UDP port 5000 by default.
+# Each OpenVPN tunnel must use
+# a different port number.
+# lport or rport can be used
+# to denote different ports
+# for local and remote.
+; port 1194
+
+# Downgrade UID and GID to
+# "nobody" after initialization
+# for extra security.
+; user nobody
+; group nobody
+
+# If you built OpenVPN with
+# LZO compression, uncomment
+# out the following line.
+; comp-lzo
+
+# Send a UDP ping to remote once
+# every 15 seconds to keep
+# stateful firewall connection
+# alive. Uncomment this
+# out if you are using a stateful
+# firewall.
+; ping 15
+
+# Uncomment this section for a more reliable detection when a system
+# loses its connection. For example, dial-ups or laptops that
+# travel to other locations.
+; ping 15
+; ping-restart 45
+; ping-timer-rem
+; persist-tun
+; persist-key
+
+# Verbosity level.
+# 0 -- quiet except for fatal errors.
+# 1 -- mostly quiet, but display non-fatal network errors.
+# 3 -- medium output, good for normal operation.
+# 9 -- verbose, good for troubleshooting
+verb 3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-home.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-home.conf
new file mode 100644
index 00000000..daa4ea1e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-home.conf
@@ -0,0 +1,83 @@
+#
+# Sample OpenVPN configuration file for
+# home using SSL/TLS mode and RSA certificates/keys.
+#
+# '#' or ';' may be used to delimit comments.
+
+# Use a dynamic tun device.
+# For Linux 2.2 or non-Linux OSes,
+# you may want to use an explicit
+# unit number such as "tun1".
+# OpenVPN also supports virtual
+# ethernet "tap" devices.
+dev tun
+
+# Our OpenVPN peer is the office gateway.
+remote 1.2.3.4
+
+# 10.1.0.2 is our local VPN endpoint (home).
+# 10.1.0.1 is our remote VPN endpoint (office).
+ifconfig 10.1.0.2 10.1.0.1
+
+# Our up script will establish routes
+# once the VPN is alive.
+up ./home.up
+
+# In SSL/TLS key exchange, Office will
+# assume server role and Home
+# will assume client role.
+tls-client
+
+# Certificate Authority file
+ca my-ca.crt
+
+# Our certificate/public key
+cert home.crt
+
+# Our private key
+key home.key
+
+# OpenVPN 2.0 uses UDP port 1194 by default
+# (official port assignment by iana.org 11/04).
+# OpenVPN 1.x uses UDP port 5000 by default.
+# Each OpenVPN tunnel must use
+# a different port number.
+# lport or rport can be used
+# to denote different ports
+# for local and remote.
+; port 1194
+
+# Downgrade UID and GID to
+# "nobody" after initialization
+# for extra security.
+; user nobody
+; group nobody
+
+# If you built OpenVPN with
+# LZO compression, uncomment
+# out the following line.
+; comp-lzo
+
+# Send a UDP ping to remote once
+# every 15 seconds to keep
+# stateful firewall connection
+# alive. Uncomment this
+# out if you are using a stateful
+# firewall.
+; ping 15
+
+# Uncomment this section for a more reliable detection when a system
+# loses its connection. For example, dial-ups or laptops that
+# travel to other locations.
+; ping 15
+; ping-restart 45
+; ping-timer-rem
+; persist-tun
+; persist-key
+
+# Verbosity level.
+# 0 -- quiet except for fatal errors.
+# 1 -- mostly quiet, but display non-fatal network errors.
+# 3 -- medium output, good for normal operation.
+# 9 -- verbose, good for troubleshooting
+verb 3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-office.conf b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-office.conf
new file mode 100644
index 00000000..f790f469
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/tls-office.conf
@@ -0,0 +1,83 @@
+#
+# Sample OpenVPN configuration file for
+# office using SSL/TLS mode and RSA certificates/keys.
+#
+# '#' or ';' may be used to delimit comments.
+
+# Use a dynamic tun device.
+# For Linux 2.2 or non-Linux OSes,
+# you may want to use an explicit
+# unit number such as "tun1".
+# OpenVPN also supports virtual
+# ethernet "tap" devices.
+dev tun
+
+# 10.1.0.1 is our local VPN endpoint (office).
+# 10.1.0.2 is our remote VPN endpoint (home).
+ifconfig 10.1.0.1 10.1.0.2
+
+# Our up script will establish routes
+# once the VPN is alive.
+up ./office.up
+
+# In SSL/TLS key exchange, Office will
+# assume server role and Home
+# will assume client role.
+tls-server
+
+# Diffie-Hellman Parameters (tls-server only)
+dh dh1024.pem
+
+# Certificate Authority file
+ca my-ca.crt
+
+# Our certificate/public key
+cert office.crt
+
+# Our private key
+key office.key
+
+# OpenVPN 2.0 uses UDP port 1194 by default
+# (official port assignment by iana.org 11/04).
+# OpenVPN 1.x uses UDP port 5000 by default.
+# Each OpenVPN tunnel must use
+# a different port number.
+# lport or rport can be used
+# to denote different ports
+# for local and remote.
+; port 1194
+
+# Downgrade UID and GID to
+# "nobody" after initialization
+# for extra security.
+; user nobody
+; group nobody
+
+# If you built OpenVPN with
+# LZO compression, uncomment
+# out the following line.
+; comp-lzo
+
+# Send a UDP ping to remote once
+# every 15 seconds to keep
+# stateful firewall connection
+# alive. Uncomment this
+# out if you are using a stateful
+# firewall.
+; ping 15
+
+# Uncomment this section for a more reliable detection when a system
+# loses its connection. For example, dial-ups or laptops that
+# travel to other locations.
+; ping 15
+; ping-restart 45
+; ping-timer-rem
+; persist-tun
+; persist-key
+
+# Verbosity level.
+# 0 -- quiet except for fatal errors.
+# 1 -- mostly quiet, but display non-fatal network errors.
+# 3 -- medium output, good for normal operation.
+# 9 -- verbose, good for troubleshooting
+verb 3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-client-config b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-client-config
new file mode 100644
index 00000000..03c5c1fa
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-client-config
@@ -0,0 +1,11 @@
+# This OpenVPN config file
+# is the client side counterpart
+# of xinetd-server-config
+
+dev tun
+ifconfig 10.4.0.1 10.4.0.2
+remote my-server
+port 1194
+user nobody
+secret /root/openvpn/key
+inactive 600
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-server-config b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-server-config
new file mode 100644
index 00000000..803a6f8f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-config-files/xinetd-server-config
@@ -0,0 +1,25 @@
+# An xinetd configuration file for OpenVPN.
+#
+# This file should be renamed to openvpn or something suitably
+# descriptive and copied to the /etc/xinetd.d directory.
+# xinetd can then be made aware of this file by restarting
+# it or sending it a SIGHUP signal.
+#
+# For each potential incoming client, create a separate version
+# of this configuration file on a unique port number. Also note
+# that the key file and ifconfig endpoints should be unique for
+# each client. This configuration assumes that the OpenVPN
+# executable and key live in /root/openvpn. Change this to fit
+# your environment.
+
+service openvpn_1
+{
+ type = UNLISTED
+ port = 1194
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = root
+ server = /root/openvpn/openvpn
+ server_args = --inetd --dev tun --ifconfig 10.4.0.2 10.4.0.1 --secret /root/openvpn/key --inactive 600 --user nobody
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/README b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/README
new file mode 100644
index 00000000..9f4f9187
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/README
@@ -0,0 +1,14 @@
+Sample RSA and EC keys.
+
+See the examples section of the man page for usage examples.
+
+NOTE: THESE KEYS ARE FOR TESTING PURPOSES ONLY.
+ DON'T USE THEM FOR ANY REAL WORK BECAUSE
+ THEY ARE TOTALLY INSECURE!
+
+ca.{crt,key} -- sample CA key/cert
+client.{crt,key} -- sample client key/cert
+server.{crt,key} -- sample server key/cert (nsCertType=server)
+pass.{crt,key} -- sample client key/cert with password-encrypted key
+ password = "password"
+ec-*.{crt,key} -- sample elliptic curve variants of the above
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.crt
new file mode 100644
index 00000000..e063ccce
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJLRzEL
+MAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNVBAoTDE9wZW5WUE4t
+VEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9tYWluMB4XDTA0MTEy
+NTE0NDA1NVoXDTE0MTEyMzE0NDA1NVowZjELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
+Ak5BMRAwDgYDVQQHEwdCSVNIS0VLMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxITAf
+BgkqhkiG9w0BCQEWEm1lQG15aG9zdC5teWRvbWFpbjCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEAqPjWJnesPu6bR/iec4FMz3opVaPdBHxg+ORKNmrnVZPh0t8/
+ZT34KXkYoI9B82scurp8UlZVXG8JdUsz+yai8ti9+g7vcuyKUtcCIjn0HLgmdPu5
+gFX25lB0pXw+XIU031dOfPvtROdG5YZN5yCErgCy7TE7zntLnkEDuRmyU6cCAwEA
+AaOBwzCBwDAdBgNVHQ4EFgQUiaZg47rqPq/8ZH9MvYzSSI3gzEYwgZAGA1UdIwSB
+iDCBhYAUiaZg47rqPq/8ZH9MvYzSSI3gzEahaqRoMGYxCzAJBgNVBAYTAktHMQsw
+CQYDVQQIEwJOQTEQMA4GA1UEBxMHQklTSEtFSzEVMBMGA1UEChMMT3BlblZQTi1U
+RVNUMSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW6CAQAwDAYDVR0T
+BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBfJoiWYrYdjM0mKPEzUQk0nLYTovBP
+I0es/2rfGrin1zbcFY+4dhVBd1E/StebnG+CP8r7QeEIwu7x8gYDdOLLsZn+2vBL
+e4jNU1ClI6Q0L7jrzhhunQ5mAaZztVyYwFB15odYcdN2iO0tP7jtEsvrRqxICNy3
+8itzViPTf5W4sA==
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.key
new file mode 100644
index 00000000..b4bf792a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ca.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCo+NYmd6w+7ptH+J5zgUzPeilVo90EfGD45Eo2audVk+HS3z9l
+PfgpeRigj0Hzaxy6unxSVlVcbwl1SzP7JqLy2L36Du9y7IpS1wIiOfQcuCZ0+7mA
+VfbmUHSlfD5chTTfV058++1E50blhk3nIISuALLtMTvOe0ueQQO5GbJTpwIDAQAB
+AoGAQuVREyWp4bhhbZr2UFBOco2ws6EOLWp4kdD/uI+WSoEjlHKiDJj+GJ1CrL5K
+o+4yD5MpCQf4/4FOQ0ukprfjJpDwDinTG6vzuWSLTHNiTgvksW3vy7IsNMJx97hT
+4D2QOOl9HhA50Qqg70teMPYXOgLRMVsdCIV7p7zDNy4nM+ECQQDX8m5ZcQmPtUDA
+38dPTfpL4U7kMB94FItJYH/Lk5kMW1/J33xymNhL+BHaG064ol9n2ubGW4XEO5t2
+qE1IOsVpAkEAyE/x/OBVSI1s75aYGlEwMd87p3qaDdtXT7WzujjRY7r8Y1ynkMU6
+GtMeneBX/lk4BY/6I+5bhAzce+hqhaXejwJBAL5Wg+c4GApf41xdogqHm7doNyYw
+OHyZ9w9NDDc+uGbI30xLPSCxEe0cEXgiG6foDpm2uzRZFTWaqHPU8pFYpAkCQGNX
+cpWM0/7VVK9Fqk1y8knpgfY/UWOJ4jU/0dCLGR0ywLSuYNPlXDmtdkOp3TnhGW14
+x/9F2NEWZ8pzq1B4wHUCQQC5ztD4m/rpiIpinoewUJODoeBJXYBKqx1+mdrALCq6
+ESvK1WRiusMaY3xmsdv4J2TB5iUPryELbn3jU12WGcQc
+-----END RSA PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.crt
new file mode 100644
index 00000000..c0474461
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.crt
@@ -0,0 +1,65 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 2 (0x2)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=KG, ST=NA, L=BISHKEK, O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ Validity
+ Not Before: Nov 25 14:46:49 2004 GMT
+ Not After : Nov 23 14:46:49 2014 GMT
+ Subject: C=KG, ST=NA, O=OpenVPN-TEST, CN=Test-Client/emailAddress=me@myhost.mydomain
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d2:12:5c:c6:4d:13:34:ae:cf:fa:ab:fe:cb:de:
+ 8c:f1:4b:4a:95:28:60:87:82:2c:b8:c1:e5:8e:c6:
+ 5d:11:58:61:a4:a5:f1:42:d7:86:74:6c:9d:9c:7a:
+ f0:3a:5c:29:e6:53:3b:5e:6d:d8:f0:45:06:2c:23:
+ ee:09:bc:02:8f:0e:b8:d5:33:1f:c3:4a:11:02:48:
+ 0b:cc:4b:ad:6e:74:e0:a2:53:b1:d6:cc:89:b9:e2:
+ 6f:db:15:b3:19:1e:57:04:79:48:3a:da:76:31:fc:
+ bf:d3:34:21:e7:32:d8:9e:06:4e:be:f3:e3:79:b0:
+ 54:fd:d1:42:32:aa:3e:7a:c1
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 17:B7:3F:C7:62:A0:A9:FD:A4:31:0E:58:D7:D9:94:7B:4B:3F:CB:56
+ X509v3 Authority Key Identifier:
+ keyid:89:A6:60:E3:BA:EA:3E:AF:FC:64:7F:4C:BD:8C:D2:48:8D:E0:CC:46
+ DirName:/C=KG/ST=NA/L=BISHKEK/O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ serial:00
+
+ Signature Algorithm: md5WithRSAEncryption
+ 61:c6:d1:fa:24:0f:c7:be:09:3b:d8:04:17:63:31:17:07:f9:
+ 56:99:af:4c:67:fa:db:cb:94:cf:55:a5:7b:16:20:8b:42:64:
+ 13:23:62:45:28:93:5e:36:f7:db:02:95:a1:e9:fd:e3:0f:8d:
+ 73:a1:7b:0e:55:78:4d:a5:c4:b7:22:12:a0:ee:55:e0:b8:0e:
+ c9:9b:12:e3:b0:ef:9b:68:93:57:6e:6c:ad:16:68:8e:8d:30:
+ 33:fe:2a:1b:c3:03:8f:b6:0a:2d:0c:b1:3c:bb:f9:58:3f:8c:
+ 81:59:6b:14:dd:62:b5:c2:93:ed:5d:c6:19:0f:9b:4b:52:b3:
+ 7c:78
+-----BEGIN CERTIFICATE-----
+MIIDNTCCAp6gAwIBAgIBAjANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJLRzEL
+MAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNVBAoTDE9wZW5WUE4t
+VEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9tYWluMB4XDTA0MTEy
+NTE0NDY0OVoXDTE0MTEyMzE0NDY0OVowajELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
+Ak5BMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxFDASBgNVBAMTC1Rlc3QtQ2xpZW50
+MSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW4wgZ8wDQYJKoZIhvcN
+AQEBBQADgY0AMIGJAoGBANISXMZNEzSuz/qr/svejPFLSpUoYIeCLLjB5Y7GXRFY
+YaSl8ULXhnRsnZx68DpcKeZTO15t2PBFBiwj7gm8Ao8OuNUzH8NKEQJIC8xLrW50
+4KJTsdbMibnib9sVsxkeVwR5SDradjH8v9M0Iecy2J4GTr7z43mwVP3RQjKqPnrB
+AgMBAAGjge4wgeswCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH
+ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFBe3P8dioKn9pDEOWNfZlHtL
+P8tWMIGQBgNVHSMEgYgwgYWAFImmYOO66j6v/GR/TL2M0kiN4MxGoWqkaDBmMQsw
+CQYDVQQGEwJLRzELMAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNV
+BAoTDE9wZW5WUE4tVEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9t
+YWluggEAMA0GCSqGSIb3DQEBBAUAA4GBAGHG0fokD8e+CTvYBBdjMRcH+VaZr0xn
++tvLlM9VpXsWIItCZBMjYkUok14299sClaHp/eMPjXOhew5VeE2lxLciEqDuVeC4
+DsmbEuOw75tok1dubK0WaI6NMDP+KhvDA4+2Ci0MsTy7+Vg/jIFZaxTdYrXCk+1d
+xhkPm0tSs3x4
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.key
new file mode 100644
index 00000000..17b95091
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/client.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDSElzGTRM0rs/6q/7L3ozxS0qVKGCHgiy4weWOxl0RWGGkpfFC
+14Z0bJ2cevA6XCnmUztebdjwRQYsI+4JvAKPDrjVMx/DShECSAvMS61udOCiU7HW
+zIm54m/bFbMZHlcEeUg62nYx/L/TNCHnMtieBk6+8+N5sFT90UIyqj56wQIDAQAB
+AoGBAK8RoIGekCfym99DYYfTg9A/t/tQeAnWYaDj7oSrKbqf1lgZ91OGPEZgkoVr
+KzLnxf9uU+bhUs8CJx+4HdO8/L9rAJA+oD9QNuMp0elN4AKuEGE1Eq3a0e3cmgPI
++VIoXM6WVAGgK9I03Zu/UerYQ/DdXWGOIsKhFe8qyQoG9pKxAkEA9ld6O9MHQt3d
+JAjJkgCNn4psozxjrfLWy2huXd3H3CRqGMjLITDGzdkVSgXjHokBYroi0+TZTu4M
+ulJSJaWwBQJBANpO2DAexH2zRHw5Z6QyeEVxz7B3/FzU4GgJx9BH+FSBh+F0G5Ln
+ir5Vst8vZ/LGcgpYjHQLNAvZVgUjiQ4Y6I0CQGvwMJL+CHR4GmmroAblTyjU0n1D
+/Lk/anZ+L73Za7U+D28ErFzCrpmLwRRKOBYtGfpUbOZDpCQ9kj4hy/TLALECQCcL
+9ysUNbzt9Y/qjJkX1d9F7gn4TBEmmkTBixW76bTjvjQbGlt6Qpyso2O8DPGlgPxM
+vkJ7RoHgC7y7kGYPGnkCQBVxSNGIjLx4NQBgN4HD0y4+fars1PTUGnckBcS4npb9
+onLNyerBlWdBwbARyBS7WPIbyyf5VCrn3yIqWxaARO0=
+-----END RSA PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/dh1024.pem b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/dh1024.pem
new file mode 100644
index 00000000..7ce05f0c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/dh1024.pem
@@ -0,0 +1,5 @@
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAJ419DBEOgmQTzo5qXl5fQcN9TN455wkOL7052HzxxRVMyhYmwQcgJvh
+1sa18fyfR9OiVEMYglOpkqVoGLN7qd5aQNNi5W7/C+VBdHTBJcGZJyyP5B3qcz32
+9mLJKudlVudV0Qxk5qUJaPZ/xupz0NyoVpviuiBOI1gNi8ovSXWzAgEC
+-----END DH PARAMETERS-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.crt
new file mode 100644
index 00000000..e190801d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.crt
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIIB4jCCAWmgAwIBAgIJALGEGB2g6cAXMAoGCCqGSM49BAMCMBUxEzARBgNVBAMT
+CkVDLVRlc3QgQ0EwHhcNMTQwMTE4MTYwMTUzWhcNMjQwMTE2MTYwMTUzWjAVMRMw
+EQYDVQQDEwpFQy1UZXN0IENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2S4AZT7j
+ZlPG/CXpT12CzCNSySyKmJt+fWyW/wzbRulVJpGHXRHpZZj2VNOUE72kqGUeshh6
+Um1o7lHGDSAkHOJpeW5FtryiKhwFc+4dsOCLTNLVFXQsEtY3gY14Uquio4GEMIGB
+MB0GA1UdDgQWBBS0mkFcuCZ8SLWZRAD/8LpBQcgGPDBFBgNVHSMEPjA8gBS0mkFc
+uCZ8SLWZRAD/8LpBQcgGPKEZpBcwFTETMBEGA1UEAxMKRUMtVGVzdCBDQYIJALGE
+GB2g6cAXMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMAoGCCqGSM49BAMCA2cA
+MGQCMHWlVTi0xNZstR8ZNH+7z0WlyIXyZe23ne3EXkO0thZLdv86kpxFMPW/llB+
+RMRKuQIweN97n7FQy5DTenr91U98KDFJ5Av4mDFRL1mkXiu3W1//4XD8yEYDQTRz
+/GARuOLL
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.key
new file mode 100644
index 00000000..51a72e1a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-ca.key
@@ -0,0 +1,6 @@
+-----BEGIN PRIVATE KEY-----
+MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDASU6X/mh2m2PayviL3
+teoml5soyIUcZfwZpVn6oNtnrLcAbIRsAJbM4xyGVp77G/6hZANiAATZLgBlPuNm
+U8b8JelPXYLMI1LJLIqYm359bJb/DNtG6VUmkYddEellmPZU05QTvaSoZR6yGHpS
+bWjuUcYNICQc4ml5bkW2vKIqHAVz7h2w4ItM0tUVdCwS1jeBjXhSq6I=
+-----END PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.crt
new file mode 100644
index 00000000..b797b022
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.crt
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 2 (0x2)
+ Signature Algorithm: ecdsa-with-SHA256
+ Issuer: CN=EC-Test CA
+ Validity
+ Not Before: Jan 18 16:02:37 2014 GMT
+ Not After : Jan 16 16:02:37 2024 GMT
+ Subject: CN=ec-client
+ Subject Public Key Info:
+ Public Key Algorithm: id-ecPublicKey
+ Public-Key: (384 bit)
+ pub:
+ 04:40:d9:b9:a2:44:1b:01:39:2c:14:ee:aa:70:6b:
+ 31:98:28:44:c9:61:bc:b7:0b:b5:53:49:c2:c0:0a:
+ 43:b0:08:50:cd:80:2f:5d:a4:89:f1:ff:7d:11:78:
+ f5:0c:b2:86:e2:59:f8:17:76:1b:22:f2:23:67:e7:
+ 55:90:ea:ce:0a:aa:da:05:f4:85:19:c9:ed:ae:6d:
+ a3:ad:56:7a:f6:33:c6:cf:bb:c7:39:fa:e4:d3:67:
+ df:f0:b8:4a:88:57:98
+ ASN1 OID: secp384r1
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ D8:E2:35:7B:CA:66:71:6B:D8:5B:F5:12:13:82:2D:ED:CD:E5:ED:7F
+ X509v3 Authority Key Identifier:
+ keyid:B4:9A:41:5C:B8:26:7C:48:B5:99:44:00:FF:F0:BA:41:41:C8:06:3C
+ DirName:/CN=EC-Test CA
+ serial:B1:84:18:1D:A0:E9:C0:17
+
+ X509v3 Extended Key Usage:
+ TLS Web Client Authentication
+ X509v3 Key Usage:
+ Digital Signature
+ Netscape Comment:
+ Easy-RSA Generated Certificate
+ Netscape Cert Type:
+ SSL Client
+ Signature Algorithm: ecdsa-with-SHA256
+ 30:64:02:30:41:8b:1a:fd:97:a8:bb:7c:d0:eb:1c:a2:ba:c0:
+ ac:2f:6d:80:07:5b:5c:ef:55:59:1a:92:56:66:94:ce:49:6a:
+ a9:57:49:b2:41:73:64:7e:01:ac:31:3a:7c:2a:bf:a5:02:30:
+ 2b:c4:a6:b1:0c:03:82:e3:e4:03:39:fb:19:d7:76:21:1b:7e:
+ 7f:aa:22:5d:90:a4:e1:2e:cd:ca:92:0f:b6:3f:80:dc:26:d2:
+ 09:34:8c:d1:61:bb:9d:ac:6d:8f:68:f0
+-----BEGIN CERTIFICATE-----
+MIICLTCCAbSgAwIBAgIBAjAKBggqhkjOPQQDAjAVMRMwEQYDVQQDEwpFQy1UZXN0
+IENBMB4XDTE0MDExODE2MDIzN1oXDTI0MDExNjE2MDIzN1owFDESMBAGA1UEAxMJ
+ZWMtY2xpZW50MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEQNm5okQbATksFO6qcGsx
+mChEyWG8twu1U0nCwApDsAhQzYAvXaSJ8f99EXj1DLKG4ln4F3YbIvIjZ+dVkOrO
+CqraBfSFGcntrm2jrVZ69jPGz7vHOfrk02ff8LhKiFeYo4HYMIHVMAkGA1UdEwQC
+MAAwHQYDVR0OBBYEFNjiNXvKZnFr2Fv1EhOCLe3N5e1/MEUGA1UdIwQ+MDyAFLSa
+QVy4JnxItZlEAP/wukFByAY8oRmkFzAVMRMwEQYDVQQDEwpFQy1UZXN0IENBggkA
+sYQYHaDpwBcwEwYDVR0lBAwwCgYIKwYBBQUHAwIwCwYDVR0PBAQDAgeAMC0GCWCG
+SAGG+EIBDQQgFh5FYXN5LVJTQSBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwEQYJYIZI
+AYb4QgEBBAQDAgeAMAoGCCqGSM49BAMCA2cAMGQCMEGLGv2XqLt80OscorrArC9t
+gAdbXO9VWRqSVmaUzklqqVdJskFzZH4BrDE6fCq/pQIwK8SmsQwDguPkAzn7Gdd2
+IRt+f6oiXZCk4S7NypIPtj+A3CbSCTSM0WG7naxtj2jw
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.key
new file mode 100644
index 00000000..60636ed2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-client.key
@@ -0,0 +1,6 @@
+-----BEGIN PRIVATE KEY-----
+MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDD9Agj8nr/8sIr0XHky
+mcn1oMb3vqOh2axFBaIvmOHYmqs11SIH1tKYelkNYy9zHTChZANiAARA2bmiRBsB
+OSwU7qpwazGYKETJYby3C7VTScLACkOwCFDNgC9dpInx/30RePUMsobiWfgXdhsi
+8iNn51WQ6s4KqtoF9IUZye2ubaOtVnr2M8bPu8c5+uTTZ9/wuEqIV5g=
+-----END PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.crt
new file mode 100644
index 00000000..99994729
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.crt
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 1 (0x1)
+ Signature Algorithm: ecdsa-with-SHA256
+ Issuer: CN=EC-Test CA
+ Validity
+ Not Before: Jan 18 16:02:31 2014 GMT
+ Not After : Jan 16 16:02:31 2024 GMT
+ Subject: CN=ec-server
+ Subject Public Key Info:
+ Public Key Algorithm: id-ecPublicKey
+ Public-Key: (384 bit)
+ pub:
+ 04:bd:8c:3a:af:2e:2f:2e:de:cf:d2:39:8d:b9:a6:
+ 13:96:80:6d:b5:b2:ee:97:62:3b:a2:32:38:77:1e:
+ fb:2a:ef:86:4b:d0:9e:4b:55:e0:9b:07:f9:64:2f:
+ 6b:a7:17:fd:65:dd:50:3f:1c:fa:fa:2f:39:2e:97:
+ d4:86:e5:4e:5a:d2:50:0b:f4:d7:08:62:67:53:44:
+ 62:e3:25:f2:fa:36:84:87:1d:03:e3:e9:9d:d9:66:
+ 51:dd:b4:c4:db:0b:05
+ ASN1 OID: secp384r1
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ X509v3 Subject Key Identifier:
+ EA:DF:7E:A3:D4:61:73:D7:01:AF:6E:0A:38:8D:33:D0:BD:24:4B:E1
+ X509v3 Authority Key Identifier:
+ keyid:B4:9A:41:5C:B8:26:7C:48:B5:99:44:00:FF:F0:BA:41:41:C8:06:3C
+ DirName:/CN=EC-Test CA
+ serial:B1:84:18:1D:A0:E9:C0:17
+
+ X509v3 Extended Key Usage:
+ TLS Web Server Authentication
+ X509v3 Key Usage:
+ Digital Signature, Key Encipherment
+ Netscape Comment:
+ Easy-RSA Generated Certificate
+ Netscape Cert Type:
+ SSL Server
+ Signature Algorithm: ecdsa-with-SHA256
+ 30:64:02:30:20:39:12:92:cc:a2:ca:45:b9:1a:8f:e0:c1:e7:
+ b7:4a:79:4d:07:07:81:72:08:b4:d4:7b:46:53:d7:72:32:d0:
+ d7:3e:e8:88:2b:c9:ba:8b:d5:94:4f:41:6c:d0:2e:a4:02:30:
+ 75:ff:c3:8a:c1:f5:79:1c:1a:08:16:31:c2:c1:6e:d4:33:dc:
+ 9f:04:0f:90:94:d9:75:c1:6d:71:28:62:cc:f6:89:7c:91:86:
+ a4:96:45:34:a0:8d:92:7e:dd:e3:da:4d
+-----BEGIN CERTIFICATE-----
+MIICLTCCAbSgAwIBAgIBATAKBggqhkjOPQQDAjAVMRMwEQYDVQQDEwpFQy1UZXN0
+IENBMB4XDTE0MDExODE2MDIzMVoXDTI0MDExNjE2MDIzMVowFDESMBAGA1UEAxMJ
+ZWMtc2VydmVyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEvYw6ry4vLt7P0jmNuaYT
+loBttbLul2I7ojI4dx77Ku+GS9CeS1Xgmwf5ZC9rpxf9Zd1QPxz6+i85LpfUhuVO
+WtJQC/TXCGJnU0Ri4yXy+jaEhx0D4+md2WZR3bTE2wsFo4HYMIHVMAkGA1UdEwQC
+MAAwHQYDVR0OBBYEFOrffqPUYXPXAa9uCjiNM9C9JEvhMEUGA1UdIwQ+MDyAFLSa
+QVy4JnxItZlEAP/wukFByAY8oRmkFzAVMRMwEQYDVQQDEwpFQy1UZXN0IENBggkA
+sYQYHaDpwBcwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMC0GCWCG
+SAGG+EIBDQQgFh5FYXN5LVJTQSBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwEQYJYIZI
+AYb4QgEBBAQDAgZAMAoGCCqGSM49BAMCA2cAMGQCMCA5EpLMospFuRqP4MHnt0p5
+TQcHgXIItNR7RlPXcjLQ1z7oiCvJuovVlE9BbNAupAIwdf/DisH1eRwaCBYxwsFu
+1DPcnwQPkJTZdcFtcShizPaJfJGGpJZFNKCNkn7d49pN
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.key
new file mode 100644
index 00000000..bb3cdf1a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/ec-server.key
@@ -0,0 +1,6 @@
+-----BEGIN PRIVATE KEY-----
+MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDD8bQlwrFrXHPmem0bt
+cBcU6nYfaZQbPdIDAB7edOOyevvzYH0qMtbaW95iSZLMRVWhZANiAAS9jDqvLi8u
+3s/SOY25phOWgG21su6XYjuiMjh3Hvsq74ZL0J5LVeCbB/lkL2unF/1l3VA/HPr6
+Lzkul9SG5U5a0lAL9NcIYmdTRGLjJfL6NoSHHQPj6Z3ZZlHdtMTbCwU=
+-----END PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.crt
new file mode 100644
index 00000000..8bb7b17a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.crt
@@ -0,0 +1,65 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 3 (0x3)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=KG, ST=NA, L=BISHKEK, O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ Validity
+ Not Before: Nov 25 14:48:55 2004 GMT
+ Not After : Nov 23 14:48:55 2014 GMT
+ Subject: C=KG, ST=NA, O=OpenVPN-TEST, CN=Test-Client-Password/emailAddress=me@myhost.mydomain
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ca:b4:05:67:7b:51:c1:d2:fe:21:57:b1:a5:57:
+ 5c:c0:86:38:05:a8:91:cf:e7:a4:bd:7a:76:d8:3b:
+ cf:fe:f3:78:65:24:d6:72:7d:1b:6d:b6:da:04:f2:
+ a8:f6:b4:04:78:d2:24:a7:21:2f:ca:29:46:96:0f:
+ 0b:91:31:66:1e:4d:22:9a:5d:05:17:99:9c:a0:7e:
+ e0:2a:be:78:0c:a1:b9:d4:04:c4:ec:f8:61:79:62:
+ b5:52:2d:f5:41:af:db:9f:8c:ab:08:1b:b7:95:b8:
+ c1:f0:29:d3:da:fb:00:3f:8e:5c:27:e3:8d:fa:ee:
+ dc:b4:3b:0b:8b:e0:ab:c1:c1
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 40:57:F1:8C:9C:86:B2:DA:E0:3F:A7:B8:D7:85:43:45:07:8A:40:73
+ X509v3 Authority Key Identifier:
+ keyid:89:A6:60:E3:BA:EA:3E:AF:FC:64:7F:4C:BD:8C:D2:48:8D:E0:CC:46
+ DirName:/C=KG/ST=NA/L=BISHKEK/O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ serial:00
+
+ Signature Algorithm: md5WithRSAEncryption
+ a5:79:72:7f:a2:08:28:8e:66:da:e1:d0:be:bb:97:3d:65:9f:
+ ab:1e:19:ac:f1:66:44:14:8f:4e:7c:eb:ea:1e:2f:57:ea:44:
+ 46:4c:b9:56:5b:c0:0c:58:d2:45:87:26:6d:82:de:8c:64:b8:
+ 8b:22:61:61:c6:68:36:08:9d:5a:fd:2f:e5:21:e1:a2:0c:7f:
+ 3e:ca:e1:06:ea:9f:81:62:3d:a0:ce:f1:1e:0d:ab:86:89:ed:
+ 9a:89:34:32:c9:e9:6d:7d:f5:11:c3:5d:7e:a5:f7:f1:a6:83:
+ 77:1b:94:67:d9:0f:5c:ac:0e:08:4a:88:98:65:49:eb:66:9e:
+ 2d:28
+-----BEGIN CERTIFICATE-----
+MIIDPjCCAqegAwIBAgIBAzANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJLRzEL
+MAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNVBAoTDE9wZW5WUE4t
+VEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9tYWluMB4XDTA0MTEy
+NTE0NDg1NVoXDTE0MTEyMzE0NDg1NVowczELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
+Ak5BMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxHTAbBgNVBAMTFFRlc3QtQ2xpZW50
+LVBhc3N3b3JkMSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW4wgZ8w
+DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMq0BWd7UcHS/iFXsaVXXMCGOAWokc/n
+pL16dtg7z/7zeGUk1nJ9G2222gTyqPa0BHjSJKchL8opRpYPC5ExZh5NIppdBReZ
+nKB+4Cq+eAyhudQExOz4YXlitVIt9UGv25+Mqwgbt5W4wfAp09r7AD+OXCfjjfru
+3LQ7C4vgq8HBAgMBAAGjge4wgeswCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYd
+T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFEBX8YychrLa
+4D+nuNeFQ0UHikBzMIGQBgNVHSMEgYgwgYWAFImmYOO66j6v/GR/TL2M0kiN4MxG
+oWqkaDBmMQswCQYDVQQGEwJLRzELMAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hL
+RUsxFTATBgNVBAoTDE9wZW5WUE4tVEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlo
+b3N0Lm15ZG9tYWluggEAMA0GCSqGSIb3DQEBBAUAA4GBAKV5cn+iCCiOZtrh0L67
+lz1ln6seGazxZkQUj0586+oeL1fqREZMuVZbwAxY0kWHJm2C3oxkuIsiYWHGaDYI
+nVr9L+Uh4aIMfz7K4Qbqn4FiPaDO8R4Nq4aJ7ZqJNDLJ6W199RHDXX6l9/Gmg3cb
+lGfZD1ysDghKiJhlSetmni0o
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.key
new file mode 100644
index 00000000..4916364c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pass.key
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,959F7365DBBFDB77
+
+nGm57l+rR/8dAZOHL/1x/6dt11zUca7rphjsgw6XRnSf3M/CWmHvHVjApWcNLEs5
+SWNMp1xfUogtGzsKoMBbnlZLDA7RVHUYD6dVMyCpc64UjzT08LmdZhtQYLAKmlUC
+PT1VXS4Ae+SrqCPUqJkw1xP3kr0F1EVCXNu0nhOBAuuTGOS7PPEyW2N+k4nRHtsR
+IaPp8GCuIeoR6CdymTFTq6d/GeCiEcyrUM4BNrG4GtRRrURxxOrzQFEOS5sjBPSg
+Km1lwa6zBQFRLg9dKjRBL4teKuPY5Z2Nmpcml/aN4CkdkVEso4lW6/UHLE/joOMQ
+0MdpdYtu8wnt1WI/Z4immQfl3MF+QcPMkqXXzCEhGG/5SbAo89KC46UXvu1Z5OhS
+8XFHhvYBivOYWgZ3XUQqyZ0ulF60mFX7aE1Ph/eEbhWBHmU39hGjxzop1UoPwqLx
+ahvtfvCkR3ZeqlWO9SHzCA3MlrKwQ1p1UL6nG6AJhNN9jSevH6by+8wr07NBZOqX
+fJx+J/8EdVsUCFG2UJxPwM83ZSwAsvKRqph6CuWEl9ndUb7rw6khmRIoY0Iz3LbU
+1MlcDoJNcJas6lYDr1UeFSk86g0SiGCHXZIqsjyUgq6HIy4YrAYiQUthnlF8tp2Q
+nNQBPLo1GsHf0dC2MqKfDFASu7ST+Bl+yajHcIiUXvUJPxWbjkWYG9Q2p2ZBLzZD
+uqeRr66OKxTzUS4go/QbHDNsAulXl61gQIEOdZw5uy/Jl11kyAI6EQbzmehagKdH
+EshTgKp8ks62y0bBHgy3FMKyidJ5Hm58ZDhBxrwN0w+vhRoTGOepTA==
+-----END RSA PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pkcs12.p12 b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pkcs12.p12
new file mode 100644
index 00000000..8df2ccb5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/pkcs12.p12
Binary files differ
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.crt b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.crt
new file mode 100644
index 00000000..28bb4d94
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.crt
@@ -0,0 +1,67 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 1 (0x1)
+ Signature Algorithm: md5WithRSAEncryption
+ Issuer: C=KG, ST=NA, L=BISHKEK, O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ Validity
+ Not Before: Nov 25 14:42:22 2004 GMT
+ Not After : Nov 23 14:42:22 2014 GMT
+ Subject: C=KG, ST=NA, O=OpenVPN-TEST, CN=Test-Server/emailAddress=me@myhost.mydomain
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:cb:4e:ac:f9:83:57:f6:69:d2:32:29:b4:bc:ad:
+ e6:f7:26:21:89:33:30:43:40:a3:35:d9:de:26:01:
+ d6:b4:f0:bc:0a:19:55:99:3b:f1:4c:91:60:b6:fd:
+ 74:34:8d:5a:c7:62:ec:ce:f2:d6:02:ce:57:32:f4:
+ 35:8c:71:a0:6d:65:2a:e7:80:ae:29:59:cf:36:73:
+ f8:7c:4a:73:90:fc:30:28:d5:46:7d:35:a4:4e:c9:
+ 9f:90:7b:e2:09:21:36:c5:a8:ec:85:82:9a:32:b4:
+ 91:3b:c1:d6:4f:9f:d1:f8:6f:68:f4:1d:d2:06:91:
+ 32:cc:9a:48:fd:cd:98:7f:2f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Cert Type:
+ SSL Server
+ Netscape Comment:
+ OpenSSL Generated Server Certificate
+ X509v3 Subject Key Identifier:
+ 69:11:FE:E7:9F:89:7B:71:34:69:C0:DC:82:F8:D0:5D:4D:FB:78:DF
+ X509v3 Authority Key Identifier:
+ keyid:89:A6:60:E3:BA:EA:3E:AF:FC:64:7F:4C:BD:8C:D2:48:8D:E0:CC:46
+ DirName:/C=KG/ST=NA/L=BISHKEK/O=OpenVPN-TEST/emailAddress=me@myhost.mydomain
+ serial:00
+
+ Signature Algorithm: md5WithRSAEncryption
+ 35:5c:75:da:57:ef:b5:79:f2:a2:db:36:e4:75:e8:c7:bc:73:
+ 26:cf:30:36:4b:2e:51:46:37:60:2f:4e:2b:f6:71:a2:23:db:
+ 8e:d8:5c:d5:af:2e:22:28:dd:30:a8:89:66:3a:cc:5b:3c:0f:
+ 96:12:20:de:5e:41:52:74:35:ed:4c:26:40:19:ca:73:df:54:
+ b1:30:96:9c:a5:14:d0:38:28:3f:ab:30:07:d7:de:98:d2:7f:
+ 7f:90:b2:52:1d:e5:95:88:ed:ba:8a:6a:14:85:66:76:ec:75:
+ 30:e8:ae:94:f4:e1:76:fa:4b:0e:f1:53:d7:95:be:fb:69:fa:
+ 3d:32
+-----BEGIN CERTIFICATE-----
+MIIDUTCCArqgAwIBAgIBATANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJLRzEL
+MAkGA1UECBMCTkExEDAOBgNVBAcTB0JJU0hLRUsxFTATBgNVBAoTDE9wZW5WUE4t
+VEVTVDEhMB8GCSqGSIb3DQEJARYSbWVAbXlob3N0Lm15ZG9tYWluMB4XDTA0MTEy
+NTE0NDIyMloXDTE0MTEyMzE0NDIyMlowajELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
+Ak5BMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxFDASBgNVBAMTC1Rlc3QtU2VydmVy
+MSEwHwYJKoZIhvcNAQkBFhJtZUBteWhvc3QubXlkb21haW4wgZ8wDQYJKoZIhvcN
+AQEBBQADgY0AMIGJAoGBAMtOrPmDV/Zp0jIptLyt5vcmIYkzMENAozXZ3iYB1rTw
+vAoZVZk78UyRYLb9dDSNWsdi7M7y1gLOVzL0NYxxoG1lKueArilZzzZz+HxKc5D8
+MCjVRn01pE7Jn5B74gkhNsWo7IWCmjK0kTvB1k+f0fhvaPQd0gaRMsyaSP3NmH8v
+AgMBAAGjggEJMIIBBTAJBgNVHRMEAjAAMBEGCWCGSAGG+EIBAQQEAwIGQDAzBglg
+hkgBhvhCAQ0EJhYkT3BlblNTTCBHZW5lcmF0ZWQgU2VydmVyIENlcnRpZmljYXRl
+MB0GA1UdDgQWBBRpEf7nn4l7cTRpwNyC+NBdTft43zCBkAYDVR0jBIGIMIGFgBSJ
+pmDjuuo+r/xkf0y9jNJIjeDMRqFqpGgwZjELMAkGA1UEBhMCS0cxCzAJBgNVBAgT
+Ak5BMRAwDgYDVQQHEwdCSVNIS0VLMRUwEwYDVQQKEwxPcGVuVlBOLVRFU1QxITAf
+BgkqhkiG9w0BCQEWEm1lQG15aG9zdC5teWRvbWFpboIBADANBgkqhkiG9w0BAQQF
+AAOBgQA1XHXaV++1efKi2zbkdejHvHMmzzA2Sy5RRjdgL04r9nGiI9uO2FzVry4i
+KN0wqIlmOsxbPA+WEiDeXkFSdDXtTCZAGcpz31SxMJacpRTQOCg/qzAH196Y0n9/
+kLJSHeWViO26imoUhWZ27HUw6K6U9OF2+ksO8VPXlb77afo9Mg==
+-----END CERTIFICATE-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.key b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.key
new file mode 100644
index 00000000..976acabf
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-keys/server.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDLTqz5g1f2adIyKbS8reb3JiGJMzBDQKM12d4mAda08LwKGVWZ
+O/FMkWC2/XQ0jVrHYuzO8tYCzlcy9DWMcaBtZSrngK4pWc82c/h8SnOQ/DAo1UZ9
+NaROyZ+Qe+IJITbFqOyFgpoytJE7wdZPn9H4b2j0HdIGkTLMmkj9zZh/LwIDAQAB
+AoGBAKP1ljA/iY/zNY447kZ/5NWKzd7tBk4mcbl7M9no/7O6tZtbZRoIKoi6cYoC
+C1ZabUyBbkNTud5XdCFmq0zRUjOWvoFMZ9VZfd2kRPvl4TGczBtJAq65b+EYMGui
+q6T9p61xPdtzu0vM+Ecj127pAMk5XcJyxu8XQK7lZWmG5UoJAkEA8CxXNZN+A3qD
+bMBPI3VdwKCNSjNVEQEnygMbNgw7VLdxPpspzZziqJEGdzsM4dsnOBwKxIWFLN2h
+lbGBOquAswJBANi0atGWM8VUxDjvqqHCTS9RUXWgnvYhee4/xraJBQPBSivjC9P0
+vKT7PjBHU6djtKSLKGaHn1vHqmyY7PCMjZUCQQCNVSqExqSzG1dXmdt4PErNXi2G
+6qo2dX2arTVIGu6XLdQgSWLSMm5XT/CEHWW5SyPLKwVTHFeATXQXCPvJML9tAkEA
+k0yXax0g1ZoXwufN4SQUmPw6Va03P/BjU/nP1ZVvbiz9gLVU/d7WN4J7tA9XomkY
+idv5OzAmtxkSE70jGSNAvQJAWhCf9+iHkzOHRyKKOYlh1DHUwDfSEp+hlZYg9H03
+P2sraQzUxgWDY/DIY63KvW78ny863baFz7onz21MYGgJXg==
+-----END RSA PRIVATE KEY-----
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/README b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/README
new file mode 100644
index 00000000..d8990f8b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/README
@@ -0,0 +1,16 @@
+OpenVPN plugin examples.
+
+Examples provided:
+
+simple.c -- using the --auth-user-pass-verify callback,
+ test deferred authentication.
+
+To build:
+
+ ./build simple (Linux/BSD/etc.)
+ ./winbuild simple (MinGW on Windows)
+
+To use in OpenVPN, add to config file:
+
+ plugin simple.so (Linux/BSD/etc.)
+ plugin simple.dll (MinGW on Windows)
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.c b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.c
new file mode 100644
index 00000000..65398657
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.c
@@ -0,0 +1,305 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This file implements a simple OpenVPN plugin module which
+ * will test deferred authentication and packet filtering.
+ *
+ * Will run on Windows or *nix.
+ *
+ * Sample usage:
+ *
+ * setenv test_deferred_auth 20
+ * setenv test_packet_filter 10
+ * plugin plugin/defer/simple.so
+ *
+ * This will enable deferred authentication to occur 20
+ * seconds after the normal TLS authentication process,
+ * and will cause a packet filter file to be generated 10
+ * seconds after the initial TLS negotiation, using
+ * {common-name}.pf as the source.
+ *
+ * Sample packet filter configuration:
+ *
+ * [CLIENTS DROP]
+ * +otherclient
+ * [SUBNETS DROP]
+ * +10.0.0.0/8
+ * -10.10.0.8
+ * [END]
+ *
+ * See the README file for build instructions.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "openvpn-plugin.h"
+
+/* bool definitions */
+#define bool int
+#define true 1
+#define false 0
+
+/*
+ * Our context, where we keep our state.
+ */
+
+struct plugin_context {
+ int test_deferred_auth;
+ int test_packet_filter;
+};
+
+struct plugin_per_client_context {
+ int n_calls;
+ bool generated_pf_file;
+};
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+/* used for safe printf of possible NULL strings */
+static const char *
+np (const char *str)
+{
+ if (str)
+ return str;
+ else
+ return "[NULL]";
+}
+
+static int
+atoi_null0 (const char *str)
+{
+ if (str)
+ return atoi (str);
+ else
+ return 0;
+}
+
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
+{
+ struct plugin_context *context;
+
+ printf ("FUNC: openvpn_plugin_open_v1\n");
+
+ /*
+ * Allocate our context
+ */
+ context = (struct plugin_context *) calloc (1, sizeof (struct plugin_context));
+
+ context->test_deferred_auth = atoi_null0 (get_env ("test_deferred_auth", envp));
+ printf ("TEST_DEFERRED_AUTH %d\n", context->test_deferred_auth);
+
+ context->test_packet_filter = atoi_null0 (get_env ("test_packet_filter", envp));
+ printf ("TEST_PACKET_FILTER %d\n", context->test_packet_filter);
+
+ /*
+ * Which callbacks to intercept.
+ */
+ *type_mask =
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_DOWN) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_ROUTE_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_IPCHANGE) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_CONNECT_V2) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_DISCONNECT) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_LEARN_ADDRESS) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_FINAL) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_ENABLE_PF);
+
+ return (openvpn_plugin_handle_t) context;
+}
+
+static int
+auth_user_pass_verify (struct plugin_context *context, struct plugin_per_client_context *pcc, const char *argv[], const char *envp[])
+{
+ if (context->test_deferred_auth)
+ {
+ /* get username/password from envp string array */
+ const char *username = get_env ("username", envp);
+ const char *password = get_env ("password", envp);
+
+ /* get auth_control_file filename from envp string array*/
+ const char *auth_control_file = get_env ("auth_control_file", envp);
+
+ printf ("DEFER u='%s' p='%s' acf='%s'\n",
+ np(username),
+ np(password),
+ np(auth_control_file));
+
+ /* Authenticate asynchronously in n seconds */
+ if (auth_control_file)
+ {
+ char buf[256];
+ int auth = 2;
+ sscanf (username, "%d", &auth);
+ snprintf (buf, sizeof(buf), "( sleep %d ; echo AUTH %s %d ; echo %d >%s ) &",
+ context->test_deferred_auth,
+ auth_control_file,
+ auth,
+ pcc->n_calls < auth,
+ auth_control_file);
+ printf ("%s\n", buf);
+ system (buf);
+ pcc->n_calls++;
+ return OPENVPN_PLUGIN_FUNC_DEFERRED;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+static int
+tls_final (struct plugin_context *context, struct plugin_per_client_context *pcc, const char *argv[], const char *envp[])
+{
+ if (context->test_packet_filter)
+ {
+ if (!pcc->generated_pf_file)
+ {
+ const char *pff = get_env ("pf_file", envp);
+ const char *cn = get_env ("username", envp);
+ if (pff && cn)
+ {
+ char buf[256];
+ snprintf (buf, sizeof(buf), "( sleep %d ; echo PF %s/%s ; cp \"%s.pf\" \"%s\" ) &",
+ context->test_packet_filter, cn, pff, cn, pff);
+ printf ("%s\n", buf);
+ system (buf);
+ pcc->generated_pf_file = true;
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v2 (openvpn_plugin_handle_t handle,
+ const int type,
+ const char *argv[],
+ const char *envp[],
+ void *per_client_context,
+ struct openvpn_plugin_string_list **return_list)
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+ struct plugin_per_client_context *pcc = (struct plugin_per_client_context *) per_client_context;
+ switch (type)
+ {
+ case OPENVPN_PLUGIN_UP:
+ printf ("OPENVPN_PLUGIN_UP\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_DOWN:
+ printf ("OPENVPN_PLUGIN_DOWN\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_ROUTE_UP:
+ printf ("OPENVPN_PLUGIN_ROUTE_UP\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_IPCHANGE:
+ printf ("OPENVPN_PLUGIN_IPCHANGE\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_TLS_VERIFY:
+ printf ("OPENVPN_PLUGIN_TLS_VERIFY\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY:
+ printf ("OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY\n");
+ return auth_user_pass_verify (context, pcc, argv, envp);
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_V2:
+ printf ("OPENVPN_PLUGIN_CLIENT_CONNECT_V2\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
+ printf ("OPENVPN_PLUGIN_CLIENT_DISCONNECT\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_LEARN_ADDRESS:
+ printf ("OPENVPN_PLUGIN_LEARN_ADDRESS\n");
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ case OPENVPN_PLUGIN_TLS_FINAL:
+ printf ("OPENVPN_PLUGIN_TLS_FINAL\n");
+ return tls_final (context, pcc, argv, envp);
+ case OPENVPN_PLUGIN_ENABLE_PF:
+ printf ("OPENVPN_PLUGIN_ENABLE_PF\n");
+ if (context->test_packet_filter)
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ default:
+ printf ("OPENVPN_PLUGIN_?\n");
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+}
+
+OPENVPN_EXPORT void *
+openvpn_plugin_client_constructor_v1 (openvpn_plugin_handle_t handle)
+{
+ printf ("FUNC: openvpn_plugin_client_constructor_v1\n");
+ return calloc (1, sizeof (struct plugin_per_client_context));
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_client_destructor_v1 (openvpn_plugin_handle_t handle, void *per_client_context)
+{
+ printf ("FUNC: openvpn_plugin_client_destructor_v1\n");
+ free (per_client_context);
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+ printf ("FUNC: openvpn_plugin_close_v1\n");
+ free (context);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.def b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.def
new file mode 100755
index 00000000..a87507d1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/simple.def
@@ -0,0 +1,6 @@
+LIBRARY OpenVPN_PLUGIN_SAMPLE
+DESCRIPTION "Sample OpenVPN plug-in module."
+EXPORTS
+ openvpn_plugin_open_v1 @1
+ openvpn_plugin_func_v1 @2
+ openvpn_plugin_close_v1 @3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/winbuild b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/winbuild
new file mode 100755
index 00000000..82927d96
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/defer/winbuild
@@ -0,0 +1,18 @@
+#
+# Build an OpenVPN plugin module on Windows/MinGW.
+# The argument should be the base name of the C source file
+# (without the .c).
+#
+
+# This directory is where we will look for openvpn-plugin.h
+INCLUDE="-I../../../build"
+
+CC_FLAGS="-O2 -Wall"
+
+gcc -DBUILD_DLL $CC_FLAGS $INCLUDE -c $1.c
+gcc --disable-stdcall-fixup -mdll -DBUILD_DLL -o junk.tmp -Wl,--base-file,base.tmp $1.o
+rm junk.tmp
+dlltool --dllname $1.dll --base-file base.tmp --output-exp temp.exp --input-def $1.def
+rm base.tmp
+gcc --enable-stdcall-fixup -mdll -DBUILD_DLL -o $1.dll $1.o -Wl,temp.exp
+rm temp.exp
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log.c b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log.c
new file mode 100644
index 00000000..1cc4650e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log.c
@@ -0,0 +1,184 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This plugin is similar to simple.c, except it also logs extra information
+ * to stdout for every plugin method called by OpenVPN.
+ *
+ * See the README file for build instructions.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "openvpn-plugin.h"
+
+/*
+ * Our context, where we keep our state.
+ */
+struct plugin_context {
+ const char *username;
+ const char *password;
+};
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
+{
+ struct plugin_context *context;
+
+ /*
+ * Allocate our context
+ */
+ context = (struct plugin_context *) calloc (1, sizeof (struct plugin_context));
+
+ /*
+ * Set the username/password we will require.
+ */
+ context->username = "foo";
+ context->password = "bar";
+
+ /*
+ * Which callbacks to intercept.
+ */
+ *type_mask =
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_DOWN) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_ROUTE_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_IPCHANGE) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_CONNECT_V2) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_DISCONNECT) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_LEARN_ADDRESS) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_FINAL);
+
+ return (openvpn_plugin_handle_t) context;
+}
+
+void
+show (const int type, const char *argv[], const char *envp[])
+{
+ size_t i;
+ switch (type)
+ {
+ case OPENVPN_PLUGIN_UP:
+ printf ("OPENVPN_PLUGIN_UP\n");
+ break;
+ case OPENVPN_PLUGIN_DOWN:
+ printf ("OPENVPN_PLUGIN_DOWN\n");
+ break;
+ case OPENVPN_PLUGIN_ROUTE_UP:
+ printf ("OPENVPN_PLUGIN_ROUTE_UP\n");
+ break;
+ case OPENVPN_PLUGIN_IPCHANGE:
+ printf ("OPENVPN_PLUGIN_IPCHANGE\n");
+ break;
+ case OPENVPN_PLUGIN_TLS_VERIFY:
+ printf ("OPENVPN_PLUGIN_TLS_VERIFY\n");
+ break;
+ case OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY:
+ printf ("OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY\n");
+ break;
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_V2:
+ printf ("OPENVPN_PLUGIN_CLIENT_CONNECT_V2\n");
+ break;
+ case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
+ printf ("OPENVPN_PLUGIN_CLIENT_DISCONNECT\n");
+ break;
+ case OPENVPN_PLUGIN_LEARN_ADDRESS:
+ printf ("OPENVPN_PLUGIN_LEARN_ADDRESS\n");
+ break;
+ case OPENVPN_PLUGIN_TLS_FINAL:
+ printf ("OPENVPN_PLUGIN_TLS_FINAL\n");
+ break;
+ default:
+ printf ("OPENVPN_PLUGIN_?\n");
+ break;
+ }
+
+ printf ("ARGV\n");
+ for (i = 0; argv[i] != NULL; ++i)
+ printf ("%d '%s'\n", (int)i, argv[i]);
+
+ printf ("ENVP\n");
+ for (i = 0; envp[i] != NULL; ++i)
+ printf ("%d '%s'\n", (int)i, envp[i]);
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+
+ show (type, argv, envp);
+
+ /* check entered username/password against what we require */
+ if (type == OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY)
+ {
+ /* get username/password from envp string array */
+ const char *username = get_env ("username", envp);
+ const char *password = get_env ("password", envp);
+
+ if (username && !strcmp (username, context->username)
+ && password && !strcmp (password, context->password))
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+ free (context);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log_v3.c b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log_v3.c
new file mode 100644
index 00000000..4d3af91a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/log_v3.c
@@ -0,0 +1,252 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This plugin is similar to simple.c, except it also logs extra information
+ * to stdout for every plugin method called by OpenVPN. The only difference
+ * between this (log_v3.c) and log.c is that this module uses the v3 plug-in
+ * API.
+ *
+ * See the README file for build instructions.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define ENABLE_SSL
+
+#include "openvpn-plugin.h"
+
+/*
+ * Our context, where we keep our state.
+ */
+struct plugin_context {
+ const char *username;
+ const char *password;
+};
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_open_v3 (const int v3structver,
+ struct openvpn_plugin_args_open_in const *args,
+ struct openvpn_plugin_args_open_return *ret)
+{
+ struct plugin_context *context = NULL;
+
+ /* Check that we are API compatible */
+ if( v3structver != OPENVPN_PLUGINv3_STRUCTVER ) {
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+
+ if( args->ssl_api != SSLAPI_OPENSSL ) {
+ printf("This plug-in can only be used against OpenVPN with OpenSSL\n");
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+
+ /* Which callbacks to intercept. */
+ ret->type_mask =
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_DOWN) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_ROUTE_UP) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_IPCHANGE) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_CONNECT_V2) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_CLIENT_DISCONNECT) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_LEARN_ADDRESS) |
+ OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_TLS_FINAL);
+
+
+ /* Allocate our context */
+ context = (struct plugin_context *) calloc (1, sizeof (struct plugin_context));
+
+ /* Set the username/password we will require. */
+ context->username = "foo";
+ context->password = "bar";
+
+ /* Point the global context handle to our newly created context */
+ ret->handle = (void *) context;
+
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+void
+show (const int type, const char *argv[], const char *envp[])
+{
+ size_t i;
+ switch (type)
+ {
+ case OPENVPN_PLUGIN_UP:
+ printf ("OPENVPN_PLUGIN_UP\n");
+ break;
+ case OPENVPN_PLUGIN_DOWN:
+ printf ("OPENVPN_PLUGIN_DOWN\n");
+ break;
+ case OPENVPN_PLUGIN_ROUTE_UP:
+ printf ("OPENVPN_PLUGIN_ROUTE_UP\n");
+ break;
+ case OPENVPN_PLUGIN_IPCHANGE:
+ printf ("OPENVPN_PLUGIN_IPCHANGE\n");
+ break;
+ case OPENVPN_PLUGIN_TLS_VERIFY:
+ printf ("OPENVPN_PLUGIN_TLS_VERIFY\n");
+ break;
+ case OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY:
+ printf ("OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY\n");
+ break;
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_V2:
+ printf ("OPENVPN_PLUGIN_CLIENT_CONNECT_V2\n");
+ break;
+ case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
+ printf ("OPENVPN_PLUGIN_CLIENT_DISCONNECT\n");
+ break;
+ case OPENVPN_PLUGIN_LEARN_ADDRESS:
+ printf ("OPENVPN_PLUGIN_LEARN_ADDRESS\n");
+ break;
+ case OPENVPN_PLUGIN_TLS_FINAL:
+ printf ("OPENVPN_PLUGIN_TLS_FINAL\n");
+ break;
+ default:
+ printf ("OPENVPN_PLUGIN_?\n");
+ break;
+ }
+
+ printf ("ARGV\n");
+ for (i = 0; argv[i] != NULL; ++i)
+ printf ("%d '%s'\n", (int)i, argv[i]);
+
+ printf ("ENVP\n");
+ for (i = 0; envp[i] != NULL; ++i)
+ printf ("%d '%s'\n", (int)i, envp[i]);
+}
+
+static void
+x509_print_info (X509 *x509crt)
+{
+ int i, n;
+ int fn_nid;
+ ASN1_OBJECT *fn;
+ ASN1_STRING *val;
+ X509_NAME *x509_name;
+ X509_NAME_ENTRY *ent;
+ const char *objbuf;
+ unsigned char *buf;
+
+ x509_name = X509_get_subject_name (x509crt);
+ n = X509_NAME_entry_count (x509_name);
+ for (i = 0; i < n; ++i)
+ {
+ ent = X509_NAME_get_entry (x509_name, i);
+ if (!ent)
+ continue;
+ fn = X509_NAME_ENTRY_get_object (ent);
+ if (!fn)
+ continue;
+ val = X509_NAME_ENTRY_get_data (ent);
+ if (!val)
+ continue;
+ fn_nid = OBJ_obj2nid (fn);
+ if (fn_nid == NID_undef)
+ continue;
+ objbuf = OBJ_nid2sn (fn_nid);
+ if (!objbuf)
+ continue;
+ buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+ if (ASN1_STRING_to_UTF8 (&buf, val) <= 0)
+ continue;
+
+ printf("X509 %s: %s\n", objbuf, (char *)buf);
+ OPENSSL_free (buf);
+ }
+}
+
+
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v3 (const int version,
+ struct openvpn_plugin_args_func_in const *args,
+ struct openvpn_plugin_args_func_return *retptr)
+{
+ struct plugin_context *context = (struct plugin_context *) args->handle;
+
+ printf("\nopenvpn_plugin_func_v3() :::::>> ");
+ show (args->type, args->argv, args->envp);
+
+ /* Dump some X509 information if we're in the TLS_VERIFY phase */
+ if ((args->type == OPENVPN_PLUGIN_TLS_VERIFY) && args->current_cert ) {
+ printf("---- X509 Subject information ----\n");
+ printf("Certificate depth: %i\n", args->current_cert_depth);
+ x509_print_info(args->current_cert);
+ printf("----------------------------------\n");
+ }
+
+ /* check entered username/password against what we require */
+ if (args->type == OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY)
+ {
+ /* get username/password from envp string array */
+ const char *username = get_env ("username", args->envp);
+ const char *password = get_env ("password", args->envp);
+
+ if (username && !strcmp (username, context->username)
+ && password && !strcmp (password, context->password))
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+ else
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+ free (context);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/winbuild b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/winbuild
new file mode 100755
index 00000000..decf05f8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/log/winbuild
@@ -0,0 +1,18 @@
+#
+# Build an OpenVPN plugin module on Windows/MinGW.
+# The argument should be the base name of the C source file
+# (without the .c).
+#
+
+# This directory is where we will look for openvpn-plugin.h
+INCLUDE="-I../../../include"
+
+CC_FLAGS="-O2 -Wall"
+
+gcc -DBUILD_DLL $CC_FLAGS $INCLUDE -c $1.c
+gcc --disable-stdcall-fixup -mdll -DBUILD_DLL -o junk.tmp -Wl,--base-file,base.tmp $1.o
+rm junk.tmp
+dlltool --dllname $1.dll --base-file base.tmp --output-exp temp.exp --input-def $1.def
+rm base.tmp
+gcc --enable-stdcall-fixup -mdll -DBUILD_DLL -o $1.dll $1.o -Wl,temp.exp
+rm temp.exp
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/README b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/README
new file mode 100644
index 00000000..4400cd30
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/README
@@ -0,0 +1,16 @@
+OpenVPN plugin examples.
+
+Examples provided:
+
+simple.c -- using the --auth-user-pass-verify callback, verify
+ that the username/password is "foo"/"bar".
+
+To build:
+
+ ./build simple (Linux/BSD/etc.)
+ ./winbuild simple (MinGW on Windows)
+
+To use in OpenVPN, add to config file:
+
+ plugin simple.so (Linux/BSD/etc.)
+ plugin simple.dll (MinGW on Windows)
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.c b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.c
new file mode 100644
index 00000000..f26d89f6
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.c
@@ -0,0 +1,120 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This file implements a simple OpenVPN plugin module which
+ * will examine the username/password provided by a client,
+ * and make an accept/deny determination. Will run
+ * on Windows or *nix.
+ *
+ * See the README file for build instructions.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "openvpn-plugin.h"
+
+/*
+ * Our context, where we keep our state.
+ */
+struct plugin_context {
+ const char *username;
+ const char *password;
+};
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
+{
+ struct plugin_context *context;
+
+ /*
+ * Allocate our context
+ */
+ context = (struct plugin_context *) calloc (1, sizeof (struct plugin_context));
+
+ /*
+ * Set the username/password we will require.
+ */
+ context->username = "foo";
+ context->password = "bar";
+
+ /*
+ * We are only interested in intercepting the
+ * --auth-user-pass-verify callback.
+ */
+ *type_mask = OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY);
+
+ return (openvpn_plugin_handle_t) context;
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+
+ /* get username/password from envp string array */
+ const char *username = get_env ("username", envp);
+ const char *password = get_env ("password", envp);
+
+ /* check entered username/password against what we require */
+ if (username && !strcmp (username, context->username)
+ && password && !strcmp (password, context->password))
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ else
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct plugin_context *context = (struct plugin_context *) handle;
+ free (context);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.def b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.def
new file mode 100755
index 00000000..a87507d1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/simple.def
@@ -0,0 +1,6 @@
+LIBRARY OpenVPN_PLUGIN_SAMPLE
+DESCRIPTION "Sample OpenVPN plug-in module."
+EXPORTS
+ openvpn_plugin_open_v1 @1
+ openvpn_plugin_func_v1 @2
+ openvpn_plugin_close_v1 @3
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/winbuild b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/winbuild
new file mode 100755
index 00000000..decf05f8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-plugins/simple/winbuild
@@ -0,0 +1,18 @@
+#
+# Build an OpenVPN plugin module on Windows/MinGW.
+# The argument should be the base name of the C source file
+# (without the .c).
+#
+
+# This directory is where we will look for openvpn-plugin.h
+INCLUDE="-I../../../include"
+
+CC_FLAGS="-O2 -Wall"
+
+gcc -DBUILD_DLL $CC_FLAGS $INCLUDE -c $1.c
+gcc --disable-stdcall-fixup -mdll -DBUILD_DLL -o junk.tmp -Wl,--base-file,base.tmp $1.o
+rm junk.tmp
+dlltool --dllname $1.dll --base-file base.tmp --output-exp temp.exp --input-def $1.def
+rm base.tmp
+gcc --enable-stdcall-fixup -mdll -DBUILD_DLL -o $1.dll $1.o -Wl,temp.exp
+rm temp.exp
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/auth-pam.pl b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/auth-pam.pl
new file mode 100755
index 00000000..5333badc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/auth-pam.pl
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -t
+
+# OpenVPN PAM AUTHENTICATON
+# This script can be used to add PAM-based authentication
+# to OpenVPN 2.0. The OpenVPN client must provide
+# a username/password, using the --auth-user-pass directive.
+# The OpenVPN server should specify --auth-user-pass-verify
+# with this script as the argument and the 'via-file' method
+# specified. The server can also optionally specify
+# --client-cert-not-required and/or --username-as-common-name.
+
+# SCRIPT OPERATION
+# Return success or failure status based on whether or not a
+# given username/password authenticates using PAM.
+# Caller should write username/password as two lines in a file
+# which is passed to this script as a command line argument.
+
+# CAVEATS
+# * Requires Authen::PAM module, which may also
+# require the pam-devel package.
+# * May need to be run as root in order to
+# access username/password file.
+
+# NOTES
+# * This script is provided mostly as a demonstration of the
+# --auth-user-pass-verify script capability in OpenVPN.
+# For real world usage, see the auth-pam module in the plugin
+# folder.
+
+use Authen::PAM;
+use POSIX;
+
+# This "conversation function" will pass
+# $password to PAM when it asks for it.
+
+sub my_conv_func {
+ my @res;
+ while ( @_ ) {
+ my $code = shift;
+ my $msg = shift;
+ my $ans = "";
+
+ $ans = $password if $msg =~ /[Pp]assword/;
+
+ push @res, (PAM_SUCCESS(),$ans);
+ }
+ push @res, PAM_SUCCESS();
+ return @res;
+}
+
+# Identify service type to PAM
+$service = "login";
+
+# Get username/password from file
+
+if ($ARG = shift @ARGV) {
+ if (!open (UPFILE, "<$ARG")) {
+ print "Could not open username/password file: $ARG\n";
+ exit 1;
+ }
+} else {
+ print "No username/password file specified on command line\n";
+ exit 1;
+}
+
+$username = <UPFILE>;
+$password = <UPFILE>;
+
+if (!$username || !$password) {
+ print "Username/password not found in file: $ARG\n";
+ exit 1;
+}
+
+chomp $username;
+chomp $password;
+
+close (UPFILE);
+
+# Initialize PAM object
+
+if (!ref($pamh = new Authen::PAM($service, $username, \&my_conv_func))) {
+ print "Authen::PAM init failed\n";
+ exit 1;
+}
+
+# Authenticate with PAM
+
+$res = $pamh->pam_authenticate;
+
+# Return success or failure
+
+if ($res == PAM_SUCCESS()) {
+ exit 0;
+} else {
+ print "Auth '$username' failed, PAM said: ", $pamh->pam_strerror($res), "\n";
+ exit 1;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-start b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-start
new file mode 100755
index 00000000..d20a2603
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-start
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#################################
+# Set up Ethernet bridge on Linux
+# Requires: bridge-utils
+#################################
+
+# Define Bridge Interface
+br="br0"
+
+# Define list of TAP interfaces to be bridged,
+# for example tap="tap0 tap1 tap2".
+tap="tap0"
+
+# Define physical ethernet interface to be bridged
+# with TAP interface(s) above.
+eth="eth0"
+eth_ip="192.168.8.4"
+eth_netmask="255.255.255.0"
+eth_broadcast="192.168.8.255"
+
+for t in $tap; do
+ openvpn --mktun --dev $t
+done
+
+brctl addbr $br
+brctl addif $br $eth
+
+for t in $tap; do
+ brctl addif $br $t
+done
+
+for t in $tap; do
+ ifconfig $t 0.0.0.0 promisc up
+done
+
+ifconfig $eth 0.0.0.0 promisc up
+
+ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-stop b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-stop
new file mode 100755
index 00000000..81927794
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/bridge-stop
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+####################################
+# Tear Down Ethernet bridge on Linux
+####################################
+
+# Define Bridge Interface
+br="br0"
+
+# Define list of TAP interfaces to be bridged together
+tap="tap0"
+
+ifconfig $br down
+brctl delbr $br
+
+for t in $tap; do
+ openvpn --rmtun --dev $t
+done
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
new file mode 100755
index 00000000..6d708f82
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -t
+
+# OpenVPN --auth-user-pass-verify script.
+# Only authenticate if username equals common_name.
+# In OpenVPN config file:
+# auth-user-pass-verify ./ucn.pl via-env
+
+$username = $ENV{'username'};
+$common_name = $ENV{'common_name'};
+
+exit !(length($username) > 0 && length($common_name) > 0 && $username eq $common_name);
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/verify-cn b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/verify-cn
new file mode 100755
index 00000000..6e747ef1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/verify-cn
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+# verify-cn -- a sample OpenVPN tls-verify script
+#
+# Return 0 if cn matches the common name component of
+# subject, 1 otherwise.
+#
+# For example in OpenVPN, you could use the directive:
+#
+# tls-verify "./verify-cn /etc/openvpn/allowed_clients"
+#
+# This would cause the connection to be dropped unless
+# the client common name is listed on a line in the
+# allowed_clients file.
+
+die "usage: verify-cn cnfile certificate_depth subject" if (@ARGV != 3);
+
+# Parse out arguments:
+# cnfile -- The file containing the list of common names, one per
+# line, which the client is required to have,
+# taken from the argument to the tls-verify directive
+# in the OpenVPN config file.
+# The file can have blank lines and comment lines that begin
+# with the # character.
+# depth -- The current certificate chain depth. In a typical
+# bi-level chain, the root certificate will be at level
+# 1 and the client certificate will be at level 0.
+# This script will be called separately for each level.
+# x509 -- the X509 subject string as extracted by OpenVPN from
+# the client's provided certificate.
+($cnfile, $depth, $x509) = @ARGV;
+
+if ($depth == 0) {
+ # If depth is zero, we know that this is the final
+ # certificate in the chain (i.e. the client certificate),
+ # and the one we are interested in examining.
+ # If so, parse out the common name substring in
+ # the X509 subject string.
+
+ if ($x509 =~ / CN=([^,]+)/) {
+ $cn = $1;
+ # Accept the connection if the X509 common name
+ # string matches the passed cn argument.
+ open(FH, '<', $cnfile) or exit 1; # can't open, nobody authenticates!
+ while (defined($line = <FH>)) {
+ if ($line !~ /^[[:space:]]*(#|$)/o) {
+ chop($line);
+ if ($line eq $cn) {
+ exit 0;
+ }
+ }
+ }
+ close(FH);
+ }
+
+ # Authentication failed -- Either we could not parse
+ # the X509 subject string, or the common name in the
+ # subject string didn't match the passed cn argument.
+ exit 1;
+}
+
+# If depth is nonzero, tell OpenVPN to continue processing
+# the certificate chain.
+exit 0;
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-windows/sample.ovpn b/ics-openvpn-stripped/main/openvpn/sample/sample-windows/sample.ovpn
new file mode 100755
index 00000000..5accd573
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-windows/sample.ovpn
@@ -0,0 +1,103 @@
+# Edit this file, and save to a .ovpn extension
+# so that OpenVPN will activate it when run
+# as a service.
+
+# Change 'myremote' to be your remote host,
+# or comment out to enter a listening
+# server mode.
+remote myremote
+
+# Uncomment this line to use a different
+# port number than the default of 1194.
+; port 1194
+
+# Choose one of three protocols supported by
+# OpenVPN. If left commented out, defaults
+# to udp.
+; proto [tcp-server | tcp-client | udp]
+
+# You must specify one of two possible network
+# protocols, 'dev tap' or 'dev tun' to be used
+# on both sides of the connection. 'tap' creates
+# a VPN using the ethernet protocol while 'tun'
+# uses the IP protocol. You must use 'tap'
+# if you are ethernet bridging or want to route
+# broadcasts. 'tun' is somewhat more efficient
+# but requires configuration of client software
+# to not depend on broadcasts. Some platforms
+# such as Solaris, OpenBSD, and Mac OS X only
+# support 'tun' interfaces, so if you are
+# connecting to such a platform, you must also
+# use a 'tun' interface on the Windows side.
+
+# Enable 'dev tap' or 'dev tun' but not both!
+dev tap
+
+# This is a 'dev tap' ifconfig that creates
+# a virtual ethernet subnet.
+# 10.3.0.1 is the local VPN IP address
+# and 255.255.255.0 is the VPN subnet.
+# Only define this option for 'dev tap'.
+ifconfig 10.3.0.1 255.255.255.0
+
+# This is a 'dev tun' ifconfig that creates
+# a point-to-point IP link.
+# 10.3.0.1 is the local VPN IP address and
+# 10.3.0.2 is the remote VPN IP address.
+# Only define this option for 'dev tun'.
+# Make sure to include the "tun-mtu" option
+# on the remote machine, but swap the order
+# of the ifconfig addresses.
+;tun-mtu 1500
+;ifconfig 10.3.0.1 10.3.0.2
+
+# If you have fragmentation issues or misconfigured
+# routers in the path which block Path MTU discovery,
+# lower the TCP MSS and internally fragment non-TCP
+# protocols.
+;fragment 1300
+;mssfix
+
+# If you have set up more than one TAP-Win32 adapter
+# on your system, you must refer to it by name.
+;dev-node my-tap
+
+# You can generate a static OpenVPN key
+# by selecting the Generate Key option
+# in the start menu.
+#
+# You can also generate key.txt manually
+# with the following command:
+# openvpn --genkey --secret key.txt
+#
+# key must match on both ends of the connection,
+# so you should generate it on one machine and
+# copy it to the other over a secure medium.
+# Place key.txt in the same directory as this
+# config file.
+secret key.txt
+
+# Uncomment this section for a more reliable
+# detection when a system loses its connection.
+# For example, dial-ups or laptops that travel
+# to other locations.
+#
+# If this section is enabled and "myremote"
+# above is a dynamic DNS name (i.e. dyndns.org),
+# OpenVPN will dynamically "follow" the IP
+# address of "myremote" if it changes.
+; ping-restart 60
+; ping-timer-rem
+; persist-tun
+; persist-key
+; resolv-retry 86400
+
+# keep-alive ping
+ping 10
+
+# enable LZO compression
+comp-lzo
+
+# moderate verbosity
+verb 4
+mute 10
diff --git a/ics-openvpn-stripped/main/openvpn/src/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/Makefile.am
new file mode 100644
index 00000000..c04468a5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/Makefile.am
@@ -0,0 +1,15 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+SUBDIRS = compat openvpn openvpnserv plugins
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/compat/Makefile.am
new file mode 100644
index 00000000..4591b851
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/Makefile.am
@@ -0,0 +1,30 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ compat.vcxproj \
+ compat.vcxproj.filters
+
+noinst_LTLIBRARIES = libcompat.la
+
+libcompat_la_SOURCES = \
+ compat.h \
+ compat-stdbool.h \
+ compat-dirname.c \
+ compat-basename.c \
+ compat-gettimeofday.c \
+ compat-daemon.c \
+ compat-inet_ntop.c \
+ compat-inet_pton.c \
+ compat-lz4.c compat-lz4.h
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-basename.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-basename.c
new file mode 100644
index 00000000..a0576919
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-basename.c
@@ -0,0 +1,50 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifndef HAVE_BASENAME
+
+#include "compat.h"
+#include <string.h>
+
+/* Modified version based on glibc-2.14.1 by Roland McGrath <roland@gnu.org>
+ * This version is extended to handle both / and \ in path names
+ */
+char *
+basename (char *filename)
+{
+ char *p = strrchr (filename, '/');
+ if (!p) {
+ /* If NULL, check for \ instead ... might be Windows a path */
+ p = strrchr (filename, '\\');
+ }
+ return p ? p + 1 : (char *) filename;
+}
+
+#endif /* HAVE_BASENAME */
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-daemon.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-daemon.c
new file mode 100644
index 00000000..dde96a20
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-daemon.c
@@ -0,0 +1,100 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifndef HAVE_DAEMON
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+int
+daemon(int nochdir, int noclose)
+{
+#if defined(HAVE_FORK) && defined(HAVE_SETSID)
+ switch (fork()) {
+ case -1:
+ return (-1);
+ case 0:
+ break;
+ default:
+ exit(0);
+ }
+
+ if (setsid() == -1)
+ return (-1);
+
+ if (!nochdir)
+ chdir("/");
+
+ if (!noclose) {
+#if defined(HAVE_DUP) && defined(HAVE_DUP2)
+ int fd;
+ if ((fd = open ("/dev/null", O_RDWR, 0)) != -1) {
+ dup2 (fd, 0);
+ dup2 (fd, 1);
+ dup2 (fd, 2);
+ if (fd > 2) {
+ close (fd);
+ }
+ }
+#endif
+ }
+
+ return 0;
+#else
+ (void)nochdir;
+ (void)noclose;
+ errno = EFAULT;
+ return -1;
+#endif
+}
+
+#endif
+
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-dirname.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-dirname.c
new file mode 100644
index 00000000..88785950
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-dirname.c
@@ -0,0 +1,119 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+
+#ifndef HAVE_DIRNAME
+
+#include "compat.h"
+#include <string.h>
+
+/* Unoptimised version of glibc memrchr().
+ * This is considered fast enough, as only this compat
+ * version of dirname() depends on it.
+ */
+static const char *
+__memrchr(const char *str, int c, size_t n)
+{
+ const char *end = str;
+
+ end += n - 1; /* Go to the end of the string */
+ while (end >= str) {
+ if(c == *end)
+ return end;
+ else
+ end--;
+ }
+ return NULL;
+}
+
+/* Modified version based on glibc-2.14.1 by Ulrich Drepper <drepper@akkadia.org>
+ * This version is extended to handle both / and \ in path names.
+ */
+char *
+dirname (char *path)
+{
+ static const char dot[] = ".";
+ char *last_slash;
+ char separator = '/';
+
+ /* Find last '/'. */
+ last_slash = path != NULL ? strrchr (path, '/') : NULL;
+ /* If NULL, check for \ instead ... might be Windows a path */
+ if (!last_slash) {
+ last_slash = path != NULL ? strrchr (path, '\\') : NULL;
+ separator = last_slash ? '\\' : '/'; /* Change the separator if \ was found */
+ }
+
+ if (last_slash != NULL && last_slash != path && last_slash[1] == '\0') {
+ /* Determine whether all remaining characters are slashes. */
+ char *runp;
+
+ for (runp = last_slash; runp != path; --runp)
+ if (runp[-1] != separator)
+ break;
+
+ /* The '/' is the last character, we have to look further. */
+ if (runp != path)
+ last_slash = (char *) __memrchr (path, separator, runp - path);
+ }
+
+ if (last_slash != NULL) {
+ /* Determine whether all remaining characters are slashes. */
+ char *runp;
+
+ for (runp = last_slash; runp != path; --runp)
+ if (runp[-1] != separator)
+ break;
+
+ /* Terminate the path. */
+ if (runp == path) {
+ /* The last slash is the first character in the string. We have to
+ return "/". As a special case we have to return "//" if there
+ are exactly two slashes at the beginning of the string. See
+ XBD 4.10 Path Name Resolution for more information. */
+ if (last_slash == path + 1)
+ ++last_slash;
+ else
+ last_slash = path + 1;
+ }
+ else
+ last_slash = runp;
+
+ last_slash[0] = '\0';
+ } else
+ /* This assignment is ill-designed but the XPG specs require to
+ return a string containing "." in any case no directory part is
+ found and so a static and constant string is required. */
+ path = (char *) dot;
+
+ return path;
+}
+
+#endif /* HAVE_DIRNAME */
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-gettimeofday.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-gettimeofday.c
new file mode 100644
index 00000000..0f32d5d1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-gettimeofday.c
@@ -0,0 +1,131 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifndef HAVE_GETTIMEOFDAY
+
+#include "compat.h"
+
+#ifdef WIN32
+/*
+ * NOTICE: mingw has much faster gettimeofday!
+ * autoconf will set HAVE_GETTIMEOFDAY
+ */
+
+#include <windows.h>
+#include <time.h>
+
+static time_t gtc_base = 0;
+static DWORD gtc_last = 0;
+static time_t last_sec = 0;
+static unsigned int last_msec = 0;
+static int bt_last = 0;
+
+static void
+gettimeofday_calibrate (void)
+{
+ const time_t t = time(NULL);
+ const DWORD gtc = GetTickCount();
+ gtc_base = t - gtc/1000;
+ gtc_last = gtc;
+}
+
+/*
+ * Rewritten by JY for OpenVPN 2.1, after I realized that
+ * QueryPerformanceCounter takes nearly 2 orders of magnitude
+ * more processor cycles than GetTickCount.
+ */
+int
+gettimeofday (struct timeval *tv, void *tz)
+{
+ const DWORD gtc = GetTickCount();
+ int bt = 0;
+ time_t sec;
+ unsigned int msec;
+ const int backtrack_hold_seconds = 10;
+
+ (void)tz;
+
+ /* recalibrate at the dreaded 49.7 day mark */
+ if (!gtc_base || gtc < gtc_last)
+ gettimeofday_calibrate ();
+ gtc_last = gtc;
+
+ sec = gtc_base + gtc / 1000;
+ msec = gtc % 1000;
+
+ if (sec == last_sec)
+ {
+ if (msec < last_msec)
+ {
+ msec = last_msec;
+ bt = 1;
+ }
+ }
+ else if (sec < last_sec)
+ {
+ /* We try to dampen out backtracks of less than backtrack_hold_seconds.
+ Larger backtracks will be passed through and dealt with by the
+ TIME_BACKTRACK_PROTECTION code (if enabled) */
+ if (sec > last_sec - backtrack_hold_seconds)
+ {
+ sec = last_sec;
+ msec = last_msec;
+ }
+ bt = 1;
+ }
+
+ tv->tv_sec = (long)last_sec = (long)sec;
+ tv->tv_usec = (last_msec = msec) * 1000;
+
+ if (bt && !bt_last)
+ gettimeofday_calibrate ();
+ bt_last = bt;
+
+ return 0;
+}
+
+#else
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+int
+gettimeofday (struct timeval *tv, void *tz)
+{
+ (void)tz;
+ tv->tv_sec = time(NULL);
+ tv->tv_usec = 0;
+ return 0;
+}
+
+#endif /* WIN32 */
+
+#endif /* HAVE_GETTIMEOFDAY */
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_ntop.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_ntop.c
new file mode 100644
index 00000000..0d521425
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_ntop.c
@@ -0,0 +1,76 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifndef HAVE_INET_NTOP
+
+#include "compat.h"
+
+#ifdef WIN32
+
+#include <windows.h>
+
+/*
+ * inet_ntop() and inet_pton() wrap-implementations using
+ * WSAAddressToString() and WSAStringToAddress() functions
+ *
+ * this is needed as long as we support running OpenVPN on WinXP
+ */
+
+const char *
+inet_ntop(int af, const void *src, char *dst, socklen_t size)
+{
+ struct sockaddr_storage ss;
+ unsigned long s = size;
+
+ ZeroMemory(&ss, sizeof(ss));
+ ss.ss_family = af;
+
+ switch(af) {
+ case AF_INET:
+ ((struct sockaddr_in *)&ss)->sin_addr = *(struct in_addr *)src;
+ break;
+ case AF_INET6:
+ ((struct sockaddr_in6 *)&ss)->sin6_addr = *(struct in6_addr *)src;
+ break;
+ default:
+ return NULL;
+ }
+ /* cannot direclty use &size because of strict aliasing rules */
+ return (WSAAddressToString((struct sockaddr *)&ss, sizeof(ss), NULL, dst, &s) == 0)?
+ dst : NULL;
+}
+
+#else
+
+#error no emulation for inet_ntop
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_pton.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_pton.c
new file mode 100644
index 00000000..cdc8d4b0
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-inet_pton.c
@@ -0,0 +1,79 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifndef HAVE_INET_PTON
+
+#include "compat.h"
+
+#ifdef WIN32
+
+#include <windows.h>
+#include <string.h>
+
+/*
+ * inet_ntop() and inet_pton() wrap-implementations using
+ * WSAAddressToString() and WSAStringToAddress() functions
+ *
+ * this is needed as long as we support running OpenVPN on WinXP
+ */
+
+
+int
+inet_pton(int af, const char *src, void *dst)
+{
+ struct sockaddr_storage ss;
+ int size = sizeof(ss);
+ char src_copy[INET6_ADDRSTRLEN+1];
+
+ ZeroMemory(&ss, sizeof(ss));
+ /* stupid non-const API */
+ strncpy (src_copy, src, INET6_ADDRSTRLEN+1);
+ src_copy[INET6_ADDRSTRLEN] = 0;
+
+ if (WSAStringToAddress(src_copy, af, NULL, (struct sockaddr *)&ss, &size) == 0) {
+ switch(af) {
+ case AF_INET:
+ *(struct in_addr *)dst = ((struct sockaddr_in *)&ss)->sin_addr;
+ return 1;
+ case AF_INET6:
+ *(struct in6_addr *)dst = ((struct sockaddr_in6 *)&ss)->sin6_addr;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+#else
+
+#error no emulation for inet_ntop
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.c b/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.c
new file mode 100644
index 00000000..c63c18ba
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.c
@@ -0,0 +1,830 @@
+/*
+ LZ4 - Fast LZ compression algorithm
+ Copyright (C) 2011-2013, Yann Collet.
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ 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.
+
+ 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.
+
+ You can contact the author at :
+ - LZ4 source repository : http://code.google.com/p/lz4/
+ - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#ifdef NEED_COMPAT_LZ4
+
+//**************************************
+// Tuning parameters
+//**************************************
+// MEMORY_USAGE :
+// Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
+// Increasing memory usage improves compression ratio
+// Reduced memory usage can improve speed, due to cache effect
+// Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache
+#define MEMORY_USAGE 14
+
+// HEAPMODE :
+// Select how default compression functions will allocate memory for their hash table,
+// in memory stack (0:default, fastest), or in memory heap (1:requires memory allocation (malloc)).
+#define HEAPMODE 0
+
+
+//**************************************
+// CPU Feature Detection
+//**************************************
+// 32 or 64 bits ?
+#if (defined(__x86_64__) || defined(_M_X64) || defined(_WIN64) \
+ || defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) \
+ || defined(__64BIT__) || defined(_LP64) || defined(__LP64__) \
+ || defined(__ia64) || defined(__itanium__) || defined(_M_IA64) ) // Detects 64 bits mode
+# define LZ4_ARCH64 1
+#else
+# define LZ4_ARCH64 0
+#endif
+
+// Little Endian or Big Endian ?
+// Overwrite the #define below if you know your architecture endianess
+#if defined (__GLIBC__)
+# include <endian.h>
+# if (__BYTE_ORDER == __BIG_ENDIAN)
+# define LZ4_BIG_ENDIAN 1
+# endif
+#elif (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)) && !(defined(__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN))
+# define LZ4_BIG_ENDIAN 1
+#elif defined(__sparc) || defined(__sparc__) \
+ || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \
+ || defined(__hpux) || defined(__hppa) \
+ || defined(_MIPSEB) || defined(__s390__)
+# define LZ4_BIG_ENDIAN 1
+#else
+// Little Endian assumed. PDP Endian and other very rare endian format are unsupported.
+#endif
+
+// Unaligned memory access is automatically enabled for "common" CPU, such as x86.
+// For others CPU, such as ARM, the compiler may be more cautious, inserting unnecessary extra code to ensure aligned access property
+// If you know your target CPU supports unaligned memory access, you want to force this option manually to improve performance
+#if defined(__ARM_FEATURE_UNALIGNED)
+# define LZ4_FORCE_UNALIGNED_ACCESS 1
+#endif
+
+// Define this parameter if your target system or compiler does not support hardware bit count
+#if defined(_MSC_VER) && defined(_WIN32_WCE) // Visual Studio for Windows CE does not support Hardware bit count
+# define LZ4_FORCE_SW_BITCOUNT
+#endif
+
+// BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE :
+// This option may provide a small boost to performance for some big endian cpu, although probably modest.
+// You may set this option to 1 if data will remain within closed environment.
+// This option is useless on Little_Endian CPU (such as x86)
+//#define BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE 1
+
+
+//**************************************
+// Compiler Options
+//**************************************
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) // C99
+/* "restrict" is a known keyword */
+#else
+# define restrict // Disable restrict
+#endif
+
+#ifdef _MSC_VER // Visual Studio
+# define FORCE_INLINE static __forceinline
+# include <intrin.h> // For Visual 2005
+# if LZ4_ARCH64 // 64-bits
+# pragma intrinsic(_BitScanForward64) // For Visual 2005
+# pragma intrinsic(_BitScanReverse64) // For Visual 2005
+# else // 32-bits
+# pragma intrinsic(_BitScanForward) // For Visual 2005
+# pragma intrinsic(_BitScanReverse) // For Visual 2005
+# endif
+# pragma warning(disable : 4127) // disable: C4127: conditional expression is constant
+#else
+# ifdef __GNUC__
+# define FORCE_INLINE static inline __attribute__((always_inline))
+# else
+# define FORCE_INLINE static inline
+# endif
+#endif
+
+#ifdef _MSC_VER
+# define lz4_bswap16(x) _byteswap_ushort(x)
+#else
+# define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
+#endif
+
+#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+
+#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__)
+# define expect(expr,value) (__builtin_expect ((expr),(value)) )
+#else
+# define expect(expr,value) (expr)
+#endif
+
+#define likely(expr) expect((expr) != 0, 1)
+#define unlikely(expr) expect((expr) != 0, 0)
+
+
+//**************************************
+// Memory routines
+//**************************************
+#include <stdlib.h> // malloc, calloc, free
+#define ALLOCATOR(n,s) calloc(n,s)
+#define FREEMEM free
+#include <string.h> // memset, memcpy
+#define MEM_INIT memset
+
+
+//**************************************
+// Includes
+//**************************************
+#include "compat-lz4.h"
+
+
+//**************************************
+// Basic Types
+//**************************************
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99
+# include <stdint.h>
+ typedef uint8_t BYTE;
+ typedef uint16_t U16;
+ typedef uint32_t U32;
+ typedef int32_t S32;
+ typedef uint64_t U64;
+#else
+ typedef unsigned char BYTE;
+ typedef unsigned short U16;
+ typedef unsigned int U32;
+ typedef signed int S32;
+ typedef unsigned long long U64;
+#endif
+
+#if defined(__GNUC__) && !defined(LZ4_FORCE_UNALIGNED_ACCESS)
+# define _PACKED __attribute__ ((packed))
+#else
+# define _PACKED
+#endif
+
+#if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__)
+# if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# pragma pack(1)
+# else
+# pragma pack(push, 1)
+# endif
+#endif
+
+typedef struct { U16 v; } _PACKED U16_S;
+typedef struct { U32 v; } _PACKED U32_S;
+typedef struct { U64 v; } _PACKED U64_S;
+typedef struct {size_t v;} _PACKED size_t_S;
+
+#if !defined(LZ4_FORCE_UNALIGNED_ACCESS) && !defined(__GNUC__)
+# if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# pragma pack(0)
+# else
+# pragma pack(pop)
+# endif
+#endif
+
+#define A16(x) (((U16_S *)(x))->v)
+#define A32(x) (((U32_S *)(x))->v)
+#define A64(x) (((U64_S *)(x))->v)
+#define AARCH(x) (((size_t_S *)(x))->v)
+
+
+//**************************************
+// Constants
+//**************************************
+#define LZ4_HASHLOG (MEMORY_USAGE-2)
+#define HASHTABLESIZE (1 << MEMORY_USAGE)
+#define HASHNBCELLS4 (1 << LZ4_HASHLOG)
+
+#define MINMATCH 4
+
+#define COPYLENGTH 8
+#define LASTLITERALS 5
+#define MFLIMIT (COPYLENGTH+MINMATCH)
+const int LZ4_minLength = (MFLIMIT+1);
+
+#define LZ4_64KLIMIT ((1<<16) + (MFLIMIT-1))
+#define SKIPSTRENGTH 6 // Increasing this value will make the compression run slower on incompressible data
+
+#define MAXD_LOG 16
+#define MAX_DISTANCE ((1 << MAXD_LOG) - 1)
+
+#define ML_BITS 4
+#define ML_MASK ((1U<<ML_BITS)-1)
+#define RUN_BITS (8-ML_BITS)
+#define RUN_MASK ((1U<<RUN_BITS)-1)
+
+#define KB *(1U<<10)
+#define MB *(1U<<20)
+#define GB *(1U<<30)
+
+
+//**************************************
+// Structures and local types
+//**************************************
+
+typedef struct {
+ U32 hashTable[HASHNBCELLS4];
+ const BYTE* bufferStart;
+ const BYTE* base;
+ const BYTE* nextBlock;
+} LZ4_Data_Structure;
+
+typedef enum { notLimited = 0, limited = 1 } limitedOutput_directive;
+typedef enum { byPtr, byU32, byU16 } tableType_t;
+
+typedef enum { noPrefix = 0, withPrefix = 1 } prefix64k_directive;
+
+typedef enum { endOnOutputSize = 0, endOnInputSize = 1 } endCondition_directive;
+typedef enum { full = 0, partial = 1 } earlyEnd_directive;
+
+
+//**************************************
+// Architecture-specific macros
+//**************************************
+#define STEPSIZE sizeof(size_t)
+#define LZ4_COPYSTEP(d,s) { AARCH(d) = AARCH(s); d+=STEPSIZE; s+=STEPSIZE; }
+#define LZ4_COPY8(d,s) { LZ4_COPYSTEP(d,s); if (STEPSIZE<8) LZ4_COPYSTEP(d,s); }
+#define LZ4_SECURECOPY(d,s,e) { if ((STEPSIZE==4)||(d<e)) LZ4_WILDCOPY(d,s,e); }
+
+#if LZ4_ARCH64 // 64-bit
+# define HTYPE U32
+# define INITBASE(base) const BYTE* const base = ip
+#else // 32-bit
+# define HTYPE const BYTE*
+# define INITBASE(base) const int base = 0
+#endif
+
+#if (defined(LZ4_BIG_ENDIAN) && !defined(BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE))
+# define LZ4_READ_LITTLEENDIAN_16(d,s,p) { U16 v = A16(p); v = lz4_bswap16(v); d = (s) - v; }
+# define LZ4_WRITE_LITTLEENDIAN_16(p,i) { U16 v = (U16)(i); v = lz4_bswap16(v); A16(p) = v; p+=2; }
+#else // Little Endian
+# define LZ4_READ_LITTLEENDIAN_16(d,s,p) { d = (s) - A16(p); }
+# define LZ4_WRITE_LITTLEENDIAN_16(p,v) { A16(p) = v; p+=2; }
+#endif
+
+
+//**************************************
+// Macros
+//**************************************
+#define LZ4_WILDCOPY(d,s,e) { do { LZ4_COPY8(d,s) } while (d<e); } // at the end, d>=e;
+
+
+//****************************
+// Private functions
+//****************************
+#if LZ4_ARCH64
+
+FORCE_INLINE int LZ4_NbCommonBytes (register U64 val)
+{
+# if defined(LZ4_BIG_ENDIAN)
+# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ unsigned long r = 0;
+ _BitScanReverse64( &r, val );
+ return (int)(r>>3);
+# elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ return (__builtin_clzll(val) >> 3);
+# else
+ int r;
+ if (!(val>>32)) { r=4; } else { r=0; val>>=32; }
+ if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; }
+ r += (!val);
+ return r;
+# endif
+# else
+# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ unsigned long r = 0;
+ _BitScanForward64( &r, val );
+ return (int)(r>>3);
+# elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ return (__builtin_ctzll(val) >> 3);
+# else
+ static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 };
+ return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58];
+# endif
+# endif
+}
+
+#else
+
+FORCE_INLINE int LZ4_NbCommonBytes (register U32 val)
+{
+# if defined(LZ4_BIG_ENDIAN)
+# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ unsigned long r = 0;
+ _BitScanReverse( &r, val );
+ return (int)(r>>3);
+# elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ return (__builtin_clz(val) >> 3);
+# else
+ int r;
+ if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; }
+ r += (!val);
+ return r;
+# endif
+# else
+# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ unsigned long r;
+ _BitScanForward( &r, val );
+ return (int)(r>>3);
+# elif defined(__GNUC__) && (GCC_VERSION >= 304) && !defined(LZ4_FORCE_SW_BITCOUNT)
+ return (__builtin_ctz(val) >> 3);
+# else
+ static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 };
+ return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27];
+# endif
+# endif
+}
+
+#endif
+
+
+//****************************
+// Compression functions
+//****************************
+FORCE_INLINE int LZ4_hashSequence(U32 sequence, tableType_t tableType)
+{
+ if (tableType == byU16)
+ return (((sequence) * 2654435761U) >> ((MINMATCH*8)-(LZ4_HASHLOG+1)));
+ else
+ return (((sequence) * 2654435761U) >> ((MINMATCH*8)-LZ4_HASHLOG));
+}
+
+FORCE_INLINE int LZ4_hashPosition(const BYTE* p, tableType_t tableType) { return LZ4_hashSequence(A32(p), tableType); }
+
+FORCE_INLINE void LZ4_putPositionOnHash(const BYTE* p, U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase)
+{
+ switch (tableType)
+ {
+ case byPtr: { const BYTE** hashTable = (const BYTE**) tableBase; hashTable[h] = p; break; }
+ case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = (U32)(p-srcBase); break; }
+ case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = (U16)(p-srcBase); break; }
+ }
+}
+
+FORCE_INLINE void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase)
+{
+ U32 h = LZ4_hashPosition(p, tableType);
+ LZ4_putPositionOnHash(p, h, tableBase, tableType, srcBase);
+}
+
+FORCE_INLINE const BYTE* LZ4_getPositionOnHash(U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase)
+{
+ if (tableType == byPtr) { const BYTE** hashTable = (const BYTE**) tableBase; return hashTable[h]; }
+ if (tableType == byU32) { U32* hashTable = (U32*) tableBase; return hashTable[h] + srcBase; }
+ { U16* hashTable = (U16*) tableBase; return hashTable[h] + srcBase; } // default, to ensure a return
+}
+
+FORCE_INLINE const BYTE* LZ4_getPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase)
+{
+ U32 h = LZ4_hashPosition(p, tableType);
+ return LZ4_getPositionOnHash(h, tableBase, tableType, srcBase);
+}
+
+
+FORCE_INLINE int LZ4_compress_generic(
+ void* ctx,
+ const char* source,
+ char* dest,
+ int inputSize,
+ int maxOutputSize,
+
+ limitedOutput_directive limitedOutput,
+ tableType_t tableType,
+ prefix64k_directive prefix)
+{
+ const BYTE* ip = (const BYTE*) source;
+ const BYTE* const base = (prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->base : (const BYTE*) source;
+ const BYTE* const lowLimit = ((prefix==withPrefix) ? ((LZ4_Data_Structure*)ctx)->bufferStart : (const BYTE*)source);
+ const BYTE* anchor = (const BYTE*) source;
+ const BYTE* const iend = ip + inputSize;
+ const BYTE* const mflimit = iend - MFLIMIT;
+ const BYTE* const matchlimit = iend - LASTLITERALS;
+
+ BYTE* op = (BYTE*) dest;
+ BYTE* const oend = op + maxOutputSize;
+
+ int length;
+ const int skipStrength = SKIPSTRENGTH;
+ U32 forwardH;
+
+ // Init conditions
+ if ((U32)inputSize > (U32)LZ4_MAX_INPUT_SIZE) return 0; // Unsupported input size, too large (or negative)
+ if ((prefix==withPrefix) && (ip != ((LZ4_Data_Structure*)ctx)->nextBlock)) return 0; // must continue from end of previous block
+ if (prefix==withPrefix) ((LZ4_Data_Structure*)ctx)->nextBlock=iend; // do it now, due to potential early exit
+ if ((tableType == byU16) && (inputSize>=LZ4_64KLIMIT)) return 0; // Size too large (not within 64K limit)
+ if (inputSize<LZ4_minLength) goto _last_literals; // Input too small, no compression (all literals)
+
+ // First Byte
+ LZ4_putPosition(ip, ctx, tableType, base);
+ ip++; forwardH = LZ4_hashPosition(ip, tableType);
+
+ // Main Loop
+ for ( ; ; )
+ {
+ int findMatchAttempts = (1U << skipStrength) + 3;
+ const BYTE* forwardIp = ip;
+ const BYTE* ref;
+ BYTE* token;
+
+ // Find a match
+ do {
+ U32 h = forwardH;
+ int step = findMatchAttempts++ >> skipStrength;
+ ip = forwardIp;
+ forwardIp = ip + step;
+
+ if unlikely(forwardIp > mflimit) { goto _last_literals; }
+
+ forwardH = LZ4_hashPosition(forwardIp, tableType);
+ ref = LZ4_getPositionOnHash(h, ctx, tableType, base);
+ LZ4_putPositionOnHash(ip, h, ctx, tableType, base);
+
+ } while ((ref + MAX_DISTANCE < ip) || (A32(ref) != A32(ip)));
+
+ // Catch up
+ while ((ip>anchor) && (ref > lowLimit) && unlikely(ip[-1]==ref[-1])) { ip--; ref--; }
+
+ // Encode Literal length
+ length = (int)(ip - anchor);
+ token = op++;
+ if ((limitedOutput) && unlikely(op + length + (2 + 1 + LASTLITERALS) + (length/255) > oend)) return 0; // Check output limit
+ if (length>=(int)RUN_MASK)
+ {
+ int len = length-RUN_MASK;
+ *token=(RUN_MASK<<ML_BITS);
+ for(; len >= 255 ; len-=255) *op++ = 255;
+ *op++ = (BYTE)len;
+ }
+ else *token = (BYTE)(length<<ML_BITS);
+
+ // Copy Literals
+ { BYTE* end=(op)+(length); LZ4_WILDCOPY(op,anchor,end); op=end; }
+
+_next_match:
+ // Encode Offset
+ LZ4_WRITE_LITTLEENDIAN_16(op,(U16)(ip-ref));
+
+ // Start Counting
+ ip+=MINMATCH; ref+=MINMATCH; // MinMatch already verified
+ anchor = ip;
+ while likely(ip<matchlimit-(STEPSIZE-1))
+ {
+ size_t diff = AARCH(ref) ^ AARCH(ip);
+ if (!diff) { ip+=STEPSIZE; ref+=STEPSIZE; continue; }
+ ip += LZ4_NbCommonBytes(diff);
+ goto _endCount;
+ }
+ if (LZ4_ARCH64) if ((ip<(matchlimit-3)) && (A32(ref) == A32(ip))) { ip+=4; ref+=4; }
+ if ((ip<(matchlimit-1)) && (A16(ref) == A16(ip))) { ip+=2; ref+=2; }
+ if ((ip<matchlimit) && (*ref == *ip)) ip++;
+_endCount:
+
+ // Encode MatchLength
+ length = (int)(ip - anchor);
+ if ((limitedOutput) && unlikely(op + (1 + LASTLITERALS) + (length>>8) > oend)) return 0; // Check output limit
+ if (length>=(int)ML_MASK)
+ {
+ *token += ML_MASK;
+ length -= ML_MASK;
+ for (; length > 509 ; length-=510) { *op++ = 255; *op++ = 255; }
+ if (length >= 255) { length-=255; *op++ = 255; }
+ *op++ = (BYTE)length;
+ }
+ else *token += (BYTE)(length);
+
+ // Test end of chunk
+ if (ip > mflimit) { anchor = ip; break; }
+
+ // Fill table
+ LZ4_putPosition(ip-2, ctx, tableType, base);
+
+ // Test next position
+ ref = LZ4_getPosition(ip, ctx, tableType, base);
+ LZ4_putPosition(ip, ctx, tableType, base);
+ if ((ref + MAX_DISTANCE >= ip) && (A32(ref) == A32(ip))) { token = op++; *token=0; goto _next_match; }
+
+ // Prepare next loop
+ anchor = ip++;
+ forwardH = LZ4_hashPosition(ip, tableType);
+ }
+
+_last_literals:
+ // Encode Last Literals
+ {
+ int lastRun = (int)(iend - anchor);
+ if ((limitedOutput) && (((char*)op - dest) + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > (U32)maxOutputSize)) return 0; // Check output limit
+ if (lastRun>=(int)RUN_MASK) { *op++=(RUN_MASK<<ML_BITS); lastRun-=RUN_MASK; for(; lastRun >= 255 ; lastRun-=255) *op++ = 255; *op++ = (BYTE) lastRun; }
+ else *op++ = (BYTE)(lastRun<<ML_BITS);
+ memcpy(op, anchor, iend - anchor);
+ op += iend-anchor;
+ }
+
+ // End
+ return (int) (((char*)op)-dest);
+}
+
+
+int LZ4_compress(const char* source, char* dest, int inputSize)
+{
+#if (HEAPMODE)
+ void* ctx = ALLOCATOR(HASHNBCELLS4, 4); // Aligned on 4-bytes boundaries
+#else
+ U32 ctx[1U<<(MEMORY_USAGE-2)] = {0}; // Ensure data is aligned on 4-bytes boundaries
+#endif
+ int result;
+
+ if (inputSize < (int)LZ4_64KLIMIT)
+ result = LZ4_compress_generic((void*)ctx, source, dest, inputSize, 0, notLimited, byU16, noPrefix);
+ else
+ result = LZ4_compress_generic((void*)ctx, source, dest, inputSize, 0, notLimited, (sizeof(void*)==8) ? byU32 : byPtr, noPrefix);
+
+#if (HEAPMODE)
+ FREEMEM(ctx);
+#endif
+ return result;
+}
+
+int LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize)
+{
+ return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, 0, notLimited, byU32, withPrefix);
+}
+
+
+int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize)
+{
+#if (HEAPMODE)
+ void* ctx = ALLOCATOR(HASHNBCELLS4, 4); // Aligned on 4-bytes boundaries
+#else
+ U32 ctx[1U<<(MEMORY_USAGE-2)] = {0}; // Ensure data is aligned on 4-bytes boundaries
+#endif
+ int result;
+
+ if (inputSize < (int)LZ4_64KLIMIT)
+ result = LZ4_compress_generic((void*)ctx, source, dest, inputSize, maxOutputSize, limited, byU16, noPrefix);
+ else
+ result = LZ4_compress_generic((void*)ctx, source, dest, inputSize, maxOutputSize, limited, (sizeof(void*)==8) ? byU32 : byPtr, noPrefix);
+
+#if (HEAPMODE)
+ FREEMEM(ctx);
+#endif
+ return result;
+}
+
+int LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize)
+{
+ return LZ4_compress_generic(LZ4_Data, source, dest, inputSize, maxOutputSize, limited, byU32, withPrefix);
+}
+
+
+//****************************
+// Stream functions
+//****************************
+
+FORCE_INLINE void LZ4_init(LZ4_Data_Structure* lz4ds, const BYTE* base)
+{
+ MEM_INIT(lz4ds->hashTable, 0, sizeof(lz4ds->hashTable));
+ lz4ds->bufferStart = base;
+ lz4ds->base = base;
+ lz4ds->nextBlock = base;
+}
+
+
+void* LZ4_create (const char* inputBuffer)
+{
+ void* lz4ds = ALLOCATOR(1, sizeof(LZ4_Data_Structure));
+ LZ4_init ((LZ4_Data_Structure*)lz4ds, (const BYTE*)inputBuffer);
+ return lz4ds;
+}
+
+
+int LZ4_free (void* LZ4_Data)
+{
+ FREEMEM(LZ4_Data);
+ return (0);
+}
+
+
+char* LZ4_slideInputBuffer (void* LZ4_Data)
+{
+ LZ4_Data_Structure* lz4ds = (LZ4_Data_Structure*)LZ4_Data;
+ size_t delta = lz4ds->nextBlock - (lz4ds->bufferStart + 64 KB);
+
+ if ( (lz4ds->base - delta > lz4ds->base) // underflow control
+ || ((size_t)(lz4ds->nextBlock - lz4ds->base) > 0xE0000000) ) // close to 32-bits limit
+ {
+ size_t deltaLimit = (lz4ds->nextBlock - 64 KB) - lz4ds->base;
+ int nH;
+
+ for (nH=0; nH < HASHNBCELLS4; nH++)
+ {
+ if ((size_t)(lz4ds->hashTable[nH]) < deltaLimit) lz4ds->hashTable[nH] = 0;
+ else lz4ds->hashTable[nH] -= (U32)deltaLimit;
+ }
+ memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB);
+ lz4ds->base = lz4ds->bufferStart;
+ lz4ds->nextBlock = lz4ds->base + 64 KB;
+ }
+ else
+ {
+ memcpy((void*)(lz4ds->bufferStart), (const void*)(lz4ds->nextBlock - 64 KB), 64 KB);
+ lz4ds->nextBlock -= delta;
+ lz4ds->base -= delta;
+ }
+
+ return (char*)(lz4ds->nextBlock);
+}
+
+
+//****************************
+// Decompression functions
+//****************************
+
+// This generic decompression function cover all use cases.
+// It shall be instanciated several times, using different sets of directives
+// Note that it is essential this generic function is really inlined,
+// in order to remove useless branches during compilation optimisation.
+FORCE_INLINE int LZ4_decompress_generic(
+ const char* source,
+ char* dest,
+ int inputSize, //
+ int outputSize, // If endOnInput==endOnInputSize, this value is the max size of Output Buffer.
+
+ int endOnInput, // endOnOutputSize, endOnInputSize
+ int prefix64k, // noPrefix, withPrefix
+ int partialDecoding, // full, partial
+ int targetOutputSize // only used if partialDecoding==partial
+ )
+{
+ // Local Variables
+ const BYTE* restrict ip = (const BYTE*) source;
+ const BYTE* ref;
+ const BYTE* const iend = ip + inputSize;
+
+ BYTE* op = (BYTE*) dest;
+ BYTE* const oend = op + outputSize;
+ BYTE* cpy;
+ BYTE* oexit = op + targetOutputSize;
+
+ const size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0}; // static reduces speed for LZ4_decompress_safe() on GCC64
+ static const size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3};
+
+
+ // Special cases
+ if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT; // targetOutputSize too high => decode everything
+ if ((endOnInput) && unlikely(outputSize==0)) return ((inputSize==1) && (*ip==0)) ? 0 : -1; // Empty output buffer
+ if ((!endOnInput) && unlikely(outputSize==0)) return (*ip==0?1:-1);
+
+
+ // Main Loop
+ while (1)
+ {
+ unsigned token;
+ size_t length;
+
+ // get runlength
+ token = *ip++;
+ if ((length=(token>>ML_BITS)) == RUN_MASK)
+ {
+ unsigned s=255;
+ while (((endOnInput)?ip<iend:1) && (s==255))
+ {
+ s = *ip++;
+ length += s;
+ }
+ }
+
+ // copy literals
+ cpy = op+length;
+ if (((endOnInput) && ((cpy>(partialDecoding?oexit:oend-MFLIMIT)) || (ip+length>iend-(2+1+LASTLITERALS))) )
+ || ((!endOnInput) && (cpy>oend-COPYLENGTH)))
+ {
+ if (partialDecoding)
+ {
+ if (cpy > oend) goto _output_error; // Error : write attempt beyond end of output buffer
+ if ((endOnInput) && (ip+length > iend)) goto _output_error; // Error : read attempt beyond end of input buffer
+ }
+ else
+ {
+ if ((!endOnInput) && (cpy != oend)) goto _output_error; // Error : block decoding must stop exactly there
+ if ((endOnInput) && ((ip+length != iend) || (cpy > oend))) goto _output_error; // Error : input must be consumed
+ }
+ memcpy(op, ip, length);
+ ip += length;
+ op += length;
+ break; // Necessarily EOF, due to parsing restrictions
+ }
+ LZ4_WILDCOPY(op, ip, cpy); ip -= (op-cpy); op = cpy;
+
+ // get offset
+ LZ4_READ_LITTLEENDIAN_16(ref,cpy,ip); ip+=2;
+ if ((prefix64k==noPrefix) && unlikely(ref < (BYTE* const)dest)) goto _output_error; // Error : offset outside destination buffer
+
+ // get matchlength
+ if ((length=(token&ML_MASK)) == ML_MASK)
+ {
+ while ((!endOnInput) || (ip<iend-(LASTLITERALS+1))) // Ensure enough bytes remain for LASTLITERALS + token
+ {
+ unsigned s = *ip++;
+ length += s;
+ if (s==255) continue;
+ break;
+ }
+ }
+
+ // copy repeated sequence
+ if unlikely((op-ref)<(int)STEPSIZE)
+ {
+ const size_t dec64 = dec64table[(sizeof(void*)==4) ? 0 : op-ref];
+ op[0] = ref[0];
+ op[1] = ref[1];
+ op[2] = ref[2];
+ op[3] = ref[3];
+ op += 4, ref += 4; ref -= dec32table[op-ref];
+ A32(op) = A32(ref);
+ op += STEPSIZE-4; ref -= dec64;
+ } else { LZ4_COPYSTEP(op,ref); }
+ cpy = op + length - (STEPSIZE-4);
+
+ if unlikely(cpy>oend-COPYLENGTH-(STEPSIZE-4))
+ {
+ if (cpy > oend-LASTLITERALS) goto _output_error; // Error : last 5 bytes must be literals
+ LZ4_SECURECOPY(op, ref, (oend-COPYLENGTH));
+ while(op<cpy) *op++=*ref++;
+ op=cpy;
+ continue;
+ }
+ LZ4_WILDCOPY(op, ref, cpy);
+ op=cpy; // correction
+ }
+
+ // end of decoding
+ if (endOnInput)
+ return (int) (((char*)op)-dest); // Nb of output bytes decoded
+ else
+ return (int) (((char*)ip)-source); // Nb of input bytes read
+
+ // Overflow error detected
+_output_error:
+ return (int) (-(((char*)ip)-source))-1;
+}
+
+
+int LZ4_decompress_safe(const char* source, char* dest, int inputSize, int maxOutputSize)
+{
+ return LZ4_decompress_generic(source, dest, inputSize, maxOutputSize, endOnInputSize, noPrefix, full, 0);
+}
+
+int LZ4_decompress_safe_withPrefix64k(const char* source, char* dest, int inputSize, int maxOutputSize)
+{
+ return LZ4_decompress_generic(source, dest, inputSize, maxOutputSize, endOnInputSize, withPrefix, full, 0);
+}
+
+int LZ4_decompress_safe_partial(const char* source, char* dest, int inputSize, int targetOutputSize, int maxOutputSize)
+{
+ return LZ4_decompress_generic(source, dest, inputSize, maxOutputSize, endOnInputSize, noPrefix, partial, targetOutputSize);
+}
+
+int LZ4_decompress_fast_withPrefix64k(const char* source, char* dest, int outputSize)
+{
+ return LZ4_decompress_generic(source, dest, 0, outputSize, endOnOutputSize, withPrefix, full, 0);
+}
+
+int LZ4_decompress_fast(const char* source, char* dest, int outputSize)
+{
+#ifdef _MSC_VER // This version is faster with Visual
+ return LZ4_decompress_generic(source, dest, 0, outputSize, endOnOutputSize, noPrefix, full, 0);
+#else
+ return LZ4_decompress_generic(source, dest, 0, outputSize, endOnOutputSize, withPrefix, full, 0);
+#endif
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.h b/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.h
new file mode 100644
index 00000000..a289fcfd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-lz4.h
@@ -0,0 +1,205 @@
+/*
+ LZ4 - Fast LZ compression algorithm
+ Header File
+ Copyright (C) 2011-2013, Yann Collet.
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ 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.
+
+ 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.
+
+ You can contact the author at :
+ - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
+ - LZ4 source repository : http://code.google.com/p/lz4/
+*/
+#pragma once
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+//**************************************
+// Compiler Options
+//**************************************
+#if defined(_MSC_VER) && !defined(__cplusplus) // Visual Studio
+# define inline __inline // Visual C is not C99, but supports some kind of inline
+#endif
+
+
+//****************************
+// Simple Functions
+//****************************
+
+int LZ4_compress (const char* source, char* dest, int inputSize);
+int LZ4_decompress_safe (const char* source, char* dest, int inputSize, int maxOutputSize);
+
+/*
+LZ4_compress() :
+ Compresses 'inputSize' bytes from 'source' into 'dest'.
+ Destination buffer must be already allocated,
+ and must be sized to handle worst cases situations (input data not compressible)
+ Worst case size evaluation is provided by function LZ4_compressBound()
+ inputSize : Max supported value is LZ4_MAX_INPUT_VALUE
+ return : the number of bytes written in buffer dest
+ or 0 if the compression fails
+
+LZ4_decompress_safe() :
+ maxOutputSize : is the size of the destination buffer (which must be already allocated)
+ return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize)
+ If the source stream is detected malformed, the function will stop decoding and return a negative result.
+ This function is protected against buffer overflow exploits (never writes outside of output buffer, and never reads outside of input buffer). Therefore, it is protected against malicious data packets
+*/
+
+
+//****************************
+// Advanced Functions
+//****************************
+#define LZ4_MAX_INPUT_SIZE 0x7E000000 // 2 113 929 216 bytes
+#define LZ4_COMPRESSBOUND(isize) ((unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
+static inline int LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); }
+
+/*
+LZ4_compressBound() :
+ Provides the maximum size that LZ4 may output in a "worst case" scenario (input data not compressible)
+ primarily useful for memory allocation of output buffer.
+ inline function is recommended for the general case,
+ macro is also provided when result needs to be evaluated at compilation (such as stack memory allocation).
+
+ isize : is the input size. Max supported value is LZ4_MAX_INPUT_SIZE
+ return : maximum output size in a "worst case" scenario
+ or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE)
+*/
+
+
+int LZ4_compress_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize);
+
+/*
+LZ4_compress_limitedOutput() :
+ Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'.
+ If it cannot achieve it, compression will stop, and result of the function will be zero.
+ This function never writes outside of provided output buffer.
+
+ inputSize : Max supported value is LZ4_MAX_INPUT_VALUE
+ maxOutputSize : is the size of the destination buffer (which must be already allocated)
+ return : the number of bytes written in buffer 'dest'
+ or 0 if the compression fails
+*/
+
+
+int LZ4_decompress_fast (const char* source, char* dest, int outputSize);
+
+/*
+LZ4_decompress_fast() :
+ outputSize : is the original (uncompressed) size
+ return : the number of bytes read from the source buffer (in other words, the compressed size)
+ If the source stream is malformed, the function will stop decoding and return a negative result.
+ note : This function is a bit faster than LZ4_decompress_safe()
+ This function never writes outside of output buffers, but may read beyond input buffer in case of malicious data packet.
+ Use this function preferably into a trusted environment (data to decode comes from a trusted source).
+ Destination buffer must be already allocated. Its size must be a minimum of 'outputSize' bytes.
+*/
+
+int LZ4_decompress_safe_partial (const char* source, char* dest, int inputSize, int targetOutputSize, int maxOutputSize);
+
+/*
+LZ4_decompress_safe_partial() :
+ This function decompress a compressed block of size 'inputSize' at position 'source'
+ into output buffer 'dest' of size 'maxOutputSize'.
+ The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached,
+ reducing decompression time.
+ return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize)
+ Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller.
+ Always control how many bytes were decoded.
+ If the source stream is detected malformed, the function will stop decoding and return a negative result.
+ This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets
+*/
+
+
+//****************************
+// Stream Functions
+//****************************
+
+void* LZ4_create (const char* inputBuffer);
+int LZ4_compress_continue (void* LZ4_Data, const char* source, char* dest, int inputSize);
+int LZ4_compress_limitedOutput_continue (void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize);
+char* LZ4_slideInputBuffer (void* LZ4_Data);
+int LZ4_free (void* LZ4_Data);
+
+/*
+These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks.
+In order to achieve this, it is necessary to start creating the LZ4 Data Structure, thanks to the function :
+
+void* LZ4_create (const char* inputBuffer);
+The result of the function is the (void*) pointer on the LZ4 Data Structure.
+This pointer will be needed in all other functions.
+If the pointer returned is NULL, then the allocation has failed, and compression must be aborted.
+The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer.
+The input buffer must be already allocated, and size at least 192KB.
+'inputBuffer' will also be the 'const char* source' of the first block.
+
+All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'.
+To compress each block, use either LZ4_compress_continue() or LZ4_compress_limitedOutput_continue().
+Their behavior are identical to LZ4_compress() or LZ4_compress_limitedOutput(),
+but require the LZ4 Data Structure as their first argument, and check that each block starts right after the previous one.
+If next block does not begin immediately after the previous one, the compression will fail (return 0).
+
+When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to :
+char* LZ4_slideInputBuffer(void* LZ4_Data);
+must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer.
+Note that, for this function to work properly, minimum size of an input buffer must be 192KB.
+==> The memory position where the next input data block must start is provided as the result of the function.
+
+Compression can then resume, using LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(), as usual.
+
+When compression is completed, a call to LZ4_free() will release the memory used by the LZ4 Data Structure.
+*/
+
+
+int LZ4_decompress_safe_withPrefix64k (const char* source, char* dest, int inputSize, int maxOutputSize);
+int LZ4_decompress_fast_withPrefix64k (const char* source, char* dest, int outputSize);
+
+/*
+*_withPrefix64k() :
+ These decoding functions work the same as their "normal name" versions,
+ but can use up to 64KB of data in front of 'char* dest'.
+ These functions are necessary to decode inter-dependant blocks.
+*/
+
+
+//****************************
+// Obsolete Functions
+//****************************
+
+static inline int LZ4_uncompress (const char* source, char* dest, int outputSize) { return LZ4_decompress_fast(source, dest, outputSize); }
+static inline int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize) { return LZ4_decompress_safe(source, dest, isize, maxOutputSize); }
+
+/*
+These functions are deprecated and should no longer be used.
+They are provided here for compatibility with existing user programs.
+*/
+
+
+
+#if defined (__cplusplus)
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat-stdbool.h b/ics-openvpn-stripped/main/openvpn/src/compat/compat-stdbool.h
new file mode 100644
index 00000000..99412188
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat-stdbool.h
@@ -0,0 +1,12 @@
+#ifndef __COMPAT_STDBOOL_H
+#define __COMPAT_STDBOOL_H
+
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+typedef int bool;
+#define false 0
+#define true 1
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat.h b/ics-openvpn-stripped/main/openvpn/src/compat/compat.h
new file mode 100644
index 00000000..021573eb
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat.h
@@ -0,0 +1,68 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2011 - David Sommerseth <davids@redhat.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef COMPAT_H
+#define COMPAT_H
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifndef HAVE_DIRNAME
+char * dirname(char *str);
+#endif /* HAVE_DIRNAME */
+
+#ifndef HAVE_BASENAME
+char * basename(char *str);
+#endif /* HAVE_BASENAME */
+
+#ifndef HAVE_GETTIMEOFDAY
+int gettimeofday (struct timeval *tv, void *tz);
+#endif
+
+#ifndef HAVE_DAEMON
+int daemon(int nochdir, int noclose);
+#endif
+
+#ifndef HAVE_INET_NTOP
+const char * inet_ntop(int af, const void *src, char *dst, socklen_t size);
+#endif
+
+#ifndef HAVE_INET_PTON
+int inet_pton(int af, const char *src, void *dst);
+#endif
+
+#endif /* COMPAT_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj b/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj
new file mode 100644
index 00000000..42979c11
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4B2E2719-E661-45D7-9203-F6F456B22F19}</ProjectGuid>
+ <RootNamespace>compat</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="compat-basename.c" />
+ <ClCompile Include="compat-dirname.c" />
+ <ClCompile Include="compat-gettimeofday.c" />
+ <ClCompile Include="compat-inet_ntop.c" />
+ <ClCompile Include="compat-inet_pton.c" />
+ <ClCompile Include="compat-daemon.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="compat.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj.filters b/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj.filters
new file mode 100644
index 00000000..00bb0ffa
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/compat/compat.vcxproj.filters
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="compat-basename.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-dirname.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-gettimeofday.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-inet_ntop.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-inet_pton.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="compat-daemon.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="compat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/openvpn/Makefile.am
new file mode 100644
index 00000000..fd593c57
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/Makefile.am
@@ -0,0 +1,133 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+include $(top_srcdir)/build/ltrc.inc
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ openvpn.vcxproj \
+ openvpn.vcxproj.filters
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/compat
+
+AM_CFLAGS = \
+ $(TAP_CFLAGS) \
+ $(OPTIONAL_CRYPTO_CFLAGS) \
+ $(OPTIONAL_LZO_CFLAGS) \
+ $(OPTIONAL_SNAPPY_CFLAGS) \
+ $(OPTIONAL_LZ4_CFLAGS) \
+ $(OPTIONAL_PKCS11_HELPER_CFLAGS)
+if WIN32
+# we want unicode entry point but not the macro
+AM_CFLAGS += -municode -UUNICODE
+endif
+
+sbin_PROGRAMS = openvpn
+
+openvpn_SOURCES = \
+ base64.c base64.h \
+ basic.h \
+ buffer.c buffer.h \
+ circ_list.h \
+ clinat.c clinat.h \
+ common.h \
+ comp.c comp.h compstub.c \
+ comp-lz4.c comp-lz4.h \
+ crypto.c crypto.h crypto_backend.h \
+ crypto_openssl.c crypto_openssl.h \
+ crypto_polarssl.c crypto_polarssl.h \
+ dhcp.c dhcp.h \
+ errlevel.h \
+ error.c error.h \
+ event.c event.h \
+ fdmisc.c fdmisc.h \
+ forward.c forward.h forward-inline.h \
+ fragment.c fragment.h \
+ gremlin.c gremlin.h \
+ helper.c helper.h \
+ httpdigest.c httpdigest.h \
+ lladdr.c lladdr.h \
+ init.c init.h \
+ integer.h \
+ interval.c interval.h \
+ list.c list.h \
+ lzo.c lzo.h \
+ manage.c manage.h \
+ mbuf.c mbuf.h \
+ memdbg.h \
+ misc.c misc.h \
+ platform.c platform.h \
+ console.c console.h \
+ mroute.c mroute.h \
+ mss.c mss.h \
+ mstats.c mstats.h \
+ mtcp.c mtcp.h \
+ mtu.c mtu.h \
+ mudp.c mudp.h \
+ multi.c multi.h \
+ ntlm.c ntlm.h \
+ occ.c occ.h occ-inline.h \
+ pkcs11.c pkcs11.h pkcs11_backend.h \
+ pkcs11_openssl.c \
+ pkcs11_polarssl.c \
+ openvpn.c openvpn.h \
+ options.c options.h \
+ otime.c otime.h \
+ packet_id.c packet_id.h \
+ perf.c perf.h \
+ pf.c pf.h pf-inline.h \
+ ping.c ping.h ping-inline.h \
+ plugin.c plugin.h \
+ pool.c pool.h \
+ proto.c proto.h \
+ proxy.c proxy.h \
+ ps.c ps.h \
+ push.c push.h \
+ pushlist.h \
+ reliable.c reliable.h \
+ route.c route.h \
+ schedule.c schedule.h \
+ session_id.c session_id.h \
+ shaper.c shaper.h \
+ sig.c sig.h \
+ snappy.c snappy.h \
+ socket.c socket.h \
+ socks.c socks.h \
+ ssl.c ssl.h ssl_backend.h \
+ ssl_openssl.c ssl_openssl.h \
+ ssl_polarssl.c ssl_polarssl.h \
+ ssl_common.h \
+ ssl_verify.c ssl_verify.h ssl_verify_backend.h \
+ ssl_verify_openssl.c ssl_verify_openssl.h \
+ ssl_verify_polarssl.c ssl_verify_polarssl.h \
+ status.c status.h \
+ syshead.h \
+ tun.c tun.h \
+ win32.h win32.c \
+ cryptoapi.h cryptoapi.c
+openvpn_LDADD = \
+ $(top_builddir)/src/compat/libcompat.la \
+ $(SOCKETS_LIBS) \
+ $(OPTIONAL_LZO_LIBS) \
+ $(OPTIONAL_SNAPPY_LIBS) \
+ $(OPTIONAL_LZ4_LIBS) \
+ $(OPTIONAL_PKCS11_HELPER_LIBS) \
+ $(OPTIONAL_CRYPTO_LIBS) \
+ $(OPTIONAL_SELINUX_LIBS) \
+ $(OPTIONAL_DL_LIBS)
+if WIN32
+openvpn_SOURCES += openvpn_win32_resources.rc
+openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm
+endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.c
new file mode 100644
index 00000000..6dc8479f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * 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 Institute 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 INSTITUTE 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 INSTITUTE 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "base64.h"
+
+#include "memdbg.h"
+
+static char base64_chars[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+/*
+ * base64 encode input data of length size to malloced
+ * buffer which is returned as *str. Returns string
+ * length of *str.
+ */
+int
+openvpn_base64_encode(const void *data, int size, char **str)
+{
+ char *s, *p;
+ int i;
+ int c;
+ const unsigned char *q;
+
+ if (size < 0)
+ return -1;
+ p = s = (char *) malloc(size * 4 / 3 + 4);
+ if (p == NULL)
+ return -1;
+ q = (const unsigned char *) data;
+ i = 0;
+ for (i = 0; i < size;) {
+ c = q[i++];
+ c *= 256;
+ if (i < size)
+ c += q[i];
+ i++;
+ c *= 256;
+ if (i < size)
+ c += q[i];
+ i++;
+ p[0] = base64_chars[(c & 0x00fc0000) >> 18];
+ p[1] = base64_chars[(c & 0x0003f000) >> 12];
+ p[2] = base64_chars[(c & 0x00000fc0) >> 6];
+ p[3] = base64_chars[(c & 0x0000003f) >> 0];
+ if (i > size)
+ p[3] = '=';
+ if (i > size + 1)
+ p[2] = '=';
+ p += 4;
+ }
+ *p = 0;
+ *str = s;
+ return strlen(s);
+}
+
+static int
+pos(char c)
+{
+ char *p;
+ for (p = base64_chars; *p; p++)
+ if (*p == c)
+ return p - base64_chars;
+ return -1;
+}
+
+#define DECODE_ERROR 0xffffffff
+
+static unsigned int
+token_decode(const char *token)
+{
+ int i;
+ unsigned int val = 0;
+ int marker = 0;
+ if (strlen(token) < 4)
+ return DECODE_ERROR;
+ for (i = 0; i < 4; i++) {
+ val *= 64;
+ if (token[i] == '=')
+ marker++;
+ else if (marker > 0)
+ return DECODE_ERROR;
+ else
+ val += pos(token[i]);
+ }
+ if (marker > 2)
+ return DECODE_ERROR;
+ return (marker << 24) | val;
+}
+/*
+ * Decode base64 str, outputting data to buffer
+ * at data of length size. Return length of
+ * decoded data written or -1 on error or overflow.
+ */
+int
+openvpn_base64_decode(const char *str, void *data, int size)
+{
+ const char *p;
+ unsigned char *q;
+ unsigned char *e = NULL;
+
+ q = data;
+ if (size >= 0)
+ e = q + size;
+ for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) {
+ unsigned int val = token_decode(p);
+ unsigned int marker = (val >> 24) & 0xff;
+ if (val == DECODE_ERROR)
+ return -1;
+ if (e && q >= e)
+ return -1;
+ *q++ = (val >> 16) & 0xff;
+ if (marker < 2)
+ {
+ if (e && q >= e)
+ return -1;
+ *q++ = (val >> 8) & 0xff;
+ }
+ if (marker < 1)
+ {
+ if (e && q >= e)
+ return -1;
+ *q++ = val & 0xff;
+ }
+ }
+ return q - (unsigned char *) data;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.h
new file mode 100644
index 00000000..92a195aa
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/base64.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * 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 Institute 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 INSTITUTE 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 INSTITUTE 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 _BASE64_H_
+#define _BASE64_H_
+
+int openvpn_base64_encode(const void *data, int size, char **str);
+int openvpn_base64_decode(const char *str, void *data, int size);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/basic.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/basic.h
new file mode 100644
index 00000000..298cf103
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/basic.h
@@ -0,0 +1,38 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef BASIC_H
+#define BASIC_H
+
+#define BOOL_CAST(x) ((x) ? (true) : (false))
+
+/* size of an array */
+#define SIZE(x) (sizeof(x)/sizeof(x[0]))
+
+/* clear an object */
+#define CLEAR(x) memset(&(x), 0, sizeof(x))
+
+#define IPV4_NETMASK_HOST 0xffffffffU
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.cpp b/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.cpp
new file mode 100644
index 00000000..cfcc10a8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.cpp
@@ -0,0 +1,29 @@
+
+#include "breakpad.h"
+#include "client/linux/handler/exception_handler.h"
+
+
+static
+bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
+ void* context,
+ bool succeeded) {
+ printf("Dump path: %s\n", descriptor.path());
+ fflush(stdout);
+ fflush(stderr);
+ return succeeded;
+}
+
+static google_breakpad::MinidumpDescriptor* desc;
+static google_breakpad::ExceptionHandler* eh;
+
+void breakpad_setup(void)
+{
+ printf("Initializing Google Breakpad!\n");
+ desc = new google_breakpad::MinidumpDescriptor("/data/data/de.blinkt.openvpn/cache");
+ eh = new google_breakpad::ExceptionHandler(*desc, NULL, DumpCallback, NULL, true,-1);
+}
+
+void breakpad_dodump(void)
+{
+ eh->WriteMinidump();
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.h
new file mode 100644
index 00000000..84df62ab
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/breakpad.h
@@ -0,0 +1,13 @@
+#ifndef BUFFER_H
+#define BUFFER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void breakpad_setup(void);
+ void breakpad_dodump(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.c
new file mode 100644
index 00000000..46f874b2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.c
@@ -0,0 +1,1153 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "common.h"
+#include "buffer.h"
+#include "error.h"
+#include "mtu.h"
+#include "misc.h"
+
+#include "memdbg.h"
+
+size_t
+array_mult_safe (const size_t m1, const size_t m2, const size_t extra)
+{
+ const size_t limit = 0xFFFFFFFF;
+ unsigned long long res = (unsigned long long)m1 * (unsigned long long)m2 + (unsigned long long)extra;
+ if (unlikely(m1 > limit) || unlikely(m2 > limit) || unlikely(extra > limit) || unlikely(res > (unsigned long long)limit))
+ msg (M_FATAL, "attemped allocation of excessively large array");
+ return (size_t) res;
+}
+
+void
+buf_size_error (const size_t size)
+{
+ msg (M_FATAL, "fatal buffer size error, size=%lu", (unsigned long)size);
+}
+
+struct buffer
+#ifdef DMALLOC
+alloc_buf_debug (size_t size, const char *file, int line)
+#else
+alloc_buf (size_t size)
+#endif
+{
+ struct buffer buf;
+
+ if (!buf_size_valid (size))
+ buf_size_error (size);
+ buf.capacity = (int)size;
+ buf.offset = 0;
+ buf.len = 0;
+#ifdef DMALLOC
+ buf.data = openvpn_dmalloc (file, line, size);
+#else
+ buf.data = calloc (1, size);
+#endif
+ check_malloc_return(buf.data);
+
+ return buf;
+}
+
+struct buffer
+#ifdef DMALLOC
+alloc_buf_gc_debug (size_t size, struct gc_arena *gc, const char *file, int line)
+#else
+alloc_buf_gc (size_t size, struct gc_arena *gc)
+#endif
+{
+ struct buffer buf;
+ if (!buf_size_valid (size))
+ buf_size_error (size);
+ buf.capacity = (int)size;
+ buf.offset = 0;
+ buf.len = 0;
+#ifdef DMALLOC
+ buf.data = (uint8_t *) gc_malloc_debug (size, false, gc, file, line);
+#else
+ buf.data = (uint8_t *) gc_malloc (size, false, gc);
+#endif
+ if (size)
+ *buf.data = 0;
+ return buf;
+}
+
+struct buffer
+#ifdef DMALLOC
+clone_buf_debug (const struct buffer* buf, const char *file, int line)
+#else
+clone_buf (const struct buffer* buf)
+#endif
+{
+ struct buffer ret;
+ ret.capacity = buf->capacity;
+ ret.offset = buf->offset;
+ ret.len = buf->len;
+#ifdef DMALLOC
+ ret.data = (uint8_t *) openvpn_dmalloc (file, line, buf->capacity);
+#else
+ ret.data = (uint8_t *) malloc (buf->capacity);
+#endif
+ check_malloc_return (ret.data);
+ memcpy (BPTR (&ret), BPTR (buf), BLEN (buf));
+ return ret;
+}
+
+#ifdef BUF_INIT_TRACKING
+
+bool
+buf_init_debug (struct buffer *buf, int offset, const char *file, int line)
+{
+ buf->debug_file = file;
+ buf->debug_line = line;
+ return buf_init_dowork (buf, offset);
+}
+
+static inline int
+buf_debug_line (const struct buffer *buf)
+{
+ return buf->debug_line;
+}
+
+static const char *
+buf_debug_file (const struct buffer *buf)
+{
+ return buf->debug_file;
+}
+
+#else
+
+#define buf_debug_line(buf) 0
+#define buf_debug_file(buf) "[UNDEF]"
+
+#endif
+
+void
+buf_clear (struct buffer *buf)
+{
+ if (buf->capacity > 0)
+ memset (buf->data, 0, buf->capacity);
+ buf->len = 0;
+ buf->offset = 0;
+}
+
+bool
+buf_assign (struct buffer *dest, const struct buffer *src)
+{
+ if (!buf_init (dest, src->offset))
+ return false;
+ return buf_write (dest, BPTR (src), BLEN (src));
+}
+
+struct buffer
+clear_buf ()
+{
+ struct buffer buf;
+ CLEAR (buf);
+ return buf;
+}
+
+void
+free_buf (struct buffer *buf)
+{
+ if (buf->data)
+ free (buf->data);
+ CLEAR (*buf);
+}
+
+/*
+ * Return a buffer for write that is a subset of another buffer
+ */
+struct buffer
+buf_sub (struct buffer *buf, int size, bool prepend)
+{
+ struct buffer ret;
+ uint8_t *data;
+
+ CLEAR (ret);
+ data = prepend ? buf_prepend (buf, size) : buf_write_alloc (buf, size);
+ if (data)
+ {
+ ret.capacity = size;
+ ret.data = data;
+ }
+ return ret;
+}
+
+/*
+ * printf append to a buffer with overflow check
+ */
+bool
+buf_printf (struct buffer *buf, const char *format, ...)
+{
+ int ret = false;
+ if (buf_defined (buf))
+ {
+ va_list arglist;
+ uint8_t *ptr = BEND (buf);
+ int cap = buf_forward_capacity (buf);
+
+ if (cap > 0)
+ {
+ int stat;
+ va_start (arglist, format);
+ stat = vsnprintf ((char *)ptr, cap, format, arglist);
+ va_end (arglist);
+ *(buf->data + buf->capacity - 1) = 0; /* windows vsnprintf needs this */
+ buf->len += (int) strlen ((char *)ptr);
+ if (stat >= 0 && stat < cap)
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+bool
+buf_puts(struct buffer *buf, const char *str)
+{
+ int ret = false;
+ uint8_t *ptr = BEND (buf);
+ int cap = buf_forward_capacity (buf);
+ if (cap > 0)
+ {
+ strncpynt ((char *)ptr,str, cap);
+ *(buf->data + buf->capacity - 1) = 0; /* windows vsnprintf needs this */
+ buf->len += (int) strlen ((char *)ptr);
+ ret = true;
+ }
+ return ret;
+}
+
+
+/*
+ * This is necessary due to certain buggy implementations of snprintf,
+ * that don't guarantee null termination for size > 0.
+ *
+ * Return false on overflow.
+ *
+ * This function is duplicated into service-win32/openvpnserv.c
+ * Any modifications here should be done to the other place as well.
+ */
+
+bool openvpn_snprintf(char *str, size_t size, const char *format, ...)
+{
+ va_list arglist;
+ int len = -1;
+ if (size > 0)
+ {
+ va_start (arglist, format);
+ len = vsnprintf (str, size, format, arglist);
+ va_end (arglist);
+ str[size - 1] = 0;
+ }
+ return (len >= 0 && len < size);
+}
+
+/*
+ * write a string to the end of a buffer that was
+ * truncated by buf_printf
+ */
+void
+buf_catrunc (struct buffer *buf, const char *str)
+{
+ if (buf_forward_capacity (buf) <= 1)
+ {
+ int len = (int) strlen (str) + 1;
+ if (len < buf_forward_capacity_total (buf))
+ {
+ strncpynt ((char *)(buf->data + buf->capacity - len), str, len);
+ }
+ }
+}
+
+/*
+ * convert a multi-line output to one line
+ */
+void
+convert_to_one_line (struct buffer *buf)
+{
+ uint8_t *cp = BPTR(buf);
+ int len = BLEN(buf);
+ while (len--)
+ {
+ if (*cp == '\n')
+ *cp = '|';
+ ++cp;
+ }
+}
+
+/* NOTE: requires that string be null terminated */
+void
+buf_write_string_file (const struct buffer *buf, const char *filename, int fd)
+{
+ const int len = strlen ((char *) BPTR (buf));
+ const int size = write (fd, BPTR (buf), len);
+ if (size != len)
+ msg (M_ERR, "Write error on file '%s'", filename);
+}
+
+/*
+ * Garbage collection
+ */
+
+void *
+#ifdef DMALLOC
+gc_malloc_debug (size_t size, bool clear, struct gc_arena *a, const char *file, int line)
+#else
+gc_malloc (size_t size, bool clear, struct gc_arena *a)
+#endif
+{
+ void *ret;
+ if (a)
+ {
+ struct gc_entry *e;
+#ifdef DMALLOC
+ e = (struct gc_entry *) openvpn_dmalloc (file, line, size + sizeof (struct gc_entry));
+#else
+ e = (struct gc_entry *) malloc (size + sizeof (struct gc_entry));
+#endif
+ check_malloc_return (e);
+ ret = (char *) e + sizeof (struct gc_entry);
+ e->next = a->list;
+ a->list = e;
+ }
+ else
+ {
+#ifdef DMALLOC
+ ret = openvpn_dmalloc (file, line, size);
+#else
+ ret = malloc (size);
+#endif
+ check_malloc_return (ret);
+ }
+#ifndef ZERO_BUFFER_ON_ALLOC
+ if (clear)
+#endif
+ memset (ret, 0, size);
+ return ret;
+}
+
+void
+x_gc_free (struct gc_arena *a)
+{
+ struct gc_entry *e;
+ e = a->list;
+ a->list = NULL;
+
+ while (e != NULL)
+ {
+ struct gc_entry *next = e->next;
+ free (e);
+ e = next;
+ }
+}
+
+/*
+ * Functions to handle special objects in gc_entries
+ */
+
+void
+x_gc_freespecial (struct gc_arena *a)
+{
+ struct gc_entry_special *e;
+ e = a->list_special;
+ a->list_special = NULL;
+
+ while (e != NULL)
+ {
+ struct gc_entry_special *next = e->next;
+ e->free_fnc (e->addr);
+ free(e);
+ e = next;
+ }
+}
+
+void gc_addspecial (void *addr, void (free_function)(void*), struct gc_arena *a)
+{
+ ASSERT(a);
+ struct gc_entry_special *e;
+#ifdef DMALLOC
+ e = (struct gc_entry_special *) openvpn_dmalloc (file, line, sizeof (struct gc_entry_special));
+#else
+ e = (struct gc_entry_special *) malloc (sizeof (struct gc_entry_special));
+#endif
+ check_malloc_return (e);
+ e->free_fnc = free_function;
+ e->addr = addr;
+
+ e->next = a->list_special;
+ a->list_special = e;
+}
+
+
+/*
+ * Transfer src arena to dest, resetting src to an empty arena.
+ */
+void
+gc_transfer (struct gc_arena *dest, struct gc_arena *src)
+{
+ if (dest && src)
+ {
+ struct gc_entry *e = src->list;
+ if (e)
+ {
+ while (e->next != NULL)
+ e = e->next;
+ e->next = dest->list;
+ dest->list = src->list;
+ src->list = NULL;
+ }
+ }
+}
+
+/*
+ * Hex dump -- Output a binary buffer to a hex string and return it.
+ */
+
+char *
+format_hex_ex (const uint8_t *data, int size, int maxoutput,
+ int space_break, const char* separator,
+ struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (maxoutput ? maxoutput :
+ ((size * 2) + (size / space_break) * (int) strlen (separator) + 2),
+ gc);
+ int i;
+ for (i = 0; i < size; ++i)
+ {
+ if (separator && i && !(i % space_break))
+ buf_printf (&out, "%s", separator);
+ buf_printf (&out, "%02x", data[i]);
+ }
+ buf_catrunc (&out, "[more...]");
+ return (char *)out.data;
+}
+
+/*
+ * remove specific trailing character
+ */
+
+void
+buf_rmtail (struct buffer *buf, uint8_t remove)
+{
+ uint8_t *cp = BLAST(buf);
+ if (cp && *cp == remove)
+ {
+ *cp = '\0';
+ --buf->len;
+ }
+}
+
+/*
+ * force a null termination even it requires
+ * truncation of the last char.
+ */
+void
+buf_null_terminate (struct buffer *buf)
+{
+ char *last = (char *) BLAST (buf);
+ if (last && *last == '\0') /* already terminated? */
+ return;
+
+ if (!buf_safe (buf, 1)) /* make space for trailing null */
+ buf_inc_len (buf, -1);
+
+ buf_write_u8 (buf, 0);
+}
+
+/*
+ * Remove trailing \r and \n chars and ensure
+ * null termination.
+ */
+void
+buf_chomp (struct buffer *buf)
+{
+ while (true)
+ {
+ char *last = (char *) BLAST (buf);
+ if (!last)
+ break;
+ if (char_class (*last, CC_CRLF|CC_NULL))
+ {
+ if (!buf_inc_len (buf, -1))
+ break;
+ }
+ else
+ break;
+ }
+ buf_null_terminate (buf);
+}
+
+const char *
+skip_leading_whitespace (const char *str)
+{
+ while (*str)
+ {
+ const char c = *str;
+ if (!(c == ' ' || c == '\t'))
+ break;
+ ++str;
+ }
+ return str;
+}
+
+/*
+ * like buf_null_terminate, but operate on strings
+ */
+void
+string_null_terminate (char *str, int len, int capacity)
+{
+ ASSERT (len >= 0 && len <= capacity && capacity > 0);
+ if (len < capacity)
+ *(str + len) = '\0';
+ else if (len == capacity)
+ *(str + len - 1) = '\0';
+}
+
+/*
+ * Remove trailing \r and \n chars.
+ */
+void
+chomp (char *str)
+{
+ rm_trailing_chars (str, "\r\n");
+}
+
+/*
+ * Remove trailing chars
+ */
+void
+rm_trailing_chars (char *str, const char *what_to_delete)
+{
+ bool modified;
+ do {
+ const int len = strlen (str);
+ modified = false;
+ if (len > 0)
+ {
+ char *cp = str + (len - 1);
+ if (strchr (what_to_delete, *cp) != NULL)
+ {
+ *cp = '\0';
+ modified = true;
+ }
+ }
+ } while (modified);
+}
+
+/*
+ * Allocate a string
+ */
+char *
+#ifdef DMALLOC
+string_alloc_debug (const char *str, struct gc_arena *gc, const char *file, int line)
+#else
+string_alloc (const char *str, struct gc_arena *gc)
+#endif
+{
+ if (str)
+ {
+ const int n = strlen (str) + 1;
+ char *ret;
+
+ if (gc) {
+#ifdef DMALLOC
+ ret = (char *) gc_malloc_debug (n, false, gc, file, line);
+#else
+ ret = (char *) gc_malloc (n, false, gc);
+#endif
+ } else {
+ /* If there are no garbage collector available, it's expected
+ * that the caller cleans up afterwards. This is coherent with the
+ * earlier behaviour when gc_malloc() would be called with gc == NULL
+ */
+#ifdef DMALLOC
+ ret = openvpn_dmalloc (file, line, n);
+ memset(ret, 0, n);
+#else
+ ret = calloc(1, n);
+#endif
+ check_malloc_return(ret);
+ }
+ memcpy (ret, str, n);
+ return ret;
+ }
+ else
+ return NULL;
+}
+
+/*
+ * Erase all characters in a string
+ */
+void
+string_clear (char *str)
+{
+ if (str)
+ {
+ const int len = strlen (str);
+ if (len > 0)
+ memset (str, 0, len);
+ }
+}
+
+/*
+ * Return the length of a string array
+ */
+int
+string_array_len (const char **array)
+{
+ int i = 0;
+ if (array)
+ {
+ while (array[i])
+ ++i;
+ }
+ return i;
+}
+
+char *
+print_argv (const char **p, struct gc_arena *gc, const unsigned int flags)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ int i = 0;
+ for (;;)
+ {
+ const char *cp = *p++;
+ if (!cp)
+ break;
+ if (i)
+ buf_printf (&out, " ");
+ if (flags & PA_BRACKET)
+ buf_printf (&out, "[%s]", cp);
+ else
+ buf_printf (&out, "%s", cp);
+ ++i;
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Allocate a string inside a buffer
+ */
+struct buffer
+#ifdef DMALLOC
+string_alloc_buf_debug (const char *str, struct gc_arena *gc, const char *file, int line)
+#else
+string_alloc_buf (const char *str, struct gc_arena *gc)
+#endif
+{
+ struct buffer buf;
+
+ ASSERT (str);
+
+#ifdef DMALLOC
+ buf_set_read (&buf, (uint8_t*) string_alloc_debug (str, gc, file, line), strlen (str) + 1);
+#else
+ buf_set_read (&buf, (uint8_t*) string_alloc (str, gc), strlen (str) + 1);
+#endif
+
+ if (buf.len > 0) /* Don't count trailing '\0' as part of length */
+ --buf.len;
+
+ return buf;
+}
+
+/*
+ * String comparison
+ */
+
+bool
+buf_string_match_head_str (const struct buffer *src, const char *match)
+{
+ const int size = strlen (match);
+ if (size < 0 || size > src->len)
+ return false;
+ return memcmp (BPTR (src), match, size) == 0;
+}
+
+bool
+buf_string_compare_advance (struct buffer *src, const char *match)
+{
+ if (buf_string_match_head_str (src, match))
+ {
+ buf_advance (src, strlen (match));
+ return true;
+ }
+ else
+ return false;
+}
+
+int
+buf_substring_len (const struct buffer *buf, int delim)
+{
+ int i = 0;
+ struct buffer tmp = *buf;
+ int c;
+
+ while ((c = buf_read_u8 (&tmp)) >= 0)
+ {
+ ++i;
+ if (c == delim)
+ return i;
+ }
+ return -1;
+}
+
+/*
+ * String parsing
+ */
+
+bool
+buf_parse (struct buffer *buf, const int delim, char *line, const int size)
+{
+ bool eol = false;
+ int n = 0;
+ int c;
+
+ ASSERT (size > 0);
+
+ do
+ {
+ c = buf_read_u8 (buf);
+ if (c < 0)
+ eol = true;
+ if (c <= 0 || c == delim)
+ c = 0;
+ if (n >= size)
+ break;
+ line[n++] = c;
+ }
+ while (c);
+
+ line[size-1] = '\0';
+ return !(eol && !strlen (line));
+}
+
+/*
+ * Print a string which might be NULL
+ */
+const char *
+np (const char *str)
+{
+ if (str)
+ return str;
+ else
+ return "[NULL]";
+}
+
+/*
+ * Classify and mutate strings based on character types.
+ */
+
+bool
+char_class (const unsigned char c, const unsigned int flags)
+{
+ if (!flags)
+ return false;
+ if (flags & CC_ANY)
+ return true;
+
+ if ((flags & CC_NULL) && c == '\0')
+ return true;
+
+ if ((flags & CC_ALNUM) && isalnum (c))
+ return true;
+ if ((flags & CC_ALPHA) && isalpha (c))
+ return true;
+ if ((flags & CC_ASCII) && isascii (c))
+ return true;
+ if ((flags & CC_CNTRL) && iscntrl (c))
+ return true;
+ if ((flags & CC_DIGIT) && isdigit (c))
+ return true;
+ if ((flags & CC_PRINT) && (c >= 32 && c != 127)) /* allow ascii non-control and UTF-8, consider DEL to be a control */
+ return true;
+ if ((flags & CC_PUNCT) && ispunct (c))
+ return true;
+ if ((flags & CC_SPACE) && isspace (c))
+ return true;
+ if ((flags & CC_XDIGIT) && isxdigit (c))
+ return true;
+
+ if ((flags & CC_BLANK) && (c == ' ' || c == '\t'))
+ return true;
+ if ((flags & CC_NEWLINE) && c == '\n')
+ return true;
+ if ((flags & CC_CR) && c == '\r')
+ return true;
+
+ if ((flags & CC_BACKSLASH) && c == '\\')
+ return true;
+ if ((flags & CC_UNDERBAR) && c == '_')
+ return true;
+ if ((flags & CC_DASH) && c == '-')
+ return true;
+ if ((flags & CC_DOT) && c == '.')
+ return true;
+ if ((flags & CC_COMMA) && c == ',')
+ return true;
+ if ((flags & CC_COLON) && c == ':')
+ return true;
+ if ((flags & CC_SLASH) && c == '/')
+ return true;
+ if ((flags & CC_SINGLE_QUOTE) && c == '\'')
+ return true;
+ if ((flags & CC_DOUBLE_QUOTE) && c == '\"')
+ return true;
+ if ((flags & CC_REVERSE_QUOTE) && c == '`')
+ return true;
+ if ((flags & CC_AT) && c == '@')
+ return true;
+ if ((flags & CC_EQUAL) && c == '=')
+ return true;
+ if ((flags & CC_LESS_THAN) && c == '<')
+ return true;
+ if ((flags & CC_GREATER_THAN) && c == '>')
+ return true;
+ if ((flags & CC_PIPE) && c == '|')
+ return true;
+ if ((flags & CC_QUESTION_MARK) && c == '?')
+ return true;
+ if ((flags & CC_ASTERISK) && c == '*')
+ return true;
+
+ return false;
+}
+
+static inline bool
+char_inc_exc (const char c, const unsigned int inclusive, const unsigned int exclusive)
+{
+ return char_class (c, inclusive) && !char_class (c, exclusive);
+}
+
+bool
+string_class (const char *str, const unsigned int inclusive, const unsigned int exclusive)
+{
+ char c;
+ ASSERT (str);
+ while ((c = *str++))
+ {
+ if (!char_inc_exc (c, inclusive, exclusive))
+ return false;
+ }
+ return true;
+}
+
+/*
+ * Modify string in place.
+ * Guaranteed to not increase string length.
+ */
+bool
+string_mod (char *str, const unsigned int inclusive, const unsigned int exclusive, const char replace)
+{
+ const char *in = str;
+ bool ret = true;
+
+ ASSERT (str);
+
+ while (true)
+ {
+ char c = *in++;
+ if (c)
+ {
+ if (!char_inc_exc (c, inclusive, exclusive))
+ {
+ c = replace;
+ ret = false;
+ }
+ if (c)
+ *str++ = c;
+ }
+ else
+ {
+ *str = '\0';
+ break;
+ }
+ }
+ return ret;
+}
+
+const char *
+string_mod_const (const char *str,
+ const unsigned int inclusive,
+ const unsigned int exclusive,
+ const char replace,
+ struct gc_arena *gc)
+{
+ if (str)
+ {
+ char *buf = string_alloc (str, gc);
+ string_mod (buf, inclusive, exclusive, replace);
+ return buf;
+ }
+ else
+ return NULL;
+}
+
+void
+string_replace_leading (char *str, const char match, const char replace)
+{
+ ASSERT (match != '\0');
+ while (*str)
+ {
+ if (*str == match)
+ *str = replace;
+ else
+ break;
+ ++str;
+ }
+}
+
+#ifdef CHARACTER_CLASS_DEBUG
+
+#define CC_INCLUDE (CC_PRINT)
+#define CC_EXCLUDE (0)
+#define CC_REPLACE ('.')
+
+void
+character_class_debug (void)
+{
+ char buf[256];
+
+ while (fgets (buf, sizeof (buf), stdin) != NULL)
+ {
+ string_mod (buf, CC_INCLUDE, CC_EXCLUDE, CC_REPLACE);
+ printf ("%s", buf);
+ }
+}
+
+#endif
+
+#ifdef VERIFY_ALIGNMENT
+void
+valign4 (const struct buffer *buf, const char *file, const int line)
+{
+ if (buf && buf->len)
+ {
+ int msglevel = D_ALIGN_DEBUG;
+ const unsigned int u = (unsigned int) BPTR (buf);
+
+ if (u & (PAYLOAD_ALIGN-1))
+ msglevel = D_ALIGN_ERRORS;
+
+ msg (msglevel, "%sAlignment at %s/%d ptr=" ptr_format " OLC=%d/%d/%d I=%s/%d",
+ (msglevel == D_ALIGN_ERRORS) ? "ERROR: " : "",
+ file,
+ line,
+ (ptr_type)buf->data,
+ buf->offset,
+ buf->len,
+ buf->capacity,
+ buf_debug_file (buf),
+ buf_debug_line (buf));
+ }
+}
+#endif
+
+/*
+ * struct buffer_list
+ */
+struct buffer_list *
+buffer_list_new (const int max_size)
+{
+ struct buffer_list *ret;
+ ALLOC_OBJ_CLEAR (ret, struct buffer_list);
+ ret->max_size = max_size;
+ ret->size = 0;
+ return ret;
+}
+
+void
+buffer_list_free (struct buffer_list *ol)
+{
+ if (ol)
+ {
+ buffer_list_reset (ol);
+ free (ol);
+ }
+}
+
+bool
+buffer_list_defined (const struct buffer_list *ol)
+{
+ return ol && ol->head != NULL;
+}
+
+void
+buffer_list_reset (struct buffer_list *ol)
+{
+ struct buffer_entry *e = ol->head;
+ while (e)
+ {
+ struct buffer_entry *next = e->next;
+ free_buf (&e->buf);
+ free (e);
+ e = next;
+ }
+ ol->head = ol->tail = NULL;
+ ol->size = 0;
+}
+
+void
+buffer_list_push (struct buffer_list *ol, const unsigned char *str)
+{
+ if (str)
+ {
+ const size_t len = strlen ((const char *)str);
+ struct buffer_entry *e = buffer_list_push_data (ol, str, len+1);
+ if (e)
+ e->buf.len = len; /* Don't count trailing '\0' as part of length */
+ }
+}
+
+struct buffer_entry *
+buffer_list_push_data (struct buffer_list *ol, const uint8_t *data, size_t size)
+{
+ struct buffer_entry *e = NULL;
+ if (data && (!ol->max_size || ol->size < ol->max_size))
+ {
+ ALLOC_OBJ_CLEAR (e, struct buffer_entry);
+
+ ++ol->size;
+ if (ol->tail)
+ {
+ ASSERT (ol->head);
+ ol->tail->next = e;
+ }
+ else
+ {
+ ASSERT (!ol->head);
+ ol->head = e;
+ }
+ e->buf = alloc_buf (size);
+ memcpy (e->buf.data, data, size);
+ e->buf.len = (int)size;
+ ol->tail = e;
+ }
+ return e;
+}
+
+struct buffer *
+buffer_list_peek (struct buffer_list *ol)
+{
+ if (ol && ol->head)
+ return &ol->head->buf;
+ else
+ return NULL;
+}
+
+void
+buffer_list_aggregate (struct buffer_list *bl, const size_t max)
+{
+ if (bl->head)
+ {
+ struct buffer_entry *more = bl->head;
+ size_t size = 0;
+ int count = 0;
+ for (count = 0; more && size <= max; ++count)
+ {
+ size += BLEN(&more->buf);
+ more = more->next;
+ }
+
+ if (count >= 2)
+ {
+ int i;
+ struct buffer_entry *e = bl->head, *f;
+
+ ALLOC_OBJ_CLEAR (f, struct buffer_entry);
+ f->buf.data = malloc (size);
+ check_malloc_return (f->buf.data);
+ f->buf.capacity = size;
+ for (i = 0; e && i < count; ++i)
+ {
+ struct buffer_entry *next = e->next;
+ buf_copy (&f->buf, &e->buf);
+ free_buf (&e->buf);
+ free (e);
+ e = next;
+ }
+ bl->head = f;
+ f->next = more;
+ if (!more)
+ bl->tail = f;
+ }
+ }
+}
+
+void
+buffer_list_pop (struct buffer_list *ol)
+{
+ if (ol && ol->head)
+ {
+ struct buffer_entry *e = ol->head->next;
+ free_buf (&ol->head->buf);
+ free (ol->head);
+ ol->head = e;
+ --ol->size;
+ if (!e)
+ ol->tail = NULL;
+ }
+}
+
+void
+buffer_list_advance (struct buffer_list *ol, int n)
+{
+ if (ol->head)
+ {
+ struct buffer *buf = &ol->head->buf;
+ ASSERT (buf_advance (buf, n));
+ if (!BLEN (buf))
+ buffer_list_pop (ol);
+ }
+}
+
+struct buffer_list *
+buffer_list_file (const char *fn, int max_line_len)
+{
+ FILE *fp = platform_fopen (fn, "r");
+ struct buffer_list *bl = NULL;
+
+ if (fp)
+ {
+ char *line = (char *) malloc (max_line_len);
+ if (line)
+ {
+ bl = buffer_list_new (0);
+ while (fgets (line, max_line_len, fp) != NULL)
+ buffer_list_push (bl, (unsigned char *)line);
+ free (line);
+ }
+ fclose (fp);
+ }
+ return bl;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.h
new file mode 100644
index 00000000..7469da63
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/buffer.h
@@ -0,0 +1,936 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef BUFFER_H
+#define BUFFER_H
+
+#include "basic.h"
+#include "error.h"
+
+#define BUF_SIZE_MAX 1000000
+
+/*
+ * Define verify_align function, otherwise
+ * it will be a noop.
+ */
+/* #define VERIFY_ALIGNMENT */
+
+/*
+ * Keep track of source file/line of buf_init calls
+ */
+#ifdef VERIFY_ALIGNMENT
+#define BUF_INIT_TRACKING
+#endif
+
+/**************************************************************************/
+/**
+ * Wrapper structure for dynamically allocated memory.
+ *
+ * The actual content stored in a \c buffer structure starts at the memory
+ * location \c buffer.data \c + \c buffer.offset, and has a length of \c
+ * buffer.len bytes. This, together with the space available before and
+ * after the content, is represented in the pseudocode below:
+@code
+uint8_t *content_start = buffer.data + buffer.offset;
+uint8_t *content_end = buffer.data + buffer.offset + buffer.len;
+int prepend_capacity = buffer.offset;
+int append_capacity = buffer.capacity - (buffer.offset + buffer.len);
+@endcode
+ */
+struct buffer
+{
+ int capacity; /**< Size in bytes of memory allocated by
+ * \c malloc(). */
+ int offset; /**< Offset in bytes of the actual content
+ * within the allocated memory. */
+ int len; /**< Length in bytes of the actual content
+ * within the allocated memory. */
+ uint8_t *data; /**< Pointer to the allocated memory. */
+
+#ifdef BUF_INIT_TRACKING
+ const char *debug_file;
+ int debug_line;
+#endif
+};
+
+
+/**************************************************************************/
+/**
+ * Garbage collection entry for one dynamically allocated block of memory.
+ *
+ * This structure represents one link in the linked list contained in a \c
+ * gc_arena structure. Each time the \c gc_malloc() function is called,
+ * it allocates \c sizeof(gc_entry) + the requested number of bytes. The
+ * \c gc_entry is then stored as a header in front of the memory address
+ * returned to the caller.
+ */
+struct gc_entry
+{
+ struct gc_entry *next; /**< Pointer to the next item in the
+ * linked list. */
+};
+
+/**
+ * Gargabe collection entry for a specially allocated structure that needs
+ * a custom free function to be freed like struct addrinfo
+ *
+ */
+struct gc_entry_special
+{
+ struct gc_entry_special *next;
+ void (*free_fnc)(void*);
+ void *addr;
+};
+
+
+/**
+ * Garbage collection arena used to keep track of dynamically allocated
+ * memory.
+ *
+ * This structure contains a linked list of \c gc_entry structures. When
+ * a block of memory is allocated using the \c gc_malloc() function, the
+ * allocation is registered in the function's \c gc_arena argument. All
+ * the dynamically allocated memory registered in a \c gc_arena can be
+ * freed using the \c gc_free() function.
+ */
+struct gc_arena
+{
+ struct gc_entry *list; /**< First element of the linked list of
+ * \c gc_entry structures. */
+ struct gc_entry_special *list_special;
+};
+
+
+#define BPTR(buf) (buf_bptr(buf))
+#define BEND(buf) (buf_bend(buf))
+#define BLAST(buf) (buf_blast(buf))
+#define BLEN(buf) (buf_len(buf))
+#define BDEF(buf) (buf_defined(buf))
+#define BSTR(buf) (buf_str(buf))
+#define BCAP(buf) (buf_forward_capacity (buf))
+
+void buf_clear (struct buffer *buf);
+
+struct buffer clear_buf (void);
+void free_buf (struct buffer *buf);
+
+bool buf_assign (struct buffer *dest, const struct buffer *src);
+
+void string_clear (char *str);
+int string_array_len (const char **array);
+
+size_t array_mult_safe (const size_t m1, const size_t m2, const size_t extra);
+
+#define PA_BRACKET (1<<0)
+char *print_argv (const char **p, struct gc_arena *gc, const unsigned int flags);
+
+void buf_size_error (const size_t size);
+
+/* for dmalloc debugging */
+
+#ifdef DMALLOC
+
+#define alloc_buf(size) alloc_buf_debug (size, __FILE__, __LINE__)
+#define alloc_buf_gc(size, gc) alloc_buf_gc_debug (size, gc, __FILE__, __LINE__);
+#define clone_buf(buf) clone_buf_debug (buf, __FILE__, __LINE__);
+#define gc_malloc(size, clear, arena) gc_malloc_debug (size, clear, arena, __FILE__, __LINE__)
+#define string_alloc(str, gc) string_alloc_debug (str, gc, __FILE__, __LINE__)
+#define string_alloc_buf(str, gc) string_alloc_buf_debug (str, gc, __FILE__, __LINE__)
+
+struct buffer alloc_buf_debug (size_t size, const char *file, int line);
+struct buffer alloc_buf_gc_debug (size_t size, struct gc_arena *gc, const char *file, int line);
+struct buffer clone_buf_debug (const struct buffer* buf, const char *file, int line);
+void *gc_malloc_debug (size_t size, bool clear, struct gc_arena *a, const char *file, int line);
+char *string_alloc_debug (const char *str, struct gc_arena *gc, const char *file, int line);
+struct buffer string_alloc_buf_debug (const char *str, struct gc_arena *gc, const char *file, int line);
+
+#else
+
+struct buffer alloc_buf (size_t size);
+struct buffer alloc_buf_gc (size_t size, struct gc_arena *gc); /* allocate buffer with garbage collection */
+struct buffer clone_buf (const struct buffer* buf);
+void *gc_malloc (size_t size, bool clear, struct gc_arena *a);
+char *string_alloc (const char *str, struct gc_arena *gc);
+struct buffer string_alloc_buf (const char *str, struct gc_arena *gc);
+
+#endif
+
+void gc_addspecial (void *addr, void (*free_function)(void*), struct gc_arena *a);
+
+
+#ifdef BUF_INIT_TRACKING
+#define buf_init(buf, offset) buf_init_debug (buf, offset, __FILE__, __LINE__)
+bool buf_init_debug (struct buffer *buf, int offset, const char *file, int line);
+#else
+#define buf_init(buf, offset) buf_init_dowork (buf, offset)
+#endif
+
+
+/* inline functions */
+inline static void
+gc_freeaddrinfo_callback (void *addr)
+{
+ freeaddrinfo((struct addrinfo*) addr);
+}
+
+static inline bool
+buf_defined (const struct buffer *buf)
+{
+ return buf->data != NULL;
+}
+
+static inline bool
+buf_valid (const struct buffer *buf)
+{
+ return likely (buf->data != NULL) && likely (buf->len >= 0);
+}
+
+static inline uint8_t *
+buf_bptr (const struct buffer *buf)
+{
+ if (buf_valid (buf))
+ return buf->data + buf->offset;
+ else
+ return NULL;
+}
+
+static int
+buf_len (const struct buffer *buf)
+{
+ if (buf_valid (buf))
+ return buf->len;
+ else
+ return 0;
+}
+
+static inline uint8_t *
+buf_bend (const struct buffer *buf)
+{
+ return buf_bptr (buf) + buf_len (buf);
+}
+
+static inline uint8_t *
+buf_blast (const struct buffer *buf)
+{
+ if (buf_len (buf) > 0)
+ return buf_bptr (buf) + buf_len (buf) - 1;
+ else
+ return NULL;
+}
+
+static inline bool
+buf_size_valid (const size_t size)
+{
+ return likely (size < BUF_SIZE_MAX);
+}
+
+static inline bool
+buf_size_valid_signed (const int size)
+{
+ return likely (size >= -BUF_SIZE_MAX) && likely (size < BUF_SIZE_MAX);
+}
+
+static inline char *
+buf_str (const struct buffer *buf)
+{
+ return (char *)buf_bptr(buf);
+}
+
+static inline void
+buf_reset (struct buffer *buf)
+{
+ buf->capacity = 0;
+ buf->offset = 0;
+ buf->len = 0;
+ buf->data = NULL;
+}
+
+static inline void
+buf_reset_len (struct buffer *buf)
+{
+ buf->len = 0;
+ buf->offset = 0;
+}
+
+static inline bool
+buf_init_dowork (struct buffer *buf, int offset)
+{
+ if (offset < 0 || offset > buf->capacity || buf->data == NULL)
+ return false;
+ buf->len = 0;
+ buf->offset = offset;
+ return true;
+}
+
+static inline void
+buf_set_write (struct buffer *buf, uint8_t *data, int size)
+{
+ if (!buf_size_valid (size))
+ buf_size_error (size);
+ buf->len = 0;
+ buf->offset = 0;
+ buf->capacity = size;
+ buf->data = data;
+ if (size > 0 && data)
+ *data = 0;
+}
+
+static inline void
+buf_set_read (struct buffer *buf, const uint8_t *data, int size)
+{
+ if (!buf_size_valid (size))
+ buf_size_error (size);
+ buf->len = buf->capacity = size;
+ buf->offset = 0;
+ buf->data = (uint8_t *)data;
+}
+
+/* Like strncpy but makes sure dest is always null terminated */
+static inline void
+strncpynt (char *dest, const char *src, size_t maxlen)
+{
+ strncpy (dest, src, maxlen);
+ if (maxlen > 0)
+ dest[maxlen - 1] = 0;
+}
+
+/* return true if string contains at least one numerical digit */
+static inline bool
+has_digit (const unsigned char* src)
+{
+ unsigned char c;
+ while ((c = *src++))
+ {
+ if (isdigit(c))
+ return true;
+ }
+ return false;
+}
+
+/*
+ * printf append to a buffer with overflow check
+ */
+bool buf_printf (struct buffer *buf, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+ __attribute__ ((format (__printf__, 2, 3)))
+#endif
+#endif
+ ;
+
+/*
+ * puts append to a buffer with overflow check
+ */
+bool buf_puts (struct buffer *buf, const char *str);
+
+/*
+ * Like snprintf but guarantees null termination for size > 0
+ */
+bool openvpn_snprintf(char *str, size_t size, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 3, 4)))
+#else
+ __attribute__ ((format (__printf__, 3, 4)))
+#endif
+#endif
+ ;
+
+/*
+ * remove/add trailing characters
+ */
+
+void buf_null_terminate (struct buffer *buf);
+void buf_chomp (struct buffer *buf);
+void buf_rmtail (struct buffer *buf, uint8_t remove);
+
+/*
+ * non-buffer string functions
+ */
+void chomp (char *str);
+void rm_trailing_chars (char *str, const char *what_to_delete);
+const char *skip_leading_whitespace (const char *str);
+void string_null_terminate (char *str, int len, int capacity);
+
+/*
+ * Write string in buf to file descriptor fd.
+ * NOTE: requires that string be null terminated.
+ */
+void buf_write_string_file (const struct buffer *buf, const char *filename, int fd);
+
+/*
+ * write a string to the end of a buffer that was
+ * truncated by buf_printf
+ */
+void buf_catrunc (struct buffer *buf, const char *str);
+
+/*
+ * convert a multi-line output to one line
+ */
+void convert_to_one_line (struct buffer *buf);
+
+/*
+ * Parse a string based on a given delimiter char
+ */
+bool buf_parse (struct buffer *buf, const int delim, char *line, const int size);
+
+/*
+ * Hex dump -- Output a binary buffer to a hex string and return it.
+ */
+char *
+format_hex_ex (const uint8_t *data, int size, int maxoutput,
+ int space_break, const char* separator,
+ struct gc_arena *gc);
+
+static inline char *
+format_hex (const uint8_t *data, int size, int maxoutput, struct gc_arena *gc)
+{
+ return format_hex_ex (data, size, maxoutput, 4, " ", gc);
+}
+
+/*
+ * Return a buffer that is a subset of another buffer.
+ */
+struct buffer buf_sub (struct buffer *buf, int size, bool prepend);
+
+/*
+ * Check if sufficient space to append to buffer.
+ */
+
+static inline bool
+buf_safe (const struct buffer *buf, int len)
+{
+ return buf_valid (buf) && buf_size_valid (len)
+ && buf->offset + buf->len + len <= buf->capacity;
+}
+
+static inline bool
+buf_safe_bidir (const struct buffer *buf, int len)
+{
+ if (buf_valid (buf) && buf_size_valid_signed (len))
+ {
+ const int newlen = buf->len + len;
+ return newlen >= 0 && buf->offset + newlen <= buf->capacity;
+ }
+ else
+ return false;
+}
+
+static inline int
+buf_forward_capacity (const struct buffer *buf)
+{
+ if (buf_valid (buf))
+ {
+ int ret = buf->capacity - (buf->offset + buf->len);
+ if (ret < 0)
+ ret = 0;
+ return ret;
+ }
+ else
+ return 0;
+}
+
+static inline int
+buf_forward_capacity_total (const struct buffer *buf)
+{
+ if (buf_valid (buf))
+ {
+ int ret = buf->capacity - buf->offset;
+ if (ret < 0)
+ ret = 0;
+ return ret;
+ }
+ else
+ return 0;
+}
+
+static inline int
+buf_reverse_capacity (const struct buffer *buf)
+{
+ if (buf_valid (buf))
+ return buf->offset;
+ else
+ return 0;
+}
+
+static inline bool
+buf_inc_len (struct buffer *buf, int inc)
+{
+ if (!buf_safe_bidir (buf, inc))
+ return false;
+ buf->len += inc;
+ return true;
+}
+
+/*
+ * Make space to prepend to a buffer.
+ * Return NULL if no space.
+ */
+
+static inline uint8_t *
+buf_prepend (struct buffer *buf, int size)
+{
+ if (!buf_valid (buf) || size < 0 || size > buf->offset)
+ return NULL;
+ buf->offset -= size;
+ buf->len += size;
+ return BPTR (buf);
+}
+
+static inline bool
+buf_advance (struct buffer *buf, int size)
+{
+ if (!buf_valid (buf) || size < 0 || buf->len < size)
+ return false;
+ buf->offset += size;
+ buf->len -= size;
+ return true;
+}
+
+/*
+ * Return a pointer to allocated space inside a buffer.
+ * Return NULL if no space.
+ */
+
+static inline uint8_t *
+buf_write_alloc (struct buffer *buf, int size)
+{
+ uint8_t *ret;
+ if (!buf_safe (buf, size))
+ return NULL;
+ ret = BPTR (buf) + buf->len;
+ buf->len += size;
+ return ret;
+}
+
+static inline uint8_t *
+buf_write_alloc_prepend (struct buffer *buf, int size, bool prepend)
+{
+ return prepend ? buf_prepend (buf, size) : buf_write_alloc (buf, size);
+}
+
+static inline uint8_t *
+buf_read_alloc (struct buffer *buf, int size)
+{
+ uint8_t *ret;
+ if (size < 0 || buf->len < size)
+ return NULL;
+ ret = BPTR (buf);
+ buf->offset += size;
+ buf->len -= size;
+ return ret;
+}
+
+static inline bool
+buf_write (struct buffer *dest, const void *src, int size)
+{
+ uint8_t *cp = buf_write_alloc (dest, size);
+ if (!cp)
+ return false;
+ memcpy (cp, src, size);
+ return true;
+}
+
+static inline bool
+buf_write_prepend (struct buffer *dest, const void *src, int size)
+{
+ uint8_t *cp = buf_prepend (dest, size);
+ if (!cp)
+ return false;
+ memcpy (cp, src, size);
+ return true;
+}
+
+static inline bool
+buf_write_u8 (struct buffer *dest, int data)
+{
+ uint8_t u8 = (uint8_t) data;
+ return buf_write (dest, &u8, sizeof (uint8_t));
+}
+
+static inline bool
+buf_write_u16 (struct buffer *dest, int data)
+{
+ uint16_t u16 = htons ((uint16_t) data);
+ return buf_write (dest, &u16, sizeof (uint16_t));
+}
+
+static inline bool
+buf_write_u32 (struct buffer *dest, int data)
+{
+ uint32_t u32 = htonl ((uint32_t) data);
+ return buf_write (dest, &u32, sizeof (uint32_t));
+}
+
+static inline bool
+buf_copy (struct buffer *dest, const struct buffer *src)
+{
+ return buf_write (dest, BPTR (src), BLEN (src));
+}
+
+static inline bool
+buf_copy_n (struct buffer *dest, struct buffer *src, int n)
+{
+ uint8_t *cp = buf_read_alloc (src, n);
+ if (!cp)
+ return false;
+ return buf_write (dest, cp, n);
+}
+
+static inline bool
+buf_copy_range (struct buffer *dest,
+ int dest_index,
+ const struct buffer *src,
+ int src_index,
+ int src_len)
+{
+ if (src_index < 0
+ || src_len < 0
+ || src_index + src_len > src->len
+ || dest_index < 0
+ || dest->offset + dest_index + src_len > dest->capacity)
+ return false;
+ memcpy (dest->data + dest->offset + dest_index, src->data + src->offset + src_index, src_len);
+ if (dest_index + src_len > dest->len)
+ dest->len = dest_index + src_len;
+ return true;
+}
+
+/* truncate src to len, copy excess data beyond len to dest */
+static inline bool
+buf_copy_excess (struct buffer *dest,
+ struct buffer *src,
+ int len)
+{
+ if (len < 0)
+ return false;
+ if (src->len > len)
+ {
+ struct buffer b = *src;
+ src->len = len;
+ if (!buf_advance (&b, len))
+ return false;
+ return buf_copy (dest, &b);
+ }
+ else
+ {
+ return true;
+ }
+}
+
+static inline bool
+buf_read (struct buffer *src, void *dest, int size)
+{
+ uint8_t *cp = buf_read_alloc (src, size);
+ if (!cp)
+ return false;
+ memcpy (dest, cp, size);
+ return true;
+}
+
+static inline int
+buf_read_u8 (struct buffer *buf)
+{
+ int ret;
+ if (BLEN (buf) < 1)
+ return -1;
+ ret = *BPTR(buf);
+ buf_advance (buf, 1);
+ return ret;
+}
+
+static inline int
+buf_read_u16 (struct buffer *buf)
+{
+ uint16_t ret;
+ if (!buf_read (buf, &ret, sizeof (uint16_t)))
+ return -1;
+ return ntohs (ret);
+}
+
+static inline uint32_t
+buf_read_u32 (struct buffer *buf, bool *good)
+{
+ uint32_t ret;
+ if (!buf_read (buf, &ret, sizeof (uint32_t)))
+ {
+ if (good)
+ *good = false;
+ return 0;
+ }
+ else
+ {
+ if (good)
+ *good = true;
+ return ntohl (ret);
+ }
+}
+
+/**
+ * Compare src buffer contents with match.
+ * *NOT* constant time. Do not use when comparing HMACs.
+ */
+static inline bool
+buf_string_match (const struct buffer *src, const void *match, int size)
+{
+ if (size != src->len)
+ return false;
+ return memcmp (BPTR (src), match, size) == 0;
+}
+
+/**
+ * Compare first size bytes of src buffer contents with match.
+ * *NOT* constant time. Do not use when comparing HMACs.
+ */
+static inline bool
+buf_string_match_head (const struct buffer *src, const void *match, int size)
+{
+ if (size < 0 || size > src->len)
+ return false;
+ return memcmp (BPTR (src), match, size) == 0;
+}
+
+bool buf_string_match_head_str (const struct buffer *src, const char *match);
+bool buf_string_compare_advance (struct buffer *src, const char *match);
+int buf_substring_len (const struct buffer *buf, int delim);
+
+/*
+ * Print a string which might be NULL
+ */
+const char *np (const char *str);
+
+/*#define CHARACTER_CLASS_DEBUG*/
+
+/* character classes */
+
+#define CC_ANY (1<<0)
+#define CC_NULL (1<<1)
+
+#define CC_ALNUM (1<<2)
+#define CC_ALPHA (1<<3)
+#define CC_ASCII (1<<4)
+#define CC_CNTRL (1<<5)
+#define CC_DIGIT (1<<6)
+#define CC_PRINT (1<<7)
+#define CC_PUNCT (1<<8)
+#define CC_SPACE (1<<9)
+#define CC_XDIGIT (1<<10)
+
+#define CC_BLANK (1<<11)
+#define CC_NEWLINE (1<<12)
+#define CC_CR (1<<13)
+
+#define CC_BACKSLASH (1<<14)
+#define CC_UNDERBAR (1<<15)
+#define CC_DASH (1<<16)
+#define CC_DOT (1<<17)
+#define CC_COMMA (1<<18)
+#define CC_COLON (1<<19)
+#define CC_SLASH (1<<20)
+#define CC_SINGLE_QUOTE (1<<21)
+#define CC_DOUBLE_QUOTE (1<<22)
+#define CC_REVERSE_QUOTE (1<<23)
+#define CC_AT (1<<24)
+#define CC_EQUAL (1<<25)
+#define CC_LESS_THAN (1<<26)
+#define CC_GREATER_THAN (1<<27)
+#define CC_PIPE (1<<28)
+#define CC_QUESTION_MARK (1<<29)
+#define CC_ASTERISK (1<<30)
+
+/* macro classes */
+#define CC_NAME (CC_ALNUM|CC_UNDERBAR)
+#define CC_CRLF (CC_CR|CC_NEWLINE)
+
+bool char_class (const unsigned char c, const unsigned int flags);
+bool string_class (const char *str, const unsigned int inclusive, const unsigned int exclusive);
+bool string_mod (char *str, const unsigned int inclusive, const unsigned int exclusive, const char replace);
+
+const char *string_mod_const (const char *str,
+ const unsigned int inclusive,
+ const unsigned int exclusive,
+ const char replace,
+ struct gc_arena *gc);
+
+void string_replace_leading (char *str, const char match, const char replace);
+
+#ifdef CHARACTER_CLASS_DEBUG
+void character_class_debug (void);
+#endif
+
+/*
+ * Verify that a pointer is correctly aligned
+ */
+#ifdef VERIFY_ALIGNMENT
+ void valign4 (const struct buffer *buf, const char *file, const int line);
+# define verify_align_4(ptr) valign4(buf, __FILE__, __LINE__)
+#else
+# define verify_align_4(ptr)
+#endif
+
+/*
+ * Very basic garbage collection, mostly for routines that return
+ * char ptrs to malloced strings.
+ */
+
+void gc_transfer (struct gc_arena *dest, struct gc_arena *src);
+
+void x_gc_free (struct gc_arena *a);
+void x_gc_freespecial (struct gc_arena *a);
+
+static inline bool
+gc_defined (struct gc_arena *a)
+{
+ return a->list != NULL;
+}
+
+static inline void
+gc_init (struct gc_arena *a)
+{
+ a->list = NULL;
+ a->list_special = NULL;
+}
+
+static inline void
+gc_detach (struct gc_arena *a)
+{
+ gc_init (a);
+}
+
+static inline struct gc_arena
+gc_new (void)
+{
+ struct gc_arena ret;
+ gc_init (&ret);
+ return ret;
+}
+
+static inline void
+gc_free (struct gc_arena *a)
+{
+ if (a->list)
+ x_gc_free (a);
+ if (a->list_special)
+ x_gc_freespecial(a);
+}
+
+static inline void
+gc_reset (struct gc_arena *a)
+{
+ gc_free (a);
+}
+
+/*
+ * Allocate memory to hold a structure
+ */
+
+#define ALLOC_OBJ(dptr, type) \
+{ \
+ check_malloc_return ((dptr) = (type *) malloc (sizeof (type))); \
+}
+
+#define ALLOC_OBJ_CLEAR(dptr, type) \
+{ \
+ ALLOC_OBJ (dptr, type); \
+ memset ((dptr), 0, sizeof(type)); \
+}
+
+#define ALLOC_ARRAY(dptr, type, n) \
+{ \
+ check_malloc_return ((dptr) = (type *) malloc (array_mult_safe (sizeof (type), (n), 0))); \
+}
+
+#define ALLOC_ARRAY_GC(dptr, type, n, gc) \
+{ \
+ (dptr) = (type *) gc_malloc (array_mult_safe (sizeof (type), (n), 0), false, (gc)); \
+}
+
+#define ALLOC_ARRAY_CLEAR(dptr, type, n) \
+{ \
+ ALLOC_ARRAY (dptr, type, n); \
+ memset ((dptr), 0, (array_mult_safe (sizeof(type), (n), 0))); \
+}
+
+#define ALLOC_ARRAY_CLEAR_GC(dptr, type, n, gc) \
+{ \
+ (dptr) = (type *) gc_malloc (array_mult_safe (sizeof (type), (n), 0), true, (gc)); \
+}
+
+#define ALLOC_VAR_ARRAY_CLEAR_GC(dptr, type, atype, n, gc) \
+{ \
+ (dptr) = (type *) gc_malloc (array_mult_safe (sizeof (atype), (n), sizeof (type)), true, (gc)); \
+}
+
+#define ALLOC_OBJ_GC(dptr, type, gc) \
+{ \
+ (dptr) = (type *) gc_malloc (sizeof (type), false, (gc)); \
+}
+
+#define ALLOC_OBJ_CLEAR_GC(dptr, type, gc) \
+{ \
+ (dptr) = (type *) gc_malloc (sizeof (type), true, (gc)); \
+}
+
+static inline void
+check_malloc_return (void *p)
+{
+ if (!p)
+ out_of_memory ();
+}
+
+/*
+ * Manage lists of buffers
+ */
+struct buffer_entry
+{
+ struct buffer buf;
+ struct buffer_entry *next;
+};
+
+struct buffer_list
+{
+ struct buffer_entry *head; /* next item to pop/peek */
+ struct buffer_entry *tail; /* last item pushed */
+ int size; /* current number of entries */
+ int max_size; /* maximum size list should grow to */
+};
+
+struct buffer_list *buffer_list_new (const int max_size);
+void buffer_list_free (struct buffer_list *ol);
+
+bool buffer_list_defined (const struct buffer_list *ol);
+void buffer_list_reset (struct buffer_list *ol);
+
+void buffer_list_push (struct buffer_list *ol, const unsigned char *str);
+struct buffer_entry *buffer_list_push_data (struct buffer_list *ol, const uint8_t *data, size_t size);
+struct buffer *buffer_list_peek (struct buffer_list *ol);
+void buffer_list_advance (struct buffer_list *ol, int n);
+void buffer_list_pop (struct buffer_list *ol);
+
+void buffer_list_aggregate (struct buffer_list *bl, const size_t max);
+
+struct buffer_list *buffer_list_file (const char *fn, int max_line_len);
+#endif /* BUFFER_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/circ_list.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/circ_list.h
new file mode 100644
index 00000000..583701a5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/circ_list.h
@@ -0,0 +1,78 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef CIRC_LIST_H
+#define CIRC_LIST_H
+
+#include "basic.h"
+#include "integer.h"
+#include "error.h"
+
+#define CIRC_LIST(name, type) \
+struct name { \
+ int x_head; \
+ int x_size; \
+ int x_cap; \
+ int x_sizeof; \
+ type x_list[EMPTY_ARRAY_SIZE]; \
+}
+
+#define CIRC_LIST_PUSH(obj, item) \
+{ \
+ (obj)->x_head = modulo_add ((obj)->x_head, -1, (obj)->x_cap); \
+ (obj)->x_list[(obj)->x_head] = (item); \
+ (obj)->x_size = min_int ((obj)->x_size + 1, (obj)->x_cap); \
+}
+
+#define CIRC_LIST_SIZE(obj) \
+ ((obj)->x_size)
+
+#define CIRC_LIST_INDEX(obj, index) \
+ modulo_add ((obj)->x_head, \
+ index_verify ((index), (obj)->x_size, __FILE__, __LINE__), \
+ (obj)->x_cap)
+
+#define CIRC_LIST_ITEM(obj, index) \
+ ((obj)->x_list[CIRC_LIST_INDEX((obj), (index))])
+
+#define CIRC_LIST_RESET(obj) \
+{ \
+ (obj)->x_head = 0; \
+ (obj)->x_size = 0; \
+}
+
+#define CIRC_LIST_ALLOC(dest, list_type, size) \
+{ \
+ const int so = sizeof (list_type) + sizeof ((dest)->x_list[0]) * (size); \
+ (dest) = (list_type *) malloc (so); \
+ check_malloc_return (dest); \
+ memset ((dest), 0, so); \
+ (dest)->x_cap = size; \
+ (dest)->x_sizeof = so; \
+}
+
+#define CIRC_LIST_FREE(dest) \
+ free (dest)
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.c
new file mode 100644
index 00000000..ddefe123
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.c
@@ -0,0 +1,265 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "clinat.h"
+#include "proto.h"
+#include "socket.h"
+#include "memdbg.h"
+
+static bool
+add_entry(struct client_nat_option_list *dest,
+ const struct client_nat_entry *e)
+{
+ if (dest->n >= MAX_CLIENT_NAT)
+ {
+ msg (M_WARN, "WARNING: client-nat table overflow (max %d entries)", MAX_CLIENT_NAT);
+ return false;
+ }
+ else
+ {
+ dest->entries[dest->n++] = *e;
+ return true;
+ }
+}
+
+void
+print_client_nat_list(const struct client_nat_option_list *list, int msglevel)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+
+ msg (msglevel, "*** CNAT list");
+ if (list)
+ {
+ for (i = 0; i < list->n; ++i)
+ {
+ const struct client_nat_entry *e = &list->entries[i];
+ msg (msglevel, " CNAT[%d] t=%d %s/%s/%s",
+ i,
+ e->type,
+ print_in_addr_t (e->network, IA_NET_ORDER, &gc),
+ print_in_addr_t (e->netmask, IA_NET_ORDER, &gc),
+ print_in_addr_t (e->foreign_network, IA_NET_ORDER, &gc));
+ }
+ }
+ gc_free (&gc);
+}
+
+struct client_nat_option_list *
+new_client_nat_list (struct gc_arena *gc)
+{
+ struct client_nat_option_list *ret;
+ ALLOC_OBJ_CLEAR_GC (ret, struct client_nat_option_list, gc);
+ return ret;
+}
+
+struct client_nat_option_list *
+clone_client_nat_option_list (const struct client_nat_option_list *src, struct gc_arena *gc)
+{
+ struct client_nat_option_list *ret;
+ ALLOC_OBJ_GC (ret, struct client_nat_option_list, gc);
+ *ret = *src;
+ return ret;
+}
+
+void
+copy_client_nat_option_list (struct client_nat_option_list *dest,
+ const struct client_nat_option_list *src)
+{
+ int i;
+ for (i = 0; i < src->n; ++i)
+ {
+ if (!add_entry(dest, &src->entries[i]))
+ break;
+ }
+}
+
+void
+add_client_nat_to_option_list (struct client_nat_option_list *dest,
+ const char *type,
+ const char *network,
+ const char *netmask,
+ const char *foreign_network,
+ int msglevel)
+{
+ struct client_nat_entry e;
+ bool ok;
+
+ if (!strcmp(type, "snat"))
+ e.type = CN_SNAT;
+ else if (!strcmp(type, "dnat"))
+ e.type = CN_DNAT;
+ else
+ {
+ msg(msglevel, "client-nat: type must be 'snat' or 'dnat'");
+ return;
+ }
+
+ e.network = getaddr(0, network, 0, &ok, NULL);
+ if (!ok)
+ {
+ msg(msglevel, "client-nat: bad network: %s", network);
+ return;
+ }
+ e.netmask = getaddr(0, netmask, 0, &ok, NULL);
+ if (!ok)
+ {
+ msg(msglevel, "client-nat: bad netmask: %s", netmask);
+ return;
+ }
+ e.foreign_network = getaddr(0, foreign_network, 0, &ok, NULL);
+ if (!ok)
+ {
+ msg(msglevel, "client-nat: bad foreign network: %s", foreign_network);
+ return;
+ }
+
+ add_entry(dest, &e);
+}
+
+#if 0
+static void
+print_checksum (struct openvpn_iphdr *iph, const char *prefix)
+{
+ uint16_t *sptr;
+ unsigned int sum = 0;
+ int i = 0;
+ for (sptr = (uint16_t *)iph; (uint8_t *)sptr < (uint8_t *)iph + sizeof(struct openvpn_iphdr); sptr++)
+ {
+ i += 1;
+ sum += *sptr;
+ }
+ msg (M_INFO, "** CKSUM[%d] %s %08x", i, prefix, sum);
+}
+#endif
+
+static void
+print_pkt (struct openvpn_iphdr *iph, const char *prefix, const int direction, const int msglevel)
+{
+ struct gc_arena gc = gc_new ();
+
+ char *dirstr = "???";
+ if (direction == CN_OUTGOING)
+ dirstr = "OUT";
+ else if (direction == CN_INCOMING)
+ dirstr = "IN";
+
+ msg(msglevel, "** CNAT %s %s %s -> %s",
+ dirstr,
+ prefix,
+ print_in_addr_t (iph->saddr, IA_NET_ORDER, &gc),
+ print_in_addr_t (iph->daddr, IA_NET_ORDER, &gc));
+
+ gc_free (&gc);
+}
+
+void
+client_nat_transform (const struct client_nat_option_list *list,
+ struct buffer *ipbuf,
+ const int direction)
+{
+ struct ip_tcp_udp_hdr *h = (struct ip_tcp_udp_hdr *) BPTR (ipbuf);
+ int i;
+ uint32_t addr, *addr_ptr;
+ const uint32_t *from, *to;
+ int accumulate = 0;
+ unsigned int amask;
+ unsigned int alog = 0;
+
+ if (check_debug_level (D_CLIENT_NAT))
+ print_pkt (&h->ip, "BEFORE", direction, D_CLIENT_NAT);
+
+ for (i = 0; i < list->n; ++i)
+ {
+ const struct client_nat_entry *e = &list->entries[i]; /* current NAT rule */
+ if (e->type ^ direction)
+ {
+ addr = *(addr_ptr = &h->ip.daddr);
+ amask = 2;
+ }
+ else
+ {
+ addr = *(addr_ptr = &h->ip.saddr);
+ amask = 1;
+ }
+ if (direction)
+ {
+ from = &e->foreign_network;
+ to = &e->network;
+ }
+ else
+ {
+ from = &e->network;
+ to = &e->foreign_network;
+ }
+
+ if (((addr & e->netmask) == *from) && !(amask & alog))
+ {
+ /* pre-adjust IP checksum */
+ ADD_CHECKSUM_32(accumulate, addr);
+
+ /* do NAT transform */
+ addr = (addr & ~e->netmask) | *to;
+
+ /* post-adjust IP checksum */
+ SUB_CHECKSUM_32(accumulate, addr);
+
+ /* write the modified address to packet */
+ *addr_ptr = addr;
+
+ /* mark as modified */
+ alog |= amask;
+ }
+ }
+ if (alog)
+ {
+ if (check_debug_level (D_CLIENT_NAT))
+ print_pkt (&h->ip, "AFTER", direction, D_CLIENT_NAT);
+
+ ADJUST_CHECKSUM(accumulate, h->ip.check);
+
+ if (h->ip.protocol == OPENVPN_IPPROTO_TCP)
+ {
+ if (BLEN(ipbuf) >= sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_tcphdr))
+ {
+ ADJUST_CHECKSUM(accumulate, h->u.tcp.check);
+ }
+ }
+ else if (h->ip.protocol == OPENVPN_IPPROTO_UDP)
+ {
+ if (BLEN(ipbuf) >= sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_udphdr))
+ {
+ ADJUST_CHECKSUM(accumulate, h->u.udp.check);
+ }
+ }
+ }
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.h
new file mode 100644
index 00000000..a5779e15
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/clinat.h
@@ -0,0 +1,65 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#if !defined(CLINAT_H)
+#define CLINAT_H
+
+#include "buffer.h"
+
+#define MAX_CLIENT_NAT 64
+
+#define CN_OUTGOING 0
+#define CN_INCOMING 1
+
+struct client_nat_entry {
+# define CN_SNAT 0
+# define CN_DNAT 1
+ int type;
+ in_addr_t network;
+ in_addr_t netmask;
+ in_addr_t foreign_network;
+};
+
+struct client_nat_option_list {
+ int n;
+ struct client_nat_entry entries[MAX_CLIENT_NAT];
+};
+
+struct client_nat_option_list *new_client_nat_list (struct gc_arena *gc);
+struct client_nat_option_list *clone_client_nat_option_list (const struct client_nat_option_list *src, struct gc_arena *gc);
+void copy_client_nat_option_list (struct client_nat_option_list *dest, const struct client_nat_option_list *src);
+void print_client_nat_list(const struct client_nat_option_list *list, int msglevel);
+
+void add_client_nat_to_option_list (struct client_nat_option_list *dest,
+ const char *type,
+ const char *network,
+ const char *netmask,
+ const char *foreign_network,
+ int msglevel);
+
+void client_nat_transform (const struct client_nat_option_list *list,
+ struct buffer *ipbuf,
+ const int direction);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/common.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/common.h
new file mode 100644
index 00000000..2f85bec2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/common.h
@@ -0,0 +1,105 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef COMMON_H
+#define COMMON_H
+
+/*
+ * Statistics counters and associated printf formats.
+ */
+#ifdef USE_64_BIT_COUNTERS
+ typedef unsigned long long int counter_type;
+# ifdef WIN32
+# define counter_format "%I64u"
+# else
+# define counter_format "%llu"
+# endif
+#else
+ typedef unsigned int counter_type;
+# define counter_format "%u"
+#endif
+
+/*
+ * Time intervals
+ */
+typedef int interval_t;
+
+/*
+ * Used as an upper bound for timeouts.
+ */
+#define BIG_TIMEOUT (60*60*24*7) /* one week (in seconds) */
+
+/*
+ * Printf formats for special types
+ */
+#ifdef _WIN64
+#define ptr_format "0x%I64x"
+#else
+#define ptr_format "0x%08lx"
+#endif
+#define time_format "%lu"
+#define fragment_header_format "0x%08x"
+
+/* these are used to cast the arguments
+ * and MUST match the formats above */
+typedef unsigned long time_type;
+#ifdef _WIN64
+typedef unsigned long long ptr_type;
+#else
+typedef unsigned long ptr_type;
+#endif
+
+/* the --client-config-dir default file */
+#define CCD_DEFAULT "DEFAULT"
+
+/*
+ * This parameter controls the TLS channel buffer size and the
+ * maximum size of a single TLS message (cleartext).
+ * This parameter must be >= PUSH_BUNDLE_SIZE
+ */
+#define TLS_CHANNEL_BUF_SIZE 2048
+
+/*
+ * This parameter controls the maximum size of a bundle
+ * of pushed options.
+ */
+#define PUSH_BUNDLE_SIZE 1024
+
+/*
+ * In how many seconds does client re-send PUSH_REQUEST if we haven't yet received a reply
+ */
+#define PUSH_REQUEST_INTERVAL 5
+
+/*
+ * A sort of pseudo-filename for data provided inline within
+ * the configuration file.
+ */
+#define INLINE_FILE_TAG "[[INLINE]]"
+
+/*
+ * Script security warning
+ */
+#define SCRIPT_SECURITY_WARNING "WARNING: External program may not be called unless '--script-security 2' or higher is enabled. See --help text or man page for detailed info."
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.c
new file mode 100644
index 00000000..46511485
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.c
@@ -0,0 +1,194 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2013 Gert Doering <gert@greenie.muc.de>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_LZ4)
+
+#if defined(NEED_COMPAT_LZ4)
+#include "compat-lz4.h"
+#else
+#include "lz4.h"
+#endif
+
+#include "comp.h"
+#include "error.h"
+
+#include "memdbg.h"
+
+/* Initial command byte to tell our peer if we compressed */
+#define LZ4_COMPRESS_BYTE 0x69
+
+static void
+lz4_compress_init (struct compress_context *compctx)
+{
+ msg (D_INIT_MEDIUM, "LZ4 compression initializing");
+ ASSERT(compctx->flags & COMP_F_SWAP);
+}
+
+static void
+lz4_compress_uninit (struct compress_context *compctx)
+{
+}
+
+static void
+lz4_compress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ bool compressed = false;
+
+ if (buf->len <= 0)
+ return;
+
+ /*
+ * In order to attempt compression, length must be at least COMPRESS_THRESHOLD.
+ */
+ if (buf->len >= COMPRESS_THRESHOLD)
+ {
+ const size_t ps = PAYLOAD_SIZE (frame);
+ int zlen_max = ps + COMP_EXTRA_BUFFER (ps);
+ int zlen;
+
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+ ASSERT (buf_safe (&work, zlen_max));
+
+ if (buf->len > ps)
+ {
+ dmsg (D_COMP_ERRORS, "LZ4 compression buffer overflow");
+ buf->len = 0;
+ return;
+ }
+
+ zlen = LZ4_compress_limitedOutput((const char *)BPTR(buf), (char *)BPTR(&work), BLEN(buf), zlen_max );
+
+ if (zlen <= 0)
+ {
+ dmsg (D_COMP_ERRORS, "LZ4 compression error");
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, zlen));
+ work.len = zlen;
+ compressed = true;
+
+ dmsg (D_COMP, "LZ4 compress %d -> %d", buf->len, work.len);
+ compctx->pre_compress += buf->len;
+ compctx->post_compress += work.len;
+ }
+
+ /* did compression save us anything? */
+ {
+ uint8_t comp_head_byte = NO_COMPRESS_BYTE_SWAP;
+ if (compressed && work.len < buf->len)
+ {
+ *buf = work;
+ comp_head_byte = LZ4_COMPRESS_BYTE;
+ }
+
+ {
+ uint8_t *head = BPTR (buf);
+ uint8_t *tail = BEND (buf);
+ ASSERT (buf_safe (buf, 1));
+ ++buf->len;
+
+ /* move head byte of payload to tail */
+ *tail = *head;
+ *head = comp_head_byte;
+ }
+ }
+}
+
+static void
+lz4_decompress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ size_t zlen_max = EXPANDED_SIZE (frame);
+ int uncomp_len;
+ uint8_t c; /* flag indicating whether or not our peer compressed */
+
+ if (buf->len <= 0)
+ return;
+
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+
+ /* do unframing/swap (assumes buf->len > 0) */
+ {
+ uint8_t *head = BPTR (buf);
+ c = *head;
+ --buf->len;
+ *head = *BEND (buf);
+ }
+
+ if (c == LZ4_COMPRESS_BYTE) /* packet was compressed */
+ {
+ ASSERT (buf_safe (&work, zlen_max));
+ uncomp_len = LZ4_decompress_safe((const char *)BPTR(buf), (char *)BPTR(&work), (size_t)BLEN(buf), zlen_max);
+ if (uncomp_len <= 0)
+ {
+ dmsg (D_COMP_ERRORS, "LZ4 decompression error: %d", uncomp_len);
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, uncomp_len));
+ work.len = uncomp_len;
+
+ dmsg (D_COMP, "LZ4 decompress %d -> %d", buf->len, work.len);
+ compctx->pre_decompress += buf->len;
+ compctx->post_decompress += work.len;
+
+ *buf = work;
+ }
+ else if (c == NO_COMPRESS_BYTE_SWAP) /* packet was not compressed */
+ {
+ ;
+ }
+ else
+ {
+ dmsg (D_COMP_ERRORS, "Bad LZ4 decompression header byte: %d", c);
+ buf->len = 0;
+ }
+}
+
+const struct compress_alg lz4_alg = {
+ "lz4",
+ lz4_compress_init,
+ lz4_compress_uninit,
+ lz4_compress,
+ lz4_decompress
+};
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_LZ4 */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.h
new file mode 100644
index 00000000..ca1dfa9b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp-lz4.h
@@ -0,0 +1,40 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2013 Gert Doering <gert@greenie.muc.de>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_COMP_LZ4_H
+#define OPENVPN_COMP_LZ4_H
+
+#if defined(ENABLE_LZ4)
+
+#include "buffer.h"
+
+extern const struct compress_alg lz4_alg;
+
+struct lz4_workspace
+{
+};
+
+#endif /* ENABLE_LZ4 */
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.c
new file mode 100644
index 00000000..4ac589f9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.c
@@ -0,0 +1,146 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef USE_COMP
+
+#include "comp.h"
+#include "error.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+struct compress_context *
+comp_init(const struct compress_options *opt)
+{
+ struct compress_context *compctx = NULL;
+ switch (opt->alg)
+ {
+ case COMP_ALG_STUB:
+ ALLOC_OBJ_CLEAR (compctx, struct compress_context);
+ compctx->flags = opt->flags;
+ compctx->alg = comp_stub_alg;
+ (*compctx->alg.compress_init)(compctx);
+ break;
+#ifdef ENABLE_LZO
+ case COMP_ALG_LZO:
+ ALLOC_OBJ_CLEAR (compctx, struct compress_context);
+ compctx->flags = opt->flags;
+ compctx->alg = lzo_alg;
+ (*compctx->alg.compress_init)(compctx);
+ break;
+#endif
+#ifdef ENABLE_SNAPPY
+ case COMP_ALG_SNAPPY:
+ ALLOC_OBJ_CLEAR (compctx, struct compress_context);
+ compctx->flags = opt->flags;
+ compctx->alg = snappy_alg;
+ (*compctx->alg.compress_init)(compctx);
+ break;
+#endif
+#ifdef ENABLE_LZ4
+ case COMP_ALG_LZ4:
+ ALLOC_OBJ_CLEAR (compctx, struct compress_context);
+ compctx->flags = opt->flags;
+ compctx->alg = lz4_alg;
+ (*compctx->alg.compress_init)(compctx);
+ break;
+#endif
+ }
+ return compctx;
+}
+
+void
+comp_uninit(struct compress_context *compctx)
+{
+ if (compctx)
+ {
+ (*compctx->alg.compress_uninit)(compctx);
+ free(compctx);
+ }
+}
+
+void
+comp_add_to_extra_frame(struct frame *frame)
+{
+ /* Leave room for our one-byte compressed/didn't-compress prefix byte. */
+ frame_add_to_extra_frame (frame, COMP_PREFIX_LEN);
+}
+
+void
+comp_add_to_extra_buffer(struct frame *frame)
+{
+ /* Leave room for compression buffer to expand in worst case scenario
+ where data is totally uncompressible */
+ frame_add_to_extra_buffer (frame, COMP_EXTRA_BUFFER (EXPANDED_SIZE(frame)));
+}
+
+void
+comp_print_stats (const struct compress_context *compctx, struct status_output *so)
+{
+ if (compctx)
+ {
+ status_printf (so, "pre-compress bytes," counter_format, compctx->pre_compress);
+ status_printf (so, "post-compress bytes," counter_format, compctx->post_compress);
+ status_printf (so, "pre-decompress bytes," counter_format, compctx->pre_decompress);
+ status_printf (so, "post-decompress bytes," counter_format, compctx->post_decompress);
+ }
+}
+
+/*
+ * Tell our peer which compression algorithms we support.
+ */
+void
+comp_generate_peer_info_string(const struct compress_options *opt, struct buffer *out)
+{
+ if (opt)
+ {
+ bool lzo_avail = false;
+ if (!(opt->flags & COMP_F_ADVERTISE_STUBS_ONLY))
+ {
+#if defined(ENABLE_LZ4)
+ buf_printf (out, "IV_LZ4=1\n");
+#endif
+#if defined(ENABLE_SNAPPY)
+ buf_printf (out, "IV_SNAPPY=1\n");
+#endif
+#if defined(ENABLE_LZO)
+ buf_printf (out, "IV_LZO=1\n");
+ lzo_avail = true;
+#endif
+ }
+ if (!lzo_avail)
+ buf_printf (out, "IV_LZO_STUB=1\n");
+ buf_printf (out, "IV_COMP_STUB=1\n");
+ }
+}
+
+#endif /* USE_COMP */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.h
new file mode 100644
index 00000000..bfa25fd3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/comp.h
@@ -0,0 +1,180 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Generic compression support. Currently we support
+ * Snappy, LZO 2 and LZ4.
+ */
+#ifndef OPENVPN_COMP_H
+#define OPENVPN_COMP_H
+
+#ifdef USE_COMP
+
+#include "buffer.h"
+#include "mtu.h"
+#include "common.h"
+#include "status.h"
+
+/* algorithms */
+#define COMP_ALG_UNDEF 0
+#define COMP_ALG_STUB 1 /* support compression command byte and framing without actual compression */
+#define COMP_ALG_LZO 2 /* LZO algorithm */
+#define COMP_ALG_SNAPPY 3 /* Snappy algorithm */
+#define COMP_ALG_LZ4 4 /* LZ4 algorithm */
+
+/* Compression flags */
+#define COMP_F_ADAPTIVE (1<<0) /* COMP_ALG_LZO only */
+#define COMP_F_ASYM (1<<1) /* only downlink is compressed, not uplink */
+#define COMP_F_SWAP (1<<2) /* initial command byte is swapped with last byte in buffer to preserve payload alignment */
+#define COMP_F_ADVERTISE_STUBS_ONLY (1<<3) /* tell server that we only support compression stubs */
+
+/*
+ * Length of prepended prefix on compressed packets
+ */
+#define COMP_PREFIX_LEN 1
+
+/*
+ * Prefix bytes
+ */
+#define NO_COMPRESS_BYTE 0xFA
+#define NO_COMPRESS_BYTE_SWAP 0xFB /* to maintain payload alignment, replace this byte with last byte of packet */
+
+/*
+ * Compress worst case size expansion (for any algorithm)
+ *
+ * LZO: len + len/8 + 128 + 3
+ * Snappy: len + len/6 + 32
+ * LZ4: len + len/255 + 16 (LZ4_COMPRESSBOUND(len))
+ */
+#define COMP_EXTRA_BUFFER(len) ((len)/6 + 128 + 3 + COMP_PREFIX_LEN)
+
+/*
+ * Don't try to compress any packet smaller than this.
+ */
+#define COMPRESS_THRESHOLD 100
+
+/* Forward declaration of compression context */
+struct compress_context;
+
+/*
+ * Virtual methods and other static info for each compression algorithm
+ */
+struct compress_alg
+{
+ const char *name;
+ void (*compress_init)(struct compress_context *compctx);
+ void (*compress_uninit)(struct compress_context *compctx);
+ void (*compress)(struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame);
+
+ void (*decompress)(struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame);
+};
+
+/*
+ * Headers for each compression implementation
+ */
+#ifdef ENABLE_LZO
+#include "lzo.h"
+#endif
+
+#ifdef ENABLE_SNAPPY
+#include "snappy.h"
+#endif
+
+#ifdef ENABLE_LZ4
+#include "comp-lz4.h"
+#endif
+
+/*
+ * Information that basically identifies a compression
+ * algorithm and related flags.
+ */
+struct compress_options
+{
+ int alg;
+ unsigned int flags;
+};
+
+/*
+ * Workspace union of all supported compression algorithms
+ */
+union compress_workspace_union
+{
+#ifdef ENABLE_LZO
+ struct lzo_compress_workspace lzo;
+#endif
+#ifdef ENABLE_SNAPPY
+ struct snappy_workspace snappy;
+#endif
+#ifdef ENABLE_LZ4
+ struct lz4_workspace lz4;
+#endif
+};
+
+/*
+ * Context for active compression session
+ */
+struct compress_context
+{
+ unsigned int flags;
+ struct compress_alg alg;
+ union compress_workspace_union wu;
+
+ /* statistics */
+ counter_type pre_decompress;
+ counter_type post_decompress;
+ counter_type pre_compress;
+ counter_type post_compress;
+};
+
+extern const struct compress_alg comp_stub_alg;
+
+struct compress_context *comp_init(const struct compress_options *opt);
+
+void comp_uninit(struct compress_context *compctx);
+
+void comp_add_to_extra_frame(struct frame *frame);
+void comp_add_to_extra_buffer(struct frame *frame);
+
+void comp_print_stats (const struct compress_context *compctx, struct status_output *so);
+
+void comp_generate_peer_info_string(const struct compress_options *opt, struct buffer *out);
+
+static inline bool
+comp_enabled(const struct compress_options *info)
+{
+ return info->alg != COMP_ALG_UNDEF;
+}
+
+static inline bool
+comp_unswapped_prefix(const struct compress_options *info)
+{
+ return !(info->flags & COMP_F_SWAP);
+}
+
+#endif /* USE_COMP */
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/compstub.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/compstub.c
new file mode 100644
index 00000000..2ab7163e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/compstub.c
@@ -0,0 +1,118 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(USE_COMP)
+
+#include "comp.h"
+#include "error.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+static void
+stub_compress_init (struct compress_context *compctx)
+{
+}
+
+static void
+stub_compress_uninit (struct compress_context *compctx)
+{
+}
+
+static void
+stub_compress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ if (buf->len <= 0)
+ return;
+ if (compctx->flags & COMP_F_SWAP)
+ {
+ uint8_t *head = BPTR (buf);
+ uint8_t *tail = BEND (buf);
+ ASSERT (buf_safe (buf, 1));
+ ++buf->len;
+
+ /* move head byte of payload to tail */
+ *tail = *head;
+ *head = NO_COMPRESS_BYTE_SWAP;
+ }
+ else
+ {
+ uint8_t *header = buf_prepend (buf, 1);
+ *header = NO_COMPRESS_BYTE;
+ }
+}
+
+static void
+stub_decompress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ uint8_t c;
+ if (buf->len <= 0)
+ return;
+ if (compctx->flags & COMP_F_SWAP)
+ {
+ uint8_t *head = BPTR (buf);
+ c = *head;
+ --buf->len;
+ *head = *BEND (buf);
+ if (c != NO_COMPRESS_BYTE_SWAP)
+ {
+ dmsg (D_COMP_ERRORS, "Bad compression stub (swap) decompression header byte: %d", c);
+ buf->len = 0;
+ }
+ }
+ else
+ {
+ c = *BPTR (buf);
+ ASSERT (buf_advance (buf, 1));
+ if (c != NO_COMPRESS_BYTE)
+ {
+ dmsg (D_COMP_ERRORS, "Bad compression stub decompression header byte: %d", c);
+ buf->len = 0;
+ }
+ }
+}
+
+const struct compress_alg comp_stub_alg = {
+ "stub",
+ stub_compress_init,
+ stub_compress_uninit,
+ stub_compress,
+ stub_decompress
+};
+
+#else
+static void dummy(void) {}
+#endif /* USE_STUB */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/console.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/console.c
new file mode 100644
index 00000000..afda8ca3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/console.c
@@ -0,0 +1,238 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+#include "console.h"
+#include "error.h"
+#include "buffer.h"
+#include "misc.h"
+
+#ifdef WIN32
+
+#include "win32.h"
+
+/*
+ * Get input from console.
+ *
+ * Return false on input error, or if service
+ * exit event is signaled.
+ */
+
+static bool
+get_console_input_win32 (const char *prompt, const bool echo, char *input, const int capacity)
+{
+ HANDLE in = INVALID_HANDLE_VALUE;
+ HANDLE err = INVALID_HANDLE_VALUE;
+ DWORD len = 0;
+
+ ASSERT (prompt);
+ ASSERT (input);
+ ASSERT (capacity > 0);
+
+ input[0] = '\0';
+
+ in = GetStdHandle (STD_INPUT_HANDLE);
+ err = get_orig_stderr ();
+
+ if (in != INVALID_HANDLE_VALUE
+ && err != INVALID_HANDLE_VALUE
+ && !win32_service_interrupt (&win32_signal)
+ && WriteFile (err, prompt, strlen (prompt), &len, NULL))
+ {
+ bool is_console = (GetFileType (in) == FILE_TYPE_CHAR);
+ DWORD flags_save = 0;
+ int status = 0;
+ WCHAR *winput;
+
+ if (is_console)
+ {
+ if (GetConsoleMode (in, &flags_save))
+ {
+ DWORD flags = ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT;
+ if (echo)
+ flags |= ENABLE_ECHO_INPUT;
+ SetConsoleMode (in, flags);
+ }
+ else
+ is_console = 0;
+ }
+
+ if (is_console)
+ {
+ winput = malloc (capacity * sizeof (WCHAR));
+ if (winput == NULL)
+ return false;
+
+ status = ReadConsoleW (in, winput, capacity, &len, NULL);
+ WideCharToMultiByte (CP_UTF8, 0, winput, len, input, capacity, NULL, NULL);
+ free (winput);
+ }
+ else
+ status = ReadFile (in, input, capacity, &len, NULL);
+
+ string_null_terminate (input, (int)len, capacity);
+ chomp (input);
+
+ if (!echo)
+ WriteFile (err, "\r\n", 2, &len, NULL);
+ if (is_console)
+ SetConsoleMode (in, flags_save);
+ if (status && !win32_service_interrupt (&win32_signal))
+ return true;
+ }
+
+ return false;
+}
+
+#endif
+
+#ifdef HAVE_GETPASS
+
+static FILE *
+open_tty (const bool write)
+{
+ FILE *ret;
+ ret = fopen ("/dev/tty", write ? "w" : "r");
+ if (!ret)
+ ret = write ? stderr : stdin;
+ return ret;
+}
+
+static void
+close_tty (FILE *fp)
+{
+ if (fp != stderr && fp != stdin)
+ fclose (fp);
+}
+
+#endif
+
+#ifdef ENABLE_SYSTEMD
+
+/*
+ * is systemd running
+ */
+
+static bool
+check_systemd_running ()
+{
+ struct stat a, b;
+
+ /* We simply test whether the systemd cgroup hierarchy is
+ * mounted */
+
+ return (lstat("/sys/fs/cgroup", &a) == 0)
+ && (lstat("/sys/fs/cgroup/systemd", &b) == 0)
+ && (a.st_dev != b.st_dev);
+
+}
+
+static bool
+get_console_input_systemd (const char *prompt, const bool echo, char *input, const int capacity)
+{
+ int std_out;
+ bool ret = false;
+ struct argv argv;
+
+ argv_init (&argv);
+ argv_printf (&argv, "/bin/systemd-ask-password");
+ argv_printf_cat (&argv, "%s", prompt);
+
+ if ((std_out = openvpn_popen (&argv, NULL)) < 0) {
+ return false;
+ }
+ CLEAR (*input);
+ if (read (std_out, input, capacity) != 0)
+ {
+ chomp (input);
+ ret = true;
+ }
+ close (std_out);
+
+ argv_reset (&argv);
+
+ return ret;
+}
+
+
+#endif
+
+/*
+ * Get input from console
+ */
+bool
+get_console_input (const char *prompt, const bool echo, char *input, const int capacity)
+{
+ bool ret = false;
+ ASSERT (prompt);
+ ASSERT (input);
+ ASSERT (capacity > 0);
+ input[0] = '\0';
+
+#ifdef ENABLE_SYSTEMD
+ if (check_systemd_running ())
+ return get_console_input_systemd (prompt, echo, input, capacity);
+#endif
+
+#if defined(WIN32)
+ return get_console_input_win32 (prompt, echo, input, capacity);
+#elif defined(HAVE_GETPASS)
+ if (echo)
+ {
+ FILE *fp;
+
+ fp = open_tty (true);
+ fprintf (fp, "%s", prompt);
+ fflush (fp);
+ close_tty (fp);
+
+ fp = open_tty (false);
+ if (fgets (input, capacity, fp) != NULL)
+ {
+ chomp (input);
+ ret = true;
+ }
+ close_tty (fp);
+ }
+ else
+ {
+ char *gp = getpass (prompt);
+ if (gp)
+ {
+ strncpynt (input, gp, capacity);
+ memset (gp, 0, strlen (gp));
+ ret = true;
+ }
+ }
+#else
+ msg (M_FATAL, "Sorry, but I can't get console input on this OS (%s)", prompt);
+#endif
+ return ret;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/console.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/console.h
new file mode 100644
index 00000000..268f3feb
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/console.h
@@ -0,0 +1,33 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef CONSOLE_H
+#define CONSOLE_H
+
+#include "basic.h"
+
+bool
+get_console_input (const char *prompt, const bool echo, char *input, const int capacity);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.c
new file mode 100644
index 00000000..62c4ab28
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.c
@@ -0,0 +1,1511 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_CRYPTO
+
+#include "crypto.h"
+#include "error.h"
+#include "misc.h"
+
+#include "memdbg.h"
+
+/*
+ * Encryption and Compression Routines.
+ *
+ * On entry, buf contains the input data and length.
+ * On exit, it should be set to the output data and length.
+ *
+ * If buf->len is <= 0 we should return
+ * If buf->len is set to 0 on exit it tells the caller to ignore the packet.
+ *
+ * work is a workspace buffer we are given of size BUF_SIZE.
+ * work may be used to return output data, or the input buffer
+ * may be modified and returned as output. If output data is
+ * returned in work, the data should start after FRAME_HEADROOM bytes
+ * of padding to leave room for downstream routines to prepend.
+ *
+ * Up to a total of FRAME_HEADROOM bytes may be prepended to the input buf
+ * by all routines (encryption, decryption, compression, and decompression).
+ *
+ * Note that the buf_prepend return will assert if we try to
+ * make a header bigger than FRAME_HEADROOM. This should not
+ * happen unless the frame parameters are wrong.
+ */
+
+#define CRYPT_ERROR(format) \
+ do { msg (D_CRYPT_ERRORS, "%s: " format, error_prefix); goto error_exit; } while (false)
+
+/**
+ * As memcmp(), but constant-time.
+ * Returns 0 when data is equal, non-zero otherwise.
+ */
+static int
+memcmp_constant_time (const void *a, const void *b, size_t size) {
+ const uint8_t * a1 = a;
+ const uint8_t * b1 = b;
+ int ret = 0;
+ size_t i;
+
+ for (i = 0; i < size; i++) {
+ ret |= *a1++ ^ *b1++;
+ }
+
+ return ret;
+}
+
+void
+openvpn_encrypt (struct buffer *buf, struct buffer work,
+ const struct crypto_options *opt,
+ const struct frame* frame)
+{
+ struct gc_arena gc;
+ gc_init (&gc);
+
+ if (buf->len > 0 && opt->key_ctx_bi)
+ {
+ struct key_ctx *ctx = &opt->key_ctx_bi->encrypt;
+
+ /* Do Encrypt from buf -> work */
+ if (ctx->cipher)
+ {
+ uint8_t iv_buf[OPENVPN_MAX_IV_LENGTH];
+ const int iv_size = cipher_ctx_iv_length (ctx->cipher);
+ const cipher_kt_t *cipher_kt = cipher_ctx_get_cipher_kt (ctx->cipher);
+ int outlen;
+
+ if (cipher_kt_mode_cbc(cipher_kt))
+ {
+ CLEAR (iv_buf);
+
+ /* generate pseudo-random IV */
+ if (opt->flags & CO_USE_IV)
+ prng_bytes (iv_buf, iv_size);
+
+ /* Put packet ID in plaintext buffer or IV, depending on cipher mode */
+ if (opt->packet_id)
+ {
+ struct packet_id_net pin;
+ packet_id_alloc_outgoing (&opt->packet_id->send, &pin, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM));
+ ASSERT (packet_id_write (&pin, buf, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM), true));
+ }
+ }
+ else if (cipher_kt_mode_ofb_cfb(cipher_kt))
+ {
+ struct packet_id_net pin;
+ struct buffer b;
+
+ ASSERT (opt->flags & CO_USE_IV); /* IV and packet-ID required */
+ ASSERT (opt->packet_id); /* for this mode. */
+
+ packet_id_alloc_outgoing (&opt->packet_id->send, &pin, true);
+ memset (iv_buf, 0, iv_size);
+ buf_set_write (&b, iv_buf, iv_size);
+ ASSERT (packet_id_write (&pin, &b, true, false));
+ }
+ else /* We only support CBC, CFB, or OFB modes right now */
+ {
+ ASSERT (0);
+ }
+
+ /* initialize work buffer with FRAME_HEADROOM bytes of prepend capacity */
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+
+ /* set the IV pseudo-randomly */
+ if (opt->flags & CO_USE_IV)
+ dmsg (D_PACKET_CONTENT, "ENCRYPT IV: %s", format_hex (iv_buf, iv_size, 0, &gc));
+
+ dmsg (D_PACKET_CONTENT, "ENCRYPT FROM: %s",
+ format_hex (BPTR (buf), BLEN (buf), 80, &gc));
+
+ /* cipher_ctx was already initialized with key & keylen */
+ ASSERT (cipher_ctx_reset(ctx->cipher, iv_buf));
+
+ /* Buffer overflow check */
+ if (!buf_safe (&work, buf->len + cipher_ctx_block_size(ctx->cipher)))
+ {
+ msg (D_CRYPT_ERRORS, "ENCRYPT: buffer size error, bc=%d bo=%d bl=%d wc=%d wo=%d wl=%d cbs=%d",
+ buf->capacity,
+ buf->offset,
+ buf->len,
+ work.capacity,
+ work.offset,
+ work.len,
+ cipher_ctx_block_size (ctx->cipher));
+ goto err;
+ }
+
+ /* Encrypt packet ID, payload */
+ ASSERT (cipher_ctx_update (ctx->cipher, BPTR (&work), &outlen, BPTR (buf), BLEN (buf)));
+ work.len += outlen;
+
+ /* Flush the encryption buffer */
+ ASSERT(cipher_ctx_final(ctx->cipher, BPTR (&work) + outlen, &outlen));
+ work.len += outlen;
+
+ /* For all CBC mode ciphers, check the last block is complete */
+ ASSERT (cipher_kt_mode (cipher_kt) != OPENVPN_MODE_CBC ||
+ outlen == iv_size);
+
+ /* prepend the IV to the ciphertext */
+ if (opt->flags & CO_USE_IV)
+ {
+ uint8_t *output = buf_prepend (&work, iv_size);
+ ASSERT (output);
+ memcpy (output, iv_buf, iv_size);
+ }
+
+ dmsg (D_PACKET_CONTENT, "ENCRYPT TO: %s",
+ format_hex (BPTR (&work), BLEN (&work), 80, &gc));
+ }
+ else /* No Encryption */
+ {
+ if (opt->packet_id)
+ {
+ struct packet_id_net pin;
+ packet_id_alloc_outgoing (&opt->packet_id->send, &pin, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM));
+ ASSERT (packet_id_write (&pin, buf, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM), true));
+ }
+ work = *buf;
+ }
+
+ /* HMAC the ciphertext (or plaintext if !cipher) */
+ if (ctx->hmac)
+ {
+ uint8_t *output = NULL;
+
+ hmac_ctx_reset (ctx->hmac);
+ hmac_ctx_update (ctx->hmac, BPTR(&work), BLEN(&work));
+ output = buf_prepend (&work, hmac_ctx_size(ctx->hmac));
+ ASSERT (output);
+ hmac_ctx_final (ctx->hmac, output);
+ }
+
+ *buf = work;
+ }
+
+ gc_free (&gc);
+ return;
+
+err:
+ crypto_clear_error();
+ buf->len = 0;
+ gc_free (&gc);
+ return;
+}
+
+/*
+ * If (opt->flags & CO_USE_IV) is not NULL, we will read an IV from the packet.
+ *
+ * Set buf->len to 0 and return false on decrypt error.
+ *
+ * On success, buf is set to point to plaintext, true
+ * is returned.
+ */
+bool
+openvpn_decrypt (struct buffer *buf, struct buffer work,
+ const struct crypto_options *opt,
+ const struct frame* frame)
+{
+ static const char error_prefix[] = "Authenticate/Decrypt packet error";
+ struct gc_arena gc;
+ gc_init (&gc);
+
+ if (buf->len > 0 && opt->key_ctx_bi)
+ {
+ struct key_ctx *ctx = &opt->key_ctx_bi->decrypt;
+ struct packet_id_net pin;
+ bool have_pin = false;
+
+ /* Verify the HMAC */
+ if (ctx->hmac)
+ {
+ int hmac_len;
+ uint8_t local_hmac[MAX_HMAC_KEY_LENGTH]; /* HMAC of ciphertext computed locally */
+
+ hmac_ctx_reset(ctx->hmac);
+
+ /* Assume the length of the input HMAC */
+ hmac_len = hmac_ctx_size (ctx->hmac);
+
+ /* Authentication fails if insufficient data in packet for HMAC */
+ if (buf->len < hmac_len)
+ CRYPT_ERROR ("missing authentication info");
+
+ hmac_ctx_update (ctx->hmac, BPTR (buf) + hmac_len, BLEN (buf) - hmac_len);
+ hmac_ctx_final (ctx->hmac, local_hmac);
+
+ /* Compare locally computed HMAC with packet HMAC */
+ if (memcmp_constant_time (local_hmac, BPTR (buf), hmac_len))
+ CRYPT_ERROR ("packet HMAC authentication failed");
+
+ ASSERT (buf_advance (buf, hmac_len));
+ }
+
+ /* Decrypt packet ID + payload */
+
+ if (ctx->cipher)
+ {
+ const int iv_size = cipher_ctx_iv_length (ctx->cipher);
+ const cipher_kt_t *cipher_kt = cipher_ctx_get_cipher_kt (ctx->cipher);
+ uint8_t iv_buf[OPENVPN_MAX_IV_LENGTH];
+ int outlen;
+
+ /* initialize work buffer with FRAME_HEADROOM bytes of prepend capacity */
+ ASSERT (buf_init (&work, FRAME_HEADROOM_ADJ (frame, FRAME_HEADROOM_MARKER_DECRYPT)));
+
+ /* use IV if user requested it */
+ CLEAR (iv_buf);
+ if (opt->flags & CO_USE_IV)
+ {
+ if (buf->len < iv_size)
+ CRYPT_ERROR ("missing IV info");
+ memcpy (iv_buf, BPTR (buf), iv_size);
+ ASSERT (buf_advance (buf, iv_size));
+ }
+
+ /* show the IV's initial state */
+ if (opt->flags & CO_USE_IV)
+ dmsg (D_PACKET_CONTENT, "DECRYPT IV: %s", format_hex (iv_buf, iv_size, 0, &gc));
+
+ if (buf->len < 1)
+ CRYPT_ERROR ("missing payload");
+
+ /* ctx->cipher was already initialized with key & keylen */
+ if (!cipher_ctx_reset (ctx->cipher, iv_buf))
+ CRYPT_ERROR ("cipher init failed");
+
+ /* Buffer overflow check (should never happen) */
+ if (!buf_safe (&work, buf->len))
+ CRYPT_ERROR ("buffer overflow");
+
+ /* Decrypt packet ID, payload */
+ if (!cipher_ctx_update (ctx->cipher, BPTR (&work), &outlen, BPTR (buf), BLEN (buf)))
+ CRYPT_ERROR ("cipher update failed");
+ work.len += outlen;
+
+ /* Flush the decryption buffer */
+ if (!cipher_ctx_final (ctx->cipher, BPTR (&work) + outlen, &outlen))
+ CRYPT_ERROR ("cipher final failed");
+ work.len += outlen;
+
+ dmsg (D_PACKET_CONTENT, "DECRYPT TO: %s",
+ format_hex (BPTR (&work), BLEN (&work), 80, &gc));
+
+ /* Get packet ID from plaintext buffer or IV, depending on cipher mode */
+ {
+ if (cipher_kt_mode_cbc(cipher_kt))
+ {
+ if (opt->packet_id)
+ {
+ if (!packet_id_read (&pin, &work, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM)))
+ CRYPT_ERROR ("error reading CBC packet-id");
+ have_pin = true;
+ }
+ }
+ else if (cipher_kt_mode_ofb_cfb(cipher_kt))
+ {
+ struct buffer b;
+
+ ASSERT (opt->flags & CO_USE_IV); /* IV and packet-ID required */
+ ASSERT (opt->packet_id); /* for this mode. */
+
+ buf_set_read (&b, iv_buf, iv_size);
+ if (!packet_id_read (&pin, &b, true))
+ CRYPT_ERROR ("error reading CFB/OFB packet-id");
+ have_pin = true;
+ }
+ else /* We only support CBC, CFB, or OFB modes right now */
+ {
+ ASSERT (0);
+ }
+ }
+ }
+ else
+ {
+ work = *buf;
+ if (opt->packet_id)
+ {
+ if (!packet_id_read (&pin, &work, BOOL_CAST (opt->flags & CO_PACKET_ID_LONG_FORM)))
+ CRYPT_ERROR ("error reading packet-id");
+ have_pin = !BOOL_CAST (opt->flags & CO_IGNORE_PACKET_ID);
+ }
+ }
+
+ if (have_pin)
+ {
+ packet_id_reap_test (&opt->packet_id->rec);
+ if (packet_id_test (&opt->packet_id->rec, &pin))
+ {
+ packet_id_add (&opt->packet_id->rec, &pin);
+ if (opt->pid_persist && (opt->flags & CO_PACKET_ID_LONG_FORM))
+ packet_id_persist_save_obj (opt->pid_persist, opt->packet_id);
+ }
+ else
+ {
+ if (!(opt->flags & CO_MUTE_REPLAY_WARNINGS))
+ msg (D_REPLAY_ERRORS, "%s: bad packet ID (may be a replay): %s -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings",
+ error_prefix, packet_id_net_print (&pin, true, &gc));
+ goto error_exit;
+ }
+ }
+ *buf = work;
+ }
+
+ gc_free (&gc);
+ return true;
+
+ error_exit:
+ crypto_clear_error();
+ buf->len = 0;
+ gc_free (&gc);
+ return false;
+}
+
+/*
+ * This verifies if a packet and its HMAC fit to a crypto context.
+ *
+ * On success true is returned.
+ */
+bool
+crypto_test_hmac (struct buffer *buf, const struct crypto_options *opt)
+{
+ struct gc_arena gc;
+ gc_init (&gc);
+ int offset = 4; /* 1 byte opcode + 3 bytes session-id */
+
+ if (buf->len > 0 && opt->key_ctx_bi)
+ {
+ struct key_ctx *ctx = &opt->key_ctx_bi->decrypt;
+
+ /* Verify the HMAC */
+ if (ctx->hmac)
+ {
+ int hmac_len;
+ uint8_t local_hmac[MAX_HMAC_KEY_LENGTH]; /* HMAC of ciphertext computed locally */
+
+ hmac_ctx_reset(ctx->hmac);
+
+ /* Assume the length of the input HMAC */
+ hmac_len = hmac_ctx_size (ctx->hmac);
+
+ /* Authentication fails if insufficient data in packet for HMAC */
+ if ((buf->len - offset) < hmac_len)
+ {
+ gc_free (&gc);
+ return false;
+ }
+
+ hmac_ctx_update (ctx->hmac, BPTR (buf) + offset + hmac_len,
+ BLEN (buf) - offset - hmac_len);
+ hmac_ctx_final (ctx->hmac, local_hmac);
+
+ /* Compare locally computed HMAC with packet HMAC */
+ if (memcmp (local_hmac, BPTR (buf) + offset, hmac_len))
+ {
+ gc_free (&gc);
+ return false;
+ }
+
+ gc_free (&gc);
+ return true;
+ }
+ }
+
+ gc_free (&gc);
+ return false;
+}
+
+/*
+ * How many bytes will we add to frame buffer for a given
+ * set of crypto options?
+ */
+void
+crypto_adjust_frame_parameters(struct frame *frame,
+ const struct key_type* kt,
+ bool cipher_defined,
+ bool use_iv,
+ bool packet_id,
+ bool packet_id_long_form)
+{
+ frame_add_to_extra_frame (frame,
+ (packet_id ? packet_id_size (packet_id_long_form) : 0) +
+ ((cipher_defined && use_iv) ? cipher_kt_iv_size (kt->cipher) : 0) +
+ (cipher_defined ? cipher_kt_block_size (kt->cipher) : 0) + /* worst case padding expansion */
+ kt->hmac_length);
+}
+
+/*
+ * Build a struct key_type.
+ */
+void
+init_key_type (struct key_type *kt, const char *ciphername,
+ bool ciphername_defined, const char *authname,
+ bool authname_defined, int keysize,
+ bool cfb_ofb_allowed, bool warn)
+{
+ CLEAR (*kt);
+ if (ciphername && ciphername_defined)
+ {
+ kt->cipher = cipher_kt_get (translate_cipher_name_from_openvpn(ciphername));
+ kt->cipher_length = cipher_kt_key_size (kt->cipher);
+ if (keysize > 0 && keysize <= MAX_CIPHER_KEY_LENGTH)
+ kt->cipher_length = keysize;
+
+ /* check legal cipher mode */
+ {
+ if (!(cipher_kt_mode_cbc(kt->cipher)
+#ifdef ENABLE_OFB_CFB_MODE
+ || (cfb_ofb_allowed && cipher_kt_mode_ofb_cfb(kt->cipher))
+#endif
+ ))
+ msg (M_FATAL, "Cipher '%s' mode not supported", ciphername);
+ }
+ }
+ else
+ {
+ if (warn)
+ msg (M_WARN, "******* WARNING *******: null cipher specified, no encryption will be used");
+ }
+ if (authname && authname_defined)
+ {
+ kt->digest = md_kt_get (authname);
+ kt->hmac_length = md_kt_size (kt->digest);
+ }
+ else
+ {
+ if (warn)
+ msg (M_WARN, "******* WARNING *******: null MAC specified, no authentication will be used");
+ }
+}
+
+/* given a key and key_type, build a key_ctx */
+void
+init_key_ctx (struct key_ctx *ctx, struct key *key,
+ const struct key_type *kt, int enc,
+ const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+ CLEAR (*ctx);
+ if (kt->cipher && kt->cipher_length > 0)
+ {
+
+ ALLOC_OBJ(ctx->cipher, cipher_ctx_t);
+ cipher_ctx_init (ctx->cipher, key->cipher, kt->cipher_length,
+ kt->cipher, enc);
+
+ msg (D_HANDSHAKE, "%s: Cipher '%s' initialized with %d bit key",
+ prefix,
+ cipher_kt_name(kt->cipher),
+ kt->cipher_length *8);
+
+ dmsg (D_SHOW_KEYS, "%s: CIPHER KEY: %s", prefix,
+ format_hex (key->cipher, kt->cipher_length, 0, &gc));
+ dmsg (D_CRYPTO_DEBUG, "%s: CIPHER block_size=%d iv_size=%d",
+ prefix,
+ cipher_kt_block_size(kt->cipher),
+ cipher_kt_iv_size(kt->cipher));
+ }
+ if (kt->digest && kt->hmac_length > 0)
+ {
+ ALLOC_OBJ(ctx->hmac, hmac_ctx_t);
+ hmac_ctx_init (ctx->hmac, key->hmac, kt->hmac_length, kt->digest);
+
+ msg (D_HANDSHAKE,
+ "%s: Using %d bit message hash '%s' for HMAC authentication",
+ prefix, md_kt_size(kt->digest) * 8, md_kt_name(kt->digest));
+
+ dmsg (D_SHOW_KEYS, "%s: HMAC KEY: %s", prefix,
+ format_hex (key->hmac, kt->hmac_length, 0, &gc));
+
+ dmsg (D_CRYPTO_DEBUG, "%s: HMAC size=%d block_size=%d",
+ prefix,
+ md_kt_size(kt->digest),
+ hmac_ctx_size(ctx->hmac));
+
+ }
+ gc_free (&gc);
+}
+
+void
+free_key_ctx (struct key_ctx *ctx)
+{
+ if (ctx->cipher)
+ {
+ cipher_ctx_cleanup(ctx->cipher);
+ free(ctx->cipher);
+ ctx->cipher = NULL;
+ }
+ if (ctx->hmac)
+ {
+ hmac_ctx_cleanup(ctx->hmac);
+ free(ctx->hmac);
+ ctx->hmac = NULL;
+ }
+}
+
+void
+free_key_ctx_bi (struct key_ctx_bi *ctx)
+{
+ free_key_ctx(&ctx->encrypt);
+ free_key_ctx(&ctx->decrypt);
+}
+
+
+static bool
+key_is_zero (struct key *key, const struct key_type *kt)
+{
+ int i;
+ for (i = 0; i < kt->cipher_length; ++i)
+ if (key->cipher[i])
+ return false;
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: WARNING: zero key detected");
+ return true;
+}
+
+/*
+ * Make sure that cipher key is a valid key for current key_type.
+ */
+bool
+check_key (struct key *key, const struct key_type *kt)
+{
+ if (kt->cipher)
+ {
+ /*
+ * Check for zero key
+ */
+ if (key_is_zero(key, kt))
+ return false;
+
+ /*
+ * Check for weak or semi-weak DES keys.
+ */
+ {
+ const int ndc = key_des_num_cblocks (kt->cipher);
+ if (ndc)
+ return key_des_check (key->cipher, kt->cipher_length, ndc);
+ else
+ return true;
+ }
+ }
+ return true;
+}
+
+/*
+ * Make safe mutations to key to ensure it is valid,
+ * such as ensuring correct parity on DES keys.
+ *
+ * This routine cannot guarantee it will generate a good
+ * key. You must always call check_key after this routine
+ * to make sure.
+ */
+void
+fixup_key (struct key *key, const struct key_type *kt)
+{
+ struct gc_arena gc = gc_new ();
+ if (kt->cipher)
+ {
+#ifdef ENABLE_DEBUG
+ const struct key orig = *key;
+#endif
+ const int ndc = key_des_num_cblocks (kt->cipher);
+
+ if (ndc)
+ key_des_fixup (key->cipher, kt->cipher_length, ndc);
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_CRYPTO_DEBUG))
+ {
+ if (memcmp (orig.cipher, key->cipher, kt->cipher_length))
+ dmsg (D_CRYPTO_DEBUG, "CRYPTO INFO: fixup_key: before=%s after=%s",
+ format_hex (orig.cipher, kt->cipher_length, 0, &gc),
+ format_hex (key->cipher, kt->cipher_length, 0, &gc));
+ }
+#endif
+ }
+ gc_free (&gc);
+}
+
+void
+check_replay_iv_consistency (const struct key_type *kt, bool packet_id, bool use_iv)
+{
+ ASSERT(kt);
+
+ if (cipher_kt_mode_ofb_cfb(kt->cipher) && !(packet_id && use_iv))
+ msg (M_FATAL, "--no-replay or --no-iv cannot be used with a CFB or OFB mode cipher");
+}
+
+/*
+ * Generate a random key. If key_type is provided, make
+ * sure generated key is valid for key_type.
+ */
+void
+generate_key_random (struct key *key, const struct key_type *kt)
+{
+ int cipher_len = MAX_CIPHER_KEY_LENGTH;
+ int hmac_len = MAX_HMAC_KEY_LENGTH;
+
+ struct gc_arena gc = gc_new ();
+
+ do {
+ CLEAR (*key);
+ if (kt)
+ {
+ if (kt->cipher && kt->cipher_length > 0 && kt->cipher_length <= cipher_len)
+ cipher_len = kt->cipher_length;
+
+ if (kt->digest && kt->hmac_length > 0 && kt->hmac_length <= hmac_len)
+ hmac_len = kt->hmac_length;
+ }
+ if (!rand_bytes (key->cipher, cipher_len)
+ || !rand_bytes (key->hmac, hmac_len))
+ msg (M_FATAL, "ERROR: Random number generator cannot obtain entropy for key generation");
+
+ dmsg (D_SHOW_KEY_SOURCE, "Cipher source entropy: %s", format_hex (key->cipher, cipher_len, 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE, "HMAC source entropy: %s", format_hex (key->hmac, hmac_len, 0, &gc));
+
+ if (kt)
+ fixup_key (key, kt);
+ } while (kt && !check_key (key, kt));
+
+ gc_free (&gc);
+}
+
+/*
+ * Print key material
+ */
+void
+key2_print (const struct key2* k,
+ const struct key_type *kt,
+ const char* prefix0,
+ const char* prefix1)
+{
+ struct gc_arena gc = gc_new ();
+ ASSERT (k->n == 2);
+ dmsg (D_SHOW_KEY_SOURCE, "%s (cipher): %s",
+ prefix0,
+ format_hex (k->keys[0].cipher, kt->cipher_length, 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE, "%s (hmac): %s",
+ prefix0,
+ format_hex (k->keys[0].hmac, kt->hmac_length, 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE, "%s (cipher): %s",
+ prefix1,
+ format_hex (k->keys[1].cipher, kt->cipher_length, 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE, "%s (hmac): %s",
+ prefix1,
+ format_hex (k->keys[1].hmac, kt->hmac_length, 0, &gc));
+ gc_free (&gc);
+}
+
+void
+test_crypto (const struct crypto_options *co, struct frame* frame)
+{
+ int i, j;
+ struct gc_arena gc = gc_new ();
+ struct buffer src = alloc_buf_gc (TUN_MTU_SIZE (frame), &gc);
+ struct buffer work = alloc_buf_gc (BUF_SIZE (frame), &gc);
+ struct buffer encrypt_workspace = alloc_buf_gc (BUF_SIZE (frame), &gc);
+ struct buffer decrypt_workspace = alloc_buf_gc (BUF_SIZE (frame), &gc);
+ struct buffer buf = clear_buf();
+
+ /* init work */
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+
+ msg (M_INFO, "Entering " PACKAGE_NAME " crypto self-test mode.");
+ for (i = 1; i <= TUN_MTU_SIZE (frame); ++i)
+ {
+ update_time ();
+
+ msg (M_INFO, "TESTING ENCRYPT/DECRYPT of packet length=%d", i);
+
+ /*
+ * Load src with random data.
+ */
+ ASSERT (buf_init (&src, 0));
+ ASSERT (i <= src.capacity);
+ src.len = i;
+ ASSERT (rand_bytes (BPTR (&src), BLEN (&src)));
+
+ /* copy source to input buf */
+ buf = work;
+ memcpy (buf_write_alloc (&buf, BLEN (&src)), BPTR (&src), BLEN (&src));
+
+ /* encrypt */
+ openvpn_encrypt (&buf, encrypt_workspace, co, frame);
+
+ /* decrypt */
+ openvpn_decrypt (&buf, decrypt_workspace, co, frame);
+
+ /* compare */
+ if (buf.len != src.len)
+ msg (M_FATAL, "SELF TEST FAILED, src.len=%d buf.len=%d", src.len, buf.len);
+ for (j = 0; j < i; ++j)
+ {
+ const uint8_t in = *(BPTR (&src) + j);
+ const uint8_t out = *(BPTR (&buf) + j);
+ if (in != out)
+ msg (M_FATAL, "SELF TEST FAILED, pos=%d in=%d out=%d", j, in, out);
+ }
+ }
+ msg (M_INFO, PACKAGE_NAME " crypto self-test mode SUCCEEDED.");
+ gc_free (&gc);
+}
+
+#ifdef ENABLE_SSL
+
+void
+get_tls_handshake_key (const struct key_type *key_type,
+ struct key_ctx_bi *ctx,
+ const char *passphrase_file,
+ const int key_direction,
+ const unsigned int flags)
+{
+ if (passphrase_file && key_type->hmac_length)
+ {
+ struct key2 key2;
+ struct key_type kt = *key_type;
+ struct key_direction_state kds;
+
+ /* for control channel we are only authenticating, not encrypting */
+ kt.cipher_length = 0;
+ kt.cipher = NULL;
+
+ if (flags & GHK_INLINE)
+ {
+ /* key was specified inline, key text is in passphrase_file */
+ read_key_file (&key2, passphrase_file, RKF_INLINE|RKF_MUST_SUCCEED);
+
+ /* succeeded? */
+ if (key2.n == 2)
+ msg (M_INFO, "Control Channel Authentication: tls-auth using INLINE static key file");
+ else
+ msg (M_FATAL, "INLINE tls-auth file lacks the requisite 2 keys");
+ }
+ else
+ {
+ /* first try to parse as an OpenVPN static key file */
+ read_key_file (&key2, passphrase_file, 0);
+
+ /* succeeded? */
+ if (key2.n == 2)
+ {
+ msg (M_INFO,
+ "Control Channel Authentication: using '%s' as a " PACKAGE_NAME " static key file",
+ passphrase_file);
+ }
+ else
+ {
+ int hash_size;
+
+ CLEAR (key2);
+
+ /* failed, now try to get hash from a freeform file */
+ hash_size = read_passphrase_hash (passphrase_file,
+ kt.digest,
+ key2.keys[0].hmac,
+ MAX_HMAC_KEY_LENGTH);
+ ASSERT (hash_size == kt.hmac_length);
+
+ /* suceeded */
+ key2.n = 1;
+
+ msg (M_INFO,
+ "Control Channel Authentication: using '%s' as a free-form passphrase file",
+ passphrase_file);
+ }
+ }
+ /* handle key direction */
+
+ key_direction_state_init (&kds, key_direction);
+ must_have_n_keys (passphrase_file, "tls-auth", &key2, kds.need_keys);
+
+ /* initialize hmac key in both directions */
+
+ init_key_ctx (&ctx->encrypt, &key2.keys[kds.out_key], &kt, OPENVPN_OP_ENCRYPT,
+ "Outgoing Control Channel Authentication");
+ init_key_ctx (&ctx->decrypt, &key2.keys[kds.in_key], &kt, OPENVPN_OP_DECRYPT,
+ "Incoming Control Channel Authentication");
+
+ CLEAR (key2);
+ }
+ else
+ {
+ CLEAR (*ctx);
+ }
+}
+#endif
+
+/* header and footer for static key file */
+static const char static_key_head[] = "-----BEGIN OpenVPN Static key V1-----";
+static const char static_key_foot[] = "-----END OpenVPN Static key V1-----";
+
+static const char printable_char_fmt[] =
+ "Non-Hex character ('%c') found at line %d in key file '%s' (%d/%d/%d bytes found/min/max)";
+
+static const char unprintable_char_fmt[] =
+ "Non-Hex, unprintable character (0x%02x) found at line %d in key file '%s' (%d/%d/%d bytes found/min/max)";
+
+/* read key from file */
+
+void
+read_key_file (struct key2 *key2, const char *file, const unsigned int flags)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer in;
+ int fd, size;
+ uint8_t hex_byte[3] = {0, 0, 0};
+ const char *error_filename = file;
+
+ /* parse info */
+ const unsigned char *cp;
+ int hb_index = 0;
+ int line_num = 1;
+ int line_index = 0;
+ int match = 0;
+
+ /* output */
+ uint8_t* out = (uint8_t*) &key2->keys;
+ const int keylen = sizeof (key2->keys);
+ int count = 0;
+
+ /* parse states */
+# define PARSE_INITIAL 0
+# define PARSE_HEAD 1
+# define PARSE_DATA 2
+# define PARSE_DATA_COMPLETE 3
+# define PARSE_FOOT 4
+# define PARSE_FINISHED 5
+ int state = PARSE_INITIAL;
+
+ /* constants */
+ const int hlen = strlen (static_key_head);
+ const int flen = strlen (static_key_foot);
+ const int onekeylen = sizeof (key2->keys[0]);
+
+ CLEAR (*key2);
+
+ /*
+ * Key can be provided as a filename in 'file' or if RKF_INLINE
+ * is set, the actual key data itself in ascii form.
+ */
+ if (flags & RKF_INLINE) /* 'file' is a string containing ascii representation of key */
+ {
+ size = strlen (file) + 1;
+ buf_set_read (&in, (const uint8_t *)file, size);
+ error_filename = INLINE_FILE_TAG;
+ }
+ else /* 'file' is a filename which refers to a file containing the ascii key */
+ {
+ in = alloc_buf_gc (2048, &gc);
+ fd = platform_open (file, O_RDONLY, 0);
+ if (fd == -1)
+ msg (M_ERR, "Cannot open file key file '%s'", file);
+ size = read (fd, in.data, in.capacity);
+ if (size < 0)
+ msg (M_FATAL, "Read error on key file ('%s')", file);
+ if (size == in.capacity)
+ msg (M_FATAL, "Key file ('%s') can be a maximum of %d bytes", file, (int)in.capacity);
+ close (fd);
+ }
+
+ cp = (unsigned char *)in.data;
+ while (size > 0)
+ {
+ const unsigned char c = *cp;
+
+#if 0
+ msg (M_INFO, "char='%c'[%d] s=%d ln=%d li=%d m=%d c=%d",
+ c, (int)c, state, line_num, line_index, match, count);
+#endif
+
+ if (c == '\n')
+ {
+ line_index = match = 0;
+ ++line_num;
+ }
+ else
+ {
+ /* first char of new line */
+ if (!line_index)
+ {
+ /* first char of line after header line? */
+ if (state == PARSE_HEAD)
+ state = PARSE_DATA;
+
+ /* first char of footer */
+ if ((state == PARSE_DATA || state == PARSE_DATA_COMPLETE) && c == '-')
+ state = PARSE_FOOT;
+ }
+
+ /* compare read chars with header line */
+ if (state == PARSE_INITIAL)
+ {
+ if (line_index < hlen && c == static_key_head[line_index])
+ {
+ if (++match == hlen)
+ state = PARSE_HEAD;
+ }
+ }
+
+ /* compare read chars with footer line */
+ if (state == PARSE_FOOT)
+ {
+ if (line_index < flen && c == static_key_foot[line_index])
+ {
+ if (++match == flen)
+ state = PARSE_FINISHED;
+ }
+ }
+
+ /* reading key */
+ if (state == PARSE_DATA)
+ {
+ if (isxdigit(c))
+ {
+ ASSERT (hb_index >= 0 && hb_index < 2);
+ hex_byte[hb_index++] = c;
+ if (hb_index == 2)
+ {
+ unsigned int u;
+ ASSERT(sscanf((const char *)hex_byte, "%x", &u) == 1);
+ *out++ = u;
+ hb_index = 0;
+ if (++count == keylen)
+ state = PARSE_DATA_COMPLETE;
+ }
+ }
+ else if (isspace(c))
+ ;
+ else
+ {
+ msg (M_FATAL,
+ (isprint (c) ? printable_char_fmt : unprintable_char_fmt),
+ c, line_num, error_filename, count, onekeylen, keylen);
+ }
+ }
+ ++line_index;
+ }
+ ++cp;
+ --size;
+ }
+
+ /*
+ * Normally we will read either 1 or 2 keys from file.
+ */
+ key2->n = count / onekeylen;
+
+ ASSERT (key2->n >= 0 && key2->n <= (int) SIZE (key2->keys));
+
+ if (flags & RKF_MUST_SUCCEED)
+ {
+ if (!key2->n)
+ msg (M_FATAL, "Insufficient key material or header text not found in file '%s' (%d/%d/%d bytes found/min/max)",
+ error_filename, count, onekeylen, keylen);
+
+ if (state != PARSE_FINISHED)
+ msg (M_FATAL, "Footer text not found in file '%s' (%d/%d/%d bytes found/min/max)",
+ error_filename, count, onekeylen, keylen);
+ }
+
+ /* zero file read buffer if not an inline file */
+ if (!(flags & RKF_INLINE))
+ buf_clear (&in);
+
+ if (key2->n)
+ warn_if_group_others_accessible (error_filename);
+
+#if 0
+ /* DEBUGGING */
+ {
+ int i;
+ printf ("KEY READ, n=%d\n", key2->n);
+ for (i = 0; i < (int) SIZE (key2->keys); ++i)
+ {
+ /* format key as ascii */
+ const char *fmt = format_hex_ex ((const uint8_t*)&key2->keys[i],
+ sizeof (key2->keys[i]),
+ 0,
+ 16,
+ "\n",
+ &gc);
+ printf ("[%d]\n%s\n\n", i, fmt);
+ }
+ }
+#endif
+
+ /* pop our garbage collection level */
+ gc_free (&gc);
+}
+
+int
+read_passphrase_hash (const char *passphrase_file,
+ const md_kt_t *digest,
+ uint8_t *output,
+ int len)
+{
+ md_ctx_t md;
+
+ ASSERT (len >= md_kt_size(digest));
+ memset (output, 0, len);
+
+ md_ctx_init(&md, digest);
+
+ /* read passphrase file */
+ {
+ const int min_passphrase_size = 8;
+ uint8_t buf[64];
+ int total_size = 0;
+ int fd = platform_open (passphrase_file, O_RDONLY, 0);
+
+ if (fd == -1)
+ msg (M_ERR, "Cannot open passphrase file: '%s'", passphrase_file);
+
+ for (;;)
+ {
+ int size = read (fd, buf, sizeof (buf));
+ if (size == 0)
+ break;
+ if (size == -1)
+ msg (M_ERR, "Read error on passphrase file: '%s'",
+ passphrase_file);
+ md_ctx_update(&md, buf, size);
+ total_size += size;
+ }
+ close (fd);
+
+ warn_if_group_others_accessible (passphrase_file);
+
+ if (total_size < min_passphrase_size)
+ msg (M_FATAL,
+ "Passphrase file '%s' is too small (must have at least %d characters)",
+ passphrase_file, min_passphrase_size);
+ }
+ md_ctx_final(&md, output);
+ md_ctx_cleanup(&md);
+ return md_kt_size(digest);
+}
+
+/*
+ * Write key to file, return number of random bits
+ * written.
+ */
+int
+write_key_file (const int nkeys, const char *filename)
+{
+ struct gc_arena gc = gc_new ();
+
+ int fd, i;
+ int nbits = 0;
+
+ /* must be large enough to hold full key file */
+ struct buffer out = alloc_buf_gc (2048, &gc);
+ struct buffer nbits_head_text = alloc_buf_gc (128, &gc);
+
+ /* how to format the ascii file representation of key */
+ const int bytes_per_line = 16;
+
+ /* open key file */
+ fd = platform_open (filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR);
+
+ if (fd == -1)
+ msg (M_ERR, "Cannot open shared secret file '%s' for write", filename);
+
+ buf_printf (&out, "%s\n", static_key_head);
+
+ for (i = 0; i < nkeys; ++i)
+ {
+ struct key key;
+ char* fmt;
+
+ /* generate random bits */
+ generate_key_random (&key, NULL);
+
+ /* format key as ascii */
+ fmt = format_hex_ex ((const uint8_t*)&key,
+ sizeof (key),
+ 0,
+ bytes_per_line,
+ "\n",
+ &gc);
+
+ /* increment random bits counter */
+ nbits += sizeof (key) * 8;
+
+ /* write to holding buffer */
+ buf_printf (&out, "%s\n", fmt);
+
+ /* zero memory which held key component (will be freed by GC) */
+ memset (fmt, 0, strlen(fmt));
+ CLEAR (key);
+ }
+
+ buf_printf (&out, "%s\n", static_key_foot);
+
+ /* write number of bits */
+ buf_printf (&nbits_head_text, "#\n# %d bit OpenVPN static key\n#\n", nbits);
+ buf_write_string_file (&nbits_head_text, filename, fd);
+
+ /* write key file, now formatted in out, to file */
+ buf_write_string_file (&out, filename, fd);
+
+ if (close (fd))
+ msg (M_ERR, "Close error on shared secret file %s", filename);
+
+ /* zero memory which held file content (memory will be freed by GC) */
+ buf_clear (&out);
+
+ /* pop our garbage collection level */
+ gc_free (&gc);
+
+ return nbits;
+}
+
+void
+must_have_n_keys (const char *filename, const char *option, const struct key2 *key2, int n)
+{
+ if (key2->n < n)
+ {
+#ifdef ENABLE_SMALL
+ msg (M_FATAL, "Key file '%s' used in --%s contains insufficient key material [keys found=%d required=%d]", filename, option, key2->n, n);
+#else
+ msg (M_FATAL, "Key file '%s' used in --%s contains insufficient key material [keys found=%d required=%d] -- try generating a new key file with '" PACKAGE " --genkey --secret [file]', or use the existing key file in bidirectional mode by specifying --%s without a key direction parameter", filename, option, key2->n, n, option);
+#endif
+ }
+}
+
+int
+ascii2keydirection (int msglevel, const char *str)
+{
+ if (!str)
+ return KEY_DIRECTION_BIDIRECTIONAL;
+ else if (!strcmp (str, "0"))
+ return KEY_DIRECTION_NORMAL;
+ else if (!strcmp (str, "1"))
+ return KEY_DIRECTION_INVERSE;
+ else
+ {
+ msg (msglevel, "Unknown key direction '%s' -- must be '0' or '1'", str);
+ return -1;
+ }
+ return KEY_DIRECTION_BIDIRECTIONAL; /* NOTREACHED */
+}
+
+const char *
+keydirection2ascii (int kd, bool remote)
+{
+ if (kd == KEY_DIRECTION_BIDIRECTIONAL)
+ return NULL;
+ else if (kd == KEY_DIRECTION_NORMAL)
+ return remote ? "1" : "0";
+ else if (kd == KEY_DIRECTION_INVERSE)
+ return remote ? "0" : "1";
+ else
+ {
+ ASSERT (0);
+ }
+ return NULL; /* NOTREACHED */
+}
+
+void
+key_direction_state_init (struct key_direction_state *kds, int key_direction)
+{
+ CLEAR (*kds);
+ switch (key_direction)
+ {
+ case KEY_DIRECTION_NORMAL:
+ kds->out_key = 0;
+ kds->in_key = 1;
+ kds->need_keys = 2;
+ break;
+ case KEY_DIRECTION_INVERSE:
+ kds->out_key = 1;
+ kds->in_key = 0;
+ kds->need_keys = 2;
+ break;
+ case KEY_DIRECTION_BIDIRECTIONAL:
+ kds->out_key = 0;
+ kds->in_key = 0;
+ kds->need_keys = 1;
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+void
+verify_fix_key2 (struct key2 *key2, const struct key_type *kt, const char *shared_secret_file)
+{
+ int i;
+
+ for (i = 0; i < key2->n; ++i)
+ {
+ /* Fix parity for DES keys and make sure not a weak key */
+ fixup_key (&key2->keys[i], kt);
+
+ /* This should be a very improbable failure */
+ if (!check_key (&key2->keys[i], kt))
+ msg (M_FATAL, "Key #%d in '%s' is bad. Try making a new key with --genkey.",
+ i+1, shared_secret_file);
+ }
+}
+
+/* given a key and key_type, write key to buffer */
+bool
+write_key (const struct key *key, const struct key_type *kt,
+ struct buffer *buf)
+{
+ ASSERT (kt->cipher_length <= MAX_CIPHER_KEY_LENGTH
+ && kt->hmac_length <= MAX_HMAC_KEY_LENGTH);
+
+ if (!buf_write (buf, &kt->cipher_length, 1))
+ return false;
+ if (!buf_write (buf, &kt->hmac_length, 1))
+ return false;
+ if (!buf_write (buf, key->cipher, kt->cipher_length))
+ return false;
+ if (!buf_write (buf, key->hmac, kt->hmac_length))
+ return false;
+
+ return true;
+}
+
+/*
+ * Given a key_type and buffer, read key from buffer.
+ * Return: 1 on success
+ * -1 read failure
+ * 0 on key length mismatch
+ */
+int
+read_key (struct key *key, const struct key_type *kt, struct buffer *buf)
+{
+ uint8_t cipher_length;
+ uint8_t hmac_length;
+
+ CLEAR (*key);
+ if (!buf_read (buf, &cipher_length, 1))
+ goto read_err;
+ if (!buf_read (buf, &hmac_length, 1))
+ goto read_err;
+
+ if (!buf_read (buf, key->cipher, cipher_length))
+ goto read_err;
+ if (!buf_read (buf, key->hmac, hmac_length))
+ goto read_err;
+
+ if (cipher_length != kt->cipher_length || hmac_length != kt->hmac_length)
+ goto key_len_err;
+
+ return 1;
+
+read_err:
+ msg (D_TLS_ERRORS, "TLS Error: error reading key from remote");
+ return -1;
+
+key_len_err:
+ msg (D_TLS_ERRORS,
+ "TLS Error: key length mismatch, local cipher/hmac %d/%d, remote cipher/hmac %d/%d",
+ kt->cipher_length, kt->hmac_length, cipher_length, hmac_length);
+ return 0;
+}
+
+/*
+ * Random number functions, used in cases where we want
+ * reasonably strong cryptographic random number generation
+ * without depleting our entropy pool. Used for random
+ * IV values and a number of other miscellaneous tasks.
+ */
+
+static uint8_t *nonce_data = NULL; /* GLOBAL */
+static const md_kt_t *nonce_md = NULL; /* GLOBAL */
+static int nonce_secret_len = 0; /* GLOBAL */
+
+/* Reset the nonce value, also done periodically to refresh entropy */
+static void
+prng_reset_nonce ()
+{
+ const int size = md_kt_size (nonce_md) + nonce_secret_len;
+#if 1 /* Must be 1 for real usage */
+ if (!rand_bytes (nonce_data, size))
+ msg (M_FATAL, "ERROR: Random number generator cannot obtain entropy for PRNG");
+#else
+ /* Only for testing -- will cause a predictable PRNG sequence */
+ {
+ int i;
+ for (i = 0; i < size; ++i)
+ nonce_data[i] = (uint8_t) i;
+ }
+#endif
+}
+
+void
+prng_init (const char *md_name, const int nonce_secret_len_parm)
+{
+ prng_uninit ();
+ nonce_md = md_name ? md_kt_get (md_name) : NULL;
+ if (nonce_md)
+ {
+ ASSERT (nonce_secret_len_parm >= NONCE_SECRET_LEN_MIN && nonce_secret_len_parm <= NONCE_SECRET_LEN_MAX);
+ nonce_secret_len = nonce_secret_len_parm;
+ {
+ const int size = md_kt_size(nonce_md) + nonce_secret_len;
+ dmsg (D_CRYPTO_DEBUG, "PRNG init md=%s size=%d", md_kt_name(nonce_md), size);
+ nonce_data = (uint8_t*) malloc (size);
+ check_malloc_return (nonce_data);
+ prng_reset_nonce();
+ }
+ }
+}
+
+void
+prng_uninit (void)
+{
+ free (nonce_data);
+ nonce_data = NULL;
+ nonce_md = NULL;
+ nonce_secret_len = 0;
+}
+
+void
+prng_bytes (uint8_t *output, int len)
+{
+ static size_t processed = 0;
+
+ if (nonce_md)
+ {
+ const int md_size = md_kt_size (nonce_md);
+ while (len > 0)
+ {
+ const int blen = min_int (len, md_size);
+ md_full(nonce_md, nonce_data, md_size + nonce_secret_len, nonce_data);
+ memcpy (output, nonce_data, blen);
+ output += blen;
+ len -= blen;
+
+ /* Ensure that random data is reset regularly */
+ processed += blen;
+ if(processed > PRNG_NONCE_RESET_BYTES) {
+ prng_reset_nonce();
+ processed = 0;
+ }
+ }
+ }
+ else
+ rand_bytes (output, len);
+}
+
+/* an analogue to the random() function, but use prng_bytes */
+long int
+get_random()
+{
+ long int l;
+ prng_bytes ((unsigned char *)&l, sizeof(l));
+ if (l < 0)
+ l = -l;
+ return l;
+}
+
+#ifndef ENABLE_SSL
+
+void
+init_ssl_lib (void)
+{
+ crypto_init_lib ();
+}
+
+void
+free_ssl_lib (void)
+{
+ crypto_uninit_lib ();
+ prng_uninit();
+}
+
+#endif /* ENABLE_SSL */
+
+/*
+ * md5 functions
+ */
+
+const char *
+md5sum (uint8_t *buf, int len, int n_print_chars, struct gc_arena *gc)
+{
+ uint8_t digest[MD5_DIGEST_LENGTH];
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+
+ md_full(md5_kt, buf, len, digest);
+
+ return format_hex (digest, MD5_DIGEST_LENGTH, n_print_chars, gc);
+}
+
+void
+md5_state_init (struct md5_state *s)
+{
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+
+ md_ctx_init(&s->ctx, md5_kt);
+}
+
+void
+md5_state_update (struct md5_state *s, void *data, size_t len)
+{
+ md_ctx_update(&s->ctx, data, len);
+}
+
+void
+md5_state_final (struct md5_state *s, struct md5_digest *out)
+{
+ md_ctx_final(&s->ctx, out->digest);
+ md_ctx_cleanup(&s->ctx);
+}
+
+void
+md5_digest_clear (struct md5_digest *digest)
+{
+ CLEAR (*digest);
+}
+
+bool
+md5_digest_defined (const struct md5_digest *digest)
+{
+ int i;
+ for (i = 0; i < MD5_DIGEST_LENGTH; ++i)
+ if (digest->digest[i])
+ return true;
+ return false;
+}
+
+bool
+md5_digest_equal (const struct md5_digest *d1, const struct md5_digest *d2)
+{
+ return memcmp(d1->digest, d2->digest, MD5_DIGEST_LENGTH) == 0;
+}
+
+#endif /* ENABLE_CRYPTO */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.h
new file mode 100644
index 00000000..3c4e59d7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto.h
@@ -0,0 +1,397 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography Module
+ */
+
+#ifndef CRYPTO_H
+#define CRYPTO_H
+
+#ifdef ENABLE_CRYPTO
+
+#include "crypto_backend.h"
+#include "basic.h"
+#include "buffer.h"
+#include "packet_id.h"
+#include "mtu.h"
+
+/*
+ * Defines a key type and key length for both cipher and HMAC.
+ */
+struct key_type
+{
+ uint8_t cipher_length; /**< Cipher length, in bytes */
+ uint8_t hmac_length; /**< HMAC length, in bytes */
+ const cipher_kt_t *cipher; /**< Cipher static parameters */
+ const md_kt_t *digest; /**< Message digest static parameters */
+};
+
+/**
+ * Container for unidirectional cipher and HMAC %key material.
+ * @ingroup control_processor
+ */
+struct key
+{
+ uint8_t cipher[MAX_CIPHER_KEY_LENGTH];
+ /**< %Key material for cipher operations. */
+ uint8_t hmac[MAX_HMAC_KEY_LENGTH];
+ /**< %Key material for HMAC operations. */
+};
+
+
+/**
+ * Container for one set of OpenSSL cipher and/or HMAC contexts.
+ * @ingroup control_processor
+ */
+struct key_ctx
+{
+ cipher_ctx_t *cipher; /**< Generic cipher %context. */
+ hmac_ctx_t *hmac; /**< Generic HMAC %context. */
+};
+
+#define KEY_DIRECTION_BIDIRECTIONAL 0 /* same keys for both directions */
+#define KEY_DIRECTION_NORMAL 1 /* encrypt with keys[0], decrypt with keys[1] */
+#define KEY_DIRECTION_INVERSE 2 /* encrypt with keys[1], decrypt with keys[0] */
+
+/**
+ * Container for bidirectional cipher and HMAC %key material.
+ * @ingroup control_processor
+ */
+struct key2
+{
+ int n; /**< The number of \c key objects stored
+ * in the \c key2.keys array. */
+ struct key keys[2]; /**< Two unidirectional sets of %key
+ * material. */
+};
+
+/**
+ * %Key ordering of the \c key2.keys array.
+ * @ingroup control_processor
+ *
+ * This structure takes care of correct ordering when using unidirectional
+ * or bidirectional %key material, and allows the same shared secret %key
+ * file to be loaded in the same way by client and server by having one of
+ * the hosts use an reversed ordering.
+ */
+struct key_direction_state
+{
+ int out_key; /**< Index into the \c key2.keys array for
+ * the sending direction. */
+ int in_key; /**< Index into the \c key2.keys array for
+ * the receiving direction. */
+ int need_keys; /**< The number of key objects necessary
+ * to support both sending and
+ * receiving.
+ *
+ * This will be 1 if the same keys are
+ * used in both directions, or 2 if
+ * there are two sets of unidirectional
+ * keys. */
+};
+
+/**
+ * Container for two sets of OpenSSL cipher and/or HMAC contexts for both
+ * sending and receiving directions.
+ * @ingroup control_processor
+ */
+struct key_ctx_bi
+{
+ struct key_ctx encrypt; /**< OpenSSL cipher and/or HMAC contexts
+ * for sending direction. */
+ struct key_ctx decrypt; /**< OpenSSL cipher and/or HMAC contexts
+ * for receiving direction. */
+};
+
+/**
+ * Security parameter state for processing data channel packets.
+ * @ingroup data_crypto
+ */
+struct crypto_options
+{
+ struct key_ctx_bi *key_ctx_bi;
+ /**< OpenSSL cipher and HMAC contexts for
+ * both sending and receiving
+ * directions. */
+ struct packet_id *packet_id; /**< Current packet ID state for both
+ * sending and receiving directions. */
+ struct packet_id_persist *pid_persist;
+ /**< Persistent packet ID state for
+ * keeping state between successive
+ * OpenVPN process startups. */
+
+# define CO_PACKET_ID_LONG_FORM (1<<0)
+ /**< Bit-flag indicating whether to use
+ * OpenVPN's long packet ID format. */
+# define CO_USE_IV (1<<1)
+ /**< Bit-flag indicating whether to
+ * generate a pseudo-random IV for each
+ * packet being encrypted. */
+# define CO_IGNORE_PACKET_ID (1<<2)
+ /**< Bit-flag indicating whether to ignore
+ * the packet ID of a received packet.
+ * This flag is used during processing
+ * of the first packet received from a
+ * client. */
+# define CO_MUTE_REPLAY_WARNINGS (1<<3)
+ /**< Bit-flag indicating not to display
+ * replay warnings. */
+ unsigned int flags; /**< Bit-flags determining behavior of
+ * security operation functions. */
+};
+
+#define RKF_MUST_SUCCEED (1<<0)
+#define RKF_INLINE (1<<1)
+void read_key_file (struct key2 *key2, const char *file, const unsigned int flags);
+
+int write_key_file (const int nkeys, const char *filename);
+
+int read_passphrase_hash (const char *passphrase_file,
+ const md_kt_t *digest,
+ uint8_t *output,
+ int len);
+
+void generate_key_random (struct key *key, const struct key_type *kt);
+
+void check_replay_iv_consistency(const struct key_type *kt, bool packet_id, bool use_iv);
+
+bool check_key (struct key *key, const struct key_type *kt);
+
+void fixup_key (struct key *key, const struct key_type *kt);
+
+bool write_key (const struct key *key, const struct key_type *kt,
+ struct buffer *buf);
+
+int read_key (struct key *key, const struct key_type *kt, struct buffer *buf);
+
+void init_key_type (struct key_type *kt, const char *ciphername,
+ bool ciphername_defined, const char *authname, bool authname_defined,
+ int keysize, bool cfb_ofb_allowed, bool warn);
+
+/*
+ * Key context functions
+ */
+
+void init_key_ctx (struct key_ctx *ctx, struct key *key,
+ const struct key_type *kt, int enc,
+ const char *prefix);
+
+void free_key_ctx (struct key_ctx *ctx);
+
+void free_key_ctx_bi (struct key_ctx_bi *ctx);
+
+
+/**************************************************************************/
+/** @name Functions for performing security operations on data channel packets
+ * @{ */
+
+/**
+ * Encrypt and HMAC sign a packet so that it can be sent as a data channel
+ * VPN tunnel packet to a remote OpenVPN peer.
+ * @ingroup data_crypto
+ *
+ * This function handles encryption and HMAC signing of a data channel
+ * packet before it is sent to its remote OpenVPN peer. It receives the
+ * necessary security parameters in the \a opt argument, which should have
+ * been set to the correct values by the \c tls_pre_encrypt() function.
+ *
+ * This function calls the \c EVP_Cipher* and \c HMAC_* functions of the
+ * OpenSSL library to perform the actual security operations.
+ *
+ * If an error occurs during processing, then the \a buf %buffer is set to
+ * empty.
+ *
+ * @param buf - The %buffer containing the packet on which to
+ * perform security operations.
+ * @param work - A working %buffer.
+ * @param opt - The security parameter state for this VPN tunnel.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ * @return This function returns void.\n On return, the \a buf argument
+ * will point to the resulting %buffer. This %buffer will either
+ * contain the processed packet ready for sending, or be empty if an
+ * error occurred.
+ */
+void openvpn_encrypt (struct buffer *buf, struct buffer work,
+ const struct crypto_options *opt,
+ const struct frame* frame);
+
+
+/**
+ * HMAC verify and decrypt a data channel packet received from a remote
+ * OpenVPN peer.
+ * @ingroup data_crypto
+ *
+ * This function handles authenticating and decrypting a data channel
+ * packet received from a remote OpenVPN peer. It receives the necessary
+ * security parameters in the \a opt argument, which should have been set
+ * to the correct values by the \c tls_pre_decrypt() function.
+ *
+ * This function calls the \c EVP_Cipher* and \c HMAC_* functions of the
+ * OpenSSL library to perform the actual security operations.
+ *
+ * If an error occurs during processing, then the \a buf %buffer is set to
+ * empty.
+ *
+ * @param buf - The %buffer containing the packet received from a
+ * remote OpenVPN peer on which to perform security
+ * operations.
+ * @param work - A working %buffer.
+ * @param opt - The security parameter state for this VPN tunnel.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ *
+ * @return
+ * @li True, if the packet was authenticated and decrypted successfully.
+ * @li False, if an error occurred. \n On return, the \a buf argument will
+ * point to the resulting %buffer. This %buffer will either contain
+ * the plaintext packet ready for further processing, or be empty if
+ * an error occurred.
+ */
+bool openvpn_decrypt (struct buffer *buf, struct buffer work,
+ const struct crypto_options *opt,
+ const struct frame* frame);
+
+
+bool crypto_test_hmac (struct buffer *buf, const struct crypto_options *opt);
+
+/** @} name Functions for performing security operations on data channel packets */
+
+void crypto_adjust_frame_parameters(struct frame *frame,
+ const struct key_type* kt,
+ bool cipher_defined,
+ bool use_iv,
+ bool packet_id,
+ bool packet_id_long_form);
+
+
+/* Minimum length of the nonce used by the PRNG */
+#define NONCE_SECRET_LEN_MIN 16
+
+/* Maximum length of the nonce used by the PRNG */
+#define NONCE_SECRET_LEN_MAX 64
+
+/** Number of bytes of random to allow before resetting the nonce */
+#define PRNG_NONCE_RESET_BYTES 1024
+
+/**
+ * Pseudo-random number generator initialisation.
+ * (see \c prng_rand_bytes())
+ *
+ * @param md_name Name of the message digest to use
+ * @param nonce_secret_len_param Length of the nonce to use
+ */
+void prng_init (const char *md_name, const int nonce_secret_len_parm);
+
+/*
+ * Message digest-based pseudo random number generator.
+ *
+ * If the PRNG was initialised with a certain message digest, uses the digest
+ * to calculate the next random number, and prevent depletion of the entropy
+ * pool.
+ *
+ * This PRNG is aimed at IV generation and similar miscellaneous tasks. Use
+ * \c rand_bytes() for higher-assurance functionality.
+ *
+ * Retrieves len bytes of pseudo random data, and places it in output.
+ *
+ * @param output Output buffer
+ * @param len Length of the output buffer
+ */
+void prng_bytes (uint8_t *output, int len);
+
+void prng_uninit ();
+
+void test_crypto (const struct crypto_options *co, struct frame* f);
+
+
+/* key direction functions */
+
+void key_direction_state_init (struct key_direction_state *kds, int key_direction);
+
+void verify_fix_key2 (struct key2 *key2, const struct key_type *kt, const char *shared_secret_file);
+
+void must_have_n_keys (const char *filename, const char *option, const struct key2 *key2, int n);
+
+int ascii2keydirection (int msglevel, const char *str);
+
+const char *keydirection2ascii (int kd, bool remote);
+
+/* print keys */
+void key2_print (const struct key2* k,
+ const struct key_type *kt,
+ const char* prefix0,
+ const char* prefix1);
+
+#ifdef ENABLE_SSL
+
+#define GHK_INLINE (1<<0)
+void get_tls_handshake_key (const struct key_type *key_type,
+ struct key_ctx_bi *ctx,
+ const char *passphrase_file,
+ const int key_direction,
+ const unsigned int flags);
+
+#else
+
+void init_ssl_lib (void);
+void free_ssl_lib (void);
+
+#endif /* ENABLE_SSL */
+
+/*
+ * md5 functions
+ */
+
+struct md5_state {
+ md_ctx_t ctx;
+};
+
+struct md5_digest {
+ uint8_t digest [MD5_DIGEST_LENGTH];
+};
+
+const char *md5sum(uint8_t *buf, int len, int n_print_chars, struct gc_arena *gc);
+void md5_state_init (struct md5_state *s);
+void md5_state_update (struct md5_state *s, void *data, size_t len);
+void md5_state_final (struct md5_state *s, struct md5_digest *out);
+void md5_digest_clear (struct md5_digest *digest);
+bool md5_digest_defined (const struct md5_digest *digest);
+bool md5_digest_equal (const struct md5_digest *d1, const struct md5_digest *d2);
+
+/*
+ * Inline functions
+ */
+
+static inline bool
+key_ctx_bi_defined(const struct key_ctx_bi* key)
+{
+ return key->encrypt.cipher || key->encrypt.hmac || key->decrypt.cipher || key->decrypt.hmac;
+}
+
+
+#endif /* ENABLE_CRYPTO */
+#endif /* CRYPTO_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_backend.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_backend.h
new file mode 100644
index 00000000..a48ad6c5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_backend.h
@@ -0,0 +1,530 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography SSL library-specific backend interface
+ */
+
+#ifndef CRYPTO_BACKEND_H_
+#define CRYPTO_BACKEND_H_
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include "crypto_openssl.h"
+#endif
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include "crypto_polarssl.h"
+#endif
+#include "basic.h"
+
+
+/*
+ * This routine should have additional OpenSSL crypto library initialisations
+ * used by both crypto and ssl components of OpenVPN.
+ */
+void crypto_init_lib (void);
+
+void crypto_uninit_lib (void);
+
+void crypto_clear_error (void);
+
+/*
+ * Initialise the given named crypto engine.
+ */
+void crypto_init_lib_engine (const char *engine_name);
+
+#ifdef DMALLOC
+/*
+ * OpenSSL memory debugging. If dmalloc debugging is enabled, tell
+ * OpenSSL to use our private malloc/realloc/free functions so that
+ * we can dispatch them to dmalloc.
+ */
+void crypto_init_dmalloc (void);
+#endif /* DMALLOC */
+
+/**
+ * Translate a data channel cipher name from the OpenVPN config file
+ * 'language' to the crypto library specific name.
+ */
+const char * translate_cipher_name_from_openvpn (const char *cipher_name);
+
+/**
+ * Translate a data channel cipher name from the crypto library specific name
+ * to the OpenVPN config file 'language'.
+ */
+const char * translate_cipher_name_from_openvpn (const char *cipher_name);
+
+void show_available_ciphers (void);
+
+void show_available_digests (void);
+
+void show_available_engines (void);
+
+/*
+ *
+ * Random number functions, used in cases where we want
+ * reasonably strong cryptographic random number generation
+ * without depleting our entropy pool. Used for random
+ * IV values and a number of other miscellaneous tasks.
+ *
+ */
+
+/**
+ * Wrapper for secure random number generator. Retrieves len bytes of random
+ * data, and places it in output.
+ *
+ * @param output Output buffer
+ * @param len Length of the output buffer, in bytes
+ *
+ * @return \c 1 on success, \c 0 on failure
+ */
+int rand_bytes (uint8_t *output, int len);
+
+/*
+ *
+ * Key functions, allow manipulation of keys.
+ *
+ */
+
+
+/**
+ * Return number of DES cblocks (1 cblock = length of a single-DES key) for the
+ * current key type or 0 if not a DES cipher.
+ *
+ * @param kt Type of key
+ *
+ * @return Number of DES cblocks that the key consists of, or 0.
+ */
+int key_des_num_cblocks (const cipher_kt_t *kt);
+
+/*
+ * Check the given DES key. Checks the given key's length, weakness and parity.
+ *
+ * @param key Key to check
+ * @param key_len Length of the key, in bytes
+ * @param ndc Number of DES cblocks that the key is made up of.
+ *
+ * @return \c true if the key is valid, \c false otherwise.
+ */
+bool key_des_check (uint8_t *key, int key_len, int ndc);
+
+/*
+ * Fix the given DES key, setting its parity to odd.
+ *
+ * @param key Key to check
+ * @param key_len Length of the key, in bytes
+ * @param ndc Number of DES cblocks that the key is made up of.
+ */
+void key_des_fixup (uint8_t *key, int key_len, int ndc);
+
+/**
+ * Encrypt the given block, using DES ECB mode
+ *
+ * @param key DES key to use.
+ * @param src Buffer containing the 8-byte source.
+ * @param dst Buffer containing the 8-byte destination
+ */
+void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH],
+ unsigned char src[DES_KEY_LENGTH],
+ unsigned char dst[DES_KEY_LENGTH]);
+
+/*
+ *
+ * Generic cipher key type functions
+ *
+ */
+/*
+ * Max size in bytes of any cipher key that might conceivably be used.
+ *
+ * This value is checked at compile time in crypto.c to make sure
+ * it is always at least EVP_MAX_KEY_LENGTH.
+ *
+ * We define our own value, since this parameter
+ * is used to control the size of static key files.
+ * If the OpenSSL library increases EVP_MAX_KEY_LENGTH,
+ * we don't want our key files to be suddenly rendered
+ * unusable.
+ */
+#define MAX_CIPHER_KEY_LENGTH 64
+
+/**
+ * Return cipher parameters, based on the given cipher name. The
+ * contents of these parameters are library-specific, and can be used to
+ * initialise encryption/decryption.
+ *
+ * @param ciphername Name of the cipher to retrieve parameters for (e.g.
+ * \c AES-128-CBC).
+ *
+ * @return A statically allocated structure containing parameters
+ * for the given cipher.
+ */
+const cipher_kt_t * cipher_kt_get (const char *ciphername);
+
+/**
+ * Retrieve a string describing the cipher (e.g. \c AES-128-CBC).
+ *
+ * @param cipher_kt Static cipher parameters
+ *
+ * @return a statically allocated string describing the cipher.
+ */
+const char * cipher_kt_name (const cipher_kt_t *cipher_kt);
+
+/**
+ * Returns the size of keys used by the cipher, in bytes. If the cipher has a
+ * variable key size, return the default key size.
+ *
+ * @param cipher_kt Static cipher parameters
+ *
+ * @return (Default) size of keys used by the cipher, in bytes.
+ */
+int cipher_kt_key_size (const cipher_kt_t *cipher_kt);
+
+/**
+ * Returns the size of the IV used by the cipher, in bytes, or 0 if no IV is
+ * used.
+ *
+ * @param cipher_kt Static cipher parameters
+ *
+ * @return Size of the IV, in bytes, or 0 if the cipher does not
+ * use an IV.
+ */
+int cipher_kt_iv_size (const cipher_kt_t *cipher_kt);
+
+/**
+ * Returns the block size of the cipher, in bytes.
+ *
+ * @param cipher_kt Static cipher parameters
+ *
+ * @return Block size, in bytes.
+ */
+int cipher_kt_block_size (const cipher_kt_t *cipher_kt);
+
+/**
+ * Returns the mode that the cipher runs in.
+ *
+ * @param cipher_kt Static cipher parameters
+ *
+ * @return Cipher mode, either \c OPENVPN_MODE_CBC, \c
+ * OPENVPN_MODE_OFB or \c OPENVPN_MODE_CFB
+ */
+int cipher_kt_mode (const cipher_kt_t *cipher_kt);
+
+/**
+ * Check of the supplied cipher is a supported CBC mode cipher.
+ *
+ * @param cipher Static cipher parameters. May not be NULL.
+ *
+ * @return true iff the cipher is a CBC mode cipher.
+ */
+bool cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+ __attribute__((nonnull));
+
+/**
+ * Check of the supplied cipher is a supported OFB or CFB mode cipher.
+ *
+ * @param cipher Static cipher parameters. May not be NULL.
+ *
+ * @return true iff the cipher is a OFB or CFB mode cipher.
+ */
+bool cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+ __attribute__((nonnull));
+
+
+/**
+ *
+ * Generic cipher functions
+ *
+ */
+
+/**
+ * Initialise a cipher context, based on the given key and key type.
+ *
+ * @param ctx Cipher context. May not be NULL
+ * @param key Buffer containing the key to use
+ * @param key_len Length of the key, in bytes
+ * @param kt Static cipher parameters to use
+ * @param enc Whether to encrypt or decrypt (either
+ * \c POLARSSL_OP_ENCRYPT or \c POLARSSL_OP_DECRYPT).
+ */
+void cipher_ctx_init (cipher_ctx_t *ctx, uint8_t *key, int key_len,
+ const cipher_kt_t *kt, int enc);
+
+/**
+ * Cleanup the specified context.
+ *
+ * @param ctx Cipher context to cleanup.
+ */
+void cipher_ctx_cleanup (cipher_ctx_t *ctx);
+
+/**
+ * Returns the size of the IV used by the cipher, in bytes, or 0 if no IV is
+ * used.
+ *
+ * @param ctx The cipher's context
+ *
+ * @return Size of the IV, in bytes, or \c 0 if the cipher does not
+ * use an IV or ctx was NULL.
+ */
+int cipher_ctx_iv_length (const cipher_ctx_t *ctx);
+
+/**
+ * Returns the block size of the cipher, in bytes.
+ *
+ * @param ctx The cipher's context
+ *
+ * @return Block size, in bytes, or 0 if ctx was NULL.
+ */
+int cipher_ctx_block_size (const cipher_ctx_t *ctx);
+
+/**
+ * Returns the mode that the cipher runs in.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ *
+ * @return Cipher mode, either \c OPENVPN_MODE_CBC, \c
+ * OPENVPN_MODE_OFB or \c OPENVPN_MODE_CFB
+ */
+int cipher_ctx_mode (const cipher_ctx_t *ctx);
+
+/**
+ * Returns the static cipher parameters for this context.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ *
+ * @return Static cipher parameters for the supplied context.
+ */
+const cipher_kt_t *cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+ __attribute__((nonnull));
+
+/**
+ * Resets the given cipher context, setting the IV to the specified value.
+ * Preserves the associated key information.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ * @param iv_buf The IV to use.
+ *
+ * @return \c 0 on failure, \c 1 on success.
+ */
+int cipher_ctx_reset (cipher_ctx_t *ctx, uint8_t *iv_buf);
+
+/**
+ * Updates the given cipher context, encrypting data in the source buffer, and
+ * placing any complete blocks in the destination buffer.
+ *
+ * Note that if a complete block cannot be written, data is cached in the
+ * context, and emitted at a later call to \c cipher_ctx_update, or by a call
+ * to \c cipher_ctx_final(). This implies that dst should have enough room for
+ * src_len + \c cipher_ctx_block_size() - 1.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ * @param dst Destination buffer
+ * @param dst_len Length of the destination buffer, in bytes
+ * @param src Source buffer
+ * @param src_len Length of the source buffer, in bytes
+ *
+ * @return \c 0 on failure, \c 1 on success.
+ */
+int cipher_ctx_update (cipher_ctx_t *ctx, uint8_t *dst, int *dst_len,
+ uint8_t *src, int src_len);
+
+/**
+ * Pads the final cipher block using PKCS padding, and output to the destination
+ * buffer.
+ *
+ * @param ctx Cipher's context. May not be NULL.
+ * @param dst Destination buffer
+ * @param dst_len Length of the destination buffer, in bytes
+ *
+ * @return \c 0 on failure, \c 1 on success.
+ */
+int cipher_ctx_final (cipher_ctx_t *ctx, uint8_t *dst, int *dst_len);
+
+/*
+ *
+ * Generic message digest information functions
+ *
+ */
+
+/*
+ * Max size in bytes of any HMAC key that might conceivably be used.
+ *
+ * This value is checked at compile time in crypto.c to make sure
+ * it is always at least EVP_MAX_MD_SIZE. We define our own value
+ * for the same reason as above.
+ */
+#define MAX_HMAC_KEY_LENGTH 64
+
+/**
+ * Return message digest parameters, based on the given digest name. The
+ * contents of these parameters are library-specific, and can be used to
+ * initialise HMAC or message digest operations.
+ *
+ * @param digest Name of the digest to retrieve parameters for (e.g.
+ * \c MD5).
+ *
+ * @return A statically allocated structure containing parameters
+ * for the given message digest.
+ */
+const md_kt_t * md_kt_get (const char *digest);
+
+/**
+ * Retrieve a string describing the digest digest (e.g. \c SHA1).
+ *
+ * @param kt Static message digest parameters
+ *
+ * @return Statically allocated string describing the message
+ * digest.
+ */
+const char * md_kt_name (const md_kt_t *kt);
+
+/**
+ * Returns the size of the message digest, in bytes.
+ *
+ * @param kt Static message digest parameters
+ *
+ * @return Message digest size, in bytes, or 0 if ctx was NULL.
+ */
+int md_kt_size (const md_kt_t *kt);
+
+
+/*
+ *
+ * Generic message digest functions
+ *
+ */
+
+/*
+ * Calculates the message digest for the given buffer.
+ *
+ * @param kt Static message digest parameters
+ * @param src Buffer to digest. May not be NULL.
+ * @param src_len The length of the incoming buffer.
+ * @param dst Buffer to write the message digest to. May not be NULL.
+ *
+ * @return \c 1 on success, \c 0 on failure
+ */
+int md_full (const md_kt_t *kt, const uint8_t *src, int src_len, uint8_t *dst);
+
+/*
+ * Initialises the given message digest context.
+ *
+ * @param ctx Message digest context
+ * @param kt Static message digest parameters
+ */
+void md_ctx_init (md_ctx_t *ctx, const md_kt_t *kt);
+
+/*
+ * Free the given message digest context.
+ *
+ * @param ctx Message digest context
+ */
+void md_ctx_cleanup(md_ctx_t *ctx);
+
+/*
+ * Returns the size of the message digest output by the given context
+ *
+ * @param ctx Message digest context.
+ *
+ * @return Size of the message digest, or \0 if ctx is NULL.
+ */
+int md_ctx_size (const md_ctx_t *ctx);
+
+/*
+ * Process the given data for use in the message digest.
+ *
+ * @param ctx Message digest context. May not be NULL.
+ * @param src Buffer to digest. May not be NULL.
+ * @param src_len The length of the incoming buffer.
+ */
+void md_ctx_update (md_ctx_t *ctx, const uint8_t *src, int src_len);
+
+/*
+ * Output the message digest to the given buffer.
+ *
+ * @param ctx Message digest context. May not be NULL.
+ * @param dst Buffer to write the message digest to. May not be NULL.
+ */
+void md_ctx_final (md_ctx_t *ctx, uint8_t *dst);
+
+
+/*
+ *
+ * Generic HMAC functions
+ *
+ */
+
+/*
+ * Initialises the given HMAC context, using the given digest
+ * and key.
+ *
+ * @param ctx HMAC context to intialise
+ * @param key The key to use for the HMAC
+ * @param key_len The key length to use
+ * @param kt Static message digest parameters
+ *
+ */
+void hmac_ctx_init (hmac_ctx_t *ctx, const uint8_t *key, int key_length,
+ const md_kt_t *kt);
+
+/*
+ * Free the given HMAC context.
+ *
+ * @param ctx HMAC context
+ */
+void hmac_ctx_cleanup(hmac_ctx_t *ctx);
+
+/*
+ * Returns the size of the HMAC output by the given HMAC Context
+ *
+ * @param ctx HMAC context.
+ *
+ * @return Size of the HMAC, or \0 if ctx is NULL.
+ */
+int hmac_ctx_size (const hmac_ctx_t *ctx);
+
+/*
+ * Resets the given HMAC context, preserving the associated key information
+ *
+ * @param ctx HMAC context. May not be NULL.
+ */
+void hmac_ctx_reset (hmac_ctx_t *ctx);
+
+/*
+ * Process the given data for use in the HMAC.
+ *
+ * @param ctx HMAC context. May not be NULL.
+ * @param src The buffer to HMAC. May not be NULL.
+ * @param src_len The length of the incoming buffer.
+ */
+void hmac_ctx_update (hmac_ctx_t *ctx, const uint8_t *src, int src_len);
+
+/*
+ * Output the HMAC to the given buffer.
+ *
+ * @param ctx HMAC context. May not be NULL.
+ * @param dst buffer to write the HMAC to. May not be NULL.
+ */
+void hmac_ctx_final (hmac_ctx_t *ctx, uint8_t *dst);
+
+#endif /* CRYPTO_BACKEND_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.c
new file mode 100644
index 00000000..0ac89a19
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.c
@@ -0,0 +1,750 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography OpenSSL-specific backend interface
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL)
+
+#include "basic.h"
+#include "buffer.h"
+#include "integer.h"
+#include "crypto.h"
+#include "crypto_backend.h"
+#include <openssl/objects.h>
+#include <openssl/evp.h>
+#include <openssl/des.h>
+
+/*
+ * Check for key size creepage.
+ */
+
+#if MAX_CIPHER_KEY_LENGTH < EVP_MAX_KEY_LENGTH
+#warning Some OpenSSL EVP ciphers now support key lengths greater than MAX_CIPHER_KEY_LENGTH -- consider increasing MAX_CIPHER_KEY_LENGTH
+#endif
+
+#if MAX_HMAC_KEY_LENGTH < EVP_MAX_MD_SIZE
+#warning Some OpenSSL HMAC message digests now support key lengths greater than MAX_HMAC_KEY_LENGTH -- consider increasing MAX_HMAC_KEY_LENGTH
+#endif
+
+#if HAVE_OPENSSL_ENGINE
+#include <openssl/engine.h>
+
+static bool engine_initialized = false; /* GLOBAL */
+
+static ENGINE *engine_persist = NULL; /* GLOBAL */
+
+/* Try to load an engine in a shareable library */
+static ENGINE *
+try_load_engine (const char *engine)
+{
+ ENGINE *e = ENGINE_by_id ("dynamic");
+ if (e)
+ {
+ if (!ENGINE_ctrl_cmd_string (e, "SO_PATH", engine, 0)
+ || !ENGINE_ctrl_cmd_string (e, "LOAD", NULL, 0))
+ {
+ ENGINE_free (e);
+ e = NULL;
+ }
+ }
+ return e;
+}
+
+static ENGINE *
+setup_engine (const char *engine)
+{
+ ENGINE *e = NULL;
+
+ ENGINE_load_builtin_engines ();
+
+ if (engine)
+ {
+ if (strcmp (engine, "auto") == 0)
+ {
+ msg (M_INFO, "Initializing OpenSSL auto engine support");
+ ENGINE_register_all_complete ();
+ return NULL;
+ }
+ if ((e = ENGINE_by_id (engine)) == NULL
+ && (e = try_load_engine (engine)) == NULL)
+ {
+ msg (M_FATAL, "OpenSSL error: cannot load engine '%s'", engine);
+ }
+
+ if (!ENGINE_set_default (e, ENGINE_METHOD_ALL))
+ {
+ msg (M_FATAL, "OpenSSL error: ENGINE_set_default failed on engine '%s'",
+ engine);
+ }
+
+ msg (M_INFO, "Initializing OpenSSL support for engine '%s'",
+ ENGINE_get_id (e));
+ }
+ return e;
+}
+
+#endif /* HAVE_OPENSSL_ENGINE */
+
+void
+crypto_init_lib_engine (const char *engine_name)
+{
+#if HAVE_OPENSSL_ENGINE
+ if (!engine_initialized)
+ {
+ ASSERT (engine_name);
+ ASSERT (!engine_persist);
+ engine_persist = setup_engine (engine_name);
+ engine_initialized = true;
+ }
+#else
+ msg (M_WARN, "Note: OpenSSL hardware crypto engine functionality is not available");
+#endif
+}
+
+/*
+ *
+ * Functions related to the core crypto library
+ *
+ */
+
+void
+crypto_init_lib (void)
+{
+#ifndef ENABLE_SSL
+ /* If SSL is enabled init is taken care of in ssl_openssl.c */
+#ifndef ENABLE_SMALL
+ ERR_load_crypto_strings ();
+#endif
+ OpenSSL_add_all_algorithms ();
+#endif
+
+ /*
+ * If you build the OpenSSL library and OpenVPN with
+ * CRYPTO_MDEBUG, you will get a listing of OpenSSL
+ * memory leaks on program termination.
+ */
+
+#ifdef CRYPTO_MDEBUG
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+#endif
+}
+
+void
+crypto_uninit_lib (void)
+{
+#ifndef ENABLE_SSL
+ /* If SSL is enabled cleanup is taken care of in ssl_openssl.c */
+ EVP_cleanup ();
+#ifndef ENABLE_SMALL
+ ERR_free_strings ();
+#endif
+#endif
+
+#ifdef CRYPTO_MDEBUG
+ FILE* fp = fopen ("sdlog", "w");
+ ASSERT (fp);
+ CRYPTO_mem_leaks_fp (fp);
+ fclose (fp);
+#endif
+
+#if HAVE_OPENSSL_ENGINE
+ if (engine_initialized)
+ {
+ ENGINE_cleanup ();
+ engine_persist = NULL;
+ engine_initialized = false;
+ }
+#endif
+}
+
+void
+crypto_clear_error (void)
+{
+ ERR_clear_error ();
+}
+
+/*
+ *
+ * OpenSSL memory debugging. If dmalloc debugging is enabled, tell
+ * OpenSSL to use our private malloc/realloc/free functions so that
+ * we can dispatch them to dmalloc.
+ *
+ */
+
+#ifdef DMALLOC
+static void *
+crypto_malloc (size_t size, const char *file, int line)
+{
+ return dmalloc_malloc(file, line, size, DMALLOC_FUNC_MALLOC, 0, 0);
+}
+
+static void *
+crypto_realloc (void *ptr, size_t size, const char *file, int line)
+{
+ return dmalloc_realloc(file, line, ptr, size, DMALLOC_FUNC_REALLOC, 0);
+}
+
+static void
+crypto_free (void *ptr)
+{
+ dmalloc_free (__FILE__, __LINE__, ptr, DMALLOC_FUNC_FREE);
+}
+
+void
+crypto_init_dmalloc (void)
+{
+ CRYPTO_set_mem_ex_functions (crypto_malloc,
+ crypto_realloc,
+ crypto_free);
+}
+#endif /* DMALLOC */
+
+const char *
+translate_cipher_name_from_openvpn (const char *cipher_name) {
+ // OpenSSL doesn't require any translation
+ return cipher_name;
+}
+
+const char *
+translate_cipher_name_to_openvpn (const char *cipher_name) {
+ // OpenSSL doesn't require any translation
+ return cipher_name;
+}
+
+void
+show_available_ciphers ()
+{
+ int nid;
+
+#ifndef ENABLE_SMALL
+ printf ("The following ciphers and cipher modes are available\n"
+ "for use with " PACKAGE_NAME ". Each cipher shown below may be\n"
+ "used as a parameter to the --cipher option. The default\n"
+ "key size is shown as well as whether or not it can be\n"
+ "changed with the --keysize directive. Using a CBC mode\n"
+ "is recommended. In static key mode only CBC mode is allowed.\n\n");
+#endif
+
+ for (nid = 0; nid < 10000; ++nid) /* is there a better way to get the size of the nid list? */
+ {
+ const EVP_CIPHER *cipher = EVP_get_cipherbynid (nid);
+ if (cipher)
+ {
+ if (cipher_kt_mode_cbc(cipher)
+#ifdef ENABLE_OFB_CFB_MODE
+ || cipher_kt_mode_ofb_cfb(cipher)
+#endif
+ )
+ {
+ const char *var_key_size =
+ (EVP_CIPHER_flags (cipher) & EVP_CIPH_VARIABLE_LENGTH) ?
+ "variable" : "fixed";
+ const char *ssl_only = cipher_kt_mode_ofb_cfb(cipher) ?
+ " (TLS client/server mode)" : "";
+
+ printf ("%s %d bit default key (%s)%s\n", OBJ_nid2sn (nid),
+ EVP_CIPHER_key_length (cipher) * 8, var_key_size,
+ ssl_only);
+ }
+ }
+ }
+ printf ("\n");
+}
+
+void
+show_available_digests ()
+{
+ int nid;
+
+#ifndef ENABLE_SMALL
+ printf ("The following message digests are available for use with\n"
+ PACKAGE_NAME ". A message digest is used in conjunction with\n"
+ "the HMAC function, to authenticate received packets.\n"
+ "You can specify a message digest as parameter to\n"
+ "the --auth option.\n\n");
+#endif
+
+ for (nid = 0; nid < 10000; ++nid)
+ {
+ const EVP_MD *digest = EVP_get_digestbynid (nid);
+ if (digest)
+ {
+ printf ("%s %d bit digest size\n",
+ OBJ_nid2sn (nid), EVP_MD_size (digest) * 8);
+ }
+ }
+ printf ("\n");
+}
+
+void
+show_available_engines ()
+{
+#if HAVE_OPENSSL_ENGINE /* Only defined for OpenSSL */
+ ENGINE *e;
+
+ printf ("OpenSSL Crypto Engines\n\n");
+
+ ENGINE_load_builtin_engines ();
+
+ e = ENGINE_get_first ();
+ while (e)
+ {
+ printf ("%s [%s]\n",
+ ENGINE_get_name (e),
+ ENGINE_get_id (e));
+ e = ENGINE_get_next (e);
+ }
+ ENGINE_cleanup ();
+#else
+ printf ("Sorry, OpenSSL hardware crypto engine functionality is not available.\n");
+#endif
+}
+
+/*
+ *
+ * Random number functions, used in cases where we want
+ * reasonably strong cryptographic random number generation
+ * without depleting our entropy pool. Used for random
+ * IV values and a number of other miscellaneous tasks.
+ *
+ */
+
+int rand_bytes(uint8_t *output, int len)
+{
+ return RAND_bytes (output, len);
+}
+
+/*
+ *
+ * Key functions, allow manipulation of keys.
+ *
+ */
+
+
+int
+key_des_num_cblocks (const EVP_CIPHER *kt)
+{
+ int ret = 0;
+ const char *name = OBJ_nid2sn (EVP_CIPHER_nid (kt));
+ if (name)
+ {
+ if (!strncmp (name, "DES-", 4))
+ {
+ ret = EVP_CIPHER_key_length (kt) / sizeof (DES_cblock);
+ }
+ else if (!strncmp (name, "DESX-", 5))
+ {
+ ret = 1;
+ }
+ }
+ dmsg (D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret);
+ return ret;
+}
+
+bool
+key_des_check (uint8_t *key, int key_len, int ndc)
+{
+ int i;
+ struct buffer b;
+
+ buf_set_read (&b, key, key_len);
+
+ for (i = 0; i < ndc; ++i)
+ {
+ DES_cblock *dc = (DES_cblock*) buf_read_alloc (&b, sizeof (DES_cblock));
+ if (!dc)
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: insufficient key material");
+ goto err;
+ }
+ if (DES_is_weak_key(dc))
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: weak key detected");
+ goto err;
+ }
+ if (!DES_check_key_parity (dc))
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: bad parity detected");
+ goto err;
+ }
+ }
+ return true;
+
+ err:
+ ERR_clear_error ();
+ return false;
+}
+
+void
+key_des_fixup (uint8_t *key, int key_len, int ndc)
+{
+ int i;
+ struct buffer b;
+
+ buf_set_read (&b, key, key_len);
+ for (i = 0; i < ndc; ++i)
+ {
+ DES_cblock *dc = (DES_cblock*) buf_read_alloc(&b, sizeof(DES_cblock));
+ if (!dc)
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: fixup_key_DES: insufficient key material");
+ ERR_clear_error ();
+ return;
+ }
+ DES_set_odd_parity (dc);
+ }
+}
+
+
+/*
+ *
+ * Generic cipher key type functions
+ *
+ */
+
+
+const EVP_CIPHER *
+cipher_kt_get (const char *ciphername)
+{
+ const EVP_CIPHER *cipher = NULL;
+
+ ASSERT (ciphername);
+
+ cipher = EVP_get_cipherbyname (ciphername);
+
+ if (NULL == cipher)
+ msg (M_SSLERR, "Cipher algorithm '%s' not found", ciphername);
+
+ if (EVP_CIPHER_key_length (cipher) > MAX_CIPHER_KEY_LENGTH)
+ msg (M_FATAL, "Cipher algorithm '%s' uses a default key size (%d bytes) which is larger than " PACKAGE_NAME "'s current maximum key size (%d bytes)",
+ ciphername,
+ EVP_CIPHER_key_length (cipher),
+ MAX_CIPHER_KEY_LENGTH);
+
+ return cipher;
+}
+
+const char *
+cipher_kt_name (const EVP_CIPHER *cipher_kt)
+{
+ if (NULL == cipher_kt)
+ return "[null-cipher]";
+ return EVP_CIPHER_name (cipher_kt);
+}
+
+int
+cipher_kt_key_size (const EVP_CIPHER *cipher_kt)
+{
+ return EVP_CIPHER_key_length (cipher_kt);
+}
+
+int
+cipher_kt_iv_size (const EVP_CIPHER *cipher_kt)
+{
+ return EVP_CIPHER_iv_length (cipher_kt);
+}
+
+int
+cipher_kt_block_size (const EVP_CIPHER *cipher_kt)
+{
+ return EVP_CIPHER_block_size (cipher_kt);
+}
+
+int
+cipher_kt_mode (const EVP_CIPHER *cipher_kt)
+{
+ ASSERT(NULL != cipher_kt);
+ return EVP_CIPHER_mode (cipher_kt);
+}
+
+bool
+cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+{
+ return cipher_kt_mode(cipher) == OPENVPN_MODE_CBC
+#ifdef EVP_CIPH_FLAG_AEAD_CIPHER
+ /* Exclude AEAD cipher modes, they require a different API */
+ && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
+#endif
+ ;
+}
+
+bool
+cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+{
+ return (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
+ cipher_kt_mode(cipher) == OPENVPN_MODE_CFB)
+#ifdef EVP_CIPH_FLAG_AEAD_CIPHER
+ /* Exclude AEAD cipher modes, they require a different API */
+ && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
+#endif
+ ;
+}
+
+/*
+ *
+ * Generic cipher context functions
+ *
+ */
+
+
+void
+cipher_ctx_init (EVP_CIPHER_CTX *ctx, uint8_t *key, int key_len,
+ const EVP_CIPHER *kt, int enc)
+{
+ ASSERT(NULL != kt && NULL != ctx);
+
+ CLEAR (*ctx);
+
+ EVP_CIPHER_CTX_init (ctx);
+ if (!EVP_CipherInit (ctx, kt, NULL, NULL, enc))
+ msg (M_SSLERR, "EVP cipher init #1");
+#ifdef HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH
+ if (!EVP_CIPHER_CTX_set_key_length (ctx, key_len))
+ msg (M_SSLERR, "EVP set key size");
+#endif
+ if (!EVP_CipherInit (ctx, NULL, key, NULL, enc))
+ msg (M_SSLERR, "EVP cipher init #2");
+
+ /* make sure we used a big enough key */
+ ASSERT (EVP_CIPHER_CTX_key_length (ctx) <= key_len);
+}
+
+void
+cipher_ctx_cleanup (EVP_CIPHER_CTX *ctx)
+{
+ EVP_CIPHER_CTX_cleanup (ctx);
+}
+
+int
+cipher_ctx_iv_length (const EVP_CIPHER_CTX *ctx)
+{
+ return EVP_CIPHER_CTX_iv_length (ctx);
+}
+
+int
+cipher_ctx_block_size(const EVP_CIPHER_CTX *ctx)
+{
+ return EVP_CIPHER_CTX_block_size (ctx);
+}
+
+int
+cipher_ctx_mode (const EVP_CIPHER_CTX *ctx)
+{
+ return EVP_CIPHER_CTX_mode (ctx);
+}
+
+const cipher_kt_t *
+cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+{
+ return EVP_CIPHER_CTX_cipher(ctx);
+}
+
+
+int
+cipher_ctx_reset (EVP_CIPHER_CTX *ctx, uint8_t *iv_buf)
+{
+ return EVP_CipherInit (ctx, NULL, NULL, iv_buf, -1);
+}
+
+int
+cipher_ctx_update (EVP_CIPHER_CTX *ctx, uint8_t *dst, int *dst_len,
+ uint8_t *src, int src_len)
+{
+ return EVP_CipherUpdate (ctx, dst, dst_len, src, src_len);
+}
+
+int
+cipher_ctx_final (EVP_CIPHER_CTX *ctx, uint8_t *dst, int *dst_len)
+{
+ return EVP_CipherFinal (ctx, dst, dst_len);
+}
+
+
+void
+cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH],
+ unsigned char *src,
+ unsigned char *dst)
+{
+ DES_key_schedule sched;
+
+ DES_set_key_unchecked((DES_cblock*)key, &sched);
+ DES_ecb_encrypt((DES_cblock *)src, (DES_cblock *)dst, &sched, DES_ENCRYPT);
+}
+
+/*
+ *
+ * Generic message digest information functions
+ *
+ */
+
+
+const EVP_MD *
+md_kt_get (const char *digest)
+{
+ const EVP_MD *md = NULL;
+ ASSERT (digest);
+ md = EVP_get_digestbyname (digest);
+ if (!md)
+ msg (M_SSLERR, "Message hash algorithm '%s' not found", digest);
+ if (EVP_MD_size (md) > MAX_HMAC_KEY_LENGTH)
+ msg (M_FATAL, "Message hash algorithm '%s' uses a default hash size (%d bytes) which is larger than " PACKAGE_NAME "'s current maximum hash size (%d bytes)",
+ digest,
+ EVP_MD_size (md),
+ MAX_HMAC_KEY_LENGTH);
+ return md;
+}
+
+const char *
+md_kt_name (const EVP_MD *kt)
+{
+ if (NULL == kt)
+ return "[null-digest]";
+ return EVP_MD_name (kt);
+}
+
+int
+md_kt_size (const EVP_MD *kt)
+{
+ return EVP_MD_size(kt);
+}
+
+
+/*
+ *
+ * Generic message digest functions
+ *
+ */
+
+int
+md_full (const EVP_MD *kt, const uint8_t *src, int src_len, uint8_t *dst)
+{
+ unsigned int in_md_len = 0;
+
+ return EVP_Digest(src, src_len, dst, &in_md_len, kt, NULL);
+}
+
+void
+md_ctx_init (EVP_MD_CTX *ctx, const EVP_MD *kt)
+{
+ ASSERT(NULL != ctx && NULL != kt);
+
+ CLEAR (*ctx);
+
+ EVP_MD_CTX_init (ctx);
+ EVP_DigestInit(ctx, kt);
+}
+
+void
+md_ctx_cleanup(EVP_MD_CTX *ctx)
+{
+ EVP_MD_CTX_cleanup(ctx);
+}
+
+int
+md_ctx_size (const EVP_MD_CTX *ctx)
+{
+ return EVP_MD_CTX_size(ctx);
+}
+
+void
+md_ctx_update (EVP_MD_CTX *ctx, const uint8_t *src, int src_len)
+{
+ EVP_DigestUpdate(ctx, src, src_len);
+}
+
+void
+md_ctx_final (EVP_MD_CTX *ctx, uint8_t *dst)
+{
+ unsigned int in_md_len = 0;
+
+ EVP_DigestFinal(ctx, dst, &in_md_len);
+}
+
+
+/*
+ *
+ * Generic HMAC functions
+ *
+ */
+
+
+void
+hmac_ctx_init (HMAC_CTX *ctx, const uint8_t *key, int key_len,
+ const EVP_MD *kt)
+{
+ ASSERT(NULL != kt && NULL != ctx);
+
+ CLEAR(*ctx);
+
+ HMAC_CTX_init (ctx);
+ HMAC_Init_ex (ctx, key, key_len, kt, NULL);
+
+ /* make sure we used a big enough key */
+ ASSERT (HMAC_size (ctx) <= key_len);
+}
+
+void
+hmac_ctx_cleanup(HMAC_CTX *ctx)
+{
+ HMAC_CTX_cleanup (ctx);
+}
+
+int
+hmac_ctx_size (const HMAC_CTX *ctx)
+{
+ return HMAC_size (ctx);
+}
+
+void
+hmac_ctx_reset (HMAC_CTX *ctx)
+{
+ HMAC_Init_ex (ctx, NULL, 0, NULL, NULL);
+}
+
+void
+hmac_ctx_update (HMAC_CTX *ctx, const uint8_t *src, int src_len)
+{
+ HMAC_Update (ctx, src, src_len);
+}
+
+void
+hmac_ctx_final (HMAC_CTX *ctx, uint8_t *dst)
+{
+ unsigned int in_hmac_len = 0;
+
+ HMAC_Final (ctx, dst, &in_hmac_len);
+}
+
+#endif /* ENABLE_CRYPTO && ENABLE_CRYPTO_OPENSSL */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.h
new file mode 100644
index 00000000..f883c2a5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_openssl.h
@@ -0,0 +1,73 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography OpenSSL-specific backend interface
+ */
+
+#ifndef CRYPTO_OPENSSL_H_
+#define CRYPTO_OPENSSL_H_
+
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#include <openssl/md5.h>
+
+/** Generic cipher key type %context. */
+typedef EVP_CIPHER cipher_kt_t;
+
+/** Generic message digest key type %context. */
+typedef EVP_MD md_kt_t;
+
+/** Generic cipher %context. */
+typedef EVP_CIPHER_CTX cipher_ctx_t;
+
+/** Generic message digest %context. */
+typedef EVP_MD_CTX md_ctx_t;
+
+/** Generic HMAC %context. */
+typedef HMAC_CTX hmac_ctx_t;
+
+/** Maximum length of an IV */
+#define OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH
+
+/** Cipher is in CBC mode */
+#define OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE
+
+/** Cipher is in OFB mode */
+#define OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE
+
+/** Cipher is in CFB mode */
+#define OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE
+
+/** Cipher should encrypt */
+#define OPENVPN_OP_ENCRYPT 1
+
+/** Cipher should decrypt */
+#define OPENVPN_OP_DECRYPT 0
+
+#define DES_KEY_LENGTH 8
+#define MD4_DIGEST_LENGTH 16
+
+#endif /* CRYPTO_OPENSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.c
new file mode 100644
index 00000000..1a986dbd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.c
@@ -0,0 +1,682 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography PolarSSL-specific backend interface
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_POLARSSL)
+
+#include "errlevel.h"
+#include "basic.h"
+#include "buffer.h"
+#include "integer.h"
+#include "crypto_backend.h"
+#include "otime.h"
+#include "misc.h"
+
+#include <polarssl/des.h>
+#include <polarssl/md5.h>
+#include <polarssl/cipher.h>
+#include <polarssl/havege.h>
+
+#include <polarssl/entropy.h>
+
+/*
+ *
+ * Hardware engine support. Allows loading/unloading of engines.
+ *
+ */
+
+void
+crypto_init_lib_engine (const char *engine_name)
+{
+ msg (M_WARN, "Note: PolarSSL hardware crypto engine functionality is not "
+ "available");
+}
+
+/*
+ *
+ * Functions related to the core crypto library
+ *
+ */
+
+void
+crypto_init_lib (void)
+{
+}
+
+void
+crypto_uninit_lib (void)
+{
+}
+
+void
+crypto_clear_error (void)
+{
+}
+
+#ifdef DMALLOC
+void
+crypto_init_dmalloc (void)
+{
+ msg (M_ERR, "Error: dmalloc support is not available for PolarSSL.");
+}
+#endif /* DMALLOC */
+
+typedef struct { const char * openvpn_name; const char * polarssl_name; } cipher_name_pair;
+cipher_name_pair cipher_name_translation_table[] = {
+ { "BF-CBC", "BLOWFISH-CBC" },
+ { "BF-CFB", "BLOWFISH-CFB64" },
+ { "CAMELLIA-128-CFB", "CAMELLIA-128-CFB128" },
+ { "CAMELLIA-192-CFB", "CAMELLIA-192-CFB128" },
+ { "CAMELLIA-256-CFB", "CAMELLIA-256-CFB128" }
+};
+
+const cipher_name_pair *
+get_cipher_name_pair(const char *cipher_name) {
+ cipher_name_pair *pair;
+ size_t i = 0;
+
+ /* Search for a cipher name translation */
+ for (; i < sizeof (cipher_name_translation_table) / sizeof (*cipher_name_translation_table); i++)
+ {
+ pair = &cipher_name_translation_table[i];
+ if (0 == strcmp (cipher_name, pair->openvpn_name) ||
+ 0 == strcmp (cipher_name, pair->polarssl_name))
+ return pair;
+ }
+
+ /* Nothing found, return null */
+ return NULL;
+}
+
+const char *
+translate_cipher_name_from_openvpn (const char *cipher_name) {
+ const cipher_name_pair *pair = get_cipher_name_pair(cipher_name);
+
+ if (NULL == pair)
+ return cipher_name;
+
+ return pair->polarssl_name;
+}
+
+const char *
+translate_cipher_name_to_openvpn (const char *cipher_name) {
+ const cipher_name_pair *pair = get_cipher_name_pair(cipher_name);
+
+ if (NULL == pair)
+ return cipher_name;
+
+ return pair->openvpn_name;
+}
+
+void
+show_available_ciphers ()
+{
+ const int *ciphers = cipher_list();
+
+#ifndef ENABLE_SMALL
+ printf ("The following ciphers and cipher modes are available\n"
+ "for use with " PACKAGE_NAME ". Each cipher shown below may be\n"
+ "used as a parameter to the --cipher option. The default\n"
+ "key size is shown as well as whether or not it can be\n"
+ "changed with the --keysize directive. Using a CBC mode\n"
+ "is recommended.\n\n");
+#endif
+
+ while (*ciphers != 0)
+ {
+ const cipher_info_t *info = cipher_info_from_type(*ciphers);
+
+ if (info && info->mode == POLARSSL_MODE_CBC)
+ printf ("%s %d bit default key\n",
+ cipher_kt_name(info), cipher_kt_key_size(info) * 8);
+
+ ciphers++;
+ }
+ printf ("\n");
+}
+
+void
+show_available_digests ()
+{
+ const int *digests = md_list();
+
+#ifndef ENABLE_SMALL
+ printf ("The following message digests are available for use with\n"
+ PACKAGE_NAME ". A message digest is used in conjunction with\n"
+ "the HMAC function, to authenticate received packets.\n"
+ "You can specify a message digest as parameter to\n"
+ "the --auth option.\n\n");
+#endif
+
+ while (*digests != 0)
+ {
+ const md_info_t *info = md_info_from_type(*digests);
+
+ if (info)
+ printf ("%s %d bit default key\n",
+ info->name, info->size * 8);
+ digests++;
+ }
+ printf ("\n");
+}
+
+void
+show_available_engines ()
+{
+ printf ("Sorry, PolarSSL hardware crypto engine functionality is not "
+ "available\n");
+}
+
+/*
+ *
+ * Random number functions, used in cases where we want
+ * reasonably strong cryptographic random number generation
+ * without depleting our entropy pool. Used for random
+ * IV values and a number of other miscellaneous tasks.
+ *
+ */
+
+/*
+ * Initialise the given ctr_drbg context, using a personalisation string and an
+ * entropy gathering function.
+ */
+ctr_drbg_context * rand_ctx_get()
+{
+ static entropy_context ec = {0};
+ static ctr_drbg_context cd_ctx = {0};
+ static bool rand_initialised = false;
+
+ if (!rand_initialised)
+ {
+ struct gc_arena gc = gc_new();
+ struct buffer pers_string = alloc_buf_gc(100, &gc);
+
+ /*
+ * Personalisation string, should be as unique as possible (see NIST
+ * 800-90 section 8.7.1). We have very little information at this stage.
+ * Include Program Name, memory address of the context and PID.
+ */
+ buf_printf(&pers_string, "OpenVPN %0u %p %s", platform_getpid(), &cd_ctx, time_string(0, 0, 0, &gc));
+
+ /* Initialise PolarSSL RNG, and built-in entropy sources */
+ entropy_init(&ec);
+
+ if (0 != ctr_drbg_init(&cd_ctx, entropy_func, &ec, BPTR(&pers_string), BLEN(&pers_string)))
+ msg (M_FATAL, "Failed to initialize random generator");
+
+ gc_free(&gc);
+ rand_initialised = true;
+ }
+
+ return &cd_ctx;
+}
+
+#ifdef ENABLE_PREDICTION_RESISTANCE
+void rand_ctx_enable_prediction_resistance()
+{
+ ctr_drbg_context *cd_ctx = rand_ctx_get();
+
+ ctr_drbg_set_prediction_resistance(cd_ctx, 1);
+}
+#endif /* ENABLE_PREDICTION_RESISTANCE */
+
+int
+rand_bytes (uint8_t *output, int len)
+{
+ ctr_drbg_context *rng_ctx = rand_ctx_get();
+
+ while (len > 0)
+ {
+ const size_t blen = min_int (len, CTR_DRBG_MAX_REQUEST);
+ if (0 != ctr_drbg_random(rng_ctx, output, blen))
+ return 0;
+
+ output += blen;
+ len -= blen;
+ }
+
+ return 1;
+}
+
+/*
+ *
+ * Key functions, allow manipulation of keys.
+ *
+ */
+
+
+int
+key_des_num_cblocks (const cipher_info_t *kt)
+{
+ int ret = 0;
+ if (kt->type == POLARSSL_CIPHER_DES_CBC)
+ ret = 1;
+ if (kt->type == POLARSSL_CIPHER_DES_EDE_CBC)
+ ret = 2;
+ if (kt->type == POLARSSL_CIPHER_DES_EDE3_CBC)
+ ret = 3;
+
+ dmsg (D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret);
+ return ret;
+}
+
+bool
+key_des_check (uint8_t *key, int key_len, int ndc)
+{
+ int i;
+ struct buffer b;
+
+ buf_set_read (&b, key, key_len);
+
+ for (i = 0; i < ndc; ++i)
+ {
+ unsigned char *key = buf_read_alloc(&b, DES_KEY_SIZE);
+ if (!key)
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: insufficient key material");
+ goto err;
+ }
+ if (0 != des_key_check_weak(key))
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: weak key detected");
+ goto err;
+ }
+ if (0 != des_key_check_key_parity(key))
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: check_key_DES: bad parity detected");
+ goto err;
+ }
+ }
+ return true;
+
+ err:
+ return false;
+}
+
+void
+key_des_fixup (uint8_t *key, int key_len, int ndc)
+{
+ int i;
+ struct buffer b;
+
+ buf_set_read (&b, key, key_len);
+ for (i = 0; i < ndc; ++i)
+ {
+ unsigned char *key = buf_read_alloc(&b, DES_KEY_SIZE);
+ if (!key)
+ {
+ msg (D_CRYPT_ERRORS, "CRYPTO INFO: fixup_key_DES: insufficient key material");
+ return;
+ }
+ des_key_set_parity(key);
+ }
+}
+
+/*
+ *
+ * Generic cipher key type functions
+ *
+ */
+
+
+const cipher_info_t *
+cipher_kt_get (const char *ciphername)
+{
+ const cipher_info_t *cipher = NULL;
+
+ ASSERT (ciphername);
+
+ cipher = cipher_info_from_string(ciphername);
+
+ if (NULL == cipher)
+ msg (M_FATAL, "Cipher algorithm '%s' not found", ciphername);
+
+ if (cipher->key_length/8 > MAX_CIPHER_KEY_LENGTH)
+ msg (M_FATAL, "Cipher algorithm '%s' uses a default key size (%d bytes) which is larger than " PACKAGE_NAME "'s current maximum key size (%d bytes)",
+ ciphername,
+ cipher->key_length/8,
+ MAX_CIPHER_KEY_LENGTH);
+
+ return cipher;
+}
+
+const char *
+cipher_kt_name (const cipher_info_t *cipher_kt)
+{
+ if (NULL == cipher_kt)
+ return "[null-cipher]";
+
+ return translate_cipher_name_to_openvpn(cipher_kt->name);
+}
+
+int
+cipher_kt_key_size (const cipher_info_t *cipher_kt)
+{
+ if (NULL == cipher_kt)
+ return 0;
+ if (POLARSSL_CIPHER_ID_BLOWFISH == cipher_kt->base->cipher)
+ return 128/8; /* Override PolarSSL 32 bit default key size with sane 128 bit default */
+
+ return cipher_kt->key_length/8;
+}
+
+int
+cipher_kt_iv_size (const cipher_info_t *cipher_kt)
+{
+ if (NULL == cipher_kt)
+ return 0;
+ return cipher_kt->iv_size;
+}
+
+int
+cipher_kt_block_size (const cipher_info_t *cipher_kt)
+{
+ if (NULL == cipher_kt)
+ return 0;
+ return cipher_kt->block_size;
+}
+
+int
+cipher_kt_mode (const cipher_info_t *cipher_kt)
+{
+ ASSERT(NULL != cipher_kt);
+ return cipher_kt->mode;
+}
+
+bool
+cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+{
+ return cipher_kt_mode(cipher) == OPENVPN_MODE_CBC;
+}
+
+bool
+cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+{
+ return (cipher_kt_mode(cipher) == OPENVPN_MODE_OFB ||
+ cipher_kt_mode(cipher) == OPENVPN_MODE_CFB);
+}
+
+
+/*
+ *
+ * Generic cipher context functions
+ *
+ */
+
+
+void
+cipher_ctx_init (cipher_context_t *ctx, uint8_t *key, int key_len,
+ const cipher_info_t *kt, int enc)
+{
+ ASSERT(NULL != kt && NULL != ctx);
+
+ CLEAR (*ctx);
+
+ if (0 != cipher_init_ctx(ctx, kt))
+ msg (M_FATAL, "PolarSSL cipher context init #1");
+
+ if (0 != cipher_setkey(ctx, key, key_len*8, enc))
+ msg (M_FATAL, "PolarSSL cipher set key");
+
+ /* make sure we used a big enough key */
+ ASSERT (ctx->key_length <= key_len*8);
+}
+
+void cipher_ctx_cleanup (cipher_context_t *ctx)
+{
+ cipher_free_ctx(ctx);
+}
+
+int cipher_ctx_iv_length (const cipher_context_t *ctx)
+{
+ return cipher_get_iv_size(ctx);
+}
+
+int cipher_ctx_block_size(const cipher_context_t *ctx)
+{
+ return cipher_get_block_size(ctx);
+}
+
+int cipher_ctx_mode (const cipher_context_t *ctx)
+{
+ ASSERT(NULL != ctx);
+
+ return cipher_kt_mode(ctx->cipher_info);
+}
+
+const cipher_kt_t *
+cipher_ctx_get_cipher_kt (const cipher_ctx_t *ctx)
+{
+ ASSERT(NULL != ctx);
+
+ return ctx->cipher_info;
+}
+
+int cipher_ctx_reset (cipher_context_t *ctx, uint8_t *iv_buf)
+{
+ int retval = cipher_reset(ctx);
+
+ if (0 == retval)
+ retval = cipher_set_iv(ctx, iv_buf, ctx->cipher_info->iv_size);
+
+ return 0 == retval;
+}
+
+int cipher_ctx_update (cipher_context_t *ctx, uint8_t *dst, int *dst_len,
+ uint8_t *src, int src_len)
+{
+ int retval = 0;
+ size_t s_dst_len = *dst_len;
+
+ retval = cipher_update(ctx, src, (size_t)src_len, dst, &s_dst_len);
+
+ *dst_len = s_dst_len;
+
+ return 0 == retval;
+}
+
+int cipher_ctx_final (cipher_context_t *ctx, uint8_t *dst, int *dst_len)
+{
+ int retval = 0;
+ size_t s_dst_len = *dst_len;
+
+ retval = cipher_finish(ctx, dst, &s_dst_len);
+ *dst_len = s_dst_len;
+
+ return 0 == retval;
+}
+
+void
+cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH],
+ unsigned char *src,
+ unsigned char *dst)
+{
+ des_context ctx;
+
+ des_setkey_enc(&ctx, key);
+ des_crypt_ecb(&ctx, src, dst);
+}
+
+
+
+/*
+ *
+ * Generic message digest information functions
+ *
+ */
+
+
+const md_info_t *
+md_kt_get (const char *digest)
+{
+ const md_info_t *md = NULL;
+ ASSERT (digest);
+
+ md = md_info_from_string(digest);
+ if (!md)
+ msg (M_FATAL, "Message hash algorithm '%s' not found", digest);
+ if (md->size > MAX_HMAC_KEY_LENGTH)
+ msg (M_FATAL, "Message hash algorithm '%s' uses a default hash size (%d bytes) which is larger than " PACKAGE_NAME "'s current maximum hash size (%d bytes)",
+ digest,
+ md->size,
+ MAX_HMAC_KEY_LENGTH);
+ return md;
+}
+
+const char *
+md_kt_name (const md_info_t *kt)
+{
+ if (NULL == kt)
+ return "[null-digest]";
+ return md_get_name (kt);
+}
+
+int
+md_kt_size (const md_info_t *kt)
+{
+ if (NULL == kt)
+ return 0;
+ return md_get_size(kt);
+}
+
+/*
+ *
+ * Generic message digest functions
+ *
+ */
+
+int
+md_full (const md_kt_t *kt, const uint8_t *src, int src_len, uint8_t *dst)
+{
+ return 0 == md(kt, src, src_len, dst);
+}
+
+
+void
+md_ctx_init (md_context_t *ctx, const md_info_t *kt)
+{
+ ASSERT(NULL != ctx && NULL != kt);
+
+ CLEAR(*ctx);
+
+ ASSERT(0 == md_init_ctx(ctx, kt));
+ ASSERT(0 == md_starts(ctx));
+}
+
+void
+md_ctx_cleanup(md_context_t *ctx)
+{
+}
+
+int
+md_ctx_size (const md_context_t *ctx)
+{
+ if (NULL == ctx)
+ return 0;
+ return md_get_size(ctx->md_info);
+}
+
+void
+md_ctx_update (md_context_t *ctx, const uint8_t *src, int src_len)
+{
+ ASSERT(0 == md_update(ctx, src, src_len));
+}
+
+void
+md_ctx_final (md_context_t *ctx, uint8_t *dst)
+{
+ ASSERT(0 == md_finish(ctx, dst));
+ ASSERT(0 == md_free_ctx(ctx));
+}
+
+
+/*
+ *
+ * Generic HMAC functions
+ *
+ */
+
+
+/*
+ * TODO: re-enable dmsg for crypto debug
+ */
+void
+hmac_ctx_init (md_context_t *ctx, const uint8_t *key, int key_len, const md_info_t *kt)
+{
+ ASSERT(NULL != kt && NULL != ctx);
+
+ CLEAR(*ctx);
+
+ ASSERT(0 == md_init_ctx(ctx, kt));
+ ASSERT(0 == md_hmac_starts(ctx, key, key_len));
+
+ /* make sure we used a big enough key */
+ ASSERT (md_get_size(kt) <= key_len);
+}
+
+void
+hmac_ctx_cleanup(md_context_t *ctx)
+{
+ ASSERT(0 == md_free_ctx(ctx));
+}
+
+int
+hmac_ctx_size (const md_context_t *ctx)
+{
+ if (NULL == ctx)
+ return 0;
+ return md_get_size(ctx->md_info);
+}
+
+void
+hmac_ctx_reset (md_context_t *ctx)
+{
+ ASSERT(0 == md_hmac_reset(ctx));
+}
+
+void
+hmac_ctx_update (md_context_t *ctx, const uint8_t *src, int src_len)
+{
+ ASSERT(0 == md_hmac_update(ctx, src, src_len));
+}
+
+void
+hmac_ctx_final (md_context_t *ctx, uint8_t *dst)
+{
+ ASSERT(0 == md_hmac_finish(ctx, dst));
+}
+
+#endif /* ENABLE_CRYPTO && ENABLE_CRYPTO_POLARSSL */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.h
new file mode 100644
index 00000000..b6da4363
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/crypto_polarssl.h
@@ -0,0 +1,94 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Cryptography PolarSSL-specific backend interface
+ */
+
+#ifndef CRYPTO_POLARSSL_H_
+#define CRYPTO_POLARSSL_H_
+
+#include <polarssl/cipher.h>
+#include <polarssl/md.h>
+#include <polarssl/ctr_drbg.h>
+
+/** Generic cipher key type %context. */
+typedef cipher_info_t cipher_kt_t;
+
+/** Generic message digest key type %context. */
+typedef md_info_t md_kt_t;
+
+/** Generic cipher %context. */
+typedef cipher_context_t cipher_ctx_t;
+
+/** Generic message digest %context. */
+typedef md_context_t md_ctx_t;
+
+/** Generic HMAC %context. */
+typedef md_context_t hmac_ctx_t;
+
+/** Maximum length of an IV */
+#define OPENVPN_MAX_IV_LENGTH POLARSSL_MAX_IV_LENGTH
+
+/** Cipher is in CBC mode */
+#define OPENVPN_MODE_CBC POLARSSL_MODE_CBC
+
+/** Cipher is in OFB mode */
+#define OPENVPN_MODE_OFB POLARSSL_MODE_OFB
+
+/** Cipher is in CFB mode */
+#define OPENVPN_MODE_CFB POLARSSL_MODE_CFB
+
+/** Cipher should encrypt */
+#define OPENVPN_OP_ENCRYPT POLARSSL_ENCRYPT
+
+/** Cipher should decrypt */
+#define OPENVPN_OP_DECRYPT POLARSSL_DECRYPT
+
+#define MD4_DIGEST_LENGTH 16
+#define MD5_DIGEST_LENGTH 16
+#define SHA_DIGEST_LENGTH 20
+#define DES_KEY_LENGTH 8
+
+/**
+ * Returns a singleton instance of the PolarSSL random number generator.
+ *
+ * For PolarSSL 1.1+, this is the CTR_DRBG random number generator. If it
+ * hasn't been initialised yet, the RNG will be initialised using the default
+ * entropy sources. Aside from the default platform entropy sources, an
+ * additional entropy source, the HAVEGE random number generator will also be
+ * added. During initialisation, a personalisation string will be added based
+ * on the time, the PID, and a pointer to the random context.
+ */
+ctr_drbg_context * rand_ctx_get();
+
+#ifdef ENABLE_PREDICTION_RESISTANCE
+/**
+ * Enable prediction resistance on the random number generator.
+ */
+void rand_ctx_enable_prediction_resistance();
+#endif
+
+#endif /* CRYPTO_POLARSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.c
new file mode 100644
index 00000000..b7fc11e0
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.c
@@ -0,0 +1,465 @@
+/*
+ * Copyright (c) 2004 Peter 'Luna' Runestig <peter@runestig.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifi-
+ * cation, are permitted provided that the following conditions are met:
+ *
+ * o Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * o Redistributions in binary form must reproduce the above copyright no-
+ * tice, this list of conditions and the following disclaimer in the do-
+ * cumentation and/or other materials provided with the distribution.
+ *
+ * o The names of the contributors may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LI-
+ * ABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN-
+ * TIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEV-
+ * ER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABI-
+ * LITY, 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_CRYPTOAPI
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <windows.h>
+#include <wincrypt.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <assert.h>
+
+/* MinGW w32api 3.17 is still incomplete when it comes to CryptoAPI while
+ * MinGW32-w64 defines all macros used. This is a hack around that problem.
+ */
+#ifndef CERT_SYSTEM_STORE_LOCATION_SHIFT
+#define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
+#endif
+#ifndef CERT_SYSTEM_STORE_CURRENT_USER_ID
+#define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
+#endif
+#ifndef CERT_SYSTEM_STORE_CURRENT_USER
+#define CERT_SYSTEM_STORE_CURRENT_USER (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
+#endif
+#ifndef CERT_STORE_READONLY_FLAG
+#define CERT_STORE_READONLY_FLAG 0x00008000
+#endif
+#ifndef CERT_STORE_OPEN_EXISTING_FLAG
+#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
+#endif
+
+/* Size of an SSL signature: MD5+SHA1 */
+#define SSL_SIG_LENGTH 36
+
+/* try to funnel any Windows/CryptoAPI error messages to OpenSSL ERR_... */
+#define ERR_LIB_CRYPTOAPI (ERR_LIB_USER + 69) /* 69 is just a number... */
+#define CRYPTOAPIerr(f) err_put_ms_error(GetLastError(), (f), __FILE__, __LINE__)
+#define CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE 100
+#define CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE 101
+#define CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY 102
+#define CRYPTOAPI_F_CRYPT_CREATE_HASH 103
+#define CRYPTOAPI_F_CRYPT_GET_HASH_PARAM 104
+#define CRYPTOAPI_F_CRYPT_SET_HASH_PARAM 105
+#define CRYPTOAPI_F_CRYPT_SIGN_HASH 106
+#define CRYPTOAPI_F_LOAD_LIBRARY 107
+#define CRYPTOAPI_F_GET_PROC_ADDRESS 108
+
+static ERR_STRING_DATA CRYPTOAPI_str_functs[] = {
+ { ERR_PACK(ERR_LIB_CRYPTOAPI, 0, 0), "microsoft cryptoapi"},
+ { ERR_PACK(0, CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE, 0), "CertOpenSystemStore" },
+ { ERR_PACK(0, CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE, 0), "CertFindCertificateInStore" },
+ { ERR_PACK(0, CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY, 0), "CryptAcquireCertificatePrivateKey" },
+ { ERR_PACK(0, CRYPTOAPI_F_CRYPT_CREATE_HASH, 0), "CryptCreateHash" },
+ { ERR_PACK(0, CRYPTOAPI_F_CRYPT_GET_HASH_PARAM, 0), "CryptGetHashParam" },
+ { ERR_PACK(0, CRYPTOAPI_F_CRYPT_SET_HASH_PARAM, 0), "CryptSetHashParam" },
+ { ERR_PACK(0, CRYPTOAPI_F_CRYPT_SIGN_HASH, 0), "CryptSignHash" },
+ { ERR_PACK(0, CRYPTOAPI_F_LOAD_LIBRARY, 0), "LoadLibrary" },
+ { ERR_PACK(0, CRYPTOAPI_F_GET_PROC_ADDRESS, 0), "GetProcAddress" },
+ { 0, NULL }
+};
+
+typedef struct _CAPI_DATA {
+ const CERT_CONTEXT *cert_context;
+ HCRYPTPROV crypt_prov;
+ DWORD key_spec;
+ BOOL free_crypt_prov;
+} CAPI_DATA;
+
+static char *ms_error_text(DWORD ms_err)
+{
+ LPVOID lpMsgBuf = NULL;
+ char *rv = NULL;
+
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, ms_err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
+ (LPTSTR) &lpMsgBuf, 0, NULL);
+ if (lpMsgBuf) {
+ char *p;
+ rv = strdup(lpMsgBuf);
+ LocalFree(lpMsgBuf);
+ /* trim to the left */
+ if (rv)
+ for (p = rv + strlen(rv) - 1; p >= rv; p--) {
+ if (isspace(*p))
+ *p = '\0';
+ else
+ break;
+ }
+ }
+ return rv;
+}
+
+static void err_put_ms_error(DWORD ms_err, int func, const char *file, int line)
+{
+ static int init = 0;
+# define ERR_MAP_SZ 16
+ static struct {
+ int err;
+ DWORD ms_err; /* I don't think we get more than 16 *different* errors */
+ } err_map[ERR_MAP_SZ]; /* in here, before we give up the whole thing... */
+ int i;
+
+ if (ms_err == 0)
+ /* 0 is not an error */
+ return;
+ if (!init) {
+ ERR_load_strings(ERR_LIB_CRYPTOAPI, CRYPTOAPI_str_functs);
+ memset(&err_map, 0, sizeof(err_map));
+ init++;
+ }
+ /* since MS error codes are 32 bit, and the ones in the ERR_... system is
+ * only 12, we must have a mapping table between them. */
+ for (i = 0; i < ERR_MAP_SZ; i++) {
+ if (err_map[i].ms_err == ms_err) {
+ ERR_PUT_error(ERR_LIB_CRYPTOAPI, func, err_map[i].err, file, line);
+ break;
+ } else if (err_map[i].ms_err == 0 ) {
+ /* end of table, add new entry */
+ ERR_STRING_DATA *esd = calloc(2, sizeof(*esd));
+ if (esd == NULL)
+ break;
+ err_map[i].ms_err = ms_err;
+ err_map[i].err = esd->error = i + 100;
+ esd->string = ms_error_text(ms_err);
+ ERR_load_strings(ERR_LIB_CRYPTOAPI, esd);
+ ERR_PUT_error(ERR_LIB_CRYPTOAPI, func, err_map[i].err, file, line);
+ break;
+ }
+ }
+}
+
+/* encrypt */
+static int rsa_pub_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ /* I haven't been able to trigger this one, but I want to know if it happens... */
+ assert(0);
+
+ return 0;
+}
+
+/* verify arbitrary data */
+static int rsa_pub_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ /* I haven't been able to trigger this one, but I want to know if it happens... */
+ assert(0);
+
+ return 0;
+}
+
+/* sign arbitrary data */
+static int rsa_priv_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ CAPI_DATA *cd = (CAPI_DATA *) rsa->meth->app_data;
+ HCRYPTHASH hash;
+ DWORD hash_size, len, i;
+ unsigned char *buf;
+
+ if (cd == NULL) {
+ RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT, ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+ if (padding != RSA_PKCS1_PADDING) {
+ /* AFAICS, CryptSignHash() *always* uses PKCS1 padding. */
+ RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
+ return 0;
+ }
+ /* Unfortunately, there is no "CryptSign()" function in CryptoAPI, that would
+ * be way to straightforward for M$, I guess... So we have to do it this
+ * tricky way instead, by creating a "Hash", and load the already-made hash
+ * from 'from' into it. */
+ /* For now, we only support NID_md5_sha1 */
+ if (flen != SSL_SIG_LENGTH) {
+ RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT, RSA_R_INVALID_MESSAGE_LENGTH);
+ return 0;
+ }
+ if (!CryptCreateHash(cd->crypt_prov, CALG_SSL3_SHAMD5, 0, 0, &hash)) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CRYPT_CREATE_HASH);
+ return 0;
+ }
+ len = sizeof(hash_size);
+ if (!CryptGetHashParam(hash, HP_HASHSIZE, (BYTE *) &hash_size, &len, 0)) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CRYPT_GET_HASH_PARAM);
+ CryptDestroyHash(hash);
+ return 0;
+ }
+ if ((int) hash_size != flen) {
+ RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT, RSA_R_INVALID_MESSAGE_LENGTH);
+ CryptDestroyHash(hash);
+ return 0;
+ }
+ if (!CryptSetHashParam(hash, HP_HASHVAL, (BYTE * ) from, 0)) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CRYPT_SET_HASH_PARAM);
+ CryptDestroyHash(hash);
+ return 0;
+ }
+
+ len = RSA_size(rsa);
+ buf = malloc(len);
+ if (buf == NULL) {
+ RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT, ERR_R_MALLOC_FAILURE);
+ CryptDestroyHash(hash);
+ return 0;
+ }
+ if (!CryptSignHash(hash, cd->key_spec, NULL, 0, buf, &len)) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CRYPT_SIGN_HASH);
+ CryptDestroyHash(hash);
+ free(buf);
+ return 0;
+ }
+ /* and now, we have to reverse the byte-order in the result from CryptSignHash()... */
+ for (i = 0; i < len; i++)
+ to[i] = buf[len - i - 1];
+ free(buf);
+
+ CryptDestroyHash(hash);
+ return len;
+}
+
+/* decrypt */
+static int rsa_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ /* I haven't been able to trigger this one, but I want to know if it happens... */
+ assert(0);
+
+ return 0;
+}
+
+/* called at RSA_new */
+static int init(RSA *rsa)
+{
+
+ return 0;
+}
+
+/* called at RSA_free */
+static int finish(RSA *rsa)
+{
+ CAPI_DATA *cd = (CAPI_DATA *) rsa->meth->app_data;
+
+ if (cd == NULL)
+ return 0;
+ if (cd->crypt_prov && cd->free_crypt_prov)
+ CryptReleaseContext(cd->crypt_prov, 0);
+ if (cd->cert_context)
+ CertFreeCertificateContext(cd->cert_context);
+ free(rsa->meth->app_data);
+ free((char *) rsa->meth);
+ rsa->meth = NULL;
+ return 1;
+}
+
+static const CERT_CONTEXT *find_certificate_in_store(const char *cert_prop, HCERTSTORE cert_store)
+{
+ /* Find, and use, the desired certificate from the store. The
+ * 'cert_prop' certificate search string can look like this:
+ * SUBJ:<certificate substring to match>
+ * THUMB:<certificate thumbprint hex value>, e.g.
+ * THUMB:f6 49 24 41 01 b4 fb 44 0c ce f4 36 ae d0 c4 c9 df 7a b6 28
+ */
+ const CERT_CONTEXT *rv = NULL;
+
+ if (!strncmp(cert_prop, "SUBJ:", 5)) {
+ /* skip the tag */
+ cert_prop += 5;
+ rv = CertFindCertificateInStore(cert_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
+ 0, CERT_FIND_SUBJECT_STR_A, cert_prop, NULL);
+
+ } else if (!strncmp(cert_prop, "THUMB:", 6)) {
+ unsigned char hash[255];
+ char *p;
+ int i, x = 0;
+ CRYPT_HASH_BLOB blob;
+
+ /* skip the tag */
+ cert_prop += 6;
+ for (p = (char *) cert_prop, i = 0; *p && i < sizeof(hash); i++) {
+ if (*p >= '0' && *p <= '9')
+ x = (*p - '0') << 4;
+ else if (*p >= 'A' && *p <= 'F')
+ x = (*p - 'A' + 10) << 4;
+ else if (*p >= 'a' && *p <= 'f')
+ x = (*p - 'a' + 10) << 4;
+ if (!*++p) /* unexpected end of string */
+ break;
+ if (*p >= '0' && *p <= '9')
+ x += *p - '0';
+ else if (*p >= 'A' && *p <= 'F')
+ x += *p - 'A' + 10;
+ else if (*p >= 'a' && *p <= 'f')
+ x += *p - 'a' + 10;
+ hash[i] = x;
+ /* skip any space(s) between hex numbers */
+ for (p++; *p && *p == ' '; p++);
+ }
+ blob.cbData = i;
+ blob.pbData = (unsigned char *) &hash;
+ rv = CertFindCertificateInStore(cert_store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
+ 0, CERT_FIND_HASH, &blob, NULL);
+
+ }
+
+ return rv;
+}
+
+int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop)
+{
+ HCERTSTORE cs;
+ X509 *cert = NULL;
+ RSA *rsa = NULL, *pub_rsa;
+ CAPI_DATA *cd = calloc(1, sizeof(*cd));
+ RSA_METHOD *my_rsa_method = calloc(1, sizeof(*my_rsa_method));
+
+ if (cd == NULL || my_rsa_method == NULL) {
+ SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+ /* search CURRENT_USER first, then LOCAL_MACHINE */
+ cs = CertOpenStore((LPCSTR) CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER |
+ CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG, L"MY");
+ if (cs == NULL) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE);
+ goto err;
+ }
+ cd->cert_context = find_certificate_in_store(cert_prop, cs);
+ CertCloseStore(cs, 0);
+ if (!cd->cert_context) {
+ cs = CertOpenStore((LPCSTR) CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE |
+ CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG, L"MY");
+ if (cs == NULL) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CERT_OPEN_SYSTEM_STORE);
+ goto err;
+ }
+ cd->cert_context = find_certificate_in_store(cert_prop, cs);
+ CertCloseStore(cs, 0);
+ if (cd->cert_context == NULL) {
+ CRYPTOAPIerr(CRYPTOAPI_F_CERT_FIND_CERTIFICATE_IN_STORE);
+ goto err;
+ }
+ }
+
+ /* cert_context->pbCertEncoded is the cert X509 DER encoded. */
+ cert = d2i_X509(NULL, (const unsigned char **) &cd->cert_context->pbCertEncoded,
+ cd->cert_context->cbCertEncoded);
+ if (cert == NULL) {
+ SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_ASN1_LIB);
+ goto err;
+ }
+
+ /* set up stuff to use the private key */
+ if (!CryptAcquireCertificatePrivateKey(cd->cert_context, CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
+ NULL, &cd->crypt_prov, &cd->key_spec, &cd->free_crypt_prov)) {
+ /* if we don't have a smart card reader here, and we try to access a
+ * smart card certificate, we get:
+ * "Error 1223: The operation was canceled by the user." */
+ CRYPTOAPIerr(CRYPTOAPI_F_CRYPT_ACQUIRE_CERTIFICATE_PRIVATE_KEY);
+ goto err;
+ }
+ /* here we don't need to do CryptGetUserKey() or anything; all necessary key
+ * info is in cd->cert_context, and then, in cd->crypt_prov. */
+
+ my_rsa_method->name = "Microsoft CryptoAPI RSA Method";
+ my_rsa_method->rsa_pub_enc = rsa_pub_enc;
+ my_rsa_method->rsa_pub_dec = rsa_pub_dec;
+ my_rsa_method->rsa_priv_enc = rsa_priv_enc;
+ my_rsa_method->rsa_priv_dec = rsa_priv_dec;
+ /* my_rsa_method->init = init; */
+ my_rsa_method->finish = finish;
+ my_rsa_method->flags = RSA_METHOD_FLAG_NO_CHECK;
+ my_rsa_method->app_data = (char *) cd;
+
+ rsa = RSA_new();
+ if (rsa == NULL) {
+ SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
+ /* cert->cert_info->key->pkey is NULL until we call SSL_CTX_use_certificate(),
+ * so we do it here then... */
+ if (!SSL_CTX_use_certificate(ssl_ctx, cert))
+ goto err;
+ /* the public key */
+ pub_rsa = cert->cert_info->key->pkey->pkey.rsa;
+ /* SSL_CTX_use_certificate() increased the reference count in 'cert', so
+ * we decrease it here with X509_free(), or it will never be cleaned up. */
+ X509_free(cert);
+ cert = NULL;
+
+ /* I'm not sure about what we have to fill in in the RSA, trying out stuff... */
+ /* rsa->n indicates the key size */
+ rsa->n = BN_dup(pub_rsa->n);
+ rsa->flags |= RSA_FLAG_EXT_PKEY;
+ if (!RSA_set_method(rsa, my_rsa_method))
+ goto err;
+
+ if (!SSL_CTX_use_RSAPrivateKey(ssl_ctx, rsa))
+ goto err;
+ /* SSL_CTX_use_RSAPrivateKey() increased the reference count in 'rsa', so
+ * we decrease it here with RSA_free(), or it will never be cleaned up. */
+ RSA_free(rsa);
+ return 1;
+
+ err:
+ if (cert)
+ X509_free(cert);
+ if (rsa)
+ RSA_free(rsa);
+ else {
+ if (my_rsa_method)
+ free(my_rsa_method);
+ if (cd) {
+ if (cd->free_crypt_prov && cd->crypt_prov)
+ CryptReleaseContext(cd->crypt_prov, 0);
+ if (cd->cert_context)
+ CertFreeCertificateContext(cd->cert_context);
+ free(cd);
+ }
+ }
+ return 0;
+}
+
+#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
+static void dummy (void) {}
+#endif
+#endif /* WIN32 */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.h
new file mode 100644
index 00000000..8ac6db36
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/cryptoapi.h
@@ -0,0 +1,7 @@
+#ifndef _CRYPTOAPI_H_
+#define _CRYPTOAPI_H_
+
+int SSL_CTX_use_CryptoAPI_certificate(SSL_CTX *ssl_ctx, const char *cert_prop);
+
+
+#endif /* !_CRYPTOAPI_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.c
new file mode 100644
index 00000000..8d0b18ac
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.c
@@ -0,0 +1,212 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "dhcp.h"
+#include "socket.h"
+#include "error.h"
+
+#include "memdbg.h"
+
+static int
+get_dhcp_message_type (const struct dhcp *dhcp, const int optlen)
+{
+ const uint8_t *p = (uint8_t *) (dhcp + 1);
+ int i;
+
+ for (i = 0; i < optlen; ++i)
+ {
+ const uint8_t type = p[i];
+ const int room = optlen - i;
+ if (type == DHCP_END) /* didn't find what we were looking for */
+ return -1;
+ else if (type == DHCP_PAD) /* no-operation */
+ ;
+ else if (type == DHCP_MSG_TYPE) /* what we are looking for */
+ {
+ if (room >= 3)
+ {
+ if (p[i+1] == 1) /* option length should be 1 */
+ return p[i+2]; /* return message type */
+ }
+ return -1;
+ }
+ else /* some other option */
+ {
+ if (room >= 2)
+ {
+ const int len = p[i+1]; /* get option length */
+ i += (len + 1); /* advance to next option */
+ }
+ }
+ }
+ return -1;
+}
+
+static in_addr_t
+do_extract (struct dhcp *dhcp, int optlen)
+{
+ uint8_t *p = (uint8_t *) (dhcp + 1);
+ int i;
+ in_addr_t ret = 0;
+
+ for (i = 0; i < optlen; )
+ {
+ const uint8_t type = p[i];
+ const int room = optlen - i;
+ if (type == DHCP_END)
+ break;
+ else if (type == DHCP_PAD)
+ ++i;
+ else if (type == DHCP_ROUTER)
+ {
+ if (room >= 2)
+ {
+ const int len = p[i+1]; /* get option length */
+ if (len <= (room-2))
+ {
+ /* get router IP address */
+ if (!ret && len >= 4 && (len & 3) == 0)
+ {
+ memcpy (&ret, p+i+2, 4);
+ ret = ntohl (ret);
+ }
+ {
+ /* delete the router option */
+ uint8_t *dest = p + i;
+ const int owlen = len + 2; /* len of data to overwrite */
+ uint8_t *src = dest + owlen;
+ uint8_t *end = p + optlen;
+ const int movlen = end - src;
+ if (movlen > 0)
+ memmove(dest, src, movlen); /* overwrite router option */
+ memset(end - owlen, DHCP_PAD, owlen); /* pad tail */
+ }
+ }
+ else
+ break;
+ }
+ else
+ break;
+ }
+ else /* some other option */
+ {
+ if (room >= 2)
+ {
+ const int len = p[i+1]; /* get option length */
+ i += (len + 2); /* advance to next option */
+ }
+ else
+ break;
+ }
+ }
+ return ret;
+}
+
+static uint16_t
+udp_checksum (const uint8_t *buf,
+ const int len_udp,
+ const uint8_t *src_addr,
+ const uint8_t *dest_addr)
+{
+ uint16_t word16;
+ uint32_t sum = 0;
+ int i;
+
+ /* make 16 bit words out of every two adjacent 8 bit words and */
+ /* calculate the sum of all 16 bit words */
+ for (i = 0; i < len_udp; i += 2){
+ word16 = ((buf[i] << 8) & 0xFF00) + ((i + 1 < len_udp) ? (buf[i+1] & 0xFF) : 0);
+ sum += word16;
+ }
+
+ /* add the UDP pseudo header which contains the IP source and destination addresses */
+ for (i = 0; i < 4; i += 2){
+ word16 =((src_addr[i] << 8) & 0xFF00) + (src_addr[i+1] & 0xFF);
+ sum += word16;
+ }
+ for (i = 0; i < 4; i += 2){
+ word16 =((dest_addr[i] << 8) & 0xFF00) + (dest_addr[i+1] & 0xFF);
+ sum += word16;
+ }
+
+ /* the protocol number and the length of the UDP packet */
+ sum += (uint16_t) OPENVPN_IPPROTO_UDP + (uint16_t) len_udp;
+
+ /* keep only the last 16 bits of the 32 bit calculated sum and add the carries */
+ while (sum >> 16)
+ sum = (sum & 0xFFFF) + (sum >> 16);
+
+ /* Take the one's complement of sum */
+ return ((uint16_t) ~sum);
+}
+
+in_addr_t
+dhcp_extract_router_msg (struct buffer *ipbuf)
+{
+ struct dhcp_full *df = (struct dhcp_full *) BPTR (ipbuf);
+ const int optlen = BLEN (ipbuf) - (sizeof (struct openvpn_iphdr) + sizeof (struct openvpn_udphdr) + sizeof (struct dhcp));
+
+ if (optlen >= 0
+ && df->ip.protocol == OPENVPN_IPPROTO_UDP
+ && df->udp.source == htons (BOOTPS_PORT)
+ && df->udp.dest == htons (BOOTPC_PORT)
+ && df->dhcp.op == BOOTREPLY)
+ {
+ const int message_type = get_dhcp_message_type (&df->dhcp, optlen);
+ if (message_type == DHCPACK || message_type == DHCPOFFER)
+ {
+ /* get the router IP address while padding out all DHCP router options */
+ const in_addr_t ret = do_extract (&df->dhcp, optlen);
+
+ /* recompute the UDP checksum */
+ df->udp.check = 0;
+ df->udp.check = htons (udp_checksum ((uint8_t *) &df->udp,
+ sizeof (struct openvpn_udphdr) + sizeof (struct dhcp) + optlen,
+ (uint8_t *)&df->ip.saddr,
+ (uint8_t *)&df->ip.daddr));
+
+ /* only return the extracted Router address if DHCPACK */
+ if (message_type == DHCPACK)
+ {
+ if (ret)
+ {
+ struct gc_arena gc = gc_new ();
+ msg (D_ROUTE, "Extracted DHCP router address: %s", print_in_addr_t (ret, 0, &gc));
+ gc_free (&gc);
+ }
+
+ return ret;
+ }
+ }
+ }
+ return 0;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.h
new file mode 100644
index 00000000..e823a4a8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/dhcp.h
@@ -0,0 +1,87 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DHCP_H
+#define DHCP_H
+
+#include "common.h"
+#include "buffer.h"
+#include "proto.h"
+
+#pragma pack(1)
+
+/* DHCP Option types */
+#define DHCP_PAD 0
+#define DHCP_ROUTER 3
+#define DHCP_MSG_TYPE 53 /* message type (u8) */
+#define DHCP_END 255
+
+/* DHCP Messages types */
+#define DHCPDISCOVER 1
+#define DHCPOFFER 2
+#define DHCPREQUEST 3
+#define DHCPDECLINE 4
+#define DHCPACK 5
+#define DHCPNAK 6
+#define DHCPRELEASE 7
+#define DHCPINFORM 8
+
+/* DHCP UDP port numbers */
+#define BOOTPS_PORT 67
+#define BOOTPC_PORT 68
+
+struct dhcp {
+# define BOOTREQUEST 1
+# define BOOTREPLY 2
+ uint8_t op; /* message op */
+
+ uint8_t htype; /* hardware address type (e.g. '1' = 10Mb Ethernet) */
+ uint8_t hlen; /* hardware address length (e.g. '6' for 10Mb Ethernet) */
+ uint8_t hops; /* client sets to 0, may be used by relay agents */
+ uint32_t xid; /* transaction ID, chosen by client */
+ uint16_t secs; /* seconds since request process began, set by client */
+ uint16_t flags;
+ uint32_t ciaddr; /* client IP address, client sets if known */
+ uint32_t yiaddr; /* 'your' IP address -- server's response to client */
+ uint32_t siaddr; /* server IP address */
+ uint32_t giaddr; /* relay agent IP address */
+ uint8_t chaddr[16]; /* client hardware address */
+ uint8_t sname[64]; /* optional server host name */
+ uint8_t file[128]; /* boot file name */
+ uint32_t magic; /* must be 0x63825363 (network order) */
+};
+
+struct dhcp_full {
+ struct openvpn_iphdr ip;
+ struct openvpn_udphdr udp;
+ struct dhcp dhcp;
+# define DHCP_OPTIONS_BUFFER_SIZE 256
+ uint8_t options[DHCP_OPTIONS_BUFFER_SIZE];
+};
+
+#pragma pack()
+
+in_addr_t dhcp_extract_router_msg (struct buffer *ipbuf);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/errlevel.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/errlevel.h
new file mode 100644
index 00000000..3ee4ebc3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/errlevel.h
@@ -0,0 +1,179 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef ERRLEVEL_H
+#define ERRLEVEL_H
+
+#include "error.h"
+
+/*
+ * Debug level at and above where we
+ * display time to microsecond resolution.
+ */
+#define DEBUG_LEVEL_USEC_TIME 4
+
+/*
+ * In non-server modes, delay n milliseconds after certain kinds
+ * of non-fatal network errors to avoid a barrage of errors.
+ *
+ * To disable all delays, set to 0.
+ */
+#define P2P_ERROR_DELAY_MS 0
+
+/*
+ * Enable D_LOG_RW
+ */
+#define LOG_RW
+
+/*
+ * Debugging levels for various kinds
+ * of output.
+ */
+
+#define M_VERB0 LOGLEV(0, 0, 0) /* Messages displayed even at --verb 0 (fatal errors only) */
+
+#define M_INFO LOGLEV(1, 0, 0) /* default informational messages */
+
+#define D_LINK_ERRORS LOGLEV(1, 1, M_NONFATAL) /* show link errors from main event loop */
+#define D_CRYPT_ERRORS LOGLEV(1, 2, M_NONFATAL) /* show errors from encrypt/decrypt */
+#define D_TLS_ERRORS LOGLEV(1, 3, M_NONFATAL) /* show TLS control channel errors */
+#define D_RESOLVE_ERRORS LOGLEV(1, 4, M_NONFATAL) /* show hostname resolve errors */
+#define D_COMP_ERRORS LOGLEV(1, 5, M_NONFATAL) /* show compression errors */
+#define D_REPLAY_ERRORS LOGLEV(1, 6, M_NONFATAL) /* show packet replay errors */
+#define D_STREAM_ERRORS LOGLEV(1, 7, M_NONFATAL) /* TCP stream error requiring restart */
+#define D_IMPORT_ERRORS LOGLEV(1, 8, M_NONFATAL) /* show server import option errors */
+#define D_MULTI_ERRORS LOGLEV(1, 9, M_NONFATAL) /* show multi-client server errors */
+#define D_EVENT_ERRORS LOGLEV(1, 10, M_NONFATAL) /* show event.[ch] errors */
+#define D_PUSH_ERRORS LOGLEV(1, 11, M_NONFATAL) /* show push/pull errors */
+#define D_PID_PERSIST LOGLEV(1, 12, M_NONFATAL) /* show packet_id persist errors */
+#define D_FRAG_ERRORS LOGLEV(1, 13, M_NONFATAL) /* show fragmentation errors */
+#define D_ALIGN_ERRORS LOGLEV(1, 14, M_NONFATAL) /* show bad struct alignments */
+
+#define D_HANDSHAKE LOGLEV(2, 20, 0) /* show data & control channel handshakes */
+#define D_CLOSE LOGLEV(2, 22, 0) /* show socket and TUN/TAP close */
+#define D_PROXY LOGLEV(2, 24, 0) /* show http proxy control packets */
+#define D_ARGV LOGLEV(2, 25, 0) /* show struct argv errors */
+
+#define D_TLS_DEBUG_LOW LOGLEV(3, 20, 0) /* low frequency info from tls_session routines */
+#define D_GREMLIN LOGLEV(3, 30, 0) /* show simulated outage info from gremlin module */
+#define D_GENKEY LOGLEV(3, 31, 0) /* print message after key generation */
+#define D_ROUTE LOGLEV(3, 0, 0) /* show routes added and deleted (don't mute) */
+#define D_TUNTAP_INFO LOGLEV(3, 32, 0) /* show debugging info from TUN/TAP driver */
+#define D_RESTART LOGLEV(3, 33, 0) /* show certain restart messages */
+#define D_PUSH LOGLEV(3, 34, 0) /* show push/pull info */
+#define D_IFCONFIG_POOL LOGLEV(3, 35, 0) /* show ifconfig pool info */
+#define D_AUTH LOGLEV(3, 37, 0) /* show user/pass auth info */
+#define D_MULTI_LOW LOGLEV(3, 38, 0) /* show point-to-multipoint low-freq debug info */
+#define D_PLUGIN LOGLEV(3, 39, 0) /* show plugin calls */
+#define D_MANAGEMENT LOGLEV(3, 40, 0) /* show --management info */
+#define D_SCHED_EXIT LOGLEV(3, 41, 0) /* show arming of scheduled exit */
+#define D_ROUTE_QUOTA LOGLEV(3, 42, 0) /* show route quota exceeded messages */
+#define D_OSBUF LOGLEV(3, 43, 0) /* show socket/tun/tap buffer sizes */
+#define D_PS_PROXY LOGLEV(3, 44, 0) /* messages related to --port-share option */
+#define D_PF_INFO LOGLEV(3, 45, 0) /* packet filter informational messages */
+
+#define D_SHOW_PARMS LOGLEV(4, 50, 0) /* show all parameters on program initiation */
+#define D_SHOW_OCC LOGLEV(4, 51, 0) /* show options compatibility string */
+#define D_LOW LOGLEV(4, 52, 0) /* miscellaneous low-frequency debug info */
+#define D_DHCP_OPT LOGLEV(4, 53, 0) /* show DHCP options binary string */
+#define D_MBUF LOGLEV(4, 54, 0) /* mbuf.[ch] routines */
+#define D_PACKET_TRUNC_ERR LOGLEV(4, 55, 0) /* PACKET_TRUNCATION_CHECK */
+#define D_PF_DROPPED LOGLEV(4, 56, 0) /* packet filter dropped a packet */
+#define D_MULTI_DROPPED LOGLEV(4, 57, 0) /* show point-to-multipoint packet drops */
+#define D_MULTI_MEDIUM LOGLEV(4, 58, 0) /* show medium frequency multi messages */
+#define D_X509_ATTR LOGLEV(4, 59, 0) /* show x509-track attributes on connection */
+#define D_INIT_MEDIUM LOGLEV(4, 60, 0) /* show medium frequency init messages */
+#define D_MTU_INFO LOGLEV(4, 61, 0) /* show terse MTU info */
+#define D_SHOW_OCC_HASH LOGLEV(4, 62, 0) /* show MD5 hash of option compatibility string */
+#define D_PID_DEBUG_LOW LOGLEV(4, 63, 0) /* show low-freq packet-id debugging info */
+#define D_PID_DEBUG_MEDIUM LOGLEV(4, 64, 0) /* show medium-freq packet-id debugging info */
+
+#define D_LOG_RW LOGLEV(5, 0, 0) /* Print 'R' or 'W' to stdout for read/write */
+
+#define D_LINK_RW LOGLEV(6, 69, M_DEBUG) /* show TCP/UDP reads/writes (terse) */
+#define D_TUN_RW LOGLEV(6, 69, M_DEBUG) /* show TUN/TAP reads/writes */
+#define D_TAP_WIN_DEBUG LOGLEV(6, 69, M_DEBUG) /* show TAP-Windows driver debug info */
+#define D_CLIENT_NAT LOGLEV(6, 69, M_DEBUG) /* show client NAT debug info */
+
+#define D_SHOW_KEYS LOGLEV(7, 70, M_DEBUG) /* show data channel encryption keys */
+#define D_SHOW_KEY_SOURCE LOGLEV(7, 70, M_DEBUG) /* show data channel key source entropy */
+#define D_REL_LOW LOGLEV(7, 70, M_DEBUG) /* show low frequency info from reliable layer */
+#define D_FRAG_DEBUG LOGLEV(7, 70, M_DEBUG) /* show fragment debugging info */
+#define D_WIN32_IO_LOW LOGLEV(7, 70, M_DEBUG) /* low freq win32 I/O debugging info */
+#define D_MTU_DEBUG LOGLEV(7, 70, M_DEBUG) /* show MTU debugging info */
+#define D_MULTI_DEBUG LOGLEV(7, 70, M_DEBUG) /* show medium-freq multi debugging info */
+#define D_MSS LOGLEV(7, 70, M_DEBUG) /* show MSS adjustments */
+#define D_COMP_LOW LOGLEV(7, 70, M_DEBUG) /* show adaptive compression state changes */
+#define D_CONNECTION_LIST LOGLEV(7, 70, M_DEBUG) /* show <connection> list info */
+#define D_SCRIPT LOGLEV(7, 70, M_DEBUG) /* show parms & env vars passed to scripts */
+#define D_SHOW_NET LOGLEV(7, 70, M_DEBUG) /* show routing table and adapter list */
+#define D_ROUTE_DEBUG LOGLEV(7, 70, M_DEBUG) /* show verbose route.[ch] output */
+#define D_TLS_STATE_ERRORS LOGLEV(7, 70, M_DEBUG) /* no TLS state for client */
+#define D_SEMAPHORE_LOW LOGLEV(7, 70, M_DEBUG) /* show Win32 semaphore waits (low freq) */
+#define D_SEMAPHORE LOGLEV(7, 70, M_DEBUG) /* show Win32 semaphore waits */
+#define D_TEST_FILE LOGLEV(7, 70, M_DEBUG) /* show test_file() calls */
+#define D_MANAGEMENT_DEBUG LOGLEV(3, 70, M_DEBUG) /* show --management debug info */
+#define D_PLUGIN_DEBUG LOGLEV(7, 70, M_DEBUG) /* show verbose plugin calls */
+#define D_SOCKET_DEBUG LOGLEV(7, 70, M_DEBUG) /* show socket.[ch] debugging info */
+#define D_SHOW_PKCS11 LOGLEV(7, 70, M_DEBUG) /* show PKCS#11 actions */
+#define D_ALIGN_DEBUG LOGLEV(7, 70, M_DEBUG) /* show verbose struct alignment info */
+#define D_PACKET_TRUNC_DEBUG LOGLEV(7, 70, M_DEBUG) /* PACKET_TRUNCATION_CHECK verbose */
+#define D_PING LOGLEV(7, 70, M_DEBUG) /* PING send/receive messages */
+#define D_PS_PROXY_DEBUG LOGLEV(7, 70, M_DEBUG) /* port share proxy debug */
+#define D_AUTO_USERID LOGLEV(7, 70, M_DEBUG) /* AUTO_USERID debugging */
+#define D_TLS_KEYSELECT LOGLEV(7, 70, M_DEBUG) /* show information on key selection for data channel */
+#define D_ARGV_PARSE_CMD LOGLEV(7, 70, M_DEBUG) /* show parse_line() errors in argv_printf %sc */
+#define D_CRYPTO_DEBUG LOGLEV(7, 70, M_DEBUG) /* show detailed info from crypto.c routines */
+#define D_PID_DEBUG LOGLEV(7, 70, M_DEBUG) /* show packet-id debugging info */
+#define D_PF_DROPPED_BCAST LOGLEV(7, 71, M_DEBUG) /* packet filter dropped a broadcast packet */
+#define D_PF_DEBUG LOGLEV(7, 72, M_DEBUG) /* packet filter debugging, must also define PF_DEBUG in pf.h */
+
+#define D_HANDSHAKE_VERBOSE LOGLEV(8, 70, M_DEBUG) /* show detailed description of each handshake */
+#define D_TLS_DEBUG_MED LOGLEV(8, 70, M_DEBUG) /* limited info from tls_session routines */
+#define D_INTERVAL LOGLEV(8, 70, M_DEBUG) /* show interval.h debugging info */
+#define D_SCHEDULER LOGLEV(8, 70, M_DEBUG) /* show scheduler debugging info */
+#define D_GREMLIN_VERBOSE LOGLEV(8, 70, M_DEBUG) /* show verbose info from gremlin module */
+#define D_REL_DEBUG LOGLEV(8, 70, M_DEBUG) /* show detailed info from reliable routines */
+#define D_EVENT_WAIT LOGLEV(8, 70, M_DEBUG) /* show detailed info from event waits */
+#define D_MULTI_TCP LOGLEV(8, 70, M_DEBUG) /* show debug info from mtcp.c */
+
+#define D_TLS_DEBUG LOGLEV(9, 70, M_DEBUG) /* show detailed info from TLS routines */
+#define D_COMP LOGLEV(9, 70, M_DEBUG) /* show compression info */
+#define D_READ_WRITE LOGLEV(9, 70, M_DEBUG) /* show all tun/tcp/udp reads/writes/opens */
+#define D_PACKET_CONTENT LOGLEV(9, 70, M_DEBUG) /* show before/after encryption packet content */
+#define D_TLS_NO_SEND_KEY LOGLEV(9, 70, M_DEBUG) /* show when no data channel send-key exists */
+#define D_PID_PERSIST_DEBUG LOGLEV(9, 70, M_DEBUG) /* show packet-id persist debugging info */
+#define D_LINK_RW_VERBOSE LOGLEV(9, 70, M_DEBUG) /* show link reads/writes with greater verbosity */
+#define D_STREAM_DEBUG LOGLEV(9, 70, M_DEBUG) /* show TCP stream debug info */
+#define D_WIN32_IO LOGLEV(9, 70, M_DEBUG) /* win32 I/O debugging info */
+#define D_PKCS11_DEBUG LOGLEV(9, 70, M_DEBUG) /* show PKCS#11 debugging */
+
+#define D_SHAPER_DEBUG LOGLEV(10, 70, M_DEBUG) /* show traffic shaper info */
+
+#define D_REGISTRY LOGLEV(11, 70, M_DEBUG) /* win32 registry debugging info */
+#define D_OPENSSL_LOCK LOGLEV(11, 70, M_DEBUG) /* show OpenSSL locks */
+
+/*#define D_THREAD_DEBUG LOGLEV(4, 70, M_DEBUG)*/ /* show pthread debug information */
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/error.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/error.c
new file mode 100644
index 00000000..af865f32
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/error.c
@@ -0,0 +1,919 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "error.h"
+#include "buffer.h"
+#include "misc.h"
+#include "win32.h"
+#include "socket.h"
+#include "tun.h"
+#include "otime.h"
+#include "perf.h"
+#include "status.h"
+#include "integer.h"
+#include "ps.h"
+#include "mstats.h"
+
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include <openssl/err.h>
+#endif
+#endif
+
+#include "memdbg.h"
+
+#if SYSLOG_CAPABILITY
+#ifndef LOG_OPENVPN
+#define LOG_OPENVPN LOG_DAEMON
+#endif
+#endif
+
+#ifdef GOOGLE_BREAKPAD
+#include "breakpad.h"
+#endif
+
+/* Globals */
+unsigned int x_debug_level; /* GLOBAL */
+
+/* Mute state */
+static int mute_cutoff; /* GLOBAL */
+static int mute_count; /* GLOBAL */
+static int mute_category; /* GLOBAL */
+
+/*
+ * Output mode priorities are as follows:
+ *
+ * (1) --log-x overrides everything
+ * (2) syslog is used if --daemon or --inetd is defined and not --log-x
+ * (3) if OPENVPN_DEBUG_COMMAND_LINE is defined, output
+ * to constant logfile name.
+ * (4) Output to stdout.
+ */
+
+/* If true, indicates that stdin/stdout/stderr
+ have been redirected due to --log */
+static bool std_redir; /* GLOBAL */
+
+/* Should messages be written to the syslog? */
+static bool use_syslog; /* GLOBAL */
+
+/* Should stdout/stderr be be parsable and always be prefixed with time
+ * and message flags */
+static bool machine_readable_output; /* GLOBAL */
+
+/* Should timestamps be included on messages to stdout/stderr? */
+static bool suppress_timestamps; /* GLOBAL */
+
+/* The program name passed to syslog */
+#if SYSLOG_CAPABILITY
+static char *pgmname_syslog; /* GLOBAL */
+#endif
+
+/* If non-null, messages should be written here (used for debugging only) */
+static FILE *msgfp; /* GLOBAL */
+
+/* If true, we forked from main OpenVPN process */
+static bool forked; /* GLOBAL */
+
+/* our default output targets */
+static FILE *default_out; /* GLOBAL */
+static FILE *default_err; /* GLOBAL */
+
+void
+msg_forked (void)
+{
+ forked = true;
+}
+
+bool
+set_debug_level (const int level, const unsigned int flags)
+{
+ const int ceiling = 15;
+
+ if (level >= 0 && level <= ceiling)
+ {
+ x_debug_level = level;
+ return true;
+ }
+ else if (flags & SDL_CONSTRAIN)
+ {
+ x_debug_level = constrain_int (level, 0, ceiling);
+ return true;
+ }
+ return false;
+}
+
+bool
+set_mute_cutoff (const int cutoff)
+{
+ if (cutoff >= 0)
+ {
+ mute_cutoff = cutoff;
+ return true;
+ }
+ else
+ return false;
+}
+
+int
+get_debug_level (void)
+{
+ return x_debug_level;
+}
+
+int
+get_mute_cutoff (void)
+{
+ return mute_cutoff;
+}
+
+void
+set_suppress_timestamps (bool suppressed)
+{
+ suppress_timestamps = suppressed;
+}
+
+void
+set_machine_readable_output (bool parsable)
+{
+ machine_readable_output = parsable;
+}
+
+void
+error_reset ()
+{
+ use_syslog = std_redir = false;
+ suppress_timestamps = false;
+ machine_readable_output = false;
+ x_debug_level = 1;
+ mute_cutoff = 0;
+ mute_count = 0;
+ mute_category = 0;
+ default_out = OPENVPN_MSG_FP;
+ default_err = OPENVPN_MSG_FP;
+
+#ifdef OPENVPN_DEBUG_COMMAND_LINE
+ msgfp = fopen (OPENVPN_DEBUG_FILE, "w");
+ if (!msgfp)
+ openvpn_exit (OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE); /* exit point */
+#else
+ msgfp = NULL;
+#endif
+}
+
+void
+errors_to_stderr (void)
+{
+ default_err = OPENVPN_ERROR_FP;
+}
+
+/*
+ * Return a file to print messages to before syslog is opened.
+ */
+FILE *
+msg_fp(const unsigned int flags)
+{
+ FILE *fp = msgfp;
+ if (!fp)
+ fp = (flags & (M_FATAL|M_USAGE_SMALL)) ? default_err : default_out;
+ if (!fp)
+ openvpn_exit (OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE); /* exit point */
+ return fp;
+}
+
+#define SWAP { tmp = m1; m1 = m2; m2 = tmp; }
+
+int x_msg_line_num; /* GLOBAL */
+
+void x_msg (const unsigned int flags, const char *format, ...)
+{
+ va_list arglist;
+ va_start (arglist, format);
+ x_msg_va (flags, format, arglist);
+ va_end (arglist);
+}
+
+void x_msg_va (const unsigned int flags, const char *format, va_list arglist)
+{
+ struct gc_arena gc;
+#if SYSLOG_CAPABILITY
+ int level;
+#endif
+ char *m1;
+ char *m2;
+ char *tmp;
+ int e;
+ const char *prefix;
+ const char *prefix_sep;
+
+ void usage_small (void);
+
+#ifndef HAVE_VARARG_MACROS
+ /* the macro has checked this otherwise */
+ if (!MSG_TEST (flags))
+ return;
+#endif
+
+ e = openvpn_errno ();
+
+ /*
+ * Apply muting filter.
+ */
+#ifndef HAVE_VARARG_MACROS
+ /* the macro has checked this otherwise */
+ if (!dont_mute (flags))
+ return;
+#endif
+
+ gc_init (&gc);
+
+ m1 = (char *) gc_malloc (ERR_BUF_SIZE, false, &gc);
+ m2 = (char *) gc_malloc (ERR_BUF_SIZE, false, &gc);
+
+ vsnprintf (m1, ERR_BUF_SIZE, format, arglist);
+ m1[ERR_BUF_SIZE - 1] = 0; /* windows vsnprintf needs this */
+
+ if ((flags & M_ERRNO) && e)
+ {
+ openvpn_snprintf (m2, ERR_BUF_SIZE, "%s: %s (errno=%d)",
+ m1, strerror_ts (e, &gc), e);
+ SWAP;
+ }
+
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_CRYPTO_OPENSSL
+ if (flags & M_SSL)
+ {
+ int nerrs = 0;
+ size_t err;
+ while ((err = ERR_get_error ()))
+ {
+ openvpn_snprintf (m2, ERR_BUF_SIZE, "%s: %s",
+ m1, ERR_error_string (err, NULL));
+ SWAP;
+ ++nerrs;
+ }
+ if (!nerrs)
+ {
+ openvpn_snprintf (m2, ERR_BUF_SIZE, "%s (OpenSSL)", m1);
+ SWAP;
+ }
+ }
+#endif
+#endif
+
+ if (flags & M_OPTERR)
+ {
+ openvpn_snprintf (m2, ERR_BUF_SIZE, "Options error: %s", m1);
+ SWAP;
+ }
+
+#if SYSLOG_CAPABILITY
+ if (flags & (M_FATAL|M_NONFATAL|M_USAGE_SMALL))
+ level = LOG_ERR;
+ else if (flags & M_WARN)
+ level = LOG_WARNING;
+ else
+ level = LOG_NOTICE;
+#endif
+
+ /* set up client prefix */
+ if (flags & M_NOIPREFIX)
+ prefix = NULL;
+ else
+ prefix = msg_get_prefix ();
+ prefix_sep = " ";
+ if (!prefix)
+ prefix_sep = prefix = "";
+
+ /* virtual output capability used to copy output to management subsystem */
+ if (!forked)
+ {
+ const struct virtual_output *vo = msg_get_virtual_output ();
+ if (vo)
+ {
+ openvpn_snprintf (m2, ERR_BUF_SIZE, "%s%s%s",
+ prefix,
+ prefix_sep,
+ m1);
+ virtual_output_print (vo, flags, m2);
+ }
+ }
+
+ if (!(flags & M_MSG_VIRT_OUT))
+ {
+ if (use_syslog && !std_redir && !forked)
+ {
+#if SYSLOG_CAPABILITY
+ syslog (level, "%s%s%s",
+ prefix,
+ prefix_sep,
+ m1);
+#endif
+ }
+ else
+ {
+ FILE *fp = msg_fp(flags);
+ const bool show_usec = check_debug_level (DEBUG_LEVEL_USEC_TIME);
+
+ if (machine_readable_output)
+ {
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+
+ fprintf (fp, "%lu.%06lu %x %s%s%s%s",
+ tv.tv_sec,
+ tv.tv_usec,
+ flags,
+ prefix,
+ prefix_sep,
+ m1,
+ "\n");
+
+ }
+ else if ((flags & M_NOPREFIX) || suppress_timestamps)
+ {
+ fprintf (fp, "%s%s%s%s",
+ prefix,
+ prefix_sep,
+ m1,
+ (flags&M_NOLF) ? "" : "\n");
+ }
+ else
+ {
+ fprintf (fp, "%s %s%s%s%s",
+ time_string (0, 0, show_usec, &gc),
+ prefix,
+ prefix_sep,
+ m1,
+ (flags&M_NOLF) ? "" : "\n");
+ }
+ fflush(fp);
+ ++x_msg_line_num;
+ }
+ }
+
+ if (flags & M_FATAL)
+ msg (M_INFO, "Exiting due to fatal error");
+
+ if (flags & M_FATAL)
+ openvpn_exit (OPENVPN_EXIT_STATUS_ERROR); /* exit point */
+
+ if (flags & M_USAGE_SMALL)
+ usage_small ();
+
+ gc_free (&gc);
+}
+
+/*
+ * Apply muting filter.
+ */
+bool
+dont_mute (unsigned int flags)
+{
+ bool ret = true;
+ if (mute_cutoff > 0 && !(flags & M_NOMUTE))
+ {
+ const int mute_level = DECODE_MUTE_LEVEL (flags);
+ if (mute_level > 0 && mute_level == mute_category)
+ {
+ if (mute_count == mute_cutoff)
+ msg (M_INFO | M_NOMUTE, "NOTE: --mute triggered...");
+ if (++mute_count > mute_cutoff)
+ ret = false;
+ }
+ else
+ {
+ const int suppressed = mute_count - mute_cutoff;
+ if (suppressed > 0)
+ msg (M_INFO | M_NOMUTE,
+ "%d variation(s) on previous %d message(s) suppressed by --mute",
+ suppressed,
+ mute_cutoff);
+ mute_count = 1;
+ mute_category = mute_level;
+ }
+ }
+ return ret;
+}
+
+void
+assert_failed (const char *filename, int line)
+{
+#ifdef GOOGLE_BREAKPAD
+ breakpad_dodump();
+#endif
+ msg (M_FATAL, "Assertion failed at %s:%d", filename, line);
+}
+
+/*
+ * Fail memory allocation. Don't use msg() because it tries
+ * to allocate memory as part of its operation.
+ */
+void
+out_of_memory (void)
+{
+ fprintf (stderr, PACKAGE_NAME ": Out of Memory\n");
+ exit (1);
+}
+
+void
+open_syslog (const char *pgmname, bool stdio_to_null)
+{
+#if SYSLOG_CAPABILITY
+ if (!msgfp && !std_redir)
+ {
+ if (!use_syslog)
+ {
+ pgmname_syslog = string_alloc (pgmname ? pgmname : PACKAGE, NULL);
+ openlog (pgmname_syslog, LOG_PID, LOG_OPENVPN);
+ use_syslog = true;
+
+ /* Better idea: somehow pipe stdout/stderr output to msg() */
+ if (stdio_to_null)
+ set_std_files_to_null (false);
+ }
+ }
+#else
+ msg (M_WARN, "Warning on use of --daemon/--inetd: this operating system lacks daemon logging features, therefore when I become a daemon, I won't be able to log status or error messages");
+#endif
+}
+
+void
+close_syslog ()
+{
+#if SYSLOG_CAPABILITY
+ if (use_syslog)
+ {
+ closelog();
+ use_syslog = false;
+ if (pgmname_syslog)
+ {
+ free (pgmname_syslog);
+ pgmname_syslog = NULL;
+ }
+ }
+#endif
+}
+
+#ifdef WIN32
+
+static HANDLE orig_stderr;
+
+HANDLE
+get_orig_stderr (void)
+{
+ if (orig_stderr)
+ return orig_stderr;
+ else
+ return GetStdHandle (STD_ERROR_HANDLE);
+}
+
+#endif
+
+void
+redirect_stdout_stderr (const char *file, bool append)
+{
+#if defined(WIN32)
+ if (!std_redir)
+ {
+ struct gc_arena gc = gc_new ();
+ HANDLE log_handle;
+ int log_fd;
+
+ SECURITY_ATTRIBUTES saAttr;
+ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
+ saAttr.bInheritHandle = TRUE;
+ saAttr.lpSecurityDescriptor = NULL;
+
+ log_handle = CreateFileW (wide_string (file, &gc),
+ GENERIC_WRITE,
+ FILE_SHARE_READ,
+ &saAttr,
+ append ? OPEN_ALWAYS : CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+
+ gc_free (&gc);
+
+ if (log_handle == INVALID_HANDLE_VALUE)
+ {
+ msg (M_WARN|M_ERRNO, "Warning: cannot open --log file: %s", file);
+ return;
+ }
+
+ /* append to logfile? */
+ if (append)
+ {
+ if (SetFilePointer (log_handle, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER)
+ msg (M_ERR, "Error: cannot seek to end of --log file: %s", file);
+ }
+
+ /* save original stderr for password prompts */
+ orig_stderr = GetStdHandle (STD_ERROR_HANDLE);
+
+#if 0 /* seems not be necessary with stdout/stderr redirection below*/
+ /* set up for redirection */
+ if (!SetStdHandle (STD_OUTPUT_HANDLE, log_handle)
+ || !SetStdHandle (STD_ERROR_HANDLE, log_handle))
+ msg (M_ERR, "Error: cannot redirect stdout/stderr to --log file: %s", file);
+#endif
+
+ /* direct stdout/stderr to point to log_handle */
+ log_fd = _open_osfhandle ((intptr_t)log_handle, _O_TEXT);
+ if (log_fd == -1)
+ msg (M_ERR, "Error: --log redirect failed due to _open_osfhandle failure");
+
+ /* open log_handle as FILE stream */
+ ASSERT (msgfp == NULL);
+ msgfp = _fdopen (log_fd, "wt");
+ if (msgfp == NULL)
+ msg (M_ERR, "Error: --log redirect failed due to _fdopen");
+
+ /* redirect C-library stdout/stderr to log file */
+ if (_dup2 (log_fd, 1) == -1 || _dup2 (log_fd, 2) == -1)
+ msg (M_WARN, "Error: --log redirect of stdout/stderr failed");
+
+ std_redir = true;
+ }
+#elif defined(HAVE_DUP2)
+ if (!std_redir)
+ {
+ int out = open (file,
+ O_CREAT | O_WRONLY | (append ? O_APPEND : O_TRUNC),
+ S_IRUSR | S_IWUSR);
+
+ if (out < 0)
+ {
+ msg (M_WARN|M_ERRNO, "Warning: Error redirecting stdout/stderr to --log file: %s", file);
+ return;
+ }
+
+ if (dup2 (out, 1) == -1)
+ msg (M_ERR, "--log file redirection error on stdout");
+ if (dup2 (out, 2) == -1)
+ msg (M_ERR, "--log file redirection error on stderr");
+
+ if (out > 2)
+ close (out);
+
+ std_redir = true;
+ }
+
+#else
+ msg (M_WARN, "WARNING: The --log option is not supported on this OS because it lacks the dup2 function");
+#endif
+}
+
+/*
+ * Functions used to check return status
+ * of I/O operations.
+ */
+
+unsigned int x_cs_info_level; /* GLOBAL */
+unsigned int x_cs_verbose_level; /* GLOBAL */
+unsigned int x_cs_err_delay_ms; /* GLOBAL */
+
+void
+reset_check_status ()
+{
+ x_cs_info_level = 0;
+ x_cs_verbose_level = 0;
+}
+
+void
+set_check_status (unsigned int info_level, unsigned int verbose_level)
+{
+ x_cs_info_level = info_level;
+ x_cs_verbose_level = verbose_level;
+}
+
+/*
+ * Called after most socket or tun/tap operations, via the inline
+ * function check_status().
+ *
+ * Decide if we should print an error message, and see if we can
+ * extract any useful info from the error, such as a Path MTU hint
+ * from the OS.
+ */
+void
+x_check_status (int status,
+ const char *description,
+ struct link_socket *sock,
+ struct tuntap *tt)
+{
+ const int my_errno = openvpn_errno ();
+ const char *extended_msg = NULL;
+
+ msg (x_cs_verbose_level, "%s %s returned %d",
+ sock ? proto2ascii (sock->info.proto, sock->info.af, true) : "",
+ description,
+ status);
+
+ if (status < 0)
+ {
+ struct gc_arena gc = gc_new ();
+#if EXTENDED_SOCKET_ERROR_CAPABILITY
+ /* get extended socket error message and possible PMTU hint from OS */
+ if (sock)
+ {
+ int mtu;
+ extended_msg = format_extended_socket_error (sock->sd, &mtu, &gc);
+ if (mtu > 0 && sock->mtu != mtu)
+ {
+ sock->mtu = mtu;
+ sock->info.mtu_changed = true;
+ }
+ }
+#elif defined(WIN32)
+ /* get possible driver error from TAP-Windows driver */
+ extended_msg = tap_win_getinfo (tt, &gc);
+#endif
+ if (!ignore_sys_error (my_errno))
+ {
+ if (extended_msg)
+ msg (x_cs_info_level, "%s %s [%s]: %s (code=%d)",
+ description,
+ sock ? proto2ascii (sock->info.proto, sock->info.af, true) : "",
+ extended_msg,
+ strerror_ts (my_errno, &gc),
+ my_errno);
+ else
+ msg (x_cs_info_level, "%s %s: %s (code=%d)",
+ description,
+ sock ? proto2ascii (sock->info.proto, sock->info.af, true) : "",
+ strerror_ts (my_errno, &gc),
+ my_errno);
+
+ if (x_cs_err_delay_ms)
+ platform_sleep_milliseconds (x_cs_err_delay_ms);
+ }
+ gc_free (&gc);
+ }
+}
+
+/*
+ * In multiclient mode, put a client-specific prefix
+ * before each message.
+ */
+const char *x_msg_prefix; /* GLOBAL */
+
+/*
+ * Allow MSG to be redirected through a virtual_output object
+ */
+
+const struct virtual_output *x_msg_virtual_output; /* GLOBAL */
+
+/*
+ * Exiting.
+ */
+
+void
+openvpn_exit (const int status)
+{
+ if (!forked)
+ {
+ void tun_abort();
+#ifdef ENABLE_PLUGIN
+ void plugin_abort (void);
+#endif
+
+ tun_abort();
+
+#ifdef WIN32
+ uninit_win32 ();
+#endif
+
+ close_syslog ();
+
+#ifdef ENABLE_PLUGIN
+ plugin_abort ();
+#endif
+
+#if PORT_SHARE
+ if (port_share)
+ port_share_abort (port_share);
+#endif
+
+#ifdef ENABLE_MEMSTATS
+ mstats_close();
+#endif
+
+#ifdef ABORT_ON_ERROR
+ if (status == OPENVPN_EXIT_STATUS_ERROR)
+ abort ();
+#endif
+
+ if (status == OPENVPN_EXIT_STATUS_GOOD)
+ perf_output_results ();
+ }
+
+ exit (status);
+}
+
+/*
+ * Translate msg flags into a string
+ */
+const char *
+msg_flags_string (const unsigned int flags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (16, gc);
+ if (flags == M_INFO)
+ buf_printf (&out, "I");
+ if (flags & M_FATAL)
+ buf_printf (&out, "F");
+ if (flags & M_NONFATAL)
+ buf_printf (&out, "N");
+ if (flags & M_WARN)
+ buf_printf (&out, "W");
+ if (flags & M_DEBUG)
+ buf_printf (&out, "D");
+ return BSTR (&out);
+}
+
+#ifdef ENABLE_DEBUG
+void
+crash (void)
+{
+ char *null = NULL;
+ *null = 0;
+}
+#endif
+
+#ifdef WIN32
+
+const char *
+strerror_win32 (DWORD errnum, struct gc_arena *gc)
+{
+ /*
+ * This code can be omitted, though often the Windows
+ * WSA error messages are less informative than the
+ * Posix equivalents.
+ */
+#if 1
+ switch (errnum) {
+ /*
+ * When the TAP-Windows driver returns STATUS_UNSUCCESSFUL, this code
+ * gets returned to user space.
+ */
+ case ERROR_GEN_FAILURE:
+ return "General failure (ERROR_GEN_FAILURE)";
+ case ERROR_IO_PENDING:
+ return "I/O Operation in progress (ERROR_IO_PENDING)";
+ case WSA_IO_INCOMPLETE:
+ return "I/O Operation in progress (WSA_IO_INCOMPLETE)";
+ case WSAEINTR:
+ return "Interrupted system call (WSAEINTR)";
+ case WSAEBADF:
+ return "Bad file number (WSAEBADF)";
+ case WSAEACCES:
+ return "Permission denied (WSAEACCES)";
+ case WSAEFAULT:
+ return "Bad address (WSAEFAULT)";
+ case WSAEINVAL:
+ return "Invalid argument (WSAEINVAL)";
+ case WSAEMFILE:
+ return "Too many open files (WSAEMFILE)";
+ case WSAEWOULDBLOCK:
+ return "Operation would block (WSAEWOULDBLOCK)";
+ case WSAEINPROGRESS:
+ return "Operation now in progress (WSAEINPROGRESS)";
+ case WSAEALREADY:
+ return "Operation already in progress (WSAEALREADY)";
+ case WSAEDESTADDRREQ:
+ return "Destination address required (WSAEDESTADDRREQ)";
+ case WSAEMSGSIZE:
+ return "Message too long (WSAEMSGSIZE)";
+ case WSAEPROTOTYPE:
+ return "Protocol wrong type for socket (WSAEPROTOTYPE)";
+ case WSAENOPROTOOPT:
+ return "Bad protocol option (WSAENOPROTOOPT)";
+ case WSAEPROTONOSUPPORT:
+ return "Protocol not supported (WSAEPROTONOSUPPORT)";
+ case WSAESOCKTNOSUPPORT:
+ return "Socket type not supported (WSAESOCKTNOSUPPORT)";
+ case WSAEOPNOTSUPP:
+ return "Operation not supported on socket (WSAEOPNOTSUPP)";
+ case WSAEPFNOSUPPORT:
+ return "Protocol family not supported (WSAEPFNOSUPPORT)";
+ case WSAEAFNOSUPPORT:
+ return "Address family not supported by protocol family (WSAEAFNOSUPPORT)";
+ case WSAEADDRINUSE:
+ return "Address already in use (WSAEADDRINUSE)";
+ case WSAENETDOWN:
+ return "Network is down (WSAENETDOWN)";
+ case WSAENETUNREACH:
+ return "Network is unreachable (WSAENETUNREACH)";
+ case WSAENETRESET:
+ return "Net dropped connection or reset (WSAENETRESET)";
+ case WSAECONNABORTED:
+ return "Software caused connection abort (WSAECONNABORTED)";
+ case WSAECONNRESET:
+ return "Connection reset by peer (WSAECONNRESET)";
+ case WSAENOBUFS:
+ return "No buffer space available (WSAENOBUFS)";
+ case WSAEISCONN:
+ return "Socket is already connected (WSAEISCONN)";
+ case WSAENOTCONN:
+ return "Socket is not connected (WSAENOTCONN)";
+ case WSAETIMEDOUT:
+ return "Connection timed out (WSAETIMEDOUT)";
+ case WSAECONNREFUSED:
+ return "Connection refused (WSAECONNREFUSED)";
+ case WSAELOOP:
+ return "Too many levels of symbolic links (WSAELOOP)";
+ case WSAENAMETOOLONG:
+ return "File name too long (WSAENAMETOOLONG)";
+ case WSAEHOSTDOWN:
+ return "Host is down (WSAEHOSTDOWN)";
+ case WSAEHOSTUNREACH:
+ return "No Route to Host (WSAEHOSTUNREACH)";
+ case WSAENOTEMPTY:
+ return "Directory not empty (WSAENOTEMPTY)";
+ case WSAEPROCLIM:
+ return "Too many processes (WSAEPROCLIM)";
+ case WSAEUSERS:
+ return "Too many users (WSAEUSERS)";
+ case WSAEDQUOT:
+ return "Disc Quota Exceeded (WSAEDQUOT)";
+ case WSAESTALE:
+ return "Stale NFS file handle (WSAESTALE)";
+ case WSASYSNOTREADY:
+ return "Network SubSystem is unavailable (WSASYSNOTREADY)";
+ case WSAVERNOTSUPPORTED:
+ return "WINSOCK DLL Version out of range (WSAVERNOTSUPPORTED)";
+ case WSANOTINITIALISED:
+ return "Successful WSASTARTUP not yet performed (WSANOTINITIALISED)";
+ case WSAEREMOTE:
+ return "Too many levels of remote in path (WSAEREMOTE)";
+ case WSAHOST_NOT_FOUND:
+ return "Host not found (WSAHOST_NOT_FOUND)";
+ default:
+ break;
+ }
+#endif
+
+ /* format a windows error message */
+ {
+ char message[256];
+ struct buffer out = alloc_buf_gc (256, gc);
+ const int status = FormatMessage (
+ FORMAT_MESSAGE_IGNORE_INSERTS
+ | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ NULL,
+ errnum,
+ 0,
+ message,
+ sizeof (message),
+ NULL);
+ if (!status)
+ {
+ buf_printf (&out, "[Unknown Win32 Error]");
+ }
+ else
+ {
+ char *cp;
+ for (cp = message; *cp != '\0'; ++cp)
+ {
+ if (*cp == '\n' || *cp == '\r')
+ *cp = ' ';
+ }
+
+ buf_printf(&out, "%s", message);
+ }
+
+ return BSTR (&out);
+ }
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/error.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/error.h
new file mode 100644
index 00000000..1e1f2acf
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/error.h
@@ -0,0 +1,359 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#include "basic.h"
+
+/* #define ABORT_ON_ERROR */
+
+#ifdef ENABLE_PKCS11
+#define ERR_BUF_SIZE 8192
+#else
+#define ERR_BUF_SIZE 1280
+#endif
+
+struct gc_arena;
+
+/*
+ * Where should messages be printed before syslog is opened?
+ * Not used if OPENVPN_DEBUG_COMMAND_LINE is defined.
+ */
+#define OPENVPN_MSG_FP stdout
+#define OPENVPN_ERROR_FP stderr
+
+/*
+ * Exit status codes
+ */
+
+#define OPENVPN_EXIT_STATUS_GOOD 0
+#define OPENVPN_EXIT_STATUS_ERROR 1
+#define OPENVPN_EXIT_STATUS_USAGE 1
+#define OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE 1
+
+/*
+ * Special command line debugging mode.
+ * If OPENVPN_DEBUG_COMMAND_LINE
+ * is defined, contents of argc/argv will
+ * be dumped to OPENVPN_DEBUG_FILE as well
+ * as all other OpenVPN messages.
+ */
+
+/* #define OPENVPN_DEBUG_COMMAND_LINE */
+#define OPENVPN_DEBUG_FILE PACKAGE ".log"
+
+/* String and Error functions */
+
+#ifdef WIN32
+# define openvpn_errno() GetLastError()
+# define openvpn_strerror(e, gc) strerror_win32(e, gc)
+ const char *strerror_win32 (DWORD errnum, struct gc_arena *gc);
+#else
+# define openvpn_errno() errno
+# define openvpn_strerror(x, gc) strerror(x)
+#endif
+
+/*
+ * These globals should not be accessed directly,
+ * but rather through macros or inline functions defined below.
+ */
+extern unsigned int x_debug_level;
+extern int x_msg_line_num;
+
+/* msg() flags */
+
+#define M_DEBUG_LEVEL (0x0F) /* debug level mask */
+
+#define M_FATAL (1<<4) /* exit program */
+#define M_NONFATAL (1<<5) /* non-fatal error */
+#define M_WARN (1<<6) /* call syslog with LOG_WARNING */
+#define M_DEBUG (1<<7)
+
+#define M_ERRNO (1<<8) /* show errno description */
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+# define M_SSL (1<<10) /* show SSL error */
+#endif
+
+#define M_NOMUTE (1<<11) /* don't do mute processing */
+#define M_NOPREFIX (1<<12) /* don't show date/time prefix */
+#define M_USAGE_SMALL (1<<13) /* fatal options error, call usage_small */
+#define M_MSG_VIRT_OUT (1<<14) /* output message through msg_status_output callback */
+#define M_OPTERR (1<<15) /* print "Options error:" prefix */
+#define M_NOLF (1<<16) /* don't print new line */
+#define M_NOIPREFIX (1<<17) /* don't print instance prefix */
+
+/* flag combinations which are frequently used */
+#define M_ERR (M_FATAL | M_ERRNO)
+#define M_SSLERR (M_FATAL | M_SSL)
+#define M_USAGE (M_USAGE_SMALL | M_NOPREFIX | M_OPTERR)
+#define M_CLIENT (M_MSG_VIRT_OUT | M_NOMUTE | M_NOIPREFIX)
+
+/*
+ * Mute levels are designed to avoid large numbers of
+ * mostly similar messages clogging the log file.
+ *
+ * A mute level of 0 is always printed.
+ */
+#define MUTE_LEVEL_SHIFT 24
+#define MUTE_LEVEL_MASK 0xFF
+
+#define ENCODE_MUTE_LEVEL(mute_level) (((mute_level) & MUTE_LEVEL_MASK) << MUTE_LEVEL_SHIFT)
+#define DECODE_MUTE_LEVEL(flags) (((flags) >> MUTE_LEVEL_SHIFT) & MUTE_LEVEL_MASK)
+
+/*
+ * log_level: verbosity level n (--verb n) must be >= log_level to print.
+ * mute_level: don't print more than n (--mute n) consecutive messages at
+ * a given mute level, or if 0 disable muting and print everything.
+ *
+ * Mask map:
+ * Bits 0-3: log level
+ * Bits 4-23: M_x flags
+ * Bits 24-31: mute level
+ */
+#define LOGLEV(log_level, mute_level, other) ((log_level) | ENCODE_MUTE_LEVEL(mute_level) | other)
+
+/*
+ * If compiler supports variable arguments in macros, define
+ * msg() as a macro for optimization win.
+ */
+
+bool dont_mute (unsigned int flags); /* check muting filter */
+
+#define MSG_TEST(flags) (unlikely((((unsigned int)flags) & M_DEBUG_LEVEL) <= x_debug_level) && dont_mute (flags))
+
+#if defined(HAVE_CPP_VARARG_MACRO_ISO) && !defined(__LCLINT__)
+# define HAVE_VARARG_MACROS
+# define msg(flags, ...) do { if (MSG_TEST(flags)) x_msg((flags), __VA_ARGS__); } while (false)
+# ifdef ENABLE_DEBUG
+# define dmsg(flags, ...) do { if (MSG_TEST(flags)) x_msg((flags), __VA_ARGS__); } while (false)
+# else
+# define dmsg(flags, ...)
+# endif
+#elif defined(HAVE_CPP_VARARG_MACRO_GCC) && !defined(__LCLINT__)
+# define HAVE_VARARG_MACROS
+# define msg(flags, args...) do { if (MSG_TEST(flags)) x_msg((flags), args); } while (false)
+# ifdef ENABLE_DEBUG
+# define dmsg(flags, args...) do { if (MSG_TEST(flags)) x_msg((flags), args); } while (false)
+# else
+# define dmsg(flags, args...)
+# endif
+#else
+# if !PEDANTIC
+# ifdef _MSC_VER
+# pragma message("this compiler appears to lack vararg macros which will cause a significant degradation in efficiency")
+# else
+# warning this compiler appears to lack vararg macros which will cause a significant degradation in efficiency (you can ignore this warning if you are using LCLINT)
+# endif
+# endif
+# define msg x_msg
+# define dmsg x_msg
+#endif
+
+void x_msg (const unsigned int flags, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+ __attribute__ ((format (__printf__, 2, 3)))
+#endif
+#endif
+ ; /* should be called via msg above */
+
+void x_msg_va (const unsigned int flags, const char *format, va_list arglist);
+
+/*
+ * Function prototypes
+ */
+
+void error_reset (void);
+
+/* route errors to stderr that would normally go to stdout */
+void errors_to_stderr (void);
+
+void set_suppress_timestamps (bool suppressed);
+void set_machine_readable_output (bool parsable);
+
+
+#define SDL_CONSTRAIN (1<<0)
+bool set_debug_level (const int level, const unsigned int flags);
+
+bool set_mute_cutoff (const int cutoff);
+
+int get_debug_level (void);
+int get_mute_cutoff (void);
+
+const char *msg_flags_string (const unsigned int flags, struct gc_arena *gc);
+
+/*
+ * File to print messages to before syslog is opened.
+ */
+FILE *msg_fp(const unsigned int flags);
+
+/* Fatal logic errors */
+#define ASSERT(x) do { if (!(x)) assert_failed(__FILE__, __LINE__); } while (false)
+
+void assert_failed (const char *filename, int line);
+
+#ifdef ENABLE_DEBUG
+void crash (void); /* force a segfault (debugging only) */
+#endif
+
+/* Inline functions */
+
+static inline bool
+check_debug_level (unsigned int level)
+{
+ return (level & M_DEBUG_LEVEL) <= x_debug_level;
+}
+
+/* Call if we forked */
+void msg_forked (void);
+
+/* syslog output */
+
+void open_syslog (const char *pgmname, bool stdio_to_null);
+void close_syslog ();
+
+/* log file output */
+void redirect_stdout_stderr (const char *file, bool append);
+
+#ifdef WIN32
+/* get original stderr handle, even if redirected by --log/--log-append */
+HANDLE get_orig_stderr (void);
+#endif
+
+/* exit program */
+void openvpn_exit (const int status);
+
+/* exit program on out of memory error */
+void out_of_memory (void);
+
+/*
+ * Check the return status of read/write routines.
+ */
+
+struct link_socket;
+struct tuntap;
+
+extern unsigned int x_cs_info_level;
+extern unsigned int x_cs_verbose_level;
+extern unsigned int x_cs_err_delay_ms;
+
+void reset_check_status (void);
+void set_check_status (unsigned int info_level, unsigned int verbose_level);
+
+void x_check_status (int status,
+ const char *description,
+ struct link_socket *sock,
+ struct tuntap *tt);
+
+static inline void
+check_status (int status, const char *description, struct link_socket *sock, struct tuntap *tt)
+{
+ if (status < 0 || check_debug_level (x_cs_verbose_level))
+ x_check_status (status, description, sock, tt);
+}
+
+static inline void
+set_check_status_error_delay (unsigned int milliseconds)
+{
+ x_cs_err_delay_ms = milliseconds;
+}
+
+/*
+ * In multiclient mode, put a client-specific prefix
+ * before each message.
+ *
+ * TODO: x_msg_prefix should be thread-local
+ */
+
+extern const char *x_msg_prefix;
+
+void msg_thread_init (void);
+void msg_thread_uninit (void);
+
+static inline void
+msg_set_prefix (const char *prefix)
+{
+ x_msg_prefix = prefix;
+}
+
+static inline const char *
+msg_get_prefix (void)
+{
+ return x_msg_prefix;
+}
+
+/*
+ * Allow MSG to be redirected through a virtual_output object
+ */
+
+struct virtual_output;
+
+extern const struct virtual_output *x_msg_virtual_output;
+
+static inline void
+msg_set_virtual_output (const struct virtual_output *vo)
+{
+ x_msg_virtual_output = vo;
+}
+
+static inline const struct virtual_output *
+msg_get_virtual_output (void)
+{
+ return x_msg_virtual_output;
+}
+
+/*
+ * Return true if this is a system error
+ * which can be safely ignored.
+ */
+static inline bool
+ignore_sys_error (const int err)
+{
+ /* I/O operation pending */
+#ifdef WIN32
+ if (err == WSAEWOULDBLOCK || err == WSAEINVAL)
+ return true;
+#else
+ if (err == EAGAIN)
+ return true;
+#endif
+
+#if 0 /* if enabled, suppress ENOBUFS errors */
+#ifdef ENOBUFS
+ /* No buffer space available */
+ if (err == ENOBUFS)
+ return true;
+#endif
+#endif
+
+ return false;
+}
+
+#include "errlevel.h"
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/event.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/event.c
new file mode 100644
index 00000000..34a3c451
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/event.c
@@ -0,0 +1,1064 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "integer.h"
+#include "event.h"
+#include "fdmisc.h"
+
+#include "memdbg.h"
+
+/*
+ * Some OSes will prefer select() over poll()
+ * when both are available.
+ */
+#if defined(TARGET_DARWIN)
+#define SELECT_PREFERRED_OVER_POLL
+#endif
+
+/*
+ * All non-windows OSes are assumed to have select()
+ */
+#ifdef WIN32
+#define SELECT 0
+#else
+#define SELECT 1
+#endif
+
+/*
+ * This should be set to the highest file descriptor
+ * which can be used in one of the FD_ macros.
+ */
+#ifdef FD_SETSIZE
+#define SELECT_MAX_FDS FD_SETSIZE
+#else
+#define SELECT_MAX_FDS 256
+#endif
+
+static inline int
+tv_to_ms_timeout (const struct timeval *tv)
+{
+ if (tv->tv_sec == 0 && tv->tv_usec == 0)
+ return 0;
+ else
+ return max_int (tv->tv_sec * 1000 + (tv->tv_usec + 500) / 1000, 1);
+}
+
+#ifdef WIN32
+
+struct we_set
+{
+ struct event_set_functions func;
+ bool fast;
+ HANDLE *events;
+ struct event_set_return *esr;
+ int n_events;
+ int capacity;
+};
+
+static inline void
+we_set_event (struct we_set *wes, int i, event_t event, unsigned int rwflags, void *arg)
+{
+ ASSERT (i >= 0 && i < wes->capacity);
+
+ if (rwflags == EVENT_READ)
+ {
+ ASSERT (event->read != NULL);
+ wes->events[i] = event->read;
+ }
+ else if (rwflags == EVENT_WRITE)
+ {
+ ASSERT (event->write != NULL);
+ wes->events[i] = event->write;
+ }
+ else
+ msg (M_FATAL, "fatal error in we_set_events: rwflags=%d", rwflags);
+
+ wes->esr[i].rwflags = rwflags;
+ wes->esr[i].arg = arg;
+}
+
+static inline bool
+we_append_event (struct we_set *wes, event_t event, unsigned int rwflags, void *arg)
+{
+ if (rwflags & EVENT_WRITE)
+ {
+ if (wes->n_events < wes->capacity)
+ {
+ we_set_event (wes, wes->n_events, event, EVENT_WRITE, arg);
+ ++wes->n_events;
+ }
+ else
+ return false;
+ }
+ if (rwflags & EVENT_READ)
+ {
+ if (wes->n_events < wes->capacity)
+ {
+ we_set_event (wes, wes->n_events, event, EVENT_READ, arg);
+ ++wes->n_events;
+ }
+ else
+ return false;
+ }
+ return true;
+}
+
+static void
+we_del_event (struct we_set *wes, event_t event)
+{
+ int i, j = 0;
+ const int len = wes->n_events;
+
+ for (i = 0; i < len; ++i)
+ {
+ const HANDLE h = wes->events[i];
+ if (h == event->read || h == event->write)
+ --wes->n_events;
+ else
+ {
+ if (i != j)
+ {
+ wes->events[j] = wes->events[i];
+ wes->esr[j] = wes->esr[i];
+ }
+ ++j;
+ }
+ }
+}
+
+static void
+we_del_index (struct we_set *wes, int index)
+{
+ int i;
+ ASSERT (index >= 0 && index < wes->n_events);
+ for (i = index; i < wes->n_events - 1; ++i)
+ {
+ wes->events[i] = wes->events[i+1];
+ wes->esr[i] = wes->esr[i+1];
+ }
+ --wes->n_events;
+}
+
+static void
+we_get_rw_indices (struct we_set *wes, event_t event, int *ri, int *wi)
+{
+ int i;
+ *ri = *wi = -1;
+ for (i = 0; i < wes->n_events; ++i)
+ {
+ const HANDLE h = wes->events[i];
+ if (h == event->read)
+ {
+ ASSERT (*ri == -1);
+ *ri = i;
+ }
+ else if (h == event->write)
+ {
+ ASSERT (*wi == -1);
+ *wi = i;
+ }
+ }
+}
+
+static void
+we_free (struct event_set *es)
+{
+ struct we_set *wes = (struct we_set *) es;
+ free (wes->events);
+ free (wes->esr);
+ free (wes);
+}
+
+static void
+we_reset (struct event_set *es)
+{
+ struct we_set *wes = (struct we_set *) es;
+ ASSERT (wes->fast);
+ wes->n_events = 0;
+}
+
+static void
+we_del (struct event_set *es, event_t event)
+{
+ struct we_set *wes = (struct we_set *) es;
+ ASSERT (!wes->fast);
+ we_del_event (wes, event);
+}
+
+static void
+we_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
+{
+ struct we_set *wes = (struct we_set *) es;
+
+ dmsg (D_EVENT_WAIT, "WE_CTL n=%d ev=%p rwflags=0x%04x arg=" ptr_format,
+ wes->n_events,
+ event,
+ rwflags,
+ (ptr_type)arg);
+
+ if (wes->fast)
+ {
+ if (!we_append_event (wes, event, rwflags, arg))
+ goto err;
+ }
+ else
+ {
+ int ri, wi;
+ int one = -1;
+ int n = 0;
+
+ we_get_rw_indices (wes, event, &ri, &wi);
+ if (wi >= 0)
+ {
+ one = wi;
+ ++n;
+ }
+ if (ri >= 0)
+ {
+ one = ri;
+ ++n;
+ }
+ switch (rwflags)
+ {
+ case 0:
+ switch (n)
+ {
+ case 0:
+ break;
+ case 1:
+ we_del_index (wes, one);
+ break;
+ case 2:
+ we_del_event (wes, event);
+ break;
+ default:
+ ASSERT (0);
+ }
+ break;
+ case EVENT_READ:
+ switch (n)
+ {
+ case 0:
+ if (!we_append_event (wes, event, EVENT_READ, arg))
+ goto err;
+ break;
+ case 1:
+ we_set_event (wes, one, event, EVENT_READ, arg);
+ break;
+ case 2:
+ we_del_index (wes, wi);
+ break;
+ default:
+ ASSERT (0);
+ }
+ break;
+ case EVENT_WRITE:
+ switch (n)
+ {
+ case 0:
+ if (!we_append_event (wes, event, EVENT_WRITE, arg))
+ goto err;
+ break;
+ case 1:
+ we_set_event (wes, one, event, EVENT_WRITE, arg);
+ break;
+ case 2:
+ we_del_index (wes, ri);
+ break;
+ default:
+ ASSERT (0);
+ }
+ break;
+ case EVENT_READ|EVENT_WRITE:
+ switch (n)
+ {
+ case 0:
+ if (!we_append_event (wes, event, EVENT_READ|EVENT_WRITE, arg))
+ goto err;
+ break;
+ case 1:
+ if (ri == -1)
+ {
+ ASSERT (wi != -1);
+ if (!we_append_event (wes, event, EVENT_READ, arg))
+ goto err;
+ }
+ else if (wi == -1)
+ {
+ if (!we_append_event (wes, event, EVENT_WRITE, arg))
+ goto err;
+ }
+ else
+ ASSERT (0);
+ break;
+ case 2:
+ break;
+ default:
+ ASSERT (0);
+ }
+ break;
+ default:
+ msg (M_FATAL, "fatal error in we_ctl: rwflags=%d", rwflags);
+ }
+ }
+ return;
+
+ err:
+ msg (D_EVENT_ERRORS, "Error: Windows resource limit WSA_MAXIMUM_WAIT_EVENTS (%d) has been exceeded", WSA_MAXIMUM_WAIT_EVENTS);
+}
+
+static int
+we_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ struct we_set *wes = (struct we_set *) es;
+ const int timeout = tv_to_ms_timeout (tv);
+ DWORD status;
+
+ dmsg (D_EVENT_WAIT, "WE_WAIT enter n=%d to=%d", wes->n_events, timeout);
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_EVENT_WAIT)) {
+ int i;
+ for (i = 0; i < wes->n_events; ++i)
+ dmsg (D_EVENT_WAIT, "[%d] ev=%p rwflags=0x%04x arg=" ptr_format,
+ i,
+ wes->events[i],
+ wes->esr[i].rwflags,
+ (ptr_type)wes->esr[i].arg);
+ }
+#endif
+
+ /*
+ * First poll our event list with 0 timeout
+ */
+ status = WSAWaitForMultipleEvents(
+ (DWORD) wes->n_events,
+ wes->events,
+ FALSE,
+ (DWORD) 0,
+ FALSE);
+
+ /*
+ * If at least one event is already set, we must
+ * individually poll the whole list.
+ */
+ if (status >= WSA_WAIT_EVENT_0 && status < WSA_WAIT_EVENT_0 + (DWORD) wes->n_events)
+ {
+ int i;
+ int j = 0;
+ for (i = 0; i < wes->n_events; ++i)
+ {
+ if (j >= outlen)
+ break;
+ if (WaitForSingleObject (wes->events[i], 0) == WAIT_OBJECT_0)
+ {
+ *out = wes->esr[i];
+ dmsg (D_EVENT_WAIT, "WE_WAIT leave [%d,%d] rwflags=0x%04x arg=" ptr_format,
+ i, j, out->rwflags, (ptr_type)out->arg);
+ ++j;
+ ++out;
+ }
+ }
+ return j;
+ }
+ else
+ {
+ /*
+ * If caller specified timeout > 0, we know at this point
+ * that no events are set, so wait only for the first event
+ * (or timeout) and return at most one event_set_return object.
+ *
+ * If caller specified timeout == 0, the second call to
+ * WSAWaitForMultipleEvents would be redundant -- just
+ * return 0 indicating timeout.
+ */
+ if (timeout > 0)
+ status = WSAWaitForMultipleEvents(
+ (DWORD) wes->n_events,
+ wes->events,
+ FALSE,
+ (DWORD) timeout,
+ FALSE);
+
+ if (outlen >= 1 && status >= WSA_WAIT_EVENT_0 && status < WSA_WAIT_EVENT_0 + (DWORD) wes->n_events)
+ {
+ *out = wes->esr[status - WSA_WAIT_EVENT_0];
+ dmsg (D_EVENT_WAIT, "WE_WAIT leave rwflags=0x%04x arg=" ptr_format,
+ out->rwflags, (ptr_type)out->arg);
+ return 1;
+ }
+ else if (status == WSA_WAIT_TIMEOUT)
+ return 0;
+ else
+ return -1;
+ }
+}
+
+static struct event_set *
+we_init (int *maxevents, unsigned int flags)
+{
+ struct we_set *wes;
+
+ dmsg (D_EVENT_WAIT, "WE_INIT maxevents=%d flags=0x%08x", *maxevents, flags);
+
+ ALLOC_OBJ_CLEAR (wes, struct we_set);
+
+ /* set dispatch functions */
+ wes->func.free = we_free;
+ wes->func.reset = we_reset;
+ wes->func.del = we_del;
+ wes->func.ctl = we_ctl;
+ wes->func.wait = we_wait;
+
+ if (flags & EVENT_METHOD_FAST)
+ wes->fast = true;
+ wes->n_events = 0;
+
+ /* Figure our event capacity */
+ ASSERT (*maxevents > 0);
+ wes->capacity = min_int (*maxevents * 2, WSA_MAXIMUM_WAIT_EVENTS);
+ *maxevents = min_int (*maxevents, WSA_MAXIMUM_WAIT_EVENTS);
+
+ /* Allocate space for Win32 event handles */
+ ALLOC_ARRAY_CLEAR (wes->events, HANDLE, wes->capacity);
+
+ /* Allocate space for event_set_return objects */
+ ALLOC_ARRAY_CLEAR (wes->esr, struct event_set_return, wes->capacity);
+
+ dmsg (D_EVENT_WAIT, "WE_INIT maxevents=%d capacity=%d",
+ *maxevents, wes->capacity);
+
+ return (struct event_set *) wes;
+}
+
+#endif /* WIN32 */
+
+#if EPOLL
+
+struct ep_set
+{
+ struct event_set_functions func;
+ bool fast;
+ int epfd;
+ int maxevents;
+ struct epoll_event *events;
+};
+
+static void
+ep_free (struct event_set *es)
+{
+ struct ep_set *eps = (struct ep_set *) es;
+ close (eps->epfd);
+ free (eps->events);
+ free (eps);
+}
+
+static void
+ep_reset (struct event_set *es)
+{
+ const struct ep_set *eps = (struct ep_set *) es;
+ ASSERT (eps->fast);
+}
+
+static void
+ep_del (struct event_set *es, event_t event)
+{
+ struct epoll_event ev;
+ struct ep_set *eps = (struct ep_set *) es;
+
+ dmsg (D_EVENT_WAIT, "EP_DEL ev=%d", (int)event);
+
+ ASSERT (!eps->fast);
+ CLEAR (ev);
+ epoll_ctl (eps->epfd, EPOLL_CTL_DEL, event, &ev);
+}
+
+static void
+ep_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
+{
+ struct ep_set *eps = (struct ep_set *) es;
+ struct epoll_event ev;
+
+ CLEAR (ev);
+
+ ev.data.ptr = arg;
+ if (rwflags & EVENT_READ)
+ ev.events |= EPOLLIN;
+ if (rwflags & EVENT_WRITE)
+ ev.events |= EPOLLOUT;
+
+ dmsg (D_EVENT_WAIT, "EP_CTL fd=%d rwflags=0x%04x ev=0x%08x arg=" ptr_format,
+ (int)event,
+ rwflags,
+ (unsigned int)ev.events,
+ (ptr_type)ev.data.ptr);
+
+ if (epoll_ctl (eps->epfd, EPOLL_CTL_MOD, event, &ev) < 0)
+ {
+ if (errno == ENOENT)
+ {
+ if (epoll_ctl (eps->epfd, EPOLL_CTL_ADD, event, &ev) < 0)
+ msg (M_ERR, "EVENT: epoll_ctl EPOLL_CTL_ADD failed, sd=%d", (int)event);
+ }
+ else
+ msg (M_ERR, "EVENT: epoll_ctl EPOLL_CTL_MOD failed, sd=%d", (int)event);
+ }
+}
+
+static int
+ep_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ struct ep_set *eps = (struct ep_set *) es;
+ int stat;
+
+ if (outlen > eps->maxevents)
+ outlen = eps->maxevents;
+
+ stat = epoll_wait (eps->epfd, eps->events, outlen, tv_to_ms_timeout (tv));
+ ASSERT (stat <= outlen);
+
+ if (stat > 0)
+ {
+ int i;
+ const struct epoll_event *ev = eps->events;
+ struct event_set_return *esr = out;
+ for (i = 0; i < stat; ++i)
+ {
+ esr->rwflags = 0;
+ if (ev->events & (EPOLLIN|EPOLLPRI|EPOLLERR|EPOLLHUP))
+ esr->rwflags |= EVENT_READ;
+ if (ev->events & EPOLLOUT)
+ esr->rwflags |= EVENT_WRITE;
+ esr->arg = ev->data.ptr;
+ dmsg (D_EVENT_WAIT, "EP_WAIT[%d] rwflags=0x%04x ev=0x%08x arg=" ptr_format,
+ i, esr->rwflags, ev->events, (ptr_type)ev->data.ptr);
+ ++ev;
+ ++esr;
+ }
+ }
+ return stat;
+}
+
+static struct event_set *
+ep_init (int *maxevents, unsigned int flags)
+{
+ struct ep_set *eps;
+ int fd;
+
+ dmsg (D_EVENT_WAIT, "EP_INIT maxevents=%d flags=0x%08x", *maxevents, flags);
+
+ /* open epoll file descriptor */
+ fd = epoll_create (*maxevents);
+ if (fd < 0)
+ return NULL;
+
+ set_cloexec (fd);
+
+ ALLOC_OBJ_CLEAR (eps, struct ep_set);
+
+ /* set dispatch functions */
+ eps->func.free = ep_free;
+ eps->func.reset = ep_reset;
+ eps->func.del = ep_del;
+ eps->func.ctl = ep_ctl;
+ eps->func.wait = ep_wait;
+
+ /* fast method ("sort of") corresponds to epoll one-shot */
+ if (flags & EVENT_METHOD_FAST)
+ eps->fast = true;
+
+ /* allocate space for epoll_wait return */
+ ASSERT (*maxevents > 0);
+ eps->maxevents = *maxevents;
+ ALLOC_ARRAY_CLEAR (eps->events, struct epoll_event, eps->maxevents);
+
+ /* set epoll control fd */
+ eps->epfd = fd;
+
+ return (struct event_set *) eps;
+}
+#endif /* EPOLL */
+
+#if POLL
+
+struct po_set
+{
+ struct event_set_functions func;
+ bool fast;
+ struct pollfd *events;
+ void **args;
+ int n_events;
+ int capacity;
+};
+
+static void
+po_free (struct event_set *es)
+{
+ struct po_set *pos = (struct po_set *) es;
+ free (pos->events);
+ free (pos->args);
+ free (pos);
+}
+
+static void
+po_reset (struct event_set *es)
+{
+ struct po_set *pos = (struct po_set *) es;
+ ASSERT (pos->fast);
+ pos->n_events = 0;
+}
+
+static void
+po_del (struct event_set *es, event_t event)
+{
+ struct po_set *pos = (struct po_set *) es;
+ int i;
+
+ dmsg (D_EVENT_WAIT, "PO_DEL ev=%d", (int)event);
+
+ ASSERT (!pos->fast);
+ for (i = 0; i < pos->n_events; ++i)
+ {
+ if (pos->events[i].fd == event)
+ {
+ int j;
+ for (j = i; j < pos->n_events - 1; ++j)
+ {
+ pos->events[j] = pos->events[j+1];
+ pos->args[j] = pos->args[j+1];
+ }
+ --pos->n_events;
+ break;
+ }
+ }
+}
+
+static inline void
+po_set_pollfd_events (struct pollfd *pfdp, unsigned int rwflags)
+{
+ pfdp->events = 0;
+ if (rwflags & EVENT_WRITE)
+ pfdp->events |= POLLOUT;
+ if (rwflags & EVENT_READ)
+ pfdp->events |= (POLLIN|POLLPRI);
+}
+
+static inline bool
+po_append_event (struct po_set *pos, event_t event, unsigned int rwflags, void *arg)
+{
+ if (pos->n_events < pos->capacity)
+ {
+ struct pollfd *pfdp = &pos->events[pos->n_events];
+ pfdp->fd = event;
+ pos->args[pos->n_events] = arg;
+ po_set_pollfd_events (pfdp, rwflags);
+ ++pos->n_events;
+ return true;
+ }
+ else
+ return false;
+}
+
+static void
+po_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
+{
+ struct po_set *pos = (struct po_set *) es;
+
+ dmsg (D_EVENT_WAIT, "PO_CTL rwflags=0x%04x ev=%d arg=" ptr_format,
+ rwflags, (int)event, (ptr_type)arg);
+
+ if (pos->fast)
+ {
+ if (!po_append_event (pos, event, rwflags, arg))
+ goto err;
+ }
+ else
+ {
+ int i;
+ for (i = 0; i < pos->n_events; ++i)
+ {
+ struct pollfd *pfdp = &pos->events[i];
+ if (pfdp->fd == event)
+ {
+ pos->args[i] = arg;
+ po_set_pollfd_events (pfdp, rwflags);
+ goto done;
+ }
+ }
+ if (!po_append_event (pos, event, rwflags, arg))
+ goto err;
+ }
+
+ done:
+ return;
+
+ err:
+ msg (D_EVENT_ERRORS, "Error: poll: too many I/O wait events");
+}
+
+static int
+po_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ struct po_set *pos = (struct po_set *) es;
+ int stat;
+
+ stat = poll (pos->events, pos->n_events, tv_to_ms_timeout (tv));
+
+ ASSERT (stat <= pos->n_events);
+
+ if (stat > 0)
+ {
+ int i, j=0;
+ const struct pollfd *pfdp = pos->events;
+ for (i = 0; i < pos->n_events && j < outlen; ++i)
+ {
+ if (pfdp->revents & (POLLIN|POLLPRI|POLLERR|POLLHUP|POLLOUT))
+ {
+ out->rwflags = 0;
+ if (pfdp->revents & (POLLIN|POLLPRI|POLLERR|POLLHUP))
+ out->rwflags |= EVENT_READ;
+ if (pfdp->revents & POLLOUT)
+ out->rwflags |= EVENT_WRITE;
+ out->arg = pos->args[i];
+ dmsg (D_EVENT_WAIT, "PO_WAIT[%d,%d] fd=%d rev=0x%08x rwflags=0x%04x arg=" ptr_format " %s",
+ i, j, pfdp->fd, pfdp->revents, out->rwflags, (ptr_type)out->arg, pos->fast ? "" : "[scalable]");
+ ++out;
+ ++j;
+ }
+ else if (pfdp->revents)
+ {
+ msg (D_EVENT_ERRORS, "Error: poll: unknown revents=0x%04x", (unsigned int)pfdp->revents);
+ }
+ ++pfdp;
+ }
+ return j;
+ }
+ return stat;
+}
+
+static struct event_set *
+po_init (int *maxevents, unsigned int flags)
+{
+ struct po_set *pos;
+
+ dmsg (D_EVENT_WAIT, "PO_INIT maxevents=%d flags=0x%08x", *maxevents, flags);
+
+ ALLOC_OBJ_CLEAR (pos, struct po_set);
+
+ /* set dispatch functions */
+ pos->func.free = po_free;
+ pos->func.reset = po_reset;
+ pos->func.del = po_del;
+ pos->func.ctl = po_ctl;
+ pos->func.wait = po_wait;
+
+ if (flags & EVENT_METHOD_FAST)
+ pos->fast = true;
+
+ pos->n_events = 0;
+
+ /* Figure our event capacity */
+ ASSERT (*maxevents > 0);
+ pos->capacity = *maxevents;
+
+ /* Allocate space for pollfd structures to be passed to poll() */
+ ALLOC_ARRAY_CLEAR (pos->events, struct pollfd, pos->capacity);
+
+ /* Allocate space for event_set_return objects */
+ ALLOC_ARRAY_CLEAR (pos->args, void *, pos->capacity);
+
+ return (struct event_set *) pos;
+}
+#endif /* POLL */
+
+#if SELECT
+
+struct se_set
+{
+ struct event_set_functions func;
+ bool fast;
+ fd_set readfds;
+ fd_set writefds;
+ void **args; /* allocated to capacity size */
+ int maxfd; /* largest fd seen so far, always < capacity */
+ int capacity; /* fixed largest fd + 1 */
+};
+
+static void
+se_free (struct event_set *es)
+{
+ struct se_set *ses = (struct se_set *) es;
+ free (ses->args);
+ free (ses);
+}
+
+static void
+se_reset (struct event_set *es)
+{
+ struct se_set *ses = (struct se_set *) es;
+ int i;
+ ASSERT (ses->fast);
+
+ dmsg (D_EVENT_WAIT, "SE_RESET");
+
+ FD_ZERO (&ses->readfds);
+ FD_ZERO (&ses->writefds);
+ for (i = 0; i <= ses->maxfd; ++i)
+ ses->args[i] = NULL;
+ ses->maxfd = -1;
+}
+
+static void
+se_del (struct event_set *es, event_t event)
+{
+ struct se_set *ses = (struct se_set *) es;
+ ASSERT (!ses->fast);
+
+ dmsg (D_EVENT_WAIT, "SE_DEL ev=%d", (int)event);
+
+ if (event >= 0 && event < ses->capacity)
+ {
+ FD_CLR (event, &ses->readfds);
+ FD_CLR (event, &ses->writefds);
+ ses->args[event] = NULL;
+ }
+ else
+ msg (D_EVENT_ERRORS, "Error: select/se_del: too many I/O wait events");
+ return;
+}
+
+static void
+se_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
+{
+ struct se_set *ses = (struct se_set *) es;
+
+ dmsg (D_EVENT_WAIT, "SE_CTL rwflags=0x%04x ev=%d fast=%d cap=%d maxfd=%d arg=" ptr_format,
+ rwflags, (int)event, (int)ses->fast, ses->capacity, ses->maxfd, (ptr_type)arg);
+
+ if (event >= 0 && event < ses->capacity)
+ {
+ ses->maxfd = max_int (event, ses->maxfd);
+ ses->args[event] = arg;
+ if (ses->fast)
+ {
+ if (rwflags & EVENT_READ)
+ FD_SET (event, &ses->readfds);
+ if (rwflags & EVENT_WRITE)
+ FD_SET (event, &ses->writefds);
+ }
+ else
+ {
+ if (rwflags & EVENT_READ)
+ FD_SET (event, &ses->readfds);
+ else
+ FD_CLR (event, &ses->readfds);
+ if (rwflags & EVENT_WRITE)
+ FD_SET (event, &ses->writefds);
+ else
+ FD_CLR (event, &ses->writefds);
+ }
+ }
+ else
+ {
+ msg (D_EVENT_ERRORS, "Error: select: too many I/O wait events, fd=%d cap=%d",
+ (int) event,
+ ses->capacity);
+ }
+}
+
+static int
+se_wait_return (struct se_set *ses,
+ fd_set *read,
+ fd_set *write,
+ struct event_set_return *out,
+ int outlen)
+{
+ int i, j = 0;
+ for (i = 0; i <= ses->maxfd && j < outlen; ++i)
+ {
+ const bool r = FD_ISSET (i, read);
+ const bool w = FD_ISSET (i, write);
+ if (r || w)
+ {
+ out->rwflags = 0;
+ if (r)
+ out->rwflags |= EVENT_READ;
+ if (w)
+ out->rwflags |= EVENT_WRITE;
+ out->arg = ses->args[i];
+ dmsg (D_EVENT_WAIT, "SE_WAIT[%d,%d] rwflags=0x%04x arg=" ptr_format,
+ i, j, out->rwflags, (ptr_type)out->arg);
+ ++out;
+ ++j;
+ }
+ }
+ return j;
+}
+
+static int
+se_wait_fast (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ struct se_set *ses = (struct se_set *) es;
+ struct timeval tv_tmp = *tv;
+ int stat;
+
+ dmsg (D_EVENT_WAIT, "SE_WAIT_FAST maxfd=%d tv=%d/%d",
+ ses->maxfd,
+ (int)tv_tmp.tv_sec,
+ (int)tv_tmp.tv_usec);
+
+ stat = select (ses->maxfd + 1, &ses->readfds, &ses->writefds, NULL, &tv_tmp);
+
+ if (stat > 0)
+ stat = se_wait_return (ses, &ses->readfds, &ses->writefds, out, outlen);
+
+ return stat;
+}
+
+static int
+se_wait_scalable (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ struct se_set *ses = (struct se_set *) es;
+ struct timeval tv_tmp = *tv;
+ fd_set read = ses->readfds;
+ fd_set write = ses->writefds;
+ int stat;
+
+ dmsg (D_EVENT_WAIT, "SE_WAIT_SCALEABLE maxfd=%d tv=%d/%d",
+ ses->maxfd, (int)tv_tmp.tv_sec, (int)tv_tmp.tv_usec);
+
+ stat = select (ses->maxfd + 1, &read, &write, NULL, &tv_tmp);
+
+ if (stat > 0)
+ stat = se_wait_return (ses, &read, &write, out, outlen);
+
+ return stat;
+}
+
+static struct event_set *
+se_init (int *maxevents, unsigned int flags)
+{
+ struct se_set *ses;
+
+ dmsg (D_EVENT_WAIT, "SE_INIT maxevents=%d flags=0x%08x", *maxevents, flags);
+
+ ALLOC_OBJ_CLEAR (ses, struct se_set);
+
+ /* set dispatch functions */
+ ses->func.free = se_free;
+ ses->func.reset = se_reset;
+ ses->func.del = se_del;
+ ses->func.ctl = se_ctl;
+ ses->func.wait = se_wait_scalable;
+
+ if (flags & EVENT_METHOD_FAST)
+ {
+ ses->fast = true;
+ ses->func.wait = se_wait_fast;
+ }
+
+ /* Select needs to be passed this value + 1 */
+ ses->maxfd = -1;
+
+ /* Set our event capacity */
+ ASSERT (*maxevents > 0);
+ *maxevents = min_int (*maxevents, SELECT_MAX_FDS);
+ ses->capacity = SELECT_MAX_FDS;
+
+ /* Allocate space for event_set_return void * args */
+ ALLOC_ARRAY_CLEAR (ses->args, void *, ses->capacity);
+
+ return (struct event_set *) ses;
+}
+#endif /* SELECT */
+
+static struct event_set *
+event_set_init_simple (int *maxevents, unsigned int flags)
+{
+ struct event_set *ret = NULL;
+#ifdef WIN32
+ ret = we_init (maxevents, flags);
+#elif POLL && SELECT
+#if 0 /* Define to 1 if EVENT_METHOD_US_TIMEOUT should cause select to be favored over poll */
+ if (flags & EVENT_METHOD_US_TIMEOUT)
+ ret = se_init (maxevents, flags);
+#endif
+# ifdef SELECT_PREFERRED_OVER_POLL
+ if (!ret)
+ ret = se_init (maxevents, flags);
+ if (!ret)
+ ret = po_init (maxevents, flags);
+# else
+ if (!ret)
+ ret = po_init (maxevents, flags);
+ if (!ret)
+ ret = se_init (maxevents, flags);
+# endif
+#elif POLL
+ ret = po_init (maxevents, flags);
+#elif SELECT
+ ret = se_init (maxevents, flags);
+#else
+#error At least one of poll, select, or WSAWaitForMultipleEvents must be supported by the kernel
+#endif
+ ASSERT (ret);
+ return ret;
+}
+
+static struct event_set *
+event_set_init_scalable (int *maxevents, unsigned int flags)
+{
+ struct event_set *ret = NULL;
+#if EPOLL
+ ret = ep_init (maxevents, flags);
+ if (!ret)
+ {
+ msg (M_WARN, "Note: sys_epoll API is unavailable, falling back to poll/select API");
+ ret = event_set_init_simple (maxevents, flags);
+ }
+#else
+ ret = event_set_init_simple (maxevents, flags);
+#endif
+ ASSERT (ret);
+ return ret;
+}
+
+struct event_set *
+event_set_init (int *maxevents, unsigned int flags)
+{
+ if (flags & EVENT_METHOD_FAST)
+ return event_set_init_simple (maxevents, flags);
+ else
+ return event_set_init_scalable (maxevents, flags);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/event.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/event.h
new file mode 100644
index 00000000..bd29fdc1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/event.h
@@ -0,0 +1,158 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef EVENT_H
+#define EVENT_H
+
+#include "win32.h"
+#include "sig.h"
+#include "perf.h"
+
+/*
+ * rwflags passed to event_ctl and returned by
+ * struct event_set_return.
+ */
+#define EVENT_UNDEF 4
+#define EVENT_READ (1<<0)
+#define EVENT_WRITE (1<<1)
+/*
+ * Initialization flags passed to event_set_init
+ */
+#define EVENT_METHOD_US_TIMEOUT (1<<0)
+#define EVENT_METHOD_FAST (1<<1)
+
+#ifdef WIN32
+
+typedef const struct rw_handle *event_t;
+
+#define UNDEFINED_EVENT (NULL)
+
+#else
+
+typedef int event_t;
+
+#define UNDEFINED_EVENT (-1)
+
+#endif
+
+struct event_set;
+struct event_set_return;
+
+struct event_set_functions
+{
+ void (*free)(struct event_set *es);
+ void (*reset)(struct event_set *es);
+ void (*del)(struct event_set *es, event_t event);
+ void (*ctl)(struct event_set *es, event_t event, unsigned int rwflags, void *arg);
+
+ /*
+ * Return status for wait:
+ * -1 on signal or error
+ * 0 on timeout
+ * length of event_set_return if at least 1 event is returned
+ */
+ int (*wait)(struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen);
+};
+
+struct event_set_return
+{
+ unsigned int rwflags;
+ void *arg;
+};
+
+struct event_set
+{
+ struct event_set_functions func;
+};
+
+/*
+ * maxevents on input: desired max number of event_t descriptors
+ * simultaneously set with event_ctl
+ * maxevents on output: may be modified down, depending on limitations
+ * of underlying API
+ * flags: EVENT_METHOD_x flags
+ */
+struct event_set *event_set_init (int *maxevents, unsigned int flags);
+
+static inline void
+event_free (struct event_set *es)
+{
+ if (es)
+ (*es->func.free)(es);
+}
+
+static inline void
+event_reset (struct event_set *es)
+{
+ (*es->func.reset)(es);
+}
+
+static inline void
+event_del (struct event_set *es, event_t event)
+{
+ (*es->func.del)(es, event);
+}
+
+static inline void
+event_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
+{
+ (*es->func.ctl)(es, event, rwflags, arg);
+}
+
+static inline int
+event_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
+{
+ int ret;
+ perf_push (PERF_IO_WAIT);
+ ret = (*es->func.wait)(es, tv, out, outlen);
+ perf_pop ();
+ return ret;
+}
+
+static inline void
+event_set_return_init (struct event_set_return *esr)
+{
+ esr->rwflags = 0;
+ esr->arg = NULL;
+}
+
+#ifdef WIN32
+
+static inline void
+wait_signal (struct event_set *es, void *arg)
+{
+ if (HANDLE_DEFINED (win32_signal.in.read))
+ event_ctl (es, &win32_signal.in, EVENT_READ, arg);
+}
+
+#else
+
+static inline void
+wait_signal (struct event_set *es, void *arg)
+{
+}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.c
new file mode 100644
index 00000000..7fe449c5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.c
@@ -0,0 +1,78 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "fdmisc.h"
+#include "error.h"
+
+#include "memdbg.h"
+
+/* Set a file descriptor to non-blocking */
+bool
+set_nonblock_action (int fd)
+{
+#ifdef WIN32
+ u_long arg = 1;
+ if (ioctlsocket (fd, FIONBIO, &arg))
+ return false;
+#else
+ if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0)
+ return false;
+#endif
+ return true;
+}
+
+/* Set a file descriptor to not be passed across execs */
+bool
+set_cloexec_action (int fd)
+{
+#ifndef WIN32
+ if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
+ return false;
+#endif
+ return true;
+}
+
+/* Set a file descriptor to non-blocking */
+void
+set_nonblock (int fd)
+{
+ if (!set_nonblock_action (fd))
+ msg (M_ERR, "Set socket to non-blocking mode failed");
+}
+
+/* Set a file descriptor to not be passed across execs */
+void
+set_cloexec (int fd)
+{
+ if (!set_cloexec_action (fd))
+ msg (M_ERR, "Set FD_CLOEXEC flag on file descriptor failed");
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.h
new file mode 100644
index 00000000..4b6b6d04
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/fdmisc.h
@@ -0,0 +1,31 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "basic.h"
+
+bool set_nonblock_action (int fd);
+bool set_cloexec_action (int fd);
+
+void set_nonblock (int fd);
+void set_cloexec (int fd);
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/forward-inline.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward-inline.h
new file mode 100644
index 00000000..5853ce29
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward-inline.h
@@ -0,0 +1,294 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef FORWARD_INLINE_H
+#define FORWARD_INLINE_H
+
+/*
+ * Inline functions
+ */
+
+/*
+ * Does TLS session need service?
+ */
+static inline void
+check_tls (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ void check_tls_dowork (struct context *c);
+ if (c->c2.tls_multi)
+ check_tls_dowork (c);
+#endif
+}
+
+/*
+ * TLS errors are fatal in TCP mode.
+ * Also check for --tls-exit trigger.
+ */
+static inline void
+check_tls_errors (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ void check_tls_errors_co (struct context *c);
+ void check_tls_errors_nco (struct context *c);
+ if (c->c2.tls_multi && c->c2.tls_exit_signal)
+ {
+ if (link_socket_connection_oriented (c->c2.link_socket))
+ {
+ if (c->c2.tls_multi->n_soft_errors)
+ check_tls_errors_co (c);
+ }
+ else
+ {
+ if (c->c2.tls_multi->n_hard_errors)
+ check_tls_errors_nco (c);
+ }
+ }
+#endif
+}
+
+/*
+ * Check for possible incoming configuration
+ * messages on the control channel.
+ */
+static inline void
+check_incoming_control_channel (struct context *c)
+{
+#if P2MP
+ void check_incoming_control_channel_dowork (struct context *c);
+ if (tls_test_payload_len (c->c2.tls_multi) > 0)
+ check_incoming_control_channel_dowork (c);
+#endif
+}
+
+/*
+ * Options like --up-delay need to be triggered by this function which
+ * checks for connection establishment.
+ */
+static inline void
+check_connection_established (struct context *c)
+{
+ void check_connection_established_dowork (struct context *c);
+ if (event_timeout_defined (&c->c2.wait_for_connect))
+ check_connection_established_dowork (c);
+}
+
+/*
+ * Should we add routes?
+ */
+static inline void
+check_add_routes (struct context *c)
+{
+ void check_add_routes_dowork (struct context *c);
+ if (event_timeout_trigger (&c->c2.route_wakeup, &c->c2.timeval, ETT_DEFAULT))
+ check_add_routes_dowork (c);
+}
+
+/*
+ * Should we exit due to inactivity timeout?
+ */
+static inline void
+check_inactivity_timeout (struct context *c)
+{
+ void check_inactivity_timeout_dowork (struct context *c);
+
+ if (c->options.inactivity_timeout
+ && event_timeout_trigger (&c->c2.inactivity_interval, &c->c2.timeval, ETT_DEFAULT))
+ check_inactivity_timeout_dowork (c);
+}
+
+#if P2MP
+
+static inline void
+check_server_poll_timeout (struct context *c)
+{
+ void check_server_poll_timeout_dowork (struct context *c);
+
+ if (c->options.server_poll_timeout
+ && event_timeout_trigger (&c->c2.server_poll_interval, &c->c2.timeval, ETT_DEFAULT))
+ check_server_poll_timeout_dowork (c);
+}
+
+/*
+ * Scheduled exit?
+ */
+static inline void
+check_scheduled_exit (struct context *c)
+{
+ void check_scheduled_exit_dowork (struct context *c);
+
+ if (event_timeout_defined (&c->c2.scheduled_exit))
+ {
+ if (event_timeout_trigger (&c->c2.scheduled_exit, &c->c2.timeval, ETT_DEFAULT))
+ check_scheduled_exit_dowork (c);
+ }
+}
+#endif
+
+/*
+ * Should we write timer-triggered status file.
+ */
+static inline void
+check_status_file (struct context *c)
+{
+ void check_status_file_dowork (struct context *c);
+
+ if (c->c1.status_output)
+ {
+ if (status_trigger_tv (c->c1.status_output, &c->c2.timeval))
+ check_status_file_dowork (c);
+ }
+}
+
+#ifdef ENABLE_FRAGMENT
+/*
+ * Should we deliver a datagram fragment to remote?
+ */
+static inline void
+check_fragment (struct context *c)
+{
+ void check_fragment_dowork (struct context *c);
+ if (c->c2.fragment)
+ check_fragment_dowork (c);
+}
+#endif
+
+#if P2MP
+
+/*
+ * see if we should send a push_request in response to --pull
+ */
+static inline void
+check_push_request (struct context *c)
+{
+ void check_push_request_dowork (struct context *c);
+ if (event_timeout_trigger (&c->c2.push_request_interval, &c->c2.timeval, ETT_DEFAULT))
+ check_push_request_dowork (c);
+}
+
+#endif
+
+#ifdef ENABLE_CRYPTO
+/*
+ * Should we persist our anti-replay packet ID state to disk?
+ */
+static inline void
+check_packet_id_persist_flush (struct context *c)
+{
+ if (packet_id_persist_enabled (&c->c1.pid_persist)
+ && event_timeout_trigger (&c->c2.packet_id_persist_interval, &c->c2.timeval, ETT_DEFAULT))
+ packet_id_persist_save (&c->c1.pid_persist);
+}
+#endif
+
+/*
+ * Set our wakeup to 0 seconds, so we will be rescheduled
+ * immediately.
+ */
+static inline void
+context_immediate_reschedule (struct context *c)
+{
+ c->c2.timeval.tv_sec = 0; /* ZERO-TIMEOUT */
+ c->c2.timeval.tv_usec = 0;
+}
+
+static inline void
+context_reschedule_sec (struct context *c, int sec)
+{
+ if (sec < 0)
+ sec = 0;
+ if (sec < c->c2.timeval.tv_sec)
+ {
+ c->c2.timeval.tv_sec = sec;
+ c->c2.timeval.tv_usec = 0;
+ }
+}
+
+static inline struct link_socket_info *
+get_link_socket_info (struct context *c)
+{
+ if (c->c2.link_socket_info)
+ return c->c2.link_socket_info;
+ else
+ return &c->c2.link_socket->info;
+}
+
+static inline void
+register_activity (struct context *c, const int size)
+{
+ if (c->options.inactivity_timeout)
+ {
+ c->c2.inactivity_bytes += size;
+ if (c->c2.inactivity_bytes >= c->options.inactivity_minimum_bytes)
+ {
+ c->c2.inactivity_bytes = 0;
+ event_timeout_reset (&c->c2.inactivity_interval);
+ }
+ }
+}
+
+/*
+ * Return the io_wait() flags appropriate for
+ * a point-to-point tunnel.
+ */
+static inline unsigned int
+p2p_iow_flags (const struct context *c)
+{
+ unsigned int flags = (IOW_SHAPER|IOW_CHECK_RESIDUAL|IOW_FRAG|IOW_READ|IOW_WAIT_SIGNAL);
+ if (c->c2.to_link.len > 0)
+ flags |= IOW_TO_LINK;
+ if (c->c2.to_tun.len > 0)
+ flags |= IOW_TO_TUN;
+ return flags;
+}
+
+/*
+ * This is the core I/O wait function, used for all I/O waits except
+ * for TCP in server mode.
+ */
+static inline void
+io_wait (struct context *c, const unsigned int flags)
+{
+ void io_wait_dowork (struct context *c, const unsigned int flags);
+
+ if (c->c2.fast_io && (flags & (IOW_TO_TUN|IOW_TO_LINK|IOW_MBUF)))
+ {
+ /* fast path -- only for TUN/TAP/UDP writes */
+ unsigned int ret = 0;
+ if (flags & IOW_TO_TUN)
+ ret |= TUN_WRITE;
+ if (flags & (IOW_TO_LINK|IOW_MBUF))
+ ret |= SOCKET_WRITE;
+ c->c2.event_set_status = ret;
+ }
+ else
+ {
+ /* slow path */
+ io_wait_dowork (c, flags);
+ }
+}
+
+#define CONNECTION_ESTABLISHED(c) (get_link_socket_info(c)->connection_established)
+
+#endif /* EVENT_INLINE_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.c
new file mode 100644
index 00000000..a43361b4
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.c
@@ -0,0 +1,1550 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "forward.h"
+#include "init.h"
+#include "push.h"
+#include "gremlin.h"
+#include "mss.h"
+#include "event.h"
+#include "ps.h"
+#include "dhcp.h"
+#include "common.h"
+#include "ssl_verify.h"
+
+#include "memdbg.h"
+
+#include "forward-inline.h"
+#include "occ-inline.h"
+#include "ping-inline.h"
+#include "mstats.h"
+
+counter_type link_read_bytes_global; /* GLOBAL */
+counter_type link_write_bytes_global; /* GLOBAL */
+
+/* show event wait debugging info */
+
+#ifdef ENABLE_DEBUG
+
+const char *
+wait_status_string (struct context *c, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ buf_printf (&out, "I/O WAIT %s|%s|%s|%s %s",
+ tun_stat (c->c1.tuntap, EVENT_READ, gc),
+ tun_stat (c->c1.tuntap, EVENT_WRITE, gc),
+ socket_stat (c->c2.link_socket, EVENT_READ, gc),
+ socket_stat (c->c2.link_socket, EVENT_WRITE, gc),
+ tv_string (&c->c2.timeval, gc));
+ return BSTR (&out);
+}
+
+void
+show_wait_status (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ dmsg (D_EVENT_WAIT, "%s", wait_status_string (c, &gc));
+ gc_free (&gc);
+}
+
+#endif
+
+/*
+ * In TLS mode, let TLS level respond to any control-channel
+ * packets which were received, or prepare any packets for
+ * transmission.
+ *
+ * tmp_int is purely an optimization that allows us to call
+ * tls_multi_process less frequently when there's not much
+ * traffic on the control-channel.
+ *
+ */
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+void
+check_tls_dowork (struct context *c)
+{
+ interval_t wakeup = BIG_TIMEOUT;
+
+ if (interval_test (&c->c2.tmp_int))
+ {
+ const int tmp_status = tls_multi_process
+ (c->c2.tls_multi, &c->c2.to_link, &c->c2.to_link_addr,
+ get_link_socket_info (c), &wakeup);
+ if (tmp_status == TLSMP_ACTIVE)
+ {
+ update_time ();
+ interval_action (&c->c2.tmp_int);
+ }
+ else if (tmp_status == TLSMP_KILL)
+ {
+ register_signal (c, SIGTERM, "auth-control-exit");
+ }
+
+ interval_future_trigger (&c->c2.tmp_int, wakeup);
+ }
+
+ interval_schedule_wakeup (&c->c2.tmp_int, &wakeup);
+
+ if (wakeup)
+ context_reschedule_sec (c, wakeup);
+}
+#endif
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+void
+check_tls_errors_co (struct context *c)
+{
+ msg (D_STREAM_ERRORS, "Fatal TLS error (check_tls_errors_co), restarting");
+ register_signal (c, c->c2.tls_exit_signal, "tls-error"); /* SOFT-SIGUSR1 -- TLS error */
+}
+
+void
+check_tls_errors_nco (struct context *c)
+{
+ register_signal (c, c->c2.tls_exit_signal, "tls-error"); /* SOFT-SIGUSR1 -- TLS error */
+}
+
+#endif
+
+#if P2MP
+
+/*
+ * Handle incoming configuration
+ * messages on the control channel.
+ */
+void
+check_incoming_control_channel_dowork (struct context *c)
+{
+ const int len = tls_test_payload_len (c->c2.tls_multi);
+ if (len)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer buf = alloc_buf_gc (len, &gc);
+ if (tls_rec_payload (c->c2.tls_multi, &buf))
+ {
+ /* force null termination of message */
+ buf_null_terminate (&buf);
+
+ /* enforce character class restrictions */
+ string_mod (BSTR (&buf), CC_PRINT, CC_CRLF, 0);
+
+ if (buf_string_match_head_str (&buf, "AUTH_FAILED"))
+ receive_auth_failed (c, &buf);
+ else if (buf_string_match_head_str (&buf, "PUSH_"))
+ incoming_push_message (c, &buf);
+ else if (buf_string_match_head_str (&buf, "RESTART"))
+ server_pushed_signal (c, &buf, true, 7);
+ else if (buf_string_match_head_str (&buf, "HALT"))
+ server_pushed_signal (c, &buf, false, 4);
+ else
+ msg (D_PUSH_ERRORS, "WARNING: Received unknown control message: %s", BSTR (&buf));
+ }
+ else
+ {
+ msg (D_PUSH_ERRORS, "WARNING: Receive control message failed");
+ }
+
+ gc_free (&gc);
+ }
+}
+
+/*
+ * Periodically resend PUSH_REQUEST until PUSH message received
+ */
+void
+check_push_request_dowork (struct context *c)
+{
+ send_push_request (c);
+
+ /* if no response to first push_request, retry at PUSH_REQUEST_INTERVAL second intervals */
+ event_timeout_modify_wakeup (&c->c2.push_request_interval, PUSH_REQUEST_INTERVAL);
+}
+
+#endif /* P2MP */
+
+/*
+ * Things that need to happen immediately after connection initiation should go here.
+ */
+void
+check_connection_established_dowork (struct context *c)
+{
+ if (event_timeout_trigger (&c->c2.wait_for_connect, &c->c2.timeval, ETT_DEFAULT))
+ {
+ if (CONNECTION_ESTABLISHED (c))
+ {
+#if P2MP
+ /* if --pull was specified, send a push request to server */
+ if (c->c2.tls_multi && c->options.pull)
+ {
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_set_state (management,
+ OPENVPN_STATE_GET_CONFIG,
+ NULL,
+ 0,
+ 0);
+ }
+#endif
+ /* send push request in 1 sec */
+ event_timeout_init (&c->c2.push_request_interval, 1, now);
+ reset_coarse_timers (c);
+ }
+ else
+#endif
+ {
+ do_up (c, false, 0);
+ }
+
+ event_timeout_clear (&c->c2.wait_for_connect);
+ }
+ }
+}
+
+/*
+ * Send a string to remote over the TLS control channel.
+ * Used for push/pull messages, passing username/password,
+ * etc.
+ */
+bool
+send_control_channel_string (struct context *c, const char *str, int msglevel)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (c->c2.tls_multi) {
+ struct gc_arena gc = gc_new ();
+ bool stat;
+
+ /* buffered cleartext write onto TLS control channel */
+ stat = tls_send_payload (c->c2.tls_multi, (uint8_t*) str, strlen (str) + 1);
+
+ /*
+ * Reschedule tls_multi_process.
+ * NOTE: in multi-client mode, usually the below two statements are
+ * insufficient to reschedule the client instance object unless
+ * multi_schedule_context_wakeup(m, mi) is also called.
+ */
+ interval_action (&c->c2.tmp_int);
+ context_immediate_reschedule (c); /* ZERO-TIMEOUT */
+
+ msg (msglevel, "SENT CONTROL [%s]: '%s' (status=%d)",
+ tls_common_name (c->c2.tls_multi, false),
+ sanitize_control_message (str, &gc),
+ (int) stat);
+
+ gc_free (&gc);
+ return stat;
+ }
+#endif
+ return true;
+}
+
+/*
+ * Add routes.
+ */
+
+static void
+check_add_routes_action (struct context *c, const bool errors)
+{
+ do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list,
+ c->c1.tuntap, c->plugins, c->c2.es);
+ update_time ();
+ event_timeout_clear (&c->c2.route_wakeup);
+ event_timeout_clear (&c->c2.route_wakeup_expire);
+ initialization_sequence_completed (c, errors ? ISC_ERRORS : 0); /* client/p2p --route-delay was defined */
+}
+
+void
+check_add_routes_dowork (struct context *c)
+{
+ if (test_routes (c->c1.route_list, c->c1.tuntap))
+ {
+ check_add_routes_action (c, false);
+ }
+ else if (event_timeout_trigger (&c->c2.route_wakeup_expire, &c->c2.timeval, ETT_DEFAULT))
+ {
+ check_add_routes_action (c, true);
+ }
+ else
+ {
+ msg (D_ROUTE, "Route: Waiting for TUN/TAP interface to come up...");
+ if (c->c1.tuntap)
+ {
+ if (!tun_standby (c->c1.tuntap))
+ {
+ register_signal (c, SIGHUP, "ip-fail");
+ c->persist.restart_sleep_seconds = 10;
+#ifdef WIN32
+ show_routes (M_INFO|M_NOPREFIX);
+ show_adapters (M_INFO|M_NOPREFIX);
+#endif
+ }
+ }
+ update_time ();
+ if (c->c2.route_wakeup.n != 1)
+ event_timeout_init (&c->c2.route_wakeup, 1, now);
+ event_timeout_reset (&c->c2.ping_rec_interval);
+ }
+}
+
+/*
+ * Should we exit due to inactivity timeout?
+ */
+void
+check_inactivity_timeout_dowork (struct context *c)
+{
+ msg (M_INFO, "Inactivity timeout (--inactive), exiting");
+ register_signal (c, SIGTERM, "inactive");
+}
+
+#if P2MP
+
+void
+check_server_poll_timeout_dowork (struct context *c)
+{
+ event_timeout_reset (&c->c2.server_poll_interval);
+ if (!tls_initial_packet_received (c->c2.tls_multi))
+ {
+ msg (M_INFO, "Server poll timeout, restarting");
+ register_signal (c, SIGUSR1, "server_poll");
+ c->persist.restart_sleep_seconds = -1;
+ }
+}
+
+/*
+ * Schedule a signal n_seconds from now.
+ */
+void
+schedule_exit (struct context *c, const int n_seconds, const int signal)
+{
+ tls_set_single_session (c->c2.tls_multi);
+ update_time ();
+ reset_coarse_timers (c);
+ event_timeout_init (&c->c2.scheduled_exit, n_seconds, now);
+ c->c2.scheduled_exit_signal = signal;
+ msg (D_SCHED_EXIT, "Delayed exit in %d seconds", n_seconds);
+}
+
+/*
+ * Scheduled exit?
+ */
+void
+check_scheduled_exit_dowork (struct context *c)
+{
+ register_signal (c, c->c2.scheduled_exit_signal, "delayed-exit");
+}
+
+#endif
+
+/*
+ * Should we write timer-triggered status file.
+ */
+void
+check_status_file_dowork (struct context *c)
+{
+ if (c->c1.status_output)
+ print_status (c, c->c1.status_output);
+}
+
+#ifdef ENABLE_FRAGMENT
+/*
+ * Should we deliver a datagram fragment to remote?
+ */
+void
+check_fragment_dowork (struct context *c)
+{
+ struct link_socket_info *lsi = get_link_socket_info (c);
+
+ /* OS MTU Hint? */
+ if (lsi->mtu_changed && c->c2.ipv4_tun)
+ {
+ frame_adjust_path_mtu (&c->c2.frame_fragment, c->c2.link_socket->mtu,
+ c->options.ce.proto);
+ lsi->mtu_changed = false;
+ }
+
+ if (fragment_outgoing_defined (c->c2.fragment))
+ {
+ if (!c->c2.to_link.len)
+ {
+ /* encrypt a fragment for output to TCP/UDP port */
+ ASSERT (fragment_ready_to_send (c->c2.fragment, &c->c2.buf, &c->c2.frame_fragment));
+ encrypt_sign (c, false);
+ }
+ }
+
+ fragment_housekeeping (c->c2.fragment, &c->c2.frame_fragment, &c->c2.timeval);
+}
+#endif
+
+/*
+ * Buffer reallocation, for use with null encryption.
+ */
+static inline void
+buffer_turnover (const uint8_t *orig_buf, struct buffer *dest_stub, struct buffer *src_stub, struct buffer *storage)
+{
+ if (orig_buf == src_stub->data && src_stub->data != storage->data)
+ {
+ buf_assign (storage, src_stub);
+ *dest_stub = *storage;
+ }
+ else
+ {
+ *dest_stub = *src_stub;
+ }
+}
+
+/*
+ * Compress, fragment, encrypt and HMAC-sign an outgoing packet.
+ * Input: c->c2.buf
+ * Output: c->c2.to_link
+ */
+void
+encrypt_sign (struct context *c, bool comp_frag)
+{
+ struct context_buffers *b = c->c2.buffers;
+ const uint8_t *orig_buf = c->c2.buf.data;
+
+#if P2MP_SERVER
+ /*
+ * Drop non-TLS outgoing packet if client-connect script/plugin
+ * has not yet succeeded.
+ */
+ if (c->c2.context_auth != CAS_SUCCEEDED)
+ c->c2.buf.len = 0;
+#endif
+
+ if (comp_frag)
+ {
+#ifdef USE_COMP
+ /* Compress the packet. */
+ if (c->c2.comp_context)
+ (*c->c2.comp_context->alg.compress)(&c->c2.buf, b->compress_buf, c->c2.comp_context, &c->c2.frame);
+#endif
+#ifdef ENABLE_FRAGMENT
+ if (c->c2.fragment)
+ fragment_outgoing (c->c2.fragment, &c->c2.buf, &c->c2.frame_fragment);
+#endif
+ }
+
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_SSL
+ /*
+ * If TLS mode, get the key we will use to encrypt
+ * the packet.
+ */
+ if (c->c2.tls_multi)
+ {
+ tls_pre_encrypt (c->c2.tls_multi, &c->c2.buf, &c->c2.crypto_options);
+ }
+#endif
+
+ /*
+ * Encrypt the packet and write an optional
+ * HMAC signature.
+ */
+ openvpn_encrypt (&c->c2.buf, b->encrypt_buf, &c->c2.crypto_options, &c->c2.frame);
+#endif
+ /*
+ * Get the address we will be sending the packet to.
+ */
+ link_socket_get_outgoing_addr (&c->c2.buf, get_link_socket_info (c),
+ &c->c2.to_link_addr);
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_SSL
+ /*
+ * In TLS mode, prepend the appropriate one-byte opcode
+ * to the packet which identifies it as a data channel
+ * packet and gives the low-permutation version of
+ * the key-id to the recipient so it knows which
+ * decrypt key to use.
+ */
+ if (c->c2.tls_multi)
+ {
+ tls_post_encrypt (c->c2.tls_multi, &c->c2.buf);
+ }
+#endif
+#endif
+
+ /* if null encryption, copy result to read_tun_buf */
+ buffer_turnover (orig_buf, &c->c2.to_link, &c->c2.buf, &b->read_tun_buf);
+}
+
+/*
+ * Coarse timers work to 1 second resolution.
+ */
+static void
+process_coarse_timers (struct context *c)
+{
+#ifdef ENABLE_CRYPTO
+ /* flush current packet-id to file once per 60
+ seconds if --replay-persist was specified */
+ check_packet_id_persist_flush (c);
+#endif
+
+ /* should we update status file? */
+ check_status_file (c);
+
+ /* process connection establishment items */
+ check_connection_established (c);
+
+#if P2MP
+ /* see if we should send a push_request in response to --pull */
+ check_push_request (c);
+#endif
+
+#ifdef PLUGIN_PF
+ pf_check_reload (c);
+#endif
+
+ /* process --route options */
+ check_add_routes (c);
+
+ /* possibly exit due to --inactive */
+ check_inactivity_timeout (c);
+ if (c->sig->signal_received)
+ return;
+
+ /* restart if ping not received */
+ check_ping_restart (c);
+ if (c->sig->signal_received)
+ return;
+
+#if P2MP
+ check_server_poll_timeout (c);
+ if (c->sig->signal_received)
+ return;
+
+ check_scheduled_exit (c);
+ if (c->sig->signal_received)
+ return;
+#endif
+
+#ifdef ENABLE_OCC
+ /* Should we send an OCC_REQUEST message? */
+ check_send_occ_req (c);
+
+ /* Should we send an MTU load test? */
+ check_send_occ_load_test (c);
+
+ /* Should we send an OCC_EXIT message to remote? */
+ if (c->c2.explicit_exit_notification_time_wait)
+ process_explicit_exit_notification_timer_wakeup (c);
+#endif
+
+ /* Should we ping the remote? */
+ check_ping_send (c);
+}
+
+static void
+check_coarse_timers_dowork (struct context *c)
+{
+ const struct timeval save = c->c2.timeval;
+ c->c2.timeval.tv_sec = BIG_TIMEOUT;
+ c->c2.timeval.tv_usec = 0;
+ process_coarse_timers (c);
+ c->c2.coarse_timer_wakeup = now + c->c2.timeval.tv_sec;
+
+ dmsg (D_INTERVAL, "TIMER: coarse timer wakeup %d seconds", (int) c->c2.timeval.tv_sec);
+
+ /* Is the coarse timeout NOT the earliest one? */
+ if (c->c2.timeval.tv_sec > save.tv_sec)
+ c->c2.timeval = save;
+}
+
+static inline void
+check_coarse_timers (struct context *c)
+{
+ const time_t local_now = now;
+ if (local_now >= c->c2.coarse_timer_wakeup)
+ check_coarse_timers_dowork (c);
+ else
+ context_reschedule_sec (c, c->c2.coarse_timer_wakeup - local_now);
+}
+
+static void
+check_timeout_random_component_dowork (struct context *c)
+{
+ const int update_interval = 10; /* seconds */
+ c->c2.update_timeout_random_component = now + update_interval;
+ c->c2.timeout_random_component.tv_usec = (time_t) get_random () & 0x0003FFFF;
+ c->c2.timeout_random_component.tv_sec = 0;
+
+ dmsg (D_INTERVAL, "RANDOM USEC=%d", (int) c->c2.timeout_random_component.tv_usec);
+}
+
+static inline void
+check_timeout_random_component (struct context *c)
+{
+ if (now >= c->c2.update_timeout_random_component)
+ check_timeout_random_component_dowork (c);
+ if (c->c2.timeval.tv_sec >= 1)
+ tv_add (&c->c2.timeval, &c->c2.timeout_random_component);
+}
+
+/*
+ * Handle addition and removal of the 10-byte Socks5 header
+ * in UDP packets.
+ */
+
+static inline void
+socks_postprocess_incoming_link (struct context *c)
+{
+ if (c->c2.link_socket->socks_proxy && c->c2.link_socket->info.proto == PROTO_UDP)
+ socks_process_incoming_udp (&c->c2.buf, &c->c2.from);
+}
+
+static inline void
+socks_preprocess_outgoing_link (struct context *c,
+ struct link_socket_actual **to_addr,
+ int *size_delta)
+{
+ if (c->c2.link_socket->socks_proxy && c->c2.link_socket->info.proto == PROTO_UDP)
+ {
+ *size_delta += socks_process_outgoing_udp (&c->c2.to_link, c->c2.to_link_addr);
+ *to_addr = &c->c2.link_socket->socks_relay;
+ }
+}
+
+/* undo effect of socks_preprocess_outgoing_link */
+static inline void
+link_socket_write_post_size_adjust (int *size,
+ int size_delta,
+ struct buffer *buf)
+{
+ if (size_delta > 0 && *size > size_delta)
+ {
+ *size -= size_delta;
+ if (!buf_advance (buf, size_delta))
+ *size = 0;
+ }
+}
+
+/*
+ * Output: c->c2.buf
+ */
+
+void
+read_incoming_link (struct context *c)
+{
+ /*
+ * Set up for recvfrom call to read datagram
+ * sent to our TCP/UDP port.
+ */
+ int status;
+
+ /*ASSERT (!c->c2.to_tun.len);*/
+
+ perf_push (PERF_READ_IN_LINK);
+
+ c->c2.buf = c->c2.buffers->read_link_buf;
+ ASSERT (buf_init (&c->c2.buf, FRAME_HEADROOM_ADJ (&c->c2.frame, FRAME_HEADROOM_MARKER_READ_LINK)));
+
+ status = link_socket_read (c->c2.link_socket,
+ &c->c2.buf,
+ MAX_RW_SIZE_LINK (&c->c2.frame),
+ &c->c2.from);
+
+ if (socket_connection_reset (c->c2.link_socket, status))
+ {
+#if PORT_SHARE
+ if (port_share && socket_foreign_protocol_detected (c->c2.link_socket))
+ {
+ const struct buffer *fbuf = socket_foreign_protocol_head (c->c2.link_socket);
+ const int sd = socket_foreign_protocol_sd (c->c2.link_socket);
+ port_share_redirect (port_share, fbuf, sd);
+ register_signal (c, SIGTERM, "port-share-redirect");
+ }
+ else
+#endif
+ {
+ /* received a disconnect from a connection-oriented protocol */
+ if (c->options.inetd)
+ {
+ register_signal (c, SIGTERM, "connection-reset-inetd");
+ msg (D_STREAM_ERRORS, "Connection reset, inetd/xinetd exit [%d]", status);
+ }
+ else
+ {
+#ifdef ENABLE_OCC
+ if (event_timeout_defined(&c->c2.explicit_exit_notification_interval))
+ {
+ msg (D_STREAM_ERRORS, "Connection reset during exit notification period, ignoring [%d]", status);
+ openvpn_sleep(1);
+ }
+ else
+#endif
+ {
+ register_signal (c, SIGUSR1, "connection-reset"); /* SOFT-SIGUSR1 -- TCP connection reset */
+ msg (D_STREAM_ERRORS, "Connection reset, restarting [%d]", status);
+ }
+ }
+ }
+ perf_pop ();
+ return;
+ }
+
+ /* check recvfrom status */
+ check_status (status, "read", c->c2.link_socket, NULL);
+
+ /* Remove socks header if applicable */
+ socks_postprocess_incoming_link (c);
+
+ perf_pop ();
+}
+
+/*
+ * Input: c->c2.buf
+ * Output: c->c2.to_tun
+ */
+
+void
+process_incoming_link (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ bool decrypt_status;
+ struct link_socket_info *lsi = get_link_socket_info (c);
+ const uint8_t *orig_buf = c->c2.buf.data;
+
+ perf_push (PERF_PROC_IN_LINK);
+
+ if (c->c2.buf.len > 0)
+ {
+ c->c2.link_read_bytes += c->c2.buf.len;
+ link_read_bytes_global += c->c2.buf.len;
+#ifdef ENABLE_MEMSTATS
+ if (mmap_stats)
+ mmap_stats->link_read_bytes = link_read_bytes_global;
+#endif
+ c->c2.original_recv_size = c->c2.buf.len;
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_bytes_in (management, c->c2.buf.len);
+#ifdef MANAGEMENT_DEF_AUTH
+ management_bytes_server (management, &c->c2.link_read_bytes, &c->c2.link_write_bytes, &c->c2.mda_context);
+#endif
+ }
+#endif
+ }
+ else
+ c->c2.original_recv_size = 0;
+
+#ifdef ENABLE_DEBUG
+ /* take action to corrupt packet if we are in gremlin test mode */
+ if (c->options.gremlin) {
+ if (!ask_gremlin (c->options.gremlin))
+ c->c2.buf.len = 0;
+ corrupt_gremlin (&c->c2.buf, c->options.gremlin);
+ }
+#endif
+
+ /* log incoming packet */
+#ifdef LOG_RW
+ if (c->c2.log_rw && c->c2.buf.len > 0)
+ fprintf (stderr, "R");
+#endif
+ msg (D_LINK_RW, "%s READ [%d] from %s: %s",
+ proto2ascii (lsi->proto, lsi->af, true),
+ BLEN (&c->c2.buf),
+ print_link_socket_actual (&c->c2.from, &gc),
+ PROTO_DUMP (&c->c2.buf, &gc));
+
+ /*
+ * Good, non-zero length packet received.
+ * Commence multi-stage processing of packet,
+ * such as authenticate, decrypt, decompress.
+ * If any stage fails, it sets buf.len to 0 or -1,
+ * telling downstream stages to ignore the packet.
+ */
+ if (c->c2.buf.len > 0)
+ {
+ if (!link_socket_verify_incoming_addr (&c->c2.buf, lsi, &c->c2.from))
+ link_socket_bad_incoming_addr (&c->c2.buf, lsi, &c->c2.from);
+
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_SSL
+ if (c->c2.tls_multi)
+ {
+ /*
+ * If tls_pre_decrypt returns true, it means the incoming
+ * packet was a good TLS control channel packet. If so, TLS code
+ * will deal with the packet and set buf.len to 0 so downstream
+ * stages ignore it.
+ *
+ * If the packet is a data channel packet, tls_pre_decrypt
+ * will load crypto_options with the correct encryption key
+ * and return false.
+ */
+ if (tls_pre_decrypt (c->c2.tls_multi, &c->c2.from, &c->c2.buf, &c->c2.crypto_options))
+ {
+ interval_action (&c->c2.tmp_int);
+
+ /* reset packet received timer if TLS packet */
+ if (c->options.ping_rec_timeout)
+ event_timeout_reset (&c->c2.ping_rec_interval);
+ }
+ }
+#if P2MP_SERVER
+ /*
+ * Drop non-TLS packet if client-connect script/plugin has not
+ * yet succeeded.
+ */
+ if (c->c2.context_auth != CAS_SUCCEEDED)
+ c->c2.buf.len = 0;
+#endif
+#endif /* ENABLE_SSL */
+
+ /* authenticate and decrypt the incoming packet */
+ decrypt_status = openvpn_decrypt (&c->c2.buf, c->c2.buffers->decrypt_buf, &c->c2.crypto_options, &c->c2.frame);
+
+ if (!decrypt_status && link_socket_connection_oriented (c->c2.link_socket))
+ {
+ /* decryption errors are fatal in TCP mode */
+ register_signal (c, SIGUSR1, "decryption-error"); /* SOFT-SIGUSR1 -- decryption error in TCP mode */
+ msg (D_STREAM_ERRORS, "Fatal decryption error (process_incoming_link), restarting");
+ goto done;
+ }
+
+#endif /* ENABLE_CRYPTO */
+
+#ifdef ENABLE_FRAGMENT
+ if (c->c2.fragment)
+ fragment_incoming (c->c2.fragment, &c->c2.buf, &c->c2.frame_fragment);
+#endif
+
+#ifdef USE_COMP
+ /* decompress the incoming packet */
+ if (c->c2.comp_context)
+ (*c->c2.comp_context->alg.decompress)(&c->c2.buf, c->c2.buffers->decompress_buf, c->c2.comp_context, &c->c2.frame);
+#endif
+
+#ifdef PACKET_TRUNCATION_CHECK
+ /* if (c->c2.buf.len > 1) --c->c2.buf.len; */
+ ipv4_packet_size_verify (BPTR (&c->c2.buf),
+ BLEN (&c->c2.buf),
+ TUNNEL_TYPE (c->c1.tuntap),
+ "POST_DECRYPT",
+ &c->c2.n_trunc_post_decrypt);
+#endif
+
+ /*
+ * Set our "official" outgoing address, since
+ * if buf.len is non-zero, we know the packet
+ * authenticated. In TLS mode we do nothing
+ * because TLS mode takes care of source address
+ * authentication.
+ *
+ * Also, update the persisted version of our packet-id.
+ */
+ if (!TLS_MODE (c))
+ link_socket_set_outgoing_addr (&c->c2.buf, lsi, &c->c2.from, NULL, c->c2.es);
+
+ /* reset packet received timer */
+ if (c->options.ping_rec_timeout && c->c2.buf.len > 0)
+ event_timeout_reset (&c->c2.ping_rec_interval);
+
+ /* increment authenticated receive byte count */
+ if (c->c2.buf.len > 0)
+ {
+ c->c2.link_read_bytes_auth += c->c2.buf.len;
+ c->c2.max_recv_size_local = max_int (c->c2.original_recv_size, c->c2.max_recv_size_local);
+ }
+
+ /* Did we just receive an openvpn ping packet? */
+ if (is_ping_msg (&c->c2.buf))
+ {
+ dmsg (D_PING, "RECEIVED PING PACKET");
+ c->c2.buf.len = 0; /* drop packet */
+ }
+
+#ifdef ENABLE_OCC
+ /* Did we just receive an OCC packet? */
+ if (is_occ_msg (&c->c2.buf))
+ process_received_occ_msg (c);
+#endif
+
+ buffer_turnover (orig_buf, &c->c2.to_tun, &c->c2.buf, &c->c2.buffers->read_link_buf);
+
+ /* to_tun defined + unopened tuntap can cause deadlock */
+ if (!tuntap_defined (c->c1.tuntap))
+ c->c2.to_tun.len = 0;
+ }
+ else
+ {
+ buf_reset (&c->c2.to_tun);
+ }
+ done:
+ perf_pop ();
+ gc_free (&gc);
+}
+
+/*
+ * Output: c->c2.buf
+ */
+
+void
+read_incoming_tun (struct context *c)
+{
+ /*
+ * Setup for read() call on TUN/TAP device.
+ */
+ /*ASSERT (!c->c2.to_link.len);*/
+
+ perf_push (PERF_READ_IN_TUN);
+
+ c->c2.buf = c->c2.buffers->read_tun_buf;
+#ifdef TUN_PASS_BUFFER
+ read_tun_buffered (c->c1.tuntap, &c->c2.buf, MAX_RW_SIZE_TUN (&c->c2.frame));
+#else
+ ASSERT (buf_init (&c->c2.buf, FRAME_HEADROOM (&c->c2.frame)));
+ ASSERT (buf_safe (&c->c2.buf, MAX_RW_SIZE_TUN (&c->c2.frame)));
+ c->c2.buf.len = read_tun (c->c1.tuntap, BPTR (&c->c2.buf), MAX_RW_SIZE_TUN (&c->c2.frame));
+#endif
+
+#ifdef PACKET_TRUNCATION_CHECK
+ ipv4_packet_size_verify (BPTR (&c->c2.buf),
+ BLEN (&c->c2.buf),
+ TUNNEL_TYPE (c->c1.tuntap),
+ "READ_TUN",
+ &c->c2.n_trunc_tun_read);
+#endif
+
+ /* Was TUN/TAP interface stopped? */
+ if (tuntap_stop (c->c2.buf.len))
+ {
+ register_signal (c, SIGTERM, "tun-stop");
+ msg (M_INFO, "TUN/TAP interface has been stopped, exiting");
+ perf_pop ();
+ return;
+ }
+
+ /* Check the status return from read() */
+ check_status (c->c2.buf.len, "read from TUN/TAP", NULL, c->c1.tuntap);
+
+ perf_pop ();
+}
+
+/*
+ * Input: c->c2.buf
+ * Output: c->c2.to_link
+ */
+
+void
+process_incoming_tun (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+
+ perf_push (PERF_PROC_IN_TUN);
+
+ if (c->c2.buf.len > 0)
+ c->c2.tun_read_bytes += c->c2.buf.len;
+
+#ifdef LOG_RW
+ if (c->c2.log_rw && c->c2.buf.len > 0)
+ fprintf (stderr, "r");
+#endif
+
+ /* Show packet content */
+ dmsg (D_TUN_RW, "TUN READ [%d]", BLEN (&c->c2.buf));
+
+ if (c->c2.buf.len > 0)
+ {
+ /*
+ * The --passtos and --mssfix options require
+ * us to examine the IP header (IPv4 or IPv6).
+ */
+ process_ip_header (c, PIPV4_PASSTOS|PIP_MSSFIX|PIPV4_CLIENT_NAT, &c->c2.buf);
+
+#ifdef PACKET_TRUNCATION_CHECK
+ /* if (c->c2.buf.len > 1) --c->c2.buf.len; */
+ ipv4_packet_size_verify (BPTR (&c->c2.buf),
+ BLEN (&c->c2.buf),
+ TUNNEL_TYPE (c->c1.tuntap),
+ "PRE_ENCRYPT",
+ &c->c2.n_trunc_pre_encrypt);
+#endif
+
+ encrypt_sign (c, true);
+ }
+ else
+ {
+ buf_reset (&c->c2.to_link);
+ }
+ perf_pop ();
+ gc_free (&gc);
+}
+
+void
+process_ip_header (struct context *c, unsigned int flags, struct buffer *buf)
+{
+ if (!c->options.ce.mssfix)
+ flags &= ~PIP_MSSFIX;
+#if PASSTOS_CAPABILITY
+ if (!c->options.passtos)
+ flags &= ~PIPV4_PASSTOS;
+#endif
+ if (!c->options.client_nat)
+ flags &= ~PIPV4_CLIENT_NAT;
+ if (!c->options.route_gateway_via_dhcp)
+ flags &= ~PIPV4_EXTRACT_DHCP_ROUTER;
+
+ if (buf->len > 0)
+ {
+ /*
+ * The --passtos and --mssfix options require
+ * us to examine the IPv4 header.
+ */
+
+ if (flags & (PIP_MSSFIX
+#if PASSTOS_CAPABILITY
+ | PIPV4_PASSTOS
+#endif
+ | PIPV4_CLIENT_NAT
+ ))
+ {
+ struct buffer ipbuf = *buf;
+ if (is_ipv4 (TUNNEL_TYPE (c->c1.tuntap), &ipbuf))
+ {
+#if PASSTOS_CAPABILITY
+ /* extract TOS from IP header */
+ if (flags & PIPV4_PASSTOS)
+ link_socket_extract_tos (c->c2.link_socket, &ipbuf);
+#endif
+
+ /* possibly alter the TCP MSS */
+ if (flags & PIP_MSSFIX)
+ mss_fixup_ipv4 (&ipbuf, MTU_TO_MSS (TUN_MTU_SIZE_DYNAMIC (&c->c2.frame)));
+
+ /* possibly do NAT on packet */
+ if ((flags & PIPV4_CLIENT_NAT) && c->options.client_nat)
+ {
+ const int direction = (flags & PIPV4_OUTGOING) ? CN_INCOMING : CN_OUTGOING;
+ client_nat_transform (c->options.client_nat, &ipbuf, direction);
+ }
+ /* possibly extract a DHCP router message */
+ if (flags & PIPV4_EXTRACT_DHCP_ROUTER)
+ {
+ const in_addr_t dhcp_router = dhcp_extract_router_msg (&ipbuf);
+ if (dhcp_router)
+ route_list_add_vpn_gateway (c->c1.route_list, c->c2.es, dhcp_router);
+ }
+ }
+ else if (is_ipv6 (TUNNEL_TYPE (c->c1.tuntap), &ipbuf))
+ {
+ /* possibly alter the TCP MSS */
+ if (flags & PIP_MSSFIX)
+ mss_fixup_ipv6 (&ipbuf, MTU_TO_MSS (TUN_MTU_SIZE_DYNAMIC (&c->c2.frame)));
+ }
+ }
+ }
+}
+
+/*
+ * Input: c->c2.to_link
+ */
+
+void
+process_outgoing_link (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+
+ perf_push (PERF_PROC_OUT_LINK);
+
+ if (c->c2.to_link.len > 0 && c->c2.to_link.len <= EXPANDED_SIZE (&c->c2.frame))
+ {
+ /*
+ * Setup for call to send/sendto which will send
+ * packet to remote over the TCP/UDP port.
+ */
+ int size = 0;
+ ASSERT (link_socket_actual_defined (c->c2.to_link_addr));
+
+#ifdef ENABLE_DEBUG
+ /* In gremlin-test mode, we may choose to drop this packet */
+ if (!c->options.gremlin || ask_gremlin (c->options.gremlin))
+#endif
+ {
+ /*
+ * Let the traffic shaper know how many bytes
+ * we wrote.
+ */
+#ifdef ENABLE_FEATURE_SHAPER
+ if (c->options.shaper)
+ shaper_wrote_bytes (&c->c2.shaper, BLEN (&c->c2.to_link)
+ + datagram_overhead (c->options.ce.proto));
+#endif
+ /*
+ * Let the pinger know that we sent a packet.
+ */
+ if (c->options.ping_send_timeout)
+ event_timeout_reset (&c->c2.ping_send_interval);
+
+#if PASSTOS_CAPABILITY
+ /* Set TOS */
+ link_socket_set_tos (c->c2.link_socket);
+#endif
+
+ /* Log packet send */
+#ifdef LOG_RW
+ if (c->c2.log_rw)
+ fprintf (stderr, "W");
+#endif
+ msg (D_LINK_RW, "%s WRITE [%d] to %s: %s",
+ proto2ascii (c->c2.link_socket->info.proto, c->c2.link_socket->info.af, true),
+ BLEN (&c->c2.to_link),
+ print_link_socket_actual (c->c2.to_link_addr, &gc),
+ PROTO_DUMP (&c->c2.to_link, &gc));
+
+ /* Packet send complexified by possible Socks5 usage */
+ {
+ struct link_socket_actual *to_addr = c->c2.to_link_addr;
+ int size_delta = 0;
+
+ /* If Socks5 over UDP, prepend header */
+ socks_preprocess_outgoing_link (c, &to_addr, &size_delta);
+
+ /* Send packet */
+ size = link_socket_write (c->c2.link_socket,
+ &c->c2.to_link,
+ to_addr);
+
+ /* Undo effect of prepend */
+ link_socket_write_post_size_adjust (&size, size_delta, &c->c2.to_link);
+ }
+
+ if (size > 0)
+ {
+ c->c2.max_send_size_local = max_int (size, c->c2.max_send_size_local);
+ c->c2.link_write_bytes += size;
+ link_write_bytes_global += size;
+#ifdef ENABLE_MEMSTATS
+ if (mmap_stats)
+ mmap_stats->link_write_bytes = link_write_bytes_global;
+#endif
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_bytes_out (management, size);
+#ifdef MANAGEMENT_DEF_AUTH
+ management_bytes_server (management, &c->c2.link_read_bytes, &c->c2.link_write_bytes, &c->c2.mda_context);
+#endif
+ }
+#endif
+ }
+ }
+
+ /* Check return status */
+ check_status (size, "write", c->c2.link_socket, NULL);
+
+ if (size > 0)
+ {
+ /* Did we write a different size packet than we intended? */
+ if (size != BLEN (&c->c2.to_link))
+ msg (D_LINK_ERRORS,
+ "TCP/UDP packet was truncated/expanded on write to %s (tried=%d,actual=%d)",
+ print_link_socket_actual (c->c2.to_link_addr, &gc),
+ BLEN (&c->c2.to_link),
+ size);
+ }
+
+ /* if not a ping/control message, indicate activity regarding --inactive parameter */
+ if (c->c2.buf.len > 0 )
+ register_activity (c, size);
+ }
+ else
+ {
+ if (c->c2.to_link.len > 0)
+ msg (D_LINK_ERRORS, "TCP/UDP packet too large on write to %s (tried=%d,max=%d)",
+ print_link_socket_actual (c->c2.to_link_addr, &gc),
+ c->c2.to_link.len,
+ EXPANDED_SIZE (&c->c2.frame));
+ }
+
+ buf_reset (&c->c2.to_link);
+
+ perf_pop ();
+ gc_free (&gc);
+}
+
+/*
+ * Input: c->c2.to_tun
+ */
+
+void
+process_outgoing_tun (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+
+ /*
+ * Set up for write() call to TUN/TAP
+ * device.
+ */
+ if (c->c2.to_tun.len <= 0)
+ return;
+
+ perf_push (PERF_PROC_OUT_TUN);
+
+ /*
+ * The --mssfix option requires
+ * us to examine the IP header (IPv4 or IPv6).
+ */
+ process_ip_header (c, PIP_MSSFIX|PIPV4_EXTRACT_DHCP_ROUTER|PIPV4_CLIENT_NAT|PIPV4_OUTGOING, &c->c2.to_tun);
+
+ if (c->c2.to_tun.len <= MAX_RW_SIZE_TUN (&c->c2.frame))
+ {
+ /*
+ * Write to TUN/TAP device.
+ */
+ int size;
+
+#ifdef LOG_RW
+ if (c->c2.log_rw)
+ fprintf (stderr, "w");
+#endif
+ dmsg (D_TUN_RW, "TUN WRITE [%d]", BLEN (&c->c2.to_tun));
+
+#ifdef PACKET_TRUNCATION_CHECK
+ ipv4_packet_size_verify (BPTR (&c->c2.to_tun),
+ BLEN (&c->c2.to_tun),
+ TUNNEL_TYPE (c->c1.tuntap),
+ "WRITE_TUN",
+ &c->c2.n_trunc_tun_write);
+#endif
+
+#ifdef TUN_PASS_BUFFER
+ size = write_tun_buffered (c->c1.tuntap, &c->c2.to_tun);
+#else
+ size = write_tun (c->c1.tuntap, BPTR (&c->c2.to_tun), BLEN (&c->c2.to_tun));
+#endif
+
+ if (size > 0)
+ c->c2.tun_write_bytes += size;
+ check_status (size, "write to TUN/TAP", NULL, c->c1.tuntap);
+
+ /* check written packet size */
+ if (size > 0)
+ {
+ /* Did we write a different size packet than we intended? */
+ if (size != BLEN (&c->c2.to_tun))
+ msg (D_LINK_ERRORS,
+ "TUN/TAP packet was destructively fragmented on write to %s (tried=%d,actual=%d)",
+ c->c1.tuntap->actual_name,
+ BLEN (&c->c2.to_tun),
+ size);
+
+ /* indicate activity regarding --inactive parameter */
+ register_activity (c, size);
+ }
+ }
+ else
+ {
+ /*
+ * This should never happen, probably indicates some kind
+ * of MTU mismatch.
+ */
+ msg (D_LINK_ERRORS, "tun packet too large on write (tried=%d,max=%d)",
+ c->c2.to_tun.len,
+ MAX_RW_SIZE_TUN (&c->c2.frame));
+ }
+
+ buf_reset (&c->c2.to_tun);
+
+ perf_pop ();
+ gc_free (&gc);
+}
+
+void
+pre_select (struct context *c)
+{
+ /* make sure current time (now) is updated on function entry */
+
+ /*
+ * Start with an effectively infinite timeout, then let it
+ * reduce to a timeout that reflects the component which
+ * needs the earliest service.
+ */
+ c->c2.timeval.tv_sec = BIG_TIMEOUT;
+ c->c2.timeval.tv_usec = 0;
+
+#if defined(WIN32)
+ if (check_debug_level (D_TAP_WIN_DEBUG))
+ {
+ c->c2.timeval.tv_sec = 1;
+ if (tuntap_defined (c->c1.tuntap))
+ tun_show_debug (c->c1.tuntap);
+ }
+#endif
+
+ /* check coarse timers? */
+ check_coarse_timers (c);
+ if (c->sig->signal_received)
+ return;
+
+ /* Does TLS need service? */
+ check_tls (c);
+
+ /* In certain cases, TLS errors will require a restart */
+ check_tls_errors (c);
+ if (c->sig->signal_received)
+ return;
+
+ /* check for incoming configuration info on the control channel */
+ check_incoming_control_channel (c);
+
+#ifdef ENABLE_OCC
+ /* Should we send an OCC message? */
+ check_send_occ_msg (c);
+#endif
+
+#ifdef ENABLE_FRAGMENT
+ /* Should we deliver a datagram fragment to remote? */
+ check_fragment (c);
+#endif
+
+ /* Update random component of timeout */
+ check_timeout_random_component (c);
+}
+
+/*
+ * Wait for I/O events. Used for both TCP & UDP sockets
+ * in point-to-point mode and for UDP sockets in
+ * point-to-multipoint mode.
+ */
+
+void
+io_wait_dowork (struct context *c, const unsigned int flags)
+{
+ unsigned int socket = 0;
+ unsigned int tuntap = 0;
+ struct event_set_return esr[4];
+
+ /* These shifts all depend on EVENT_READ and EVENT_WRITE */
+ static int socket_shift = 0; /* depends on SOCKET_READ and SOCKET_WRITE */
+ static int tun_shift = 2; /* depends on TUN_READ and TUN_WRITE */
+ static int err_shift = 4; /* depends on ES_ERROR */
+#ifdef ENABLE_MANAGEMENT
+ static int management_shift = 6; /* depends on MANAGEMENT_READ and MANAGEMENT_WRITE */
+#endif
+
+ /*
+ * Decide what kind of events we want to wait for.
+ */
+ event_reset (c->c2.event_set);
+
+ /*
+ * On win32 we use the keyboard or an event object as a source
+ * of asynchronous signals.
+ */
+ if (flags & IOW_WAIT_SIGNAL)
+ wait_signal (c->c2.event_set, (void*)&err_shift);
+
+ /*
+ * If outgoing data (for TCP/UDP port) pending, wait for ready-to-send
+ * status from TCP/UDP port. Otherwise, wait for incoming data on
+ * TUN/TAP device.
+ */
+ if (flags & IOW_TO_LINK)
+ {
+ if (flags & IOW_SHAPER)
+ {
+ /*
+ * If sending this packet would put us over our traffic shaping
+ * quota, don't send -- instead compute the delay we must wait
+ * until it will be OK to send the packet.
+ */
+#ifdef ENABLE_FEATURE_SHAPER
+ int delay = 0;
+
+ /* set traffic shaping delay in microseconds */
+ if (c->options.shaper)
+ delay = max_int (delay, shaper_delay (&c->c2.shaper));
+
+ if (delay < 1000)
+ {
+ socket |= EVENT_WRITE;
+ }
+ else
+ {
+ shaper_soonest_event (&c->c2.timeval, delay);
+ }
+#else /* ENABLE_FEATURE_SHAPER */
+ socket |= EVENT_WRITE;
+#endif /* ENABLE_FEATURE_SHAPER */
+ }
+ else
+ {
+ socket |= EVENT_WRITE;
+ }
+ }
+ else if (!((flags & IOW_FRAG) && TO_LINK_FRAG (c)))
+ {
+ if (flags & IOW_READ_TUN)
+ tuntap |= EVENT_READ;
+ }
+
+ /*
+ * If outgoing data (for TUN/TAP device) pending, wait for ready-to-send status
+ * from device. Otherwise, wait for incoming data on TCP/UDP port.
+ */
+ if (flags & IOW_TO_TUN)
+ {
+ tuntap |= EVENT_WRITE;
+ }
+ else
+ {
+ if (flags & IOW_READ_LINK)
+ socket |= EVENT_READ;
+ }
+
+ /*
+ * outgoing bcast buffer waiting to be sent?
+ */
+ if (flags & IOW_MBUF)
+ socket |= EVENT_WRITE;
+
+ /*
+ * Force wait on TUN input, even if also waiting on TCP/UDP output
+ */
+ if (flags & IOW_READ_TUN_FORCE)
+ tuntap |= EVENT_READ;
+
+ /*
+ * Configure event wait based on socket, tuntap flags.
+ */
+ socket_set (c->c2.link_socket, c->c2.event_set, socket, (void*)&socket_shift, NULL);
+ tun_set (c->c1.tuntap, c->c2.event_set, tuntap, (void*)&tun_shift, NULL);
+
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_socket_set (management, c->c2.event_set, (void*)&management_shift, NULL);
+#endif
+
+ /*
+ * Possible scenarios:
+ * (1) tcp/udp port has data available to read
+ * (2) tcp/udp port is ready to accept more data to write
+ * (3) tun dev has data available to read
+ * (4) tun dev is ready to accept more data to write
+ * (5) we received a signal (handler sets signal_received)
+ * (6) timeout (tv) expired
+ */
+
+ c->c2.event_set_status = ES_ERROR;
+
+ if (!c->sig->signal_received)
+ {
+ if (!(flags & IOW_CHECK_RESIDUAL) || !socket_read_residual (c->c2.link_socket))
+ {
+ int status;
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_EVENT_WAIT))
+ show_wait_status (c);
+#endif
+
+ /*
+ * Wait for something to happen.
+ */
+ status = event_wait (c->c2.event_set, &c->c2.timeval, esr, SIZE(esr));
+
+ check_status (status, "event_wait", NULL, NULL);
+
+ if (status > 0)
+ {
+ int i;
+ c->c2.event_set_status = 0;
+ for (i = 0; i < status; ++i)
+ {
+ const struct event_set_return *e = &esr[i];
+ c->c2.event_set_status |= ((e->rwflags & 3) << *((int*)e->arg));
+ }
+ }
+ else if (status == 0)
+ {
+ c->c2.event_set_status = ES_TIMEOUT;
+ }
+ }
+ else
+ {
+ c->c2.event_set_status = SOCKET_READ;
+ }
+ }
+
+ /* 'now' should always be a reasonably up-to-date timestamp */
+ update_time ();
+
+ /* set signal_received if a signal was received */
+ if (c->c2.event_set_status & ES_ERROR)
+ get_signal (&c->sig->signal_received);
+
+ dmsg (D_EVENT_WAIT, "I/O WAIT status=0x%04x", c->c2.event_set_status);
+}
+
+void
+process_io (struct context *c)
+{
+ const unsigned int status = c->c2.event_set_status;
+
+#ifdef ENABLE_MANAGEMENT
+ if (status & (MANAGEMENT_READ|MANAGEMENT_WRITE))
+ {
+ ASSERT (management);
+ management_io (management);
+ }
+#endif
+
+ /* TCP/UDP port ready to accept write */
+ if (status & SOCKET_WRITE)
+ {
+ process_outgoing_link (c);
+ }
+ /* TUN device ready to accept write */
+ else if (status & TUN_WRITE)
+ {
+ process_outgoing_tun (c);
+ }
+ /* Incoming data on TCP/UDP port */
+ else if (status & SOCKET_READ)
+ {
+ read_incoming_link (c);
+ if (!IS_SIG (c))
+ process_incoming_link (c);
+ }
+ /* Incoming data on TUN device */
+ else if (status & TUN_READ)
+ {
+ read_incoming_tun (c);
+ if (!IS_SIG (c))
+ process_incoming_tun (c);
+ }
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.h
new file mode 100644
index 00000000..1830a00b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/forward.h
@@ -0,0 +1,242 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/**
+ * @file
+ * Interface functions to the internal and external multiplexers.
+ */
+
+
+#ifndef FORWARD_H
+#define FORWARD_H
+
+#include "openvpn.h"
+#include "occ.h"
+#include "ping.h"
+
+#define TUN_OUT(c) (BLEN(&(c)->c2.to_tun) > 0)
+#define LINK_OUT(c) (BLEN(&(c)->c2.to_link) > 0)
+#define ANY_OUT(c) (TUN_OUT(c) || LINK_OUT(c))
+
+#ifdef ENABLE_FRAGMENT
+#define TO_LINK_FRAG(c) ((c)->c2.fragment && fragment_outgoing_defined ((c)->c2.fragment))
+#else
+#define TO_LINK_FRAG(c) (false)
+#endif
+
+#define TO_LINK_DEF(c) (LINK_OUT(c) || TO_LINK_FRAG(c))
+
+#define IOW_TO_TUN (1<<0)
+#define IOW_TO_LINK (1<<1)
+#define IOW_READ_TUN (1<<2)
+#define IOW_READ_LINK (1<<3)
+#define IOW_SHAPER (1<<4)
+#define IOW_CHECK_RESIDUAL (1<<5)
+#define IOW_FRAG (1<<6)
+#define IOW_MBUF (1<<7)
+#define IOW_READ_TUN_FORCE (1<<8)
+#define IOW_WAIT_SIGNAL (1<<9)
+
+#define IOW_READ (IOW_READ_TUN|IOW_READ_LINK)
+
+
+void pre_select (struct context *c);
+void process_io (struct context *c);
+
+const char *wait_status_string (struct context *c, struct gc_arena *gc);
+void show_wait_status (struct context *c);
+
+
+/**********************************************************************/
+/**
+ * Process a data channel packet that will be sent through a VPN tunnel.
+ * @ingroup data_control
+ *
+ * This function controls the processing of a data channel packet which
+ * will be sent through a VPN tunnel to a remote OpenVPN peer. It's
+ * general structure is as follows:
+ * - Check that the client authentication has succeeded; if not, drop the
+ * packet.
+ * - If the \a comp_frag argument is true:
+ * - Call \c lzo_compress() of the \link Data Channel Compression
+ * module\endlink to (possibly) compress the packet.
+ * - Call \c fragment_outgoing() of the \link Data Channel Fragmentation
+ * module\endlink to (possibly) fragment the packet.
+ * - Activate the \link Data Channel Crypto module\endlink to perform
+ * security operations on the packet.
+ * - Call \c tls_pre_encrypt() to choose the appropriate security
+ * parameters for this packet.
+ * - Call \c openvpn_encrypt() to encrypt and HMAC signed the packet.
+ * - Call \c tls_post_encrypt() to prepend the one-byte OpenVPN header
+ * and do some TLS accounting.
+ * - Place the resulting packet in \c c->c2.to_link so that it can be sent
+ * over the external network interface to its remote destination by the
+ * \link external_multiplexer External Multiplexer\endlink.
+ *
+ * @param c - The context structure of the VPN tunnel associated with this
+ * packet.
+ * @param comp_frag - Whether to do packet compression and fragmentation.
+ * This flag is set to true the first time a packet is processed. If
+ * the packet then gets fragmented, this function will be called again
+ * once for each remaining fragment with this parameter set to false.
+ */
+void encrypt_sign (struct context *c, bool comp_frag);
+
+
+/**********************************************************************/
+/**
+ * Read a packet from the external network interface.
+ * @ingroup external_multiplexer
+ *
+ * The packet read from the external network interface is stored in \c
+ * c->c2.buf and its source address in \c c->c2.from. If an error
+ * occurred, the length of \c c->c2.buf will be 0.
+ *
+ * OpenVPN running as client or as UDP server only has a single external
+ * network socket, so this function can be called with the single (client
+ * mode) or top level (UDP server) context as its argument. OpenVPN
+ * running as TCP server, on the other hand, has a network socket for each
+ * active VPN tunnel. In that case this function must be called with the
+ * context associated with the appropriate VPN tunnel for which data is
+ * available to be read.
+ *
+ * @param c - The context structure which contains the external
+ * network socket from which to read incoming packets.
+ */
+void read_incoming_link (struct context *c);
+
+
+/**
+ * Process a packet read from the external network interface.
+ * @ingroup external_multiplexer
+ *
+ * This function controls the processing of a data channel packet which
+ * has come out of a VPN tunnel. It's high-level structure is as follows:
+ * - Verify that a nonzero length packet has been received from a valid
+ * source address for the given context \a c.
+ * - Call \c tls_pre_decrypt(), which splits data channel and control
+ * channel packets:
+ * - If a data channel packet, the appropriate security parameters are
+ * loaded.
+ * - If a control channel packet, this function process is it and
+ * afterwards sets the packet's buffer length to 0, so that the data
+ * channel processing steps below will ignore it.
+ * - Call \c openvpn_decrypt() of the \link data_crypto Data Channel
+ * Crypto module\endlink to authenticate and decrypt the packet using
+ * the security parameters loaded by \c tls_pre_decrypt() above.
+ * - Call \c fragment_incoming() of the \link fragmentation Data Channel
+ * Fragmentation module\endlink to reassemble the packet if it's
+ * fragmented.
+ * - Call \c lzo_decompress() of the \link compression Data Channel
+ * Compression module\endlink to decompress the packet if it's
+ * compressed.
+ * - Place the resulting packet in \c c->c2.to_tun so that it can be sent
+ * over the virtual tun/tap network interface to its local destination
+ * by the \link internal_multiplexer Internal Multiplexer\endlink.
+ *
+ * @param c - The context structure of the VPN tunnel associated with the
+ * packet.
+ */
+void process_incoming_link (struct context *c);
+
+
+/**
+ * Write a packet to the external network interface.
+ * @ingroup external_multiplexer
+ *
+ * This function writes the packet stored in \c c->c2.to_link to the
+ * external network device contained within \c c->c1.link_socket.
+ *
+ * If an error occurs, it is logged and the packet is dropped.
+ *
+ * @param c - The context structure of the VPN tunnel associated with the
+ * packet.
+ */
+void process_outgoing_link (struct context *c);
+
+
+/**************************************************************************/
+/**
+ * Read a packet from the virtual tun/tap network interface.
+ * @ingroup internal_multiplexer
+ *
+ * This function reads a packet from the virtual tun/tap network device \c
+ * c->c1.tuntap and stores it in \c c->c2.buf.
+ *
+ * If an error occurs, it is logged and the packet is dropped.
+ *
+ * @param c - The context structure in which to store the received
+ * packet.
+ */
+void read_incoming_tun (struct context *c);
+
+
+/**
+ * Process a packet read from the virtual tun/tap network interface.
+ * @ingroup internal_multiplexer
+ *
+ * This function calls \c encrypt_sign() of the \link data_control Data
+ * Channel Control module\endlink to process the packet.
+ *
+ * If an error occurs, it is logged and the packet is dropped.
+ *
+ * @param c - The context structure of the VPN tunnel associated with the
+ * packet.
+ */
+void process_incoming_tun (struct context *c);
+
+
+/**
+ * Write a packet to the virtual tun/tap network interface.
+ * @ingroup internal_multiplexer
+ *
+ * This function writes the packet stored in \c c->c2.to_tun to the
+ * virtual tun/tap network device \c c->c1.tuntap.
+ *
+ * If an error occurs, it is logged and the packet is dropped.
+ *
+ * @param c - The context structure of the VPN tunnel associated with
+ * the packet.
+ */
+void process_outgoing_tun (struct context *c);
+
+
+/**************************************************************************/
+
+bool send_control_channel_string (struct context *c, const char *str, int msglevel);
+
+#define PIPV4_PASSTOS (1<<0)
+#define PIP_MSSFIX (1<<1) /* v4 and v6 */
+#define PIPV4_OUTGOING (1<<2)
+#define PIPV4_EXTRACT_DHCP_ROUTER (1<<3)
+#define PIPV4_CLIENT_NAT (1<<4)
+
+void process_ip_header (struct context *c, unsigned int flags, struct buffer *buf);
+
+#if P2MP
+void schedule_exit (struct context *c, const int n_seconds, const int signal);
+#endif
+
+#endif /* FORWARD_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.c
new file mode 100644
index 00000000..7ad1d616
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.c
@@ -0,0 +1,414 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_FRAGMENT
+
+#include "misc.h"
+#include "fragment.h"
+#include "integer.h"
+#include "memdbg.h"
+
+#define FRAG_ERR(s) { errmsg = s; goto error; }
+
+static void
+fragment_list_buf_init (struct fragment_list *list, const struct frame *frame)
+{
+ int i;
+ for (i = 0; i < N_FRAG_BUF; ++i)
+ list->fragments[i].buf = alloc_buf (BUF_SIZE (frame));
+}
+
+static void
+fragment_list_buf_free (struct fragment_list *list)
+{
+ int i;
+ for (i = 0; i < N_FRAG_BUF; ++i)
+ free_buf (&list->fragments[i].buf);
+}
+
+/*
+ * Given a sequence ID number, get a fragment buffer. Use a sliding window,
+ * similar to packet_id code.
+ */
+static struct fragment *
+fragment_list_get_buf (struct fragment_list *list, int seq_id)
+{
+ int diff;
+ if (abs (diff = modulo_subtract (seq_id, list->seq_id, N_SEQ_ID)) >= N_FRAG_BUF)
+ {
+ int i;
+ for (i = 0; i < N_FRAG_BUF; ++i)
+ list->fragments[i].defined = false;
+ list->index = 0;
+ list->seq_id = seq_id;
+ diff = 0;
+ }
+ while (diff > 0)
+ {
+ list->fragments[list->index = modulo_add (list->index, 1, N_FRAG_BUF)].defined = false;
+ list->seq_id = modulo_add (list->seq_id, 1, N_SEQ_ID);
+ --diff;
+ }
+ return &list->fragments[modulo_add (list->index, diff, N_FRAG_BUF)];
+}
+
+struct fragment_master *
+fragment_init (struct frame *frame)
+{
+ struct fragment_master *ret;
+
+ /* code that initializes other parts of
+ fragment_master assume an initial CLEAR */
+ ALLOC_OBJ_CLEAR (ret, struct fragment_master);
+
+ /* add in the size of our contribution to the expanded frame size */
+ frame_add_to_extra_frame (frame, sizeof(fragment_header_type));
+
+ /*
+ * Outgoing sequence ID is randomized to reduce
+ * the probability of sequence number collisions
+ * when openvpn sessions are restarted. This is
+ * not done out of any need for security, as all
+ * fragmentation control information resides
+ * inside of the encrypted/authenticated envelope.
+ */
+ ret->outgoing_seq_id = (int)get_random() & (N_SEQ_ID - 1);
+
+ event_timeout_init (&ret->wakeup, FRAG_WAKEUP_INTERVAL, now);
+
+ return ret;
+}
+
+void
+fragment_free (struct fragment_master *f)
+{
+ fragment_list_buf_free (&f->incoming);
+ free_buf (&f->outgoing);
+ free_buf (&f->outgoing_return);
+ free (f);
+}
+
+void
+fragment_frame_init (struct fragment_master *f, const struct frame *frame)
+{
+ fragment_list_buf_init (&f->incoming, frame);
+ f->outgoing = alloc_buf (BUF_SIZE (frame));
+ f->outgoing_return = alloc_buf (BUF_SIZE (frame));
+}
+
+/*
+ * Accept an incoming datagram (which may be a fragment) from remote.
+ * If the datagram is whole (i.e not a fragment), pass through.
+ * If the datagram is a fragment, join with other fragments received so far.
+ * If a fragment fully completes the datagram, return the datagram.
+ */
+void
+fragment_incoming (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame)
+{
+ const char *errmsg = NULL;
+ fragment_header_type flags = 0;
+ int frag_type = 0;
+
+ if (buf->len > 0)
+ {
+ /* get flags from packet head */
+ if (!buf_read (buf, &flags, sizeof (flags)))
+ FRAG_ERR ("flags not found in packet");
+ flags = ntoh_fragment_header_type (flags);
+
+ /* get fragment type from flags */
+ frag_type = ((flags >> FRAG_TYPE_SHIFT) & FRAG_TYPE_MASK);
+
+#if 0
+ /*
+ * If you want to extract FRAG_EXTRA_MASK/FRAG_EXTRA_SHIFT bits,
+ * do it here.
+ */
+ if (frag_type == FRAG_WHOLE || frag_type == FRAG_YES_NOTLAST)
+ {
+ }
+#endif
+
+ /* handle the fragment type */
+ if (frag_type == FRAG_WHOLE)
+ {
+ dmsg (D_FRAG_DEBUG,
+ "FRAG_IN buf->len=%d type=FRAG_WHOLE flags="
+ fragment_header_format,
+ buf->len,
+ flags);
+
+ if (flags & (FRAG_SEQ_ID_MASK | FRAG_ID_MASK))
+ FRAG_ERR ("spurrious FRAG_WHOLE flags");
+ }
+ else if (frag_type == FRAG_YES_NOTLAST || frag_type == FRAG_YES_LAST)
+ {
+ const int seq_id = ((flags >> FRAG_SEQ_ID_SHIFT) & FRAG_SEQ_ID_MASK);
+ const int n = ((flags >> FRAG_ID_SHIFT) & FRAG_ID_MASK);
+ const int size = ((frag_type == FRAG_YES_LAST)
+ ? (int)(((flags >> FRAG_SIZE_SHIFT) & FRAG_SIZE_MASK) << FRAG_SIZE_ROUND_SHIFT)
+ : buf->len);
+
+ /* get the appropriate fragment buffer based on received seq_id */
+ struct fragment *frag = fragment_list_get_buf (&f->incoming, seq_id);
+
+ dmsg (D_FRAG_DEBUG,
+ "FRAG_IN len=%d type=%d seq_id=%d frag_id=%d size=%d flags="
+ fragment_header_format,
+ buf->len,
+ frag_type,
+ seq_id,
+ n,
+ size,
+ flags);
+
+ /* make sure that size is an even multiple of 1<<FRAG_SIZE_ROUND_SHIFT */
+ if (size & FRAG_SIZE_ROUND_MASK)
+ FRAG_ERR ("bad fragment size");
+
+ /* is this the first fragment for our sequence number? */
+ if (!frag->defined || (frag->defined && frag->max_frag_size != size))
+ {
+ frag->defined = true;
+ frag->max_frag_size = size;
+ frag->map = 0;
+ ASSERT (buf_init (&frag->buf, FRAME_HEADROOM_ADJ (frame, FRAME_HEADROOM_MARKER_FRAGMENT)));
+ }
+
+ /* copy the data to fragment buffer */
+ if (!buf_copy_range (&frag->buf, n * size, buf, 0, buf->len))
+ FRAG_ERR ("fragment buffer overflow");
+
+ /* set elements in bit array to reflect which fragments have been received */
+ frag->map |= (((frag_type == FRAG_YES_LAST) ? FRAG_MAP_MASK : 1) << n);
+
+ /* update timestamp on partially built datagram */
+ frag->timestamp = now;
+
+ /* received full datagram? */
+ if ((frag->map & FRAG_MAP_MASK) == FRAG_MAP_MASK)
+ {
+ frag->defined = false;
+ *buf = frag->buf;
+ }
+ else
+ {
+ buf->len = 0;
+ }
+ }
+ else if (frag_type == FRAG_TEST)
+ {
+ FRAG_ERR ("FRAG_TEST not implemented");
+ }
+ else
+ {
+ FRAG_ERR ("unknown fragment type");
+ }
+ }
+
+ return;
+
+ error:
+ if (errmsg)
+ msg (D_FRAG_ERRORS, "FRAG_IN error flags=" fragment_header_format ": %s", flags, errmsg);
+ buf->len = 0;
+ return;
+}
+
+/* pack fragment parms into a uint32_t and prepend to buffer */
+static void
+fragment_prepend_flags (struct buffer *buf,
+ int type,
+ int seq_id,
+ int frag_id,
+ int frag_size)
+{
+ fragment_header_type flags = ((type & FRAG_TYPE_MASK) << FRAG_TYPE_SHIFT)
+ | ((seq_id & FRAG_SEQ_ID_MASK) << FRAG_SEQ_ID_SHIFT)
+ | ((frag_id & FRAG_ID_MASK) << FRAG_ID_SHIFT);
+
+ if (type == FRAG_WHOLE || type == FRAG_YES_NOTLAST)
+ {
+ /*
+ * If you want to set FRAG_EXTRA_MASK/FRAG_EXTRA_SHIFT bits,
+ * do it here.
+ */
+ dmsg (D_FRAG_DEBUG,
+ "FRAG_OUT len=%d type=%d seq_id=%d frag_id=%d frag_size=%d flags="
+ fragment_header_format,
+ buf->len, type, seq_id, frag_id, frag_size, flags);
+ }
+ else
+ {
+ flags |= (((frag_size >> FRAG_SIZE_ROUND_SHIFT) & FRAG_SIZE_MASK) << FRAG_SIZE_SHIFT);
+
+ dmsg (D_FRAG_DEBUG,
+ "FRAG_OUT len=%d type=%d seq_id=%d frag_id=%d frag_size=%d flags="
+ fragment_header_format,
+ buf->len, type, seq_id, frag_id, frag_size, flags);
+ }
+
+ flags = hton_fragment_header_type (flags);
+ ASSERT (buf_write_prepend (buf, &flags, sizeof (flags)));
+}
+
+/*
+ * Without changing the number of fragments, return a possibly smaller
+ * max fragment size that will allow for the last fragment to be of
+ * similar size as previous fragments.
+ */
+static inline int
+optimal_fragment_size (int len, int max_frag_size)
+{
+ const int mfs_aligned = (max_frag_size & ~FRAG_SIZE_ROUND_MASK);
+ const int div = len / mfs_aligned;
+ const int mod = len % mfs_aligned;
+
+ if (div > 0 && mod > 0 && mod < mfs_aligned * 3 / 4)
+ return min_int (mfs_aligned, (max_frag_size - ((max_frag_size - mod) / (div + 1))
+ + FRAG_SIZE_ROUND_MASK) & ~FRAG_SIZE_ROUND_MASK);
+ else
+ return mfs_aligned;
+}
+
+/* process an outgoing datagram, possibly breaking it up into fragments */
+void
+fragment_outgoing (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame)
+{
+ const char *errmsg = NULL;
+ if (buf->len > 0)
+ {
+ /* The outgoing buffer should be empty so we can put new data in it */
+ if (f->outgoing.len)
+ msg (D_FRAG_ERRORS, "FRAG: outgoing buffer is not empty, len=[%d,%d]",
+ buf->len, f->outgoing.len);
+ if (buf->len > PAYLOAD_SIZE_DYNAMIC(frame)) /* should we fragment? */
+ {
+ /*
+ * Send the datagram as a series of 2 or more fragments.
+ */
+ f->outgoing_frag_size = optimal_fragment_size (buf->len, PAYLOAD_SIZE_DYNAMIC(frame));
+ if (buf->len > f->outgoing_frag_size * MAX_FRAGS)
+ FRAG_ERR ("too many fragments would be required to send datagram");
+ ASSERT (buf_init (&f->outgoing, FRAME_HEADROOM (frame)));
+ ASSERT (buf_copy (&f->outgoing, buf));
+ f->outgoing_seq_id = modulo_add (f->outgoing_seq_id, 1, N_SEQ_ID);
+ f->outgoing_frag_id = 0;
+ buf->len = 0;
+ ASSERT (fragment_ready_to_send (f, buf, frame));
+ }
+ else
+ {
+ /*
+ * Send the datagram whole.
+ */
+ fragment_prepend_flags (buf,
+ FRAG_WHOLE,
+ 0,
+ 0,
+ 0);
+ }
+ }
+ return;
+
+ error:
+ if (errmsg)
+ msg (D_FRAG_ERRORS, "FRAG_OUT error, len=%d frag_size=%d MAX_FRAGS=%d: %s",
+ buf->len, f->outgoing_frag_size, MAX_FRAGS, errmsg);
+ buf->len = 0;
+ return;
+}
+
+/* return true (and set buf) if we have an outgoing fragment which is ready to send */
+bool
+fragment_ready_to_send (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame)
+{
+ if (fragment_outgoing_defined (f))
+ {
+ /* get fragment size, and determine if it is the last fragment */
+ int size = f->outgoing_frag_size;
+ int last = false;
+ if (f->outgoing.len <= size)
+ {
+ size = f->outgoing.len;
+ last = true;
+ }
+
+ /* initialize return buffer */
+ *buf = f->outgoing_return;
+ ASSERT (buf_init (buf, FRAME_HEADROOM (frame)));
+ ASSERT (buf_copy_n (buf, &f->outgoing, size));
+
+ /* fragment flags differ based on whether or not we are sending the last fragment */
+ fragment_prepend_flags (buf,
+ last ? FRAG_YES_LAST : FRAG_YES_NOTLAST,
+ f->outgoing_seq_id,
+ f->outgoing_frag_id++,
+ f->outgoing_frag_size);
+
+ ASSERT (!last || !f->outgoing.len); /* outgoing buffer length should be zero after last fragment sent */
+
+ return true;
+ }
+ else
+ return false;
+}
+
+static void
+fragment_ttl_reap (struct fragment_master *f)
+{
+ int i;
+ for (i = 0; i < N_FRAG_BUF; ++i)
+ {
+ struct fragment *frag = &f->incoming.fragments[i];
+ if (frag->defined && frag->timestamp + FRAG_TTL_SEC <= now)
+ {
+ msg (D_FRAG_ERRORS, "FRAG TTL expired i=%d", i);
+ frag->defined = false;
+ }
+ }
+}
+
+/* called every FRAG_WAKEUP_INTERVAL seconds */
+void
+fragment_wakeup (struct fragment_master *f, struct frame *frame)
+{
+ /* delete fragments with expired TTLs */
+ fragment_ttl_reap (f);
+}
+
+#else
+static void dummy(void) {}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.h
new file mode 100644
index 00000000..866573b2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/fragment.h
@@ -0,0 +1,479 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef FRAGMENT_H
+#define FRAGMENT_H
+
+/**
+ * @file
+ * Data Channel Fragmentation module header file.
+ */
+
+
+#ifdef ENABLE_FRAGMENT
+
+/**
+ * @addtogroup fragmentation
+ * @{
+ */
+
+
+#include "common.h"
+#include "buffer.h"
+#include "interval.h"
+#include "mtu.h"
+#include "shaper.h"
+#include "error.h"
+
+
+#define N_FRAG_BUF 25
+ /**< Number of packet buffers for
+ * reassembling incoming fragmented
+ * packets. */
+
+#define FRAG_TTL_SEC 10
+ /**< Time-to-live in seconds for a %fragment. */
+
+#define FRAG_WAKEUP_INTERVAL 5
+ /**< Interval in seconds between calls to
+ * wakeup code. */
+
+/**************************************************************************/
+/**
+ * Structure for reassembling one incoming fragmented packet.
+ */
+struct fragment {
+ bool defined; /**< Whether reassembly is currently
+ * taking place in this structure. */
+
+ int max_frag_size; /**< Maximum size of each %fragment. */
+
+# define FRAG_MAP_MASK 0xFFFFFFFF
+ /**< Mask for reassembly map. */
+# define MAX_FRAGS 32 /**< Maximum number of fragments per packet. */
+ unsigned int map;
+ /**< Reassembly map for recording which
+ * fragments have been received.
+ *
+ * A bit array where each bit
+ * corresponds to a %fragment. A 1 bit
+ * in element n means that the %fragment
+ * n has been received. Needs to have
+ * at least \c MAX_FRAGS bits. */
+
+ time_t timestamp; /**< Timestamp for time-to-live purposes. */
+
+ struct buffer buf; /**< Buffer in which received datagrams
+ * are reassembled. */
+};
+
+
+/**
+ * List of fragment structures for reassembling multiple incoming packets
+ * concurrently.
+ */
+struct fragment_list {
+ int seq_id; /**< Highest fragmentation sequence ID of
+ * the packets currently being
+ * reassembled. */
+ int index; /**< Index of the packet being reassembled
+ * with the highest fragmentation
+ * sequence ID into the \c
+ * fragment_list.fragments array. */
+
+/** Array of reassembly structures, each can contain one whole packet.
+ *
+ * The fragmentation sequence IDs of the packets being reassembled in
+ * this array are linearly increasing. \c
+ * fragment_list.fragments[fragment_list.index] has an ID of \c
+ * fragment_list.seq_id. This means that one of these \c fragment_list
+ * structures can at any one time contain at most packets with the
+ * fragmentation sequence IDs in the range \c fragment_list.seq_id \c -
+ * \c N_FRAG_BUF \c + \c 1 to \c fragment_list.seq_id, inclusive.
+ */
+ struct fragment fragments[N_FRAG_BUF];
+};
+
+
+/**
+ * Fragmentation and reassembly state for one VPN tunnel instance.
+ *
+ * This structure contains all the state necessary for sending and
+ * receiving fragmented data channel packets associated with one VPN
+ * tunnel.
+ *
+ * The fragmented packet currently being sent to a remote OpenVPN peer is
+ * stored in \c fragment_master.outgoing. It is copied into that buffer
+ * by the \c fragment_outgoing() function and the remaining parts to be
+ * sent can be retrieved by successive calls to \c
+ * fragment_ready_to_send().
+ *
+ * The received packets currently being reassembled are stored in the \c
+ * fragment_master.incoming array of \c fragment structures. The \c
+ * fragment_incoming() function adds newly received parts into this array
+ * and returns the whole packets once reassembly is complete.
+ */
+struct fragment_master {
+ struct event_timeout wakeup; /**< Timeout structure used by the main
+ * event loop to know when to do
+ * fragmentation housekeeping. */
+ bool received_os_mtu_hint; /**< Whether the operating system has
+ * explicitly recommended an MTU value. */
+# define N_SEQ_ID 256
+ /**< One more than the maximum fragment
+ * sequence ID, above which the IDs wrap
+ * to zero. Should be a power of 2. */
+ int outgoing_seq_id; /**< Fragment sequence ID of the current
+ * fragmented packet waiting to be sent.
+ *
+ * All parts of a fragmented packet
+ * share the same sequence ID, so that
+ * the remote OpenVPN peer can determine
+ * which parts belong to which original
+ * packet. */
+# define MAX_FRAG_PKT_SIZE 65536
+ /**< (Not used) Maximum packet size before
+ * fragmenting. */
+ int outgoing_frag_size; /**< Size in bytes of each part to be
+ * sent, except for the last part which
+ * may be smaller.
+ *
+ * This value is computed by the \c
+ * optimal_fragment_size() function. Its
+ * value is sent to the remote peer in
+ * the fragmentation header of the last
+ * part (i.e. with %fragment type \c
+ * FRAG_YES_LAST) using the \c
+ * FRAG_SIZE_MASK and \c FRAG_SIZE_SHIFT
+ * bits. */
+ int outgoing_frag_id; /**< The fragment ID of the next part to
+ * be sent. Must have a value between 0
+ * and \c MAX_FRAGS-1. */
+ struct buffer outgoing; /**< Buffer containing the remaining parts
+ * of the fragmented packet being sent. */
+ struct buffer outgoing_return;
+ /**< Buffer used by \c
+ * fragment_ready_to_send() to return a
+ * part to send. */
+
+ struct fragment_list incoming;
+ /**< List of structures for reassembling
+ * incoming packets. */
+};
+
+
+/**************************************************************************/
+/** @name Fragment header
+ * @todo Add description of %fragment header format.
+ *//** @{ *//*************************************/
+
+typedef uint32_t fragment_header_type;
+ /**< Fragmentation information is stored in
+ * a 32-bit packet header. */
+
+#define hton_fragment_header_type(x) htonl(x)
+ /**< Convert a fragment_header_type from
+ * host to network order. */
+
+#define ntoh_fragment_header_type(x) ntohl(x)
+ /**< Convert a \c fragment_header_type
+ * from network to host order. */
+
+#define FRAG_TYPE_MASK 0x00000003
+ /**< Bit mask for %fragment type info. */
+#define FRAG_TYPE_SHIFT 0 /**< Bit shift for %fragment type info. */
+
+#define FRAG_WHOLE 0 /**< Fragment type indicating packet is
+ * whole. */
+#define FRAG_YES_NOTLAST 1 /**< Fragment type indicating packet is
+ * part of a fragmented packet, but not
+ * the last part in the sequence. */
+#define FRAG_YES_LAST 2 /**< Fragment type indicating packet is
+ * the last part in the sequence of
+ * parts. */
+#define FRAG_TEST 3 /**< Fragment type not implemented yet.
+ * In the future might be used as a
+ * control packet for establishing MTU
+ * size. */
+
+#define FRAG_SEQ_ID_MASK 0x000000ff
+ /**< Bit mask for %fragment sequence ID. */
+#define FRAG_SEQ_ID_SHIFT 2 /**< Bit shift for %fragment sequence ID. */
+
+#define FRAG_ID_MASK 0x0000001f
+ /**< Bit mask for %fragment ID. */
+#define FRAG_ID_SHIFT 10
+ /**< Bit shift for %fragment ID. */
+
+/*
+ * FRAG_SIZE 14 bits
+ *
+ * IF FRAG_YES_LAST (FRAG_SIZE):
+ * The max size of a %fragment. If a %fragment is not the last %fragment in the packet,
+ * then the %fragment size is guaranteed to be equal to the max %fragment size. Therefore,
+ * max_frag_size is only sent over the wire if FRAG_LAST is set. Otherwise it is assumed
+ * to be the actual %fragment size received.
+ */
+#define FRAG_SIZE_MASK 0x00003fff
+ /**< Bit mask for %fragment size. */
+#define FRAG_SIZE_SHIFT 15
+ /**< Bit shift for %fragment size. */
+#define FRAG_SIZE_ROUND_SHIFT 2 /**< Bit shift for %fragment size rounding. */
+#define FRAG_SIZE_ROUND_MASK ((1 << FRAG_SIZE_ROUND_SHIFT) - 1)
+ /**< Bit mask for %fragment size rounding. */
+
+/*
+ * FRAG_EXTRA 16 bits
+ *
+ * IF FRAG_WHOLE or FRAG_YES_NOTLAST, these 16 bits are available (not currently used)
+ */
+#define FRAG_EXTRA_MASK 0x0000ffff
+ /**< Bit mask for extra bits. */
+#define FRAG_EXTRA_SHIFT 15
+ /**< Bit shift for extra bits. */
+
+/** @} name Fragment header *//********************************************/
+
+
+/**************************************************************************/
+/** @name Functions for initialization and cleanup *//** @{ *//************/
+
+/**
+ * Allocate and initialize a \c fragment_master structure.
+ *
+ * This function also modifies the \a frame packet geometry parameters to
+ * include space for the fragmentation header.
+ *
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel, modified by this function to include the
+ * fragmentation header.
+ *
+ * @return A pointer to the new \c fragment_master structure.
+ */
+struct fragment_master *fragment_init (struct frame *frame);
+
+
+/**
+ * Allocate internal packet buffers for a \c fragment_master structure.
+ *
+ * @param f - The \c fragment_master structure for which to
+ * allocate the internal buffers.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel, used to determine how much memory to
+ * allocate for each packet buffer.
+ */
+void fragment_frame_init (struct fragment_master *f, const struct frame *frame);
+
+
+/**
+ * Free a \c fragment_master structure and its internal packet buffers.
+ *
+ * @param f - The \c fragment_master structure to free.
+ */
+void fragment_free (struct fragment_master *f);
+
+/** @} name Functions for initialization and cleanup *//*******************/
+
+
+/**************************************************************************/
+/** @name Functions for processing packets received from a remote OpenVPN peer */
+/** @{ */
+
+/**
+ * Process an incoming packet, which may or may not be fragmented.
+ *
+ * This function inspects the fragmentation header of the incoming packet
+ * and processes the packet accordingly. Depending on the %fragment type
+ * bits (\c FRAG_TYPE_MASK and \c FRAG_TYPE_SHIFT) the packet is processed
+ * in the following ways:
+ * - \c FRAG_WHOLE: the packet is not fragmented, and this function does
+ * not modify its contents, except for removing the fragmentation
+ * header.
+ * - \c FRAG_YES_NOTLAST or \c FRAG_YES_LAST: the packet is part of a
+ * fragmented packet. This function copies the packet into an internal
+ * reassembly buffer. If the incoming part completes the packet being
+ * reassembled, the \a buf argument is modified to point to the fully
+ * reassembled packet. If, on the other hand, reassembly is not yet
+ * complete, then the the \a buf buffer is set to empty.
+ * - Any other value: error.
+ *
+ * If an error occurs during processing, an error message is logged and
+ * the length of \a buf is set to zero.
+ *
+ * @param f - The \c fragment_master structure for this VPN
+ * tunnel.
+ * @param buf - A pointer to the buffer structure containing the
+ * incoming packet. This pointer will have been
+ * modified on return either to point to a
+ * completely reassembled packet, or to have length
+ * set to zero if reassembly is not yet complete.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ *
+ * @return Void.\n On return, the \a buf argument will point to a buffer.
+ * The buffer will have nonzero length if the incoming packet passed
+ * to this function was whole and unfragmented, or if it was the final
+ * part of a fragmented packet thereby completing reassembly. On the
+ * other hand, the buffer will have a length of zero if the incoming
+ * packet was part of a fragmented packet and reassembly is not yet
+ * complete. If an error occurs during processing, the buffer length
+ * is also set to zero.
+ */
+void fragment_incoming (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame);
+
+/** @} name Functions for processing packets received from a VPN tunnel */
+
+
+/**************************************************************************/
+/** @name Functions for processing packets to be sent to a remote OpenVPN peer */
+/** @{ */
+
+/**
+ * Process an outgoing packet, which may or may not need to be fragmented.
+ *
+ * This function inspects the outgoing packet, determines whether it needs
+ * to be fragmented, and processes it accordingly.
+ *
+ * Depending on the size of the outgoing packet and the packet geometry
+ * parameters for the VPN tunnel, the packet will or will not be
+ * fragmented.
+ * @li Packet size is less than or equal to the maximum packet size for
+ * this VPN tunnel: fragmentation is not necessary. The \a buf
+ * argument points to a buffer containing the unmodified outgoing
+ * packet with a fragmentation header indicating the packet is whole
+ * (FRAG_WHOLE) prepended.
+ * @li Packet size is greater than the maximum packet size for this VPN
+ * tunnel: fragmentation is necessary. The original outgoing packet
+ * is copied into an internal buffer for fragmentation. The \a buf
+ * argument is modified to point to the first part of the fragmented
+ * packet. The remaining parts remain stored in the internal buffer,
+ * and can be retrieved using the \c fragment_ready_to_send()
+ * function.
+ *
+ * If an error occurs during processing, an error message is logged and
+ * the length of \a buf is set to zero.
+ *
+ * @param f - The \c fragment_master structure for this VPN
+ * tunnel.
+ * @param buf - A pointer to the buffer structure containing the
+ * outgoing packet. This pointer will be modified
+ * to point to a whole unfragmented packet or to the
+ * first part of a fragmented packet on return.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ *
+ * @return Void.\n On return, the \a buf argument will point to a buffer.
+ * This buffer contains either the whole original outgoing packet if
+ * fragmentation was not necessary, or the first part of the
+ * fragmented outgoing packet if fragmentation was necessary. In both
+ * cases a fragmentation header will have been prepended to inform the
+ * remote peer how to handle the packet.
+ */
+void fragment_outgoing (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame);
+
+/**
+ * Check whether outgoing fragments are ready to be send, and if so make
+ * one available.
+ *
+ * This function checks whether the internal buffer for fragmenting
+ * outgoing packets contains any unsent parts. If it does not, meaning
+ * there is nothing waiting to be sent, it returns false. Otherwise there
+ * are parts ready to be sent, and it returns true. In that case it also
+ * modifies the \a buf argument to point to a buffer containing the next
+ * part to be sent.
+ *
+ * @param f - The \a fragment_master structure for this VPN
+ * tunnel.
+ * @param buf - A pointer to a buffer structure which on return,
+ * if there are parts waiting to be sent, will point
+ * to the next part to be sent.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ *
+ * @return
+ * @li True, if an outgoing packet has been fragmented and not all parts
+ * have been sent yet. In this case this function will modify the \a
+ * buf argument to point to a buffer containing the next part to be
+ * sent.
+ * @li False, if there are no outgoing fragmented parts waiting to be
+ * sent.
+ */
+bool fragment_ready_to_send (struct fragment_master *f, struct buffer *buf,
+ const struct frame* frame);
+
+/**
+ * Check whether a \c fragment_master structure contains fragments ready
+ * to be sent.
+ *
+ * @param f - The \c fragment_master structure for this VPN
+ * tunnel.
+ *
+ * @return
+ * @li True, if there are one or more fragments ready to be sent.
+ * @li False, otherwise.
+ */
+static inline bool
+fragment_outgoing_defined (struct fragment_master *f)
+{
+ return f->outgoing.len > 0;
+}
+
+/** @} name Functions for processing packets going out through a VPN tunnel */
+
+
+void fragment_wakeup (struct fragment_master *f, struct frame *frame);
+
+
+/**************************************************************************/
+/** @name Functions for regular housekeeping *//** @{ *//******************/
+
+/**
+ * Perform housekeeping of a \c fragment_master structure.
+ *
+ * Housekeeping includes scanning incoming packet reassembly buffers for
+ * packets which have not yet been reassembled completely but are already
+ * older than their time-to-live.
+ *
+ * @param f - The \c fragment_master structure for this VPN
+ * tunnel.
+ * @param frame - The packet geometry parameters for this VPN
+ * tunnel.
+ */
+static inline void
+fragment_housekeeping (struct fragment_master *f, struct frame *frame, struct timeval *tv)
+{
+ if (event_timeout_trigger (&f->wakeup, tv, ETT_DEFAULT))
+ fragment_wakeup (f, frame);
+}
+
+/** @} name Functions for regular housekeeping *//*************************/
+
+
+/** @} addtogroup fragmentation *//****************************************/
+
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.c
new file mode 100644
index 00000000..f0aa7f61
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.c
@@ -0,0 +1,221 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Test protocol robustness by simulating dropped packets and
+ * network outages when the --gremlin option is used.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_DEBUG
+
+#include "error.h"
+#include "common.h"
+#include "misc.h"
+#include "otime.h"
+#include "gremlin.h"
+
+#include "memdbg.h"
+
+/*
+ * Parameters for packet corruption and droppage.
+ * Each parameter has 4 possible levels, 0 = disabled,
+ * while 1, 2, and 3 are enumerated in the below arrays.
+ * The parameter is a 2-bit field within the --gremlin
+ * parameter.
+ */
+
+/*
+ * Probability that we will drop a packet is 1 / n
+ */
+static const int drop_freq[] = { 500, 100, 50 };
+
+/*
+ * Probability that we will corrupt a packet is 1 / n
+ */
+static const int corrupt_freq[] = { 500, 100, 50 };
+
+/*
+ * When network goes up, it will be up for between
+ * UP_LOW and UP_HIGH seconds.
+ */
+static const int up_low[] = { 60, 10, 5 };
+static const int up_high[] = { 600, 60, 10 };
+
+/*
+ * When network goes down, it will be down for between
+ * DOWN_LOW and DOWN_HIGH seconds.
+ */
+static const int down_low[] = { 5, 10, 10 };
+static const int down_high[] = { 10, 60, 120 };
+
+/*
+ * Packet flood levels:
+ * { number of packets, packet size }
+ */
+static const struct packet_flood_parms packet_flood_data[] =
+ {{10, 100}, {10, 1500}, {100, 1500}};
+
+struct packet_flood_parms
+get_packet_flood_parms (int level)
+{
+ ASSERT (level > 0 && level < 4);
+ return packet_flood_data [level - 1];
+}
+
+/*
+ * Return true with probability 1/n
+ */
+static bool flip(int n) {
+ return (get_random() % n) == 0;
+}
+
+/*
+ * Return uniformly distributed random number between
+ * low and high.
+ */
+static int roll(int low, int high) {
+ int ret;
+ ASSERT (low <= high);
+ ret = low + (get_random() % (high - low + 1));
+ ASSERT (ret >= low && ret <= high);
+ return ret;
+}
+
+static bool initialized; /* GLOBAL */
+static bool up; /* GLOBAL */
+static time_t next; /* GLOBAL */
+
+/*
+ * Return false if we should drop a packet.
+ */
+bool
+ask_gremlin (int flags)
+{
+ const int up_down_level = GREMLIN_UP_DOWN_LEVEL (flags);
+ const int drop_level = GREMLIN_DROP_LEVEL (flags);
+
+ if (!initialized)
+ {
+ initialized = true;
+
+ if (up_down_level)
+ up = false;
+ else
+ up = true;
+
+ next = now;
+ }
+
+ if (up_down_level) /* change up/down state? */
+ {
+ if (now >= next)
+ {
+ int delta;
+ if (up)
+ {
+ delta = roll (down_low[up_down_level-1], down_high[up_down_level-1]);
+ up = false;
+ }
+ else
+ {
+ delta = roll (up_low[up_down_level-1], up_high[up_down_level-1]);
+ up = true;
+ }
+
+ msg (D_GREMLIN,
+ "GREMLIN: CONNECTION GOING %s FOR %d SECONDS",
+ (up ? "UP" : "DOWN"),
+ delta);
+ next = now + delta;
+ }
+ }
+
+ if (drop_level)
+ {
+ if (up && flip (drop_freq[drop_level-1]))
+ {
+ dmsg (D_GREMLIN_VERBOSE, "GREMLIN: Random packet drop");
+ return false;
+ }
+ }
+
+ return up;
+}
+
+/*
+ * Possibly corrupt a packet.
+ */
+void corrupt_gremlin (struct buffer *buf, int flags) {
+ const int corrupt_level = GREMLIN_CORRUPT_LEVEL (flags);
+ if (corrupt_level)
+ {
+ if (flip (corrupt_freq[corrupt_level-1]))
+ {
+ do
+ {
+ if (buf->len > 0)
+ {
+ uint8_t r = roll (0, 255);
+ int method = roll (0, 5);
+
+ switch (method) {
+ case 0: /* corrupt the first byte */
+ *BPTR (buf) = r;
+ break;
+ case 1: /* corrupt the last byte */
+ *(BPTR (buf) + buf->len - 1) = r;
+ break;
+ case 2: /* corrupt a random byte */
+ *(BPTR(buf) + roll (0, buf->len - 1)) = r;
+ break;
+ case 3: /* append a random byte */
+ buf_write (buf, &r, 1);
+ break;
+ case 4: /* reduce length by 1 */
+ --buf->len;
+ break;
+ case 5: /* reduce length by a random amount */
+ buf->len -= roll (0, buf->len - 1);
+ break;
+ }
+ dmsg (D_GREMLIN_VERBOSE, "GREMLIN: Packet Corruption, method=%d", method);
+ }
+ else
+ break;
+ } while (flip (2)); /* a 50% chance we will corrupt again */
+ }
+ }
+}
+
+#else
+static void dummy(void) {}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.h
new file mode 100644
index 00000000..c0aeab18
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/gremlin.h
@@ -0,0 +1,72 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef GREMLIN_H
+#define GREMLIN_H
+
+#ifdef ENABLE_DEBUG
+
+/*
+ * Gremlin options, presented as bitmask argument to --gremlin directive
+ */
+
+#define GREMLIN_CONNECTION_FLOOD_SHIFT (0)
+#define GREMLIN_CONNECTION_FLOOD_MASK (0x07)
+
+#define GREMLIN_PACKET_FLOOD_SHIFT (3)
+#define GREMLIN_PACKET_FLOOD_MASK (0x03)
+
+#define GREMLIN_CORRUPT_SHIFT (5)
+#define GREMLIN_CORRUPT_MASK (0x03)
+
+#define GREMLIN_UP_DOWN_SHIFT (7)
+#define GREMLIN_UP_DOWN_MASK (0x03)
+
+/* 512:1/500 1024:1/100 1536:1/50 */
+
+#define GREMLIN_DROP_SHIFT (9)
+#define GREMLIN_DROP_MASK (0x03)
+
+/* extract gremlin parms */
+
+#define GREMLIN_CONNECTION_FLOOD_LEVEL(x) (((x)>>GREMLIN_CONNECTION_FLOOD_SHIFT) & GREMLIN_CONNECTION_FLOOD_MASK)
+#define GREMLIN_PACKET_FLOOD_LEVEL(x) (((x)>>GREMLIN_PACKET_FLOOD_SHIFT) & GREMLIN_PACKET_FLOOD_MASK)
+#define GREMLIN_CORRUPT_LEVEL(x) (((x)>>GREMLIN_CORRUPT_SHIFT) & GREMLIN_CORRUPT_MASK)
+#define GREMLIN_UP_DOWN_LEVEL(x) (((x)>>GREMLIN_UP_DOWN_SHIFT) & GREMLIN_UP_DOWN_MASK)
+#define GREMLIN_DROP_LEVEL(x) (((x)>>GREMLIN_DROP_SHIFT) & GREMLIN_DROP_MASK)
+
+#include "buffer.h"
+
+struct packet_flood_parms
+{
+ int n_packets;
+ int packet_size;
+};
+
+bool ask_gremlin (int flags);
+void corrupt_gremlin (struct buffer* buf, int flags);
+struct packet_flood_parms get_packet_flood_parms (int level);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.c
new file mode 100644
index 00000000..0ed0b2ba
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.c
@@ -0,0 +1,541 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "forward.h"
+#include "helper.h"
+#include "pool.h"
+#include "push.h"
+
+#include "memdbg.h"
+
+#if P2MP_SERVER
+
+static const char *
+print_netmask (int netbits, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ const in_addr_t netmask = netbits_to_netmask (netbits);
+
+ buf_printf (&out, "%s (/%d)", print_in_addr_t (netmask, 0, gc), netbits);
+
+ return BSTR (&out);
+}
+
+static const char *
+print_opt_route_gateway (const in_addr_t route_gateway, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ ASSERT (route_gateway);
+ buf_printf (&out, "route-gateway %s", print_in_addr_t (route_gateway, 0, gc));
+ return BSTR (&out);
+}
+
+static const char *
+print_opt_route_gateway_dhcp (struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (32, gc);
+ buf_printf (&out, "route-gateway dhcp");
+ return BSTR (&out);
+}
+
+static const char *
+print_opt_route (const in_addr_t network, const in_addr_t netmask, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ ASSERT (network);
+
+ if (netmask)
+ buf_printf (&out, "route %s %s",
+ print_in_addr_t (network, 0, gc),
+ print_in_addr_t (netmask, 0, gc));
+ else
+ buf_printf (&out, "route %s",
+ print_in_addr_t (network, 0, gc));
+
+ return BSTR (&out);
+}
+
+static const char *
+print_opt_topology (const int topology, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+
+ buf_printf (&out, "topology %s", print_topology (topology));
+
+ return BSTR (&out);
+}
+
+static const char *
+print_str_int (const char *str, const int i, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ buf_printf (&out, "%s %d", str, i);
+ return BSTR (&out);
+}
+
+static const char *
+print_str (const char *str, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ buf_printf (&out, "%s", str);
+ return BSTR (&out);
+}
+
+static void
+helper_add_route (const in_addr_t network, const in_addr_t netmask, struct options *o)
+{
+ rol_check_alloc (o);
+ add_route_to_option_list (o->routes,
+ print_in_addr_t (network, 0, &o->gc),
+ print_in_addr_t (netmask, 0, &o->gc),
+ NULL,
+ NULL);
+}
+
+static void
+verify_common_subnet (const char *opt, const in_addr_t a, const in_addr_t b, const in_addr_t subnet)
+{
+ struct gc_arena gc = gc_new ();
+ if ((a & subnet) != (b & subnet))
+ msg (M_USAGE, "%s IP addresses %s and %s are not in the same %s subnet",
+ opt,
+ print_in_addr_t (a, 0, &gc),
+ print_in_addr_t (b, 0, &gc),
+ print_in_addr_t (subnet, 0, &gc));
+ gc_free (&gc);
+}
+
+#endif
+
+/*
+ * Process server, server-bridge, and client helper
+ * directives after the parameters themselves have been
+ * parsed and placed in struct options.
+ */
+void
+helper_client_server (struct options *o)
+{
+ struct gc_arena gc = gc_new ();
+
+#if P2MP
+#if P2MP_SERVER
+
+/*
+ * Get tun/tap/null device type
+ */
+ const int dev = dev_type_enum (o->dev, o->dev_type);
+ const int topology = o->topology;
+
+ /*
+ *
+ * HELPER DIRECTIVE for IPv6
+ *
+ * server-ipv6 2001:db8::/64
+ *
+ * EXPANDS TO:
+ *
+ * tun-ipv6
+ * push "tun-ipv6"
+ * ifconfig-ipv6 2001:db8::1 2001:db8::2
+ * if !nopool:
+ * ifconfig-ipv6-pool 2001:db8::1:0/64
+ *
+ */
+ if ( o->server_ipv6_defined )
+ {
+ if ( ! o->server_defined )
+ {
+ msg (M_USAGE, "--server-ipv6 must be used together with --server");
+ }
+ if ( o->server_flags & SF_NOPOOL )
+ {
+ msg( M_USAGE, "--server-ipv6 is incompatible with 'nopool' option" );
+ }
+ if ( o->ifconfig_ipv6_pool_defined )
+ {
+ msg( M_USAGE, "--server-ipv6 already defines an ifconfig-ipv6-pool, so you can't also specify --ifconfig-pool explicitly");
+ }
+
+ /* local ifconfig is "base address + 1" and "+2" */
+ o->ifconfig_ipv6_local =
+ print_in6_addr( add_in6_addr( o->server_network_ipv6, 1), 0, &o->gc );
+ o->ifconfig_ipv6_remote =
+ print_in6_addr( add_in6_addr( o->server_network_ipv6, 2), 0, &o->gc );
+ o->ifconfig_ipv6_netbits = o->server_netbits_ipv6;
+
+ /* pool starts at "base address + 0x1000" - leave enough room */
+ ASSERT( o->server_netbits_ipv6 <= 112 ); /* want 16 bits */
+
+ o->ifconfig_ipv6_pool_defined = true;
+ o->ifconfig_ipv6_pool_base =
+ add_in6_addr( o->server_network_ipv6, 0x1000 );
+ o->ifconfig_ipv6_pool_netbits = o->server_netbits_ipv6;
+
+ o->tun_ipv6 = true;
+
+ push_option( o, "tun-ipv6", M_USAGE );
+ }
+
+ /*
+ *
+ * HELPER DIRECTIVE:
+ *
+ * server 10.8.0.0 255.255.255.0
+ *
+ * EXPANDS TO:
+ *
+ * mode server
+ * tls-server
+ * push "topology [topology]"
+ *
+ * if tun AND (topology == net30 OR topology == p2p):
+ * ifconfig 10.8.0.1 10.8.0.2
+ * if !nopool:
+ * ifconfig-pool 10.8.0.4 10.8.0.251
+ * route 10.8.0.0 255.255.255.0
+ * if client-to-client:
+ * push "route 10.8.0.0 255.255.255.0"
+ * else if topology == net30:
+ * push "route 10.8.0.1"
+ *
+ * if tap OR (tun AND topology == subnet):
+ * ifconfig 10.8.0.1 255.255.255.0
+ * if !nopool:
+ * ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
+ * push "route-gateway 10.8.0.1"
+ * if route-gateway unset:
+ * route-gateway 10.8.0.2
+ */
+
+ if (o->server_defined)
+ {
+ int netbits = -2;
+ bool status = false;
+
+ if (o->client)
+ msg (M_USAGE, "--server and --client cannot be used together");
+
+ if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
+ msg (M_USAGE, "--server and --server-bridge cannot be used together");
+
+ if (o->shared_secret_file)
+ msg (M_USAGE, "--server and --secret cannot be used together (you must use SSL/TLS keys)");
+
+ if (!(o->server_flags & SF_NOPOOL) && o->ifconfig_pool_defined)
+ msg (M_USAGE, "--server already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
+
+ if (!(dev == DEV_TYPE_TAP || dev == DEV_TYPE_TUN))
+ msg (M_USAGE, "--server directive only makes sense with --dev tun or --dev tap");
+
+ status = netmask_to_netbits (o->server_network, o->server_netmask, &netbits);
+ if (!status)
+ msg (M_USAGE, "--server directive network/netmask combination is invalid");
+
+ if (netbits < 0)
+ msg (M_USAGE, "--server directive netmask is invalid");
+
+ if (netbits < IFCONFIG_POOL_MIN_NETBITS)
+ msg (M_USAGE, "--server directive netmask allows for too many host addresses (subnet must be %s or higher)",
+ print_netmask (IFCONFIG_POOL_MIN_NETBITS, &gc));
+
+ if (dev == DEV_TYPE_TUN)
+ {
+ int pool_end_reserve = 4;
+
+ if (netbits > 29)
+ msg (M_USAGE, "--server directive when used with --dev tun must define a subnet of %s or lower",
+ print_netmask (29, &gc));
+
+ if (netbits == 29)
+ pool_end_reserve = 0;
+
+ o->mode = MODE_SERVER;
+ o->tls_server = true;
+
+ if (topology == TOP_NET30 || topology == TOP_P2P)
+ {
+ o->ifconfig_local = print_in_addr_t (o->server_network + 1, 0, &o->gc);
+ o->ifconfig_remote_netmask = print_in_addr_t (o->server_network + 2, 0, &o->gc);
+
+ if (!(o->server_flags & SF_NOPOOL))
+ {
+ o->ifconfig_pool_defined = true;
+ o->ifconfig_pool_start = o->server_network + 4;
+ o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - pool_end_reserve;
+ ifconfig_pool_verify_range (M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
+ }
+
+ helper_add_route (o->server_network, o->server_netmask, o);
+ if (o->enable_c2c)
+ push_option (o, print_opt_route (o->server_network, o->server_netmask, &o->gc), M_USAGE);
+ else if (topology == TOP_NET30)
+ push_option (o, print_opt_route (o->server_network + 1, 0, &o->gc), M_USAGE);
+ }
+ else if (topology == TOP_SUBNET)
+ {
+ o->ifconfig_local = print_in_addr_t (o->server_network + 1, 0, &o->gc);
+ o->ifconfig_remote_netmask = print_in_addr_t (o->server_netmask, 0, &o->gc);
+
+ if (!(o->server_flags & SF_NOPOOL))
+ {
+ o->ifconfig_pool_defined = true;
+ o->ifconfig_pool_start = o->server_network + 2;
+ o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 2;
+ ifconfig_pool_verify_range (M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
+ }
+ o->ifconfig_pool_netmask = o->server_netmask;
+
+ push_option (o, print_opt_route_gateway (o->server_network + 1, &o->gc), M_USAGE);
+ if (!o->route_default_gateway)
+ o->route_default_gateway = print_in_addr_t (o->server_network + 2, 0, &o->gc);
+ }
+ else
+ ASSERT (0);
+
+ push_option (o, print_opt_topology (topology, &o->gc), M_USAGE);
+ }
+ else if (dev == DEV_TYPE_TAP)
+ {
+ if (netbits > 30)
+ msg (M_USAGE, "--server directive when used with --dev tap must define a subnet of %s or lower",
+ print_netmask (30, &gc));
+
+ o->mode = MODE_SERVER;
+ o->tls_server = true;
+ o->ifconfig_local = print_in_addr_t (o->server_network + 1, 0, &o->gc);
+ o->ifconfig_remote_netmask = print_in_addr_t (o->server_netmask, 0, &o->gc);
+
+ if (!(o->server_flags & SF_NOPOOL))
+ {
+ o->ifconfig_pool_defined = true;
+ o->ifconfig_pool_start = o->server_network + 2;
+ o->ifconfig_pool_end = (o->server_network | ~o->server_netmask) - 1;
+ ifconfig_pool_verify_range (M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
+ }
+ o->ifconfig_pool_netmask = o->server_netmask;
+
+ push_option (o, print_opt_route_gateway (o->server_network + 1, &o->gc), M_USAGE);
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+ /* set push-ifconfig-constraint directive */
+ if ((dev == DEV_TYPE_TAP || topology == TOP_SUBNET))
+ {
+ o->push_ifconfig_constraint_defined = true;
+ o->push_ifconfig_constraint_network = o->server_network;
+ o->push_ifconfig_constraint_netmask = o->server_netmask;
+ }
+ }
+
+ /*
+ * HELPER DIRECTIVE:
+ *
+ * server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 10.8.0.254
+ *
+ * EXPANDS TO:
+ *
+ * mode server
+ * tls-server
+ *
+ * ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0
+ * push "route-gateway 10.8.0.4"
+ *
+ * OR
+ *
+ * server-bridge
+ *
+ * EXPANDS TO:
+ *
+ * mode server
+ * tls-server
+ *
+ * if !nogw:
+ * push "route-gateway dhcp"
+ */
+ else if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+ {
+ if (o->client)
+ msg (M_USAGE, "--server-bridge and --client cannot be used together");
+
+ if (!(o->server_flags & SF_NOPOOL) && o->ifconfig_pool_defined)
+ msg (M_USAGE, "--server-bridge already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
+
+ if (o->shared_secret_file)
+ msg (M_USAGE, "--server-bridge and --secret cannot be used together (you must use SSL/TLS keys)");
+
+ if (dev != DEV_TYPE_TAP)
+ msg (M_USAGE, "--server-bridge directive only makes sense with --dev tap");
+
+ if (o->server_bridge_defined)
+ {
+ verify_common_subnet ("--server-bridge", o->server_bridge_ip, o->server_bridge_pool_start, o->server_bridge_netmask);
+ verify_common_subnet ("--server-bridge", o->server_bridge_pool_start, o->server_bridge_pool_end, o->server_bridge_netmask);
+ verify_common_subnet ("--server-bridge", o->server_bridge_ip, o->server_bridge_pool_end, o->server_bridge_netmask);
+ }
+
+ o->mode = MODE_SERVER;
+ o->tls_server = true;
+
+ if (o->server_bridge_defined)
+ {
+ o->ifconfig_pool_defined = true;
+ o->ifconfig_pool_start = o->server_bridge_pool_start;
+ o->ifconfig_pool_end = o->server_bridge_pool_end;
+ ifconfig_pool_verify_range (M_USAGE, o->ifconfig_pool_start, o->ifconfig_pool_end);
+ o->ifconfig_pool_netmask = o->server_bridge_netmask;
+ push_option (o, print_opt_route_gateway (o->server_bridge_ip, &o->gc), M_USAGE);
+ }
+ else if (o->server_bridge_proxy_dhcp && !(o->server_flags & SF_NO_PUSH_ROUTE_GATEWAY))
+ {
+ push_option (o, print_opt_route_gateway_dhcp (&o->gc), M_USAGE);
+ }
+ }
+ else
+#endif /* P2MP_SERVER */
+
+ /*
+ * HELPER DIRECTIVE:
+ *
+ * client
+ *
+ * EXPANDS TO:
+ *
+ * pull
+ * tls-client
+ */
+ if (o->client)
+ {
+ if (o->key_method != 2)
+ msg (M_USAGE, "--client requires --key-method 2");
+
+ o->pull = true;
+ o->tls_client = true;
+ }
+
+#endif /* P2MP */
+
+ gc_free (&gc);
+}
+
+/*
+ *
+ * HELPER DIRECTIVE:
+ *
+ * keepalive 10 60
+ *
+ * EXPANDS TO:
+ *
+ * if mode server:
+ * ping 10
+ * ping-restart 120
+ * push "ping 10"
+ * push "ping-restart 60"
+ * else
+ * ping 10
+ * ping-restart 60
+ */
+void
+helper_keepalive (struct options *o)
+{
+ if (o->keepalive_ping || o->keepalive_timeout)
+ {
+ /*
+ * Sanity checks.
+ */
+ if (o->keepalive_ping <= 0 || o->keepalive_timeout <= 0)
+ msg (M_USAGE, "--keepalive parameters must be > 0");
+ if (o->keepalive_ping * 2 > o->keepalive_timeout)
+ msg (M_USAGE, "the second parameter to --keepalive (restart timeout=%d) must be at least twice the value of the first parameter (ping interval=%d). A ratio of 1:5 or 1:6 would be even better. Recommended setting is --keepalive 10 60.",
+ o->keepalive_timeout,
+ o->keepalive_ping);
+ if (o->ping_send_timeout || o->ping_rec_timeout)
+ msg (M_USAGE, "--keepalive conflicts with --ping, --ping-exit, or --ping-restart. If you use --keepalive, you don't need any of the other --ping directives.");
+
+ /*
+ * Expand.
+ */
+ if (o->mode == MODE_POINT_TO_POINT)
+ {
+ o->ping_rec_timeout_action = PING_RESTART;
+ o->ping_send_timeout = o->keepalive_ping;
+ o->ping_rec_timeout = o->keepalive_timeout;
+ }
+#if P2MP_SERVER
+ else if (o->mode == MODE_SERVER)
+ {
+ o->ping_rec_timeout_action = PING_RESTART;
+ o->ping_send_timeout = o->keepalive_ping;
+ o->ping_rec_timeout = o->keepalive_timeout * 2;
+ push_option (o, print_str_int ("ping", o->keepalive_ping, &o->gc), M_USAGE);
+ push_option (o, print_str_int ("ping-restart", o->keepalive_timeout, &o->gc), M_USAGE);
+ }
+#endif
+ else
+ {
+ ASSERT (0);
+ }
+ }
+}
+
+/*
+ *
+ * HELPER DIRECTIVE:
+ *
+ * tcp-nodelay
+ *
+ * EXPANDS TO:
+ *
+ * if mode server:
+ * socket-flags TCP_NODELAY
+ * push "socket-flags TCP_NODELAY"
+ */
+void
+helper_tcp_nodelay (struct options *o)
+{
+#if P2MP_SERVER
+ if (o->server_flags & SF_TCP_NODELAY_HELPER)
+ {
+ if (o->mode == MODE_SERVER)
+ {
+ o->sockflags |= SF_TCP_NODELAY;
+ push_option (o, print_str ("socket-flags TCP_NODELAY", &o->gc), M_USAGE);
+ }
+ else
+ {
+ ASSERT (0);
+ }
+ }
+#endif
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.h
new file mode 100644
index 00000000..444969c9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/helper.h
@@ -0,0 +1,38 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Process helper directives such as server, client, and keepalive.
+ */
+
+#ifndef HELPER_H
+#define HELPER_H
+
+#include "options.h"
+
+void helper_keepalive (struct options *o);
+void helper_client_server (struct options *o);
+void helper_tcp_nodelay (struct options *o);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.c
new file mode 100644
index 00000000..78b8344d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.c
@@ -0,0 +1,154 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if PROXY_DIGEST_AUTH
+
+#include "crypto.h"
+#include "httpdigest.h"
+
+static void
+CvtHex(
+ IN HASH Bin,
+ OUT HASHHEX Hex
+ )
+{
+ unsigned short i;
+ unsigned char j;
+
+ for (i = 0; i < HASHLEN; i++) {
+ j = (Bin[i] >> 4) & 0xf;
+ if (j <= 9)
+ Hex[i*2] = (j + '0');
+ else
+ Hex[i*2] = (j + 'a' - 10);
+ j = Bin[i] & 0xf;
+ if (j <= 9)
+ Hex[i*2+1] = (j + '0');
+ else
+ Hex[i*2+1] = (j + 'a' - 10);
+ };
+ Hex[HASHHEXLEN] = '\0';
+};
+
+/* calculate H(A1) as per spec */
+void
+DigestCalcHA1(
+ IN char * pszAlg,
+ IN char * pszUserName,
+ IN char * pszRealm,
+ IN char * pszPassword,
+ IN char * pszNonce,
+ IN char * pszCNonce,
+ OUT HASHHEX SessionKey
+ )
+{
+ HASH HA1;
+ md_ctx_t md5_ctx;
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+
+ md_ctx_init(&md5_ctx, md5_kt);
+ md_ctx_update(&md5_ctx, pszUserName, strlen(pszUserName));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszRealm, strlen(pszRealm));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszPassword, strlen(pszPassword));
+ md_ctx_final(&md5_ctx, HA1);
+ if (pszAlg && strcasecmp(pszAlg, "md5-sess") == 0)
+ {
+ md_ctx_init(&md5_ctx, md5_kt);
+ md_ctx_update(&md5_ctx, HA1, HASHLEN);
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
+ md_ctx_final(&md5_ctx, HA1);
+ };
+ md_ctx_cleanup(&md5_ctx);
+ CvtHex(HA1, SessionKey);
+}
+
+/* calculate request-digest/response-digest as per HTTP Digest spec */
+void
+DigestCalcResponse(
+ IN HASHHEX HA1, /* H(A1) */
+ IN char * pszNonce, /* nonce from server */
+ IN char * pszNonceCount, /* 8 hex digits */
+ IN char * pszCNonce, /* client nonce */
+ IN char * pszQop, /* qop-value: "", "auth", "auth-int" */
+ IN char * pszMethod, /* method from the request */
+ IN char * pszDigestUri, /* requested URL */
+ IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
+ OUT HASHHEX Response /* request-digest or response-digest */
+ )
+{
+ HASH HA2;
+ HASH RespHash;
+ HASHHEX HA2Hex;
+
+ md_ctx_t md5_ctx;
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+
+ /* calculate H(A2) */
+ md_ctx_init(&md5_ctx, md5_kt);
+ md_ctx_update(&md5_ctx, pszMethod, strlen(pszMethod));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszDigestUri, strlen(pszDigestUri));
+ if (strcasecmp(pszQop, "auth-int") == 0)
+ {
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, HEntity, HASHHEXLEN);
+ };
+ md_ctx_final(&md5_ctx, HA2);
+ CvtHex(HA2, HA2Hex);
+
+ /* calculate response */
+ md_ctx_init(&md5_ctx, md5_kt);
+ md_ctx_update(&md5_ctx, HA1, HASHHEXLEN);
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszNonce, strlen(pszNonce));
+ md_ctx_update(&md5_ctx, ":", 1);
+ if (*pszQop)
+ {
+ md_ctx_update(&md5_ctx, pszNonceCount, strlen(pszNonceCount));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszCNonce, strlen(pszCNonce));
+ md_ctx_update(&md5_ctx, ":", 1);
+ md_ctx_update(&md5_ctx, pszQop, strlen(pszQop));
+ md_ctx_update(&md5_ctx, ":", 1);
+ };
+ md_ctx_update(&md5_ctx, HA2Hex, HASHHEXLEN);
+ md_ctx_final(&md5_ctx, RespHash);
+ md_ctx_cleanup(&md5_ctx);
+ CvtHex(RespHash, Response);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.h
new file mode 100644
index 00000000..84238413
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/httpdigest.h
@@ -0,0 +1,60 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#if PROXY_DIGEST_AUTH
+
+#define HASHLEN 16
+typedef unsigned char HASH[HASHLEN];
+#define HASHHEXLEN 32
+typedef unsigned char HASHHEX[HASHHEXLEN+1];
+#undef IN
+#undef OUT
+#define IN const
+#define OUT
+
+/* calculate H(A1) as per HTTP Digest spec */
+void DigestCalcHA1(
+ IN char * pszAlg,
+ IN char * pszUserName,
+ IN char * pszRealm,
+ IN char * pszPassword,
+ IN char * pszNonce,
+ IN char * pszCNonce,
+ OUT HASHHEX SessionKey
+ );
+
+/* calculate request-digest/response-digest as per HTTP Digest spec */
+void DigestCalcResponse(
+ IN HASHHEX HA1, /* H(A1) */
+ IN char * pszNonce, /* nonce from server */
+ IN char * pszNonceCount, /* 8 hex digits */
+ IN char * pszCNonce, /* client nonce */
+ IN char * pszQop, /* qop-value: "", "auth", "auth-int" */
+ IN char * pszMethod, /* method from the request */
+ IN char * pszDigestUri, /* requested URL */
+ IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
+ OUT HASHHEX Response /* request-digest or response-digest */
+ );
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/init.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/init.c
new file mode 100644
index 00000000..6137588d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/init.c
@@ -0,0 +1,3825 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "win32.h"
+#include "init.h"
+#include "sig.h"
+#include "occ.h"
+#include "list.h"
+#include "otime.h"
+#include "pool.h"
+#include "gremlin.h"
+#include "pkcs11.h"
+#include "ps.h"
+#include "lladdr.h"
+#include "ping.h"
+#include "mstats.h"
+#include "ssl_verify.h"
+
+#include "memdbg.h"
+
+#include "occ-inline.h"
+
+static struct context *static_context; /* GLOBAL */
+
+/*
+ * Crypto initialization flags
+ */
+#define CF_LOAD_PERSISTED_PACKET_ID (1<<0)
+#define CF_INIT_TLS_MULTI (1<<1)
+#define CF_INIT_TLS_AUTH_STANDALONE (1<<2)
+
+static void do_init_first_time (struct context *c);
+
+void
+context_clear (struct context *c)
+{
+ CLEAR (*c);
+}
+
+void
+context_clear_1 (struct context *c)
+{
+ CLEAR (c->c1);
+}
+
+void
+context_clear_2 (struct context *c)
+{
+ CLEAR (c->c2);
+}
+
+void
+context_clear_all_except_first_time (struct context *c)
+{
+ const bool first_time_save = c->first_time;
+ const struct context_persist cpsave = c->persist;
+ context_clear (c);
+ c->first_time = first_time_save;
+ c->persist = cpsave;
+}
+
+/*
+ * Should be called after options->ce is modified at the top
+ * of a SIGUSR1 restart.
+ */
+static void
+update_options_ce_post (struct options *options)
+{
+#if P2MP
+ /*
+ * In pull mode, we usually import --ping/--ping-restart parameters from
+ * the server. However we should also set an initial default --ping-restart
+ * for the period of time before we pull the --ping-restart parameter
+ * from the server.
+ */
+ if (options->pull
+ && options->ping_rec_timeout_action == PING_UNDEF
+ && proto_is_dgram(options->ce.proto))
+ {
+ options->ping_rec_timeout = PRE_PULL_INITIAL_PING_RESTART;
+ options->ping_rec_timeout_action = PING_RESTART;
+ }
+#endif
+}
+
+#ifdef ENABLE_MANAGEMENT
+static bool
+management_callback_proxy_cmd (void *arg, const char **p)
+{
+ struct context *c = arg;
+ struct connection_entry *ce = &c->options.ce;
+ struct gc_arena *gc = &c->c2.gc;
+ bool ret = false;
+
+ update_time();
+ if (streq (p[1], "NONE"))
+ ret = true;
+ else if (p[2] && p[3])
+ {
+ if (streq (p[1], "HTTP"))
+ {
+ struct http_proxy_options *ho;
+ if (ce->proto != PROTO_TCP && ce->proto != PROTO_TCP_CLIENT )
+ {
+ msg (M_WARN, "HTTP proxy support only works for TCP based connections");
+ return false;
+ }
+ ho = init_http_proxy_options_once (&ce->http_proxy_options, gc);
+ ho->server = string_alloc (p[2], gc);
+ ho->port = string_alloc (p[3], gc);
+ ho->retry = true;
+ ho->auth_retry = (p[4] && streq (p[4], "nct") ? PAR_NCT : PAR_ALL);
+ ret = true;
+ }
+ else if (streq (p[1], "SOCKS"))
+ {
+ ce->socks_proxy_server = string_alloc (p[2], gc);
+ ce->socks_proxy_port = p[3];
+ ret = true;
+ }
+ }
+ else
+ msg (M_WARN, "Bad proxy command");
+
+ ce->flags &= ~CE_MAN_QUERY_PROXY;
+
+ return ret;
+}
+
+static bool
+ce_management_query_proxy (struct context *c)
+{
+ const struct connection_list *l = c->options.connection_list;
+ struct connection_entry *ce = &c->options.ce;
+ struct gc_arena gc;
+ bool ret = true;
+
+ update_time();
+ if (management)
+ {
+ gc = gc_new ();
+ {
+ struct buffer out = alloc_buf_gc (256, &gc);
+ buf_printf (&out, ">PROXY:%u,%s,%s", (l ? l->current : 0) + 1,
+ (proto_is_udp (ce->proto) ? "UDP" : "TCP"), np (ce->remote));
+ management_notify_generic (management, BSTR (&out));
+ }
+ ce->flags |= CE_MAN_QUERY_PROXY;
+ while (ce->flags & CE_MAN_QUERY_PROXY)
+ {
+ management_event_loop_n_seconds (management, 1);
+ if (IS_SIG (c))
+ {
+ ret = false;
+ break;
+ }
+ }
+ gc_free (&gc);
+ }
+
+ return ret;
+}
+
+
+static bool
+management_callback_remote_cmd (void *arg, const char **p)
+{
+ struct context *c = (struct context *) arg;
+ struct connection_entry *ce = &c->options.ce;
+ int ret = false;
+ if (p[1] && ((ce->flags>>CE_MAN_QUERY_REMOTE_SHIFT)&CE_MAN_QUERY_REMOTE_MASK) == CE_MAN_QUERY_REMOTE_QUERY)
+ {
+ int flags = 0;
+ if (!strcmp(p[1], "ACCEPT"))
+ {
+ flags = CE_MAN_QUERY_REMOTE_ACCEPT;
+ ret = true;
+ }
+ else if (!strcmp(p[1], "SKIP"))
+ {
+ flags = CE_MAN_QUERY_REMOTE_SKIP;
+ ret = true;
+ }
+ else if (!strcmp(p[1], "MOD") && p[2] && p[3])
+ {
+ if (strlen(p[2]) < RH_HOST_LEN && strlen(p[3]) < RH_PORT_LEN)
+ {
+ struct remote_host_store *rhs = c->options.rh_store;
+ if (!rhs)
+ {
+ ALLOC_OBJ_CLEAR_GC (rhs, struct remote_host_store, &c->options.gc);
+ c->options.rh_store = rhs;
+ }
+ strncpynt(rhs->host, p[2], RH_HOST_LEN);
+ strncpynt(rhs->port, p[3], RH_PORT_LEN);
+
+ ce->remote = rhs->host;
+ ce->remote_port = rhs->port;
+ flags = CE_MAN_QUERY_REMOTE_MOD;
+ ret = true;
+ }
+ }
+ if (ret)
+ {
+ ce->flags &= ~(CE_MAN_QUERY_REMOTE_MASK<<CE_MAN_QUERY_REMOTE_SHIFT);
+ ce->flags |= ((flags&CE_MAN_QUERY_REMOTE_MASK)<<CE_MAN_QUERY_REMOTE_SHIFT);
+ }
+ }
+ return ret;
+}
+
+static bool
+ce_management_query_remote (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ volatile struct connection_entry *ce = &c->options.ce;
+ int ret = true;
+ update_time();
+ if (management)
+ {
+ struct buffer out = alloc_buf_gc (256, &gc);
+ buf_printf (&out, ">REMOTE:%s,%s,%s", np(ce->remote), ce->remote_port, proto2ascii(ce->proto, ce->af, false));
+ management_notify_generic(management, BSTR (&out));
+ ce->flags &= ~(CE_MAN_QUERY_REMOTE_MASK<<CE_MAN_QUERY_REMOTE_SHIFT);
+ ce->flags |= (CE_MAN_QUERY_REMOTE_QUERY<<CE_MAN_QUERY_REMOTE_SHIFT);
+ while (((ce->flags>>CE_MAN_QUERY_REMOTE_SHIFT) & CE_MAN_QUERY_REMOTE_MASK) == CE_MAN_QUERY_REMOTE_QUERY)
+ {
+ management_event_loop_n_seconds (management, 1);
+ if (IS_SIG (c))
+ {
+ ret = false;
+ break;
+ }
+ }
+ }
+ {
+ const int flags = ((ce->flags>>CE_MAN_QUERY_REMOTE_SHIFT) & CE_MAN_QUERY_REMOTE_MASK);
+ ret = (flags != CE_MAN_QUERY_REMOTE_SKIP);
+ }
+ gc_free (&gc);
+ return ret;
+}
+#endif /* ENABLE_MANAGEMENT */
+
+/*
+ * Initialize and possibly randomize connection list.
+ */
+static void
+init_connection_list (struct context *c)
+{
+ struct connection_list *l = c->options.connection_list;
+
+ l->current = -1;
+ if (c->options.remote_random)
+ {
+ int i;
+ for (i = 0; i < l->len; ++i)
+ {
+ const int j = get_random () % l->len;
+ if (i != j)
+ {
+ struct connection_entry *tmp;
+ tmp = l->array[i];
+ l->array[i] = l->array[j];
+ l->array[j] = tmp;
+ }
+ }
+ }
+}
+
+/*
+ * Clear the remote address list
+ */
+static void clear_remote_addrlist (struct link_socket_addr *lsa, bool free)
+{
+ if (lsa->remote_list && free)
+ freeaddrinfo(lsa->remote_list);
+ lsa->remote_list = NULL;
+ lsa->current_remote = NULL;
+}
+
+/*
+ * Increment to next connection entry
+ */
+static void
+next_connection_entry (struct context *c)
+{
+ struct connection_list *l = c->options.connection_list;
+ bool ce_defined;
+ struct connection_entry *ce;
+ int n_cycles = 0;
+
+ do {
+ ce_defined = true;
+ if (c->options.no_advance && l->current >= 0)
+ {
+ c->options.no_advance = false;
+ }
+ else
+ {
+ /* Check if there is another resolved address to try for
+ * the current connection */
+ if (c->c1.link_socket_addr.current_remote &&
+ c->c1.link_socket_addr.current_remote->ai_next)
+ {
+ c->c1.link_socket_addr.current_remote =
+ c->c1.link_socket_addr.current_remote->ai_next;
+ }
+ else
+ {
+ /* FIXME (schwabe) fix the persist-remote-ip option for real,
+ * this is broken probably ever since connection lists and multiple
+ * remote existed
+ */
+ if (!c->options.persist_remote_ip)
+ {
+ /* close_instance should have cleared the addrinfo objects */
+ ASSERT (c->c1.link_socket_addr.current_remote == NULL);
+ ASSERT (c->c1.link_socket_addr.remote_list == NULL);
+ }
+ else
+ c->c1.link_socket_addr.current_remote =
+ c->c1.link_socket_addr.remote_list;
+
+ /*
+ * Increase the number of connection attempts
+ * If this is connect-retry-max * size(l)
+ * OpenVPN will quit
+ */
+
+ c->options.unsuccessful_attempts++;
+
+ if (++l->current >= l->len)
+ {
+
+ l->current = 0;
+ if (++n_cycles >= 2)
+ msg (M_FATAL, "No usable connection profiles are present");
+ }
+ }
+ }
+
+ ce = l->array[l->current];
+
+ if (ce->flags & CE_DISABLED)
+ ce_defined = false;
+
+ c->options.ce = *ce;
+#ifdef ENABLE_MANAGEMENT
+ if (ce_defined && management && management_query_remote_enabled(management))
+ {
+ /* allow management interface to override connection entry details */
+ ce_defined = ce_management_query_remote(c);
+ if (IS_SIG (c))
+ break;
+ }
+ else
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ if (ce_defined && management && management_query_proxy_enabled (management))
+ {
+ ce_defined = ce_management_query_proxy (c);
+ if (IS_SIG (c))
+ break;
+ }
+#endif
+ } while (!ce_defined);
+
+ /* Check if this connection attempt would bring us over the limit */
+ if (c->options.connect_retry_max > 0 &&
+ c->options.unsuccessful_attempts > (l->len * c->options.connect_retry_max))
+ msg(M_FATAL, "All connections have been connect-retry-max (%d) times unsuccessful, exiting",
+ c->options.connect_retry_max);
+ update_options_ce_post (&c->options);
+}
+
+/*
+ * Query for private key and auth-user-pass username/passwords
+ */
+static void
+init_query_passwords (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ /* Certificate password input */
+ if (c->options.key_pass_file)
+ pem_password_setup (c->options.key_pass_file);
+#endif
+
+#if P2MP
+ /* Auth user/pass input */
+ if (c->options.auth_user_pass_file)
+ {
+#ifdef ENABLE_CLIENT_CR
+ auth_user_pass_setup (c->options.auth_user_pass_file, &c->options.sc_info);
+#else
+ auth_user_pass_setup (c->options.auth_user_pass_file, NULL);
+#endif
+ }
+#endif
+}
+
+/*
+ * Initialize/Uninitialize HTTP or SOCKS proxy
+ */
+
+static void
+uninit_proxy_dowork (struct context *c)
+{
+ if (c->c1.http_proxy_owned && c->c1.http_proxy)
+ {
+ http_proxy_close (c->c1.http_proxy);
+ c->c1.http_proxy = NULL;
+ c->c1.http_proxy_owned = false;
+ }
+ if (c->c1.socks_proxy_owned && c->c1.socks_proxy)
+ {
+ socks_proxy_close (c->c1.socks_proxy);
+ c->c1.socks_proxy = NULL;
+ c->c1.socks_proxy_owned = false;
+ }
+}
+
+static void
+init_proxy_dowork (struct context *c)
+{
+ bool did_http = false;
+
+ uninit_proxy_dowork (c);
+
+ if (c->options.ce.http_proxy_options)
+ {
+ /* Possible HTTP proxy user/pass input */
+ c->c1.http_proxy = http_proxy_new (c->options.ce.http_proxy_options);
+ if (c->c1.http_proxy)
+ {
+ did_http = true;
+ c->c1.http_proxy_owned = true;
+ }
+ }
+
+ if (!did_http && c->options.ce.socks_proxy_server)
+ {
+ c->c1.socks_proxy = socks_proxy_new (c->options.ce.socks_proxy_server,
+ c->options.ce.socks_proxy_port,
+ c->options.ce.socks_proxy_authfile,
+ c->options.ce.socks_proxy_retry);
+ if (c->c1.socks_proxy)
+ {
+ c->c1.socks_proxy_owned = true;
+ }
+ }
+}
+
+static void
+init_proxy (struct context *c)
+{
+ init_proxy_dowork (c);
+}
+
+static void
+uninit_proxy (struct context *c)
+{
+ uninit_proxy_dowork (c);
+}
+
+void
+context_init_1 (struct context *c)
+{
+ context_clear_1 (c);
+
+ packet_id_persist_init (&c->c1.pid_persist);
+
+ init_connection_list (c);
+
+ init_query_passwords (c);
+
+#if defined(ENABLE_PKCS11)
+ if (c->first_time) {
+ int i;
+ pkcs11_initialize (true, c->options.pkcs11_pin_cache_period);
+ for (i=0;i<MAX_PARMS && c->options.pkcs11_providers[i] != NULL;i++)
+ pkcs11_addProvider (c->options.pkcs11_providers[i], c->options.pkcs11_protected_authentication[i],
+ c->options.pkcs11_private_mode[i], c->options.pkcs11_cert_private[i]);
+ }
+#endif
+
+#if 0 /* test get_user_pass with GET_USER_PASS_NEED_OK flag */
+ {
+ /*
+ * In the management interface, you can okay the request by entering "needok token-insertion-request ok"
+ */
+ struct user_pass up;
+ CLEAR (up);
+ strcpy (up.username, "Please insert your cryptographic token"); /* put the high-level message in up.username */
+ get_user_pass (&up, NULL, "token-insertion-request", GET_USER_PASS_MANAGEMENT|GET_USER_PASS_NEED_OK);
+ msg (M_INFO, "RET:%s", up.password); /* will return the third argument to management interface
+ 'needok' command, usually 'ok' or 'cancel'. */
+ }
+#endif
+
+}
+
+void
+context_gc_free (struct context *c)
+{
+ gc_free (&c->c2.gc);
+ gc_free (&c->options.gc);
+ gc_free (&c->gc);
+}
+
+#if PORT_SHARE
+
+static void
+close_port_share (void)
+{
+ if (port_share)
+ {
+ port_share_close (port_share);
+ port_share = NULL;
+ }
+}
+
+static void
+init_port_share (struct context *c)
+{
+ if (!port_share && (c->options.port_share_host && c->options.port_share_port))
+ {
+ port_share = port_share_open (c->options.port_share_host,
+ c->options.port_share_port,
+ MAX_RW_SIZE_LINK (&c->c2.frame),
+ c->options.port_share_journal_dir);
+ if (port_share == NULL)
+ msg (M_FATAL, "Fatal error: Port sharing failed");
+ }
+}
+
+#endif
+
+bool
+init_static (void)
+{
+ /* configure_path (); */
+
+#if defined(ENABLE_CRYPTO) && defined(DMALLOC)
+ crypto_init_dmalloc();
+#endif
+
+ init_random_seed (); /* init random() function, only used as
+ source for weak random numbers */
+ error_reset (); /* initialize error.c */
+ reset_check_status (); /* initialize status check code in socket.c */
+
+#ifdef WIN32
+ init_win32 ();
+#endif
+
+#ifdef OPENVPN_DEBUG_COMMAND_LINE
+ {
+ int i;
+ for (i = 0; i < argc; ++i)
+ msg (M_INFO, "argv[%d] = '%s'", i, argv[i]);
+ }
+#endif
+
+ update_time ();
+
+#ifdef ENABLE_CRYPTO
+ init_ssl_lib ();
+
+ /* init PRNG used for IV generation */
+ /* When forking, copy this to more places in the code to avoid fork
+ random-state predictability */
+ prng_init (NULL, 0);
+#endif
+
+#ifdef PID_TEST
+ packet_id_interactive_test (); /* test the sequence number code */
+ return false;
+#endif
+
+#ifdef SCHEDULE_TEST
+ schedule_test ();
+ return false;
+#endif
+
+#ifdef LIST_TEST
+ list_test ();
+ return false;
+#endif
+
+#ifdef IFCONFIG_POOL_TEST
+ ifconfig_pool_test (0x0A010004, 0x0A0100FF);
+ return false;
+#endif
+
+#ifdef CHARACTER_CLASS_DEBUG
+ character_class_debug ();
+ return false;
+#endif
+
+#ifdef EXTRACT_X509_FIELD_TEST
+ extract_x509_field_test ();
+ return false;
+#endif
+
+#ifdef TIME_TEST
+ time_test ();
+ return false;
+#endif
+
+#ifdef TEST_GET_DEFAULT_GATEWAY
+ {
+ struct route_gateway_info rgi;
+ get_default_gateway(&rgi);
+ print_default_gateway(M_INFO, &rgi);
+ return false;
+ }
+#endif
+
+#ifdef GEN_PATH_TEST
+ {
+ struct gc_arena gc = gc_new ();
+ const char *fn = gen_path ("foo",
+ "bar",
+ &gc);
+ printf ("%s\n", fn);
+ gc_free (&gc);
+ }
+ return false;
+#endif
+
+#ifdef STATUS_PRINTF_TEST
+ {
+ struct gc_arena gc = gc_new ();
+ const char *tmp_file = create_temp_file ("/tmp", "foo", &gc);
+ struct status_output *so = status_open (tmp_file, 0, -1, NULL, STATUS_OUTPUT_WRITE);
+ status_printf (so, "%s", "foo");
+ status_printf (so, "%s", "bar");
+ if (!status_close (so))
+ msg (M_WARN, "STATUS_PRINTF_TEST: %s: write error", tmp_file);
+ gc_free (&gc);
+ }
+ return false;
+#endif
+
+#ifdef ARGV_TEST
+ {
+ void argv_test (void);
+ argv_test ();
+ return false;
+ }
+#endif
+
+#ifdef PRNG_TEST
+ {
+ struct gc_arena gc = gc_new ();
+ uint8_t rndbuf[8];
+ int i;
+ prng_init ("sha1", 16);
+ /*prng_init (NULL, 0);*/
+ const int factor = 1;
+ for (i = 0; i < factor * 8; ++i)
+ {
+#if 1
+ prng_bytes (rndbuf, sizeof (rndbuf));
+#else
+ ASSERT(rand_bytes (rndbuf, sizeof (rndbuf)));
+#endif
+ printf ("[%d] %s\n", i, format_hex (rndbuf, sizeof (rndbuf), 0, &gc));
+ }
+ gc_free (&gc);
+ prng_uninit ();
+ return false;
+ }
+#endif
+
+#ifdef BUFFER_LIST_AGGREGATE_TEST
+ /* test buffer_list_aggregate function */
+ {
+ static const char *text[] = {
+ "It was a bright cold day in April, ",
+ "and the clocks were striking ",
+ "thirteen. ",
+ "Winston Smith, ",
+ "his chin nuzzled into his breast in an ",
+ "effort to escape the vile wind, ",
+ "slipped quickly through the glass doors ",
+ "of Victory Mansions, though not quickly ",
+ "enough to prevent a swirl of gritty dust from ",
+ "entering along with him."
+ };
+
+ int iter, listcap;
+ for (listcap = 0; listcap < 12; ++listcap)
+ {
+ for (iter = 0; iter < 512; ++iter)
+ {
+ struct buffer_list *bl = buffer_list_new(listcap);
+ {
+ int i;
+ for (i = 0; i < SIZE(text); ++i)
+ buffer_list_push(bl, (unsigned char *)text[i]);
+ }
+ printf("[cap=%d i=%d] *************************\n", listcap, iter);
+ if (!(iter & 8))
+ buffer_list_aggregate(bl, iter/2);
+ if (!(iter & 16))
+ buffer_list_push(bl, (unsigned char *)"Even more text...");
+ buffer_list_aggregate(bl, iter);
+ if (!(iter & 1))
+ buffer_list_push(bl, (unsigned char *)"More text...");
+ {
+ struct buffer *buf;
+ while ((buf = buffer_list_peek(bl)))
+ {
+ int c;
+ printf ("'");
+ while ((c = buf_read_u8(buf)) >= 0)
+ putchar(c);
+ printf ("'\n");
+ buffer_list_advance(bl, 0);
+ }
+ }
+ buffer_list_free(bl);
+ }
+ }
+ return false;
+ }
+#endif
+
+#ifdef MSTATS_TEST
+ {
+ int i;
+ mstats_open("/dev/shm/mstats.dat");
+ for (i = 0; i < 30; ++i)
+ {
+ mmap_stats->n_clients += 1;
+ mmap_stats->link_write_bytes += 8;
+ mmap_stats->link_read_bytes += 16;
+ sleep(1);
+ }
+ mstats_close();
+ return false;
+ }
+#endif
+
+ return true;
+}
+
+void
+uninit_static (void)
+{
+#ifdef ENABLE_CRYPTO
+ free_ssl_lib ();
+#endif
+
+#ifdef ENABLE_PKCS11
+ pkcs11_terminate ();
+#endif
+
+#if PORT_SHARE
+ close_port_share ();
+#endif
+
+#if defined(MEASURE_TLS_HANDSHAKE_STATS) && defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ show_tls_performance_stats ();
+#endif
+}
+
+void
+init_verb_mute (struct context *c, unsigned int flags)
+{
+ if (flags & IVM_LEVEL_1)
+ {
+ /* set verbosity and mute levels */
+ set_check_status (D_LINK_ERRORS, D_READ_WRITE);
+ set_debug_level (c->options.verbosity, SDL_CONSTRAIN);
+ set_mute_cutoff (c->options.mute);
+ }
+
+ /* special D_LOG_RW mode */
+ if (flags & IVM_LEVEL_2)
+ c->c2.log_rw = (check_debug_level (D_LOG_RW) && !check_debug_level (D_LOG_RW + 1));
+}
+
+/*
+ * Possibly set --dev based on --dev-node.
+ * For example, if --dev-node /tmp/foo/tun, and --dev undefined,
+ * set --dev to tun.
+ */
+void
+init_options_dev (struct options *options)
+{
+ if (!options->dev && options->dev_node) {
+ char *dev_node = strdup(options->dev_node); /* POSIX basename() implementaions may modify its arguments */
+ options->dev = basename (dev_node);
+ }
+}
+
+bool
+print_openssl_info (const struct options *options)
+{
+ /*
+ * OpenSSL info print mode?
+ */
+#ifdef ENABLE_CRYPTO
+ if (options->show_ciphers || options->show_digests || options->show_engines
+#ifdef ENABLE_SSL
+ || options->show_tls_ciphers || options->show_curves
+#endif
+ )
+ {
+ if (options->show_ciphers)
+ show_available_ciphers ();
+ if (options->show_digests)
+ show_available_digests ();
+ if (options->show_engines)
+ show_available_engines ();
+#ifdef ENABLE_SSL
+ if (options->show_tls_ciphers)
+ show_available_tls_ciphers (options->cipher_list);
+ if (options->show_curves)
+ show_available_curves();
+#endif
+ return true;
+ }
+#endif
+ return false;
+}
+
+/*
+ * Static pre-shared key generation mode?
+ */
+bool
+do_genkey (const struct options * options)
+{
+#ifdef ENABLE_CRYPTO
+ if (options->genkey)
+ {
+ int nbits_written;
+
+ notnull (options->shared_secret_file,
+ "shared secret output file (--secret)");
+
+ if (options->mlock) /* should we disable paging? */
+ platform_mlockall (true);
+
+ nbits_written = write_key_file (2, options->shared_secret_file);
+
+ msg (D_GENKEY | M_NOPREFIX,
+ "Randomly generated %d bit key written to %s", nbits_written,
+ options->shared_secret_file);
+ return true;
+ }
+#endif
+ return false;
+}
+
+/*
+ * Persistent TUN/TAP device management mode?
+ */
+bool
+do_persist_tuntap (const struct options *options)
+{
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+ if (options->persist_config)
+ {
+ /* sanity check on options for --mktun or --rmtun */
+ notnull (options->dev, "TUN/TAP device (--dev)");
+ if (options->ce.remote || options->ifconfig_local
+ || options->ifconfig_remote_netmask
+#ifdef ENABLE_CRYPTO
+ || options->shared_secret_file
+#ifdef ENABLE_SSL
+ || options->tls_server || options->tls_client
+#endif
+#endif
+ )
+ msg (M_FATAL|M_OPTERR,
+ "options --mktun or --rmtun should only be used together with --dev");
+ tuncfg (options->dev, options->dev_type, options->dev_node,
+ options->persist_mode,
+ options->username, options->groupname, &options->tuntap_options);
+ if (options->persist_mode && options->lladdr)
+ set_lladdr(options->dev, options->lladdr, NULL);
+ return true;
+ }
+#endif
+ return false;
+}
+
+/*
+ * Should we become a daemon?
+ * Return true if we did it.
+ */
+static bool
+possibly_become_daemon (const struct options *options, const bool first_time)
+{
+ bool ret = false;
+ if (first_time && options->daemon)
+ {
+ ASSERT (!options->inetd);
+ if (daemon (options->cd_dir != NULL, options->log) < 0)
+ msg (M_ERR, "daemon() failed or unsupported");
+ restore_signal_state ();
+ if (options->log)
+ set_std_files_to_null (true);
+
+#if defined(ENABLE_PKCS11)
+ pkcs11_forkFixup ();
+#endif
+
+ ret = true;
+ }
+ return ret;
+}
+
+/*
+ * Actually do UID/GID downgrade, chroot and SELinux context switching, if requested.
+ */
+static void
+do_uid_gid_chroot (struct context *c, bool no_delay)
+{
+ static const char why_not[] = "will be delayed because of --client, --pull, or --up-delay";
+ struct context_0 *c0 = c->c0;
+
+ if (c->first_time && c0 && !c0->uid_gid_set)
+ {
+ /* chroot if requested */
+ if (c->options.chroot_dir)
+ {
+ if (no_delay)
+ platform_chroot (c->options.chroot_dir);
+ else
+ msg (M_INFO, "NOTE: chroot %s", why_not);
+ }
+
+ /* set user and/or group that we want to setuid/setgid to */
+ if (no_delay)
+ {
+ platform_group_set (&c0->platform_state_group);
+ platform_user_set (&c0->platform_state_user);
+ c0->uid_gid_set = true;
+ }
+ else if (c0->uid_gid_specified)
+ {
+ msg (M_INFO, "NOTE: UID/GID downgrade %s", why_not);
+ }
+
+#ifdef ENABLE_MEMSTATS
+ if (c->options.memstats_fn)
+ mstats_open(c->options.memstats_fn);
+#endif
+
+#ifdef ENABLE_SELINUX
+ /* Apply a SELinux context in order to restrict what OpenVPN can do
+ * to _only_ what it is supposed to do after initialization is complete
+ * (basically just network I/O operations). Doing it after chroot
+ * requires /proc to be mounted in the chroot (which is annoying indeed
+ * but doing it before requires more complex SELinux policies.
+ */
+ if (c->options.selinux_context)
+ {
+ if (no_delay) {
+ if (-1 == setcon (c->options.selinux_context))
+ msg (M_ERR, "setcon to '%s' failed; is /proc accessible?", c->options.selinux_context);
+ else
+ msg (M_INFO, "setcon to '%s' succeeded", c->options.selinux_context);
+ }
+ else
+ msg (M_INFO, "NOTE: setcon %s", why_not);
+ }
+#endif
+ }
+}
+
+/*
+ * Return common name in a way that is formatted for
+ * prepending to msg() output.
+ */
+const char *
+format_common_name (struct context *c, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (c->c2.tls_multi)
+ {
+ buf_printf (&out, "[%s] ", tls_common_name (c->c2.tls_multi, false));
+ }
+#endif
+ return BSTR (&out);
+}
+
+void
+pre_setup (const struct options *options)
+{
+#ifdef WIN32
+ if (options->exit_event_name)
+ {
+ win32_signal_open (&win32_signal,
+ WSO_FORCE_SERVICE,
+ options->exit_event_name,
+ options->exit_event_initial_state);
+ }
+ else
+ {
+ win32_signal_open (&win32_signal,
+ WSO_FORCE_CONSOLE,
+ NULL,
+ false);
+
+ /* put a title on the top window bar */
+ if (win32_signal.mode == WSO_MODE_CONSOLE)
+ {
+ window_title_save (&window_title);
+ window_title_generate (options->config);
+ }
+ }
+#endif
+}
+
+void
+reset_coarse_timers (struct context *c)
+{
+ c->c2.coarse_timer_wakeup = 0;
+}
+
+/*
+ * Initialize timers
+ */
+static void
+do_init_timers (struct context *c, bool deferred)
+{
+ update_time ();
+ reset_coarse_timers (c);
+
+ /* initialize inactivity timeout */
+ if (c->options.inactivity_timeout)
+ event_timeout_init (&c->c2.inactivity_interval, c->options.inactivity_timeout, now);
+
+ /* initialize pings */
+
+ if (c->options.ping_send_timeout)
+ event_timeout_init (&c->c2.ping_send_interval, c->options.ping_send_timeout, 0);
+
+ if (c->options.ping_rec_timeout)
+ event_timeout_init (&c->c2.ping_rec_interval, c->options.ping_rec_timeout, now);
+
+#if P2MP
+ if (c->options.server_poll_timeout)
+ event_timeout_init (&c->c2.server_poll_interval, c->options.server_poll_timeout, now);
+#endif
+
+ if (!deferred)
+ {
+ /* initialize connection establishment timer */
+ event_timeout_init (&c->c2.wait_for_connect, 1, now);
+
+#ifdef ENABLE_OCC
+ /* initialize occ timers */
+
+ if (c->options.occ
+ && !TLS_MODE (c)
+ && c->c2.options_string_local && c->c2.options_string_remote)
+ event_timeout_init (&c->c2.occ_interval, OCC_INTERVAL_SECONDS, now);
+
+ if (c->options.mtu_test)
+ event_timeout_init (&c->c2.occ_mtu_load_test_interval, OCC_MTU_LOAD_INTERVAL_SECONDS, now);
+#endif
+
+ /* initialize packet_id persistence timer */
+#ifdef ENABLE_CRYPTO
+ if (c->options.packet_id_file)
+ event_timeout_init (&c->c2.packet_id_persist_interval, 60, now);
+#endif
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ /* initialize tmp_int optimization that limits the number of times we call
+ tls_multi_process in the main event loop */
+ interval_init (&c->c2.tmp_int, TLS_MULTI_HORIZON, TLS_MULTI_REFRESH);
+#endif
+ }
+}
+
+/*
+ * Initialize traffic shaper.
+ */
+static void
+do_init_traffic_shaper (struct context *c)
+{
+#ifdef ENABLE_FEATURE_SHAPER
+ /* initialize traffic shaper (i.e. transmit bandwidth limiter) */
+ if (c->options.shaper)
+ {
+ shaper_init (&c->c2.shaper, c->options.shaper);
+ shaper_msg (&c->c2.shaper);
+ }
+#endif
+}
+
+/*
+ * Allocate route list structures for IPv4 and IPv6
+ * (we do this for IPv4 even if no --route option has been seen, as other
+ * parts of OpenVPN might want to fill the route-list with info, e.g. DHCP)
+ */
+static void
+do_alloc_route_list (struct context *c)
+{
+ if (!c->c1.route_list)
+ ALLOC_OBJ_CLEAR_GC (c->c1.route_list, struct route_list, &c->gc);
+ if (c->options.routes_ipv6 && !c->c1.route_ipv6_list)
+ ALLOC_OBJ_CLEAR_GC (c->c1.route_ipv6_list, struct route_ipv6_list, &c->gc);
+}
+
+
+/*
+ * Initialize the route list, resolving any DNS names in route
+ * options and saving routes in the environment.
+ */
+static void
+do_init_route_list (const struct options *options,
+ struct route_list *route_list,
+ const struct link_socket_info *link_socket_info,
+ bool fatal,
+ struct env_set *es)
+{
+ const char *gw = NULL;
+ int dev = dev_type_enum (options->dev, options->dev_type);
+ int metric = 0;
+
+ if (dev == DEV_TYPE_TUN && (options->topology == TOP_NET30 || options->topology == TOP_P2P))
+ gw = options->ifconfig_remote_netmask;
+ if (options->route_default_gateway)
+ gw = options->route_default_gateway;
+ if (options->route_default_metric)
+ metric = options->route_default_metric;
+
+ if (!init_route_list (route_list,
+ options->routes,
+ gw,
+ metric,
+ link_socket_current_remote (link_socket_info),
+ es))
+ {
+ if (fatal)
+ openvpn_exit (OPENVPN_EXIT_STATUS_ERROR); /* exit point */
+ }
+ else
+ {
+ /* copy routes to environment */
+ setenv_routes (es, route_list);
+ }
+}
+
+static void
+do_init_route_ipv6_list (const struct options *options,
+ struct route_ipv6_list *route_ipv6_list,
+ bool fatal,
+ struct env_set *es)
+{
+ const char *gw = NULL;
+ int metric = -1; /* no metric set */
+
+ gw = options->ifconfig_ipv6_remote; /* default GW = remote end */
+#if 0 /* not yet done for IPv6 - TODO!*/
+ if ( options->route_ipv6_default_gateway ) /* override? */
+ gw = options->route_ipv6_default_gateway;
+#endif
+
+ if (options->route_default_metric)
+ metric = options->route_default_metric;
+
+ if (!init_route_ipv6_list (route_ipv6_list,
+ options->routes_ipv6,
+ gw,
+ metric,
+ es))
+ {
+ if (fatal)
+ openvpn_exit (OPENVPN_EXIT_STATUS_ERROR); /* exit point */
+ }
+ else
+ {
+ /* copy routes to environment */
+ setenv_routes_ipv6 (es, route_ipv6_list);
+ }
+}
+
+
+/*
+ * Called after all initialization has been completed.
+ */
+void
+initialization_sequence_completed (struct context *c, const unsigned int flags)
+{
+ static const char message[] = "Initialization Sequence Completed";
+
+ /* Reset the unsuccessful connection counter on complete initialisation */
+ c->options.unsuccessful_attempts=0;
+
+ /* If we delayed UID/GID downgrade or chroot, do it now */
+ do_uid_gid_chroot (c, true);
+
+ /* Test if errors */
+ if (flags & ISC_ERRORS)
+ {
+#ifdef WIN32
+ show_routes (M_INFO|M_NOPREFIX);
+ show_adapters (M_INFO|M_NOPREFIX);
+ msg (M_INFO, "%s With Errors ( see http://openvpn.net/faq.html#dhcpclientserv )", message);
+#else
+ msg (M_INFO, "%s With Errors", message);
+#endif
+ }
+ else
+ msg (M_INFO, "%s", message);
+
+ /* Flag that we initialized */
+ if ((flags & (ISC_ERRORS|ISC_SERVER)) == 0)
+ c->options.no_advance=true;
+
+#ifdef WIN32
+ fork_register_dns_action (c->c1.tuntap);
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ /* Tell management interface that we initialized */
+ if (management)
+ {
+ in_addr_t tun_local = 0;
+ in_addr_t tun_remote = 0; /* FKS */
+ const char *detail = "SUCCESS";
+ if (c->c1.tuntap)
+ tun_local = c->c1.tuntap->local;
+ /* TODO(jjo): for ipv6 this will convert some 32bits in the ipv6 addr
+ * to a meaningless ipv4 address.
+ * In any case, is somewhat inconsistent to send local tunnel
+ * addr with remote _endpoint_ addr (?)
+ */
+ tun_remote = htonl (c->c1.link_socket_addr.actual.dest.addr.in4.sin_addr.s_addr);
+ if (flags & ISC_ERRORS)
+ detail = "ERROR";
+ management_set_state (management,
+ OPENVPN_STATE_CONNECTED,
+ detail,
+ tun_local,
+ tun_remote);
+ if (tun_local)
+ management_post_tunnel_open (management, tun_local);
+ }
+#endif
+}
+
+/*
+ * Possibly add routes and/or call route-up script
+ * based on options.
+ */
+void
+do_route (const struct options *options,
+ struct route_list *route_list,
+ struct route_ipv6_list *route_ipv6_list,
+ const struct tuntap *tt,
+ const struct plugin_list *plugins,
+ struct env_set *es)
+{
+ if (!options->route_noexec && ( route_list || route_ipv6_list ) )
+ {
+ add_routes (route_list, route_ipv6_list, tt, ROUTE_OPTION_FLAGS (options), es);
+ setenv_int (es, "redirect_gateway", route_did_redirect_default_gateway(route_list));
+ }
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_up_down (management, "UP", es);
+#endif
+
+ if (plugin_defined (plugins, OPENVPN_PLUGIN_ROUTE_UP))
+ {
+ if (plugin_call (plugins, OPENVPN_PLUGIN_ROUTE_UP, NULL, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ msg (M_WARN, "WARNING: route-up plugin call failed");
+ }
+
+ if (options->route_script)
+ {
+ struct argv argv = argv_new ();
+ setenv_str (es, "script_type", "route-up");
+ argv_printf (&argv, "%sc", options->route_script);
+ openvpn_run_script (&argv, es, 0, "--route-up");
+ argv_reset (&argv);
+ }
+
+#ifdef WIN32
+ if (options->show_net_up)
+ {
+ show_routes (M_INFO|M_NOPREFIX);
+ show_adapters (M_INFO|M_NOPREFIX);
+ }
+ else if (check_debug_level (D_SHOW_NET))
+ {
+ show_routes (D_SHOW_NET|M_NOPREFIX);
+ show_adapters (D_SHOW_NET|M_NOPREFIX);
+ }
+#endif
+}
+
+/*
+ * Save current pulled options string in the c1 context store, so we can
+ * compare against it after possible future restarts.
+ */
+#if P2MP
+static void
+save_pulled_options_digest (struct context *c, const struct md5_digest *newdigest)
+{
+ if (newdigest)
+ c->c1.pulled_options_digest_save = *newdigest;
+ else
+ md5_digest_clear (&c->c1.pulled_options_digest_save);
+}
+#endif
+
+/*
+ * initialize tun/tap device object
+ */
+static void
+do_init_tun (struct context *c)
+{
+ c->c1.tuntap = init_tun (c->options.dev,
+ c->options.dev_type,
+ c->options.topology,
+ c->options.ifconfig_local,
+ c->options.ifconfig_remote_netmask,
+ c->options.ifconfig_ipv6_local,
+ c->options.ifconfig_ipv6_netbits,
+ c->options.ifconfig_ipv6_remote,
+ c->c1.link_socket_addr.bind_local,
+ c->c1.link_socket_addr.remote_list,
+ !c->options.ifconfig_nowarn,
+ c->c2.es);
+
+ /* flag tunnel for IPv6 config if --tun-ipv6 is set */
+ c->c1.tuntap->ipv6 = c->options.tun_ipv6;
+
+ init_tun_post (c->c1.tuntap,
+ &c->c2.frame,
+ &c->options.tuntap_options);
+
+ c->c1.tuntap_owned = true;
+}
+
+/*
+ * Open tun/tap device, ifconfig, call up script, etc.
+ */
+
+static bool
+do_open_tun (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+
+ c->c2.ipv4_tun = (!c->options.tun_ipv6
+ && is_dev_type (c->options.dev, c->options.dev_type, "tun"));
+
+#ifndef TARGET_ANDROID
+ if (!c->c1.tuntap)
+ {
+#endif
+
+#ifdef TARGET_ANDROID
+ /* If we emulate persist-tun on android we still have to open a new tun and
+ * then close the old */
+ int oldtunfd=-1;
+ if (c->c1.tuntap)
+ oldtunfd = c->c1.tuntap->fd;
+#endif
+
+ /* initialize (but do not open) tun/tap object */
+ do_init_tun (c);
+
+ /* allocate route list structure */
+ do_alloc_route_list (c);
+
+ /* parse and resolve the route option list */
+ if (c->options.routes && c->c1.route_list && c->c2.link_socket)
+ do_init_route_list (&c->options, c->c1.route_list, &c->c2.link_socket->info, false, c->c2.es);
+ if (c->options.routes_ipv6 && c->c1.route_ipv6_list )
+ do_init_route_ipv6_list (&c->options, c->c1.route_ipv6_list, false, c->c2.es);
+
+ /* do ifconfig */
+ if (!c->options.ifconfig_noexec
+ && ifconfig_order () == IFCONFIG_BEFORE_TUN_OPEN)
+ {
+ /* guess actual tun/tap unit number that will be returned
+ by open_tun */
+ const char *guess = guess_tuntap_dev (c->options.dev,
+ c->options.dev_type,
+ c->options.dev_node,
+ &gc);
+ do_ifconfig (c->c1.tuntap, guess, TUN_MTU_SIZE (&c->c2.frame), c->c2.es);
+ }
+
+ /* possibly add routes */
+ if (route_order() == ROUTE_BEFORE_TUN) {
+ /* Ignore route_delay, would cause ROUTE_BEFORE_TUN to be ignored */
+ do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list,
+ c->c1.tuntap, c->plugins, c->c2.es);
+ }
+#ifdef TARGET_ANDROID
+ /* Store the old fd inside the fd so open_tun can use it */
+ c->c1.tuntap->fd = oldtunfd;
+#endif
+ /* open the tun device */
+ open_tun (c->options.dev, c->options.dev_type, c->options.dev_node,
+ c->c1.tuntap);
+
+ /* set the hardware address */
+ if (c->options.lladdr)
+ set_lladdr(c->c1.tuntap->actual_name, c->options.lladdr, c->c2.es);
+
+ /* do ifconfig */
+ if (!c->options.ifconfig_noexec
+ && ifconfig_order () == IFCONFIG_AFTER_TUN_OPEN)
+ {
+ do_ifconfig (c->c1.tuntap, c->c1.tuntap->actual_name, TUN_MTU_SIZE (&c->c2.frame), c->c2.es);
+ }
+
+ /* run the up script */
+ run_up_down (c->options.up_script,
+ c->plugins,
+ OPENVPN_PLUGIN_UP,
+ c->c1.tuntap->actual_name,
+ dev_type_string (c->options.dev, c->options.dev_type),
+ TUN_MTU_SIZE (&c->c2.frame),
+ EXPANDED_SIZE (&c->c2.frame),
+ print_in_addr_t (c->c1.tuntap->local, IA_EMPTY_IF_UNDEF, &gc),
+ print_in_addr_t (c->c1.tuntap->remote_netmask, IA_EMPTY_IF_UNDEF, &gc),
+ "init",
+ NULL,
+ "up",
+ c->c2.es);
+
+ /* possibly add routes */
+ if ((route_order() == ROUTE_AFTER_TUN) && (!c->options.route_delay_defined))
+ do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list,
+ c->c1.tuntap, c->plugins, c->c2.es);
+
+ /*
+ * Did tun/tap driver give us an MTU?
+ */
+ if (c->c1.tuntap->post_open_mtu)
+ frame_set_mtu_dynamic (&c->c2.frame,
+ c->c1.tuntap->post_open_mtu,
+ SET_MTU_TUN | SET_MTU_UPPER_BOUND);
+
+ ret = true;
+ static_context = c;
+#ifndef TARGET_ANDROID
+ }
+ else
+ {
+ msg (M_INFO, "Preserving previous TUN/TAP instance: %s",
+ c->c1.tuntap->actual_name);
+
+ /* run the up script if user specified --up-restart */
+ if (c->options.up_restart)
+ run_up_down (c->options.up_script,
+ c->plugins,
+ OPENVPN_PLUGIN_UP,
+ c->c1.tuntap->actual_name,
+ dev_type_string (c->options.dev, c->options.dev_type),
+ TUN_MTU_SIZE (&c->c2.frame),
+ EXPANDED_SIZE (&c->c2.frame),
+ print_in_addr_t (c->c1.tuntap->local, IA_EMPTY_IF_UNDEF, &gc),
+ print_in_addr_t (c->c1.tuntap->remote_netmask, IA_EMPTY_IF_UNDEF, &gc),
+ "restart",
+ NULL,
+ "up",
+ c->c2.es);
+ }
+#endif
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Close TUN/TAP device
+ */
+
+static void
+do_close_tun_simple (struct context *c)
+{
+ msg (D_CLOSE, "Closing TUN/TAP interface");
+ close_tun (c->c1.tuntap);
+ c->c1.tuntap = NULL;
+ c->c1.tuntap_owned = false;
+#if P2MP
+ save_pulled_options_digest (c, NULL); /* delete C1-saved pulled_options_digest */
+#endif
+}
+
+static void
+do_close_tun (struct context *c, bool force)
+{
+ struct gc_arena gc = gc_new ();
+ if (c->c1.tuntap && c->c1.tuntap_owned)
+ {
+ const char *tuntap_actual = string_alloc (c->c1.tuntap->actual_name, &gc);
+ const in_addr_t local = c->c1.tuntap->local;
+ const in_addr_t remote_netmask = c->c1.tuntap->remote_netmask;
+
+ if (force || !(c->sig->signal_received == SIGUSR1 && c->options.persist_tun))
+ {
+ static_context = NULL;
+
+#ifdef ENABLE_MANAGEMENT
+ /* tell management layer we are about to close the TUN/TAP device */
+ if (management)
+ {
+ management_pre_tunnel_close (management);
+ management_up_down (management, "DOWN", c->c2.es);
+ }
+#endif
+
+ /* delete any routes we added */
+ if (c->c1.route_list || c->c1.route_ipv6_list )
+ {
+ run_up_down (c->options.route_predown_script,
+ c->plugins,
+ OPENVPN_PLUGIN_ROUTE_PREDOWN,
+ tuntap_actual,
+ NULL,
+ TUN_MTU_SIZE (&c->c2.frame),
+ EXPANDED_SIZE (&c->c2.frame),
+ print_in_addr_t (local, IA_EMPTY_IF_UNDEF, &gc),
+ print_in_addr_t (remote_netmask, IA_EMPTY_IF_UNDEF, &gc),
+ "init",
+ signal_description (c->sig->signal_received,
+ c->sig->signal_text),
+ "route-pre-down",
+ c->c2.es);
+
+ delete_routes (c->c1.route_list, c->c1.route_ipv6_list,
+ c->c1.tuntap, ROUTE_OPTION_FLAGS (&c->options), c->c2.es);
+ }
+
+ /* actually close tun/tap device based on --down-pre flag */
+ if (!c->options.down_pre)
+ do_close_tun_simple (c);
+
+ /* Run the down script -- note that it will run at reduced
+ privilege if, for example, "--user nobody" was used. */
+ run_up_down (c->options.down_script,
+ c->plugins,
+ OPENVPN_PLUGIN_DOWN,
+ tuntap_actual,
+ NULL,
+ TUN_MTU_SIZE (&c->c2.frame),
+ EXPANDED_SIZE (&c->c2.frame),
+ print_in_addr_t (local, IA_EMPTY_IF_UNDEF, &gc),
+ print_in_addr_t (remote_netmask, IA_EMPTY_IF_UNDEF, &gc),
+ "init",
+ signal_description (c->sig->signal_received,
+ c->sig->signal_text),
+ "down",
+ c->c2.es);
+
+ /* actually close tun/tap device based on --down-pre flag */
+ if (c->options.down_pre)
+ do_close_tun_simple (c);
+ }
+ else
+ {
+ /* run the down script on this restart if --up-restart was specified */
+ if (c->options.up_restart)
+ run_up_down (c->options.down_script,
+ c->plugins,
+ OPENVPN_PLUGIN_DOWN,
+ tuntap_actual,
+ NULL,
+ TUN_MTU_SIZE (&c->c2.frame),
+ EXPANDED_SIZE (&c->c2.frame),
+ print_in_addr_t (local, IA_EMPTY_IF_UNDEF, &gc),
+ print_in_addr_t (remote_netmask, IA_EMPTY_IF_UNDEF, &gc),
+ "restart",
+ signal_description (c->sig->signal_received,
+ c->sig->signal_text),
+ "down",
+ c->c2.es);
+ }
+ }
+ gc_free (&gc);
+}
+
+void
+tun_abort()
+{
+ struct context *c = static_context;
+ if (c)
+ {
+ static_context = NULL;
+ do_close_tun (c, true);
+ }
+}
+
+/*
+ * Handle delayed tun/tap interface bringup due to --up-delay or --pull
+ */
+
+void
+do_up (struct context *c, bool pulled_options, unsigned int option_types_found)
+{
+ if (!c->c2.do_up_ran)
+ {
+ reset_coarse_timers (c);
+
+ if (pulled_options && option_types_found)
+ do_deferred_options (c, option_types_found);
+
+ /* if --up-delay specified, open tun, do ifconfig, and run up script now */
+ if (c->options.up_delay || PULL_DEFINED (&c->options))
+ {
+ c->c2.did_open_tun = do_open_tun (c);
+ update_time ();
+
+#if P2MP
+ /*
+ * Was tun interface object persisted from previous restart iteration,
+ * and if so did pulled options string change from previous iteration?
+ */
+ if (!c->c2.did_open_tun
+ && PULL_DEFINED (&c->options)
+ && c->c1.tuntap
+ && (!md5_digest_defined (&c->c1.pulled_options_digest_save) || !md5_digest_defined (&c->c2.pulled_options_digest)
+ || !md5_digest_equal (&c->c1.pulled_options_digest_save, &c->c2.pulled_options_digest)))
+ {
+ /* if so, close tun, delete routes, then reinitialize tun and add routes */
+ msg (M_INFO, "NOTE: Pulled options changed on restart, will need to close and reopen TUN/TAP device.");
+ do_close_tun (c, true);
+ openvpn_sleep (1);
+ c->c2.did_open_tun = do_open_tun (c);
+ update_time ();
+ }
+#endif
+ }
+
+ if (c->c2.did_open_tun)
+ {
+#if P2MP
+ save_pulled_options_digest (c, &c->c2.pulled_options_digest);
+#endif
+
+ /* if --route-delay was specified, start timer */
+ if ((route_order() == ROUTE_AFTER_TUN) && c->options.route_delay_defined)
+ {
+ event_timeout_init (&c->c2.route_wakeup, c->options.route_delay, now);
+ event_timeout_init (&c->c2.route_wakeup_expire, c->options.route_delay + c->options.route_delay_window, now);
+ if (c->c1.tuntap)
+ tun_standby_init (c->c1.tuntap);
+ }
+ else
+ {
+ initialization_sequence_completed (c, 0); /* client/p2p --route-delay undefined */
+ }
+ }
+ else if (c->options.mode == MODE_POINT_TO_POINT)
+ {
+ initialization_sequence_completed (c, 0); /* client/p2p restart with --persist-tun */
+ }
+
+ c->c2.do_up_ran = true;
+ }
+}
+
+/*
+ * These are the option categories which will be accepted by pull.
+ */
+unsigned int
+pull_permission_mask (const struct context *c)
+{
+ unsigned int flags =
+ OPT_P_UP
+ | OPT_P_ROUTE_EXTRAS
+ | OPT_P_SOCKBUF
+ | OPT_P_SOCKFLAGS
+ | OPT_P_SETENV
+ | OPT_P_SHAPER
+ | OPT_P_TIMER
+ | OPT_P_COMP
+ | OPT_P_PERSIST
+ | OPT_P_MESSAGES
+ | OPT_P_EXPLICIT_NOTIFY
+ | OPT_P_ECHO
+ | OPT_P_PULL_MODE;
+
+ if (!c->options.route_nopull)
+ flags |= (OPT_P_ROUTE | OPT_P_IPWIN32);
+
+ return flags;
+}
+
+/*
+ * Handle non-tun-related pulled options.
+ */
+void
+do_deferred_options (struct context *c, const unsigned int found)
+{
+ if (found & OPT_P_MESSAGES)
+ {
+ init_verb_mute (c, IVM_LEVEL_1|IVM_LEVEL_2);
+ msg (D_PUSH, "OPTIONS IMPORT: --verb and/or --mute level changed");
+ }
+ if (found & OPT_P_TIMER)
+ {
+ do_init_timers (c, true);
+ msg (D_PUSH, "OPTIONS IMPORT: timers and/or timeouts modified");
+ }
+
+#ifdef ENABLE_OCC
+ if (found & OPT_P_EXPLICIT_NOTIFY)
+ {
+ if (!proto_is_udp(c->options.ce.proto) && c->options.ce.explicit_exit_notification)
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: --explicit-exit-notify can only be used with --proto udp");
+ c->options.ce.explicit_exit_notification = 0;
+ }
+ else
+ msg (D_PUSH, "OPTIONS IMPORT: explicit notify parm(s) modified");
+ }
+#endif
+
+#ifdef USE_COMP
+ if (found & OPT_P_COMP)
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: compression parms modified");
+ comp_uninit (c->c2.comp_context);
+ c->c2.comp_context = comp_init (&c->options.comp);
+ }
+#endif
+
+ if (found & OPT_P_SHAPER)
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: traffic shaper enabled");
+ do_init_traffic_shaper (c);
+ }
+
+ if (found & OPT_P_SOCKBUF)
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: --sndbuf/--rcvbuf options modified");
+ link_socket_update_buffer_sizes (c->c2.link_socket, c->options.rcvbuf, c->options.sndbuf);
+ }
+
+ if (found & OPT_P_SOCKFLAGS)
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: --socket-flags option modified");
+ link_socket_update_flags (c->c2.link_socket, c->options.sockflags);
+ }
+
+ if (found & OPT_P_PERSIST)
+ msg (D_PUSH, "OPTIONS IMPORT: --persist options modified");
+ if (found & OPT_P_UP)
+ msg (D_PUSH, "OPTIONS IMPORT: --ifconfig/up options modified");
+ if (found & OPT_P_ROUTE)
+ msg (D_PUSH, "OPTIONS IMPORT: route options modified");
+ if (found & OPT_P_ROUTE_EXTRAS)
+ msg (D_PUSH, "OPTIONS IMPORT: route-related options modified");
+ if (found & OPT_P_IPWIN32)
+ msg (D_PUSH, "OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified");
+ if (found & OPT_P_SETENV)
+ msg (D_PUSH, "OPTIONS IMPORT: environment modified");
+}
+
+/*
+ * Possible hold on initialization
+ */
+static bool
+do_hold (struct context *c)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ /* if c is defined, daemonize before hold */
+ if (c && c->options.daemon && management_should_daemonize (management))
+ do_init_first_time (c);
+
+ /* block until management hold is released */
+ if (management_hold (management))
+ return true;
+ }
+#endif
+ return false;
+}
+
+/*
+ * Sleep before restart.
+ */
+static void
+socket_restart_pause (struct context *c)
+{
+ int sec = 2;
+
+ switch (c->options.ce.proto)
+ {
+ case PROTO_TCP_SERVER:
+ sec = 1;
+ break;
+ case PROTO_UDP:
+ case PROTO_TCP_CLIENT:
+ sec = c->options.ce.connect_retry_seconds;
+ break;
+ }
+
+#ifdef ENABLE_DEBUG
+ if (GREMLIN_CONNECTION_FLOOD_LEVEL (c->options.gremlin))
+ sec = 0;
+#endif
+
+#if P2MP
+ if (auth_retry_get () == AR_NOINTERACT)
+ sec = 10;
+
+#if 0 /* not really needed because of c->persist.restart_sleep_seconds */
+ if (c->options.server_poll_timeout && sec > 1)
+ sec = 1;
+#endif
+#endif
+
+ if (c->persist.restart_sleep_seconds > 0 && c->persist.restart_sleep_seconds > sec)
+ sec = c->persist.restart_sleep_seconds;
+ else if (c->persist.restart_sleep_seconds == -1)
+ sec = 0;
+ c->persist.restart_sleep_seconds = 0;
+
+ /* do managment hold on context restart, i.e. second, third, fourth, etc. initialization */
+ if (do_hold (NULL))
+ sec = 0;
+
+ if (sec)
+ {
+ msg (D_RESTART, "Restart pause, %d second(s)", sec);
+ openvpn_sleep (sec);
+ }
+}
+
+/*
+ * Do a possible pause on context_2 initialization.
+ */
+static void
+do_startup_pause (struct context *c)
+{
+ if (!c->first_time)
+ socket_restart_pause (c);
+ else
+ do_hold (NULL); /* do management hold on first context initialization */
+}
+
+/*
+ * Finalize MTU parameters based on command line or config file options.
+ */
+static void
+frame_finalize_options (struct context *c, const struct options *o)
+{
+ if (!o)
+ o = &c->options;
+
+ /*
+ * Set adjustment factor for buffer alignment when no
+ * cipher is used.
+ */
+ if (!CIPHER_ENABLED (c))
+ {
+ frame_align_to_extra_frame (&c->c2.frame);
+ frame_or_align_flags (&c->c2.frame,
+ FRAME_HEADROOM_MARKER_FRAGMENT
+ |FRAME_HEADROOM_MARKER_READ_LINK
+ |FRAME_HEADROOM_MARKER_READ_STREAM);
+ }
+
+ frame_finalize (&c->c2.frame,
+ o->ce.link_mtu_defined,
+ o->ce.link_mtu,
+ o->ce.tun_mtu_defined,
+ o->ce.tun_mtu);
+}
+
+/*
+ * Free a key schedule, including OpenSSL components.
+ */
+static void
+key_schedule_free (struct key_schedule *ks, bool free_ssl_ctx)
+{
+#ifdef ENABLE_CRYPTO
+ free_key_ctx_bi (&ks->static_key);
+#ifdef ENABLE_SSL
+ if (tls_ctx_initialised(&ks->ssl_ctx) && free_ssl_ctx)
+ {
+ tls_ctx_free (&ks->ssl_ctx);
+ free_key_ctx_bi (&ks->tls_auth_key);
+ }
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+ CLEAR (*ks);
+}
+
+#ifdef ENABLE_CRYPTO
+
+static void
+init_crypto_pre (struct context *c, const unsigned int flags)
+{
+ if (c->options.engine)
+ crypto_init_lib_engine (c->options.engine);
+
+ if (flags & CF_LOAD_PERSISTED_PACKET_ID)
+ {
+ /* load a persisted packet-id for cross-session replay-protection */
+ if (c->options.packet_id_file)
+ packet_id_persist_load (&c->c1.pid_persist, c->options.packet_id_file);
+ }
+
+ /* Initialize crypto options */
+
+ if (c->options.use_iv)
+ c->c2.crypto_options.flags |= CO_USE_IV;
+
+ if (c->options.mute_replay_warnings)
+ c->c2.crypto_options.flags |= CO_MUTE_REPLAY_WARNINGS;
+
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ if (c->options.use_prediction_resistance)
+ rand_ctx_enable_prediction_resistance();
+#endif
+
+}
+
+/*
+ * Static Key Mode (using a pre-shared key)
+ */
+static void
+do_init_crypto_static (struct context *c, const unsigned int flags)
+{
+ const struct options *options = &c->options;
+ ASSERT (options->shared_secret_file);
+
+ init_crypto_pre (c, flags);
+
+ /* Initialize packet ID tracking */
+ if (options->replay)
+ {
+ packet_id_init (&c->c2.packet_id,
+ link_socket_proto_connection_oriented (options->ce.proto),
+ options->replay_window,
+ options->replay_time,
+ "STATIC", 0);
+ c->c2.crypto_options.packet_id = &c->c2.packet_id;
+ c->c2.crypto_options.pid_persist = &c->c1.pid_persist;
+ c->c2.crypto_options.flags |= CO_PACKET_ID_LONG_FORM;
+ packet_id_persist_load_obj (&c->c1.pid_persist,
+ c->c2.crypto_options.packet_id);
+ }
+
+ if (!key_ctx_bi_defined (&c->c1.ks.static_key))
+ {
+ struct key2 key2;
+ struct key_direction_state kds;
+
+ /* Get cipher & hash algorithms */
+ init_key_type (&c->c1.ks.key_type, options->ciphername,
+ options->ciphername_defined, options->authname,
+ options->authname_defined, options->keysize,
+ options->test_crypto, true);
+
+ /* Read cipher and hmac keys from shared secret file */
+ {
+ unsigned int rkf_flags = RKF_MUST_SUCCEED;
+ const char *rkf_file = options->shared_secret_file;
+
+ if (options->shared_secret_file_inline)
+ {
+ rkf_file = options->shared_secret_file_inline;
+ rkf_flags |= RKF_INLINE;
+ }
+ read_key_file (&key2, rkf_file, rkf_flags);
+ }
+
+ /* Check for and fix highly unlikely key problems */
+ verify_fix_key2 (&key2, &c->c1.ks.key_type,
+ options->shared_secret_file);
+
+ /* Initialize OpenSSL key objects */
+ key_direction_state_init (&kds, options->key_direction);
+ must_have_n_keys (options->shared_secret_file, "secret", &key2,
+ kds.need_keys);
+ init_key_ctx (&c->c1.ks.static_key.encrypt, &key2.keys[kds.out_key],
+ &c->c1.ks.key_type, OPENVPN_OP_ENCRYPT, "Static Encrypt");
+ init_key_ctx (&c->c1.ks.static_key.decrypt, &key2.keys[kds.in_key],
+ &c->c1.ks.key_type, OPENVPN_OP_DECRYPT, "Static Decrypt");
+
+ /* Erase the temporary copy of key */
+ CLEAR (key2);
+ }
+ else
+ {
+ msg (M_INFO, "Re-using pre-shared static key");
+ }
+
+ /* Get key schedule */
+ c->c2.crypto_options.key_ctx_bi = &c->c1.ks.static_key;
+
+ /* Compute MTU parameters */
+ crypto_adjust_frame_parameters (&c->c2.frame,
+ &c->c1.ks.key_type,
+ options->ciphername_defined,
+ options->use_iv, options->replay, true);
+
+ /* Sanity check on IV, sequence number, and cipher mode options */
+ check_replay_iv_consistency (&c->c1.ks.key_type, options->replay,
+ options->use_iv);
+}
+
+#ifdef ENABLE_SSL
+
+/*
+ * Initialize the persistent component of OpenVPN's TLS mode,
+ * which is preserved across SIGUSR1 resets.
+ */
+static void
+do_init_crypto_tls_c1 (struct context *c)
+{
+ const struct options *options = &c->options;
+
+ if (!tls_ctx_initialised(&c->c1.ks.ssl_ctx))
+ {
+ /*
+ * Initialize the OpenSSL library's global
+ * SSL context.
+ */
+ init_ssl (options, &(c->c1.ks.ssl_ctx));
+ if (!tls_ctx_initialised(&c->c1.ks.ssl_ctx))
+ {
+#if P2MP
+ switch (auth_retry_get ())
+ {
+ case AR_NONE:
+ msg (M_FATAL, "Error: private key password verification failed");
+ break;
+ case AR_INTERACT:
+ ssl_purge_auth (false);
+ case AR_NOINTERACT:
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- Password failure error */
+ break;
+ default:
+ ASSERT (0);
+ }
+ c->sig->signal_text = "private-key-password-failure";
+ return;
+#else
+ msg (M_FATAL, "Error: private key password verification failed");
+#endif
+ }
+
+ /* Get cipher & hash algorithms */
+ init_key_type (&c->c1.ks.key_type, options->ciphername,
+ options->ciphername_defined, options->authname,
+ options->authname_defined, options->keysize, true, true);
+
+ /* Initialize PRNG with config-specified digest */
+ prng_init (options->prng_hash, options->prng_nonce_secret_len);
+
+ /* TLS handshake authentication (--tls-auth) */
+ if (options->tls_auth_file)
+ {
+ unsigned int flags = 0;
+ const char *file = options->tls_auth_file;
+
+ if (options->tls_auth_file_inline)
+ {
+ flags |= GHK_INLINE;
+ file = options->tls_auth_file_inline;
+ }
+ get_tls_handshake_key (&c->c1.ks.key_type,
+ &c->c1.ks.tls_auth_key,
+ file,
+ options->key_direction,
+ flags);
+ }
+
+#if 0 /* was: #if ENABLE_INLINE_FILES -- Note that enabling this code will break restarts */
+ if (options->priv_key_file_inline)
+ {
+ string_clear (c->options.priv_key_file_inline);
+ c->options.priv_key_file_inline = NULL;
+ }
+#endif
+ }
+ else
+ {
+ msg (D_INIT_MEDIUM, "Re-using SSL/TLS context");
+ }
+}
+
+static void
+do_init_crypto_tls (struct context *c, const unsigned int flags)
+{
+ const struct options *options = &c->options;
+ struct tls_options to;
+ bool packet_id_long_form;
+
+ ASSERT (options->tls_server || options->tls_client);
+ ASSERT (!options->test_crypto);
+
+ init_crypto_pre (c, flags);
+
+ /* Make sure we are either a TLS client or server but not both */
+ ASSERT (options->tls_server == !options->tls_client);
+
+ /* initialize persistent component */
+ do_init_crypto_tls_c1 (c);
+ if (IS_SIG (c))
+ return;
+
+ /* Sanity check on IV, sequence number, and cipher mode options */
+ check_replay_iv_consistency (&c->c1.ks.key_type, options->replay,
+ options->use_iv);
+
+ /* In short form, unique datagram identifier is 32 bits, in long form 64 bits */
+ packet_id_long_form = cipher_kt_mode_ofb_cfb (c->c1.ks.key_type.cipher);
+
+ /* Compute MTU parameters */
+ crypto_adjust_frame_parameters (&c->c2.frame,
+ &c->c1.ks.key_type,
+ options->ciphername_defined,
+ options->use_iv,
+ options->replay, packet_id_long_form);
+ tls_adjust_frame_parameters (&c->c2.frame);
+
+ /* Set all command-line TLS-related options */
+ CLEAR (to);
+
+ to.crypto_flags_and = ~(CO_PACKET_ID_LONG_FORM);
+ if (packet_id_long_form)
+ to.crypto_flags_or = CO_PACKET_ID_LONG_FORM;
+
+ to.ssl_ctx = c->c1.ks.ssl_ctx;
+ to.key_type = c->c1.ks.key_type;
+ to.server = options->tls_server;
+ to.key_method = options->key_method;
+ to.replay = options->replay;
+ to.replay_window = options->replay_window;
+ to.replay_time = options->replay_time;
+ to.tcp_mode = link_socket_proto_connection_oriented (options->ce.proto);
+ to.transition_window = options->transition_window;
+ to.handshake_window = options->handshake_window;
+ to.packet_timeout = options->tls_timeout;
+ to.renegotiate_bytes = options->renegotiate_bytes;
+ to.renegotiate_packets = options->renegotiate_packets;
+ to.renegotiate_seconds = options->renegotiate_seconds;
+ to.single_session = options->single_session;
+#ifdef ENABLE_PUSH_PEER_INFO
+ if (options->push_peer_info) /* all there is */
+ to.push_peer_info_detail = 2;
+ else if (options->pull) /* pull clients send some details */
+ to.push_peer_info_detail = 1;
+ else /* default: no peer-info at all */
+ to.push_peer_info_detail = 0;
+#endif
+
+ /* should we not xmit any packets until we get an initial
+ response from client? */
+ if (to.server && options->ce.proto == PROTO_TCP_SERVER)
+ to.xmit_hold = true;
+
+#ifdef ENABLE_OCC
+ to.disable_occ = !options->occ;
+#endif
+
+ to.verify_command = options->tls_verify;
+ to.verify_export_cert = options->tls_export_cert;
+ to.verify_x509_type = (options->verify_x509_type & 0xff);
+ to.verify_x509_name = options->verify_x509_name;
+ to.crl_file = options->crl_file;
+ to.ssl_flags = options->ssl_flags;
+ to.ns_cert_type = options->ns_cert_type;
+ memmove (to.remote_cert_ku, options->remote_cert_ku, sizeof (to.remote_cert_ku));
+ to.remote_cert_eku = options->remote_cert_eku;
+ to.verify_hash = options->verify_hash;
+#ifdef ENABLE_X509ALTUSERNAME
+ to.x509_username_field = (char *) options->x509_username_field;
+#else
+ to.x509_username_field = X509_USERNAME_FIELD_DEFAULT;
+#endif
+ to.es = c->c2.es;
+
+#ifdef ENABLE_DEBUG
+ to.gremlin = c->options.gremlin;
+#endif
+
+ to.plugins = c->plugins;
+
+#ifdef MANAGEMENT_DEF_AUTH
+ to.mda_context = &c->c2.mda_context;
+#endif
+
+#if P2MP_SERVER
+ to.auth_user_pass_verify_script = options->auth_user_pass_verify_script;
+ to.auth_user_pass_verify_script_via_file = options->auth_user_pass_verify_script_via_file;
+ to.tmp_dir = options->tmp_dir;
+ if (options->ccd_exclusive)
+ to.client_config_dir_exclusive = options->client_config_dir;
+#endif
+
+#ifdef ENABLE_X509_TRACK
+ to.x509_track = options->x509_track;
+#endif
+
+#if P2MP
+#ifdef ENABLE_CLIENT_CR
+ to.sci = &options->sc_info;
+#endif
+#endif
+
+#ifdef USE_COMP
+ to.comp_options = options->comp;
+#endif
+
+ /* TLS handshake authentication (--tls-auth) */
+ if (options->tls_auth_file)
+ {
+ to.tls_auth_key = c->c1.ks.tls_auth_key;
+ to.tls_auth.pid_persist = &c->c1.pid_persist;
+ to.tls_auth.flags |= CO_PACKET_ID_LONG_FORM;
+ crypto_adjust_frame_parameters (&to.frame,
+ &c->c1.ks.key_type,
+ false, false, true, true);
+ }
+
+ /* If we are running over TCP, allow for
+ length prefix */
+ socket_adjust_frame_parameters (&to.frame, options->ce.proto);
+
+ /*
+ * Initialize OpenVPN's master TLS-mode object.
+ */
+ if (flags & CF_INIT_TLS_MULTI)
+ c->c2.tls_multi = tls_multi_init (&to);
+
+ if (flags & CF_INIT_TLS_AUTH_STANDALONE)
+ c->c2.tls_auth_standalone = tls_auth_standalone_init (&to, &c->c2.gc);
+}
+
+static void
+do_init_finalize_tls_frame (struct context *c)
+{
+ if (c->c2.tls_multi)
+ {
+ tls_multi_init_finalize (c->c2.tls_multi, &c->c2.frame);
+ ASSERT (EXPANDED_SIZE (&c->c2.tls_multi->opt.frame) <=
+ EXPANDED_SIZE (&c->c2.frame));
+ frame_print (&c->c2.tls_multi->opt.frame, D_MTU_INFO,
+ "Control Channel MTU parms");
+ }
+ if (c->c2.tls_auth_standalone)
+ {
+ tls_auth_standalone_finalize (c->c2.tls_auth_standalone, &c->c2.frame);
+ frame_print (&c->c2.tls_auth_standalone->frame, D_MTU_INFO,
+ "TLS-Auth MTU parms");
+ }
+}
+
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+
+#ifdef ENABLE_CRYPTO
+/*
+ * No encryption or authentication.
+ */
+static void
+do_init_crypto_none (const struct context *c)
+{
+ ASSERT (!c->options.test_crypto);
+ msg (M_WARN,
+ "******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext");
+}
+#endif
+
+static void
+do_init_crypto (struct context *c, const unsigned int flags)
+{
+#ifdef ENABLE_CRYPTO
+ if (c->options.shared_secret_file)
+ do_init_crypto_static (c, flags);
+#ifdef ENABLE_SSL
+ else if (c->options.tls_server || c->options.tls_client)
+ do_init_crypto_tls (c, flags);
+#endif
+ else /* no encryption or authentication. */
+ do_init_crypto_none (c);
+#else /* ENABLE_CRYPTO */
+ msg (M_WARN,
+ "******* WARNING *******: " PACKAGE_NAME
+ " built without OpenSSL -- encryption and authentication features disabled -- all data will be tunnelled as cleartext");
+#endif /* ENABLE_CRYPTO */
+}
+
+static void
+do_init_frame (struct context *c)
+{
+#ifdef USE_COMP
+ /*
+ * modify frame parameters if compression is enabled
+ */
+ if (comp_enabled(&c->options.comp))
+ {
+ comp_add_to_extra_frame (&c->c2.frame);
+
+#if !defined(ENABLE_SNAPPY) && !defined(ENABLE_LZ4)
+ /*
+ * Compression usage affects buffer alignment when non-swapped algs
+ * such as LZO is used.
+ * Newer algs like Snappy and comp-stub with COMP_F_SWAP don't need
+ * any special alignment because of the control-byte swap approach.
+ * LZO alignment (on the other hand) is problematic because
+ * the presence of the control byte means that either the output of
+ * decryption must be written to an unaligned buffer, or the input
+ * to compression (or packet dispatch if packet is uncompressed)
+ * must be read from an unaligned buffer.
+ * This code tries to align the input to compression (or packet
+ * dispatch if packet is uncompressed) at the cost of requiring
+ * decryption output to be written to an unaligned buffer, so
+ * it's more of a tradeoff than an optimal solution and we don't
+ * include it when we are doing a modern build with Snappy or LZ4.
+ * Strictly speaking, on the server it would be better to execute
+ * this code for every connection after we decide the compression
+ * method, but currently the frame code doesn't appear to be
+ * flexible enough for this, since the frame is already established
+ * before it is known which compression options will be pushed.
+ */
+ if (comp_unswapped_prefix (&c->options.comp) && CIPHER_ENABLED (c))
+ {
+ frame_add_to_align_adjust (&c->c2.frame, COMP_PREFIX_LEN);
+ frame_or_align_flags (&c->c2.frame,
+ FRAME_HEADROOM_MARKER_FRAGMENT
+ |FRAME_HEADROOM_MARKER_DECRYPT);
+ }
+#endif
+
+#ifdef ENABLE_FRAGMENT
+ comp_add_to_extra_frame (&c->c2.frame_fragment_omit); /* omit compression frame delta from final frame_fragment */
+#endif
+ }
+#endif /* USE_COMP */
+
+ /*
+ * Adjust frame size for UDP Socks support.
+ */
+ if (c->options.ce.socks_proxy_server)
+ socks_adjust_frame_parameters (&c->c2.frame, c->options.ce.proto);
+
+ /*
+ * Adjust frame size based on the --tun-mtu-extra parameter.
+ */
+ if (c->options.ce.tun_mtu_extra_defined)
+ tun_adjust_frame_parameters (&c->c2.frame, c->options.ce.tun_mtu_extra);
+
+ /*
+ * Adjust frame size based on link socket parameters.
+ * (Since TCP is a stream protocol, we need to insert
+ * a packet length uint16_t in the buffer.)
+ */
+ socket_adjust_frame_parameters (&c->c2.frame, c->options.ce.proto);
+
+ /*
+ * Fill in the blanks in the frame parameters structure,
+ * make sure values are rational, etc.
+ */
+ frame_finalize_options (c, NULL);
+
+#ifdef USE_COMP
+ /*
+ * Modify frame parameters if compression is compiled in.
+ * Should be called after frame_finalize_options.
+ */
+ comp_add_to_extra_buffer (&c->c2.frame);
+#ifdef ENABLE_FRAGMENT
+ comp_add_to_extra_buffer (&c->c2.frame_fragment_omit); /* omit compression frame delta from final frame_fragment */
+#endif
+#endif /* USE_COMP */
+
+#ifdef ENABLE_FRAGMENT
+ /*
+ * Set frame parameter for fragment code. This is necessary because
+ * the fragmentation code deals with payloads which have already been
+ * passed through the compression code.
+ */
+ c->c2.frame_fragment = c->c2.frame;
+ frame_subtract_extra (&c->c2.frame_fragment, &c->c2.frame_fragment_omit);
+#endif
+
+#if defined(ENABLE_FRAGMENT) && defined(ENABLE_OCC)
+ /*
+ * MTU advisories
+ */
+ if (c->options.ce.fragment && c->options.mtu_test)
+ msg (M_WARN,
+ "WARNING: using --fragment and --mtu-test together may produce an inaccurate MTU test result");
+#endif
+
+#ifdef ENABLE_FRAGMENT
+ if ((c->options.ce.mssfix || c->options.ce.fragment)
+ && TUN_MTU_SIZE (&c->c2.frame_fragment) != ETHERNET_MTU)
+ msg (M_WARN,
+ "WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu %d (currently it is %d)",
+ ETHERNET_MTU, TUN_MTU_SIZE (&c->c2.frame_fragment));
+#endif
+}
+
+static void
+do_option_warnings (struct context *c)
+{
+ const struct options *o = &c->options;
+
+ if (o->ping_send_timeout && !o->ping_rec_timeout)
+ msg (M_WARN, "WARNING: --ping should normally be used with --ping-restart or --ping-exit");
+
+ if (o->username || o->groupname || o->chroot_dir
+#ifdef ENABLE_SELINUX
+ || o->selinux_context
+#endif
+ )
+ {
+ if (!o->persist_tun)
+ msg (M_WARN, "WARNING: you are using user/group/chroot/setcon without persist-tun -- this may cause restarts to fail");
+ if (!o->persist_key
+#ifdef ENABLE_PKCS11
+ && !o->pkcs11_id
+#endif
+ )
+ msg (M_WARN, "WARNING: you are using user/group/chroot/setcon without persist-key -- this may cause restarts to fail");
+ }
+
+ if (o->chroot_dir && !(o->username && o->groupname))
+ msg (M_WARN, "WARNING: you are using chroot without specifying user and group -- this may cause the chroot jail to be insecure");
+
+#if P2MP
+ if (o->pull && o->ifconfig_local && c->first_time)
+ msg (M_WARN, "WARNING: using --pull/--client and --ifconfig together is probably not what you want");
+
+#if P2MP_SERVER
+ if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+ msg (M_WARN, "NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to");
+
+ if (o->mode == MODE_SERVER)
+ {
+ if (o->duplicate_cn && o->client_config_dir)
+ msg (M_WARN, "WARNING: using --duplicate-cn and --client-config-dir together is probably not what you want");
+ if (o->duplicate_cn && o->ifconfig_pool_persist_filename)
+ msg (M_WARN, "WARNING: --ifconfig-pool-persist will not work with --duplicate-cn");
+ if (!o->keepalive_ping || !o->keepalive_timeout)
+ msg (M_WARN, "WARNING: --keepalive option is missing from server config");
+ }
+#endif
+#endif
+
+#ifdef ENABLE_CRYPTO
+ if (!o->replay)
+ msg (M_WARN, "WARNING: You have disabled Replay Protection (--no-replay) which may make " PACKAGE_NAME " less secure");
+ if (!o->use_iv)
+ msg (M_WARN, "WARNING: You have disabled Crypto IVs (--no-iv) which may make " PACKAGE_NAME " less secure");
+
+#ifdef ENABLE_SSL
+ if (o->tls_server)
+ warn_on_use_of_common_subnets ();
+ if (o->tls_client
+ && !o->tls_verify
+ && o->verify_x509_type == VERIFY_X509_NONE
+ && !(o->ns_cert_type & NS_CERT_CHECK_SERVER)
+ && !o->remote_cert_eku)
+ msg (M_WARN, "WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.");
+#endif
+#endif
+
+#ifndef CONNECT_NONBLOCK
+ if (o->ce.connect_timeout_defined)
+ msg (M_WARN, "NOTE: --connect-timeout option is not supported on this OS");
+#endif
+
+ /* If a script is used, print appropiate warnings */
+ if (o->user_script_used)
+ {
+ if (script_security >= SSEC_SCRIPTS)
+ msg (M_WARN, "NOTE: the current --script-security setting may allow this configuration to call user-defined scripts");
+ else if (script_security >= SSEC_PW_ENV)
+ msg (M_WARN, "WARNING: the current --script-security setting may allow passwords to be passed to scripts via environmental variables");
+ else
+ msg (M_WARN, "NOTE: starting with " PACKAGE_NAME " 2.1, '--script-security 2' or higher is required to call user-defined scripts or executables");
+ }
+}
+
+static void
+do_init_frame_tls (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ do_init_finalize_tls_frame (c);
+#endif
+}
+
+struct context_buffers *
+init_context_buffers (const struct frame *frame)
+{
+ struct context_buffers *b;
+
+ ALLOC_OBJ_CLEAR (b, struct context_buffers);
+
+ b->read_link_buf = alloc_buf (BUF_SIZE (frame));
+ b->read_tun_buf = alloc_buf (BUF_SIZE (frame));
+
+ b->aux_buf = alloc_buf (BUF_SIZE (frame));
+
+#ifdef ENABLE_CRYPTO
+ b->encrypt_buf = alloc_buf (BUF_SIZE (frame));
+ b->decrypt_buf = alloc_buf (BUF_SIZE (frame));
+#endif
+
+#ifdef USE_COMP
+ b->compress_buf = alloc_buf (BUF_SIZE (frame));
+ b->decompress_buf = alloc_buf (BUF_SIZE (frame));
+#endif
+
+ return b;
+}
+
+void
+free_context_buffers (struct context_buffers *b)
+{
+ if (b)
+ {
+ free_buf (&b->read_link_buf);
+ free_buf (&b->read_tun_buf);
+ free_buf (&b->aux_buf);
+
+#ifdef USE_COMP
+ free_buf (&b->compress_buf);
+ free_buf (&b->decompress_buf);
+#endif
+
+#ifdef ENABLE_CRYPTO
+ free_buf (&b->encrypt_buf);
+ free_buf (&b->decrypt_buf);
+#endif
+
+ free (b);
+ }
+}
+
+/*
+ * Now that we know all frame parameters, initialize
+ * our buffers.
+ */
+static void
+do_init_buffers (struct context *c)
+{
+ c->c2.buffers = init_context_buffers (&c->c2.frame);
+ c->c2.buffers_owned = true;
+}
+
+#ifdef ENABLE_FRAGMENT
+/*
+ * Fragmenting code has buffers to initialize
+ * once frame parameters are known.
+ */
+static void
+do_init_fragment (struct context *c)
+{
+ ASSERT (c->options.ce.fragment);
+ frame_set_mtu_dynamic (&c->c2.frame_fragment,
+ c->options.ce.fragment, SET_MTU_UPPER_BOUND);
+ fragment_frame_init (c->c2.fragment, &c->c2.frame_fragment);
+}
+#endif
+
+/*
+ * Set the --mssfix option.
+ */
+static void
+do_init_mssfix (struct context *c)
+{
+ if (c->options.ce.mssfix)
+ {
+ frame_set_mtu_dynamic (&c->c2.frame,
+ c->options.ce.mssfix, SET_MTU_UPPER_BOUND);
+ }
+}
+
+/*
+ * Allocate our socket object.
+ */
+static void
+do_link_socket_new (struct context *c)
+{
+ ASSERT (!c->c2.link_socket);
+ c->c2.link_socket = link_socket_new ();
+ c->c2.link_socket_owned = true;
+}
+
+/*
+ * bind the TCP/UDP socket
+ */
+static void
+do_init_socket_1 (struct context *c, const int mode)
+{
+ unsigned int sockflags = c->options.sockflags;
+
+#if PORT_SHARE
+ if (c->options.port_share_host && c->options.port_share_port)
+ sockflags |= SF_PORT_SHARE;
+#endif
+
+ link_socket_init_phase1 (c->c2.link_socket,
+ c->options.ce.local,
+ c->options.ce.local_port,
+ c->options.ce.remote,
+ c->options.ce.remote_port,
+ c->c1.dns_cache,
+ c->options.ce.proto,
+ c->options.ce.af,
+ c->options.ce.bind_ipv6_only,
+ mode,
+ c->c2.accept_from,
+ c->c1.http_proxy,
+ c->c1.socks_proxy,
+#ifdef ENABLE_DEBUG
+ c->options.gremlin,
+#endif
+ c->options.ce.bind_local,
+ c->options.ce.remote_float,
+ c->options.inetd,
+ &c->c1.link_socket_addr,
+ c->options.ipchange,
+ c->plugins,
+ c->options.resolve_retry_seconds,
+ c->options.ce.connect_timeout,
+ c->options.ce.mtu_discover_type,
+ c->options.rcvbuf,
+ c->options.sndbuf,
+ c->options.mark,
+ sockflags);
+}
+
+/*
+ * finalize the TCP/UDP socket
+ */
+static void
+do_init_socket_2 (struct context *c)
+{
+ link_socket_init_phase2 (c->c2.link_socket, &c->c2.frame,
+ c->sig);
+}
+
+/*
+ * Print MTU INFO
+ */
+static void
+do_print_data_channel_mtu_parms (struct context *c)
+{
+ frame_print (&c->c2.frame, D_MTU_INFO, "Data Channel MTU parms");
+#ifdef ENABLE_FRAGMENT
+ if (c->c2.fragment)
+ frame_print (&c->c2.frame_fragment, D_MTU_INFO,
+ "Fragmentation MTU parms");
+#endif
+}
+
+#ifdef ENABLE_OCC
+/*
+ * Get local and remote options compatibility strings.
+ */
+static void
+do_compute_occ_strings (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+
+ c->c2.options_string_local =
+ options_string (&c->options, &c->c2.frame, c->c1.tuntap, false, &gc);
+ c->c2.options_string_remote =
+ options_string (&c->options, &c->c2.frame, c->c1.tuntap, true, &gc);
+
+ msg (D_SHOW_OCC, "Local Options String: '%s'", c->c2.options_string_local);
+ msg (D_SHOW_OCC, "Expected Remote Options String: '%s'",
+ c->c2.options_string_remote);
+
+#ifdef ENABLE_CRYPTO
+ msg (D_SHOW_OCC_HASH, "Local Options hash (VER=%s): '%s'",
+ options_string_version (c->c2.options_string_local, &gc),
+ md5sum ((uint8_t*)c->c2.options_string_local,
+ strlen (c->c2.options_string_local), 9, &gc));
+ msg (D_SHOW_OCC_HASH, "Expected Remote Options hash (VER=%s): '%s'",
+ options_string_version (c->c2.options_string_remote, &gc),
+ md5sum ((uint8_t*)c->c2.options_string_remote,
+ strlen (c->c2.options_string_remote), 9, &gc));
+#endif
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (c->c2.tls_multi)
+ tls_multi_init_set_options (c->c2.tls_multi,
+ c->c2.options_string_local,
+ c->c2.options_string_remote);
+#endif
+
+ gc_free (&gc);
+}
+#endif
+
+/*
+ * These things can only be executed once per program instantiation.
+ * Set up for possible UID/GID downgrade, but don't do it yet.
+ * Daemonize if requested.
+ */
+static void
+do_init_first_time (struct context *c)
+{
+ if (c->first_time && !c->did_we_daemonize && !c->c0)
+ {
+ struct context_0 *c0;
+
+ ALLOC_OBJ_CLEAR_GC (c->c0, struct context_0, &c->gc);
+ c0 = c->c0;
+
+ /* get user and/or group that we want to setuid/setgid to */
+ c0->uid_gid_specified =
+ platform_group_get (c->options.groupname, &c0->platform_state_group) |
+ platform_user_get (c->options.username, &c0->platform_state_user);
+
+ /* get --writepid file descriptor */
+ get_pid_file (c->options.writepid, &c0->pid_state);
+
+ /* become a daemon if --daemon */
+ c->did_we_daemonize = possibly_become_daemon (&c->options, c->first_time);
+
+ /* should we disable paging? */
+ if (c->options.mlock && c->did_we_daemonize)
+ platform_mlockall (true); /* call again in case we daemonized */
+
+ /* save process ID in a file */
+ write_pid (&c0->pid_state);
+
+ /* should we change scheduling priority? */
+ platform_nice (c->options.nice);
+ }
+}
+
+/*
+ * If xinetd/inetd mode, don't allow restart.
+ */
+static void
+do_close_check_if_restart_permitted (struct context *c)
+{
+ if (c->options.inetd
+ && (c->sig->signal_received == SIGHUP
+ || c->sig->signal_received == SIGUSR1))
+ {
+ c->sig->signal_received = SIGTERM;
+ msg (M_INFO,
+ PACKAGE_NAME
+ " started by inetd/xinetd cannot restart... Exiting.");
+ }
+}
+
+/*
+ * free buffers
+ */
+static void
+do_close_free_buf (struct context *c)
+{
+ if (c->c2.buffers_owned)
+ {
+ free_context_buffers (c->c2.buffers);
+ c->c2.buffers = NULL;
+ c->c2.buffers_owned = false;
+ }
+}
+
+/*
+ * close TLS
+ */
+static void
+do_close_tls (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (c->c2.tls_multi)
+ {
+ tls_multi_free (c->c2.tls_multi, true);
+ c->c2.tls_multi = NULL;
+ }
+
+#ifdef ENABLE_OCC
+ /* free options compatibility strings */
+ if (c->c2.options_string_local)
+ free (c->c2.options_string_local);
+ if (c->c2.options_string_remote)
+ free (c->c2.options_string_remote);
+ c->c2.options_string_local = c->c2.options_string_remote = NULL;
+#endif
+#endif
+}
+
+/*
+ * Free key schedules
+ */
+static void
+do_close_free_key_schedule (struct context *c, bool free_ssl_ctx)
+{
+ if (!(c->sig->signal_received == SIGUSR1 && c->options.persist_key))
+ key_schedule_free (&c->c1.ks, free_ssl_ctx);
+}
+
+/*
+ * Close TCP/UDP connection
+ */
+static void
+do_close_link_socket (struct context *c)
+{
+ if (c->c2.link_socket && c->c2.link_socket_owned)
+ {
+ link_socket_close (c->c2.link_socket);
+ c->c2.link_socket = NULL;
+ }
+
+
+ /* Preserve the resolved list of remote if the user request to or if we want
+ * reconnect to the same host again or there are still addresses that need
+ * to be tried */
+ if (!(c->sig->signal_received == SIGUSR1 &&
+ ( (c->options.persist_remote_ip)
+ ||
+ ( c->sig->source != SIG_SOURCE_HARD &&
+ ((c->c1.link_socket_addr.current_remote && c->c1.link_socket_addr.current_remote->ai_next)
+ || c->options.no_advance))
+ )))
+ {
+ clear_remote_addrlist(&c->c1.link_socket_addr, !c->options.resolve_in_advance);
+ }
+
+ /* Clear the remote actual address when persist_remote_ip is not in use */
+ if (!(c->sig->signal_received == SIGUSR1 && c->options.persist_remote_ip))
+ CLEAR (c->c1.link_socket_addr.actual);
+
+ if (!(c->sig->signal_received == SIGUSR1 && c->options.persist_local_ip)) {
+ if (c->c1.link_socket_addr.bind_local && !c->options.resolve_in_advance)
+ freeaddrinfo(c->c1.link_socket_addr.bind_local);
+
+ c->c1.link_socket_addr.bind_local=NULL;
+ }
+}
+
+/*
+ * Close packet-id persistance file
+ */
+static void
+do_close_packet_id (struct context *c)
+{
+#ifdef ENABLE_CRYPTO
+ packet_id_free (&c->c2.packet_id);
+ packet_id_persist_save (&c->c1.pid_persist);
+ if (!(c->sig->signal_received == SIGUSR1))
+ packet_id_persist_close (&c->c1.pid_persist);
+#endif
+}
+
+#ifdef ENABLE_FRAGMENT
+/*
+ * Close fragmentation handler.
+ */
+static void
+do_close_fragment (struct context *c)
+{
+ if (c->c2.fragment)
+ {
+ fragment_free (c->c2.fragment);
+ c->c2.fragment = NULL;
+ }
+}
+#endif
+
+/*
+ * Open and close our event objects.
+ */
+
+static void
+do_event_set_init (struct context *c,
+ bool need_us_timeout)
+{
+ unsigned int flags = 0;
+
+ c->c2.event_set_max = BASE_N_EVENTS;
+
+ flags |= EVENT_METHOD_FAST;
+
+ if (need_us_timeout)
+ flags |= EVENT_METHOD_US_TIMEOUT;
+
+ c->c2.event_set = event_set_init (&c->c2.event_set_max, flags);
+ c->c2.event_set_owned = true;
+}
+
+static void
+do_close_event_set (struct context *c)
+{
+ if (c->c2.event_set && c->c2.event_set_owned)
+ {
+ event_free (c->c2.event_set);
+ c->c2.event_set = NULL;
+ c->c2.event_set_owned = false;
+ }
+}
+
+/*
+ * Open and close --status file
+ */
+
+static void
+do_open_status_output (struct context *c)
+{
+ if (!c->c1.status_output)
+ {
+ c->c1.status_output = status_open (c->options.status_file,
+ c->options.status_file_update_freq,
+ -1,
+ NULL,
+ STATUS_OUTPUT_WRITE);
+ c->c1.status_output_owned = true;
+ }
+}
+
+static void
+do_close_status_output (struct context *c)
+{
+ if (!(c->sig->signal_received == SIGUSR1))
+ {
+ if (c->c1.status_output_owned && c->c1.status_output)
+ {
+ status_close (c->c1.status_output);
+ c->c1.status_output = NULL;
+ c->c1.status_output_owned = false;
+ }
+ }
+}
+
+/*
+ * Handle ifconfig-pool persistance object.
+ */
+static void
+do_open_ifconfig_pool_persist (struct context *c)
+{
+#if P2MP_SERVER
+ if (!c->c1.ifconfig_pool_persist && c->options.ifconfig_pool_persist_filename)
+ {
+ c->c1.ifconfig_pool_persist = ifconfig_pool_persist_init (c->options.ifconfig_pool_persist_filename,
+ c->options.ifconfig_pool_persist_refresh_freq);
+ c->c1.ifconfig_pool_persist_owned = true;
+ }
+#endif
+}
+
+static void
+do_close_ifconfig_pool_persist (struct context *c)
+{
+#if P2MP_SERVER
+ if (!(c->sig->signal_received == SIGUSR1))
+ {
+ if (c->c1.ifconfig_pool_persist && c->c1.ifconfig_pool_persist_owned)
+ {
+ ifconfig_pool_persist_close (c->c1.ifconfig_pool_persist);
+ c->c1.ifconfig_pool_persist = NULL;
+ c->c1.ifconfig_pool_persist_owned = false;
+ }
+ }
+#endif
+}
+
+/*
+ * Inherit environmental variables
+ */
+
+static void
+do_inherit_env (struct context *c, const struct env_set *src)
+{
+ c->c2.es = env_set_create (NULL);
+ c->c2.es_owned = true;
+ env_set_inherit (c->c2.es, src);
+}
+
+static void
+do_env_set_destroy (struct context *c)
+{
+ if (c->c2.es && c->c2.es_owned)
+ {
+ env_set_destroy (c->c2.es);
+ c->c2.es = NULL;
+ c->c2.es_owned = false;
+ }
+}
+
+/*
+ * Fast I/O setup. Fast I/O is an optimization which only works
+ * if all of the following are true:
+ *
+ * (1) The platform is not Windows
+ * (2) --proto udp is enabled
+ * (3) --shaper is disabled
+ */
+static void
+do_setup_fast_io (struct context *c)
+{
+ if (c->options.fast_io)
+ {
+#ifdef WIN32
+ msg (M_INFO, "NOTE: --fast-io is disabled since we are running on Windows");
+#else
+ if (!proto_is_udp(c->options.ce.proto))
+ msg (M_INFO, "NOTE: --fast-io is disabled since we are not using UDP");
+ else
+ {
+#ifdef ENABLE_FEATURE_SHAPER
+ if (c->options.shaper)
+ msg (M_INFO, "NOTE: --fast-io is disabled since we are using --shaper");
+ else
+#endif
+ {
+ c->c2.fast_io = true;
+ }
+ }
+#endif
+ }
+}
+
+static void
+do_signal_on_tls_errors (struct context *c)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (c->options.tls_exit)
+ c->c2.tls_exit_signal = SIGTERM;
+ else
+ c->c2.tls_exit_signal = SIGUSR1;
+#endif
+}
+
+#ifdef ENABLE_PLUGIN
+
+void
+init_plugins (struct context *c)
+{
+ if (c->options.plugin_list && !c->plugins)
+ {
+ c->plugins = plugin_list_init (c->options.plugin_list);
+ c->plugins_owned = true;
+ }
+}
+
+void
+open_plugins (struct context *c, const bool import_options, int init_point)
+{
+ if (c->plugins && c->plugins_owned)
+ {
+ if (import_options)
+ {
+ struct plugin_return pr, config;
+ plugin_return_init (&pr);
+ plugin_list_open (c->plugins, c->options.plugin_list, &pr, c->c2.es, init_point);
+ plugin_return_get_column (&pr, &config, "config");
+ if (plugin_return_defined (&config))
+ {
+ int i;
+ for (i = 0; i < config.n; ++i)
+ {
+ unsigned int option_types_found = 0;
+ if (config.list[i] && config.list[i]->value)
+ options_string_import (&c->options,
+ config.list[i]->value,
+ D_IMPORT_ERRORS|M_OPTERR,
+ OPT_P_DEFAULT & ~OPT_P_PLUGIN,
+ &option_types_found,
+ c->es);
+ }
+ }
+ plugin_return_free (&pr);
+ }
+ else
+ {
+ plugin_list_open (c->plugins, c->options.plugin_list, NULL, c->c2.es, init_point);
+ }
+ }
+}
+
+static void
+do_close_plugins (struct context *c)
+{
+ if (c->plugins && c->plugins_owned && !(c->sig->signal_received == SIGUSR1))
+ {
+ plugin_list_close (c->plugins);
+ c->plugins = NULL;
+ c->plugins_owned = false;
+ }
+}
+
+static void
+do_inherit_plugins (struct context *c, const struct context *src)
+{
+ if (!c->plugins && src->plugins)
+ {
+ c->plugins = plugin_list_inherit (src->plugins);
+ c->plugins_owned = true;
+ }
+}
+
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+
+static void
+management_callback_status_p2p (void *arg, const int version, struct status_output *so)
+{
+ struct context *c = (struct context *) arg;
+ print_status (c, so);
+}
+
+void
+management_show_net_callback (void *arg, const int msglevel)
+{
+#ifdef WIN32
+ show_routes (msglevel);
+ show_adapters (msglevel);
+ msg (msglevel, "END");
+#else
+ msg (msglevel, "ERROR: Sorry, this command is currently only implemented on Windows");
+#endif
+}
+
+#ifdef TARGET_ANDROID
+int
+managmenet_callback_network_change (void *arg)
+{
+ int socketfd=-1;
+ struct context *c = (struct context *) arg;
+ if (!c->c2.link_socket)
+ return -1;
+ if (c->c2.link_socket->sd == SOCKET_UNDEFINED)
+ return -1;
+
+ /* Check if the client should translate the network change to a SIGUSR1 to
+ reestablish the connection or just reprotect the socket */
+
+ /* At the moment just assume that, for all settings that use pull
+ reestablishing the connection is required */
+
+ socketfd = c->c2.link_socket->sd;
+ if (!c->options.pull || c->c2.tls_multi->use_session_id)
+ return socketfd;
+ else
+ return -2;
+}
+#endif
+
+#endif
+
+void
+init_management_callback_p2p (struct context *c)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ struct management_callback cb;
+ CLEAR (cb);
+ cb.arg = c;
+ cb.status = management_callback_status_p2p;
+ cb.show_net = management_show_net_callback;
+ cb.proxy_cmd = management_callback_proxy_cmd;
+ cb.remote_cmd = management_callback_remote_cmd;
+#ifdef TARGET_ANDROID
+ cb.network_change = managmenet_callback_network_change;
+#endif
+ management_set_callback (management, &cb);
+ }
+#endif
+}
+
+#ifdef ENABLE_MANAGEMENT
+
+void
+init_management (struct context *c)
+{
+ if (!management)
+ management = management_init ();
+}
+
+bool
+open_management (struct context *c)
+{
+ /* initialize management layer */
+ if (management)
+ {
+ if (c->options.management_addr)
+ {
+ unsigned int flags = c->options.management_flags;
+ if (c->options.mode == MODE_SERVER)
+ flags |= MF_SERVER;
+ if (management_open (management,
+ c->options.management_addr,
+ c->options.management_port,
+ c->options.management_user_pass,
+ c->options.management_client_user,
+ c->options.management_client_group,
+ c->options.management_log_history_cache,
+ c->options.management_echo_buffer_size,
+ c->options.management_state_buffer_size,
+ c->options.management_write_peer_info_file,
+ c->options.remap_sigusr1,
+ flags))
+ {
+ management_set_state (management,
+ OPENVPN_STATE_CONNECTING,
+ NULL,
+ (in_addr_t)0,
+ (in_addr_t)0);
+ }
+
+ /* initial management hold, called early, before first context initialization */
+ do_hold (c);
+ if (IS_SIG (c))
+ {
+ msg (M_WARN, "Signal received from management interface, exiting");
+ return false;
+ }
+ }
+ else
+ close_management ();
+ }
+ return true;
+}
+
+void
+close_management (void)
+{
+ if (management)
+ {
+ management_close (management);
+ management = NULL;
+ }
+}
+
+#endif
+
+
+void
+uninit_management_callback (void)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_clear_callback (management);
+ }
+#endif
+}
+
+/*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals (struct context *c, const struct env_set *env, const unsigned int flags)
+{
+ pre_init_signal_catch ();
+ init_instance (c, env, flags);
+ post_init_signal_catch ();
+
+ /*
+ * This is done so that signals thrown during
+ * initialization can bring us back to
+ * a management hold.
+ */
+ if (IS_SIG (c))
+ {
+ remap_signal (c);
+ uninit_management_callback ();
+ }
+}
+
+/*
+ * Initialize a tunnel instance.
+ */
+void
+init_instance (struct context *c, const struct env_set *env, const unsigned int flags)
+{
+ const struct options *options = &c->options;
+ const bool child = (c->mode == CM_CHILD_TCP || c->mode == CM_CHILD_UDP);
+ int link_socket_mode = LS_MODE_DEFAULT;
+
+ /* init garbage collection level */
+ gc_init (&c->c2.gc);
+
+ /* inherit environmental variables */
+ if (env)
+ do_inherit_env (c, env);
+
+ /* signals caught here will abort */
+ c->sig->signal_received = 0;
+ c->sig->signal_text = NULL;
+ c->sig->source = SIG_SOURCE_SOFT;
+
+ if (c->mode == CM_P2P)
+ init_management_callback_p2p (c);
+
+ /* possible sleep or management hold if restart */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ {
+ do_startup_pause (c);
+ if (IS_SIG (c))
+ goto sig;
+ }
+
+ if (c->options.resolve_in_advance)
+ {
+ do_preresolve (c);
+ if (IS_SIG (c))
+ goto sig;
+ }
+
+ /* map in current connection entry */
+ next_connection_entry (c);
+
+ /* link_socket_mode allows CM_CHILD_TCP
+ instances to inherit acceptable fds
+ from a top-level parent */
+ if (c->options.ce.proto == PROTO_TCP_SERVER)
+ {
+ if (c->mode == CM_TOP)
+ link_socket_mode = LS_MODE_TCP_LISTEN;
+ else if (c->mode == CM_CHILD_TCP)
+ link_socket_mode = LS_MODE_TCP_ACCEPT_FROM;
+ }
+
+ /* should we disable paging? */
+ if (c->first_time && options->mlock)
+ platform_mlockall (true);
+
+#if P2MP
+ /* get passwords if undefined */
+ if (auth_retry_get () == AR_INTERACT)
+ init_query_passwords (c);
+#endif
+
+ /* initialize context level 2 --verb/--mute parms */
+ init_verb_mute (c, IVM_LEVEL_2);
+
+ /* set error message delay for non-server modes */
+ if (c->mode == CM_P2P)
+ set_check_status_error_delay (P2P_ERROR_DELAY_MS);
+
+ /* warn about inconsistent options */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ do_option_warnings (c);
+
+#ifdef ENABLE_PLUGIN
+ /* initialize plugins */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ open_plugins (c, false, OPENVPN_PLUGIN_INIT_PRE_DAEMON);
+#endif
+
+ /* should we enable fast I/O? */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ do_setup_fast_io (c);
+
+ /* should we throw a signal on TLS errors? */
+ do_signal_on_tls_errors (c);
+
+ /* open --status file */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ do_open_status_output (c);
+
+ /* open --ifconfig-pool-persist file */
+ if (c->mode == CM_TOP)
+ do_open_ifconfig_pool_persist (c);
+
+#ifdef ENABLE_OCC
+ /* reset OCC state */
+ if (c->mode == CM_P2P || child)
+ c->c2.occ_op = occ_reset_op ();
+#endif
+
+ /* our wait-for-i/o objects, different for posix vs. win32 */
+ if (c->mode == CM_P2P)
+ do_event_set_init (c, SHAPER_DEFINED (&c->options));
+ else if (c->mode == CM_CHILD_TCP)
+ do_event_set_init (c, false);
+
+ /* initialize HTTP or SOCKS proxy object at scope level 2 */
+ init_proxy (c);
+
+ /* allocate our socket object */
+ if (c->mode == CM_P2P || c->mode == CM_TOP || c->mode == CM_CHILD_TCP)
+ do_link_socket_new (c);
+
+#ifdef ENABLE_FRAGMENT
+ /* initialize internal fragmentation object */
+ if (options->ce.fragment && (c->mode == CM_P2P || child))
+ c->c2.fragment = fragment_init (&c->c2.frame);
+#endif
+
+ /* init crypto layer */
+ {
+ unsigned int crypto_flags = 0;
+ if (c->mode == CM_TOP)
+ crypto_flags = CF_INIT_TLS_AUTH_STANDALONE;
+ else if (c->mode == CM_P2P)
+ crypto_flags = CF_LOAD_PERSISTED_PACKET_ID | CF_INIT_TLS_MULTI;
+ else if (child)
+ crypto_flags = CF_INIT_TLS_MULTI;
+ do_init_crypto (c, crypto_flags);
+ if (IS_SIG (c) && !child)
+ goto sig;
+ }
+
+#ifdef USE_COMP
+ /* initialize compression library. */
+ if (comp_enabled(&options->comp) && (c->mode == CM_P2P || child))
+ c->c2.comp_context = comp_init (&options->comp);
+#endif
+
+ /* initialize MTU variables */
+ do_init_frame (c);
+
+ /* initialize TLS MTU variables */
+ do_init_frame_tls (c);
+
+ /* init workspace buffers whose size is derived from frame size */
+ if (c->mode == CM_P2P || c->mode == CM_CHILD_TCP)
+ do_init_buffers (c);
+
+#ifdef ENABLE_FRAGMENT
+ /* initialize internal fragmentation capability with known frame size */
+ if (options->ce.fragment && (c->mode == CM_P2P || child))
+ do_init_fragment (c);
+#endif
+
+ /* initialize dynamic MTU variable */
+ do_init_mssfix (c);
+
+ /* bind the TCP/UDP socket */
+ if (c->mode == CM_P2P || c->mode == CM_TOP || c->mode == CM_CHILD_TCP)
+ do_init_socket_1 (c, link_socket_mode);
+
+ /* initialize tun/tap device object,
+ open tun/tap device, ifconfig, run up script, etc. */
+ if (!(options->up_delay || PULL_DEFINED (options)) && (c->mode == CM_P2P || c->mode == CM_TOP))
+ c->c2.did_open_tun = do_open_tun (c);
+
+ /* print MTU info */
+ do_print_data_channel_mtu_parms (c);
+
+#ifdef ENABLE_OCC
+ /* get local and remote options compatibility strings */
+ if (c->mode == CM_P2P || child)
+ do_compute_occ_strings (c);
+#endif
+
+ /* initialize output speed limiter */
+ if (c->mode == CM_P2P)
+ do_init_traffic_shaper (c);
+
+ /* do one-time inits, and possibily become a daemon here */
+ do_init_first_time (c);
+
+#ifdef ENABLE_PLUGIN
+ /* initialize plugins */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ open_plugins (c, false, OPENVPN_PLUGIN_INIT_POST_DAEMON);
+#endif
+
+ /*
+ * Actually do UID/GID downgrade, and chroot, if requested.
+ * May be delayed by --client, --pull, or --up-delay.
+ */
+ do_uid_gid_chroot (c, c->c2.did_open_tun);
+
+ /* finalize the TCP/UDP socket */
+ if (c->mode == CM_P2P || c->mode == CM_TOP || c->mode == CM_CHILD_TCP)
+ do_init_socket_2 (c);
+
+ /* initialize timers */
+ if (c->mode == CM_P2P || child)
+ do_init_timers (c, false);
+
+#ifdef ENABLE_PLUGIN
+ /* initialize plugins */
+ if (c->mode == CM_P2P || c->mode == CM_TOP)
+ open_plugins (c, false, OPENVPN_PLUGIN_INIT_POST_UID_CHANGE);
+#endif
+
+#if PORT_SHARE
+ /* share OpenVPN port with foreign (such as HTTPS) server */
+ if (c->first_time && (c->mode == CM_P2P || c->mode == CM_TOP))
+ init_port_share (c);
+#endif
+
+#ifdef ENABLE_PF
+ if (child)
+ pf_init_context (c);
+#endif
+
+ /* Check for signals */
+ if (IS_SIG (c))
+ goto sig;
+
+ return;
+
+ sig:
+ if (!c->sig->signal_text)
+ c->sig->signal_text = "init_instance";
+ close_context (c, -1, flags);
+ return;
+}
+
+/*
+ * Close a tunnel instance.
+ */
+void
+close_instance (struct context *c)
+{
+ /* close event objects */
+ do_close_event_set (c);
+
+ if (c->mode == CM_P2P
+ || c->mode == CM_CHILD_TCP
+ || c->mode == CM_CHILD_UDP
+ || c->mode == CM_TOP)
+ {
+ /* if xinetd/inetd mode, don't allow restart */
+ do_close_check_if_restart_permitted (c);
+
+#ifdef USE_COMP
+ if (c->c2.comp_context)
+ {
+ comp_uninit (c->c2.comp_context);
+ c->c2.comp_context = NULL;
+ }
+#endif
+
+ /* free buffers */
+ do_close_free_buf (c);
+
+ /* close TLS */
+ do_close_tls (c);
+
+ /* free key schedules */
+ do_close_free_key_schedule (c, (c->mode == CM_P2P || c->mode == CM_TOP));
+
+ /* close TCP/UDP connection */
+ do_close_link_socket (c);
+
+ /* close TUN/TAP device */
+ do_close_tun (c, false);
+
+#ifdef MANAGEMENT_DEF_AUTH
+ if (management)
+ management_notify_client_close (management, &c->c2.mda_context, NULL);
+#endif
+
+#ifdef ENABLE_PF
+ pf_destroy_context (&c->c2.pf);
+#endif
+
+#ifdef ENABLE_PLUGIN
+ /* call plugin close functions and unload */
+ do_close_plugins (c);
+#endif
+
+ /* close packet-id persistance file */
+ do_close_packet_id (c);
+
+ /* close --status file */
+ do_close_status_output (c);
+
+#ifdef ENABLE_FRAGMENT
+ /* close fragmentation handler */
+ do_close_fragment (c);
+#endif
+
+ /* close --ifconfig-pool-persist obj */
+ do_close_ifconfig_pool_persist (c);
+
+ /* free up environmental variable store */
+ do_env_set_destroy (c);
+
+ /* close HTTP or SOCKS proxy */
+ uninit_proxy (c);
+
+ /* garbage collect */
+ gc_free (&c->c2.gc);
+ }
+}
+
+void
+inherit_context_child (struct context *dest,
+ const struct context *src)
+{
+ CLEAR (*dest);
+
+ /* proto_is_dgram will ASSERT(0) if proto is invalid */
+ dest->mode = proto_is_dgram(src->options.ce.proto)? CM_CHILD_UDP : CM_CHILD_TCP;
+
+ dest->gc = gc_new ();
+
+ ALLOC_OBJ_CLEAR_GC (dest->sig, struct signal_info, &dest->gc);
+
+ /* c1 init */
+ packet_id_persist_init (&dest->c1.pid_persist);
+
+#ifdef ENABLE_CRYPTO
+ dest->c1.ks.key_type = src->c1.ks.key_type;
+#ifdef ENABLE_SSL
+ /* inherit SSL context */
+ dest->c1.ks.ssl_ctx = src->c1.ks.ssl_ctx;
+ dest->c1.ks.tls_auth_key = src->c1.ks.tls_auth_key;
+#endif
+#endif
+
+ /* options */
+ dest->options = src->options;
+ options_detach (&dest->options);
+
+ if (dest->mode == CM_CHILD_TCP)
+ {
+ /*
+ * The CM_TOP context does the socket listen(),
+ * and the CM_CHILD_TCP context does the accept().
+ */
+ dest->c2.accept_from = src->c2.link_socket;
+ }
+
+#ifdef ENABLE_PLUGIN
+ /* inherit plugins */
+ do_inherit_plugins (dest, src);
+#endif
+
+ /* context init */
+ init_instance (dest, src->c2.es, CC_NO_CLOSE | CC_USR1_TO_HUP);
+ if (IS_SIG (dest))
+ return;
+
+ /* inherit tun/tap interface object */
+ dest->c1.tuntap = src->c1.tuntap;
+
+ /* UDP inherits some extra things which TCP does not */
+ if (dest->mode == CM_CHILD_UDP)
+ {
+ /* inherit buffers */
+ dest->c2.buffers = src->c2.buffers;
+
+ /* inherit parent link_socket and tuntap */
+ dest->c2.link_socket = src->c2.link_socket;
+
+ ALLOC_OBJ_GC (dest->c2.link_socket_info, struct link_socket_info, &dest->gc);
+ *dest->c2.link_socket_info = src->c2.link_socket->info;
+
+ /* locally override some link_socket_info fields */
+ dest->c2.link_socket_info->lsa = &dest->c1.link_socket_addr;
+ dest->c2.link_socket_info->connection_established = false;
+ }
+}
+
+void
+inherit_context_top (struct context *dest,
+ const struct context *src)
+{
+ /* copy parent */
+ *dest = *src;
+
+ /*
+ * CM_TOP_CLONE will prevent close_instance from freeing or closing
+ * resources owned by the parent.
+ *
+ * Also note that CM_TOP_CLONE context objects are
+ * closed by multi_top_free in multi.c.
+ */
+ dest->mode = CM_TOP_CLONE;
+
+ dest->first_time = false;
+ dest->c0 = NULL;
+
+ options_detach (&dest->options);
+ gc_detach (&dest->gc);
+ gc_detach (&dest->c2.gc);
+
+ /* detach plugins */
+ dest->plugins_owned = false;
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ dest->c2.tls_multi = NULL;
+#endif
+
+ /* detach c1 ownership */
+ dest->c1.tuntap_owned = false;
+ dest->c1.status_output_owned = false;
+#if P2MP_SERVER
+ dest->c1.ifconfig_pool_persist_owned = false;
+#endif
+
+ /* detach c2 ownership */
+ dest->c2.event_set_owned = false;
+ dest->c2.link_socket_owned = false;
+ dest->c2.buffers_owned = false;
+ dest->c2.es_owned = false;
+
+ dest->c2.event_set = NULL;
+ if (proto_is_dgram(src->options.ce.proto))
+ do_event_set_init (dest, false);
+
+#ifdef USE_COMP
+ dest->c2.comp_context = NULL;
+#endif
+}
+
+void
+close_context (struct context *c, int sig, unsigned int flags)
+{
+ ASSERT (c);
+ ASSERT (c->sig);
+
+ if (sig >= 0)
+ c->sig->signal_received = sig;
+
+ if (c->sig->signal_received == SIGUSR1)
+ {
+ if ((flags & CC_USR1_TO_HUP)
+ || (c->sig->source == SIG_SOURCE_HARD && (flags & CC_HARD_USR1_TO_HUP)))
+ {
+ c->sig->signal_received = SIGHUP;
+ c->sig->signal_text = "close_context usr1 to hup";
+ }
+ }
+
+ if (!(flags & CC_NO_CLOSE))
+ close_instance (c);
+
+ if (flags & CC_GC_FREE)
+ context_gc_free (c);
+}
+
+#ifdef ENABLE_CRYPTO
+
+/*
+ * Do a loopback test
+ * on the crypto subsystem.
+ */
+static void *
+test_crypto_thread (void *arg)
+{
+ struct context *c = (struct context *) arg;
+ const struct options *options = &c->options;
+
+ ASSERT (options->test_crypto);
+ init_verb_mute (c, IVM_LEVEL_1);
+ context_init_1 (c);
+ next_connection_entry(c);
+ do_init_crypto_static (c, 0);
+
+ frame_finalize_options (c, options);
+
+ test_crypto (&c->c2.crypto_options, &c->c2.frame);
+
+ key_schedule_free (&c->c1.ks, true);
+ packet_id_free (&c->c2.packet_id);
+
+ context_gc_free (c);
+ return NULL;
+}
+
+#endif
+
+bool
+do_test_crypto (const struct options *o)
+{
+#ifdef ENABLE_CRYPTO
+ if (o->test_crypto)
+ {
+ struct context c;
+
+ /* print version number */
+ msg (M_INFO, "%s", title_string);
+
+ context_clear (&c);
+ c.options = *o;
+ options_detach (&c.options);
+ c.first_time = true;
+ test_crypto_thread ((void *) &c);
+ return true;
+ }
+#endif
+ return false;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/init.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/init.h
new file mode 100644
index 00000000..5a1d1dcf
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/init.h
@@ -0,0 +1,128 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef INIT_H
+#define INIT_H
+
+#include "openvpn.h"
+
+/*
+ * Baseline maximum number of events
+ * to wait for.
+ */
+#define BASE_N_EVENTS 4
+
+void context_clear (struct context *c);
+void context_clear_1 (struct context *c);
+void context_clear_2 (struct context *c);
+void context_init_1 (struct context *c);
+void context_clear_all_except_first_time (struct context *c);
+
+bool init_static (void);
+
+void uninit_static (void);
+
+#define IVM_LEVEL_1 (1<<0)
+#define IVM_LEVEL_2 (1<<1)
+void init_verb_mute (struct context *c, unsigned int flags);
+
+void init_options_dev (struct options *options);
+
+bool print_openssl_info (const struct options *options);
+
+bool do_genkey (const struct options *options);
+
+bool do_persist_tuntap (const struct options *options);
+
+void pre_setup (const struct options *options);
+
+void init_instance_handle_signals (struct context *c, const struct env_set *env, const unsigned int flags);
+
+void init_instance (struct context *c, const struct env_set *env, const unsigned int flags);
+
+void do_route (const struct options *options,
+ struct route_list *route_list,
+ struct route_ipv6_list *route_ipv6_list,
+ const struct tuntap *tt,
+ const struct plugin_list *plugins,
+ struct env_set *es);
+
+void close_instance (struct context *c);
+
+bool do_test_crypto (const struct options *o);
+
+void context_gc_free (struct context *c);
+
+void do_up (struct context *c,
+ bool pulled_options,
+ unsigned int option_types_found);
+
+unsigned int pull_permission_mask (const struct context *c);
+
+const char *format_common_name (struct context *c, struct gc_arena *gc);
+
+void reset_coarse_timers (struct context *c);
+
+void do_deferred_options (struct context *c, const unsigned int found);
+
+void inherit_context_child (struct context *dest,
+ const struct context *src);
+
+void inherit_context_top (struct context *dest,
+ const struct context *src);
+
+#define CC_GC_FREE (1<<0)
+#define CC_USR1_TO_HUP (1<<1)
+#define CC_HARD_USR1_TO_HUP (1<<2)
+#define CC_NO_CLOSE (1<<3)
+
+void close_context (struct context *c, int sig, unsigned int flags);
+
+struct context_buffers *init_context_buffers (const struct frame *frame);
+
+void free_context_buffers (struct context_buffers *b);
+
+#define ISC_ERRORS (1<<0)
+#define ISC_SERVER (1<<1)
+void initialization_sequence_completed (struct context *c, const unsigned int flags);
+
+#ifdef ENABLE_MANAGEMENT
+
+void init_management (struct context *c);
+bool open_management (struct context *c);
+void close_management (void);
+
+void management_show_net_callback (void *arg, const int msglevel);
+
+#endif
+
+void init_management_callback_p2p (struct context *c);
+void uninit_management_callback (void);
+
+#ifdef ENABLE_PLUGIN
+void init_plugins (struct context *c);
+void open_plugins (struct context *c, const bool import_options, int init_point);
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/integer.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/integer.h
new file mode 100644
index 00000000..f0fc196e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/integer.h
@@ -0,0 +1,114 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef INTEGER_H
+#define INTEGER_H
+
+#include "error.h"
+
+/*
+ * min/max functions
+ */
+
+static inline int
+max_int (int x, int y)
+{
+ if (x > y)
+ return x;
+ else
+ return y;
+}
+
+static inline int
+min_int (int x, int y)
+{
+ if (x < y)
+ return x;
+ else
+ return y;
+}
+
+static inline int
+constrain_int (int x, int min, int max)
+{
+ if (min > max)
+ return min;
+ if (x < min)
+ return min;
+ else if (x > max)
+ return max;
+ else
+ return x;
+}
+
+/*
+ * Functions used for circular buffer index arithmetic.
+ */
+
+/*
+ * Return x - y on a circle of circumference mod by shortest path.
+ *
+ * 0 <= x < mod
+ * 0 <= y < mod
+ */
+static inline int
+modulo_subtract(int x, int y, int mod)
+{
+ const int d1 = x - y;
+ const int d2 = (x > y ? -mod : mod) + d1;
+ ASSERT (0 <= x && x < mod && 0 <= y && y < mod);
+ return abs(d1) > abs(d2) ? d2 : d1;
+}
+
+/*
+ * Return x + y on a circle of circumference mod.
+ *
+ * 0 <= x < mod
+ * -mod <= y <= mod
+ */
+static inline int
+modulo_add(int x, int y, int mod)
+{
+ int sum = x + y;
+ ASSERT (0 <= x && x < mod && -mod <= y && y <= mod);
+ if (sum >= mod)
+ sum -= mod;
+ if (sum < 0)
+ sum += mod;
+ return sum;
+}
+
+static inline int
+index_verify (int index, int size, const char *file, int line)
+{
+ if (index < 0 || index >= size)
+ msg (M_FATAL, "Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d",
+ index,
+ size,
+ file,
+ line);
+ return index;
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.c
new file mode 100644
index 00000000..64494f1b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.c
@@ -0,0 +1,83 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "interval.h"
+
+#include "memdbg.h"
+
+void
+interval_init (struct interval *top, int horizon, int refresh)
+{
+ CLEAR (*top);
+ top->refresh = refresh;
+ top->horizon = horizon;
+}
+
+bool
+event_timeout_trigger (struct event_timeout *et,
+ struct timeval *tv,
+ const int et_const_retry)
+{
+ bool ret = false;
+ const time_t local_now = now;
+
+ if (et->defined)
+ {
+ int wakeup = (int) et->last + et->n - local_now;
+ if (wakeup <= 0)
+ {
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "EVENT event_timeout_trigger (%d) etcr=%d", et->n, et_const_retry);
+#endif
+ if (et_const_retry < 0)
+ {
+ et->last = local_now;
+ wakeup = et->n;
+ ret = true;
+ }
+ else
+ {
+ wakeup = et_const_retry;
+ }
+ }
+
+ if (tv && wakeup < tv->tv_sec)
+ {
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "EVENT event_timeout_wakeup (%d/%d) etcr=%d", wakeup, et->n, et_const_retry);
+#endif
+ tv->tv_sec = wakeup;
+ tv->tv_usec = 0;
+ }
+ }
+ return ret;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.h
new file mode 100644
index 00000000..4814ec92
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/interval.h
@@ -0,0 +1,247 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * The interval_ routines are designed to optimize the calling of a routine
+ * (normally tls_multi_process()) which can be called less frequently
+ * between triggers.
+ */
+
+#ifndef INTERVAL_H
+#define INTERVAL_H
+
+#include "otime.h"
+
+#define INTERVAL_DEBUG 0
+
+/*
+ * Designed to limit calls to expensive functions that need to be called
+ * regularly.
+ */
+
+struct interval
+{
+ interval_t refresh;
+ interval_t horizon;
+ time_t future_trigger;
+ time_t last_action;
+ time_t last_test_true;
+};
+
+void interval_init (struct interval *top, int horizon, int refresh);
+
+/*
+ * IF
+ * last_action less than horizon seconds ago
+ * OR last_test_true more than refresh seconds ago
+ * OR hit future_trigger
+ * THEN
+ * return true
+ * ELSE
+ * set wakeup to the number of seconds until a true return
+ * return false
+ */
+
+static inline bool
+interval_test (struct interval* top)
+{
+ bool trigger = false;
+ const time_t local_now = now;
+
+ if (top->future_trigger && local_now >= top->future_trigger)
+ {
+ trigger = true;
+ top->future_trigger = 0;
+ }
+
+ if (top->last_action + top->horizon > local_now ||
+ top->last_test_true + top->refresh <= local_now ||
+ trigger)
+ {
+ top->last_test_true = local_now;
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "INTERVAL interval_test true");
+#endif
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+static inline void
+interval_schedule_wakeup (struct interval* top, interval_t *wakeup)
+{
+ const time_t local_now = now;
+ interval_earliest_wakeup (wakeup, top->last_test_true + top->refresh, local_now);
+ interval_earliest_wakeup (wakeup, top->future_trigger, local_now);
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "INTERVAL interval_schedule wakeup=%d", (int)*wakeup);
+#endif
+}
+
+/*
+ * In wakeup seconds, interval_test will return true once.
+ */
+static inline void
+interval_future_trigger (struct interval* top, interval_t wakeup) {
+ if (wakeup)
+ {
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "INTERVAL interval_future_trigger %d", (int)wakeup);
+#endif
+ top->future_trigger = now + wakeup;
+ }
+}
+
+/*
+ * Once an action is triggered, interval_test will remain true for
+ * horizon seconds.
+ */
+static inline void
+interval_action (struct interval* top)
+{
+#if INTERVAL_DEBUG
+ dmsg (D_INTERVAL, "INTERVAL action");
+#endif
+ top->last_action = now;
+}
+
+/*
+ * Measure when n seconds beyond an event have elapsed
+ */
+
+struct event_timeout
+{
+ bool defined;
+ interval_t n;
+ time_t last; /* time of last event */
+};
+
+static inline bool
+event_timeout_defined (const struct event_timeout* et)
+{
+ return et->defined;
+}
+
+static inline void
+event_timeout_clear (struct event_timeout* et)
+{
+ et->defined = false;
+ et->n = 0;
+ et->last = 0;
+}
+
+static inline struct event_timeout
+event_timeout_clear_ret ()
+{
+ struct event_timeout ret;
+ event_timeout_clear (&ret);
+ return ret;
+}
+
+static inline void
+event_timeout_init (struct event_timeout* et, interval_t n, const time_t local_now)
+{
+ et->defined = true;
+ et->n = (n >= 0) ? n : 0;
+ et->last = local_now;
+}
+
+static inline void
+event_timeout_reset (struct event_timeout* et)
+{
+ if (et->defined)
+ et->last = now;
+}
+
+static inline void
+event_timeout_modify_wakeup (struct event_timeout* et, interval_t n)
+{
+ /* note that you might need to call reset_coarse_timers after this */
+ if (et->defined)
+ et->n = (n >= 0) ? n : 0;
+}
+
+/*
+ * This is the principal function for testing and triggering recurring
+ * timers and will return true on a timer signal event.
+ * If et_const_retry == ETT_DEFAULT and a signal occurs,
+ * the function will return true and *et will be armed for the
+ * next event. If et_const_retry >= 0 and a signal occurs,
+ * *et will not be touched, but *tv will be set to
+ * minimum (*tv, et_const_retry) for a future re-test,
+ * and the function will return true.
+ */
+
+#define ETT_DEFAULT (-1)
+
+bool event_timeout_trigger (struct event_timeout *et,
+ struct timeval *tv,
+ const int et_const_retry);
+
+/*
+ * Measure time intervals in microseconds
+ */
+
+#define USEC_TIMER_MAX 60 /* maximum interval size in seconds */
+
+#define USEC_TIMER_MAX_USEC (USEC_TIMER_MAX * 1000000)
+
+struct usec_timer {
+ struct timeval start;
+ struct timeval end;
+};
+
+#ifdef HAVE_GETTIMEOFDAY
+
+static inline void
+usec_timer_start (struct usec_timer *obj)
+{
+ CLEAR (*obj);
+ openvpn_gettimeofday (&obj->start, NULL);
+}
+
+static inline void
+usec_timer_end (struct usec_timer *obj)
+{
+ openvpn_gettimeofday (&obj->end, NULL);
+}
+
+#endif /* HAVE_GETTIMEOFDAY */
+
+static inline bool
+usec_timer_interval_defined (struct usec_timer *obj)
+{
+ return obj->start.tv_sec && obj->end.tv_sec;
+}
+
+static inline int
+usec_timer_interval (struct usec_timer *obj)
+{
+ return tv_subtract (&obj->end, &obj->start, USEC_TIMER_MAX);
+}
+
+#endif /* INTERVAL_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/list.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/list.c
new file mode 100644
index 00000000..ea6bd74b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/list.c
@@ -0,0 +1,649 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "list.h"
+#include "misc.h"
+
+#include "memdbg.h"
+
+struct hash *
+hash_init (const int n_buckets,
+ const uint32_t iv,
+ uint32_t (*hash_function)(const void *key, uint32_t iv),
+ bool (*compare_function)(const void *key1, const void *key2))
+{
+ struct hash *h;
+ int i;
+
+ ASSERT (n_buckets > 0);
+ ALLOC_OBJ_CLEAR (h, struct hash);
+ h->n_buckets = (int) adjust_power_of_2 (n_buckets);
+ h->mask = h->n_buckets - 1;
+ h->hash_function = hash_function;
+ h->compare_function = compare_function;
+ h->iv = iv;
+ ALLOC_ARRAY (h->buckets, struct hash_bucket, h->n_buckets);
+ for (i = 0; i < h->n_buckets; ++i)
+ {
+ struct hash_bucket *b = &h->buckets[i];
+ b->list = NULL;
+ }
+ return h;
+}
+
+void
+hash_free (struct hash *hash)
+{
+ int i;
+ for (i = 0; i < hash->n_buckets; ++i)
+ {
+ struct hash_bucket *b = &hash->buckets[i];
+ struct hash_element *he = b->list;
+
+ while (he)
+ {
+ struct hash_element *next = he->next;
+ free (he);
+ he = next;
+ }
+ }
+ free (hash->buckets);
+ free (hash);
+}
+
+struct hash_element *
+hash_lookup_fast (struct hash *hash,
+ struct hash_bucket *bucket,
+ const void *key,
+ uint32_t hv)
+{
+ struct hash_element *he;
+ struct hash_element *prev = NULL;
+
+ he = bucket->list;
+
+ while (he)
+ {
+ if (hv == he->hash_value && (*hash->compare_function)(key, he->key))
+ {
+ /* move to head of list */
+ if (prev)
+ {
+ prev->next = he->next;
+ he->next = bucket->list;
+ bucket->list = he;
+ }
+ return he;
+ }
+ prev = he;
+ he = he->next;
+ }
+
+ return NULL;
+}
+
+bool
+hash_remove_fast (struct hash *hash,
+ struct hash_bucket *bucket,
+ const void *key,
+ uint32_t hv)
+{
+ struct hash_element *he;
+ struct hash_element *prev = NULL;
+
+ he = bucket->list;
+
+ while (he)
+ {
+ if (hv == he->hash_value && (*hash->compare_function)(key, he->key))
+ {
+ if (prev)
+ prev->next = he->next;
+ else
+ bucket->list = he->next;
+ free (he);
+ --hash->n_elements;
+ return true;
+ }
+ prev = he;
+ he = he->next;
+ }
+ return false;
+}
+
+bool
+hash_add (struct hash *hash, const void *key, void *value, bool replace)
+{
+ uint32_t hv;
+ struct hash_bucket *bucket;
+ struct hash_element *he;
+ bool ret = false;
+
+ hv = hash_value (hash, key);
+ bucket = &hash->buckets[hv & hash->mask];
+
+ if ((he = hash_lookup_fast (hash, bucket, key, hv))) /* already exists? */
+ {
+ if (replace)
+ {
+ he->value = value;
+ ret = true;
+ }
+ }
+ else
+ {
+ hash_add_fast (hash, bucket, key, hv, value);
+ ret = true;
+ }
+
+ return ret;
+}
+
+void
+hash_remove_by_value (struct hash *hash, void *value)
+{
+ struct hash_iterator hi;
+ struct hash_element *he;
+
+ hash_iterator_init (hash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ if (he->value == value)
+ hash_iterator_delete_element (&hi);
+ }
+ hash_iterator_free (&hi);
+}
+
+static void
+hash_remove_marked (struct hash *hash, struct hash_bucket *bucket)
+{
+ struct hash_element *prev = NULL;
+ struct hash_element *he = bucket->list;
+
+ while (he)
+ {
+ if (!he->key) /* marked? */
+ {
+ struct hash_element *newhe;
+ if (prev)
+ newhe = prev->next = he->next;
+ else
+ newhe = bucket->list = he->next;
+ free (he);
+ --hash->n_elements;
+ he = newhe;
+ }
+ else
+ {
+ prev = he;
+ he = he->next;
+ }
+ }
+}
+
+uint32_t
+void_ptr_hash_function (const void *key, uint32_t iv)
+{
+ return hash_func ((const void *)&key, sizeof (key), iv);
+}
+
+bool
+void_ptr_compare_function (const void *key1, const void *key2)
+{
+ return key1 == key2;
+}
+
+void
+hash_iterator_init_range (struct hash *hash,
+ struct hash_iterator *hi,
+ int start_bucket,
+ int end_bucket)
+{
+ if (end_bucket > hash->n_buckets)
+ end_bucket = hash->n_buckets;
+
+ ASSERT (start_bucket >= 0 && start_bucket <= end_bucket);
+
+ hi->hash = hash;
+ hi->elem = NULL;
+ hi->bucket = NULL;
+ hi->last = NULL;
+ hi->bucket_marked = false;
+ hi->bucket_index_start = start_bucket;
+ hi->bucket_index_end = end_bucket;
+ hi->bucket_index = hi->bucket_index_start - 1;
+}
+
+void
+hash_iterator_init (struct hash *hash,
+ struct hash_iterator *hi)
+{
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
+}
+
+static inline void
+hash_iterator_lock (struct hash_iterator *hi, struct hash_bucket *b)
+{
+ hi->bucket = b;
+ hi->last = NULL;
+ hi->bucket_marked = false;
+}
+
+static inline void
+hash_iterator_unlock (struct hash_iterator *hi)
+{
+ if (hi->bucket)
+ {
+ if (hi->bucket_marked)
+ {
+ hash_remove_marked (hi->hash, hi->bucket);
+ hi->bucket_marked = false;
+ }
+ hi->bucket = NULL;
+ hi->last = NULL;
+ }
+}
+
+static inline void
+hash_iterator_advance (struct hash_iterator *hi)
+{
+ hi->last = hi->elem;
+ hi->elem = hi->elem->next;
+}
+
+void
+hash_iterator_free (struct hash_iterator *hi)
+{
+ hash_iterator_unlock (hi);
+}
+
+struct hash_element *
+hash_iterator_next (struct hash_iterator *hi)
+{
+ struct hash_element *ret = NULL;
+ if (hi->elem)
+ {
+ ret = hi->elem;
+ hash_iterator_advance (hi);
+ }
+ else
+ {
+ while (++hi->bucket_index < hi->bucket_index_end)
+ {
+ struct hash_bucket *b;
+ hash_iterator_unlock (hi);
+ b = &hi->hash->buckets[hi->bucket_index];
+ if (b->list)
+ {
+ hash_iterator_lock (hi, b);
+ hi->elem = b->list;
+ if (hi->elem)
+ {
+ ret = hi->elem;
+ hash_iterator_advance (hi);
+ break;
+ }
+ }
+ }
+ }
+ return ret;
+}
+
+void
+hash_iterator_delete_element (struct hash_iterator *hi)
+{
+ ASSERT (hi->last);
+ hi->last->key = NULL;
+ hi->bucket_marked = true;
+}
+
+
+#ifdef LIST_TEST
+
+/*
+ * Test the hash code by implementing a simple
+ * word frequency algorithm.
+ */
+
+struct word
+{
+ const char *word;
+ int n;
+};
+
+static uint32_t
+word_hash_function (const void *key, uint32_t iv)
+{
+ const char *str = (const char *) key;
+ const int len = strlen (str);
+ return hash_func ((const uint8_t *)str, len, iv);
+}
+
+static bool
+word_compare_function (const void *key1, const void *key2)
+{
+ return strcmp ((const char *)key1, (const char *)key2) == 0;
+}
+
+static void
+print_nhash (struct hash *hash)
+{
+ struct hash_iterator hi;
+ struct hash_element *he;
+ int count = 0;
+
+ hash_iterator_init (hash, &hi, true);
+
+ while ((he = hash_iterator_next (&hi)))
+ {
+ printf ("%d ", (int) he->value);
+ ++count;
+ }
+ printf ("\n");
+
+ hash_iterator_free (&hi);
+ ASSERT (count == hash_n_elements (hash));
+}
+
+static void
+rmhash (struct hash *hash, const char *word)
+{
+ hash_remove (hash, word);
+}
+
+void
+list_test (void)
+{
+ openvpn_thread_init ();
+
+ {
+ struct gc_arena gc = gc_new ();
+ struct hash *hash = hash_init (10000, get_random (), word_hash_function, word_compare_function);
+ struct hash *nhash = hash_init (256, get_random (), word_hash_function, word_compare_function);
+
+ printf ("hash_init n_buckets=%d mask=0x%08x\n", hash->n_buckets, hash->mask);
+
+ /* parse words from stdin */
+ while (true)
+ {
+ char buf[256];
+ char wordbuf[256];
+ int wbi;
+ int bi;
+ char c;
+
+ if (!fgets(buf, sizeof(buf), stdin))
+ break;
+
+ bi = wbi = 0;
+ do
+ {
+ c = buf[bi++];
+ if (isalnum (c) || c == '_')
+ {
+ ASSERT (wbi < (int) sizeof (wordbuf));
+ wordbuf[wbi++] = c;
+ }
+ else
+ {
+ if (wbi)
+ {
+ struct word *w;
+ ASSERT (wbi < (int) sizeof (wordbuf));
+ wordbuf[wbi++] = '\0';
+
+ /* word is parsed from stdin */
+
+ /* does it already exist in table? */
+ w = (struct word *) hash_lookup (hash, wordbuf);
+
+ if (w)
+ {
+ /* yes, increment count */
+ ++w->n;
+ }
+ else
+ {
+ /* no, make a new object */
+ ALLOC_OBJ_GC (w, struct word, &gc);
+ w->word = string_alloc (wordbuf, &gc);
+ w->n = 1;
+ ASSERT (hash_add (hash, w->word, w, false));
+ ASSERT (hash_add (nhash, w->word, (void*) ((random() & 0x0F) + 1), false));
+ }
+ }
+ wbi = 0;
+ }
+ } while (c);
+ }
+
+#if 1
+ /* remove some words from the table */
+ {
+ rmhash (hash, "true");
+ rmhash (hash, "false");
+ }
+#endif
+
+ /* output contents of hash table */
+ {
+ int base;
+ int inc = 0;
+ int count = 0;
+
+ for (base = 0; base < hash_n_buckets (hash); base += inc) {
+ struct hash_iterator hi;
+ struct hash_element *he;
+ inc = (get_random () % 3) + 1;
+ hash_iterator_init_range (hash, &hi, true, base, base + inc);
+
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct word *w = (struct word *) he->value;
+ printf ("%6d '%s'\n", w->n, w->word);
+ ++count;
+ }
+
+ hash_iterator_free (&hi);
+ }
+ ASSERT (count == hash_n_elements (hash));
+ }
+
+#if 1
+ /* test hash_remove_by_value function */
+ {
+ int i;
+ for (i = 1; i <= 16; ++i)
+ {
+ printf ("[%d] ***********************************\n", i);
+ print_nhash (nhash);
+ hash_remove_by_value (nhash, (void *) i, true);
+ }
+ printf ("FINAL **************************\n");
+ print_nhash (nhash);
+ }
+#endif
+
+ hash_free (hash);
+ hash_free (nhash);
+ gc_free (&gc);
+ }
+
+ openvpn_thread_cleanup ();
+}
+
+#endif
+
+/*
+--------------------------------------------------------------------
+hash() -- hash a variable-length key into a 32-bit value
+ k : the key (the unaligned variable-length array of bytes)
+ len : the length of the key, counting by bytes
+ level : can be any 4-byte value
+Returns a 32-bit value. Every bit of the key affects every bit of
+the return value. Every 1-bit and 2-bit delta achieves avalanche.
+About 36+6len instructions.
+
+The best hash table sizes are powers of 2. There is no need to do
+mod a prime (mod is sooo slow!). If you need less than 32 bits,
+use a bitmask. For example, if you need only 10 bits, do
+ h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (uint8_t **)k, do it like this:
+ for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
+
+By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this
+code any way you wish, private, educational, or commercial. It's free.
+
+See http://burlteburtle.net/bob/hash/evahash.html
+Use for hash table lookup, or anything where one collision in 2^32 is
+acceptable. Do NOT use for cryptographic purposes.
+
+--------------------------------------------------------------------
+
+mix -- mix 3 32-bit values reversibly.
+For every delta with one or two bit set, and the deltas of all three
+ high bits or all three low bits, whether the original value of a,b,c
+ is almost all zero or is uniformly distributed,
+* If mix() is run forward or backward, at least 32 bits in a,b,c
+ have at least 1/4 probability of changing.
+* If mix() is run forward, every bit of c will change between 1/3 and
+ 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
+mix() was built out of 36 single-cycle latency instructions in a
+ structure that could supported 2x parallelism, like so:
+ a -= b;
+ a -= c; x = (c>>13);
+ b -= c; a ^= x;
+ b -= a; x = (a<<8);
+ c -= a; b ^= x;
+ c -= b; x = (b>>13);
+ ...
+ Unfortunately, superscalar Pentiums and Sparcs can't take advantage
+ of that parallelism. They've also turned some of those single-cycle
+ latency instructions into multi-cycle latency instructions. Still,
+ this is the fastest good hash I could find. There were about 2^^68
+ to choose from. I only looked at a billion or so.
+
+James Yonan Notes:
+
+* This function is faster than it looks, and appears to be
+ appropriate for our usage in OpenVPN which is primarily
+ for hash-table based address lookup (IPv4, IPv6, and Ethernet MAC).
+ NOTE: This function is never used for cryptographic purposes, only
+ to produce evenly-distributed indexes into hash tables.
+
+* Benchmark results: 11.39 machine cycles per byte on a P2 266Mhz,
+ and 12.1 machine cycles per byte on a
+ 2.2 Ghz P4 when hashing a 6 byte string.
+--------------------------------------------------------------------
+*/
+
+#define mix(a,b,c) \
+{ \
+ a -= b; a -= c; a ^= (c>>13); \
+ b -= c; b -= a; b ^= (a<<8); \
+ c -= a; c -= b; c ^= (b>>13); \
+ a -= b; a -= c; a ^= (c>>12); \
+ b -= c; b -= a; b ^= (a<<16); \
+ c -= a; c -= b; c ^= (b>>5); \
+ a -= b; a -= c; a ^= (c>>3); \
+ b -= c; b -= a; b ^= (a<<10); \
+ c -= a; c -= b; c ^= (b>>15); \
+}
+
+uint32_t
+hash_func (const uint8_t *k, uint32_t length, uint32_t initval)
+{
+ uint32_t a, b, c, len;
+
+ /* Set up the internal state */
+ len = length;
+ a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
+ c = initval; /* the previous hash value */
+
+ /*---------------------------------------- handle most of the key */
+ while (len >= 12)
+ {
+ a += (k[0] + ((uint32_t) k[1] << 8)
+ + ((uint32_t) k[2] << 16)
+ + ((uint32_t) k[3] << 24));
+ b += (k[4] + ((uint32_t) k[5] << 8)
+ + ((uint32_t) k[6] << 16)
+ + ((uint32_t) k[7] << 24));
+ c += (k[8] + ((uint32_t) k[9] << 8)
+ + ((uint32_t) k[10] << 16)
+ + ((uint32_t) k[11] << 24));
+ mix (a, b, c);
+ k += 12;
+ len -= 12;
+ }
+
+ /*------------------------------------- handle the last 11 bytes */
+ c += length;
+ switch (len) /* all the case statements fall through */
+ {
+ case 11:
+ c += ((uint32_t) k[10] << 24);
+ case 10:
+ c += ((uint32_t) k[9] << 16);
+ case 9:
+ c += ((uint32_t) k[8] << 8);
+ /* the first byte of c is reserved for the length */
+ case 8:
+ b += ((uint32_t) k[7] << 24);
+ case 7:
+ b += ((uint32_t) k[6] << 16);
+ case 6:
+ b += ((uint32_t) k[5] << 8);
+ case 5:
+ b += k[4];
+ case 4:
+ a += ((uint32_t) k[3] << 24);
+ case 3:
+ a += ((uint32_t) k[2] << 16);
+ case 2:
+ a += ((uint32_t) k[1] << 8);
+ case 1:
+ a += k[0];
+ /* case 0: nothing left to add */
+ }
+ mix (a, b, c);
+ /*-------------------------------------- report the result */
+ return c;
+}
+
+#else
+static void dummy(void) {}
+#endif /* P2MP_SERVER */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/list.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/list.h
new file mode 100644
index 00000000..adde36b3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/list.h
@@ -0,0 +1,196 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef LIST_H
+#define LIST_H
+
+/*
+ * This code is a fairly straightforward hash
+ * table implementation using Bob Jenkins'
+ * hash function.
+ *
+ * Hash tables are used in OpenVPN to keep track of
+ * client instances over various key spaces.
+ */
+
+#if P2MP_SERVER
+
+/* define this to enable special list test mode */
+/*#define LIST_TEST*/
+
+#include "basic.h"
+#include "buffer.h"
+
+#define hashsize(n) ((uint32_t)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+
+struct hash_element
+{
+ void *value;
+ const void *key;
+ unsigned int hash_value;
+ struct hash_element *next;
+};
+
+struct hash_bucket
+{
+ struct hash_element *list;
+};
+
+struct hash
+{
+ int n_buckets;
+ int n_elements;
+ int mask;
+ uint32_t iv;
+ uint32_t (*hash_function)(const void *key, uint32_t iv);
+ bool (*compare_function)(const void *key1, const void *key2); /* return true if equal */
+ struct hash_bucket *buckets;
+};
+
+struct hash *hash_init (const int n_buckets,
+ const uint32_t iv,
+ uint32_t (*hash_function)(const void *key, uint32_t iv),
+ bool (*compare_function)(const void *key1, const void *key2));
+
+void hash_free (struct hash *hash);
+
+bool hash_add (struct hash *hash, const void *key, void *value, bool replace);
+
+struct hash_element *hash_lookup_fast (struct hash *hash,
+ struct hash_bucket *bucket,
+ const void *key,
+ uint32_t hv);
+
+bool hash_remove_fast (struct hash *hash,
+ struct hash_bucket *bucket,
+ const void *key,
+ uint32_t hv);
+
+void hash_remove_by_value (struct hash *hash, void *value);
+
+struct hash_iterator
+{
+ struct hash *hash;
+ int bucket_index;
+ struct hash_bucket *bucket;
+ struct hash_element *elem;
+ struct hash_element *last;
+ bool bucket_marked;
+ int bucket_index_start;
+ int bucket_index_end;
+};
+
+void hash_iterator_init_range (struct hash *hash,
+ struct hash_iterator *hi,
+ int start_bucket,
+ int end_bucket);
+
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
+struct hash_element *hash_iterator_next (struct hash_iterator *hi);
+void hash_iterator_delete_element (struct hash_iterator *hi);
+void hash_iterator_free (struct hash_iterator *hi);
+
+uint32_t hash_func (const uint8_t *k, uint32_t length, uint32_t initval);
+
+uint32_t void_ptr_hash_function (const void *key, uint32_t iv);
+bool void_ptr_compare_function (const void *key1, const void *key2);
+
+#ifdef LIST_TEST
+void list_test (void);
+#endif
+
+static inline uint32_t
+hash_value (const struct hash *hash, const void *key)
+{
+ return (*hash->hash_function)(key, hash->iv);
+}
+
+static inline int
+hash_n_elements (const struct hash *hash)
+{
+ return hash->n_elements;
+}
+
+static inline int
+hash_n_buckets (const struct hash *hash)
+{
+ return hash->n_buckets;
+}
+
+static inline struct hash_bucket *
+hash_bucket (struct hash *hash, uint32_t hv)
+{
+ return &hash->buckets[hv & hash->mask];
+}
+
+static inline void *
+hash_lookup (struct hash *hash, const void *key)
+{
+ void *ret = NULL;
+ struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
+ struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
+
+ he = hash_lookup_fast (hash, bucket, key, hv);
+ if (he)
+ ret = he->value;
+
+ return ret;
+}
+
+/* NOTE: assumes that key is not a duplicate */
+static inline void
+hash_add_fast (struct hash *hash,
+ struct hash_bucket *bucket,
+ const void *key,
+ uint32_t hv,
+ void *value)
+{
+ struct hash_element *he;
+
+ ALLOC_OBJ (he, struct hash_element);
+ he->value = value;
+ he->key = key;
+ he->hash_value = hv;
+ he->next = bucket->list;
+ bucket->list = he;
+ ++hash->n_elements;
+}
+
+static inline bool
+hash_remove (struct hash *hash, const void *key)
+{
+ uint32_t hv;
+ struct hash_bucket *bucket;
+ bool ret;
+
+ hv = hash_value (hash, key);
+ bucket = &hash->buckets[hv & hash->mask];
+ ret = hash_remove_fast (hash, bucket, key, hv);
+ return ret;
+}
+
+#endif /* P2MP_SERVER */
+#endif /* LIST */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.c
new file mode 100644
index 00000000..57f447b3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.c
@@ -0,0 +1,67 @@
+/*
+ * Support routine for configuring link layer address
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+#include "error.h"
+#include "misc.h"
+
+int set_lladdr(const char *ifname, const char *lladdr,
+ const struct env_set *es)
+{
+ struct argv argv = argv_new ();
+ int r;
+
+ if (!ifname || !lladdr)
+ return -1;
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ argv_printf (&argv,
+ "%s link set addr %s dev %s",
+ iproute_path, lladdr, ifname);
+#else
+ argv_printf (&argv,
+ "%s %s hw ether %s",
+ IFCONFIG_PATH,
+ ifname, lladdr);
+#endif
+#elif defined(TARGET_SOLARIS)
+ argv_printf (&argv,
+ "%s %s ether %s",
+ IFCONFIG_PATH,
+ ifname, lladdr);
+#elif defined(TARGET_OPENBSD)
+ argv_printf (&argv,
+ "%s %s lladdr %s",
+ IFCONFIG_PATH,
+ ifname, lladdr);
+#elif defined(TARGET_DARWIN)
+ argv_printf (&argv,
+ "%s %s lladdr %s",
+ IFCONFIG_PATH,
+ ifname, lladdr);
+#elif defined(TARGET_FREEBSD)
+ argv_printf (&argv,
+ "%s %s ether %s",
+ IFCONFIG_PATH,
+ ifname, lladdr);
+#else
+ msg (M_WARN, "Sorry, but I don't know how to configure link layer addresses on this operating system.");
+ return -1;
+#endif
+
+ argv_msg (M_INFO, &argv);
+ r = openvpn_execve_check (&argv, es, M_WARN, "ERROR: Unable to set link layer address.");
+ if (r)
+ msg (M_INFO, "TUN/TAP link layer address set to %s", lladdr);
+
+ argv_reset (&argv);
+ return r;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.h
new file mode 100644
index 00000000..d6c42562
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/lladdr.h
@@ -0,0 +1,8 @@
+/*
+ * Support routine for configuring link layer address
+ */
+
+#include "misc.h"
+
+int set_lladdr(const char *ifname, const char *lladdr,
+ const struct env_set *es);
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.c
new file mode 100644
index 00000000..daa02ed0
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.c
@@ -0,0 +1,258 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Data Channel Compression module function definitions.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_LZO)
+
+#include "comp.h"
+#include "error.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+/* Initial command byte to tell our peer if we compressed */
+#define LZO_COMPRESS_BYTE 0x66
+
+/**
+ * Perform adaptive compression housekeeping.
+ *
+ * @param ac the adaptive compression state structure.
+ *
+ * @return
+ */
+static bool
+lzo_adaptive_compress_test (struct lzo_adaptive_compress *ac)
+{
+ const bool save = ac->compress_state;
+ const time_t local_now = now;
+
+ if (!ac->compress_state)
+ {
+ if (local_now >= ac->next)
+ {
+ if (ac->n_total > AC_MIN_BYTES
+ && (ac->n_total - ac->n_comp) < (ac->n_total / (100 / AC_SAVE_PCT)))
+ {
+ ac->compress_state = true;
+ ac->next = local_now + AC_OFF_SEC;
+ }
+ else
+ {
+ ac->next = local_now + AC_SAMP_SEC;
+ }
+ dmsg (D_COMP, "lzo_adaptive_compress_test: comp=%d total=%d", ac->n_comp, ac->n_total);
+ ac->n_total = ac->n_comp = 0;
+ }
+ }
+ else
+ {
+ if (local_now >= ac->next)
+ {
+ ac->next = local_now + AC_SAMP_SEC;
+ ac->n_total = ac->n_comp = 0;
+ ac->compress_state = false;
+ }
+ }
+
+ if (ac->compress_state != save)
+ dmsg (D_COMP_LOW, "Adaptive compression state %s", (ac->compress_state ? "OFF" : "ON"));
+
+ return !ac->compress_state;
+}
+
+static inline void
+lzo_adaptive_compress_data (struct lzo_adaptive_compress *ac, int n_total, int n_comp)
+{
+ ac->n_total += n_total;
+ ac->n_comp += n_comp;
+}
+
+static void
+lzo_compress_init (struct compress_context *compctx)
+{
+ msg (D_INIT_MEDIUM, "LZO compression initializing");
+ ASSERT(!(compctx->flags & COMP_F_SWAP));
+ compctx->wu.lzo.wmem_size = LZO_WORKSPACE;
+ if (lzo_init () != LZO_E_OK)
+ msg (M_FATAL, "Cannot initialize LZO compression library");
+ compctx->wu.lzo.wmem = (lzo_voidp) lzo_malloc (compctx->wu.lzo.wmem_size);
+ check_malloc_return (compctx->wu.lzo.wmem);
+}
+
+static void
+lzo_compress_uninit (struct compress_context *compctx)
+{
+ lzo_free (compctx->wu.lzo.wmem);
+ compctx->wu.lzo.wmem = NULL;
+}
+
+static inline bool
+lzo_compression_enabled (struct compress_context *compctx)
+{
+ if (compctx->flags & COMP_F_ASYM)
+ return false;
+ else
+ {
+ if (compctx->flags & COMP_F_ADAPTIVE)
+ return lzo_adaptive_compress_test (&compctx->wu.lzo.ac);
+ else
+ return true;
+ }
+}
+
+static void
+lzo_compress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ lzo_uint zlen = 0;
+ int err;
+ bool compressed = false;
+
+ if (buf->len <= 0)
+ return;
+
+ /*
+ * In order to attempt compression, length must be at least COMPRESS_THRESHOLD,
+ * and our adaptive level must give the OK.
+ */
+ if (buf->len >= COMPRESS_THRESHOLD && lzo_compression_enabled (compctx))
+ {
+ const size_t ps = PAYLOAD_SIZE (frame);
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+ ASSERT (buf_safe (&work, ps + COMP_EXTRA_BUFFER (ps)));
+
+ if (buf->len > ps)
+ {
+ dmsg (D_COMP_ERRORS, "LZO compression buffer overflow");
+ buf->len = 0;
+ return;
+ }
+
+ err = LZO_COMPRESS (BPTR (buf), BLEN (buf), BPTR (&work), &zlen, compctx->wu.lzo.wmem);
+ if (err != LZO_E_OK)
+ {
+ dmsg (D_COMP_ERRORS, "LZO compression error: %d", err);
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, zlen));
+ work.len = zlen;
+ compressed = true;
+
+ dmsg (D_COMP, "LZO compress %d -> %d", buf->len, work.len);
+ compctx->pre_compress += buf->len;
+ compctx->post_compress += work.len;
+
+ /* tell adaptive level about our success or lack thereof in getting any size reduction */
+ if (compctx->flags & COMP_F_ADAPTIVE)
+ lzo_adaptive_compress_data (&compctx->wu.lzo.ac, buf->len, work.len);
+ }
+
+ /* did compression save us anything ? */
+ if (compressed && work.len < buf->len)
+ {
+ uint8_t *header = buf_prepend (&work, 1);
+ *header = LZO_COMPRESS_BYTE;
+ *buf = work;
+ }
+ else
+ {
+ uint8_t *header = buf_prepend (buf, 1);
+ *header = NO_COMPRESS_BYTE;
+ }
+}
+
+static void
+lzo_decompress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ lzo_uint zlen = EXPANDED_SIZE (frame);
+ int err;
+ uint8_t c; /* flag indicating whether or not our peer compressed */
+
+ if (buf->len <= 0)
+ return;
+
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+
+ c = *BPTR (buf);
+ ASSERT (buf_advance (buf, 1));
+
+ if (c == LZO_COMPRESS_BYTE) /* packet was compressed */
+ {
+ ASSERT (buf_safe (&work, zlen));
+ err = LZO_DECOMPRESS (BPTR (buf), BLEN (buf), BPTR (&work), &zlen,
+ compctx->wu.lzo.wmem);
+ if (err != LZO_E_OK)
+ {
+ dmsg (D_COMP_ERRORS, "LZO decompression error: %d", err);
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, zlen));
+ work.len = zlen;
+
+ dmsg (D_COMP, "LZO decompress %d -> %d", buf->len, work.len);
+ compctx->pre_decompress += buf->len;
+ compctx->post_decompress += work.len;
+
+ *buf = work;
+ }
+ else if (c == NO_COMPRESS_BYTE) /* packet was not compressed */
+ {
+ ;
+ }
+ else
+ {
+ dmsg (D_COMP_ERRORS, "Bad LZO decompression header byte: %d", c);
+ buf->len = 0;
+ }
+}
+
+const struct compress_alg lzo_alg = {
+ "lzo",
+ lzo_compress_init,
+ lzo_compress_uninit,
+ lzo_compress,
+ lzo_decompress
+};
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_LZO */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.h
new file mode 100644
index 00000000..f33e587a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/lzo.h
@@ -0,0 +1,131 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_LZO_H
+#define OPENVPN_LZO_H
+
+
+/**
+ * @file
+ * Data Channel Compression module header file.
+ */
+
+
+#if defined(ENABLE_LZO)
+
+/**
+ * @addtogroup compression
+ * @{
+ */
+
+#if defined(HAVE_LZO_LZOUTIL_H)
+#include "lzo/lzoutil.h"
+#elif defined(HAVE_LZOUTIL_H)
+#include "lzoutil.h"
+#endif
+#if defined(HAVE_LZO_LZO1X_H)
+#include "lzo/lzo1x.h"
+#elif defined(HAVE_LZO1X_H)
+#include "lzo1x.h"
+#endif
+
+#include "buffer.h"
+#include "mtu.h"
+#include "common.h"
+#include "status.h"
+
+extern const struct compress_alg lzo_alg;
+
+/**************************************************************************/
+/** @name LZO library interface defines *//** @{ *//***********************/
+#define LZO_COMPRESS lzo1x_1_15_compress
+ /**< LZO library compression function.
+ *
+ * Use \c lzo1x_1_15_compress because it
+ * is described as faster than the
+ * standard routine, although it does
+ * need a bit more memory. */
+#define LZO_WORKSPACE LZO1X_1_15_MEM_COMPRESS
+ /**< The size in bytes of the memory
+ * %buffer required by the LZO library
+ * compression algorithm. */
+#define LZO_DECOMPRESS lzo1x_decompress_safe
+ /**< LZO library decompression function.
+ *
+ * Use safe decompress because it
+ * includes checks for possible %buffer
+ * overflows. If speed is essential and
+ * you will always be using a MAC to
+ * verify the integrity of incoming
+ * packets, you might want to consider
+ * using the non-safe version. */
+/** @} name LZO library interface *//**************************************/
+
+
+/**************************************************************************/
+/** @name Adaptive compression defines *//** @{ *//************************/
+#define AC_SAMP_SEC 2 /**< Number of seconds in a sample period. */
+#define AC_MIN_BYTES 1000 /**< Minimum number of bytes a sample
+ * period must contain for it to be
+ * evaluated. */
+#define AC_SAVE_PCT 5 /**< Minimum size reduction percentage
+ * below which compression will be
+ * turned off. */
+#define AC_OFF_SEC 60 /**< Seconds to wait after compression has
+ * been turned off before retesting. */
+/** @} name Adaptive compression defines *//*******************************/
+
+/**
+ * Adaptive compression state.
+ */
+struct lzo_adaptive_compress {
+ bool compress_state;
+ time_t next;
+ int n_total;
+ int n_comp;
+};
+
+
+/**
+ * State for the compression and decompression routines.
+ *
+ * This structure contains compression module state, such as whether
+ * compression is enabled and the status of the adaptive compression
+ * routines. It also contains an allocated working buffer.
+ *
+ * One of these compression workspace structures is maintained for each
+ * VPN tunnel.
+ */
+struct lzo_compress_workspace
+{
+ lzo_voidp wmem;
+ int wmem_size;
+ struct lzo_adaptive_compress ac;
+};
+
+/** @} addtogroup compression */
+
+
+#endif /* ENABLE_LZO && USE_COMP */
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.c
new file mode 100644
index 00000000..9913197b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.c
@@ -0,0 +1,3466 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_MANAGEMENT
+
+#include "error.h"
+#include "fdmisc.h"
+#include "options.h"
+#include "sig.h"
+#include "event.h"
+#include "otime.h"
+#include "integer.h"
+#include "misc.h"
+#include "ssl.h"
+#include "common.h"
+#include "manage.h"
+
+#include "memdbg.h"
+
+#ifdef ENABLE_PKCS11
+#include "pkcs11.h"
+#endif
+
+#define MANAGEMENT_ECHO_PULL_INFO 0
+
+#if MANAGEMENT_ECHO_PULL_INFO
+#define MANAGEMENT_ECHO_FLAGS LOG_PRINT_INTVAL
+#else
+#define MANAGEMENT_ECHO_FLAGS 0
+#endif
+
+/* tag for blank username/password */
+static const char blank_up[] = "[[BLANK]]";
+
+struct management *management; /* GLOBAL */
+
+/* static forward declarations */
+static void man_output_standalone (struct management *man, volatile int *signal_received);
+static void man_reset_client_socket (struct management *man, const bool exiting);
+
+static void
+man_help ()
+{
+ msg (M_CLIENT, "Management Interface for %s", title_string);
+ msg (M_CLIENT, "Commands:");
+ msg (M_CLIENT, "auth-retry t : Auth failure retry mode (none,interact,nointeract).");
+ msg (M_CLIENT, "bytecount n : Show bytes in/out, update every n secs (0=off).");
+ msg (M_CLIENT, "echo [on|off] [N|all] : Like log, but only show messages in echo buffer.");
+ msg (M_CLIENT, "exit|quit : Close management session.");
+ msg (M_CLIENT, "forget-passwords : Forget passwords entered so far.");
+ msg (M_CLIENT, "help : Print this message.");
+ msg (M_CLIENT, "hold [on|off|release] : Set/show hold flag to on/off state, or");
+ msg (M_CLIENT, " release current hold and start tunnel.");
+ msg (M_CLIENT, "kill cn : Kill the client instance(s) having common name cn.");
+ msg (M_CLIENT, "kill IP:port : Kill the client instance connecting from IP:port.");
+ msg (M_CLIENT, "load-stats : Show global server load stats.");
+ msg (M_CLIENT, "log [on|off] [N|all] : Turn on/off realtime log display");
+ msg (M_CLIENT, " + show last N lines or 'all' for entire history.");
+ msg (M_CLIENT, "mute [n] : Set log mute level to n, or show level if n is absent.");
+ msg (M_CLIENT, "needok type action : Enter confirmation for NEED-OK request of 'type',");
+ msg (M_CLIENT, " where action = 'ok' or 'cancel'.");
+ msg (M_CLIENT, "needstr type action : Enter confirmation for NEED-STR request of 'type',");
+ msg (M_CLIENT, " where action is reply string.");
+ msg (M_CLIENT, "net : (Windows only) Show network info and routing table.");
+ msg (M_CLIENT, "password type p : Enter password p for a queried OpenVPN password.");
+ msg (M_CLIENT, "remote type [host port] : Override remote directive, type=ACCEPT|MOD|SKIP.");
+ msg (M_CLIENT, "proxy type [host port flags] : Enter dynamic proxy server info.");
+ msg (M_CLIENT, "pid : Show process ID of the current OpenVPN process.");
+#ifdef ENABLE_PKCS11
+ msg (M_CLIENT, "pkcs11-id-count : Get number of available PKCS#11 identities.");
+ msg (M_CLIENT, "pkcs11-id-get index : Get PKCS#11 identity at index.");
+#endif
+#ifdef MANAGEMENT_DEF_AUTH
+ msg (M_CLIENT, "client-auth CID KID : Authenticate client-id/key-id CID/KID (MULTILINE)");
+ msg (M_CLIENT, "client-auth-nt CID KID : Authenticate client-id/key-id CID/KID");
+ msg (M_CLIENT, "client-deny CID KID R [CR] : Deny auth client-id/key-id CID/KID with log reason");
+ msg (M_CLIENT, " text R and optional client reason text CR");
+ msg (M_CLIENT, "client-kill CID [M] : Kill client instance CID with message M (def=RESTART)");
+ msg (M_CLIENT, "env-filter [level] : Set env-var filter level");
+#ifdef MANAGEMENT_PF
+ msg (M_CLIENT, "client-pf CID : Define packet filter for client CID (MULTILINE)");
+#endif
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ msg (M_CLIENT, "rsa-sig : Enter an RSA signature in response to >RSA_SIGN challenge");
+ msg (M_CLIENT, " Enter signature base64 on subsequent lines followed by END");
+#endif
+ msg (M_CLIENT, "signal s : Send signal s to daemon,");
+ msg (M_CLIENT, " s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2.");
+ msg (M_CLIENT, "state [on|off] [N|all] : Like log, but show state history.");
+ msg (M_CLIENT, "status [n] : Show current daemon status info using format #n.");
+ msg (M_CLIENT, "test n : Produce n lines of output for testing/debugging.");
+ msg (M_CLIENT, "username type u : Enter username u for a queried OpenVPN username.");
+ msg (M_CLIENT, "verb [n] : Set log verbosity level to n, or show if n is absent.");
+ msg (M_CLIENT, "version : Show current version number.");
+ msg (M_CLIENT, "END");
+}
+
+static const char *
+man_state_name (const int state)
+{
+ switch (state)
+ {
+ case OPENVPN_STATE_INITIAL:
+ return "INITIAL";
+ case OPENVPN_STATE_CONNECTING:
+ return "CONNECTING";
+ case OPENVPN_STATE_WAIT:
+ return "WAIT";
+ case OPENVPN_STATE_AUTH:
+ return "AUTH";
+ case OPENVPN_STATE_GET_CONFIG:
+ return "GET_CONFIG";
+ case OPENVPN_STATE_ASSIGN_IP:
+ return "ASSIGN_IP";
+ case OPENVPN_STATE_ADD_ROUTES:
+ return "ADD_ROUTES";
+ case OPENVPN_STATE_CONNECTED:
+ return "CONNECTED";
+ case OPENVPN_STATE_RECONNECTING:
+ return "RECONNECTING";
+ case OPENVPN_STATE_EXITING:
+ return "EXITING";
+ case OPENVPN_STATE_RESOLVE:
+ return "RESOLVE";
+ case OPENVPN_STATE_TCP_CONNECT:
+ return "TCP_CONNECT";
+ default:
+ return "?";
+ }
+}
+
+static void
+man_welcome (struct management *man)
+{
+ msg (M_CLIENT, ">INFO:OpenVPN Management Interface Version %d -- type 'help' for more info",
+ MANAGEMENT_VERSION);
+ if (man->persist.special_state_msg)
+ msg (M_CLIENT, "%s", man->persist.special_state_msg);
+}
+
+static inline bool
+man_password_needed (struct management *man)
+{
+ return man->settings.up.defined && !man->connection.password_verified;
+}
+
+static void
+man_check_password (struct management *man, const char *line)
+{
+ if (man_password_needed (man))
+ {
+ if (streq (line, man->settings.up.password))
+ {
+ man->connection.password_verified = true;
+ msg (M_CLIENT, "SUCCESS: password is correct");
+ man_welcome (man);
+ }
+ else
+ {
+ man->connection.password_verified = false;
+ msg (M_CLIENT, "ERROR: bad password");
+ if (++man->connection.password_tries >= MANAGEMENT_N_PASSWORD_RETRIES)
+ {
+ msg (M_WARN, "MAN: client connection rejected after %d failed password attempts",
+ MANAGEMENT_N_PASSWORD_RETRIES);
+ man->connection.halt = true;
+ }
+ }
+ }
+}
+
+static void
+man_update_io_state (struct management *man)
+{
+ if (socket_defined (man->connection.sd_cli))
+ {
+ if (buffer_list_defined (man->connection.out))
+ {
+ man->connection.state = MS_CC_WAIT_WRITE;
+ }
+ else
+ {
+ man->connection.state = MS_CC_WAIT_READ;
+ }
+ }
+}
+
+static void
+man_output_list_push_finalize (struct management *man)
+{
+ if (management_connected (man))
+ {
+ man_update_io_state (man);
+ if (!man->persist.standalone_disabled)
+ {
+ volatile int signal_received = 0;
+ man_output_standalone (man, &signal_received);
+ }
+ }
+}
+
+static void
+man_output_list_push_str (struct management *man, const char *str)
+{
+ if (management_connected (man) && str)
+ {
+ buffer_list_push (man->connection.out, (const unsigned char *) str);
+ }
+}
+
+static void
+man_output_list_push (struct management *man, const char *str)
+{
+ man_output_list_push_str (man, str);
+ man_output_list_push_finalize (man);
+}
+
+static void
+man_prompt (struct management *man)
+{
+ if (man_password_needed (man))
+ man_output_list_push (man, "ENTER PASSWORD:");
+#if 0 /* should we use prompt? */
+ else
+ man_output_list_push (man, ">");
+#endif
+}
+
+static void
+man_delete_unix_socket (struct management *man)
+{
+#if UNIX_SOCK_SUPPORT
+ if ((man->settings.flags & (MF_UNIX_SOCK|MF_CONNECT_AS_CLIENT)) == MF_UNIX_SOCK)
+ socket_delete_unix (&man->settings.local_unix);
+#endif
+}
+
+static void
+man_close_socket (struct management *man, const socket_descriptor_t sd)
+{
+#ifndef WIN32
+ /*
+ * Windows doesn't need this because the ne32 event is permanently
+ * enabled at struct management scope.
+ */
+ if (man->persist.callback.delete_event)
+ (*man->persist.callback.delete_event) (man->persist.callback.arg, sd);
+#endif
+ openvpn_close_socket (sd);
+}
+
+static void
+virtual_output_callback_func (void *arg, const unsigned int flags, const char *str)
+{
+ struct management *man = (struct management *) arg;
+ static int recursive_level = 0; /* GLOBAL */
+
+# define AF_DID_PUSH (1<<0)
+# define AF_DID_RESET (1<<1)
+
+ if (!recursive_level) /* don't allow recursion */
+ {
+ struct gc_arena gc = gc_new ();
+ struct log_entry e;
+ const char *out = NULL;
+ unsigned int action_flags = 0;
+
+ ++recursive_level;
+
+ CLEAR (e);
+ update_time ();
+ e.timestamp = now;
+ e.u.msg_flags = flags;
+ e.string = str;
+
+ if (flags & M_FATAL)
+ man->persist.standalone_disabled = false;
+
+ if (flags != M_CLIENT)
+ log_history_add (man->persist.log, &e);
+
+ if (!man_password_needed (man))
+ {
+ if (flags == M_CLIENT)
+ out = log_entry_print (&e, LOG_PRINT_CRLF, &gc);
+ else if (man->connection.log_realtime)
+ out = log_entry_print (&e, LOG_PRINT_INT_DATE
+ | LOG_PRINT_MSG_FLAGS
+ | LOG_PRINT_LOG_PREFIX
+ | LOG_PRINT_CRLF, &gc);
+ if (out)
+ {
+ man_output_list_push_str (man, out);
+ action_flags |= AF_DID_PUSH;
+ }
+ if (flags & M_FATAL)
+ {
+ out = log_entry_print (&e, LOG_FATAL_NOTIFY|LOG_PRINT_CRLF, &gc);
+ if (out)
+ {
+ man_output_list_push_str (man, out);
+ action_flags |= (AF_DID_PUSH|AF_DID_RESET);
+ }
+ }
+ }
+
+ gc_free (&gc);
+
+ if (action_flags & AF_DID_PUSH)
+ man_output_list_push_finalize (man);
+ if (action_flags & AF_DID_RESET)
+ man_reset_client_socket (man, true);
+
+ --recursive_level;
+ }
+}
+
+/*
+ * Given a signal, return the signal with possible remapping applied,
+ * or -1 if the signal should be ignored.
+ */
+static int
+man_mod_signal (const struct management *man, const int signum)
+{
+ const unsigned int flags = man->settings.mansig;
+ int s = signum;
+ if (s == SIGUSR1)
+ {
+ if (flags & MANSIG_MAP_USR1_TO_HUP)
+ s = SIGHUP;
+ if (flags & MANSIG_MAP_USR1_TO_TERM)
+ s = SIGTERM;
+ }
+ if (flags & MANSIG_IGNORE_USR1_HUP)
+ {
+ if (s == SIGHUP || s == SIGUSR1)
+ s = -1;
+ }
+ return s;
+}
+
+static void
+man_signal (struct management *man, const char *name)
+{
+ const int sig = parse_signal (name);
+ if (sig >= 0)
+ {
+ const int sig_mod = man_mod_signal (man, sig);
+ if (sig_mod >= 0)
+ {
+ throw_signal (sig_mod);
+ msg (M_CLIENT, "SUCCESS: signal %s thrown", signal_name (sig_mod, true));
+ }
+ else
+ {
+ if (man->persist.special_state_msg)
+ msg (M_CLIENT, "%s", man->persist.special_state_msg);
+ else
+ msg (M_CLIENT, "ERROR: signal '%s' is currently ignored", name);
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: signal '%s' is not a known signal type", name);
+ }
+}
+
+static void
+man_status (struct management *man, const int version, struct status_output *so)
+{
+ if (man->persist.callback.status)
+ {
+ (*man->persist.callback.status) (man->persist.callback.arg, version, so);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The 'status' command is not supported by the current daemon mode");
+ }
+}
+
+static void
+man_bytecount (struct management *man, const int update_seconds)
+{
+ if (update_seconds >= 0)
+ man->connection.bytecount_update_seconds = update_seconds;
+ else
+ man->connection.bytecount_update_seconds = 0;
+ msg (M_CLIENT, "SUCCESS: bytecount interval changed");
+}
+
+void
+man_bytecount_output_client (struct management *man)
+{
+ char in[32];
+ char out[32];
+ /* do in a roundabout way to work around possible mingw or mingw-glibc bug */
+ openvpn_snprintf (in, sizeof (in), counter_format, man->persist.bytes_in);
+ openvpn_snprintf (out, sizeof (out), counter_format, man->persist.bytes_out);
+ msg (M_CLIENT, ">BYTECOUNT:%s,%s", in, out);
+ man->connection.bytecount_last_update = now;
+}
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+void
+man_bytecount_output_server (struct management *man,
+ const counter_type *bytes_in_total,
+ const counter_type *bytes_out_total,
+ struct man_def_auth_context *mdac)
+{
+ char in[32];
+ char out[32];
+ /* do in a roundabout way to work around possible mingw or mingw-glibc bug */
+ openvpn_snprintf (in, sizeof (in), counter_format, *bytes_in_total);
+ openvpn_snprintf (out, sizeof (out), counter_format, *bytes_out_total);
+ msg (M_CLIENT, ">BYTECOUNT_CLI:%lu,%s,%s", mdac->cid, in, out);
+ mdac->bytecount_last_update = now;
+}
+
+#endif
+
+static void
+man_kill (struct management *man, const char *victim)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (man->persist.callback.kill_by_cn && man->persist.callback.kill_by_addr)
+ {
+ struct buffer buf;
+ char p1[128];
+ char p2[128];
+ int n_killed;
+
+ buf_set_read (&buf, (uint8_t*) victim, strlen (victim) + 1);
+ buf_parse (&buf, ':', p1, sizeof (p1));
+ buf_parse (&buf, ':', p2, sizeof (p2));
+
+ if (strlen (p1) && strlen (p2))
+ {
+ /* IP:port specified */
+ bool status;
+ const in_addr_t addr = getaddr (GETADDR_HOST_ORDER|GETADDR_MSG_VIRT_OUT, p1, 0, &status, NULL);
+ if (status)
+ {
+ const int port = atoi (p2);
+ if (port > 0 && port < 65536)
+ {
+ n_killed = (*man->persist.callback.kill_by_addr) (man->persist.callback.arg, addr, port);
+ if (n_killed > 0)
+ {
+ msg (M_CLIENT, "SUCCESS: %d client(s) at address %s:%d killed",
+ n_killed,
+ print_in_addr_t (addr, 0, &gc),
+ port);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: client at address %s:%d not found",
+ print_in_addr_t (addr, 0, &gc),
+ port);
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: port number is out of range: %s", p2);
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: error parsing IP address: %s", p1);
+ }
+ }
+ else if (strlen (p1))
+ {
+ /* common name specified */
+ n_killed = (*man->persist.callback.kill_by_cn) (man->persist.callback.arg, p1);
+ if (n_killed > 0)
+ {
+ msg (M_CLIENT, "SUCCESS: common name '%s' found, %d client(s) killed", p1, n_killed);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: common name '%s' not found", p1);
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: kill parse");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The 'kill' command is not supported by the current daemon mode");
+ }
+
+ gc_free (&gc);
+}
+
+/*
+ * General-purpose history command handler
+ * for the log and echo commands.
+ */
+static void
+man_history (struct management *man,
+ const char *parm,
+ const char *type,
+ struct log_history *log,
+ bool *realtime,
+ const unsigned int lep_flags)
+{
+ struct gc_arena gc = gc_new ();
+ int n = 0;
+
+ if (streq (parm, "on"))
+ {
+ *realtime = true;
+ msg (M_CLIENT, "SUCCESS: real-time %s notification set to ON", type);
+ }
+ else if (streq (parm, "off"))
+ {
+ *realtime = false;
+ msg (M_CLIENT, "SUCCESS: real-time %s notification set to OFF", type);
+ }
+ else if (streq (parm, "all") || (n = atoi (parm)) > 0)
+ {
+ const int size = log_history_size (log);
+ const int start = (n ? n : size) - 1;
+ int i;
+
+ for (i = start; i >= 0; --i)
+ {
+ const struct log_entry *e = log_history_ref (log, i);
+ if (e)
+ {
+ const char *out = log_entry_print (e, lep_flags, &gc);
+ virtual_output_callback_func (man, M_CLIENT, out);
+ }
+ }
+ msg (M_CLIENT, "END");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: %s parameter must be 'on' or 'off' or some number n or 'all'", type);
+ }
+
+ gc_free (&gc);
+}
+
+static void
+man_log (struct management *man, const char *parm)
+{
+ man_history (man,
+ parm,
+ "log",
+ man->persist.log,
+ &man->connection.log_realtime,
+ LOG_PRINT_INT_DATE|LOG_PRINT_MSG_FLAGS);
+}
+
+static void
+man_echo (struct management *man, const char *parm)
+{
+ man_history (man,
+ parm,
+ "echo",
+ man->persist.echo,
+ &man->connection.echo_realtime,
+ LOG_PRINT_INT_DATE|MANAGEMENT_ECHO_FLAGS);
+}
+
+static void
+man_state (struct management *man, const char *parm)
+{
+ man_history (man,
+ parm,
+ "state",
+ man->persist.state,
+ &man->connection.state_realtime,
+ LOG_PRINT_INT_DATE|LOG_PRINT_STATE|
+ LOG_PRINT_LOCAL_IP|LOG_PRINT_REMOTE_IP);
+}
+
+static void
+man_up_finalize (struct management *man)
+{
+ switch (man->connection.up_query_mode)
+ {
+ case UP_QUERY_USER_PASS:
+ if (!strlen (man->connection.up_query.username))
+ break;
+ /* fall through */
+ case UP_QUERY_PASS:
+ case UP_QUERY_NEED_OK:
+ case UP_QUERY_NEED_STR:
+ if (strlen (man->connection.up_query.password))
+ man->connection.up_query.defined = true;
+ break;
+ case UP_QUERY_DISABLED:
+ man->connection.up_query.defined = false;
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+static void
+man_query_user_pass (struct management *man,
+ const char *type,
+ const char *string,
+ const bool needed,
+ const char *prompt,
+ char *dest,
+ int len)
+{
+ if (needed)
+ {
+ ASSERT (man->connection.up_query_type);
+ if (streq (man->connection.up_query_type, type))
+ {
+ strncpynt (dest, string, len);
+ man_up_finalize (man);
+ msg (M_CLIENT, "SUCCESS: '%s' %s entered, but not yet verified",
+ type,
+ prompt);
+ }
+ else
+ msg (M_CLIENT, "ERROR: %s of type '%s' entered, but we need one of type '%s'",
+ prompt,
+ type,
+ man->connection.up_query_type);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: no %s is currently needed at this time", prompt);
+ }
+}
+
+static void
+man_query_username (struct management *man, const char *type, const char *string)
+{
+ const bool needed = ((man->connection.up_query_mode == UP_QUERY_USER_PASS
+ ) && man->connection.up_query_type);
+ man_query_user_pass (man, type, string, needed, "username", man->connection.up_query.username, USER_PASS_LEN);
+}
+
+static void
+man_query_password (struct management *man, const char *type, const char *string)
+{
+ const bool needed = ((man->connection.up_query_mode == UP_QUERY_PASS
+ || man->connection.up_query_mode == UP_QUERY_USER_PASS
+ ) && man->connection.up_query_type);
+ if (!string[0]) /* allow blank passwords to be passed through using the blank_up tag */
+ string = blank_up;
+ man_query_user_pass (man, type, string, needed, "password", man->connection.up_query.password, USER_PASS_LEN);
+}
+
+static void
+man_query_need_ok (struct management *man, const char *type, const char *action)
+{
+ const bool needed = ((man->connection.up_query_mode == UP_QUERY_NEED_OK) && man->connection.up_query_type);
+ man_query_user_pass (man, type, action, needed, "needok-confirmation", man->connection.up_query.password, USER_PASS_LEN);
+}
+
+static void
+man_query_need_str (struct management *man, const char *type, const char *action)
+{
+ const bool needed = ((man->connection.up_query_mode == UP_QUERY_NEED_STR) && man->connection.up_query_type);
+ man_query_user_pass (man, type, action, needed, "needstr-string", man->connection.up_query.password, USER_PASS_LEN);
+}
+
+static void
+man_forget_passwords (struct management *man)
+{
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ ssl_purge_auth (false);
+ msg (M_CLIENT, "SUCCESS: Passwords were forgotten");
+#endif
+}
+
+static void
+man_net (struct management *man)
+{
+ if (man->persist.callback.show_net)
+ {
+ (*man->persist.callback.show_net) (man->persist.callback.arg, M_CLIENT);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The 'net' command is not supported by the current daemon mode");
+ }
+}
+
+#ifdef ENABLE_PKCS11
+
+static void
+man_pkcs11_id_count (struct management *man)
+{
+ msg (M_CLIENT, ">PKCS11ID-COUNT:%d", pkcs11_management_id_count ());
+}
+
+static void
+man_pkcs11_id_get (struct management *man, const int index)
+{
+ char *id = NULL;
+ char *base64 = NULL;
+
+ if (pkcs11_management_id_get (index, &id, &base64))
+ msg (M_CLIENT, ">PKCS11ID-ENTRY:'%d', ID:'%s', BLOB:'%s'", index, id, base64);
+ else
+ msg (M_CLIENT, ">PKCS11ID-ENTRY:'%d'", index);
+
+ if (id != NULL)
+ free (id);
+ if (base64 != NULL)
+ free (base64);
+}
+
+#endif
+
+static void
+man_hold (struct management *man, const char *cmd)
+{
+ if (cmd)
+ {
+ if (streq (cmd, "on"))
+ {
+ man->settings.flags |= MF_HOLD;
+ msg (M_CLIENT, "SUCCESS: hold flag set to ON");
+ }
+ else if (streq (cmd, "off"))
+ {
+ man->settings.flags &= ~MF_HOLD;
+ msg (M_CLIENT, "SUCCESS: hold flag set to OFF");
+ }
+ else if (streq (cmd, "release"))
+ {
+ man->persist.hold_release = true;
+ msg (M_CLIENT, "SUCCESS: hold release succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: bad hold command parameter");
+ }
+ }
+ else
+ msg (M_CLIENT, "SUCCESS: hold=%d", BOOL_CAST(man->settings.flags & MF_HOLD));
+}
+
+#ifdef MANAGEMENT_IN_EXTRA
+
+#define IER_RESET 0
+#define IER_NEW 1
+
+static void
+in_extra_reset (struct man_connection *mc, const int mode)
+{
+ if (mc)
+ {
+ if (mode != IER_NEW)
+ {
+ mc->in_extra_cmd = IEC_UNDEF;
+#ifdef MANAGEMENT_DEF_AUTH
+ mc->in_extra_cid = 0;
+ mc->in_extra_kid = 0;
+#endif
+ }
+ if (mc->in_extra)
+ {
+ buffer_list_free (mc->in_extra);
+ mc->in_extra = NULL;
+ }
+ if (mode == IER_NEW)
+ mc->in_extra = buffer_list_new (0);
+ }
+}
+
+static void
+in_extra_dispatch (struct management *man)
+{
+ switch (man->connection.in_extra_cmd)
+ {
+#ifdef MANAGEMENT_DEF_AUTH
+ case IEC_CLIENT_AUTH:
+ if (man->persist.callback.client_auth)
+ {
+ const bool status = (*man->persist.callback.client_auth)
+ (man->persist.callback.arg,
+ man->connection.in_extra_cid,
+ man->connection.in_extra_kid,
+ true,
+ NULL,
+ NULL,
+ man->connection.in_extra);
+ man->connection.in_extra = NULL;
+ if (status)
+ {
+ msg (M_CLIENT, "SUCCESS: client-auth command succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: client-auth command failed");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The client-auth command is not supported by the current daemon mode");
+ }
+ break;
+#endif
+#ifdef MANAGEMENT_PF
+ case IEC_CLIENT_PF:
+ if (man->persist.callback.client_pf)
+ {
+ const bool status = (*man->persist.callback.client_pf)
+ (man->persist.callback.arg,
+ man->connection.in_extra_cid,
+ man->connection.in_extra);
+ man->connection.in_extra = NULL;
+ if (status)
+ {
+ msg (M_CLIENT, "SUCCESS: client-pf command succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: client-pf command failed");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The client-pf command is not supported by the current daemon mode");
+ }
+ break;
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ case IEC_RSA_SIGN:
+ man->connection.ext_key_state = EKS_READY;
+ buffer_list_free (man->connection.ext_key_input);
+ man->connection.ext_key_input = man->connection.in_extra;
+ man->connection.in_extra = NULL;
+ return;
+#endif
+ }
+ in_extra_reset (&man->connection, IER_RESET);
+}
+
+#endif /* MANAGEMENT_IN_EXTRA */
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+static bool
+parse_cid (const char *str, unsigned long *cid)
+{
+ if (sscanf (str, "%lu", cid) == 1)
+ return true;
+ else
+ {
+ msg (M_CLIENT, "ERROR: cannot parse CID");
+ return false;
+ }
+}
+
+static bool
+parse_kid (const char *str, unsigned int *kid)
+{
+ if (sscanf (str, "%u", kid) == 1)
+ return true;
+ else
+ {
+ msg (M_CLIENT, "ERROR: cannot parse KID");
+ return false;
+ }
+}
+
+static void
+man_client_auth (struct management *man, const char *cid_str, const char *kid_str, const bool extra)
+{
+ struct man_connection *mc = &man->connection;
+ mc->in_extra_cid = 0;
+ mc->in_extra_kid = 0;
+ if (parse_cid (cid_str, &mc->in_extra_cid)
+ && parse_kid (kid_str, &mc->in_extra_kid))
+ {
+ mc->in_extra_cmd = IEC_CLIENT_AUTH;
+ in_extra_reset (mc, IER_NEW);
+ if (!extra)
+ in_extra_dispatch (man);
+ }
+}
+
+static void
+man_client_deny (struct management *man, const char *cid_str, const char *kid_str, const char *reason, const char *client_reason)
+{
+ unsigned long cid = 0;
+ unsigned int kid = 0;
+ if (parse_cid (cid_str, &cid) && parse_kid (kid_str, &kid))
+ {
+ if (man->persist.callback.client_auth)
+ {
+ const bool status = (*man->persist.callback.client_auth)
+ (man->persist.callback.arg,
+ cid,
+ kid,
+ false,
+ reason,
+ client_reason,
+ NULL);
+ if (status)
+ {
+ msg (M_CLIENT, "SUCCESS: client-deny command succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: client-deny command failed");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The client-deny command is not supported by the current daemon mode");
+ }
+ }
+}
+
+static void
+man_client_kill (struct management *man, const char *cid_str, const char *kill_msg)
+{
+ unsigned long cid = 0;
+ if (parse_cid (cid_str, &cid))
+ {
+ if (man->persist.callback.kill_by_cid)
+ {
+ const bool status = (*man->persist.callback.kill_by_cid) (man->persist.callback.arg, cid, kill_msg);
+ if (status)
+ {
+ msg (M_CLIENT, "SUCCESS: client-kill command succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: client-kill command failed");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The client-kill command is not supported by the current daemon mode");
+ }
+ }
+}
+
+static void
+man_client_n_clients (struct management *man)
+{
+ if (man->persist.callback.n_clients)
+ {
+ const int nclients = (*man->persist.callback.n_clients) (man->persist.callback.arg);
+ msg (M_CLIENT, "SUCCESS: nclients=%d", nclients);
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The nclients command is not supported by the current daemon mode");
+ }
+}
+
+static void
+man_env_filter (struct management *man, const int level)
+{
+ man->connection.env_filter_level = level;
+ msg (M_CLIENT, "SUCCESS: env_filter_level=%d", level);
+}
+
+#ifdef MANAGEMENT_PF
+
+static void
+man_client_pf (struct management *man, const char *cid_str)
+{
+ struct man_connection *mc = &man->connection;
+ mc->in_extra_cid = 0;
+ mc->in_extra_kid = 0;
+ if (parse_cid (cid_str, &mc->in_extra_cid))
+ {
+ mc->in_extra_cmd = IEC_CLIENT_PF;
+ in_extra_reset (mc, IER_NEW);
+ }
+}
+
+#endif /* MANAGEMENT_PF */
+#endif /* MANAGEMENT_DEF_AUTH */
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+static void
+man_rsa_sig (struct management *man)
+{
+ struct man_connection *mc = &man->connection;
+ if (mc->ext_key_state == EKS_SOLICIT)
+ {
+ mc->ext_key_state = EKS_INPUT;
+ mc->in_extra_cmd = IEC_RSA_SIGN;
+ in_extra_reset (mc, IER_NEW);
+ }
+ else
+ msg (M_CLIENT, "ERROR: The rsa-sig command is not currently available");
+}
+
+#endif
+
+static void
+man_load_stats (struct management *man)
+{
+ extern counter_type link_read_bytes_global;
+ extern counter_type link_write_bytes_global;
+ int nclients = 0;
+
+ if (man->persist.callback.n_clients)
+ nclients = (*man->persist.callback.n_clients) (man->persist.callback.arg);
+ msg (M_CLIENT, "SUCCESS: nclients=%d,bytesin=" counter_format ",bytesout=" counter_format,
+ nclients,
+ link_read_bytes_global,
+ link_write_bytes_global);
+}
+
+#define MN_AT_LEAST (1<<0)
+
+static bool
+man_need (struct management *man, const char **p, const int n, unsigned int flags)
+{
+ int i;
+ ASSERT (p[0]);
+ for (i = 1; i <= n; ++i)
+ {
+ if (!p[i])
+ {
+ msg (M_CLIENT, "ERROR: the '%s' command requires %s%d parameter%s",
+ p[0],
+ (flags & MN_AT_LEAST) ? "at least " : "",
+ n,
+ n > 1 ? "s" : "");
+ return false;
+ }
+ }
+ return true;
+}
+
+static void
+man_proxy (struct management *man, const char **p)
+{
+ if (man->persist.callback.proxy_cmd)
+ {
+ const bool status = (*man->persist.callback.proxy_cmd)(man->persist.callback.arg, p);
+ if (status)
+ msg (M_CLIENT, "SUCCESS: proxy command succeeded");
+ else
+ msg (M_CLIENT, "ERROR: proxy command failed");
+ }
+ else
+ msg (M_CLIENT, "ERROR: The proxy command is not supported by the current daemon mode");
+}
+
+static void
+man_remote (struct management *man, const char **p)
+{
+ if (man->persist.callback.remote_cmd)
+ {
+ const bool status = (*man->persist.callback.remote_cmd)(man->persist.callback.arg, p);
+ if (status)
+ {
+ msg (M_CLIENT, "SUCCESS: remote command succeeded");
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: remote command failed");
+ }
+ }
+ else
+ {
+ msg (M_CLIENT, "ERROR: The remote command is not supported by the current daemon mode");
+ }
+}
+
+#ifdef TARGET_ANDROID
+static void
+man_network_change (struct management *man)
+{
+ if (man->persist.callback.network_change)
+ {
+ int fd = (*man->persist.callback.network_change)(man->persist.callback.arg);
+ man->connection.fdtosend = fd;
+ msg (M_CLIENT, "PROTECTFD: fd '%d' sent to be protected", fd);
+ if (fd == -2)
+ man_signal (man, "USR1");
+ }
+}
+#endif
+
+static void
+man_dispatch_command (struct management *man, struct status_output *so, const char **p, const int nparms)
+{
+ struct gc_arena gc = gc_new ();
+
+ ASSERT (p[0]);
+ if (streq (p[0], "exit") || streq (p[0], "quit"))
+ {
+ man->connection.halt = true;
+ goto done;
+ }
+ else if (streq (p[0], "help"))
+ {
+ man_help ();
+ }
+ else if (streq (p[0], "version"))
+ {
+ msg (M_CLIENT, "OpenVPN Version: %s", title_string);
+ msg (M_CLIENT, "Management Version: %d", MANAGEMENT_VERSION);
+ msg (M_CLIENT, "END");
+ }
+ else if (streq (p[0], "pid"))
+ {
+ msg (M_CLIENT, "SUCCESS: pid=%d", platform_getpid ());
+ }
+#ifdef MANAGEMENT_DEF_AUTH
+ else if (streq (p[0], "nclients"))
+ {
+ man_client_n_clients (man);
+ }
+ else if (streq (p[0], "env-filter"))
+ {
+ int level = 0;
+ if (p[1])
+ level = atoi (p[1]);
+ man_env_filter (man, level);
+ }
+#endif
+ else if (streq (p[0], "signal"))
+ {
+ if (man_need (man, p, 1, 0))
+ man_signal (man, p[1]);
+ }
+#ifdef TARGET_ANDROID
+ else if (streq (p[0], "network-change"))
+ {
+ man_network_change(man);
+ }
+#endif
+ else if (streq (p[0], "load-stats"))
+ {
+ man_load_stats (man);
+ }
+ else if (streq (p[0], "status"))
+ {
+ int version = 0;
+ if (p[1])
+ version = atoi (p[1]);
+ man_status (man, version, so);
+ }
+ else if (streq (p[0], "kill"))
+ {
+ if (man_need (man, p, 1, 0))
+ man_kill (man, p[1]);
+ }
+ else if (streq (p[0], "verb"))
+ {
+ if (p[1])
+ {
+ const int level = atoi(p[1]);
+ if (set_debug_level (level, 0))
+ msg (M_CLIENT, "SUCCESS: verb level changed");
+ else
+ msg (M_CLIENT, "ERROR: verb level is out of range");
+ }
+ else
+ msg (M_CLIENT, "SUCCESS: verb=%d", get_debug_level ());
+ }
+ else if (streq (p[0], "mute"))
+ {
+ if (p[1])
+ {
+ const int level = atoi(p[1]);
+ if (set_mute_cutoff (level))
+ msg (M_CLIENT, "SUCCESS: mute level changed");
+ else
+ msg (M_CLIENT, "ERROR: mute level is out of range");
+ }
+ else
+ msg (M_CLIENT, "SUCCESS: mute=%d", get_mute_cutoff ());
+ }
+ else if (streq (p[0], "auth-retry"))
+ {
+#if P2MP
+ if (p[1])
+ {
+ if (auth_retry_set (M_CLIENT, p[1]))
+ msg (M_CLIENT, "SUCCESS: auth-retry parameter changed");
+ else
+ msg (M_CLIENT, "ERROR: bad auth-retry parameter");
+ }
+ else
+ msg (M_CLIENT, "SUCCESS: auth-retry=%s", auth_retry_print ());
+#else
+ msg (M_CLIENT, "ERROR: auth-retry feature is unavailable");
+#endif
+ }
+ else if (streq (p[0], "state"))
+ {
+ if (!p[1])
+ {
+ man_state (man, "1");
+ }
+ else
+ {
+ if (p[1])
+ man_state (man, p[1]);
+ if (p[2])
+ man_state (man, p[2]);
+ }
+ }
+ else if (streq (p[0], "log"))
+ {
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ {
+ if (p[1])
+ man_log (man, p[1]);
+ if (p[2])
+ man_log (man, p[2]);
+ }
+ }
+ else if (streq (p[0], "echo"))
+ {
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ {
+ if (p[1])
+ man_echo (man, p[1]);
+ if (p[2])
+ man_echo (man, p[2]);
+ }
+ }
+ else if (streq (p[0], "username"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_query_username (man, p[1], p[2]);
+ }
+ else if (streq (p[0], "password"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_query_password (man, p[1], p[2]);
+ }
+ else if (streq (p[0], "forget-passwords"))
+ {
+ man_forget_passwords (man);
+ }
+ else if (streq (p[0], "needok"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_query_need_ok (man, p[1], p[2]);
+ }
+ else if (streq (p[0], "needstr"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_query_need_str (man, p[1], p[2]);
+ }
+ else if (streq (p[0], "net"))
+ {
+ man_net (man);
+ }
+ else if (streq (p[0], "hold"))
+ {
+ man_hold (man, p[1]);
+ }
+ else if (streq (p[0], "bytecount"))
+ {
+ if (man_need (man, p, 1, 0))
+ man_bytecount (man, atoi(p[1]));
+ }
+#ifdef MANAGEMENT_DEF_AUTH
+ else if (streq (p[0], "client-kill"))
+ {
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ man_client_kill (man, p[1], p[2]);
+ }
+ else if (streq (p[0], "client-deny"))
+ {
+ if (man_need (man, p, 3, MN_AT_LEAST))
+ man_client_deny (man, p[1], p[2], p[3], p[4]);
+ }
+ else if (streq (p[0], "client-auth-nt"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_client_auth (man, p[1], p[2], false);
+ }
+ else if (streq (p[0], "client-auth"))
+ {
+ if (man_need (man, p, 2, 0))
+ man_client_auth (man, p[1], p[2], true);
+ }
+#ifdef MANAGEMENT_PF
+ else if (streq (p[0], "client-pf"))
+ {
+ if (man_need (man, p, 1, 0))
+ man_client_pf (man, p[1]);
+ }
+#endif
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ else if (streq (p[0], "rsa-sig"))
+ {
+ man_rsa_sig (man);
+ }
+#endif
+#ifdef ENABLE_PKCS11
+ else if (streq (p[0], "pkcs11-id-count"))
+ {
+ man_pkcs11_id_count (man);
+ }
+ else if (streq (p[0], "pkcs11-id-get"))
+ {
+ if (man_need (man, p, 1, 0))
+ man_pkcs11_id_get (man, atoi(p[1]));
+ }
+#endif
+ else if (streq (p[0], "proxy"))
+ {
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ man_proxy (man, p);
+ }
+ else if (streq (p[0], "remote"))
+ {
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ man_remote (man, p);
+ }
+#if 1
+ else if (streq (p[0], "test"))
+ {
+ if (man_need (man, p, 1, 0))
+ {
+ int i;
+ const int n = atoi (p[1]);
+ for (i = 0; i < n; ++i)
+ {
+ msg (M_CLIENT, "[%d] The purpose of this command is to generate large amounts of output.", i);
+ }
+ }
+ }
+#endif
+ else
+ {
+ msg (M_CLIENT, "ERROR: unknown command, enter 'help' for more options");
+ }
+
+ done:
+ gc_free (&gc);
+}
+
+#ifdef WIN32
+
+static void
+man_start_ne32 (struct management *man)
+{
+ switch (man->connection.state)
+ {
+ case MS_LISTEN:
+ net_event_win32_start (&man->connection.ne32, FD_ACCEPT, man->connection.sd_top);
+ break;
+ case MS_CC_WAIT_READ:
+ case MS_CC_WAIT_WRITE:
+ net_event_win32_start (&man->connection.ne32, FD_READ|FD_WRITE|FD_CLOSE, man->connection.sd_cli);
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+static void
+man_stop_ne32 (struct management *man)
+{
+ net_event_win32_stop (&man->connection.ne32);
+}
+
+#endif
+
+static void
+man_record_peer_info (struct management *man)
+{
+ struct gc_arena gc = gc_new ();
+ if (man->settings.write_peer_info_file)
+ {
+ bool success = false;
+#ifdef HAVE_GETSOCKNAME
+ if (socket_defined (man->connection.sd_cli))
+ {
+ struct sockaddr_in addr;
+ socklen_t addrlen = sizeof (addr);
+ int status;
+
+ CLEAR (addr);
+ status = getsockname (man->connection.sd_cli, (struct sockaddr *)&addr, &addrlen);
+ if (!status && addrlen == sizeof (addr))
+ {
+ const in_addr_t a = ntohl (addr.sin_addr.s_addr);
+ const int p = ntohs (addr.sin_port);
+ FILE *fp = platform_fopen (man->settings.write_peer_info_file, "w");
+ if (fp)
+ {
+ fprintf (fp, "%s\n%d\n", print_in_addr_t (a, 0, &gc), p);
+ if (!fclose (fp))
+ success = true;
+ }
+ }
+ }
+#endif
+ if (!success)
+ {
+ msg (D_MANAGEMENT, "MANAGEMENT: failed to write peer info to file %s",
+ man->settings.write_peer_info_file);
+ throw_signal_soft (SIGTERM, "management-connect-failed");
+ }
+ }
+ gc_free (&gc);
+}
+
+static void
+man_connection_settings_reset (struct management *man)
+{
+ man->connection.state_realtime = false;
+ man->connection.log_realtime = false;
+ man->connection.echo_realtime = false;
+ man->connection.bytecount_update_seconds = 0;
+ man->connection.password_verified = false;
+ man->connection.password_tries = 0;
+ man->connection.halt = false;
+ man->connection.state = MS_CC_WAIT_WRITE;
+}
+
+static void
+man_new_connection_post (struct management *man, const char *description)
+{
+ struct gc_arena gc = gc_new ();
+
+ set_nonblock (man->connection.sd_cli);
+ set_cloexec (man->connection.sd_cli);
+
+ man_connection_settings_reset (man);
+
+#ifdef WIN32
+ man_start_ne32 (man);
+#endif
+
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ msg (D_MANAGEMENT, "MANAGEMENT: %s %s",
+ description,
+ sockaddr_unix_name (&man->settings.local_unix, "NULL"));
+ }
+ else
+#endif
+ msg (D_MANAGEMENT, "MANAGEMENT: %s %s",
+ description,
+ print_sockaddr (man->settings.local->ai_addr, &gc));
+
+ buffer_list_reset (man->connection.out);
+
+ if (!man_password_needed (man))
+ man_welcome (man);
+ man_prompt (man);
+ man_update_io_state (man);
+
+ gc_free (&gc);
+}
+
+#if UNIX_SOCK_SUPPORT
+static bool
+man_verify_unix_peer_uid_gid (struct management *man, const socket_descriptor_t sd)
+{
+ if (socket_defined (sd) && (man->settings.client_uid != -1 || man->settings.client_gid != -1))
+ {
+ static const char err_prefix[] = "MANAGEMENT: unix domain socket client connection rejected --";
+ int uid, gid;
+ if (unix_socket_get_peer_uid_gid (man->connection.sd_cli, &uid, &gid))
+ {
+ if (man->settings.client_uid != -1 && man->settings.client_uid != uid)
+ {
+ msg (D_MANAGEMENT, "%s UID of socket peer (%d) doesn't match required value (%d) as given by --management-client-user",
+ err_prefix, uid, man->settings.client_uid);
+ return false;
+ }
+ if (man->settings.client_gid != -1 && man->settings.client_gid != gid)
+ {
+ msg (D_MANAGEMENT, "%s GID of socket peer (%d) doesn't match required value (%d) as given by --management-client-group",
+ err_prefix, gid, man->settings.client_gid);
+ return false;
+ }
+ }
+ else
+ {
+ msg (D_MANAGEMENT, "%s cannot get UID/GID of socket peer", err_prefix);
+ return false;
+ }
+ }
+ return true;
+}
+#endif
+
+static void
+man_accept (struct management *man)
+{
+ struct link_socket_actual act;
+ CLEAR (act);
+
+ /*
+ * Accept the TCP or Unix domain socket client.
+ */
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ struct sockaddr_un remote;
+ man->connection.sd_cli = socket_accept_unix (man->connection.sd_top, &remote);
+ if (!man_verify_unix_peer_uid_gid (man, man->connection.sd_cli))
+ sd_close (&man->connection.sd_cli);
+ }
+ else
+#endif
+ man->connection.sd_cli = socket_do_accept (man->connection.sd_top, &act, false);
+
+ if (socket_defined (man->connection.sd_cli))
+ {
+ man->connection.remote = act.dest;
+
+ if (socket_defined (man->connection.sd_top))
+ {
+#ifdef WIN32
+ man_stop_ne32 (man);
+#endif
+ }
+
+ man_new_connection_post (man, "Client connected from");
+ }
+}
+
+static void
+man_listen (struct management *man)
+{
+ struct gc_arena gc = gc_new ();
+
+ /*
+ * Initialize state
+ */
+ man->connection.state = MS_LISTEN;
+ man->connection.sd_cli = SOCKET_UNDEFINED;
+
+ /*
+ * Initialize listening socket
+ */
+ if (man->connection.sd_top == SOCKET_UNDEFINED)
+ {
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ man_delete_unix_socket (man);
+ man->connection.sd_top = create_socket_unix ();
+ socket_bind_unix (man->connection.sd_top, &man->settings.local_unix, "MANAGEMENT");
+ }
+ else
+#endif
+ {
+ man->connection.sd_top = create_socket_tcp (man->settings.local);
+ socket_bind (man->connection.sd_top, man->settings.local,
+ man->settings.local->ai_family, "MANAGEMENT", false);
+ }
+
+ /*
+ * Listen for connection
+ */
+ if (listen (man->connection.sd_top, 1))
+ msg (M_ERR, "MANAGEMENT: listen() failed");
+
+ /*
+ * Set misc socket properties
+ */
+ set_nonblock (man->connection.sd_top);
+ set_cloexec (man->connection.sd_top);
+
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ msg (D_MANAGEMENT, "MANAGEMENT: unix domain socket listening on %s",
+ sockaddr_unix_name (&man->settings.local_unix, "NULL"));
+ }
+ else
+#endif
+ msg (D_MANAGEMENT, "MANAGEMENT: TCP Socket listening on %s",
+ print_sockaddr (man->settings.local->ai_addr, &gc));
+ }
+
+#ifdef WIN32
+ man_start_ne32 (man);
+#endif
+
+ gc_free (&gc);
+}
+
+static void
+man_connect (struct management *man)
+{
+ struct gc_arena gc = gc_new ();
+ int status;
+ int signal_received = 0;
+
+ /*
+ * Initialize state
+ */
+ man->connection.state = MS_INITIAL;
+ man->connection.sd_top = SOCKET_UNDEFINED;
+
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ man->connection.sd_cli = create_socket_unix ();
+ status = socket_connect_unix (man->connection.sd_cli, &man->settings.local_unix);
+ if (!status && !man_verify_unix_peer_uid_gid (man, man->connection.sd_cli))
+ {
+#ifdef EPERM
+ status = EPERM;
+#else
+ status = 1;
+#endif
+ sd_close (&man->connection.sd_cli);
+ }
+ }
+ else
+#endif
+ {
+ man->connection.sd_cli = create_socket_tcp (man->settings.local);
+ status = openvpn_connect (man->connection.sd_cli,
+ man->settings.local->ai_addr,
+ 5,
+ &signal_received);
+ }
+
+ if (signal_received)
+ {
+ throw_signal (signal_received);
+ goto done;
+ }
+
+ if (status)
+ {
+#if UNIX_SOCK_SUPPORT
+ if (man->settings.flags & MF_UNIX_SOCK)
+ {
+ msg (D_LINK_ERRORS,
+ "MANAGEMENT: connect to unix socket %s failed: %s",
+ sockaddr_unix_name (&man->settings.local_unix, "NULL"),
+ strerror_ts (status, &gc));
+ }
+ else
+#endif
+ msg (D_LINK_ERRORS,
+ "MANAGEMENT: connect to %s failed: %s",
+ print_sockaddr (man->settings.local->ai_addr, &gc),
+ strerror_ts (status, &gc));
+ throw_signal_soft (SIGTERM, "management-connect-failed");
+ goto done;
+ }
+
+ man_record_peer_info (man);
+ man_new_connection_post (man, "Connected to management server at");
+
+ done:
+ gc_free (&gc);
+}
+
+static void
+man_reset_client_socket (struct management *man, const bool exiting)
+{
+ if (socket_defined (man->connection.sd_cli))
+ {
+#ifdef WIN32
+ man_stop_ne32 (man);
+#endif
+ man_close_socket (man, man->connection.sd_cli);
+ man->connection.sd_cli = SOCKET_UNDEFINED;
+ man->connection.state = MS_INITIAL;
+ command_line_reset (man->connection.in);
+ buffer_list_reset (man->connection.out);
+#ifdef MANAGEMENT_IN_EXTRA
+ in_extra_reset (&man->connection, IER_RESET);
+#endif
+ msg (D_MANAGEMENT, "MANAGEMENT: Client disconnected");
+ }
+ if (!exiting)
+ {
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ if (man->settings.flags & MF_FORGET_DISCONNECT)
+ ssl_purge_auth (false);
+#endif
+ if (man->settings.flags & MF_SIGNAL) {
+ int mysig = man_mod_signal (man, SIGUSR1);
+ if (mysig >= 0)
+ {
+ msg (D_MANAGEMENT, "MANAGEMENT: Triggering management signal");
+ throw_signal_soft (mysig, "management-disconnect");
+ }
+ }
+
+ if (man->settings.flags & MF_CONNECT_AS_CLIENT)
+ {
+ msg (D_MANAGEMENT, "MANAGEMENT: Triggering management exit");
+ throw_signal_soft (SIGTERM, "management-exit");
+ }
+ else
+ man_listen (man);
+ }
+}
+
+static void
+man_process_command (struct management *man, const char *line)
+{
+ struct gc_arena gc = gc_new ();
+ struct status_output *so;
+ int nparms;
+ char *parms[MAX_PARMS+1];
+
+ CLEAR (parms);
+ so = status_open (NULL, 0, -1, &man->persist.vout, 0);
+#ifdef MANAGEMENT_IN_EXTRA
+ in_extra_reset (&man->connection, IER_RESET);
+#endif
+
+ if (man_password_needed (man))
+ {
+ man_check_password (man, line);
+ }
+ else
+ {
+ nparms = parse_line (line, parms, MAX_PARMS, "TCP", 0, M_CLIENT, &gc);
+ if (parms[0] && streq (parms[0], "password"))
+ msg (D_MANAGEMENT_DEBUG, "MANAGEMENT: CMD 'password [...]'");
+ else if (!streq (line, "load-stats"))
+ msg (D_MANAGEMENT_DEBUG, "MANAGEMENT: CMD '%s'", line);
+
+#if 0
+ /* DEBUGGING -- print args */
+ {
+ int i;
+ for (i = 0; i < nparms; ++i)
+ msg (M_INFO, "[%d] '%s'", i, parms[i]);
+ }
+#endif
+
+ if (nparms > 0)
+ man_dispatch_command (man, so, (const char **)parms, nparms);
+ }
+
+ CLEAR (parms);
+ status_close (so);
+ gc_free (&gc);
+}
+
+static bool
+man_io_error (struct management *man, const char *prefix)
+{
+ const int err = openvpn_errno ();
+
+ if (!ignore_sys_error (err))
+ {
+ struct gc_arena gc = gc_new ();
+ msg (D_MANAGEMENT, "MANAGEMENT: TCP %s error: %s",
+ prefix,
+ strerror_ts (err, &gc));
+ gc_free (&gc);
+ return true;
+ }
+ else
+ return false;
+}
+
+#ifdef TARGET_ANDROID
+static ssize_t man_send_with_fd (int fd, void *ptr, size_t nbytes, int flags, int sendfd)
+{
+ struct msghdr msg;
+ struct iovec iov[1];
+
+ union {
+ struct cmsghdr cm;
+ char control[CMSG_SPACE(sizeof(int))];
+ } control_un;
+ struct cmsghdr *cmptr;
+
+ msg.msg_control = control_un.control;
+ msg.msg_controllen = sizeof(control_un.control);
+
+ cmptr = CMSG_FIRSTHDR(&msg);
+ cmptr->cmsg_len = CMSG_LEN(sizeof(int));
+ cmptr->cmsg_level = SOL_SOCKET;
+ cmptr->cmsg_type = SCM_RIGHTS;
+ *((int *) CMSG_DATA(cmptr)) = sendfd;
+
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+
+ iov[0].iov_base = ptr;
+ iov[0].iov_len = nbytes;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+
+ return (sendmsg(fd, &msg, flags));
+}
+
+static ssize_t man_recv_with_fd (int fd, void *ptr, size_t nbytes, int flags, int *recvfd)
+{
+ struct msghdr msghdr;
+ struct iovec iov[1];
+ ssize_t n;
+
+ union {
+ struct cmsghdr cm;
+ char control[CMSG_SPACE(sizeof (int))];
+ } control_un;
+ struct cmsghdr *cmptr;
+
+ msghdr.msg_control = control_un.control;
+ msghdr.msg_controllen = sizeof(control_un.control);
+
+ msghdr.msg_name = NULL;
+ msghdr.msg_namelen = 0;
+
+ iov[0].iov_base = ptr;
+ iov[0].iov_len = nbytes;
+ msghdr.msg_iov = iov;
+ msghdr.msg_iovlen = 1;
+
+ if ( (n = recvmsg(fd, &msghdr, flags)) <= 0)
+ return (n);
+
+ if ( (cmptr = CMSG_FIRSTHDR(&msghdr)) != NULL &&
+ cmptr->cmsg_len == CMSG_LEN(sizeof(int))) {
+ if (cmptr->cmsg_level != SOL_SOCKET)
+ msg (M_ERR, "control level != SOL_SOCKET");
+ if (cmptr->cmsg_type != SCM_RIGHTS)
+ msg (M_ERR, "control type != SCM_RIGHTS");
+ *recvfd = *((int *) CMSG_DATA(cmptr));
+ } else
+ *recvfd = -1; /* descriptor was not passed */
+
+ return (n);
+}
+
+/*
+ * The android control method will instruct the GUI part of openvpn to do
+ * the route/ifconfig/open tun command. See doc/android.txt for details.
+ */
+bool management_android_control (struct management *man, const char *command, const char *msg)
+{
+ struct user_pass up;
+ CLEAR(up);
+ strncpy (up.username, msg, sizeof(up.username)-1);
+
+ management_query_user_pass(management, &up , command, GET_USER_PASS_NEED_OK,(void*) 0);
+ return strcmp ("ok", up.password)==0;
+}
+
+/*
+ * In Android 4.4 it is not possible to open a new tun device and then close the
+ * old tun device without breaking the whole VPNService stack until the device
+ * is rebooted. This management method ask the UI what method should be taken to
+ * ensure the optimal solution for the situation
+ */
+int managment_android_persisttun_action (struct management *man)
+{
+ struct user_pass up;
+ CLEAR(up);
+ strcpy(up.username,"tunmethod");
+ management_query_user_pass(management, &up , "PERSIST_TUN_ACTION",
+ GET_USER_PASS_NEED_OK,(void*) 0);
+ if (!strcmp("NOACTION", up.password))
+ return ANDROID_KEEP_OLD_TUN;
+ else if (!strcmp ("OPEN_AFTER_CLOSE", up.password))
+ return ANDROID_OPEN_AFTER_CLOSE;
+ else if (!strcmp ("OPEN_BEFORE_CLOSE", up.password))
+ return ANDROID_OPEN_BEFORE_CLOSE;
+ else
+ msg (M_ERR, "Got unrecognised '%s' from management for PERSIST_TUN_ACTION query", up.password);
+
+ ASSERT(0);
+ return ANDROID_OPEN_AFTER_CLOSE;
+}
+
+
+#endif
+
+static int
+man_read (struct management *man)
+{
+ /*
+ * read command line from socket
+ */
+ unsigned char buf[256];
+ int len = 0;
+
+#ifdef TARGET_ANDROID
+ int fd;
+ len = man_recv_with_fd (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL, &fd);
+ if(fd >= 0)
+ man->connection.lastfdreceived = fd;
+#else
+ len = recv (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL);
+#endif
+
+ if (len == 0)
+ {
+ man_reset_client_socket (man, false);
+ }
+ else if (len > 0)
+ {
+ bool processed_command = false;
+
+ ASSERT (len <= (int) sizeof (buf));
+ command_line_add (man->connection.in, buf, len);
+
+ /*
+ * Reset output object
+ */
+ buffer_list_reset (man->connection.out);
+
+ /*
+ * process command line if complete
+ */
+ {
+ const unsigned char *line;
+ while ((line = command_line_get (man->connection.in)))
+ {
+#ifdef MANAGEMENT_IN_EXTRA
+ if (man->connection.in_extra)
+ {
+ if (!strcmp ((char *)line, "END"))
+ in_extra_dispatch (man);
+ else
+ buffer_list_push (man->connection.in_extra, line);
+ }
+ else
+#endif
+ man_process_command (man, (char *) line);
+ if (man->connection.halt)
+ break;
+ command_line_next (man->connection.in);
+ processed_command = true;
+ }
+ }
+
+ /*
+ * Reset output state to MS_CC_WAIT_(READ|WRITE)
+ */
+ if (man->connection.halt)
+ {
+ man_reset_client_socket (man, false);
+ len = 0;
+ }
+ else
+ {
+ if (processed_command)
+ man_prompt (man);
+ man_update_io_state (man);
+ }
+ }
+ else /* len < 0 */
+ {
+ if (man_io_error (man, "recv"))
+ man_reset_client_socket (man, false);
+ }
+ return len;
+}
+
+static int
+man_write (struct management *man)
+{
+ const int size_hint = 1024;
+ int sent = 0;
+ const struct buffer *buf;
+
+ buffer_list_aggregate(man->connection.out, size_hint);
+ buf = buffer_list_peek (man->connection.out);
+ if (buf && BLEN (buf))
+ {
+ const int len = min_int (size_hint, BLEN (buf));
+#ifdef TARGET_ANDROID
+ if (man->connection.fdtosend > 0)
+ {
+ sent = man_send_with_fd (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL,man->connection.fdtosend);
+ man->connection.fdtosend = -1;
+ } else
+#endif
+ sent = send (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL);
+ if (sent >= 0)
+ {
+ buffer_list_advance (man->connection.out, sent);
+ }
+ else if (sent < 0)
+ {
+ if (man_io_error (man, "send"))
+ man_reset_client_socket (man, false);
+ }
+ }
+
+ /*
+ * Reset output state to MS_CC_WAIT_(READ|WRITE)
+ */
+ man_update_io_state (man);
+
+ return sent;
+}
+
+static void
+man_connection_clear (struct man_connection *mc)
+{
+ CLEAR (*mc);
+
+ /* set initial state */
+ mc->state = MS_INITIAL;
+
+ /* clear socket descriptors */
+ mc->sd_top = SOCKET_UNDEFINED;
+ mc->sd_cli = SOCKET_UNDEFINED;
+}
+
+static void
+man_persist_init (struct management *man,
+ const int log_history_cache,
+ const int echo_buffer_size,
+ const int state_buffer_size)
+{
+ struct man_persist *mp = &man->persist;
+ if (!mp->defined)
+ {
+ CLEAR (*mp);
+
+ /* initialize log history store */
+ mp->log = log_history_init (log_history_cache);
+
+ /*
+ * Initialize virtual output object, so that functions
+ * which write to a virtual_output object can be redirected
+ * here to the management object.
+ */
+ mp->vout.func = virtual_output_callback_func;
+ mp->vout.arg = man;
+ mp->vout.flags_default = M_CLIENT;
+ msg_set_virtual_output (&mp->vout);
+
+ /*
+ * Initialize --echo list
+ */
+ man->persist.echo = log_history_init (echo_buffer_size);
+
+ /*
+ * Initialize --state list
+ */
+ man->persist.state = log_history_init (state_buffer_size);
+
+ mp->defined = true;
+ }
+}
+
+static void
+man_persist_close (struct man_persist *mp)
+{
+ if (mp->log)
+ {
+ msg_set_virtual_output (NULL);
+ log_history_close (mp->log);
+ }
+
+ if (mp->echo)
+ log_history_close (mp->echo);
+
+ if (mp->state)
+ log_history_close (mp->state);
+
+ CLEAR (*mp);
+}
+
+static void
+man_settings_init (struct man_settings *ms,
+ const char *addr,
+ const char *port,
+ const char *pass_file,
+ const char *client_user,
+ const char *client_group,
+ const int log_history_cache,
+ const int echo_buffer_size,
+ const int state_buffer_size,
+ const char *write_peer_info_file,
+ const int remap_sigusr1,
+ const unsigned int flags)
+{
+ if (!ms->defined)
+ {
+ CLEAR (*ms);
+
+ ms->flags = flags;
+ ms->client_uid = -1;
+ ms->client_gid = -1;
+
+ /*
+ * Get username/password
+ */
+ if (pass_file)
+ get_user_pass (&ms->up, pass_file, "Management", GET_USER_PASS_PASSWORD_ONLY);
+
+ /*
+ * lookup client UID/GID if specified
+ */
+ if (client_user)
+ {
+ struct platform_state_user s;
+ platform_user_get (client_user, &s);
+ ms->client_uid = platform_state_user_uid (&s);
+ msg (D_MANAGEMENT, "MANAGEMENT: client_uid=%d", ms->client_uid);
+ ASSERT (ms->client_uid >= 0);
+ }
+ if (client_group)
+ {
+ struct platform_state_group s;
+ platform_group_get (client_group, &s);
+ ms->client_gid = platform_state_group_gid (&s);
+ msg (D_MANAGEMENT, "MANAGEMENT: client_gid=%d", ms->client_gid);
+ ASSERT (ms->client_gid >= 0);
+ }
+
+ ms->write_peer_info_file = string_alloc (write_peer_info_file, NULL);
+
+#if UNIX_SOCK_SUPPORT
+ if (ms->flags & MF_UNIX_SOCK)
+ sockaddr_unix_init (&ms->local_unix, addr);
+ else
+#endif
+ {
+
+ /*
+ * Run management over tunnel, or
+ * separate channel?
+ */
+ if (streq (addr, "tunnel") && !(flags & MF_CONNECT_AS_CLIENT))
+ {
+ ms->management_over_tunnel = true;
+ }
+ else
+ {
+ int status;
+ int resolve_flags = GETADDR_RESOLVE|GETADDR_WARN_ON_SIGNAL|GETADDR_FATAL;
+
+ if (! (flags & MF_CONNECT_AS_CLIENT))
+ resolve_flags |= GETADDR_PASSIVE;
+
+ status = openvpn_getaddrinfo (resolve_flags, addr, port, 0,
+ NULL, AF_UNSPEC, &ms->local);
+ ASSERT(status==0);
+ }
+ }
+
+ /*
+ * Log history and echo buffer may need to be resized
+ */
+ ms->log_history_cache = log_history_cache;
+ ms->echo_buffer_size = echo_buffer_size;
+ ms->state_buffer_size = state_buffer_size;
+
+ /*
+ * Set remap sigusr1 flags
+ */
+ if (remap_sigusr1 == SIGHUP)
+ ms->mansig |= MANSIG_MAP_USR1_TO_HUP;
+ else if (remap_sigusr1 == SIGTERM)
+ ms->mansig |= MANSIG_MAP_USR1_TO_TERM;
+
+ ms->defined = true;
+ }
+}
+
+static void
+man_settings_close (struct man_settings *ms)
+{
+ if (ms->local)
+ freeaddrinfo(ms->local);
+ free (ms->write_peer_info_file);
+ CLEAR (*ms);
+}
+
+
+static void
+man_connection_init (struct management *man)
+{
+ if (man->connection.state == MS_INITIAL)
+ {
+#ifdef WIN32
+ /*
+ * This object is a sort of TCP/IP helper
+ * for Windows.
+ */
+ net_event_win32_init (&man->connection.ne32);
+#endif
+
+ /*
+ * Allocate helper objects for command line input and
+ * command output from/to the socket.
+ */
+ man->connection.in = command_line_new (1024);
+ man->connection.out = buffer_list_new (0);
+
+ /*
+ * Initialize event set for standalone usage, when we are
+ * running outside of the primary event loop.
+ */
+ {
+ int maxevents = 1;
+ man->connection.es = event_set_init (&maxevents, EVENT_METHOD_FAST);
+ }
+
+ /*
+ * Listen/connect socket
+ */
+ if (man->settings.flags & MF_CONNECT_AS_CLIENT)
+ man_connect (man);
+ else
+ man_listen (man);
+ }
+}
+
+static void
+man_connection_close (struct management *man)
+{
+ struct man_connection *mc = &man->connection;
+
+ if (mc->es)
+ event_free (mc->es);
+#ifdef WIN32
+ net_event_win32_close (&mc->ne32);
+#endif
+ if (socket_defined (mc->sd_top))
+ {
+ man_close_socket (man, mc->sd_top);
+ man_delete_unix_socket (man);
+ }
+ if (socket_defined (mc->sd_cli))
+ man_close_socket (man, mc->sd_cli);
+ if (mc->in)
+ command_line_free (mc->in);
+ if (mc->out)
+ buffer_list_free (mc->out);
+#ifdef MANAGEMENT_IN_EXTRA
+ in_extra_reset (&man->connection, IER_RESET);
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ buffer_list_free (mc->ext_key_input);
+#endif
+ man_connection_clear (mc);
+}
+
+struct management *
+management_init (void)
+{
+ struct management *man;
+ ALLOC_OBJ_CLEAR (man, struct management);
+
+ man_persist_init (man,
+ MANAGEMENT_LOG_HISTORY_INITIAL_SIZE,
+ MANAGEMENT_ECHO_BUFFER_SIZE,
+ MANAGEMENT_STATE_BUFFER_SIZE);
+
+ man_connection_clear (&man->connection);
+
+ return man;
+}
+
+bool
+management_open (struct management *man,
+ const char *addr,
+ const char *port,
+ const char *pass_file,
+ const char *client_user,
+ const char *client_group,
+ const int log_history_cache,
+ const int echo_buffer_size,
+ const int state_buffer_size,
+ const char *write_peer_info_file,
+ const int remap_sigusr1,
+ const unsigned int flags)
+{
+ bool ret = false;
+
+ /*
+ * Save the settings only if they have not
+ * been saved before.
+ */
+ man_settings_init (&man->settings,
+ addr,
+ port,
+ pass_file,
+ client_user,
+ client_group,
+ log_history_cache,
+ echo_buffer_size,
+ state_buffer_size,
+ write_peer_info_file,
+ remap_sigusr1,
+ flags);
+
+ /*
+ * The log is initially sized to MANAGEMENT_LOG_HISTORY_INITIAL_SIZE,
+ * but may be changed here. Ditto for echo and state buffers.
+ */
+ log_history_resize (man->persist.log, man->settings.log_history_cache);
+ log_history_resize (man->persist.echo, man->settings.echo_buffer_size);
+ log_history_resize (man->persist.state, man->settings.state_buffer_size);
+
+ /*
+ * If connection object is uninitialized and we are not doing
+ * over-the-tunnel management, then open (listening) connection.
+ */
+ if (man->connection.state == MS_INITIAL)
+ {
+ if (!man->settings.management_over_tunnel)
+ {
+ man_connection_init (man);
+ ret = true;
+ }
+ }
+
+ return ret;
+}
+
+void
+management_close (struct management *man)
+{
+ man_output_list_push_finalize (man); /* flush output queue */
+ man_connection_close (man);
+ man_settings_close (&man->settings);
+ man_persist_close (&man->persist);
+ free (man);
+}
+
+void
+management_set_callback (struct management *man,
+ const struct management_callback *cb)
+{
+ man->persist.standalone_disabled = true;
+ man->persist.callback = *cb;
+}
+
+void
+management_clear_callback (struct management *man)
+{
+ man->persist.standalone_disabled = false;
+ man->persist.hold_release = false;
+ CLEAR (man->persist.callback);
+ man_output_list_push_finalize (man); /* flush output queue */
+}
+
+void
+management_set_state (struct management *man,
+ const int state,
+ const char *detail,
+ const in_addr_t tun_local_ip,
+ const in_addr_t tun_remote_ip)
+{
+ if (man->persist.state && (!(man->settings.flags & MF_SERVER) || state < OPENVPN_STATE_CLIENT_BASE))
+ {
+ struct gc_arena gc = gc_new ();
+ struct log_entry e;
+ const char *out = NULL;
+
+ update_time ();
+ CLEAR (e);
+ e.timestamp = now;
+ e.u.state = state;
+ e.string = detail;
+ e.local_ip = tun_local_ip;
+ e.remote_ip = tun_remote_ip;
+
+ log_history_add (man->persist.state, &e);
+
+ if (man->connection.state_realtime)
+ out = log_entry_print (&e, LOG_PRINT_STATE_PREFIX
+ | LOG_PRINT_INT_DATE
+ | LOG_PRINT_STATE
+ | LOG_PRINT_LOCAL_IP
+ | LOG_PRINT_REMOTE_IP
+ | LOG_PRINT_CRLF
+ | LOG_ECHO_TO_LOG, &gc);
+
+ if (out)
+ man_output_list_push (man, out);
+
+ gc_free (&gc);
+ }
+}
+
+static bool
+env_filter_match (const char *env_str, const int env_filter_level)
+{
+ static const char *env_names[] = {
+ "username=",
+ "password=",
+ "X509_0_CN=",
+ "tls_serial_",
+ "untrusted_ip=",
+ "ifconfig_local=",
+ "ifconfig_netmask=",
+ "daemon_start_time=",
+ "daemon_pid=",
+ "dev=",
+ "ifconfig_pool_remote_ip=",
+ "ifconfig_pool_netmask=",
+ "time_duration=",
+ "bytes_sent=",
+ "bytes_received="
+ };
+
+ if (env_filter_level == 0)
+ return true;
+ else if (env_filter_level <= 1 && !strncmp(env_str, "X509_", 5))
+ return true;
+ else if (env_filter_level <= 2)
+ {
+ size_t i;
+ for (i = 0; i < SIZE(env_names); ++i)
+ {
+ const char *en = env_names[i];
+ const size_t len = strlen(en);
+ if (!strncmp(env_str, en, len))
+ return true;
+ }
+ return false;
+ }
+ return false;
+}
+
+static void
+man_output_env (const struct env_set *es, const bool tail, const int env_filter_level, const char *prefix)
+{
+ if (es)
+ {
+ struct env_item *e;
+ for (e = es->list; e != NULL; e = e->next)
+ {
+ if (e->string && (!env_filter_level || env_filter_match(e->string, env_filter_level)))
+ msg (M_CLIENT, ">%s:ENV,%s", prefix, e->string);
+ }
+ }
+ if (tail)
+ msg (M_CLIENT, ">%s:ENV,END", prefix);
+}
+
+static void
+man_output_extra_env (struct management *man, const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+ struct env_set *es = env_set_create (&gc);
+ if (man->persist.callback.n_clients)
+ {
+ const int nclients = (*man->persist.callback.n_clients) (man->persist.callback.arg);
+ setenv_int (es, "n_clients", nclients);
+ }
+ man_output_env (es, false, man->connection.env_filter_level, prefix);
+ gc_free (&gc);
+}
+
+void
+management_up_down(struct management *man, const char *updown, const struct env_set *es)
+{
+ if (man->settings.flags & MF_UP_DOWN)
+ {
+ msg (M_CLIENT, ">UPDOWN:%s", updown);
+ man_output_env (es, true, 0, "UPDOWN");
+ }
+}
+
+void
+management_notify(struct management *man, const char *severity, const char *type, const char *text)
+{
+ msg (M_CLIENT, ">NOTIFY:%s,%s,%s", severity, type, text);
+}
+
+void
+management_notify_generic (struct management *man, const char *str)
+{
+ msg (M_CLIENT, "%s", str);
+}
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+static void
+man_output_peer_info_env (struct management *man, struct man_def_auth_context *mdac)
+{
+ char line[256];
+ if (man->persist.callback.get_peer_info)
+ {
+ const char *peer_info = (*man->persist.callback.get_peer_info) (man->persist.callback.arg, mdac->cid);
+ if (peer_info)
+ {
+ struct buffer buf;
+ buf_set_read (&buf, (const uint8_t *) peer_info, strlen(peer_info));
+ while (buf_parse (&buf, '\n', line, sizeof (line)))
+ {
+ chomp (line);
+ if (validate_peer_info_line(line))
+ {
+ msg (M_CLIENT, ">CLIENT:ENV,%s", line);
+ }
+ else
+ msg (D_MANAGEMENT, "validation failed on peer_info line received from client");
+ }
+ }
+ }
+}
+
+void
+management_notify_client_needing_auth (struct management *management,
+ const unsigned int mda_key_id,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es)
+{
+ if (!(mdac->flags & DAF_CONNECTION_CLOSED))
+ {
+ const char *mode = "CONNECT";
+ if (mdac->flags & DAF_CONNECTION_ESTABLISHED)
+ mode = "REAUTH";
+ msg (M_CLIENT, ">CLIENT:%s,%lu,%u", mode, mdac->cid, mda_key_id);
+ man_output_extra_env (management, "CLIENT");
+ if (management->connection.env_filter_level>0)
+ man_output_peer_info_env(management, mdac);
+ man_output_env (es, true, management->connection.env_filter_level, "CLIENT");
+ mdac->flags |= DAF_INITIAL_AUTH;
+ }
+}
+
+void
+management_connection_established (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es)
+{
+ mdac->flags |= DAF_CONNECTION_ESTABLISHED;
+ msg (M_CLIENT, ">CLIENT:ESTABLISHED,%lu", mdac->cid);
+ man_output_extra_env (management, "CLIENT");
+ man_output_env (es, true, management->connection.env_filter_level, "CLIENT");
+}
+
+void
+management_notify_client_close (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es)
+{
+ if ((mdac->flags & DAF_INITIAL_AUTH) && !(mdac->flags & DAF_CONNECTION_CLOSED))
+ {
+ msg (M_CLIENT, ">CLIENT:DISCONNECT,%lu", mdac->cid);
+ man_output_env (es, true, management->connection.env_filter_level, "CLIENT");
+ mdac->flags |= DAF_CONNECTION_CLOSED;
+ }
+}
+
+void
+management_learn_addr (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct mroute_addr *addr,
+ const bool primary)
+{
+ struct gc_arena gc = gc_new ();
+ if ((mdac->flags & DAF_INITIAL_AUTH) && !(mdac->flags & DAF_CONNECTION_CLOSED))
+ {
+ msg (M_CLIENT, ">CLIENT:ADDRESS,%lu,%s,%d",
+ mdac->cid,
+ mroute_addr_print_ex (addr, MAPF_SUBNET, &gc),
+ BOOL_CAST (primary));
+ }
+ gc_free (&gc);
+}
+
+#endif /* MANAGEMENT_DEF_AUTH */
+
+void
+management_echo (struct management *man, const char *string, const bool pull)
+{
+ if (man->persist.echo)
+ {
+ struct gc_arena gc = gc_new ();
+ struct log_entry e;
+ const char *out = NULL;
+
+ update_time ();
+ CLEAR (e);
+ e.timestamp = now;
+ e.string = string;
+ e.u.intval = BOOL_CAST (pull);
+
+ log_history_add (man->persist.echo, &e);
+
+ if (man->connection.echo_realtime)
+ out = log_entry_print (&e, LOG_PRINT_INT_DATE|LOG_PRINT_ECHO_PREFIX|LOG_PRINT_CRLF|MANAGEMENT_ECHO_FLAGS, &gc);
+
+ if (out)
+ man_output_list_push (man, out);
+
+ gc_free (&gc);
+ }
+}
+
+void
+management_post_tunnel_open (struct management *man, const in_addr_t tun_local_ip)
+{
+ /*
+ * If we are running management over the tunnel,
+ * this is the place to initialize the connection.
+ */
+ if (man->settings.management_over_tunnel
+ && man->connection.state == MS_INITIAL)
+ {
+ /* listen on our local TUN/TAP IP address */
+ struct in_addr ia;
+ int ret;
+
+ ia.s_addr = htonl(tun_local_ip);
+ ret = openvpn_getaddrinfo(GETADDR_PASSIVE, inet_ntoa(ia), NULL, 0, NULL,
+ AF_INET, &man->settings.local);
+ ASSERT (ret==0);
+ man_connection_init (man);
+ }
+
+}
+
+void
+management_pre_tunnel_close (struct management *man)
+{
+ if (man->settings.management_over_tunnel)
+ man_connection_close (man);
+}
+
+void
+management_auth_failure (struct management *man, const char *type, const char *reason)
+{
+ if (reason)
+ msg (M_CLIENT, ">PASSWORD:Verification Failed: '%s' ['%s']", type, reason);
+ else
+ msg (M_CLIENT, ">PASSWORD:Verification Failed: '%s'", type);
+}
+
+void
+management_auth_token (struct management *man, const char *token)
+{
+ msg (M_CLIENT, ">PASSWORD:Auth-Token:%s", token);
+}
+
+static inline bool
+man_persist_state (unsigned int *persistent, const int n)
+{
+ if (persistent)
+ {
+ if (*persistent == (unsigned int)n)
+ return false;
+ *persistent = n;
+ }
+ return true;
+}
+
+#ifdef WIN32
+
+void
+management_socket_set (struct management *man,
+ struct event_set *es,
+ void *arg,
+ unsigned int *persistent)
+{
+ if (man->connection.state != MS_INITIAL)
+ {
+ event_t ev = net_event_win32_get_event (&man->connection.ne32);
+ net_event_win32_reset_write (&man->connection.ne32);
+
+ switch (man->connection.state)
+ {
+ case MS_LISTEN:
+ if (man_persist_state (persistent, 1))
+ event_ctl (es, ev, EVENT_READ, arg);
+ break;
+ case MS_CC_WAIT_READ:
+ if (man_persist_state (persistent, 2))
+ event_ctl (es, ev, EVENT_READ, arg);
+ break;
+ case MS_CC_WAIT_WRITE:
+ if (man_persist_state (persistent, 3))
+ event_ctl (es, ev, EVENT_READ|EVENT_WRITE, arg);
+ break;
+ default:
+ ASSERT (0);
+ }
+ }
+}
+
+void
+management_io (struct management *man)
+{
+ if (man->connection.state != MS_INITIAL)
+ {
+ long net_events;
+ net_event_win32_reset (&man->connection.ne32);
+ net_events = net_event_win32_get_event_mask (&man->connection.ne32);
+
+ if (net_events & FD_CLOSE)
+ {
+ man_reset_client_socket (man, false);
+ }
+ else
+ {
+ if (man->connection.state == MS_LISTEN)
+ {
+ if (net_events & FD_ACCEPT)
+ {
+ man_accept (man);
+ net_event_win32_clear_selected_events (&man->connection.ne32, FD_ACCEPT);
+ }
+ }
+ else if (man->connection.state == MS_CC_WAIT_READ || man->connection.state == MS_CC_WAIT_WRITE)
+ {
+ if (net_events & FD_READ)
+ {
+ while (man_read (man) > 0)
+ ;
+ net_event_win32_clear_selected_events (&man->connection.ne32, FD_READ);
+ }
+
+ if (net_events & FD_WRITE)
+ {
+ int status;
+ status = man_write (man);
+ if (status < 0 && WSAGetLastError() == WSAEWOULDBLOCK)
+ {
+ net_event_win32_clear_selected_events (&man->connection.ne32, FD_WRITE);
+ }
+ }
+ }
+ }
+ }
+}
+
+#else
+
+void
+management_socket_set (struct management *man,
+ struct event_set *es,
+ void *arg,
+ unsigned int *persistent)
+{
+ switch (man->connection.state)
+ {
+ case MS_LISTEN:
+ if (man_persist_state (persistent, 1))
+ event_ctl (es, man->connection.sd_top, EVENT_READ, arg);
+ break;
+ case MS_CC_WAIT_READ:
+ if (man_persist_state (persistent, 2))
+ event_ctl (es, man->connection.sd_cli, EVENT_READ, arg);
+ break;
+ case MS_CC_WAIT_WRITE:
+ if (man_persist_state (persistent, 3))
+ event_ctl (es, man->connection.sd_cli, EVENT_WRITE, arg);
+ break;
+ case MS_INITIAL:
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+void
+management_io (struct management *man)
+{
+ switch (man->connection.state)
+ {
+ case MS_LISTEN:
+ man_accept (man);
+ break;
+ case MS_CC_WAIT_READ:
+ man_read (man);
+ break;
+ case MS_CC_WAIT_WRITE:
+ man_write (man);
+ break;
+ case MS_INITIAL:
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+#endif
+
+static inline bool
+man_standalone_ok (const struct management *man)
+{
+ return !man->settings.management_over_tunnel && man->connection.state != MS_INITIAL;
+}
+
+static bool
+man_check_for_signals (volatile int *signal_received)
+{
+ if (signal_received)
+ {
+ get_signal (signal_received);
+ if (*signal_received)
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Wait for socket I/O when outside primary event loop
+ */
+static int
+man_block (struct management *man, volatile int *signal_received, const time_t expire)
+{
+ struct timeval tv;
+ struct event_set_return esr;
+ int status = -1;
+
+ if (man_standalone_ok (man))
+ {
+ while (true)
+ {
+ event_reset (man->connection.es);
+ management_socket_set (man, man->connection.es, NULL, NULL);
+ tv.tv_usec = 0;
+ tv.tv_sec = 1;
+ if (man_check_for_signals (signal_received))
+ {
+ status = -1;
+ break;
+ }
+ status = event_wait (man->connection.es, &tv, &esr, 1);
+ update_time ();
+ if (man_check_for_signals (signal_received))
+ {
+ status = -1;
+ break;
+ }
+
+ if (status > 0)
+ break;
+ else if (expire && now >= expire)
+ {
+ /* set SIGINT signal if expiration time exceeded */
+ status = 0;
+ if (signal_received)
+ *signal_received = SIGINT;
+ break;
+ }
+ }
+ }
+ return status;
+}
+
+/*
+ * Perform management socket output outside primary event loop
+ */
+static void
+man_output_standalone (struct management *man, volatile int *signal_received)
+{
+ if (man_standalone_ok (man))
+ {
+ while (man->connection.state == MS_CC_WAIT_WRITE)
+ {
+ management_io (man);
+ if (man->connection.state == MS_CC_WAIT_WRITE)
+ man_block (man, signal_received, 0);
+ if (signal_received && *signal_received)
+ break;
+ }
+ }
+}
+
+/*
+ * Process management event loop outside primary event loop
+ */
+static int
+man_standalone_event_loop (struct management *man, volatile int *signal_received, const time_t expire)
+{
+ int status = -1;
+ if (man_standalone_ok (man))
+ {
+ status = man_block (man, signal_received, expire);
+ if (status > 0)
+ management_io (man);
+ }
+ return status;
+}
+
+#define MWCC_PASSWORD_WAIT (1<<0)
+#define MWCC_HOLD_WAIT (1<<1)
+#define MWCC_OTHER_WAIT (1<<2)
+
+/*
+ * Block until client connects
+ */
+static void
+man_wait_for_client_connection (struct management *man,
+ volatile int *signal_received,
+ const time_t expire,
+ unsigned int flags)
+{
+ ASSERT (man_standalone_ok (man));
+ if (man->connection.state == MS_LISTEN)
+ {
+ if (flags & MWCC_PASSWORD_WAIT)
+ msg (D_MANAGEMENT, "Need password(s) from management interface, waiting...");
+ if (flags & MWCC_HOLD_WAIT)
+ msg (D_MANAGEMENT, "Need hold release from management interface, waiting...");
+ if (flags & MWCC_OTHER_WAIT)
+ msg (D_MANAGEMENT, "Need information from management interface, waiting...");
+ do {
+ man_standalone_event_loop (man, signal_received, expire);
+ if (signal_received && *signal_received)
+ break;
+ } while (man->connection.state == MS_LISTEN || man_password_needed (man));
+ }
+}
+
+/*
+ * Process the management event loop for sec seconds
+ */
+void
+management_event_loop_n_seconds (struct management *man, int sec)
+{
+ if (man_standalone_ok (man))
+ {
+ volatile int signal_received = 0;
+ const bool standalone_disabled_save = man->persist.standalone_disabled;
+ time_t expire = 0;
+
+ man->persist.standalone_disabled = false; /* This is so M_CLIENT messages will be correctly passed through msg() */
+
+ /* set expire time */
+ update_time ();
+ if (sec)
+ expire = now + sec;
+
+ /* if no client connection, wait for one */
+ man_wait_for_client_connection (man, &signal_received, expire, 0);
+ if (signal_received)
+ return;
+
+ /* run command processing event loop */
+ do
+ {
+ man_standalone_event_loop (man, &signal_received, expire);
+ if (!signal_received)
+ man_check_for_signals (&signal_received);
+ if (signal_received)
+ return;
+ } while (expire);
+
+ /* revert state */
+ man->persist.standalone_disabled = standalone_disabled_save;
+ }
+ else
+ {
+ sleep (sec);
+ }
+}
+
+/*
+ * Get a username/password from management channel in standalone mode.
+ */
+bool
+management_query_user_pass (struct management *man,
+ struct user_pass *up,
+ const char *type,
+ const unsigned int flags,
+ const char *static_challenge)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+
+ if (man_standalone_ok (man))
+ {
+ volatile int signal_received = 0;
+ const bool standalone_disabled_save = man->persist.standalone_disabled;
+ struct buffer alert_msg = alloc_buf_gc (128, &gc);
+ const char *alert_type = NULL;
+ const char *prefix = NULL;
+ unsigned int up_query_mode = 0;
+#ifdef ENABLE_CLIENT_CR
+ const char *sc = NULL;
+#endif
+ ret = true;
+ man->persist.standalone_disabled = false; /* This is so M_CLIENT messages will be correctly passed through msg() */
+ man->persist.special_state_msg = NULL;
+
+ CLEAR (man->connection.up_query);
+
+ if (flags & GET_USER_PASS_NEED_OK)
+ {
+ up_query_mode = UP_QUERY_NEED_OK;
+ prefix= "NEED-OK";
+ alert_type = "confirmation";
+ }
+ else if (flags & GET_USER_PASS_NEED_STR)
+ {
+ up_query_mode = UP_QUERY_NEED_STR;
+ prefix= "NEED-STR";
+ alert_type = "string";
+ }
+ else if (flags & GET_USER_PASS_PASSWORD_ONLY)
+ {
+ up_query_mode = UP_QUERY_PASS;
+ prefix = "PASSWORD";
+ alert_type = "password";
+ }
+ else
+ {
+ up_query_mode = UP_QUERY_USER_PASS;
+ prefix = "PASSWORD";
+ alert_type = "username/password";
+#ifdef ENABLE_CLIENT_CR
+ if (static_challenge)
+ sc = static_challenge;
+#endif
+ }
+ buf_printf (&alert_msg, ">%s:Need '%s' %s",
+ prefix,
+ type,
+ alert_type);
+
+ if (flags & (GET_USER_PASS_NEED_OK | GET_USER_PASS_NEED_STR))
+ buf_printf (&alert_msg, " MSG:%s", up->username);
+
+#ifdef ENABLE_CLIENT_CR
+ if (sc)
+ buf_printf (&alert_msg, " SC:%d,%s",
+ BOOL_CAST(flags & GET_USER_PASS_STATIC_CHALLENGE_ECHO),
+ sc);
+#endif
+
+ man_wait_for_client_connection (man, &signal_received, 0, MWCC_PASSWORD_WAIT);
+ if (signal_received)
+ ret = false;
+
+ if (ret)
+ {
+ man->persist.special_state_msg = BSTR (&alert_msg);
+ msg (M_CLIENT, "%s", man->persist.special_state_msg);
+
+ /* tell command line parser which info we need */
+ man->connection.up_query_mode = up_query_mode;
+ man->connection.up_query_type = type;
+
+ /* run command processing event loop until we get our username/password/response */
+ do
+ {
+ man_standalone_event_loop (man, &signal_received, 0);
+ if (!signal_received)
+ man_check_for_signals (&signal_received);
+ if (signal_received)
+ {
+ ret = false;
+ break;
+ }
+ } while (!man->connection.up_query.defined);
+ }
+
+ /* revert state */
+ man->connection.up_query_mode = UP_QUERY_DISABLED;
+ man->connection.up_query_type = NULL;
+ man->persist.standalone_disabled = standalone_disabled_save;
+ man->persist.special_state_msg = NULL;
+
+ /* pass through blank passwords */
+ if (!strcmp (man->connection.up_query.password, blank_up))
+ CLEAR (man->connection.up_query.password);
+
+ /*
+ * Transfer u/p to return object, zero any record
+ * we hold in the management object.
+ */
+ if (ret)
+ {
+ man->connection.up_query.nocache = up->nocache; /* preserve caller's nocache setting */
+ *up = man->connection.up_query;
+ }
+ CLEAR (man->connection.up_query);
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+char * /* returns allocated base64 signature */
+management_query_rsa_sig (struct management *man,
+ const char *b64_data)
+{
+ struct gc_arena gc = gc_new ();
+ char *ret = NULL;
+ volatile int signal_received = 0;
+ struct buffer alert_msg = clear_buf();
+ struct buffer *buf;
+ const bool standalone_disabled_save = man->persist.standalone_disabled;
+ struct man_connection *mc = &man->connection;
+
+ if (man_standalone_ok (man))
+ {
+ man->persist.standalone_disabled = false; /* This is so M_CLIENT messages will be correctly passed through msg() */
+ man->persist.special_state_msg = NULL;
+
+ mc->ext_key_state = EKS_SOLICIT;
+
+ alert_msg = alloc_buf_gc (strlen(b64_data)+64, &gc);
+ buf_printf (&alert_msg, ">RSA_SIGN:%s", b64_data);
+
+ man_wait_for_client_connection (man, &signal_received, 0, MWCC_OTHER_WAIT);
+
+ if (signal_received)
+ goto done;
+
+ man->persist.special_state_msg = BSTR (&alert_msg);
+ msg (M_CLIENT, "%s", man->persist.special_state_msg);
+
+ /* run command processing event loop until we get our signature */
+ do
+ {
+ man_standalone_event_loop (man, &signal_received, 0);
+ if (!signal_received)
+ man_check_for_signals (&signal_received);
+ if (signal_received)
+ goto done;
+ } while (mc->ext_key_state != EKS_READY);
+
+ if (buffer_list_defined(mc->ext_key_input))
+ {
+ buffer_list_aggregate (mc->ext_key_input, 2048);
+ buf = buffer_list_peek (mc->ext_key_input);
+ if (buf && BLEN(buf) > 0)
+ {
+ ret = (char *) malloc(BLEN(buf)+1);
+ check_malloc_return(ret);
+ memcpy(ret, buf->data, BLEN(buf));
+ ret[BLEN(buf)] = '\0';
+ }
+ }
+ }
+
+ done:
+ if (mc->ext_key_state == EKS_READY && ret)
+ msg (M_CLIENT, "SUCCESS: rsa-sig command succeeded");
+ else if (mc->ext_key_state == EKS_INPUT || mc->ext_key_state == EKS_READY)
+ msg (M_CLIENT, "ERROR: rsa-sig command failed");
+
+ /* revert state */
+ man->persist.standalone_disabled = standalone_disabled_save;
+ man->persist.special_state_msg = NULL;
+ in_extra_reset (mc, IER_RESET);
+ mc->ext_key_state = EKS_UNDEF;
+ buffer_list_free (mc->ext_key_input);
+ mc->ext_key_input = NULL;
+
+ gc_free (&gc);
+ return ret;
+}
+
+#endif
+
+/*
+ * Return true if management_hold() would block
+ */
+bool
+management_would_hold (struct management *man)
+{
+ return (man->settings.flags & MF_HOLD) && !man->persist.hold_release && man_standalone_ok (man);
+}
+
+/*
+ * Return true if (from the management interface's perspective) OpenVPN should
+ * daemonize.
+ */
+bool
+management_should_daemonize (struct management *man)
+{
+ return management_would_hold (man) || (man->settings.flags & MF_QUERY_PASSWORDS);
+}
+
+/*
+ * If the hold flag is enabled, hibernate until a management client releases the hold.
+ * Return true if the caller should not sleep for an additional time interval.
+ */
+bool
+management_hold (struct management *man)
+{
+ if (management_would_hold (man))
+ {
+ volatile int signal_received = 0;
+ const bool standalone_disabled_save = man->persist.standalone_disabled;
+
+ man->persist.standalone_disabled = false; /* This is so M_CLIENT messages will be correctly passed through msg() */
+ man->persist.special_state_msg = NULL;
+ man->settings.mansig |= MANSIG_IGNORE_USR1_HUP;
+
+ man_wait_for_client_connection (man, &signal_received, 0, MWCC_HOLD_WAIT);
+
+ if (!signal_received)
+ {
+ man->persist.special_state_msg = ">HOLD:Waiting for hold release";
+ msg (M_CLIENT, "%s", man->persist.special_state_msg);
+
+ /* run command processing event loop until we get our username/password */
+ do
+ {
+ man_standalone_event_loop (man, &signal_received, 0);
+ if (!signal_received)
+ man_check_for_signals (&signal_received);
+ if (signal_received)
+ break;
+ } while (!man->persist.hold_release);
+ }
+
+ /* revert state */
+ man->persist.standalone_disabled = standalone_disabled_save;
+ man->persist.special_state_msg = NULL;
+ man->settings.mansig &= ~MANSIG_IGNORE_USR1_HUP;
+
+ return true;
+ }
+ return false;
+}
+
+/*
+ * struct command_line
+ */
+
+struct command_line *
+command_line_new (const int buf_len)
+{
+ struct command_line *cl;
+ ALLOC_OBJ_CLEAR (cl, struct command_line);
+ cl->buf = alloc_buf (buf_len);
+ cl->residual = alloc_buf (buf_len);
+ return cl;
+}
+
+void
+command_line_reset (struct command_line *cl)
+{
+ buf_clear (&cl->buf);
+ buf_clear (&cl->residual);
+}
+
+void
+command_line_free (struct command_line *cl)
+{
+ command_line_reset (cl);
+ free_buf (&cl->buf);
+ free_buf (&cl->residual);
+ free (cl);
+}
+
+void
+command_line_add (struct command_line *cl, const unsigned char *buf, const int len)
+{
+ int i;
+ for (i = 0; i < len; ++i)
+ {
+ if (buf[i] && char_class(buf[i], (CC_PRINT|CC_NEWLINE)))
+ {
+ if (!buf_write_u8 (&cl->buf, buf[i]))
+ buf_clear (&cl->buf);
+ }
+ }
+}
+
+const unsigned char *
+command_line_get (struct command_line *cl)
+{
+ int i;
+ const unsigned char *ret = NULL;
+
+ i = buf_substring_len (&cl->buf, '\n');
+ if (i >= 0)
+ {
+ buf_copy_excess (&cl->residual, &cl->buf, i);
+ buf_chomp (&cl->buf);
+ ret = (const unsigned char *) BSTR (&cl->buf);
+ }
+ return ret;
+}
+
+void
+command_line_next (struct command_line *cl)
+{
+ buf_clear (&cl->buf);
+ buf_copy (&cl->buf, &cl->residual);
+ buf_clear (&cl->residual);
+}
+
+/*
+ * struct log_entry
+ */
+
+const char *
+log_entry_print (const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (ERR_BUF_SIZE, gc);
+ if (flags & LOG_FATAL_NOTIFY)
+ buf_printf (&out, ">FATAL:");
+ if (flags & LOG_PRINT_LOG_PREFIX)
+ buf_printf (&out, ">LOG:");
+ if (flags & LOG_PRINT_ECHO_PREFIX)
+ buf_printf (&out, ">ECHO:");
+ if (flags & LOG_PRINT_STATE_PREFIX)
+ buf_printf (&out, ">STATE:");
+ if (flags & LOG_PRINT_INT_DATE)
+ buf_printf (&out, "%u,", (unsigned int)e->timestamp);
+ if (flags & LOG_PRINT_MSG_FLAGS)
+ buf_printf (&out, "%s,", msg_flags_string (e->u.msg_flags, gc));
+ if (flags & LOG_PRINT_STATE)
+ buf_printf (&out, "%s,", man_state_name (e->u.state));
+ if (flags & LOG_PRINT_INTVAL)
+ buf_printf (&out, "%d,", e->u.intval);
+ if (e->string)
+ buf_printf (&out, "%s", e->string);
+ if (flags & LOG_PRINT_LOCAL_IP)
+ buf_printf (&out, ",%s", print_in_addr_t (e->local_ip, IA_EMPTY_IF_UNDEF, gc));
+ if (flags & LOG_PRINT_REMOTE_IP)
+ buf_printf (&out, ",%s", print_in_addr_t (e->remote_ip, IA_EMPTY_IF_UNDEF, gc));
+ if (flags & LOG_ECHO_TO_LOG)
+ msg (D_MANAGEMENT, "MANAGEMENT: %s", BSTR (&out));
+ if (flags & LOG_PRINT_CRLF)
+ buf_printf (&out, "\r\n");
+ return BSTR (&out);
+}
+
+static void
+log_entry_free_contents (struct log_entry *e)
+{
+ if (e->string)
+ free ((char *)e->string);
+ CLEAR (*e);
+}
+
+/*
+ * struct log_history
+ */
+
+static inline int
+log_index (const struct log_history *h, int i)
+{
+ return modulo_add (h->base, i, h->capacity);
+}
+
+static void
+log_history_obj_init (struct log_history *h, int capacity)
+{
+ CLEAR (*h);
+ h->capacity = capacity;
+ ALLOC_ARRAY_CLEAR (h->array, struct log_entry, capacity);
+}
+
+struct log_history *
+log_history_init (const int capacity)
+{
+ struct log_history *h;
+ ASSERT (capacity > 0);
+ ALLOC_OBJ (h, struct log_history);
+ log_history_obj_init (h, capacity);
+ return h;
+}
+
+static void
+log_history_free_contents (struct log_history *h)
+{
+ int i;
+ for (i = 0; i < h->size; ++i)
+ log_entry_free_contents (&h->array[log_index(h, i)]);
+ free (h->array);
+}
+
+void
+log_history_close (struct log_history *h)
+{
+ log_history_free_contents (h);
+ free (h);
+}
+
+void
+log_history_add (struct log_history *h, const struct log_entry *le)
+{
+ struct log_entry *e;
+ ASSERT (h->size >= 0 && h->size <= h->capacity);
+ if (h->size == h->capacity)
+ {
+ e = &h->array[h->base];
+ log_entry_free_contents (e);
+ h->base = log_index (h, 1);
+ }
+ else
+ {
+ e = &h->array[log_index(h, h->size)];
+ ++h->size;
+ }
+
+ *e = *le;
+ e->string = string_alloc (le->string, NULL);
+}
+
+void
+log_history_resize (struct log_history *h, const int capacity)
+{
+ if (capacity != h->capacity)
+ {
+ struct log_history newlog;
+ int i;
+
+ ASSERT (capacity > 0);
+ log_history_obj_init (&newlog, capacity);
+
+ for (i = 0; i < h->size; ++i)
+ log_history_add (&newlog, &h->array[log_index(h, i)]);
+
+ log_history_free_contents (h);
+ *h = newlog;
+ }
+}
+
+const struct log_entry *
+log_history_ref (const struct log_history *h, const int index)
+{
+ if (index >= 0 && index < h->size)
+ return &h->array[log_index(h, (h->size - 1) - index)];
+ else
+ return NULL;
+}
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_MANAGEMENT */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.h
new file mode 100644
index 00000000..c48875c7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/manage.h
@@ -0,0 +1,579 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANAGE_H
+#define MANAGE_H
+
+#ifdef ENABLE_MANAGEMENT
+
+#include "misc.h"
+#include "event.h"
+#include "socket.h"
+#include "mroute.h"
+
+#define MANAGEMENT_VERSION 1
+#define MANAGEMENT_N_PASSWORD_RETRIES 3
+#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100
+#define MANAGEMENT_ECHO_BUFFER_SIZE 100
+#define MANAGEMENT_STATE_BUFFER_SIZE 100
+
+/*
+ * Management-interface-based deferred authentication
+ */
+#ifdef MANAGEMENT_DEF_AUTH
+struct man_def_auth_context {
+ unsigned long cid;
+
+#define DAF_CONNECTION_ESTABLISHED (1<<0)
+#define DAF_CONNECTION_CLOSED (1<<1)
+#define DAF_INITIAL_AUTH (1<<2)
+ unsigned int flags;
+
+ unsigned int mda_key_id_counter;
+
+ time_t bytecount_last_update;
+};
+#endif
+
+/*
+ * Manage build-up of command line
+ */
+struct command_line
+{
+ struct buffer buf;
+ struct buffer residual;
+};
+
+struct command_line *command_line_new (const int buf_len);
+void command_line_free (struct command_line *cl);
+
+void command_line_add (struct command_line *cl, const unsigned char *buf, const int len);
+const unsigned char *command_line_get (struct command_line *cl);
+void command_line_reset (struct command_line *cl);
+void command_line_next (struct command_line *cl);
+
+/*
+ * Manage log file history
+ */
+
+union log_entry_union {
+ unsigned int msg_flags;
+ int state;
+ int intval;
+};
+
+struct log_entry
+{
+ time_t timestamp;
+ const char *string;
+ in_addr_t local_ip;
+ in_addr_t remote_ip;
+ union log_entry_union u;
+};
+
+#define LOG_PRINT_LOG_PREFIX (1<<0)
+#define LOG_PRINT_ECHO_PREFIX (1<<1)
+#define LOG_PRINT_STATE_PREFIX (1<<2)
+
+#define LOG_PRINT_INT_DATE (1<<3)
+#define LOG_PRINT_MSG_FLAGS (1<<4)
+#define LOG_PRINT_STATE (1<<5)
+#define LOG_PRINT_LOCAL_IP (1<<6)
+
+#define LOG_PRINT_CRLF (1<<7)
+#define LOG_FATAL_NOTIFY (1<<8)
+
+#define LOG_PRINT_INTVAL (1<<9)
+
+#define LOG_PRINT_REMOTE_IP (1<<10)
+
+#define LOG_ECHO_TO_LOG (1<<11)
+
+const char *log_entry_print (const struct log_entry *e, unsigned int flags, struct gc_arena *gc);
+
+struct log_history
+{
+ int base;
+ int size;
+ int capacity;
+ struct log_entry *array;
+};
+
+struct log_history *log_history_init (const int capacity);
+void log_history_close (struct log_history *h);
+void log_history_add (struct log_history *h, const struct log_entry *le);
+void log_history_resize (struct log_history *h, const int capacity);
+const struct log_entry *log_history_ref (const struct log_history *h, const int index);
+
+static inline int
+log_history_size (const struct log_history *h)
+{
+ return h->size;
+}
+
+static inline int
+log_history_capacity (const struct log_history *h)
+{
+ return h->capacity;
+}
+
+/*
+ * Callbacks for 'status' and 'kill' commands.
+ * Also for management-based deferred authentication and packet filter.
+ */
+struct management_callback
+{
+ void *arg;
+
+# define MCF_SERVER (1<<0) /* is OpenVPN being run as a server? */
+ unsigned int flags;
+
+ void (*status) (void *arg, const int version, struct status_output *so);
+ void (*show_net) (void *arg, const int msglevel);
+ int (*kill_by_cn) (void *arg, const char *common_name);
+ int (*kill_by_addr) (void *arg, const in_addr_t addr, const int port);
+ void (*delete_event) (void *arg, event_t event);
+ int (*n_clients) (void *arg);
+#ifdef MANAGEMENT_DEF_AUTH
+ bool (*kill_by_cid) (void *arg, const unsigned long cid, const char *kill_msg);
+ bool (*client_auth) (void *arg,
+ const unsigned long cid,
+ const unsigned int mda_key_id,
+ const bool auth,
+ const char *reason,
+ const char *client_reason,
+ struct buffer_list *cc_config); /* ownership transferred */
+ char *(*get_peer_info) (void *arg, const unsigned long cid);
+#endif
+#ifdef MANAGEMENT_PF
+ bool (*client_pf) (void *arg,
+ const unsigned long cid,
+ struct buffer_list *pf_config); /* ownership transferred */
+#endif
+ bool (*proxy_cmd) (void *arg, const char **p);
+ bool (*remote_cmd) (void *arg, const char **p);
+#ifdef TARGET_ANDROID
+ int (*network_change) (void *arg);
+#endif
+};
+
+/*
+ * Management object, split into three components:
+ *
+ * struct man_persist : Data elements which are persistent across
+ * man_connection open and close.
+ *
+ * struct man_settings : management parameters.
+ *
+ * struct man_connection : created on socket binding and listen,
+ * deleted on socket unbind, may
+ * handle multiple sequential client
+ * connections.
+ */
+
+struct man_persist {
+ bool defined;
+
+ struct log_history *log;
+ struct virtual_output vout;
+
+ bool standalone_disabled;
+ struct management_callback callback;
+
+ struct log_history *echo; /* saved --echo strings */
+ struct log_history *state;
+
+ bool hold_release;
+
+ const char *special_state_msg;
+
+ counter_type bytes_in;
+ counter_type bytes_out;
+};
+
+struct man_settings {
+ bool defined;
+ unsigned int flags; /* MF_x flags */
+ struct addrinfo* local;
+#if UNIX_SOCK_SUPPORT
+ struct sockaddr_un local_unix;
+#endif
+ bool management_over_tunnel;
+ struct user_pass up;
+ int log_history_cache;
+ int echo_buffer_size;
+ int state_buffer_size;
+ char *write_peer_info_file;
+ int client_uid;
+ int client_gid;
+
+/* flags for handling the management interface "signal" command */
+# define MANSIG_IGNORE_USR1_HUP (1<<0)
+# define MANSIG_MAP_USR1_TO_HUP (1<<1)
+# define MANSIG_MAP_USR1_TO_TERM (1<<2)
+ unsigned int mansig;
+};
+
+/* up_query modes */
+#define UP_QUERY_DISABLED 0
+#define UP_QUERY_USER_PASS 1
+#define UP_QUERY_PASS 2
+#define UP_QUERY_NEED_OK 3
+#define UP_QUERY_NEED_STR 4
+
+/* states */
+#define MS_INITIAL 0 /* all sockets are closed */
+#define MS_LISTEN 1 /* no client is connected */
+#define MS_CC_WAIT_READ 2 /* client is connected, waiting for read on socket */
+#define MS_CC_WAIT_WRITE 3 /* client is connected, waiting for ability to write to socket */
+
+struct man_connection {
+ int state;
+
+ socket_descriptor_t sd_top;
+ socket_descriptor_t sd_cli;
+ struct openvpn_sockaddr remote;
+
+#ifdef WIN32
+ struct net_event_win32 ne32;
+#endif
+
+ bool halt;
+ bool password_verified;
+ int password_tries;
+
+ struct command_line *in;
+ struct buffer_list *out;
+
+#ifdef MANAGEMENT_IN_EXTRA
+# define IEC_UNDEF 0
+# define IEC_CLIENT_AUTH 1
+# define IEC_CLIENT_PF 2
+# define IEC_RSA_SIGN 3
+ int in_extra_cmd;
+ struct buffer_list *in_extra;
+#ifdef MANAGEMENT_DEF_AUTH
+ unsigned long in_extra_cid;
+ unsigned int in_extra_kid;
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+# define EKS_UNDEF 0
+# define EKS_SOLICIT 1
+# define EKS_INPUT 2
+# define EKS_READY 3
+ int ext_key_state;
+ struct buffer_list *ext_key_input;
+#endif
+#endif
+ struct event_set *es;
+ int env_filter_level;
+
+ bool state_realtime;
+ bool log_realtime;
+ bool echo_realtime;
+ int bytecount_update_seconds;
+ time_t bytecount_last_update;
+
+ const char *up_query_type;
+ int up_query_mode;
+ struct user_pass up_query;
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+ struct buffer_list *rsa_sig;
+#endif
+#ifdef TARGET_ANDROID
+ int fdtosend;
+ int lastfdreceived;
+#endif
+};
+
+struct management
+{
+ struct man_persist persist;
+ struct man_settings settings;
+ struct man_connection connection;
+};
+
+extern struct management *management;
+
+struct user_pass;
+
+struct management *management_init (void);
+
+/* management_open flags */
+# define MF_SERVER (1<<0)
+# define MF_QUERY_PASSWORDS (1<<1)
+# define MF_HOLD (1<<2)
+# define MF_SIGNAL (1<<3)
+# define MF_FORGET_DISCONNECT (1<<4)
+# define MF_CONNECT_AS_CLIENT (1<<5)
+#ifdef MANAGEMENT_DEF_AUTH
+# define MF_CLIENT_AUTH (1<<6)
+#endif
+#ifdef MANAGEMENT_PF
+# define MF_CLIENT_PF (1<<7)
+#endif
+# define MF_UNIX_SOCK (1<<8)
+#ifdef MANAGMENT_EXTERNAL_KEY
+# define MF_EXTERNAL_KEY (1<<9)
+#endif
+#define MF_UP_DOWN (1<<10)
+#define MF_QUERY_REMOTE (1<<11)
+#define MF_QUERY_PROXY (1<<12)
+
+bool management_open (struct management *man,
+ const char *addr,
+ const char *port,
+ const char *pass_file,
+ const char *client_user,
+ const char *client_group,
+ const int log_history_cache,
+ const int echo_buffer_size,
+ const int state_buffer_size,
+ const char *write_peer_info_file,
+ const int remap_sigusr1,
+ const unsigned int flags);
+
+void management_close (struct management *man);
+
+void management_post_tunnel_open (struct management *man, const in_addr_t tun_local_ip);
+
+void management_pre_tunnel_close (struct management *man);
+
+void management_socket_set (struct management *man,
+ struct event_set *es,
+ void *arg,
+ unsigned int *persistent);
+
+void management_io (struct management *man);
+
+void management_set_callback (struct management *man,
+ const struct management_callback *cb);
+
+void management_clear_callback (struct management *man);
+
+bool management_query_user_pass (struct management *man,
+ struct user_pass *up,
+ const char *type,
+ const unsigned int flags,
+ const char *static_challenge);
+
+#ifdef TARGET_ANDROID
+bool management_android_control (struct management *man, const char *command, const char *msg);
+
+#define ANDROID_KEEP_OLD_TUN 1
+#define ANDROID_OPEN_AFTER_CLOSE 2
+#define ANDROID_OPEN_BEFORE_CLOSE 3
+int managment_android_persisttun_action (struct management *man);
+#endif
+
+bool management_should_daemonize (struct management *man);
+bool management_would_hold (struct management *man);
+bool management_hold (struct management *man);
+
+void management_event_loop_n_seconds (struct management *man, int sec);
+
+void management_up_down(struct management *man, const char *updown, const struct env_set *es);
+
+void management_notify(struct management *man, const char *severity, const char *type, const char *text);
+
+void management_notify_generic (struct management *man, const char *str);
+
+#ifdef MANAGEMENT_DEF_AUTH
+void management_notify_client_needing_auth (struct management *management,
+ const unsigned int auth_id,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es);
+
+void management_connection_established (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es);
+
+void management_notify_client_close (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct env_set *es);
+
+void management_learn_addr (struct management *management,
+ struct man_def_auth_context *mdac,
+ const struct mroute_addr *addr,
+ const bool primary);
+#endif
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+char *management_query_rsa_sig (struct management *man, const char *b64_data);
+
+#endif
+
+static inline bool
+management_connected (const struct management *man)
+{
+ return man->connection.state == MS_CC_WAIT_READ || man->connection.state == MS_CC_WAIT_WRITE;
+}
+
+static inline bool
+management_query_user_pass_enabled (const struct management *man)
+{
+ return BOOL_CAST(man->settings.flags & MF_QUERY_PASSWORDS);
+}
+
+static inline bool
+management_query_remote_enabled (const struct management *man)
+{
+ return BOOL_CAST(man->settings.flags & MF_QUERY_REMOTE);
+}
+
+static inline bool
+management_query_proxy_enabled (const struct management *man)
+{
+ return BOOL_CAST(man->settings.flags & MF_QUERY_PROXY);
+}
+
+#ifdef MANAGEMENT_PF
+static inline bool
+management_enable_pf (const struct management *man)
+{
+ return man && BOOL_CAST(man->settings.flags & MF_CLIENT_PF);
+}
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+static inline bool
+management_enable_def_auth (const struct management *man)
+{
+ return man && BOOL_CAST(man->settings.flags & MF_CLIENT_AUTH);
+}
+#endif
+
+/*
+ * OpenVPN tells the management layer what state it's in
+ */
+
+/* client/server states */
+#define OPENVPN_STATE_INITIAL 0 /* Initial, undefined state */
+#define OPENVPN_STATE_CONNECTING 1 /* Management interface has been initialized */
+#define OPENVPN_STATE_ASSIGN_IP 2 /* Assigning IP address to virtual network interface */
+#define OPENVPN_STATE_ADD_ROUTES 3 /* Adding routes to system */
+#define OPENVPN_STATE_CONNECTED 4 /* Initialization sequence completed */
+#define OPENVPN_STATE_RECONNECTING 5 /* Restart */
+#define OPENVPN_STATE_EXITING 6 /* Exit */
+
+/* client-only states */
+#define OPENVPN_STATE_WAIT 7 /* Waiting for initial response from server */
+#define OPENVPN_STATE_AUTH 8 /* Authenticating with server */
+#define OPENVPN_STATE_GET_CONFIG 9 /* Downloading configuration from server */
+#define OPENVPN_STATE_RESOLVE 10 /* DNS lookup */
+#define OPENVPN_STATE_TCP_CONNECT 11 /* Connecting to TCP server */
+
+#define OPENVPN_STATE_CLIENT_BASE 7 /* Base index of client-only states */
+
+void management_set_state (struct management *man,
+ const int state,
+ const char *detail,
+ const in_addr_t tun_local_ip,
+ const in_addr_t tun_remote_ip);
+
+/*
+ * The management object keeps track of OpenVPN --echo
+ * parameters.
+ */
+void management_echo (struct management *man, const char *string, const bool pull);
+
+/*
+ * OpenVPN calls here to indicate a password failure
+ */
+
+void management_auth_failure (struct management *man, const char *type, const char *reason);
+
+/*
+ * Echo an authentication token to management interface
+ */
+void management_auth_token (struct management *man, const char *token);
+
+/*
+ * These functions drive the bytecount in/out counters.
+ */
+
+void man_bytecount_output_client (struct management *man);
+
+static inline void
+man_bytecount_possible_output_client (struct management *man)
+{
+ if (man->connection.bytecount_update_seconds > 0
+ && now >= man->connection.bytecount_last_update
+ + man->connection.bytecount_update_seconds)
+ man_bytecount_output_client (man);
+}
+
+static inline void
+management_bytes_out_client (struct management *man, const int size)
+{
+ man->persist.bytes_out += size;
+ man_bytecount_possible_output_client (man);
+}
+
+static inline void
+management_bytes_in_client (struct management *man, const int size)
+{
+ man->persist.bytes_in += size;
+ man_bytecount_possible_output_client (man);
+}
+
+static inline void
+management_bytes_out (struct management *man, const int size)
+{
+ if (!(man->persist.callback.flags & MCF_SERVER))
+ management_bytes_out_client (man, size);
+}
+
+static inline void
+management_bytes_in (struct management *man, const int size)
+{
+ if (!(man->persist.callback.flags & MCF_SERVER))
+ management_bytes_in_client (man, size);
+}
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+static inline void
+management_bytes_server (struct management *man,
+ const counter_type *bytes_in_total,
+ const counter_type *bytes_out_total,
+ struct man_def_auth_context *mdac)
+{
+ void man_bytecount_output_server (struct management *man,
+ const counter_type *bytes_in_total,
+ const counter_type *bytes_out_total,
+ struct man_def_auth_context *mdac);
+
+ if (man->connection.bytecount_update_seconds > 0
+ && now >= mdac->bytecount_last_update + man->connection.bytecount_update_seconds
+ && (mdac->flags & (DAF_CONNECTION_ESTABLISHED|DAF_CONNECTION_CLOSED)) == DAF_CONNECTION_ESTABLISHED)
+ man_bytecount_output_server (man, bytes_in_total, bytes_out_total, mdac);
+}
+
+#endif /* MANAGEMENT_DEF_AUTH */
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.c
new file mode 100644
index 00000000..82f23888
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.c
@@ -0,0 +1,175 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP
+
+#include "buffer.h"
+#include "error.h"
+#include "misc.h"
+#include "mbuf.h"
+
+#include "memdbg.h"
+
+struct mbuf_set *
+mbuf_init (unsigned int size)
+{
+ struct mbuf_set *ret;
+ ALLOC_OBJ_CLEAR (ret, struct mbuf_set);
+ ret->capacity = adjust_power_of_2 (size);
+ ALLOC_ARRAY (ret->array, struct mbuf_item, ret->capacity);
+ return ret;
+}
+
+void
+mbuf_free (struct mbuf_set *ms)
+{
+ if (ms)
+ {
+ int i;
+ for (i = 0; i < (int) ms->len; ++i)
+ {
+ struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)];
+ mbuf_free_buf (item->buffer);
+ }
+ free (ms->array);
+ free (ms);
+ }
+}
+
+struct mbuf_buffer *
+mbuf_alloc_buf (const struct buffer *buf)
+{
+ struct mbuf_buffer *ret;
+ ALLOC_OBJ (ret, struct mbuf_buffer);
+ ret->buf = clone_buf (buf);
+ ret->refcount = 1;
+ ret->flags = 0;
+ return ret;
+}
+
+void
+mbuf_free_buf (struct mbuf_buffer *mb)
+{
+ if (mb)
+ {
+ if (--mb->refcount <= 0)
+ {
+ free_buf (&mb->buf);
+ free (mb);
+ }
+ }
+}
+
+void
+mbuf_add_item (struct mbuf_set *ms, const struct mbuf_item *item)
+{
+ ASSERT (ms);
+ if (ms->len == ms->capacity)
+ {
+ struct mbuf_item rm;
+ ASSERT (mbuf_extract_item (ms, &rm));
+ mbuf_free_buf (rm.buffer);
+ msg (D_MULTI_DROPPED, "MBUF: mbuf packet dropped");
+ }
+
+ ASSERT (ms->len < ms->capacity);
+
+ ms->array[MBUF_INDEX(ms->head, ms->len, ms->capacity)] = *item;
+ if (++ms->len > ms->max_queued)
+ ms->max_queued = ms->len;
+ ++item->buffer->refcount;
+}
+
+bool
+mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item)
+{
+ bool ret = false;
+ if (ms)
+ {
+ while (ms->len)
+ {
+ *item = ms->array[ms->head];
+ ms->head = MBUF_INDEX(ms->head, 1, ms->capacity);
+ --ms->len;
+ if (item->instance) /* ignore dereferenced instances */
+ {
+ ret = true;
+ break;
+ }
+ }
+ }
+ return ret;
+}
+
+struct multi_instance *
+mbuf_peek_dowork (struct mbuf_set *ms)
+{
+ struct multi_instance *ret = NULL;
+ if (ms)
+ {
+ int i;
+ for (i = 0; i < (int) ms->len; ++i)
+ {
+ struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)];
+ if (item->instance)
+ {
+ ret = item->instance;
+ break;
+ }
+ }
+ }
+ return ret;
+}
+
+void
+mbuf_dereference_instance (struct mbuf_set *ms, struct multi_instance *mi)
+{
+ if (ms)
+ {
+ int i;
+ for (i = 0; i < (int) ms->len; ++i)
+ {
+ struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)];
+ if (item->instance == mi)
+ {
+ mbuf_free_buf (item->buffer);
+ item->buffer = NULL;
+ item->instance = NULL;
+ msg (D_MBUF, "MBUF: dereferenced queued packet");
+ }
+ }
+ }
+}
+
+#else
+static void dummy(void) {}
+#endif /* P2MP */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.h
new file mode 100644
index 00000000..1085adc7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mbuf.h
@@ -0,0 +1,109 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MBUF_H
+#define MBUF_H
+
+/*
+ * Handle both multicast and broadcast functions.
+ */
+
+#if P2MP
+
+/* define this to enable special test mode */
+/*#define MBUF_TEST*/
+
+#include "basic.h"
+#include "buffer.h"
+
+struct multi_instance;
+
+#define MBUF_INDEX(head, offset, size) (((head) + (offset)) & ((size)-1))
+
+struct mbuf_buffer
+{
+ struct buffer buf;
+ int refcount;
+
+# define MF_UNICAST (1<<0)
+ unsigned int flags;
+};
+
+struct mbuf_item
+{
+ struct mbuf_buffer *buffer;
+ struct multi_instance *instance;
+};
+
+struct mbuf_set
+{
+ unsigned int head;
+ unsigned int len;
+ unsigned int capacity;
+ unsigned int max_queued;
+ struct mbuf_item *array;
+};
+
+struct mbuf_set *mbuf_init (unsigned int size);
+void mbuf_free (struct mbuf_set *ms);
+
+struct mbuf_buffer *mbuf_alloc_buf (const struct buffer *buf);
+void mbuf_free_buf (struct mbuf_buffer *mb);
+
+void mbuf_add_item (struct mbuf_set *ms, const struct mbuf_item *item);
+
+bool mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item);
+
+void mbuf_dereference_instance (struct mbuf_set *ms, struct multi_instance *mi);
+
+static inline bool
+mbuf_defined (const struct mbuf_set *ms)
+{
+ return ms && ms->len;
+}
+
+static inline unsigned int
+mbuf_len (const struct mbuf_set *ms)
+{
+ return ms->len;
+}
+
+static inline int
+mbuf_maximum_queued (const struct mbuf_set *ms)
+{
+ return (int) ms->max_queued;
+}
+
+static inline struct multi_instance *
+mbuf_peek (struct mbuf_set *ms)
+{
+ struct multi_instance *mbuf_peek_dowork (struct mbuf_set *ms);
+ if (mbuf_defined (ms))
+ return mbuf_peek_dowork (ms);
+ else
+ return NULL;
+}
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/memdbg.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/memdbg.h
new file mode 100644
index 00000000..1f6bb676
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/memdbg.h
@@ -0,0 +1,114 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MEMDBG_H
+#define MEMDBG_H
+
+/*
+ * Valgrind debugging support.
+ *
+ * Valgrind is a great tool for debugging memory issues,
+ * though it seems to generate a lot of warnings in OpenSSL
+ * about uninitialized data. To silence these warnings,
+ * I've put together a suppressions file
+ * in debug/valgrind-suppress.
+ *
+ * Also, grep for VALGRIND_MAKE_READABLE in the OpenVPN source.
+ * Because valgrind thinks that some of the data passed from
+ * OpenSSL back to OpenVPN is tainted due to being sourced
+ * from uninitialized data, we need to untaint it before use --
+ * otherwise we will get a lot of useless warnings.
+ *
+ * valgrind --tool=memcheck --error-limit=no --suppressions=debug/valgrind-suppress --gen-suppressions=yes ./openvpn ...
+ */
+
+#ifdef USE_VALGRIND
+
+#include "valgrind/memcheck.h"
+
+#define VALGRIND_MAKE_READABLE(addr, len)
+
+#else
+
+#define VALGRIND_MAKE_READABLE(addr, len)
+
+#endif
+
+#ifdef DMALLOC /* see ./configure options to enable */
+
+/*
+ * See ./configure options to enable dmalloc
+ * support for memory leak checking.
+ *
+ * The dmalloc package can be downloaded from:
+ *
+ * http://dmalloc.com/
+ *
+ * When dmalloc is installed and enabled,
+ * use this command prior to running openvpn:
+ *
+ * dmalloc -l dlog -i 100 low -p log-unknown
+ *
+ * Also, put this in your .bashrc file:
+ *
+ * function dmalloc { eval `command dmalloc -b $*`; }
+ *
+ * Or take a more low-level approach:
+ *
+ * export DMALLOC_OPTIONS="debug=0x4e48503,inter=100,log=dlog"
+ *
+ * NOTE: When building dmalloc you need to add something
+ * like this to dmalloc's settings.h -- it will allocate a static
+ * buffer to be used as the malloc arena:
+ *
+ * #define INTERNAL_MEMORY_SPACE (1024 * 1024 * 50)
+ */
+
+#include "dmalloc.h"
+
+#define openvpn_dmalloc(file, line, size) dmalloc_malloc((file), (line), (size), DMALLOC_FUNC_MALLOC, 0, 0)
+
+/*
+ * This #define will put the line number of the log
+ * file position where leaked memory was allocated instead
+ * of the source code file and line number. Make sure
+ * to increase the size of dmalloc's info tables,
+ * (MEMORY_TABLE_SIZE in settings.h)
+ * otherwise it might get overwhelmed by the large
+ * number of unique file/line combinations.
+ */
+#if 0
+#undef malloc
+#define malloc(size) openvpn_dmalloc("logfile", x_msg_line_num, (size))
+#endif
+
+#endif /* DMALLOC */
+
+/*
+ * Force buffers to be zeroed after allocation.
+ * For debugging only.
+ */
+/*#define ZERO_BUFFER_ON_ALLOC*/
+
+#endif /* MEMDBG_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.c
new file mode 100644
index 00000000..63b4c1cf
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.c
@@ -0,0 +1,2118 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "misc.h"
+#include "base64.h"
+#include "tun.h"
+#include "error.h"
+#include "otime.h"
+#include "plugin.h"
+#include "options.h"
+#include "manage.h"
+#include "crypto.h"
+#include "route.h"
+#include "console.h"
+#include "win32.h"
+
+#include "memdbg.h"
+
+#ifdef ENABLE_IPROUTE
+const char *iproute_path = IPROUTE_PATH; /* GLOBAL */
+#endif
+
+/* contains an SSEC_x value defined in misc.h */
+int script_security = SSEC_BUILT_IN; /* GLOBAL */
+
+/*
+ * Pass tunnel endpoint and MTU parms to a user-supplied script.
+ * Used to execute the up/down script/plugins.
+ */
+void
+run_up_down (const char *command,
+ const struct plugin_list *plugins,
+ int plugin_type,
+ const char *arg,
+ const char *dev_type,
+ int tun_mtu,
+ int link_mtu,
+ const char *ifconfig_local,
+ const char* ifconfig_remote,
+ const char *context,
+ const char *signal_text,
+ const char *script_type,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (signal_text)
+ setenv_str (es, "signal", signal_text);
+ setenv_str (es, "script_context", context);
+ setenv_int (es, "tun_mtu", tun_mtu);
+ setenv_int (es, "link_mtu", link_mtu);
+ setenv_str (es, "dev", arg);
+ if (dev_type)
+ setenv_str (es, "dev_type", dev_type);
+
+ if (!ifconfig_local)
+ ifconfig_local = "";
+ if (!ifconfig_remote)
+ ifconfig_remote = "";
+ if (!context)
+ context = "";
+
+ if (plugin_defined (plugins, plugin_type))
+ {
+ struct argv argv = argv_new ();
+ ASSERT (arg);
+ argv_printf (&argv,
+ "%s %d %d %s %s %s",
+ arg,
+ tun_mtu, link_mtu,
+ ifconfig_local, ifconfig_remote,
+ context);
+
+ if (plugin_call (plugins, plugin_type, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ msg (M_FATAL, "ERROR: up/down plugin call failed");
+
+ argv_reset (&argv);
+ }
+
+ if (command)
+ {
+ struct argv argv = argv_new ();
+ ASSERT (arg);
+ setenv_str (es, "script_type", script_type);
+ argv_printf (&argv,
+ "%sc %s %d %d %s %s %s",
+ command,
+ arg,
+ tun_mtu, link_mtu,
+ ifconfig_local, ifconfig_remote,
+ context);
+ argv_msg (M_INFO, &argv);
+ openvpn_run_script (&argv, es, S_FATAL, "--up/--down");
+ argv_reset (&argv);
+ }
+
+ gc_free (&gc);
+}
+
+/* Get the file we will later write our process ID to */
+void
+get_pid_file (const char* filename, struct pid_state *state)
+{
+ CLEAR (*state);
+ if (filename)
+ {
+ state->fp = platform_fopen (filename, "w");
+ if (!state->fp)
+ msg (M_ERR, "Open error on pid file %s", filename);
+ state->filename = filename;
+ }
+}
+
+/* Write our PID to a file */
+void
+write_pid (const struct pid_state *state)
+{
+ if (state->filename && state->fp)
+ {
+ unsigned int pid = platform_getpid ();
+ fprintf(state->fp, "%u\n", pid);
+ if (fclose (state->fp))
+ msg (M_ERR, "Close error on pid file %s", state->filename);
+ }
+}
+
+/*
+ * Set standard file descriptors to /dev/null
+ */
+void
+set_std_files_to_null (bool stdin_only)
+{
+#if defined(HAVE_DUP) && defined(HAVE_DUP2)
+ int fd;
+ if ((fd = open ("/dev/null", O_RDWR, 0)) != -1)
+ {
+ dup2 (fd, 0);
+ if (!stdin_only)
+ {
+ dup2 (fd, 1);
+ dup2 (fd, 2);
+ }
+ if (fd > 2)
+ close (fd);
+ }
+#endif
+}
+
+/*
+ * dup inetd/xinetd socket descriptor and save
+ */
+
+int inetd_socket_descriptor = SOCKET_UNDEFINED; /* GLOBAL */
+
+void
+save_inetd_socket_descriptor (void)
+{
+ inetd_socket_descriptor = INETD_SOCKET_DESCRIPTOR;
+#if defined(HAVE_DUP) && defined(HAVE_DUP2)
+ /* use handle passed by inetd/xinetd */
+ if ((inetd_socket_descriptor = dup (INETD_SOCKET_DESCRIPTOR)) < 0)
+ msg (M_ERR, "INETD_SOCKET_DESCRIPTOR dup(%d) failed", INETD_SOCKET_DESCRIPTOR);
+ set_std_files_to_null (true);
+#endif
+}
+
+/*
+ * Warn if a given file is group/others accessible.
+ */
+void
+warn_if_group_others_accessible (const char* filename)
+{
+#ifndef WIN32
+#ifdef HAVE_STAT
+ if (strcmp (filename, INLINE_FILE_TAG))
+ {
+ struct stat st;
+ if (stat (filename, &st))
+ {
+ msg (M_WARN | M_ERRNO, "WARNING: cannot stat file '%s'", filename);
+ }
+ else
+ {
+ if (st.st_mode & (S_IRWXG|S_IRWXO))
+ msg (M_WARN, "WARNING: file '%s' is group or others accessible", filename);
+ }
+ }
+#endif
+#endif
+}
+
+/*
+ * Print an error message based on the status code returned by system().
+ */
+const char *
+system_error_message (int stat, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+#ifdef WIN32
+ if (stat == -1)
+ buf_printf (&out, "external program did not execute -- ");
+ buf_printf (&out, "returned error code %d", stat);
+#else
+ if (stat == -1)
+ buf_printf (&out, "external program fork failed");
+ else if (!WIFEXITED (stat))
+ buf_printf (&out, "external program did not exit normally");
+ else
+ {
+ const int cmd_ret = WEXITSTATUS (stat);
+ if (!cmd_ret)
+ buf_printf (&out, "external program exited normally");
+ else if (cmd_ret == 127)
+ buf_printf (&out, "could not execute external program");
+ else
+ buf_printf (&out, "external program exited with error status: %d", cmd_ret);
+ }
+#endif
+ return (const char *)out.data;
+}
+
+/*
+ * Wrapper around openvpn_execve
+ */
+bool
+openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message)
+{
+ struct gc_arena gc = gc_new ();
+ const int stat = openvpn_execve (a, es, flags);
+ int ret = false;
+
+ if (platform_system_ok (stat))
+ ret = true;
+ else
+ {
+ if (error_message)
+ msg (((flags & S_FATAL) ? M_FATAL : M_WARN), "%s: %s",
+ error_message,
+ system_error_message (stat, &gc));
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+bool
+openvpn_execve_allowed (const unsigned int flags)
+{
+ if (flags & S_SCRIPT)
+ return script_security >= SSEC_SCRIPTS;
+ else
+ return script_security >= SSEC_BUILT_IN;
+}
+
+
+#ifndef WIN32
+/*
+ * Run execve() inside a fork(). Designed to replicate the semantics of system() but
+ * in a safer way that doesn't require the invocation of a shell or the risks
+ * assocated with formatting and parsing a command line.
+ */
+int
+openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+ struct gc_arena gc = gc_new ();
+ int ret = -1;
+ static bool warn_shown = false;
+
+ if (a && a->argv[0])
+ {
+#if defined(ENABLE_FEATURE_EXECVE)
+ if (openvpn_execve_allowed (flags))
+ {
+ const char *cmd = a->argv[0];
+ char *const *argv = a->argv;
+ char *const *envp = (char *const *)make_env_array (es, true, &gc);
+ pid_t pid;
+
+ pid = fork ();
+ if (pid == (pid_t)0) /* child side */
+ {
+ execve (cmd, argv, envp);
+ exit (127);
+ }
+ else if (pid < (pid_t)0) /* fork failed */
+ msg (M_ERR, "openvpn_execve: unable to fork");
+ else /* parent side */
+ {
+ if (waitpid (pid, &ret, 0) != pid)
+ ret = -1;
+ }
+ }
+ else if (!warn_shown && (script_security < SSEC_SCRIPTS))
+ {
+ msg (M_WARN, SCRIPT_SECURITY_WARNING);
+ warn_shown = true;
+ }
+#else
+ msg (M_WARN, "openvpn_execve: execve function not available");
+#endif
+ }
+ else
+ {
+ msg (M_FATAL, "openvpn_execve: called with empty argv");
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+#endif
+
+/*
+ * Run execve() inside a fork(), duping stdout. Designed to replicate the semantics of popen() but
+ * in a safer way that doesn't require the invocation of a shell or the risks
+ * assocated with formatting and parsing a command line.
+ */
+int
+openvpn_popen (const struct argv *a, const struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+ int ret = -1;
+ static bool warn_shown = false;
+
+ if (a && a->argv[0])
+ {
+#if defined(ENABLE_FEATURE_EXECVE)
+ if (script_security >= SSEC_BUILT_IN)
+ {
+ const char *cmd = a->argv[0];
+ char *const *argv = a->argv;
+ char *const *envp = (char *const *)make_env_array (es, true, &gc);
+ pid_t pid;
+ int pipe_stdout[2];
+
+ if (pipe (pipe_stdout) == 0) {
+ pid = fork ();
+ if (pid == (pid_t)0) /* child side */
+ {
+ close (pipe_stdout[0]);
+ dup2 (pipe_stdout[1],1);
+ execve (cmd, argv, envp);
+ exit (127);
+ }
+ else if (pid < (pid_t)0) /* fork failed */
+ {
+ msg (M_ERR, "openvpn_popen: unable to fork");
+ }
+ else /* parent side */
+ {
+ ret=pipe_stdout[0];
+ close (pipe_stdout[1]);
+ }
+ }
+ else {
+ msg (M_WARN, "openvpn_popen: unable to create stdout pipe");
+ ret = -1;
+ }
+ }
+ else if (!warn_shown && (script_security < SSEC_SCRIPTS))
+ {
+ msg (M_WARN, SCRIPT_SECURITY_WARNING);
+ warn_shown = true;
+ }
+#else
+ msg (M_WARN, "openvpn_popen: execve function not available");
+#endif
+ }
+ else
+ {
+ msg (M_FATAL, "openvpn_popen: called with empty argv");
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+
+
+/*
+ * Initialize random number seed. random() is only used
+ * when "weak" random numbers are acceptable.
+ * OpenSSL routines are always used when cryptographically
+ * strong random numbers are required.
+ */
+
+void
+init_random_seed(void)
+{
+ struct timeval tv;
+
+ if (!gettimeofday (&tv, NULL))
+ {
+ const unsigned int seed = (unsigned int) tv.tv_sec ^ tv.tv_usec;
+ srandom (seed);
+ }
+}
+
+/* thread-safe strerror */
+
+const char *
+strerror_ts (int errnum, struct gc_arena *gc)
+{
+#ifdef HAVE_STRERROR
+ struct buffer out = alloc_buf_gc (256, gc);
+
+ buf_printf (&out, "%s", openvpn_strerror (errnum, gc));
+ return BSTR (&out);
+#else
+ return "[error string unavailable]";
+#endif
+}
+
+/*
+ * Set environmental variable (int or string).
+ *
+ * On Posix, we use putenv for portability,
+ * and put up with its painful semantics
+ * that require all the support code below.
+ */
+
+/* General-purpose environmental variable set functions */
+
+static char *
+construct_name_value (const char *name, const char *value, struct gc_arena *gc)
+{
+ struct buffer out;
+
+ ASSERT (name);
+ if (!value)
+ value = "";
+ out = alloc_buf_gc (strlen (name) + strlen (value) + 2, gc);
+ buf_printf (&out, "%s=%s", name, value);
+ return BSTR (&out);
+}
+
+bool
+deconstruct_name_value (const char *str, const char **name, const char **value, struct gc_arena *gc)
+{
+ char *cp;
+
+ ASSERT (str);
+ ASSERT (name && value);
+
+ *name = cp = string_alloc (str, gc);
+ *value = NULL;
+
+ while ((*cp))
+ {
+ if (*cp == '=' && !*value)
+ {
+ *cp = 0;
+ *value = cp + 1;
+ }
+ ++cp;
+ }
+ return *name && *value;
+}
+
+static bool
+env_string_equal (const char *s1, const char *s2)
+{
+ int c1, c2;
+ ASSERT (s1);
+ ASSERT (s2);
+
+ while (true)
+ {
+ c1 = *s1++;
+ c2 = *s2++;
+ if (c1 == '=')
+ c1 = 0;
+ if (c2 == '=')
+ c2 = 0;
+ if (!c1 && !c2)
+ return true;
+ if (c1 != c2)
+ break;
+ }
+ return false;
+}
+
+static bool
+remove_env_item (const char *str, const bool do_free, struct env_item **list)
+{
+ struct env_item *current, *prev;
+
+ ASSERT (str);
+ ASSERT (list);
+
+ for (current = *list, prev = NULL; current != NULL; current = current->next)
+ {
+ if (env_string_equal (current->string, str))
+ {
+ if (prev)
+ prev->next = current->next;
+ else
+ *list = current->next;
+ if (do_free)
+ {
+ memset (current->string, 0, strlen (current->string));
+ free (current->string);
+ free (current);
+ }
+ return true;
+ }
+ prev = current;
+ }
+ return false;
+}
+
+static void
+add_env_item (char *str, const bool do_alloc, struct env_item **list, struct gc_arena *gc)
+{
+ struct env_item *item;
+
+ ASSERT (str);
+ ASSERT (list);
+
+ ALLOC_OBJ_GC (item, struct env_item, gc);
+ item->string = do_alloc ? string_alloc (str, gc): str;
+ item->next = *list;
+ *list = item;
+}
+
+/* struct env_set functions */
+
+static bool
+env_set_del_nolock (struct env_set *es, const char *str)
+{
+ return remove_env_item (str, es->gc == NULL, &es->list);
+}
+
+static void
+env_set_add_nolock (struct env_set *es, const char *str)
+{
+ remove_env_item (str, es->gc == NULL, &es->list);
+ add_env_item ((char *)str, true, &es->list, es->gc);
+}
+
+struct env_set *
+env_set_create (struct gc_arena *gc)
+{
+ struct env_set *es;
+ ALLOC_OBJ_CLEAR_GC (es, struct env_set, gc);
+ es->list = NULL;
+ es->gc = gc;
+ return es;
+}
+
+void
+env_set_destroy (struct env_set *es)
+{
+ if (es && es->gc == NULL)
+ {
+ struct env_item *e = es->list;
+ while (e)
+ {
+ struct env_item *next = e->next;
+ free (e->string);
+ free (e);
+ e = next;
+ }
+ free (es);
+ }
+}
+
+bool
+env_set_del (struct env_set *es, const char *str)
+{
+ bool ret;
+ ASSERT (es);
+ ASSERT (str);
+ ret = env_set_del_nolock (es, str);
+ return ret;
+}
+
+void
+env_set_add (struct env_set *es, const char *str)
+{
+ ASSERT (es);
+ ASSERT (str);
+ env_set_add_nolock (es, str);
+}
+
+void
+env_set_print (int msglevel, const struct env_set *es)
+{
+ if (check_debug_level (msglevel))
+ {
+ const struct env_item *e;
+ int i;
+
+ if (es)
+ {
+ e = es->list;
+ i = 0;
+
+ while (e)
+ {
+ if (env_safe_to_print (e->string))
+ msg (msglevel, "ENV [%d] '%s'", i, e->string);
+ ++i;
+ e = e->next;
+ }
+ }
+ }
+}
+
+void
+env_set_inherit (struct env_set *es, const struct env_set *src)
+{
+ const struct env_item *e;
+
+ ASSERT (es);
+
+ if (src)
+ {
+ e = src->list;
+ while (e)
+ {
+ env_set_add_nolock (es, e->string);
+ e = e->next;
+ }
+ }
+}
+
+void
+env_set_add_to_environment (const struct env_set *es)
+{
+ if (es)
+ {
+ struct gc_arena gc = gc_new ();
+ const struct env_item *e;
+
+ e = es->list;
+
+ while (e)
+ {
+ const char *name;
+ const char *value;
+
+ if (deconstruct_name_value (e->string, &name, &value, &gc))
+ setenv_str (NULL, name, value);
+
+ e = e->next;
+ }
+ gc_free (&gc);
+ }
+}
+
+void
+env_set_remove_from_environment (const struct env_set *es)
+{
+ if (es)
+ {
+ struct gc_arena gc = gc_new ();
+ const struct env_item *e;
+
+ e = es->list;
+
+ while (e)
+ {
+ const char *name;
+ const char *value;
+
+ if (deconstruct_name_value (e->string, &name, &value, &gc))
+ setenv_del (NULL, name);
+
+ e = e->next;
+ }
+ gc_free (&gc);
+ }
+}
+
+/* add/modify/delete environmental strings */
+
+void
+setenv_counter (struct env_set *es, const char *name, counter_type value)
+{
+ char buf[64];
+ openvpn_snprintf (buf, sizeof(buf), counter_format, value);
+ setenv_str (es, name, buf);
+}
+
+void
+setenv_int (struct env_set *es, const char *name, int value)
+{
+ char buf[64];
+ openvpn_snprintf (buf, sizeof(buf), "%d", value);
+ setenv_str (es, name, buf);
+}
+
+void
+setenv_unsigned (struct env_set *es, const char *name, unsigned int value)
+{
+ char buf[64];
+ openvpn_snprintf (buf, sizeof(buf), "%u", value);
+ setenv_str (es, name, buf);
+}
+
+void
+setenv_str (struct env_set *es, const char *name, const char *value)
+{
+ setenv_str_ex (es, name, value, CC_NAME, 0, 0, CC_PRINT, 0, 0);
+}
+
+void
+setenv_str_safe (struct env_set *es, const char *name, const char *value)
+{
+ uint8_t b[64];
+ struct buffer buf;
+ buf_set_write (&buf, b, sizeof (b));
+ if (buf_printf (&buf, "OPENVPN_%s", name))
+ setenv_str (es, BSTR(&buf), value);
+ else
+ msg (M_WARN, "setenv_str_safe: name overflow");
+}
+
+void
+setenv_del (struct env_set *es, const char *name)
+{
+ ASSERT (name);
+ setenv_str (es, name, NULL);
+}
+
+void
+setenv_str_ex (struct env_set *es,
+ const char *name,
+ const char *value,
+ const unsigned int name_include,
+ const unsigned int name_exclude,
+ const char name_replace,
+ const unsigned int value_include,
+ const unsigned int value_exclude,
+ const char value_replace)
+{
+ struct gc_arena gc = gc_new ();
+ const char *name_tmp;
+ const char *val_tmp = NULL;
+
+ ASSERT (name && strlen (name) > 1);
+
+ name_tmp = string_mod_const (name, name_include, name_exclude, name_replace, &gc);
+
+ if (value)
+ val_tmp = string_mod_const (value, value_include, value_exclude, value_replace, &gc);
+
+ ASSERT (es);
+
+ if (val_tmp)
+ {
+ const char *str = construct_name_value (name_tmp, val_tmp, &gc);
+ env_set_add (es, str);
+#if DEBUG_VERBOSE_SETENV
+ msg (M_INFO, "SETENV_ES '%s'", str);
+#endif
+ }
+ else
+ env_set_del (es, name_tmp);
+
+ gc_free (&gc);
+}
+
+/*
+ * Setenv functions that append an integer index to the name
+ */
+static const char *
+setenv_format_indexed_name (const char *name, const int i, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (strlen (name) + 16, gc);
+ if (i >= 0)
+ buf_printf (&out, "%s_%d", name, i);
+ else
+ buf_printf (&out, "%s", name);
+ return BSTR (&out);
+}
+
+void
+setenv_int_i (struct env_set *es, const char *name, const int value, const int i)
+{
+ struct gc_arena gc = gc_new ();
+ const char *name_str = setenv_format_indexed_name (name, i, &gc);
+ setenv_int (es, name_str, value);
+ gc_free (&gc);
+}
+
+void
+setenv_str_i (struct env_set *es, const char *name, const char *value, const int i)
+{
+ struct gc_arena gc = gc_new ();
+ const char *name_str = setenv_format_indexed_name (name, i, &gc);
+ setenv_str (es, name_str, value);
+ gc_free (&gc);
+}
+
+/*
+ * taken from busybox networking/ifupdown.c
+ */
+unsigned int
+count_bits(unsigned int a)
+{
+ unsigned int result;
+ result = (a & 0x55) + ((a >> 1) & 0x55);
+ result = (result & 0x33) + ((result >> 2) & 0x33);
+ return((result & 0x0F) + ((result >> 4) & 0x0F));
+}
+
+int
+count_netmask_bits(const char *dotted_quad)
+{
+ unsigned int result, a, b, c, d;
+ /* Found a netmask... Check if it is dotted quad */
+ if (sscanf(dotted_quad, "%u.%u.%u.%u", &a, &b, &c, &d) != 4)
+ return -1;
+ result = count_bits(a);
+ result += count_bits(b);
+ result += count_bits(c);
+ result += count_bits(d);
+ return ((int)result);
+}
+
+/* return true if filename can be opened for read */
+bool
+test_file (const char *filename)
+{
+ bool ret = false;
+ if (filename)
+ {
+ FILE *fp = platform_fopen (filename, "r");
+ if (fp)
+ {
+ fclose (fp);
+ ret = true;
+ }
+ else
+ {
+ if( openvpn_errno () == EACCES ) {
+ msg( M_WARN | M_ERRNO, "Could not access file '%s'", filename);
+ }
+ }
+ }
+
+ dmsg (D_TEST_FILE, "TEST FILE '%s' [%d]",
+ filename ? filename : "UNDEF",
+ ret);
+
+ return ret;
+}
+
+#ifdef ENABLE_CRYPTO
+
+/* create a temporary filename in directory */
+const char *
+create_temp_file (const char *directory, const char *prefix, struct gc_arena *gc)
+{
+ static unsigned int counter;
+ struct buffer fname = alloc_buf_gc (256, gc);
+ int fd;
+ const char *retfname = NULL;
+ unsigned int attempts = 0;
+
+ do
+ {
+ uint8_t rndbytes[16];
+ const char *rndstr;
+
+ ++attempts;
+ ++counter;
+
+ prng_bytes (rndbytes, sizeof rndbytes);
+ rndstr = format_hex_ex (rndbytes, sizeof rndbytes, 40, 0, NULL, gc);
+ buf_printf (&fname, PACKAGE "_%s_%s.tmp", prefix, rndstr);
+
+ retfname = gen_path (directory, BSTR (&fname), gc);
+ if (!retfname)
+ {
+ msg (M_FATAL, "Failed to create temporary filename and path");
+ return NULL;
+ }
+
+ /* Atomically create the file. Errors out if the file already
+ exists. */
+ fd = platform_open (retfname, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
+ if (fd != -1)
+ {
+ close (fd);
+ return retfname;
+ }
+ else if (fd == -1 && errno != EEXIST)
+ {
+ /* Something else went wrong, no need to retry. */
+ struct gc_arena gcerr = gc_new ();
+ msg (M_FATAL, "Could not create temporary file '%s': %s",
+ retfname, strerror_ts (errno, &gcerr));
+ gc_free (&gcerr);
+ return NULL;
+ }
+ }
+ while (attempts < 6);
+
+ msg (M_FATAL, "Failed to create temporary file after %i attempts", attempts);
+ return NULL;
+}
+
+/*
+ * Prepend a random string to hostname to prevent DNS caching.
+ * For example, foo.bar.gov would be modified to <random-chars>.foo.bar.gov.
+ * Of course, this requires explicit support in the DNS server (wildcard).
+ */
+const char *
+hostname_randomize(const char *hostname, struct gc_arena *gc)
+{
+# define n_rnd_bytes 6
+
+ uint8_t rnd_bytes[n_rnd_bytes];
+ const char *rnd_str;
+ struct buffer hname = alloc_buf_gc (strlen(hostname)+sizeof(rnd_bytes)*2+4, gc);
+
+ prng_bytes (rnd_bytes, sizeof (rnd_bytes));
+ rnd_str = format_hex_ex (rnd_bytes, sizeof (rnd_bytes), 40, 0, NULL, gc);
+ buf_printf(&hname, "%s.%s", rnd_str, hostname);
+ return BSTR(&hname);
+# undef n_rnd_bytes
+}
+
+#else
+
+const char *
+hostname_randomize(const char *hostname, struct gc_arena *gc)
+{
+ msg (M_WARN, "WARNING: hostname randomization disabled when crypto support is not compiled");
+ return hostname;
+}
+
+#endif
+
+/*
+ * Put a directory and filename together.
+ */
+const char *
+gen_path (const char *directory, const char *filename, struct gc_arena *gc)
+{
+#if WIN32
+ const int CC_PATH_RESERVED = CC_LESS_THAN|CC_GREATER_THAN|CC_COLON|
+ CC_DOUBLE_QUOTE|CC_SLASH|CC_BACKSLASH|CC_PIPE|CC_QUESTION_MARK|CC_ASTERISK;
+#else
+ const int CC_PATH_RESERVED = CC_SLASH;
+#endif
+ const char *safe_filename = string_mod_const (filename, CC_PRINT, CC_PATH_RESERVED, '_', gc);
+
+ if (safe_filename
+ && strcmp (safe_filename, ".")
+ && strcmp (safe_filename, "..")
+#ifdef WIN32
+ && win_safe_filename (safe_filename)
+#endif
+ )
+ {
+ const size_t outsize = strlen(safe_filename) + (directory ? strlen (directory) : 0) + 16;
+ struct buffer out = alloc_buf_gc (outsize, gc);
+ char dirsep[2];
+
+ dirsep[0] = OS_SPECIFIC_DIRSEP;
+ dirsep[1] = '\0';
+
+ if (directory)
+ buf_printf (&out, "%s%s", directory, dirsep);
+ buf_printf (&out, "%s", safe_filename);
+
+ return BSTR (&out);
+ }
+ else
+ return NULL;
+}
+
+bool
+absolute_pathname (const char *pathname)
+{
+ if (pathname)
+ {
+ const int c = pathname[0];
+#ifdef WIN32
+ return c == '\\' || (isalpha(c) && pathname[1] == ':' && pathname[2] == '\\');
+#else
+ return c == '/';
+#endif
+ }
+ else
+ return false;
+}
+
+/*
+ * Get and store a username/password
+ */
+
+bool
+get_user_pass_cr (struct user_pass *up,
+ const char *auth_file,
+ const char *prefix,
+ const unsigned int flags,
+ const char *auth_challenge)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (!up->defined)
+ {
+ const bool from_stdin = (!auth_file || !strcmp (auth_file, "stdin"));
+
+ if (flags & GET_USER_PASS_PREVIOUS_CREDS_FAILED)
+ msg (M_WARN, "Note: previous '%s' credentials failed", prefix);
+
+#ifdef ENABLE_MANAGEMENT
+ /*
+ * Get username/password from management interface?
+ */
+ if (management
+ && ((auth_file && streq (auth_file, "management")) || (from_stdin && (flags & GET_USER_PASS_MANAGEMENT)))
+ && management_query_user_pass_enabled (management))
+ {
+ const char *sc = NULL;
+
+ if (flags & GET_USER_PASS_PREVIOUS_CREDS_FAILED)
+ management_auth_failure (management, prefix, "previous auth credentials failed");
+
+#ifdef ENABLE_CLIENT_CR
+ if (auth_challenge && (flags & GET_USER_PASS_STATIC_CHALLENGE))
+ sc = auth_challenge;
+#endif
+ if (!management_query_user_pass (management, up, prefix, flags, sc))
+ {
+ if ((flags & GET_USER_PASS_NOFATAL) != 0)
+ return false;
+ else
+ msg (M_FATAL, "ERROR: could not read %s username/password/ok/string from management interface", prefix);
+ }
+ }
+ else
+#endif
+ /*
+ * Get NEED_OK confirmation from the console
+ */
+ if (flags & GET_USER_PASS_NEED_OK)
+ {
+ struct buffer user_prompt = alloc_buf_gc (128, &gc);
+
+ buf_printf (&user_prompt, "NEED-OK|%s|%s:", prefix, up->username);
+
+ if (!get_console_input (BSTR (&user_prompt), true, up->password, USER_PASS_LEN))
+ msg (M_FATAL, "ERROR: could not read %s ok-confirmation from stdin", prefix);
+
+ if (!strlen (up->password))
+ strcpy (up->password, "ok");
+ }
+
+ /*
+ * Get username/password from standard input?
+ */
+ else if (from_stdin)
+ {
+#ifdef ENABLE_CLIENT_CR
+ if (auth_challenge && (flags & GET_USER_PASS_DYNAMIC_CHALLENGE))
+ {
+ struct auth_challenge_info *ac = get_auth_challenge (auth_challenge, &gc);
+ if (ac)
+ {
+ char *response = (char *) gc_malloc (USER_PASS_LEN, false, &gc);
+ struct buffer packed_resp;
+
+ buf_set_write (&packed_resp, (uint8_t*)up->password, USER_PASS_LEN);
+ msg (M_INFO|M_NOPREFIX, "CHALLENGE: %s", ac->challenge_text);
+ if (!get_console_input ("Response:", BOOL_CAST(ac->flags&CR_ECHO), response, USER_PASS_LEN))
+ msg (M_FATAL, "ERROR: could not read challenge response from stdin");
+ strncpynt (up->username, ac->user, USER_PASS_LEN);
+ buf_printf (&packed_resp, "CRV1::%s::%s", ac->state_id, response);
+ }
+ else
+ {
+ msg (M_FATAL, "ERROR: received malformed challenge request from server");
+ }
+ }
+ else
+#endif
+ {
+ struct buffer user_prompt = alloc_buf_gc (128, &gc);
+ struct buffer pass_prompt = alloc_buf_gc (128, &gc);
+
+ buf_printf (&user_prompt, "Enter %s Username:", prefix);
+ buf_printf (&pass_prompt, "Enter %s Password:", prefix);
+
+ if (!(flags & GET_USER_PASS_PASSWORD_ONLY))
+ {
+ if (!get_console_input (BSTR (&user_prompt), true, up->username, USER_PASS_LEN))
+ msg (M_FATAL, "ERROR: could not read %s username from stdin", prefix);
+ if (strlen (up->username) == 0)
+ msg (M_FATAL, "ERROR: %s username is empty", prefix);
+ }
+
+ if (!get_console_input (BSTR (&pass_prompt), false, up->password, USER_PASS_LEN))
+ msg (M_FATAL, "ERROR: could not not read %s password from stdin", prefix);
+
+#ifdef ENABLE_CLIENT_CR
+ if (auth_challenge && (flags & GET_USER_PASS_STATIC_CHALLENGE))
+ {
+ char *response = (char *) gc_malloc (USER_PASS_LEN, false, &gc);
+ struct buffer packed_resp;
+ char *pw64=NULL, *resp64=NULL;
+
+ msg (M_INFO|M_NOPREFIX, "CHALLENGE: %s", auth_challenge);
+ if (!get_console_input ("Response:", BOOL_CAST(flags & GET_USER_PASS_STATIC_CHALLENGE_ECHO), response, USER_PASS_LEN))
+ msg (M_FATAL, "ERROR: could not read static challenge response from stdin");
+ if (openvpn_base64_encode(up->password, strlen(up->password), &pw64) == -1
+ || openvpn_base64_encode(response, strlen(response), &resp64) == -1)
+ msg (M_FATAL, "ERROR: could not base64-encode password/static_response");
+ buf_set_write (&packed_resp, (uint8_t*)up->password, USER_PASS_LEN);
+ buf_printf (&packed_resp, "SCRV1:%s:%s", pw64, resp64);
+ string_clear(pw64);
+ free(pw64);
+ string_clear(resp64);
+ free(resp64);
+ }
+#endif
+ }
+ }
+ else
+ {
+ /*
+ * Get username/password from a file.
+ */
+ FILE *fp;
+
+#ifndef ENABLE_PASSWORD_SAVE
+ /*
+ * Unless ENABLE_PASSWORD_SAVE is defined, don't allow sensitive passwords
+ * to be read from a file.
+ */
+ if (flags & GET_USER_PASS_SENSITIVE)
+ msg (M_FATAL, "Sorry, '%s' password cannot be read from a file", prefix);
+#endif
+
+ warn_if_group_others_accessible (auth_file);
+
+ fp = platform_fopen (auth_file, "r");
+ if (!fp)
+ msg (M_ERR, "Error opening '%s' auth file: %s", prefix, auth_file);
+
+ if (flags & GET_USER_PASS_PASSWORD_ONLY)
+ {
+ if (fgets (up->password, USER_PASS_LEN, fp) == NULL)
+ msg (M_FATAL, "Error reading password from %s authfile: %s",
+ prefix,
+ auth_file);
+ }
+ else
+ {
+ if (fgets (up->username, USER_PASS_LEN, fp) == NULL
+ || fgets (up->password, USER_PASS_LEN, fp) == NULL)
+ msg (M_FATAL, "Error reading username and password (must be on two consecutive lines) from %s authfile: %s",
+ prefix,
+ auth_file);
+ }
+
+ fclose (fp);
+
+ chomp (up->username);
+ chomp (up->password);
+
+ if (!(flags & GET_USER_PASS_PASSWORD_ONLY) && strlen (up->username) == 0)
+ msg (M_FATAL, "ERROR: username from %s authfile '%s' is empty", prefix, auth_file);
+ }
+
+ string_mod (up->username, CC_PRINT, CC_CRLF, 0);
+ string_mod (up->password, CC_PRINT, CC_CRLF, 0);
+
+ up->defined = true;
+ }
+
+#if 0
+ msg (M_INFO, "GET_USER_PASS %s u='%s' p='%s'", prefix, up->username, up->password);
+#endif
+
+ gc_free (&gc);
+
+ return true;
+}
+
+#ifdef ENABLE_CLIENT_CR
+
+/*
+ * See management/management-notes.txt for more info on the
+ * the dynamic challenge/response protocol implemented here.
+ */
+struct auth_challenge_info *
+get_auth_challenge (const char *auth_challenge, struct gc_arena *gc)
+{
+ if (auth_challenge)
+ {
+ struct auth_challenge_info *ac;
+ const int len = strlen (auth_challenge);
+ char *work = (char *) gc_malloc (len+1, false, gc);
+ char *cp;
+
+ struct buffer b;
+ buf_set_read (&b, (const uint8_t *)auth_challenge, len);
+
+ ALLOC_OBJ_CLEAR_GC (ac, struct auth_challenge_info, gc);
+
+ /* parse prefix */
+ if (!buf_parse(&b, ':', work, len))
+ return NULL;
+ if (strcmp(work, "CRV1"))
+ return NULL;
+
+ /* parse flags */
+ if (!buf_parse(&b, ':', work, len))
+ return NULL;
+ for (cp = work; *cp != '\0'; ++cp)
+ {
+ const char c = *cp;
+ if (c == 'E')
+ ac->flags |= CR_ECHO;
+ else if (c == 'R')
+ ac->flags |= CR_RESPONSE;
+ }
+
+ /* parse state ID */
+ if (!buf_parse(&b, ':', work, len))
+ return NULL;
+ ac->state_id = string_alloc(work, gc);
+
+ /* parse user name */
+ if (!buf_parse(&b, ':', work, len))
+ return NULL;
+ ac->user = (char *) gc_malloc (strlen(work)+1, true, gc);
+ openvpn_base64_decode(work, (void*)ac->user, -1);
+
+ /* parse challenge text */
+ ac->challenge_text = string_alloc(BSTR(&b), gc);
+
+ return ac;
+ }
+ else
+ return NULL;
+}
+
+#endif
+
+#if AUTO_USERID
+
+void
+get_user_pass_auto_userid (struct user_pass *up, const char *tag)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer buf;
+ uint8_t macaddr[6];
+ static uint8_t digest [MD5_DIGEST_LENGTH];
+ static const uint8_t hashprefix[] = "AUTO_USERID_DIGEST";
+
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+ md_ctx_t ctx;
+
+ CLEAR (*up);
+ buf_set_write (&buf, (uint8_t*)up->username, USER_PASS_LEN);
+ buf_printf (&buf, "%s", TARGET_PREFIX);
+ if (get_default_gateway_mac_addr (macaddr))
+ {
+ dmsg (D_AUTO_USERID, "GUPAU: macaddr=%s", format_hex_ex (macaddr, sizeof (macaddr), 0, 1, ":", &gc));
+ md_ctx_init(&ctx, md5_kt);
+ md_ctx_update(&ctx, hashprefix, sizeof (hashprefix) - 1);
+ md_ctx_update(&ctx, macaddr, sizeof (macaddr));
+ md_ctx_final(&ctx, digest);
+ md_ctx_cleanup(&ctx)
+ buf_printf(&buf, "%s", format_hex_ex (digest, sizeof (digest), 0, 256, " ", &gc));
+ }
+ else
+ {
+ buf_printf (&buf, "UNKNOWN");
+ }
+ if (tag && strcmp (tag, "stdin"))
+ buf_printf (&buf, "-%s", tag);
+ up->defined = true;
+ gc_free (&gc);
+
+ dmsg (D_AUTO_USERID, "GUPAU: AUTO_USERID: '%s'", up->username);
+}
+
+#endif
+
+void
+purge_user_pass (struct user_pass *up, const bool force)
+{
+ const bool nocache = up->nocache;
+ static bool warn_shown = false;
+ if (nocache || force)
+ {
+ CLEAR (*up);
+ up->nocache = nocache;
+ }
+ else if (!warn_shown)
+ {
+ msg (M_WARN, "WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this");
+ warn_shown = true;
+ }
+}
+
+void
+set_auth_token (struct user_pass *up, const char *token)
+{
+ if (token && strlen(token) && up && up->defined && !up->nocache)
+ {
+ CLEAR (up->password);
+ strncpynt (up->password, token, USER_PASS_LEN);
+ }
+}
+
+/*
+ * Process string received by untrusted peer before
+ * printing to console or log file.
+ *
+ * Assumes that string has been null terminated.
+ */
+const char *
+safe_print (const char *str, struct gc_arena *gc)
+{
+ return string_mod_const (str, CC_PRINT, CC_CRLF, '.', gc);
+}
+
+static bool
+is_password_env_var (const char *str)
+{
+ return (strncmp (str, "password", 8) == 0);
+}
+
+bool
+env_allowed (const char *str)
+{
+ return (script_security >= SSEC_PW_ENV || !is_password_env_var (str));
+}
+
+bool
+env_safe_to_print (const char *str)
+{
+#ifndef UNSAFE_DEBUG
+ if (is_password_env_var (str))
+ return false;
+#endif
+ return true;
+}
+
+/* Make arrays of strings */
+
+const char **
+make_env_array (const struct env_set *es,
+ const bool check_allowed,
+ struct gc_arena *gc)
+{
+ char **ret = NULL;
+ struct env_item *e = NULL;
+ int i = 0, n = 0;
+
+ /* figure length of es */
+ if (es)
+ {
+ for (e = es->list; e != NULL; e = e->next)
+ ++n;
+ }
+
+ /* alloc return array */
+ ALLOC_ARRAY_CLEAR_GC (ret, char *, n+1, gc);
+
+ /* fill return array */
+ if (es)
+ {
+ i = 0;
+ for (e = es->list; e != NULL; e = e->next)
+ {
+ if (!check_allowed || env_allowed (e->string))
+ {
+ ASSERT (i < n);
+ ret[i++] = e->string;
+ }
+ }
+ }
+
+ ret[i] = NULL;
+ return (const char **)ret;
+}
+
+const char **
+make_arg_array (const char *first, const char *parms, struct gc_arena *gc)
+{
+ char **ret = NULL;
+ int base = 0;
+ const int max_parms = MAX_PARMS + 2;
+ int n = 0;
+
+ /* alloc return array */
+ ALLOC_ARRAY_CLEAR_GC (ret, char *, max_parms, gc);
+
+ /* process first parameter, if provided */
+ if (first)
+ {
+ ret[base++] = string_alloc (first, gc);
+ }
+
+ if (parms)
+ {
+ n = parse_line (parms, &ret[base], max_parms - base - 1, "make_arg_array", 0, M_WARN, gc);
+ ASSERT (n >= 0 && n + base + 1 <= max_parms);
+ }
+ ret[base + n] = NULL;
+
+ return (const char **)ret;
+}
+
+static const char **
+make_inline_array (const char *str, struct gc_arena *gc)
+{
+ char line[OPTION_LINE_SIZE];
+ struct buffer buf;
+ int len = 0;
+ char **ret = NULL;
+ int i = 0;
+
+ buf_set_read (&buf, (const uint8_t *) str, strlen (str));
+ while (buf_parse (&buf, '\n', line, sizeof (line)))
+ ++len;
+
+ /* alloc return array */
+ ALLOC_ARRAY_CLEAR_GC (ret, char *, len + 1, gc);
+
+ buf_set_read (&buf, (const uint8_t *) str, strlen(str));
+ while (buf_parse (&buf, '\n', line, sizeof (line)))
+ {
+ chomp (line);
+ ASSERT (i < len);
+ ret[i] = string_alloc (skip_leading_whitespace (line), gc);
+ ++i;
+ }
+ ASSERT (i <= len);
+ ret[i] = NULL;
+ return (const char **)ret;
+}
+
+static const char **
+make_arg_copy (char **p, struct gc_arena *gc)
+{
+ char **ret = NULL;
+ const int len = string_array_len ((const char **)p);
+ const int max_parms = len + 1;
+ int i;
+
+ /* alloc return array */
+ ALLOC_ARRAY_CLEAR_GC (ret, char *, max_parms, gc);
+
+ for (i = 0; i < len; ++i)
+ ret[i] = p[i];
+
+ return (const char **)ret;
+}
+
+const char **
+make_extended_arg_array (char **p, struct gc_arena *gc)
+{
+ const int argc = string_array_len ((const char **)p);
+ if (!strcmp (p[0], INLINE_FILE_TAG) && argc == 2)
+ return make_inline_array (p[1], gc);
+ else
+ if (argc == 0)
+ return make_arg_array (NULL, NULL, gc);
+ else if (argc == 1)
+ return make_arg_array (p[0], NULL, gc);
+ else if (argc == 2)
+ return make_arg_array (p[0], p[1], gc);
+ else
+ return make_arg_copy (p, gc);
+}
+
+void
+openvpn_sleep (const int n)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_event_loop_n_seconds (management, n);
+ return;
+ }
+#endif
+ sleep (n);
+}
+
+/*
+ * Return the next largest power of 2
+ * or u if u is a power of 2.
+ */
+size_t
+adjust_power_of_2 (size_t u)
+{
+ size_t ret = 1;
+
+ while (ret < u)
+ {
+ ret <<= 1;
+ ASSERT (ret > 0);
+ }
+
+ return ret;
+}
+
+/*
+ * A printf-like function (that only recognizes a subset of standard printf
+ * format operators) that prints arguments to an argv list instead
+ * of a standard string. This is used to build up argv arrays for passing
+ * to execve.
+ */
+
+void
+argv_init (struct argv *a)
+{
+ a->capacity = 0;
+ a->argc = 0;
+ a->argv = NULL;
+ a->system_str = NULL;
+}
+
+struct argv
+argv_new (void)
+{
+ struct argv ret;
+ argv_init (&ret);
+ return ret;
+}
+
+void
+argv_reset (struct argv *a)
+{
+ size_t i;
+ for (i = 0; i < a->argc; ++i)
+ free (a->argv[i]);
+ free (a->argv);
+ free (a->system_str);
+ argv_init (a);
+}
+
+static void
+argv_extend (struct argv *a, const size_t newcap)
+{
+ if (newcap > a->capacity)
+ {
+ char **newargv;
+ size_t i;
+ ALLOC_ARRAY_CLEAR (newargv, char *, newcap);
+ for (i = 0; i < a->argc; ++i)
+ newargv[i] = a->argv[i];
+ free (a->argv);
+ a->argv = newargv;
+ a->capacity = newcap;
+ }
+}
+
+static void
+argv_grow (struct argv *a, const size_t add)
+{
+ const size_t newargc = a->argc + add + 1;
+ ASSERT (newargc > a->argc);
+ argv_extend (a, adjust_power_of_2 (newargc));
+}
+
+static void
+argv_append (struct argv *a, char *str) /* str must have been malloced or be NULL */
+{
+ argv_grow (a, 1);
+ a->argv[a->argc++] = str;
+}
+
+static void
+argv_system_str_append (struct argv *a, const char *str, const bool enquote)
+{
+ if (str)
+ {
+ char *newstr;
+
+ /* compute length of new system_str */
+ size_t l = strlen (str) + 1; /* space for new string plus trailing '\0' */
+ if (a->system_str)
+ l += strlen (a->system_str) + 1; /* space for existing string + space (" ") separator */
+ if (enquote)
+ l += 2; /* space for two quotes */
+
+ /* build new system_str */
+ newstr = (char *) malloc (l);
+ newstr[0] = '\0';
+ check_malloc_return (newstr);
+ if (a->system_str)
+ {
+ strcpy (newstr, a->system_str);
+ strcat (newstr, " ");
+ }
+ if (enquote)
+ strcat (newstr, "\"");
+ strcat (newstr, str);
+ if (enquote)
+ strcat (newstr, "\"");
+ free (a->system_str);
+ a->system_str = newstr;
+ }
+}
+
+static char *
+argv_extract_cmd_name (const char *path)
+{
+ if (path)
+ {
+ char *path_cp = strdup(path); /* POSIX basename() implementaions may modify its arguments */
+ const char *bn = basename (path_cp);
+ if (bn)
+ {
+ char *ret = string_alloc (bn, NULL);
+ char *dot = strrchr (ret, '.');
+ if (dot)
+ *dot = '\0';
+ free(path_cp);
+ if (ret[0] != '\0')
+ return ret;
+ }
+ }
+ return NULL;
+}
+
+const char *
+argv_system_str (const struct argv *a)
+{
+ return a->system_str;
+}
+
+struct argv
+argv_clone (const struct argv *a, const size_t headroom)
+{
+ struct argv r;
+ size_t i;
+
+ argv_init (&r);
+ for (i = 0; i < headroom; ++i)
+ argv_append (&r, NULL);
+ if (a)
+ {
+ for (i = 0; i < a->argc; ++i)
+ argv_append (&r, string_alloc (a->argv[i], NULL));
+ r.system_str = string_alloc (a->system_str, NULL);
+ }
+ return r;
+}
+
+struct argv
+argv_insert_head (const struct argv *a, const char *head)
+{
+ struct argv r;
+ char *s;
+
+ r = argv_clone (a, 1);
+ r.argv[0] = string_alloc (head, NULL);
+ s = r.system_str;
+ r.system_str = string_alloc (head, NULL);
+ if (s)
+ {
+ argv_system_str_append (&r, s, false);
+ free (s);
+ }
+ return r;
+}
+
+char *
+argv_term (const char **f)
+{
+ const char *p = *f;
+ const char *term = NULL;
+ size_t termlen = 0;
+
+ if (*p == '\0')
+ return NULL;
+
+ while (true)
+ {
+ const int c = *p;
+ if (c == '\0')
+ break;
+ if (term)
+ {
+ if (!isspace (c))
+ ++termlen;
+ else
+ break;
+ }
+ else
+ {
+ if (!isspace (c))
+ {
+ term = p;
+ termlen = 1;
+ }
+ }
+ ++p;
+ }
+ *f = p;
+
+ if (term)
+ {
+ char *ret;
+ ASSERT (termlen > 0);
+ ret = malloc (termlen + 1);
+ check_malloc_return (ret);
+ memcpy (ret, term, termlen);
+ ret[termlen] = '\0';
+ return ret;
+ }
+ else
+ return NULL;
+}
+
+const char *
+argv_str (const struct argv *a, struct gc_arena *gc, const unsigned int flags)
+{
+ if (a->argv)
+ return print_argv ((const char **)a->argv, gc, flags);
+ else
+ return "";
+}
+
+void
+argv_msg (const int msglev, const struct argv *a)
+{
+ struct gc_arena gc = gc_new ();
+ msg (msglev, "%s", argv_str (a, &gc, 0));
+ gc_free (&gc);
+}
+
+void
+argv_msg_prefix (const int msglev, const struct argv *a, const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+ msg (msglev, "%s: %s", prefix, argv_str (a, &gc, 0));
+ gc_free (&gc);
+}
+
+void
+argv_printf (struct argv *a, const char *format, ...)
+{
+ va_list arglist;
+ va_start (arglist, format);
+ argv_printf_arglist (a, format, 0, arglist);
+ va_end (arglist);
+ }
+
+void
+argv_printf_cat (struct argv *a, const char *format, ...)
+{
+ va_list arglist;
+ va_start (arglist, format);
+ argv_printf_arglist (a, format, APA_CAT, arglist);
+ va_end (arglist);
+}
+
+void
+argv_printf_arglist (struct argv *a, const char *format, const unsigned int flags, va_list arglist)
+{
+ struct gc_arena gc = gc_new ();
+ char *term;
+ const char *f = format;
+
+ if (!(flags & APA_CAT))
+ argv_reset (a);
+ argv_extend (a, 1); /* ensure trailing NULL */
+
+ while ((term = argv_term (&f)) != NULL)
+ {
+ if (term[0] == '%')
+ {
+ if (!strcmp (term, "%s"))
+ {
+ char *s = va_arg (arglist, char *);
+ if (!s)
+ s = "";
+ argv_append (a, string_alloc (s, NULL));
+ argv_system_str_append (a, s, true);
+ }
+ else if (!strcmp (term, "%sc"))
+ {
+ char *s = va_arg (arglist, char *);
+ if (s)
+ {
+ int nparms;
+ char *parms[MAX_PARMS+1];
+ int i;
+
+ nparms = parse_line (s, parms, MAX_PARMS, "SCRIPT-ARGV", 0, D_ARGV_PARSE_CMD, &gc);
+ if (nparms)
+ {
+ for (i = 0; i < nparms; ++i)
+ argv_append (a, string_alloc (parms[i], NULL));
+ }
+ else
+ argv_append (a, string_alloc (s, NULL));
+
+ argv_system_str_append (a, s, false);
+ }
+ else
+ {
+ argv_append (a, string_alloc ("", NULL));
+ argv_system_str_append (a, "echo", false);
+ }
+ }
+ else if (!strcmp (term, "%d"))
+ {
+ char numstr[64];
+ openvpn_snprintf (numstr, sizeof (numstr), "%d", va_arg (arglist, int));
+ argv_append (a, string_alloc (numstr, NULL));
+ argv_system_str_append (a, numstr, false);
+ }
+ else if (!strcmp (term, "%u"))
+ {
+ char numstr[64];
+ openvpn_snprintf (numstr, sizeof (numstr), "%u", va_arg (arglist, unsigned int));
+ argv_append (a, string_alloc (numstr, NULL));
+ argv_system_str_append (a, numstr, false);
+ }
+ else if (!strcmp (term, "%s/%d"))
+ {
+ char numstr[64];
+ char *s = va_arg (arglist, char *);
+
+ if (!s)
+ s = "";
+
+ openvpn_snprintf (numstr, sizeof (numstr), "%d", va_arg (arglist, int));
+
+ {
+ const size_t len = strlen(s) + strlen(numstr) + 2;
+ char *combined = (char *) malloc (len);
+ check_malloc_return (combined);
+
+ strcpy (combined, s);
+ strcat (combined, "/");
+ strcat (combined, numstr);
+ argv_append (a, combined);
+ argv_system_str_append (a, combined, false);
+ }
+ }
+ else if (!strcmp (term, "%s%sc"))
+ {
+ char *s1 = va_arg (arglist, char *);
+ char *s2 = va_arg (arglist, char *);
+ char *combined;
+ char *cmd_name;
+
+ if (!s1) s1 = "";
+ if (!s2) s2 = "";
+ combined = (char *) malloc (strlen(s1) + strlen(s2) + 1);
+ check_malloc_return (combined);
+ strcpy (combined, s1);
+ strcat (combined, s2);
+ argv_append (a, combined);
+
+ cmd_name = argv_extract_cmd_name (combined);
+ if (cmd_name)
+ {
+ argv_system_str_append (a, cmd_name, false);
+ free (cmd_name);
+ }
+ }
+ else
+ ASSERT (0);
+ free (term);
+ }
+ else
+ {
+ argv_append (a, term);
+ argv_system_str_append (a, term, false);
+ }
+ }
+ gc_free (&gc);
+}
+
+#ifdef ARGV_TEST
+void
+argv_test (void)
+{
+ struct gc_arena gc = gc_new ();
+ const char *s;
+
+ struct argv a;
+
+ argv_init (&a);
+ argv_printf (&a, "%sc foo bar %s", "c:\\\\src\\\\test\\\\jyargs.exe", "foo bar");
+ argv_msg_prefix (M_INFO, &a, "ARGV");
+ msg (M_INFO, "ARGV-S: %s", argv_system_str(&a));
+ /*openvpn_execve_check (&a, NULL, 0, "command failed");*/
+
+ argv_printf (&a, "%sc %s %s", "c:\\\\src\\\\test files\\\\batargs.bat", "foo", "bar");
+ argv_msg_prefix (M_INFO, &a, "ARGV");
+ msg (M_INFO, "ARGV-S: %s", argv_system_str(&a));
+ /*openvpn_execve_check (&a, NULL, 0, "command failed");*/
+
+ argv_printf (&a, "%s%sc foo bar %s %s/%d %d %u", "/foo", "/bar.exe", "one two", "1.2.3.4", 24, -69, 96);
+ argv_msg_prefix (M_INFO, &a, "ARGV");
+ msg (M_INFO, "ARGV-S: %s", argv_system_str(&a));
+ /*openvpn_execve_check (&a, NULL, 0, "command failed");*/
+
+ argv_printf (&a, "this is a %s test of int %d unsigned %u", "FOO", -69, 42);
+ s = argv_str (&a, &gc, PA_BRACKET);
+ printf ("PF: %s\n", s);
+ printf ("PF-S: %s\n", argv_system_str(&a));
+
+ {
+ struct argv b = argv_insert_head (&a, "MARK");
+ s = argv_str (&b, &gc, PA_BRACKET);
+ printf ("PF: %s\n", s);
+ printf ("PF-S: %s\n", argv_system_str(&b));
+ argv_reset (&b);
+ }
+
+ argv_printf (&a, "%sc foo bar %d", "\"multi term\" command following \\\"spaces", 99);
+ s = argv_str (&a, &gc, PA_BRACKET);
+ printf ("PF: %s\n", s);
+ printf ("PF-S: %s\n", argv_system_str(&a));
+ argv_reset (&a);
+
+ s = argv_str (&a, &gc, PA_BRACKET);
+ printf ("PF: %s\n", s);
+ printf ("PF-S: %s\n", argv_system_str(&a));
+ argv_reset (&a);
+
+ argv_printf (&a, "foo bar %d", 99);
+ argv_printf_cat (&a, "bar %d foo %sc", 42, "nonesuch");
+ argv_printf_cat (&a, "cool %s %d u %s/%d end", "frood", 4, "hello", 7);
+ s = argv_str (&a, &gc, PA_BRACKET);
+ printf ("PF: %s\n", s);
+ printf ("PF-S: %s\n", argv_system_str(&a));
+ argv_reset (&a);
+
+#if 0
+ {
+ char line[512];
+ while (fgets (line, sizeof(line), stdin) != NULL)
+ {
+ char *term;
+ const char *f = line;
+ int i = 0;
+
+ while ((term = argv_term (&f)) != NULL)
+ {
+ printf ("[%d] '%s'\n", i, term);
+ ++i;
+ free (term);
+ }
+ }
+ }
+#endif
+
+ argv_reset (&a);
+ gc_free (&gc);
+}
+#endif
+
+/*
+ * Remove security-sensitive strings from control message
+ * so that they will not be output to log file.
+ */
+const char *
+sanitize_control_message(const char *src, struct gc_arena *gc)
+{
+ char *ret = gc_malloc (strlen(src)+1, false, gc);
+ char *dest = ret;
+ bool redact = false;
+ int skip = 0;
+
+ for (;;)
+ {
+ const char c = *src;
+ if (c == '\0')
+ break;
+ if (c == 'S' && !strncmp(src, "SESS_ID_", 8))
+ {
+ skip = 7;
+ redact = true;
+ }
+ else if (c == 'e' && !strncmp(src, "echo ", 5))
+ {
+ skip = 4;
+ redact = true;
+ }
+
+ if (c == ',') /* end of redacted item? */
+ {
+ skip = 0;
+ redact = false;
+ }
+
+ if (redact)
+ {
+ if (skip > 0)
+ {
+ --skip;
+ *dest++ = c;
+ }
+ }
+ else
+ *dest++ = c;
+
+ ++src;
+ }
+ *dest = '\0';
+ return ret;
+}
+
+/**
+ * Will set or query for a global compat flag. To modify the compat flags
+ * the COMPAT_FLAG_SET must be bitwise ORed together with the flag to set.
+ * If no "operator" flag is given it defaults to COMPAT_FLAG_QUERY,
+ * which returns the flag state.
+ *
+ * @param flag Flag to be set/queried for bitwise ORed with the operator flag
+ * @return Returns 0 if the flag is not set, otherwise the 'flag' value is returned
+ */
+bool
+compat_flag (unsigned int flag)
+{
+ static unsigned int compat_flags = 0;
+
+ if (flag & COMPAT_FLAG_SET)
+ compat_flags |= (flag >> 1);
+
+ return (compat_flags & (flag >> 1));
+
+}
+
+#if P2MP_SERVER
+
+/* helper to parse peer_info received from multi client, validate
+ * (this is untrusted data) and put into environment
+ */
+bool
+validate_peer_info_line(char *line)
+{
+ uint8_t c;
+ int state = 0;
+ while (*line)
+ {
+ c = *line;
+ switch (state)
+ {
+ case 0:
+ case 1:
+ if (c == '=' && state == 1)
+ state = 2;
+ else if (isalnum(c) || c == '_')
+ state = 1;
+ else
+ return false;
+ case 2:
+ /* after the '=', replace non-printable or shell meta with '_' */
+ if (!isprint(c) || isspace(c) ||
+ c == '$' || c == '(' || c == '`' )
+ *line = '_';
+ }
+ line++;
+ }
+ return (state == 2);
+}
+
+void
+output_peer_info_env (struct env_set *es, const char * peer_info)
+{
+ char line[256];
+ struct buffer buf;
+ buf_set_read (&buf, (const uint8_t *) peer_info, strlen(peer_info));
+ while (buf_parse (&buf, '\n', line, sizeof (line)))
+ {
+ chomp (line);
+ if (validate_peer_info_line(line) &&
+ (strncmp(line, "IV_", 3) == 0 || strncmp(line, "UV_", 3) == 0) )
+ {
+ msg (M_INFO, "peer info: %s", line);
+ env_set_add(es, line);
+ }
+ else
+ msg (M_WARN, "validation failed on peer_info line received from client");
+ }
+}
+
+#endif /* P2MP_SERVER */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.h
new file mode 100644
index 00000000..41748bd8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/misc.h
@@ -0,0 +1,379 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MISC_H
+#define MISC_H
+
+#include "basic.h"
+#include "common.h"
+#include "integer.h"
+#include "buffer.h"
+#include "platform.h"
+
+/* socket descriptor passed by inetd/xinetd server to us */
+#define INETD_SOCKET_DESCRIPTOR 0
+
+/* forward declarations */
+struct plugin_list;
+
+/* used by argv_x functions */
+struct argv {
+ size_t capacity;
+ size_t argc;
+ char **argv;
+ char *system_str;
+};
+
+/*
+ * Handle environmental variable lists
+ */
+
+struct env_item {
+ char *string;
+ struct env_item *next;
+};
+
+struct env_set {
+ struct gc_arena *gc;
+ struct env_item *list;
+};
+
+void run_up_down (const char *command,
+ const struct plugin_list *plugins,
+ int plugin_type,
+ const char *arg,
+ const char *dev_type,
+ int tun_mtu,
+ int link_mtu,
+ const char *ifconfig_local,
+ const char* ifconfig_remote,
+ const char *context,
+ const char *signal_text,
+ const char *script_type,
+ struct env_set *es);
+
+/* workspace for get_pid_file/write_pid */
+struct pid_state {
+ FILE *fp;
+ const char *filename;
+};
+
+void get_pid_file (const char* filename, struct pid_state *state);
+void write_pid (const struct pid_state *state);
+
+/* check file protections */
+void warn_if_group_others_accessible(const char* filename);
+
+/* system flags */
+#define S_SCRIPT (1<<0)
+#define S_FATAL (1<<1)
+
+const char *system_error_message (int, struct gc_arena *gc);
+
+/* wrapper around the execve() call */
+int openvpn_popen (const struct argv *a, const struct env_set *es);
+int openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned int flags);
+bool openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message);
+bool openvpn_execve_allowed (const unsigned int flags);
+
+static inline bool
+openvpn_run_script (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *hook)
+{
+ char msg[256];
+
+ openvpn_snprintf(msg, sizeof(msg), "WARNING: Failed running command (%s)", hook);
+ return openvpn_execve_check(a, es, flags | S_SCRIPT, msg);
+}
+
+
+#ifdef HAVE_STRERROR
+/* a thread-safe version of strerror */
+const char* strerror_ts (int errnum, struct gc_arena *gc);
+#endif
+
+/* Set standard file descriptors to /dev/null */
+void set_std_files_to_null (bool stdin_only);
+
+/* dup inetd/xinetd socket descriptor and save */
+extern int inetd_socket_descriptor;
+void save_inetd_socket_descriptor (void);
+
+/* init random() function, only used as source for weak random numbers, when !ENABLE_CRYPTO */
+void init_random_seed(void);
+
+/* set/delete environmental variable */
+void setenv_str_ex (struct env_set *es,
+ const char *name,
+ const char *value,
+ const unsigned int name_include,
+ const unsigned int name_exclude,
+ const char name_replace,
+ const unsigned int value_include,
+ const unsigned int value_exclude,
+ const char value_replace);
+
+void setenv_counter (struct env_set *es, const char *name, counter_type value);
+void setenv_int (struct env_set *es, const char *name, int value);
+void setenv_unsigned (struct env_set *es, const char *name, unsigned int value);
+void setenv_str (struct env_set *es, const char *name, const char *value);
+void setenv_str_safe (struct env_set *es, const char *name, const char *value);
+void setenv_del (struct env_set *es, const char *name);
+
+void setenv_int_i (struct env_set *es, const char *name, const int value, const int i);
+void setenv_str_i (struct env_set *es, const char *name, const char *value, const int i);
+
+/* struct env_set functions */
+
+struct env_set *env_set_create (struct gc_arena *gc);
+void env_set_destroy (struct env_set *es);
+bool env_set_del (struct env_set *es, const char *str);
+void env_set_add (struct env_set *es, const char *str);
+
+void env_set_print (int msglevel, const struct env_set *es);
+
+void env_set_inherit (struct env_set *es, const struct env_set *src);
+
+void env_set_add_to_environment (const struct env_set *es);
+void env_set_remove_from_environment (const struct env_set *es);
+
+/* Make arrays of strings */
+
+const char **make_env_array (const struct env_set *es,
+ const bool check_allowed,
+ struct gc_arena *gc);
+
+const char **make_arg_array (const char *first, const char *parms, struct gc_arena *gc);
+const char **make_extended_arg_array (char **p, struct gc_arena *gc);
+
+/* convert netmasks for iproute2 */
+int count_netmask_bits(const char *);
+unsigned int count_bits(unsigned int );
+
+/* an analogue to the random() function, but use OpenSSL functions if available */
+#ifdef ENABLE_CRYPTO
+long int get_random(void);
+#else
+#define get_random random
+#endif
+
+/* return true if filename can be opened for read */
+bool test_file (const char *filename);
+
+/* create a temporary file in directory, returns the filename of the created file */
+const char *create_temp_file (const char *directory, const char *prefix, struct gc_arena *gc);
+
+/* put a directory and filename together */
+const char *gen_path (const char *directory, const char *filename, struct gc_arena *gc);
+
+/* return true if pathname is absolute */
+bool absolute_pathname (const char *pathname);
+
+/* prepend a random prefix to hostname (need ENABLE_CRYPTO) */
+const char *hostname_randomize(const char *hostname, struct gc_arena *gc);
+
+/*
+ * Get and store a username/password
+ */
+
+struct user_pass
+{
+ bool defined;
+ bool nocache;
+
+/* max length of username/password */
+# ifdef ENABLE_PKCS11
+# define USER_PASS_LEN 4096
+# else
+# define USER_PASS_LEN 128
+# endif
+ char username[USER_PASS_LEN];
+ char password[USER_PASS_LEN];
+};
+
+#ifdef ENABLE_CLIENT_CR
+/*
+ * Challenge response info on client as pushed by server.
+ */
+struct auth_challenge_info {
+# define CR_ECHO (1<<0) /* echo response when typed by user */
+# define CR_RESPONSE (1<<1) /* response needed */
+ unsigned int flags;
+
+ const char *user;
+ const char *state_id;
+ const char *challenge_text;
+};
+
+struct auth_challenge_info *get_auth_challenge (const char *auth_challenge, struct gc_arena *gc);
+
+/*
+ * Challenge response info on client as pushed by server.
+ */
+struct static_challenge_info {
+# define SC_ECHO (1<<0) /* echo response when typed by user */
+ unsigned int flags;
+
+ const char *challenge_text;
+};
+
+#else
+struct auth_challenge_info {};
+struct static_challenge_info {};
+#endif
+
+/*
+ * Flags for get_user_pass and management_query_user_pass
+ */
+#define GET_USER_PASS_MANAGEMENT (1<<0)
+#define GET_USER_PASS_SENSITIVE (1<<1)
+#define GET_USER_PASS_PASSWORD_ONLY (1<<2)
+#define GET_USER_PASS_NEED_OK (1<<3)
+#define GET_USER_PASS_NOFATAL (1<<4)
+#define GET_USER_PASS_NEED_STR (1<<5)
+#define GET_USER_PASS_PREVIOUS_CREDS_FAILED (1<<6)
+
+#define GET_USER_PASS_DYNAMIC_CHALLENGE (1<<7) /* CRV1 protocol -- dynamic challenge */
+#define GET_USER_PASS_STATIC_CHALLENGE (1<<8) /* SCRV1 protocol -- static challenge */
+#define GET_USER_PASS_STATIC_CHALLENGE_ECHO (1<<9) /* SCRV1 protocol -- echo response */
+
+bool get_user_pass_cr (struct user_pass *up,
+ const char *auth_file,
+ const char *prefix,
+ const unsigned int flags,
+ const char *auth_challenge);
+
+static inline bool
+get_user_pass (struct user_pass *up,
+ const char *auth_file,
+ const char *prefix,
+ const unsigned int flags)
+{
+ return get_user_pass_cr (up, auth_file, prefix, flags, NULL);
+}
+
+void fail_user_pass (const char *prefix,
+ const unsigned int flags,
+ const char *reason);
+
+void purge_user_pass (struct user_pass *up, const bool force);
+
+void set_auth_token (struct user_pass *up, const char *token);
+
+/*
+ * Process string received by untrusted peer before
+ * printing to console or log file.
+ * Assumes that string has been null terminated.
+ */
+const char *safe_print (const char *str, struct gc_arena *gc);
+
+/* returns true if environmental variable safe to print to log */
+bool env_safe_to_print (const char *str);
+
+/* returns true if environmental variable may be passed to an external program */
+bool env_allowed (const char *str);
+
+/*
+ * A sleep function that services the management layer for n
+ * seconds rather than doing nothing.
+ */
+void openvpn_sleep (const int n);
+
+void configure_path (void);
+
+const char *sanitize_control_message(const char *str, struct gc_arena *gc);
+
+#if AUTO_USERID
+void get_user_pass_auto_userid (struct user_pass *up, const char *tag);
+#endif
+
+/*
+ * /sbin/ip path, may be overridden
+ */
+#ifdef ENABLE_IPROUTE
+extern const char *iproute_path;
+#endif
+
+/* Script security */
+#define SSEC_NONE 0 /* strictly no calling of external programs */
+#define SSEC_BUILT_IN 1 /* only call built-in programs such as ifconfig, route, netsh, etc.*/
+#define SSEC_SCRIPTS 2 /* allow calling of built-in programs and user-defined scripts */
+#define SSEC_PW_ENV 3 /* allow calling of built-in programs and user-defined scripts that may receive a password as an environmental variable */
+extern int script_security; /* GLOBAL */
+
+/* return the next largest power of 2 */
+size_t adjust_power_of_2 (size_t u);
+
+/*
+ * A printf-like function (that only recognizes a subset of standard printf
+ * format operators) that prints arguments to an argv list instead
+ * of a standard string. This is used to build up argv arrays for passing
+ * to execve.
+ */
+void argv_init (struct argv *a);
+struct argv argv_new (void);
+void argv_reset (struct argv *a);
+char *argv_term (const char **f);
+const char *argv_str (const struct argv *a, struct gc_arena *gc, const unsigned int flags);
+struct argv argv_insert_head (const struct argv *a, const char *head);
+void argv_msg (const int msglev, const struct argv *a);
+void argv_msg_prefix (const int msglev, const struct argv *a, const char *prefix);
+const char *argv_system_str (const struct argv *a);
+
+#define APA_CAT (1<<0) /* concatentate onto existing struct argv list */
+void argv_printf_arglist (struct argv *a, const char *format, const unsigned int flags, va_list arglist);
+
+void argv_printf (struct argv *a, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+ __attribute__ ((format (__printf__, 2, 3)))
+#endif
+#endif
+ ;
+
+void argv_printf_cat (struct argv *a, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+ __attribute__ ((format (__printf__, 2, 3)))
+#endif
+#endif
+ ;
+
+#define COMPAT_FLAG_QUERY 0 /** compat_flags operator: Query for a flag */
+#define COMPAT_FLAG_SET (1<<0) /** compat_flags operator: Set a compat flag */
+#define COMPAT_NAMES (1<<1) /** compat flag: --compat-names set */
+#define COMPAT_NO_NAME_REMAPPING (1<<2) /** compat flag: --compat-names without char remapping */
+bool compat_flag (unsigned int flag);
+
+#if P2MP_SERVER
+/* helper to parse peer_info received from multi client, validate
+ * (this is untrusted data) and put into environment */
+bool validate_peer_info_line(char *line);
+void output_peer_info_env (struct env_set *es, const char * peer_info);
+#endif /* P2MP_SERVER */
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.c
new file mode 100644
index 00000000..ba4ef46f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.c
@@ -0,0 +1,524 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "mroute.h"
+#include "proto.h"
+#include "error.h"
+#include "socket.h"
+
+#include "memdbg.h"
+
+void
+mroute_addr_init (struct mroute_addr *addr)
+{
+ CLEAR (*addr);
+}
+
+/*
+ * Ethernet multicast addresses.
+ */
+
+static inline bool
+is_mac_mcast_addr (const uint8_t *mac)
+{
+ return (bool) (mac[0] & 1);
+}
+
+static inline bool
+is_mac_mcast_maddr (const struct mroute_addr *addr)
+{
+ return (addr->type & MR_ADDR_MASK) == MR_ADDR_ETHER && is_mac_mcast_addr (addr->addr);
+}
+
+/*
+ * Don't learn certain addresses.
+ */
+bool
+mroute_learnable_address (const struct mroute_addr *addr)
+{
+ int i;
+ bool not_all_zeros = false;
+ bool not_all_ones = false;
+
+ for (i = 0; i < addr->len; ++i)
+ {
+ int b = addr->addr[i];
+ if (b != 0x00)
+ not_all_zeros = true;
+ if (b != 0xFF)
+ not_all_ones = true;
+ }
+ return not_all_zeros && not_all_ones && !is_mac_mcast_maddr (addr);
+}
+
+static inline void
+mroute_get_in_addr_t (struct mroute_addr *ma, const in_addr_t src, unsigned int mask)
+{
+ if (ma)
+ {
+ ma->type = MR_ADDR_IPV4 | mask;
+ ma->netbits = 0;
+ ma->len = 4;
+ *(in_addr_t*)ma->addr = src;
+ }
+}
+
+static inline void
+mroute_get_in6_addr (struct mroute_addr *ma, const struct in6_addr src, unsigned int mask)
+{
+ if (ma)
+ {
+ ma->type = MR_ADDR_IPV6 | mask;
+ ma->netbits = 0;
+ ma->len = 16;
+ *(struct in6_addr *)ma->addr = src;
+ }
+}
+
+static inline bool
+mroute_is_mcast (const in_addr_t addr)
+{
+ return ((addr & htonl(IP_MCAST_SUBNET_MASK)) == htonl(IP_MCAST_NETWORK));
+}
+
+/* RFC 4291, 2.7, "binary 11111111 at the start of an address identifies
+ * the address as being a multicast address"
+ */
+static inline bool
+mroute_is_mcast_ipv6 (const struct in6_addr addr)
+{
+ return (addr.s6_addr[0] == 0xff);
+}
+
+#ifdef ENABLE_PF
+
+static unsigned int
+mroute_extract_addr_arp (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ const struct buffer *buf)
+{
+ unsigned int ret = 0;
+ if (BLEN (buf) >= (int) sizeof (struct openvpn_arp))
+ {
+ const struct openvpn_arp *arp = (const struct openvpn_arp *) BPTR (buf);
+ if (arp->mac_addr_type == htons(0x0001)
+ && arp->proto_addr_type == htons(0x0800)
+ && arp->mac_addr_size == 0x06
+ && arp->proto_addr_size == 0x04)
+ {
+ mroute_get_in_addr_t (src, arp->ip_src, MR_ARP);
+ mroute_get_in_addr_t (dest, arp->ip_dest, MR_ARP);
+
+ /* multicast packet? */
+ if (mroute_is_mcast (arp->ip_dest))
+ ret |= MROUTE_EXTRACT_MCAST;
+
+ ret |= MROUTE_EXTRACT_SUCCEEDED;
+ }
+ }
+ return ret;
+}
+
+#endif
+
+unsigned int
+mroute_extract_addr_ipv4 (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ const struct buffer *buf)
+{
+ unsigned int ret = 0;
+ if (BLEN (buf) >= 1)
+ {
+ switch (OPENVPN_IPH_GET_VER (*BPTR(buf)))
+ {
+ case 4:
+ if (BLEN (buf) >= (int) sizeof (struct openvpn_iphdr))
+ {
+ const struct openvpn_iphdr *ip = (const struct openvpn_iphdr *) BPTR (buf);
+
+ mroute_get_in_addr_t (src, ip->saddr, 0);
+ mroute_get_in_addr_t (dest, ip->daddr, 0);
+
+ /* multicast packet? */
+ if (mroute_is_mcast (ip->daddr))
+ ret |= MROUTE_EXTRACT_MCAST;
+
+ /* IGMP message? */
+ if (ip->protocol == OPENVPN_IPPROTO_IGMP)
+ ret |= MROUTE_EXTRACT_IGMP;
+
+ ret |= MROUTE_EXTRACT_SUCCEEDED;
+ }
+ break;
+ case 6:
+ if (BLEN (buf) >= (int) sizeof (struct openvpn_ipv6hdr))
+ {
+ const struct openvpn_ipv6hdr *ipv6 = (const struct openvpn_ipv6hdr *) BPTR (buf);
+#if 0 /* very basic debug */
+ struct gc_arena gc = gc_new ();
+ msg( M_INFO, "IPv6 packet! src=%s, dst=%s",
+ print_in6_addr( ipv6->saddr, 0, &gc ),
+ print_in6_addr( ipv6->daddr, 0, &gc ));
+ gc_free (&gc);
+#endif
+
+ mroute_get_in6_addr (src, ipv6->saddr, 0);
+ mroute_get_in6_addr (dest, ipv6->daddr, 0);
+
+ if (mroute_is_mcast_ipv6 (ipv6->daddr))
+ ret |= MROUTE_EXTRACT_MCAST;
+
+ ret |= MROUTE_EXTRACT_SUCCEEDED;
+ }
+ break;
+ default:
+ msg (M_WARN, "IP packet with unknown IP version=%d seen",
+ OPENVPN_IPH_GET_VER (*BPTR(buf)));
+ }
+ }
+ return ret;
+}
+
+unsigned int
+mroute_extract_addr_ether (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ struct mroute_addr *esrc,
+ struct mroute_addr *edest,
+ const struct buffer *buf)
+{
+ unsigned int ret = 0;
+ if (BLEN (buf) >= (int) sizeof (struct openvpn_ethhdr))
+ {
+ const struct openvpn_ethhdr *eth = (const struct openvpn_ethhdr *) BPTR (buf);
+ if (src)
+ {
+ src->type = MR_ADDR_ETHER;
+ src->netbits = 0;
+ src->len = 6;
+ memcpy (src->addr, eth->source, 6);
+ }
+ if (dest)
+ {
+ dest->type = MR_ADDR_ETHER;
+ dest->netbits = 0;
+ dest->len = 6;
+ memcpy (dest->addr, eth->dest, 6);
+
+ /* ethernet broadcast/multicast packet? */
+ if (is_mac_mcast_addr (eth->dest))
+ ret |= MROUTE_EXTRACT_BCAST;
+ }
+
+ ret |= MROUTE_EXTRACT_SUCCEEDED;
+
+#ifdef ENABLE_PF
+ if (esrc || edest)
+ {
+ struct buffer b = *buf;
+ if (buf_advance (&b, sizeof (struct openvpn_ethhdr)))
+ {
+ switch (ntohs (eth->proto))
+ {
+ case OPENVPN_ETH_P_IPV4:
+ ret |= (mroute_extract_addr_ipv4 (esrc, edest, &b) << MROUTE_SEC_SHIFT);
+ break;
+ case OPENVPN_ETH_P_ARP:
+ ret |= (mroute_extract_addr_arp (esrc, edest, &b) << MROUTE_SEC_SHIFT);
+ break;
+ }
+ }
+ }
+#endif
+ }
+ return ret;
+}
+
+/*
+ * Translate a struct openvpn_sockaddr (osaddr)
+ * to a struct mroute_addr (addr).
+ */
+bool mroute_extract_openvpn_sockaddr (struct mroute_addr *addr,
+ const struct openvpn_sockaddr *osaddr,
+ bool use_port)
+{
+ switch (osaddr->addr.sa.sa_family)
+ {
+ case AF_INET:
+ {
+ if (use_port)
+ {
+ addr->type = MR_ADDR_IPV4 | MR_WITH_PORT;
+ addr->netbits = 0;
+ addr->len = 6;
+ memcpy (addr->addr, &osaddr->addr.in4.sin_addr.s_addr, 4);
+ memcpy (addr->addr + 4, &osaddr->addr.in4.sin_port, 2);
+ }
+ else
+ {
+ addr->type = MR_ADDR_IPV4;
+ addr->netbits = 0;
+ addr->len = 4;
+ memcpy (addr->addr, &osaddr->addr.in4.sin_addr.s_addr, 4);
+ }
+ return true;
+ }
+ case AF_INET6:
+ if (use_port)
+ {
+ addr->type = MR_ADDR_IPV6 | MR_WITH_PORT;
+ addr->netbits = 0;
+ addr->len = 18;
+ memcpy (addr->addr, &osaddr->addr.in6.sin6_addr, 16);
+ memcpy (addr->addr + 16, &osaddr->addr.in6.sin6_port, 2);
+ }
+ else
+ {
+ addr->type = MR_ADDR_IPV6;
+ addr->netbits = 0;
+ addr->len = 16;
+ memcpy (addr->addr, &osaddr->addr.in6.sin6_addr, 16);
+ }
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Zero off the host bits in an address, leaving
+ * only the network bits, using the netbits member of
+ * struct mroute_addr as the controlling parameter.
+ *
+ * TODO: this is called for route-lookup for every yet-unhashed
+ * destination address, so for lots of active net-iroutes, this
+ * might benefit from some "zeroize 32 bit at a time" improvements
+ */
+void
+mroute_addr_mask_host_bits (struct mroute_addr *ma)
+{
+ in_addr_t addr = ntohl(*(in_addr_t*)ma->addr);
+ if ((ma->type & MR_ADDR_MASK) == MR_ADDR_IPV4)
+ {
+ addr &= netbits_to_netmask (ma->netbits);
+ *(in_addr_t*)ma->addr = htonl (addr);
+ }
+ else if ((ma->type & MR_ADDR_MASK) == MR_ADDR_IPV6)
+ {
+ int byte = ma->len-1; /* rightmost byte in address */
+ int bits_to_clear = 128 - ma->netbits;
+
+ while( byte >= 0 && bits_to_clear > 0 )
+ {
+ if ( bits_to_clear >= 8 )
+ { ma->addr[byte--] = 0; bits_to_clear -= 8; }
+ else
+ { ma->addr[byte--] &= (IPV4_NETMASK_HOST << bits_to_clear); bits_to_clear = 0; }
+ }
+ ASSERT( bits_to_clear == 0 );
+ }
+ else
+ ASSERT(0);
+}
+
+/*
+ * The mroute_addr hash function takes into account the
+ * address type, number of bits in the network address,
+ * and the actual address.
+ */
+uint32_t
+mroute_addr_hash_function (const void *key, uint32_t iv)
+{
+ return hash_func (mroute_addr_hash_ptr ((const struct mroute_addr *) key),
+ mroute_addr_hash_len ((const struct mroute_addr *) key),
+ iv);
+}
+
+bool
+mroute_addr_compare_function (const void *key1, const void *key2)
+{
+ return mroute_addr_equal ((const struct mroute_addr *) key1,
+ (const struct mroute_addr *) key2);
+}
+
+const char *
+mroute_addr_print (const struct mroute_addr *ma,
+ struct gc_arena *gc)
+{
+ return mroute_addr_print_ex (ma, MAPF_IA_EMPTY_IF_UNDEF, gc);
+}
+
+const char *
+mroute_addr_print_ex (const struct mroute_addr *ma,
+ const unsigned int flags,
+ struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ if (ma)
+ {
+ struct mroute_addr maddr = *ma;
+
+ switch (maddr.type & MR_ADDR_MASK)
+ {
+ case MR_ADDR_ETHER:
+ buf_printf (&out, "%s", format_hex_ex (ma->addr, 6, 0, 1, ":", gc));
+ break;
+ case MR_ADDR_IPV4:
+ {
+ struct buffer buf;
+ in_addr_t addr;
+ int port;
+ bool status;
+ buf_set_read (&buf, maddr.addr, maddr.len);
+ addr = buf_read_u32 (&buf, &status);
+ if (status)
+ {
+ if ((flags & MAPF_SHOW_ARP) && (maddr.type & MR_ARP))
+ buf_printf (&out, "ARP/");
+ buf_printf (&out, "%s", print_in_addr_t (addr, (flags & MAPF_IA_EMPTY_IF_UNDEF) ? IA_EMPTY_IF_UNDEF : 0, gc));
+ if (maddr.type & MR_WITH_NETBITS)
+ {
+ if (flags & MAPF_SUBNET)
+ {
+ const in_addr_t netmask = netbits_to_netmask (maddr.netbits);
+ buf_printf (&out, "/%s", print_in_addr_t (netmask, 0, gc));
+ }
+ else
+ buf_printf (&out, "/%d", maddr.netbits);
+ }
+ }
+ if (maddr.type & MR_WITH_PORT)
+ {
+ port = buf_read_u16 (&buf);
+ if (port >= 0)
+ buf_printf (&out, ":%d", port);
+ }
+ }
+ break;
+ case MR_ADDR_IPV6:
+ {
+ buf_printf (&out, "%s",
+ print_in6_addr( *(struct in6_addr*)&maddr.addr, 0, gc));
+ if (maddr.type & MR_WITH_NETBITS)
+ {
+ buf_printf (&out, "/%d", maddr.netbits);
+ }
+ }
+ break;
+ default:
+ buf_printf (&out, "UNKNOWN");
+ break;
+ }
+ return BSTR (&out);
+ }
+ else
+ return "[NULL]";
+ }
+
+/*
+ * mroute_helper's main job is keeping track of
+ * currently used CIDR netlengths, so we don't
+ * have to cycle through all 33.
+ */
+
+struct mroute_helper *
+mroute_helper_init (int ageable_ttl_secs)
+{
+ struct mroute_helper *mh;
+ ALLOC_OBJ_CLEAR (mh, struct mroute_helper);
+ mh->ageable_ttl_secs = ageable_ttl_secs;
+ return mh;
+}
+
+static void
+mroute_helper_regenerate (struct mroute_helper *mh)
+{
+ int i, j = 0;
+ for (i = MR_HELPER_NET_LEN - 1; i >= 0; --i)
+ {
+ if (mh->net_len_refcount[i] > 0)
+ mh->net_len[j++] = (uint8_t) i;
+ }
+ mh->n_net_len = j;
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_MULTI_DEBUG))
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer out = alloc_buf_gc (256, &gc);
+ buf_printf (&out, "MROUTE CIDR netlen:");
+ for (i = 0; i < mh->n_net_len; ++i)
+ {
+ buf_printf (&out, " /%d", mh->net_len[i]);
+ }
+ dmsg (D_MULTI_DEBUG, "%s", BSTR (&out));
+ gc_free (&gc);
+ }
+#endif
+}
+
+void
+mroute_helper_add_iroute46 (struct mroute_helper *mh, int netbits)
+{
+ if (netbits >= 0)
+ {
+ ASSERT (netbits < MR_HELPER_NET_LEN);
+ ++mh->cache_generation;
+ ++mh->net_len_refcount[netbits];
+ if (mh->net_len_refcount[netbits] == 1)
+ mroute_helper_regenerate (mh);
+ }
+}
+
+void
+mroute_helper_del_iroute46 (struct mroute_helper *mh, int netbits)
+{
+ if (netbits >= 0)
+ {
+ ASSERT (netbits < MR_HELPER_NET_LEN);
+ ++mh->cache_generation;
+ --mh->net_len_refcount[netbits];
+ ASSERT (mh->net_len_refcount[netbits] >= 0);
+ if (!mh->net_len_refcount[netbits])
+ mroute_helper_regenerate (mh);
+ }
+}
+
+void
+mroute_helper_free (struct mroute_helper *mh)
+{
+ free (mh);
+}
+
+#else
+static void dummy(void) {}
+#endif /* P2MP_SERVER */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.h
new file mode 100644
index 00000000..608f70be
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mroute.h
@@ -0,0 +1,212 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MROUTE_H
+#define MROUTE_H
+
+#if P2MP_SERVER
+
+#include "buffer.h"
+#include "list.h"
+#include "route.h"
+
+#define IP_MCAST_SUBNET_MASK ((in_addr_t)240<<24)
+#define IP_MCAST_NETWORK ((in_addr_t)224<<24)
+
+/* Return status values for mroute_extract_addr_from_packet */
+
+#define MROUTE_EXTRACT_SUCCEEDED (1<<0)
+#define MROUTE_EXTRACT_BCAST (1<<1)
+#define MROUTE_EXTRACT_MCAST (1<<2)
+#define MROUTE_EXTRACT_IGMP (1<<3)
+
+#define MROUTE_SEC_EXTRACT_SUCCEEDED (1<<(0+MROUTE_SEC_SHIFT))
+#define MROUTE_SEC_EXTRACT_BCAST (1<<(1+MROUTE_SEC_SHIFT))
+#define MROUTE_SEC_EXTRACT_MCAST (1<<(2+MROUTE_SEC_SHIFT))
+#define MROUTE_SEC_EXTRACT_IGMP (1<<(3+MROUTE_SEC_SHIFT))
+
+#define MROUTE_SEC_SHIFT 4
+
+/*
+ * Choose the largest address possible with
+ * any of our supported types, which is IPv6
+ * with port number.
+ */
+#define MR_MAX_ADDR_LEN 20
+
+/*
+ * Address Types
+ */
+#define MR_ADDR_NONE 0
+#define MR_ADDR_ETHER 1
+#define MR_ADDR_IPV4 2
+#define MR_ADDR_IPV6 3
+#define MR_ADDR_MASK 3
+
+/* Address type mask indicating that port # is part of address */
+#define MR_WITH_PORT 4
+
+/* Address type mask indicating that netbits is part of address */
+#define MR_WITH_NETBITS 8
+
+/* Indicates than IPv4 addr was extracted from ARP packet */
+#define MR_ARP 16
+
+struct mroute_addr {
+ uint8_t len; /* length of address */
+ uint8_t unused;
+ uint8_t type; /* MR_ADDR/MR_WITH flags */
+ uint8_t netbits; /* number of bits in network part of address,
+ valid if MR_WITH_NETBITS is set */
+ uint8_t addr[MR_MAX_ADDR_LEN]; /* actual address */
+};
+
+/*
+ * Number of bits in an address. Should be raised for IPv6.
+ */
+#define MR_HELPER_NET_LEN 129
+
+/*
+ * Used to help maintain CIDR routing table.
+ */
+struct mroute_helper {
+ unsigned int cache_generation; /* incremented when route added */
+ int ageable_ttl_secs; /* host route cache entry time-to-live*/
+ int n_net_len; /* length of net_len array */
+ uint8_t net_len[MR_HELPER_NET_LEN]; /* CIDR netlengths in descending order */
+ int net_len_refcount[MR_HELPER_NET_LEN]; /* refcount of each netlength */
+};
+
+struct openvpn_sockaddr;
+
+bool mroute_extract_openvpn_sockaddr (struct mroute_addr *addr,
+ const struct openvpn_sockaddr *osaddr,
+ bool use_port);
+
+bool mroute_learnable_address (const struct mroute_addr *addr);
+
+uint32_t mroute_addr_hash_function (const void *key, uint32_t iv);
+bool mroute_addr_compare_function (const void *key1, const void *key2);
+
+void mroute_addr_init (struct mroute_addr *addr);
+
+const char *mroute_addr_print (const struct mroute_addr *ma,
+ struct gc_arena *gc);
+
+#define MAPF_SUBNET (1<<0)
+#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)
+#define MAPF_SHOW_ARP (1<<2)
+const char *mroute_addr_print_ex (const struct mroute_addr *ma,
+ const unsigned int flags,
+ struct gc_arena *gc);
+
+void mroute_addr_mask_host_bits (struct mroute_addr *ma);
+
+struct mroute_helper *mroute_helper_init (int ageable_ttl_secs);
+void mroute_helper_free (struct mroute_helper *mh);
+void mroute_helper_add_iroute46 (struct mroute_helper *mh, int netbits);
+void mroute_helper_del_iroute46 (struct mroute_helper *mh, int netbits);
+
+/*
+ * Given a raw packet in buf, return the src and dest
+ * addresses of the packet.
+ */
+static inline unsigned int
+mroute_extract_addr_from_packet (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ struct mroute_addr *esrc,
+ struct mroute_addr *edest,
+ const struct buffer *buf,
+ int tunnel_type)
+{
+ unsigned int mroute_extract_addr_ipv4 (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ const struct buffer *buf);
+
+ unsigned int mroute_extract_addr_ether (struct mroute_addr *src,
+ struct mroute_addr *dest,
+ struct mroute_addr *esrc,
+ struct mroute_addr *edest,
+ const struct buffer *buf);
+ unsigned int ret = 0;
+ verify_align_4 (buf);
+ if (tunnel_type == DEV_TYPE_TUN)
+ ret = mroute_extract_addr_ipv4 (src, dest, buf);
+ else if (tunnel_type == DEV_TYPE_TAP)
+ ret = mroute_extract_addr_ether (src, dest, esrc, edest, buf);
+ return ret;
+}
+
+static inline bool
+mroute_addr_equal (const struct mroute_addr *a1, const struct mroute_addr *a2)
+{
+ if (a1->type != a2->type)
+ return false;
+ if (a1->netbits != a2->netbits)
+ return false;
+ if (a1->len != a2->len)
+ return false;
+ return memcmp (a1->addr, a2->addr, a1->len) == 0;
+}
+
+static inline const uint8_t *
+mroute_addr_hash_ptr (const struct mroute_addr *a)
+{
+ /* NOTE: depends on ordering of struct mroute_addr */
+ return (uint8_t *) &a->type;
+}
+
+static inline uint32_t
+mroute_addr_hash_len (const struct mroute_addr *a)
+{
+ return (uint32_t) a->len + 2;
+}
+
+static inline void
+mroute_extract_in_addr_t (struct mroute_addr *dest, const in_addr_t src)
+{
+ dest->type = MR_ADDR_IPV4;
+ dest->netbits = 0;
+ dest->len = 4;
+ *(in_addr_t*)dest->addr = htonl (src);
+}
+
+static inline in_addr_t
+in_addr_t_from_mroute_addr (const struct mroute_addr *addr)
+{
+ if ((addr->type & MR_ADDR_MASK) == MR_ADDR_IPV4 && addr->netbits == 0 && addr->len == 4)
+ return ntohl(*(in_addr_t*)addr->addr);
+ else
+ return 0;
+}
+
+static inline void
+mroute_addr_reset (struct mroute_addr *ma)
+{
+ ma->len = 0;
+ ma->type = MR_ADDR_NONE;
+}
+
+#endif /* P2MP_SERVER */
+#endif /* MROUTE_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.c
new file mode 100644
index 00000000..64fd722f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.c
@@ -0,0 +1,175 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+#include "error.h"
+#include "mss.h"
+#include "memdbg.h"
+
+/*
+ * Lower MSS on TCP SYN packets to fix MTU
+ * problems which arise from protocol
+ * encapsulation.
+ */
+
+/*
+ * IPv4 packet: find TCP header, check flags for "SYN"
+ * if yes, hand to mss_fixup_dowork()
+ */
+void
+mss_fixup_ipv4 (struct buffer *buf, int maxmss)
+{
+ const struct openvpn_iphdr *pip;
+ int hlen;
+
+ if (BLEN (buf) < (int) sizeof (struct openvpn_iphdr))
+ return;
+
+ verify_align_4 (buf);
+ pip = (struct openvpn_iphdr *) BPTR (buf);
+
+ hlen = OPENVPN_IPH_GET_LEN (pip->version_len);
+
+ if (pip->protocol == OPENVPN_IPPROTO_TCP
+ && ntohs (pip->tot_len) == BLEN (buf)
+ && (ntohs (pip->frag_off) & OPENVPN_IP_OFFMASK) == 0
+ && hlen <= BLEN (buf)
+ && BLEN (buf) - hlen
+ >= (int) sizeof (struct openvpn_tcphdr))
+ {
+ struct buffer newbuf = *buf;
+ if (buf_advance (&newbuf, hlen))
+ {
+ struct openvpn_tcphdr *tc = (struct openvpn_tcphdr *) BPTR (&newbuf);
+ if (tc->flags & OPENVPN_TCPH_SYN_MASK)
+ mss_fixup_dowork (&newbuf, (uint16_t) maxmss);
+ }
+ }
+}
+
+/*
+ * IPv6 packet: find TCP header, check flags for "SYN"
+ * if yes, hand to mss_fixup_dowork()
+ * (IPv6 header structure is sufficiently different from IPv4...)
+ */
+void
+mss_fixup_ipv6 (struct buffer *buf, int maxmss)
+{
+ const struct openvpn_ipv6hdr *pip6;
+ struct buffer newbuf;
+
+ if (BLEN (buf) < (int) sizeof (struct openvpn_ipv6hdr))
+ return;
+
+ verify_align_4 (buf);
+ pip6 = (struct openvpn_ipv6hdr *) BPTR (buf);
+
+ /* do we have the full IPv6 packet?
+ * "payload_len" does not include IPv6 header (+40 bytes)
+ */
+ if (BLEN (buf) != (int) ntohs(pip6->payload_len)+40 )
+ return;
+
+ /* follow header chain until we reach final header, then check for TCP
+ *
+ * An IPv6 packet could, theoretically, have a chain of multiple headers
+ * before the final header (TCP, UDP, ...), so we'd need to walk that
+ * chain (see RFC 2460 and RFC 6564 for details).
+ *
+ * In practice, "most typically used" extention headers (AH, routing,
+ * fragment, mobility) are very unlikely to be seen inside an OpenVPN
+ * tun, so for now, we only handle the case of "single next header = TCP"
+ */
+ if ( pip6->nexthdr != OPENVPN_IPPROTO_TCP )
+ return;
+
+ newbuf = *buf;
+ if ( buf_advance( &newbuf, 40 ) )
+ {
+ struct openvpn_tcphdr *tc = (struct openvpn_tcphdr *) BPTR (&newbuf);
+ if (tc->flags & OPENVPN_TCPH_SYN_MASK)
+ mss_fixup_dowork (&newbuf, (uint16_t) maxmss-20);
+ }
+}
+
+/*
+ * change TCP MSS option in SYN/SYN-ACK packets, if present
+ * this is generic for IPv4 and IPv6, as the TCP header is the same
+ */
+
+void
+mss_fixup_dowork (struct buffer *buf, uint16_t maxmss)
+{
+ int hlen, olen, optlen;
+ uint8_t *opt;
+ uint16_t *mss;
+ int accumulate;
+ struct openvpn_tcphdr *tc;
+
+ ASSERT (BLEN (buf) >= (int) sizeof (struct openvpn_tcphdr));
+
+ verify_align_4 (buf);
+ tc = (struct openvpn_tcphdr *) BPTR (buf);
+ hlen = OPENVPN_TCPH_GET_DOFF (tc->doff_res);
+
+ /* Invalid header length or header without options. */
+ if (hlen <= (int) sizeof (struct openvpn_tcphdr)
+ || hlen > BLEN (buf))
+ return;
+
+ for (olen = hlen - sizeof (struct openvpn_tcphdr),
+ opt = (uint8_t *)(tc + 1);
+ olen > 0;
+ olen -= optlen, opt += optlen) {
+ if (*opt == OPENVPN_TCPOPT_EOL)
+ break;
+ else if (*opt == OPENVPN_TCPOPT_NOP)
+ optlen = 1;
+ else {
+ optlen = *(opt + 1);
+ if (optlen <= 0 || optlen > olen)
+ break;
+ if (*opt == OPENVPN_TCPOPT_MAXSEG) {
+ if (optlen != OPENVPN_TCPOLEN_MAXSEG)
+ continue;
+ mss = (uint16_t *)(opt + 2);
+ if (ntohs (*mss) > maxmss) {
+ dmsg (D_MSS, "MSS: %d -> %d",
+ (int) ntohs (*mss),
+ (int) maxmss);
+ accumulate = *mss;
+ *mss = htons (maxmss);
+ accumulate -= *mss;
+ ADJUST_CHECKSUM (accumulate, tc->check);
+ }
+ }
+ }
+ }
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.h
new file mode 100644
index 00000000..0d329432
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mss.h
@@ -0,0 +1,35 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MSS_H
+#define MSS_H
+
+#include "proto.h"
+#include "error.h"
+
+void mss_fixup_ipv4 (struct buffer *buf, int maxmss);
+void mss_fixup_ipv6 (struct buffer *buf, int maxmss);
+void mss_fixup_dowork (struct buffer *buf, uint16_t maxmss);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.c
new file mode 100644
index 00000000..3be493cd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.c
@@ -0,0 +1,122 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Maintain usage stats in a memory-mapped file
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_MEMSTATS)
+
+#include <sys/mman.h>
+
+#include "error.h"
+#include "misc.h"
+#include "mstats.h"
+
+#include "memdbg.h"
+
+volatile struct mmap_stats *mmap_stats = NULL; /* GLOBAL */
+static char mmap_fn[128];
+
+void
+mstats_open(const char *fn)
+{
+ void *data;
+ ssize_t stat;
+ int fd;
+ struct mmap_stats ms;
+
+ if (mmap_stats) /* already called? */
+ return;
+
+ /* verify that filename is not too long */
+ if (strlen(fn) >= sizeof(mmap_fn))
+ msg (M_FATAL, "mstats_open: filename too long");
+
+ /* create file that will be memory mapped */
+ fd = open (fn, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+ {
+ msg (M_ERR, "mstats_open: cannot open: %s", fn);
+ return;
+ }
+
+ /* set the file to the correct size to contain a
+ struct mmap_stats, and zero it */
+ CLEAR(ms);
+ ms.state = MSTATS_ACTIVE;
+ stat = write(fd, &ms, sizeof(ms));
+ if (stat != sizeof(ms))
+ {
+ msg (M_ERR, "mstats_open: write error: %s", fn);
+ close(fd);
+ return;
+ }
+
+ /* mmap the file */
+ data = mmap(NULL, sizeof(struct mmap_stats), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+ if (data == MAP_FAILED)
+ {
+ msg (M_ERR, "mstats_open: write error: %s", fn);
+ close(fd);
+ return;
+ }
+
+ /* close the fd (mmap now controls the file) */
+ if (close(fd))
+ {
+ msg (M_ERR, "mstats_open: close error: %s", fn);
+ }
+
+ /* save filename so we can delete it later */
+ strcpy(mmap_fn, fn);
+
+ /* save a global pointer to memory-mapped region */
+ mmap_stats = (struct mmap_stats *)data;
+
+ msg (M_INFO, "memstats data will be written to %s", fn);
+}
+
+void
+mstats_close(void)
+{
+ if (mmap_stats)
+ {
+ mmap_stats->state = MSTATS_EXPIRED;
+ if (munmap((void *)mmap_stats, sizeof(struct mmap_stats)))
+ msg (M_WARN | M_ERRNO, "mstats_close: munmap error");
+ platform_unlink(mmap_fn);
+ mmap_stats = NULL;
+ }
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.h
new file mode 100644
index 00000000..dab05fe9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mstats.h
@@ -0,0 +1,51 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2011 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Maintain usage stats in a memory-mapped file
+ */
+
+#if !defined(OPENVPN_MEMSTATS_H) && defined(ENABLE_MEMSTATS)
+#define OPENVPN_MEMSTATS_H
+
+#include "basic.h"
+
+/* this struct is mapped to the file */
+struct mmap_stats {
+ counter_type link_read_bytes; /* counter_type can be assumed to be a uint64_t */
+ counter_type link_write_bytes;
+ int n_clients;
+
+# define MSTATS_UNDEF 0
+# define MSTATS_ACTIVE 1
+# define MSTATS_EXPIRED 2
+ int state;
+};
+
+extern volatile struct mmap_stats *mmap_stats; /* GLOBAL */
+
+void mstats_open(const char *fn);
+void mstats_close(void);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.c
new file mode 100644
index 00000000..dc15f092
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.c
@@ -0,0 +1,727 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "multi.h"
+#include "forward-inline.h"
+
+#include "memdbg.h"
+
+/*
+ * TCP States
+ */
+#define TA_UNDEF 0
+#define TA_SOCKET_READ 1
+#define TA_SOCKET_READ_RESIDUAL 2
+#define TA_SOCKET_WRITE 3
+#define TA_SOCKET_WRITE_READY 4
+#define TA_SOCKET_WRITE_DEFERRED 5
+#define TA_TUN_READ 6
+#define TA_TUN_WRITE 7
+#define TA_INITIAL 8
+#define TA_TIMEOUT 9
+#define TA_TUN_WRITE_TIMEOUT 10
+
+/*
+ * Special tags passed to event.[ch] functions
+ */
+#define MTCP_SOCKET ((void*)1)
+#define MTCP_TUN ((void*)2)
+#define MTCP_SIG ((void*)3) /* Only on Windows */
+#ifdef ENABLE_MANAGEMENT
+# define MTCP_MANAGEMENT ((void*)4)
+#endif
+
+#define MTCP_N ((void*)16) /* upper bound on MTCP_x */
+
+struct ta_iow_flags
+{
+ unsigned int flags;
+ unsigned int ret;
+ unsigned int tun;
+ unsigned int sock;
+};
+
+static const char *
+pract (int action)
+{
+ switch (action)
+ {
+ case TA_UNDEF:
+ return "TA_UNDEF";
+ case TA_SOCKET_READ:
+ return "TA_SOCKET_READ";
+ case TA_SOCKET_READ_RESIDUAL:
+ return "TA_SOCKET_READ_RESIDUAL";
+ case TA_SOCKET_WRITE:
+ return "TA_SOCKET_WRITE";
+ case TA_SOCKET_WRITE_READY:
+ return "TA_SOCKET_WRITE_READY";
+ case TA_SOCKET_WRITE_DEFERRED:
+ return "TA_SOCKET_WRITE_DEFERRED";
+ case TA_TUN_READ:
+ return "TA_TUN_READ";
+ case TA_TUN_WRITE:
+ return "TA_TUN_WRITE";
+ case TA_INITIAL:
+ return "TA_INITIAL";
+ case TA_TIMEOUT:
+ return "TA_TIMEOUT";
+ case TA_TUN_WRITE_TIMEOUT:
+ return "TA_TUN_WRITE_TIMEOUT";
+ default:
+ return "?";
+ }
+}
+
+static struct multi_instance *
+multi_create_instance_tcp (struct multi_context *m)
+{
+ struct gc_arena gc = gc_new ();
+ struct multi_instance *mi = NULL;
+ struct hash *hash = m->hash;
+
+ mi = multi_create_instance (m, NULL);
+ if (mi)
+ {
+ struct hash_element *he;
+ const uint32_t hv = hash_value (hash, &mi->real);
+ struct hash_bucket *bucket = hash_bucket (hash, hv);
+
+ he = hash_lookup_fast (hash, bucket, &mi->real, hv);
+
+ if (he)
+ {
+ struct multi_instance *oldmi = (struct multi_instance *) he->value;
+ msg (D_MULTI_LOW, "MULTI TCP: new incoming client address matches existing client address -- new client takes precedence");
+ oldmi->did_real_hash = false;
+ multi_close_instance (m, oldmi, false);
+ he->key = &mi->real;
+ he->value = mi;
+ }
+ else
+ hash_add_fast (hash, bucket, &mi->real, hv, mi);
+
+ mi->did_real_hash = true;
+ }
+
+#ifdef ENABLE_DEBUG
+ if (mi)
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: instance added: %s", mroute_addr_print (&mi->real, &gc));
+ else
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: new client instance failed");
+#endif
+
+ gc_free (&gc);
+ ASSERT (!(mi && mi->halt));
+ return mi;
+}
+
+bool
+multi_tcp_instance_specific_init (struct multi_context *m, struct multi_instance *mi)
+{
+ /* buffer for queued TCP socket output packets */
+ mi->tcp_link_out_deferred = mbuf_init (m->top.options.n_bcast_buf);
+
+ ASSERT (mi->context.c2.link_socket);
+ ASSERT (mi->context.c2.link_socket->info.lsa);
+ ASSERT (mi->context.c2.link_socket->mode == LS_MODE_TCP_ACCEPT_FROM);
+ ASSERT (mi->context.c2.link_socket->info.lsa->actual.dest.addr.sa.sa_family == AF_INET
+ || mi->context.c2.link_socket->info.lsa->actual.dest.addr.sa.sa_family == AF_INET6
+ );
+ if (!mroute_extract_openvpn_sockaddr (&mi->real, &mi->context.c2.link_socket->info.lsa->actual.dest, true))
+ {
+ msg (D_MULTI_ERRORS, "MULTI TCP: TCP client address is undefined");
+ return false;
+ }
+ return true;
+}
+
+void
+multi_tcp_instance_specific_free (struct multi_instance *mi)
+{
+ mbuf_free (mi->tcp_link_out_deferred);
+}
+
+struct multi_tcp *
+multi_tcp_init (int maxevents, int *maxclients)
+{
+ struct multi_tcp *mtcp;
+ const int extra_events = BASE_N_EVENTS;
+
+ ASSERT (maxevents >= 1);
+ ASSERT (maxclients);
+
+ ALLOC_OBJ_CLEAR (mtcp, struct multi_tcp);
+ mtcp->maxevents = maxevents + extra_events;
+ mtcp->es = event_set_init (&mtcp->maxevents, 0);
+ wait_signal (mtcp->es, MTCP_SIG);
+ ALLOC_ARRAY (mtcp->esr, struct event_set_return, mtcp->maxevents);
+ *maxclients = max_int (min_int (mtcp->maxevents - extra_events, *maxclients), 1);
+ msg (D_MULTI_LOW, "MULTI: TCP INIT maxclients=%d maxevents=%d", *maxclients, mtcp->maxevents);
+ return mtcp;
+}
+
+void
+multi_tcp_delete_event (struct multi_tcp *mtcp, event_t event)
+{
+ if (mtcp && mtcp->es)
+ event_del (mtcp->es, event);
+}
+
+void
+multi_tcp_free (struct multi_tcp *mtcp)
+{
+ if (mtcp)
+ {
+ event_free (mtcp->es);
+ if (mtcp->esr)
+ free (mtcp->esr);
+ free (mtcp);
+ }
+}
+
+void
+multi_tcp_dereference_instance (struct multi_tcp *mtcp, struct multi_instance *mi)
+{
+ struct link_socket *ls = mi->context.c2.link_socket;
+ if (ls && mi->socket_set_called)
+ event_del (mtcp->es, socket_event_handle (ls));
+ mtcp->n_esr = 0;
+}
+
+static inline void
+multi_tcp_set_global_rw_flags (struct multi_context *m, struct multi_instance *mi)
+{
+ if (mi)
+ {
+ mi->socket_set_called = true;
+ socket_set (mi->context.c2.link_socket,
+ m->mtcp->es,
+ mbuf_defined (mi->tcp_link_out_deferred) ? EVENT_WRITE : EVENT_READ,
+ mi,
+ &mi->tcp_rwflags);
+ }
+}
+
+static inline int
+multi_tcp_wait (const struct context *c,
+ struct multi_tcp *mtcp)
+{
+ int status;
+ socket_set_listen_persistent (c->c2.link_socket, mtcp->es, MTCP_SOCKET);
+ tun_set (c->c1.tuntap, mtcp->es, EVENT_READ, MTCP_TUN, &mtcp->tun_rwflags);
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_socket_set (management, mtcp->es, MTCP_MANAGEMENT, &mtcp->management_persist_flags);
+#endif
+ status = event_wait (mtcp->es, &c->c2.timeval, mtcp->esr, mtcp->maxevents);
+ update_time ();
+ mtcp->n_esr = 0;
+ if (status > 0)
+ mtcp->n_esr = status;
+ return status;
+}
+
+static inline struct context *
+multi_tcp_context (struct multi_context *m, struct multi_instance *mi)
+{
+ if (mi)
+ return &mi->context;
+ else
+ return &m->top;
+}
+
+static bool
+multi_tcp_process_outgoing_link_ready (struct multi_context *m, struct multi_instance *mi, const unsigned int mpp_flags)
+{
+ struct mbuf_item item;
+ bool ret = true;
+ ASSERT (mi);
+
+ /* extract from queue */
+ if (mbuf_extract_item (mi->tcp_link_out_deferred, &item)) /* ciphertext IP packet */
+ {
+ dmsg (D_MULTI_TCP, "MULTI TCP: transmitting previously deferred packet");
+
+ ASSERT (mi == item.instance);
+ mi->context.c2.to_link = item.buffer->buf;
+ ret = multi_process_outgoing_link_dowork (m, mi, mpp_flags);
+ if (!ret)
+ mi = NULL;
+ mbuf_free_buf (item.buffer);
+ }
+ return ret;
+}
+
+static bool
+multi_tcp_process_outgoing_link (struct multi_context *m, bool defer, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = multi_process_outgoing_link_pre (m);
+ bool ret = true;
+
+ if (mi)
+ {
+ if (defer || mbuf_defined (mi->tcp_link_out_deferred))
+ {
+ /* save to queue */
+ struct buffer *buf = &mi->context.c2.to_link;
+ if (BLEN (buf) > 0)
+ {
+ struct mbuf_buffer *mb = mbuf_alloc_buf (buf);
+ struct mbuf_item item;
+
+ set_prefix (mi);
+ dmsg (D_MULTI_TCP, "MULTI TCP: queuing deferred packet");
+ item.buffer = mb;
+ item.instance = mi;
+ mbuf_add_item (mi->tcp_link_out_deferred, &item);
+ mbuf_free_buf (mb);
+ buf_reset (buf);
+ ret = multi_process_post (m, mi, mpp_flags);
+ if (!ret)
+ mi = NULL;
+ clear_prefix ();
+ }
+ }
+ else
+ {
+ ret = multi_process_outgoing_link_dowork (m, mi, mpp_flags);
+ if (!ret)
+ mi = NULL;
+ }
+ }
+ return ret;
+}
+
+static int
+multi_tcp_wait_lite (struct multi_context *m, struct multi_instance *mi, const int action, bool *tun_input_pending)
+{
+ struct context *c = multi_tcp_context (m, mi);
+ unsigned int looking_for = 0;
+
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: multi_tcp_wait_lite a=%s mi=" ptr_format,
+ pract(action),
+ (ptr_type)mi);
+
+ tv_clear (&c->c2.timeval); /* ZERO-TIMEOUT */
+
+ switch (action)
+ {
+ case TA_TUN_READ:
+ looking_for = TUN_READ;
+ tun_input_pending = NULL;
+ io_wait (c, IOW_READ_TUN);
+ break;
+ case TA_SOCKET_READ:
+ looking_for = SOCKET_READ;
+ tun_input_pending = NULL;
+ io_wait (c, IOW_READ_LINK);
+ break;
+ case TA_TUN_WRITE:
+ looking_for = TUN_WRITE;
+ tun_input_pending = NULL;
+ c->c2.timeval.tv_sec = 1; /* For some reason, the Linux 2.2 TUN/TAP driver hits this timeout */
+ perf_push (PERF_PROC_OUT_TUN_MTCP);
+ io_wait (c, IOW_TO_TUN);
+ perf_pop ();
+ break;
+ case TA_SOCKET_WRITE:
+ looking_for = SOCKET_WRITE;
+ io_wait (c, IOW_TO_LINK|IOW_READ_TUN_FORCE);
+ break;
+ default:
+ msg (M_FATAL, "MULTI TCP: multi_tcp_wait_lite, unhandled action=%d", action);
+ }
+
+ if (tun_input_pending && (c->c2.event_set_status & TUN_READ))
+ *tun_input_pending = true;
+
+ if (c->c2.event_set_status & looking_for)
+ {
+ return action;
+ }
+ else
+ {
+ switch (action)
+ {
+ /* TCP socket output buffer is full */
+ case TA_SOCKET_WRITE:
+ return TA_SOCKET_WRITE_DEFERRED;
+
+ /* TUN device timed out on accepting write */
+ case TA_TUN_WRITE:
+ return TA_TUN_WRITE_TIMEOUT;
+ }
+
+ return TA_UNDEF;
+ }
+}
+
+static struct multi_instance *
+multi_tcp_dispatch (struct multi_context *m, struct multi_instance *mi, const int action)
+{
+ const unsigned int mpp_flags = MPP_PRE_SELECT|MPP_RECORD_TOUCH;
+ struct multi_instance *touched = mi;
+ m->mpp_touched = &touched;
+
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: multi_tcp_dispatch a=%s mi=" ptr_format,
+ pract(action),
+ (ptr_type)mi);
+
+ switch (action)
+ {
+ case TA_TUN_READ:
+ read_incoming_tun (&m->top);
+ if (!IS_SIG (&m->top))
+ multi_process_incoming_tun (m, mpp_flags);
+ break;
+ case TA_SOCKET_READ:
+ case TA_SOCKET_READ_RESIDUAL:
+ ASSERT (mi);
+ ASSERT (mi->context.c2.link_socket);
+ set_prefix (mi);
+ read_incoming_link (&mi->context);
+ clear_prefix ();
+ if (!IS_SIG (&mi->context))
+ {
+ multi_process_incoming_link (m, mi, mpp_flags);
+ if (!IS_SIG (&mi->context))
+ stream_buf_read_setup (mi->context.c2.link_socket);
+ }
+ break;
+ case TA_TIMEOUT:
+ multi_process_timeout (m, mpp_flags);
+ break;
+ case TA_TUN_WRITE:
+ multi_process_outgoing_tun (m, mpp_flags);
+ break;
+ case TA_TUN_WRITE_TIMEOUT:
+ multi_process_drop_outgoing_tun (m, mpp_flags);
+ break;
+ case TA_SOCKET_WRITE_READY:
+ ASSERT (mi);
+ multi_tcp_process_outgoing_link_ready (m, mi, mpp_flags);
+ break;
+ case TA_SOCKET_WRITE:
+ multi_tcp_process_outgoing_link (m, false, mpp_flags);
+ break;
+ case TA_SOCKET_WRITE_DEFERRED:
+ multi_tcp_process_outgoing_link (m, true, mpp_flags);
+ break;
+ case TA_INITIAL:
+ ASSERT (mi);
+ multi_tcp_set_global_rw_flags (m, mi);
+ multi_process_post (m, mi, mpp_flags);
+ break;
+ default:
+ msg (M_FATAL, "MULTI TCP: multi_tcp_dispatch, unhandled action=%d", action);
+ }
+
+ m->mpp_touched = NULL;
+ return touched;
+}
+
+int
+multi_tcp_post (struct multi_context *m, struct multi_instance *mi, const int action)
+{
+ struct context *c = multi_tcp_context (m, mi);
+ int newaction = TA_UNDEF;
+
+# define MTP_NONE 0
+# define MTP_TUN_OUT (1<<0)
+# define MTP_LINK_OUT (1<<1)
+ unsigned int flags = MTP_NONE;
+
+ if (TUN_OUT(c))
+ flags |= MTP_TUN_OUT;
+ if (LINK_OUT(c))
+ flags |= MTP_LINK_OUT;
+
+ switch (flags)
+ {
+ case MTP_TUN_OUT|MTP_LINK_OUT:
+ case MTP_TUN_OUT:
+ newaction = TA_TUN_WRITE;
+ break;
+ case MTP_LINK_OUT:
+ newaction = TA_SOCKET_WRITE;
+ break;
+ case MTP_NONE:
+ if (mi && socket_read_residual (c->c2.link_socket))
+ newaction = TA_SOCKET_READ_RESIDUAL;
+ else
+ multi_tcp_set_global_rw_flags (m, mi);
+ break;
+ default:
+ {
+ struct gc_arena gc = gc_new ();
+ msg (M_FATAL, "MULTI TCP: multi_tcp_post bad state, mi=%s flags=%d",
+ multi_instance_string (mi, false, &gc),
+ flags);
+ gc_free (&gc);
+ break;
+ }
+ }
+
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: multi_tcp_post %s -> %s",
+ pract(action),
+ pract(newaction));
+
+ return newaction;
+}
+
+static void
+multi_tcp_action (struct multi_context *m, struct multi_instance *mi, int action, bool poll)
+{
+ bool tun_input_pending = false;
+
+ do {
+ dmsg (D_MULTI_DEBUG, "MULTI TCP: multi_tcp_action a=%s p=%d",
+ pract(action),
+ poll);
+
+ /*
+ * If TA_SOCKET_READ_RESIDUAL, it means we still have pending
+ * input packets which were read by a prior TCP recv.
+ *
+ * Otherwise do a "lite" wait, which means we wait with 0 timeout
+ * on I/O events only related to the current instance, not
+ * the big list of events.
+ *
+ * On our first pass, poll will be false because we already know
+ * that input is available, and to call io_wait would be redundant.
+ */
+ if (poll && action != TA_SOCKET_READ_RESIDUAL)
+ {
+ const int orig_action = action;
+ action = multi_tcp_wait_lite (m, mi, action, &tun_input_pending);
+ if (action == TA_UNDEF)
+ msg (M_FATAL, "MULTI TCP: I/O wait required blocking in multi_tcp_action, action=%d", orig_action);
+ }
+
+ /*
+ * Dispatch the action
+ */
+ {
+ struct multi_instance *touched = multi_tcp_dispatch (m, mi, action);
+
+ /*
+ * Signal received or TCP connection
+ * reset by peer?
+ */
+ if (touched && IS_SIG (&touched->context))
+ {
+ if (mi == touched)
+ mi = NULL;
+ multi_close_instance_on_signal (m, touched);
+ }
+ }
+
+ /*
+ * If dispatch produced any pending output
+ * for a particular instance, point to
+ * that instance.
+ */
+ if (m->pending)
+ mi = m->pending;
+
+ /*
+ * Based on the effects of the action,
+ * such as generating pending output,
+ * possibly transition to a new action state.
+ */
+ action = multi_tcp_post (m, mi, action);
+
+ /*
+ * If we are finished processing the original action,
+ * check if we have any TUN input. If so, transition
+ * our action state to processing this input.
+ */
+ if (tun_input_pending && action == TA_UNDEF)
+ {
+ action = TA_TUN_READ;
+ mi = NULL;
+ tun_input_pending = false;
+ poll = false;
+ }
+ else
+ poll = true;
+
+ } while (action != TA_UNDEF);
+}
+
+static void
+multi_tcp_process_io (struct multi_context *m)
+{
+ struct multi_tcp *mtcp = m->mtcp;
+ int i;
+
+ for (i = 0; i < mtcp->n_esr; ++i)
+ {
+ struct event_set_return *e = &mtcp->esr[i];
+
+ /* incoming data for instance? */
+ if (e->arg >= MTCP_N)
+ {
+ struct multi_instance *mi = (struct multi_instance *) e->arg;
+ if (mi)
+ {
+ if (e->rwflags & EVENT_WRITE)
+ multi_tcp_action (m, mi, TA_SOCKET_WRITE_READY, false);
+ else if (e->rwflags & EVENT_READ)
+ multi_tcp_action (m, mi, TA_SOCKET_READ, false);
+ }
+ }
+ else
+ {
+#ifdef ENABLE_MANAGEMENT
+ if (e->arg == MTCP_MANAGEMENT)
+ {
+ ASSERT (management);
+ management_io (management);
+ }
+ else
+#endif
+ /* incoming data on TUN? */
+ if (e->arg == MTCP_TUN)
+ {
+ if (e->rwflags & EVENT_WRITE)
+ multi_tcp_action (m, NULL, TA_TUN_WRITE, false);
+ else if (e->rwflags & EVENT_READ)
+ multi_tcp_action (m, NULL, TA_TUN_READ, false);
+ }
+ /* new incoming TCP client attempting to connect? */
+ else if (e->arg == MTCP_SOCKET)
+ {
+ struct multi_instance *mi;
+ ASSERT (m->top.c2.link_socket);
+ socket_reset_listen_persistent (m->top.c2.link_socket);
+ mi = multi_create_instance_tcp (m);
+ if (mi)
+ multi_tcp_action (m, mi, TA_INITIAL, false);
+ }
+ /* signal received? */
+ else if (e->arg == MTCP_SIG)
+ {
+ get_signal (&m->top.sig->signal_received);
+ }
+ }
+ if (IS_SIG (&m->top))
+ break;
+ }
+ mtcp->n_esr = 0;
+
+ /*
+ * Process queued mbuf packets destined for TCP socket
+ */
+ {
+ struct multi_instance *mi;
+ while (!IS_SIG (&m->top) && (mi = mbuf_peek (m->mbuf)) != NULL)
+ {
+ multi_tcp_action (m, mi, TA_SOCKET_WRITE, true);
+ }
+ }
+}
+
+/*
+ * Top level event loop for single-threaded operation.
+ * TCP mode.
+ */
+void
+tunnel_server_tcp (struct context *top)
+{
+ struct multi_context multi;
+ int status;
+
+ top->mode = CM_TOP;
+ context_clear_2 (top);
+
+ /* initialize top-tunnel instance */
+ init_instance_handle_signals (top, top->es, CC_HARD_USR1_TO_HUP);
+ if (IS_SIG (top))
+ return;
+
+ /* initialize global multi_context object */
+ multi_init (&multi, top, true, MC_SINGLE_THREADED);
+
+ /* initialize our cloned top object */
+ multi_top_init (&multi, top, true);
+
+ /* initialize management interface */
+ init_management_callback_multi (&multi);
+
+ /* finished with initialization */
+ initialization_sequence_completed (top, ISC_SERVER); /* --mode server --proto tcp-server */
+
+ /* per-packet event loop */
+ while (true)
+ {
+ perf_push (PERF_EVENT_LOOP);
+
+ /* wait on tun/socket list */
+ multi_get_timeout (&multi, &multi.top.c2.timeval);
+ status = multi_tcp_wait (&multi.top, multi.mtcp);
+ MULTI_CHECK_SIG (&multi);
+
+ /* check on status of coarse timers */
+ multi_process_per_second_timers (&multi);
+
+ /* timeout? */
+ if (status > 0)
+ {
+ /* process the I/O which triggered select */
+ multi_tcp_process_io (&multi);
+ MULTI_CHECK_SIG (&multi);
+ }
+ else if (status == 0)
+ {
+ multi_tcp_action (&multi, NULL, TA_TIMEOUT, false);
+ }
+
+ perf_pop ();
+ }
+
+ /* shut down management interface */
+ uninit_management_callback_multi (&multi);
+
+ /* save ifconfig-pool */
+ multi_ifconfig_pool_persist (&multi, true);
+
+ /* tear down tunnel instance (unless --persist-tun) */
+ multi_uninit (&multi);
+ multi_top_free (&multi);
+ close_instance (top);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.h
new file mode 100644
index 00000000..b677b48a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtcp.h
@@ -0,0 +1,77 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * TCP specific code for --mode server
+ */
+
+#ifndef MTCP_H
+#define MTCP_H
+
+#if P2MP_SERVER
+
+#include "event.h"
+
+/*
+ * Extra state info needed for TCP mode
+ */
+struct multi_tcp
+{
+ struct event_set *es;
+ struct event_set_return *esr;
+ int n_esr;
+ int maxevents;
+ unsigned int tun_rwflags;
+#ifdef ENABLE_MANAGEMENT
+ unsigned int management_persist_flags;
+#endif
+};
+
+struct multi_instance;
+struct context;
+
+struct multi_tcp *multi_tcp_init (int maxevents, int *maxclients);
+void multi_tcp_free (struct multi_tcp *mtcp);
+void multi_tcp_dereference_instance (struct multi_tcp *mtcp, struct multi_instance *mi);
+
+bool multi_tcp_instance_specific_init (struct multi_context *m, struct multi_instance *mi);
+void multi_tcp_instance_specific_free (struct multi_instance *mi);
+
+void multi_tcp_link_out_deferred (struct multi_context *m, struct multi_instance *mi);
+
+
+/**************************************************************************/
+/**
+ * Main event loop for OpenVPN in TCP server mode.
+ * @ingroup eventloop
+ *
+ * @param top - Top-level context structure.
+ */
+void tunnel_server_tcp (struct context *top);
+
+
+void multi_tcp_delete_event (struct multi_tcp *mtcp, event_t event);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.c
new file mode 100644
index 00000000..13f3f6c6
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.c
@@ -0,0 +1,296 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "common.h"
+#include "buffer.h"
+#include "error.h"
+#include "integer.h"
+#include "mtu.h"
+
+#include "memdbg.h"
+
+/* allocate a buffer for socket or tun layer */
+void
+alloc_buf_sock_tun (struct buffer *buf,
+ const struct frame *frame,
+ const bool tuntap_buffer,
+ const unsigned int align_mask)
+{
+ /* allocate buffer for overlapped I/O */
+ *buf = alloc_buf (BUF_SIZE (frame));
+ ASSERT (buf_init (buf, FRAME_HEADROOM_ADJ (frame, align_mask)));
+ buf->len = tuntap_buffer ? MAX_RW_SIZE_TUN (frame) : MAX_RW_SIZE_LINK (frame);
+ ASSERT (buf_safe (buf, 0));
+}
+
+void
+frame_finalize (struct frame *frame,
+ bool link_mtu_defined,
+ int link_mtu,
+ bool tun_mtu_defined,
+ int tun_mtu)
+{
+ /* Set link_mtu based on command line options */
+ if (tun_mtu_defined)
+ {
+ ASSERT (!link_mtu_defined);
+ frame->link_mtu = tun_mtu + TUN_LINK_DELTA (frame);
+ }
+ else
+ {
+ ASSERT (link_mtu_defined);
+ frame->link_mtu = link_mtu;
+ }
+
+ if (TUN_MTU_SIZE (frame) < TUN_MTU_MIN)
+ {
+ msg (M_WARN, "TUN MTU value (%d) must be at least %d", TUN_MTU_SIZE (frame), TUN_MTU_MIN);
+ frame_print (frame, M_FATAL, "MTU is too small");
+ }
+
+ frame->link_mtu_dynamic = frame->link_mtu;
+
+ frame->extra_buffer += PAYLOAD_ALIGN;
+}
+
+/*
+ * Set the tun MTU dynamically.
+ */
+void
+frame_set_mtu_dynamic (struct frame *frame, int mtu, unsigned int flags)
+{
+
+#ifdef ENABLE_DEBUG
+ const int orig_mtu = mtu;
+ const int orig_link_mtu_dynamic = frame->link_mtu_dynamic;
+#endif
+
+ ASSERT (mtu >= 0);
+
+ if (flags & SET_MTU_TUN)
+ mtu += TUN_LINK_DELTA (frame);
+
+ if (!(flags & SET_MTU_UPPER_BOUND) || mtu < frame->link_mtu_dynamic)
+ {
+ frame->link_mtu_dynamic = constrain_int (
+ mtu,
+ EXPANDED_SIZE_MIN (frame),
+ EXPANDED_SIZE (frame));
+ }
+
+ dmsg (D_MTU_DEBUG, "MTU DYNAMIC mtu=%d, flags=%u, %d -> %d",
+ orig_mtu,
+ flags,
+ orig_link_mtu_dynamic,
+ frame->link_mtu_dynamic);
+}
+
+/*
+ * Move extra_frame octets into extra_tun. Used by fragmenting code
+ * to adjust frame relative to its position in the buffer processing
+ * queue.
+ */
+void
+frame_subtract_extra (struct frame *frame, const struct frame *src)
+{
+ frame->extra_frame -= src->extra_frame;
+ frame->extra_tun += src->extra_frame;
+}
+
+void
+frame_print (const struct frame *frame,
+ int level,
+ const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer out = alloc_buf_gc (256, &gc);
+ if (prefix)
+ buf_printf (&out, "%s ", prefix);
+ buf_printf (&out, "[");
+ buf_printf (&out, " L:%d", frame->link_mtu);
+ buf_printf (&out, " D:%d", frame->link_mtu_dynamic);
+ buf_printf (&out, " EF:%d", frame->extra_frame);
+ buf_printf (&out, " EB:%d", frame->extra_buffer);
+ buf_printf (&out, " ET:%d", frame->extra_tun);
+ buf_printf (&out, " EL:%d", frame->extra_link);
+ if (frame->align_flags && frame->align_adjust)
+ buf_printf (&out, " AF:%u/%d", frame->align_flags, frame->align_adjust);
+ buf_printf (&out, " ]");
+
+ msg (level, "%s", out.data);
+ gc_free (&gc);
+}
+
+#define MTUDISC_NOT_SUPPORTED_MSG "--mtu-disc is not supported on this OS"
+
+void
+set_mtu_discover_type (int sd, int mtu_type)
+{
+ if (mtu_type >= 0)
+ {
+#if defined(HAVE_SETSOCKOPT) && defined(SOL_IP) && defined(IP_MTU_DISCOVER)
+ if (setsockopt
+ (sd, SOL_IP, IP_MTU_DISCOVER, &mtu_type, sizeof (mtu_type)))
+ msg (M_ERR, "Error setting IP_MTU_DISCOVER type=%d on TCP/UDP socket",
+ mtu_type);
+#else
+ msg (M_FATAL, MTUDISC_NOT_SUPPORTED_MSG);
+#endif
+ }
+}
+
+int
+translate_mtu_discover_type_name (const char *name)
+{
+#if defined(IP_PMTUDISC_DONT) && defined(IP_PMTUDISC_WANT) && defined(IP_PMTUDISC_DO)
+ if (!strcmp (name, "yes"))
+ return IP_PMTUDISC_DO;
+ if (!strcmp (name, "maybe"))
+ return IP_PMTUDISC_WANT;
+ if (!strcmp (name, "no"))
+ return IP_PMTUDISC_DONT;
+ msg (M_FATAL,
+ "invalid --mtu-disc type: '%s' -- valid types are 'yes', 'maybe', or 'no'",
+ name);
+#else
+ msg (M_FATAL, MTUDISC_NOT_SUPPORTED_MSG);
+#endif
+ return -1; /* NOTREACHED */
+}
+
+#if EXTENDED_SOCKET_ERROR_CAPABILITY
+
+struct probehdr
+{
+ uint32_t ttl;
+ struct timeval tv;
+};
+
+const char *
+format_extended_socket_error (int fd, int *mtu, struct gc_arena *gc)
+{
+ int res;
+ struct probehdr rcvbuf;
+ struct iovec iov;
+ struct msghdr msg;
+ struct cmsghdr *cmsg;
+ struct sock_extended_err *e;
+ struct sockaddr_in addr;
+ struct buffer out = alloc_buf_gc (256, gc);
+ char *cbuf = (char *) gc_malloc (256, false, gc);
+
+ *mtu = 0;
+
+ while (true)
+ {
+ memset (&rcvbuf, -1, sizeof (rcvbuf));
+ iov.iov_base = &rcvbuf;
+ iov.iov_len = sizeof (rcvbuf);
+ msg.msg_name = (uint8_t *) &addr;
+ msg.msg_namelen = sizeof (addr);
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_flags = 0;
+ msg.msg_control = cbuf;
+ msg.msg_controllen = 256; /* size of cbuf */
+
+ res = recvmsg (fd, &msg, MSG_ERRQUEUE);
+ if (res < 0)
+ goto exit;
+
+ e = NULL;
+
+ for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; cmsg = CMSG_NXTHDR (&msg, cmsg))
+ {
+ if (cmsg->cmsg_level == SOL_IP)
+ {
+ if (cmsg->cmsg_type == IP_RECVERR)
+ {
+ e = (struct sock_extended_err *) CMSG_DATA (cmsg);
+ }
+ else
+ {
+ buf_printf (&out ,"CMSG=%d|", cmsg->cmsg_type);
+ }
+ }
+ }
+ if (e == NULL)
+ {
+ buf_printf (&out, "NO-INFO|");
+ goto exit;
+ }
+
+ switch (e->ee_errno)
+ {
+ case ETIMEDOUT:
+ buf_printf (&out, "ETIMEDOUT|");
+ break;
+ case EMSGSIZE:
+ buf_printf (&out, "EMSGSIZE Path-MTU=%d|", e->ee_info);
+ *mtu = e->ee_info;
+ break;
+ case ECONNREFUSED:
+ buf_printf (&out, "ECONNREFUSED|");
+ break;
+ case EPROTO:
+ buf_printf (&out, "EPROTO|");
+ break;
+ case EHOSTUNREACH:
+ buf_printf (&out, "EHOSTUNREACH|");
+ break;
+ case ENETUNREACH:
+ buf_printf (&out, "ENETUNREACH|");
+ break;
+ case EACCES:
+ buf_printf (&out, "EACCES|");
+ break;
+ default:
+ buf_printf (&out, "UNKNOWN|");
+ break;
+ }
+ }
+
+ exit:
+ buf_rmtail (&out, '|');
+ return BSTR (&out);
+}
+
+void
+set_sock_extended_error_passing (int sd)
+{
+ int on = 1;
+ if (setsockopt (sd, SOL_IP, IP_RECVERR, &on, sizeof (on)))
+ msg (M_WARN | M_ERRNO,
+ "Note: enable extended error passing on TCP/UDP socket failed (IP_RECVERR)");
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.h
new file mode 100644
index 00000000..29ec21fd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mtu.h
@@ -0,0 +1,308 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MTU_H
+#define MTU_H
+
+#include "buffer.h"
+
+/*
+ *
+ * Packet maninipulation routes such as encrypt, decrypt, compress, decompress
+ * are passed a frame buffer that looks like this:
+ *
+ * [extra_frame bytes] [mtu bytes] [extra_frame_bytes] [compression overflow bytes]
+ * ^
+ * Pointer passed to function points here so that routine
+ * can make use of extra_frame bytes before pointer
+ * to prepend headers, etc.
+ *
+ * extra_frame bytes is large enough for all encryption related overhead.
+ *
+ * mtu bytes will be the MTU size set in the ifconfig statement that configures
+ * the TUN or TAP device such as:
+ *
+ * ifconfig $1 10.1.0.2 pointopoint 10.1.0.1 mtu 1450
+ *
+ * Compression overflow bytes is the worst-case size expansion that would be
+ * expected if we tried to compress mtu + extra_frame bytes of uncompressible data.
+ */
+
+/*
+ * Standard ethernet MTU
+ */
+#define ETHERNET_MTU 1500
+
+/*
+ * It is a fatal error if mtu is less than
+ * this value for tun device.
+ */
+#define TUN_MTU_MIN 100
+
+/*
+ * Default MTU of network over which tunnel data will pass by TCP/UDP.
+ */
+#define LINK_MTU_DEFAULT 1500
+
+/*
+ * Default MTU of tunnel device.
+ */
+#define TUN_MTU_DEFAULT 1500
+
+/*
+ * MTU Defaults for TAP devices
+ */
+#define TAP_MTU_EXTRA_DEFAULT 32
+
+/*
+ * Default MSSFIX value, used for reducing TCP MTU size
+ */
+#define MSSFIX_DEFAULT 1450
+
+/*
+ * Alignment of payload data such as IP packet or
+ * ethernet frame.
+ */
+#define PAYLOAD_ALIGN 4
+
+
+/**************************************************************************/
+/**
+ * Packet geometry parameters.
+ */
+struct frame {
+ int link_mtu; /**< Maximum packet size to be sent over
+ * the external network interface. */
+
+ int link_mtu_dynamic; /**< Dynamic MTU value for the external
+ * network interface. */
+
+ int extra_frame; /**< Maximum number of bytes that all
+ * processing steps together could add.
+ * @code
+ * frame.link_mtu = "socket MTU" - extra_frame;
+ * @endcode
+ */
+
+ int extra_buffer; /**< Maximum number of bytes that
+ * processing steps could expand the
+ * internal work buffer.
+ *
+ * This is used by the \link compression
+ * Data Channel Compression
+ * module\endlink to give enough working
+ * space for worst-case expansion of
+ * incompressible content. */
+
+ int extra_tun; /**< Maximum number of bytes in excess of
+ * the tun/tap MTU that might be read
+ * from or written to the virtual
+ * tun/tap network interface. */
+
+ int extra_link; /**< Maximum number of bytes in excess of
+ * external network interface's MTU that
+ * might be read from or written to it. */
+
+ /*
+ * Alignment control
+ */
+# define FRAME_HEADROOM_MARKER_DECRYPT (1<<0)
+# define FRAME_HEADROOM_MARKER_FRAGMENT (1<<1)
+# define FRAME_HEADROOM_MARKER_READ_LINK (1<<2)
+# define FRAME_HEADROOM_MARKER_READ_STREAM (1<<3)
+ unsigned int align_flags;
+ int align_adjust;
+};
+
+/* Routines which read struct frame should use the macros below */
+
+/*
+ * Overhead added to packet payload due to encapsulation
+ */
+#define EXTRA_FRAME(f) ((f)->extra_frame)
+
+/*
+ * Delta between tun payload size and final TCP/UDP datagram size
+ * (not including extra_link additions)
+ */
+#define TUN_LINK_DELTA(f) ((f)->extra_frame + (f)->extra_tun)
+
+/*
+ * This is the size to "ifconfig" the tun or tap device.
+ */
+#define TUN_MTU_SIZE(f) ((f)->link_mtu - TUN_LINK_DELTA(f))
+#define TUN_MTU_SIZE_DYNAMIC(f) ((f)->link_mtu_dynamic - TUN_LINK_DELTA(f))
+
+/*
+ * This is the maximum packet size that we need to be able to
+ * read from or write to a tun or tap device. For example,
+ * a tap device ifconfiged to an MTU of 1200 might actually want
+ * to return a packet size of 1214 on a read().
+ */
+#define PAYLOAD_SIZE(f) ((f)->link_mtu - (f)->extra_frame)
+#define PAYLOAD_SIZE_DYNAMIC(f) ((f)->link_mtu_dynamic - (f)->extra_frame)
+
+/*
+ * Max size of a payload packet after encryption, compression, etc.
+ * overhead is added.
+ */
+#define EXPANDED_SIZE(f) ((f)->link_mtu)
+#define EXPANDED_SIZE_DYNAMIC(f) ((f)->link_mtu_dynamic)
+#define EXPANDED_SIZE_MIN(f) (TUN_MTU_MIN + TUN_LINK_DELTA(f))
+
+/*
+ * These values are used as maximum size constraints
+ * on read() or write() from TUN/TAP device or TCP/UDP port.
+ */
+#define MAX_RW_SIZE_TUN(f) (PAYLOAD_SIZE(f))
+#define MAX_RW_SIZE_LINK(f) (EXPANDED_SIZE(f) + (f)->extra_link)
+
+/*
+ * Control buffer headroom allocations to allow for efficient prepending.
+ */
+#define FRAME_HEADROOM_BASE(f) (TUN_LINK_DELTA(f) + (f)->extra_buffer + (f)->extra_link)
+#define FRAME_HEADROOM(f) frame_headroom(f, 0)
+#define FRAME_HEADROOM_ADJ(f, fm) frame_headroom(f, fm)
+
+/*
+ * Max size of a buffer used to build a packet for output to
+ * the TCP/UDP port.
+ */
+#define BUF_SIZE(f) (TUN_MTU_SIZE(f) + FRAME_HEADROOM_BASE(f) * 2)
+
+/*
+ * Function prototypes.
+ */
+
+void frame_finalize (struct frame *frame,
+ bool link_mtu_defined,
+ int link_mtu,
+ bool tun_mtu_defined,
+ int tun_mtu);
+
+void frame_subtract_extra (struct frame *frame, const struct frame *src);
+
+void frame_print (const struct frame *frame,
+ int level,
+ const char *prefix);
+
+void set_mtu_discover_type (int sd, int mtu_type);
+int translate_mtu_discover_type_name (const char *name);
+
+/*
+ * frame_set_mtu_dynamic and flags
+ */
+
+#define SET_MTU_TUN (1<<0) /* use tun/tap rather than link sizing */
+#define SET_MTU_UPPER_BOUND (1<<1) /* only decrease dynamic MTU */
+
+void frame_set_mtu_dynamic (struct frame *frame, int mtu, unsigned int flags);
+
+/*
+ * allocate a buffer for socket or tun layer
+ */
+void alloc_buf_sock_tun (struct buffer *buf,
+ const struct frame *frame,
+ const bool tuntap_buffer,
+ const unsigned int align_mask);
+
+/*
+ * EXTENDED_SOCKET_ERROR_CAPABILITY functions -- print extra error info
+ * on socket errors, such as PMTU size. As of 2003.05.11, only works
+ * on Linux 2.4+.
+ */
+
+#if EXTENDED_SOCKET_ERROR_CAPABILITY
+
+void set_sock_extended_error_passing (int sd);
+const char *format_extended_socket_error (int fd, int *mtu, struct gc_arena *gc);
+
+#endif
+
+/*
+ * Calculate a starting offset into a buffer object, dealing with
+ * headroom and alignment issues.
+ */
+static inline int
+frame_headroom (const struct frame *f, const unsigned int flag_mask)
+{
+ const int offset = FRAME_HEADROOM_BASE (f);
+ const int adjust = (flag_mask & f->align_flags) ? f->align_adjust : 0;
+ const int delta = ((PAYLOAD_ALIGN << 24) - (offset + adjust)) & (PAYLOAD_ALIGN - 1);
+ return offset + delta;
+}
+
+/*
+ * frame member adjustment functions
+ */
+
+static inline void
+frame_add_to_extra_frame (struct frame *frame, const int increment)
+{
+ frame->extra_frame += increment;
+}
+
+static inline void
+frame_add_to_extra_tun (struct frame *frame, const int increment)
+{
+ frame->extra_tun += increment;
+}
+
+static inline void
+frame_add_to_extra_link (struct frame *frame, const int increment)
+{
+ frame->extra_link += increment;
+}
+
+static inline void
+frame_add_to_extra_buffer (struct frame *frame, const int increment)
+{
+ frame->extra_buffer += increment;
+}
+
+static inline void
+frame_add_to_align_adjust (struct frame *frame, const int increment)
+{
+ frame->align_adjust += increment;
+}
+
+static inline void
+frame_align_to_extra_frame (struct frame *frame)
+{
+ frame->align_adjust = frame->extra_frame + frame->extra_link;
+}
+
+static inline void
+frame_or_align_flags (struct frame *frame, const unsigned int flag_mask)
+{
+ frame->align_flags |= flag_mask;
+}
+
+static inline bool
+frame_defined (const struct frame *frame)
+{
+ return frame->link_mtu > 0;
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.c
new file mode 100644
index 00000000..f7ab6253
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.c
@@ -0,0 +1,385 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "multi.h"
+#include "forward-inline.h"
+
+#include "memdbg.h"
+
+/*
+ * Update instance with new peer address
+ */
+void
+update_floated(struct multi_context *m, struct multi_instance *mi,
+ struct mroute_addr real, uint32_t hv)
+{
+ struct mroute_addr real_old;
+
+ real_old = mi->real;
+ generate_prefix (mi);
+
+ /* remove before modifying mi->real, since it also modifies key in hash */
+ hash_remove(m->hash, &real_old);
+ hash_remove(m->iter, &real_old);
+
+ /* update address */
+ memcpy(&mi->real, &real, sizeof(real));
+
+ mi->context.c2.from = m->top.c2.from;
+ mi->context.c2.to_link_addr = &mi->context.c2.from;
+
+ /* switch to new log prefix */
+ generate_prefix (mi);
+ /* inherit buffers */
+ mi->context.c2.buffers = m->top.c2.buffers;
+
+ /* inherit parent link_socket and link_socket_info */
+ mi->context.c2.link_socket = m->top.c2.link_socket;
+ mi->context.c2.link_socket_info->lsa->actual = m->top.c2.from;
+
+ /* fix remote_addr in tls structure */
+ tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
+ mi->did_open_context = true;
+
+ hash_add(m->hash, &mi->real, mi, false);
+ hash_add(m->iter, &mi->real, mi, false);
+
+ mi->did_real_hash = true;
+#ifdef MANAGEMENT_DEF_AUTH
+ hash_remove (m->cid_hash, &mi->context.c2.mda_context.cid);
+ hash_add (m->cid_hash, &mi->context.c2.mda_context.cid, mi, false);
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+ mi->did_cid_hash = true;
+#endif
+}
+
+/*
+ * Get a client instance based on real address. If
+ * the instance doesn't exist, create it while
+ * maintaining real address hash table atomicity.
+ */
+
+struct multi_instance *
+multi_get_create_instance_udp (struct multi_context *m)
+{
+ struct gc_arena gc = gc_new ();
+ struct mroute_addr real;
+ struct multi_instance *mi = NULL;
+ struct hash *hash = m->hash;
+
+ if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true))
+ {
+ struct hash_element *he;
+ const uint32_t hv = hash_value (hash, &real);
+ struct hash_bucket *bucket = hash_bucket (hash, hv);
+ uint8_t* ptr = BPTR(&m->top.c2.buf);
+ uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
+ uint32_t sess_id;
+ bool session_forged = false;
+
+ if (op == P_DATA_V2)
+ {
+ sess_id = (*(uint32_t*)ptr) >> 8;
+ if ((sess_id < m->max_clients) && (m->instances[sess_id]))
+ {
+ mi = m->instances[sess_id];
+
+ if (!link_socket_actual_match(&mi->context.c2.from, &m->top.c2.from))
+ {
+ msg(D_MULTI_MEDIUM, "floating detected from %s to %s",
+ print_link_socket_actual (&mi->context.c2.from, &gc), print_link_socket_actual (&m->top.c2.from, &gc));
+
+ /* session-id is not trusted, so check hmac */
+ session_forged = !(crypto_test_hmac(&m->top.c2.buf, &mi->context.c2.crypto_options));
+ if (session_forged)
+ {
+ mi = NULL;
+ msg (D_MULTI_MEDIUM, "hmac verification failed, session forge detected!");
+ }
+ else
+ {
+ update_floated(m, mi, real, hv);
+ }
+ }
+ }
+ }
+ else
+ {
+ he = hash_lookup_fast (hash, bucket, &real, hv);
+ if (he)
+ {
+ mi = (struct multi_instance *) he->value;
+ }
+ }
+ if (!mi && !session_forged)
+ {
+ if (!m->top.c2.tls_auth_standalone
+ || tls_pre_decrypt_lite (m->top.c2.tls_auth_standalone, &m->top.c2.from, &m->top.c2.buf))
+ {
+ if (frequency_limit_event_allowed (m->new_connection_limiter))
+ {
+ mi = multi_create_instance (m, &real);
+ if (mi)
+ {
+ hash_add_fast (hash, bucket, &mi->real, hv, mi);
+ mi->did_real_hash = true;
+
+ int i;
+ for (i = 0; i < m->max_clients; ++ i)
+ {
+ if (!m->instances[i])
+ {
+ mi->context.c2.tls_multi->vpn_session_id = i;
+ m->instances[i] = mi;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ msg (D_MULTI_ERRORS,
+ "MULTI: Connection from %s would exceed new connection frequency limit as controlled by --connect-freq",
+ mroute_addr_print (&real, &gc));
+ }
+ }
+ }
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_MULTI_DEBUG))
+ {
+ const char *status = mi ? "[ok]" : "[failed]";
+
+ /*
+ if (he && mi)
+ status = "[succeeded]";
+ else if (!he && mi)
+ status = "[created]";
+ else
+ status = "[failed]";
+ */
+
+ dmsg (D_MULTI_DEBUG, "GET INST BY REAL: %s %s",
+ mroute_addr_print (&real, &gc),
+ status);
+ }
+#endif
+ }
+
+ gc_free (&gc);
+ ASSERT (!(mi && mi->halt));
+ return mi;
+}
+
+/*
+ * Send a packet to TCP/UDP socket.
+ */
+static inline void
+multi_process_outgoing_link (struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = multi_process_outgoing_link_pre (m);
+ if (mi)
+ multi_process_outgoing_link_dowork (m, mi, mpp_flags);
+}
+
+/*
+ * Process an I/O event.
+ */
+static void
+multi_process_io_udp (struct multi_context *m)
+{
+ const unsigned int status = m->top.c2.event_set_status;
+ const unsigned int mpp_flags = m->top.c2.fast_io
+ ? (MPP_CONDITIONAL_PRE_SELECT | MPP_CLOSE_ON_SIGNAL)
+ : (MPP_PRE_SELECT | MPP_CLOSE_ON_SIGNAL);
+
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ char buf[16];
+ buf[0] = 0;
+ if (status & SOCKET_READ)
+ strcat (buf, "SR/");
+ else if (status & SOCKET_WRITE)
+ strcat (buf, "SW/");
+ else if (status & TUN_READ)
+ strcat (buf, "TR/");
+ else if (status & TUN_WRITE)
+ strcat (buf, "TW/");
+ printf ("IO %s\n", buf);
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ if (status & (MANAGEMENT_READ|MANAGEMENT_WRITE))
+ {
+ ASSERT (management);
+ management_io (management);
+ }
+#endif
+
+ /* UDP port ready to accept write */
+ if (status & SOCKET_WRITE)
+ {
+ multi_process_outgoing_link (m, mpp_flags);
+ }
+ /* TUN device ready to accept write */
+ else if (status & TUN_WRITE)
+ {
+ multi_process_outgoing_tun (m, mpp_flags);
+ }
+ /* Incoming data on UDP port */
+ else if (status & SOCKET_READ)
+ {
+ read_incoming_link (&m->top);
+ multi_release_io_lock (m);
+ if (!IS_SIG (&m->top))
+ multi_process_incoming_link (m, NULL, mpp_flags);
+ }
+ /* Incoming data on TUN device */
+ else if (status & TUN_READ)
+ {
+ read_incoming_tun (&m->top);
+ multi_release_io_lock (m);
+ if (!IS_SIG (&m->top))
+ multi_process_incoming_tun (m, mpp_flags);
+ }
+}
+
+/*
+ * Return the io_wait() flags appropriate for
+ * a point-to-multipoint tunnel.
+ */
+static inline unsigned int
+p2mp_iow_flags (const struct multi_context *m)
+{
+ unsigned int flags = IOW_WAIT_SIGNAL;
+ if (m->pending)
+ {
+ if (TUN_OUT (&m->pending->context))
+ flags |= IOW_TO_TUN;
+ if (LINK_OUT (&m->pending->context))
+ flags |= IOW_TO_LINK;
+ }
+ else if (mbuf_defined (m->mbuf))
+ flags |= IOW_MBUF;
+ else
+ flags |= IOW_READ;
+
+ return flags;
+}
+
+
+/**************************************************************************/
+/**
+ * Main event loop for OpenVPN in UDP server mode.
+ * @ingroup eventloop
+ *
+ * This function implements OpenVPN's main event loop for UDP server mode.
+ * At this time, OpenVPN does not yet support multithreading. This
+ * function's name is therefore slightly misleading.
+ *
+ * @param top - Top-level context structure.
+ */
+static void
+tunnel_server_udp_single_threaded (struct context *top)
+{
+ struct multi_context multi;
+
+ top->mode = CM_TOP;
+ context_clear_2 (top);
+
+ /* initialize top-tunnel instance */
+ init_instance_handle_signals (top, top->es, CC_HARD_USR1_TO_HUP);
+ if (IS_SIG (top))
+ return;
+
+ /* initialize global multi_context object */
+ multi_init (&multi, top, false, MC_SINGLE_THREADED);
+
+ /* initialize our cloned top object */
+ multi_top_init (&multi, top, true);
+
+ /* initialize management interface */
+ init_management_callback_multi (&multi);
+
+ /* finished with initialization */
+ initialization_sequence_completed (top, ISC_SERVER); /* --mode server --proto udp */
+
+ /* per-packet event loop */
+ while (true)
+ {
+ perf_push (PERF_EVENT_LOOP);
+
+ /* set up and do the io_wait() */
+ multi_get_timeout (&multi, &multi.top.c2.timeval);
+ io_wait (&multi.top, p2mp_iow_flags (&multi));
+ MULTI_CHECK_SIG (&multi);
+
+ /* check on status of coarse timers */
+ multi_process_per_second_timers (&multi);
+
+ /* timeout? */
+ if (multi.top.c2.event_set_status == ES_TIMEOUT)
+ {
+ multi_process_timeout (&multi, MPP_PRE_SELECT|MPP_CLOSE_ON_SIGNAL);
+ }
+ else
+ {
+ /* process I/O */
+ multi_process_io_udp (&multi);
+ MULTI_CHECK_SIG (&multi);
+ }
+
+ perf_pop ();
+ }
+
+ /* shut down management interface */
+ uninit_management_callback_multi (&multi);
+
+ /* save ifconfig-pool */
+ multi_ifconfig_pool_persist (&multi, true);
+
+ /* tear down tunnel instance (unless --persist-tun) */
+ multi_uninit (&multi);
+ multi_top_free (&multi);
+ close_instance (top);
+}
+
+void
+tunnel_server_udp (struct context *top)
+{
+ tunnel_server_udp_single_threaded (top);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.h
new file mode 100644
index 00000000..97f961b3
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/mudp.h
@@ -0,0 +1,71 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * UDP specific code for --mode server
+ */
+
+#ifndef MUDP_H
+#define MUDP_H
+
+#if P2MP_SERVER
+
+struct context;
+struct multi_context;
+
+
+/**************************************************************************/
+/**
+ * Main event loop wrapper function for OpenVPN in UDP server mode.
+ * @ingroup eventloop
+ *
+ * This function simply calls \c tunnel_server_udp_single_threaded().
+ *
+ * @param top - Top-level context structure.
+ */
+void tunnel_server_udp (struct context *top);
+
+
+/**************************************************************************/
+/**
+ * Get, and if necessary create, the multi_instance associated with a
+ * packet's source address.
+ * @ingroup external_multiplexer
+ *
+ * This function extracts the source address of a recently read packet
+ * from \c m->top.c2.from and uses that source address as a hash key for
+ * the hash table \c m->hash. If an entry exists, this function returns
+ * it. If no entry exists, this function handles its creation, and if
+ * successful, returns the newly created instance.
+ *
+ * @param m - The single multi_context structure.
+ *
+ * @return A pointer to a multi_instance if one already existed for the
+ * packet's source address or if one was a newly created successfully.
+ * NULL if one did not yet exist and a new one was not created.
+ */
+struct multi_instance *multi_get_create_instance_udp (struct multi_context *m);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.c
new file mode 100644
index 00000000..a4289ac7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.c
@@ -0,0 +1,2892 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "multi.h"
+#include "push.h"
+#include "misc.h"
+#include "otime.h"
+#include "gremlin.h"
+#include "mstats.h"
+#include "ssl_verify.h"
+
+#include "memdbg.h"
+
+#include "forward-inline.h"
+#include "pf-inline.h"
+
+/*#define MULTI_DEBUG_EVENT_LOOP*/
+
+#ifdef MULTI_DEBUG_EVENT_LOOP
+static const char *
+id (struct multi_instance *mi)
+{
+ if (mi)
+ return tls_common_name (mi->context.c2.tls_multi, false);
+ else
+ return "NULL";
+}
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+static void
+set_cc_config (struct multi_instance *mi, struct buffer_list *cc_config)
+{
+ if (mi->cc_config)
+ buffer_list_free (mi->cc_config);
+ mi->cc_config = cc_config;
+}
+#endif
+
+static inline void
+update_mstat_n_clients(const int n_clients)
+{
+#ifdef ENABLE_MEMSTATS
+ if (mmap_stats)
+ mmap_stats->n_clients = n_clients;
+#endif
+}
+
+static bool
+learn_address_script (const struct multi_context *m,
+ const struct multi_instance *mi,
+ const char *op,
+ const struct mroute_addr *addr)
+{
+ struct gc_arena gc = gc_new ();
+ struct env_set *es;
+ bool ret = true;
+ struct plugin_list *plugins;
+
+ /* get environmental variable source */
+ if (mi && mi->context.c2.es)
+ es = mi->context.c2.es;
+ else
+ es = env_set_create (&gc);
+
+ /* get plugin source */
+ if (mi)
+ plugins = mi->context.plugins;
+ else
+ plugins = m->top.plugins;
+
+ if (plugin_defined (plugins, OPENVPN_PLUGIN_LEARN_ADDRESS))
+ {
+ struct argv argv = argv_new ();
+ argv_printf (&argv, "%s %s",
+ op,
+ mroute_addr_print (addr, &gc));
+ if (mi)
+ argv_printf_cat (&argv, "%s", tls_common_name (mi->context.c2.tls_multi, false));
+ if (plugin_call (plugins, OPENVPN_PLUGIN_LEARN_ADDRESS, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ {
+ msg (M_WARN, "WARNING: learn-address plugin call failed");
+ ret = false;
+ }
+ argv_reset (&argv);
+ }
+
+ if (m->top.options.learn_address_script)
+ {
+ struct argv argv = argv_new ();
+ setenv_str (es, "script_type", "learn-address");
+ argv_printf (&argv, "%sc %s %s",
+ m->top.options.learn_address_script,
+ op,
+ mroute_addr_print (addr, &gc));
+ if (mi)
+ argv_printf_cat (&argv, "%s", tls_common_name (mi->context.c2.tls_multi, false));
+ if (!openvpn_run_script (&argv, es, 0, "--learn-address"))
+ ret = false;
+ argv_reset (&argv);
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+void
+multi_ifconfig_pool_persist (struct multi_context *m, bool force)
+{
+ /* write pool data to file */
+ if (m->ifconfig_pool
+ && m->top.c1.ifconfig_pool_persist
+ && (force || ifconfig_pool_write_trigger (m->top.c1.ifconfig_pool_persist)))
+ {
+ ifconfig_pool_write (m->top.c1.ifconfig_pool_persist, m->ifconfig_pool);
+ }
+}
+
+static void
+multi_reap_range (const struct multi_context *m,
+ int start_bucket,
+ int end_bucket)
+{
+ struct gc_arena gc = gc_new ();
+ struct hash_iterator hi;
+ struct hash_element *he;
+
+ if (start_bucket < 0)
+ {
+ start_bucket = 0;
+ end_bucket = hash_n_buckets (m->vhash);
+ }
+
+ dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
+ while ((he = hash_iterator_next (&hi)) != NULL)
+ {
+ struct multi_route *r = (struct multi_route *) he->value;
+ if (!multi_route_defined (m, r))
+ {
+ dmsg (D_MULTI_DEBUG, "MULTI: REAP DEL %s",
+ mroute_addr_print (&r->addr, &gc));
+ learn_address_script (m, NULL, "delete", &r->addr);
+ multi_route_del (r);
+ hash_iterator_delete_element (&hi);
+ }
+ }
+ hash_iterator_free (&hi);
+ gc_free (&gc);
+}
+
+static void
+multi_reap_all (const struct multi_context *m)
+{
+ multi_reap_range (m, -1, 0);
+}
+
+static struct multi_reap *
+multi_reap_new (int buckets_per_pass)
+{
+ struct multi_reap *mr;
+ ALLOC_OBJ (mr, struct multi_reap);
+ mr->bucket_base = 0;
+ mr->buckets_per_pass = buckets_per_pass;
+ mr->last_call = now;
+ return mr;
+}
+
+void
+multi_reap_process_dowork (const struct multi_context *m)
+{
+ struct multi_reap *mr = m->reaper;
+ if (mr->bucket_base >= hash_n_buckets (m->vhash))
+ mr->bucket_base = 0;
+ multi_reap_range (m, mr->bucket_base, mr->bucket_base + mr->buckets_per_pass);
+ mr->bucket_base += mr->buckets_per_pass;
+ mr->last_call = now;
+}
+
+static void
+multi_reap_free (struct multi_reap *mr)
+{
+ free (mr);
+}
+
+/*
+ * How many buckets in vhash to reap per pass.
+ */
+static int
+reap_buckets_per_pass (int n_buckets)
+{
+ return constrain_int (n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX);
+}
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+static uint32_t
+cid_hash_function (const void *key, uint32_t iv)
+{
+ const unsigned long *k = (const unsigned long *)key;
+ return (uint32_t) *k;
+}
+
+static bool
+cid_compare_function (const void *key1, const void *key2)
+{
+ const unsigned long *k1 = (const unsigned long *)key1;
+ const unsigned long *k2 = (const unsigned long *)key2;
+ return *k1 == *k2;
+}
+
+#endif
+
+/*
+ * Main initialization function, init multi_context object.
+ */
+void
+multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int thread_mode)
+{
+ int dev = DEV_TYPE_UNDEF;
+
+ msg (D_MULTI_LOW, "MULTI: multi_init called, r=%d v=%d",
+ t->options.real_hash_size,
+ t->options.virtual_hash_size);
+
+ /*
+ * Get tun/tap/null device type
+ */
+ dev = dev_type_enum (t->options.dev, t->options.dev_type);
+
+ /*
+ * Init our multi_context object.
+ */
+ CLEAR (*m);
+
+ m->thread_mode = thread_mode;
+
+ /*
+ * Real address hash table (source port number is
+ * considered to be part of the address). Used
+ * to determine which client sent an incoming packet
+ * which is seen on the TCP/UDP socket.
+ */
+ m->hash = hash_init (t->options.real_hash_size,
+ get_random (),
+ mroute_addr_hash_function,
+ mroute_addr_compare_function);
+
+ /*
+ * Virtual address hash table. Used to determine
+ * which client to route a packet to.
+ */
+ m->vhash = hash_init (t->options.virtual_hash_size,
+ get_random (),
+ mroute_addr_hash_function,
+ mroute_addr_compare_function);
+
+ /*
+ * This hash table is a clone of m->hash but with a
+ * bucket size of one so that it can be used
+ * for fast iteration through the list.
+ */
+ m->iter = hash_init (1,
+ get_random (),
+ mroute_addr_hash_function,
+ mroute_addr_compare_function);
+
+#ifdef MANAGEMENT_DEF_AUTH
+ m->cid_hash = hash_init (t->options.real_hash_size,
+ 0,
+ cid_hash_function,
+ cid_compare_function);
+#endif
+
+
+ /*
+ * This is our scheduler, for time-based wakeup
+ * events.
+ */
+ m->schedule = schedule_init ();
+
+ /*
+ * Limit frequency of incoming connections to control
+ * DoS.
+ */
+ m->new_connection_limiter = frequency_limit_init (t->options.cf_max,
+ t->options.cf_per);
+
+ /*
+ * Allocate broadcast/multicast buffer list
+ */
+ m->mbuf = mbuf_init (t->options.n_bcast_buf);
+
+ /*
+ * Different status file format options are available
+ */
+ m->status_file_version = t->options.status_file_version;
+
+ /*
+ * Possibly allocate an ifconfig pool, do it
+ * differently based on whether a tun or tap style
+ * tunnel.
+ */
+ if (t->options.ifconfig_pool_defined)
+ {
+ int pool_type = IFCONFIG_POOL_INDIV;
+
+ if ( dev == DEV_TYPE_TUN && t->options.topology == TOP_NET30 )
+ pool_type = IFCONFIG_POOL_30NET;
+
+ m->ifconfig_pool = ifconfig_pool_init (pool_type,
+ t->options.ifconfig_pool_start,
+ t->options.ifconfig_pool_end,
+ t->options.duplicate_cn,
+ t->options.ifconfig_ipv6_pool_defined,
+ t->options.ifconfig_ipv6_pool_base,
+ t->options.ifconfig_ipv6_pool_netbits );
+
+ /* reload pool data from file */
+ if (t->c1.ifconfig_pool_persist)
+ ifconfig_pool_read (t->c1.ifconfig_pool_persist, m->ifconfig_pool);
+ }
+
+ /*
+ * Help us keep track of routing table.
+ */
+ m->route_helper = mroute_helper_init (MULTI_CACHE_ROUTE_TTL);
+
+ /*
+ * Initialize route and instance reaper.
+ */
+ m->reaper = multi_reap_new (reap_buckets_per_pass (t->options.virtual_hash_size));
+
+ /*
+ * Get local ifconfig address
+ */
+ CLEAR (m->local);
+ ASSERT (t->c1.tuntap);
+ mroute_extract_in_addr_t (&m->local, t->c1.tuntap->local);
+
+ /*
+ * Per-client limits
+ */
+ m->max_clients = t->options.max_clients;
+
+ int i;
+ m->instances = malloc(sizeof(struct multi_instance*) * m->max_clients);
+ for (i = 0; i < m->max_clients; ++ i)
+ {
+ m->instances[i] = NULL;
+ }
+
+ /*
+ * Initialize multi-socket TCP I/O wait object
+ */
+ if (tcp_mode)
+ m->mtcp = multi_tcp_init (t->options.max_clients, &m->max_clients);
+ m->tcp_queue_limit = t->options.tcp_queue_limit;
+
+ /*
+ * Allow client <-> client communication, without going through
+ * tun/tap interface and network stack?
+ */
+ m->enable_c2c = t->options.enable_c2c;
+
+ /* initialize stale routes check timer */
+ if (t->options.stale_routes_check_interval > 0)
+ {
+ msg (M_INFO, "Initializing stale route check timer to run every %i seconds and to removing routes with activity timeout older than %i seconds",
+ t->options.stale_routes_check_interval, t->options.stale_routes_ageing_time);
+ event_timeout_init (&m->stale_routes_check_et, t->options.stale_routes_check_interval, 0);
+ }
+}
+
+const char *
+multi_instance_string (const struct multi_instance *mi, bool null, struct gc_arena *gc)
+{
+ if (mi)
+ {
+ struct buffer out = alloc_buf_gc (256, gc);
+ const char *cn = tls_common_name (mi->context.c2.tls_multi, true);
+
+ if (cn)
+ buf_printf (&out, "%s/", cn);
+ buf_printf (&out, "%s", mroute_addr_print (&mi->real, gc));
+ return BSTR (&out);
+ }
+ else if (null)
+ return NULL;
+ else
+ return "UNDEF";
+}
+
+void
+generate_prefix (struct multi_instance *mi)
+{
+ mi->msg_prefix = multi_instance_string (mi, true, &mi->gc);
+ set_prefix (mi);
+}
+
+void
+ungenerate_prefix (struct multi_instance *mi)
+{
+ mi->msg_prefix = NULL;
+ set_prefix (mi);
+}
+
+static const char *
+mi_prefix (const struct multi_instance *mi)
+{
+ if (mi && mi->msg_prefix)
+ return mi->msg_prefix;
+ else
+ return "UNDEF_I";
+}
+
+/*
+ * Tell the route helper about deleted iroutes so
+ * that it can update its mask of currently used
+ * CIDR netlengths.
+ */
+static void
+multi_del_iroutes (struct multi_context *m,
+ struct multi_instance *mi)
+{
+ const struct iroute *ir;
+ const struct iroute_ipv6 *ir6;
+ if (TUNNEL_TYPE (mi->context.c1.tuntap) == DEV_TYPE_TUN)
+ {
+ for (ir = mi->context.options.iroutes; ir != NULL; ir = ir->next)
+ mroute_helper_del_iroute46 (m->route_helper, ir->netbits);
+
+ for ( ir6 = mi->context.options.iroutes_ipv6; ir6 != NULL; ir6 = ir6->next )
+ mroute_helper_del_iroute46 (m->route_helper, ir6->netbits);
+ }
+}
+
+static void
+setenv_stats (struct context *c)
+{
+ setenv_counter (c->c2.es, "bytes_received", c->c2.link_read_bytes);
+ setenv_counter (c->c2.es, "bytes_sent", c->c2.link_write_bytes);
+}
+
+static void
+multi_client_disconnect_setenv (struct multi_context *m,
+ struct multi_instance *mi)
+{
+ /* setenv client real IP address */
+ setenv_trusted (mi->context.c2.es, get_link_socket_info (&mi->context));
+
+ /* setenv stats */
+ setenv_stats (&mi->context);
+
+ /* setenv connection duration */
+ {
+ const unsigned int duration = (unsigned int) now - mi->created;
+ setenv_unsigned (mi->context.c2.es, "time_duration", duration);
+ }
+}
+
+static void
+multi_client_disconnect_script (struct multi_context *m,
+ struct multi_instance *mi)
+{
+ if ((mi->context.c2.context_auth == CAS_SUCCEEDED && mi->connection_established_flag)
+ || mi->context.c2.context_auth == CAS_PARTIAL)
+ {
+ multi_client_disconnect_setenv (m, mi);
+
+ if (plugin_defined (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_DISCONNECT))
+ {
+ if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_DISCONNECT, NULL, NULL, mi->context.c2.es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ msg (M_WARN, "WARNING: client-disconnect plugin call failed");
+ }
+
+ if (mi->context.options.client_disconnect_script)
+ {
+ struct argv argv = argv_new ();
+ setenv_str (mi->context.c2.es, "script_type", "client-disconnect");
+ argv_printf (&argv, "%sc", mi->context.options.client_disconnect_script);
+ openvpn_run_script (&argv, mi->context.c2.es, 0, "--client-disconnect");
+ argv_reset (&argv);
+ }
+#ifdef MANAGEMENT_DEF_AUTH
+ if (management)
+ management_notify_client_close (management, &mi->context.c2.mda_context, mi->context.c2.es);
+#endif
+
+ }
+}
+
+void
+multi_close_instance (struct multi_context *m,
+ struct multi_instance *mi,
+ bool shutdown)
+{
+ perf_push (PERF_MULTI_CLOSE_INSTANCE);
+
+ ASSERT (!mi->halt);
+ mi->halt = true;
+
+ dmsg (D_MULTI_DEBUG, "MULTI: multi_close_instance called");
+
+ /* adjust current client connection count */
+ m->n_clients += mi->n_clients_delta;
+ update_mstat_n_clients(m->n_clients);
+ mi->n_clients_delta = 0;
+
+ /* prevent dangling pointers */
+ if (m->pending == mi)
+ multi_set_pending (m, NULL);
+ if (m->earliest_wakeup == mi)
+ m->earliest_wakeup = NULL;
+
+ if (!shutdown)
+ {
+ if (mi->did_real_hash)
+ {
+ ASSERT (hash_remove (m->hash, &mi->real));
+ }
+ if (mi->did_iter)
+ {
+ ASSERT (hash_remove (m->iter, &mi->real));
+ }
+#ifdef MANAGEMENT_DEF_AUTH
+ if (mi->did_cid_hash)
+ {
+ ASSERT (hash_remove (m->cid_hash, &mi->context.c2.mda_context.cid));
+ }
+#endif
+
+ m->instances[mi->context.c2.tls_multi->vpn_session_id] = NULL;
+
+ schedule_remove_entry (m->schedule, (struct schedule_entry *) mi);
+
+ ifconfig_pool_release (m->ifconfig_pool, mi->vaddr_handle, false);
+
+ if (mi->did_iroutes)
+ {
+ multi_del_iroutes (m, mi);
+ mi->did_iroutes = false;
+ }
+
+ if (m->mtcp)
+ multi_tcp_dereference_instance (m->mtcp, mi);
+
+ mbuf_dereference_instance (m->mbuf, mi);
+ }
+
+#ifdef MANAGEMENT_DEF_AUTH
+ set_cc_config (mi, NULL);
+#endif
+
+ multi_client_disconnect_script (m, mi);
+
+ if (mi->did_open_context)
+ close_context (&mi->context, SIGTERM, CC_GC_FREE);
+
+ multi_tcp_instance_specific_free (mi);
+
+ ungenerate_prefix (mi);
+
+ /*
+ * Don't actually delete the instance memory allocation yet,
+ * because virtual routes may still point to it. Let the
+ * vhash reaper deal with it.
+ */
+ multi_instance_dec_refcount (mi);
+
+ perf_pop ();
+}
+
+/*
+ * Called on shutdown or restart.
+ */
+void
+multi_uninit (struct multi_context *m)
+{
+ if (m->thread_mode & MC_WORK_THREAD)
+ {
+ multi_top_free (m);
+ m->thread_mode = MC_UNDEF;
+ }
+ else if (m->thread_mode)
+ {
+ if (m->hash)
+ {
+ struct hash_iterator hi;
+ struct hash_element *he;
+
+ hash_iterator_init (m->iter, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct multi_instance *mi = (struct multi_instance *) he->value;
+ mi->did_iter = false;
+ multi_close_instance (m, mi, true);
+ }
+ hash_iterator_free (&hi);
+
+ multi_reap_all (m);
+
+ hash_free (m->hash);
+ hash_free (m->vhash);
+ hash_free (m->iter);
+#ifdef MANAGEMENT_DEF_AUTH
+ hash_free (m->cid_hash);
+#endif
+ m->hash = NULL;
+
+ free(m->instances);
+
+ schedule_free (m->schedule);
+ mbuf_free (m->mbuf);
+ ifconfig_pool_free (m->ifconfig_pool);
+ frequency_limit_free (m->new_connection_limiter);
+ multi_reap_free (m->reaper);
+ mroute_helper_free (m->route_helper);
+ multi_tcp_free (m->mtcp);
+ m->thread_mode = MC_UNDEF;
+ }
+ }
+}
+
+/*
+ * Create a client instance object for a newly connected client.
+ */
+struct multi_instance *
+multi_create_instance (struct multi_context *m, const struct mroute_addr *real)
+{
+ struct gc_arena gc = gc_new ();
+ struct multi_instance *mi;
+
+ perf_push (PERF_MULTI_CREATE_INSTANCE);
+
+ ALLOC_OBJ_CLEAR (mi, struct multi_instance);
+
+ mi->gc = gc_new ();
+ multi_instance_inc_refcount (mi);
+ mi->vaddr_handle = -1;
+ mi->created = now;
+ mroute_addr_init (&mi->real);
+
+ if (real)
+ {
+ mi->real = *real;
+ generate_prefix (mi);
+ }
+
+ mi->did_open_context = true;
+ inherit_context_child (&mi->context, &m->top);
+ if (IS_SIG (&mi->context))
+ goto err;
+
+ mi->context.c2.context_auth = CAS_PENDING;
+
+ if (hash_n_elements (m->hash) >= m->max_clients)
+ {
+ msg (D_MULTI_ERRORS, "MULTI: new incoming connection would exceed maximum number of clients (%d)", m->max_clients);
+ goto err;
+ }
+
+ if (!real) /* TCP mode? */
+ {
+ if (!multi_tcp_instance_specific_init (m, mi))
+ goto err;
+ generate_prefix (mi);
+ }
+
+ if (!hash_add (m->iter, &mi->real, mi, false))
+ {
+ msg (D_MULTI_LOW, "MULTI: unable to add real address [%s] to iterator hash table",
+ mroute_addr_print (&mi->real, &gc));
+ goto err;
+ }
+ mi->did_iter = true;
+
+#ifdef MANAGEMENT_DEF_AUTH
+ do {
+ mi->context.c2.mda_context.cid = m->cid_counter++;
+ } while (!hash_add (m->cid_hash, &mi->context.c2.mda_context.cid, mi, false));
+ mi->did_cid_hash = true;
+#endif
+
+ mi->context.c2.push_reply_deferred = true;
+
+ if (!multi_process_post (m, mi, MPP_PRE_SELECT))
+ {
+ msg (D_MULTI_ERRORS, "MULTI: signal occurred during client instance initialization");
+ goto err;
+ }
+
+ perf_pop ();
+ gc_free (&gc);
+ return mi;
+
+ err:
+ multi_close_instance (m, mi, false);
+ perf_pop ();
+ gc_free (&gc);
+ return NULL;
+}
+
+/*
+ * Dump tables -- triggered by SIGUSR2.
+ * If status file is defined, write to file.
+ * If status file is NULL, write to syslog.
+ */
+void
+multi_print_status (struct multi_context *m, struct status_output *so, const int version)
+{
+ if (m->hash)
+ {
+ struct gc_arena gc_top = gc_new ();
+ struct hash_iterator hi;
+ const struct hash_element *he;
+
+ status_reset (so);
+
+ if (version == 1) /* WAS: m->status_file_version */
+ {
+ /*
+ * Status file version 1
+ */
+ status_printf (so, "OpenVPN CLIENT LIST");
+ status_printf (so, "Updated,%s", time_string (0, 0, false, &gc_top));
+ status_printf (so, "Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since");
+ hash_iterator_init (m->hash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct gc_arena gc = gc_new ();
+ const struct multi_instance *mi = (struct multi_instance *) he->value;
+
+ if (!mi->halt)
+ {
+ status_printf (so, "%s,%s," counter_format "," counter_format ",%s",
+ tls_common_name (mi->context.c2.tls_multi, false),
+ mroute_addr_print (&mi->real, &gc),
+ mi->context.c2.link_read_bytes,
+ mi->context.c2.link_write_bytes,
+ time_string (mi->created, 0, false, &gc));
+ }
+ gc_free (&gc);
+ }
+ hash_iterator_free (&hi);
+
+ status_printf (so, "ROUTING TABLE");
+ status_printf (so, "Virtual Address,Common Name,Real Address,Last Ref");
+ hash_iterator_init (m->vhash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct gc_arena gc = gc_new ();
+ const struct multi_route *route = (struct multi_route *) he->value;
+
+ if (multi_route_defined (m, route))
+ {
+ const struct multi_instance *mi = route->instance;
+ const struct mroute_addr *ma = &route->addr;
+ char flags[2] = {0, 0};
+
+ if (route->flags & MULTI_ROUTE_CACHE)
+ flags[0] = 'C';
+ status_printf (so, "%s%s,%s,%s,%s",
+ mroute_addr_print (ma, &gc),
+ flags,
+ tls_common_name (mi->context.c2.tls_multi, false),
+ mroute_addr_print (&mi->real, &gc),
+ time_string (route->last_reference, 0, false, &gc));
+ }
+ gc_free (&gc);
+ }
+ hash_iterator_free (&hi);
+
+ status_printf (so, "GLOBAL STATS");
+ if (m->mbuf)
+ status_printf (so, "Max bcast/mcast queue length,%d",
+ mbuf_maximum_queued (m->mbuf));
+
+ status_printf (so, "END");
+ }
+ else if (version == 2 || version == 3)
+ {
+ const char sep = (version == 3) ? '\t' : ',';
+
+ /*
+ * Status file version 2 and 3
+ */
+ status_printf (so, "TITLE%c%s", sep, title_string);
+ status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0, false, &gc_top), sep, (unsigned int)now);
+ status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID",
+ sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
+ hash_iterator_init (m->hash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct gc_arena gc = gc_new ();
+ const struct multi_instance *mi = (struct multi_instance *) he->value;
+
+ if (!mi->halt)
+ {
+ status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c"
+#ifdef MANAGEMENT_DEF_AUTH
+ "%lu",
+#else
+ "",
+#endif
+ sep, tls_common_name (mi->context.c2.tls_multi, false),
+ sep, mroute_addr_print (&mi->real, &gc),
+ sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc),
+ sep, print_in6_addr (mi->reporting_addr_ipv6, IA_EMPTY_IF_UNDEF, &gc),
+ sep, mi->context.c2.link_read_bytes,
+ sep, mi->context.c2.link_write_bytes,
+ sep, time_string (mi->created, 0, false, &gc),
+ sep, (unsigned int)mi->created,
+ sep, tls_username (mi->context.c2.tls_multi, false),
+#ifdef MANAGEMENT_DEF_AUTH
+ sep, mi->context.c2.mda_context.cid);
+#else
+ sep);
+#endif
+ }
+ gc_free (&gc);
+ }
+ hash_iterator_free (&hi);
+
+ status_printf (so, "HEADER%cROUTING_TABLE%cVirtual Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
+ sep, sep, sep, sep, sep, sep);
+ hash_iterator_init (m->vhash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct gc_arena gc = gc_new ();
+ const struct multi_route *route = (struct multi_route *) he->value;
+
+ if (multi_route_defined (m, route))
+ {
+ const struct multi_instance *mi = route->instance;
+ const struct mroute_addr *ma = &route->addr;
+ char flags[2] = {0, 0};
+
+ if (route->flags & MULTI_ROUTE_CACHE)
+ flags[0] = 'C';
+ status_printf (so, "ROUTING_TABLE%c%s%s%c%s%c%s%c%s%c%u",
+ sep, mroute_addr_print (ma, &gc), flags,
+ sep, tls_common_name (mi->context.c2.tls_multi, false),
+ sep, mroute_addr_print (&mi->real, &gc),
+ sep, time_string (route->last_reference, 0, false, &gc),
+ sep, (unsigned int)route->last_reference);
+ }
+ gc_free (&gc);
+ }
+ hash_iterator_free (&hi);
+
+ if (m->mbuf)
+ status_printf (so, "GLOBAL_STATS%cMax bcast/mcast queue length%c%d",
+ sep, sep, mbuf_maximum_queued (m->mbuf));
+
+ status_printf (so, "END");
+ }
+ else
+ {
+ status_printf (so, "ERROR: bad status format version number");
+ }
+
+#ifdef PACKET_TRUNCATION_CHECK
+ {
+ status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
+ hash_iterator_init (m->hash, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct gc_arena gc = gc_new ();
+ const struct multi_instance *mi = (struct multi_instance *) he->value;
+
+ if (!mi->halt)
+ {
+ status_printf (so, "ERRORS,%s," counter_format "," counter_format "," counter_format "," counter_format,
+ tls_common_name (mi->context.c2.tls_multi, false),
+ m->top.c2.n_trunc_tun_read,
+ mi->context.c2.n_trunc_tun_write,
+ mi->context.c2.n_trunc_pre_encrypt,
+ mi->context.c2.n_trunc_post_decrypt);
+ }
+ gc_free (&gc);
+ }
+ hash_iterator_free (&hi);
+ }
+#endif
+
+ status_flush (so);
+ gc_free (&gc_top);
+ }
+}
+
+/*
+ * Learn a virtual address or route.
+ * The learn will fail if the learn address
+ * script/plugin fails. In this case the
+ * return value may be != mi.
+ * Return the instance which owns this route,
+ * or NULL if none.
+ */
+static struct multi_instance *
+multi_learn_addr (struct multi_context *m,
+ struct multi_instance *mi,
+ const struct mroute_addr *addr,
+ const unsigned int flags)
+{
+ struct hash_element *he;
+ const uint32_t hv = hash_value (m->vhash, addr);
+ struct hash_bucket *bucket = hash_bucket (m->vhash, hv);
+ struct multi_route *oldroute = NULL;
+ struct multi_instance *owner = NULL;
+
+ /* if route currently exists, get the instance which owns it */
+ he = hash_lookup_fast (m->vhash, bucket, addr, hv);
+ if (he)
+ oldroute = (struct multi_route *) he->value;
+ if (oldroute && multi_route_defined (m, oldroute))
+ owner = oldroute->instance;
+
+ /* do we need to add address to hash table? */
+ if ((!owner || owner != mi)
+ && mroute_learnable_address (addr)
+ && !mroute_addr_equal (addr, &m->local))
+ {
+ struct gc_arena gc = gc_new ();
+ struct multi_route *newroute;
+ bool learn_succeeded = false;
+
+ ALLOC_OBJ (newroute, struct multi_route);
+ newroute->addr = *addr;
+ newroute->instance = mi;
+ newroute->flags = flags;
+ newroute->last_reference = now;
+ newroute->cache_generation = 0;
+
+ /* The cache is invalidated when cache_generation is incremented */
+ if (flags & MULTI_ROUTE_CACHE)
+ newroute->cache_generation = m->route_helper->cache_generation;
+
+ if (oldroute) /* route already exists? */
+ {
+ if (route_quota_test (m, mi) && learn_address_script (m, mi, "update", &newroute->addr))
+ {
+ learn_succeeded = true;
+ owner = mi;
+ multi_instance_inc_refcount (mi);
+ route_quota_inc (mi);
+
+ /* delete old route */
+ multi_route_del (oldroute);
+
+ /* modify hash table entry, replacing old route */
+ he->key = &newroute->addr;
+ he->value = newroute;
+ }
+ }
+ else
+ {
+ if (route_quota_test (m, mi) && learn_address_script (m, mi, "add", &newroute->addr))
+ {
+ learn_succeeded = true;
+ owner = mi;
+ multi_instance_inc_refcount (mi);
+ route_quota_inc (mi);
+
+ /* add new route */
+ hash_add_fast (m->vhash, bucket, &newroute->addr, hv, newroute);
+ }
+ }
+
+ msg (D_MULTI_LOW, "MULTI: Learn%s: %s -> %s",
+ learn_succeeded ? "" : " FAILED",
+ mroute_addr_print (&newroute->addr, &gc),
+ multi_instance_string (mi, false, &gc));
+
+ if (!learn_succeeded)
+ free (newroute);
+
+ gc_free (&gc);
+ }
+
+ return owner;
+}
+
+/*
+ * Get client instance based on virtual address.
+ */
+static struct multi_instance *
+multi_get_instance_by_virtual_addr (struct multi_context *m,
+ const struct mroute_addr *addr,
+ bool cidr_routing)
+{
+ struct multi_route *route;
+ struct multi_instance *ret = NULL;
+
+ /* check for local address */
+ if (mroute_addr_equal (addr, &m->local))
+ return NULL;
+
+ route = (struct multi_route *) hash_lookup (m->vhash, addr);
+
+ /* does host route (possible cached) exist? */
+ if (route && multi_route_defined (m, route))
+ {
+ struct multi_instance *mi = route->instance;
+ route->last_reference = now;
+ ret = mi;
+ }
+ else if (cidr_routing) /* do we need to regenerate a host route cache entry? */
+ {
+ struct mroute_helper *rh = m->route_helper;
+ struct mroute_addr tryaddr;
+ int i;
+
+ /* cycle through each CIDR length */
+ for (i = 0; i < rh->n_net_len; ++i)
+ {
+ tryaddr = *addr;
+ tryaddr.type |= MR_WITH_NETBITS;
+ tryaddr.netbits = rh->net_len[i];
+ mroute_addr_mask_host_bits (&tryaddr);
+
+ /* look up a possible route with netbits netmask */
+ route = (struct multi_route *) hash_lookup (m->vhash, &tryaddr);
+
+ if (route && multi_route_defined (m, route))
+ {
+ /* found an applicable route, cache host route */
+ struct multi_instance *mi = route->instance;
+ multi_learn_addr (m, mi, addr, MULTI_ROUTE_CACHE|MULTI_ROUTE_AGEABLE);
+ ret = mi;
+ break;
+ }
+ }
+ }
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_MULTI_DEBUG))
+ {
+ struct gc_arena gc = gc_new ();
+ const char *addr_text = mroute_addr_print (addr, &gc);
+ if (ret)
+ {
+ dmsg (D_MULTI_DEBUG, "GET INST BY VIRT: %s -> %s via %s",
+ addr_text,
+ multi_instance_string (ret, false, &gc),
+ mroute_addr_print (&route->addr, &gc));
+ }
+ else
+ {
+ dmsg (D_MULTI_DEBUG, "GET INST BY VIRT: %s [failed]",
+ addr_text);
+ }
+ gc_free (&gc);
+ }
+#endif
+
+ ASSERT (!(ret && ret->halt));
+ return ret;
+}
+
+/*
+ * Helper function to multi_learn_addr().
+ */
+static struct multi_instance *
+multi_learn_in_addr_t (struct multi_context *m,
+ struct multi_instance *mi,
+ in_addr_t a,
+ int netbits, /* -1 if host route, otherwise # of network bits in address */
+ bool primary)
+{
+ struct openvpn_sockaddr remote_si;
+ struct mroute_addr addr;
+
+ CLEAR (remote_si);
+ remote_si.addr.in4.sin_family = AF_INET;
+ remote_si.addr.in4.sin_addr.s_addr = htonl (a);
+ ASSERT (mroute_extract_openvpn_sockaddr (&addr, &remote_si, false));
+
+ if (netbits >= 0)
+ {
+ addr.type |= MR_WITH_NETBITS;
+ addr.netbits = (uint8_t) netbits;
+ }
+
+ {
+ struct multi_instance *owner = multi_learn_addr (m, mi, &addr, 0);
+#ifdef MANAGEMENT_DEF_AUTH
+ if (management && owner)
+ management_learn_addr (management, &mi->context.c2.mda_context, &addr, primary);
+#endif
+ return owner;
+ }
+}
+
+static struct multi_instance *
+multi_learn_in6_addr (struct multi_context *m,
+ struct multi_instance *mi,
+ struct in6_addr a6,
+ int netbits, /* -1 if host route, otherwise # of network bits in address */
+ bool primary)
+{
+ struct mroute_addr addr;
+
+ addr.len = 16;
+ addr.type = MR_ADDR_IPV6;
+ addr.netbits = 0;
+ memcpy( &addr.addr, &a6, sizeof(a6) );
+
+ if (netbits >= 0)
+ {
+ addr.type |= MR_WITH_NETBITS;
+ addr.netbits = (uint8_t) netbits;
+ mroute_addr_mask_host_bits( &addr );
+ }
+
+ {
+ struct multi_instance *owner = multi_learn_addr (m, mi, &addr, 0);
+#ifdef MANAGEMENT_DEF_AUTH
+ if (management && owner)
+ management_learn_addr (management, &mi->context.c2.mda_context, &addr, primary);
+#endif
+ return owner;
+ }
+}
+
+/*
+ * A new client has connected, add routes (server -> client)
+ * to internal routing table.
+ */
+static void
+multi_add_iroutes (struct multi_context *m,
+ struct multi_instance *mi)
+{
+ struct gc_arena gc = gc_new ();
+ const struct iroute *ir;
+ const struct iroute_ipv6 *ir6;
+ if (TUNNEL_TYPE (mi->context.c1.tuntap) == DEV_TYPE_TUN)
+ {
+ mi->did_iroutes = true;
+ for (ir = mi->context.options.iroutes; ir != NULL; ir = ir->next)
+ {
+ if (ir->netbits >= 0)
+ msg (D_MULTI_LOW, "MULTI: internal route %s/%d -> %s",
+ print_in_addr_t (ir->network, 0, &gc),
+ ir->netbits,
+ multi_instance_string (mi, false, &gc));
+ else
+ msg (D_MULTI_LOW, "MULTI: internal route %s -> %s",
+ print_in_addr_t (ir->network, 0, &gc),
+ multi_instance_string (mi, false, &gc));
+
+ mroute_helper_add_iroute46 (m->route_helper, ir->netbits);
+
+ multi_learn_in_addr_t (m, mi, ir->network, ir->netbits, false);
+ }
+ for ( ir6 = mi->context.options.iroutes_ipv6; ir6 != NULL; ir6 = ir6->next )
+ {
+ msg (D_MULTI_LOW, "MULTI: internal route %s/%d -> %s",
+ print_in6_addr (ir6->network, 0, &gc),
+ ir6->netbits,
+ multi_instance_string (mi, false, &gc));
+
+ mroute_helper_add_iroute46 (m->route_helper, ir6->netbits);
+
+ multi_learn_in6_addr (m, mi, ir6->network, ir6->netbits, false);
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Given an instance (new_mi), delete all other instances which use the
+ * same common name.
+ */
+static void
+multi_delete_dup (struct multi_context *m, struct multi_instance *new_mi)
+{
+ if (new_mi)
+ {
+ const char *new_cn = tls_common_name (new_mi->context.c2.tls_multi, true);
+ if (new_cn)
+ {
+ struct hash_iterator hi;
+ struct hash_element *he;
+ int count = 0;
+
+ hash_iterator_init (m->iter, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct multi_instance *mi = (struct multi_instance *) he->value;
+ if (mi != new_mi && !mi->halt)
+ {
+ const char *cn = tls_common_name (mi->context.c2.tls_multi, true);
+ if (cn && !strcmp (cn, new_cn))
+ {
+ mi->did_iter = false;
+ multi_close_instance (m, mi, false);
+ hash_iterator_delete_element (&hi);
+ ++count;
+ }
+ }
+ }
+ hash_iterator_free (&hi);
+
+ if (count)
+ msg (D_MULTI_LOW, "MULTI: new connection by client '%s' will cause previous active sessions by this client to be dropped. Remember to use the --duplicate-cn option if you want multiple clients using the same certificate or username to concurrently connect.", new_cn);
+ }
+ }
+}
+
+static void
+check_stale_routes (struct multi_context *m)
+{
+
+ struct gc_arena gc = gc_new ();
+ struct hash_iterator hi;
+ struct hash_element *he;
+
+ dmsg (D_MULTI_DEBUG, "MULTI: Checking stale routes");
+ hash_iterator_init_range (m->vhash, &hi, 0, hash_n_buckets (m->vhash));
+ while ((he = hash_iterator_next (&hi)) != NULL)
+ {
+ struct multi_route *r = (struct multi_route *) he->value;
+ if (multi_route_defined (m, r) && difftime(now, r->last_reference) >= m->top.options.stale_routes_ageing_time)
+ {
+ dmsg (D_MULTI_DEBUG, "MULTI: Deleting stale route for address '%s'",
+ mroute_addr_print (&r->addr, &gc));
+ learn_address_script (m, NULL, "delete", &r->addr);
+ multi_route_del (r);
+ hash_iterator_delete_element (&hi);
+ }
+ }
+ hash_iterator_free (&hi);
+ gc_free (&gc);
+}
+
+/*
+ * Ensure that endpoint to be pushed to client
+ * complies with --ifconfig-push-constraint directive.
+ */
+static bool
+ifconfig_push_constraint_satisfied (const struct context *c)
+{
+ const struct options *o = &c->options;
+ if (o->push_ifconfig_constraint_defined && c->c2.push_ifconfig_defined)
+ return (o->push_ifconfig_constraint_netmask & c->c2.push_ifconfig_local) == o->push_ifconfig_constraint_network;
+ else
+ return true;
+}
+
+/*
+ * Select a virtual address for a new client instance.
+ * Use an --ifconfig-push directive, if given (static IP).
+ * Otherwise use an --ifconfig-pool address (dynamic IP).
+ */
+static void
+multi_select_virtual_addr (struct multi_context *m, struct multi_instance *mi)
+{
+ struct gc_arena gc = gc_new ();
+
+ /*
+ * If ifconfig addresses were set by dynamic config file,
+ * release pool addresses, otherwise keep them.
+ */
+ if (mi->context.options.push_ifconfig_defined)
+ {
+ /* ifconfig addresses were set statically,
+ release dynamic allocation */
+ if (mi->vaddr_handle >= 0)
+ {
+ ifconfig_pool_release (m->ifconfig_pool, mi->vaddr_handle, true);
+ mi->vaddr_handle = -1;
+ }
+
+ mi->context.c2.push_ifconfig_defined = true;
+ mi->context.c2.push_ifconfig_local = mi->context.options.push_ifconfig_local;
+ mi->context.c2.push_ifconfig_remote_netmask = mi->context.options.push_ifconfig_remote_netmask;
+ mi->context.c2.push_ifconfig_local_alias = mi->context.options.push_ifconfig_local_alias;
+
+ /* the current implementation does not allow "static IPv4, pool IPv6",
+ * (see below) so issue a warning if that happens - don't break the
+ * session, though, as we don't even know if this client WANTS IPv6
+ */
+ if ( mi->context.c1.tuntap->ipv6 &&
+ mi->context.options.ifconfig_ipv6_pool_defined &&
+ ! mi->context.options.push_ifconfig_ipv6_defined )
+ {
+ msg( M_INFO, "MULTI_sva: WARNING: if --ifconfig-push is used for IPv4, automatic IPv6 assignment from --ifconfig-ipv6-pool does not work. Use --ifconfig-ipv6-push for IPv6 then." );
+ }
+ }
+ else if (m->ifconfig_pool && mi->vaddr_handle < 0) /* otherwise, choose a pool address */
+ {
+ in_addr_t local=0, remote=0;
+ struct in6_addr remote_ipv6;
+ const char *cn = NULL;
+
+ if (!mi->context.options.duplicate_cn)
+ cn = tls_common_name (mi->context.c2.tls_multi, true);
+
+ CLEAR(remote_ipv6);
+ mi->vaddr_handle = ifconfig_pool_acquire (m->ifconfig_pool, &local, &remote, &remote_ipv6, cn);
+ if (mi->vaddr_handle >= 0)
+ {
+ const int tunnel_type = TUNNEL_TYPE (mi->context.c1.tuntap);
+ const int tunnel_topology = TUNNEL_TOPOLOGY (mi->context.c1.tuntap);
+
+ msg( M_INFO, "MULTI_sva: pool returned IPv4=%s, IPv6=%s",
+ print_in_addr_t( remote, 0, &gc ),
+ (mi->context.options.ifconfig_ipv6_pool_defined
+ ? print_in6_addr( remote_ipv6, 0, &gc )
+ : "(Not enabled)") );
+
+ /* set push_ifconfig_remote_netmask from pool ifconfig address(es) */
+ mi->context.c2.push_ifconfig_local = remote;
+ if (tunnel_type == DEV_TYPE_TAP || (tunnel_type == DEV_TYPE_TUN && tunnel_topology == TOP_SUBNET))
+ {
+ mi->context.c2.push_ifconfig_remote_netmask = mi->context.options.ifconfig_pool_netmask;
+ if (!mi->context.c2.push_ifconfig_remote_netmask)
+ mi->context.c2.push_ifconfig_remote_netmask = mi->context.c1.tuntap->remote_netmask;
+ }
+ else if (tunnel_type == DEV_TYPE_TUN)
+ {
+ if (tunnel_topology == TOP_P2P)
+ mi->context.c2.push_ifconfig_remote_netmask = mi->context.c1.tuntap->local;
+ else if (tunnel_topology == TOP_NET30)
+ mi->context.c2.push_ifconfig_remote_netmask = local;
+ }
+
+ if (mi->context.c2.push_ifconfig_remote_netmask)
+ mi->context.c2.push_ifconfig_defined = true;
+ else
+ msg (D_MULTI_ERRORS, "MULTI: no --ifconfig-pool netmask parameter is available to push to %s",
+ multi_instance_string (mi, false, &gc));
+
+ if ( mi->context.options.ifconfig_ipv6_pool_defined )
+ {
+ mi->context.c2.push_ifconfig_ipv6_local = remote_ipv6;
+ mi->context.c2.push_ifconfig_ipv6_remote =
+ mi->context.c1.tuntap->local_ipv6;
+ mi->context.c2.push_ifconfig_ipv6_netbits =
+ mi->context.options.ifconfig_ipv6_pool_netbits;
+ mi->context.c2.push_ifconfig_ipv6_defined = true;
+ }
+ }
+ else
+ {
+ msg (D_MULTI_ERRORS, "MULTI: no free --ifconfig-pool addresses are available");
+ }
+ }
+
+ /* IPv6 push_ifconfig is a bit problematic - since IPv6 shares the
+ * pool handling with IPv4, the combination "static IPv4, dynamic IPv6"
+ * will fail (because no pool will be allocated in this case).
+ * OTOH, this doesn't make too much sense in reality - and the other
+ * way round ("dynamic IPv4, static IPv6") or "both static" makes sense
+ * -> and so it's implemented right now
+ */
+ if ( mi->context.c1.tuntap->ipv6 &&
+ mi->context.options.push_ifconfig_ipv6_defined )
+ {
+ mi->context.c2.push_ifconfig_ipv6_local =
+ mi->context.options.push_ifconfig_ipv6_local;
+ mi->context.c2.push_ifconfig_ipv6_remote =
+ mi->context.options.push_ifconfig_ipv6_remote;
+ mi->context.c2.push_ifconfig_ipv6_netbits =
+ mi->context.options.push_ifconfig_ipv6_netbits;
+ mi->context.c2.push_ifconfig_ipv6_defined = true;
+
+ msg( M_INFO, "MULTI_sva: push_ifconfig_ipv6 %s/%d",
+ print_in6_addr( mi->context.c2.push_ifconfig_ipv6_local, 0, &gc ),
+ mi->context.c2.push_ifconfig_ipv6_netbits );
+ }
+
+ gc_free (&gc);
+}
+
+/*
+ * Set virtual address environmental variables.
+ */
+static void
+multi_set_virtual_addr_env (struct multi_context *m, struct multi_instance *mi)
+{
+ setenv_del (mi->context.c2.es, "ifconfig_pool_local_ip");
+ setenv_del (mi->context.c2.es, "ifconfig_pool_remote_ip");
+ setenv_del (mi->context.c2.es, "ifconfig_pool_netmask");
+
+ if (mi->context.c2.push_ifconfig_defined)
+ {
+ const int tunnel_type = TUNNEL_TYPE (mi->context.c1.tuntap);
+ const int tunnel_topology = TUNNEL_TOPOLOGY (mi->context.c1.tuntap);
+
+ setenv_in_addr_t (mi->context.c2.es,
+ "ifconfig_pool_remote_ip",
+ mi->context.c2.push_ifconfig_local,
+ SA_SET_IF_NONZERO);
+
+ if (tunnel_type == DEV_TYPE_TAP || (tunnel_type == DEV_TYPE_TUN && tunnel_topology == TOP_SUBNET))
+ {
+ setenv_in_addr_t (mi->context.c2.es,
+ "ifconfig_pool_netmask",
+ mi->context.c2.push_ifconfig_remote_netmask,
+ SA_SET_IF_NONZERO);
+ }
+ else if (tunnel_type == DEV_TYPE_TUN)
+ {
+ setenv_in_addr_t (mi->context.c2.es,
+ "ifconfig_pool_local_ip",
+ mi->context.c2.push_ifconfig_remote_netmask,
+ SA_SET_IF_NONZERO);
+ }
+ }
+
+ /* TODO: I'm not exactly sure what these environment variables are
+ * used for, but if we have them for IPv4, we should also have
+ * them for IPv6, no?
+ */
+}
+
+/*
+ * Called after client-connect script is called
+ */
+static void
+multi_client_connect_post (struct multi_context *m,
+ struct multi_instance *mi,
+ const char *dc_file,
+ unsigned int option_permissions_mask,
+ unsigned int *option_types_found)
+{
+ /* Did script generate a dynamic config file? */
+ if (test_file (dc_file))
+ {
+ options_server_import (&mi->context.options,
+ dc_file,
+ D_IMPORT_ERRORS|M_OPTERR,
+ option_permissions_mask,
+ option_types_found,
+ mi->context.c2.es);
+
+ if (!platform_unlink (dc_file))
+ msg (D_MULTI_ERRORS, "MULTI: problem deleting temporary file: %s",
+ dc_file);
+
+ /*
+ * If the --client-connect script generates a config file
+ * with an --ifconfig-push directive, it will override any
+ * --ifconfig-push directive from the --client-config-dir
+ * directory or any --ifconfig-pool dynamic address.
+ */
+ multi_select_virtual_addr (m, mi);
+ multi_set_virtual_addr_env (m, mi);
+ }
+}
+
+#ifdef ENABLE_PLUGIN
+
+/*
+ * Called after client-connect plug-in is called
+ */
+static void
+multi_client_connect_post_plugin (struct multi_context *m,
+ struct multi_instance *mi,
+ const struct plugin_return *pr,
+ unsigned int option_permissions_mask,
+ unsigned int *option_types_found)
+{
+ struct plugin_return config;
+
+ plugin_return_get_column (pr, &config, "config");
+
+ /* Did script generate a dynamic config file? */
+ if (plugin_return_defined (&config))
+ {
+ int i;
+ for (i = 0; i < config.n; ++i)
+ {
+ if (config.list[i] && config.list[i]->value)
+ options_string_import (&mi->context.options,
+ config.list[i]->value,
+ D_IMPORT_ERRORS|M_OPTERR,
+ option_permissions_mask,
+ option_types_found,
+ mi->context.c2.es);
+ }
+
+ /*
+ * If the --client-connect script generates a config file
+ * with an --ifconfig-push directive, it will override any
+ * --ifconfig-push directive from the --client-config-dir
+ * directory or any --ifconfig-pool dynamic address.
+ */
+ multi_select_virtual_addr (m, mi);
+ multi_set_virtual_addr_env (m, mi);
+ }
+}
+
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+/*
+ * Called to load management-derived client-connect config
+ */
+static void
+multi_client_connect_mda (struct multi_context *m,
+ struct multi_instance *mi,
+ const struct buffer_list *config,
+ unsigned int option_permissions_mask,
+ unsigned int *option_types_found)
+{
+ if (config)
+ {
+ struct buffer_entry *be;
+
+ for (be = config->head; be != NULL; be = be->next)
+ {
+ const char *opt = BSTR(&be->buf);
+ options_string_import (&mi->context.options,
+ opt,
+ D_IMPORT_ERRORS|M_OPTERR,
+ option_permissions_mask,
+ option_types_found,
+ mi->context.c2.es);
+ }
+
+ /*
+ * If the --client-connect script generates a config file
+ * with an --ifconfig-push directive, it will override any
+ * --ifconfig-push directive from the --client-config-dir
+ * directory or any --ifconfig-pool dynamic address.
+ */
+ multi_select_virtual_addr (m, mi);
+ multi_set_virtual_addr_env (m, mi);
+ }
+}
+
+#endif
+
+static void
+multi_client_connect_setenv (struct multi_context *m,
+ struct multi_instance *mi)
+{
+ struct gc_arena gc = gc_new ();
+
+ /* setenv incoming cert common name for script */
+ setenv_str (mi->context.c2.es, "common_name", tls_common_name (mi->context.c2.tls_multi, true));
+
+ /* setenv client real IP address */
+ setenv_trusted (mi->context.c2.es, get_link_socket_info (&mi->context));
+
+ /* setenv client virtual IP address */
+ multi_set_virtual_addr_env (m, mi);
+
+ /* setenv connection time */
+ {
+ const char *created_ascii = time_string (mi->created, 0, false, &gc);
+ setenv_str (mi->context.c2.es, "time_ascii", created_ascii);
+ setenv_unsigned (mi->context.c2.es, "time_unix", (unsigned int)mi->created);
+ }
+
+ gc_free (&gc);
+}
+
+/*
+ * Called as soon as the SSL/TLS connection authenticates.
+ *
+ * Instance-specific directives to be processed:
+ *
+ * iroute start-ip end-ip
+ * ifconfig-push local remote-netmask
+ * push
+ */
+static void
+multi_connection_established (struct multi_context *m, struct multi_instance *mi)
+{
+ if (tls_authentication_status (mi->context.c2.tls_multi, 0) == TLS_AUTHENTICATION_SUCCEEDED)
+ {
+ struct gc_arena gc = gc_new ();
+ unsigned int option_types_found = 0;
+
+ const unsigned int option_permissions_mask =
+ OPT_P_INSTANCE
+ | OPT_P_INHERIT
+ | OPT_P_PUSH
+ | OPT_P_TIMER
+ | OPT_P_CONFIG
+ | OPT_P_ECHO
+ | OPT_P_COMP
+ | OPT_P_SOCKFLAGS;
+
+ int cc_succeeded = true; /* client connect script status */
+ int cc_succeeded_count = 0;
+
+ ASSERT (mi->context.c1.tuntap);
+
+ /* lock down the common name and cert hashes so they can't change during future TLS renegotiations */
+ tls_lock_common_name (mi->context.c2.tls_multi);
+ tls_lock_cert_hash_set (mi->context.c2.tls_multi);
+
+ /* generate a msg() prefix for this client instance */
+ generate_prefix (mi);
+
+ /* delete instances of previous clients with same common-name */
+ if (!mi->context.options.duplicate_cn)
+ multi_delete_dup (m, mi);
+
+ /* reset pool handle to null */
+ mi->vaddr_handle = -1;
+
+ /*
+ * Try to source a dynamic config file from the
+ * --client-config-dir directory.
+ */
+ if (mi->context.options.client_config_dir)
+ {
+ const char *ccd_file;
+
+ ccd_file = gen_path (mi->context.options.client_config_dir,
+ tls_common_name (mi->context.c2.tls_multi, false),
+ &gc);
+
+ /* try common-name file */
+ if (test_file (ccd_file))
+ {
+ options_server_import (&mi->context.options,
+ ccd_file,
+ D_IMPORT_ERRORS|M_OPTERR,
+ option_permissions_mask,
+ &option_types_found,
+ mi->context.c2.es);
+ }
+ else /* try default file */
+ {
+ ccd_file = gen_path (mi->context.options.client_config_dir,
+ CCD_DEFAULT,
+ &gc);
+
+ if (test_file (ccd_file))
+ {
+ options_server_import (&mi->context.options,
+ ccd_file,
+ D_IMPORT_ERRORS|M_OPTERR,
+ option_permissions_mask,
+ &option_types_found,
+ mi->context.c2.es);
+ }
+ }
+ }
+
+ /*
+ * Select a virtual address from either --ifconfig-push in --client-config-dir file
+ * or --ifconfig-pool.
+ */
+ multi_select_virtual_addr (m, mi);
+
+ /* do --client-connect setenvs */
+ multi_client_connect_setenv (m, mi);
+
+#ifdef ENABLE_PLUGIN
+ /*
+ * Call client-connect plug-in.
+ */
+
+ /* deprecated callback, use a file for passing back return info */
+ if (plugin_defined (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT))
+ {
+ struct argv argv = argv_new ();
+ const char *dc_file = create_temp_file (mi->context.options.tmp_dir, "cc", &gc);
+
+ if( !dc_file ) {
+ cc_succeeded = false;
+ goto script_depr_failed;
+ }
+
+ argv_printf (&argv, "%s", dc_file);
+ if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT, &argv, NULL, mi->context.c2.es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ {
+ msg (M_WARN, "WARNING: client-connect plugin call failed");
+ cc_succeeded = false;
+ }
+ else
+ {
+ multi_client_connect_post (m, mi, dc_file, option_permissions_mask, &option_types_found);
+ ++cc_succeeded_count;
+ }
+ script_depr_failed:
+ argv_reset (&argv);
+ }
+
+ /* V2 callback, use a plugin_return struct for passing back return info */
+ if (plugin_defined (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT_V2))
+ {
+ struct plugin_return pr;
+
+ plugin_return_init (&pr);
+
+ if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT_V2, NULL, &pr, mi->context.c2.es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ {
+ msg (M_WARN, "WARNING: client-connect-v2 plugin call failed");
+ cc_succeeded = false;
+ }
+ else
+ {
+ multi_client_connect_post_plugin (m, mi, &pr, option_permissions_mask, &option_types_found);
+ ++cc_succeeded_count;
+ }
+
+ plugin_return_free (&pr);
+ }
+#endif
+
+ /*
+ * Run --client-connect script.
+ */
+ if (mi->context.options.client_connect_script && cc_succeeded)
+ {
+ struct argv argv = argv_new ();
+ const char *dc_file = NULL;
+
+ setenv_str (mi->context.c2.es, "script_type", "client-connect");
+
+ dc_file = create_temp_file (mi->context.options.tmp_dir, "cc", &gc);
+ if( !dc_file ) {
+ cc_succeeded = false;
+ goto script_failed;
+ }
+
+ argv_printf (&argv, "%sc %s",
+ mi->context.options.client_connect_script,
+ dc_file);
+
+ if (openvpn_run_script (&argv, mi->context.c2.es, 0, "--client-connect"))
+ {
+ multi_client_connect_post (m, mi, dc_file, option_permissions_mask, &option_types_found);
+ ++cc_succeeded_count;
+ }
+ else
+ cc_succeeded = false;
+ script_failed:
+ argv_reset (&argv);
+ }
+
+ /*
+ * Check for client-connect script left by management interface client
+ */
+#ifdef MANAGEMENT_DEF_AUTH
+ if (cc_succeeded && mi->cc_config)
+ {
+ multi_client_connect_mda (m, mi, mi->cc_config, option_permissions_mask, &option_types_found);
+ ++cc_succeeded_count;
+ }
+#endif
+
+ /*
+ * Check for "disable" directive in client-config-dir file
+ * or config file generated by --client-connect script.
+ */
+ if (mi->context.options.disable)
+ {
+ msg (D_MULTI_ERRORS, "MULTI: client has been rejected due to 'disable' directive");
+ cc_succeeded = false;
+ }
+
+ if (cc_succeeded)
+ {
+ /*
+ * Process sourced options.
+ */
+ do_deferred_options (&mi->context, option_types_found);
+
+ /*
+ * make sure we got ifconfig settings from somewhere
+ */
+ if (!mi->context.c2.push_ifconfig_defined)
+ {
+ msg (D_MULTI_ERRORS, "MULTI: no dynamic or static remote --ifconfig address is available for %s",
+ multi_instance_string (mi, false, &gc));
+ }
+
+ /*
+ * make sure that ifconfig settings comply with constraints
+ */
+ if (!ifconfig_push_constraint_satisfied (&mi->context))
+ {
+ /* JYFIXME -- this should cause the connection to fail */
+ msg (D_MULTI_ERRORS, "MULTI ERROR: primary virtual IP for %s (%s) violates tunnel network/netmask constraint (%s/%s)",
+ multi_instance_string (mi, false, &gc),
+ print_in_addr_t (mi->context.c2.push_ifconfig_local, 0, &gc),
+ print_in_addr_t (mi->context.options.push_ifconfig_constraint_network, 0, &gc),
+ print_in_addr_t (mi->context.options.push_ifconfig_constraint_netmask, 0, &gc));
+ }
+
+ /*
+ * For routed tunnels, set up internal route to endpoint
+ * plus add all iroute routes.
+ */
+ if (TUNNEL_TYPE (mi->context.c1.tuntap) == DEV_TYPE_TUN)
+ {
+ if (mi->context.c2.push_ifconfig_defined)
+ {
+ multi_learn_in_addr_t (m, mi, mi->context.c2.push_ifconfig_local, -1, true);
+ msg (D_MULTI_LOW, "MULTI: primary virtual IP for %s: %s",
+ multi_instance_string (mi, false, &gc),
+ print_in_addr_t (mi->context.c2.push_ifconfig_local, 0, &gc));
+ }
+
+ if (mi->context.c2.push_ifconfig_ipv6_defined)
+ {
+ multi_learn_in6_addr (m, mi, mi->context.c2.push_ifconfig_ipv6_local, -1, true);
+ /* TODO: find out where addresses are "unlearned"!! */
+ msg (D_MULTI_LOW, "MULTI: primary virtual IPv6 for %s: %s",
+ multi_instance_string (mi, false, &gc),
+ print_in6_addr (mi->context.c2.push_ifconfig_ipv6_local, 0, &gc));
+ }
+
+ /* add routes locally, pointing to new client, if
+ --iroute options have been specified */
+ multi_add_iroutes (m, mi);
+
+ /*
+ * iroutes represent subnets which are "owned" by a particular
+ * client. Therefore, do not actually push a route to a client
+ * if it matches one of the client's iroutes.
+ */
+ remove_iroutes_from_push_route_list (&mi->context.options);
+ }
+ else if (mi->context.options.iroutes)
+ {
+ msg (D_MULTI_ERRORS, "MULTI: --iroute options rejected for %s -- iroute only works with tun-style tunnels",
+ multi_instance_string (mi, false, &gc));
+ }
+
+ /* set our client's VPN endpoint for status reporting purposes */
+ mi->reporting_addr = mi->context.c2.push_ifconfig_local;
+ mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;
+
+ /* set context-level authentication flag */
+ mi->context.c2.context_auth = CAS_SUCCEEDED;
+ }
+ else
+ {
+ /* set context-level authentication flag */
+ mi->context.c2.context_auth = cc_succeeded_count ? CAS_PARTIAL : CAS_FAILED;
+ }
+
+ /* set flag so we don't get called again */
+ mi->connection_established_flag = true;
+
+ /* increment number of current authenticated clients */
+ ++m->n_clients;
+ update_mstat_n_clients(m->n_clients);
+ --mi->n_clients_delta;
+
+#ifdef MANAGEMENT_DEF_AUTH
+ if (management)
+ management_connection_established (management, &mi->context.c2.mda_context, mi->context.c2.es);
+#endif
+
+ gc_free (&gc);
+ }
+
+ /*
+ * Reply now to client's PUSH_REQUEST query
+ */
+ mi->context.c2.push_reply_deferred = false;
+}
+
+/*
+ * Add a mbuf buffer to a particular
+ * instance.
+ */
+void
+multi_add_mbuf (struct multi_context *m,
+ struct multi_instance *mi,
+ struct mbuf_buffer *mb)
+{
+ if (multi_output_queue_ready (m, mi))
+ {
+ struct mbuf_item item;
+ item.buffer = mb;
+ item.instance = mi;
+ mbuf_add_item (m->mbuf, &item);
+ }
+ else
+ {
+ msg (D_MULTI_DROPPED, "MULTI: packet dropped due to output saturation (multi_add_mbuf)");
+ }
+}
+
+/*
+ * Add a packet to a client instance output queue.
+ */
+static inline void
+multi_unicast (struct multi_context *m,
+ const struct buffer *buf,
+ struct multi_instance *mi)
+{
+ struct mbuf_buffer *mb;
+
+ if (BLEN (buf) > 0)
+ {
+ mb = mbuf_alloc_buf (buf);
+ mb->flags = MF_UNICAST;
+ multi_add_mbuf (m, mi, mb);
+ mbuf_free_buf (mb);
+ }
+}
+
+/*
+ * Broadcast a packet to all clients.
+ */
+static void
+multi_bcast (struct multi_context *m,
+ const struct buffer *buf,
+ const struct multi_instance *sender_instance,
+ const struct mroute_addr *sender_addr)
+{
+ struct hash_iterator hi;
+ struct hash_element *he;
+ struct multi_instance *mi;
+ struct mbuf_buffer *mb;
+
+ if (BLEN (buf) > 0)
+ {
+ perf_push (PERF_MULTI_BCAST);
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("BCAST len=%d\n", BLEN (buf));
+#endif
+ mb = mbuf_alloc_buf (buf);
+ hash_iterator_init (m->iter, &hi);
+
+ while ((he = hash_iterator_next (&hi)))
+ {
+ mi = (struct multi_instance *) he->value;
+ if (mi != sender_instance && !mi->halt)
+ {
+#ifdef ENABLE_PF
+ if (sender_instance)
+ {
+ if (!pf_c2c_test (&sender_instance->context, &mi->context, "bcast_c2c"))
+ {
+ msg (D_PF_DROPPED_BCAST, "PF: client[%s] -> client[%s] packet dropped by BCAST packet filter",
+ mi_prefix (sender_instance),
+ mi_prefix (mi));
+ continue;
+ }
+ }
+ if (sender_addr)
+ {
+ if (!pf_addr_test (&mi->context, sender_addr, "bcast_src_addr"))
+ {
+ struct gc_arena gc = gc_new ();
+ msg (D_PF_DROPPED_BCAST, "PF: addr[%s] -> client[%s] packet dropped by BCAST packet filter",
+ mroute_addr_print_ex (sender_addr, MAPF_SHOW_ARP, &gc),
+ mi_prefix (mi));
+ gc_free (&gc);
+ continue;
+ }
+ }
+#endif
+ multi_add_mbuf (m, mi, mb);
+ }
+ }
+
+ hash_iterator_free (&hi);
+ mbuf_free_buf (mb);
+ perf_pop ();
+ }
+}
+
+/*
+ * Given a time delta, indicating that we wish to be
+ * awoken by the scheduler at time now + delta, figure
+ * a sigma parameter (in microseconds) that represents
+ * a sort of fuzz factor around delta, so that we're
+ * really telling the scheduler to wake us up any time
+ * between now + delta - sigma and now + delta + sigma.
+ *
+ * The sigma parameter helps the scheduler to run more efficiently.
+ * Sigma should be no larger than TV_WITHIN_SIGMA_MAX_USEC
+ */
+static inline unsigned int
+compute_wakeup_sigma (const struct timeval *delta)
+{
+ if (delta->tv_sec < 1)
+ {
+ /* if < 1 sec, fuzz = # of microseconds / 8 */
+ return delta->tv_usec >> 3;
+ }
+ else
+ {
+ /* if < 10 minutes, fuzz = 13.1% of timeout */
+ if (delta->tv_sec < 600)
+ return delta->tv_sec << 17;
+ else
+ return 120000000; /* if >= 10 minutes, fuzz = 2 minutes */
+ }
+}
+
+static void
+multi_schedule_context_wakeup (struct multi_context *m, struct multi_instance *mi)
+{
+ /* calculate an absolute wakeup time */
+ ASSERT (!openvpn_gettimeofday (&mi->wakeup, NULL));
+ tv_add (&mi->wakeup, &mi->context.c2.timeval);
+
+ /* tell scheduler to wake us up at some point in the future */
+ schedule_add_entry (m->schedule,
+ (struct schedule_entry *) mi,
+ &mi->wakeup,
+ compute_wakeup_sigma (&mi->context.c2.timeval));
+}
+
+/*
+ * Figure instance-specific timers, convert
+ * earliest to absolute time in mi->wakeup,
+ * call scheduler with our future wakeup time.
+ *
+ * Also close context on signal.
+ */
+bool
+multi_process_post (struct multi_context *m, struct multi_instance *mi, const unsigned int flags)
+{
+ bool ret = true;
+
+ if (!IS_SIG (&mi->context) && ((flags & MPP_PRE_SELECT) || ((flags & MPP_CONDITIONAL_PRE_SELECT) && !ANY_OUT (&mi->context))))
+ {
+ /* figure timeouts and fetch possible outgoing
+ to_link packets (such as ping or TLS control) */
+ pre_select (&mi->context);
+
+ if (!IS_SIG (&mi->context))
+ {
+ /* tell scheduler to wake us up at some point in the future */
+ multi_schedule_context_wakeup(m, mi);
+
+ /* connection is "established" when SSL/TLS key negotiation succeeds
+ and (if specified) auth user/pass succeeds */
+ if (!mi->connection_established_flag && CONNECTION_ESTABLISHED (&mi->context))
+ multi_connection_established (m, mi);
+ }
+ }
+
+ if (IS_SIG (&mi->context))
+ {
+ if (flags & MPP_CLOSE_ON_SIGNAL)
+ {
+ multi_close_instance_on_signal (m, mi);
+ ret = false;
+ }
+ }
+ else
+ {
+ /* continue to pend on output? */
+ multi_set_pending (m, ANY_OUT (&mi->context) ? mi : NULL);
+
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("POST %s[%d] to=%d lo=%d/%d w=%d/%d\n",
+ id(mi),
+ (int) (mi == m->pending),
+ mi ? mi->context.c2.to_tun.len : -1,
+ mi ? mi->context.c2.to_link.len : -1,
+ (mi && mi->context.c2.fragment) ? mi->context.c2.fragment->outgoing.len : -1,
+ (int)mi->context.c2.timeval.tv_sec,
+ (int)mi->context.c2.timeval.tv_usec);
+#endif
+ }
+
+ if ((flags & MPP_RECORD_TOUCH) && m->mpp_touched)
+ *m->mpp_touched = mi;
+
+ return ret;
+}
+
+/*
+ * Process packets in the TCP/UDP socket -> TUN/TAP interface direction,
+ * i.e. client -> server direction.
+ */
+bool
+multi_process_incoming_link (struct multi_context *m, struct multi_instance *instance, const unsigned int mpp_flags)
+{
+ struct gc_arena gc = gc_new ();
+
+ struct context *c;
+ struct mroute_addr src, dest;
+ unsigned int mroute_flags;
+ struct multi_instance *mi;
+ bool ret = true;
+
+ if (m->pending)
+ return true;
+
+ if (!instance)
+ {
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("TCP/UDP -> TUN [%d]\n", BLEN (&m->top.c2.buf));
+#endif
+ multi_set_pending (m, multi_get_create_instance_udp (m));
+ }
+ else
+ multi_set_pending (m, instance);
+
+ if (m->pending)
+ {
+ set_prefix (m->pending);
+
+ /* get instance context */
+ c = &m->pending->context;
+
+ if (!instance)
+ {
+ /* transfer packet pointer from top-level context buffer to instance */
+ c->c2.buf = m->top.c2.buf;
+
+ /* transfer from-addr from top-level context buffer to instance */
+ c->c2.from = m->top.c2.from;
+ }
+
+ if (BLEN (&c->c2.buf) > 0)
+ {
+ /* decrypt in instance context */
+ process_incoming_link (c);
+
+ if (TUNNEL_TYPE (m->top.c1.tuntap) == DEV_TYPE_TUN)
+ {
+ /* extract packet source and dest addresses */
+ mroute_flags = mroute_extract_addr_from_packet (&src,
+ &dest,
+ NULL,
+ NULL,
+ &c->c2.to_tun,
+ DEV_TYPE_TUN);
+
+ /* drop packet if extract failed */
+ if (!(mroute_flags & MROUTE_EXTRACT_SUCCEEDED))
+ {
+ c->c2.to_tun.len = 0;
+ }
+ /* make sure that source address is associated with this client */
+ else if (multi_get_instance_by_virtual_addr (m, &src, true) != m->pending)
+ {
+ /* IPv6 link-local address (fe80::xxx)? */
+ if ( (src.type & MR_ADDR_MASK) == MR_ADDR_IPV6 &&
+ src.addr[0] == 0xfe && src.addr[1] == 0x80 )
+ {
+ /* do nothing, for now. TODO: add address learning */
+ }
+ else
+ {
+ msg (D_MULTI_DROPPED, "MULTI: bad source address from client [%s], packet dropped",
+ mroute_addr_print (&src, &gc));
+ }
+ c->c2.to_tun.len = 0;
+ }
+ /* client-to-client communication enabled? */
+ else if (m->enable_c2c)
+ {
+ /* multicast? */
+ if (mroute_flags & MROUTE_EXTRACT_MCAST)
+ {
+ /* for now, treat multicast as broadcast */
+ multi_bcast (m, &c->c2.to_tun, m->pending, NULL);
+ }
+ else /* possible client to client routing */
+ {
+ ASSERT (!(mroute_flags & MROUTE_EXTRACT_BCAST));
+ mi = multi_get_instance_by_virtual_addr (m, &dest, true);
+
+ /* if dest addr is a known client, route to it */
+ if (mi)
+ {
+#ifdef ENABLE_PF
+ if (!pf_c2c_test (c, &mi->context, "tun_c2c"))
+ {
+ msg (D_PF_DROPPED, "PF: client -> client[%s] packet dropped by TUN packet filter",
+ mi_prefix (mi));
+ }
+ else
+#endif
+ {
+ multi_unicast (m, &c->c2.to_tun, mi);
+ register_activity (c, BLEN(&c->c2.to_tun));
+ }
+ c->c2.to_tun.len = 0;
+ }
+ }
+ }
+#ifdef ENABLE_PF
+ if (c->c2.to_tun.len && !pf_addr_test (c, &dest, "tun_dest_addr"))
+ {
+ msg (D_PF_DROPPED, "PF: client -> addr[%s] packet dropped by TUN packet filter",
+ mroute_addr_print_ex (&dest, MAPF_SHOW_ARP, &gc));
+ c->c2.to_tun.len = 0;
+ }
+#endif
+ }
+ else if (TUNNEL_TYPE (m->top.c1.tuntap) == DEV_TYPE_TAP)
+ {
+#ifdef ENABLE_PF
+ struct mroute_addr edest;
+ mroute_addr_reset (&edest);
+#endif
+ /* extract packet source and dest addresses */
+ mroute_flags = mroute_extract_addr_from_packet (&src,
+ &dest,
+ NULL,
+#ifdef ENABLE_PF
+ &edest,
+#else
+ NULL,
+#endif
+ &c->c2.to_tun,
+ DEV_TYPE_TAP);
+
+ if (mroute_flags & MROUTE_EXTRACT_SUCCEEDED)
+ {
+ if (multi_learn_addr (m, m->pending, &src, 0) == m->pending)
+ {
+ /* check for broadcast */
+ if (m->enable_c2c)
+ {
+ if (mroute_flags & (MROUTE_EXTRACT_BCAST|MROUTE_EXTRACT_MCAST))
+ {
+ multi_bcast (m, &c->c2.to_tun, m->pending, NULL);
+ }
+ else /* try client-to-client routing */
+ {
+ mi = multi_get_instance_by_virtual_addr (m, &dest, false);
+
+ /* if dest addr is a known client, route to it */
+ if (mi)
+ {
+#ifdef ENABLE_PF
+ if (!pf_c2c_test (c, &mi->context, "tap_c2c"))
+ {
+ msg (D_PF_DROPPED, "PF: client -> client[%s] packet dropped by TAP packet filter",
+ mi_prefix (mi));
+ }
+ else
+#endif
+ {
+ multi_unicast (m, &c->c2.to_tun, mi);
+ register_activity (c, BLEN(&c->c2.to_tun));
+ }
+ c->c2.to_tun.len = 0;
+ }
+ }
+ }
+#ifdef ENABLE_PF
+ if (c->c2.to_tun.len && !pf_addr_test (c, &edest, "tap_dest_addr"))
+ {
+ msg (D_PF_DROPPED, "PF: client -> addr[%s] packet dropped by TAP packet filter",
+ mroute_addr_print_ex (&edest, MAPF_SHOW_ARP, &gc));
+ c->c2.to_tun.len = 0;
+ }
+#endif
+ }
+ else
+ {
+ msg (D_MULTI_DROPPED, "MULTI: bad source address from client [%s], packet dropped",
+ mroute_addr_print (&src, &gc));
+ c->c2.to_tun.len = 0;
+ }
+ }
+ else
+ {
+ c->c2.to_tun.len = 0;
+ }
+ }
+ }
+
+ /* postprocess and set wakeup */
+ ret = multi_process_post (m, m->pending, mpp_flags);
+
+ clear_prefix ();
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Process packets in the TUN/TAP interface -> TCP/UDP socket direction,
+ * i.e. server -> client direction.
+ */
+bool
+multi_process_incoming_tun (struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = true;
+
+ if (BLEN (&m->top.c2.buf) > 0)
+ {
+ unsigned int mroute_flags;
+ struct mroute_addr src, dest;
+ const int dev_type = TUNNEL_TYPE (m->top.c1.tuntap);
+
+#ifdef ENABLE_PF
+ struct mroute_addr esrc, *e1, *e2;
+ if (dev_type == DEV_TYPE_TUN)
+ {
+ e1 = NULL;
+ e2 = &src;
+ }
+ else
+ {
+ e1 = e2 = &esrc;
+ mroute_addr_reset (&esrc);
+ }
+#endif
+
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("TUN -> TCP/UDP [%d]\n", BLEN (&m->top.c2.buf));
+#endif
+
+ if (m->pending)
+ return true;
+
+ /*
+ * Route an incoming tun/tap packet to
+ * the appropriate multi_instance object.
+ */
+
+ mroute_flags = mroute_extract_addr_from_packet (&src,
+ &dest,
+#ifdef ENABLE_PF
+ e1,
+#else
+ NULL,
+#endif
+ NULL,
+ &m->top.c2.buf,
+ dev_type);
+
+ if (mroute_flags & MROUTE_EXTRACT_SUCCEEDED)
+ {
+ struct context *c;
+
+ /* broadcast or multicast dest addr? */
+ if (mroute_flags & (MROUTE_EXTRACT_BCAST|MROUTE_EXTRACT_MCAST))
+ {
+ /* for now, treat multicast as broadcast */
+#ifdef ENABLE_PF
+ multi_bcast (m, &m->top.c2.buf, NULL, e2);
+#else
+ multi_bcast (m, &m->top.c2.buf, NULL, NULL);
+#endif
+ }
+ else
+ {
+ multi_set_pending (m, multi_get_instance_by_virtual_addr (m, &dest, dev_type == DEV_TYPE_TUN));
+
+ if (m->pending)
+ {
+ /* get instance context */
+ c = &m->pending->context;
+
+ set_prefix (m->pending);
+
+#ifdef ENABLE_PF
+ if (!pf_addr_test (c, e2, "tun_tap_src_addr"))
+ {
+ msg (D_PF_DROPPED, "PF: addr[%s] -> client packet dropped by packet filter",
+ mroute_addr_print_ex (&src, MAPF_SHOW_ARP, &gc));
+ buf_reset_len (&c->c2.buf);
+ }
+ else
+#endif
+ {
+ if (multi_output_queue_ready (m, m->pending))
+ {
+ /* transfer packet pointer from top-level context buffer to instance */
+ c->c2.buf = m->top.c2.buf;
+ }
+ else
+ {
+ /* drop packet */
+ msg (D_MULTI_DROPPED, "MULTI: packet dropped due to output saturation (multi_process_incoming_tun)");
+ buf_reset_len (&c->c2.buf);
+ }
+ }
+
+ /* encrypt in instance context */
+ process_incoming_tun (c);
+
+ /* postprocess and set wakeup */
+ ret = multi_process_post (m, m->pending, mpp_flags);
+
+ clear_prefix ();
+ }
+ }
+ }
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Process a possible client-to-client/bcast/mcast message in the
+ * queue.
+ */
+struct multi_instance *
+multi_get_queue (struct mbuf_set *ms)
+{
+ struct mbuf_item item;
+
+ if (mbuf_extract_item (ms, &item)) /* cleartext IP packet */
+ {
+ unsigned int pip_flags = PIPV4_PASSTOS;
+
+ set_prefix (item.instance);
+ item.instance->context.c2.buf = item.buffer->buf;
+ if (item.buffer->flags & MF_UNICAST) /* --mssfix doesn't make sense for broadcast or multicast */
+ pip_flags |= PIP_MSSFIX;
+ process_ip_header (&item.instance->context, pip_flags, &item.instance->context.c2.buf);
+ encrypt_sign (&item.instance->context, true);
+ mbuf_free_buf (item.buffer);
+
+ dmsg (D_MULTI_DEBUG, "MULTI: C2C/MCAST/BCAST");
+
+ clear_prefix ();
+ return item.instance;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+/*
+ * Called when an I/O wait times out. Usually means that a particular
+ * client instance object needs timer-based service.
+ */
+bool
+multi_process_timeout (struct multi_context *m, const unsigned int mpp_flags)
+{
+ bool ret = true;
+
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("%s -> TIMEOUT\n", id(m->earliest_wakeup));
+#endif
+
+ /* instance marked for wakeup? */
+ if (m->earliest_wakeup)
+ {
+ set_prefix (m->earliest_wakeup);
+ ret = multi_process_post (m, m->earliest_wakeup, mpp_flags);
+ m->earliest_wakeup = NULL;
+ clear_prefix ();
+ }
+ return ret;
+}
+
+/*
+ * Drop a TUN/TAP outgoing packet..
+ */
+void
+multi_process_drop_outgoing_tun (struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = m->pending;
+
+ ASSERT (mi);
+
+ set_prefix (mi);
+
+ msg (D_MULTI_ERRORS, "MULTI: Outgoing TUN queue full, dropped packet len=%d",
+ mi->context.c2.to_tun.len);
+
+ buf_reset (&mi->context.c2.to_tun);
+
+ multi_process_post (m, mi, mpp_flags);
+ clear_prefix ();
+}
+
+/*
+ * Per-client route quota management
+ */
+
+void
+route_quota_exceeded (const struct multi_context *m, const struct multi_instance *mi)
+{
+ struct gc_arena gc = gc_new ();
+ msg (D_ROUTE_QUOTA, "MULTI ROUTE: route quota (%d) exceeded for %s (see --max-routes-per-client option)",
+ mi->context.options.max_routes_per_client,
+ multi_instance_string (mi, false, &gc));
+ gc_free (&gc);
+}
+
+#ifdef ENABLE_DEBUG
+/*
+ * Flood clients with random packets
+ */
+static void
+gremlin_flood_clients (struct multi_context *m)
+{
+ const int level = GREMLIN_PACKET_FLOOD_LEVEL (m->top.options.gremlin);
+ if (level)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer buf = alloc_buf_gc (BUF_SIZE (&m->top.c2.frame), &gc);
+ struct packet_flood_parms parm = get_packet_flood_parms (level);
+ int i;
+
+ ASSERT (buf_init (&buf, FRAME_HEADROOM (&m->top.c2.frame)));
+ parm.packet_size = min_int (parm.packet_size, MAX_RW_SIZE_TUN (&m->top.c2.frame));
+
+ msg (D_GREMLIN, "GREMLIN_FLOOD_CLIENTS: flooding clients with %d packets of size %d",
+ parm.n_packets,
+ parm.packet_size);
+
+ for (i = 0; i < parm.packet_size; ++i)
+ ASSERT (buf_write_u8 (&buf, get_random () & 0xFF));
+
+ for (i = 0; i < parm.n_packets; ++i)
+ multi_bcast (m, &buf, NULL, NULL);
+
+ gc_free (&gc);
+ }
+}
+#endif
+
+bool
+stale_route_check_trigger (struct multi_context *m)
+{
+ struct timeval null;
+ CLEAR (null);
+ return event_timeout_trigger (&m->stale_routes_check_et, &null, ETT_DEFAULT);
+}
+
+/*
+ * Process timers in the top-level context
+ */
+void
+multi_process_per_second_timers_dowork (struct multi_context *m)
+{
+ /* possibly reap instances/routes in vhash */
+ multi_reap_process (m);
+
+ /* possibly print to status log */
+ if (m->top.c1.status_output)
+ {
+ if (status_trigger (m->top.c1.status_output))
+ multi_print_status (m, m->top.c1.status_output, m->status_file_version);
+ }
+
+ /* possibly flush ifconfig-pool file */
+ multi_ifconfig_pool_persist (m, false);
+
+#ifdef ENABLE_DEBUG
+ gremlin_flood_clients (m);
+#endif
+
+ /* Should we check for stale routes? */
+ if (m->top.options.stale_routes_check_interval && stale_route_check_trigger (m))
+ check_stale_routes (m);
+}
+
+void
+multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers)
+{
+ inherit_context_top (&m->top, top);
+ m->top.c2.buffers = NULL;
+ if (alloc_buffers)
+ m->top.c2.buffers = init_context_buffers (&top->c2.frame);
+}
+
+void
+multi_top_free (struct multi_context *m)
+{
+ close_context (&m->top, -1, CC_GC_FREE);
+ free_context_buffers (m->top.c2.buffers);
+}
+
+/*
+ * Return true if event loop should break,
+ * false if it should continue.
+ */
+bool
+multi_process_signal (struct multi_context *m)
+{
+ if (m->top.sig->signal_received == SIGUSR2)
+ {
+ struct status_output *so = status_open (NULL, 0, M_INFO, NULL, 0);
+ multi_print_status (m, so, m->status_file_version);
+ status_close (so);
+ m->top.sig->signal_received = 0;
+ return false;
+ }
+ return true;
+}
+
+/*
+ * Called when an instance should be closed due to the
+ * reception of a soft signal.
+ */
+void
+multi_close_instance_on_signal (struct multi_context *m, struct multi_instance *mi)
+{
+ remap_signal (&mi->context);
+ set_prefix (mi);
+ print_signal (mi->context.sig, "client-instance", D_MULTI_LOW);
+ clear_prefix ();
+ multi_close_instance (m, mi, false);
+}
+
+static void
+multi_signal_instance (struct multi_context *m, struct multi_instance *mi, const int sig)
+{
+ mi->context.sig->signal_received = sig;
+ multi_close_instance_on_signal (m, mi);
+}
+
+/*
+ * Management subsystem callbacks
+ */
+
+#ifdef ENABLE_MANAGEMENT
+
+static void
+management_callback_status (void *arg, const int version, struct status_output *so)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+
+ if (!version)
+ multi_print_status (m, so, m->status_file_version);
+ else
+ multi_print_status (m, so, version);
+}
+
+static int
+management_callback_n_clients (void *arg)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ return m->n_clients;
+}
+
+static int
+management_callback_kill_by_cn (void *arg, const char *del_cn)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct hash_iterator hi;
+ struct hash_element *he;
+ int count = 0;
+
+ hash_iterator_init (m->iter, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct multi_instance *mi = (struct multi_instance *) he->value;
+ if (!mi->halt)
+ {
+ const char *cn = tls_common_name (mi->context.c2.tls_multi, false);
+ if (cn && !strcmp (cn, del_cn))
+ {
+ multi_signal_instance (m, mi, SIGTERM);
+ ++count;
+ }
+ }
+ }
+ hash_iterator_free (&hi);
+ return count;
+}
+
+static int
+management_callback_kill_by_addr (void *arg, const in_addr_t addr, const int port)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct hash_iterator hi;
+ struct hash_element *he;
+ struct openvpn_sockaddr saddr;
+ struct mroute_addr maddr;
+ int count = 0;
+
+ CLEAR (saddr);
+ saddr.addr.in4.sin_family = AF_INET;
+ saddr.addr.in4.sin_addr.s_addr = htonl (addr);
+ saddr.addr.in4.sin_port = htons (port);
+ if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
+ {
+ hash_iterator_init (m->iter, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct multi_instance *mi = (struct multi_instance *) he->value;
+ if (!mi->halt && mroute_addr_equal (&maddr, &mi->real))
+ {
+ multi_signal_instance (m, mi, SIGTERM);
+ ++count;
+ }
+ }
+ hash_iterator_free (&hi);
+ }
+ return count;
+}
+
+static void
+management_delete_event (void *arg, event_t event)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ if (m->mtcp)
+ multi_tcp_delete_event (m->mtcp, event);
+}
+
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+
+static struct multi_instance *
+lookup_by_cid (struct multi_context *m, const unsigned long cid)
+{
+ if (m)
+ {
+ struct multi_instance *mi = (struct multi_instance *) hash_lookup (m->cid_hash, &cid);
+ if (mi && !mi->halt)
+ return mi;
+ }
+ return NULL;
+}
+
+static bool
+management_kill_by_cid (void *arg, const unsigned long cid, const char *kill_msg)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct multi_instance *mi = lookup_by_cid (m, cid);
+ if (mi)
+ {
+ send_restart (&mi->context, kill_msg); /* was: multi_signal_instance (m, mi, SIGTERM); */
+ multi_schedule_context_wakeup(m, mi);
+ return true;
+ }
+ else
+ return false;
+}
+
+static bool
+management_client_auth (void *arg,
+ const unsigned long cid,
+ const unsigned int mda_key_id,
+ const bool auth,
+ const char *reason,
+ const char *client_reason,
+ struct buffer_list *cc_config) /* ownership transferred */
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct multi_instance *mi = lookup_by_cid (m, cid);
+ bool cc_config_owned = true;
+ bool ret = false;
+
+ if (mi)
+ {
+ ret = tls_authenticate_key (mi->context.c2.tls_multi, mda_key_id, auth, client_reason);
+ if (ret)
+ {
+ if (auth)
+ {
+ if (!mi->connection_established_flag)
+ {
+ set_cc_config (mi, cc_config);
+ cc_config_owned = false;
+ }
+ }
+ else
+ {
+ if (reason)
+ msg (D_MULTI_LOW, "MULTI: connection rejected: %s, CLI:%s", reason, np(client_reason));
+ if (mi->connection_established_flag)
+ {
+ send_auth_failed (&mi->context, client_reason); /* mid-session reauth failed */
+ multi_schedule_context_wakeup(m, mi);
+ }
+ }
+ }
+ }
+ if (cc_config_owned && cc_config)
+ buffer_list_free (cc_config);
+ return ret;
+}
+
+static char *
+management_get_peer_info (void *arg, const unsigned long cid)
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct multi_instance *mi = lookup_by_cid (m, cid);
+ char *ret = NULL;
+
+ if (mi)
+ ret = tls_get_peer_info (mi->context.c2.tls_multi);
+
+ return ret;
+}
+
+#endif
+
+#ifdef MANAGEMENT_PF
+static bool
+management_client_pf (void *arg,
+ const unsigned long cid,
+ struct buffer_list *pf_config) /* ownership transferred */
+{
+ struct multi_context *m = (struct multi_context *) arg;
+ struct multi_instance *mi = lookup_by_cid (m, cid);
+ bool ret = false;
+
+ if (mi && pf_config)
+ ret = pf_load_from_buffer_list (&mi->context, pf_config);
+
+ if (pf_config)
+ buffer_list_free (pf_config);
+ return ret;
+}
+#endif
+
+void
+init_management_callback_multi (struct multi_context *m)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ struct management_callback cb;
+ CLEAR (cb);
+ cb.arg = m;
+ cb.flags = MCF_SERVER;
+ cb.status = management_callback_status;
+ cb.show_net = management_show_net_callback;
+ cb.kill_by_cn = management_callback_kill_by_cn;
+ cb.kill_by_addr = management_callback_kill_by_addr;
+ cb.delete_event = management_delete_event;
+ cb.n_clients = management_callback_n_clients;
+#ifdef MANAGEMENT_DEF_AUTH
+ cb.kill_by_cid = management_kill_by_cid;
+ cb.client_auth = management_client_auth;
+ cb.get_peer_info = management_get_peer_info;
+#endif
+#ifdef MANAGEMENT_PF
+ cb.client_pf = management_client_pf;
+#endif
+ management_set_callback (management, &cb);
+ }
+#endif
+}
+
+void
+uninit_management_callback_multi (struct multi_context *m)
+{
+ uninit_management_callback ();
+}
+
+/*
+ * Top level event loop.
+ */
+void
+tunnel_server (struct context *top)
+{
+ ASSERT (top->options.mode == MODE_SERVER);
+
+ if (proto_is_dgram(top->options.ce.proto))
+ tunnel_server_udp(top);
+ else
+ tunnel_server_tcp(top);
+}
+
+#else
+static void dummy(void) {}
+#endif /* P2MP_SERVER */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.h
new file mode 100644
index 00000000..0446fbfc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/multi.h
@@ -0,0 +1,585 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Header file for server-mode related structures and functions.
+ */
+
+#ifndef MULTI_H
+#define MULTI_H
+
+#if P2MP_SERVER
+
+#include "init.h"
+#include "forward.h"
+#include "mroute.h"
+#include "mbuf.h"
+#include "list.h"
+#include "schedule.h"
+#include "pool.h"
+#include "mudp.h"
+#include "mtcp.h"
+#include "perf.h"
+
+/*
+ * Walk (don't run) through the routing table,
+ * deleting old entries, and possibly multi_instance
+ * structs as well which have been marked for deletion.
+ */
+struct multi_reap
+{
+ int bucket_base;
+ int buckets_per_pass;
+ time_t last_call;
+};
+
+
+/**
+ * Server-mode state structure for one single VPN tunnel.
+ *
+ * This structure is used by OpenVPN processes running in server-mode to
+ * store state information related to one single VPN tunnel.
+ *
+ * The @ref tunnel_state "Structure of VPN tunnel state storage" related
+ * page describes the role the structure plays when OpenVPN is running in
+ * server-mode.
+ */
+struct multi_instance {
+ struct schedule_entry se; /* this must be the first element of the structure */
+ struct gc_arena gc;
+ bool defined;
+ bool halt;
+ int refcount;
+ int route_count; /* number of routes (including cached routes) owned by this instance */
+ time_t created; /**< Time at which a VPN tunnel instance
+ * was created. This parameter is set
+ * by the \c multi_create_instance()
+ * function. */
+ struct timeval wakeup; /* absolute time */
+ struct mroute_addr real; /**< External network address of the
+ * remote peer. */
+ ifconfig_pool_handle vaddr_handle;
+ const char *msg_prefix;
+
+ /* queued outgoing data in Server/TCP mode */
+ unsigned int tcp_rwflags;
+ struct mbuf_set *tcp_link_out_deferred;
+ bool socket_set_called;
+
+ in_addr_t reporting_addr; /* IP address shown in status listing */
+ struct in6_addr reporting_addr_ipv6; /* IPv6 address in status listing */
+
+ bool did_open_context;
+ bool did_real_hash;
+ bool did_iter;
+#ifdef MANAGEMENT_DEF_AUTH
+ bool did_cid_hash;
+ struct buffer_list *cc_config;
+#endif
+ bool connection_established_flag;
+ bool did_iroutes;
+ int n_clients_delta; /* added to multi_context.n_clients when instance is closed */
+
+ struct context context; /**< The context structure storing state
+ * for this VPN tunnel. */
+};
+
+
+/**
+ * Main OpenVPN server state structure.
+ *
+ * This structure is used by OpenVPN processes running in server-mode to
+ * store all the VPN tunnel and process-wide state.
+ *
+ * The @ref tunnel_state "Structure of VPN tunnel state storage" related
+ * page describes the role the structure plays when OpenVPN is running in
+ * server-mode.
+ */
+struct multi_context {
+# define MC_UNDEF 0
+# define MC_SINGLE_THREADED (1<<0)
+# define MC_MULTI_THREADED_MASTER (1<<1)
+# define MC_MULTI_THREADED_WORKER (1<<2)
+# define MC_MULTI_THREADED_SCHEDULER (1<<3)
+# define MC_WORK_THREAD (MC_MULTI_THREADED_WORKER|MC_MULTI_THREADED_SCHEDULER)
+ int thread_mode;
+
+ struct multi_instance** instances;
+
+ struct hash *hash; /**< VPN tunnel instances indexed by real
+ * address of the remote peer. */
+ struct hash *vhash; /**< VPN tunnel instances indexed by
+ * virtual address of remote hosts. */
+ struct hash *iter; /**< VPN tunnel instances indexed by real
+ * address of the remote peer, optimized
+ * for iteration. */
+ struct schedule *schedule;
+ struct mbuf_set *mbuf; /**< Set of buffers for passing data
+ * channel packets between VPN tunnel
+ * instances. */
+ struct multi_tcp *mtcp; /**< State specific to OpenVPN using TCP
+ * as external transport. */
+ struct ifconfig_pool *ifconfig_pool;
+ struct frequency_limit *new_connection_limiter;
+ struct mroute_helper *route_helper;
+ struct multi_reap *reaper;
+ struct mroute_addr local;
+ bool enable_c2c;
+ int max_clients;
+ int tcp_queue_limit;
+ int status_file_version;
+ int n_clients; /* current number of authenticated clients */
+
+#ifdef MANAGEMENT_DEF_AUTH
+ struct hash *cid_hash;
+ unsigned long cid_counter;
+#endif
+
+ struct multi_instance *pending;
+ struct multi_instance *earliest_wakeup;
+ struct multi_instance **mpp_touched;
+ struct context_buffers *context_buffers;
+ time_t per_second_trigger;
+
+ struct context top; /**< Storage structure for process-wide
+ * configuration. */
+
+ /*
+ * Timer object for stale route check
+ */
+ struct event_timeout stale_routes_check_et;
+};
+
+/*
+ * Host route
+ */
+struct multi_route
+{
+ struct mroute_addr addr;
+ struct multi_instance *instance;
+
+# define MULTI_ROUTE_CACHE (1<<0)
+# define MULTI_ROUTE_AGEABLE (1<<1)
+ unsigned int flags;
+
+ unsigned int cache_generation;
+ time_t last_reference;
+};
+
+
+/**************************************************************************/
+/**
+ * Main event loop for OpenVPN in server mode.
+ * @ingroup eventloop
+ *
+ * This function calls the appropriate main event loop function depending
+ * on the transport protocol used:
+ * - \c tunnel_server_udp()
+ * - \c tunnel_server_tcp()
+ *
+ * @param top - Top-level context structure.
+ */
+void tunnel_server (struct context *top);
+
+
+const char *multi_instance_string (const struct multi_instance *mi, bool null, struct gc_arena *gc);
+
+/*
+ * Called by mtcp.c, mudp.c, or other (to be written) protocol drivers
+ */
+
+void multi_init (struct multi_context *m, struct context *t, bool tcp_mode, int thread_mode);
+void multi_uninit (struct multi_context *m);
+
+void multi_top_init (struct multi_context *m, const struct context *top, const bool alloc_buffers);
+void multi_top_free (struct multi_context *m);
+
+struct multi_instance *multi_create_instance (struct multi_context *m, const struct mroute_addr *real);
+void multi_close_instance (struct multi_context *m, struct multi_instance *mi, bool shutdown);
+
+bool multi_process_timeout (struct multi_context *m, const unsigned int mpp_flags);
+
+#define MPP_PRE_SELECT (1<<0)
+#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
+#define MPP_CLOSE_ON_SIGNAL (1<<2)
+#define MPP_RECORD_TOUCH (1<<3)
+
+
+/**************************************************************************/
+/**
+ * Perform postprocessing of a VPN tunnel instance.
+ *
+ * After some VPN tunnel activity has taken place, the VPN tunnel's state
+ * may need updating and some follow-up action may be required. This
+ * function controls the necessary postprocessing. It is called by many
+ * other functions that handle VPN tunnel related activity, such as \c
+ * multi_process_incoming_link(), \c multi_process_outgoing_link(), \c
+ * multi_process_incoming_tun(), \c multi_process_outgoing_tun(), and \c
+ * multi_process_timeout(), among others.
+ *
+ * @param m - The single \c multi_context structure.
+ * @param mi - The \c multi_instance of the VPN tunnel to be
+ * postprocessed.
+ * @param flags - Fast I/O optimization flags.
+ *
+ * @return
+ * - True, if the VPN tunnel instance \a mi was not closed due to a
+ * signal during processing.
+ * - False, if the VPN tunnel instance \a mi was closed.
+ */
+bool multi_process_post (struct multi_context *m, struct multi_instance *mi, const unsigned int flags);
+
+
+/**************************************************************************/
+/**
+ * Demultiplex and process a packet received over the external network
+ * interface.
+ * @ingroup external_multiplexer
+ *
+ * This function determines which VPN tunnel instance the incoming packet
+ * is associated with, and then calls \c process_incoming_link() to handle
+ * it. Afterwards, if the packet is destined for a broadcast/multicast
+ * address or a remote host reachable through a different VPN tunnel, this
+ * function takes care of sending it they are.
+ *
+ * @note This function is only used by OpenVPN processes which are running
+ * in server mode, and can therefore sustain multiple active VPN
+ * tunnels.
+ *
+ * @param m - The single \c multi_context structure.
+ * @param instance - The VPN tunnel state structure associated with
+ * the incoming packet, if known, as is the case
+ * when using TCP transport. Otherwise NULL, as is
+ * the case when using UDP transport.
+ * @param mpp_flags - Fast I/O optimization flags.
+ */
+bool multi_process_incoming_link (struct multi_context *m, struct multi_instance *instance, const unsigned int mpp_flags);
+
+
+/**
+ * Determine the destination VPN tunnel of a packet received over the
+ * virtual tun/tap network interface and then process it accordingly.
+ * @ingroup internal_multiplexer
+ *
+ * This function determines which VPN tunnel instance the packet is
+ * destined for, and then calls \c process_outgoing_tun() to handle it.
+ *
+ * @note This function is only used by OpenVPN processes which are running
+ * in server mode, and can therefore sustain multiple active VPN
+ * tunnels.
+ *
+ * @param m - The single \c multi_context structure.
+ * @param mpp_flags - Fast I/O optimization flags.
+ */
+bool multi_process_incoming_tun (struct multi_context *m, const unsigned int mpp_flags);
+
+
+void multi_process_drop_outgoing_tun (struct multi_context *m, const unsigned int mpp_flags);
+
+void multi_print_status (struct multi_context *m, struct status_output *so, const int version);
+
+struct multi_instance *multi_get_queue (struct mbuf_set *ms);
+
+void multi_add_mbuf (struct multi_context *m,
+ struct multi_instance *mi,
+ struct mbuf_buffer *mb);
+
+void multi_ifconfig_pool_persist (struct multi_context *m, bool force);
+
+bool multi_process_signal (struct multi_context *m);
+
+void multi_close_instance_on_signal (struct multi_context *m, struct multi_instance *mi);
+
+void init_management_callback_multi (struct multi_context *m);
+void uninit_management_callback_multi (struct multi_context *m);
+
+/*
+ * Return true if our output queue is not full
+ */
+static inline bool
+multi_output_queue_ready (const struct multi_context *m,
+ const struct multi_instance *mi)
+{
+ if (mi->tcp_link_out_deferred)
+ return mbuf_len (mi->tcp_link_out_deferred) <= m->tcp_queue_limit;
+ else
+ return true;
+}
+
+/*
+ * Determine which instance has pending output
+ * and prepare the output for sending in
+ * the to_link buffer.
+ */
+static inline struct multi_instance *
+multi_process_outgoing_link_pre (struct multi_context *m)
+{
+ struct multi_instance *mi = NULL;
+
+ if (m->pending)
+ mi = m->pending;
+ else if (mbuf_defined (m->mbuf))
+ mi = multi_get_queue (m->mbuf);
+ return mi;
+}
+
+/*
+ * Per-client route quota management
+ */
+
+void route_quota_exceeded (const struct multi_context *m, const struct multi_instance *mi);
+
+static inline void
+route_quota_inc (struct multi_instance *mi)
+{
+ ++mi->route_count;
+}
+
+static inline void
+route_quota_dec (struct multi_instance *mi)
+{
+ --mi->route_count;
+}
+
+/* can we add a new route? */
+static inline bool
+route_quota_test (const struct multi_context *m, const struct multi_instance *mi)
+{
+ if (mi->route_count >= mi->context.options.max_routes_per_client)
+ {
+ route_quota_exceeded (m, mi);
+ return false;
+ }
+ else
+ return true;
+}
+
+/*
+ * Instance reference counting
+ */
+
+static inline void
+multi_instance_inc_refcount (struct multi_instance *mi)
+{
+ ++mi->refcount;
+}
+
+static inline void
+multi_instance_dec_refcount (struct multi_instance *mi)
+{
+ if (--mi->refcount <= 0)
+ {
+ gc_free (&mi->gc);
+ free (mi);
+ }
+}
+
+static inline void
+multi_route_del (struct multi_route *route)
+{
+ struct multi_instance *mi = route->instance;
+ route_quota_dec (mi);
+ multi_instance_dec_refcount (mi);
+ free (route);
+}
+
+static inline bool
+multi_route_defined (const struct multi_context *m,
+ const struct multi_route *r)
+{
+ if (r->instance->halt)
+ return false;
+ else if ((r->flags & MULTI_ROUTE_CACHE)
+ && r->cache_generation != m->route_helper->cache_generation)
+ return false;
+ else if ((r->flags & MULTI_ROUTE_AGEABLE)
+ && r->last_reference + m->route_helper->ageable_ttl_secs < now)
+ return false;
+ else
+ return true;
+}
+
+/*
+ * Set a msg() function prefix with our current client instance ID.
+ */
+
+static inline void
+set_prefix (struct multi_instance *mi)
+{
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ if (mi->msg_prefix)
+ printf ("[%s]\n", mi->msg_prefix);
+#endif
+ msg_set_prefix (mi->msg_prefix);
+}
+
+static inline void
+clear_prefix (void)
+{
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("[NULL]\n");
+#endif
+ msg_set_prefix (NULL);
+}
+
+/*
+ * Instance Reaper
+ *
+ * Reaper constants. The reaper is the process where the virtual address
+ * and virtual route hash table is scanned for dead entries which are
+ * then removed. The hash table could potentially be quite large, so we
+ * don't want to reap in a single pass.
+ */
+
+#define REAP_MAX_WAKEUP 10 /* Do reap pass at least once per n seconds */
+#define REAP_DIVISOR 256 /* How many passes to cover whole hash table */
+#define REAP_MIN 16 /* Minimum number of buckets per pass */
+#define REAP_MAX 1024 /* Maximum number of buckets per pass */
+
+/*
+ * Mark a cached host route for deletion after this
+ * many seconds without any references.
+ */
+#define MULTI_CACHE_ROUTE_TTL 60
+
+static inline void
+multi_reap_process (const struct multi_context *m)
+{
+ void multi_reap_process_dowork (const struct multi_context *m);
+ if (m->reaper->last_call != now)
+ multi_reap_process_dowork (m);
+}
+
+static inline void
+multi_process_per_second_timers (struct multi_context *m)
+{
+ if (m->per_second_trigger != now)
+ {
+ void multi_process_per_second_timers_dowork (struct multi_context *m);
+ multi_process_per_second_timers_dowork (m);
+ m->per_second_trigger = now;
+ }
+}
+
+/*
+ * Compute earliest timeout expiry from the set of
+ * all instances. Output:
+ *
+ * m->earliest_wakeup : instance needing the earliest service.
+ * dest : earliest timeout as a delta in relation
+ * to current time.
+ */
+static inline void
+multi_get_timeout (struct multi_context *m, struct timeval *dest)
+{
+ struct timeval tv, current;
+
+ CLEAR (tv);
+ m->earliest_wakeup = (struct multi_instance *) schedule_get_earliest_wakeup (m->schedule, &tv);
+ if (m->earliest_wakeup)
+ {
+ ASSERT (!openvpn_gettimeofday (&current, NULL));
+ tv_delta (dest, &current, &tv);
+ if (dest->tv_sec >= REAP_MAX_WAKEUP)
+ {
+ m->earliest_wakeup = NULL;
+ dest->tv_sec = REAP_MAX_WAKEUP;
+ dest->tv_usec = 0;
+ }
+ }
+ else
+ {
+ dest->tv_sec = REAP_MAX_WAKEUP;
+ dest->tv_usec = 0;
+ }
+}
+
+
+/**
+ * Send a packet over the virtual tun/tap network interface to its locally
+ * reachable destination.
+ * @ingroup internal_multiplexer
+ *
+ * This function calls \c process_outgoing_tun() to perform the actual
+ * sending of the packet. Afterwards, it calls \c multi_process_post() to
+ * perform server-mode postprocessing.
+ *
+ * @param m - The single \c multi_context structure.
+ * @param mpp_flags - Fast I/O optimization flags.
+ *
+ * @return
+ * - True, if the \c multi_instance associated with the packet sent was
+ * not closed due to a signal during processing.
+ * - Falls, if the \c multi_instance was closed.
+ */
+static inline bool
+multi_process_outgoing_tun (struct multi_context *m, const unsigned int mpp_flags)
+{
+ struct multi_instance *mi = m->pending;
+ bool ret = true;
+
+ ASSERT (mi);
+#ifdef MULTI_DEBUG_EVENT_LOOP
+ printf ("%s -> TUN len=%d\n",
+ id(mi),
+ mi->context.c2.to_tun.len);
+#endif
+ set_prefix (mi);
+ process_outgoing_tun (&mi->context);
+ ret = multi_process_post (m, mi, mpp_flags);
+ clear_prefix ();
+ return ret;
+}
+
+
+
+static inline bool
+multi_process_outgoing_link_dowork (struct multi_context *m, struct multi_instance *mi, const unsigned int mpp_flags)
+{
+ bool ret = true;
+ set_prefix (mi);
+ process_outgoing_link (&mi->context);
+ ret = multi_process_post (m, mi, mpp_flags);
+ clear_prefix ();
+ return ret;
+}
+
+/*
+ * Check for signals.
+ */
+#define MULTI_CHECK_SIG(m) EVENT_LOOP_CHECK_SIGNAL (&(m)->top, multi_process_signal, (m))
+
+static inline void
+multi_set_pending (struct multi_context *m, struct multi_instance *mi)
+{
+ m->pending = mi;
+}
+
+static inline void
+multi_release_io_lock (struct multi_context *m)
+{
+}
+
+#endif /* P2MP_SERVER */
+#endif /* MULTI_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.c
new file mode 100644
index 00000000..3390bddd
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.c
@@ -0,0 +1,352 @@
+/*
+ * ntlm proxy support for OpenVPN
+ *
+ * Copyright (C) 2004 William Preston
+ *
+ * *NTLMv2 support and domain name parsing by Miroslav Zajic, Nextsoft s.r.o.*
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if NTLM
+
+#include "common.h"
+#include "buffer.h"
+#include "misc.h"
+#include "socket.h"
+#include "fdmisc.h"
+#include "proxy.h"
+#include "ntlm.h"
+#include "base64.h"
+#include "crypto.h"
+
+#include "memdbg.h"
+
+
+/* 64bit datatype macros */
+#ifdef _MSC_VER
+ /* MS compilers */
+# define UINTEGER64 __int64
+# define UINT64(c) c ## Ui64
+#else
+ /* Non MS compilers */
+# define UINTEGER64 unsigned long long
+# define UINT64(c) c ## LL
+#endif
+
+
+
+
+static void
+create_des_keys(const unsigned char *hash, unsigned char *key)
+{
+ key[0] = hash[0];
+ key[1] = ((hash[0]&1)<<7)|(hash[1]>>1);
+ key[2] = ((hash[1]&3)<<6)|(hash[2]>>2);
+ key[3] = ((hash[2]&7)<<5)|(hash[3]>>3);
+ key[4] = ((hash[3]&15)<<4)|(hash[4]>>4);
+ key[5] = ((hash[4]&31)<<3)|(hash[5]>>5);
+ key[6] = ((hash[5]&63)<<2)|(hash[6]>>6);
+ key[7] = ((hash[6]&127)<<1);
+ key_des_fixup(key, 8, 1);
+}
+
+static void
+gen_md4_hash (const char* data, int data_len, char *result)
+{
+ /* result is 16 byte md4 hash */
+ const md_kt_t *md4_kt = md_kt_get("MD4");
+ char md[MD4_DIGEST_LENGTH];
+
+ md_full(md4_kt, data, data_len, md);
+ memcpy (result, md, MD4_DIGEST_LENGTH);
+}
+
+static void
+gen_hmac_md5 (const char* data, int data_len, const char* key, int key_len,char *result)
+{
+ const md_kt_t *md5_kt = md_kt_get("MD5");
+ hmac_ctx_t hmac_ctx;
+ CLEAR(hmac_ctx);
+
+ hmac_ctx_init(&hmac_ctx, key, key_len, md5_kt);
+ hmac_ctx_update(&hmac_ctx, (const unsigned char *)data, data_len);
+ hmac_ctx_final(&hmac_ctx, (unsigned char *)result);
+ hmac_ctx_cleanup(&hmac_ctx);
+}
+
+static void
+gen_timestamp (unsigned char *timestamp)
+{
+ /* Copies 8 bytes long timestamp into "timestamp" buffer.
+ * Timestamp is Little-endian, 64-bit signed value representing the number of tenths of a microsecond since January 1, 1601.
+ */
+
+ UINTEGER64 timestamp_ull;
+
+ timestamp_ull = openvpn_time(NULL);
+ timestamp_ull = (timestamp_ull + UINT64(11644473600)) * UINT64(10000000);
+
+ /* store little endian value */
+ timestamp[0]= timestamp_ull & UINT64(0xFF);
+ timestamp[1]= (timestamp_ull >> 8) & UINT64(0xFF);
+ timestamp[2]= (timestamp_ull >> 16) & UINT64(0xFF);
+ timestamp[3]= (timestamp_ull >> 24) & UINT64(0xFF);
+ timestamp[4]= (timestamp_ull >> 32) & UINT64(0xFF);
+ timestamp[5]= (timestamp_ull >> 40) & UINT64(0xFF);
+ timestamp[6]= (timestamp_ull >> 48) & UINT64(0xFF);
+ timestamp[7]= (timestamp_ull >> 56) & UINT64(0xFF);
+}
+
+static void
+gen_nonce (unsigned char *nonce)
+{
+ /* Generates 8 random bytes to be used as client nonce */
+ int i;
+
+ for(i=0;i<8;i++){
+ nonce[i] = (unsigned char)get_random();
+ }
+}
+
+unsigned char *my_strupr(unsigned char *str)
+{
+ /* converts string to uppercase in place */
+ unsigned char *tmp = str;;
+
+ do *str = toupper(*str); while (*(++str));
+ return tmp;
+}
+
+static int
+unicodize (char *dst, const char *src)
+{
+ /* not really unicode... */
+ int i = 0;
+ do
+ {
+ dst[i++] = *src;
+ dst[i++] = 0;
+ }
+ while (*src++);
+
+ return i;
+}
+
+static void
+add_security_buffer(int sb_offset, void *data, int length, unsigned char *msg_buf, int *msg_bufpos)
+{
+ /* Adds security buffer data to a message and sets security buffer's offset and length */
+ msg_buf[sb_offset] = (unsigned char)length;
+ msg_buf[sb_offset + 2] = msg_buf[sb_offset];
+ msg_buf[sb_offset + 4] = (unsigned char)(*msg_bufpos & 0xff);
+ msg_buf[sb_offset + 5] = (unsigned char)((*msg_bufpos >> 8) & 0xff);
+ memcpy(&msg_buf[*msg_bufpos], data, msg_buf[sb_offset]);
+ *msg_bufpos += length;
+}
+
+const char *
+ntlm_phase_1 (const struct http_proxy_info *p, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (96, gc);
+ /* try a minimal NTLM handshake
+ *
+ * http://davenport.sourceforge.net/ntlm.html
+ *
+ * This message contains only the NTLMSSP signature,
+ * the NTLM message type,
+ * and the minimal set of flags (Negotiate NTLM and Negotiate OEM).
+ *
+ */
+ buf_printf (&out, "%s", "TlRMTVNTUAABAAAAAgIAAA==");
+ return (BSTR (&out));
+}
+
+const char *
+ntlm_phase_3 (const struct http_proxy_info *p, const char *phase_2, struct gc_arena *gc)
+{
+ /* NTLM handshake
+ *
+ * http://davenport.sourceforge.net/ntlm.html
+ *
+ */
+
+ char pwbuf[sizeof (p->up.password) * 2]; /* for unicode password */
+ char buf2[128]; /* decoded reply from proxy */
+ unsigned char phase3[464];
+
+ char md4_hash[MD4_DIGEST_LENGTH+5];
+ char challenge[8], ntlm_response[24];
+ int i, ret_val;
+
+ char ntlmv2_response[144];
+ char userdomain_u[256]; /* for uppercase unicode username and domain */
+ char userdomain[128]; /* the same as previous but ascii */
+ char ntlmv2_hash[MD5_DIGEST_LENGTH];
+ char ntlmv2_hmacmd5[16];
+ char *ntlmv2_blob = ntlmv2_response + 16; /* inside ntlmv2_response, length: 128 */
+ int ntlmv2_blob_size=0;
+ int phase3_bufpos = 0x40; /* offset to next security buffer data to be added */
+ size_t len;
+
+ char domain[128];
+ char username[128];
+ char *separator;
+
+ bool ntlmv2_enabled = (p->auth_method == HTTP_AUTH_NTLM2);
+
+ CLEAR (buf2);
+
+ ASSERT (strlen (p->up.username) > 0);
+ ASSERT (strlen (p->up.password) > 0);
+
+ /* username parsing */
+ separator = strchr(p->up.username, '\\');
+ if (separator == NULL) {
+ strncpy(username, p->up.username, sizeof(username)-1);
+ username[sizeof(username)-1]=0;
+ domain[0]=0;
+ } else {
+ strncpy(username, separator+1, sizeof(username)-1);
+ username[sizeof(username)-1]=0;
+ len = separator - p->up.username;
+ if (len > sizeof(domain) - 1) len = sizeof(domain) - 1;
+ strncpy(domain, p->up.username, len);
+ domain[len]=0;
+ }
+
+
+ /* fill 1st 16 bytes with md4 hash, disregard terminating null */
+ gen_md4_hash (pwbuf, unicodize (pwbuf, p->up.password) - 2, md4_hash);
+
+ /* pad to 21 bytes */
+ memset(md4_hash + MD4_DIGEST_LENGTH, 0, 5);
+
+ ret_val = openvpn_base64_decode( phase_2, (void *)buf2, -1);
+ if (ret_val < 0)
+ return NULL;
+
+ /* we can be sure that phase_2 is less than 128
+ * therefore buf2 needs to be (3/4 * 128) */
+
+ /* extract the challenge from bytes 24-31 */
+ for (i=0; i<8; i++)
+ {
+ challenge[i] = buf2[i+24];
+ }
+
+ if (ntlmv2_enabled){ /* Generate NTLMv2 response */
+ int tib_len;
+
+ /* NTLMv2 hash */
+ my_strupr((unsigned char *)strcpy(userdomain, username));
+ if (strlen(username) + strlen(domain) < sizeof(userdomain))
+ strcat(userdomain, domain);
+ else
+ msg (M_INFO, "Warning: Username or domain too long");
+ unicodize (userdomain_u, userdomain);
+ gen_hmac_md5(userdomain_u, 2 * strlen(userdomain), md4_hash, MD5_DIGEST_LENGTH, ntlmv2_hash);
+
+ /* NTLMv2 Blob */
+ memset(ntlmv2_blob, 0, 128); /* Clear blob buffer */
+ ntlmv2_blob[0x00]=1; /* Signature */
+ ntlmv2_blob[0x01]=1; /* Signature */
+ ntlmv2_blob[0x04]=0; /* Reserved */
+ gen_timestamp((unsigned char *)&ntlmv2_blob[0x08]); /* 64-bit Timestamp */
+ gen_nonce((unsigned char *)&ntlmv2_blob[0x10]); /* 64-bit Client Nonce */
+ ntlmv2_blob[0x18]=0; /* Unknown, zero should work */
+
+ /* Add target information block to the blob */
+ if (( *((long *)&buf2[0x14]) & 0x00800000) == 0x00800000){ /* Check for Target Information block */
+ tib_len = buf2[0x28];/* Get Target Information block size */
+ if (tib_len > 96) tib_len = 96;
+ {
+ char *tib_ptr = buf2 + buf2[0x2c]; /* Get Target Information block pointer */
+ memcpy(&ntlmv2_blob[0x1c], tib_ptr, tib_len); /* Copy Target Information block into the blob */
+ }
+ } else {
+ tib_len = 0;
+ }
+
+ ntlmv2_blob[0x1c + tib_len] = 0; /* Unknown, zero works */
+
+ /* Get blob length */
+ ntlmv2_blob_size = 0x20 + tib_len;
+
+ /* Add challenge from message 2 */
+ memcpy(&ntlmv2_response[8], challenge, 8);
+
+ /* hmac-md5 */
+ gen_hmac_md5(&ntlmv2_response[8], ntlmv2_blob_size + 8, ntlmv2_hash, MD5_DIGEST_LENGTH, ntlmv2_hmacmd5);
+
+ /* Add hmac-md5 result to the blob */
+ memcpy(ntlmv2_response, ntlmv2_hmacmd5, MD5_DIGEST_LENGTH); /* Note: This overwrites challenge previously written at ntlmv2_response[8..15] */
+
+ } else { /* Generate NTLM response */
+ unsigned char key1[DES_KEY_LENGTH], key2[DES_KEY_LENGTH], key3[DES_KEY_LENGTH];
+
+ create_des_keys ((unsigned char *)md4_hash, key1);
+ cipher_des_encrypt_ecb (key1, challenge, ntlm_response);
+
+ create_des_keys ((unsigned char *)&(md4_hash[DES_KEY_LENGTH-1]), key2);
+ cipher_des_encrypt_ecb (key2, challenge, &ntlm_response[DES_KEY_LENGTH]);
+
+ create_des_keys ((unsigned char *)&(md4_hash[2*(DES_KEY_LENGTH-1)]), key3);
+ cipher_des_encrypt_ecb (key3, challenge, &ntlm_response[DES_KEY_LENGTH*2]);
+ }
+
+
+ memset (phase3, 0, sizeof (phase3)); /* clear reply */
+
+ strcpy ((char *)phase3, "NTLMSSP\0"); /* signature */
+ phase3[8] = 3; /* type 3 */
+
+ if (ntlmv2_enabled){ /* NTLMv2 response */
+ add_security_buffer(0x14, ntlmv2_response, ntlmv2_blob_size + 16, phase3, &phase3_bufpos);
+ }else{ /* NTLM response */
+ add_security_buffer(0x14, ntlm_response, 24, phase3, &phase3_bufpos);
+ }
+
+ /* username in ascii */
+ add_security_buffer(0x24, username, strlen (username), phase3, &phase3_bufpos);
+
+ /* Set domain. If <domain> is empty, default domain will be used (i.e. proxy's domain) */
+ add_security_buffer(0x1c, domain, strlen (domain), phase3, &phase3_bufpos);
+
+
+ /* other security buffers will be empty */
+ phase3[0x10] = phase3_bufpos; /* lm not used */
+ phase3[0x30] = phase3_bufpos; /* no workstation name supplied */
+ phase3[0x38] = phase3_bufpos; /* no session key */
+
+ /* flags */
+ phase3[0x3c] = 0x02; /* negotiate oem */
+ phase3[0x3d] = 0x02; /* negotiate ntlm */
+
+ return ((const char *)make_base64_string2 ((unsigned char *)phase3, phase3_bufpos, gc));
+}
+
+#else
+static void dummy(void) {}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.h
new file mode 100644
index 00000000..77903b08
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ntlm.h
@@ -0,0 +1,11 @@
+#ifndef NTLM_H
+#define NTLM_H
+
+#if NTLM
+
+const char *ntlm_phase_1 (const struct http_proxy_info *p, struct gc_arena *gc);
+const char *ntlm_phase_3 (const struct http_proxy_info *p, const char *phase_2, struct gc_arena *gc);
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/occ-inline.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ-inline.h
new file mode 100644
index 00000000..516eb4d9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ-inline.h
@@ -0,0 +1,85 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OCC_INLINE_H
+#define OCC_INLINE_H
+
+#ifdef ENABLE_OCC
+
+/*
+ * Inline functions
+ */
+
+static inline int
+occ_reset_op ()
+{
+ return -1;
+}
+
+/*
+ * Should we send an OCC_REQUEST message?
+ */
+static inline void
+check_send_occ_req (struct context *c)
+{
+ void check_send_occ_req_dowork (struct context *c);
+ if (event_timeout_defined (&c->c2.occ_interval)
+ && event_timeout_trigger (&c->c2.occ_interval,
+ &c->c2.timeval,
+ (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
+ check_send_occ_req_dowork (c);
+}
+
+/*
+ * Should we send an MTU load test?
+ */
+static inline void
+check_send_occ_load_test (struct context *c)
+{
+ void check_send_occ_load_test_dowork (struct context *c);
+ if (event_timeout_defined (&c->c2.occ_mtu_load_test_interval)
+ && event_timeout_trigger (&c->c2.occ_mtu_load_test_interval,
+ &c->c2.timeval,
+ (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
+ check_send_occ_load_test_dowork (c);
+}
+
+/*
+ * Should we send an OCC message?
+ */
+static inline void
+check_send_occ_msg (struct context *c)
+{
+ void check_send_occ_msg_dowork (struct context *c);
+ if (c->c2.occ_op >= 0)
+ {
+ if (!TO_LINK_DEF(c))
+ check_send_occ_msg_dowork (c);
+ else
+ tv_clear (&c->c2.timeval); /* ZERO-TIMEOUT */
+ }
+}
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.c
new file mode 100644
index 00000000..ff487069
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.c
@@ -0,0 +1,399 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_OCC
+
+#include "occ.h"
+
+#include "memdbg.h"
+
+#include "forward-inline.h"
+#include "occ-inline.h"
+
+/*
+ * This random string identifies an OpenVPN
+ * Configuration Control packet.
+ * It should be of sufficient length and randomness
+ * so as not to collide with other tunnel data.
+ *
+ * The OCC protocol is as follows:
+ *
+ * occ_magic -- (16 octets)
+ *
+ * type [OCC_REQUEST | OCC_REPLY] (1 octet)
+ * null terminated options string if OCC_REPLY (variable)
+ *
+ * When encryption is used, the OCC packet
+ * is encapsulated within the encrypted
+ * envelope.
+ *
+ * OCC_STRING_SIZE must be set to sizeof (occ_magic)
+ */
+
+const uint8_t occ_magic[] = {
+ 0x28, 0x7f, 0x34, 0x6b, 0xd4, 0xef, 0x7a, 0x81,
+ 0x2d, 0x56, 0xb8, 0xd3, 0xaf, 0xc5, 0x45, 0x9c
+};
+
+static const struct mtu_load_test mtu_load_test_sequence[] = {
+
+ {OCC_MTU_LOAD_REQUEST, -1000},
+ {OCC_MTU_LOAD, -1000},
+ {OCC_MTU_LOAD_REQUEST, -1000},
+ {OCC_MTU_LOAD, -1000},
+ {OCC_MTU_LOAD_REQUEST, -1000},
+ {OCC_MTU_LOAD, -1000},
+
+ {OCC_MTU_LOAD_REQUEST, -750},
+ {OCC_MTU_LOAD, -750},
+ {OCC_MTU_LOAD_REQUEST, -750},
+ {OCC_MTU_LOAD, -750},
+ {OCC_MTU_LOAD_REQUEST, -750},
+ {OCC_MTU_LOAD, -750},
+
+ {OCC_MTU_LOAD_REQUEST, -500},
+ {OCC_MTU_LOAD, -500},
+ {OCC_MTU_LOAD_REQUEST, -500},
+ {OCC_MTU_LOAD, -500},
+ {OCC_MTU_LOAD_REQUEST, -500},
+ {OCC_MTU_LOAD, -500},
+
+ {OCC_MTU_LOAD_REQUEST, -400},
+ {OCC_MTU_LOAD, -400},
+ {OCC_MTU_LOAD_REQUEST, -400},
+ {OCC_MTU_LOAD, -400},
+ {OCC_MTU_LOAD_REQUEST, -400},
+ {OCC_MTU_LOAD, -400},
+
+ {OCC_MTU_LOAD_REQUEST, -300},
+ {OCC_MTU_LOAD, -300},
+ {OCC_MTU_LOAD_REQUEST, -300},
+ {OCC_MTU_LOAD, -300},
+ {OCC_MTU_LOAD_REQUEST, -300},
+ {OCC_MTU_LOAD, -300},
+
+ {OCC_MTU_LOAD_REQUEST, -200},
+ {OCC_MTU_LOAD, -200},
+ {OCC_MTU_LOAD_REQUEST, -200},
+ {OCC_MTU_LOAD, -200},
+ {OCC_MTU_LOAD_REQUEST, -200},
+ {OCC_MTU_LOAD, -200},
+
+ {OCC_MTU_LOAD_REQUEST, -150},
+ {OCC_MTU_LOAD, -150},
+ {OCC_MTU_LOAD_REQUEST, -150},
+ {OCC_MTU_LOAD, -150},
+ {OCC_MTU_LOAD_REQUEST, -150},
+ {OCC_MTU_LOAD, -150},
+
+ {OCC_MTU_LOAD_REQUEST, -100},
+ {OCC_MTU_LOAD, -100},
+ {OCC_MTU_LOAD_REQUEST, -100},
+ {OCC_MTU_LOAD, -100},
+ {OCC_MTU_LOAD_REQUEST, -100},
+ {OCC_MTU_LOAD, -100},
+
+ {OCC_MTU_LOAD_REQUEST, -50},
+ {OCC_MTU_LOAD, -50},
+ {OCC_MTU_LOAD_REQUEST, -50},
+ {OCC_MTU_LOAD, -50},
+ {OCC_MTU_LOAD_REQUEST, -50},
+ {OCC_MTU_LOAD, -50},
+
+ {OCC_MTU_LOAD_REQUEST, 0},
+ {OCC_MTU_LOAD, 0},
+ {OCC_MTU_LOAD_REQUEST, 0},
+ {OCC_MTU_LOAD, 0},
+ {OCC_MTU_LOAD_REQUEST, 0},
+ {OCC_MTU_LOAD, 0},
+
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+ {OCC_MTU_REQUEST, 0},
+
+ {-1, 0}
+};
+
+void
+check_send_occ_req_dowork (struct context *c)
+{
+ if (++c->c2.occ_n_tries >= OCC_N_TRIES)
+ {
+ if (c->options.ce.remote)
+ /*
+ * No OCC_REPLY from peer after repeated attempts.
+ * Give up.
+ */
+ msg (D_SHOW_OCC,
+ "NOTE: failed to obtain options consistency info from peer -- "
+ "this could occur if the remote peer is running a version of "
+ PACKAGE_NAME
+ " before 1.5-beta8 or if there is a network connectivity problem, and will not necessarily prevent "
+ PACKAGE_NAME
+ " from running (" counter_format " bytes received from peer, " counter_format
+ " bytes authenticated data channel traffic) -- you can disable the options consistency "
+ "check with --disable-occ.",
+ c->c2.link_read_bytes,
+ c->c2.link_read_bytes_auth);
+ event_timeout_clear (&c->c2.occ_interval);
+ }
+ else
+ {
+ c->c2.occ_op = OCC_REQUEST;
+
+ /*
+ * If we don't hear back from peer, send another
+ * OCC_REQUEST in OCC_INTERVAL_SECONDS.
+ */
+ event_timeout_reset (&c->c2.occ_interval);
+ }
+}
+
+void
+check_send_occ_load_test_dowork (struct context *c)
+{
+ if (CONNECTION_ESTABLISHED (c))
+ {
+ const struct mtu_load_test *entry;
+
+ if (!c->c2.occ_mtu_load_n_tries)
+ msg (M_INFO,
+ "NOTE: Beginning empirical MTU test -- results should be available in 3 to 4 minutes.");
+
+ entry = &mtu_load_test_sequence[c->c2.occ_mtu_load_n_tries++];
+ if (entry->op >= 0)
+ {
+ c->c2.occ_op = entry->op;
+ c->c2.occ_mtu_load_size =
+ EXPANDED_SIZE (&c->c2.frame) + entry->delta;
+ }
+ else
+ {
+ msg (M_INFO,
+ "NOTE: failed to empirically measure MTU (requires " PACKAGE_NAME " 1.5 or higher at other end of connection).");
+ event_timeout_clear (&c->c2.occ_mtu_load_test_interval);
+ c->c2.occ_mtu_load_n_tries = 0;
+ }
+ }
+}
+
+void
+check_send_occ_msg_dowork (struct context *c)
+{
+ bool doit = false;
+
+ c->c2.buf = c->c2.buffers->aux_buf;
+ ASSERT (buf_init (&c->c2.buf, FRAME_HEADROOM (&c->c2.frame)));
+ ASSERT (buf_safe (&c->c2.buf, MAX_RW_SIZE_TUN (&c->c2.frame)));
+ ASSERT (buf_write (&c->c2.buf, occ_magic, OCC_STRING_SIZE));
+
+ switch (c->c2.occ_op)
+ {
+ case OCC_REQUEST:
+ if (!buf_write_u8 (&c->c2.buf, OCC_REQUEST))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_REQUEST");
+ doit = true;
+ break;
+
+ case OCC_REPLY:
+ if (!c->c2.options_string_local)
+ break;
+ if (!buf_write_u8 (&c->c2.buf, OCC_REPLY))
+ break;
+ if (!buf_write (&c->c2.buf, c->c2.options_string_local,
+ strlen (c->c2.options_string_local) + 1))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_REPLY");
+ doit = true;
+ break;
+
+ case OCC_MTU_REQUEST:
+ if (!buf_write_u8 (&c->c2.buf, OCC_MTU_REQUEST))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_MTU_REQUEST");
+ doit = true;
+ break;
+
+ case OCC_MTU_REPLY:
+ if (!buf_write_u8 (&c->c2.buf, OCC_MTU_REPLY))
+ break;
+ if (!buf_write_u16 (&c->c2.buf, c->c2.max_recv_size_local))
+ break;
+ if (!buf_write_u16 (&c->c2.buf, c->c2.max_send_size_local))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_MTU_REPLY");
+ doit = true;
+ break;
+
+ case OCC_MTU_LOAD_REQUEST:
+ if (!buf_write_u8 (&c->c2.buf, OCC_MTU_LOAD_REQUEST))
+ break;
+ if (!buf_write_u16 (&c->c2.buf, c->c2.occ_mtu_load_size))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_MTU_LOAD_REQUEST");
+ doit = true;
+ break;
+
+ case OCC_MTU_LOAD:
+ {
+ int need_to_add;
+
+ if (!buf_write_u8 (&c->c2.buf, OCC_MTU_LOAD))
+ break;
+ need_to_add = min_int (c->c2.occ_mtu_load_size, EXPANDED_SIZE (&c->c2.frame))
+ - OCC_STRING_SIZE
+ - sizeof (uint8_t)
+ - EXTRA_FRAME (&c->c2.frame);
+
+ while (need_to_add > 0)
+ {
+ /*
+ * Fill the load test packet with pseudo-random bytes.
+ */
+ if (!buf_write_u8 (&c->c2.buf, get_random () & 0xFF))
+ break;
+ --need_to_add;
+ }
+ dmsg (D_PACKET_CONTENT, "SENT OCC_MTU_LOAD min_int(%d-%d-%d-%d,%d) size=%d",
+ c->c2.occ_mtu_load_size,
+ OCC_STRING_SIZE,
+ (int) sizeof (uint8_t),
+ EXTRA_FRAME (&c->c2.frame),
+ MAX_RW_SIZE_TUN (&c->c2.frame),
+ BLEN (&c->c2.buf));
+ doit = true;
+ }
+ break;
+
+ case OCC_EXIT:
+ if (!buf_write_u8 (&c->c2.buf, OCC_EXIT))
+ break;
+ dmsg (D_PACKET_CONTENT, "SENT OCC_EXIT");
+ doit = true;
+ break;
+ }
+
+ if (doit)
+ {
+ /*
+ * We will treat the packet like any other outgoing packet,
+ * compress, encrypt, sign, etc.
+ */
+ encrypt_sign (c, true);
+ }
+
+ c->c2.occ_op = -1;
+}
+
+void
+process_received_occ_msg (struct context *c)
+{
+ ASSERT (buf_advance (&c->c2.buf, OCC_STRING_SIZE));
+ switch (buf_read_u8 (&c->c2.buf))
+ {
+ case OCC_REQUEST:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_REQUEST");
+ c->c2.occ_op = OCC_REPLY;
+ break;
+
+ case OCC_MTU_REQUEST:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_MTU_REQUEST");
+ c->c2.occ_op = OCC_MTU_REPLY;
+ break;
+
+ case OCC_MTU_LOAD_REQUEST:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_MTU_LOAD_REQUEST");
+ c->c2.occ_mtu_load_size = buf_read_u16 (&c->c2.buf);
+ if (c->c2.occ_mtu_load_size >= 0)
+ c->c2.occ_op = OCC_MTU_LOAD;
+ break;
+
+ case OCC_REPLY:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_REPLY");
+ if (c->options.occ && !TLS_MODE (c) && c->c2.options_string_remote)
+ {
+ if (!options_cmp_equal_safe ((char *) BPTR (&c->c2.buf),
+ c->c2.options_string_remote,
+ c->c2.buf.len))
+ {
+ options_warning_safe ((char *) BPTR (&c->c2.buf),
+ c->c2.options_string_remote,
+ c->c2.buf.len);
+ }
+ }
+ event_timeout_clear (&c->c2.occ_interval);
+ break;
+
+ case OCC_MTU_REPLY:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_MTU_REPLY");
+ c->c2.max_recv_size_remote = buf_read_u16 (&c->c2.buf);
+ c->c2.max_send_size_remote = buf_read_u16 (&c->c2.buf);
+ if (c->options.mtu_test
+ && c->c2.max_recv_size_remote > 0
+ && c->c2.max_send_size_remote > 0)
+ {
+ msg (M_INFO, "NOTE: Empirical MTU test completed [Tried,Actual] local->remote=[%d,%d] remote->local=[%d,%d]",
+ c->c2.max_send_size_local,
+ c->c2.max_recv_size_remote,
+ c->c2.max_send_size_remote,
+ c->c2.max_recv_size_local);
+ if (!c->options.ce.fragment
+ && (proto_is_dgram(c->options.ce.proto))
+ && c->c2.max_send_size_local > TUN_MTU_MIN
+ && (c->c2.max_recv_size_remote < c->c2.max_send_size_local
+ || c->c2.max_recv_size_local < c->c2.max_send_size_remote))
+ msg (M_INFO, "NOTE: This connection is unable to accomodate a UDP packet size of %d. Consider using --fragment or --mssfix options as a workaround.",
+ c->c2.max_send_size_local);
+ }
+ event_timeout_clear (&c->c2.occ_mtu_load_test_interval);
+ break;
+
+ case OCC_EXIT:
+ dmsg (D_PACKET_CONTENT, "RECEIVED OCC_EXIT");
+ c->sig->signal_received = SIGTERM;
+ c->sig->signal_text = "remote-exit";
+ break;
+ }
+ c->c2.buf.len = 0; /* don't pass packet on */
+}
+
+#else
+static void dummy(void) {}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.h
new file mode 100644
index 00000000..5d88cc9e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/occ.h
@@ -0,0 +1,95 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OCC_H
+#define OCC_H
+
+#ifdef ENABLE_OCC
+
+#include "forward.h"
+
+/* OCC_STRING_SIZE must be set to sizeof (occ_magic) */
+#define OCC_STRING_SIZE 16
+
+/*
+ * OCC (OpenVPN Configuration Control) protocol opcodes.
+ */
+
+#define OCC_REQUEST 0 /* request options string from peer */
+#define OCC_REPLY 1 /* deliver options string to peer */
+
+/*
+ * Send an OCC_REQUEST once every OCC_INTERVAL
+ * seconds until a reply is received.
+ *
+ * If we haven't received a reply after
+ * OCC_N_TRIES, give up.
+ */
+#define OCC_INTERVAL_SECONDS 10
+#define OCC_N_TRIES 12
+
+/*
+ * Other OCC protocol opcodes used to estimate the MTU empirically.
+ */
+#define OCC_MTU_LOAD_REQUEST 2 /* Ask peer to send a big packet to us */
+#define OCC_MTU_LOAD 3 /* Send a big packet to peer */
+#define OCC_MTU_REQUEST 4 /* Ask peer to tell us the largest
+ packet it has received from us so far */
+#define OCC_MTU_REPLY 5 /* Send largest packet size to peer */
+
+/*
+ * Process one command from mtu_load_test_sequence
+ * once every n seconds, if --mtu-test is specified.
+ */
+#define OCC_MTU_LOAD_INTERVAL_SECONDS 3
+
+/*
+ * Send an exit message to remote.
+ */
+#define OCC_EXIT 6
+
+/*
+ * Used to conduct a load test command sequence
+ * of UDP connection for empirical MTU measurement.
+ */
+struct mtu_load_test
+{
+ int op; /* OCC opcode to send to peer */
+ int delta; /* determine packet size to send by using
+ this delta against currently
+ configured MTU */
+};
+
+extern const uint8_t occ_magic[];
+
+static inline bool
+is_occ_msg (const struct buffer* buf)
+{
+ return buf_string_match_head (buf, occ_magic, OCC_STRING_SIZE);
+}
+
+void process_received_occ_msg (struct context *c);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.c
new file mode 100644
index 00000000..94d0167e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.c
@@ -0,0 +1,335 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "init.h"
+#include "forward.h"
+#include "multi.h"
+#include "win32.h"
+
+#include "memdbg.h"
+
+#include "forward-inline.h"
+
+#define P2P_CHECK_SIG() EVENT_LOOP_CHECK_SIGNAL (c, process_signal_p2p, c);
+
+#ifdef GOOGLE_BREAKPAD
+#include "breakpad.h"
+#endif
+
+static bool
+process_signal_p2p (struct context *c)
+{
+ remap_signal (c);
+ return process_signal (c);
+}
+
+
+
+/**************************************************************************/
+/**
+ * Main event loop for OpenVPN in client mode, where only one VPN tunnel
+ * is active.
+ * @ingroup eventloop
+ *
+ * @param c - The context structure of the single active VPN tunnel.
+ */
+static void
+tunnel_point_to_point (struct context *c)
+{
+ context_clear_2 (c);
+
+ /* set point-to-point mode */
+ c->mode = CM_P2P;
+
+ /* initialize tunnel instance */
+ init_instance_handle_signals (c, c->es, CC_HARD_USR1_TO_HUP);
+ if (IS_SIG (c))
+ return;
+
+ /* main event loop */
+ while (true)
+ {
+ perf_push (PERF_EVENT_LOOP);
+
+ /* process timers, TLS, etc. */
+ pre_select (c);
+ P2P_CHECK_SIG();
+
+ /* set up and do the I/O wait */
+ io_wait (c, p2p_iow_flags (c));
+ P2P_CHECK_SIG();
+
+ /* timeout? */
+ if (c->c2.event_set_status == ES_TIMEOUT)
+ {
+ perf_pop ();
+ continue;
+ }
+
+ /* process the I/O which triggered select */
+ process_io (c);
+ P2P_CHECK_SIG();
+
+ perf_pop ();
+ }
+
+ uninit_management_callback ();
+
+ /* tear down tunnel instance (unless --persist-tun) */
+ close_instance (c);
+}
+
+#undef PROCESS_SIGNAL_P2P
+
+
+/**************************************************************************/
+/**
+ * OpenVPN's main init-run-cleanup loop.
+ * @ingroup eventloop
+ *
+ * This function contains the two outer OpenVPN loops. Its structure is
+ * as follows:
+ * - Once-per-process initialization.
+ * - Outer loop, run at startup and then once per \c SIGHUP:
+ * - Level 1 initialization
+ * - Inner loop, run at startup and then once per \c SIGUSR1:
+ * - Call event loop function depending on client or server mode:
+ * - \c tunnel_point_to_point()
+ * - \c tunnel_server()
+ * - Level 1 cleanup
+ * - Once-per-process cleanup.
+ *
+ * @param argc - Commandline argument count.
+ * @param argv - Commandline argument values.
+ */
+static
+int
+openvpn_main (int argc, char *argv[])
+{
+ struct context c;
+
+#if PEDANTIC
+ fprintf (stderr, "Sorry, I was built with --enable-pedantic and I am incapable of doing any real work!\n");
+ return 1;
+#endif
+
+#ifdef WIN32
+ SetConsoleOutputCP (CP_UTF8);
+#endif
+
+ CLEAR (c);
+
+ /* signify first time for components which can
+ only be initialized once per program instantiation. */
+ c.first_time = true;
+
+ /* initialize program-wide statics */
+ if (init_static ())
+ {
+ /*
+ * This loop is initially executed on startup and then
+ * once per SIGHUP.
+ */
+ do
+ {
+ /* enter pre-initialization mode with regard to signal handling */
+ pre_init_signal_catch ();
+
+ /* zero context struct but leave first_time member alone */
+ context_clear_all_except_first_time (&c);
+
+ /* static signal info object */
+ CLEAR (siginfo_static);
+ c.sig = &siginfo_static;
+
+ /* initialize garbage collector scoped to context object */
+ gc_init (&c.gc);
+
+ /* initialize environmental variable store */
+ c.es = env_set_create (NULL);
+#ifdef WIN32
+ set_win_sys_path_via_env (c.es);
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ /* initialize management subsystem */
+ init_management (&c);
+#endif
+
+ /* initialize options to default state */
+ init_options (&c.options, true);
+
+ /* parse command line options, and read configuration file */
+ parse_argv (&c.options, argc, argv, M_USAGE, OPT_P_DEFAULT, NULL, c.es);
+
+#ifdef ENABLE_PLUGIN
+ /* plugins may contribute options configuration */
+ init_verb_mute (&c, IVM_LEVEL_1);
+ init_plugins (&c);
+ open_plugins (&c, true, OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE);
+#endif
+
+ /* init verbosity and mute levels */
+ init_verb_mute (&c, IVM_LEVEL_1);
+
+ /* set dev options */
+ init_options_dev (&c.options);
+
+ /* openssl print info? */
+ if (print_openssl_info (&c.options))
+ break;
+
+ /* --genkey mode? */
+ if (do_genkey (&c.options))
+ break;
+
+ /* tun/tap persist command? */
+ if (do_persist_tuntap (&c.options))
+ break;
+
+ /* sanity check on options */
+ options_postprocess (&c.options);
+
+ /* show all option settings */
+ show_settings (&c.options);
+
+ /* print version number */
+ msg (M_INFO, "%s", title_string);
+ show_library_versions(M_INFO);
+
+ /* misc stuff */
+ pre_setup (&c.options);
+
+ /* test crypto? */
+ if (do_test_crypto (&c.options))
+ break;
+
+#ifdef ENABLE_MANAGEMENT
+ /* open management subsystem */
+ if (!open_management (&c))
+ break;
+#endif
+
+ /* set certain options as environmental variables */
+ setenv_settings (c.es, &c.options);
+
+ /* finish context init */
+ context_init_1 (&c);
+
+ do
+ {
+ /* run tunnel depending on mode */
+ switch (c.options.mode)
+ {
+ case MODE_POINT_TO_POINT:
+ tunnel_point_to_point (&c);
+ break;
+#if P2MP_SERVER
+ case MODE_SERVER:
+ tunnel_server (&c);
+ break;
+#endif
+ default:
+ ASSERT (0);
+ }
+
+ /* indicates first iteration -- has program-wide scope */
+ c.first_time = false;
+
+ /* any signals received? */
+ if (IS_SIG (&c))
+ print_signal (c.sig, NULL, M_INFO);
+
+ /* pass restart status to management subsystem */
+ signal_restart_status (c.sig);
+ }
+ while (c.sig->signal_received == SIGUSR1);
+
+ uninit_options (&c.options);
+ gc_reset (&c.gc);
+ }
+ while (c.sig->signal_received == SIGHUP);
+ }
+
+ context_gc_free (&c);
+
+ env_set_destroy (c.es);
+
+#ifdef ENABLE_MANAGEMENT
+ /* close management interface */
+ close_management ();
+#endif
+
+ /* uninitialize program-wide statics */
+ uninit_static ();
+
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ return 0; /* NOTREACHED */
+}
+
+#ifdef WIN32
+int
+wmain (int argc, wchar_t *wargv[]) {
+ char **argv;
+ int ret;
+ int i;
+
+ if ((argv = calloc(argc+1, sizeof(char*))) == NULL)
+ return 1;
+
+ for (i = 0; i < argc; i++)
+ {
+ int n = WideCharToMultiByte (CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL);
+ argv[i] = malloc (n);
+ WideCharToMultiByte (CP_UTF8, 0, wargv[i], -1, argv[i], n, NULL, NULL);
+ }
+
+ ret = openvpn_main(argc, argv);
+
+ for (i=0; i < argc; i++ )
+ {
+ free (argv[i]);
+ }
+ free(argv);
+
+ return ret;
+}
+#else
+int
+main (int argc, char *argv[]) {
+#ifdef GOOGLE_BREAKPAD
+ breakpad_setup();
+#endif
+
+ return openvpn_main(argc, argv);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.h
new file mode 100644
index 00000000..eab8cd5b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.h
@@ -0,0 +1,592 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_H
+#define OPENVPN_H
+
+#include "buffer.h"
+#include "options.h"
+#include "socket.h"
+#include "crypto.h"
+#include "ssl.h"
+#include "packet_id.h"
+#include "comp.h"
+#include "tun.h"
+#include "interval.h"
+#include "status.h"
+#include "fragment.h"
+#include "shaper.h"
+#include "route.h"
+#include "proxy.h"
+#include "socks.h"
+#include "sig.h"
+#include "misc.h"
+#include "mbuf.h"
+#include "pool.h"
+#include "plugin.h"
+#include "manage.h"
+#include "pf.h"
+
+/*
+ * Our global key schedules, packaged thusly
+ * to facilitate --persist-key.
+ */
+
+struct key_schedule
+{
+#ifdef ENABLE_CRYPTO
+ /* which cipher, HMAC digest, and key sizes are we using? */
+ struct key_type key_type;
+
+ /* pre-shared static key, read from a file */
+ struct key_ctx_bi static_key;
+
+#ifdef ENABLE_SSL
+ /* our global SSL context */
+ struct tls_root_ctx ssl_ctx;
+
+ /* optional authentication HMAC key for TLS control channel */
+ struct key_ctx_bi tls_auth_key;
+
+#endif /* ENABLE_SSL */
+#else /* ENABLE_CRYPTO */
+ int dummy;
+#endif /* ENABLE_CRYPTO */
+};
+
+/*
+ * struct packet_id_persist should be empty if we are not
+ * building with crypto.
+ */
+#ifndef PACKET_ID_H
+struct packet_id_persist
+{
+ int dummy;
+};
+static inline void
+packet_id_persist_init (struct packet_id_persist *p)
+{
+}
+#endif
+
+/*
+ * Packet processing buffers.
+ */
+struct context_buffers
+{
+ /* miscellaneous buffer, used by ping, occ, etc. */
+ struct buffer aux_buf;
+
+ /* workspace buffers used by crypto routines */
+#ifdef ENABLE_CRYPTO
+ struct buffer encrypt_buf;
+ struct buffer decrypt_buf;
+#endif
+
+ /* workspace buffers for compression */
+#ifdef USE_COMP
+ struct buffer compress_buf;
+ struct buffer decompress_buf;
+#endif
+
+ /*
+ * Buffers used to read from TUN device
+ * and TCP/UDP port.
+ */
+ struct buffer read_link_buf;
+ struct buffer read_tun_buf;
+};
+
+/*
+ * always-persistent context variables
+ */
+struct context_persist
+{
+ int restart_sleep_seconds;
+};
+
+
+/**************************************************************************/
+/**
+ * Level 0 %context containing information related to the OpenVPN process.
+ *
+ * Level 0 state is initialized once at program startup, and then remains
+ * throughout the lifetime of the OpenVPN process. This structure
+ * contains information related to the process's PID, user, and group.
+ */
+struct context_0
+{
+ /* workspace for get_pid_file/write_pid */
+ struct pid_state pid_state;
+
+ /* workspace for --user/--group */
+ bool uid_gid_specified;
+ bool uid_gid_set;
+ struct platform_state_user platform_state_user;
+ struct platform_state_group platform_state_group;
+};
+
+
+/**
+ * Level 1 %context containing state that persists across \c SIGUSR1
+ * restarts.
+ *
+ * Level 1 state is reset on \c SIGHUP restarts. This structure is
+ * initialized for every iteration of the \c main() function's outer \c
+ * SIGHUP loop, but persists over iteration of that function's inner \c
+ * SIGUSR1 loop.
+ */
+struct context_1
+{
+ struct link_socket_addr link_socket_addr;
+ /**< Local and remote addresses on the
+ * external network. */
+
+ /* tunnel session keys */
+ struct key_schedule ks;
+
+ /* preresolved and cached host names */
+ struct cached_dns_entry *dns_cache;
+
+ /* persist crypto sequence number to/from file */
+ struct packet_id_persist pid_persist;
+
+ struct tuntap *tuntap; /**< Tun/tap virtual network interface. */
+ bool tuntap_owned; /**< Whether the tun/tap interface should
+ * be cleaned up when this %context is
+ * cleaned up. */
+
+ struct route_list *route_list;
+ /**< List of routing information. See the
+ * \c --route command line option. */
+
+ /* list of --route-ipv6 directives */
+ struct route_ipv6_list *route_ipv6_list;
+
+ /* --status file */
+ struct status_output *status_output;
+ bool status_output_owned;
+
+ /* HTTP proxy object */
+ struct http_proxy_info *http_proxy;
+ bool http_proxy_owned;
+
+ /* SOCKS proxy object */
+ struct socks_proxy_info *socks_proxy;
+ bool socks_proxy_owned;
+
+#if P2MP
+
+#if P2MP_SERVER
+ /* persist --ifconfig-pool db to file */
+ struct ifconfig_pool_persist *ifconfig_pool_persist;
+ bool ifconfig_pool_persist_owned;
+#endif
+
+ /* if client mode, hash of option strings we pulled from server */
+ struct md5_digest pulled_options_digest_save;
+ /**< Hash of option strings received from the
+ * remote OpenVPN server. Only used in
+ * client-mode. */
+
+ struct user_pass *auth_user_pass;
+ /**< Username and password for
+ * authentication. */
+#endif
+};
+
+/**
+ * Level 2 %context containing state that is reset on both \c SIGHUP and
+ * \c SIGUSR1 restarts.
+ *
+ * This structure is initialized at the top of the \c
+ * tunnel_point_to_point(), \c tunnel_server_udp_single_threaded(), and \c
+ * tunnel_server_tcp() functions. In other words, it is reset for every
+ * iteration of the \c main() function's inner \c SIGUSR1 loop.
+ */
+struct context_2
+{
+ struct gc_arena gc; /**< Garbage collection arena for
+ * allocations done in the level 2 scope
+ * of this context_2 structure. */
+
+ /* our global wait events */
+ struct event_set *event_set;
+ int event_set_max;
+ bool event_set_owned;
+
+ /* event flags returned by io_wait */
+# define SOCKET_READ (1<<0)
+# define SOCKET_WRITE (1<<1)
+# define TUN_READ (1<<2)
+# define TUN_WRITE (1<<3)
+# define ES_ERROR (1<<4)
+# define ES_TIMEOUT (1<<5)
+# ifdef ENABLE_MANAGEMENT
+# define MANAGEMENT_READ (1<<6)
+# define MANAGEMENT_WRITE (1<<7)
+# endif
+
+ unsigned int event_set_status;
+
+ struct link_socket *link_socket; /* socket used for TCP/UDP connection to remote */
+ bool link_socket_owned;
+ struct link_socket_info *link_socket_info;
+ const struct link_socket *accept_from; /* possibly do accept() on a parent link_socket */
+
+ struct link_socket_actual *to_link_addr; /* IP address of remote */
+ struct link_socket_actual from; /* address of incoming datagram */
+
+ /* MTU frame parameters */
+ struct frame frame;
+
+#ifdef ENABLE_FRAGMENT
+ /* Object to handle advanced MTU negotiation and datagram fragmentation */
+ struct fragment_master *fragment;
+ struct frame frame_fragment;
+ struct frame frame_fragment_omit;
+#endif
+
+#ifdef ENABLE_FEATURE_SHAPER
+ /*
+ * Traffic shaper object.
+ */
+ struct shaper shaper;
+#endif
+
+ /*
+ * Statistics
+ */
+ counter_type tun_read_bytes;
+ counter_type tun_write_bytes;
+ counter_type link_read_bytes;
+ counter_type link_read_bytes_auth;
+ counter_type link_write_bytes;
+#ifdef PACKET_TRUNCATION_CHECK
+ counter_type n_trunc_tun_read;
+ counter_type n_trunc_tun_write;
+ counter_type n_trunc_pre_encrypt;
+ counter_type n_trunc_post_decrypt;
+#endif
+
+ /*
+ * Timer objects for ping and inactivity
+ * timeout features.
+ */
+ struct event_timeout wait_for_connect;
+ struct event_timeout ping_send_interval;
+ struct event_timeout ping_rec_interval;
+
+ /* --inactive */
+ struct event_timeout inactivity_interval;
+ int inactivity_bytes;
+
+#ifdef ENABLE_OCC
+ /* the option strings must match across peers */
+ char *options_string_local;
+ char *options_string_remote;
+
+ int occ_op; /* INIT to -1 */
+ int occ_n_tries;
+ struct event_timeout occ_interval;
+#endif
+
+ /*
+ * Keep track of maximum packet size received so far
+ * (of authenticated packets).
+ */
+ int original_recv_size; /* temporary */
+ int max_recv_size_local; /* max packet size received */
+ int max_recv_size_remote; /* max packet size received by remote */
+ int max_send_size_local; /* max packet size sent */
+ int max_send_size_remote; /* max packet size sent by remote */
+
+#ifdef ENABLE_OCC
+ /* remote wants us to send back a load test packet of this size */
+ int occ_mtu_load_size;
+
+ struct event_timeout occ_mtu_load_test_interval;
+ int occ_mtu_load_n_tries;
+#endif
+
+#ifdef ENABLE_CRYPTO
+
+ /*
+ * TLS-mode crypto objects.
+ */
+#ifdef ENABLE_SSL
+
+ struct tls_multi *tls_multi; /**< TLS state structure for this VPN
+ * tunnel. */
+
+ struct tls_auth_standalone *tls_auth_standalone;
+ /**< TLS state structure required for the
+ * initial authentication of a client's
+ * connection attempt. This structure
+ * is used by the \c
+ * tls_pre_decrypt_lite() function when
+ * it performs the HMAC firewall check
+ * on the first connection packet
+ * received from a new client. See the
+ * \c --tls-auth commandline option. */
+
+ /* used to optimize calls to tls_multi_process */
+ struct interval tmp_int;
+
+ /* throw this signal on TLS errors */
+ int tls_exit_signal;
+
+#endif /* ENABLE_SSL */
+
+ struct crypto_options crypto_options;
+ /**< Security parameters and crypto state
+ * used by the \link data_crypto Data
+ * Channel Crypto module\endlink to
+ * process data channel packet. */
+
+ /* used to keep track of data channel packet sequence numbers */
+ struct packet_id packet_id;
+ struct event_timeout packet_id_persist_interval;
+
+#endif /* ENABLE_CRYPTO */
+
+#ifdef USE_COMP
+ struct compress_context *comp_context;
+ /**< Compression context used by the
+ * \link compression Data Channel
+ * Compression module\endlink. */
+#endif
+
+ /*
+ * Buffers used for packet processing.
+ */
+ struct context_buffers *buffers;
+ bool buffers_owned; /* if true, we should free all buffers on close */
+
+ /*
+ * These buffers don't actually allocate storage, they are used
+ * as pointers to the allocated buffers in
+ * struct context_buffers.
+ */
+ struct buffer buf;
+ struct buffer to_tun;
+ struct buffer to_link;
+
+ /*
+ * IPv4 TUN device?
+ */
+ bool ipv4_tun;
+
+ /* should we print R|W|r|w to console on packet transfers? */
+ bool log_rw;
+
+ /* route stuff */
+ struct event_timeout route_wakeup;
+ struct event_timeout route_wakeup_expire;
+
+ /* did we open tun/tap dev during this cycle? */
+ bool did_open_tun;
+
+ /*
+ * Event loop info
+ */
+
+ /* how long to wait on link/tun read before we will need to be serviced */
+ struct timeval timeval;
+
+ /* next wakeup for processing coarse timers (>1 sec resolution) */
+ time_t coarse_timer_wakeup;
+
+ /* maintain a random delta to add to timeouts to avoid contexts
+ waking up simultaneously */
+ time_t update_timeout_random_component;
+ struct timeval timeout_random_component;
+
+ /* indicates that the do_up_delay function has run */
+ bool do_up_ran;
+
+#ifdef ENABLE_OCC
+ /* indicates that we have received a SIGTERM when
+ options->explicit_exit_notification is enabled,
+ but we have not exited yet */
+ time_t explicit_exit_notification_time_wait;
+ struct event_timeout explicit_exit_notification_interval;
+#endif
+
+ /* environmental variables to pass to scripts */
+ struct env_set *es;
+ bool es_owned;
+
+ /* don't wait for TUN/TAP/UDP to be ready to accept write */
+ bool fast_io;
+
+#if P2MP
+
+#if P2MP_SERVER
+ /* --ifconfig endpoints to be pushed to client */
+ bool push_reply_deferred;
+ bool push_ifconfig_defined;
+ time_t sent_push_reply_expiry;
+ in_addr_t push_ifconfig_local;
+ in_addr_t push_ifconfig_remote_netmask;
+ in_addr_t push_ifconfig_local_alias;
+
+ bool push_ifconfig_ipv6_defined;
+ struct in6_addr push_ifconfig_ipv6_local;
+ int push_ifconfig_ipv6_netbits;
+ struct in6_addr push_ifconfig_ipv6_remote;
+
+ /* client authentication state, CAS_SUCCEEDED must be 0 */
+# define CAS_SUCCEEDED 0
+# define CAS_PENDING 1
+# define CAS_FAILED 2
+# define CAS_PARTIAL 3 /* at least one client-connect script/plugin
+ succeeded while a later one in the chain failed */
+ int context_auth;
+#endif
+
+ struct event_timeout push_request_interval;
+ int n_sent_push_requests;
+ bool did_pre_pull_restore;
+
+ /* hash of pulled options, so we can compare when options change */
+ bool pulled_options_md5_init_done;
+ struct md5_state pulled_options_state;
+ struct md5_digest pulled_options_digest;
+
+ struct event_timeout server_poll_interval;
+
+ struct event_timeout scheduled_exit;
+ int scheduled_exit_signal;
+#endif
+
+ /* packet filter */
+#ifdef ENABLE_PF
+ struct pf_context pf;
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+ struct man_def_auth_context mda_context;
+#endif
+};
+
+
+/**
+ * Contains all state information for one tunnel.
+ *
+ * This structure represents one VPN tunnel. It is used to store state
+ * information related to a VPN tunnel, but also includes process-wide
+ * data, such as configuration options.
+ *
+ * The @ref tunnel_state "Structure of VPN tunnel state storage" related
+ * page describes how this structure is used in client-mode and
+ * server-mode.
+ */
+struct context
+{
+ struct options options; /**< Options loaded from command line or
+ * configuration file. */
+
+ bool first_time; /**< True on the first iteration of
+ * OpenVPN's main loop. */
+
+ /* context modes */
+# define CM_P2P 0 /* standalone point-to-point session or client */
+# define CM_TOP 1 /* top level of a multi-client or point-to-multipoint server */
+# define CM_TOP_CLONE 2 /* clone of a CM_TOP context for one thread */
+# define CM_CHILD_UDP 3 /* child context of a CM_TOP or CM_THREAD */
+# define CM_CHILD_TCP 4 /* child context of a CM_TOP or CM_THREAD */
+ int mode; /**< Role of this context within the
+ * OpenVPN process. Valid values are \c
+ * CM_P2P, \c CM_TOP, \c CM_TOP_CLONE,
+ * \c CM_CHILD_UDP, and \c CM_CHILD_TCP. */
+
+ struct gc_arena gc; /**< Garbage collection arena for
+ * allocations done in the scope of this
+ * context structure. */
+
+ struct env_set *es; /**< Set of environment variables. */
+
+ struct signal_info *sig; /**< Internal error signaling object. */
+
+ struct plugin_list *plugins; /**< List of plug-ins. */
+ bool plugins_owned; /**< Whether the plug-ins should be
+ * cleaned up when this %context is
+ * cleaned up. */
+
+ bool did_we_daemonize; /**< Whether demonization has already
+ * taken place. */
+
+ struct context_persist persist;
+ /**< Persistent %context. */
+ struct context_0 *c0; /**< Level 0 %context. */
+ struct context_1 c1; /**< Level 1 %context. */
+ struct context_2 c2; /**< Level 2 %context. */
+};
+
+/*
+ * Check for a signal when inside an event loop
+ */
+#define EVENT_LOOP_CHECK_SIGNAL(c, func, arg) \
+ if (IS_SIG (c)) \
+ { \
+ const int brk = func (arg); \
+ perf_pop (); \
+ if (brk) \
+ break; \
+ else \
+ continue; \
+ }
+
+/*
+ * Macros for referencing objects which may not
+ * have been compiled in.
+ */
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+#define TLS_MODE(c) ((c)->c2.tls_multi != NULL)
+#define PROTO_DUMP_FLAGS (check_debug_level (D_LINK_RW_VERBOSE) ? (PD_SHOW_DATA|PD_VERBOSE) : 0)
+#define PROTO_DUMP(buf, gc) protocol_dump((buf), \
+ PROTO_DUMP_FLAGS | \
+ (c->c2.tls_multi ? PD_TLS : 0) | \
+ (c->options.tls_auth_file ? c->c1.ks.key_type.hmac_length : 0), \
+ gc)
+#else
+#define TLS_MODE(c) (false)
+#define PROTO_DUMP(buf, gc) format_hex (BPTR (buf), BLEN (buf), 80, gc)
+#endif
+
+#ifdef ENABLE_CRYPTO
+#define MD5SUM(buf, len, gc) md5sum((buf), (len), 0, (gc))
+#else
+#define MD5SUM(buf, len, gc) "[unavailable]"
+#endif
+
+#ifdef ENABLE_CRYPTO
+#define CIPHER_ENABLED(c) (c->c1.ks.key_type.cipher != NULL)
+#else
+#define CIPHER_ENABLED(c) (false)
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj
new file mode 100755
index 00000000..3b2340ee
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}</ProjectGuid>
+ <RootNamespace>openvpn</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <UndefinePreprocessorDefinitions>UNICODE</UndefinePreprocessorDefinitions>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="base64.c" />
+ <ClCompile Include="buffer.c" />
+ <ClCompile Include="clinat.c" />
+ <ClCompile Include="console.c" />
+ <ClCompile Include="crypto.c" />
+ <ClCompile Include="crypto_openssl.c" />
+ <ClCompile Include="cryptoapi.c" />
+ <ClCompile Include="dhcp.c" />
+ <ClCompile Include="error.c" />
+ <ClCompile Include="event.c" />
+ <ClCompile Include="fdmisc.c" />
+ <ClCompile Include="forward.c" />
+ <ClCompile Include="fragment.c" />
+ <ClCompile Include="gremlin.c" />
+ <ClCompile Include="helper.c" />
+ <ClCompile Include="httpdigest.c" />
+ <ClCompile Include="init.c" />
+ <ClCompile Include="interval.c" />
+ <ClCompile Include="list.c" />
+ <ClCompile Include="lladdr.c" />
+ <ClCompile Include="lzo.c" />
+ <ClCompile Include="manage.c" />
+ <ClCompile Include="mbuf.c" />
+ <ClCompile Include="misc.c" />
+ <ClCompile Include="mroute.c" />
+ <ClCompile Include="mss.c" />
+ <ClCompile Include="mstats.c" />
+ <ClCompile Include="mtcp.c" />
+ <ClCompile Include="mtu.c" />
+ <ClCompile Include="mudp.c" />
+ <ClCompile Include="multi.c" />
+ <ClCompile Include="ntlm.c" />
+ <ClCompile Include="occ.c" />
+ <ClCompile Include="openvpn.c" />
+ <ClCompile Include="options.c" />
+ <ClCompile Include="otime.c" />
+ <ClCompile Include="packet_id.c" />
+ <ClCompile Include="perf.c" />
+ <ClCompile Include="pf.c" />
+ <ClCompile Include="ping.c" />
+ <ClCompile Include="pkcs11.c" />
+ <ClCompile Include="pkcs11_openssl.c" />
+ <ClCompile Include="platform.c" />
+ <ClCompile Include="plugin.c" />
+ <ClCompile Include="pool.c" />
+ <ClCompile Include="proto.c" />
+ <ClCompile Include="proxy.c" />
+ <ClCompile Include="ps.c" />
+ <ClCompile Include="push.c" />
+ <ClCompile Include="reliable.c" />
+ <ClCompile Include="route.c" />
+ <ClCompile Include="schedule.c" />
+ <ClCompile Include="session_id.c" />
+ <ClCompile Include="shaper.c" />
+ <ClCompile Include="sig.c" />
+ <ClCompile Include="socket.c" />
+ <ClCompile Include="socks.c" />
+ <ClCompile Include="ssl.c" />
+ <ClCompile Include="ssl_openssl.c" />
+ <ClCompile Include="ssl_verify.c" />
+ <ClCompile Include="ssl_verify_openssl.c" />
+ <ClCompile Include="status.c" />
+ <ClCompile Include="tun.c" />
+ <ClCompile Include="win32.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="base64.h" />
+ <ClInclude Include="basic.h" />
+ <ClInclude Include="buffer.h" />
+ <ClInclude Include="circ_list.h" />
+ <ClInclude Include="clinat.h" />
+ <ClInclude Include="common.h" />
+ <ClInclude Include="console.h" />
+ <ClInclude Include="crypto.h" />
+ <ClInclude Include="crypto_backend.h" />
+ <ClInclude Include="crypto_openssl.h" />
+ <ClInclude Include="cryptoapi.h" />
+ <ClInclude Include="dhcp.h" />
+ <ClInclude Include="errlevel.h" />
+ <ClInclude Include="error.h" />
+ <ClInclude Include="event.h" />
+ <ClInclude Include="fdmisc.h" />
+ <ClInclude Include="forward-inline.h" />
+ <ClInclude Include="forward.h" />
+ <ClInclude Include="fragment.h" />
+ <ClInclude Include="gremlin.h" />
+ <ClInclude Include="helper.h" />
+ <ClInclude Include="httpdigest.h" />
+ <ClInclude Include="init.h" />
+ <ClInclude Include="integer.h" />
+ <ClInclude Include="interval.h" />
+ <ClInclude Include="list.h" />
+ <ClInclude Include="lladdr.h" />
+ <ClInclude Include="lzo.h" />
+ <ClInclude Include="manage.h" />
+ <ClInclude Include="mbuf.h" />
+ <ClInclude Include="memdbg.h" />
+ <ClInclude Include="misc.h" />
+ <ClInclude Include="mroute.h" />
+ <ClInclude Include="mss.h" />
+ <ClInclude Include="mstats.h" />
+ <ClInclude Include="mtcp.h" />
+ <ClInclude Include="mtu.h" />
+ <ClInclude Include="mudp.h" />
+ <ClInclude Include="multi.h" />
+ <ClInclude Include="ntlm.h" />
+ <ClInclude Include="occ-inline.h" />
+ <ClInclude Include="occ.h" />
+ <ClInclude Include="openvpn.h" />
+ <ClInclude Include="options.h" />
+ <ClInclude Include="otime.h" />
+ <ClInclude Include="packet_id.h" />
+ <ClInclude Include="perf.h" />
+ <ClInclude Include="pf-inline.h" />
+ <ClInclude Include="pf.h" />
+ <ClInclude Include="ping-inline.h" />
+ <ClInclude Include="ping.h" />
+ <ClInclude Include="pkcs11.h" />
+ <ClInclude Include="pkcs11_backend.h" />
+ <ClInclude Include="platform.h" />
+ <ClInclude Include="plugin.h" />
+ <ClInclude Include="pool.h" />
+ <ClInclude Include="proto.h" />
+ <ClInclude Include="proxy.h" />
+ <ClInclude Include="ps.h" />
+ <ClInclude Include="push.h" />
+ <ClInclude Include="pushlist.h" />
+ <ClInclude Include="reliable.h" />
+ <ClInclude Include="route.h" />
+ <ClInclude Include="schedule.h" />
+ <ClInclude Include="session_id.h" />
+ <ClInclude Include="shaper.h" />
+ <ClInclude Include="sig.h" />
+ <ClInclude Include="socket.h" />
+ <ClInclude Include="socks.h" />
+ <ClInclude Include="ssl.h" />
+ <ClInclude Include="ssl_backend.h" />
+ <ClInclude Include="ssl_common.h" />
+ <ClInclude Include="ssl_openssl.h" />
+ <ClInclude Include="ssl_verify.h" />
+ <ClInclude Include="ssl_verify_backend.h" />
+ <ClInclude Include="ssl_verify_openssl.h" />
+ <ClInclude Include="status.h" />
+ <ClInclude Include="syshead.h" />
+ <ClInclude Include="tun.h" />
+ <ClInclude Include="win32.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpn_win32_resources.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+ <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\compat\compat.vcxproj">
+ <Project>{4b2e2719-e661-45d7-9203-f6f456b22f19}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj.filters b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj.filters
new file mode 100644
index 00000000..40336ba8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn.vcxproj.filters
@@ -0,0 +1,458 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="base64.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="buffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="clinat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="console.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="crypto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="crypto_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="cryptoapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dhcp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="error.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="event.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="fdmisc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="forward.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="fragment.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="gremlin.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="helper.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="httpdigest.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="init.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="interval.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="list.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lladdr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lzo.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="manage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mbuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="misc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mroute.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mss.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mstats.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mtcp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mtu.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mudp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="multi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ntlm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="occ.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="openvpn.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="options.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="otime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="packet_id.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="perf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ping.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pkcs11.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pkcs11_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="platform.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="plugin.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="pool.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="proto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="proxy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ps.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="push.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="reliable.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="route.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="schedule.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="session_id.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="shaper.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="sig.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="socket.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="socks.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_verify.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ssl_verify_openssl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="status.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="tun.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="win32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="base64.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="basic.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="buffer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="circ_list.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="clinat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="console.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="crypto_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="cryptoapi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="dhcp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="errlevel.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="error.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="event.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="fdmisc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="forward-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="forward.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="fragment.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="gremlin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="helper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="httpdigest.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="init.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="integer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="interval.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="list.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="lladdr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="lzo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="manage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="memdbg.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="misc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mroute.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mss.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mstats.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mtcp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mtu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mudp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="multi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ntlm.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="occ-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="occ.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="openvpn.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="options.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="otime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="packet_id.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="perf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pf-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ping-inline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ping.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pkcs11.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pkcs11_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="platform.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="plugin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="proxy.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ps.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="push.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="pushlist.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="reliable.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="route.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="schedule.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="session_id.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="shaper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="sig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="socket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="socks.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify_backend.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ssl_verify_openssl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="status.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="syshead.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="tun.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="win32.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpn_win32_resources.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn_win32_resources.rc b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn_win32_resources.rc
new file mode 100644
index 00000000..d092e21a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/openvpn_win32_resources.rc
@@ -0,0 +1,43 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#include <config-msvc-version.h>
+#endif
+#include <winresrc.h>
+
+#pragma code_page(65001) /* UTF8 */
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION OPENVPN_VERSION_RESOURCE
+ PRODUCTVERSION OPENVPN_VERSION_RESOURCE
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "The OpenVPN Project"
+ VALUE "FileDescription", "OpenVPN Daemon"
+ VALUE "FileVersion", PACKAGE_VERSION ".0"
+ VALUE "InternalName", "OpenVPN"
+ VALUE "LegalCopyright", "Copyright © The OpenVPN Project"
+ VALUE "OriginalFilename", "openvpn.exe"
+ VALUE "ProductName", "OpenVPN"
+ VALUE "ProductVersion", PACKAGE_VERSION ".0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/options.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/options.c
new file mode 100644
index 00000000..9ff2db5a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/options.c
@@ -0,0 +1,7010 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2013 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2008-2013 David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * 2004-01-28: Added Socks5 proxy support
+ * (Christof Meerwald, http://cmeerw.org)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+#ifdef HAVE_CONFIG_VERSION_H
+#include "config-version.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "common.h"
+#include "shaper.h"
+#include "crypto.h"
+#include "ssl.h"
+#include "options.h"
+#include "misc.h"
+#include "socket.h"
+#include "packet_id.h"
+#include "pkcs11.h"
+#include "win32.h"
+#include "push.h"
+#include "pool.h"
+#include "helper.h"
+#include "manage.h"
+#include "forward.h"
+#include "ssl_verify.h"
+#include <ctype.h>
+
+#include "memdbg.h"
+
+const char title_string[] =
+ PACKAGE_STRING
+#ifdef CONFIGURE_GIT_REVISION
+ " [git:" CONFIGURE_GIT_REVISION CONFIGURE_GIT_FLAGS "]"
+#endif
+ " " TARGET_ALIAS
+#ifdef ENABLE_CRYPTO
+#ifdef ENABLE_SSL
+#if defined(ENABLE_CRYPTO_POLARSSL)
+ " [SSL (PolarSSL)]"
+#elif defined(ENABLE_CRYPTO_OPENSSL)
+ " [SSL (OpenSSL)]"
+#else
+ " [SSL]"
+#endif /* defined(ENABLE_CRYPTO_POLARSSL) */
+#else /* ! ENABLE_SSL */
+#if defined(ENABLE_CRYPTO_POLARSSL)
+ " [CRYPTO (PolarSSL)]"
+#elif defined(ENABLE_CRYPTO_OPENSSL)
+ " [CRYPTO (OpenSSL)]"
+#else
+ " [CRYPTO]"
+#endif /* defined(ENABLE_CRYPTO_POLARSSL) */
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+#ifdef USE_COMP
+#ifdef ENABLE_LZO
+ " [LZO]"
+#endif
+#ifdef ENABLE_SNAPPY
+ " [SNAPPY]"
+#endif
+#ifdef ENABLE_LZ4
+ " [LZ4]"
+#endif
+#ifdef ENABLE_COMP_STUB
+ " [COMP_STUB]"
+#endif
+#endif /* USE_COMP */
+#if EPOLL
+ " [EPOLL]"
+#endif
+#ifdef PRODUCT_TAP_DEBUG
+ " [TAPDBG]"
+#endif
+#ifdef ENABLE_PKCS11
+ " [PKCS11]"
+#endif
+#if ENABLE_IP_PKTINFO
+ " [MH]"
+#endif
+ " [IPv6]"
+ " built on " __DATE__
+;
+
+#ifndef ENABLE_SMALL
+
+static const char usage_message[] =
+ "%s\n"
+ "\n"
+ "General Options:\n"
+ "--config file : Read configuration options from file.\n"
+ "--help : Show options.\n"
+ "--version : Show copyright and version information.\n"
+ "\n"
+ "Tunnel Options:\n"
+ "--local host : Local host name or ip address. Implies --bind.\n"
+ "--remote host [port] : Remote host name or ip address.\n"
+ "--remote-random : If multiple --remote options specified, choose one randomly.\n"
+ "--remote-random-hostname : Add a random string to remote DNS name.\n"
+ "--mode m : Major mode, m = 'p2p' (default, point-to-point) or 'server'.\n"
+ "--proto p : Use protocol p for communicating with peer.\n"
+ " p = udp (default), tcp-server, or tcp-client\n"
+ "--proto-force p : only consider protocol p in list of connection profiles.\n"
+ " p = udp6, tcp6-server, or tcp6-client (ipv6)\n"
+ "--connect-retry n : For --proto tcp-client, number of seconds to wait\n"
+ " between connection retries (default=%d).\n"
+ "--connect-timeout n : For --proto tcp-client, connection timeout (in seconds).\n"
+ "--connect-retry-max n : Maximum connection attempt retries, default infinite.\n"
+ "--http-proxy s p [up] [auth] : Connect to remote host\n"
+ " through an HTTP proxy at address s and port p.\n"
+ " If proxy authentication is required,\n"
+ " up is a file containing username/password on 2 lines, or\n"
+ " 'stdin' to prompt from console. Add auth='ntlm' if\n"
+ " the proxy requires NTLM authentication.\n"
+ "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n"
+ " determine auth method and query for username/password\n"
+ " if needed. auto-nct disables weak proxy auth methods.\n"
+ "--http-proxy-retry : Retry indefinitely on HTTP proxy errors.\n"
+ "--http-proxy-timeout n : Proxy timeout in seconds, default=5.\n"
+ "--http-proxy-option type [parm] : Set extended HTTP proxy options.\n"
+ " Repeat to set multiple options.\n"
+ " VERSION version (default=1.0)\n"
+ " AGENT user-agent\n"
+ "--socks-proxy s [p] [up] : Connect to remote host through a Socks5 proxy at\n"
+ " address s and port p (default port = 1080).\n"
+ " If proxy authentication is required,\n"
+ " up is a file containing username/password on 2 lines, or\n"
+ " 'stdin' to prompt for console.\n"
+ "--socks-proxy-retry : Retry indefinitely on Socks proxy errors.\n"
+ "--resolv-retry n: If hostname resolve fails for --remote, retry\n"
+ " resolve for n seconds before failing (disabled by default).\n"
+ " Set n=\"infinite\" to retry indefinitely.\n"
+ "--float : Allow remote to change its IP address/port, such as through\n"
+ " DHCP (this is the default if --remote is not used).\n"
+ "--ipchange cmd : Run command cmd on remote ip address initial\n"
+ " setting or change -- execute as: cmd ip-address port#\n"
+ "--port port : TCP/UDP port # for both local and remote.\n"
+ "--lport port : TCP/UDP port # for local (default=%s). Implies --bind.\n"
+ "--rport port : TCP/UDP port # for remote (default=%s).\n"
+ "--bind : Bind to local address and port. (This is the default unless\n"
+ " --proto tcp-client"
+ " or --http-proxy"
+ " or --socks-proxy"
+ " is used).\n"
+ "--nobind : Do not bind to local address and port.\n"
+ "--dev tunX|tapX : tun/tap device (X can be omitted for dynamic device.\n"
+ "--dev-type dt : Which device type are we using? (dt = tun or tap) Use\n"
+ " this option only if the tun/tap device used with --dev\n"
+ " does not begin with \"tun\" or \"tap\".\n"
+ "--dev-node node : Explicitly set the device node rather than using\n"
+ " /dev/net/tun, /dev/tun, /dev/tap, etc.\n"
+ "--lladdr hw : Set the link layer address of the tap device.\n"
+ "--topology t : Set --dev tun topology: 'net30', 'p2p', or 'subnet'.\n"
+ "--tun-ipv6 : Build tun link capable of forwarding IPv6 traffic.\n"
+#ifdef ENABLE_IPROUTE
+ "--iproute cmd : Use this command instead of default " IPROUTE_PATH ".\n"
+#endif
+ "--ifconfig l rn : TUN: configure device to use IP address l as a local\n"
+ " endpoint and rn as a remote endpoint. l & rn should be\n"
+ " swapped on the other peer. l & rn must be private\n"
+ " addresses outside of the subnets used by either peer.\n"
+ " TAP: configure device to use IP address l as a local\n"
+ " endpoint and rn as a subnet mask.\n"
+ "--ifconfig-ipv6 l r : configure device to use IPv6 address l as local\n"
+ " endpoint (as a /64) and r as remote endpoint\n"
+ "--ifconfig-noexec : Don't actually execute ifconfig/netsh command, instead\n"
+ " pass --ifconfig parms by environment to scripts.\n"
+ "--ifconfig-nowarn : Don't warn if the --ifconfig option on this side of the\n"
+ " connection doesn't match the remote side.\n"
+ "--route network [netmask] [gateway] [metric] :\n"
+ " Add route to routing table after connection\n"
+ " is established. Multiple routes can be specified.\n"
+ " netmask default: 255.255.255.255\n"
+ " gateway default: taken from --route-gateway or --ifconfig\n"
+ " Specify default by leaving blank or setting to \"nil\".\n"
+ "--route-ipv6 network/bits [gateway] [metric] :\n"
+ " Add IPv6 route to routing table after connection\n"
+ " is established. Multiple routes can be specified.\n"
+ " gateway default: taken from 'remote' in --ifconfig-ipv6\n"
+ "--route-gateway gw|'dhcp' : Specify a default gateway for use with --route.\n"
+ "--route-metric m : Specify a default metric for use with --route.\n"
+ "--route-delay n [w] : Delay n seconds after connection initiation before\n"
+ " adding routes (may be 0). If not specified, routes will\n"
+ " be added immediately after tun/tap open. On Windows, wait\n"
+ " up to w seconds for TUN/TAP adapter to come up.\n"
+ "--route-up cmd : Run command cmd after routes are added.\n"
+ "--route-pre-down cmd : Run command cmd before routes are removed.\n"
+ "--route-noexec : Don't add routes automatically. Instead pass routes to\n"
+ " --route-up script using environmental variables.\n"
+ "--route-nopull : When used with --client or --pull, accept options pushed\n"
+ " by server EXCEPT for routes and dhcp options.\n"
+ "--allow-pull-fqdn : Allow client to pull DNS names from server for\n"
+ " --ifconfig, --route, and --route-gateway.\n"
+ "--redirect-gateway [flags]: Automatically execute routing\n"
+ " commands to redirect all outgoing IP traffic through the\n"
+ " VPN. Add 'local' flag if both " PACKAGE_NAME " servers are directly\n"
+ " connected via a common subnet, such as with WiFi.\n"
+ " Add 'def1' flag to set default route using using 0.0.0.0/1\n"
+ " and 128.0.0.0/1 rather than 0.0.0.0/0. Add 'bypass-dhcp'\n"
+ " flag to add a direct route to DHCP server, bypassing tunnel.\n"
+ " Add 'bypass-dns' flag to similarly bypass tunnel for DNS.\n"
+ "--redirect-private [flags]: Like --redirect-gateway, but omit actually changing\n"
+ " the default gateway. Useful when pushing private subnets.\n"
+ "--client-nat snat|dnat network netmask alias : on client add 1-to-1 NAT rule.\n"
+#ifdef ENABLE_PUSH_PEER_INFO
+ "--push-peer-info : (client only) push client info to server.\n"
+#endif
+ "--setenv name value : Set a custom environmental variable to pass to script.\n"
+ "--setenv FORWARD_COMPATIBLE 1 : Relax config file syntax checking to allow\n"
+ " directives for future OpenVPN versions to be ignored.\n"
+ "--ignore-unkown-option opt1 opt2 ...: Relax config file syntax. Allow\n"
+ " these options to be ignored when unknown\n"
+ "--script-security level: Where level can be:\n"
+ " 0 -- strictly no calling of external programs\n"
+ " 1 -- (default) only call built-ins such as ifconfig\n"
+ " 2 -- allow calling of built-ins and scripts\n"
+ " 3 -- allow password to be passed to scripts via env\n"
+ "--shaper n : Restrict output to peer to n bytes per second.\n"
+ "--keepalive n m : Helper option for setting timeouts in server mode. Send\n"
+ " ping once every n seconds, restart if ping not received\n"
+ " for m seconds.\n"
+ "--inactive n [bytes] : Exit after n seconds of activity on tun/tap device\n"
+ " produces a combined in/out byte count < bytes.\n"
+ "--ping-exit n : Exit if n seconds pass without reception of remote ping.\n"
+ "--ping-restart n: Restart if n seconds pass without reception of remote ping.\n"
+ "--ping-timer-rem: Run the --ping-exit/--ping-restart timer only if we have a\n"
+ " remote address.\n"
+ "--ping n : Ping remote once every n seconds over TCP/UDP port.\n"
+#if ENABLE_IP_PKTINFO
+ "--multihome : Configure a multi-homed UDP server.\n"
+#endif
+ "--fast-io : (experimental) Optimize TUN/TAP/UDP writes.\n"
+ "--remap-usr1 s : On SIGUSR1 signals, remap signal (s='SIGHUP' or 'SIGTERM').\n"
+ "--persist-tun : Keep tun/tap device open across SIGUSR1 or --ping-restart.\n"
+ "--persist-remote-ip : Keep remote IP address across SIGUSR1 or --ping-restart.\n"
+ "--persist-local-ip : Keep local IP address across SIGUSR1 or --ping-restart.\n"
+ "--persist-key : Don't re-read key files across SIGUSR1 or --ping-restart.\n"
+#if PASSTOS_CAPABILITY
+ "--passtos : TOS passthrough (applies to IPv4 only).\n"
+#endif
+ "--tun-mtu n : Take the tun/tap device MTU to be n and derive the\n"
+ " TCP/UDP MTU from it (default=%d).\n"
+ "--tun-mtu-extra n : Assume that tun/tap device might return as many\n"
+ " as n bytes more than the tun-mtu size on read\n"
+ " (default TUN=0 TAP=%d).\n"
+ "--link-mtu n : Take the TCP/UDP device MTU to be n and derive the tun MTU\n"
+ " from it.\n"
+ "--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?\n"
+ " 'no' -- Never send DF (Don't Fragment) frames\n"
+ " 'maybe' -- Use per-route hints\n"
+ " 'yes' -- Always DF (Don't Fragment)\n"
+#ifdef ENABLE_OCC
+ "--mtu-test : Empirically measure and report MTU.\n"
+#endif
+#ifdef ENABLE_FRAGMENT
+ "--fragment max : Enable internal datagram fragmentation so that no UDP\n"
+ " datagrams are sent which are larger than max bytes.\n"
+ " Adds 4 bytes of overhead per datagram.\n"
+#endif
+ "--mssfix [n] : Set upper bound on TCP MSS, default = tun-mtu size\n"
+ " or --fragment max value, whichever is lower.\n"
+ "--sndbuf size : Set the TCP/UDP send buffer size.\n"
+ "--rcvbuf size : Set the TCP/UDP receive buffer size.\n"
+#if defined(TARGET_LINUX) && HAVE_DECL_SO_MARK
+ "--mark value : Mark encrypted packets being sent with value. The mark value\n"
+ " can be matched in policy routing and packetfilter rules.\n"
+#endif
+ "--txqueuelen n : Set the tun/tap TX queue length to n (Linux only).\n"
+#ifdef ENABLE_MEMSTATS
+ "--memstats file : Write live usage stats to memory mapped binary file.\n"
+#endif
+ "--mlock : Disable Paging -- ensures key material and tunnel\n"
+ " data will never be written to disk.\n"
+ "--up cmd : Run command cmd after successful tun device open.\n"
+ " Execute as: cmd tun/tap-dev tun-mtu link-mtu \\\n"
+ " ifconfig-local-ip ifconfig-remote-ip\n"
+ " (pre --user or --group UID/GID change)\n"
+ "--up-delay : Delay tun/tap open and possible --up script execution\n"
+ " until after TCP/UDP connection establishment with peer.\n"
+ "--down cmd : Run command cmd after tun device close.\n"
+ " (post --user/--group UID/GID change and/or --chroot)\n"
+ " (command parameters are same as --up option)\n"
+ "--down-pre : Run --down command before TUN/TAP close.\n"
+ "--up-restart : Run up/down commands for all restarts including those\n"
+ " caused by --ping-restart or SIGUSR1\n"
+ "--user user : Set UID to user after initialization.\n"
+ "--group group : Set GID to group after initialization.\n"
+ "--chroot dir : Chroot to this directory after initialization.\n"
+#ifdef ENABLE_SELINUX
+ "--setcon context: Apply this SELinux context after initialization.\n"
+#endif
+ "--cd dir : Change to this directory before initialization.\n"
+ "--daemon [name] : Become a daemon after initialization.\n"
+ " The optional 'name' parameter will be passed\n"
+ " as the program name to the system logger.\n"
+ "--syslog [name] : Output to syslog, but do not become a daemon.\n"
+ " See --daemon above for a description of the 'name' parm.\n"
+ "--inetd [name] ['wait'|'nowait'] : Run as an inetd or xinetd server.\n"
+ " See --daemon above for a description of the 'name' parm.\n"
+ "--log file : Output log to file which is created/truncated on open.\n"
+ "--log-append file : Append log to file, or create file if nonexistent.\n"
+ "--suppress-timestamps : Don't log timestamps to stdout/stderr.\n"
+ "--machine-readable-output : Always log timestamp, message flags to stdout/stderr.\n"
+ "--writepid file : Write main process ID to file.\n"
+ "--nice n : Change process priority (>0 = lower, <0 = higher).\n"
+ "--echo [parms ...] : Echo parameters to log output.\n"
+ "--verb n : Set output verbosity to n (default=%d):\n"
+ " (Level 3 is recommended if you want a good summary\n"
+ " of what's happening without being swamped by output).\n"
+ " : 0 -- no output except fatal errors\n"
+ " : 1 -- startup info + connection initiated messages +\n"
+ " non-fatal encryption & net errors\n"
+ " : 2,3 -- show TLS negotiations & route info\n"
+ " : 4 -- show parameters\n"
+ " : 5 -- show 'RrWw' chars on console for each packet sent\n"
+ " and received from TCP/UDP (caps) or tun/tap (lc)\n"
+ " : 6 to 11 -- debug messages of increasing verbosity\n"
+ "--mute n : Log at most n consecutive messages in the same category.\n"
+ "--status file n : Write operational status to file every n seconds.\n"
+ "--status-version [n] : Choose the status file format version number.\n"
+ " Currently, n can be 1, 2, or 3 (default=1).\n"
+#ifdef ENABLE_OCC
+ "--disable-occ : Disable options consistency check between peers.\n"
+#endif
+#ifdef ENABLE_DEBUG
+ "--gremlin mask : Special stress testing mode (for debugging only).\n"
+#endif
+#if defined(USE_COMP)
+ "--compress alg : Use compression algorithm alg\n"
+#if defined(ENABLE_LZO)
+ "--comp-lzo : Use LZO compression -- may add up to 1 byte per\n"
+ " packet for uncompressible data.\n"
+ "--comp-noadapt : Don't use adaptive compression when --comp-lzo\n"
+ " is specified.\n"
+#endif
+#endif
+#ifdef ENABLE_MANAGEMENT
+ "--management ip port [pass] : Enable a TCP server on ip:port to handle\n"
+ " management functions. pass is a password file\n"
+ " or 'stdin' to prompt from console.\n"
+#if UNIX_SOCK_SUPPORT
+ " To listen on a unix domain socket, specific the pathname\n"
+ " in place of ip and use 'unix' as the port number.\n"
+#endif
+ "--management-client : Management interface will connect as a TCP client to\n"
+ " ip/port rather than listen as a TCP server.\n"
+ "--management-query-passwords : Query management channel for private key\n"
+ " and auth-user-pass passwords.\n"
+ "--management-query-proxy : Query management channel for proxy information.\n"
+ "--management-query-remote : Query management channel for --remote directive.\n"
+ "--management-hold : Start " PACKAGE_NAME " in a hibernating state, until a client\n"
+ " of the management interface explicitly starts it.\n"
+ "--management-signal : Issue SIGUSR1 when management disconnect event occurs.\n"
+ "--management-forget-disconnect : Forget passwords when management disconnect\n"
+ " event occurs.\n"
+ "--management-up-down : Report tunnel up/down events to management interface.\n"
+ "--management-log-cache n : Cache n lines of log file history for usage\n"
+ " by the management channel.\n"
+#if UNIX_SOCK_SUPPORT
+ "--management-client-user u : When management interface is a unix socket, only\n"
+ " allow connections from user u.\n"
+ "--management-client-group g : When management interface is a unix socket, only\n"
+ " allow connections from group g.\n"
+#endif
+#ifdef MANAGEMENT_DEF_AUTH
+ "--management-client-auth : gives management interface client the responsibility\n"
+ " to authenticate clients after their client certificate\n"
+ " has been verified.\n"
+#endif
+#ifdef MANAGEMENT_PF
+ "--management-client-pf : management interface clients must specify a packet\n"
+ " filter file for each connecting client.\n"
+#endif
+#endif
+#ifdef ENABLE_PLUGIN
+ "--plugin m [str]: Load plug-in module m passing str as an argument\n"
+ " to its initialization function.\n"
+#endif
+#if P2MP
+#if P2MP_SERVER
+ "\n"
+ "Multi-Client Server options (when --mode server is used):\n"
+ "--server network netmask : Helper option to easily configure server mode.\n"
+ "--server-ipv6 network/bits : Configure IPv6 server mode.\n"
+ "--server-bridge [IP netmask pool-start-IP pool-end-IP] : Helper option to\n"
+ " easily configure ethernet bridging server mode.\n"
+ "--push \"option\" : Push a config file option back to the peer for remote\n"
+ " execution. Peer must specify --pull in its config file.\n"
+ "--push-reset : Don't inherit global push list for specific\n"
+ " client instance.\n"
+ "--ifconfig-pool start-IP end-IP [netmask] : Set aside a pool of subnets\n"
+ " to be dynamically allocated to connecting clients.\n"
+ "--ifconfig-pool-linear : Use individual addresses rather than /30 subnets\n"
+ " in tun mode. Not compatible with Windows clients.\n"
+ "--ifconfig-pool-persist file [seconds] : Persist/unpersist ifconfig-pool\n"
+ " data to file, at seconds intervals (default=600).\n"
+ " If seconds=0, file will be treated as read-only.\n"
+ "--ifconfig-ipv6-pool base-IP/bits : set aside an IPv6 network block\n"
+ " to be dynamically allocated to connecting clients.\n"
+ "--ifconfig-push local remote-netmask : Push an ifconfig option to remote,\n"
+ " overrides --ifconfig-pool dynamic allocation.\n"
+ " Only valid in a client-specific config file.\n"
+ "--ifconfig-ipv6-push local/bits remote : Push an ifconfig-ipv6 option to\n"
+ " remote, overrides --ifconfig-ipv6-pool allocation.\n"
+ " Only valid in a client-specific config file.\n"
+ "--iroute network [netmask] : Route subnet to client.\n"
+ "--iroute-ipv6 network/bits : Route IPv6 subnet to client.\n"
+ " Sets up internal routes only.\n"
+ " Only valid in a client-specific config file.\n"
+ "--disable : Client is disabled.\n"
+ " Only valid in a client-specific config file.\n"
+ "--client-cert-not-required : Don't require client certificate, client\n"
+ " will authenticate using username/password.\n"
+ "--username-as-common-name : For auth-user-pass authentication, use\n"
+ " the authenticated username as the common name,\n"
+ " rather than the common name from the client cert.\n"
+ "--auth-user-pass-verify cmd method: Query client for username/password and\n"
+ " run command cmd to verify. If method='via-env', pass\n"
+ " user/pass via environment, if method='via-file', pass\n"
+ " user/pass via temporary file.\n"
+ "--opt-verify : Clients that connect with options that are incompatible\n"
+ " with those of the server will be disconnected.\n"
+ "--auth-user-pass-optional : Allow connections by clients that don't\n"
+ " specify a username/password.\n"
+ "--no-name-remapping : Allow Common Name and X509 Subject to include\n"
+ " any printable character.\n"
+ "--client-to-client : Internally route client-to-client traffic.\n"
+ "--duplicate-cn : Allow multiple clients with the same common name to\n"
+ " concurrently connect.\n"
+ "--client-connect cmd : Run command cmd on client connection.\n"
+ "--client-disconnect cmd : Run command cmd on client disconnection.\n"
+ "--client-config-dir dir : Directory for custom client config files.\n"
+ "--ccd-exclusive : Refuse connection unless custom client config is found.\n"
+ "--tmp-dir dir : Temporary directory, used for --client-connect return file and plugin communication.\n"
+ "--hash-size r v : Set the size of the real address hash table to r and the\n"
+ " virtual address table to v.\n"
+ "--bcast-buffers n : Allocate n broadcast buffers.\n"
+ "--tcp-queue-limit n : Maximum number of queued TCP output packets.\n"
+ "--tcp-nodelay : Macro that sets TCP_NODELAY socket flag on the server\n"
+ " as well as pushes it to connecting clients.\n"
+ "--learn-address cmd : Run command cmd to validate client virtual addresses.\n"
+ "--connect-freq n s : Allow a maximum of n new connections per s seconds.\n"
+ "--max-clients n : Allow a maximum of n simultaneously connected clients.\n"
+ "--max-routes-per-client n : Allow a maximum of n internal routes per client.\n"
+ "--stale-routes-check n [t] : Remove routes with a last activity timestamp\n"
+ " older than n seconds. Run this check every t\n"
+ " seconds (defaults to n).\n"
+#if PORT_SHARE
+ "--port-share host port [dir] : When run in TCP mode, proxy incoming HTTPS\n"
+ " sessions to a web server at host:port. dir specifies an\n"
+ " optional directory to write origin IP:port data.\n"
+#endif
+#endif
+ "\n"
+ "Client options (when connecting to a multi-client server):\n"
+ "--client : Helper option to easily configure client mode.\n"
+ "--auth-user-pass [up] : Authenticate with server using username/password.\n"
+ " up is a file containing username/password on 2 lines,\n"
+ " or omit to prompt from console.\n"
+ "--pull : Accept certain config file options from the peer as if they\n"
+ " were part of the local config file. Must be specified\n"
+ " when connecting to a '--mode server' remote host.\n"
+ "--auth-retry t : How to handle auth failures. Set t to\n"
+ " none (default), interact, or nointeract.\n"
+ "--static-challenge t e : Enable static challenge/response protocol using\n"
+ " challenge text t, with e indicating echo flag (0|1)\n"
+ "--server-poll-timeout n : when polling possible remote servers to connect to\n"
+ " in a round-robin fashion, spend no more than n seconds\n"
+ " waiting for a response before trying the next server.\n"
+#endif
+#ifdef ENABLE_OCC
+ "--explicit-exit-notify [n] : On exit/restart, send exit signal to\n"
+ " server/remote. n = # of retries, default=1.\n"
+#endif
+#ifdef ENABLE_CRYPTO
+ "\n"
+ "Data Channel Encryption Options (must be compatible between peers):\n"
+ "(These options are meaningful for both Static Key & TLS-mode)\n"
+ "--secret f [d] : Enable Static Key encryption mode (non-TLS).\n"
+ " Use shared secret file f, generate with --genkey.\n"
+ " The optional d parameter controls key directionality.\n"
+ " If d is specified, use separate keys for each\n"
+ " direction, set d=0 on one side of the connection,\n"
+ " and d=1 on the other side.\n"
+ "--auth alg : Authenticate packets with HMAC using message\n"
+ " digest algorithm alg (default=%s).\n"
+ " (usually adds 16 or 20 bytes per packet)\n"
+ " Set alg=none to disable authentication.\n"
+ "--cipher alg : Encrypt packets with cipher algorithm alg\n"
+ " (default=%s).\n"
+ " Set alg=none to disable encryption.\n"
+ "--prng alg [nsl] : For PRNG, use digest algorithm alg, and\n"
+ " nonce_secret_len=nsl. Set alg=none to disable PRNG.\n"
+#ifdef HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH
+ "--keysize n : Size of cipher key in bits (optional).\n"
+ " If unspecified, defaults to cipher-specific default.\n"
+#endif
+#ifndef ENABLE_CRYPTO_POLARSSL
+ "--engine [name] : Enable OpenSSL hardware crypto engine functionality.\n"
+#endif
+ "--no-replay : Disable replay protection.\n"
+ "--mute-replay-warnings : Silence the output of replay warnings to log file.\n"
+ "--replay-window n [t] : Use a replay protection sliding window of size n\n"
+ " and a time window of t seconds.\n"
+ " Default n=%d t=%d\n"
+ "--no-iv : Disable cipher IV -- only allowed with CBC mode ciphers.\n"
+ "--replay-persist file : Persist replay-protection state across sessions\n"
+ " using file.\n"
+ "--test-crypto : Run a self-test of crypto features enabled.\n"
+ " For debugging only.\n"
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ "--use-prediction-resistance: Enable prediction resistance on the random\n"
+ " number generator.\n"
+#endif
+#ifdef ENABLE_SSL
+ "\n"
+ "TLS Key Negotiation Options:\n"
+ "(These options are meaningful only for TLS-mode)\n"
+ "--tls-server : Enable TLS and assume server role during TLS handshake.\n"
+ "--tls-client : Enable TLS and assume client role during TLS handshake.\n"
+ "--key-method m : Data channel key exchange method. m should be a method\n"
+ " number, such as 1 (default), 2, etc.\n"
+ "--ca file : Certificate authority file in .pem format containing\n"
+ " root certificate.\n"
+#ifndef ENABLE_CRYPTO_POLARSSL
+ "--capath dir : A directory of trusted certificates (CAs"
+ " and CRLs).\n"
+#endif /* ENABLE_CRYPTO_POLARSSL */
+ "--dh file : File containing Diffie Hellman parameters\n"
+ " in .pem format (for --tls-server only).\n"
+ " Use \"openssl dhparam -out dh1024.pem 1024\" to generate.\n"
+ "--cert file : Local certificate in .pem format -- must be signed\n"
+ " by a Certificate Authority in --ca file.\n"
+ "--extra-certs file : one or more PEM certs that complete the cert chain.\n"
+ "--key file : Local private key in .pem format.\n"
+ "--tls-version-min <version> ['or-highest'] : sets the minimum TLS version we\n"
+ " will accept from the peer. If version is unrecognized and 'or-highest'\n"
+ " is specified, require max TLS version supported by SSL implementation.\n"
+#ifndef ENABLE_CRYPTO_POLARSSL
+ "--pkcs12 file : PKCS#12 file containing local private key, local certificate\n"
+ " and optionally the root CA certificate.\n"
+#endif
+#ifdef ENABLE_X509ALTUSERNAME
+ "--x509-username-field : Field in x509 certificate containing the username.\n"
+ " Default is CN in the Subject field.\n"
+#endif
+ "--verify-hash : Specify SHA1 fingerprint for level-1 cert.\n"
+#ifdef WIN32
+ "--cryptoapicert select-string : Load the certificate and private key from the\n"
+ " Windows Certificate System Store.\n"
+#endif
+ "--tls-cipher l : A list l of allowable TLS ciphers separated by : (optional).\n"
+ " : Use --show-tls to see a list of supported TLS ciphers.\n"
+ "--tls-timeout n : Packet retransmit timeout on TLS control channel\n"
+ " if no ACK from remote within n seconds (default=%d).\n"
+ "--reneg-bytes n : Renegotiate data chan. key after n bytes sent and recvd.\n"
+ "--reneg-pkts n : Renegotiate data chan. key after n packets sent and recvd.\n"
+ "--reneg-sec n : Renegotiate data chan. key after n seconds (default=%d).\n"
+ "--hand-window n : Data channel key exchange must finalize within n seconds\n"
+ " of handshake initiation by any peer (default=%d).\n"
+ "--tran-window n : Transition window -- old key can live this many seconds\n"
+ " after new key renegotiation begins (default=%d).\n"
+ "--single-session: Allow only one session (reset state on restart).\n"
+ "--tls-exit : Exit on TLS negotiation failure.\n"
+ "--tls-auth f [d]: Add an additional layer of authentication on top of the TLS\n"
+ " control channel to protect against DoS attacks.\n"
+ " f (required) is a shared-secret passphrase file.\n"
+ " The optional d parameter controls key directionality,\n"
+ " see --secret option for more info.\n"
+ "--askpass [file]: Get PEM password from controlling tty before we daemonize.\n"
+ "--auth-nocache : Don't cache --askpass or --auth-user-pass passwords.\n"
+ "--crl-verify crl ['dir']: Check peer certificate against a CRL.\n"
+ "--tls-verify cmd: Run command cmd to verify the X509 name of a\n"
+ " pending TLS connection that has otherwise passed all other\n"
+ " tests of certification. cmd should return 0 to allow\n"
+ " TLS handshake to proceed, or 1 to fail. (cmd is\n"
+ " executed as 'cmd certificate_depth subject')\n"
+ "--tls-export-cert [directory] : Get peer cert in PEM format and store it \n"
+ " in an openvpn temporary file in [directory]. Peer cert is \n"
+ " stored before tls-verify script execution and deleted after.\n"
+ "--verify-x509-name name: Accept connections only from a host with X509 subject\n"
+ " DN name. The remote host must also pass all other tests\n"
+ " of verification.\n"
+ "--ns-cert-type t: Require that peer certificate was signed with an explicit\n"
+ " nsCertType designation t = 'client' | 'server'.\n"
+#ifdef ENABLE_X509_TRACK
+ "--x509-track x : Save peer X509 attribute x in environment for use by\n"
+ " plugins and management interface.\n"
+#endif
+ "--remote-cert-ku v ... : Require that the peer certificate was signed with\n"
+ " explicit key usage, you can specify more than one value.\n"
+ " value should be given in hex format.\n"
+ "--remote-cert-eku oid : Require that the peer certificate was signed with\n"
+ " explicit extended key usage. Extended key usage can be encoded\n"
+ " as an object identifier or OpenSSL string representation.\n"
+ "--remote-cert-tls t: Require that peer certificate was signed with explicit\n"
+ " key usage and extended key usage based on RFC3280 TLS rules.\n"
+ " t = 'client' | 'server'.\n"
+#endif /* ENABLE_SSL */
+#ifdef ENABLE_PKCS11
+ "\n"
+ "PKCS#11 Options:\n"
+ "--pkcs11-providers provider ... : PKCS#11 provider to load.\n"
+ "--pkcs11-protected-authentication [0|1] ... : Use PKCS#11 protected authentication\n"
+ " path. Set for each provider.\n"
+ "--pkcs11-private-mode hex ... : PKCS#11 private key mode mask.\n"
+ " 0 : Try to determind automatically (default).\n"
+ " 1 : Use Sign.\n"
+ " 2 : Use SignRecover.\n"
+ " 4 : Use Decrypt.\n"
+ " 8 : Use Unwrap.\n"
+ "--pkcs11-cert-private [0|1] ... : Set if login should be performed before\n"
+ " certificate can be accessed. Set for each provider.\n"
+ "--pkcs11-pin-cache seconds : Number of seconds to cache PIN. The default is -1\n"
+ " cache until token is removed.\n"
+ "--pkcs11-id-management : Acquire identity from management interface.\n"
+ "--pkcs11-id serialized-id 'id' : Identity to use, get using standalone --show-pkcs11-ids\n"
+#endif /* ENABLE_PKCS11 */
+ "\n"
+ "SSL Library information:\n"
+ "--show-ciphers : Show cipher algorithms to use with --cipher option.\n"
+ "--show-digests : Show message digest algorithms to use with --auth option.\n"
+ "--show-engines : Show hardware crypto accelerator engines (if available).\n"
+#ifdef ENABLE_SSL
+ "--show-tls : Show all TLS ciphers (TLS used only as a control channel).\n"
+#endif
+#ifdef WIN32
+ "\n"
+ "Windows Specific:\n"
+ "--win-sys path : Pathname of Windows system directory. Default is the pathname\n"
+ " from SystemRoot environment variable.\n"
+ "--ip-win32 method : When using --ifconfig on Windows, set TAP-Windows adapter\n"
+ " IP address using method = manual, netsh, ipapi,\n"
+ " dynamic, or adaptive (default = adaptive).\n"
+ " Dynamic method allows two optional parameters:\n"
+ " offset: DHCP server address offset (> -256 and < 256).\n"
+ " If 0, use network address, if >0, take nth\n"
+ " address forward from network address, if <0,\n"
+ " take nth address backward from broadcast\n"
+ " address.\n"
+ " Default is 0.\n"
+ " lease-time: Lease time in seconds.\n"
+ " Default is one year.\n"
+ "--route-method : Which method to use for adding routes on Windows?\n"
+ " adaptive (default) -- Try ipapi then fall back to exe.\n"
+ " ipapi -- Use IP helper API.\n"
+ " exe -- Call the route.exe shell command.\n"
+ "--dhcp-option type [parm] : Set extended TAP-Windows properties, must\n"
+ " be used with --ip-win32 dynamic. For options\n"
+ " which allow multiple addresses,\n"
+ " --dhcp-option must be repeated.\n"
+ " DOMAIN name : Set DNS suffix\n"
+ " DNS addr : Set domain name server address(es)\n"
+ " NTP : Set NTP server address(es)\n"
+ " NBDD : Set NBDD server address(es)\n"
+ " WINS addr : Set WINS server address(es)\n"
+ " NBT type : Set NetBIOS over TCP/IP Node type\n"
+ " 1: B, 2: P, 4: M, 8: H\n"
+ " NBS id : Set NetBIOS scope ID\n"
+ " DISABLE-NBT : Disable Netbios-over-TCP/IP.\n"
+ "--dhcp-renew : Ask Windows to renew the TAP adapter lease on startup.\n"
+ "--dhcp-pre-release : Ask Windows to release the previous TAP adapter lease on\n"
+" startup.\n"
+ "--dhcp-release : Ask Windows to release the TAP adapter lease on shutdown.\n"
+ "--register-dns : Run net stop dnscache, net start dnscache, ipconfig /flushdns\n"
+ " and ipconfig /registerdns on connection initiation.\n"
+ "--tap-sleep n : Sleep for n seconds after TAP adapter open before\n"
+ " attempting to set adapter properties.\n"
+ "--pause-exit : When run from a console window, pause before exiting.\n"
+ "--service ex [0|1] : For use when " PACKAGE_NAME " is being instantiated by a\n"
+ " service, and should not be used directly by end-users.\n"
+ " ex is the name of an event object which, when\n"
+ " signaled, will cause " PACKAGE_NAME " to exit. A second\n"
+ " optional parameter controls the initial state of ex.\n"
+ "--show-net-up : Show " PACKAGE_NAME "'s view of routing table and net adapter list\n"
+ " after TAP adapter is up and routes have been added.\n"
+ "Windows Standalone Options:\n"
+ "\n"
+ "--show-adapters : Show all TAP-Windows adapters.\n"
+ "--show-net : Show " PACKAGE_NAME "'s view of routing table and net adapter list.\n"
+ "--show-valid-subnets : Show valid subnets for --dev tun emulation.\n"
+ "--allow-nonadmin [TAP-adapter] : Allow " PACKAGE_NAME " running without admin privileges\n"
+ " to access TAP adapter.\n"
+#endif
+ "\n"
+ "Generate a random key (only for non-TLS static key encryption mode):\n"
+ "--genkey : Generate a random key to be used as a shared secret,\n"
+ " for use with the --secret option.\n"
+ "--secret file : Write key to file.\n"
+#endif /* ENABLE_CRYPTO */
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+ "\n"
+ "Tun/tap config mode (available with linux 2.4+):\n"
+ "--mktun : Create a persistent tunnel.\n"
+ "--rmtun : Remove a persistent tunnel.\n"
+ "--dev tunX|tapX : tun/tap device\n"
+ "--dev-type dt : Device type. See tunnel options above for details.\n"
+ "--user user : User to set privilege to.\n"
+ "--group group : Group to set privilege to.\n"
+#endif
+#ifdef ENABLE_PKCS11
+ "\n"
+ "PKCS#11 standalone options:\n"
+ "--show-pkcs11-ids provider [cert_private] : Show PKCS#11 available ids.\n"
+ " --verb option can be added *BEFORE* this.\n"
+#endif /* ENABLE_PKCS11 */
+ "\n"
+ "General Standalone Options:\n"
+#ifdef ENABLE_DEBUG
+ "--show-gateway : Show info about default gateway.\n"
+#endif
+ ;
+
+#endif /* !ENABLE_SMALL */
+
+/*
+ * This is where the options defaults go.
+ * Any option not explicitly set here
+ * will be set to 0.
+ */
+void
+init_options (struct options *o, const bool init_gc)
+{
+ CLEAR (*o);
+ if (init_gc)
+ {
+ gc_init (&o->gc);
+ o->gc_owned = true;
+ }
+ o->mode = MODE_POINT_TO_POINT;
+ o->topology = TOP_NET30;
+ o->ce.proto = PROTO_UDP;
+ o->ce.af = AF_UNSPEC;
+ o->ce.bind_ipv6_only = false;
+ o->ce.connect_retry_seconds = 5;
+ o->ce.connect_timeout = 10;
+ o->connect_retry_max = 0;
+ o->ce.local_port = o->ce.remote_port = OPENVPN_PORT;
+ o->verbosity = 1;
+ o->status_file_update_freq = 60;
+ o->status_file_version = 1;
+ o->ce.bind_local = true;
+ o->ce.tun_mtu = TUN_MTU_DEFAULT;
+ o->ce.link_mtu = LINK_MTU_DEFAULT;
+ o->ce.mtu_discover_type = -1;
+ o->ce.mssfix = MSSFIX_DEFAULT;
+ o->route_delay_window = 30;
+ o->resolve_retry_seconds = RESOLV_RETRY_INFINITE;
+ o->resolve_in_advance = false;
+ o->proto_force = -1;
+#ifdef ENABLE_OCC
+ o->occ = true;
+#endif
+#ifdef ENABLE_MANAGEMENT
+ o->management_log_history_cache = 250;
+ o->management_echo_buffer_size = 100;
+ o->management_state_buffer_size = 100;
+#endif
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+ o->persist_mode = 1;
+#endif
+#ifndef WIN32
+ o->rcvbuf = 65536;
+ o->sndbuf = 65536;
+#endif
+#ifdef TARGET_LINUX
+ o->tuntap_options.txqueuelen = 100;
+#endif
+#ifdef WIN32
+#if 0
+ o->tuntap_options.ip_win32_type = IPW32_SET_ADAPTIVE;
+#else
+ o->tuntap_options.ip_win32_type = IPW32_SET_DHCP_MASQ;
+#endif
+ o->tuntap_options.dhcp_lease_time = 31536000; /* one year */
+ o->tuntap_options.dhcp_masq_offset = 0; /* use network address as internal DHCP server address */
+ o->route_method = ROUTE_METHOD_ADAPTIVE;
+#endif
+#if P2MP_SERVER
+ o->real_hash_size = 256;
+ o->virtual_hash_size = 256;
+ o->n_bcast_buf = 256;
+ o->tcp_queue_limit = 64;
+ o->max_clients = 1024;
+ o->max_routes_per_client = 256;
+ o->stale_routes_check_interval = 0;
+ o->ifconfig_pool_persist_refresh_freq = 600;
+#endif
+#if P2MP
+ o->scheduled_exit_interval = 5;
+ o->server_poll_timeout = 0;
+#endif
+#ifdef ENABLE_CRYPTO
+ o->ciphername = "BF-CBC";
+ o->ciphername_defined = true;
+ o->authname = "SHA1";
+ o->authname_defined = true;
+ o->prng_hash = "SHA1";
+ o->prng_nonce_secret_len = 16;
+ o->replay = true;
+ o->replay_window = DEFAULT_SEQ_BACKTRACK;
+ o->replay_time = DEFAULT_TIME_BACKTRACK;
+ o->use_iv = true;
+ o->key_direction = KEY_DIRECTION_BIDIRECTIONAL;
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ o->use_prediction_resistance = false;
+#endif
+#ifdef ENABLE_SSL
+ o->key_method = 2;
+ o->tls_timeout = 2;
+ o->renegotiate_seconds = 3600;
+ o->handshake_window = 60;
+ o->transition_window = 3600;
+ o->ecdh_curve = NULL;
+#ifdef ENABLE_X509ALTUSERNAME
+ o->x509_username_field = X509_USERNAME_FIELD_DEFAULT;
+#endif
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+#ifdef ENABLE_PKCS11
+ o->pkcs11_pin_cache_period = -1;
+#endif /* ENABLE_PKCS11 */
+
+/* tmp is only used in P2MP server context */
+#if P2MP_SERVER
+ /* Set default --tmp-dir */
+#ifdef WIN32
+ /* On Windows, find temp dir via enviroment variables */
+ o->tmp_dir = win_get_tempdir();
+#else
+ /* Non-windows platforms use $TMPDIR, and if not set, default to '/tmp' */
+ o->tmp_dir = getenv("TMPDIR");
+ if( !o->tmp_dir ) {
+ o->tmp_dir = "/tmp";
+ }
+#endif /* WIN32 */
+#endif /* P2MP_SERVER */
+}
+
+void
+uninit_options (struct options *o)
+{
+ if (o->gc_owned)
+ {
+ gc_free (&o->gc);
+ }
+}
+
+#ifndef ENABLE_SMALL
+
+#define SHOW_PARM(name, value, format) msg(D_SHOW_PARMS, " " #name " = " format, (value))
+#define SHOW_STR(var) SHOW_PARM(var, (o->var ? o->var : "[UNDEF]"), "'%s'")
+#define SHOW_INT(var) SHOW_PARM(var, o->var, "%d")
+#define SHOW_UINT(var) SHOW_PARM(var, o->var, "%u")
+#define SHOW_UNSIGNED(var) SHOW_PARM(var, o->var, "0x%08x")
+#define SHOW_BOOL(var) SHOW_PARM(var, (o->var ? "ENABLED" : "DISABLED"), "%s");
+
+#endif
+
+void
+setenv_connection_entry (struct env_set *es,
+ const struct connection_entry *e,
+ const int i)
+{
+ setenv_str_i (es, "proto", proto2ascii (e->proto, e->af, false), i);
+ setenv_str_i (es, "local", e->local, i);
+ setenv_str_i (es, "local_port", e->local_port, i);
+ setenv_str_i (es, "remote", e->remote, i);
+ setenv_str_i (es, "remote_port", e->remote_port, i);
+
+ if (e->http_proxy_options)
+ {
+ setenv_str_i (es, "http_proxy_server", e->http_proxy_options->server, i);
+ setenv_str_i (es, "http_proxy_port", e->http_proxy_options->port, i);
+ }
+ if (e->socks_proxy_server)
+ {
+ setenv_str_i (es, "socks_proxy_server", e->socks_proxy_server, i);
+ setenv_str_i (es, "socks_proxy_port", e->socks_proxy_port, i);
+ }
+}
+
+void
+setenv_settings (struct env_set *es, const struct options *o)
+{
+ setenv_str (es, "config", o->config);
+ setenv_int (es, "verb", o->verbosity);
+ setenv_int (es, "daemon", o->daemon);
+ setenv_int (es, "daemon_log_redirect", o->log);
+ setenv_unsigned (es, "daemon_start_time", time(NULL));
+ setenv_int (es, "daemon_pid", platform_getpid());
+
+ if (o->connection_list)
+ {
+ int i;
+ for (i = 0; i < o->connection_list->len; ++i)
+ setenv_connection_entry (es, o->connection_list->array[i], i+1);
+ }
+ else
+ setenv_connection_entry (es, &o->ce, 1);
+}
+
+static in_addr_t
+get_ip_addr (const char *ip_string, int msglevel, bool *error)
+{
+ unsigned int flags = GETADDR_HOST_ORDER;
+ bool succeeded = false;
+ in_addr_t ret;
+
+ if (msglevel & M_FATAL)
+ flags |= GETADDR_FATAL;
+
+ ret = getaddr (flags, ip_string, 0, &succeeded, NULL);
+ if (!succeeded && error)
+ *error = true;
+ return ret;
+}
+
+/* helper: parse a text string containing an IPv6 address + netbits
+ * in "standard format" (2001:dba::/32)
+ * "/nn" is optional, default to /64 if missing
+ *
+ * return true if parsing succeeded, modify *network and *netbits
+ * return address part without "/nn" in *printable_ipv6 (if != NULL)
+ */
+bool
+get_ipv6_addr( const char * prefix_str, struct in6_addr *network,
+ unsigned int * netbits, char ** printable_ipv6, int msglevel )
+{
+ int rc;
+ char * sep, * endp;
+ int bits;
+ struct in6_addr t_network;
+
+ sep = strchr( prefix_str, '/' );
+ if ( sep == NULL )
+ {
+ bits = 64;
+ }
+ else
+ {
+ bits = strtol( sep+1, &endp, 10 );
+ if ( *endp != '\0' || bits < 0 || bits > 128 )
+ {
+ msg (msglevel, "IPv6 prefix '%s': invalid '/bits' spec", prefix_str);
+ return false;
+ }
+ }
+
+ /* temporary replace '/' in caller-provided string with '\0', otherwise
+ * inet_pton() will refuse prefix string
+ * (alternative would be to strncpy() the prefix to temporary buffer)
+ */
+
+ if ( sep != NULL ) *sep = '\0';
+
+ rc = inet_pton( AF_INET6, prefix_str, &t_network );
+
+ if ( rc == 1 && printable_ipv6 != NULL )
+ {
+ *printable_ipv6 = string_alloc( prefix_str, NULL );
+ }
+
+ if ( sep != NULL ) *sep = '/';
+
+ if ( rc != 1 )
+ {
+ msg (msglevel, "IPv6 prefix '%s': invalid IPv6 address", prefix_str);
+ return false;
+ }
+
+ if ( netbits != NULL )
+ {
+ *netbits = bits;
+ }
+ if ( network != NULL )
+ {
+ *network = t_network;
+ }
+ return true; /* parsing OK, values set */
+}
+
+static bool ipv6_addr_safe_hexplusbits( const char * ipv6_prefix_spec )
+{
+ struct in6_addr t_addr;
+ unsigned int t_bits;
+
+ return get_ipv6_addr( ipv6_prefix_spec, &t_addr, &t_bits, NULL, M_WARN );
+}
+
+static char *
+string_substitute (const char *src, int from, int to, struct gc_arena *gc)
+{
+ char *ret = (char *) gc_malloc (strlen (src) + 1, true, gc);
+ char *dest = ret;
+ char c;
+
+ do
+ {
+ c = *src++;
+ if (c == from)
+ c = to;
+ *dest++ = c;
+ }
+ while (c);
+ return ret;
+}
+
+#ifdef ENABLE_SSL
+static uint8_t *
+parse_hash_fingerprint(const char *str, int nbytes, int msglevel, struct gc_arena *gc)
+{
+ int i;
+ const char *cp = str;
+ uint8_t *ret = (uint8_t *) gc_malloc (nbytes, true, gc);
+ char term = 1;
+ int byte;
+ char bs[3];
+
+ for (i = 0; i < nbytes; ++i)
+ {
+ if (strlen(cp) < 2)
+ msg (msglevel, "format error in hash fingerprint: %s", str);
+ bs[0] = *cp++;
+ bs[1] = *cp++;
+ bs[2] = 0;
+ byte = 0;
+ if (sscanf(bs, "%x", &byte) != 1)
+ msg (msglevel, "format error in hash fingerprint hex byte: %s", str);
+ ret[i] = (uint8_t)byte;
+ term = *cp++;
+ if (term != ':' && term != 0)
+ msg (msglevel, "format error in hash fingerprint delimiter: %s", str);
+ if (term == 0)
+ break;
+ }
+ if (term != 0 || i != nbytes-1)
+ msg (msglevel, "hash fingerprint is different length than expected (%d bytes): %s", nbytes, str);
+ return ret;
+}
+#endif
+
+#ifdef WIN32
+
+#ifndef ENABLE_SMALL
+
+static void
+show_dhcp_option_addrs (const char *name, const in_addr_t *array, int len)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ for (i = 0; i < len; ++i)
+ {
+ msg (D_SHOW_PARMS, " %s[%d] = %s",
+ name,
+ i,
+ print_in_addr_t (array[i], 0, &gc));
+ }
+ gc_free (&gc);
+}
+
+static void
+show_tuntap_options (const struct tuntap_options *o)
+{
+ SHOW_BOOL (ip_win32_defined);
+ SHOW_INT (ip_win32_type);
+ SHOW_INT (dhcp_masq_offset);
+ SHOW_INT (dhcp_lease_time);
+ SHOW_INT (tap_sleep);
+ SHOW_BOOL (dhcp_options);
+ SHOW_BOOL (dhcp_renew);
+ SHOW_BOOL (dhcp_pre_release);
+ SHOW_BOOL (dhcp_release);
+ SHOW_STR (domain);
+ SHOW_STR (netbios_scope);
+ SHOW_INT (netbios_node_type);
+ SHOW_BOOL (disable_nbt);
+
+ show_dhcp_option_addrs ("DNS", o->dns, o->dns_len);
+ show_dhcp_option_addrs ("WINS", o->wins, o->wins_len);
+ show_dhcp_option_addrs ("NTP", o->ntp, o->ntp_len);
+ show_dhcp_option_addrs ("NBDD", o->nbdd, o->nbdd_len);
+}
+
+#endif
+#endif
+
+#if defined(WIN32) || defined(TARGET_ANDROID)
+static void
+dhcp_option_address_parse (const char *name, const char *parm, in_addr_t *array, int *len, int msglevel)
+{
+ if (*len >= N_DHCP_ADDR)
+ {
+ msg (msglevel, "--dhcp-option %s: maximum of %d %s servers can be specified",
+ name,
+ N_DHCP_ADDR,
+ name);
+ }
+ else
+ {
+ if (ip_addr_dotted_quad_safe (parm)) /* FQDN -- IP address only */
+ {
+ bool error = false;
+ const in_addr_t addr = get_ip_addr (parm, msglevel, &error);
+ if (!error)
+ array[(*len)++] = addr;
+ }
+ else
+ {
+ msg (msglevel, "dhcp-option parameter %s '%s' must be an IP address", name, parm);
+ }
+ }
+}
+
+#endif
+
+#if P2MP
+
+#ifndef ENABLE_SMALL
+
+static void
+show_p2mp_parms (const struct options *o)
+{
+ struct gc_arena gc = gc_new ();
+
+#if P2MP_SERVER
+ msg (D_SHOW_PARMS, " server_network = %s", print_in_addr_t (o->server_network, 0, &gc));
+ msg (D_SHOW_PARMS, " server_netmask = %s", print_in_addr_t (o->server_netmask, 0, &gc));
+ msg (D_SHOW_PARMS, " server_network_ipv6 = %s", print_in6_addr (o->server_network_ipv6, 0, &gc) );
+ SHOW_INT (server_netbits_ipv6);
+ msg (D_SHOW_PARMS, " server_bridge_ip = %s", print_in_addr_t (o->server_bridge_ip, 0, &gc));
+ msg (D_SHOW_PARMS, " server_bridge_netmask = %s", print_in_addr_t (o->server_bridge_netmask, 0, &gc));
+ msg (D_SHOW_PARMS, " server_bridge_pool_start = %s", print_in_addr_t (o->server_bridge_pool_start, 0, &gc));
+ msg (D_SHOW_PARMS, " server_bridge_pool_end = %s", print_in_addr_t (o->server_bridge_pool_end, 0, &gc));
+ if (o->push_list.head)
+ {
+ const struct push_entry *e = o->push_list.head;
+ while (e)
+ {
+ if (e->enable)
+ msg (D_SHOW_PARMS, " push_entry = '%s'", e->option);
+ e = e->next;
+ }
+ }
+ SHOW_BOOL (ifconfig_pool_defined);
+ msg (D_SHOW_PARMS, " ifconfig_pool_start = %s", print_in_addr_t (o->ifconfig_pool_start, 0, &gc));
+ msg (D_SHOW_PARMS, " ifconfig_pool_end = %s", print_in_addr_t (o->ifconfig_pool_end, 0, &gc));
+ msg (D_SHOW_PARMS, " ifconfig_pool_netmask = %s", print_in_addr_t (o->ifconfig_pool_netmask, 0, &gc));
+ SHOW_STR (ifconfig_pool_persist_filename);
+ SHOW_INT (ifconfig_pool_persist_refresh_freq);
+ SHOW_BOOL (ifconfig_ipv6_pool_defined);
+ msg (D_SHOW_PARMS, " ifconfig_ipv6_pool_base = %s", print_in6_addr (o->ifconfig_ipv6_pool_base, 0, &gc));
+ SHOW_INT (ifconfig_ipv6_pool_netbits);
+ SHOW_INT (n_bcast_buf);
+ SHOW_INT (tcp_queue_limit);
+ SHOW_INT (real_hash_size);
+ SHOW_INT (virtual_hash_size);
+ SHOW_STR (client_connect_script);
+ SHOW_STR (learn_address_script);
+ SHOW_STR (client_disconnect_script);
+ SHOW_STR (client_config_dir);
+ SHOW_BOOL (ccd_exclusive);
+ SHOW_STR (tmp_dir);
+ SHOW_BOOL (push_ifconfig_defined);
+ msg (D_SHOW_PARMS, " push_ifconfig_local = %s", print_in_addr_t (o->push_ifconfig_local, 0, &gc));
+ msg (D_SHOW_PARMS, " push_ifconfig_remote_netmask = %s", print_in_addr_t (o->push_ifconfig_remote_netmask, 0, &gc));
+ SHOW_BOOL (push_ifconfig_ipv6_defined);
+ msg (D_SHOW_PARMS, " push_ifconfig_ipv6_local = %s/%d", print_in6_addr (o->push_ifconfig_ipv6_local, 0, &gc), o->push_ifconfig_ipv6_netbits );
+ msg (D_SHOW_PARMS, " push_ifconfig_ipv6_remote = %s", print_in6_addr (o->push_ifconfig_ipv6_remote, 0, &gc));
+ SHOW_BOOL (enable_c2c);
+ SHOW_BOOL (duplicate_cn);
+ SHOW_INT (cf_max);
+ SHOW_INT (cf_per);
+ SHOW_INT (max_clients);
+ SHOW_INT (max_routes_per_client);
+ SHOW_STR (auth_user_pass_verify_script);
+ SHOW_BOOL (auth_user_pass_verify_script_via_file);
+#if PORT_SHARE
+ SHOW_STR (port_share_host);
+ SHOW_STR (port_share_port);
+#endif
+#endif /* P2MP_SERVER */
+
+ SHOW_BOOL (client);
+ SHOW_BOOL (pull);
+ SHOW_STR (auth_user_pass_file);
+
+ gc_free (&gc);
+}
+
+#endif /* ! ENABLE_SMALL */
+
+#if P2MP_SERVER
+
+static void
+option_iroute (struct options *o,
+ const char *network_str,
+ const char *netmask_str,
+ int msglevel)
+{
+ struct iroute *ir;
+
+ ALLOC_OBJ_GC (ir, struct iroute, &o->gc);
+ ir->network = getaddr (GETADDR_HOST_ORDER, network_str, 0, NULL, NULL);
+ ir->netbits = -1;
+
+ if (netmask_str)
+ {
+ const in_addr_t netmask = getaddr (GETADDR_HOST_ORDER, netmask_str, 0, NULL, NULL);
+ if (!netmask_to_netbits (ir->network, netmask, &ir->netbits))
+ {
+ msg (msglevel, "in --iroute %s %s : Bad network/subnet specification",
+ network_str,
+ netmask_str);
+ return;
+ }
+ }
+
+ ir->next = o->iroutes;
+ o->iroutes = ir;
+}
+
+static void
+option_iroute_ipv6 (struct options *o,
+ const char *prefix_str,
+ int msglevel)
+{
+ struct iroute_ipv6 *ir;
+
+ ALLOC_OBJ_GC (ir, struct iroute_ipv6, &o->gc);
+
+ if ( get_ipv6_addr (prefix_str, &ir->network, &ir->netbits, NULL, msglevel ) < 0 )
+ {
+ msg (msglevel, "in --iroute-ipv6 %s: Bad IPv6 prefix specification",
+ prefix_str);
+ return;
+ }
+
+ ir->next = o->iroutes_ipv6;
+ o->iroutes_ipv6 = ir;
+}
+#endif /* P2MP_SERVER */
+#endif /* P2MP */
+
+#ifndef ENABLE_SMALL
+static void
+show_http_proxy_options (const struct http_proxy_options *o)
+{
+ int i;
+ msg (D_SHOW_PARMS, "BEGIN http_proxy");
+ SHOW_STR (server);
+ SHOW_STR (port);
+ SHOW_STR (auth_method_string);
+ SHOW_STR (auth_file);
+ SHOW_BOOL (retry);
+ SHOW_INT (timeout);
+ SHOW_STR (http_version);
+ SHOW_STR (user_agent);
+ for (i=0; i < MAX_CUSTOM_HTTP_HEADER && o->custom_headers[i].name;i++)
+ {
+ if (o->custom_headers[i].content)
+ msg (D_SHOW_PARMS, " custom_header[%d] = %s: %s", i,
+ o->custom_headers[i].name, o->custom_headers[i].content);
+ else
+ msg (D_SHOW_PARMS, " custom_header[%d] = %s", i,
+ o->custom_headers[i].name);
+ }
+ msg (D_SHOW_PARMS, "END http_proxy");
+}
+#endif
+
+void
+options_detach (struct options *o)
+{
+ gc_detach (&o->gc);
+ o->routes = NULL;
+ o->client_nat = NULL;
+#if P2MP_SERVER
+ clone_push_list(o);
+#endif
+}
+
+void
+rol_check_alloc (struct options *options)
+{
+ if (!options->routes)
+ options->routes = new_route_option_list (&options->gc);
+}
+
+void
+rol6_check_alloc (struct options *options)
+{
+ if (!options->routes_ipv6)
+ options->routes_ipv6 = new_route_ipv6_option_list (&options->gc);
+}
+
+static void
+cnol_check_alloc (struct options *options)
+{
+ if (!options->client_nat)
+ options->client_nat = new_client_nat_list (&options->gc);
+}
+
+#ifndef ENABLE_SMALL
+static void
+show_connection_entry (const struct connection_entry *o)
+{
+ msg (D_SHOW_PARMS, " proto = %s", proto2ascii (o->proto, o->af, false));
+ SHOW_STR (local);
+ SHOW_STR (local_port);
+ SHOW_STR (remote);
+ SHOW_STR (remote_port);
+ SHOW_BOOL (remote_float);
+ SHOW_BOOL (bind_defined);
+ SHOW_BOOL (bind_local);
+ SHOW_BOOL (bind_ipv6_only);
+ SHOW_INT (connect_retry_seconds);
+ SHOW_INT (connect_timeout);
+
+ if (o->http_proxy_options)
+ show_http_proxy_options (o->http_proxy_options);
+ SHOW_STR (socks_proxy_server);
+ SHOW_STR (socks_proxy_port);
+ SHOW_BOOL (socks_proxy_retry);
+ SHOW_INT (tun_mtu);
+ SHOW_BOOL (tun_mtu_defined);
+ SHOW_INT (link_mtu);
+ SHOW_BOOL (link_mtu_defined);
+ SHOW_INT (tun_mtu_extra);
+ SHOW_BOOL (tun_mtu_extra_defined);
+
+ SHOW_INT (mtu_discover_type);
+
+#ifdef ENABLE_FRAGMENT
+ SHOW_INT (fragment);
+#endif
+ SHOW_INT (mssfix);
+
+#ifdef ENABLE_OCC
+ SHOW_INT (explicit_exit_notification);
+#endif
+}
+
+
+static void
+show_connection_entries (const struct options *o)
+{
+ if (o->connection_list)
+ {
+ const struct connection_list *l = o->connection_list;
+ int i;
+ for (i = 0; i < l->len; ++i)
+ {
+ msg (D_SHOW_PARMS, "Connection profiles [%d]:", i);
+ show_connection_entry (l->array[i]);
+ }
+ }
+ else
+ {
+ msg (D_SHOW_PARMS, "Connection profiles [default]:");
+ show_connection_entry (&o->ce);
+ }
+ msg (D_SHOW_PARMS, "Connection profiles END");
+}
+
+#endif
+
+void
+show_settings (const struct options *o)
+{
+#ifndef ENABLE_SMALL
+ msg (D_SHOW_PARMS, "Current Parameter Settings:");
+
+ SHOW_STR (config);
+
+ SHOW_INT (mode);
+
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+ SHOW_BOOL (persist_config);
+ SHOW_INT (persist_mode);
+#endif
+
+#ifdef ENABLE_CRYPTO
+ SHOW_BOOL (show_ciphers);
+ SHOW_BOOL (show_digests);
+ SHOW_BOOL (show_engines);
+ SHOW_BOOL (genkey);
+#ifdef ENABLE_SSL
+ SHOW_STR (key_pass_file);
+ SHOW_BOOL (show_tls_ciphers);
+#endif
+#endif
+
+ SHOW_INT (connect_retry_max);
+ show_connection_entries (o);
+
+ SHOW_BOOL (remote_random);
+
+ SHOW_STR (ipchange);
+ SHOW_STR (dev);
+ SHOW_STR (dev_type);
+ SHOW_STR (dev_node);
+ SHOW_STR (lladdr);
+ SHOW_INT (topology);
+ SHOW_BOOL (tun_ipv6);
+ SHOW_STR (ifconfig_local);
+ SHOW_STR (ifconfig_remote_netmask);
+ SHOW_BOOL (ifconfig_noexec);
+ SHOW_BOOL (ifconfig_nowarn);
+ SHOW_STR (ifconfig_ipv6_local);
+ SHOW_INT (ifconfig_ipv6_netbits);
+ SHOW_STR (ifconfig_ipv6_remote);
+
+#ifdef ENABLE_FEATURE_SHAPER
+ SHOW_INT (shaper);
+#endif
+#ifdef ENABLE_OCC
+ SHOW_INT (mtu_test);
+#endif
+
+ SHOW_BOOL (mlock);
+
+ SHOW_INT (keepalive_ping);
+ SHOW_INT (keepalive_timeout);
+ SHOW_INT (inactivity_timeout);
+ SHOW_INT (ping_send_timeout);
+ SHOW_INT (ping_rec_timeout);
+ SHOW_INT (ping_rec_timeout_action);
+ SHOW_BOOL (ping_timer_remote);
+ SHOW_INT (remap_sigusr1);
+ SHOW_BOOL (persist_tun);
+ SHOW_BOOL (persist_local_ip);
+ SHOW_BOOL (persist_remote_ip);
+ SHOW_BOOL (persist_key);
+
+#if PASSTOS_CAPABILITY
+ SHOW_BOOL (passtos);
+#endif
+
+ SHOW_INT (resolve_retry_seconds);
+ SHOW_BOOL (resolve_in_advance);
+
+ SHOW_STR (username);
+ SHOW_STR (groupname);
+ SHOW_STR (chroot_dir);
+ SHOW_STR (cd_dir);
+#ifdef ENABLE_SELINUX
+ SHOW_STR (selinux_context);
+#endif
+ SHOW_STR (writepid);
+ SHOW_STR (up_script);
+ SHOW_STR (down_script);
+ SHOW_BOOL (down_pre);
+ SHOW_BOOL (up_restart);
+ SHOW_BOOL (up_delay);
+ SHOW_BOOL (daemon);
+ SHOW_INT (inetd);
+ SHOW_BOOL (log);
+ SHOW_BOOL (suppress_timestamps);
+ SHOW_BOOL (machine_readable_output);
+ SHOW_INT (nice);
+ SHOW_INT (verbosity);
+ SHOW_INT (mute);
+#ifdef ENABLE_DEBUG
+ SHOW_INT (gremlin);
+#endif
+ SHOW_STR (status_file);
+ SHOW_INT (status_file_version);
+ SHOW_INT (status_file_update_freq);
+
+#ifdef ENABLE_OCC
+ SHOW_BOOL (occ);
+#endif
+ SHOW_INT (rcvbuf);
+ SHOW_INT (sndbuf);
+#if defined(TARGET_LINUX) && HAVE_DECL_SO_MARK
+ SHOW_INT (mark);
+#endif
+ SHOW_INT (sockflags);
+
+ SHOW_BOOL (fast_io);
+
+#ifdef USE_COMP
+ SHOW_INT (comp.alg);
+ SHOW_INT (comp.flags);
+#endif
+
+ SHOW_STR (route_script);
+ SHOW_STR (route_default_gateway);
+ SHOW_INT (route_default_metric);
+ SHOW_BOOL (route_noexec);
+ SHOW_INT (route_delay);
+ SHOW_INT (route_delay_window);
+ SHOW_BOOL (route_delay_defined);
+ SHOW_BOOL (route_nopull);
+ SHOW_BOOL (route_gateway_via_dhcp);
+ SHOW_BOOL (allow_pull_fqdn);
+ if (o->routes)
+ print_route_options (o->routes, D_SHOW_PARMS);
+
+ if (o->client_nat)
+ print_client_nat_list(o->client_nat, D_SHOW_PARMS);
+
+#ifdef ENABLE_MANAGEMENT
+ SHOW_STR (management_addr);
+ SHOW_STR (management_port);
+ SHOW_STR (management_user_pass);
+ SHOW_INT (management_log_history_cache);
+ SHOW_INT (management_echo_buffer_size);
+ SHOW_STR (management_write_peer_info_file);
+ SHOW_STR (management_client_user);
+ SHOW_STR (management_client_group);
+ SHOW_INT (management_flags);
+#endif
+#ifdef ENABLE_PLUGIN
+ if (o->plugin_list)
+ plugin_option_list_print (o->plugin_list, D_SHOW_PARMS);
+#endif
+
+#ifdef ENABLE_CRYPTO
+ SHOW_STR (shared_secret_file);
+ SHOW_INT (key_direction);
+ SHOW_BOOL (ciphername_defined);
+ SHOW_STR (ciphername);
+ SHOW_BOOL (authname_defined);
+ SHOW_STR (authname);
+ SHOW_STR (prng_hash);
+ SHOW_INT (prng_nonce_secret_len);
+ SHOW_INT (keysize);
+#ifndef ENABLE_CRYPTO_POLARSSL
+ SHOW_BOOL (engine);
+#endif /* ENABLE_CRYPTO_POLARSSL */
+ SHOW_BOOL (replay);
+ SHOW_BOOL (mute_replay_warnings);
+ SHOW_INT (replay_window);
+ SHOW_INT (replay_time);
+ SHOW_STR (packet_id_file);
+ SHOW_BOOL (use_iv);
+ SHOW_BOOL (test_crypto);
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ SHOW_BOOL (use_prediction_resistance);
+#endif
+
+#ifdef ENABLE_SSL
+ SHOW_BOOL (tls_server);
+ SHOW_BOOL (tls_client);
+ SHOW_INT (key_method);
+ SHOW_STR (ca_file);
+ SHOW_STR (ca_path);
+ SHOW_STR (dh_file);
+ SHOW_STR (cert_file);
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if((o->management_flags & MF_EXTERNAL_KEY))
+ SHOW_PARM ("priv_key_file","EXTERNAL_PRIVATE_KEY","%s");
+ else
+#endif
+ SHOW_STR (priv_key_file);
+#ifndef ENABLE_CRYPTO_POLARSSL
+ SHOW_STR (pkcs12_file);
+#endif
+#ifdef ENABLE_CRYPTOAPI
+ SHOW_STR (cryptoapi_cert);
+#endif
+ SHOW_STR (cipher_list);
+ SHOW_STR (tls_verify);
+ SHOW_STR (tls_export_cert);
+ SHOW_INT (verify_x509_type);
+ SHOW_STR (verify_x509_name);
+ SHOW_STR (crl_file);
+ SHOW_INT (ns_cert_type);
+ {
+ int i;
+ for (i=0;i<MAX_PARMS;i++)
+ SHOW_INT (remote_cert_ku[i]);
+ }
+ SHOW_STR (remote_cert_eku);
+ SHOW_INT (ssl_flags);
+
+ SHOW_INT (tls_timeout);
+
+ SHOW_INT (renegotiate_bytes);
+ SHOW_INT (renegotiate_packets);
+ SHOW_INT (renegotiate_seconds);
+
+ SHOW_INT (handshake_window);
+ SHOW_INT (transition_window);
+
+ SHOW_BOOL (single_session);
+#ifdef ENABLE_PUSH_PEER_INFO
+ SHOW_BOOL (push_peer_info);
+#endif
+ SHOW_BOOL (tls_exit);
+
+ SHOW_STR (tls_auth_file);
+#endif
+#endif
+
+#ifdef ENABLE_PKCS11
+ {
+ int i;
+ for (i=0;i<MAX_PARMS && o->pkcs11_providers[i] != NULL;i++)
+ SHOW_PARM (pkcs11_providers, o->pkcs11_providers[i], "%s");
+ }
+ {
+ int i;
+ for (i=0;i<MAX_PARMS;i++)
+ SHOW_PARM (pkcs11_protected_authentication, o->pkcs11_protected_authentication[i] ? "ENABLED" : "DISABLED", "%s");
+ }
+ {
+ int i;
+ for (i=0;i<MAX_PARMS;i++)
+ SHOW_PARM (pkcs11_private_mode, o->pkcs11_private_mode[i], "%08x");
+ }
+ {
+ int i;
+ for (i=0;i<MAX_PARMS;i++)
+ SHOW_PARM (pkcs11_cert_private, o->pkcs11_cert_private[i] ? "ENABLED" : "DISABLED", "%s");
+ }
+ SHOW_INT (pkcs11_pin_cache_period);
+ SHOW_STR (pkcs11_id);
+ SHOW_BOOL (pkcs11_id_management);
+#endif /* ENABLE_PKCS11 */
+
+#if P2MP
+ show_p2mp_parms (o);
+#endif
+
+#ifdef WIN32
+ SHOW_BOOL (show_net_up);
+ SHOW_INT (route_method);
+ show_tuntap_options (&o->tuntap_options);
+#endif
+#endif
+}
+
+#undef SHOW_PARM
+#undef SHOW_STR
+#undef SHOW_INT
+#undef SHOW_BOOL
+
+#ifdef ENABLE_MANAGEMENT
+
+static struct http_proxy_options *
+parse_http_proxy_override (const char *server,
+ const char *port,
+ const char *flags,
+ const int msglevel,
+ struct gc_arena *gc)
+{
+ if (server && port)
+ {
+ struct http_proxy_options *ho;
+ ALLOC_OBJ_CLEAR_GC (ho, struct http_proxy_options, gc);
+ ho->server = string_alloc(server, gc);
+ ho->port = port;
+ ho->retry = true;
+ ho->timeout = 5;
+ if (flags && !strcmp(flags, "nct"))
+ ho->auth_retry = PAR_NCT;
+ else
+ ho->auth_retry = PAR_ALL;
+ ho->http_version = "1.0";
+ ho->user_agent = "OpenVPN-Autoproxy/1.0";
+ return ho;
+ }
+ else
+ return NULL;
+}
+
+void
+options_postprocess_http_proxy_override (struct options *o)
+{
+ const struct connection_list *l = o->connection_list;
+ int i;
+ bool succeed = false;
+ for (i = 0; i < l->len; ++i)
+ {
+ struct connection_entry *ce = l->array[i];
+ if (ce->proto == PROTO_TCP_CLIENT || ce->proto == PROTO_TCP)
+ {
+ ce->http_proxy_options = o->http_proxy_override;
+ succeed = true;
+ }
+ }
+ if (succeed)
+ {
+ for (i = 0; i < l->len; ++i)
+ {
+ struct connection_entry *ce = l->array[i];
+ if (ce->proto == PROTO_UDP)
+ {
+ ce->flags |= CE_DISABLED;
+ }
+ }
+ }
+ else
+ {
+ msg (M_WARN, "Note: option http-proxy-override ignored because no TCP-based connection profiles are defined");
+ }
+}
+
+#endif
+
+static struct connection_list *
+alloc_connection_list_if_undef (struct options *options)
+{
+ if (!options->connection_list)
+ ALLOC_OBJ_CLEAR_GC (options->connection_list, struct connection_list, &options->gc);
+ return options->connection_list;
+}
+
+static struct connection_entry *
+alloc_connection_entry (struct options *options, const int msglevel)
+{
+ struct connection_list *l = alloc_connection_list_if_undef (options);
+ struct connection_entry *e;
+
+ if (l->len >= CONNECTION_LIST_SIZE)
+ {
+ msg (msglevel, "Maximum number of 'connection' options (%d) exceeded", CONNECTION_LIST_SIZE);
+ return NULL;
+ }
+ ALLOC_OBJ_GC (e, struct connection_entry, &options->gc);
+ l->array[l->len++] = e;
+ return e;
+}
+
+static struct remote_list *
+alloc_remote_list_if_undef (struct options *options)
+{
+ if (!options->remote_list)
+ ALLOC_OBJ_CLEAR_GC (options->remote_list, struct remote_list, &options->gc);
+ return options->remote_list;
+}
+
+static struct remote_entry *
+alloc_remote_entry (struct options *options, const int msglevel)
+{
+ struct remote_list *l = alloc_remote_list_if_undef (options);
+ struct remote_entry *e;
+
+ if (l->len >= CONNECTION_LIST_SIZE)
+ {
+ msg (msglevel, "Maximum number of 'remote' options (%d) exceeded", CONNECTION_LIST_SIZE);
+ return NULL;
+ }
+ ALLOC_OBJ_GC (e, struct remote_entry, &options->gc);
+ l->array[l->len++] = e;
+ return e;
+}
+
+void
+connection_entry_load_re (struct connection_entry *ce, const struct remote_entry *re)
+{
+ if (re->remote)
+ ce->remote = re->remote;
+ if (re->remote_port)
+ ce->remote_port = re->remote_port;
+ if (re->proto >= 0)
+ ce->proto = re->proto;
+ if (re->af > 0)
+ ce->af = re->af;
+}
+
+static void
+options_postprocess_verify_ce (const struct options *options, const struct connection_entry *ce)
+{
+ struct options defaults;
+ int dev = DEV_TYPE_UNDEF;
+ bool pull = false;
+
+ init_options (&defaults, true);
+
+#ifdef ENABLE_CRYPTO
+ if (options->test_crypto)
+ {
+ notnull (options->shared_secret_file, "key file (--secret)");
+ }
+ else
+#endif
+ notnull (options->dev, "TUN/TAP device (--dev)");
+
+ /*
+ * Get tun/tap/null device type
+ */
+ dev = dev_type_enum (options->dev, options->dev_type);
+
+ /*
+ * If "proto tcp" is specified, make sure we know whether it is
+ * tcp-client or tcp-server.
+ */
+ if (ce->proto == PROTO_TCP)
+ msg (M_USAGE, "--proto tcp is ambiguous in this context. Please specify --proto tcp-server or --proto tcp-client");
+
+ /*
+ * Sanity check on daemon/inetd modes
+ */
+
+ if (options->daemon && options->inetd)
+ msg (M_USAGE, "only one of --daemon or --inetd may be specified");
+
+ if (options->inetd && (ce->local || ce->remote))
+ msg (M_USAGE, "--local or --remote cannot be used with --inetd");
+
+ if (options->inetd && ce->proto == PROTO_TCP_CLIENT)
+ msg (M_USAGE, "--proto tcp-client cannot be used with --inetd");
+
+ if (options->inetd == INETD_NOWAIT && ce->proto != PROTO_TCP_SERVER)
+ msg (M_USAGE, "--inetd nowait can only be used with --proto tcp-server");
+
+ if (options->inetd == INETD_NOWAIT
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ && !(options->tls_server || options->tls_client)
+#endif
+ )
+ msg (M_USAGE, "--inetd nowait can only be used in TLS mode");
+
+ if (options->inetd == INETD_NOWAIT && dev != DEV_TYPE_TAP)
+ msg (M_USAGE, "--inetd nowait only makes sense in --dev tap mode");
+
+
+ if (options->lladdr && dev != DEV_TYPE_TAP)
+ msg (M_USAGE, "--lladdr can only be used in --dev tap mode");
+
+ /*
+ * Sanity check on TCP mode options
+ */
+ if (ce->connect_timeout_defined && ce->proto != PROTO_TCP_CLIENT)
+ msg (M_USAGE, "--connect-timeout doesn't make sense unless also used with "
+ "--proto tcp-client or tcp6-client");
+
+ /*
+ * Sanity check on MTU parameters
+ */
+ if (options->ce.tun_mtu_defined && options->ce.link_mtu_defined)
+ msg (M_USAGE, "only one of --tun-mtu or --link-mtu may be defined (note that --ifconfig implies --link-mtu %d)", LINK_MTU_DEFAULT);
+
+#ifdef ENABLE_OCC
+ if (!proto_is_udp(ce->proto) && options->mtu_test)
+ msg (M_USAGE, "--mtu-test only makes sense with --proto udp");
+#endif
+
+ /* will we be pulling options from server? */
+#if P2MP
+ pull = options->pull;
+#endif
+
+ /*
+ * Sanity check on --local, --remote, and --ifconfig
+ */
+
+ if (proto_is_net(ce->proto)
+ && string_defined_equal (ce->local, ce->remote)
+ && string_defined_equal (ce->local_port, ce->remote_port))
+ msg (M_USAGE, "--remote and --local addresses are the same");
+
+ if (string_defined_equal (ce->remote, options->ifconfig_local)
+ || string_defined_equal (ce->remote, options->ifconfig_remote_netmask))
+ msg (M_USAGE, "--local and --remote addresses must be distinct from --ifconfig addresses");
+
+ if (string_defined_equal (ce->local, options->ifconfig_local)
+ || string_defined_equal (ce->local, options->ifconfig_remote_netmask))
+ msg (M_USAGE, "--local addresses must be distinct from --ifconfig addresses");
+
+ if (string_defined_equal (options->ifconfig_local, options->ifconfig_remote_netmask))
+ msg (M_USAGE, "local and remote/netmask --ifconfig addresses must be different");
+
+ if (ce->bind_defined && !ce->bind_local)
+ msg (M_USAGE, "--bind and --nobind can't be used together");
+
+ if (ce->local && !ce->bind_local)
+ msg (M_USAGE, "--local and --nobind don't make sense when used together");
+
+ if (ce->local_port_defined && !ce->bind_local)
+ msg (M_USAGE, "--lport and --nobind don't make sense when used together");
+
+ if (!ce->remote && !ce->bind_local)
+ msg (M_USAGE, "--nobind doesn't make sense unless used with --remote");
+
+ /*
+ * Check for consistency of management options
+ */
+#ifdef ENABLE_MANAGEMENT
+ if (!options->management_addr &&
+ (options->management_flags
+ || options->management_write_peer_info_file
+ || options->management_log_history_cache != defaults.management_log_history_cache))
+ msg (M_USAGE, "--management is not specified, however one or more options which modify the behavior of --management were specified");
+
+ if ((options->management_client_user || options->management_client_group)
+ && !(options->management_flags & MF_UNIX_SOCK))
+ msg (M_USAGE, "--management-client-(user|group) can only be used on unix domain sockets");
+#endif
+
+ /*
+ * Windows-specific options.
+ */
+
+#ifdef WIN32
+ if (dev == DEV_TYPE_TUN && !(pull || (options->ifconfig_local && options->ifconfig_remote_netmask)))
+ msg (M_USAGE, "On Windows, --ifconfig is required when --dev tun is used");
+
+ if ((options->tuntap_options.ip_win32_defined)
+ && !(pull || (options->ifconfig_local && options->ifconfig_remote_netmask)))
+ msg (M_USAGE, "On Windows, --ip-win32 doesn't make sense unless --ifconfig is also used");
+
+ if (options->tuntap_options.dhcp_options
+ && options->tuntap_options.ip_win32_type != IPW32_SET_DHCP_MASQ
+ && options->tuntap_options.ip_win32_type != IPW32_SET_ADAPTIVE)
+ msg (M_USAGE, "--dhcp-options requires --ip-win32 dynamic or adaptive");
+#endif
+
+ /*
+ * Check that protocol options make sense.
+ */
+
+#ifdef ENABLE_FRAGMENT
+ if (!proto_is_udp(ce->proto) && ce->fragment)
+ msg (M_USAGE, "--fragment can only be used with --proto udp");
+#endif
+
+#ifdef ENABLE_OCC
+ if (!proto_is_udp(ce->proto) && ce->explicit_exit_notification)
+ msg (M_USAGE, "--explicit-exit-notify can only be used with --proto udp");
+#endif
+
+ if (!ce->remote && ce->proto == PROTO_TCP_CLIENT)
+ msg (M_USAGE, "--remote MUST be used in TCP Client mode");
+
+ if ((ce->http_proxy_options) && ce->proto != PROTO_TCP_CLIENT)
+ msg (M_USAGE, "--http-proxy MUST be used in TCP Client mode (i.e. --proto tcp-client)");
+ if ((ce->http_proxy_options) && !ce->http_proxy_options->server)
+ msg (M_USAGE, "--http-proxy not specified but other http proxy options present");
+
+ if (ce->http_proxy_options && ce->socks_proxy_server)
+ msg (M_USAGE, "--http-proxy can not be used together with --socks-proxy");
+
+ if (ce->socks_proxy_server && ce->proto == PROTO_TCP_SERVER)
+ msg (M_USAGE, "--socks-proxy can not be used in TCP Server mode");
+
+ if (ce->proto == PROTO_TCP_SERVER && (options->connection_list->len > 1))
+ msg (M_USAGE, "TCP server mode allows at most one --remote address");
+
+ if (options->routes && ((options->routes->flags & RG_BLOCK_LOCAL) && (options->routes->flags & RG_UNBLOCK_LOCAL)))
+ msg (M_USAGE, "unblock-local and block-local options of redirect-gateway/redirect-private are mutatlly exclusive");
+
+#if P2MP_SERVER
+
+ /*
+ * Check consistency of --mode server options.
+ */
+ if (options->mode == MODE_SERVER)
+ {
+ if (!(dev == DEV_TYPE_TUN || dev == DEV_TYPE_TAP))
+ msg (M_USAGE, "--mode server only works with --dev tun or --dev tap");
+ if (options->pull)
+ msg (M_USAGE, "--pull cannot be used with --mode server");
+ if (!(proto_is_udp(ce->proto) || ce->proto == PROTO_TCP_SERVER))
+ msg (M_USAGE, "--mode server currently only supports "
+ "--proto udp or --proto tcp-server or proto tcp6-server");
+#if PORT_SHARE
+ if ((options->port_share_host || options->port_share_port) &&
+ (ce->proto != PROTO_TCP_SERVER))
+ msg (M_USAGE, "--port-share only works in TCP server mode "
+ "(--proto tcp-server or tcp6-server)");
+#endif
+ if (!options->tls_server)
+ msg (M_USAGE, "--mode server requires --tls-server");
+ if (ce->remote)
+ msg (M_USAGE, "--remote cannot be used with --mode server");
+ if (!ce->bind_local)
+ msg (M_USAGE, "--nobind cannot be used with --mode server");
+ if (ce->http_proxy_options)
+ msg (M_USAGE, "--http-proxy cannot be used with --mode server");
+ if (ce->socks_proxy_server)
+ msg (M_USAGE, "--socks-proxy cannot be used with --mode server");
+ /* <connection> blocks force to have a remote embedded, so we check for the
+ * --remote and bail out if it is present */
+ if (options->connection_list->len >1 ||
+ options->connection_list->array[0]->remote)
+ msg (M_USAGE, "<connection> cannot be used with --mode server");
+
+#if 0
+ if (options->tun_ipv6)
+ msg (M_USAGE, "--tun-ipv6 cannot be used with --mode server");
+#endif
+ if (options->shaper)
+ msg (M_USAGE, "--shaper cannot be used with --mode server");
+ if (options->inetd)
+ msg (M_USAGE, "--inetd cannot be used with --mode server");
+ if (options->ipchange)
+ msg (M_USAGE, "--ipchange cannot be used with --mode server (use --client-connect instead)");
+ if (!(proto_is_dgram(ce->proto) || ce->proto == PROTO_TCP_SERVER))
+ msg (M_USAGE, "--mode server currently only supports "
+ "--proto udp or --proto tcp-server or --proto tcp6-server");
+ if (!proto_is_udp(ce->proto) && (options->cf_max || options->cf_per))
+ msg (M_USAGE, "--connect-freq only works with --mode server --proto udp. Try --max-clients instead.");
+ if (!(dev == DEV_TYPE_TAP || (dev == DEV_TYPE_TUN && options->topology == TOP_SUBNET)) && options->ifconfig_pool_netmask)
+ msg (M_USAGE, "The third parameter to --ifconfig-pool (netmask) is only valid in --dev tap mode");
+#ifdef ENABLE_OCC
+ if (ce->explicit_exit_notification)
+ msg (M_USAGE, "--explicit-exit-notify cannot be used with --mode server");
+#endif
+ if (options->routes && (options->routes->flags & RG_ENABLE))
+ msg (M_USAGE, "--redirect-gateway cannot be used with --mode server (however --push \"redirect-gateway\" is fine)");
+
+ if (options->route_delay_defined)
+ msg (M_USAGE, "--route-delay cannot be used with --mode server");
+ if (options->up_delay)
+ msg (M_USAGE, "--up-delay cannot be used with --mode server");
+ if (!options->ifconfig_pool_defined && options->ifconfig_pool_persist_filename)
+ msg (M_USAGE, "--ifconfig-pool-persist must be used with --ifconfig-pool");
+ if (options->ifconfig_ipv6_pool_defined && !options->ifconfig_ipv6_local )
+ msg (M_USAGE, "--ifconfig-ipv6-pool needs --ifconfig-ipv6");
+ if (options->ifconfig_ipv6_local && !options->tun_ipv6 )
+ msg (M_INFO, "Warning: --ifconfig-ipv6 without --tun-ipv6 will not do IPv6");
+
+ if (options->auth_user_pass_file)
+ msg (M_USAGE, "--auth-user-pass cannot be used with --mode server (it should be used on the client side only)");
+ if (options->ccd_exclusive && !options->client_config_dir)
+ msg (M_USAGE, "--ccd-exclusive must be used with --client-config-dir");
+ if (options->key_method != 2)
+ msg (M_USAGE, "--mode server requires --key-method 2");
+
+ {
+ const bool ccnr = (options->auth_user_pass_verify_script
+ || PLUGIN_OPTION_LIST (options)
+ || MAN_CLIENT_AUTH_ENABLED (options));
+ const char *postfix = "must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
+ if ((options->ssl_flags & SSLF_CLIENT_CERT_NOT_REQUIRED) && !ccnr)
+ msg (M_USAGE, "--client-cert-not-required %s", postfix);
+ if ((options->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) && !ccnr)
+ msg (M_USAGE, "--username-as-common-name %s", postfix);
+ if ((options->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL) && !ccnr)
+ msg (M_USAGE, "--auth-user-pass-optional %s", postfix);
+ }
+ }
+ else
+ {
+ /*
+ * When not in server mode, err if parameters are
+ * specified which require --mode server.
+ */
+ if (options->ifconfig_pool_defined || options->ifconfig_pool_persist_filename)
+ msg (M_USAGE, "--ifconfig-pool/--ifconfig-pool-persist requires --mode server");
+ if (options->ifconfig_ipv6_pool_defined)
+ msg (M_USAGE, "--ifconfig-ipv6-pool requires --mode server");
+ if (options->real_hash_size != defaults.real_hash_size
+ || options->virtual_hash_size != defaults.virtual_hash_size)
+ msg (M_USAGE, "--hash-size requires --mode server");
+ if (options->learn_address_script)
+ msg (M_USAGE, "--learn-address requires --mode server");
+ if (options->client_connect_script)
+ msg (M_USAGE, "--client-connect requires --mode server");
+ if (options->client_disconnect_script)
+ msg (M_USAGE, "--client-disconnect requires --mode server");
+ if (options->client_config_dir || options->ccd_exclusive)
+ msg (M_USAGE, "--client-config-dir/--ccd-exclusive requires --mode server");
+ if (options->enable_c2c)
+ msg (M_USAGE, "--client-to-client requires --mode server");
+ if (options->duplicate_cn)
+ msg (M_USAGE, "--duplicate-cn requires --mode server");
+ if (options->cf_max || options->cf_per)
+ msg (M_USAGE, "--connect-freq requires --mode server");
+ if (options->ssl_flags & SSLF_CLIENT_CERT_NOT_REQUIRED)
+ msg (M_USAGE, "--client-cert-not-required requires --mode server");
+ if (options->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME)
+ msg (M_USAGE, "--username-as-common-name requires --mode server");
+ if (options->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL)
+ msg (M_USAGE, "--auth-user-pass-optional requires --mode server");
+ if (options->ssl_flags & SSLF_OPT_VERIFY)
+ msg (M_USAGE, "--opt-verify requires --mode server");
+ if (options->server_flags & SF_TCP_NODELAY_HELPER)
+ msg (M_USAGE, "--tcp-nodelay requires --mode server");
+ if (options->auth_user_pass_verify_script)
+ msg (M_USAGE, "--auth-user-pass-verify requires --mode server");
+#if PORT_SHARE
+ if (options->port_share_host || options->port_share_port)
+ msg (M_USAGE, "--port-share requires TCP server mode (--mode server --proto tcp-server)");
+#endif
+
+ if (options->stale_routes_check_interval)
+ msg (M_USAGE, "--stale-routes-check requires --mode server");
+ if (compat_flag (COMPAT_FLAG_QUERY | COMPAT_NO_NAME_REMAPPING))
+ msg (M_USAGE, "--compat-x509-names no-remapping requires --mode server");
+ }
+#endif /* P2MP_SERVER */
+
+#ifdef ENABLE_CRYPTO
+
+ /*
+ * Check consistency of replay options
+ */
+ if ((!proto_is_udp(ce->proto))
+ && (options->replay_window != defaults.replay_window
+ || options->replay_time != defaults.replay_time))
+ msg (M_USAGE, "--replay-window only makes sense with --proto udp");
+
+ if (!options->replay
+ && (options->replay_window != defaults.replay_window
+ || options->replay_time != defaults.replay_time))
+ msg (M_USAGE, "--replay-window doesn't make sense when replay protection is disabled with --no-replay");
+
+ /*
+ * SSL/TLS mode sanity checks.
+ */
+
+#ifdef ENABLE_SSL
+ if (options->tls_server + options->tls_client +
+ (options->shared_secret_file != NULL) > 1)
+ msg (M_USAGE, "specify only one of --tls-server, --tls-client, or --secret");
+
+ if (options->tls_server)
+ {
+ notnull (options->dh_file, "DH file (--dh)");
+ }
+ if (options->tls_server || options->tls_client)
+ {
+#ifdef ENABLE_PKCS11
+ if (options->pkcs11_providers[0])
+ {
+ notnull (options->ca_file, "CA file (--ca)");
+
+ if (options->pkcs11_id_management && options->pkcs11_id != NULL)
+ msg(M_USAGE, "Parameter --pkcs11-id cannot be used when --pkcs11-id-management is also specified.");
+ if (!options->pkcs11_id_management && options->pkcs11_id == NULL)
+ msg(M_USAGE, "Parameter --pkcs11-id or --pkcs11-id-management should be specified.");
+ if (options->cert_file)
+ msg(M_USAGE, "Parameter --cert cannot be used when --pkcs11-provider is also specified.");
+ if (options->priv_key_file)
+ msg(M_USAGE, "Parameter --key cannot be used when --pkcs11-provider is also specified.");
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if (options->management_flags & MF_EXTERNAL_KEY)
+ msg(M_USAGE, "Parameter --management-external-key cannot be used when --pkcs11-provider is also specified.");
+#endif
+ if (options->pkcs12_file)
+ msg(M_USAGE, "Parameter --pkcs12 cannot be used when --pkcs11-provider is also specified.");
+#ifdef ENABLE_CRYPTOAPI
+ if (options->cryptoapi_cert)
+ msg(M_USAGE, "Parameter --cryptoapicert cannot be used when --pkcs11-provider is also specified.");
+#endif
+ }
+ else
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if((options->management_flags & MF_EXTERNAL_KEY) && options->priv_key_file)
+ {
+ msg (M_USAGE, "--key and --management-external-key are mutually exclusive");
+ }
+ else
+#endif
+#ifdef ENABLE_CRYPTOAPI
+ if (options->cryptoapi_cert)
+ {
+ if ((!(options->ca_file)) && (!(options->ca_path)))
+ msg(M_USAGE, "You must define CA file (--ca) or CA path (--capath)");
+ if (options->cert_file)
+ msg(M_USAGE, "Parameter --cert cannot be used when --cryptoapicert is also specified.");
+ if (options->priv_key_file)
+ msg(M_USAGE, "Parameter --key cannot be used when --cryptoapicert is also specified.");
+ if (options->pkcs12_file)
+ msg(M_USAGE, "Parameter --pkcs12 cannot be used when --cryptoapicert is also specified.");
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if (options->management_flags & MF_EXTERNAL_KEY)
+ msg(M_USAGE, "Parameter --management-external-key cannot be used when --cryptoapicert is also specified.");
+#endif
+ }
+ else
+#endif
+ if (options->pkcs12_file)
+ {
+#ifdef ENABLE_CRYPTO_POLARSSL
+ msg(M_USAGE, "Parameter --pkcs12 cannot be used with the PolarSSL version version of OpenVPN.");
+#else
+ if (options->ca_path)
+ msg(M_USAGE, "Parameter --capath cannot be used when --pkcs12 is also specified.");
+ if (options->cert_file)
+ msg(M_USAGE, "Parameter --cert cannot be used when --pkcs12 is also specified.");
+ if (options->priv_key_file)
+ msg(M_USAGE, "Parameter --key cannot be used when --pkcs12 is also specified.");
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if (options->management_flags & MF_EXTERNAL_KEY)
+ msg(M_USAGE, "Parameter --external-management-key cannot be used when --pkcs12 is also specified.");
+#endif
+#endif
+ }
+ else
+ {
+#ifdef ENABLE_CRYPTO_POLARSSL
+ if (!(options->ca_file))
+ msg(M_USAGE, "You must define CA file (--ca)");
+ if (options->ca_path)
+ msg(M_USAGE, "Parameter --capath cannot be used with the PolarSSL version version of OpenVPN.");
+#else
+ if ((!(options->ca_file)) && (!(options->ca_path)))
+ msg(M_USAGE, "You must define CA file (--ca) or CA path (--capath)");
+#endif
+ if (pull)
+ {
+
+ const int sum = (options->cert_file != NULL) +
+#ifdef MANAGMENT_EXTERNAL_KEY
+ ((options->priv_key_file != NULL) || (options->management_flags & MF_EXTERNAL_KEY));
+#else
+ (options->priv_key_file != NULL);
+#endif
+
+
+ if (sum == 0)
+ {
+#if P2MP
+ if (!options->auth_user_pass_file)
+#endif
+ msg (M_USAGE, "No client-side authentication method is specified. You must use either --cert/--key, --pkcs12, or --auth-user-pass");
+ }
+ else if (sum == 2)
+ ;
+ else
+ {
+ msg (M_USAGE, "If you use one of --cert or --key, you must use them both");
+ }
+ }
+ else
+ {
+ notnull (options->cert_file, "certificate file (--cert) or PKCS#12 file (--pkcs12)");
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if (!(options->management_flags & MF_EXTERNAL_KEY))
+#endif
+ notnull (options->priv_key_file, "private key file (--key) or PKCS#12 file (--pkcs12)");
+ }
+ }
+ }
+ else
+ {
+ /*
+ * Make sure user doesn't specify any TLS options
+ * when in non-TLS mode.
+ */
+
+#define MUST_BE_UNDEF(parm) if (options->parm != defaults.parm) msg (M_USAGE, err, #parm);
+
+ const char err[] = "Parameter %s can only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified.";
+
+ MUST_BE_UNDEF (ca_file);
+ MUST_BE_UNDEF (ca_path);
+ MUST_BE_UNDEF (dh_file);
+ MUST_BE_UNDEF (cert_file);
+ MUST_BE_UNDEF (priv_key_file);
+#ifndef ENABLE_CRYPTO_POLARSSL
+ MUST_BE_UNDEF (pkcs12_file);
+#endif
+ MUST_BE_UNDEF (cipher_list);
+ MUST_BE_UNDEF (tls_verify);
+ MUST_BE_UNDEF (tls_export_cert);
+ MUST_BE_UNDEF (verify_x509_name);
+ MUST_BE_UNDEF (tls_timeout);
+ MUST_BE_UNDEF (renegotiate_bytes);
+ MUST_BE_UNDEF (renegotiate_packets);
+ MUST_BE_UNDEF (renegotiate_seconds);
+ MUST_BE_UNDEF (handshake_window);
+ MUST_BE_UNDEF (transition_window);
+ MUST_BE_UNDEF (tls_auth_file);
+ MUST_BE_UNDEF (single_session);
+#ifdef ENABLE_PUSH_PEER_INFO
+ MUST_BE_UNDEF (push_peer_info);
+#endif
+ MUST_BE_UNDEF (tls_exit);
+ MUST_BE_UNDEF (crl_file);
+ MUST_BE_UNDEF (key_method);
+ MUST_BE_UNDEF (ns_cert_type);
+ MUST_BE_UNDEF (remote_cert_ku[0]);
+ MUST_BE_UNDEF (remote_cert_eku);
+#ifdef ENABLE_PKCS11
+ MUST_BE_UNDEF (pkcs11_providers[0]);
+ MUST_BE_UNDEF (pkcs11_private_mode[0]);
+ MUST_BE_UNDEF (pkcs11_id);
+ MUST_BE_UNDEF (pkcs11_id_management);
+#endif
+
+ if (pull)
+ msg (M_USAGE, err, "--pull");
+ }
+#undef MUST_BE_UNDEF
+#endif /* ENABLE_CRYPTO */
+#endif /* ENABLE_SSL */
+
+#if P2MP
+ if (options->auth_user_pass_file && !options->pull)
+ msg (M_USAGE, "--auth-user-pass requires --pull");
+#endif
+
+ uninit_options (&defaults);
+}
+
+static void
+options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce)
+{
+ const int dev = dev_type_enum (o->dev, o->dev_type);
+
+#if P2MP_SERVER
+ if (o->server_defined || o->server_bridge_defined || o->server_bridge_proxy_dhcp)
+ {
+ if (ce->proto == PROTO_TCP)
+ ce->proto = PROTO_TCP_SERVER;
+ }
+#endif
+#if P2MP
+ if (o->client)
+ {
+ if (ce->proto == PROTO_TCP)
+ ce->proto = PROTO_TCP_CLIENT;
+ }
+#endif
+
+ if (ce->proto == PROTO_TCP_CLIENT && !ce->local && !ce->local_port_defined && !ce->bind_defined)
+ ce->bind_local = false;
+
+ if (ce->proto == PROTO_UDP && ce->socks_proxy_server && !ce->local && !ce->local_port_defined && !ce->bind_defined)
+ ce->bind_local = false;
+
+ if (!ce->bind_local)
+ ce->local_port = NULL;
+
+ /* if protocol forcing is enabled, disable all protocols except for the forced one */
+ if (o->proto_force >= 0 && o->proto_force != ce->proto)
+ ce->flags |= CE_DISABLED;
+
+ /*
+ * If --mssfix is supplied without a parameter, default
+ * it to --fragment value, if --fragment is specified.
+ */
+ if (o->ce.mssfix_default)
+ {
+#ifdef ENABLE_FRAGMENT
+ if (ce->fragment)
+ o->ce.mssfix = ce->fragment;
+#else
+ msg (M_USAGE, "--mssfix must specify a parameter");
+#endif
+ }
+
+ /*
+ * Set MTU defaults
+ */
+ {
+ if (!ce->tun_mtu_defined && !ce->link_mtu_defined)
+ {
+ ce->tun_mtu_defined = true;
+ }
+ if ((dev == DEV_TYPE_TAP) && !ce->tun_mtu_extra_defined)
+ {
+ ce->tun_mtu_extra_defined = true;
+ ce->tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT;
+ }
+ }
+
+}
+
+static void
+options_postprocess_mutate_invariant (struct options *options)
+{
+#ifdef WIN32
+ const int dev = dev_type_enum (options->dev, options->dev_type);
+#endif
+
+ /*
+ * In forking TCP server mode, you don't need to ifconfig
+ * the tap device (the assumption is that it will be bridged).
+ */
+ if (options->inetd == INETD_NOWAIT)
+ options->ifconfig_noexec = true;
+
+#ifdef WIN32
+ if ((dev == DEV_TYPE_TUN || dev == DEV_TYPE_TAP) && !options->route_delay_defined)
+ {
+ if (options->mode == MODE_POINT_TO_POINT)
+ {
+ options->route_delay_defined = true;
+ options->route_delay = 5; /* Vista sometimes has a race without this */
+ }
+ }
+
+ if (options->ifconfig_noexec)
+ {
+ options->tuntap_options.ip_win32_type = IPW32_SET_MANUAL;
+ options->ifconfig_noexec = false;
+ }
+#endif
+
+#if P2MP_SERVER
+ /*
+ * Check consistency of --mode server options.
+ */
+ if (options->mode == MODE_SERVER)
+ {
+#ifdef WIN32
+ /*
+ * We need to explicitly set --tap-sleep because
+ * we do not schedule event timers in the top-level context.
+ */
+ options->tuntap_options.tap_sleep = 10;
+ if (options->route_delay_defined && options->route_delay)
+ options->tuntap_options.tap_sleep = options->route_delay;
+ options->route_delay_defined = false;
+#endif
+ }
+#endif
+}
+
+static void
+options_postprocess_verify (const struct options *o)
+{
+ if (o->connection_list)
+ {
+ int i;
+ for (i = 0; i < o->connection_list->len; ++i)
+ options_postprocess_verify_ce (o, o->connection_list->array[i]);
+ }
+ else
+ options_postprocess_verify_ce (o, &o->ce);
+}
+
+static void
+options_postprocess_mutate (struct options *o)
+{
+ int i;
+ /*
+ * Process helper-type options which map to other, more complex
+ * sequences of options.
+ */
+ helper_client_server (o);
+ helper_keepalive (o);
+ helper_tcp_nodelay (o);
+
+ options_postprocess_mutate_invariant (o);
+
+ if (o->remote_list && !o->connection_list)
+ {
+ /*
+ * Convert remotes into connection list
+ */
+ const struct remote_list *rl = o->remote_list;
+ for (i = 0; i < rl->len; ++i)
+ {
+ const struct remote_entry *re = rl->array[i];
+ struct connection_entry ce = o->ce;
+ struct connection_entry *ace;
+
+ ASSERT (re->remote);
+ connection_entry_load_re (&ce, re);
+ ace = alloc_connection_entry (o, M_USAGE);
+ ASSERT (ace);
+ *ace = ce;
+ }
+ }
+ else if(!o->remote_list && !o->connection_list)
+ {
+ struct connection_entry *ace;
+ ace = alloc_connection_entry (o, M_USAGE);
+ ASSERT (ace);
+ *ace = o->ce;
+ }
+
+ ASSERT (o->connection_list);
+ for (i = 0; i < o->connection_list->len; ++i)
+ options_postprocess_mutate_ce (o, o->connection_list->array[i]);
+
+#if ENABLE_MANAGEMENT
+ if (o->http_proxy_override)
+ options_postprocess_http_proxy_override(o);
+#endif
+
+#if P2MP
+ /*
+ * Save certain parms before modifying options via --pull
+ */
+ pre_pull_save (o);
+#endif
+}
+
+/*
+ * Check file/directory sanity
+ *
+ */
+#ifndef ENABLE_SMALL /** Expect people using the stripped down version to know what they do */
+
+#define CHKACC_FILE (1<<0) /** Check for a file/directory precense */
+#define CHKACC_DIRPATH (1<<1) /** Check for directory precense where a file should reside */
+#define CHKACC_FILEXSTWR (1<<2) /** If file exists, is it writable? */
+#define CHKACC_INLINE (1<<3) /** File is present if it's an inline file */
+#define CHKACC_ACPTSTDIN (1<<4) /** If filename is stdin, it's allowed and "exists" */
+
+static bool
+check_file_access(const int type, const char *file, const int mode, const char *opt)
+{
+ int errcode = 0;
+
+ /* If no file configured, no errors to look for */
+ if (!file)
+ return false;
+
+ /* If this may be an inline file, and the proper inline "filename" is set - no issues */
+ if ((type & CHKACC_INLINE) && streq(file, INLINE_FILE_TAG) )
+ return false;
+
+ /* If stdin is allowed and the file name is 'stdin', then do no
+ * further checks as stdin is always available
+ */
+ if( (type & CHKACC_ACPTSTDIN) && streq(file, "stdin") )
+ return false;
+
+ /* Is the directory path leading to the given file accessible? */
+ if (type & CHKACC_DIRPATH)
+ {
+ char *fullpath = strdup(file); /* POSIX dirname() implementaion may modify its arguments */
+ char *dirpath = dirname(fullpath);
+
+ if (platform_access (dirpath, mode|X_OK) != 0)
+ errcode = errno;
+ free(fullpath);
+ }
+
+ /* Is the file itself accessible? */
+ if (!errcode && (type & CHKACC_FILE) && (platform_access (file, mode) != 0) )
+ errcode = errno;
+
+ /* If the file exists and is accessible, is it writable? */
+ if (!errcode && (type & CHKACC_FILEXSTWR) && (platform_access (file, F_OK) == 0) )
+ if (platform_access (file, W_OK) != 0)
+ errcode = errno;
+
+ /* Scream if an error is found */
+ if( errcode > 0 )
+ msg (M_NOPREFIX|M_OPTERR, "%s fails with '%s': %s",
+ opt, file, strerror(errno));
+
+ /* Return true if an error occured */
+ return (errcode != 0 ? true : false);
+}
+
+/* A wrapper for check_file_access() which also takes a chroot directory.
+ * If chroot is NULL, behaviour is exactly the same as calling check_file_access() directly,
+ * otherwise it will look for the file inside the given chroot directory instead.
+ */
+static bool
+check_file_access_chroot(const char *chroot, const int type, const char *file, const int mode, const char *opt)
+{
+ bool ret = false;
+
+ /* If no file configured, no errors to look for */
+ if (!file)
+ return false;
+
+ /* If chroot is set, look for the file/directory inside the chroot */
+ if( chroot )
+ {
+ struct gc_arena gc = gc_new();
+ struct buffer chroot_file;
+ int len = 0;
+
+ /* Build up a new full path including chroot directory */
+ len = strlen(chroot) + strlen(PATH_SEPARATOR_STR) + strlen(file) + 1;
+ chroot_file = alloc_buf_gc(len, &gc);
+ buf_printf(&chroot_file, "%s%s%s", chroot, PATH_SEPARATOR_STR, file);
+ ASSERT (chroot_file.len > 0);
+
+ ret = check_file_access(type, BSTR(&chroot_file), mode, opt);
+ gc_free(&gc);
+ }
+ else
+ {
+ /* No chroot in play, just call core file check function */
+ ret = check_file_access(type, file, mode, opt);
+ }
+ return ret;
+}
+
+
+/*
+ * Verifies that the path in the "command" that comes after certain script options (e.g., --up) is a
+ * valid file with appropriate permissions.
+ *
+ * "command" consists of a path, optionally followed by a space, which may be
+ * followed by arbitrary arguments. It is NOT a full shell command line -- shell expansion is not
+ * performed.
+ *
+ * The path and arguments in "command" may be single- or double-quoted or escaped.
+ *
+ * The path is extracted from "command", then check_file_access() is called to check it. The
+ * arguments, if any, are ignored.
+ *
+ * Note that the type, mode, and opt arguments to this routine are the same as the corresponding
+ * check_file_access() arguments.
+ */
+static bool
+check_cmd_access(const char *command, const char *opt, const char *chroot)
+{
+ struct argv argv;
+ bool return_code;
+
+ /* If no command was set, there are no errors to look for */
+ if (! command)
+ return false;
+
+ /* Extract executable path and arguments */
+ argv = argv_new ();
+ argv_printf (&argv, "%sc", command);
+
+ /* if an executable is specified then check it; otherwise, complain */
+ if (argv.argv[0])
+ /* Scripts requires R_OK as well, but that might fail on binaries which
+ * only requires X_OK to function on Unix - a scenario not unlikely to
+ * be seen on suid binaries.
+ */
+ return_code = check_file_access_chroot(chroot, CHKACC_FILE, argv.argv[0], X_OK, opt);
+ else
+ {
+ msg (M_NOPREFIX|M_OPTERR, "%s fails with '%s': No path to executable.",
+ opt, command);
+ return_code = true;
+ }
+
+ argv_reset (&argv);
+
+ return return_code;
+}
+
+/*
+ * Sanity check of all file/dir options. Checks that file/dir
+ * is accessible by OpenVPN
+ */
+static void
+options_postprocess_filechecks (struct options *options)
+{
+ bool errs = false;
+
+ /* ** SSL/TLS/crypto related files ** */
+#ifdef ENABLE_SSL
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->dh_file, R_OK, "--dh");
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->ca_file, R_OK, "--ca");
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->ca_path, R_OK, "--capath");
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->cert_file, R_OK, "--cert");
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->extra_certs_file, R_OK,
+ "--extra-certs");
+#ifdef MANAGMENT_EXTERNAL_KEY
+ if(!(options->management_flags & MF_EXTERNAL_KEY))
+#endif
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->priv_key_file, R_OK,
+ "--key");
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->pkcs12_file, R_OK,
+ "--pkcs12");
+
+ if (options->ssl_flags & SSLF_CRL_VERIFY_DIR)
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->crl_file, R_OK|X_OK,
+ "--crl-verify directory");
+ else
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->crl_file, R_OK,
+ "--crl-verify");
+
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->tls_auth_file, R_OK,
+ "--tls-auth");
+#endif /* ENABLE_SSL */
+#ifdef ENABLE_CRYPTO
+ errs |= check_file_access (CHKACC_FILE|CHKACC_INLINE, options->shared_secret_file, R_OK,
+ "--secret");
+ errs |= check_file_access (CHKACC_DIRPATH|CHKACC_FILEXSTWR,
+ options->packet_id_file, R_OK|W_OK, "--replay-persist");
+#endif /* ENABLE_CRYPTO */
+
+
+ /* ** Password files ** */
+#ifdef ENABLE_SSL
+ errs |= check_file_access (CHKACC_FILE, options->key_pass_file, R_OK,
+ "--askpass");
+#endif /* ENABLE_SSL */
+#ifdef ENABLE_MANAGEMENT
+ errs |= check_file_access (CHKACC_FILE|CHKACC_ACPTSTDIN,
+ options->management_user_pass, R_OK,
+ "--management user/password file");
+#endif /* ENABLE_MANAGEMENT */
+#if P2MP
+ errs |= check_file_access (CHKACC_FILE|CHKACC_ACPTSTDIN,
+ options->auth_user_pass_file, R_OK,
+ "--auth-user-pass");
+#endif /* P2MP */
+
+ /* ** System related ** */
+ errs |= check_file_access (CHKACC_FILE, options->chroot_dir,
+ R_OK|X_OK, "--chroot directory");
+ errs |= check_file_access (CHKACC_DIRPATH|CHKACC_FILEXSTWR, options->writepid,
+ R_OK|W_OK, "--writepid");
+
+ /* ** Log related ** */
+ errs |= check_file_access (CHKACC_DIRPATH|CHKACC_FILEXSTWR, options->status_file,
+ R_OK|W_OK, "--status");
+
+ /* ** Config related ** */
+#ifdef ENABLE_SSL
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->tls_export_cert,
+ R_OK|W_OK|X_OK, "--tls-export-cert");
+#endif /* ENABLE_SSL */
+#if P2MP_SERVER
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->client_config_dir,
+ R_OK|X_OK, "--client-config-dir");
+ errs |= check_file_access_chroot (options->chroot_dir, CHKACC_FILE, options->tmp_dir,
+ R_OK|W_OK|X_OK, "Temporary directory (--tmp-dir)");
+
+#endif /* P2MP_SERVER */
+
+ if (errs)
+ msg (M_USAGE, "Please correct these errors.");
+}
+#endif /* !ENABLE_SMALL */
+
+/*
+ * Sanity check on options.
+ * Also set some options based on other
+ * options.
+ */
+void
+options_postprocess (struct options *options)
+{
+ options_postprocess_mutate (options);
+ options_postprocess_verify (options);
+#ifndef ENABLE_SMALL
+ options_postprocess_filechecks (options);
+#endif /* !ENABLE_SMALL */
+}
+
+#if P2MP
+
+/*
+ * Save/Restore certain option defaults before --pull is applied.
+ */
+
+void
+pre_pull_save (struct options *o)
+{
+ if (o->pull)
+ {
+ ALLOC_OBJ_CLEAR_GC (o->pre_pull, struct options_pre_pull, &o->gc);
+ o->pre_pull->tuntap_options = o->tuntap_options;
+ o->pre_pull->tuntap_options_defined = true;
+ o->pre_pull->foreign_option_index = o->foreign_option_index;
+ if (o->routes)
+ {
+ o->pre_pull->routes = clone_route_option_list(o->routes, &o->gc);
+ o->pre_pull->routes_defined = true;
+ }
+ if (o->routes_ipv6)
+ {
+ o->pre_pull->routes_ipv6 = clone_route_ipv6_option_list(o->routes_ipv6, &o->gc);
+ o->pre_pull->routes_ipv6_defined = true;
+ }
+ if (o->client_nat)
+ {
+ o->pre_pull->client_nat = clone_client_nat_option_list(o->client_nat, &o->gc);
+ o->pre_pull->client_nat_defined = true;
+ }
+ }
+}
+
+void
+pre_pull_restore (struct options *o, struct gc_arena *gc)
+{
+ const struct options_pre_pull *pp = o->pre_pull;
+ if (pp)
+ {
+ CLEAR (o->tuntap_options);
+ if (pp->tuntap_options_defined)
+ o->tuntap_options = pp->tuntap_options;
+
+ if (pp->routes_defined)
+ {
+ rol_check_alloc (o);
+ copy_route_option_list (o->routes, pp->routes, gc);
+ }
+ else
+ o->routes = NULL;
+
+ if (pp->routes_ipv6_defined)
+ {
+ rol6_check_alloc (o);
+ copy_route_ipv6_option_list (o->routes_ipv6, pp->routes_ipv6, gc);
+ }
+ else
+ o->routes_ipv6 = NULL;
+
+ if (pp->client_nat_defined)
+ {
+ cnol_check_alloc (o);
+ copy_client_nat_option_list (o->client_nat, pp->client_nat);
+ }
+ else
+ o->client_nat = NULL;
+
+ o->foreign_option_index = pp->foreign_option_index;
+ }
+
+ o->push_continuation = 0;
+ o->push_option_types_found = 0;
+}
+
+#endif
+
+#ifdef ENABLE_OCC
+
+/*
+ * Build an options string to represent data channel encryption options.
+ * This string must match exactly between peers. The keysize is checked
+ * separately by read_key().
+ *
+ * The following options must match on both peers:
+ *
+ * Tunnel options:
+ *
+ * --dev tun|tap [unit number need not match]
+ * --dev-type tun|tap
+ * --link-mtu
+ * --udp-mtu
+ * --tun-mtu
+ * --proto udp
+ * --proto tcp-client [matched with --proto tcp-server
+ * on the other end of the connection]
+ * --proto tcp-server [matched with --proto tcp-client on
+ * the other end of the connection]
+ * --tun-ipv6
+ * --ifconfig x y [matched with --ifconfig y x on
+ * the other end of the connection]
+ *
+ * --comp-lzo
+ * --compress alg
+ * --fragment
+ *
+ * Crypto Options:
+ *
+ * --cipher
+ * --auth
+ * --keysize
+ * --secret
+ * --no-replay
+ * --no-iv
+ *
+ * SSL Options:
+ *
+ * --tls-auth
+ * --tls-client [matched with --tls-server on
+ * the other end of the connection]
+ * --tls-server [matched with --tls-client on
+ * the other end of the connection]
+ */
+
+char *
+options_string (const struct options *o,
+ const struct frame *frame,
+ struct tuntap *tt,
+ bool remote,
+ struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf (OPTION_LINE_SIZE);
+ bool tt_local = false;
+
+ buf_printf (&out, "V4");
+
+ /*
+ * Tunnel Options
+ */
+
+ buf_printf (&out, ",dev-type %s", dev_type_string (o->dev, o->dev_type));
+ buf_printf (&out, ",link-mtu %d", EXPANDED_SIZE (frame));
+ buf_printf (&out, ",tun-mtu %d", PAYLOAD_SIZE (frame));
+ buf_printf (&out, ",proto %s", proto_remote (o->ce.proto, remote));
+
+ /* send tun_ipv6 only in peer2peer mode - in client/server mode, it
+ * is usually pushed by the server, triggering a non-helpful warning
+ */
+ if (o->tun_ipv6 && o->mode == MODE_POINT_TO_POINT && !PULL_DEFINED(o))
+ buf_printf (&out, ",tun-ipv6");
+
+ /*
+ * Try to get ifconfig parameters into the options string.
+ * If tt is undefined, make a temporary instantiation.
+ */
+ if (!tt)
+ {
+ tt = init_tun (o->dev,
+ o->dev_type,
+ o->topology,
+ o->ifconfig_local,
+ o->ifconfig_remote_netmask,
+ o->ifconfig_ipv6_local,
+ o->ifconfig_ipv6_netbits,
+ o->ifconfig_ipv6_remote,
+ (in_addr_t)0,
+ (in_addr_t)0,
+ false,
+ NULL);
+ if (tt)
+ tt_local = true;
+ }
+
+ if (tt && o->mode == MODE_POINT_TO_POINT && !PULL_DEFINED(o))
+ {
+ const char *ios = ifconfig_options_string (tt, remote, o->ifconfig_nowarn, gc);
+ if (ios && strlen (ios))
+ buf_printf (&out, ",ifconfig %s", ios);
+ }
+ if (tt_local)
+ {
+ free (tt);
+ tt = NULL;
+ }
+
+#ifdef USE_COMP
+ if (o->comp.alg != COMP_ALG_UNDEF)
+ buf_printf (&out, ",comp-lzo"); /* for compatibility, this simply indicates that compression context is active, not necessarily LZO per-se */
+#endif
+
+#ifdef ENABLE_FRAGMENT
+ if (o->ce.fragment)
+ buf_printf (&out, ",mtu-dynamic");
+#endif
+
+#ifdef ENABLE_CRYPTO
+
+#ifdef ENABLE_SSL
+#define TLS_CLIENT (o->tls_client)
+#define TLS_SERVER (o->tls_server)
+#else
+#define TLS_CLIENT (false)
+#define TLS_SERVER (false)
+#endif
+
+ /*
+ * Key direction
+ */
+ {
+ const char *kd = keydirection2ascii (o->key_direction, remote);
+ if (kd)
+ buf_printf (&out, ",keydir %s", kd);
+ }
+
+ /*
+ * Crypto Options
+ */
+ if (o->shared_secret_file || TLS_CLIENT || TLS_SERVER)
+ {
+ struct key_type kt;
+
+ ASSERT ((o->shared_secret_file != NULL)
+ + (TLS_CLIENT == true)
+ + (TLS_SERVER == true)
+ <= 1);
+
+ init_key_type (&kt, o->ciphername, o->ciphername_defined,
+ o->authname, o->authname_defined,
+ o->keysize, true, false);
+
+ buf_printf (&out, ",cipher %s", cipher_kt_name (kt.cipher));
+ buf_printf (&out, ",auth %s", md_kt_name (kt.digest));
+ buf_printf (&out, ",keysize %d", kt.cipher_length * 8);
+ if (o->shared_secret_file)
+ buf_printf (&out, ",secret");
+ if (!o->replay)
+ buf_printf (&out, ",no-replay");
+ if (!o->use_iv)
+ buf_printf (&out, ",no-iv");
+
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ if (o->use_prediction_resistance)
+ buf_printf (&out, ",use-prediction-resistance");
+#endif
+ }
+
+#ifdef ENABLE_SSL
+ /*
+ * SSL Options
+ */
+ {
+ if (TLS_CLIENT || TLS_SERVER)
+ {
+ if (o->tls_auth_file)
+ buf_printf (&out, ",tls-auth");
+
+ if (o->key_method > 1)
+ buf_printf (&out, ",key-method %d", o->key_method);
+ }
+
+ if (remote)
+ {
+ if (TLS_CLIENT)
+ buf_printf (&out, ",tls-server");
+ else if (TLS_SERVER)
+ buf_printf (&out, ",tls-client");
+ }
+ else
+ {
+ if (TLS_CLIENT)
+ buf_printf (&out, ",tls-client");
+ else if (TLS_SERVER)
+ buf_printf (&out, ",tls-server");
+ }
+ }
+#endif /* ENABLE_SSL */
+
+#undef TLS_CLIENT
+#undef TLS_SERVER
+
+#endif /* ENABLE_CRYPTO */
+
+ return BSTR (&out);
+}
+
+/*
+ * Compare option strings for equality.
+ * If the first two chars of the strings differ, it means that
+ * we are looking at different versions of the options string,
+ * therefore don't compare them and return true.
+ */
+
+bool
+options_cmp_equal (char *actual, const char *expected)
+{
+ return options_cmp_equal_safe (actual, expected, strlen (actual) + 1);
+}
+
+void
+options_warning (char *actual, const char *expected)
+{
+ options_warning_safe (actual, expected, strlen (actual) + 1);
+}
+
+static const char *
+options_warning_extract_parm1 (const char *option_string,
+ struct gc_arena *gc_ret)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer b = string_alloc_buf (option_string, &gc);
+ char *p = gc_malloc (OPTION_PARM_SIZE, false, &gc);
+ const char *ret;
+
+ buf_parse (&b, ' ', p, OPTION_PARM_SIZE);
+ ret = string_alloc (p, gc_ret);
+ gc_free (&gc);
+ return ret;
+}
+
+static void
+options_warning_safe_scan2 (const int msglevel,
+ const int delim,
+ const bool report_inconsistent,
+ const char *p1,
+ const struct buffer *b2_src,
+ const char *b1_name,
+ const char *b2_name)
+{
+ /* we will stop sending 'proto xxx' in OCC in a future version
+ * (because it's not useful), and to reduce questions when
+ * interoperating, we start not-printing a warning about it today
+ */
+ if (strncmp(p1, "proto ", 6) == 0 )
+ {
+ return;
+ }
+
+ if (strlen (p1) > 0)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer b2 = *b2_src;
+ const char *p1_prefix = options_warning_extract_parm1 (p1, &gc);
+ char *p2 = gc_malloc (OPTION_PARM_SIZE, false, &gc);
+
+ while (buf_parse (&b2, delim, p2, OPTION_PARM_SIZE))
+ {
+ if (strlen (p2))
+ {
+ const char *p2_prefix = options_warning_extract_parm1 (p2, &gc);
+
+ if (!strcmp (p1, p2))
+ goto done;
+ if (!strcmp (p1_prefix, p2_prefix))
+ {
+ if (report_inconsistent)
+ msg (msglevel, "WARNING: '%s' is used inconsistently, %s='%s', %s='%s'",
+ safe_print (p1_prefix, &gc),
+ b1_name,
+ safe_print (p1, &gc),
+ b2_name,
+ safe_print (p2, &gc));
+ goto done;
+ }
+ }
+ }
+
+ msg (msglevel, "WARNING: '%s' is present in %s config but missing in %s config, %s='%s'",
+ safe_print (p1_prefix, &gc),
+ b1_name,
+ b2_name,
+ b1_name,
+ safe_print (p1, &gc));
+
+ done:
+ gc_free (&gc);
+ }
+}
+
+static void
+options_warning_safe_scan1 (const int msglevel,
+ const int delim,
+ const bool report_inconsistent,
+ const struct buffer *b1_src,
+ const struct buffer *b2_src,
+ const char *b1_name,
+ const char *b2_name)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer b = *b1_src;
+ char *p = gc_malloc (OPTION_PARM_SIZE, true, &gc);
+
+ while (buf_parse (&b, delim, p, OPTION_PARM_SIZE))
+ options_warning_safe_scan2 (msglevel, delim, report_inconsistent, p, b2_src, b1_name, b2_name);
+
+ gc_free (&gc);
+}
+
+static void
+options_warning_safe_ml (const int msglevel, char *actual, const char *expected, size_t actual_n)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (actual_n > 0)
+ {
+ struct buffer local = alloc_buf_gc (OPTION_PARM_SIZE + 16, &gc);
+ struct buffer remote = alloc_buf_gc (OPTION_PARM_SIZE + 16, &gc);
+ actual[actual_n - 1] = 0;
+
+ buf_printf (&local, "version %s", expected);
+ buf_printf (&remote, "version %s", actual);
+
+ options_warning_safe_scan1 (msglevel, ',', true,
+ &local, &remote,
+ "local", "remote");
+
+ options_warning_safe_scan1 (msglevel, ',', false,
+ &remote, &local,
+ "remote", "local");
+ }
+
+ gc_free (&gc);
+}
+
+bool
+options_cmp_equal_safe (char *actual, const char *expected, size_t actual_n)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = true;
+
+ if (actual_n > 0)
+ {
+ actual[actual_n - 1] = 0;
+#ifndef ENABLE_STRICT_OPTIONS_CHECK
+ if (strncmp (actual, expected, 2))
+ {
+ msg (D_SHOW_OCC, "NOTE: Options consistency check may be skewed by version differences");
+ options_warning_safe_ml (D_SHOW_OCC, actual, expected, actual_n);
+ }
+ else
+#endif
+ ret = !strcmp (actual, expected);
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+void
+options_warning_safe (char *actual, const char *expected, size_t actual_n)
+{
+ options_warning_safe_ml (M_WARN, actual, expected, actual_n);
+}
+
+const char *
+options_string_version (const char* s, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (4, gc);
+ strncpynt ((char *) BPTR (&out), s, 3);
+ return BSTR (&out);
+}
+
+#endif /* ENABLE_OCC */
+
+static void
+foreign_option (struct options *o, char *argv[], int len, struct env_set *es)
+{
+ if (len > 0)
+ {
+ struct gc_arena gc = gc_new();
+ struct buffer name = alloc_buf_gc (OPTION_PARM_SIZE, &gc);
+ struct buffer value = alloc_buf_gc (OPTION_PARM_SIZE, &gc);
+ int i;
+ bool first = true;
+ bool good = true;
+
+ good &= buf_printf (&name, "foreign_option_%d", o->foreign_option_index + 1);
+ ++o->foreign_option_index;
+ for (i = 0; i < len; ++i)
+ {
+ if (argv[i])
+ {
+ if (!first)
+ good &= buf_printf (&value, " ");
+ good &= buf_printf (&value, "%s", argv[i]);
+ first = false;
+ }
+ }
+ if (good)
+ setenv_str (es, BSTR(&name), BSTR(&value));
+ else
+ msg (M_WARN, "foreign_option: name/value overflow");
+ gc_free (&gc);
+ }
+}
+
+/*
+ * parse/print topology coding
+ */
+
+int
+parse_topology (const char *str, const int msglevel)
+{
+ if (streq (str, "net30"))
+ return TOP_NET30;
+ else if (streq (str, "p2p"))
+ return TOP_P2P;
+ else if (streq (str, "subnet"))
+ return TOP_SUBNET;
+ else
+ {
+ msg (msglevel, "--topology must be net30, p2p, or subnet");
+ return TOP_UNDEF;
+ }
+}
+
+const char *
+print_topology (const int topology)
+{
+ switch (topology)
+ {
+ case TOP_UNDEF:
+ return "undef";
+ case TOP_NET30:
+ return "net30";
+ case TOP_P2P:
+ return "p2p";
+ case TOP_SUBNET:
+ return "subnet";
+ default:
+ return "unknown";
+ }
+}
+
+#if P2MP
+
+/*
+ * Manage auth-retry variable
+ */
+
+static int global_auth_retry; /* GLOBAL */
+
+int
+auth_retry_get (void)
+{
+ return global_auth_retry;
+}
+
+bool
+auth_retry_set (const int msglevel, const char *option)
+{
+ if (streq (option, "interact"))
+ global_auth_retry = AR_INTERACT;
+ else if (streq (option, "nointeract"))
+ global_auth_retry = AR_NOINTERACT;
+ else if (streq (option, "none"))
+ global_auth_retry = AR_NONE;
+ else
+ {
+ msg (msglevel, "--auth-retry method must be 'interact', 'nointeract', or 'none'");
+ return false;
+ }
+ return true;
+}
+
+const char *
+auth_retry_print (void)
+{
+ switch (global_auth_retry)
+ {
+ case AR_NONE:
+ return "none";
+ case AR_NOINTERACT:
+ return "nointeract";
+ case AR_INTERACT:
+ return "interact";
+ default:
+ return "???";
+ }
+}
+
+#endif
+
+/*
+ * Print the help message.
+ */
+static void
+usage (void)
+{
+ FILE *fp = msg_fp(0);
+
+#ifdef ENABLE_SMALL
+
+ fprintf (fp, "Usage message not available\n");
+
+#else
+
+ struct options o;
+ init_options (&o, true);
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+ fprintf (fp, usage_message,
+ title_string,
+ o.ce.connect_retry_seconds,
+ o.ce.local_port, o.ce.remote_port,
+ TUN_MTU_DEFAULT, TAP_MTU_EXTRA_DEFAULT,
+ o.verbosity,
+ o.authname, o.ciphername,
+ o.replay_window, o.replay_time,
+ o.tls_timeout, o.renegotiate_seconds,
+ o.handshake_window, o.transition_window);
+#elif defined(ENABLE_CRYPTO)
+ fprintf (fp, usage_message,
+ title_string,
+ o.ce.connect_retry_seconds,
+ o.ce.local_port, o.ce.remote_port,
+ TUN_MTU_DEFAULT, TAP_MTU_EXTRA_DEFAULT,
+ o.verbosity,
+ o.authname, o.ciphername,
+ o.replay_window, o.replay_time);
+#else
+ fprintf (fp, usage_message,
+ title_string,
+ o.ce.connect_retry_seconds,
+ o.ce.local_port, o.ce.remote_port,
+ TUN_MTU_DEFAULT, TAP_MTU_EXTRA_DEFAULT,
+ o.verbosity);
+#endif
+ fflush(fp);
+
+#endif /* ENABLE_SMALL */
+
+ openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
+}
+
+void
+usage_small (void)
+{
+ msg (M_WARN|M_NOPREFIX, "Use --help for more information.");
+ openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
+}
+
+void
+show_library_versions(const unsigned int flags)
+{
+#ifdef ENABLE_SSL
+#define SSL_LIB_VER_STR get_ssl_library_version()
+#else
+#define SSL_LIB_VER_STR ""
+#endif
+#ifdef ENABLE_LZO
+#define LZO_LIB_VER_STR ", LZO ", lzo_version_string()
+#else
+#define LZO_LIB_VER_STR "", ""
+#endif
+
+ msg (flags, "library versions: %s%s%s", SSL_LIB_VER_STR, LZO_LIB_VER_STR);
+
+#undef SSL_LIB_VER_STR
+#undef LZO_LIB_VER_STR
+}
+
+static void
+usage_version (void)
+{
+ msg (M_INFO|M_NOPREFIX, "%s", title_string);
+ show_library_versions( M_INFO|M_NOPREFIX );
+ msg (M_INFO|M_NOPREFIX, "Originally developed by James Yonan");
+ msg (M_INFO|M_NOPREFIX, "Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>");
+#ifndef ENABLE_SMALL
+#ifdef CONFIGURE_DEFINES
+ msg (M_INFO|M_NOPREFIX, "Compile time defines: %s", CONFIGURE_DEFINES);
+#endif
+#ifdef CONFIGURE_SPECIAL_BUILD
+ msg (M_INFO|M_NOPREFIX, "special build: %s", CONFIGURE_SPECIAL_BUILD);
+#endif
+#endif
+ openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
+}
+
+void
+notnull (const char *arg, const char *description)
+{
+ if (!arg)
+ msg (M_USAGE, "You must define %s", description);
+}
+
+bool
+string_defined_equal (const char *s1, const char *s2)
+{
+ if (s1 && s2)
+ return !strcmp (s1, s2);
+ else
+ return false;
+}
+
+#if 0
+static void
+ping_rec_err (int msglevel)
+{
+ msg (msglevel, "only one of --ping-exit or --ping-restart options may be specified");
+}
+#endif
+
+static int
+positive_atoi (const char *str)
+{
+ const int i = atoi (str);
+ return i < 0 ? 0 : i;
+}
+
+#ifdef WIN32 /* This function is only used when compiling on Windows */
+static unsigned int
+atou (const char *str)
+{
+ unsigned int val = 0;
+ sscanf (str, "%u", &val);
+ return val;
+}
+#endif
+
+static inline bool
+space (unsigned char c)
+{
+ return c == '\0' || isspace (c);
+}
+
+int
+parse_line (const char *line,
+ char *p[],
+ const int n,
+ const char *file,
+ const int line_num,
+ int msglevel,
+ struct gc_arena *gc)
+{
+ const int STATE_INITIAL = 0;
+ const int STATE_READING_QUOTED_PARM = 1;
+ const int STATE_READING_UNQUOTED_PARM = 2;
+ const int STATE_DONE = 3;
+ const int STATE_READING_SQUOTED_PARM = 4;
+
+ const char *error_prefix = "";
+
+ int ret = 0;
+ const char *c = line;
+ int state = STATE_INITIAL;
+ bool backslash = false;
+ char in, out;
+
+ char parm[OPTION_PARM_SIZE];
+ unsigned int parm_len = 0;
+
+ msglevel &= ~M_OPTERR;
+
+ if (msglevel & M_MSG_VIRT_OUT)
+ error_prefix = "ERROR: ";
+
+ do
+ {
+ in = *c;
+ out = 0;
+
+ if (!backslash && in == '\\' && state != STATE_READING_SQUOTED_PARM)
+ {
+ backslash = true;
+ }
+ else
+ {
+ if (state == STATE_INITIAL)
+ {
+ if (!space (in))
+ {
+ if (in == ';' || in == '#') /* comment */
+ break;
+ if (!backslash && in == '\"')
+ state = STATE_READING_QUOTED_PARM;
+ else if (!backslash && in == '\'')
+ state = STATE_READING_SQUOTED_PARM;
+ else
+ {
+ out = in;
+ state = STATE_READING_UNQUOTED_PARM;
+ }
+ }
+ }
+ else if (state == STATE_READING_UNQUOTED_PARM)
+ {
+ if (!backslash && space (in))
+ state = STATE_DONE;
+ else
+ out = in;
+ }
+ else if (state == STATE_READING_QUOTED_PARM)
+ {
+ if (!backslash && in == '\"')
+ state = STATE_DONE;
+ else
+ out = in;
+ }
+ else if (state == STATE_READING_SQUOTED_PARM)
+ {
+ if (in == '\'')
+ state = STATE_DONE;
+ else
+ out = in;
+ }
+ if (state == STATE_DONE)
+ {
+ /* ASSERT (parm_len > 0); */
+ p[ret] = gc_malloc (parm_len + 1, true, gc);
+ memcpy (p[ret], parm, parm_len);
+ p[ret][parm_len] = '\0';
+ state = STATE_INITIAL;
+ parm_len = 0;
+ ++ret;
+ }
+
+ if (backslash && out)
+ {
+ if (!(out == '\\' || out == '\"' || space (out)))
+ {
+#ifdef ENABLE_SMALL
+ msg (msglevel, "%sOptions warning: Bad backslash ('\\') usage in %s:%d", error_prefix, file, line_num);
+#else
+ msg (msglevel, "%sOptions warning: Bad backslash ('\\') usage in %s:%d: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as \"c:\\\\" PACKAGE "\\\\static.key\"", error_prefix, file, line_num);
+#endif
+ return 0;
+ }
+ }
+ backslash = false;
+ }
+
+ /* store parameter character */
+ if (out)
+ {
+ if (parm_len >= SIZE (parm))
+ {
+ parm[SIZE (parm) - 1] = 0;
+ msg (msglevel, "%sOptions error: Parameter at %s:%d is too long (%d chars max): %s",
+ error_prefix, file, line_num, (int) SIZE (parm), parm);
+ return 0;
+ }
+ parm[parm_len++] = out;
+ }
+
+ /* avoid overflow if too many parms in one config file line */
+ if (ret >= n)
+ break;
+
+ } while (*c++ != '\0');
+
+ if (state == STATE_READING_QUOTED_PARM)
+ {
+ msg (msglevel, "%sOptions error: No closing quotation (\") in %s:%d", error_prefix, file, line_num);
+ return 0;
+ }
+ if (state == STATE_READING_SQUOTED_PARM)
+ {
+ msg (msglevel, "%sOptions error: No closing single quotation (\') in %s:%d", error_prefix, file, line_num);
+ return 0;
+ }
+ if (state != STATE_INITIAL)
+ {
+ msg (msglevel, "%sOptions error: Residual parse state (%d) in %s:%d", error_prefix, state, file, line_num);
+ return 0;
+ }
+#if 0
+ {
+ int i;
+ for (i = 0; i < ret; ++i)
+ {
+ msg (M_INFO|M_NOPREFIX, "%s:%d ARG[%d] '%s'", file, line_num, i, p[i]);
+ }
+ }
+#endif
+ return ret;
+}
+
+static void
+bypass_doubledash (char **p)
+{
+ if (strlen (*p) >= 3 && !strncmp (*p, "--", 2))
+ *p += 2;
+}
+
+struct in_src {
+# define IS_TYPE_FP 1
+# define IS_TYPE_BUF 2
+ int type;
+ union {
+ FILE *fp;
+ struct buffer *multiline;
+ } u;
+};
+
+static bool
+in_src_get (const struct in_src *is, char *line, const int size)
+{
+ if (is->type == IS_TYPE_FP)
+ {
+ return BOOL_CAST (fgets (line, size, is->u.fp));
+ }
+ else if (is->type == IS_TYPE_BUF)
+ {
+ bool status = buf_parse (is->u.multiline, '\n', line, size);
+ if ((int) strlen (line) + 1 < size)
+ strcat (line, "\n");
+ return status;
+ }
+ else
+ {
+ ASSERT (0);
+ return false;
+ }
+}
+
+static char *
+read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc)
+{
+ char line[OPTION_LINE_SIZE];
+ struct buffer buf = alloc_buf (10000);
+ char *ret;
+ while (in_src_get (is, line, sizeof (line)))
+ {
+ if (!strncmp (line, close_tag, strlen (close_tag)))
+ break;
+ buf_printf (&buf, "%s", line);
+ }
+ ret = string_alloc (BSTR (&buf), gc);
+ buf_clear (&buf);
+ free_buf (&buf);
+ CLEAR (line);
+ return ret;
+}
+
+static bool
+check_inline_file (struct in_src *is, char *p[], struct gc_arena *gc)
+{
+ bool ret = false;
+ if (p[0] && !p[1])
+ {
+ char *arg = p[0];
+ if (arg[0] == '<' && arg[strlen(arg)-1] == '>')
+ {
+ struct buffer close_tag;
+ arg[strlen(arg)-1] = '\0';
+ p[0] = string_alloc (arg+1, gc);
+ p[1] = string_alloc (INLINE_FILE_TAG, gc);
+ close_tag = alloc_buf (strlen(p[0]) + 4);
+ buf_printf (&close_tag, "</%s>", p[0]);
+ p[2] = read_inline_file (is, BSTR (&close_tag), gc);
+ p[3] = NULL;
+ free_buf (&close_tag);
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+static bool
+check_inline_file_via_fp (FILE *fp, char *p[], struct gc_arena *gc)
+{
+ struct in_src is;
+ is.type = IS_TYPE_FP;
+ is.u.fp = fp;
+ return check_inline_file (&is, p, gc);
+}
+
+static bool
+check_inline_file_via_buf (struct buffer *multiline, char *p[], struct gc_arena *gc)
+{
+ struct in_src is;
+ is.type = IS_TYPE_BUF;
+ is.u.multiline = multiline;
+ return check_inline_file (&is, p, gc);
+}
+
+static void
+add_option (struct options *options,
+ char *p[],
+ const char *file,
+ int line,
+ const int level,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es);
+
+static void
+read_config_file (struct options *options,
+ const char *file,
+ int level,
+ const char *top_file,
+ const int top_line,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ const int max_recursive_levels = 10;
+ FILE *fp;
+ int line_num;
+ char line[OPTION_LINE_SIZE];
+ char *p[MAX_PARMS];
+
+ ++level;
+ if (level <= max_recursive_levels)
+ {
+ if (streq (file, "stdin"))
+ fp = stdin;
+ else
+ fp = platform_fopen (file, "r");
+ if (fp)
+ {
+ line_num = 0;
+ while (fgets(line, sizeof (line), fp))
+ {
+ int offset = 0;
+ CLEAR (p);
+ ++line_num;
+ /* Ignore UTF-8 BOM at start of stream */
+ if (line_num == 1 && strncmp (line, "\xEF\xBB\xBF", 3) == 0)
+ offset = 3;
+ if (parse_line (line + offset, p, SIZE (p), file, line_num, msglevel, &options->gc))
+ {
+ bypass_doubledash (&p[0]);
+ check_inline_file_via_fp (fp, p, &options->gc);
+ add_option (options, p, file, line_num, level, msglevel, permission_mask, option_types_found, es);
+ }
+ }
+ if (fp != stdin)
+ fclose (fp);
+ }
+ else
+ {
+ msg (msglevel, "In %s:%d: Error opening configuration file: %s", top_file, top_line, file);
+ }
+ }
+ else
+ {
+ msg (msglevel, "In %s:%d: Maximum recursive include levels exceeded in include attempt of file %s -- probably you have a configuration file that tries to include itself.", top_file, top_line, file);
+ }
+ CLEAR (line);
+ CLEAR (p);
+}
+
+static void
+read_config_string (const char *prefix,
+ struct options *options,
+ const char *config,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ char line[OPTION_LINE_SIZE];
+ struct buffer multiline;
+ int line_num = 0;
+
+ buf_set_read (&multiline, (uint8_t*)config, strlen (config));
+
+ while (buf_parse (&multiline, '\n', line, sizeof (line)))
+ {
+ char *p[MAX_PARMS];
+ CLEAR (p);
+ ++line_num;
+ if (parse_line (line, p, SIZE (p), prefix, line_num, msglevel, &options->gc))
+ {
+ bypass_doubledash (&p[0]);
+ check_inline_file_via_buf (&multiline, p, &options->gc);
+ add_option (options, p, prefix, line_num, 0, msglevel, permission_mask, option_types_found, es);
+ }
+ CLEAR (p);
+ }
+ CLEAR (line);
+}
+
+void
+parse_argv (struct options *options,
+ const int argc,
+ char *argv[],
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ int i, j;
+
+ /* usage message */
+ if (argc <= 1)
+ usage ();
+
+ /* config filename specified only? */
+ if (argc == 2 && strncmp (argv[1], "--", 2))
+ {
+ char *p[MAX_PARMS];
+ CLEAR (p);
+ p[0] = "config";
+ p[1] = argv[1];
+ add_option (options, p, NULL, 0, 0, msglevel, permission_mask, option_types_found, es);
+ }
+ else
+ {
+ /* parse command line */
+ for (i = 1; i < argc; ++i)
+ {
+ char *p[MAX_PARMS];
+ CLEAR (p);
+ p[0] = argv[i];
+ if (strncmp(p[0], "--", 2))
+ {
+ msg (msglevel, "I'm trying to parse \"%s\" as an --option parameter but I don't see a leading '--'", p[0]);
+ }
+ else
+ p[0] += 2;
+
+ for (j = 1; j < MAX_PARMS; ++j)
+ {
+ if (i + j < argc)
+ {
+ char *arg = argv[i + j];
+ if (strncmp (arg, "--", 2))
+ p[j] = arg;
+ else
+ break;
+ }
+ }
+ add_option (options, p, NULL, 0, 0, msglevel, permission_mask, option_types_found, es);
+ i += j - 1;
+ }
+ }
+}
+
+bool
+apply_push_options (struct options *options,
+ struct buffer *buf,
+ unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es,
+ struct tls_multi *tls_multi)
+{
+ char line[OPTION_PARM_SIZE];
+ int line_num = 0;
+ const char *file = "[PUSH-OPTIONS]";
+ const int msglevel = D_PUSH_ERRORS|M_OPTERR;
+
+ while (buf_parse (buf, ',', line, sizeof (line)))
+ {
+ char *p[MAX_PARMS];
+ CLEAR (p);
+ ++line_num;
+ if (parse_line (line, p, SIZE (p), file, line_num, msglevel, &options->gc))
+ {
+ if (streq(p[0], "session_id"))
+ {
+ /* Server supports P_DATA_V2 */
+ tls_multi->vpn_session_id = atoi(p[1]);
+ tls_multi->use_session_id = true;
+ msg(D_PUSH, "session id: %d", tls_multi->vpn_session_id);
+ }
+ else
+ {
+ add_option (options, p, file, line_num, 0, msglevel, permission_mask, option_types_found, es);
+ }
+ }
+ }
+ return true;
+}
+
+void
+options_server_import (struct options *o,
+ const char *filename,
+ int msglevel,
+ unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ msg (D_PUSH, "OPTIONS IMPORT: reading client specific options from: %s", filename);
+ read_config_file (o,
+ filename,
+ 0,
+ filename,
+ 0,
+ msglevel,
+ permission_mask,
+ option_types_found,
+ es);
+}
+
+void options_string_import (struct options *options,
+ const char *config,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ read_config_string ("[CONFIG-STRING]", options, config, msglevel, permission_mask, option_types_found, es);
+}
+
+#if P2MP
+
+#define VERIFY_PERMISSION(mask) { if (!verify_permission(p[0], file, line, (mask), permission_mask, option_types_found, msglevel, options)) goto err; }
+
+static bool
+verify_permission (const char *name,
+ const char* file,
+ int line,
+ const unsigned int type,
+ const unsigned int allowed,
+ unsigned int *found,
+ const int msglevel,
+ struct options* options)
+{
+ if (!(type & allowed))
+ {
+ msg (msglevel, "option '%s' cannot be used in this context (%s)", name, file);
+ return false;
+ }
+
+ if (found)
+ *found |= type;
+
+#ifndef ENABLE_SMALL
+ /* Check if this options is allowed in connection block,
+ * but we are currently not in a connection block
+ * Parsing a connection block uses a temporary options struct without
+ * connection_list
+ */
+
+ if ((type & OPT_P_CONNECTION) && options->connection_list)
+ {
+ if (file)
+ msg (M_WARN, "Option '%s' in %s:%d is ignored by previous <connection> blocks ", name, file, line);
+ else
+ msg (M_WARN, "Option '%s' is ignored by previous <connection> blocks", name);
+ }
+#endif
+ return true;
+}
+
+#else
+
+#define VERIFY_PERMISSION(mask)
+
+#endif
+
+/*
+ * Check that an option doesn't have too
+ * many parameters.
+ */
+
+#define NM_QUOTE_HINT (1<<0)
+
+static bool
+no_more_than_n_args (const int msglevel,
+ char *p[],
+ const int max,
+ const unsigned int flags)
+{
+ const int len = string_array_len ((const char **)p);
+
+ if (!len)
+ return false;
+
+ if (len > max)
+ {
+ msg (msglevel, "the --%s directive should have at most %d parameter%s.%s",
+ p[0],
+ max - 1,
+ max >= 3 ? "s" : "",
+ (flags & NM_QUOTE_HINT) ? " To pass a list of arguments as one of the parameters, try enclosing them in double quotes (\"\")." : "");
+ return false;
+ }
+ else
+ return true;
+}
+
+static inline int
+msglevel_forward_compatible (struct options *options, const int msglevel)
+{
+ return options->forward_compatible ? M_WARN : msglevel;
+}
+
+static void
+set_user_script (struct options *options,
+ const char **script,
+ const char *new_script,
+ const char *type,
+ bool in_chroot)
+{
+ if (*script) {
+ msg (M_WARN, "Multiple --%s scripts defined. "
+ "The previously configured script is overridden.", type);
+ }
+ *script = new_script;
+ options->user_script_used = true;
+
+#ifndef ENABLE_SMALL
+ {
+ char script_name[100];
+ openvpn_snprintf (script_name, sizeof(script_name),
+ "--%s script", type);
+
+ if (check_cmd_access (*script, script_name, (in_chroot ? options->chroot_dir : NULL)))
+ msg (M_USAGE, "Please correct this error.");
+
+ }
+#endif
+}
+
+
+static void
+add_option (struct options *options,
+ char *p[],
+ const char *file,
+ int line,
+ const int level,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+ const bool pull_mode = BOOL_CAST (permission_mask & OPT_P_PULL_MODE);
+ int msglevel_fc = msglevel_forward_compatible (options, msglevel);
+
+ ASSERT (MAX_PARMS >= 7);
+
+ /*
+ * If directive begins with "setenv opt" prefix, don't raise an error if
+ * directive is unrecognized.
+ */
+ if (streq (p[0], "setenv") && p[1] && streq (p[1], "opt") && !(permission_mask & OPT_P_PULL_MODE))
+ {
+ p += 2;
+ msglevel_fc = M_WARN;
+ }
+
+ if (!file)
+ {
+ file = "[CMD-LINE]";
+ line = 1;
+ }
+ if (streq (p[0], "help"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ usage ();
+ }
+ if (streq (p[0], "version"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ usage_version ();
+ }
+ else if (streq (p[0], "config") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_CONFIG);
+
+ /* save first config file only in options */
+ if (!options->config)
+ options->config = p[1];
+
+ read_config_file (options, p[1], level, file, line, msglevel, permission_mask, option_types_found, es);
+ }
+#if defined(ENABLE_DEBUG) && !defined(ENABLE_SMALL)
+ else if (streq (p[0], "show-gateway"))
+ {
+ struct route_gateway_info rgi;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ get_default_gateway(&rgi);
+ print_default_gateway(M_INFO, &rgi);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+#endif
+#if 0
+ else if (streq (p[0], "foreign-option") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ foreign_option (options, p, 3, es);
+ }
+#endif
+ else if (streq (p[0], "echo") || streq (p[0], "parameter"))
+ {
+ struct buffer string = alloc_buf_gc (OPTION_PARM_SIZE, &gc);
+ int j;
+ bool good = true;
+
+ VERIFY_PERMISSION (OPT_P_ECHO);
+
+ for (j = 1; j < MAX_PARMS; ++j)
+ {
+ if (!p[j])
+ break;
+ if (j > 1)
+ good &= buf_printf (&string, " ");
+ good &= buf_printf (&string, "%s", p[j]);
+ }
+ if (good)
+ {
+#if 0
+ /* removed for now since ECHO can potentially include
+ security-sensitive strings */
+ msg (M_INFO, "%s:%s",
+ pull_mode ? "ECHO-PULL" : "ECHO",
+ BSTR (&string));
+#endif
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_echo (management, BSTR (&string), pull_mode);
+#endif
+ }
+ else
+ msg (M_WARN, "echo/parameter option overflow");
+ }
+#ifdef ENABLE_MANAGEMENT
+ else if (streq (p[0], "management") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[2], "unix"))
+ {
+#if UNIX_SOCK_SUPPORT
+ options->management_flags |= MF_UNIX_SOCK;
+#else
+ msg (msglevel, "MANAGEMENT: this platform does not support unix domain sockets");
+ goto err;
+#endif
+ }
+
+ options->management_addr = p[1];
+ options->management_port = p[2];
+ if (p[3])
+ {
+ options->management_user_pass = p[3];
+ }
+ }
+ else if (streq (p[0], "management-client-user") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_client_user = p[1];
+ }
+ else if (streq (p[0], "management-client-group") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_client_group = p[1];
+ }
+ else if (streq (p[0], "management-query-passwords"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_QUERY_PASSWORDS;
+ }
+ else if (streq (p[0], "management-query-remote"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_QUERY_REMOTE;
+ }
+ else if (streq (p[0], "management-query-proxy"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_QUERY_PROXY;
+ }
+ else if (streq (p[0], "management-hold"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_HOLD;
+ }
+ else if (streq (p[0], "management-signal"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_SIGNAL;
+ }
+ else if (streq (p[0], "management-forget-disconnect"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_FORGET_DISCONNECT;
+ }
+ else if (streq (p[0], "management-up-down"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_UP_DOWN;
+ }
+ else if (streq (p[0], "management-client"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_CONNECT_AS_CLIENT;
+ options->management_write_peer_info_file = p[1];
+ }
+#ifdef MANAGMENT_EXTERNAL_KEY
+ else if (streq (p[0], "management-external-key"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_EXTERNAL_KEY;
+ }
+#endif
+#ifdef MANAGEMENT_DEF_AUTH
+ else if (streq (p[0], "management-client-auth"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= MF_CLIENT_AUTH;
+ }
+#endif
+#ifdef ENABLE_X509_TRACK
+ else if (streq (p[0], "x509-track") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ x509_track_add (&options->x509_track, p[1], msglevel, &options->gc);
+ }
+#endif
+#ifdef MANAGEMENT_PF
+ else if (streq (p[0], "management-client-pf"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->management_flags |= (MF_CLIENT_PF | MF_CLIENT_AUTH);
+ }
+#endif
+ else if (streq (p[0], "management-log-cache") && p[1])
+ {
+ int cache;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ cache = atoi (p[1]);
+ if (cache < 1)
+ {
+ msg (msglevel, "--management-log-cache parameter is out of range");
+ goto err;
+ }
+ options->management_log_history_cache = cache;
+ }
+#endif
+#ifdef ENABLE_PLUGIN
+ else if (streq (p[0], "plugin") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_PLUGIN);
+ if (!options->plugin_list)
+ options->plugin_list = plugin_option_list_new (&options->gc);
+ if (!plugin_option_list_add (options->plugin_list, &p[1], &options->gc))
+ {
+ msg (msglevel, "plugin add failed: %s", p[1]);
+ goto err;
+ }
+ }
+#endif
+ else if (streq (p[0], "mode") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "p2p"))
+ options->mode = MODE_POINT_TO_POINT;
+#if P2MP_SERVER
+ else if (streq (p[1], "server"))
+ options->mode = MODE_SERVER;
+#endif
+ else
+ {
+ msg (msglevel, "Bad --mode parameter: %s", p[1]);
+ goto err;
+ }
+ }
+ else if (streq (p[0], "dev") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->dev = p[1];
+ }
+ else if (streq (p[0], "dev-type") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->dev_type = p[1];
+ }
+ else if (streq (p[0], "dev-node") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->dev_node = p[1];
+ }
+ else if (streq (p[0], "lladdr") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ if (mac_addr_safe (p[1])) /* MAC address only */
+ options->lladdr = p[1];
+ else
+ {
+ msg (msglevel, "lladdr parm '%s' must be a MAC address", p[1]);
+ goto err;
+ }
+ }
+ else if (streq (p[0], "topology") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->topology = parse_topology (p[1], msglevel);
+ }
+ else if (streq (p[0], "tun-ipv6"))
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->tun_ipv6 = true;
+ }
+#ifdef ENABLE_IPROUTE
+ else if (streq (p[0], "iproute") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ iproute_path = p[1];
+ }
+#endif
+ else if (streq (p[0], "ifconfig") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ if (ip_or_dns_addr_safe (p[1], options->allow_pull_fqdn) && ip_or_dns_addr_safe (p[2], options->allow_pull_fqdn)) /* FQDN -- may be DNS name */
+ {
+ options->ifconfig_local = p[1];
+ options->ifconfig_remote_netmask = p[2];
+ }
+ else
+ {
+ msg (msglevel, "ifconfig parms '%s' and '%s' must be valid addresses", p[1], p[2]);
+ goto err;
+ }
+ }
+ else if (streq (p[0], "ifconfig-ipv6") && p[1] && p[2] )
+ {
+ unsigned int netbits;
+ char * ipv6_local;
+
+ VERIFY_PERMISSION (OPT_P_UP);
+ if ( get_ipv6_addr( p[1], NULL, &netbits, &ipv6_local, msglevel ) &&
+ ipv6_addr_safe( p[2] ) )
+ {
+ if ( netbits < 64 || netbits > 124 )
+ {
+ msg( msglevel, "ifconfig-ipv6: /netbits must be between 64 and 124, not '/%d'", netbits );
+ goto err;
+ }
+
+ if (options->ifconfig_ipv6_local)
+ /* explicitly ignoring this is a const char */
+ free ((char *) options->ifconfig_ipv6_local);
+
+ options->ifconfig_ipv6_local = ipv6_local;
+ options->ifconfig_ipv6_netbits = netbits;
+ options->ifconfig_ipv6_remote = p[2];
+ }
+ else
+ {
+ msg (msglevel, "ifconfig-ipv6 parms '%s' and '%s' must be valid addresses", p[1], p[2]);
+ goto err;
+ }
+ }
+ else if (streq (p[0], "ifconfig-noexec"))
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->ifconfig_noexec = true;
+ }
+ else if (streq (p[0], "ifconfig-nowarn"))
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->ifconfig_nowarn = true;
+ }
+ else if (streq (p[0], "local") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.local = p[1];
+ }
+ else if (streq (p[0], "remote-random"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->remote_random = true;
+ }
+ else if (streq (p[0], "connection") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ struct options sub;
+ struct connection_entry *e;
+
+ init_options (&sub, true);
+ sub.ce = options->ce;
+ read_config_string ("[CONNECTION-OPTIONS]", &sub, p[2], msglevel, OPT_P_CONNECTION, option_types_found, es);
+ if (!sub.ce.remote)
+ {
+ msg (msglevel, "Each 'connection' block must contain exactly one 'remote' directive");
+ goto err;
+ }
+
+ e = alloc_connection_entry (options, msglevel);
+ if (!e)
+ goto err;
+ *e = sub.ce;
+ gc_transfer (&options->gc, &sub.gc);
+ uninit_options (&sub);
+ }
+ }
+ else if (streq (p[0], "ignore-unknown-option") && p[1])
+ {
+ int i;
+ int j;
+ int numignored=0;
+ const char **ignore;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ /* Find out how many options to be ignored */
+ for (i=1;p[i];i++)
+ numignored++;
+
+ /* add number of options already ignored */
+ for (i=0;options->ignore_unknown_option &&
+ options->ignore_unknown_option[i]; i++)
+ numignored++;
+
+ /* Allocate array */
+ ALLOC_ARRAY_GC (ignore, const char*, numignored+1, &options->gc);
+ for (i=0;options->ignore_unknown_option &&
+ options->ignore_unknown_option[i]; i++)
+ ignore[i]=options->ignore_unknown_option[i];
+
+ options->ignore_unknown_option=ignore;
+
+ for (j=1;p[j];j++)
+ {
+ /* Allow the user to specify ignore-unknown-option --opt too */
+ if (p[j][0]=='-' && p[j][1]=='-')
+ options->ignore_unknown_option[i] = (p[j]+2);
+ else
+ options->ignore_unknown_option[i] = p[j];
+ i++;
+ }
+
+ options->ignore_unknown_option[i] = NULL;
+ }
+#if ENABLE_MANAGEMENT
+ else if (streq (p[0], "http-proxy-override") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->http_proxy_override = parse_http_proxy_override(p[1], p[2], p[3], msglevel, &options->gc);
+ if (!options->http_proxy_override)
+ goto err;
+ }
+#endif
+ else if (streq (p[0], "remote") && p[1])
+ {
+ struct remote_entry re;
+ re.remote = re.remote_port= NULL;
+ re.proto = -1;
+ re.af=0;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ re.remote = p[1];
+ if (p[2])
+ {
+ re.remote_port = p[2];
+ if (p[3])
+ {
+ const int proto = ascii2proto (p[3]);
+ const sa_family_t af = ascii2af (p[3]);
+ if (proto < 0)
+ {
+ msg (msglevel, "remote: bad protocol associated with host %s: '%s'", p[1], p[3]);
+ goto err;
+ }
+ re.proto = proto;
+ re.af = af;
+ }
+ }
+ if (permission_mask & OPT_P_GENERAL)
+ {
+ struct remote_entry *e = alloc_remote_entry (options, msglevel);
+ if (!e)
+ goto err;
+ *e = re;
+ }
+ else if (permission_mask & OPT_P_CONNECTION)
+ {
+ connection_entry_load_re (&options->ce, &re);
+ }
+ }
+ else if (streq (p[0], "resolv-retry") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "infinite"))
+ options->resolve_retry_seconds = RESOLV_RETRY_INFINITE;
+ else
+ options->resolve_retry_seconds = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "preresolve") || streq (p[0], "ip-remote-hint"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->resolve_in_advance = true;
+ /* Note the ip-remote-hint and the argument p[1] are for
+ backward compatibility */
+ if (p[1])
+ options->ip_remote_hint=p[1];
+ }
+ else if (streq (p[0], "connect-retry") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.connect_retry_seconds = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "connect-timeout") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.connect_timeout = positive_atoi (p[1]);
+ options->ce.connect_timeout_defined = true;
+ }
+ else if (streq (p[0], "connect-retry-max") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->connect_retry_max = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "ipchange") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options,
+ &options->ipchange,
+ string_substitute (p[1], ',', ' ', &options->gc),
+ "ipchange", true);
+ }
+ else if (streq (p[0], "float"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.remote_float = true;
+ }
+#ifdef ENABLE_DEBUG
+ else if (streq (p[0], "gremlin") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->gremlin = positive_atoi (p[1]);
+ }
+#endif
+ else if (streq (p[0], "chroot") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->chroot_dir = p[1];
+ }
+ else if (streq (p[0], "cd") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (platform_chdir (p[1]))
+ {
+ msg (M_ERR, "cd to '%s' failed", p[1]);
+ goto err;
+ }
+ options->cd_dir = p[1];
+ }
+#ifdef ENABLE_SELINUX
+ else if (streq (p[0], "setcon") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->selinux_context = p[1];
+ }
+#endif
+ else if (streq (p[0], "writepid") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->writepid = p[1];
+ }
+ else if (streq (p[0], "up") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->up_script, p[1], "up", false);
+ }
+ else if (streq (p[0], "down") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->down_script, p[1], "down", true);
+ }
+ else if (streq (p[0], "down-pre"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->down_pre = true;
+ }
+ else if (streq (p[0], "up-delay"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->up_delay = true;
+ }
+ else if (streq (p[0], "up-restart"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->up_restart = true;
+ }
+ else if (streq (p[0], "syslog"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ open_syslog (p[1], false);
+ }
+ else if (streq (p[0], "daemon"))
+ {
+ bool didit = false;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (!options->daemon)
+ {
+ options->daemon = didit = true;
+ open_syslog (p[1], false);
+ }
+ if (p[1])
+ {
+ if (!didit)
+ {
+ msg (M_WARN, "WARNING: Multiple --daemon directives specified, ignoring --daemon %s. (Note that initscripts sometimes add their own --daemon directive.)", p[1]);
+ goto err;
+ }
+ }
+ }
+ else if (streq (p[0], "inetd"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (!options->inetd)
+ {
+ int z;
+ const char *name = NULL;
+ const char *opterr = "when --inetd is used with two parameters, one of them must be 'wait' or 'nowait' and the other must be a daemon name to use for system logging";
+
+ options->inetd = -1;
+
+ for (z = 1; z <= 2; ++z)
+ {
+ if (p[z])
+ {
+ if (streq (p[z], "wait"))
+ {
+ if (options->inetd != -1)
+ {
+ msg (msglevel, "%s", opterr);
+ goto err;
+ }
+ else
+ options->inetd = INETD_WAIT;
+ }
+ else if (streq (p[z], "nowait"))
+ {
+ if (options->inetd != -1)
+ {
+ msg (msglevel, "%s", opterr);
+ goto err;
+ }
+ else
+ options->inetd = INETD_NOWAIT;
+ }
+ else
+ {
+ if (name != NULL)
+ {
+ msg (msglevel, "%s", opterr);
+ goto err;
+ }
+ name = p[z];
+ }
+ }
+ }
+
+ /* default */
+ if (options->inetd == -1)
+ options->inetd = INETD_WAIT;
+
+ save_inetd_socket_descriptor ();
+ open_syslog (name, true);
+ }
+ }
+ else if (streq (p[0], "log") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->log = true;
+ redirect_stdout_stderr (p[1], false);
+ }
+ else if (streq (p[0], "suppress-timestamps"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->suppress_timestamps = true;
+ set_suppress_timestamps(true);
+ }
+ else if (streq (p[0], "machine-readable-output"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->machine_readable_output = true;
+ set_machine_readable_output(true);
+ }
+ else if (streq (p[0], "log-append") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->log = true;
+ redirect_stdout_stderr (p[1], true);
+ }
+#ifdef ENABLE_MEMSTATS
+ else if (streq (p[0], "memstats") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->memstats_fn = p[1];
+ }
+#endif
+ else if (streq (p[0], "mlock"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->mlock = true;
+ }
+#if ENABLE_IP_PKTINFO
+ else if (streq (p[0], "multihome"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->sockflags |= SF_USE_IP_PKTINFO;
+ }
+#endif
+ else if (streq (p[0], "verb") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MESSAGES);
+ options->verbosity = positive_atoi (p[1]);
+#if !defined(ENABLE_DEBUG) && !defined(ENABLE_SMALL)
+ /* Warn when a debug verbosity is supplied when built without debug support */
+ if (options->verbosity >= 7)
+ msg (M_WARN, "NOTE: debug verbosity (--verb %d) is enabled but this build lacks debug support.",
+ options->verbosity);
+#endif
+ }
+ else if (streq (p[0], "mute") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MESSAGES);
+ options->mute = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "errors-to-stderr"))
+ {
+ VERIFY_PERMISSION (OPT_P_MESSAGES);
+ errors_to_stderr();
+ }
+ else if (streq (p[0], "status") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->status_file = p[1];
+ if (p[2])
+ {
+ options->status_file_update_freq = positive_atoi (p[2]);
+ }
+ }
+ else if (streq (p[0], "status-version") && p[1])
+ {
+ int version;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ version = atoi (p[1]);
+ if (version < 1 || version > 3)
+ {
+ msg (msglevel, "--status-version must be 1 to 3");
+ goto err;
+ }
+ options->status_file_version = version;
+ }
+ else if (streq (p[0], "remap-usr1") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "SIGHUP"))
+ options->remap_sigusr1 = SIGHUP;
+ else if (streq (p[1], "SIGTERM"))
+ options->remap_sigusr1 = SIGTERM;
+ else
+ {
+ msg (msglevel, "--remap-usr1 parm must be 'SIGHUP' or 'SIGTERM'");
+ goto err;
+ }
+ }
+ else if ((streq (p[0], "link-mtu") || streq (p[0], "udp-mtu")) && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ options->ce.link_mtu = positive_atoi (p[1]);
+ options->ce.link_mtu_defined = true;
+ }
+ else if (streq (p[0], "tun-mtu") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ options->ce.tun_mtu = positive_atoi (p[1]);
+ options->ce.tun_mtu_defined = true;
+ }
+ else if (streq (p[0], "tun-mtu-extra") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ options->ce.tun_mtu_extra = positive_atoi (p[1]);
+ options->ce.tun_mtu_extra_defined = true;
+ }
+#ifdef ENABLE_FRAGMENT
+ else if (streq (p[0], "mtu-dynamic"))
+ {
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ msg (msglevel, "--mtu-dynamic has been replaced by --fragment");
+ goto err;
+ }
+ else if (streq (p[0], "fragment") && p[1])
+ {
+/* VERIFY_PERMISSION (OPT_P_MTU); */
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ options->ce.fragment = positive_atoi (p[1]);
+ }
+#endif
+ else if (streq (p[0], "mtu-disc") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION);
+ options->ce.mtu_discover_type = translate_mtu_discover_type_name (p[1]);
+ }
+#ifdef ENABLE_OCC
+ else if (streq (p[0], "mtu-test"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->mtu_test = true;
+ }
+#endif
+ else if (streq (p[0], "nice") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_NICE);
+ options->nice = atoi (p[1]);
+ }
+ else if (streq (p[0], "rcvbuf") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SOCKBUF);
+ options->rcvbuf = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "sndbuf") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SOCKBUF);
+ options->sndbuf = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "mark") && p[1])
+ {
+#if defined(TARGET_LINUX) && HAVE_DECL_SO_MARK
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->mark = atoi(p[1]);
+#endif
+ }
+ else if (streq (p[0], "socket-flags"))
+ {
+ int j;
+ VERIFY_PERMISSION (OPT_P_SOCKFLAGS);
+ for (j = 1; j < MAX_PARMS && p[j]; ++j)
+ {
+ if (streq (p[j], "TCP_NODELAY"))
+ options->sockflags |= SF_TCP_NODELAY;
+ else
+ msg (msglevel, "unknown socket flag: %s", p[j]);
+ }
+ }
+ else if (streq (p[0], "txqueuelen") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+#ifdef TARGET_LINUX
+ options->tuntap_options.txqueuelen = positive_atoi (p[1]);
+#else
+ msg (msglevel, "--txqueuelen not supported on this OS");
+ goto err;
+#endif
+ }
+ else if (streq (p[0], "shaper") && p[1])
+ {
+#ifdef ENABLE_FEATURE_SHAPER
+ int shaper;
+
+ VERIFY_PERMISSION (OPT_P_SHAPER);
+ shaper = atoi (p[1]);
+ if (shaper < SHAPER_MIN || shaper > SHAPER_MAX)
+ {
+ msg (msglevel, "Bad shaper value, must be between %d and %d",
+ SHAPER_MIN, SHAPER_MAX);
+ goto err;
+ }
+ options->shaper = shaper;
+#else /* ENABLE_FEATURE_SHAPER */
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ msg (msglevel, "--shaper requires the gettimeofday() function which is missing");
+ goto err;
+#endif /* ENABLE_FEATURE_SHAPER */
+ }
+ else if (streq (p[0], "port") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.local_port = options->ce.remote_port = p[1];
+ }
+ else if (streq (p[0], "lport") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.local_port_defined = true;
+ options->ce.local_port = p[1];
+ }
+ else if (streq (p[0], "rport") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.remote_port = p[1];
+ }
+ else if (streq (p[0], "bind"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.bind_defined = true;
+ if (p[1] && streq (p[1], "ipv6only"))
+ options->ce.bind_ipv6_only=true;
+
+ }
+ else if (streq (p[0], "nobind"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.bind_local = false;
+ }
+ else if (streq (p[0], "fast-io"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->fast_io = true;
+ }
+ else if (streq (p[0], "inactive") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TIMER);
+ options->inactivity_timeout = positive_atoi (p[1]);
+ if (p[2])
+ options->inactivity_minimum_bytes = positive_atoi (p[2]);
+ }
+ else if (streq (p[0], "proto") && p[1])
+ {
+ int proto;
+ sa_family_t af;
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ proto = ascii2proto (p[1]);
+ af = ascii2af(p[1]);
+ if (proto < 0)
+ {
+ msg (msglevel, "Bad protocol: '%s'. Allowed protocols with --proto option: %s",
+ p[1],
+ proto2ascii_all (&gc));
+ goto err;
+ }
+ options->ce.proto = proto;
+ options->ce.af = af;
+ }
+ else if (streq (p[0], "proto-force") && p[1])
+ {
+ int proto_force;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ proto_force = ascii2proto (p[1]);
+ if (proto_force < 0)
+ {
+ msg (msglevel, "Bad --proto-force protocol: '%s'", p[1]);
+ goto err;
+ }
+ options->proto_force = proto_force;
+ }
+ else if (streq (p[0], "http-proxy") && p[1])
+ {
+ struct http_proxy_options *ho;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+
+ {
+ if (!p[2])
+ {
+ msg (msglevel, "http-proxy port number not defined");
+ goto err;
+ }
+
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
+
+ ho->server = p[1];
+ ho->port = p[2];
+ }
+
+ if (p[3])
+ {
+ /* auto -- try to figure out proxy addr, port, and type automatically */
+ /* semiauto -- given proxy addr:port, try to figure out type automatically */
+ /* (auto|semiauto)-nct -- disable proxy auth cleartext protocols (i.e. basic auth) */
+ if (streq (p[3], "auto"))
+ ho->auth_retry = PAR_ALL;
+ else if (streq (p[3], "auto-nct"))
+ ho->auth_retry = PAR_NCT;
+ else
+ {
+ ho->auth_method_string = "basic";
+ ho->auth_file = p[3];
+
+ if (p[4])
+ {
+ ho->auth_method_string = p[4];
+ }
+ }
+ }
+ else
+ {
+ ho->auth_method_string = "none";
+ }
+ }
+ else if (streq (p[0], "http-proxy-retry"))
+ {
+ struct http_proxy_options *ho;
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
+ ho->retry = true;
+ }
+ else if (streq (p[0], "http-proxy-timeout") && p[1])
+ {
+ struct http_proxy_options *ho;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
+ ho->timeout = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "http-proxy-option") && p[1])
+ {
+ struct http_proxy_options *ho;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ ho = init_http_proxy_options_once (&options->ce.http_proxy_options, &options->gc);
+
+ if (streq (p[1], "VERSION") && p[2])
+ {
+ ho->http_version = p[2];
+ }
+ else if (streq (p[1], "AGENT") && p[2])
+ {
+ ho->user_agent = p[2];
+ }
+ else if ((streq (p[1], "EXT1") || streq(p[1], "EXT2") || streq(p[1], "CUSTOM-HEADER"))
+ && p[2])
+ {
+ /* In the wild patched versions use both EXT1/2 and CUSTOM-HEADER
+ * with either two argument or one */
+
+ struct http_custom_header *custom_header = NULL;
+ int i;
+ /* Find the first free header */
+ for (i=0; i < MAX_CUSTOM_HTTP_HEADER; i++) {
+ if (!ho->custom_headers[i].name) {
+ custom_header = &ho->custom_headers[i];
+ break;
+ }
+ }
+ if (!custom_header)
+ {
+ msg (msglevel, "Cannot use more than %d http-proxy-option CUSTOM-HEADER : '%s'", MAX_CUSTOM_HTTP_HEADER, p[1]);
+ }
+ else
+ {
+ /* We will save p[2] and p[3], the proxy code will detect if
+ * p[3] is NULL */
+ custom_header->name = p[2];
+ custom_header->content = p[3];
+ }
+ }
+ else
+ {
+ msg (msglevel, "Bad http-proxy-option or missing parameter: '%s'", p[1]);
+ }
+ }
+ else if (streq (p[0], "socks-proxy") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+
+ if (p[2])
+ {
+ options->ce.socks_proxy_port = p[2];
+ }
+ else
+ {
+ options->ce.socks_proxy_port = "1080";
+ }
+ options->ce.socks_proxy_server = p[1];
+ options->ce.socks_proxy_authfile = p[3]; /* might be NULL */
+ }
+ else if (streq (p[0], "socks-proxy-retry"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ options->ce.socks_proxy_retry = true;
+ }
+ else if (streq (p[0], "keepalive") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->keepalive_ping = atoi (p[1]);
+ options->keepalive_timeout = atoi (p[2]);
+ }
+ else if (streq (p[0], "ping") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TIMER);
+ options->ping_send_timeout = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "ping-exit") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TIMER);
+ options->ping_rec_timeout = positive_atoi (p[1]);
+ options->ping_rec_timeout_action = PING_EXIT;
+ }
+ else if (streq (p[0], "ping-restart") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TIMER);
+ options->ping_rec_timeout = positive_atoi (p[1]);
+ options->ping_rec_timeout_action = PING_RESTART;
+ }
+ else if (streq (p[0], "ping-timer-rem"))
+ {
+ VERIFY_PERMISSION (OPT_P_TIMER);
+ options->ping_timer_remote = true;
+ }
+#ifdef ENABLE_OCC
+ else if (streq (p[0], "explicit-exit-notify"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION|OPT_P_EXPLICIT_NOTIFY);
+ if (p[1])
+ {
+ options->ce.explicit_exit_notification = positive_atoi (p[1]);
+ }
+ else
+ {
+ options->ce.explicit_exit_notification = 1;
+ }
+ }
+#endif
+ else if (streq (p[0], "persist-tun"))
+ {
+ VERIFY_PERMISSION (OPT_P_PERSIST);
+ options->persist_tun = true;
+ }
+ else if (streq (p[0], "persist-key"))
+ {
+ VERIFY_PERMISSION (OPT_P_PERSIST);
+ options->persist_key = true;
+ }
+ else if (streq (p[0], "persist-local-ip"))
+ {
+ VERIFY_PERMISSION (OPT_P_PERSIST_IP);
+ options->persist_local_ip = true;
+ }
+ else if (streq (p[0], "persist-remote-ip"))
+ {
+ VERIFY_PERMISSION (OPT_P_PERSIST_IP);
+ options->persist_remote_ip = true;
+ }
+ else if (streq (p[0], "client-nat") && p[1] && p[2] && p[3] && p[4])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ cnol_check_alloc (options);
+ add_client_nat_to_option_list(options->client_nat, p[1], p[2], p[3], p[4], msglevel);
+ }
+ else if (streq (p[0], "route") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ rol_check_alloc (options);
+ if (pull_mode)
+ {
+ if (!ip_or_dns_addr_safe (p[1], options->allow_pull_fqdn) && !is_special_addr (p[1])) /* FQDN -- may be DNS name */
+ {
+ msg (msglevel, "route parameter network/IP '%s' must be a valid address", p[1]);
+ goto err;
+ }
+ if (p[2] && !ip_addr_dotted_quad_safe (p[2])) /* FQDN -- must be IP address */
+ {
+ msg (msglevel, "route parameter netmask '%s' must be an IP address", p[2]);
+ goto err;
+ }
+ if (p[3] && !ip_or_dns_addr_safe (p[3], options->allow_pull_fqdn) && !is_special_addr (p[3])) /* FQDN -- may be DNS name */
+ {
+ msg (msglevel, "route parameter gateway '%s' must be a valid address", p[3]);
+ goto err;
+ }
+ }
+ add_route_to_option_list (options->routes, p[1], p[2], p[3], p[4]);
+ }
+ else if (streq (p[0], "route-ipv6") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ rol6_check_alloc (options);
+ if (pull_mode)
+ {
+ if (!ipv6_addr_safe_hexplusbits (p[1]))
+ {
+ msg (msglevel, "route-ipv6 parameter network/IP '%s' must be a valid address", p[1]);
+ goto err;
+ }
+ if (p[2] && !ipv6_addr_safe (p[2]))
+ {
+ msg (msglevel, "route-ipv6 parameter gateway '%s' must be a valid address", p[2]);
+ goto err;
+ }
+ /* p[3] is metric, if present */
+ }
+ add_route_ipv6_to_option_list (options->routes_ipv6, p[1], p[2], p[3]);
+ }
+ else if (streq (p[0], "max-routes"))
+ {
+ msg (M_WARN, "DEPRECATED OPTION: --max-routes option ignored."
+ "The number of routes is unlimited as of version 2.4. "
+ "This option will be removed in a future version, "
+ "please remove it from your configuration.");
+ }
+ else if (streq (p[0], "route-gateway") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
+ if (streq (p[1], "dhcp"))
+ {
+ options->route_gateway_via_dhcp = true;
+ }
+ else
+ {
+ if (ip_or_dns_addr_safe (p[1], options->allow_pull_fqdn) || is_special_addr (p[1])) /* FQDN -- may be DNS name */
+ {
+ options->route_default_gateway = p[1];
+ }
+ else
+ {
+ msg (msglevel, "route-gateway parm '%s' must be a valid address", p[1]);
+ goto err;
+ }
+ }
+ }
+ else if (streq (p[0], "route-metric") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ options->route_default_metric = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "route-delay"))
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
+ options->route_delay_defined = true;
+ if (p[1])
+ {
+ options->route_delay = positive_atoi (p[1]);
+ if (p[2])
+ {
+ options->route_delay_window = positive_atoi (p[2]);
+ }
+ }
+ else
+ {
+ options->route_delay = 0;
+ }
+ }
+ else if (streq (p[0], "route-up") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->route_script, p[1], "route-up", false);
+ }
+ else if (streq (p[0], "route-pre-down") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options,
+ &options->route_predown_script,
+ p[1],
+ "route-pre-down", true);
+ }
+ else if (streq (p[0], "route-noexec"))
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ options->route_noexec = true;
+ }
+ else if (streq (p[0], "route-nopull"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->route_nopull = true;
+ }
+ else if (streq (p[0], "allow-pull-fqdn"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->allow_pull_fqdn = true;
+ }
+ else if (streq (p[0], "redirect-gateway") || streq (p[0], "redirect-private"))
+ {
+ int j;
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ rol_check_alloc (options);
+ if (streq (p[0], "redirect-gateway"))
+ options->routes->flags |= RG_REROUTE_GW;
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ {
+ if (streq (p[j], "local"))
+ options->routes->flags |= RG_LOCAL;
+ else if (streq (p[j], "autolocal"))
+ options->routes->flags |= RG_AUTO_LOCAL;
+ else if (streq (p[j], "def1"))
+ options->routes->flags |= RG_DEF1;
+ else if (streq (p[j], "bypass-dhcp"))
+ options->routes->flags |= RG_BYPASS_DHCP;
+ else if (streq (p[j], "bypass-dns"))
+ options->routes->flags |= RG_BYPASS_DNS;
+ else if (streq (p[j], "block-local"))
+ options->routes->flags |= RG_BLOCK_LOCAL;
+ else if (streq (p[j], "unblock-local"))
+ options->routes->flags |= RG_UNBLOCK_LOCAL;
+ else
+ {
+ msg (msglevel, "unknown --%s flag: %s", p[0], p[j]);
+ goto err;
+ }
+ }
+ options->routes->flags |= RG_ENABLE;
+ }
+ else if (streq (p[0], "remote-random-hostname"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->sockflags |= SF_HOST_RANDOMIZE;
+ }
+ else if (streq (p[0], "setenv") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "REMOTE_RANDOM_HOSTNAME"))
+ {
+ options->sockflags |= SF_HOST_RANDOMIZE;
+ }
+ else if (streq (p[1], "GENERIC_CONFIG"))
+ {
+ msg (msglevel, "this is a generic configuration and cannot directly be used");
+ goto err;
+ }
+#ifdef ENABLE_PUSH_PEER_INFO
+ else if (streq (p[1], "PUSH_PEER_INFO"))
+ {
+ options->push_peer_info = true;
+ }
+#endif
+#if P2MP
+ else if (streq (p[1], "SERVER_POLL_TIMEOUT") && p[2])
+ {
+ options->server_poll_timeout = positive_atoi(p[2]);
+ }
+#endif
+ else
+ {
+ if (streq (p[1], "FORWARD_COMPATIBLE") && p[2] && streq (p[2], "1"))
+ {
+ options->forward_compatible = true;
+ msglevel_fc = msglevel_forward_compatible (options, msglevel);
+ }
+ setenv_str (es, p[1], p[2] ? p[2] : "");
+ }
+ }
+ else if (streq (p[0], "setenv-safe") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SETENV);
+ setenv_str_safe (es, p[1], p[2] ? p[2] : "");
+ }
+ else if (streq (p[0], "script-security") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ script_security = atoi (p[1]);
+ }
+ else if (streq (p[0], "mssfix"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION);
+ if (p[1])
+ {
+ options->ce.mssfix = positive_atoi (p[1]);
+ }
+ else
+ options->ce.mssfix_default = true;
+
+ }
+#ifdef ENABLE_OCC
+ else if (streq (p[0], "disable-occ"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->occ = false;
+ }
+#endif
+#if P2MP
+#if P2MP_SERVER
+ else if (streq (p[0], "server") && p[1] && p[2])
+ {
+ const int lev = M_WARN;
+ bool error = false;
+ in_addr_t network, netmask;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ network = get_ip_addr (p[1], lev, &error);
+ netmask = get_ip_addr (p[2], lev, &error);
+ if (error || !network || !netmask)
+ {
+ msg (msglevel, "error parsing --server parameters");
+ goto err;
+ }
+ options->server_defined = true;
+ options->server_network = network;
+ options->server_netmask = netmask;
+
+ if (p[3])
+ {
+ if (streq (p[3], "nopool"))
+ options->server_flags |= SF_NOPOOL;
+ else
+ {
+ msg (msglevel, "error parsing --server: %s is not a recognized flag", p[3]);
+ goto err;
+ }
+ }
+ }
+ else if (streq (p[0], "server-ipv6") && p[1] )
+ {
+ const int lev = M_WARN;
+ struct in6_addr network;
+ unsigned int netbits = 0;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if ( ! get_ipv6_addr (p[1], &network, &netbits, NULL, lev) )
+ {
+ msg (msglevel, "error parsing --server-ipv6 parameter");
+ goto err;
+ }
+ if ( netbits < 64 || netbits > 112 )
+ {
+ msg( msglevel, "--server-ipv6 settings: only /64../112 supported right now (not /%d)", netbits );
+ goto err;
+ }
+ options->server_ipv6_defined = true;
+ options->server_network_ipv6 = network;
+ options->server_netbits_ipv6 = netbits;
+
+ if (p[2]) /* no "nopool" options or similar for IPv6 */
+ {
+ msg (msglevel, "error parsing --server-ipv6: %s is not a recognized flag", p[3]);
+ goto err;
+ }
+ }
+ else if (streq (p[0], "server-bridge") && p[1] && p[2] && p[3] && p[4])
+ {
+ const int lev = M_WARN;
+ bool error = false;
+ in_addr_t ip, netmask, pool_start, pool_end;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ ip = get_ip_addr (p[1], lev, &error);
+ netmask = get_ip_addr (p[2], lev, &error);
+ pool_start = get_ip_addr (p[3], lev, &error);
+ pool_end = get_ip_addr (p[4], lev, &error);
+ if (error || !ip || !netmask || !pool_start || !pool_end)
+ {
+ msg (msglevel, "error parsing --server-bridge parameters");
+ goto err;
+ }
+ options->server_bridge_defined = true;
+ options->server_bridge_ip = ip;
+ options->server_bridge_netmask = netmask;
+ options->server_bridge_pool_start = pool_start;
+ options->server_bridge_pool_end = pool_end;
+ }
+ else if (streq (p[0], "server-bridge") && p[1] && streq (p[1], "nogw"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->server_bridge_proxy_dhcp = true;
+ options->server_flags |= SF_NO_PUSH_ROUTE_GATEWAY;
+ }
+ else if (streq (p[0], "server-bridge") && !p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->server_bridge_proxy_dhcp = true;
+ }
+ else if (streq (p[0], "push") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_PUSH);
+ push_options (options, &p[1], msglevel, &options->gc);
+ }
+ else if (streq (p[0], "push-reset"))
+ {
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+ push_reset (options);
+ }
+ else if (streq (p[0], "ifconfig-pool") && p[1] && p[2])
+ {
+ const int lev = M_WARN;
+ bool error = false;
+ in_addr_t start, end, netmask=0;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ start = get_ip_addr (p[1], lev, &error);
+ end = get_ip_addr (p[2], lev, &error);
+ if (p[3])
+ {
+ netmask = get_ip_addr (p[3], lev, &error);
+ }
+ if (error)
+ {
+ msg (msglevel, "error parsing --ifconfig-pool parameters");
+ goto err;
+ }
+ if (!ifconfig_pool_verify_range (msglevel, start, end))
+ goto err;
+
+ options->ifconfig_pool_defined = true;
+ options->ifconfig_pool_start = start;
+ options->ifconfig_pool_end = end;
+ if (netmask)
+ options->ifconfig_pool_netmask = netmask;
+ }
+ else if (streq (p[0], "ifconfig-pool-persist") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ifconfig_pool_persist_filename = p[1];
+ if (p[2])
+ {
+ options->ifconfig_pool_persist_refresh_freq = positive_atoi (p[2]);
+ }
+ }
+ else if (streq (p[0], "ifconfig-pool-linear"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->topology = TOP_P2P;
+ }
+ else if (streq (p[0], "ifconfig-ipv6-pool") && p[1] )
+ {
+ const int lev = M_WARN;
+ struct in6_addr network;
+ unsigned int netbits = 0;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if ( ! get_ipv6_addr (p[1], &network, &netbits, NULL, lev ) )
+ {
+ msg (msglevel, "error parsing --ifconfig-ipv6-pool parameters");
+ goto err;
+ }
+ if ( netbits < 64 || netbits > 112 )
+ {
+ msg( msglevel, "--ifconfig-ipv6-pool settings: only /64../112 supported right now (not /%d)", netbits );
+ goto err;
+ }
+
+ options->ifconfig_ipv6_pool_defined = true;
+ options->ifconfig_ipv6_pool_base = network;
+ options->ifconfig_ipv6_pool_netbits = netbits;
+ }
+ else if (streq (p[0], "hash-size") && p[1] && p[2])
+ {
+ int real, virtual;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ real = atoi (p[1]);
+ virtual = atoi (p[2]);
+ if (real < 1 || virtual < 1)
+ {
+ msg (msglevel, "--hash-size sizes must be >= 1 (preferably a power of 2)");
+ goto err;
+ }
+ options->real_hash_size = real;
+ options->virtual_hash_size = real;
+ }
+ else if (streq (p[0], "connect-freq") && p[1] && p[2])
+ {
+ int cf_max, cf_per;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ cf_max = atoi (p[1]);
+ cf_per = atoi (p[2]);
+ if (cf_max < 0 || cf_per < 0)
+ {
+ msg (msglevel, "--connect-freq parms must be > 0");
+ goto err;
+ }
+ options->cf_max = cf_max;
+ options->cf_per = cf_per;
+ }
+ else if (streq (p[0], "max-clients") && p[1])
+ {
+ int max_clients;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ max_clients = atoi (p[1]);
+ if (max_clients < 0)
+ {
+ msg (msglevel, "--max-clients must be at least 1");
+ goto err;
+ }
+ options->max_clients = max_clients;
+ }
+ else if (streq (p[0], "max-routes-per-client") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_INHERIT);
+ options->max_routes_per_client = max_int (atoi (p[1]), 1);
+ }
+ else if (streq (p[0], "client-cert-not-required"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ssl_flags |= SSLF_CLIENT_CERT_NOT_REQUIRED;
+ }
+ else if (streq (p[0], "username-as-common-name"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ssl_flags |= SSLF_USERNAME_AS_COMMON_NAME;
+ }
+ else if (streq (p[0], "auth-user-pass-optional"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ssl_flags |= SSLF_AUTH_USER_PASS_OPTIONAL;
+ }
+ else if (streq (p[0], "opt-verify"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ssl_flags |= SSLF_OPT_VERIFY;
+ }
+ else if (streq (p[0], "auth-user-pass-verify") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 3, NM_QUOTE_HINT))
+ goto err;
+ if (p[2])
+ {
+ if (streq (p[2], "via-env"))
+ options->auth_user_pass_verify_script_via_file = false;
+ else if (streq (p[2], "via-file"))
+ options->auth_user_pass_verify_script_via_file = true;
+ else
+ {
+ msg (msglevel, "second parm to --auth-user-pass-verify must be 'via-env' or 'via-file'");
+ goto err;
+ }
+ }
+ else
+ {
+ msg (msglevel, "--auth-user-pass-verify requires a second parameter ('via-env' or 'via-file')");
+ goto err;
+ }
+ set_user_script (options,
+ &options->auth_user_pass_verify_script,
+ p[1], "auth-user-pass-verify", true);
+ }
+ else if (streq (p[0], "client-connect") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->client_connect_script,
+ p[1], "client-connect", true);
+ }
+ else if (streq (p[0], "client-disconnect") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->client_disconnect_script,
+ p[1], "client-disconnect", true);
+ }
+ else if (streq (p[0], "learn-address") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->learn_address_script,
+ p[1], "learn-address", true);
+ }
+ else if (streq (p[0], "tmp-dir") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->tmp_dir = p[1];
+ }
+ else if (streq (p[0], "client-config-dir") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->client_config_dir = p[1];
+ }
+ else if (streq (p[0], "ccd-exclusive"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ccd_exclusive = true;
+ }
+ else if (streq (p[0], "bcast-buffers") && p[1])
+ {
+ int n_bcast_buf;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ n_bcast_buf = atoi (p[1]);
+ if (n_bcast_buf < 1)
+ msg (msglevel, "--bcast-buffers parameter must be > 0");
+ options->n_bcast_buf = n_bcast_buf;
+ }
+ else if (streq (p[0], "tcp-queue-limit") && p[1])
+ {
+ int tcp_queue_limit;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ tcp_queue_limit = atoi (p[1]);
+ if (tcp_queue_limit < 1)
+ msg (msglevel, "--tcp-queue-limit parameter must be > 0");
+ options->tcp_queue_limit = tcp_queue_limit;
+ }
+#if PORT_SHARE
+ else if (streq (p[0], "port-share") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->port_share_host = p[1];
+ options->port_share_port = p[2];
+ options->port_share_journal_dir = p[3];
+ }
+#endif
+ else if (streq (p[0], "client-to-client"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->enable_c2c = true;
+ }
+ else if (streq (p[0], "duplicate-cn"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->duplicate_cn = true;
+ }
+ else if (streq (p[0], "iroute") && p[1])
+ {
+ const char *netmask = NULL;
+
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+ if (p[2])
+ {
+ netmask = p[2];
+ }
+ option_iroute (options, p[1], netmask, msglevel);
+ }
+ else if (streq (p[0], "iroute-ipv6") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+ option_iroute_ipv6 (options, p[1], msglevel);
+ }
+ else if (streq (p[0], "ifconfig-push") && p[1] && p[2])
+ {
+ in_addr_t local, remote_netmask;
+
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+ local = getaddr (GETADDR_HOST_ORDER|GETADDR_RESOLVE, p[1], 0, NULL, NULL);
+ remote_netmask = getaddr (GETADDR_HOST_ORDER|GETADDR_RESOLVE, p[2], 0, NULL, NULL);
+ if (local && remote_netmask)
+ {
+ options->push_ifconfig_defined = true;
+ options->push_ifconfig_local = local;
+ options->push_ifconfig_remote_netmask = remote_netmask;
+ if (p[3])
+ options->push_ifconfig_local_alias = getaddr (GETADDR_HOST_ORDER|GETADDR_RESOLVE, p[3], 0, NULL, NULL);
+ }
+ else
+ {
+ msg (msglevel, "cannot parse --ifconfig-push addresses");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "ifconfig-push-constraint") && p[1] && p[2])
+ {
+ in_addr_t network, netmask;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ network = getaddr (GETADDR_HOST_ORDER|GETADDR_RESOLVE, p[1], 0, NULL, NULL);
+ netmask = getaddr (GETADDR_HOST_ORDER, p[2], 0, NULL, NULL);
+ if (network && netmask)
+ {
+ options->push_ifconfig_constraint_defined = true;
+ options->push_ifconfig_constraint_network = network;
+ options->push_ifconfig_constraint_netmask = netmask;
+ }
+ else
+ {
+ msg (msglevel, "cannot parse --ifconfig-push-constraint addresses");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "ifconfig-ipv6-push") && p[1] )
+ {
+ struct in6_addr local, remote;
+ unsigned int netbits;
+
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+
+ if ( ! get_ipv6_addr( p[1], &local, &netbits, NULL, msglevel ) )
+ {
+ msg (msglevel, "cannot parse --ifconfig-ipv6-push addresses");
+ goto err;
+ }
+
+ if ( p[2] )
+ {
+ if ( !get_ipv6_addr( p[2], &remote, NULL, NULL, msglevel ) )
+ {
+ msg( msglevel, "cannot parse --ifconfig-ipv6-push addresses");
+ goto err;
+ }
+ }
+ else
+ {
+ if ( ! options->ifconfig_ipv6_local ||
+ ! get_ipv6_addr( options->ifconfig_ipv6_local, &remote,
+ NULL, NULL, msglevel ) )
+ {
+ msg( msglevel, "second argument to --ifconfig-ipv6-push missing and no global --ifconfig-ipv6 address set");
+ goto err;
+ }
+ }
+
+ options->push_ifconfig_ipv6_defined = true;
+ options->push_ifconfig_ipv6_local = local;
+ options->push_ifconfig_ipv6_netbits = netbits;
+ options->push_ifconfig_ipv6_remote = remote;
+ }
+ else if (streq (p[0], "disable"))
+ {
+ VERIFY_PERMISSION (OPT_P_INSTANCE);
+ options->disable = true;
+ }
+ else if (streq (p[0], "tcp-nodelay"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->server_flags |= SF_TCP_NODELAY_HELPER;
+ }
+ else if (streq (p[0], "stale-routes-check") && p[1])
+ {
+ int ageing_time, check_interval;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ ageing_time = atoi (p[1]);
+ if (p[2])
+ check_interval = atoi (p[2]);
+ else
+ check_interval = ageing_time;
+
+ if (ageing_time < 1 || check_interval < 1)
+ {
+ msg (msglevel, "--stale-routes-check aging time and check interval must be >= 1");
+ goto err;
+ }
+ options->stale_routes_ageing_time = ageing_time;
+ options->stale_routes_check_interval = check_interval;
+ }
+#endif /* P2MP_SERVER */
+
+ else if (streq (p[0], "client"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->client = true;
+ }
+ else if (streq (p[0], "pull"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->pull = true;
+ }
+ else if (streq (p[0], "push-continuation") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_PULL_MODE);
+ options->push_continuation = atoi(p[1]);
+ }
+ else if (streq (p[0], "server-poll-timeout") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->server_poll_timeout = positive_atoi(p[1]);
+ }
+ else if (streq (p[0], "auth-user-pass"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (p[1])
+ {
+ options->auth_user_pass_file = p[1];
+ }
+ else
+ options->auth_user_pass_file = "stdin";
+ }
+ else if (streq (p[0], "auth-retry") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ auth_retry_set (msglevel, p[1]);
+ }
+#ifdef ENABLE_CLIENT_CR
+ else if (streq (p[0], "static-challenge") && p[1] && p[2])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->sc_info.challenge_text = p[1];
+ if (atoi(p[2]))
+ options->sc_info.flags |= SC_ECHO;
+ }
+#endif
+#endif
+#ifdef WIN32
+ else if (streq (p[0], "win-sys") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "env"))
+ msg (M_INFO, "NOTE: --win-sys env is default from OpenVPN v2.3. "
+ "This entry will now be ignored. "
+ "Please remove this entry from your configuration file.");
+ else
+ set_win_sys_path (p[1], es);
+ }
+ else if (streq (p[0], "route-method") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
+ if (streq (p[1], "adaptive"))
+ options->route_method = ROUTE_METHOD_ADAPTIVE;
+ else if (streq (p[1], "ipapi"))
+ options->route_method = ROUTE_METHOD_IPAPI;
+ else if (streq (p[1], "exe"))
+ options->route_method = ROUTE_METHOD_EXE;
+ else
+ {
+ msg (msglevel, "--route method must be 'adaptive', 'ipapi', or 'exe'");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "ip-win32") && p[1])
+ {
+ const int index = ascii2ipset (p[1]);
+ struct tuntap_options *to = &options->tuntap_options;
+
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+
+ if (index < 0)
+ {
+ msg (msglevel,
+ "Bad --ip-win32 method: '%s'. Allowed methods: %s",
+ p[1],
+ ipset2ascii_all (&gc));
+ goto err;
+ }
+
+ if (index == IPW32_SET_ADAPTIVE)
+ options->route_delay_window = IPW32_SET_ADAPTIVE_DELAY_WINDOW;
+
+ if (index == IPW32_SET_DHCP_MASQ)
+ {
+ if (p[2])
+ {
+ if (!streq (p[2], "default"))
+ {
+ int offset = atoi (p[2]);
+
+ if (!(offset > -256 && offset < 256))
+ {
+ msg (msglevel, "--ip-win32 dynamic [offset] [lease-time]: offset (%d) must be > -256 and < 256", offset);
+ goto err;
+ }
+
+ to->dhcp_masq_custom_offset = true;
+ to->dhcp_masq_offset = offset;
+ }
+
+ if (p[3])
+ {
+ const int min_lease = 30;
+ int lease_time;
+ lease_time = atoi (p[3]);
+ if (lease_time < min_lease)
+ {
+ msg (msglevel, "--ip-win32 dynamic [offset] [lease-time]: lease time parameter (%d) must be at least %d seconds", lease_time, min_lease);
+ goto err;
+ }
+ to->dhcp_lease_time = lease_time;
+ }
+ }
+ }
+ to->ip_win32_type = index;
+ to->ip_win32_defined = true;
+ }
+#endif
+#if defined(WIN32) || defined(TARGET_ANDROID)
+ else if (streq (p[0], "dhcp-option") && p[1])
+ {
+ struct tuntap_options *o = &options->tuntap_options;
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+
+ if (streq (p[1], "DOMAIN") && p[2])
+ {
+ o->domain = p[2];
+ }
+ else if (streq (p[1], "NBS") && p[2])
+ {
+ o->netbios_scope = p[2];
+ }
+ else if (streq (p[1], "NBT") && p[2])
+ {
+ int t;
+ t = atoi (p[2]);
+ if (!(t == 1 || t == 2 || t == 4 || t == 8))
+ {
+ msg (msglevel, "--dhcp-option NBT: parameter (%d) must be 1, 2, 4, or 8", t);
+ goto err;
+ }
+ o->netbios_node_type = t;
+ }
+ else if (streq (p[1], "DNS") && p[2])
+ {
+ dhcp_option_address_parse ("DNS", p[2], o->dns, &o->dns_len, msglevel);
+ }
+ else if (streq (p[1], "WINS") && p[2])
+ {
+ dhcp_option_address_parse ("WINS", p[2], o->wins, &o->wins_len, msglevel);
+ }
+ else if (streq (p[1], "NTP") && p[2])
+ {
+ dhcp_option_address_parse ("NTP", p[2], o->ntp, &o->ntp_len, msglevel);
+ }
+ else if (streq (p[1], "NBDD") && p[2])
+ {
+ dhcp_option_address_parse ("NBDD", p[2], o->nbdd, &o->nbdd_len, msglevel);
+ }
+ else if (streq (p[1], "DISABLE-NBT"))
+ {
+ o->disable_nbt = 1;
+ }
+ else
+ {
+ msg (msglevel, "--dhcp-option: unknown option type '%s' or missing parameter", p[1]);
+ goto err;
+ }
+ o->dhcp_options = true;
+ }
+#endif
+#ifdef WIN32
+ else if (streq (p[0], "show-adapters"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ show_tap_win_adapters (M_INFO|M_NOPREFIX, M_WARN|M_NOPREFIX);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "show-net"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ show_routes (M_INFO|M_NOPREFIX);
+ show_adapters (M_INFO|M_NOPREFIX);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "show-net-up"))
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->show_net_up = true;
+ }
+ else if (streq (p[0], "tap-sleep") && p[1])
+ {
+ int s;
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ s = atoi (p[1]);
+ if (s < 0 || s >= 256)
+ {
+ msg (msglevel, "--tap-sleep parameter must be between 0 and 255");
+ goto err;
+ }
+ options->tuntap_options.tap_sleep = s;
+ }
+ else if (streq (p[0], "dhcp-renew"))
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ options->tuntap_options.dhcp_renew = true;
+ }
+ else if (streq (p[0], "dhcp-pre-release"))
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ options->tuntap_options.dhcp_pre_release = true;
+ }
+ else if (streq (p[0], "dhcp-release"))
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ options->tuntap_options.dhcp_release = true;
+ }
+ else if (streq (p[0], "dhcp-internal") && p[1]) /* standalone method for internal use */
+ {
+ unsigned int adapter_index;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ set_debug_level (options->verbosity, SDL_CONSTRAIN);
+ adapter_index = atou (p[1]);
+ sleep (options->tuntap_options.tap_sleep);
+ if (options->tuntap_options.dhcp_pre_release)
+ dhcp_release_by_adapter_index (adapter_index);
+ if (options->tuntap_options.dhcp_renew)
+ dhcp_renew_by_adapter_index (adapter_index);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "register-dns"))
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ options->tuntap_options.register_dns = true;
+ }
+ else if (streq (p[0], "rdns-internal"))
+ /* standalone method for internal use
+ *
+ * (if --register-dns is set, openvpn needs to call itself in a
+ * sub-process to execute the required functions in a non-blocking
+ * way, and uses --rdns-internal to signal that to itself)
+ */
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ set_debug_level (options->verbosity, SDL_CONSTRAIN);
+ if (options->tuntap_options.register_dns)
+ ipconfig_register_dns (NULL);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "show-valid-subnets"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ show_valid_win32_tun_subnets ();
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "pause-exit"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ set_pause_exit_win32 ();
+ }
+ else if (streq (p[0], "service") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->exit_event_name = p[1];
+ if (p[2])
+ {
+ options->exit_event_initial_state = (atoi(p[2]) != 0);
+ }
+ }
+ else if (streq (p[0], "allow-nonadmin"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ tap_allow_nonadmin_access (p[1]);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "user") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ msg (M_WARN, "NOTE: --user option is not implemented on Windows");
+ }
+ else if (streq (p[0], "group") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ msg (M_WARN, "NOTE: --group option is not implemented on Windows");
+ }
+#else
+ else if (streq (p[0], "user") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->username = p[1];
+ }
+ else if (streq (p[0], "group") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->groupname = p[1];
+ }
+ else if (streq (p[0], "dhcp-option") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_IPWIN32);
+ foreign_option (options, p, 3, es);
+ }
+ else if (streq (p[0], "route-method") && p[1]) /* ignore when pushed to non-Windows OS */
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
+ }
+#endif
+#if PASSTOS_CAPABILITY
+ else if (streq (p[0], "passtos"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->passtos = true;
+ }
+#endif
+#if defined(USE_COMP)
+ else if (streq (p[0], "comp-lzo"))
+ {
+ VERIFY_PERMISSION (OPT_P_COMP);
+
+#if defined(ENABLE_LZO)
+ if (p[1] && streq (p[1], "no"))
+#endif
+ {
+ options->comp.alg = COMP_ALG_STUB;
+ options->comp.flags = 0;
+ }
+#if defined(ENABLE_LZO)
+ else if (p[1])
+ {
+ if (streq (p[1], "yes"))
+ {
+ options->comp.alg = COMP_ALG_LZO;
+ options->comp.flags = 0;
+ }
+ else if (streq (p[1], "adaptive"))
+ {
+ options->comp.alg = COMP_ALG_LZO;
+ options->comp.flags = COMP_F_ADAPTIVE;
+ }
+ else
+ {
+ msg (msglevel, "bad comp-lzo option: %s -- must be 'yes', 'no', or 'adaptive'", p[1]);
+ goto err;
+ }
+ }
+ else
+ {
+ options->comp.alg = COMP_ALG_LZO;
+ options->comp.flags = COMP_F_ADAPTIVE;
+ }
+#endif
+ }
+ else if (streq (p[0], "comp-noadapt"))
+ {
+ VERIFY_PERMISSION (OPT_P_COMP);
+ options->comp.flags &= ~COMP_F_ADAPTIVE;
+ }
+ else if (streq (p[0], "compress"))
+ {
+ VERIFY_PERMISSION (OPT_P_COMP);
+ if (p[1])
+ {
+ if (streq (p[1], "stub"))
+ {
+ options->comp.alg = COMP_ALG_STUB;
+ options->comp.flags = (COMP_F_SWAP|COMP_F_ADVERTISE_STUBS_ONLY);
+ }
+#if defined(ENABLE_LZO)
+ else if (streq (p[1], "lzo"))
+ {
+ options->comp.alg = COMP_ALG_LZO;
+ options->comp.flags = 0;
+ }
+#endif
+#if defined(ENABLE_SNAPPY)
+ else if (streq (p[1], "snappy"))
+ {
+ options->comp.alg = COMP_ALG_SNAPPY;
+ options->comp.flags = COMP_F_SWAP;
+ }
+#endif
+#if defined(ENABLE_LZ4)
+ else if (streq (p[1], "lz4"))
+ {
+ options->comp.alg = COMP_ALG_LZ4;
+ options->comp.flags = COMP_F_SWAP;
+ }
+#endif
+ else
+ {
+ msg (msglevel, "bad comp option: %s", p[1]);
+ goto err;
+ }
+ }
+ else
+ {
+ options->comp.alg = COMP_ALG_STUB;
+ options->comp.flags = COMP_F_SWAP;
+ }
+ }
+#endif /* USE_COMP */
+#ifdef ENABLE_CRYPTO
+ else if (streq (p[0], "show-ciphers"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->show_ciphers = true;
+ }
+ else if (streq (p[0], "show-digests"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->show_digests = true;
+ }
+ else if (streq (p[0], "show-engines"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->show_engines = true;
+ }
+ else if (streq (p[0], "key-direction") && p[1])
+ {
+ int key_direction;
+
+ key_direction = ascii2keydirection (msglevel, p[1]);
+ if (key_direction >= 0)
+ options->key_direction = key_direction;
+ else
+ goto err;
+ }
+ else if (streq (p[0], "secret") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->shared_secret_file_inline = p[2];
+ }
+ else
+ if (p[2])
+ {
+ int key_direction;
+
+ key_direction = ascii2keydirection (msglevel, p[2]);
+ if (key_direction >= 0)
+ options->key_direction = key_direction;
+ else
+ goto err;
+ }
+ options->shared_secret_file = p[1];
+ }
+ else if (streq (p[0], "genkey"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->genkey = true;
+ }
+ else if (streq (p[0], "auth") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->authname_defined = true;
+ options->authname = p[1];
+ if (streq (options->authname, "none"))
+ {
+ options->authname_defined = false;
+ options->authname = NULL;
+ }
+ }
+ else if (streq (p[0], "auth"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->authname_defined = true;
+ }
+ else if (streq (p[0], "cipher") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->ciphername_defined = true;
+ options->ciphername = p[1];
+ if (streq (options->ciphername, "none"))
+ {
+ options->ciphername_defined = false;
+ options->ciphername = NULL;
+ }
+ }
+ else if (streq (p[0], "cipher"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->ciphername_defined = true;
+ }
+ else if (streq (p[0], "prng") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ if (streq (p[1], "none"))
+ options->prng_hash = NULL;
+ else
+ options->prng_hash = p[1];
+ if (p[2])
+ {
+ const int sl = atoi (p[2]);
+ if (sl >= NONCE_SECRET_LEN_MIN && sl <= NONCE_SECRET_LEN_MAX)
+ {
+ options->prng_nonce_secret_len = sl;
+ }
+ else
+ {
+ msg (msglevel, "prng parameter nonce_secret_len must be between %d and %d",
+ NONCE_SECRET_LEN_MIN, NONCE_SECRET_LEN_MAX);
+ goto err;
+ }
+ }
+ }
+ else if (streq (p[0], "no-replay"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->replay = false;
+ }
+ else if (streq (p[0], "replay-window"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ if (p[1])
+ {
+ int replay_window;
+
+ replay_window = atoi (p[1]);
+ if (!(MIN_SEQ_BACKTRACK <= replay_window && replay_window <= MAX_SEQ_BACKTRACK))
+ {
+ msg (msglevel, "replay-window window size parameter (%d) must be between %d and %d",
+ replay_window,
+ MIN_SEQ_BACKTRACK,
+ MAX_SEQ_BACKTRACK);
+ goto err;
+ }
+ options->replay_window = replay_window;
+
+ if (p[2])
+ {
+ int replay_time;
+
+ replay_time = atoi (p[2]);
+ if (!(MIN_TIME_BACKTRACK <= replay_time && replay_time <= MAX_TIME_BACKTRACK))
+ {
+ msg (msglevel, "replay-window time window parameter (%d) must be between %d and %d",
+ replay_time,
+ MIN_TIME_BACKTRACK,
+ MAX_TIME_BACKTRACK);
+ goto err;
+ }
+ options->replay_time = replay_time;
+ }
+ }
+ else
+ {
+ msg (msglevel, "replay-window option is missing window size parameter");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "mute-replay-warnings"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->mute_replay_warnings = true;
+ }
+ else if (streq (p[0], "no-iv"))
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->use_iv = false;
+ }
+ else if (streq (p[0], "replay-persist") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->packet_id_file = p[1];
+ }
+ else if (streq (p[0], "test-crypto"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->test_crypto = true;
+ }
+#ifndef ENABLE_CRYPTO_POLARSSL
+ else if (streq (p[0], "engine"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (p[1])
+ {
+ options->engine = p[1];
+ }
+ else
+ options->engine = "auto";
+ }
+#endif /* ENABLE_CRYPTO_POLARSSL */
+#ifdef HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH
+ else if (streq (p[0], "keysize") && p[1])
+ {
+ int keysize;
+
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ keysize = atoi (p[1]) / 8;
+ if (keysize < 0 || keysize > MAX_CIPHER_KEY_LENGTH)
+ {
+ msg (msglevel, "Bad keysize: %s", p[1]);
+ goto err;
+ }
+ options->keysize = keysize;
+ }
+#endif
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ else if (streq (p[0], "use-prediction-resistance"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->use_prediction_resistance = true;
+ }
+#endif
+#ifdef ENABLE_SSL
+ else if (streq (p[0], "show-tls"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->show_tls_ciphers = true;
+ }
+ else if (streq (p[0], "show-curves"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->show_curves = true;
+ }
+ else if (streq (p[0], "ecdh-curve") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_CRYPTO);
+ options->ecdh_curve= p[1];
+ }
+ else if (streq (p[0], "tls-server"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->tls_server = true;
+ }
+ else if (streq (p[0], "tls-client"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->tls_client = true;
+ }
+ else if (streq (p[0], "ca") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ca_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->ca_file_inline = p[2];
+ }
+ }
+#ifndef ENABLE_CRYPTO_POLARSSL
+ else if (streq (p[0], "capath") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->ca_path = p[1];
+ }
+#endif /* ENABLE_CRYPTO_POLARSSL */
+ else if (streq (p[0], "dh") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->dh_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->dh_file_inline = p[2];
+ }
+ }
+ else if (streq (p[0], "cert") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->cert_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->cert_file_inline = p[2];
+ }
+ }
+ else if (streq (p[0], "extra-certs") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->extra_certs_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->extra_certs_file_inline = p[2];
+ }
+ }
+ else if (streq (p[0], "verify-hash") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->verify_hash = parse_hash_fingerprint(p[1], SHA_DIGEST_LENGTH, msglevel, &options->gc);
+ }
+#ifdef ENABLE_CRYPTOAPI
+ else if (streq (p[0], "cryptoapicert") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->cryptoapi_cert = p[1];
+ }
+#endif
+ else if (streq (p[0], "key") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->priv_key_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->priv_key_file_inline = p[2];
+ }
+ }
+ else if (streq (p[0], "tls-version-min") && p[1])
+ {
+ int ver;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ ver = tls_version_min_parse(p[1], p[2]);
+ if (ver == TLS_VER_BAD)
+ {
+ msg (msglevel, "unknown tls-version-min parameter: %s", p[1]);
+ goto err;
+ }
+ options->ssl_flags &= ~(SSLF_TLS_VERSION_MASK << SSLF_TLS_VERSION_SHIFT);
+ options->ssl_flags |= (ver << SSLF_TLS_VERSION_SHIFT);
+ }
+#ifndef ENABLE_CRYPTO_POLARSSL
+ else if (streq (p[0], "pkcs12") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->pkcs12_file = p[1];
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->pkcs12_file_inline = p[2];
+ }
+ }
+#endif /* ENABLE_CRYPTO_POLARSSL */
+ else if (streq (p[0], "askpass"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (p[1])
+ {
+ options->key_pass_file = p[1];
+ }
+ else
+ options->key_pass_file = "stdin";
+ }
+ else if (streq (p[0], "auth-nocache"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ ssl_set_auth_nocache ();
+ }
+ else if (streq (p[0], "auth-token") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ECHO);
+ ssl_set_auth_token(p[1]);
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_auth_token (management, p[1]);
+#endif
+ }
+ else if (streq (p[0], "single-session"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->single_session = true;
+ }
+#ifdef ENABLE_PUSH_PEER_INFO
+ else if (streq (p[0], "push-peer-info"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->push_peer_info = true;
+ }
+#endif
+ else if (streq (p[0], "tls-exit"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->tls_exit = true;
+ }
+ else if (streq (p[0], "tls-cipher") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->cipher_list = p[1];
+ }
+ else if (streq (p[0], "crl-verify") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (p[2] && streq(p[2], "dir"))
+ options->ssl_flags |= SSLF_CRL_VERIFY_DIR;
+ options->crl_file = p[1];
+ }
+ else if (streq (p[0], "tls-verify") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_SCRIPT);
+ if (!no_more_than_n_args (msglevel, p, 2, NM_QUOTE_HINT))
+ goto err;
+ set_user_script (options, &options->tls_verify,
+ string_substitute (p[1], ',', ' ', &options->gc),
+ "tls-verify", true);
+ }
+#ifndef ENABLE_CRYPTO_POLARSSL
+ else if (streq (p[0], "tls-export-cert") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->tls_export_cert = p[1];
+ }
+#endif
+ else if (streq (p[0], "compat-names"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (options->verify_x509_type != VERIFY_X509_NONE &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_DN &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_RDN_PREFIX)
+ {
+ msg (msglevel, "you cannot use --compat-names with --verify-x509-name");
+ goto err;
+ }
+ msg (M_WARN, "DEPRECATED OPTION: --compat-names, please update your configuration");
+ compat_flag (COMPAT_FLAG_SET | COMPAT_NAMES);
+#if P2MP_SERVER
+ if (p[1] && streq (p[1], "no-remapping"))
+ compat_flag (COMPAT_FLAG_SET | COMPAT_NO_NAME_REMAPPING);
+ }
+ else if (streq (p[0], "no-name-remapping"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (options->verify_x509_type != VERIFY_X509_NONE &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_DN &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_RDN_PREFIX)
+ {
+ msg (msglevel, "you cannot use --no-name-remapping with --verify-x509-name");
+ goto err;
+ }
+ msg (M_WARN, "DEPRECATED OPTION: --no-name-remapping, please update your configuration");
+ compat_flag (COMPAT_FLAG_SET | COMPAT_NAMES);
+ compat_flag (COMPAT_FLAG_SET | COMPAT_NO_NAME_REMAPPING);
+#endif
+ }
+ else if (streq (p[0], "tls-remote") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ if (options->verify_x509_type != VERIFY_X509_NONE &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_DN &&
+ options->verify_x509_type != TLS_REMOTE_SUBJECT_RDN_PREFIX)
+ {
+ msg (msglevel, "you cannot use --tls-remote with --verify-x509-name");
+ goto err;
+ }
+ msg (M_WARN, "DEPRECATED OPTION: --tls-remote, please update your configuration");
+
+ if (strlen (p[1]))
+ {
+ int is_username = (!strchr (p[1], '=') || !strstr (p[1], ", "));
+ int type = TLS_REMOTE_SUBJECT_DN;
+ if (p[1][0] != '/' && is_username)
+ type = TLS_REMOTE_SUBJECT_RDN_PREFIX;
+
+ /*
+ * Enable legacy openvpn format for DNs that have not been converted
+ * yet and --x509-username-field (not containing an '=' or ', ')
+ */
+ if (p[1][0] == '/' || is_username)
+ compat_flag (COMPAT_FLAG_SET | COMPAT_NAMES);
+
+ options->verify_x509_type = type;
+ options->verify_x509_name = p[1];
+ }
+ }
+ else if (streq (p[0], "verify-x509-name") && p[1] && strlen (p[1]))
+ {
+ int type = VERIFY_X509_SUBJECT_DN;
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (options->verify_x509_type == TLS_REMOTE_SUBJECT_DN ||
+ options->verify_x509_type == TLS_REMOTE_SUBJECT_RDN_PREFIX)
+ {
+ msg (msglevel, "you cannot use --verify-x509-name with --tls-remote");
+ goto err;
+ }
+ if (compat_flag (COMPAT_FLAG_QUERY | COMPAT_NAMES))
+ {
+ msg (msglevel, "you cannot use --verify-x509-name with "
+ "--compat-names or --no-name-remapping");
+ goto err;
+ }
+ if (p[2])
+ {
+ if (streq (p[2], "subject"))
+ type = VERIFY_X509_SUBJECT_DN;
+ else if (streq (p[2], "name"))
+ type = VERIFY_X509_SUBJECT_RDN;
+ else if (streq (p[2], "name-prefix"))
+ type = VERIFY_X509_SUBJECT_RDN_PREFIX;
+ else
+ {
+ msg (msglevel, "unknown X.509 name type: %s", p[2]);
+ goto err;
+ }
+ }
+ options->verify_x509_type = type;
+ options->verify_x509_name = p[1];
+ }
+ else if (streq (p[0], "ns-cert-type") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], "server"))
+ options->ns_cert_type = NS_CERT_CHECK_SERVER;
+ else if (streq (p[1], "client"))
+ options->ns_cert_type = NS_CERT_CHECK_CLIENT;
+ else
+ {
+ msg (msglevel, "--ns-cert-type must be 'client' or 'server'");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "remote-cert-ku"))
+ {
+ int j;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ sscanf (p[j], "%x", &(options->remote_cert_ku[j-1]));
+ }
+ else if (streq (p[0], "remote-cert-eku") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->remote_cert_eku = p[1];
+ }
+ else if (streq (p[0], "remote-cert-tls") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ if (streq (p[1], "server"))
+ {
+ options->remote_cert_ku[0] = 0xa0;
+ options->remote_cert_ku[1] = 0x88;
+ options->remote_cert_eku = "TLS Web Server Authentication";
+ }
+ else if (streq (p[1], "client"))
+ {
+ options->remote_cert_ku[0] = 0x80;
+ options->remote_cert_ku[1] = 0x08;
+ options->remote_cert_ku[2] = 0x88;
+ options->remote_cert_eku = "TLS Web Client Authentication";
+ }
+ else
+ {
+ msg (msglevel, "--remote-cert-tls must be 'client' or 'server'");
+ goto err;
+ }
+ }
+ else if (streq (p[0], "tls-timeout") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->tls_timeout = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "reneg-bytes") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->renegotiate_bytes = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "reneg-pkts") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->renegotiate_packets = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "reneg-sec") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->renegotiate_seconds = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "hand-window") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->handshake_window = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "tran-window") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_TLS_PARMS);
+ options->transition_window = positive_atoi (p[1]);
+ }
+ else if (streq (p[0], "tls-auth") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (streq (p[1], INLINE_FILE_TAG) && p[2])
+ {
+ options->tls_auth_file_inline = p[2];
+ }
+ else
+ if (p[2])
+ {
+ int key_direction;
+
+ key_direction = ascii2keydirection (msglevel, p[2]);
+ if (key_direction >= 0)
+ options->key_direction = key_direction;
+ else
+ goto err;
+ }
+ options->tls_auth_file = p[1];
+ }
+ else if (streq (p[0], "key-method") && p[1])
+ {
+ int key_method;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ key_method = atoi (p[1]);
+ if (key_method < KEY_METHOD_MIN || key_method > KEY_METHOD_MAX)
+ {
+ msg (msglevel, "key_method parameter (%d) must be >= %d and <= %d",
+ key_method,
+ KEY_METHOD_MIN,
+ KEY_METHOD_MAX);
+ goto err;
+ }
+ options->key_method = key_method;
+ }
+#ifdef ENABLE_X509ALTUSERNAME
+ else if (streq (p[0], "x509-username-field") && p[1])
+ {
+ /* This option used to automatically upcase the fieldname passed as the
+ * option argument, e.g., "ou" became "OU". Now, this "helpfulness" is
+ * fine-tuned by only upcasing Subject field attribute names which consist
+ * of all lower-case characters. Mixed-case attributes such as
+ * "emailAddress" are left as-is. An option parameter having the "ext:"
+ * prefix for matching X.509v3 extended fields will also remain unchanged.
+ */
+ char *s = p[1];
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ if (strncmp("ext:", s, 4) != 0)
+ {
+ size_t i = 0;
+ while (s[i] && !isupper(s[i])) i++;
+ if (strlen(s) == i)
+ {
+ while ((*s = toupper(*s)) != '\0') s++;
+ msg(M_WARN, "DEPRECATED FEATURE: automatically upcased the "
+ "--x509-username-field parameter to '%s'; please update your"
+ "configuration", p[1]);
+ }
+ }
+ options->x509_username_field = p[1];
+ }
+#endif /* ENABLE_X509ALTUSERNAME */
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+#ifdef ENABLE_PKCS11
+ else if (streq (p[0], "show-pkcs11-ids") && p[1])
+ {
+ char *provider = p[1];
+ bool cert_private = (p[2] == NULL ? false : ( atoi (p[2]) != 0 ));
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ set_debug_level (options->verbosity, SDL_CONSTRAIN);
+ show_pkcs11_ids (provider, cert_private);
+ openvpn_exit (OPENVPN_EXIT_STATUS_GOOD); /* exit point */
+ }
+ else if (streq (p[0], "pkcs11-providers") && p[1])
+ {
+ int j;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ options->pkcs11_providers[j-1] = p[j];
+ }
+ else if (streq (p[0], "pkcs11-protected-authentication"))
+ {
+ int j;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ options->pkcs11_protected_authentication[j-1] = atoi (p[j]) != 0 ? 1 : 0;
+ }
+ else if (streq (p[0], "pkcs11-private-mode") && p[1])
+ {
+ int j;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ sscanf (p[j], "%x", &(options->pkcs11_private_mode[j-1]));
+ }
+ else if (streq (p[0], "pkcs11-cert-private"))
+ {
+ int j;
+
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+
+ for (j = 1; j < MAX_PARMS && p[j] != NULL; ++j)
+ options->pkcs11_cert_private[j-1] = atoi (p[j]) != 0 ? 1 : 0;
+ }
+ else if (streq (p[0], "pkcs11-pin-cache") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->pkcs11_pin_cache_period = atoi (p[1]);
+ }
+ else if (streq (p[0], "pkcs11-id") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->pkcs11_id = p[1];
+ }
+ else if (streq (p[0], "pkcs11-id-management"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->pkcs11_id_management = true;
+ }
+#endif
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+ else if (streq (p[0], "rmtun"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->persist_config = true;
+ options->persist_mode = 0;
+ }
+ else if (streq (p[0], "mktun"))
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ options->persist_config = true;
+ options->persist_mode = 1;
+ }
+#endif
+ else
+ {
+ int i;
+ int msglevel= msglevel_fc;
+ /* Check if an option is in --ignore-unknown-option and
+ set warning level to non fatal */
+ for(i=0; options->ignore_unknown_option && options->ignore_unknown_option[i]; i++)
+ {
+ if (streq(p[0], options->ignore_unknown_option[i]))
+ {
+ msglevel = M_WARN;
+ break;
+ }
+ }
+ if (file)
+ msg (msglevel, "Unrecognized option or missing parameter(s) in %s:%d: %s (%s)", file, line, p[0], PACKAGE_VERSION);
+ else
+ msg (msglevel, "Unrecognized option or missing parameter(s): --%s (%s)", p[0], PACKAGE_VERSION);
+ }
+ err:
+ gc_free (&gc);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/options.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/options.h
new file mode 100644
index 00000000..77c942ca
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/options.h
@@ -0,0 +1,779 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * 2004-01-28: Added Socks5 proxy support
+ * (Christof Meerwald, http://cmeerw.org)
+ */
+
+#ifndef OPTIONS_H
+#define OPTIONS_H
+
+#include "basic.h"
+#include "common.h"
+#include "mtu.h"
+#include "route.h"
+#include "tun.h"
+#include "socket.h"
+#include "plugin.h"
+#include "manage.h"
+#include "proxy.h"
+#include "comp.h"
+#include "pushlist.h"
+#include "clinat.h"
+
+/*
+ * Maximum number of parameters associated with an option,
+ * including the option name itself.
+ */
+#define MAX_PARMS 16
+
+/*
+ * Max size of options line and parameter.
+ */
+#define OPTION_PARM_SIZE 256
+#define OPTION_LINE_SIZE 256
+
+extern const char title_string[];
+
+#if P2MP
+
+/* certain options are saved before --pull modifications are applied */
+struct options_pre_pull
+{
+ bool tuntap_options_defined;
+ struct tuntap_options tuntap_options;
+
+ bool routes_defined;
+ struct route_option_list *routes;
+
+ bool routes_ipv6_defined;
+ struct route_ipv6_option_list *routes_ipv6;
+
+ bool client_nat_defined;
+ struct client_nat_option_list *client_nat;
+
+ int foreign_option_index;
+};
+
+#endif
+#if defined(ENABLE_CRYPTO) && !defined(ENABLE_CRYPTO_OPENSSL) && !defined(ENABLE_CRYPTO_POLARSSL)
+# error "At least one of OpenSSL or PolarSSL needs to be defined."
+#endif
+
+struct connection_entry
+{
+ int proto;
+ sa_family_t af;
+ const char* local_port;
+ bool local_port_defined;
+ const char *remote_port;
+ const char *local;
+ const char *remote;
+ bool remote_float;
+ bool bind_defined;
+ bool bind_ipv6_only;
+ bool bind_local;
+ int connect_retry_seconds;
+ int connect_timeout;
+ bool connect_timeout_defined;
+ struct http_proxy_options *http_proxy_options;
+ const char *socks_proxy_server;
+ const char *socks_proxy_port;
+ const char *socks_proxy_authfile;
+ bool socks_proxy_retry;
+
+ int tun_mtu; /* MTU of tun device */
+ bool tun_mtu_defined; /* true if user overriding parm with command line option */
+ int tun_mtu_extra;
+ bool tun_mtu_extra_defined;
+ int link_mtu; /* MTU of device over which tunnel packets pass via TCP/UDP */
+ bool link_mtu_defined; /* true if user overriding parm with command line option */
+
+ /* Advanced MTU negotiation and datagram fragmentation options */
+ int mtu_discover_type; /* used if OS supports setting Path MTU discovery options on socket */
+
+ int fragment; /* internal fragmentation size */
+ int mssfix; /* Upper bound on TCP MSS */
+ bool mssfix_default; /* true if --mssfix was supplied without a parameter */
+
+#ifdef ENABLE_OCC
+ int explicit_exit_notification; /* Explicitly tell peer when we are exiting via OCC_EXIT message */
+#endif
+
+# define CE_DISABLED (1<<0)
+# define CE_MAN_QUERY_PROXY (1<<1)
+# define CE_MAN_QUERY_REMOTE_UNDEF 0
+# define CE_MAN_QUERY_REMOTE_QUERY 1
+# define CE_MAN_QUERY_REMOTE_ACCEPT 2
+# define CE_MAN_QUERY_REMOTE_MOD 3
+# define CE_MAN_QUERY_REMOTE_SKIP 4
+# define CE_MAN_QUERY_REMOTE_MASK (0x07)
+# define CE_MAN_QUERY_REMOTE_SHIFT (2)
+ unsigned int flags;
+};
+
+struct remote_entry
+{
+ const char *remote;
+ const char *remote_port;
+ int proto;
+ sa_family_t af;
+};
+
+#define CONNECTION_LIST_SIZE 64
+
+struct connection_list
+{
+ int len;
+ int current;
+ struct connection_entry *array[CONNECTION_LIST_SIZE];
+};
+
+struct remote_list
+{
+ int len;
+ struct remote_entry *array[CONNECTION_LIST_SIZE];
+};
+
+struct remote_host_store
+{
+# define RH_HOST_LEN 80
+ char host[RH_HOST_LEN];
+#define RH_PORT_LEN 20
+ char port[RH_PORT_LEN];
+};
+
+/* Command line options */
+struct options
+{
+ struct gc_arena gc;
+ bool gc_owned;
+
+ /* first config file */
+ const char *config;
+
+ /* major mode */
+# define MODE_POINT_TO_POINT 0
+# define MODE_SERVER 1
+ int mode;
+
+ /* enable forward compatibility for post-2.1 features */
+ bool forward_compatible;
+ /* list of options that should be ignored even if unkown */
+ const char ** ignore_unknown_option;
+
+ /* persist parms */
+ bool persist_config;
+ int persist_mode;
+
+#ifdef ENABLE_CRYPTO
+ const char *key_pass_file;
+ bool show_ciphers;
+ bool show_digests;
+ bool show_engines;
+#ifdef ENABLE_SSL
+ bool show_tls_ciphers;
+ bool show_curves;
+#endif
+ bool genkey;
+#endif
+
+ /* Networking parms */
+ int connect_retry_max;
+ struct connection_entry ce;
+ struct connection_list *connection_list;
+
+ struct remote_list *remote_list;
+ /* Do not advanced the connection or remote addr list*/
+ bool no_advance;
+ /* Counts the number of unsuccessful connection attempts */
+ unsigned int unsuccessful_attempts;
+
+#if ENABLE_MANAGEMENT
+ struct http_proxy_options *http_proxy_override;
+#endif
+
+ struct remote_host_store *rh_store;
+
+ bool remote_random;
+ const char *ipchange;
+ const char *dev;
+ const char *dev_type;
+ const char *dev_node;
+ const char *lladdr;
+ int topology; /* one of the TOP_x values from proto.h */
+ const char *ifconfig_local;
+ const char *ifconfig_remote_netmask;
+ const char *ifconfig_ipv6_local;
+ int ifconfig_ipv6_netbits;
+ const char *ifconfig_ipv6_remote;
+ bool ifconfig_noexec;
+ bool ifconfig_nowarn;
+#ifdef ENABLE_FEATURE_SHAPER
+ int shaper;
+#endif
+
+ int proto_force;
+
+#ifdef ENABLE_OCC
+ bool mtu_test;
+#endif
+
+#ifdef ENABLE_MEMSTATS
+ char *memstats_fn;
+#endif
+
+ bool mlock;
+
+ int keepalive_ping; /* a proxy for ping/ping-restart */
+ int keepalive_timeout;
+
+ int inactivity_timeout; /* --inactive */
+ int inactivity_minimum_bytes;
+
+ int ping_send_timeout; /* Send a TCP/UDP ping to remote every n seconds */
+ int ping_rec_timeout; /* Expect a TCP/UDP ping from remote at least once every n seconds */
+ bool ping_timer_remote; /* Run ping timer only if we have a remote address */
+ bool tun_ipv6; /* Build tun dev that supports IPv6 */
+
+# define PING_UNDEF 0
+# define PING_EXIT 1
+# define PING_RESTART 2
+ int ping_rec_timeout_action; /* What action to take on ping_rec_timeout (exit or restart)? */
+
+ bool persist_tun; /* Don't close/reopen TUN/TAP dev on SIGUSR1 or PING_RESTART */
+ bool persist_local_ip; /* Don't re-resolve local address on SIGUSR1 or PING_RESTART */
+ bool persist_remote_ip; /* Don't re-resolve remote address on SIGUSR1 or PING_RESTART */
+ bool persist_key; /* Don't re-read key files on SIGUSR1 or PING_RESTART */
+
+#if PASSTOS_CAPABILITY
+ bool passtos;
+#endif
+
+ int resolve_retry_seconds; /* If hostname resolve fails, retry for n seconds */
+ bool resolve_in_advance;
+ const char *ip_remote_hint;
+
+ struct tuntap_options tuntap_options;
+
+ /* Misc parms */
+ const char *username;
+ const char *groupname;
+ const char *chroot_dir;
+ const char *cd_dir;
+#ifdef ENABLE_SELINUX
+ char *selinux_context;
+#endif
+ const char *writepid;
+ const char *up_script;
+ const char *down_script;
+ bool user_script_used;
+ bool down_pre;
+ bool up_delay;
+ bool up_restart;
+ bool daemon;
+
+ int remap_sigusr1;
+
+ /* inetd modes defined in socket.h */
+ int inetd;
+
+ bool log;
+ bool suppress_timestamps;
+ bool machine_readable_output;
+ int nice;
+ int verbosity;
+ int mute;
+
+#ifdef ENABLE_DEBUG
+ int gremlin;
+#endif
+
+ const char *status_file;
+ int status_file_version;
+ int status_file_update_freq;
+
+ /* optimize TUN/TAP/UDP writes */
+ bool fast_io;
+
+#ifdef USE_COMP
+ struct compress_options comp;
+#endif
+
+ /* buffer sizes */
+ int rcvbuf;
+ int sndbuf;
+
+ /* mark value */
+ int mark;
+
+ /* socket flags */
+ unsigned int sockflags;
+
+ /* route management */
+ const char *route_script;
+ const char *route_predown_script;
+ const char *route_default_gateway;
+ int route_default_metric;
+ bool route_noexec;
+ int route_delay;
+ int route_delay_window;
+ bool route_delay_defined;
+ struct route_option_list *routes;
+ struct route_ipv6_option_list *routes_ipv6; /* IPv6 */
+ bool route_nopull;
+ bool route_gateway_via_dhcp;
+ bool allow_pull_fqdn; /* as a client, allow server to push a FQDN for certain parameters */
+ struct client_nat_option_list *client_nat;
+
+#ifdef ENABLE_OCC
+ /* Enable options consistency check between peers */
+ bool occ;
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ const char *management_addr;
+ const char *management_port;
+ const char *management_user_pass;
+ int management_log_history_cache;
+ int management_echo_buffer_size;
+ int management_state_buffer_size;
+ const char *management_write_peer_info_file;
+
+ const char *management_client_user;
+ const char *management_client_group;
+
+ /* Mask of MF_ values of manage.h */
+ unsigned int management_flags;
+#endif
+
+#ifdef ENABLE_PLUGIN
+ struct plugin_option_list *plugin_list;
+#endif
+
+
+
+#if P2MP
+
+#if P2MP_SERVER
+ /* the tmp dir is for now only used in the P2P server context */
+ const char *tmp_dir;
+ bool server_defined;
+ in_addr_t server_network;
+ in_addr_t server_netmask;
+ bool server_ipv6_defined; /* IPv6 */
+ struct in6_addr server_network_ipv6; /* IPv6 */
+ unsigned int server_netbits_ipv6; /* IPv6 */
+
+# define SF_NOPOOL (1<<0)
+# define SF_TCP_NODELAY_HELPER (1<<1)
+# define SF_NO_PUSH_ROUTE_GATEWAY (1<<2)
+ unsigned int server_flags;
+
+ bool server_bridge_proxy_dhcp;
+
+ bool server_bridge_defined;
+ in_addr_t server_bridge_ip;
+ in_addr_t server_bridge_netmask;
+ in_addr_t server_bridge_pool_start;
+ in_addr_t server_bridge_pool_end;
+
+ struct push_list push_list;
+ bool ifconfig_pool_defined;
+ in_addr_t ifconfig_pool_start;
+ in_addr_t ifconfig_pool_end;
+ in_addr_t ifconfig_pool_netmask;
+ const char *ifconfig_pool_persist_filename;
+ int ifconfig_pool_persist_refresh_freq;
+
+ bool ifconfig_ipv6_pool_defined; /* IPv6 */
+ struct in6_addr ifconfig_ipv6_pool_base; /* IPv6 */
+ int ifconfig_ipv6_pool_netbits; /* IPv6 */
+
+ int real_hash_size;
+ int virtual_hash_size;
+ const char *client_connect_script;
+ const char *client_disconnect_script;
+ const char *learn_address_script;
+ const char *client_config_dir;
+ bool ccd_exclusive;
+ bool disable;
+ int n_bcast_buf;
+ int tcp_queue_limit;
+ struct iroute *iroutes;
+ struct iroute_ipv6 *iroutes_ipv6; /* IPv6 */
+ bool push_ifconfig_defined;
+ in_addr_t push_ifconfig_local;
+ in_addr_t push_ifconfig_remote_netmask;
+ in_addr_t push_ifconfig_local_alias;
+ bool push_ifconfig_constraint_defined;
+ in_addr_t push_ifconfig_constraint_network;
+ in_addr_t push_ifconfig_constraint_netmask;
+ bool push_ifconfig_ipv6_defined; /* IPv6 */
+ struct in6_addr push_ifconfig_ipv6_local; /* IPv6 */
+ int push_ifconfig_ipv6_netbits; /* IPv6 */
+ struct in6_addr push_ifconfig_ipv6_remote; /* IPv6 */
+ bool enable_c2c;
+ bool duplicate_cn;
+ int cf_max;
+ int cf_per;
+ int max_clients;
+ int max_routes_per_client;
+ int stale_routes_check_interval;
+ int stale_routes_ageing_time;
+
+ const char *auth_user_pass_verify_script;
+ bool auth_user_pass_verify_script_via_file;
+#if PORT_SHARE
+ char *port_share_host;
+ char *port_share_port;
+ const char *port_share_journal_dir;
+#endif
+#endif
+
+ bool client;
+ bool pull; /* client pull of config options from server */
+ int push_continuation;
+ unsigned int push_option_types_found;
+ const char *auth_user_pass_file;
+ struct options_pre_pull *pre_pull;
+
+ int server_poll_timeout;
+
+ int scheduled_exit_interval;
+
+#ifdef ENABLE_CLIENT_CR
+ struct static_challenge_info sc_info;
+#endif
+#endif
+
+#ifdef ENABLE_CRYPTO
+ /* Cipher parms */
+ const char *shared_secret_file;
+ const char *shared_secret_file_inline;
+ int key_direction;
+ bool ciphername_defined;
+ const char *ciphername;
+ bool authname_defined;
+ const char *authname;
+ int keysize;
+ const char *prng_hash;
+ int prng_nonce_secret_len;
+ const char *engine;
+ bool replay;
+ bool mute_replay_warnings;
+ int replay_window;
+ int replay_time;
+ const char *packet_id_file;
+ bool use_iv;
+ bool test_crypto;
+#ifdef ENABLE_PREDICTION_RESISTANCE
+ bool use_prediction_resistance;
+#endif
+
+#ifdef ENABLE_SSL
+ /* TLS (control channel) parms */
+ bool tls_server;
+ bool tls_client;
+ const char *ca_file;
+ const char *ca_path;
+ const char *dh_file;
+ const char *cert_file;
+ const char *extra_certs_file;
+ const char *priv_key_file;
+ const char *pkcs12_file;
+ const char *cipher_list;
+ const char *ecdh_curve;
+ const char *tls_verify;
+ int verify_x509_type;
+ const char *verify_x509_name;
+ const char *tls_export_cert;
+ const char *crl_file;
+
+ const char *ca_file_inline;
+ const char *cert_file_inline;
+ const char *extra_certs_file_inline;
+ char *priv_key_file_inline;
+ const char *dh_file_inline;
+ const char *pkcs12_file_inline; /* contains the base64 encoding of pkcs12 file */
+
+ int ns_cert_type; /* set to 0, NS_CERT_CHECK_SERVER, or NS_CERT_CHECK_CLIENT */
+ unsigned remote_cert_ku[MAX_PARMS];
+ const char *remote_cert_eku;
+ uint8_t *verify_hash;
+ unsigned int ssl_flags; /* set to SSLF_x flags from ssl.h */
+
+#ifdef ENABLE_PKCS11
+ const char *pkcs11_providers[MAX_PARMS];
+ unsigned pkcs11_private_mode[MAX_PARMS];
+ bool pkcs11_protected_authentication[MAX_PARMS];
+ bool pkcs11_cert_private[MAX_PARMS];
+ int pkcs11_pin_cache_period;
+ const char *pkcs11_id;
+ bool pkcs11_id_management;
+#endif
+
+#ifdef ENABLE_CRYPTOAPI
+ const char *cryptoapi_cert;
+#endif
+
+ /* data channel key exchange method */
+ int key_method;
+
+ /* Per-packet timeout on control channel */
+ int tls_timeout;
+
+ /* Data channel key renegotiation parameters */
+ int renegotiate_bytes;
+ int renegotiate_packets;
+ int renegotiate_seconds;
+
+ /* Data channel key handshake must finalize
+ within n seconds of handshake initiation. */
+ int handshake_window;
+
+#ifdef ENABLE_X509ALTUSERNAME
+ /* Field used to be the username in X509 cert. */
+ char *x509_username_field;
+#endif
+
+ /* Old key allowed to live n seconds after new key goes active */
+ int transition_window;
+
+ /* Special authentication MAC for TLS control channel */
+ const char *tls_auth_file; /* shared secret */
+ const char *tls_auth_file_inline;
+
+ /* Allow only one session */
+ bool single_session;
+
+#ifdef ENABLE_PUSH_PEER_INFO
+ bool push_peer_info;
+#endif
+
+ bool tls_exit;
+
+#endif /* ENABLE_SSL */
+#endif /* ENABLE_CRYPTO */
+
+#ifdef ENABLE_X509_TRACK
+ const struct x509_track *x509_track;
+#endif
+
+ /* special state parms */
+ int foreign_option_index;
+
+#ifdef WIN32
+ const char *exit_event_name;
+ bool exit_event_initial_state;
+ bool show_net_up;
+ int route_method;
+#endif
+};
+
+#define streq(x, y) (!strcmp((x), (y)))
+
+/*
+ * Option classes.
+ */
+#define OPT_P_GENERAL (1<<0)
+#define OPT_P_UP (1<<1)
+#define OPT_P_ROUTE (1<<2)
+#define OPT_P_IPWIN32 (1<<3)
+#define OPT_P_SCRIPT (1<<4)
+#define OPT_P_SETENV (1<<5)
+#define OPT_P_SHAPER (1<<6)
+#define OPT_P_TIMER (1<<7)
+#define OPT_P_PERSIST (1<<8)
+#define OPT_P_PERSIST_IP (1<<9)
+#define OPT_P_COMP (1<<10) /* TODO */
+#define OPT_P_MESSAGES (1<<11)
+#define OPT_P_CRYPTO (1<<12) /* TODO */
+#define OPT_P_TLS_PARMS (1<<13) /* TODO */
+#define OPT_P_MTU (1<<14) /* TODO */
+#define OPT_P_NICE (1<<15)
+#define OPT_P_PUSH (1<<16)
+#define OPT_P_INSTANCE (1<<17)
+#define OPT_P_CONFIG (1<<18)
+#define OPT_P_EXPLICIT_NOTIFY (1<<19)
+#define OPT_P_ECHO (1<<20)
+#define OPT_P_INHERIT (1<<21)
+#define OPT_P_ROUTE_EXTRAS (1<<22)
+#define OPT_P_PULL_MODE (1<<23)
+#define OPT_P_PLUGIN (1<<24)
+#define OPT_P_SOCKBUF (1<<25)
+#define OPT_P_SOCKFLAGS (1<<26)
+#define OPT_P_CONNECTION (1<<27)
+
+#define OPT_P_DEFAULT (~(OPT_P_INSTANCE|OPT_P_PULL_MODE))
+
+#if P2MP
+#define PULL_DEFINED(opt) ((opt)->pull)
+#if P2MP_SERVER
+#define PUSH_DEFINED(opt) ((opt)->push_list)
+#endif
+#endif
+
+#ifndef PULL_DEFINED
+#define PULL_DEFINED(opt) (false)
+#endif
+
+#ifndef PUSH_DEFINED
+#define PUSH_DEFINED(opt) (false)
+#endif
+
+#ifdef WIN32
+#define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
+#else
+#define ROUTE_OPTION_FLAGS(o) (0)
+#endif
+
+#ifdef ENABLE_FEATURE_SHAPER
+#define SHAPER_DEFINED(opt) ((opt)->shaper)
+#else
+#define SHAPER_DEFINED(opt) (false)
+#endif
+
+#ifdef ENABLE_PLUGIN
+#define PLUGIN_OPTION_LIST(opt) ((opt)->plugin_list)
+#else
+#define PLUGIN_OPTION_LIST(opt) (NULL)
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+#define MAN_CLIENT_AUTH_ENABLED(opt) ((opt)->management_flags & MF_CLIENT_AUTH)
+#else
+#define MAN_CLIENT_AUTH_ENABLED(opt) (false)
+#endif
+
+void parse_argv (struct options *options,
+ const int argc,
+ char *argv[],
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es);
+
+void notnull (const char *arg, const char *description);
+
+void usage_small (void);
+
+void show_library_versions(const unsigned int flags);
+
+void init_options (struct options *o, const bool init_gc);
+void uninit_options (struct options *o);
+
+void setenv_settings (struct env_set *es, const struct options *o);
+void show_settings (const struct options *o);
+
+bool string_defined_equal (const char *s1, const char *s2);
+
+#ifdef ENABLE_OCC
+
+const char *options_string_version (const char* s, struct gc_arena *gc);
+
+char *options_string (const struct options *o,
+ const struct frame *frame,
+ struct tuntap *tt,
+ bool remote,
+ struct gc_arena *gc);
+
+bool options_cmp_equal_safe (char *actual, const char *expected, size_t actual_n);
+void options_warning_safe (char *actual, const char *expected, size_t actual_n);
+bool options_cmp_equal (char *actual, const char *expected);
+void options_warning (char *actual, const char *expected);
+
+#endif
+
+void options_postprocess (struct options *options);
+
+void pre_pull_save (struct options *o);
+void pre_pull_restore (struct options *o, struct gc_arena *gc);
+
+struct tls_multi;
+bool apply_push_options (struct options *options,
+ struct buffer *buf,
+ unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es,
+ struct tls_multi* tls_multi);
+
+void options_detach (struct options *o);
+
+void options_server_import (struct options *o,
+ const char *filename,
+ int msglevel,
+ unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es);
+
+void pre_pull_default (struct options *o);
+
+void rol_check_alloc (struct options *options);
+
+int parse_line (const char *line,
+ char *p[],
+ const int n,
+ const char *file,
+ const int line_num,
+ int msglevel,
+ struct gc_arena *gc);
+
+/*
+ * parse/print topology coding
+ */
+
+int parse_topology (const char *str, const int msglevel);
+const char *print_topology (const int topology);
+
+/*
+ * Manage auth-retry variable
+ */
+
+#if P2MP
+
+#define AR_NONE 0
+#define AR_INTERACT 1
+#define AR_NOINTERACT 2
+
+int auth_retry_get (void);
+bool auth_retry_set (const int msglevel, const char *option);
+const char *auth_retry_print (void);
+
+#endif
+
+void options_string_import (struct options *options,
+ const char *config,
+ const int msglevel,
+ const unsigned int permission_mask,
+ unsigned int *option_types_found,
+ struct env_set *es);
+
+bool get_ipv6_addr( const char * prefix_str, struct in6_addr *network,
+ unsigned int * netbits, char ** printable_ipv6,
+ int msglevel );
+
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.c
new file mode 100644
index 00000000..2c1e5b13
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.c
@@ -0,0 +1,201 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "otime.h"
+
+#include "memdbg.h"
+
+time_t now = 0; /* GLOBAL */
+
+#if TIME_BACKTRACK_PROTECTION
+
+static time_t now_adj = 0; /* GLOBAL */
+time_t now_usec = 0; /* GLOBAL */
+
+/*
+ * Try to filter out time instability caused by the system
+ * clock backtracking or jumping forward.
+ */
+
+void
+update_now (const time_t system_time)
+{
+ const int forward_threshold = 86400; /* threshold at which to dampen forward jumps */
+ const int backward_trigger = 10; /* backward jump must be >= this many seconds before we adjust */
+ time_t real_time = system_time + now_adj;
+
+ if (real_time > now)
+ {
+ const time_t overshoot = real_time - now - 1;
+ if (overshoot > forward_threshold && now_adj >= overshoot)
+ {
+ now_adj -= overshoot;
+ real_time -= overshoot;
+ }
+ now = real_time;
+ }
+ else if (real_time < now - backward_trigger)
+ now_adj += (now - real_time);
+}
+
+void
+update_now_usec (struct timeval *tv)
+{
+ const time_t last = now;
+ update_now (tv->tv_sec);
+ if (now > last || (now == last && tv->tv_usec > now_usec))
+ now_usec = tv->tv_usec;
+}
+
+#endif /* TIME_BACKTRACK_PROTECTION */
+
+/*
+ * Return a numerical string describing a struct timeval.
+ */
+const char *
+tv_string (const struct timeval *tv, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ buf_printf (&out, "[%d/%d]",
+ (int) tv->tv_sec,
+ (int )tv->tv_usec);
+ return BSTR (&out);
+}
+
+/*
+ * Return an ascii string describing an absolute
+ * date/time in a struct timeval.
+ *
+ */
+const char *
+tv_string_abs (const struct timeval *tv, struct gc_arena *gc)
+{
+ return time_string ((time_t) tv->tv_sec,
+ (int) tv->tv_usec,
+ true,
+ gc);
+}
+
+/* format a time_t as ascii, or use current time if 0 */
+
+const char *
+time_string (time_t t, int usec, bool show_usec, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ struct timeval tv;
+
+ if (t)
+ {
+ tv.tv_sec = t;
+ tv.tv_usec = usec;
+ }
+ else
+ {
+ gettimeofday (&tv, NULL);
+ }
+
+ t = tv.tv_sec;
+ buf_printf (&out, "%s", ctime(&t));
+ buf_rmtail (&out, '\n');
+
+ if (show_usec && tv.tv_usec)
+ buf_printf (&out, " us=%d", (int)tv.tv_usec);
+
+ return BSTR (&out);
+}
+
+/*
+ * Limit the frequency of an event stream.
+ *
+ * Used to control maximum rate of new
+ * incoming connections.
+ */
+
+struct frequency_limit *
+frequency_limit_init (int max, int per)
+{
+ struct frequency_limit *f;
+
+ ASSERT (max >= 0 && per >= 0);
+
+ ALLOC_OBJ (f, struct frequency_limit);
+ f->max = max;
+ f->per = per;
+ f->n = 0;
+ f->reset = 0;
+ return f;
+}
+
+void
+frequency_limit_free (struct frequency_limit *f)
+{
+ free (f);
+}
+
+bool
+frequency_limit_event_allowed (struct frequency_limit *f)
+{
+ if (f->per)
+ {
+ bool ret;
+ if (now >= f->reset + f->per)
+ {
+ f->reset = now;
+ f->n = 0;
+ }
+ ret = (++f->n <= f->max);
+ return ret;
+ }
+ else
+ return true;
+}
+
+#ifdef TIME_TEST
+void
+time_test (void)
+{
+ struct timeval tv;
+ time_t t;
+ int i;
+ for (i = 0; i < 10000; ++i)
+ {
+ t = time(NULL);
+ gettimeofday (&tv, NULL);
+#if 1
+ msg (M_INFO, "t=%u s=%u us=%u",
+ (unsigned int)t,
+ (unsigned int)tv.tv_sec,
+ (unsigned int)tv.tv_usec);
+#endif
+ }
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.h
new file mode 100644
index 00000000..4ca10326
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/otime.h
@@ -0,0 +1,264 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OTIME_H
+#define OTIME_H
+
+#include "common.h"
+#include "integer.h"
+#include "buffer.h"
+
+struct frequency_limit
+{
+ int max;
+ int per;
+ int n;
+ time_t reset;
+};
+
+struct frequency_limit *frequency_limit_init (int max, int per);
+void frequency_limit_free (struct frequency_limit *f);
+bool frequency_limit_event_allowed (struct frequency_limit *f);
+
+/* format a time_t as ascii, or use current time if 0 */
+const char* time_string (time_t t, int usec, bool show_usec, struct gc_arena *gc);
+
+/* struct timeval functions */
+
+const char *tv_string (const struct timeval *tv, struct gc_arena *gc);
+const char *tv_string_abs (const struct timeval *tv, struct gc_arena *gc);
+
+extern time_t now; /* updated frequently to time(NULL) */
+
+void time_test (void);
+
+#if TIME_BACKTRACK_PROTECTION
+
+void update_now (const time_t system_time);
+
+extern time_t now_usec;
+void update_now_usec (struct timeval *tv);
+
+static inline int
+openvpn_gettimeofday (struct timeval *tv, void *tz)
+{
+ const int status = gettimeofday (tv, tz);
+ if (!status)
+ {
+ update_now_usec (tv);
+ tv->tv_sec = now;
+ tv->tv_usec = now_usec;
+ }
+ return status;
+}
+
+static inline void
+update_time (void)
+{
+#ifdef WIN32
+ /* on WIN32, gettimeofday is faster than time(NULL) */
+ struct timeval tv;
+ openvpn_gettimeofday (&tv, NULL);
+#else
+ update_now (time (NULL));
+#endif
+}
+
+#else /* !TIME_BACKTRACK_PROTECTION */
+
+static inline void
+update_time (void)
+{
+#if defined(WIN32)
+ /* on WIN32, gettimeofday is faster than time(NULL) */
+ struct timeval tv;
+ if (!gettimeofday (&tv, NULL))
+ {
+ if (tv.tv_sec != now)
+ now = tv.tv_sec;
+ }
+#else
+ const time_t real_time = time (NULL);
+ if (real_time != now)
+ now = real_time;
+#endif
+}
+
+static inline int
+openvpn_gettimeofday (struct timeval *tv, void *tz)
+{
+ return gettimeofday (tv, tz);
+}
+
+#endif /* TIME_BACKTRACK_PROTECTION */
+
+static inline time_t
+openvpn_time (time_t *t)
+{
+ update_time ();
+ if (t)
+ *t = now;
+ return now;
+}
+
+static inline void
+tv_clear (struct timeval *tv)
+{
+ tv->tv_sec = 0;
+ tv->tv_usec = 0;
+}
+
+static inline bool
+tv_defined (const struct timeval *tv)
+{
+ return tv->tv_sec > 0 && tv->tv_usec > 0;
+}
+
+/* return tv1 - tv2 in usec, constrained by max_seconds */
+static inline int
+tv_subtract (const struct timeval *tv1, const struct timeval *tv2, const unsigned int max_seconds)
+{
+ const int max_usec = max_seconds * 1000000;
+ const int sec_diff = tv1->tv_sec - tv2->tv_sec;
+
+ if (sec_diff > ((int)max_seconds + 10))
+ return max_usec;
+ else if (sec_diff < -((int)max_seconds + 10))
+ return -max_usec;
+ return constrain_int (sec_diff * 1000000 + (tv1->tv_usec - tv2->tv_usec), -max_usec, max_usec);
+}
+
+static inline void
+tv_add (struct timeval *dest, const struct timeval *src)
+{
+ dest->tv_sec += src->tv_sec;
+ dest->tv_usec += src->tv_usec;
+ dest->tv_sec += (dest->tv_usec >> 20);
+ dest->tv_usec &= 0x000FFFFF;
+ if (dest->tv_usec >= 1000000)
+ {
+ dest->tv_usec -= 1000000;
+ dest->tv_sec += 1;
+ }
+}
+
+static inline bool
+tv_lt (const struct timeval *t1, const struct timeval *t2)
+{
+ if (t1->tv_sec < t2->tv_sec)
+ return true;
+ else if (t1->tv_sec > t2->tv_sec)
+ return false;
+ else
+ return t1->tv_usec < t2->tv_usec;
+}
+
+static inline bool
+tv_le (const struct timeval *t1, const struct timeval *t2)
+{
+ if (t1->tv_sec < t2->tv_sec)
+ return true;
+ else if (t1->tv_sec > t2->tv_sec)
+ return false;
+ else
+ return t1->tv_usec <= t2->tv_usec;
+}
+
+static inline bool
+tv_ge (const struct timeval *t1, const struct timeval *t2)
+{
+ if (t1->tv_sec > t2->tv_sec)
+ return true;
+ else if (t1->tv_sec < t2->tv_sec)
+ return false;
+ else
+ return t1->tv_usec >= t2->tv_usec;
+}
+
+static inline bool
+tv_gt (const struct timeval *t1, const struct timeval *t2)
+{
+ if (t1->tv_sec > t2->tv_sec)
+ return true;
+ else if (t1->tv_sec < t2->tv_sec)
+ return false;
+ else
+ return t1->tv_usec > t2->tv_usec;
+}
+
+static inline bool
+tv_eq (const struct timeval *t1, const struct timeval *t2)
+{
+ return t1->tv_sec == t2->tv_sec && t1->tv_usec == t2->tv_usec;
+}
+
+static inline void
+tv_delta (struct timeval *dest, const struct timeval *t1, const struct timeval *t2)
+{
+ int sec = t2->tv_sec - t1->tv_sec;
+ int usec = t2->tv_usec - t1->tv_usec;
+
+ while (usec < 0)
+ {
+ usec += 1000000;
+ sec -= 1;
+ }
+
+ if (sec < 0)
+ usec = sec = 0;
+
+ dest->tv_sec = sec;
+ dest->tv_usec = usec;
+}
+
+#define TV_WITHIN_SIGMA_MAX_SEC 600
+#define TV_WITHIN_SIGMA_MAX_USEC (TV_WITHIN_SIGMA_MAX_SEC * 1000000)
+
+/*
+ * Is t1 and t2 within sigma microseconds of each other?
+ */
+static inline bool
+tv_within_sigma (const struct timeval *t1, const struct timeval *t2, unsigned int sigma)
+{
+ const int delta = tv_subtract (t1, t2, TV_WITHIN_SIGMA_MAX_SEC); /* sigma should be less than 10 minutes */
+ return -(int)sigma <= delta && delta <= (int)sigma;
+}
+
+/*
+ * Used to determine in how many seconds we should be
+ * called again.
+ */
+static inline void
+interval_earliest_wakeup (interval_t *wakeup, time_t at, time_t current) {
+ if (at > current)
+ {
+ const interval_t delta = (interval_t) (at - current);
+ if (delta < *wakeup)
+ *wakeup = delta;
+ if (*wakeup < 0)
+ *wakeup = 0;
+ }
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.c
new file mode 100644
index 00000000..baa49664
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.c
@@ -0,0 +1,606 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * These routines are designed to catch replay attacks,
+ * where a man-in-the-middle captures packets and then
+ * attempts to replay them back later.
+ *
+ * We use the "sliding-window" algorithm, similar
+ * to IPSec.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_CRYPTO
+
+#include "packet_id.h"
+#include "misc.h"
+#include "integer.h"
+
+#include "memdbg.h"
+
+/* #define PID_SIMULATE_BACKTRACK */
+
+/*
+ * Special time_t value that indicates that
+ * sequence number has expired.
+ */
+#define SEQ_UNSEEN ((time_t)0)
+#define SEQ_EXPIRED ((time_t)1)
+
+static void packet_id_debug_print (int msglevel,
+ const struct packet_id_rec *p,
+ const struct packet_id_net *pin,
+ const char *message,
+ int value);
+
+static inline void
+packet_id_debug (int msglevel,
+ const struct packet_id_rec *p,
+ const struct packet_id_net *pin,
+ const char *message,
+ int value)
+{
+#ifdef ENABLE_DEBUG
+ if (unlikely(check_debug_level(msglevel)))
+ packet_id_debug_print (msglevel, p, pin, message, value);
+#endif
+}
+
+void
+packet_id_init (struct packet_id *p, bool tcp_mode, int seq_backtrack, int time_backtrack, const char *name, int unit)
+{
+ dmsg (D_PID_DEBUG, "PID packet_id_init tcp_mode=%d seq_backtrack=%d time_backtrack=%d",
+ tcp_mode,
+ seq_backtrack,
+ time_backtrack);
+
+ ASSERT (p);
+ CLEAR (*p);
+
+ p->rec.name = name;
+ p->rec.unit = unit;
+ if (seq_backtrack && !tcp_mode)
+ {
+ ASSERT (MIN_SEQ_BACKTRACK <= seq_backtrack && seq_backtrack <= MAX_SEQ_BACKTRACK);
+ ASSERT (MIN_TIME_BACKTRACK <= time_backtrack && time_backtrack <= MAX_TIME_BACKTRACK);
+ CIRC_LIST_ALLOC (p->rec.seq_list, struct seq_list, seq_backtrack);
+ p->rec.seq_backtrack = seq_backtrack;
+ p->rec.time_backtrack = time_backtrack;
+ }
+ p->rec.initialized = true;
+}
+
+void
+packet_id_free (struct packet_id *p)
+{
+ if (p)
+ {
+ dmsg (D_PID_DEBUG, "PID packet_id_free");
+ if (p->rec.seq_list)
+ free (p->rec.seq_list);
+ CLEAR (*p);
+ }
+}
+
+void
+packet_id_add (struct packet_id_rec *p, const struct packet_id_net *pin)
+{
+ const time_t local_now = now;
+ if (p->seq_list)
+ {
+ packet_id_type diff;
+
+ /*
+ * If time value increases, start a new
+ * sequence number sequence.
+ */
+ if (!CIRC_LIST_SIZE (p->seq_list)
+ || pin->time > p->time
+ || (pin->id >= (packet_id_type)p->seq_backtrack
+ && pin->id - (packet_id_type)p->seq_backtrack > p->id))
+ {
+ p->time = pin->time;
+ p->id = 0;
+ if (pin->id > (packet_id_type)p->seq_backtrack)
+ p->id = pin->id - (packet_id_type)p->seq_backtrack;
+ CIRC_LIST_RESET (p->seq_list);
+ }
+
+ while (p->id < pin->id
+#ifdef PID_SIMULATE_BACKTRACK
+ || (get_random() % 64) < 31
+#endif
+ )
+ {
+ CIRC_LIST_PUSH (p->seq_list, SEQ_UNSEEN);
+ ++p->id;
+ }
+
+ diff = p->id - pin->id;
+ if (diff < (packet_id_type) CIRC_LIST_SIZE (p->seq_list)
+ && local_now > SEQ_EXPIRED)
+ CIRC_LIST_ITEM (p->seq_list, diff) = local_now;
+ }
+ else
+ {
+ p->time = pin->time;
+ p->id = pin->id;
+ }
+}
+
+/*
+ * Expire sequence numbers which can no longer
+ * be accepted because they would violate
+ * time_backtrack.
+ */
+void
+packet_id_reap (struct packet_id_rec *p)
+{
+ const time_t local_now = now;
+ if (p->time_backtrack)
+ {
+ int i;
+ bool expire = false;
+ for (i = 0; i < CIRC_LIST_SIZE (p->seq_list); ++i)
+ {
+ const time_t t = CIRC_LIST_ITEM (p->seq_list, i);
+ if (t == SEQ_EXPIRED)
+ break;
+ if (!expire && t && t + p->time_backtrack < local_now)
+ expire = true;
+ if (expire)
+ CIRC_LIST_ITEM (p->seq_list, i) = SEQ_EXPIRED;
+ }
+ }
+ p->last_reap = local_now;
+}
+
+/*
+ * Return true if packet id is ok, or false if
+ * it is a replay.
+ */
+bool
+packet_id_test (struct packet_id_rec *p,
+ const struct packet_id_net *pin)
+{
+ packet_id_type diff;
+
+ packet_id_debug (D_PID_DEBUG, p, pin, "PID_TEST", 0);
+
+ ASSERT (p->initialized);
+
+ if (!pin->id)
+ return false;
+
+ if (p->seq_backtrack)
+ {
+ /*
+ * In backtrack mode, we allow packet reordering subject
+ * to the seq_backtrack and time_backtrack constraints.
+ *
+ * This mode is used with UDP.
+ */
+ if (pin->time == p->time)
+ {
+ /* is packet-id greater than any one we've seen yet? */
+ if (pin->id > p->id)
+ return true;
+
+ /* check packet-id sliding window for original/replay status */
+ diff = p->id - pin->id;
+
+ /* keep track of maximum backtrack seen for debugging purposes */
+ if ((int)diff > p->max_backtrack_stat)
+ {
+ p->max_backtrack_stat = (int)diff;
+ packet_id_debug (D_PID_DEBUG_LOW, p, pin, "PID_ERR replay-window backtrack occurred", p->max_backtrack_stat);
+ }
+
+ if (diff >= (packet_id_type) CIRC_LIST_SIZE (p->seq_list))
+ {
+ packet_id_debug (D_PID_DEBUG_LOW, p, pin, "PID_ERR large diff", diff);
+ return false;
+ }
+
+ {
+ const time_t v = CIRC_LIST_ITEM (p->seq_list, diff);
+ if (v == 0)
+ return true;
+ else
+ {
+ /* raised from D_PID_DEBUG_LOW to reduce verbosity */
+ packet_id_debug (D_PID_DEBUG_MEDIUM, p, pin, "PID_ERR replay", diff);
+ return false;
+ }
+ }
+ }
+ else if (pin->time < p->time) /* if time goes back, reject */
+ {
+ packet_id_debug (D_PID_DEBUG_LOW, p, pin, "PID_ERR time backtrack", 0);
+ return false;
+ }
+ else /* time moved forward */
+ return true;
+ }
+ else
+ {
+ /*
+ * In non-backtrack mode, all sequence number series must
+ * begin at some number n > 0 and must increment linearly without gaps.
+ *
+ * This mode is used with TCP.
+ */
+ if (pin->time == p->time)
+ return !p->id || pin->id == p->id + 1;
+ else if (pin->time < p->time) /* if time goes back, reject */
+ return false;
+ else /* time moved forward */
+ return pin->id == 1;
+ }
+}
+
+/*
+ * Read/write a packet ID to/from the buffer. Short form is sequence number
+ * only. Long form is sequence number and timestamp.
+ */
+
+bool
+packet_id_read (struct packet_id_net *pin, struct buffer *buf, bool long_form)
+{
+ packet_id_type net_id;
+ net_time_t net_time;
+
+ pin->id = 0;
+ pin->time = 0;
+
+ if (!buf_read (buf, &net_id, sizeof (net_id)))
+ return false;
+ pin->id = ntohpid (net_id);
+ if (long_form)
+ {
+ if (!buf_read (buf, &net_time, sizeof (net_time)))
+ return false;
+ pin->time = ntohtime (net_time);
+ }
+ return true;
+}
+
+bool
+packet_id_write (const struct packet_id_net *pin, struct buffer *buf, bool long_form, bool prepend)
+{
+ packet_id_type net_id = htonpid (pin->id);
+ net_time_t net_time = htontime (pin->time);
+
+ if (prepend)
+ {
+ if (long_form)
+ {
+ if (!buf_write_prepend (buf, &net_time, sizeof (net_time)))
+ return false;
+ }
+ if (!buf_write_prepend (buf, &net_id, sizeof (net_id)))
+ return false;
+ }
+ else
+ {
+ if (!buf_write (buf, &net_id, sizeof (net_id)))
+ return false;
+ if (long_form)
+ {
+ if (!buf_write (buf, &net_time, sizeof (net_time)))
+ return false;
+ }
+ }
+ return true;
+}
+
+const char *
+packet_id_net_print (const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+
+ buf_printf (&out, "[ #" packet_id_format, (packet_id_print_type)pin->id);
+ if (print_timestamp && pin->time)
+ buf_printf (&out, " / time = (" packet_id_format ") %s",
+ (packet_id_print_type)pin->time,
+ time_string (pin->time, 0, false, gc));
+
+ buf_printf (&out, " ]");
+ return BSTR (&out);
+}
+
+/* initialize the packet_id_persist structure in a disabled state */
+void
+packet_id_persist_init (struct packet_id_persist *p)
+{
+ p->filename = NULL;
+ p->fd = -1;
+ p->time = p->time_last_written = 0;
+ p->id = p->id_last_written = 0;
+}
+
+/* close the file descriptor if it is open, and switch to disabled state */
+void
+packet_id_persist_close (struct packet_id_persist *p)
+{
+ if (packet_id_persist_enabled (p))
+ {
+ if (close (p->fd))
+ msg (D_PID_PERSIST | M_ERRNO, "Close error on --replay-persist file %s", p->filename);
+ packet_id_persist_init (p);
+ }
+}
+
+/* load persisted rec packet_id (time and id) only once from file, and set state to enabled */
+void
+packet_id_persist_load (struct packet_id_persist *p, const char *filename)
+{
+ struct gc_arena gc = gc_new ();
+ if (!packet_id_persist_enabled (p))
+ {
+ /* open packet-id persist file for both read and write */
+ p->fd = platform_open (filename,
+ O_CREAT | O_RDWR | O_BINARY,
+ S_IRUSR | S_IWUSR);
+ if (p->fd == -1)
+ {
+ msg (D_PID_PERSIST | M_ERRNO,
+ "Cannot open --replay-persist file %s for read/write",
+ filename);
+ }
+ else
+ {
+ struct packet_id_persist_file_image image;
+ ssize_t n;
+
+#if defined(HAVE_FLOCK) && defined(LOCK_EX) && defined(LOCK_NB)
+ if (flock (p->fd, LOCK_EX | LOCK_NB))
+ msg (M_ERR, "Cannot obtain exclusive lock on --replay-persist file %s", filename);
+#endif
+
+ p->filename = filename;
+ n = read (p->fd, &image, sizeof(image));
+ if (n == sizeof(image))
+ {
+ p->time = p->time_last_written = image.time;
+ p->id = p->id_last_written = image.id;
+ dmsg (D_PID_PERSIST_DEBUG, "PID Persist Read from %s: %s",
+ p->filename, packet_id_persist_print (p, &gc));
+ }
+ else if (n == -1)
+ {
+ msg (D_PID_PERSIST | M_ERRNO,
+ "Read error on --replay-persist file %s",
+ p->filename);
+ }
+ }
+ }
+ gc_free (&gc);
+}
+
+/* save persisted rec packet_id (time and id) to file (only if enabled state) */
+void
+packet_id_persist_save (struct packet_id_persist *p)
+{
+ if (packet_id_persist_enabled (p) && p->time && (p->time != p->time_last_written ||
+ p->id != p->id_last_written))
+ {
+ struct packet_id_persist_file_image image;
+ ssize_t n;
+ off_t seek_ret;
+ struct gc_arena gc = gc_new ();
+
+ image.time = p->time;
+ image.id = p->id;
+ seek_ret = lseek(p->fd, (off_t)0, SEEK_SET);
+ if (seek_ret == (off_t)0)
+ {
+ n = write(p->fd, &image, sizeof(image));
+ if (n == sizeof(image))
+ {
+ p->time_last_written = p->time;
+ p->id_last_written = p->id;
+ dmsg (D_PID_PERSIST_DEBUG, "PID Persist Write to %s: %s",
+ p->filename, packet_id_persist_print (p, &gc));
+ }
+ else
+ {
+ msg (D_PID_PERSIST | M_ERRNO,
+ "Cannot write to --replay-persist file %s",
+ p->filename);
+ }
+ }
+ else
+ {
+ msg (D_PID_PERSIST | M_ERRNO,
+ "Cannot seek to beginning of --replay-persist file %s",
+ p->filename);
+ }
+ gc_free (&gc);
+ }
+}
+
+/* transfer packet_id_persist -> packet_id */
+void
+packet_id_persist_load_obj (const struct packet_id_persist *p, struct packet_id *pid)
+{
+ if (p && pid && packet_id_persist_enabled (p) && p->time)
+ {
+ pid->rec.time = p->time;
+ pid->rec.id = p->id;
+ }
+}
+
+const char *
+packet_id_persist_print (const struct packet_id_persist *p, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+
+ buf_printf (&out, "[");
+
+ if (packet_id_persist_enabled (p))
+ {
+ buf_printf (&out, " #" packet_id_format, (packet_id_print_type)p->id);
+ if (p->time)
+ buf_printf (&out, " / time = (" packet_id_format ") %s",
+ (packet_id_print_type)p->time,
+ time_string (p->time, 0, false, gc));
+ }
+
+ buf_printf (&out, " ]");
+ return (char *)out.data;
+}
+
+#ifdef ENABLE_DEBUG
+
+static void
+packet_id_debug_print (int msglevel,
+ const struct packet_id_rec *p,
+ const struct packet_id_net *pin,
+ const char *message,
+ int value)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer out = alloc_buf_gc (256, &gc);
+ struct timeval tv;
+ const time_t prev_now = now;
+ const struct seq_list *sl = p->seq_list;
+ int i;
+
+ CLEAR (tv);
+ gettimeofday (&tv, NULL);
+
+ buf_printf (&out, "%s [%d]", message, value);
+ buf_printf (&out, " [%s-%d] [", p->name, p->unit);
+ for (i = 0; sl != NULL && i < sl->x_size; ++i)
+ {
+ char c;
+ time_t v;
+ int diff;
+
+ v = CIRC_LIST_ITEM(sl, i);
+ if (v == SEQ_UNSEEN)
+ c = '_';
+ else if (v == SEQ_EXPIRED)
+ c = 'E';
+ else
+ {
+ diff = (int) prev_now - v;
+ if (diff < 0)
+ c = 'N';
+ else if (diff < 10)
+ c = '0' + diff;
+ else
+ c = '>';
+ }
+ buf_printf(&out, "%c", c);
+ }
+ buf_printf (&out, "] " time_format ":" packet_id_format, (time_type)p->time, (packet_id_print_type)p->id);
+ if (pin)
+ buf_printf (&out, " " time_format ":" packet_id_format, (time_type)pin->time, (packet_id_print_type)pin->id);
+
+ buf_printf (&out, " t=" time_format "[%d]",
+ (time_type)prev_now,
+ (int)(prev_now - tv.tv_sec));
+
+ buf_printf (&out, " r=[%d,%d,%d,%d,%d]",
+ (int)(p->last_reap - tv.tv_sec),
+ p->seq_backtrack,
+ p->time_backtrack,
+ p->max_backtrack_stat,
+ (int)p->initialized);
+ if (sl != NULL)
+ {
+ buf_printf (&out, " sl=[%d,%d,%d,%d]",
+ sl->x_head,
+ sl->x_size,
+ sl->x_cap,
+ sl->x_sizeof);
+ }
+
+
+ msg (msglevel, "%s", BSTR(&out));
+ gc_free (&gc);
+}
+
+#endif
+
+#ifdef PID_TEST
+
+void
+packet_id_interactive_test ()
+{
+ struct packet_id pid;
+ struct packet_id_net pin;
+ bool long_form;
+ bool count = 0;
+ bool test;
+
+ const int seq_backtrack = 10;
+ const int time_backtrack = 10;
+
+ packet_id_init (&pid, seq_backtrack, time_backtrack);
+
+ while (true) {
+ char buf[80];
+ if (!fgets(buf, sizeof(buf), stdin))
+ break;
+ update_time ();
+ if (sscanf (buf, "%lu,%u", &pin.time, &pin.id) == 2)
+ {
+ packet_id_reap_test (&pid.rec);
+ test = packet_id_test (&pid.rec, &pin);
+ printf ("packet_id_test (" time_format ", " packet_id_format ") returned %d\n",
+ (time_type)pin.time,
+ (packet_id_print_type)pin.id,
+ test);
+ if (test)
+ packet_id_add (&pid.rec, &pin);
+ }
+ else
+ {
+ long_form = (count < 20);
+ packet_id_alloc_outgoing (&pid.send, &pin, long_form);
+ printf ("(" time_format "(" packet_id_format "), %d)\n",
+ (time_type)pin.time,
+ (packet_id_print_type)pin.id,
+ long_form);
+ if (pid.send.id == 10)
+ pid.send.id = 0xFFFFFFF8;
+ ++count;
+ }
+ }
+ packet_id_free (&pid);
+}
+#endif
+
+#endif /* ENABLE_CRYPTO */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.h
new file mode 100644
index 00000000..3ddaab6a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/packet_id.h
@@ -0,0 +1,338 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * These routines are designed to catch replay attacks,
+ * where a man-in-the-middle captures packets and then
+ * attempts to replay them back later.
+ */
+
+#ifdef ENABLE_CRYPTO
+
+#ifndef PACKET_ID_H
+#define PACKET_ID_H
+
+#include "circ_list.h"
+#include "buffer.h"
+#include "error.h"
+#include "otime.h"
+
+/*
+ * Enables OpenVPN to be compiled in special packet_id test mode.
+ */
+/*#define PID_TEST*/
+
+#if 1
+/*
+ * These are the types that members of
+ * a struct packet_id_net are converted
+ * to for network transmission.
+ */
+typedef uint32_t packet_id_type;
+typedef uint32_t net_time_t;
+
+/*
+ * In TLS mode, when a packet ID gets to this level,
+ * start thinking about triggering a new
+ * SSL/TLS handshake.
+ */
+#define PACKET_ID_WRAP_TRIGGER 0xFF000000
+
+/* convert a packet_id_type from host to network order */
+#define htonpid(x) htonl(x)
+
+/* convert a packet_id_type from network to host order */
+#define ntohpid(x) ntohl(x)
+
+/* convert a time_t in host order to a net_time_t in network order */
+#define htontime(x) htonl((net_time_t)x)
+
+/* convert a net_time_t in network order to a time_t in host order */
+#define ntohtime(x) ((time_t)ntohl(x))
+
+#else
+
+/*
+ * DEBUGGING ONLY.
+ * Make packet_id_type and net_time_t small
+ * to test wraparound logic and corner cases.
+ */
+
+typedef uint8_t packet_id_type;
+typedef uint16_t net_time_t;
+
+#define PACKET_ID_WRAP_TRIGGER 0x80
+
+#define htonpid(x) (x)
+#define ntohpid(x) (x)
+#define htontime(x) htons((net_time_t)x)
+#define ntohtime(x) ((time_t)ntohs(x))
+
+#endif
+
+/*
+ * Printf formats for special types
+ */
+#define packet_id_format "%u"
+typedef unsigned int packet_id_print_type;
+
+/*
+ * Maximum allowed backtrack in
+ * sequence number due to packets arriving
+ * out of order.
+ */
+#define MIN_SEQ_BACKTRACK 0
+#define MAX_SEQ_BACKTRACK 65536
+#define DEFAULT_SEQ_BACKTRACK 64
+
+/*
+ * Maximum allowed backtrack in
+ * seconds due to packets arriving
+ * out of order.
+ */
+#define MIN_TIME_BACKTRACK 0
+#define MAX_TIME_BACKTRACK 600
+#define DEFAULT_TIME_BACKTRACK 15
+
+/*
+ * Do a reap pass through the sequence number
+ * array once every n seconds in order to
+ * expire sequence numbers which can no longer
+ * be accepted because they would violate
+ * TIME_BACKTRACK.
+ */
+#define SEQ_REAP_INTERVAL 5
+
+CIRC_LIST (seq_list, time_t);
+
+/*
+ * This is the data structure we keep on the receiving side,
+ * to check that no packet-id (i.e. sequence number + optional timestamp)
+ * is accepted more than once.
+ */
+struct packet_id_rec
+{
+ time_t last_reap; /* last call of packet_id_reap */
+ time_t time; /* highest time stamp received */
+ packet_id_type id; /* highest sequence number received */
+ int seq_backtrack; /* set from --replay-window */
+ int time_backtrack; /* set from --replay-window */
+ int max_backtrack_stat; /* maximum backtrack seen so far */
+ bool initialized; /* true if packet_id_init was called */
+ struct seq_list *seq_list; /* packet-id "memory" */
+ const char *name;
+ int unit;
+};
+
+/*
+ * file to facilitate cross-session persistence
+ * of time/id
+ */
+struct packet_id_persist
+{
+ const char *filename;
+ int fd;
+ time_t time; /* time stamp */
+ packet_id_type id; /* sequence number */
+ time_t time_last_written;
+ packet_id_type id_last_written;
+};
+
+struct packet_id_persist_file_image
+{
+ time_t time; /* time stamp */
+ packet_id_type id; /* sequence number */
+};
+
+/*
+ * Keep a record of our current packet-id state
+ * on the sending side.
+ */
+struct packet_id_send
+{
+ packet_id_type id;
+ time_t time;
+};
+
+/*
+ * Communicate packet-id over the wire.
+ * A short packet-id is just a 32 bit
+ * sequence number. A long packet-id
+ * includes a timestamp as well.
+ *
+ * Long packet-ids are used as IVs for
+ * CFB/OFB ciphers.
+ *
+ * This data structure is always sent
+ * over the net in network byte order,
+ * by calling htonpid, ntohpid,
+ * htontime, and ntohtime on the
+ * data elements to change them
+ * to and from standard sizes.
+ *
+ * In addition, time is converted to
+ * a net_time_t before sending,
+ * since openvpn always
+ * uses a 32-bit time_t but some
+ * 64 bit platforms use a
+ * 64 bit time_t.
+ */
+struct packet_id_net
+{
+ packet_id_type id;
+ time_t time; /* converted to net_time_t before transmission */
+};
+
+struct packet_id
+{
+ struct packet_id_send send;
+ struct packet_id_rec rec;
+};
+
+void packet_id_init (struct packet_id *p, bool tcp_mode, int seq_backtrack, int time_backtrack, const char *name, int unit);
+void packet_id_free (struct packet_id *p);
+
+/* should we accept an incoming packet id ? */
+bool packet_id_test (struct packet_id_rec *p,
+ const struct packet_id_net *pin);
+
+/* change our current state to reflect an accepted packet id */
+void packet_id_add (struct packet_id_rec *p,
+ const struct packet_id_net *pin);
+
+/* expire TIME_BACKTRACK sequence numbers */
+void packet_id_reap (struct packet_id_rec *p);
+
+/*
+ * packet ID persistence
+ */
+
+/* initialize the packet_id_persist structure in a disabled state */
+void packet_id_persist_init (struct packet_id_persist *p);
+
+/* close the file descriptor if it is open, and switch to disabled state */
+void packet_id_persist_close (struct packet_id_persist *p);
+
+/* load persisted rec packet_id (time and id) only once from file, and set state to enabled */
+void packet_id_persist_load (struct packet_id_persist *p, const char *filename);
+
+/* save persisted rec packet_id (time and id) to file (only if enabled state) */
+void packet_id_persist_save (struct packet_id_persist *p);
+
+/* transfer packet_id_persist -> packet_id */
+void packet_id_persist_load_obj (const struct packet_id_persist *p, struct packet_id* pid);
+
+/* return an ascii string representing a packet_id_persist object */
+const char *packet_id_persist_print (const struct packet_id_persist *p, struct gc_arena *gc);
+
+/*
+ * Read/write a packet ID to/from the buffer. Short form is sequence number
+ * only. Long form is sequence number and timestamp.
+ */
+
+bool packet_id_read (struct packet_id_net *pin, struct buffer *buf, bool long_form);
+bool packet_id_write (const struct packet_id_net *pin, struct buffer *buf, bool long_form, bool prepend);
+
+/*
+ * Inline functions.
+ */
+
+/* are we in enabled state? */
+static inline bool
+packet_id_persist_enabled (const struct packet_id_persist *p)
+{
+ return p->fd >= 0;
+}
+
+/* transfer packet_id -> packet_id_persist */
+static inline void
+packet_id_persist_save_obj (struct packet_id_persist *p, const struct packet_id* pid)
+{
+ if (packet_id_persist_enabled (p) && pid->rec.time)
+ {
+ p->time = pid->rec.time;
+ p->id = pid->rec.id;
+ }
+}
+
+const char* packet_id_net_print(const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc);
+
+#ifdef PID_TEST
+void packet_id_interactive_test();
+#endif
+
+static inline int
+packet_id_size (bool long_form)
+{
+ return sizeof (packet_id_type) + (long_form ? sizeof (net_time_t) : 0);
+}
+
+static inline bool
+packet_id_close_to_wrapping (const struct packet_id_send *p)
+{
+ return p->id >= PACKET_ID_WRAP_TRIGGER;
+}
+
+/*
+ * Allocate an outgoing packet id.
+ * Sequence number ranges from 1 to 2^32-1.
+ * In long_form, a time_t is added as well.
+ */
+static inline void
+packet_id_alloc_outgoing (struct packet_id_send *p, struct packet_id_net *pin, bool long_form)
+{
+ if (!p->time)
+ p->time = now;
+ pin->id = ++p->id;
+ if (!pin->id)
+ {
+ ASSERT (long_form);
+ p->time = now;
+ pin->id = p->id = 1;
+ }
+ pin->time = p->time;
+}
+
+static inline bool
+check_timestamp_delta (time_t remote, unsigned int max_delta)
+{
+ unsigned int abs;
+ const time_t local_now = now;
+
+ if (local_now >= remote)
+ abs = local_now - remote;
+ else
+ abs = remote - local_now;
+ return abs <= max_delta;
+}
+
+static inline void
+packet_id_reap_test (struct packet_id_rec *p)
+{
+ if (p->last_reap + SEQ_REAP_INTERVAL <= now)
+ packet_id_reap (p);
+}
+
+#endif /* PACKET_ID_H */
+#endif /* ENABLE_CRYPTO */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.c
new file mode 100644
index 00000000..910d171d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.c
@@ -0,0 +1,299 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "perf.h"
+
+#ifdef ENABLE_PERFORMANCE_METRICS
+
+#include "error.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+static const char *metric_names[] = {
+ "PERF_BIO_READ_PLAINTEXT",
+ "PERF_BIO_WRITE_PLAINTEXT",
+ "PERF_BIO_READ_CIPHERTEXT",
+ "PERF_BIO_WRITE_CIPHERTEXT",
+ "PERF_TLS_MULTI_PROCESS",
+ "PERF_IO_WAIT",
+ "PERF_EVENT_LOOP",
+ "PERF_MULTI_CREATE_INSTANCE",
+ "PERF_MULTI_CLOSE_INSTANCE",
+ "PERF_MULTI_SHOW_STATS",
+ "PERF_MULTI_BCAST",
+ "PERF_MULTI_MCAST",
+ "PERF_SCRIPT",
+ "PERF_READ_IN_LINK",
+ "PERF_PROC_IN_LINK",
+ "PERF_READ_IN_TUN",
+ "PERF_PROC_IN_TUN",
+ "PERF_PROC_OUT_LINK",
+ "PERF_PROC_OUT_TUN",
+ "PERF_PROC_OUT_TUN_MTCP"
+};
+
+struct perf
+{
+# define PS_INITIAL 0
+# define PS_METER_RUNNING 1
+# define PS_METER_INTERRUPTED 2
+ int state;
+
+ struct timeval start;
+ double sofar;
+ double sum;
+ double max;
+ double count;
+};
+
+struct perf_set
+{
+ int stack_len;
+ int stack[STACK_N];
+ struct perf perf[PERF_N];
+};
+
+static struct perf_set perf_set;
+
+static void perf_print_state (int lev);
+
+static inline int
+get_stack_index (int sdelta)
+{
+ const int sindex = perf_set.stack_len + sdelta;
+ if (sindex >= 0 && sindex < STACK_N)
+ return sindex;
+ else
+ return -1;
+}
+
+static int
+get_perf_index (int sdelta)
+{
+ const int sindex = get_stack_index (sdelta);
+ if (sindex >= 0)
+ {
+ const int pindex = perf_set.stack[sindex];
+ if (pindex >= 0 && pindex < PERF_N)
+ return pindex;
+ else
+ return -1;
+ }
+ else
+ return -1;
+}
+
+static struct perf *
+get_perf (int sdelta)
+{
+ const int pindex = get_perf_index (sdelta);
+ if (pindex >= 0)
+ return &perf_set.perf[pindex];
+ else
+ return NULL;
+}
+
+static void
+push_perf_index (int pindex)
+{
+ const int sindex = get_stack_index (0);
+ const int newlen = get_stack_index (1);
+ if (sindex >= 0 && newlen >= 0
+ && pindex >= 0 && pindex < PERF_N)
+ {
+ int i;
+ for (i = 0; i < sindex; ++i)
+ if (perf_set.stack[i] == pindex)
+ {
+ perf_print_state (M_INFO);
+ msg (M_FATAL, "PERF: push_perf_index %s failed",
+ metric_names [pindex]);
+ }
+
+ perf_set.stack[sindex] = pindex;
+ perf_set.stack_len = newlen;
+ }
+ else
+ msg (M_FATAL, "PERF: push_perf_index: stack push error");
+}
+
+static void
+pop_perf_index (void)
+{
+ const int newlen = get_stack_index (-1);
+ if (newlen >= 0)
+ {
+ perf_set.stack_len = newlen;
+ }
+ else
+ msg (M_FATAL, "PERF: pop_perf_index: stack pop error");
+}
+
+static void
+state_must_be (const struct perf *p, const int wanted)
+{
+ if (p->state != wanted)
+ msg (M_FATAL, "PERF: bad state actual=%d wanted=%d",
+ p->state,
+ wanted);
+}
+
+static void
+update_sofar (struct perf *p)
+{
+ struct timeval current;
+ ASSERT (!gettimeofday (&current, NULL));
+ p->sofar += (double) tv_subtract (&current, &p->start, 600) / 1000000.0;
+ tv_clear (&p->start);
+}
+
+static void
+perf_start (struct perf *p)
+{
+ state_must_be (p, PS_INITIAL);
+ ASSERT (!gettimeofday (&p->start, NULL));
+ p->sofar = 0.0;
+ p->state = PS_METER_RUNNING;
+}
+
+static void
+perf_stop (struct perf *p)
+{
+ state_must_be (p, PS_METER_RUNNING);
+ update_sofar (p);
+ p->sum += p->sofar;
+ if (p->sofar > p->max)
+ p->max = p->sofar;
+ p->count += 1.0;
+ p->sofar = 0.0;
+ p->state = PS_INITIAL;
+}
+
+static void
+perf_interrupt (struct perf *p)
+{
+ state_must_be (p, PS_METER_RUNNING);
+ update_sofar (p);
+ p->state = PS_METER_INTERRUPTED;
+}
+
+static void
+perf_resume (struct perf *p)
+{
+ state_must_be (p, PS_METER_INTERRUPTED);
+ ASSERT (!gettimeofday (&p->start, NULL));
+ p->state = PS_METER_RUNNING;
+}
+
+void
+perf_push (int type)
+{
+ struct perf *prev;
+ struct perf *cur;
+
+ ASSERT (SIZE(metric_names) == PERF_N);
+ push_perf_index (type);
+
+ prev = get_perf (-2);
+ cur = get_perf (-1);
+
+ ASSERT (cur);
+
+ if (prev)
+ perf_interrupt (prev);
+ perf_start (cur);
+}
+
+void
+perf_pop (void)
+{
+ struct perf *prev;
+ struct perf *cur;
+
+ prev = get_perf (-2);
+ cur = get_perf (-1);
+
+ ASSERT (cur);
+ perf_stop (cur);
+
+ if (prev)
+ perf_resume (prev);
+
+ pop_perf_index ();
+}
+
+void
+perf_output_results (void)
+{
+ int i;
+ msg (M_INFO, "LATENCY PROFILE (mean and max are in milliseconds)");
+ for (i = 0; i < PERF_N; ++i)
+ {
+ struct perf *p = &perf_set.perf[i];
+ if (p->count > 0.0)
+ {
+ const double mean = p->sum / p->count;
+ msg (M_INFO, "%s n=%.0f mean=%.3f max=%.3f", metric_names[i], p->count, mean*1000.0, p->max*1000.0);
+ }
+ }
+}
+
+static void
+perf_print_state (int lev)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ msg (lev, "PERF STATE");
+ msg (lev, "Stack:");
+ for (i = 0; i < perf_set.stack_len; ++i)
+ {
+ const int j = perf_set.stack[i];
+ const struct perf *p = &perf_set.perf[j];
+ msg (lev, "[%d] %s state=%d start=%s sofar=%f sum=%f max=%f count=%f",
+ i,
+ metric_names[j],
+ p->state,
+ tv_string (&p->start, &gc),
+ p->sofar,
+ p->sum,
+ p->max,
+ p->count);
+ }
+ gc_free (&gc);
+}
+
+#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
+static void dummy(void) {}
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.h
new file mode 100644
index 00000000..c531d9c1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/perf.h
@@ -0,0 +1,82 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * The interval_ routines are designed to optimize the calling of a routine
+ * (normally tls_multi_process()) which can be called less frequently
+ * between triggers.
+ */
+
+#ifndef PERF_H
+#define PERF_H
+
+/*#define ENABLE_PERFORMANCE_METRICS*/
+
+/*
+ * Metrics
+ */
+#define PERF_BIO_READ_PLAINTEXT 0
+#define PERF_BIO_WRITE_PLAINTEXT 1
+#define PERF_BIO_READ_CIPHERTEXT 2
+#define PERF_BIO_WRITE_CIPHERTEXT 3
+#define PERF_TLS_MULTI_PROCESS 4
+#define PERF_IO_WAIT 5
+#define PERF_EVENT_LOOP 6
+#define PERF_MULTI_CREATE_INSTANCE 7
+#define PERF_MULTI_CLOSE_INSTANCE 8
+#define PERF_MULTI_SHOW_STATS 9
+#define PERF_MULTI_BCAST 10
+#define PERF_MULTI_MCAST 11
+#define PERF_SCRIPT 12
+#define PERF_READ_IN_LINK 13
+#define PERF_PROC_IN_LINK 14
+#define PERF_READ_IN_TUN 15
+#define PERF_PROC_IN_TUN 16
+#define PERF_PROC_OUT_LINK 17
+#define PERF_PROC_OUT_TUN 18
+#define PERF_PROC_OUT_TUN_MTCP 19
+#define PERF_N 20
+
+#ifdef ENABLE_PERFORMANCE_METRICS
+
+#include "basic.h"
+
+/*
+ * Stack size
+ */
+#define STACK_N 64
+
+void perf_push (int type);
+void perf_pop (void);
+void perf_output_results (void);
+
+#else
+
+static inline void perf_push (int type) {}
+static inline void perf_pop (void) {}
+static inline void perf_output_results (void) {}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pf-inline.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf-inline.h
new file mode 100644
index 00000000..6b5dcb25
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf-inline.h
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#if defined(ENABLE_PF) && !defined(PF_INLINE_H)
+#define PF_INLINE_H
+
+/*
+ * Inline functions
+ */
+
+#define PCT_SRC 1
+#define PCT_DEST 2
+static inline bool
+pf_c2c_test (const struct context *src, const struct context *dest, const char *prefix)
+{
+ bool pf_cn_test (struct pf_set *pfs, const struct tls_multi *tm, const int type, const char *prefix);
+ return (!src->c2.pf.enabled || pf_cn_test (src->c2.pf.pfs, dest->c2.tls_multi, PCT_DEST, prefix))
+ && (!dest->c2.pf.enabled || pf_cn_test (dest->c2.pf.pfs, src->c2.tls_multi, PCT_SRC, prefix));
+}
+
+static inline bool
+pf_addr_test (const struct context *src, const struct mroute_addr *dest, const char *prefix)
+{
+ bool pf_addr_test_dowork (const struct context *src, const struct mroute_addr *dest, const char *prefix);
+
+ if (src->c2.pf.enabled)
+ return pf_addr_test_dowork (src, dest, prefix);
+ else
+ return true;
+}
+
+static inline bool
+pf_kill_test (const struct pf_set *pfs)
+{
+ return pfs->kill;
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.c
new file mode 100644
index 00000000..a3208db1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.c
@@ -0,0 +1,716 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* packet filter functions */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_PF)
+
+#include "init.h"
+#include "memdbg.h"
+#include "ssl_verify.h"
+
+#include "pf-inline.h"
+
+static void
+pf_destroy (struct pf_set *pfs)
+{
+ if (pfs)
+ {
+ if (pfs->cns.hash_table)
+ hash_free (pfs->cns.hash_table);
+
+ {
+ struct pf_cn_elem *l = pfs->cns.list;
+ while (l)
+ {
+ struct pf_cn_elem *next = l->next;
+ free (l->rule.cn);
+ free (l);
+ l = next;
+ }
+ }
+ {
+ struct pf_subnet *l = pfs->sns.list;
+ while (l)
+ {
+ struct pf_subnet *next = l->next;
+ free (l);
+ l = next;
+ }
+ }
+ free (pfs);
+ }
+}
+
+static bool
+add_client (const char *line, const char *prefix, const int line_num, struct pf_cn_elem ***next, const bool exclude)
+{
+ struct pf_cn_elem *e;
+ ALLOC_OBJ_CLEAR (e, struct pf_cn_elem);
+ e->rule.exclude = exclude;
+ e->rule.cn = string_alloc (line, NULL);
+ **next = e;
+ *next = &e->next;
+ return true;
+}
+
+static bool
+add_subnet (const char *line, const char *prefix, const int line_num, struct pf_subnet ***next, const bool exclude)
+{
+ struct in_addr network;
+ in_addr_t netmask = 0;
+
+ if (strcmp (line, "unknown"))
+ {
+ int netbits = 32;
+ char *div = strchr (line, '/');
+
+ if (div)
+ {
+ *div++ = '\0';
+ if (sscanf (div, "%d", &netbits) != 1)
+ {
+ msg (D_PF_INFO, "PF: %s/%d: bad '/n' subnet specifier: '%s'", prefix, line_num, div);
+ return false;
+ }
+ if (netbits < 0 || netbits > 32)
+ {
+ msg (D_PF_INFO, "PF: %s/%d: bad '/n' subnet specifier: must be between 0 and 32: '%s'", prefix, line_num, div);
+ return false;
+ }
+ }
+
+ if (openvpn_inet_aton (line, &network) != OIA_IP)
+ {
+ msg (D_PF_INFO, "PF: %s/%d: bad network address: '%s'", prefix, line_num, line);
+ return false;
+ }
+ netmask = netbits_to_netmask (netbits);
+ if ((network.s_addr & htonl (netmask)) != network.s_addr)
+ {
+ network.s_addr &= htonl (netmask);
+ msg (M_WARN, "WARNING: PF: %s/%d: incorrect subnet %s/%d changed to %s/%d", prefix, line_num, line, netbits, inet_ntoa (network), netbits);
+ }
+ }
+ else
+ {
+ /* match special "unknown" tag for addresses unrecognized by mroute */
+ network.s_addr = htonl(0);
+ netmask = IPV4_NETMASK_HOST;
+ }
+
+ {
+ struct pf_subnet *e;
+ ALLOC_OBJ_CLEAR (e, struct pf_subnet);
+ e->rule.exclude = exclude;
+ e->rule.network = ntohl (network.s_addr);
+ e->rule.netmask = netmask;
+ **next = e;
+ *next = &e->next;
+ return true;
+ }
+}
+
+static uint32_t
+cn_hash_function (const void *key, uint32_t iv)
+{
+ return hash_func ((uint8_t *)key, strlen ((char *)key) + 1, iv);
+}
+
+static bool
+cn_compare_function (const void *key1, const void *key2)
+{
+ return !strcmp((const char *)key1, (const char *)key2);
+}
+
+static bool
+genhash (struct pf_cn_set *cns, const char *prefix, const int n_clients)
+{
+ struct pf_cn_elem *e;
+ bool status = true;
+ int n_buckets = n_clients;
+
+ if (n_buckets < 16)
+ n_buckets = 16;
+ cns->hash_table = hash_init (n_buckets, 0, cn_hash_function, cn_compare_function);
+ for (e = cns->list; e != NULL; e = e->next)
+ {
+ if (!hash_add (cns->hash_table, e->rule.cn, &e->rule, false))
+ {
+ msg (D_PF_INFO, "PF: %s: duplicate common name in [clients] section: '%s'", prefix, e->rule.cn);
+ status = false;
+ }
+ }
+
+ return status;
+}
+
+static struct pf_set *
+pf_init (const struct buffer_list *bl, const char *prefix, const bool allow_kill)
+{
+# define MODE_UNDEF 0
+# define MODE_CLIENTS 1
+# define MODE_SUBNETS 2
+ int mode = MODE_UNDEF;
+ int line_num = 0;
+ int n_clients = 0;
+ int n_subnets = 0;
+ int n_errors = 0;
+ struct pf_set *pfs = NULL;
+ char line[PF_MAX_LINE_LEN];
+
+ ALLOC_OBJ_CLEAR (pfs, struct pf_set);
+ if (bl)
+ {
+ struct pf_cn_elem **cl = &pfs->cns.list;
+ struct pf_subnet **sl = &pfs->sns.list;
+ struct buffer_entry *be;
+
+ for (be = bl->head; be != NULL; be = be->next)
+ {
+ ++line_num;
+ strncpynt (line, BSTR(&be->buf), sizeof(line));
+ rm_trailing_chars (line, "\r\n\t ");
+ if (line[0] == '\0' || line[0] == '#')
+ ;
+ else if (line[0] == '+' || line[0] == '-')
+ {
+ bool exclude = (line[0] == '-');
+
+ if (line[1] =='\0')
+ {
+ msg (D_PF_INFO, "PF: %s/%d: no data after +/-: '%s'", prefix, line_num, line);
+ ++n_errors;
+ }
+ else if (mode == MODE_CLIENTS)
+ {
+ if (add_client (&line[1], prefix, line_num, &cl, exclude))
+ ++n_clients;
+ else
+ ++n_errors;
+ }
+ else if (mode == MODE_SUBNETS)
+ {
+ if (add_subnet (&line[1], prefix, line_num, &sl, exclude))
+ ++n_subnets;
+ else
+ ++n_errors;
+ }
+ else if (mode == MODE_UNDEF)
+ ;
+ else
+ {
+ ASSERT (0);
+ }
+ }
+ else if (line[0] == '[')
+ {
+ if (!strcasecmp (line, "[clients accept]"))
+ {
+ mode = MODE_CLIENTS;
+ pfs->cns.default_allow = true;
+ }
+ else if (!strcasecmp (line, "[clients drop]"))
+ {
+ mode = MODE_CLIENTS;
+ pfs->cns.default_allow = false;
+ }
+ else if (!strcasecmp (line, "[subnets accept]"))
+ {
+ mode = MODE_SUBNETS;
+ pfs->sns.default_allow = true;
+ }
+ else if (!strcasecmp (line, "[subnets drop]"))
+ {
+ mode = MODE_SUBNETS;
+ pfs->sns.default_allow = false;
+ }
+ else if (!strcasecmp (line, "[end]"))
+ goto done;
+ else if (allow_kill && !strcasecmp (line, "[kill]"))
+ goto kill;
+ else
+ {
+ mode = MODE_UNDEF;
+ msg (D_PF_INFO, "PF: %s/%d unknown tag: '%s'", prefix, line_num, line);
+ ++n_errors;
+ }
+ }
+ else
+ {
+ msg (D_PF_INFO, "PF: %s/%d line must begin with '+', '-', or '[' : '%s'", prefix, line_num, line);
+ ++n_errors;
+ }
+ }
+ ++n_errors;
+ msg (D_PF_INFO, "PF: %s: missing [end]", prefix);
+ }
+ else
+ {
+ msg (D_PF_INFO, "PF: %s: cannot open", prefix);
+ ++n_errors;
+ }
+
+ done:
+ if (bl)
+ {
+ if (!n_errors)
+ {
+ if (!genhash (&pfs->cns, prefix, n_clients))
+ ++n_errors;
+ }
+ if (n_errors)
+ msg (D_PF_INFO, "PF: %s rejected due to %d error(s)", prefix, n_errors);
+ }
+ if (n_errors)
+ {
+ pf_destroy (pfs);
+ pfs = NULL;
+ }
+ return pfs;
+
+ kill:
+ pf_destroy (pfs);
+ ALLOC_OBJ_CLEAR (pfs, struct pf_set);
+ pfs->kill = true;
+ return pfs;
+}
+
+#ifdef PLUGIN_PF
+static struct pf_set *
+pf_init_from_file (const char *fn)
+{
+ struct buffer_list *bl = buffer_list_file (fn, PF_MAX_LINE_LEN);
+ if (bl)
+ {
+ struct pf_set *pfs = pf_init (bl, fn, true);
+ buffer_list_free (bl);
+ return pfs;
+ }
+ else
+ {
+ msg (D_PF_INFO|M_ERRNO, "PF: %s: cannot open", fn);
+ return NULL;
+ }
+}
+#endif
+
+#ifdef ENABLE_DEBUG
+
+static const char *
+drop_accept (const bool accept)
+{
+ return accept ? "ACCEPT" : "DROP";
+}
+
+static const char *
+pct_name (const int type)
+{
+ switch (type)
+ {
+ case PCT_SRC:
+ return "SRC";
+ case PCT_DEST:
+ return "DEST";
+ default:
+ return "???";
+ }
+}
+
+static void
+pf_cn_test_print (const char *prefix,
+ const int type,
+ const char *prefix2,
+ const char *cn,
+ const bool allow,
+ const struct pf_cn *rule)
+{
+ if (rule)
+ {
+ dmsg (D_PF_DEBUG, "PF: %s/%s/%s %s %s rule=[%s %s]",
+ prefix, prefix2, pct_name (type),
+ cn, drop_accept (allow),
+ rule->cn, drop_accept (!rule->exclude));
+ }
+ else
+ {
+ dmsg (D_PF_DEBUG, "PF: %s/%s/%s %s %s",
+ prefix, prefix2, pct_name (type),
+ cn, drop_accept (allow));
+ }
+}
+
+static void
+pf_addr_test_print (const char *prefix,
+ const char *prefix2,
+ const struct context *src,
+ const struct mroute_addr *dest,
+ const bool allow,
+ const struct ipv4_subnet *rule)
+{
+ struct gc_arena gc = gc_new ();
+ if (rule)
+ {
+ dmsg (D_PF_DEBUG, "PF: %s/%s %s %s %s rule=[%s/%s %s]",
+ prefix,
+ prefix2,
+ tls_common_name (src->c2.tls_multi, false),
+ mroute_addr_print_ex (dest, MAPF_SHOW_ARP, &gc),
+ drop_accept (allow),
+ print_in_addr_t (rule->network, 0, &gc),
+ print_in_addr_t (rule->netmask, 0, &gc),
+ drop_accept (!rule->exclude));
+ }
+ else
+ {
+ dmsg (D_PF_DEBUG, "PF: %s/%s %s %s %s",
+ prefix,
+ prefix2,
+ tls_common_name (src->c2.tls_multi, false),
+ mroute_addr_print_ex (dest, MAPF_SHOW_ARP, &gc),
+ drop_accept (allow));
+ }
+ gc_free (&gc);
+}
+
+#endif
+
+static inline struct pf_cn *
+lookup_cn_rule (struct hash *h, const char *cn, const uint32_t cn_hash)
+{
+ struct hash_element *he = hash_lookup_fast (h, hash_bucket (h, cn_hash), cn, cn_hash);
+ if (he)
+ return (struct pf_cn *) he->value;
+ else
+ return NULL;
+}
+
+bool
+pf_cn_test (struct pf_set *pfs, const struct tls_multi *tm, const int type, const char *prefix)
+{
+ if (pfs && !pfs->kill)
+ {
+ const char *cn;
+ uint32_t cn_hash;
+ if (tls_common_name_hash (tm, &cn, &cn_hash))
+ {
+ const struct pf_cn *rule = lookup_cn_rule (pfs->cns.hash_table, cn, cn_hash);
+ if (rule)
+ {
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_cn_test_print ("PF_CN_MATCH", type, prefix, cn, !rule->exclude, rule);
+#endif
+ if (!rule->exclude)
+ return true;
+ else
+ return false;
+ }
+ else
+ {
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_cn_test_print ("PF_CN_DEFAULT", type, prefix, cn, pfs->cns.default_allow, NULL);
+#endif
+ if (pfs->cns.default_allow)
+ return true;
+ else
+ return false;
+ }
+ }
+ }
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_cn_test_print ("PF_CN_FAULT", type, prefix, tls_common_name (tm, false), false, NULL);
+#endif
+ return false;
+}
+
+bool
+pf_addr_test_dowork (const struct context *src, const struct mroute_addr *dest, const char *prefix)
+{
+ struct pf_set *pfs = src->c2.pf.pfs;
+ if (pfs && !pfs->kill)
+ {
+ const in_addr_t addr = in_addr_t_from_mroute_addr (dest);
+ const struct pf_subnet *se = pfs->sns.list;
+ while (se)
+ {
+ if ((addr & se->rule.netmask) == se->rule.network)
+ {
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_addr_test_print ("PF_ADDR_MATCH", prefix, src, dest, !se->rule.exclude, &se->rule);
+#endif
+ return !se->rule.exclude;
+ }
+ se = se->next;
+ }
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_addr_test_print ("PF_ADDR_DEFAULT", prefix, src, dest, pfs->sns.default_allow, NULL);
+#endif
+ return pfs->sns.default_allow;
+ }
+ else
+ {
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_addr_test_print ("PF_ADDR_FAULT", prefix, src, dest, false, NULL);
+#endif
+ return false;
+ }
+}
+
+#ifdef PLUGIN_PF
+void
+pf_check_reload (struct context *c)
+{
+ const int slow_wakeup = 15;
+ const int fast_wakeup = 1;
+ const int wakeup_transition = 60;
+ bool reloaded = false;
+
+ if (c->c2.pf.enabled
+ && c->c2.pf.filename
+ && event_timeout_trigger (&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT))
+ {
+ platform_stat_t s;
+ if (!platform_stat (c->c2.pf.filename, &s))
+ {
+ if (s.st_mtime > c->c2.pf.file_last_mod)
+ {
+ struct pf_set *pfs = pf_init_from_file (c->c2.pf.filename);
+ if (pfs)
+ {
+ if (c->c2.pf.pfs)
+ pf_destroy (c->c2.pf.pfs);
+ c->c2.pf.pfs = pfs;
+ reloaded = true;
+ if (pf_kill_test (pfs))
+ {
+ c->sig->signal_received = SIGTERM;
+ c->sig->signal_text = "pf-kill";
+ }
+ }
+ c->c2.pf.file_last_mod = s.st_mtime;
+ }
+ }
+ {
+ int wakeup = slow_wakeup;
+ if (!c->c2.pf.pfs && c->c2.pf.n_check_reload < wakeup_transition)
+ wakeup = fast_wakeup;
+ event_timeout_init (&c->c2.pf.reload, wakeup, now);
+ reset_coarse_timers (c);
+ c->c2.pf.n_check_reload++;
+ }
+ }
+#ifdef ENABLE_DEBUG
+ if (reloaded && check_debug_level (D_PF_DEBUG))
+ pf_context_print (&c->c2.pf, "pf_check_reload", D_PF_DEBUG);
+#endif
+}
+#endif
+
+#ifdef MANAGEMENT_PF
+bool
+pf_load_from_buffer_list (struct context *c, const struct buffer_list *config)
+{
+ struct pf_set *pfs = pf_init (config, "[SERVER-PF]", false);
+ if (pfs)
+ {
+ if (c->c2.pf.pfs)
+ pf_destroy (c->c2.pf.pfs);
+ c->c2.pf.pfs = pfs;
+ return true;
+ }
+ else
+ return false;
+}
+#endif
+
+void
+pf_init_context (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+#ifdef PLUGIN_PF
+ if (plugin_defined (c->plugins, OPENVPN_PLUGIN_ENABLE_PF))
+ {
+ const char *pf_file = create_temp_file (c->options.tmp_dir, "pf", &gc);
+ if( pf_file ) {
+ setenv_str (c->c2.es, "pf_file", pf_file);
+
+ if (plugin_call (c->plugins, OPENVPN_PLUGIN_ENABLE_PF, NULL, NULL, c->c2.es) == OPENVPN_PLUGIN_FUNC_SUCCESS)
+ {
+ event_timeout_init (&c->c2.pf.reload, 1, now);
+ c->c2.pf.filename = string_alloc (pf_file, &c->c2.gc);
+ c->c2.pf.enabled = true;
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_context_print (&c->c2.pf, "pf_init_context#1", D_PF_DEBUG);
+#endif
+ }
+ else
+ {
+ msg (M_WARN, "WARNING: OPENVPN_PLUGIN_ENABLE_PF disabled");
+ }
+ }
+ }
+#endif
+#ifdef MANAGEMENT_PF
+ if (!c->c2.pf.enabled && management_enable_pf (management))
+ {
+ c->c2.pf.enabled = true;
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_PF_DEBUG))
+ pf_context_print (&c->c2.pf, "pf_init_context#2", D_PF_DEBUG);
+#endif
+ }
+#endif
+ gc_free (&gc);
+}
+
+void
+pf_destroy_context (struct pf_context *pfc)
+{
+#ifdef PLUGIN_PF
+ if (pfc->filename)
+ {
+ platform_unlink (pfc->filename);
+ }
+#endif
+ if (pfc->pfs)
+ pf_destroy (pfc->pfs);
+}
+
+#ifdef ENABLE_DEBUG
+
+static void
+pf_subnet_set_print (const struct pf_subnet_set *s, const int lev)
+{
+ struct gc_arena gc = gc_new ();
+ if (s)
+ {
+ struct pf_subnet *e;
+
+ msg (lev, " ----- struct pf_subnet_set -----");
+ msg (lev, " default_allow=%s", drop_accept (s->default_allow));
+
+ for (e = s->list; e != NULL; e = e->next)
+ {
+ msg (lev, " %s/%s %s",
+ print_in_addr_t (e->rule.network, 0, &gc),
+ print_in_addr_t (e->rule.netmask, 0, &gc),
+ drop_accept (!e->rule.exclude));
+ }
+ }
+ gc_free (&gc);
+}
+
+static void
+pf_cn_set_print (const struct pf_cn_set *s, const int lev)
+{
+ if (s)
+ {
+ struct hash_iterator hi;
+ struct hash_element *he;
+
+ msg (lev, " ----- struct pf_cn_set -----");
+ msg (lev, " default_allow=%s", drop_accept (s->default_allow));
+
+ if (s->hash_table)
+ {
+ hash_iterator_init (s->hash_table, &hi);
+ while ((he = hash_iterator_next (&hi)))
+ {
+ struct pf_cn *e = (struct pf_cn *)he->value;
+ msg (lev, " %s %s",
+ e->cn,
+ drop_accept (!e->exclude));
+ }
+
+ msg (lev, " ----------");
+
+ {
+ struct pf_cn_elem *ce;
+ for (ce = s->list; ce != NULL; ce = ce->next)
+ {
+ struct pf_cn *e = lookup_cn_rule (s->hash_table, ce->rule.cn, cn_hash_function (ce->rule.cn, 0));
+ if (e)
+ {
+ msg (lev, " %s %s",
+ e->cn,
+ drop_accept (!e->exclude));
+ }
+ else
+ {
+ msg (lev, " %s LOOKUP FAILED", ce->rule.cn);
+ }
+ }
+ }
+ }
+ }
+}
+
+static void
+pf_set_print (const struct pf_set *pfs, const int lev)
+{
+ if (pfs)
+ {
+ msg (lev, " ----- struct pf_set -----");
+ msg (lev, " kill=%d", pfs->kill);
+ pf_subnet_set_print (&pfs->sns, lev);
+ pf_cn_set_print (&pfs->cns, lev);
+ }
+}
+
+void
+pf_context_print (const struct pf_context *pfc, const char *prefix, const int lev)
+{
+ msg (lev, "----- %s : struct pf_context -----", prefix);
+ if (pfc)
+ {
+ msg (lev, "enabled=%d", pfc->enabled);
+#ifdef PLUGIN_PF
+ msg (lev, "filename='%s'", np(pfc->filename));
+ msg (lev, "file_last_mod=%u", (unsigned int)pfc->file_last_mod);
+ msg (lev, "n_check_reload=%u", pfc->n_check_reload);
+ msg (lev, "reload=[%d,%u,%u]", pfc->reload.defined, pfc->reload.n, (unsigned int)pfc->reload.last);
+#endif
+ pf_set_print (pfc->pfs, lev);
+ }
+ msg (lev, "--------------------");
+}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.h
new file mode 100644
index 00000000..04adf0ea
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pf.h
@@ -0,0 +1,102 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* packet filter functions */
+
+#if defined(ENABLE_PF) && !defined(OPENVPN_PF_H)
+#define OPENVPN_PF_H
+
+#include "list.h"
+#include "mroute.h"
+
+#define PF_MAX_LINE_LEN 256
+
+struct context;
+
+struct ipv4_subnet {
+ bool exclude;
+ in_addr_t network;
+ in_addr_t netmask;
+};
+
+struct pf_subnet {
+ struct pf_subnet *next;
+ struct ipv4_subnet rule;
+};
+
+struct pf_subnet_set {
+ bool default_allow;
+ struct pf_subnet *list;
+};
+
+struct pf_cn {
+ bool exclude;
+ char *cn;
+};
+
+struct pf_cn_elem {
+ struct pf_cn_elem *next;
+ struct pf_cn rule;
+};
+
+struct pf_cn_set {
+ bool default_allow;
+ struct pf_cn_elem *list;
+ struct hash *hash_table;
+};
+
+struct pf_set {
+ bool kill;
+ struct pf_subnet_set sns;
+ struct pf_cn_set cns;
+};
+
+struct pf_context {
+ bool enabled;
+ struct pf_set *pfs;
+#ifdef PLUGIN_PF
+ char *filename;
+ time_t file_last_mod;
+ unsigned int n_check_reload;
+ struct event_timeout reload;
+#endif
+};
+
+void pf_init_context (struct context *c);
+
+void pf_destroy_context (struct pf_context *pfc);
+
+#ifdef PLUGIN_PF
+void pf_check_reload (struct context *c);
+#endif
+
+#ifdef MANAGEMENT_PF
+bool pf_load_from_buffer_list (struct context *c, const struct buffer_list *config);
+#endif
+
+#ifdef ENABLE_DEBUG
+void pf_context_print (const struct pf_context *pfc, const char *prefix, const int lev);
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ping-inline.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping-inline.h
new file mode 100644
index 00000000..c7249705
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping-inline.h
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PING_INLINE_H
+#define PING_INLINE_H
+
+/*
+ * Should we exit or restart due to ping (or other authenticated packet)
+ * not received in n seconds?
+ */
+static inline void
+check_ping_restart (struct context *c)
+{
+ void check_ping_restart_dowork (struct context *c);
+ if (c->options.ping_rec_timeout
+ && event_timeout_trigger (&c->c2.ping_rec_interval,
+ &c->c2.timeval,
+ (!c->options.ping_timer_remote
+ || link_socket_actual_defined (&c->c1.link_socket_addr.actual))
+ ? ETT_DEFAULT : 15))
+ check_ping_restart_dowork (c);
+}
+
+/*
+ * Should we ping the remote?
+ */
+static inline void
+check_ping_send (struct context *c)
+{
+ void check_ping_send_dowork (struct context *c);
+ if (c->options.ping_send_timeout
+ && event_timeout_trigger (&c->c2.ping_send_interval,
+ &c->c2.timeval,
+ !TO_LINK_DEF(c) ? ETT_DEFAULT : 1))
+ check_ping_send_dowork (c);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.c
new file mode 100644
index 00000000..6dc0b4e5
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.c
@@ -0,0 +1,98 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "ping.h"
+
+#include "memdbg.h"
+
+#include "ping-inline.h"
+
+/*
+ * This random string identifies an OpenVPN ping packet.
+ * It should be of sufficient length and randomness
+ * so as not to collide with other tunnel data.
+ *
+ * PING_STRING_SIZE must be sizeof (ping_string)
+ */
+const uint8_t ping_string[] = {
+ 0x2a, 0x18, 0x7b, 0xf3, 0x64, 0x1e, 0xb4, 0xcb,
+ 0x07, 0xed, 0x2d, 0x0a, 0x98, 0x1f, 0xc7, 0x48
+};
+
+/*
+ * Should we exit or restart due to ping (or other authenticated packet)
+ * not received in n seconds?
+ */
+void
+check_ping_restart_dowork (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ switch (c->options.ping_rec_timeout_action)
+ {
+ case PING_EXIT:
+ msg (M_INFO, "%sInactivity timeout (--ping-exit), exiting",
+ format_common_name (c, &gc));
+ c->sig->signal_received = SIGTERM;
+ c->sig->signal_text = "ping-exit";
+ break;
+ case PING_RESTART:
+ msg (M_INFO, "%sInactivity timeout (--ping-restart), restarting",
+ format_common_name (c, &gc));
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- Ping Restart */
+ c->sig->signal_text = "ping-restart";
+ break;
+ default:
+ ASSERT (0);
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Should we ping the remote?
+ */
+void
+check_ping_send_dowork (struct context *c)
+{
+ c->c2.buf = c->c2.buffers->aux_buf;
+ ASSERT (buf_init (&c->c2.buf, FRAME_HEADROOM (&c->c2.frame)));
+ ASSERT (buf_safe (&c->c2.buf, MAX_RW_SIZE_TUN (&c->c2.frame)));
+ ASSERT (buf_write (&c->c2.buf, ping_string, sizeof (ping_string)));
+
+ /*
+ * We will treat the ping like any other outgoing packet,
+ * encrypt, sign, etc.
+ */
+ encrypt_sign (c, true);
+ /* Set length to 0, so it won't be counted as activity */
+ c->c2.buf.len = 0;
+ dmsg (D_PING, "SENT PING");
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.h
new file mode 100644
index 00000000..88f5f3a9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ping.h
@@ -0,0 +1,47 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PING_H
+#define PING_H
+
+#include "init.h"
+#include "forward.h"
+
+/*
+ * Initial default --ping-restart before --pull
+ */
+#define PRE_PULL_INITIAL_PING_RESTART 120 /* in seconds */
+
+extern const uint8_t ping_string[];
+
+/* PING_STRING_SIZE must be sizeof (ping_string) */
+#define PING_STRING_SIZE 16
+
+static inline bool
+is_ping_msg (const struct buffer* buf)
+{
+ return buf_string_match (buf, ping_string, PING_STRING_SIZE);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.c
new file mode 100644
index 00000000..3a15ef68
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.c
@@ -0,0 +1,946 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_PKCS11)
+
+#include <pkcs11-helper-1.0/pkcs11h-certificate.h>
+#include "basic.h"
+#include "error.h"
+#include "manage.h"
+#include "base64.h"
+#include "pkcs11.h"
+#include "misc.h"
+#include "otime.h"
+#include "console.h"
+#include "pkcs11_backend.h"
+
+static
+time_t
+__mytime (void) {
+ return openvpn_time (NULL);
+}
+
+#if !defined(_WIN32)
+static
+int
+__mygettimeofday (struct timeval *tv) {
+ return gettimeofday (tv, NULL);
+}
+#endif
+
+static
+void
+__mysleep (const unsigned long usec) {
+#if defined(_WIN32)
+ Sleep (usec/1000);
+#else
+ usleep (usec);
+#endif
+}
+
+
+static pkcs11h_engine_system_t s_pkcs11h_sys_engine = {
+ malloc,
+ free,
+ __mytime,
+ __mysleep,
+#if defined(_WIN32)
+ NULL
+#else
+ __mygettimeofday
+#endif
+};
+
+static
+unsigned
+_pkcs11_msg_pkcs112openvpn (
+ const unsigned flags
+) {
+ unsigned openvpn_flags;
+
+ switch (flags) {
+ case PKCS11H_LOG_DEBUG2:
+ openvpn_flags = D_PKCS11_DEBUG;
+ break;
+ case PKCS11H_LOG_DEBUG1:
+ openvpn_flags = D_SHOW_PKCS11;
+ break;
+ case PKCS11H_LOG_INFO:
+ openvpn_flags = M_INFO;
+ break;
+ case PKCS11H_LOG_WARN:
+ openvpn_flags = M_WARN;
+ break;
+ case PKCS11H_LOG_ERROR:
+ openvpn_flags = M_FATAL;
+ break;
+ default:
+ openvpn_flags = M_FATAL;
+ break;
+ }
+
+#if defined(ENABLE_PKCS11_FORCE_DEBUG)
+ openvpn_flags=M_INFO;
+#endif
+
+ return openvpn_flags;
+}
+
+static
+unsigned
+_pkcs11_msg_openvpn2pkcs11 (
+ const unsigned flags
+) {
+ unsigned pkcs11_flags;
+
+ if ((flags & D_PKCS11_DEBUG) != 0) {
+ pkcs11_flags = PKCS11H_LOG_DEBUG2;
+ }
+ else if ((flags & D_SHOW_PKCS11) != 0) {
+ pkcs11_flags = PKCS11H_LOG_DEBUG1;
+ }
+ else if ((flags & M_INFO) != 0) {
+ pkcs11_flags = PKCS11H_LOG_INFO;
+ }
+ else if ((flags & M_WARN) != 0) {
+ pkcs11_flags = PKCS11H_LOG_WARN;
+ }
+ else if ((flags & M_FATAL) != 0) {
+ pkcs11_flags = PKCS11H_LOG_ERROR;
+ }
+ else {
+ pkcs11_flags = PKCS11H_LOG_ERROR;
+ }
+
+#if defined(ENABLE_PKCS11_FORCE_DEBUG)
+ pkcs11_flags = PKCS11H_LOG_DEBUG2;
+#endif
+
+ return pkcs11_flags;
+}
+
+static
+void
+_pkcs11_openvpn_log (
+ void * const global_data,
+ unsigned flags,
+ const char * const szFormat,
+ va_list args
+) {
+ char Buffer[10*1024];
+
+ (void)global_data;
+
+ vsnprintf (Buffer, sizeof (Buffer), szFormat, args);
+ Buffer[sizeof (Buffer)-1] = 0;
+
+ msg (_pkcs11_msg_pkcs112openvpn (flags), "%s", Buffer);
+}
+
+static
+PKCS11H_BOOL
+_pkcs11_openvpn_token_prompt (
+ void * const global_data,
+ void * const user_data,
+ const pkcs11h_token_id_t token,
+ const unsigned retry
+) {
+ struct user_pass token_resp;
+
+ (void)global_data;
+ (void)user_data;
+ (void)retry;
+
+ ASSERT (token!=NULL);
+
+ CLEAR (token_resp);
+ token_resp.defined = false;
+ token_resp.nocache = true;
+ openvpn_snprintf (
+ token_resp.username,
+ sizeof (token_resp.username),
+ "Please insert %s token",
+ token->label
+ );
+
+ if (
+ !get_user_pass (
+ &token_resp,
+ NULL,
+ "token-insertion-request",
+ GET_USER_PASS_MANAGEMENT|GET_USER_PASS_NEED_OK|GET_USER_PASS_NOFATAL
+ )
+ ) {
+ return false;
+ }
+ else {
+ return strcmp (token_resp.password, "ok") == 0;
+ }
+}
+
+static
+PKCS11H_BOOL
+_pkcs11_openvpn_pin_prompt (
+ void * const global_data,
+ void * const user_data,
+ const pkcs11h_token_id_t token,
+ const unsigned retry,
+ char * const pin,
+ const size_t pin_max
+) {
+ struct user_pass token_pass;
+ char prompt[1024];
+
+ (void)global_data;
+ (void)user_data;
+ (void)retry;
+
+ ASSERT (token!=NULL);
+
+ openvpn_snprintf (prompt, sizeof (prompt), "%s token", token->label);
+
+ token_pass.defined = false;
+ token_pass.nocache = true;
+
+ if (
+ !get_user_pass (
+ &token_pass,
+ NULL,
+ prompt,
+ GET_USER_PASS_MANAGEMENT|GET_USER_PASS_PASSWORD_ONLY|GET_USER_PASS_NOFATAL
+ )
+ ) {
+ return false;
+ }
+ else {
+ strncpynt (pin, token_pass.password, pin_max);
+ purge_user_pass (&token_pass, true);
+
+ if (strlen (pin) == 0) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+}
+
+bool
+pkcs11_initialize (
+ const bool protected_auth,
+ const int nPINCachePeriod
+) {
+ CK_RV rv = CKR_FUNCTION_FAILED;
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_initialize - entered"
+ );
+
+ if ((rv = pkcs11h_engine_setSystem (&s_pkcs11h_sys_engine)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot initialize system engine %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_initialize ()) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot initialize %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setLogHook (_pkcs11_openvpn_log, NULL)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set hooks %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ pkcs11h_setLogLevel (_pkcs11_msg_openvpn2pkcs11 (get_debug_level ()));
+
+ if ((rv = pkcs11h_setForkMode (TRUE)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set fork mode %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setTokenPromptHook (_pkcs11_openvpn_token_prompt, NULL)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set hooks %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setPINPromptHook (_pkcs11_openvpn_pin_prompt, NULL)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set hooks %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setProtectedAuthentication (protected_auth)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set protected authentication mode %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setPINCachePeriod (nPINCachePeriod)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set Pcache period %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ rv = CKR_OK;
+
+cleanup:
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_initialize - return %ld-'%s'",
+ rv,
+ pkcs11h_getMessage (rv)
+ );
+
+ return rv == CKR_OK;
+}
+
+void
+pkcs11_terminate () {
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_terminate - entered"
+ );
+
+ pkcs11h_terminate ();
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_terminate - return"
+ );
+}
+
+void
+pkcs11_forkFixup () {
+ pkcs11h_forkFixup ();
+}
+
+bool
+pkcs11_addProvider (
+ const char * const provider,
+ const bool protected_auth,
+ const unsigned private_mode,
+ const bool cert_private
+) {
+ CK_RV rv = CKR_OK;
+
+ ASSERT (provider!=NULL);
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_addProvider - entered - provider='%s', private_mode=%08x",
+ provider,
+ private_mode
+ );
+
+ msg (
+ M_INFO,
+ "PKCS#11: Adding PKCS#11 provider '%s'",
+ provider
+ );
+
+ if (
+ (rv = pkcs11h_addProvider (
+ provider,
+ provider,
+ protected_auth,
+ private_mode,
+ PKCS11H_SLOTEVENT_METHOD_AUTO,
+ 0,
+ cert_private
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot initialize provider '%s' %ld-'%s'", provider, rv, pkcs11h_getMessage (rv));
+ }
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_addProvider - return rv=%ld-'%s'",
+ rv,
+ pkcs11h_getMessage (rv)
+ );
+
+ return rv == CKR_OK;
+}
+
+int
+pkcs11_logout() {
+ return pkcs11h_logout () == CKR_OK;
+}
+
+int
+pkcs11_management_id_count () {
+ pkcs11h_certificate_id_list_t id_list = NULL;
+ pkcs11h_certificate_id_list_t t = NULL;
+ CK_RV rv = CKR_OK;
+ int count = 0;
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_management_id_count - entered"
+ );
+
+ if (
+ (rv = pkcs11h_certificate_enumCertificateIds (
+ PKCS11H_ENUM_METHOD_CACHE_EXIST,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ NULL,
+ &id_list
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate list %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ for (count = 0, t = id_list; t != NULL; t = t->next) {
+ count++;
+ }
+
+cleanup:
+
+ if (id_list != NULL) {
+ pkcs11h_certificate_freeCertificateIdList (id_list);
+ id_list = NULL;
+ }
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_management_id_count - return count=%d",
+ count
+ );
+
+ return count;
+}
+
+bool
+pkcs11_management_id_get (
+ const int index,
+ char ** id,
+ char **base64
+) {
+ pkcs11h_certificate_id_list_t id_list = NULL;
+ pkcs11h_certificate_id_list_t entry = NULL;
+#if 0 /* certificate_id seems to be unused -- JY */
+ pkcs11h_certificate_id_t certificate_id = NULL;
+#endif
+ pkcs11h_certificate_t certificate = NULL;
+ CK_RV rv = CKR_OK;
+ unsigned char *certificate_blob = NULL;
+ size_t certificate_blob_size = 0;
+ size_t max;
+ char *internal_id = NULL;
+ char *internal_base64 = NULL;
+ int count = 0;
+ bool success = false;
+
+ ASSERT (id!=NULL);
+ ASSERT (base64!=NULL);
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_management_id_get - entered index=%d",
+ index
+ );
+
+ *id = NULL;
+ *base64 = NULL;
+
+ if (
+ (rv = pkcs11h_certificate_enumCertificateIds (
+ PKCS11H_ENUM_METHOD_CACHE_EXIST,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ NULL,
+ &id_list
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate list %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ entry = id_list;
+ count = 0;
+ while (entry != NULL && count != index) {
+ count++;
+ entry = entry->next;
+ }
+
+ if (entry == NULL) {
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_management_id_get - no certificate at index=%d",
+ index
+ );
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_serializeCertificateId (
+ NULL,
+ &max,
+ entry->certificate_id
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot serialize certificate id %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((internal_id = (char *)malloc (max)) == NULL) {
+ msg (M_FATAL, "PKCS#11: Cannot allocate memory");
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_serializeCertificateId (
+ internal_id,
+ &max,
+ entry->certificate_id
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot serialize certificate id %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_create (
+ entry->certificate_id,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ PKCS11H_PIN_CACHE_INFINITE,
+ &certificate
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_getCertificateBlob (
+ certificate,
+ NULL,
+ &certificate_blob_size
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate blob %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((certificate_blob = (unsigned char *)malloc (certificate_blob_size)) == NULL) {
+ msg (M_FATAL, "PKCS#11: Cannot allocate memory");
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_getCertificateBlob (
+ certificate,
+ certificate_blob,
+ &certificate_blob_size
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate blob %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (openvpn_base64_encode (certificate_blob, certificate_blob_size, &internal_base64) == -1) {
+ msg (M_WARN, "PKCS#11: Cannot encode certificate");
+ goto cleanup;
+ }
+
+ *id = internal_id;
+ internal_id = NULL;
+ *base64 = internal_base64;
+ internal_base64 = NULL;
+ success = true;
+
+cleanup:
+
+ if (id_list != NULL) {
+ pkcs11h_certificate_freeCertificateIdList (id_list);
+ id_list = NULL;
+ }
+
+ if (internal_id != NULL) {
+ free (internal_id);
+ internal_id = NULL;
+ }
+
+ if (internal_base64 != NULL) {
+ free (internal_base64);
+ internal_base64 = NULL;
+ }
+
+ if (certificate_blob != NULL) {
+ free (certificate_blob);
+ certificate_blob = NULL;
+ }
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: pkcs11_management_id_get - return success=%d, id='%s'",
+ success ? 1 : 0,
+ *id
+ );
+
+ return success;
+}
+
+int
+tls_ctx_use_pkcs11 (
+ struct tls_root_ctx * const ssl_ctx,
+ bool pkcs11_id_management,
+ const char * const pkcs11_id
+) {
+ pkcs11h_certificate_id_t certificate_id = NULL;
+ pkcs11h_certificate_t certificate = NULL;
+ CK_RV rv = CKR_OK;
+
+ bool ok = false;
+
+ ASSERT (ssl_ctx!=NULL);
+ ASSERT (pkcs11_id_management || pkcs11_id!=NULL);
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: tls_ctx_use_pkcs11 - entered - ssl_ctx=%p, pkcs11_id_management=%d, pkcs11_id='%s'",
+ (void *)ssl_ctx,
+ pkcs11_id_management ? 1 : 0,
+ pkcs11_id
+ );
+
+ if (pkcs11_id_management) {
+ struct user_pass id_resp;
+
+ CLEAR (id_resp);
+
+ id_resp.defined = false;
+ id_resp.nocache = true;
+ openvpn_snprintf (
+ id_resp.username,
+ sizeof (id_resp.username),
+ "Please specify PKCS#11 id to use"
+ );
+
+ if (
+ !get_user_pass (
+ &id_resp,
+ NULL,
+ "pkcs11-id-request",
+ GET_USER_PASS_MANAGEMENT|GET_USER_PASS_NEED_STR|GET_USER_PASS_NOFATAL
+ )
+ ) {
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_deserializeCertificateId (
+ &certificate_id,
+ id_resp.password
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot deserialize id %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+ }
+ else {
+ if (
+ (rv = pkcs11h_certificate_deserializeCertificateId (
+ &certificate_id,
+ pkcs11_id
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot deserialize id %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+ }
+
+ if (
+ (rv = pkcs11h_certificate_create (
+ certificate_id,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ PKCS11H_PIN_CACHE_INFINITE,
+ &certificate
+ )) != CKR_OK
+ ) {
+ msg (M_WARN, "PKCS#11: Cannot get certificate %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (
+ (pkcs11_init_tls_session (
+ certificate,
+ ssl_ctx
+ ))
+ ) {
+ /* Handled by SSL context free */
+ certificate = NULL;
+ goto cleanup;
+ }
+
+ /* Handled by SSL context free */
+ certificate = NULL;
+ ok = true;
+
+cleanup:
+ if (certificate != NULL) {
+ pkcs11h_certificate_freeCertificate (certificate);
+ certificate = NULL;
+ }
+
+ if (certificate_id != NULL) {
+ pkcs11h_certificate_freeCertificateId (certificate_id);
+ certificate_id = NULL;
+ }
+
+ dmsg (
+ D_PKCS11_DEBUG,
+ "PKCS#11: tls_ctx_use_pkcs11 - return ok=%d, rv=%ld",
+ ok ? 1 : 0,
+ rv
+ );
+
+ return ok ? 1 : 0;
+}
+
+static
+PKCS11H_BOOL
+_pkcs11_openvpn_show_pkcs11_ids_pin_prompt (
+ void * const global_data,
+ void * const user_data,
+ const pkcs11h_token_id_t token,
+ const unsigned retry,
+ char * const pin,
+ const size_t pin_max
+) {
+ struct gc_arena gc = gc_new ();
+ struct buffer pass_prompt = alloc_buf_gc (128, &gc);
+
+ (void)global_data;
+ (void)user_data;
+ (void)retry;
+
+ ASSERT (token!=NULL);
+
+ buf_printf (&pass_prompt, "Please enter '%s' token PIN or 'cancel': ", token->display);
+
+ if (!get_console_input (BSTR (&pass_prompt), false, pin, pin_max)) {
+ msg (M_FATAL, "Cannot read password from stdin");
+ }
+
+ gc_free (&gc);
+
+ if (!strcmp (pin, "cancel")) {
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+void
+show_pkcs11_ids (
+ const char * const provider,
+ bool cert_private
+) {
+ struct gc_arena gc = gc_new();
+ pkcs11h_certificate_id_list_t user_certificates = NULL;
+ pkcs11h_certificate_id_list_t current = NULL;
+ CK_RV rv = CKR_FUNCTION_FAILED;
+
+ if ((rv = pkcs11h_initialize ()) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot initialize %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setLogHook (_pkcs11_openvpn_log, NULL)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set hooks %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ pkcs11h_setLogLevel (_pkcs11_msg_openvpn2pkcs11 (get_debug_level ()));
+
+ if ((rv = pkcs11h_setProtectedAuthentication (TRUE)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set protected authentication %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if ((rv = pkcs11h_setPINPromptHook (_pkcs11_openvpn_show_pkcs11_ids_pin_prompt, NULL)) != CKR_OK) {
+ msg (M_FATAL, "PKCS#11: Cannot set PIN hook %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_addProvider (
+ provider,
+ provider,
+ TRUE,
+ 0,
+ FALSE,
+ 0,
+ cert_private ? TRUE : FALSE
+ )) != CKR_OK
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot add provider '%s' %ld-'%s'", provider, rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_enumCertificateIds (
+ PKCS11H_ENUM_METHOD_CACHE_EXIST,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ NULL,
+ &user_certificates
+ )) != CKR_OK
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot enumerate certificates %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup;
+ }
+
+ msg (
+ M_INFO|M_NOPREFIX|M_NOLF,
+ (
+ "\n"
+ "The following objects are available for use.\n"
+ "Each object shown below may be used as parameter to\n"
+ "--pkcs11-id option please remember to use single quote mark.\n"
+ )
+ );
+ for (current = user_certificates;current != NULL; current = current->next) {
+ pkcs11h_certificate_t certificate = NULL;
+ char *dn = NULL;
+ char serial[1024] = {0};
+ char *ser = NULL;
+ size_t ser_len = 0;
+
+ if (
+ (rv = pkcs11h_certificate_serializeCertificateId (
+ NULL,
+ &ser_len,
+ current->certificate_id
+ )) != CKR_OK
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot serialize certificate %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup1;
+ }
+
+ if (
+ rv == CKR_OK &&
+ (ser = (char *)malloc (ser_len)) == NULL
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot allocate memory");
+ goto cleanup1;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_serializeCertificateId (
+ ser,
+ &ser_len,
+ current->certificate_id
+ )) != CKR_OK
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot serialize certificate %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup1;
+ }
+
+ if (
+ (rv = pkcs11h_certificate_create (
+ current->certificate_id,
+ NULL,
+ PKCS11H_PROMPT_MASK_ALLOW_ALL,
+ PKCS11H_PIN_CACHE_INFINITE,
+ &certificate
+ ))
+ ) {
+ msg (M_FATAL, "PKCS#11: Cannot create certificate %ld-'%s'", rv, pkcs11h_getMessage (rv));
+ goto cleanup1;
+ }
+
+ if (
+ (dn = pkcs11_certificate_dn (
+ certificate,
+ &gc
+ )) == NULL
+ ) {
+ goto cleanup1;
+ }
+
+ if (
+ (pkcs11_certificate_serial (
+ certificate,
+ serial,
+ sizeof(serial)
+ ))
+ ) {
+ goto cleanup1;
+ }
+
+ msg (
+ M_INFO|M_NOPREFIX|M_NOLF,
+ (
+ "\n"
+ "Certificate\n"
+ " DN: %s\n"
+ " Serial: %s\n"
+ " Serialized id: %s\n"
+ ),
+ dn,
+ serial,
+ ser
+ );
+
+ cleanup1:
+
+ if (certificate != NULL) {
+ pkcs11h_certificate_freeCertificate (certificate);
+ certificate = NULL;
+ }
+
+ if (ser != NULL) {
+ free (ser);
+ ser = NULL;
+ }
+ }
+
+cleanup:
+ if (user_certificates != NULL) {
+ pkcs11h_certificate_freeCertificateIdList (user_certificates);
+ user_certificates = NULL;
+ }
+
+ pkcs11h_terminate ();
+ gc_free (&gc);
+}
+
+#else
+#ifdef _MSC_VER /* Dummy function needed to avoid empty file compiler warning in Microsoft VC */
+static void dummy (void) {}
+#endif
+#endif /* ENABLE_PKCS11 */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.h
new file mode 100644
index 00000000..4261871d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11.h
@@ -0,0 +1,80 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_PKCS11_H
+#define OPENVPN_PKCS11_H
+
+#if defined(ENABLE_PKCS11)
+
+#include "ssl_common.h"
+
+bool
+pkcs11_initialize (
+ const bool fProtectedAuthentication,
+ const int nPINCachePeriod
+);
+
+void
+pkcs11_terminate ();
+
+void
+pkcs11_forkFixup ();
+
+bool
+pkcs11_addProvider (
+ const char * const provider,
+ const bool fProtectedAuthentication,
+ const unsigned private_mode,
+ const bool fCertIsPrivate
+);
+
+int
+pkcs11_logout();
+
+int
+pkcs11_management_id_count ();
+
+bool
+pkcs11_management_id_get (
+ const int index,
+ char ** id,
+ char **base64
+);
+
+int
+tls_ctx_use_pkcs11 (
+ struct tls_root_ctx * const ssl_ctx,
+ bool pkcs11_id_management,
+ const char * const pkcs11_id
+);
+
+void
+show_pkcs11_ids (
+ const char * const provider,
+ bool cert_private
+);
+
+#endif /* ENABLE_PKCS11 */
+
+#endif /* OPENVPN_PKCS11H_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_backend.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_backend.h
new file mode 100644
index 00000000..7b7ec45b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_backend.h
@@ -0,0 +1,75 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file PKCS #11 SSL library-specific backend
+ */
+
+#ifndef PKCS11_BACKEND_H_
+#define PKCS11_BACKEND_H_
+
+#include "syshead.h"
+
+#if defined(ENABLE_PKCS11)
+
+#include "ssl_common.h"
+
+#include <pkcs11-helper-1.0/pkcs11h-certificate.h>
+
+/**
+ * Retrieve PKCS #11 Certificate's DN in a printable format.
+ *
+ * @param certificate The PKCS #11 helper certificate object
+ * @param gc Garbage collection pool to allocate memory in
+ *
+ * @return Certificate's DN on success, NULL on failure
+ */
+char * pkcs11_certificate_dn (pkcs11h_certificate_t certificate, struct gc_arena *gc);
+
+/**
+ * Retrieve PKCS #11 Certificate's serial number in a printable format.
+ *
+ * @param certificate The PKCS #11 helper certificate object
+ * @param serial Buffer that the certificate's serial will be placed in.
+ * @param serial_len Size of said buffer.
+ *
+ * @return 1 on failure, 0 on success
+ */
+int pkcs11_certificate_serial (pkcs11h_certificate_t certificate, char *serial,
+ size_t serial_len);
+
+/**
+ * Load PKCS #11 Certificate's information into the given TLS context
+ *
+ * @param certificate The PKCS #11 helper certificate object
+ * @param ssl_ctx TLS context to use.
+ *
+ * @return 1 on failure, 0 on success
+ */
+int pkcs11_init_tls_session(pkcs11h_certificate_t certificate,
+ struct tls_root_ctx * const ssl_ctx);
+
+#endif /* defined(ENABLE_PKCS11) */
+#endif /* PKCS11_BACKEND_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_openssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_openssl.c
new file mode 100644
index 00000000..87eb166e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_openssl.c
@@ -0,0 +1,192 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file PKCS #11 OpenSSL backend
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_PKCS11) && defined(ENABLE_CRYPTO_OPENSSL)
+
+#include "errlevel.h"
+#include "pkcs11_backend.h"
+#include "ssl_verify.h"
+#include <pkcs11-helper-1.0/pkcs11h-openssl.h>
+
+int
+pkcs11_init_tls_session(pkcs11h_certificate_t certificate,
+ struct tls_root_ctx * const ssl_ctx)
+{
+ int ret = 1;
+
+ X509 *x509 = NULL;
+ EVP_PKEY *evp = NULL;
+ pkcs11h_openssl_session_t openssl_session = NULL;
+
+ if ((openssl_session = pkcs11h_openssl_createSession (certificate)) == NULL)
+ {
+ msg (M_WARN, "PKCS#11: Cannot initialize openssl session");
+ goto cleanup;
+ }
+
+ /*
+ * Will be released by openssl_session
+ */
+ certificate = NULL;
+
+ if ((evp = pkcs11h_openssl_session_getEVP (openssl_session)) == NULL)
+ {
+ msg (M_WARN, "PKCS#11: Unable get evp object");
+ goto cleanup;
+ }
+
+ if ((x509 = pkcs11h_openssl_session_getX509 (openssl_session)) == NULL)
+ {
+ msg (M_WARN, "PKCS#11: Unable get certificate object");
+ goto cleanup;
+ }
+
+ if (!SSL_CTX_use_PrivateKey (ssl_ctx->ctx, evp))
+ {
+ msg (M_WARN, "PKCS#11: Cannot set private key for openssl");
+ goto cleanup;
+ }
+
+ if (!SSL_CTX_use_certificate (ssl_ctx->ctx, x509))
+ {
+ msg (M_WARN, "PKCS#11: Cannot set certificate for openssl");
+ goto cleanup;
+ }
+ ret = 0;
+
+cleanup:
+ /*
+ * Certificate freeing is usually handled by openssl_session.
+ * If something went wrong, creating the session we have to do it manually.
+ */
+ if (certificate != NULL) {
+ pkcs11h_certificate_freeCertificate (certificate);
+ certificate = NULL;
+ }
+
+ /*
+ * openssl objects have reference
+ * count, so release them
+ */
+ if (x509 != NULL)
+ {
+ X509_free (x509);
+ x509 = NULL;
+ }
+
+ if (evp != NULL)
+ {
+ EVP_PKEY_free (evp);
+ evp = NULL;
+ }
+
+ if (openssl_session != NULL)
+ {
+ pkcs11h_openssl_freeSession (openssl_session);
+ openssl_session = NULL;
+ }
+ return ret;
+}
+
+char *
+pkcs11_certificate_dn (pkcs11h_certificate_t certificate, struct gc_arena *gc)
+{
+ X509 *x509 = NULL;
+
+ char *dn = NULL;
+
+ if ((x509 = pkcs11h_openssl_getX509 (certificate)) == NULL)
+ {
+ msg (M_FATAL, "PKCS#11: Cannot get X509");
+ goto cleanup;
+ }
+
+ dn = x509_get_subject (x509, gc);
+
+cleanup:
+ if (x509 != NULL)
+ {
+ X509_free (x509);
+ x509 = NULL;
+ }
+
+ return dn;
+}
+
+int
+pkcs11_certificate_serial (pkcs11h_certificate_t certificate, char *serial,
+ size_t serial_len)
+{
+ X509 *x509 = NULL;
+ BIO *bio = NULL;
+ int ret = 1;
+ int n;
+
+ if ((x509 = pkcs11h_openssl_getX509 (certificate)) == NULL)
+ {
+ msg (M_FATAL, "PKCS#11: Cannot get X509");
+ goto cleanup;
+ }
+
+ if ((bio = BIO_new (BIO_s_mem ())) == NULL)
+ {
+ msg (M_FATAL, "PKCS#11: Cannot create BIO");
+ goto cleanup;
+ }
+
+ i2a_ASN1_INTEGER(bio, X509_get_serialNumber (x509));
+ n = BIO_read (bio, serial, serial_len-1);
+
+ if (n<0) {
+ serial[0] = '\x0';
+ }
+ else {
+ serial[n] = 0;
+ }
+
+ ret = 0;
+
+cleanup:
+
+ if (x509 != NULL)
+ {
+ X509_free (x509);
+ x509 = NULL;
+ }
+ return ret;
+}
+#endif /* defined(ENABLE_PKCS11) && defined(ENABLE_OPENSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_polarssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_polarssl.c
new file mode 100644
index 00000000..be4e9737
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pkcs11_polarssl.c
@@ -0,0 +1,127 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file PKCS #11 PolarSSL backend
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_PKCS11) && defined(ENABLE_CRYPTO_POLARSSL)
+
+#include "errlevel.h"
+#include "pkcs11_backend.h"
+#include <polarssl/pkcs11.h>
+#include <polarssl/x509.h>
+
+int
+pkcs11_init_tls_session(pkcs11h_certificate_t certificate,
+ struct tls_root_ctx * const ssl_ctx)
+{
+ int ret = 1;
+
+ ASSERT (NULL != ssl_ctx);
+
+ if (pkcs11_x509_cert_init(ssl_ctx->crt_chain, certificate)) {
+ msg (M_FATAL, "PKCS#11: Cannot retrieve PolarSSL certificate object");
+ goto cleanup;
+ }
+
+ ssl_ctx->priv_key_pkcs11 = malloc(sizeof(pkcs11_context));
+
+ if (ssl_ctx->priv_key_pkcs11 == NULL) {
+ msg (M_FATAL, "PKCS#11: Cannot allocate PolarSSL private key object");
+ goto cleanup;
+ }
+
+ if (pkcs11_priv_key_init(ssl_ctx->priv_key_pkcs11, certificate)) {
+ msg (M_FATAL, "PKCS#11: Cannot initialize PolarSSL private key object");
+ goto cleanup;
+ }
+
+ ret = 0;
+
+cleanup:
+ return ret;
+}
+
+char *
+pkcs11_certificate_dn (pkcs11h_certificate_t cert, struct gc_arena *gc)
+{
+ char *ret = NULL;
+ char dn[1024] = {0};
+
+ x509_crt polar_cert = {0};
+
+ if (pkcs11_x509_cert_init(&polar_cert, cert)) {
+ msg (M_FATAL, "PKCS#11: Cannot retrieve PolarSSL certificate object");
+ goto cleanup;
+ }
+
+ if (-1 == x509_dn_gets (dn, sizeof(dn), &polar_cert.subject)) {
+ msg (M_FATAL, "PKCS#11: PolarSSL cannot parse subject");
+ goto cleanup;
+ }
+
+ ret = string_alloc(dn, gc);
+
+cleanup:
+ x509_crt_free(&polar_cert);
+
+ return ret;
+}
+
+int
+pkcs11_certificate_serial (pkcs11h_certificate_t cert, char *serial,
+ size_t serial_len)
+{
+ int ret = 1;
+
+ x509_crt polar_cert = {0};
+
+ if (pkcs11_x509_cert_init(&polar_cert, cert)) {
+ msg (M_FATAL, "PKCS#11: Cannot retrieve PolarSSL certificate object");
+ goto cleanup;
+ }
+
+ if (-1 == x509_serial_gets (serial, serial_len, &polar_cert.serial)) {
+ msg (M_FATAL, "PKCS#11: PolarSSL cannot parse serial");
+ goto cleanup;
+ }
+
+ ret = 0;
+
+cleanup:
+ x509_crt_free(&polar_cert);
+
+ return ret;
+}
+#endif /* defined(ENABLE_PKCS11) && defined(ENABLE_CRYPTO_POLARSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.c
new file mode 100644
index 00000000..16d4daca
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.c
@@ -0,0 +1,316 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "win32.h"
+
+#include "memdbg.h"
+
+#include "platform.h"
+
+/* Redefine the top level directory of the filesystem
+ to restrict access to files for security */
+void
+platform_chroot (const char *path)
+{
+ if (path)
+ {
+#ifdef HAVE_CHROOT
+ const char *top = "/";
+ if (chroot (path))
+ msg (M_ERR, "chroot to '%s' failed", path);
+ if (platform_chdir (top))
+ msg (M_ERR, "cd to '%s' failed", top);
+ msg (M_INFO, "chroot to '%s' and cd to '%s' succeeded", path, top);
+#else
+ msg (M_FATAL, "Sorry but I can't chroot to '%s' because this operating system doesn't appear to support the chroot() system call", path);
+#endif
+ }
+}
+
+/* Get/Set UID of process */
+
+bool
+platform_user_get (const char *username, struct platform_state_user *state)
+{
+ bool ret = false;
+ CLEAR (*state);
+ if (username)
+ {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+ state->pw = getpwnam (username);
+ if (!state->pw)
+ msg (M_ERR, "failed to find UID for user %s", username);
+ state->username = username;
+ ret = true;
+#else
+ msg (M_FATAL, "cannot get UID for user %s -- platform lacks getpwname() or setuid() system calls", username);
+#endif
+ }
+ return ret;
+}
+
+void
+platform_user_set (const struct platform_state_user *state)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+ if (state->username && state->pw)
+ {
+ if (setuid (state->pw->pw_uid))
+ msg (M_ERR, "setuid('%s') failed", state->username);
+ msg (M_INFO, "UID set to %s", state->username);
+ }
+#endif
+}
+
+/* Get/Set GID of process */
+
+bool
+platform_group_get (const char *groupname, struct platform_state_group *state)
+{
+ bool ret = false;
+ CLEAR (*state);
+ if (groupname)
+ {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+ state->gr = getgrnam (groupname);
+ if (!state->gr)
+ msg (M_ERR, "failed to find GID for group %s", groupname);
+ state->groupname = groupname;
+ ret = true;
+#else
+ msg (M_FATAL, "cannot get GID for group %s -- platform lacks getgrnam() or setgid() system calls", groupname);
+#endif
+ }
+ return ret;
+}
+
+void
+platform_group_set (const struct platform_state_group *state)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+ if (state->groupname && state->gr)
+ {
+ if (setgid (state->gr->gr_gid))
+ msg (M_ERR, "setgid('%s') failed", state->groupname);
+ msg (M_INFO, "GID set to %s", state->groupname);
+#ifdef HAVE_SETGROUPS
+ {
+ gid_t gr_list[1];
+ gr_list[0] = state->gr->gr_gid;
+ if (setgroups (1, gr_list))
+ msg (M_ERR, "setgroups('%s') failed", state->groupname);
+ }
+#endif
+ }
+#endif
+}
+
+/* Change process priority */
+void
+platform_nice (int niceval)
+{
+ if (niceval)
+ {
+#ifdef HAVE_NICE
+ errno = 0;
+ if (nice (niceval) < 0 && errno != 0)
+ msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
+ else
+ msg (M_INFO, "nice %d succeeded", niceval);
+#else
+ msg (M_WARN, "WARNING: nice %d failed (function not implemented)", niceval);
+#endif
+ }
+}
+
+/* Get current PID */
+unsigned int
+platform_getpid ()
+{
+#ifdef WIN32
+ return (unsigned int) GetCurrentProcessId ();
+#else
+#ifdef HAVE_GETPID
+ return (unsigned int) getpid ();
+#else
+ return 0;
+#endif
+#endif
+}
+
+/* Disable paging */
+void
+platform_mlockall(bool print_msg)
+{
+#ifdef HAVE_MLOCKALL
+ if (mlockall (MCL_CURRENT | MCL_FUTURE))
+ msg (M_WARN | M_ERRNO, "WARNING: mlockall call failed");
+ else if (print_msg)
+ msg (M_INFO, "mlockall call succeeded");
+#else
+ msg (M_WARN, "WARNING: mlockall call failed (function not implemented)");
+#endif
+}
+
+/*
+ * Wrapper for chdir library function
+ */
+int
+platform_chdir (const char* dir)
+{
+#ifdef HAVE_CHDIR
+#ifdef WIN32
+ int res;
+ struct gc_arena gc = gc_new ();
+ res = _wchdir (wide_string (dir, &gc));
+ gc_free (&gc);
+ return res;
+#else
+ return chdir (dir);
+#endif
+#else
+ return -1;
+#endif
+}
+
+/*
+ * convert execve() return into a success/failure value
+ */
+bool
+platform_system_ok (int stat)
+{
+#ifdef WIN32
+ return stat == 0;
+#else
+ return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
+#endif
+}
+
+int
+platform_access (const char *path, int mode)
+{
+#ifdef WIN32
+ struct gc_arena gc = gc_new ();
+ int ret = _waccess (wide_string (path, &gc), mode & ~X_OK);
+ gc_free (&gc);
+ return ret;
+#else
+ return access (path, mode);
+#endif
+}
+
+/*
+ * Go to sleep for n milliseconds.
+ */
+void
+platform_sleep_milliseconds (unsigned int n)
+{
+#ifdef WIN32
+ Sleep (n);
+#else
+ struct timeval tv;
+ tv.tv_sec = n / 1000;
+ tv.tv_usec = (n % 1000) * 1000;
+ select (0, NULL, NULL, NULL, &tv);
+#endif
+}
+
+/*
+ * Go to sleep indefinitely.
+ */
+void
+platform_sleep_until_signal (void)
+{
+#ifdef WIN32
+ ASSERT (0);
+#else
+ select (0, NULL, NULL, NULL, NULL);
+#endif
+}
+
+/* delete a file, return true if succeeded */
+bool
+platform_unlink (const char *filename)
+{
+#if defined(WIN32)
+ struct gc_arena gc = gc_new ();
+ BOOL ret = DeleteFileW (wide_string (filename, &gc));
+ gc_free (&gc);
+ return (ret != 0);
+#elif defined(HAVE_UNLINK)
+ return (unlink (filename) == 0);
+#else
+ return false;
+#endif
+}
+
+FILE *
+platform_fopen (const char *path, const char *mode)
+{
+#ifdef WIN32
+ struct gc_arena gc = gc_new ();
+ FILE *f = _wfopen (wide_string (path, &gc), wide_string (mode, &gc));
+ gc_free (&gc);
+ return f;
+#else
+ return fopen(path, mode);
+#endif
+}
+
+int
+platform_open (const char *path, int flags, int mode)
+{
+#ifdef WIN32
+ struct gc_arena gc = gc_new ();
+ int fd = _wopen (wide_string (path, &gc), flags, mode);
+ gc_free (&gc);
+ return fd;
+#else
+ return open(path, flags, mode);
+#endif
+}
+
+int
+platform_stat (const char *path, platform_stat_t *buf)
+{
+#ifdef WIN32
+ struct gc_arena gc = gc_new ();
+ int res = _wstat (wide_string (path, &gc), buf);
+ gc_free (&gc);
+ return res;
+#else
+ return stat(path, buf);
+#endif
+}
+
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.h
new file mode 100644
index 00000000..7c0a4d72
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/platform.h
@@ -0,0 +1,140 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#include "basic.h"
+
+/* Get/Set UID of process */
+
+struct platform_state_user {
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+ const char *username;
+ struct passwd *pw;
+#else
+ int dummy;
+#endif
+};
+
+/* Get/Set GID of process */
+
+struct platform_state_group {
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+ const char *groupname;
+ struct group *gr;
+#else
+ int dummy;
+#endif
+};
+
+bool platform_user_get (const char *username, struct platform_state_user *state);
+void platform_user_set (const struct platform_state_user *state);
+
+bool platform_group_get (const char *groupname, struct platform_state_group *state);
+void platform_group_set (const struct platform_state_group *state);
+
+/*
+ * Extract UID or GID
+ */
+
+static inline int
+platform_state_user_uid (const struct platform_state_user *s)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_SETUID)
+ if (s->pw)
+ return s->pw->pw_uid;
+#endif
+ return -1;
+}
+
+static inline int
+platform_state_group_gid (const struct platform_state_group *s)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_SETGID)
+ if (s->gr)
+ return s->gr->gr_gid;
+#endif
+ return -1;
+}
+
+void platform_chroot (const char *path);
+
+void platform_nice (int niceval);
+
+unsigned int platform_getpid (void);
+
+void platform_mlockall (bool print_msg); /* Disable paging */
+
+int platform_chdir (const char* dir);
+
+/* interpret the status code returned by execve() */
+bool platform_system_ok (int stat);
+
+int platform_access (const char *path, int mode);
+
+void platform_sleep_milliseconds (unsigned int n);
+
+void platform_sleep_until_signal (void);
+
+/* delete a file, return true if succeeded */
+bool platform_unlink (const char *filename);
+
+int platform_putenv (char *string);
+
+FILE *platform_fopen (const char *path, const char *mode);
+int platform_open (const char *path, int flags, int mode);
+
+#ifdef WIN32
+typedef struct _stat platform_stat_t;
+#else
+typedef struct stat platform_stat_t;
+#endif
+int platform_stat (const char *path, platform_stat_t *buf);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.c
new file mode 100644
index 00000000..0948f238
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.c
@@ -0,0 +1,872 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef ENABLE_PLUGIN
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include "buffer.h"
+#include "error.h"
+#include "misc.h"
+#include "plugin.h"
+#include "ssl_backend.h"
+#include "win32.h"
+#include "memdbg.h"
+
+#define PLUGIN_SYMBOL_REQUIRED (1<<0)
+
+/* used only for program aborts */
+static struct plugin_common *static_plugin_common = NULL; /* GLOBAL */
+
+static void
+plugin_show_string_array (int msglevel, const char *name, const char *array[])
+{
+ int i;
+ for (i = 0; array[i]; ++i)
+ {
+ if (env_safe_to_print (array[i]))
+ msg (msglevel, "%s[%d] = '%s'", name, i, array[i]);
+ }
+}
+
+static void
+plugin_show_args_env (int msglevel, const char *argv[], const char *envp[])
+{
+ if (check_debug_level (msglevel))
+ {
+ plugin_show_string_array (msglevel, "ARGV", argv);
+ plugin_show_string_array (msglevel, "ENVP", envp);
+ }
+}
+
+static const char *
+plugin_type_name (const int type)
+{
+ switch (type)
+ {
+ case OPENVPN_PLUGIN_UP:
+ return "PLUGIN_UP";
+ case OPENVPN_PLUGIN_DOWN:
+ return "PLUGIN_DOWN";
+ case OPENVPN_PLUGIN_ROUTE_UP:
+ return "PLUGIN_ROUTE_UP";
+ case OPENVPN_PLUGIN_IPCHANGE:
+ return "PLUGIN_IPCHANGE";
+ case OPENVPN_PLUGIN_TLS_VERIFY:
+ return "PLUGIN_TLS_VERIFY";
+ case OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY:
+ return "PLUGIN_AUTH_USER_PASS_VERIFY";
+ case OPENVPN_PLUGIN_CLIENT_CONNECT:
+ return "PLUGIN_CLIENT_CONNECT";
+ case OPENVPN_PLUGIN_CLIENT_CONNECT_V2:
+ return "PLUGIN_CLIENT_CONNECT";
+ case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
+ return "PLUGIN_CLIENT_DISCONNECT";
+ case OPENVPN_PLUGIN_LEARN_ADDRESS:
+ return "PLUGIN_LEARN_ADDRESS";
+ case OPENVPN_PLUGIN_TLS_FINAL:
+ return "PLUGIN_TLS_FINAL";
+ case OPENVPN_PLUGIN_ENABLE_PF:
+ return "PLUGIN_ENABLE_PF";
+ case OPENVPN_PLUGIN_ROUTE_PREDOWN:
+ return "PLUGIN_ROUTE_PREDOWN";
+ default:
+ return "PLUGIN_???";
+ }
+}
+
+static const char *
+plugin_mask_string (const unsigned int type_mask, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ bool first = true;
+ int i;
+
+ for (i = 0; i < OPENVPN_PLUGIN_N; ++i)
+ {
+ if (OPENVPN_PLUGIN_MASK (i) & type_mask)
+ {
+ if (!first)
+ buf_printf (&out, "|");
+ buf_printf (&out, "%s", plugin_type_name (i));
+ first = false;
+ }
+ }
+ return BSTR (&out);
+}
+
+static inline unsigned int
+plugin_supported_types (void)
+{
+ return ((1<<OPENVPN_PLUGIN_N)-1);
+}
+
+struct plugin_option_list *
+plugin_option_list_new (struct gc_arena *gc)
+{
+ struct plugin_option_list *ret;
+ ALLOC_OBJ_CLEAR_GC (ret, struct plugin_option_list, gc);
+ return ret;
+}
+
+bool
+plugin_option_list_add (struct plugin_option_list *list, char **p, struct gc_arena *gc)
+{
+ if (list->n < MAX_PLUGINS)
+ {
+ struct plugin_option *o = &list->plugins[list->n++];
+ o->argv = make_extended_arg_array (p, gc);
+ if (o->argv[0])
+ o->so_pathname = o->argv[0];
+ return true;
+ }
+ else
+ return false;
+}
+
+#ifndef ENABLE_SMALL
+void
+plugin_option_list_print (const struct plugin_option_list *list, int msglevel)
+{
+ int i;
+ struct gc_arena gc = gc_new ();
+
+ for (i = 0; i < list->n; ++i)
+ {
+ const struct plugin_option *o = &list->plugins[i];
+ msg (msglevel, " plugin[%d] %s '%s'", i, o->so_pathname, print_argv (o->argv, &gc, PA_BRACKET));
+ }
+
+ gc_free (&gc);
+}
+#endif
+
+#ifndef WIN32
+
+static void
+libdl_resolve_symbol (void *handle, void **dest, const char *symbol, const char *plugin_name, const unsigned int flags)
+{
+ *dest = dlsym (handle, symbol);
+ if ((flags & PLUGIN_SYMBOL_REQUIRED) && !*dest)
+ msg (M_FATAL, "PLUGIN: could not find required symbol '%s' in plugin shared object %s: %s", symbol, plugin_name, dlerror());
+}
+
+#else
+
+static void
+dll_resolve_symbol (HMODULE module, void **dest, const char *symbol, const char *plugin_name, const unsigned int flags)
+{
+ *dest = GetProcAddress (module, symbol);
+ if ((flags & PLUGIN_SYMBOL_REQUIRED) && !*dest)
+ msg (M_FATAL, "PLUGIN: could not find required symbol '%s' in plugin DLL %s", symbol, plugin_name);
+}
+
+#endif
+
+static void
+plugin_init_item (struct plugin *p, const struct plugin_option *o)
+{
+ struct gc_arena gc = gc_new ();
+ bool rel = false;
+
+ p->so_pathname = o->so_pathname;
+ p->plugin_type_mask = plugin_supported_types ();
+
+#ifndef WIN32
+
+ p->handle = NULL;
+#if defined(PLUGIN_LIBDIR)
+ if (!absolute_pathname (p->so_pathname))
+ {
+ char full[PATH_MAX];
+
+ openvpn_snprintf (full, sizeof(full), "%s/%s", PLUGIN_LIBDIR, p->so_pathname);
+ p->handle = dlopen (full, RTLD_NOW);
+#if defined(ENABLE_PLUGIN_SEARCH)
+ if (!p->handle)
+ {
+ rel = true;
+ p->handle = dlopen (p->so_pathname, RTLD_NOW);
+ }
+#endif
+ }
+ else
+#endif
+ {
+ rel = !absolute_pathname (p->so_pathname);
+ p->handle = dlopen (p->so_pathname, RTLD_NOW);
+ }
+ if (!p->handle)
+ msg (M_ERR, "PLUGIN_INIT: could not load plugin shared object %s: %s", p->so_pathname, dlerror());
+
+# define PLUGIN_SYM(var, name, flags) libdl_resolve_symbol (p->handle, (void*)&p->var, name, p->so_pathname, flags)
+
+#else
+
+ rel = !absolute_pathname (p->so_pathname);
+ p->module = LoadLibraryW (wide_string (p->so_pathname, &gc));
+ if (!p->module)
+ msg (M_ERR, "PLUGIN_INIT: could not load plugin DLL: %s", p->so_pathname);
+
+# define PLUGIN_SYM(var, name, flags) dll_resolve_symbol (p->module, (void*)&p->var, name, p->so_pathname, flags)
+
+#endif
+
+ PLUGIN_SYM (open1, "openvpn_plugin_open_v1", 0);
+ PLUGIN_SYM (open2, "openvpn_plugin_open_v2", 0);
+ PLUGIN_SYM (open3, "openvpn_plugin_open_v3", 0);
+ PLUGIN_SYM (func1, "openvpn_plugin_func_v1", 0);
+ PLUGIN_SYM (func2, "openvpn_plugin_func_v2", 0);
+ PLUGIN_SYM (func3, "openvpn_plugin_func_v3", 0);
+ PLUGIN_SYM (close, "openvpn_plugin_close_v1", PLUGIN_SYMBOL_REQUIRED);
+ PLUGIN_SYM (abort, "openvpn_plugin_abort_v1", 0);
+ PLUGIN_SYM (client_constructor, "openvpn_plugin_client_constructor_v1", 0);
+ PLUGIN_SYM (client_destructor, "openvpn_plugin_client_destructor_v1", 0);
+ PLUGIN_SYM (min_version_required, "openvpn_plugin_min_version_required_v1", 0);
+ PLUGIN_SYM (initialization_point, "openvpn_plugin_select_initialization_point_v1", 0);
+
+ if (!p->open1 && !p->open2 && !p->open3)
+ msg (M_FATAL, "PLUGIN: symbol openvpn_plugin_open_vX is undefined in plugin: %s", p->so_pathname);
+
+ if (!p->func1 && !p->func2 && !p->func3)
+ msg (M_FATAL, "PLUGIN: symbol openvpn_plugin_func_vX is undefined in plugin: %s", p->so_pathname);
+
+ /*
+ * Verify that we are sufficiently up-to-date to handle the plugin
+ */
+ if (p->min_version_required)
+ {
+ const int plugin_needs_version = (*p->min_version_required)();
+ if (plugin_needs_version > OPENVPN_PLUGIN_VERSION)
+ msg (M_FATAL, "PLUGIN_INIT: plugin needs interface version %d, but this version of OpenVPN only supports version %d: %s",
+ plugin_needs_version,
+ OPENVPN_PLUGIN_VERSION,
+ p->so_pathname);
+ }
+
+ if (p->initialization_point)
+ p->requested_initialization_point = (*p->initialization_point)();
+ else
+ p->requested_initialization_point = OPENVPN_PLUGIN_INIT_PRE_DAEMON;
+
+ if (rel)
+ msg (M_WARN, "WARNING: plugin '%s' specified by a relative pathname -- using an absolute pathname would be more secure", p->so_pathname);
+
+ p->initialized = true;
+
+ gc_free (&gc);
+}
+
+static void
+plugin_vlog (openvpn_plugin_log_flags_t flags, const char *name, const char *format, va_list arglist)
+{
+ unsigned int msg_flags;
+
+ if (!format)
+ return;
+
+ if (!name || name[0] == '\0')
+ {
+ msg (D_PLUGIN_DEBUG, "PLUGIN: suppressed log message from plugin with unknown name");
+ return;
+ }
+
+ if (flags & PLOG_ERR)
+ msg_flags = M_INFO | M_NONFATAL;
+ else if (flags & PLOG_WARN)
+ msg_flags = M_INFO | M_WARN;
+ else if (flags & PLOG_NOTE)
+ msg_flags = M_INFO;
+ else if (flags & PLOG_DEBUG)
+ msg_flags = D_PLUGIN_DEBUG;
+
+ if (flags & PLOG_ERRNO)
+ msg_flags |= M_ERRNO;
+ if (flags & PLOG_NOMUTE)
+ msg_flags |= M_NOMUTE;
+
+ if (MSG_TEST (msg_flags))
+ {
+ struct gc_arena gc;
+ char* msg_fmt;
+
+ /* Never add instance prefix; not thread safe */
+ msg_flags |= M_NOIPREFIX;
+
+ gc_init (&gc);
+ msg_fmt = gc_malloc (ERR_BUF_SIZE, false, &gc);
+ openvpn_snprintf (msg_fmt, ERR_BUF_SIZE, "PLUGIN %s: %s", name, format);
+ x_msg_va (msg_flags, msg_fmt, arglist);
+
+ gc_free (&gc);
+ }
+}
+
+static void
+plugin_log (openvpn_plugin_log_flags_t flags, const char *name, const char *format, ...)
+{
+ va_list arglist;
+ va_start (arglist, format);
+ plugin_vlog (flags, name, format, arglist);
+ va_end (arglist);
+}
+
+static struct openvpn_plugin_callbacks callbacks = {
+ plugin_log,
+ plugin_vlog
+};
+
+static void
+plugin_open_item (struct plugin *p,
+ const struct plugin_option *o,
+ struct openvpn_plugin_string_list **retlist,
+ const char **envp,
+ const int init_point)
+{
+ ASSERT (p->initialized);
+
+ /* clear return list */
+ if (retlist)
+ *retlist = NULL;
+
+ if (!p->plugin_handle && init_point == p->requested_initialization_point)
+ {
+ struct gc_arena gc = gc_new ();
+
+ dmsg (D_PLUGIN_DEBUG, "PLUGIN_INIT: PRE");
+ plugin_show_args_env (D_PLUGIN_DEBUG, o->argv, envp);
+
+ /*
+ * Call the plugin initialization
+ */
+ if (p->open3) {
+ struct openvpn_plugin_args_open_in args = { p->plugin_type_mask,
+ (const char ** const) o->argv,
+ (const char ** const) envp,
+ &callbacks,
+ SSLAPI };
+ struct openvpn_plugin_args_open_return retargs;
+
+ CLEAR(retargs);
+ retargs.return_list = retlist;
+ if ((*p->open3)(OPENVPN_PLUGINv3_STRUCTVER, &args, &retargs) == OPENVPN_PLUGIN_FUNC_SUCCESS) {
+ p->plugin_type_mask = retargs.type_mask;
+ p->plugin_handle = retargs.handle;
+ } else {
+ p->plugin_handle = NULL;
+ }
+ } else if (p->open2)
+ p->plugin_handle = (*p->open2)(&p->plugin_type_mask, o->argv, envp, retlist);
+ else if (p->open1)
+ p->plugin_handle = (*p->open1)(&p->plugin_type_mask, o->argv, envp);
+ else
+ ASSERT (0);
+
+ msg (D_PLUGIN, "PLUGIN_INIT: POST %s '%s' intercepted=%s %s",
+ p->so_pathname,
+ print_argv (o->argv, &gc, PA_BRACKET),
+ plugin_mask_string (p->plugin_type_mask, &gc),
+ (retlist && *retlist) ? "[RETLIST]" : "");
+
+ if ((p->plugin_type_mask | plugin_supported_types()) != plugin_supported_types())
+ msg (M_FATAL, "PLUGIN_INIT: plugin %s expressed interest in unsupported plugin types: [want=0x%08x, have=0x%08x]",
+ p->so_pathname,
+ p->plugin_type_mask,
+ plugin_supported_types());
+
+ if (p->plugin_handle == NULL)
+ msg (M_FATAL, "PLUGIN_INIT: plugin initialization function failed: %s",
+ p->so_pathname);
+
+ gc_free (&gc);
+ }
+}
+
+static int
+plugin_call_item (const struct plugin *p,
+ void *per_client_context,
+ const int type,
+ const struct argv *av,
+ struct openvpn_plugin_string_list **retlist,
+ const char **envp
+#ifdef ENABLE_SSL
+ , int certdepth,
+ openvpn_x509_cert_t *current_cert
+#endif
+ )
+{
+ int status = OPENVPN_PLUGIN_FUNC_SUCCESS;
+
+ /* clear return list */
+ if (retlist)
+ *retlist = NULL;
+
+ if (p->plugin_handle && (p->plugin_type_mask & OPENVPN_PLUGIN_MASK (type)))
+ {
+ struct gc_arena gc = gc_new ();
+ struct argv a = argv_insert_head (av, p->so_pathname);
+
+ dmsg (D_PLUGIN_DEBUG, "PLUGIN_CALL: PRE type=%s", plugin_type_name (type));
+ plugin_show_args_env (D_PLUGIN_DEBUG, (const char **)a.argv, envp);
+
+ /*
+ * Call the plugin work function
+ */
+ if (p->func3) {
+ struct openvpn_plugin_args_func_in args = { type,
+ (const char ** const) a.argv,
+ (const char ** const) envp,
+ p->plugin_handle,
+ per_client_context,
+#ifdef ENABLE_SSL
+ (current_cert ? certdepth : -1),
+ current_cert
+#else
+ -1,
+ NULL
+#endif
+ };
+
+ struct openvpn_plugin_args_func_return retargs;
+
+ CLEAR(retargs);
+ retargs.return_list = retlist;
+ status = (*p->func3)(OPENVPN_PLUGINv3_STRUCTVER, &args, &retargs);
+ } else if (p->func2)
+ status = (*p->func2)(p->plugin_handle, type, (const char **)a.argv, envp, per_client_context, retlist);
+ else if (p->func1)
+ status = (*p->func1)(p->plugin_handle, type, (const char **)a.argv, envp);
+ else
+ ASSERT (0);
+
+ msg (D_PLUGIN, "PLUGIN_CALL: POST %s/%s status=%d",
+ p->so_pathname,
+ plugin_type_name (type),
+ status);
+
+ if (status == OPENVPN_PLUGIN_FUNC_ERROR)
+ msg (M_WARN, "PLUGIN_CALL: plugin function %s failed with status %d: %s",
+ plugin_type_name (type),
+ status,
+ p->so_pathname);
+
+ argv_reset (&a);
+ gc_free (&gc);
+ }
+ return status;
+}
+
+static void
+plugin_close_item (struct plugin *p)
+{
+ if (p->initialized)
+ {
+ msg (D_PLUGIN, "PLUGIN_CLOSE: %s", p->so_pathname);
+
+ /*
+ * Call the plugin close function
+ */
+ if (p->plugin_handle)
+ (*p->close)(p->plugin_handle);
+
+#ifndef WIN32
+ if (dlclose (p->handle))
+ msg (M_WARN, "PLUGIN_CLOSE: dlclose() failed on plugin: %s", p->so_pathname);
+#elif defined(WIN32)
+ if (!FreeLibrary (p->module))
+ msg (M_WARN, "PLUGIN_CLOSE: FreeLibrary() failed on plugin: %s", p->so_pathname);
+#endif
+
+ p->initialized = false;
+ }
+}
+
+static void
+plugin_abort_item (const struct plugin *p)
+{
+ /*
+ * Call the plugin abort function
+ */
+ if (p->abort)
+ (*p->abort)(p->plugin_handle);
+}
+
+static void
+plugin_per_client_init (const struct plugin_common *pc,
+ struct plugin_per_client *cli,
+ const int init_point)
+{
+ const int n = pc->n;
+ int i;
+
+ for (i = 0; i < n; ++i)
+ {
+ const struct plugin *p = &pc->plugins[i];
+ if (p->plugin_handle
+ && (init_point < 0 || init_point == p->requested_initialization_point)
+ && p->client_constructor)
+ cli->per_client_context[i] = (*p->client_constructor)(p->plugin_handle);
+ }
+}
+
+static void
+plugin_per_client_destroy (const struct plugin_common *pc, struct plugin_per_client *cli)
+{
+ const int n = pc->n;
+ int i;
+
+ for (i = 0; i < n; ++i)
+ {
+ const struct plugin *p = &pc->plugins[i];
+ void *cc = cli->per_client_context[i];
+
+ if (p->client_destructor && cc)
+ (*p->client_destructor)(p->plugin_handle, cc);
+ }
+ CLEAR (*cli);
+}
+
+struct plugin_list *
+plugin_list_inherit (const struct plugin_list *src)
+{
+ struct plugin_list *pl;
+ ALLOC_OBJ_CLEAR (pl, struct plugin_list);
+ pl->common = src->common;
+ ASSERT (pl->common);
+ plugin_per_client_init (pl->common, &pl->per_client, -1);
+ return pl;
+}
+
+static struct plugin_common *
+plugin_common_init (const struct plugin_option_list *list)
+{
+ int i;
+ struct plugin_common *pc;
+
+ ALLOC_OBJ_CLEAR (pc, struct plugin_common);
+
+ for (i = 0; i < list->n; ++i)
+ {
+ plugin_init_item (&pc->plugins[i],
+ &list->plugins[i]);
+ pc->n = i + 1;
+ }
+
+ static_plugin_common = pc;
+ return pc;
+}
+
+static void
+plugin_common_open (struct plugin_common *pc,
+ const struct plugin_option_list *list,
+ struct plugin_return *pr,
+ const struct env_set *es,
+ const int init_point)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ const char **envp;
+
+ envp = make_env_array (es, false, &gc);
+
+ if (pr)
+ plugin_return_init (pr);
+
+ for (i = 0; i < pc->n; ++i)
+ {
+ plugin_open_item (&pc->plugins[i],
+ &list->plugins[i],
+ pr ? &pr->list[i] : NULL,
+ envp,
+ init_point);
+ }
+
+ if (pr)
+ pr->n = i;
+
+ gc_free (&gc);
+}
+
+static void
+plugin_common_close (struct plugin_common *pc)
+{
+ static_plugin_common = NULL;
+ if (pc)
+ {
+ int i;
+
+ for (i = 0; i < pc->n; ++i)
+ plugin_close_item (&pc->plugins[i]);
+ free (pc);
+ }
+}
+
+struct plugin_list *
+plugin_list_init (const struct plugin_option_list *list)
+{
+ struct plugin_list *pl;
+ ALLOC_OBJ_CLEAR (pl, struct plugin_list);
+ pl->common = plugin_common_init (list);
+ pl->common_owned = true;
+ return pl;
+}
+
+void
+plugin_list_open (struct plugin_list *pl,
+ const struct plugin_option_list *list,
+ struct plugin_return *pr,
+ const struct env_set *es,
+ const int init_point)
+{
+ plugin_common_open (pl->common, list, pr, es, init_point);
+ plugin_per_client_init (pl->common, &pl->per_client, init_point);
+}
+
+int
+plugin_call_ssl (const struct plugin_list *pl,
+ const int type,
+ const struct argv *av,
+ struct plugin_return *pr,
+ struct env_set *es
+#ifdef ENABLE_SSL
+ , int certdepth,
+ openvpn_x509_cert_t *current_cert
+#endif
+ )
+{
+ if (pr)
+ plugin_return_init (pr);
+
+ if (plugin_defined (pl, type))
+ {
+ struct gc_arena gc = gc_new ();
+ int i;
+ const char **envp;
+ const int n = plugin_n (pl);
+ bool success = false;
+ bool error = false;
+ bool deferred = false;
+
+ setenv_del (es, "script_type");
+ envp = make_env_array (es, false, &gc);
+
+ for (i = 0; i < n; ++i)
+ {
+ const int status = plugin_call_item (&pl->common->plugins[i],
+ pl->per_client.per_client_context[i],
+ type,
+ av,
+ pr ? &pr->list[i] : NULL,
+ envp
+#ifdef ENABLE_SSL
+ ,certdepth,
+ current_cert
+#endif
+ );
+ switch (status)
+ {
+ case OPENVPN_PLUGIN_FUNC_SUCCESS:
+ success = true;
+ break;
+ case OPENVPN_PLUGIN_FUNC_DEFERRED:
+ deferred = true;
+ break;
+ default:
+ error = true;
+ break;
+ }
+ }
+
+ if (pr)
+ pr->n = i;
+
+ gc_free (&gc);
+
+ if (type == OPENVPN_PLUGIN_ENABLE_PF && success)
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ else if (error)
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ else if (deferred)
+ return OPENVPN_PLUGIN_FUNC_DEFERRED;
+ }
+
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+}
+
+void
+plugin_list_close (struct plugin_list *pl)
+{
+ if (pl)
+ {
+ if (pl->common)
+ {
+ plugin_per_client_destroy (pl->common, &pl->per_client);
+
+ if (pl->common_owned)
+ plugin_common_close (pl->common);
+ }
+
+ free (pl);
+ }
+}
+
+void
+plugin_abort (void)
+{
+ struct plugin_common *pc = static_plugin_common;
+ static_plugin_common = NULL;
+ if (pc)
+ {
+ int i;
+
+ for (i = 0; i < pc->n; ++i)
+ plugin_abort_item (&pc->plugins[i]);
+ }
+}
+
+bool
+plugin_defined (const struct plugin_list *pl, const int type)
+{
+ bool ret = false;
+
+ if (pl)
+ {
+ const struct plugin_common *pc = pl->common;
+
+ if (pc)
+ {
+ int i;
+ const unsigned int mask = OPENVPN_PLUGIN_MASK (type);
+ for (i = 0; i < pc->n; ++i)
+ {
+ if (pc->plugins[i].plugin_type_mask & mask)
+ {
+ ret = true;
+ break;
+ }
+ }
+ }
+ }
+ return ret;
+}
+
+/*
+ * Plugin return functions
+ */
+
+static void
+openvpn_plugin_string_list_item_free (struct openvpn_plugin_string_list *l)
+{
+ if (l)
+ {
+ free (l->name);
+ string_clear (l->value);
+ free (l->value);
+ free (l);
+ }
+}
+
+static void
+openvpn_plugin_string_list_free (struct openvpn_plugin_string_list *l)
+{
+ struct openvpn_plugin_string_list *next;
+ while (l)
+ {
+ next = l->next;
+ openvpn_plugin_string_list_item_free (l);
+ l = next;
+ }
+}
+
+static struct openvpn_plugin_string_list *
+openvpn_plugin_string_list_find (struct openvpn_plugin_string_list *l, const char *name)
+{
+ while (l)
+ {
+ if (!strcmp (l->name, name))
+ return l;
+ l = l->next;
+ }
+ return NULL;
+}
+
+void
+plugin_return_get_column (const struct plugin_return *src,
+ struct plugin_return *dest,
+ const char *colname)
+{
+ int i;
+
+ dest->n = 0;
+ for (i = 0; i < src->n; ++i)
+ dest->list[i] = openvpn_plugin_string_list_find (src->list[i], colname);
+ dest->n = i;
+}
+
+void
+plugin_return_free (struct plugin_return *pr)
+{
+ int i;
+ for (i = 0; i < pr->n; ++i)
+ openvpn_plugin_string_list_free (pr->list[i]);
+ pr->n = 0;
+}
+
+#ifdef ENABLE_DEBUG
+void
+plugin_return_print (const int msglevel, const char *prefix, const struct plugin_return *pr)
+{
+ int i;
+ msg (msglevel, "PLUGIN_RETURN_PRINT %s", prefix);
+ for (i = 0; i < pr->n; ++i)
+ {
+ struct openvpn_plugin_string_list *l = pr->list[i];
+ int count = 0;
+
+ msg (msglevel, "PLUGIN #%d (%s)", i, prefix);
+ while (l)
+ {
+ msg (msglevel, "[%d] '%s' -> '%s'\n",
+ ++count,
+ l->name,
+ l->value);
+ l = l->next;
+ }
+ }
+}
+#endif
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_PLUGIN */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.h
new file mode 100644
index 00000000..2f8416b1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/plugin.h
@@ -0,0 +1,211 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * plug-in support, using dynamically loaded libraries
+ */
+
+#ifndef OPENVPN_PLUGIN_H
+#define OPENVPN_PLUGIN_H
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include "ssl_verify_openssl.h"
+#endif
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include "ssl_verify_polarssl.h"
+#endif
+#include "openvpn-plugin.h"
+
+#ifdef ENABLE_PLUGIN
+
+#include "misc.h"
+
+#define MAX_PLUGINS 16
+
+struct plugin_option {
+ const char *so_pathname;
+ const char **argv;
+};
+
+struct plugin_option_list {
+ int n;
+ struct plugin_option plugins[MAX_PLUGINS];
+};
+
+struct plugin {
+ bool initialized;
+ const char *so_pathname;
+ unsigned int plugin_type_mask;
+ int requested_initialization_point;
+
+#ifndef WIN32
+ void *handle;
+#else
+ HMODULE module;
+#endif
+
+ openvpn_plugin_open_v1 open1;
+ openvpn_plugin_open_v2 open2;
+ openvpn_plugin_open_v3 open3;
+ openvpn_plugin_func_v1 func1;
+ openvpn_plugin_func_v2 func2;
+ openvpn_plugin_func_v3 func3;
+ openvpn_plugin_close_v1 close;
+ openvpn_plugin_abort_v1 abort;
+ openvpn_plugin_client_constructor_v1 client_constructor;
+ openvpn_plugin_client_destructor_v1 client_destructor;
+ openvpn_plugin_min_version_required_v1 min_version_required;
+ openvpn_plugin_select_initialization_point_v1 initialization_point;
+
+ openvpn_plugin_handle_t plugin_handle;
+};
+
+struct plugin_per_client
+{
+ void *per_client_context[MAX_PLUGINS];
+};
+
+struct plugin_common
+{
+ int n;
+ struct plugin plugins[MAX_PLUGINS];
+};
+
+struct plugin_list
+{
+ struct plugin_per_client per_client;
+ struct plugin_common *common;
+ bool common_owned;
+};
+
+struct plugin_return
+{
+ int n;
+ struct openvpn_plugin_string_list *list[MAX_PLUGINS];
+};
+
+struct plugin_option_list *plugin_option_list_new (struct gc_arena *gc);
+bool plugin_option_list_add (struct plugin_option_list *list, char **p, struct gc_arena *gc);
+
+#ifndef ENABLE_SMALL
+void plugin_option_list_print (const struct plugin_option_list *list, int msglevel);
+#endif
+
+struct plugin_list *plugin_list_init (const struct plugin_option_list *list);
+
+void plugin_list_open (struct plugin_list *pl,
+ const struct plugin_option_list *list,
+ struct plugin_return *pr,
+ const struct env_set *es,
+ const int init_point);
+
+struct plugin_list *plugin_list_inherit (const struct plugin_list *src);
+
+int plugin_call_ssl (const struct plugin_list *pl,
+ const int type,
+ const struct argv *av,
+ struct plugin_return *pr,
+ struct env_set *es
+#ifdef ENABLE_SSL
+ , int current_cert_depth,
+ openvpn_x509_cert_t *current_cert
+#endif
+ );
+
+void plugin_list_close (struct plugin_list *pl);
+bool plugin_defined (const struct plugin_list *pl, const int type);
+
+void plugin_return_get_column (const struct plugin_return *src,
+ struct plugin_return *dest,
+ const char *colname);
+
+void plugin_return_free (struct plugin_return *pr);
+
+#ifdef ENABLE_DEBUG
+void plugin_return_print (const int msglevel, const char *prefix, const struct plugin_return *pr);
+#endif
+
+static inline int
+plugin_n (const struct plugin_list *pl)
+{
+ if (pl && pl->common)
+ return pl->common->n;
+ else
+ return 0;
+}
+
+static inline bool
+plugin_return_defined (const struct plugin_return *pr)
+{
+ return pr->n >= 0;
+}
+
+static inline void
+plugin_return_init (struct plugin_return *pr)
+{
+ pr->n = 0;
+}
+
+#else
+struct plugin_list { int dummy; };
+struct plugin_return { int dummy; };
+
+static inline bool
+plugin_defined (const struct plugin_list *pl, const int type)
+{
+ return false;
+}
+
+static inline int
+plugin_call_ssl (const struct plugin_list *pl,
+ const int type,
+ const struct argv *av,
+ struct plugin_return *pr,
+ struct env_set *es
+#ifdef ENABLE_SSL
+ , int current_cert_depth,
+ openvpn_x509_cert_t *current_cert
+#endif
+ )
+{
+ return 0;
+}
+
+#endif /* ENABLE_PLUGIN */
+
+static inline int
+plugin_call(const struct plugin_list *pl,
+ const int type,
+ const struct argv *av,
+ struct plugin_return *pr,
+ struct env_set *es)
+{
+ return plugin_call_ssl(pl, type, av, pr, es
+#ifdef ENABLE_SSL
+ , -1, NULL
+#endif
+ );
+}
+
+#endif /* OPENVPN_PLUGIN_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.c
new file mode 100644
index 00000000..28c26b4d
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.c
@@ -0,0 +1,589 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "pool.h"
+#include "buffer.h"
+#include "error.h"
+#include "socket.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+#if P2MP
+
+static void
+ifconfig_pool_entry_free (struct ifconfig_pool_entry *ipe, bool hard)
+{
+ ipe->in_use = false;
+ if (hard && ipe->common_name)
+ {
+ free (ipe->common_name);
+ ipe->common_name = NULL;
+ }
+ if (hard)
+ ipe->last_release = 0;
+ else
+ ipe->last_release = now;
+}
+
+static int
+ifconfig_pool_find (struct ifconfig_pool *pool, const char *common_name)
+{
+ int i;
+ time_t earliest_release = 0;
+ int previous_usage = -1;
+ int new_usage = -1;
+
+ for (i = 0; i < pool->size; ++i)
+ {
+ struct ifconfig_pool_entry *ipe = &pool->list[i];
+ if (!ipe->in_use)
+ {
+ /*
+ * If duplicate_cn mode, take first available IP address
+ */
+ if (pool->duplicate_cn)
+ {
+ new_usage = i;
+ break;
+ }
+
+ /*
+ * Keep track of the unused IP address entry which
+ * was released earliest.
+ */
+ if ((new_usage == -1 || ipe->last_release < earliest_release) && !ipe->fixed)
+ {
+ earliest_release = ipe->last_release;
+ new_usage = i;
+ }
+
+ /*
+ * Keep track of a possible allocation to us
+ * from an earlier session.
+ */
+ if (previous_usage < 0
+ && common_name
+ && ipe->common_name
+ && !strcmp (common_name, ipe->common_name))
+ previous_usage = i;
+
+ }
+ }
+
+ if (previous_usage >= 0)
+ return previous_usage;
+
+ if (new_usage >= 0)
+ return new_usage;
+
+ return -1;
+}
+
+/*
+ * Verify start/end range
+ */
+bool
+ifconfig_pool_verify_range (const int msglevel, const in_addr_t start, const in_addr_t end)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = true;
+
+ if (start > end)
+ {
+ msg (msglevel, "--ifconfig-pool start IP [%s] is greater than end IP [%s]",
+ print_in_addr_t (start, 0, &gc),
+ print_in_addr_t (end, 0, &gc));
+ ret = false;
+ }
+ if (end - start >= IFCONFIG_POOL_MAX)
+ {
+ msg (msglevel, "--ifconfig-pool address range is too large [%s -> %s]. Current maximum is %d addresses, as defined by IFCONFIG_POOL_MAX variable.",
+ print_in_addr_t (start, 0, &gc),
+ print_in_addr_t (end, 0, &gc),
+ IFCONFIG_POOL_MAX);
+ ret = false;
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+struct ifconfig_pool *
+ifconfig_pool_init (int type, in_addr_t start, in_addr_t end,
+ const bool duplicate_cn,
+ const bool ipv6_pool, const struct in6_addr ipv6_base,
+ const int ipv6_netbits )
+{
+ struct gc_arena gc = gc_new ();
+ struct ifconfig_pool *pool = NULL;
+
+ ASSERT (start <= end && end - start < IFCONFIG_POOL_MAX);
+ ALLOC_OBJ_CLEAR (pool, struct ifconfig_pool);
+
+ pool->type = type;
+ pool->duplicate_cn = duplicate_cn;
+
+ switch (type)
+ {
+ case IFCONFIG_POOL_30NET:
+ pool->base = start & ~3;
+ pool->size = (((end | 3) + 1) - pool->base) >> 2;
+ break;
+ case IFCONFIG_POOL_INDIV:
+ pool->base = start;
+ pool->size = end - start + 1;
+ break;
+ default:
+ ASSERT (0);
+ }
+
+ /* IPv6 pools are always "INDIV" type */
+ pool->ipv6 = ipv6_pool;
+
+ if ( pool->ipv6 )
+ {
+ pool->base_ipv6 = ipv6_base;
+ pool->size_ipv6 = ipv6_netbits>96? ( 1<<(128-ipv6_netbits) )
+ : IFCONFIG_POOL_MAX;
+
+ msg( D_IFCONFIG_POOL, "IFCONFIG POOL IPv6: (IPv4) size=%d, size_ipv6=%d, netbits=%d, base_ipv6=%s",
+ pool->size, pool->size_ipv6, ipv6_netbits,
+ print_in6_addr( pool->base_ipv6, 0, &gc ));
+
+ /* the current code is very simple and assumes that the IPv6
+ * pool is at least as big as the IPv4 pool, and we don't need
+ * to do separate math etc. for IPv6
+ */
+ ASSERT( pool->size < pool->size_ipv6 );
+ }
+
+ ALLOC_ARRAY_CLEAR (pool->list, struct ifconfig_pool_entry, pool->size);
+
+ msg (D_IFCONFIG_POOL, "IFCONFIG POOL: base=%s size=%d, ipv6=%d",
+ print_in_addr_t (pool->base, 0, &gc),
+ pool->size, pool->ipv6 );
+
+ gc_free (&gc);
+ return pool;
+}
+
+void
+ifconfig_pool_free (struct ifconfig_pool *pool)
+{
+ if (pool)
+ {
+ int i;
+ for (i = 0; i < pool->size; ++i)
+ ifconfig_pool_entry_free (&pool->list[i], true);
+ free (pool->list);
+ free (pool);
+ }
+}
+
+ifconfig_pool_handle
+ifconfig_pool_acquire (struct ifconfig_pool *pool, in_addr_t *local, in_addr_t *remote, struct in6_addr *remote_ipv6, const char *common_name)
+{
+ int i;
+
+ i = ifconfig_pool_find (pool, common_name);
+ if (i >= 0)
+ {
+ struct ifconfig_pool_entry *ipe = &pool->list[i];
+ ASSERT (!ipe->in_use);
+ ifconfig_pool_entry_free (ipe, true);
+ ipe->in_use = true;
+ if (common_name)
+ ipe->common_name = string_alloc (common_name, NULL);
+
+ switch (pool->type)
+ {
+ case IFCONFIG_POOL_30NET:
+ {
+ in_addr_t b = pool->base + (i << 2);
+ *local = b + 1;
+ *remote = b + 2;
+ break;
+ }
+ case IFCONFIG_POOL_INDIV:
+ {
+ in_addr_t b = pool->base + i;
+ *local = 0;
+ *remote = b;
+ break;
+ }
+ default:
+ ASSERT (0);
+ }
+
+ /* IPv6 pools are always INDIV (--linear) */
+ if ( pool->ipv6 && remote_ipv6 )
+ {
+ *remote_ipv6 = add_in6_addr( pool->base_ipv6, i );
+ }
+ }
+ return i;
+}
+
+bool
+ifconfig_pool_release (struct ifconfig_pool* pool, ifconfig_pool_handle hand, const bool hard)
+{
+ bool ret = false;
+ if (pool && hand >= 0 && hand < pool->size)
+ {
+ ifconfig_pool_entry_free (&pool->list[hand], hard);
+ ret = true;
+ }
+ return ret;
+}
+
+/*
+ * private access functions
+ */
+
+static ifconfig_pool_handle
+ifconfig_pool_ip_base_to_handle (const struct ifconfig_pool* pool, const in_addr_t addr)
+{
+ ifconfig_pool_handle ret = -1;
+
+ switch (pool->type)
+ {
+ case IFCONFIG_POOL_30NET:
+ {
+ ret = (addr - pool->base) >> 2;
+ break;
+ }
+ case IFCONFIG_POOL_INDIV:
+ {
+ ret = (addr - pool->base);
+ break;
+ }
+ default:
+ ASSERT (0);
+ }
+
+ if (ret < 0 || ret >= pool->size)
+ ret = -1;
+
+ return ret;
+}
+
+static in_addr_t
+ifconfig_pool_handle_to_ip_base (const struct ifconfig_pool* pool, ifconfig_pool_handle hand)
+{
+ in_addr_t ret = 0;
+
+ if (hand >= 0 && hand < pool->size)
+ {
+ switch (pool->type)
+ {
+ case IFCONFIG_POOL_30NET:
+ {
+ ret = pool->base + (hand << 2);;
+ break;
+ }
+ case IFCONFIG_POOL_INDIV:
+ {
+ ret = pool->base + hand;
+ break;
+ }
+ default:
+ ASSERT (0);
+ }
+ }
+
+ return ret;
+}
+
+static struct in6_addr
+ifconfig_pool_handle_to_ipv6_base (const struct ifconfig_pool* pool, ifconfig_pool_handle hand)
+{
+ struct in6_addr ret = in6addr_any;
+
+ /* IPv6 pools are always INDIV (--linear) */
+ if (hand >= 0 && hand < pool->size_ipv6 )
+ {
+ ret = add_in6_addr( pool->base_ipv6, hand );
+ }
+ return ret;
+}
+
+static void
+ifconfig_pool_set (struct ifconfig_pool* pool, const char *cn, const in_addr_t addr, const bool fixed)
+{
+ ifconfig_pool_handle h = ifconfig_pool_ip_base_to_handle (pool, addr);
+ if (h >= 0)
+ {
+ struct ifconfig_pool_entry *e = &pool->list[h];
+ ifconfig_pool_entry_free (e, true);
+ e->in_use = false;
+ e->common_name = string_alloc (cn, NULL);
+ e->last_release = now;
+ e->fixed = fixed;
+ }
+}
+
+static void
+ifconfig_pool_list (const struct ifconfig_pool* pool, struct status_output *out)
+{
+ if (pool && out)
+ {
+ struct gc_arena gc = gc_new ();
+ int i;
+
+ for (i = 0; i < pool->size; ++i)
+ {
+ const struct ifconfig_pool_entry *e = &pool->list[i];
+ if (e->common_name)
+ {
+ const in_addr_t ip = ifconfig_pool_handle_to_ip_base (pool, i);
+ if ( pool->ipv6 )
+ {
+ struct in6_addr ip6 = ifconfig_pool_handle_to_ipv6_base (pool, i);
+ status_printf (out, "%s,%s,%s",
+ e->common_name,
+ print_in_addr_t (ip, 0, &gc),
+ print_in6_addr (ip6, 0, &gc));
+ }
+ else
+ {
+ status_printf (out, "%s,%s",
+ e->common_name,
+ print_in_addr_t (ip, 0, &gc));
+ }
+ }
+ }
+ gc_free (&gc);
+ }
+}
+
+static void
+ifconfig_pool_msg (const struct ifconfig_pool* pool, int msglevel)
+{
+ struct status_output *so = status_open (NULL, 0, msglevel, NULL, 0);
+ ASSERT (so);
+ status_printf (so, "IFCONFIG POOL LIST");
+ ifconfig_pool_list (pool, so);
+ status_close (so);
+}
+
+/*
+ * Deal with reading/writing the ifconfig pool database to a file
+ */
+
+struct ifconfig_pool_persist *
+ifconfig_pool_persist_init (const char *filename, int refresh_freq)
+{
+ struct ifconfig_pool_persist *ret;
+
+ ASSERT (filename);
+
+ ALLOC_OBJ_CLEAR (ret, struct ifconfig_pool_persist);
+ if (refresh_freq > 0)
+ {
+ ret->fixed = false;
+ ret->file = status_open (filename, refresh_freq, -1, NULL, STATUS_OUTPUT_READ|STATUS_OUTPUT_WRITE);
+ }
+ else
+ {
+ ret->fixed = true;
+ ret->file = status_open (filename, 0, -1, NULL, STATUS_OUTPUT_READ);
+ }
+ return ret;
+}
+
+void
+ifconfig_pool_persist_close (struct ifconfig_pool_persist *persist)
+{
+ if (persist)
+ {
+ if (persist->file)
+ status_close (persist->file);
+ free (persist);
+ }
+}
+
+bool
+ifconfig_pool_write_trigger (struct ifconfig_pool_persist *persist)
+{
+ if (persist->file)
+ return status_trigger (persist->file);
+ else
+ return false;
+}
+
+void
+ifconfig_pool_read (struct ifconfig_pool_persist *persist, struct ifconfig_pool *pool)
+{
+ const int buf_size = 128;
+
+ update_time ();
+ if (persist && persist->file && pool)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer in = alloc_buf_gc (256, &gc);
+ char *cn_buf;
+ char *ip_buf;
+ int line = 0;
+
+ ALLOC_ARRAY_CLEAR_GC (cn_buf, char, buf_size, &gc);
+ ALLOC_ARRAY_CLEAR_GC (ip_buf, char, buf_size, &gc);
+
+ while (true)
+ {
+ ASSERT (buf_init (&in, 0));
+ if (!status_read (persist->file, &in))
+ break;
+ ++line;
+ if (BLEN (&in))
+ {
+ int c = *BSTR(&in);
+ if (c == '#' || c == ';')
+ continue;
+ msg( M_INFO, "ifconfig_pool_read(), in='%s', TODO: IPv6",
+ BSTR(&in) );
+
+ if (buf_parse (&in, ',', cn_buf, buf_size)
+ && buf_parse (&in, ',', ip_buf, buf_size))
+ {
+ bool succeeded;
+ const in_addr_t addr = getaddr (GETADDR_HOST_ORDER, ip_buf, 0, &succeeded, NULL);
+ if (succeeded)
+ {
+ msg( M_INFO, "succeeded -> ifconfig_pool_set()");
+ ifconfig_pool_set (pool, cn_buf, addr, persist->fixed);
+ }
+ }
+ }
+ }
+
+ ifconfig_pool_msg (pool, D_IFCONFIG_POOL);
+
+ gc_free (&gc);
+ }
+}
+
+void
+ifconfig_pool_write (struct ifconfig_pool_persist *persist, const struct ifconfig_pool *pool)
+{
+ if (persist && persist->file && (status_rw_flags (persist->file) & STATUS_OUTPUT_WRITE) && pool)
+ {
+ status_reset (persist->file);
+ ifconfig_pool_list (pool, persist->file);
+ status_flush (persist->file);
+ }
+}
+
+/*
+ * TESTING ONLY
+ */
+
+#ifdef IFCONFIG_POOL_TEST
+
+#define DUP_CN
+
+void
+ifconfig_pool_test (in_addr_t start, in_addr_t end)
+{
+ struct gc_arena gc = gc_new ();
+ struct ifconfig_pool *p = ifconfig_pool_init (IFCONFIG_POOL_30NET, start, end);
+ /*struct ifconfig_pool *p = ifconfig_pool_init (IFCONFIG_POOL_INDIV, start, end);*/
+ ifconfig_pool_handle array[256];
+ int i;
+
+ CLEAR (array);
+
+ msg (M_INFO | M_NOPREFIX, "************ 1");
+ for (i = 0; i < (int) SIZE (array); ++i)
+ {
+ char *cn;
+ ifconfig_pool_handle h;
+ in_addr_t local, remote;
+ char buf[256];
+ openvpn_snprintf (buf, sizeof(buf), "common-name-%d", i);
+#ifdef DUP_CN
+ cn = NULL;
+#else
+ cn = buf;
+#endif
+ h = ifconfig_pool_acquire (p, &local, &remote, NULL, cn);
+ if (h < 0)
+ break;
+ msg (M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 1: l=%s r=%s cn=%s",
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote, 0, &gc),
+ cn);
+ array[i] = h;
+
+ }
+
+ msg (M_INFO | M_NOPREFIX, "************* 2");
+ for (i = (int) SIZE (array) / 16; i < (int) SIZE (array) / 8; ++i)
+ {
+ msg (M_INFO, "Attempt to release %d cn=%s", array[i], p->list[i].common_name);
+ if (!ifconfig_pool_release (p, array[i]))
+ break;
+ msg (M_INFO, "Succeeded");
+ }
+
+ CLEAR (array);
+
+ msg (M_INFO | M_NOPREFIX, "**************** 3");
+ for (i = 0; i < (int) SIZE (array); ++i)
+ {
+ char *cn;
+ ifconfig_pool_handle h;
+ in_addr_t local, remote;
+ char buf[256];
+ snprintf (buf, sizeof(buf), "common-name-%d", i+24);
+#ifdef DUP_CN
+ cn = NULL;
+#else
+ cn = buf;
+#endif
+ h = ifconfig_pool_acquire (p, &local, &remote, NULL, cn);
+ if (h < 0)
+ break;
+ msg (M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 3: l=%s r=%s cn=%s",
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote, 0, &gc),
+ cn);
+ array[i] = h;
+
+ }
+
+ ifconfig_pool_free (p);
+ gc_free (&gc);
+}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.h
new file mode 100644
index 00000000..fc9d6ab2
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pool.h
@@ -0,0 +1,91 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef POOL_H
+#define POOL_H
+
+#if P2MP
+
+/*#define IFCONFIG_POOL_TEST*/
+
+#include "basic.h"
+#include "status.h"
+
+#define IFCONFIG_POOL_MAX 65536
+#define IFCONFIG_POOL_MIN_NETBITS 16
+
+#define IFCONFIG_POOL_30NET 0
+#define IFCONFIG_POOL_INDIV 1
+
+struct ifconfig_pool_entry
+{
+ bool in_use;
+ char *common_name;
+ time_t last_release;
+ bool fixed;
+};
+
+struct ifconfig_pool
+{
+ in_addr_t base;
+ int size;
+ int type;
+ bool duplicate_cn;
+ bool ipv6;
+ struct in6_addr base_ipv6;
+ unsigned int size_ipv6;
+ struct ifconfig_pool_entry *list;
+};
+
+struct ifconfig_pool_persist
+{
+ struct status_output *file;
+ bool fixed;
+};
+
+typedef int ifconfig_pool_handle;
+
+struct ifconfig_pool *ifconfig_pool_init (int type, in_addr_t start, in_addr_t end, const bool duplicate_cn, const bool ipv6_pool, const struct in6_addr ipv6_base, const int ipv6_netbits );
+
+void ifconfig_pool_free (struct ifconfig_pool *pool);
+
+bool ifconfig_pool_verify_range (const int msglevel, const in_addr_t start, const in_addr_t end);
+
+ifconfig_pool_handle ifconfig_pool_acquire (struct ifconfig_pool *pool, in_addr_t *local, in_addr_t *remote, struct in6_addr *remote_ipv6, const char *common_name);
+
+bool ifconfig_pool_release (struct ifconfig_pool* pool, ifconfig_pool_handle hand, const bool hard);
+
+struct ifconfig_pool_persist *ifconfig_pool_persist_init (const char *filename, int refresh_freq);
+void ifconfig_pool_persist_close (struct ifconfig_pool_persist *persist);
+bool ifconfig_pool_write_trigger (struct ifconfig_pool_persist *persist);
+
+void ifconfig_pool_read (struct ifconfig_pool_persist *persist, struct ifconfig_pool *pool);
+void ifconfig_pool_write (struct ifconfig_pool_persist *persist, const struct ifconfig_pool *pool);
+
+#ifdef IFCONFIG_POOL_TEST
+void ifconfig_pool_test (in_addr_t start, in_addr_t end);
+#endif
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.c
new file mode 100644
index 00000000..7b58e6ab
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.c
@@ -0,0 +1,141 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "proto.h"
+#include "error.h"
+
+#include "memdbg.h"
+
+/*
+ * If raw tunnel packet is IPv<X>, return true and increment
+ * buffer offset to start of IP header.
+ */
+static
+bool
+is_ipv_X ( int tunnel_type, struct buffer *buf, int ip_ver )
+{
+ int offset;
+ const struct openvpn_iphdr *ih;
+
+ verify_align_4 (buf);
+ if (tunnel_type == DEV_TYPE_TUN)
+ {
+ if (BLEN (buf) < (int) sizeof (struct openvpn_iphdr))
+ return false;
+ offset = 0;
+ }
+ else if (tunnel_type == DEV_TYPE_TAP)
+ {
+ const struct openvpn_ethhdr *eh;
+ if (BLEN (buf) < (int)(sizeof (struct openvpn_ethhdr)
+ + sizeof (struct openvpn_iphdr)))
+ return false;
+ eh = (const struct openvpn_ethhdr *) BPTR (buf);
+ if (ntohs (eh->proto) != (ip_ver == 6 ? OPENVPN_ETH_P_IPV6 : OPENVPN_ETH_P_IPV4))
+ return false;
+ offset = sizeof (struct openvpn_ethhdr);
+ }
+ else
+ return false;
+
+ ih = (const struct openvpn_iphdr *) (BPTR (buf) + offset);
+
+ /* IP version is stored in the same bits for IPv4 or IPv6 header */
+ if (OPENVPN_IPH_GET_VER (ih->version_len) == ip_ver)
+ return buf_advance (buf, offset);
+ else
+ return false;
+}
+
+bool
+is_ipv4 (int tunnel_type, struct buffer *buf)
+{
+ return is_ipv_X( tunnel_type, buf, 4 );
+}
+bool
+is_ipv6 (int tunnel_type, struct buffer *buf)
+{
+ return is_ipv_X( tunnel_type, buf, 6 );
+}
+
+#ifdef PACKET_TRUNCATION_CHECK
+
+void
+ipv4_packet_size_verify (const uint8_t *data,
+ const int size,
+ const int tunnel_type,
+ const char *prefix,
+ counter_type *errors)
+{
+ if (size > 0)
+ {
+ struct buffer buf;
+
+ buf_set_read (&buf, data, size);
+
+ if (is_ipv4 (tunnel_type, &buf))
+ {
+ const struct openvpn_iphdr *pip;
+ int hlen;
+ int totlen;
+ const char *msgstr = "PACKET SIZE INFO";
+ unsigned int msglevel = D_PACKET_TRUNC_DEBUG;
+
+ if (BLEN (&buf) < (int) sizeof (struct openvpn_iphdr))
+ return;
+
+ verify_align_4 (&buf);
+ pip = (struct openvpn_iphdr *) BPTR (&buf);
+
+ hlen = OPENVPN_IPH_GET_LEN (pip->version_len);
+ totlen = ntohs (pip->tot_len);
+
+ if (BLEN (&buf) != totlen)
+ {
+ msgstr = "PACKET TRUNCATION ERROR";
+ msglevel = D_PACKET_TRUNC_ERR;
+ if (errors)
+ ++(*errors);
+ }
+
+ msg (msglevel, "%s %s: size=%d totlen=%d hlen=%d errcount=" counter_format,
+ msgstr,
+ prefix,
+ BLEN (&buf),
+ totlen,
+ hlen,
+ errors ? *errors : (counter_type)0);
+ }
+ }
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.h
new file mode 100644
index 00000000..f91e787e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/proto.h
@@ -0,0 +1,237 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PROTO_H
+#define PROTO_H
+
+#include "common.h"
+#include "buffer.h"
+
+#pragma pack(1)
+
+/*
+ * Tunnel types
+ */
+#define DEV_TYPE_UNDEF 0
+#define DEV_TYPE_NULL 1
+#define DEV_TYPE_TUN 2 /* point-to-point IP tunnel */
+#define DEV_TYPE_TAP 3 /* ethernet (802.3) tunnel */
+
+/* TUN topologies */
+
+#define TOP_UNDEF 0
+#define TOP_NET30 1
+#define TOP_P2P 2
+#define TOP_SUBNET 3
+
+/*
+ * IP and Ethernet protocol structs. For portability,
+ * OpenVPN needs its own definitions of these structs, and
+ * names have been adjusted to avoid collisions with
+ * native structs.
+ */
+
+#define OPENVPN_ETH_ALEN 6 /* ethernet address length */
+struct openvpn_ethhdr
+{
+ uint8_t dest[OPENVPN_ETH_ALEN]; /* destination ethernet addr */
+ uint8_t source[OPENVPN_ETH_ALEN]; /* source ethernet addr */
+
+# define OPENVPN_ETH_P_IPV4 0x0800 /* IPv4 protocol */
+# define OPENVPN_ETH_P_IPV6 0x86DD /* IPv6 protocol */
+# define OPENVPN_ETH_P_ARP 0x0806 /* ARP protocol */
+ uint16_t proto; /* packet type ID field */
+};
+
+struct openvpn_arp {
+# define ARP_MAC_ADDR_TYPE 0x0001
+ uint16_t mac_addr_type; /* 0x0001 */
+
+ uint16_t proto_addr_type; /* 0x0800 */
+ uint8_t mac_addr_size; /* 0x06 */
+ uint8_t proto_addr_size; /* 0x04 */
+
+# define ARP_REQUEST 0x0001
+# define ARP_REPLY 0x0002
+ uint16_t arp_command; /* 0x0001 for ARP request, 0x0002 for ARP reply */
+
+ uint8_t mac_src[OPENVPN_ETH_ALEN];
+ in_addr_t ip_src;
+ uint8_t mac_dest[OPENVPN_ETH_ALEN];
+ in_addr_t ip_dest;
+};
+
+struct openvpn_iphdr {
+# define OPENVPN_IPH_GET_VER(v) (((v) >> 4) & 0x0F)
+# define OPENVPN_IPH_GET_LEN(v) (((v) & 0x0F) << 2)
+ uint8_t version_len;
+
+ uint8_t tos;
+ uint16_t tot_len;
+ uint16_t id;
+
+# define OPENVPN_IP_OFFMASK 0x1fff
+ uint16_t frag_off;
+
+ uint8_t ttl;
+
+# define OPENVPN_IPPROTO_IGMP 2 /* IGMP protocol */
+# define OPENVPN_IPPROTO_TCP 6 /* TCP protocol */
+# define OPENVPN_IPPROTO_UDP 17 /* UDP protocol */
+ uint8_t protocol;
+
+ uint16_t check;
+ uint32_t saddr;
+ uint32_t daddr;
+ /*The options start here. */
+};
+
+/*
+ * IPv6 header
+ */
+struct openvpn_ipv6hdr {
+ uint8_t version_prio;
+ uint8_t flow_lbl[3];
+ uint16_t payload_len;
+ uint8_t nexthdr;
+ uint8_t hop_limit;
+
+ struct in6_addr saddr;
+ struct in6_addr daddr;
+};
+
+
+/*
+ * UDP header
+ */
+struct openvpn_udphdr {
+ uint16_t source;
+ uint16_t dest;
+ uint16_t len;
+ uint16_t check;
+};
+
+/*
+ * TCP header, per RFC 793.
+ */
+struct openvpn_tcphdr {
+ uint16_t source; /* source port */
+ uint16_t dest; /* destination port */
+ uint32_t seq; /* sequence number */
+ uint32_t ack_seq; /* acknowledgement number */
+
+# define OPENVPN_TCPH_GET_DOFF(d) (((d) & 0xF0) >> 2)
+ uint8_t doff_res;
+
+# define OPENVPN_TCPH_FIN_MASK (1<<0)
+# define OPENVPN_TCPH_SYN_MASK (1<<1)
+# define OPENVPN_TCPH_RST_MASK (1<<2)
+# define OPENVPN_TCPH_PSH_MASK (1<<3)
+# define OPENVPN_TCPH_ACK_MASK (1<<4)
+# define OPENVPN_TCPH_URG_MASK (1<<5)
+# define OPENVPN_TCPH_ECE_MASK (1<<6)
+# define OPENVPN_TCPH_CWR_MASK (1<<7)
+ uint8_t flags;
+
+ uint16_t window;
+ uint16_t check;
+ uint16_t urg_ptr;
+};
+
+#define OPENVPN_TCPOPT_EOL 0
+#define OPENVPN_TCPOPT_NOP 1
+#define OPENVPN_TCPOPT_MAXSEG 2
+#define OPENVPN_TCPOLEN_MAXSEG 4
+
+struct ip_tcp_udp_hdr {
+ struct openvpn_iphdr ip;
+ union {
+ struct openvpn_tcphdr tcp;
+ struct openvpn_udphdr udp;
+ } u;
+};
+
+#pragma pack()
+
+/*
+ * The following macro is used to update an
+ * internet checksum. "acc" is a 32-bit
+ * accumulation of all the changes to the
+ * checksum (adding in old 16-bit words and
+ * subtracting out new words), and "cksum"
+ * is the checksum value to be updated.
+ */
+#define ADJUST_CHECKSUM(acc, cksum) { \
+ int _acc = acc; \
+ _acc += (cksum); \
+ if (_acc < 0) { \
+ _acc = -_acc; \
+ _acc = (_acc >> 16) + (_acc & 0xffff); \
+ _acc += _acc >> 16; \
+ (cksum) = (uint16_t) ~_acc; \
+ } else { \
+ _acc = (_acc >> 16) + (_acc & 0xffff); \
+ _acc += _acc >> 16; \
+ (cksum) = (uint16_t) _acc; \
+ } \
+}
+
+#define ADD_CHECKSUM_32(acc, u32) { \
+ acc += (u32) & 0xffff; \
+ acc += (u32) >> 16; \
+}
+
+#define SUB_CHECKSUM_32(acc, u32) { \
+ acc -= (u32) & 0xffff; \
+ acc -= (u32) >> 16; \
+}
+
+/*
+ * We are in a "liberal" position with respect to MSS,
+ * i.e. we assume that MSS can be calculated from MTU
+ * by subtracting out only the IP and TCP header sizes
+ * without options.
+ *
+ * (RFC 879, section 7).
+ */
+#define MTU_TO_MSS(mtu) (mtu - sizeof(struct openvpn_iphdr) \
+ - sizeof(struct openvpn_tcphdr))
+
+/*
+ * If raw tunnel packet is IPv4 or IPv6, return true and increment
+ * buffer offset to start of IP header.
+ */
+bool is_ipv4 (int tunnel_type, struct buffer *buf);
+bool is_ipv6 (int tunnel_type, struct buffer *buf);
+
+#ifdef PACKET_TRUNCATION_CHECK
+void ipv4_packet_size_verify (const uint8_t *data,
+ const int size,
+ const int tunnel_type,
+ const char
+ *prefix,
+ counter_type *errors);
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.c
new file mode 100644
index 00000000..2568e191
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.c
@@ -0,0 +1,945 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "common.h"
+#include "misc.h"
+#include "crypto.h"
+#include "win32.h"
+#include "socket.h"
+#include "fdmisc.h"
+#include "proxy.h"
+#include "base64.h"
+#include "httpdigest.h"
+#include "ntlm.h"
+#include "memdbg.h"
+
+#define UP_TYPE_PROXY "HTTP Proxy"
+
+struct http_proxy_options *
+init_http_proxy_options_once (struct http_proxy_options **hpo,
+ struct gc_arena *gc)
+{
+ if (!*hpo)
+ {
+ ALLOC_OBJ_CLEAR_GC (*hpo, struct http_proxy_options, gc);
+ /* http proxy defaults */
+ (*hpo)->timeout = 5;
+ (*hpo)->http_version = "1.0";
+ }
+ return *hpo;
+}
+
+
+/* cached proxy username/password */
+static struct user_pass static_proxy_user_pass;
+
+static bool
+recv_line (socket_descriptor_t sd,
+ char *buf,
+ int len,
+ const int timeout_sec,
+ const bool verbose,
+ struct buffer *lookahead,
+ volatile int *signal_received)
+{
+ struct buffer la;
+ int lastc = 0;
+
+ CLEAR (la);
+ if (lookahead)
+ la = *lookahead;
+
+ while (true)
+ {
+ int status;
+ ssize_t size;
+ fd_set reads;
+ struct timeval tv;
+ uint8_t c;
+
+ if (buf_defined (&la))
+ {
+ ASSERT (buf_init (&la, 0));
+ }
+
+ FD_ZERO (&reads);
+ FD_SET (sd, &reads);
+ tv.tv_sec = timeout_sec;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, &reads, NULL, NULL, &tv);
+
+ get_signal (signal_received);
+ if (*signal_received)
+ goto error;
+
+ /* timeout? */
+ if (status == 0)
+ {
+ if (verbose)
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_line: TCP port read timeout expired");
+ goto error;
+ }
+
+ /* error */
+ if (status < 0)
+ {
+ if (verbose)
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_line: TCP port read failed on select()");
+ goto error;
+ }
+
+ /* read single char */
+ size = recv (sd, &c, 1, MSG_NOSIGNAL);
+
+ /* error? */
+ if (size != 1)
+ {
+ if (verbose)
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_line: TCP port read failed on recv()");
+ goto error;
+ }
+
+#if 0
+ if (isprint(c))
+ msg (M_INFO, "PROXY: read '%c' (%d)", c, (int)c);
+ else
+ msg (M_INFO, "PROXY: read (%d)", (int)c);
+#endif
+
+ /* store char in buffer */
+ if (len > 1)
+ {
+ *buf++ = c;
+ --len;
+ }
+
+ /* also store char in lookahead buffer */
+ if (buf_defined (&la))
+ {
+ buf_write_u8 (&la, c);
+ if (!isprint(c) && !isspace(c)) /* not ascii? */
+ {
+ if (verbose)
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_line: Non-ASCII character (%d) read on recv()", (int)c);
+ *lookahead = la;
+ return false;
+ }
+ }
+
+ /* end of line? */
+ if (lastc == '\r' && c == '\n')
+ break;
+
+ lastc = c;
+ }
+
+ /* append trailing null */
+ if (len > 0)
+ *buf++ = '\0';
+
+ return true;
+
+ error:
+ return false;
+}
+
+static bool
+send_line (socket_descriptor_t sd,
+ const char *buf)
+{
+ const ssize_t size = send (sd, buf, strlen (buf), MSG_NOSIGNAL);
+ if (size != (ssize_t) strlen (buf))
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "send_line: TCP port write failed on send()");
+ return false;
+ }
+ return true;
+}
+
+static bool
+send_line_crlf (socket_descriptor_t sd,
+ const char *src)
+{
+ bool ret;
+
+ struct buffer buf = alloc_buf (strlen (src) + 3);
+ ASSERT (buf_write (&buf, src, strlen (src)));
+ ASSERT (buf_write (&buf, "\r\n", 3));
+ ret = send_line (sd, BSTR (&buf));
+ free_buf (&buf);
+ return ret;
+}
+
+static bool
+send_crlf (socket_descriptor_t sd)
+{
+ return send_line_crlf (sd, "");
+}
+
+uint8_t *
+make_base64_string2 (const uint8_t *str, int src_len, struct gc_arena *gc)
+{
+ uint8_t *ret = NULL;
+ char *b64out = NULL;
+ ASSERT (openvpn_base64_encode ((const void *)str, src_len, &b64out) >= 0);
+ ret = (uint8_t *) string_alloc (b64out, gc);
+ free (b64out);
+ return ret;
+}
+
+uint8_t *
+make_base64_string (const uint8_t *str, struct gc_arena *gc)
+{
+ return make_base64_string2 (str, strlen ((const char *)str), gc);
+}
+
+static const char *
+username_password_as_base64 (const struct http_proxy_info *p,
+ struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (strlen (p->up.username) + strlen (p->up.password) + 2, gc);
+ ASSERT (strlen (p->up.username) > 0);
+ buf_printf (&out, "%s:%s", p->up.username, p->up.password);
+ return (const char *)make_base64_string ((const uint8_t*)BSTR (&out), gc);
+}
+
+static void
+get_user_pass_http (struct http_proxy_info *p, const bool force)
+{
+ if (!static_proxy_user_pass.defined || force)
+ {
+ unsigned int flags = GET_USER_PASS_MANAGEMENT;
+ if (p->queried_creds)
+ flags |= GET_USER_PASS_PREVIOUS_CREDS_FAILED;
+ get_user_pass (&static_proxy_user_pass,
+ p->options.auth_file,
+ UP_TYPE_PROXY,
+ flags);
+ p->queried_creds = true;
+ p->up = static_proxy_user_pass;
+ }
+}
+static void
+clear_user_pass_http (void)
+{
+ purge_user_pass (&static_proxy_user_pass, true);
+}
+
+static void
+dump_residual (socket_descriptor_t sd,
+ int timeout,
+ volatile int *signal_received)
+{
+ char buf[256];
+ while (true)
+ {
+ if (!recv_line (sd, buf, sizeof (buf), timeout, true, NULL, signal_received))
+ return;
+ chomp (buf);
+ msg (D_PROXY, "PROXY HEADER: '%s'", buf);
+ }
+}
+
+/*
+ * Extract the Proxy-Authenticate header from the stream.
+ * Consumes all headers.
+ */
+static int
+get_proxy_authenticate (socket_descriptor_t sd,
+ int timeout,
+ char **data,
+ struct gc_arena *gc,
+ volatile int *signal_received)
+{
+ char buf[256];
+ int ret = HTTP_AUTH_NONE;
+ while (true)
+ {
+ if (!recv_line (sd, buf, sizeof (buf), timeout, true, NULL, signal_received))
+ {
+ *data = NULL;
+ return HTTP_AUTH_NONE;
+ }
+ chomp (buf);
+ if (!strlen(buf))
+ return ret;
+ if (ret == HTTP_AUTH_NONE && !strncmp(buf, "Proxy-Authenticate: ", 20))
+ {
+ if (!strncmp(buf+20, "Basic ", 6))
+ {
+ msg (D_PROXY, "PROXY AUTH BASIC: '%s'", buf);
+ *data = string_alloc(buf+26, gc);
+ ret = HTTP_AUTH_BASIC;
+ }
+#if PROXY_DIGEST_AUTH
+ else if (!strncmp(buf+20, "Digest ", 7))
+ {
+ msg (D_PROXY, "PROXY AUTH DIGEST: '%s'", buf);
+ *data = string_alloc(buf+27, gc);
+ ret = HTTP_AUTH_DIGEST;
+ }
+#endif
+#if NTLM
+ else if (!strncmp(buf+20, "NTLM", 4))
+ {
+ msg (D_PROXY, "PROXY AUTH HTLM: '%s'", buf);
+ *data = NULL;
+ ret = HTTP_AUTH_NTLM;
+ }
+#endif
+ }
+ }
+}
+
+static void
+store_proxy_authenticate (struct http_proxy_info *p, char *data)
+{
+ if (p->proxy_authenticate)
+ free (p->proxy_authenticate);
+ p->proxy_authenticate = data;
+}
+
+/*
+ * Parse out key/value pairs from Proxy-Authenticate string.
+ * Return true on success, or false on parse failure.
+ */
+static bool
+get_key_value(const char *str, /* source string */
+ char *key, /* key stored here */
+ char *value, /* value stored here */
+ int max_key_len,
+ int max_value_len,
+ const char **endptr) /* next search position */
+{
+ int c;
+ bool starts_with_quote = false;
+ bool escape = false;
+
+ for (c = max_key_len-1; (*str && (*str != '=') && c--); )
+ *key++ = *str++;
+ *key = '\0';
+
+ if('=' != *str++)
+ /* no key/value found */
+ return false;
+
+ if('\"' == *str)
+ {
+ /* quoted string */
+ str++;
+ starts_with_quote = true;
+ }
+
+ for (c = max_value_len-1; *str && c--; str++)
+ {
+ switch (*str)
+ {
+ case '\\':
+ if (!escape)
+ {
+ /* possibly the start of an escaped quote */
+ escape = true;
+ *value++ = '\\'; /* even though this is an escape character, we still
+ store it as-is in the target buffer */
+ continue;
+ }
+ break;
+ case ',':
+ if (!starts_with_quote)
+ {
+ /* this signals the end of the value if we didn't get a starting quote
+ and then we do "sloppy" parsing */
+ c=0; /* the end */
+ continue;
+ }
+ break;
+ case '\r':
+ case '\n':
+ /* end of string */
+ c=0;
+ continue;
+ case '\"':
+ if (!escape && starts_with_quote)
+ {
+ /* end of string */
+ c=0;
+ continue;
+ }
+ break;
+ }
+ escape = false;
+ *value++ = *str;
+ }
+ *value = '\0';
+
+ *endptr = str;
+
+ return true; /* success */
+}
+
+static char *
+get_pa_var (const char *key, const char *pa, struct gc_arena *gc)
+{
+ char k[64];
+ char v[256];
+ const char *content = pa;
+
+ while (true)
+ {
+ const int status = get_key_value(content, k, v, sizeof(k), sizeof(v), &content);
+ if (status)
+ {
+ if (!strcmp(key, k))
+ return string_alloc(v, gc);
+ }
+ else
+ return NULL;
+
+ /* advance to start of next key */
+ if (*content == ',')
+ ++content;
+ while (*content && isspace(*content))
+ ++content;
+ }
+}
+
+struct http_proxy_info *
+http_proxy_new (const struct http_proxy_options *o)
+{
+ struct http_proxy_info *p;
+
+ if (!o || !o->server)
+ msg (M_FATAL, "HTTP_PROXY: server not specified");
+
+ ASSERT ( o->port);
+
+ ALLOC_OBJ_CLEAR (p, struct http_proxy_info);
+ p->options = *o;
+
+ /* parse authentication method */
+ p->auth_method = HTTP_AUTH_NONE;
+ if (o->auth_method_string)
+ {
+ if (!strcmp (o->auth_method_string, "none"))
+ p->auth_method = HTTP_AUTH_NONE;
+ else if (!strcmp (o->auth_method_string, "basic"))
+ p->auth_method = HTTP_AUTH_BASIC;
+#if NTLM
+ else if (!strcmp (o->auth_method_string, "ntlm"))
+ p->auth_method = HTTP_AUTH_NTLM;
+ else if (!strcmp (o->auth_method_string, "ntlm2"))
+ p->auth_method = HTTP_AUTH_NTLM2;
+#endif
+ else
+ msg (M_FATAL, "ERROR: unknown HTTP authentication method: '%s'",
+ o->auth_method_string);
+ }
+
+ /* only basic and NTLM/NTLMv2 authentication supported so far */
+ if (p->auth_method == HTTP_AUTH_BASIC || p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2)
+ {
+ get_user_pass_http (p, true);
+ }
+
+#if !NTLM
+ if (p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2)
+ msg (M_FATAL, "Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support.");
+#endif
+
+ p->defined = true;
+ return p;
+}
+
+void
+http_proxy_close (struct http_proxy_info *hp)
+{
+ free (hp);
+}
+
+bool
+add_proxy_headers (struct http_proxy_info *p,
+ socket_descriptor_t sd, /* already open to proxy */
+ const char *host, /* openvpn server remote */
+ const char* port /* openvpn server port */
+ )
+{
+ char buf[512];
+ int i;
+ bool host_header_sent=false;
+
+ /*
+ * Send custom headers if provided
+ * If content is NULL the whole header is in name
+ * Also remember if we already sent a Host: header
+ */
+ for (i=0; i < MAX_CUSTOM_HTTP_HEADER && p->options.custom_headers[i].name;i++)
+ {
+ if (p->options.custom_headers[i].content)
+ {
+ openvpn_snprintf (buf, sizeof(buf), "%s: %s",
+ p->options.custom_headers[i].name,
+ p->options.custom_headers[i].content);
+ if (!strcasecmp(p->options.custom_headers[i].name, "Host"))
+ host_header_sent=true;
+ }
+ else
+ {
+ openvpn_snprintf (buf, sizeof(buf), "%s",
+ p->options.custom_headers[i].name);
+ if (!strncasecmp(p->options.custom_headers[i].name, "Host:", 5))
+ host_header_sent=true;
+ }
+
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ return false;
+ }
+
+ if (!host_header_sent)
+ {
+ openvpn_snprintf (buf, sizeof(buf), "Host: %s", host);
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf(sd, buf))
+ return false;
+ }
+
+ /* send User-Agent string if provided */
+ if (p->options.user_agent)
+ {
+ openvpn_snprintf (buf, sizeof(buf), "User-Agent: %s",
+ p->options.user_agent);
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ return false;
+ }
+
+ return true;
+}
+
+
+bool
+establish_http_proxy_passthru (struct http_proxy_info *p,
+ socket_descriptor_t sd, /* already open to proxy */
+ const char *host, /* openvpn server remote */
+ const char *port, /* openvpn server port */
+ struct buffer *lookahead,
+ volatile int *signal_received)
+{
+ struct gc_arena gc = gc_new ();
+ char buf[512];
+ char buf2[129];
+ char get[80];
+ int status;
+ int nparms;
+ bool ret = false;
+ bool processed = false;
+
+ /* get user/pass if not previously given */
+ if (p->auth_method == HTTP_AUTH_BASIC
+ || p->auth_method == HTTP_AUTH_DIGEST
+ || p->auth_method == HTTP_AUTH_NTLM)
+ get_user_pass_http (p, false);
+
+ /* are we being called again after getting the digest server nonce in the previous transaction? */
+ if (p->auth_method == HTTP_AUTH_DIGEST && p->proxy_authenticate)
+ {
+ nparms = 1;
+ status = 407;
+ }
+ else
+ {
+ /* format HTTP CONNECT message */
+ openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%s HTTP/%s",
+ host,
+ port,
+ p->options.http_version);
+
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+
+ /* send HTTP CONNECT message to proxy */
+ if (!send_line_crlf (sd, buf))
+ goto error;
+
+ if (!add_proxy_headers (p, sd, host, port))
+ goto error;
+
+ /* auth specified? */
+ switch (p->auth_method)
+ {
+ case HTTP_AUTH_NONE:
+ break;
+
+ case HTTP_AUTH_BASIC:
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Authorization: Basic %s",
+ username_password_as_base64 (p, &gc));
+ msg (D_PROXY, "Attempting Basic Proxy-Authorization");
+ dmsg (D_SHOW_KEYS, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ goto error;
+ break;
+
+#if NTLM
+ case HTTP_AUTH_NTLM:
+ case HTTP_AUTH_NTLM2:
+ /* keep-alive connection */
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Connection: Keep-Alive");
+ if (!send_line_crlf (sd, buf))
+ goto error;
+
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Authorization: NTLM %s",
+ ntlm_phase_1 (p, &gc));
+ msg (D_PROXY, "Attempting NTLM Proxy-Authorization phase 1");
+ dmsg (D_SHOW_KEYS, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ goto error;
+ break;
+#endif
+
+ default:
+ ASSERT (0);
+ }
+
+ /* send empty CR, LF */
+ if (!send_crlf (sd))
+ goto error;
+
+ /* receive reply from proxy */
+ if (!recv_line (sd, buf, sizeof(buf), p->options.timeout, true, NULL, signal_received))
+ goto error;
+
+ /* remove trailing CR, LF */
+ chomp (buf);
+
+ msg (D_PROXY, "HTTP proxy returned: '%s'", buf);
+
+ /* parse return string */
+ nparms = sscanf (buf, "%*s %d", &status);
+
+ }
+
+ /* check for a "407 Proxy Authentication Required" response */
+ while (nparms >= 1 && status == 407)
+ {
+ msg (D_PROXY, "Proxy requires authentication");
+
+ if (p->auth_method == HTTP_AUTH_BASIC && !processed)
+ {
+ processed = true;
+ }
+ else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */
+ {
+#if NTLM
+ /* look for the phase 2 response */
+
+ while (true)
+ {
+ if (!recv_line (sd, buf, sizeof(buf), p->options.timeout, true, NULL, signal_received))
+ goto error;
+ chomp (buf);
+ msg (D_PROXY, "HTTP proxy returned: '%s'", buf);
+
+ openvpn_snprintf (get, sizeof get, "%%*s NTLM %%%ds", (int) sizeof (buf2) - 1);
+ nparms = sscanf (buf, get, buf2);
+ buf2[128] = 0; /* we only need the beginning - ensure it's null terminated. */
+
+ /* check for "Proxy-Authenticate: NTLM TlRM..." */
+ if (nparms == 1)
+ {
+ /* parse buf2 */
+ msg (D_PROXY, "auth string: '%s'", buf2);
+ break;
+ }
+ }
+ /* if we are here then auth string was got */
+ msg (D_PROXY, "Received NTLM Proxy-Authorization phase 2 response");
+
+ /* receive and discard everything else */
+ while (recv_line (sd, NULL, 0, 2, true, NULL, signal_received))
+ ;
+
+ /* now send the phase 3 reply */
+
+ /* format HTTP CONNECT message */
+ openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%s HTTP/%s",
+ host,
+ port,
+ p->options.http_version);
+
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+
+ /* send HTTP CONNECT message to proxy */
+ if (!send_line_crlf (sd, buf))
+ goto error;
+
+ /* keep-alive connection */
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Connection: Keep-Alive");
+ if (!send_line_crlf (sd, buf))
+ goto error;
+
+ /* send HOST etc, */
+ if (!add_proxy_headers (p, sd, host, port))
+ goto error;
+
+ msg (D_PROXY, "Attempting NTLM Proxy-Authorization phase 3");
+ {
+ const char *np3 = ntlm_phase_3 (p, buf2, &gc);
+ if (!np3)
+ {
+ msg (D_PROXY, "NTLM Proxy-Authorization phase 3 failed: received corrupted data from proxy server");
+ goto error;
+ }
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Authorization: NTLM %s", np3);
+ }
+
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ goto error;
+ /* ok so far... */
+ /* send empty CR, LF */
+ if (!send_crlf (sd))
+ goto error;
+
+ /* receive reply from proxy */
+ if (!recv_line (sd, buf, sizeof(buf), p->options.timeout, true, NULL, signal_received))
+ goto error;
+
+ /* remove trailing CR, LF */
+ chomp (buf);
+
+ msg (D_PROXY, "HTTP proxy returned: '%s'", buf);
+
+ /* parse return string */
+ nparms = sscanf (buf, "%*s %d", &status);
+ processed = true;
+#endif
+ }
+#if PROXY_DIGEST_AUTH
+ else if (p->auth_method == HTTP_AUTH_DIGEST && !processed)
+ {
+ char *pa = p->proxy_authenticate;
+ const int method = p->auth_method;
+ ASSERT(pa);
+
+ if (method == HTTP_AUTH_DIGEST)
+ {
+ const char *http_method = "CONNECT";
+ const char *nonce_count = "00000001";
+ const char *qop = "auth";
+ const char *username = p->up.username;
+ const char *password = p->up.password;
+ char *opaque_kv = "";
+ char uri[128];
+ uint8_t cnonce_raw[8];
+ uint8_t *cnonce;
+ HASHHEX session_key;
+ HASHHEX response;
+
+ const char *realm = get_pa_var("realm", pa, &gc);
+ const char *nonce = get_pa_var("nonce", pa, &gc);
+ const char *algor = get_pa_var("algorithm", pa, &gc);
+ const char *opaque = get_pa_var("opaque", pa, &gc);
+
+ /* generate a client nonce */
+ ASSERT(rand_bytes(cnonce_raw, sizeof(cnonce_raw)));
+ cnonce = make_base64_string2(cnonce_raw, sizeof(cnonce_raw), &gc);
+
+
+ /* build the digest response */
+ openvpn_snprintf (uri, sizeof(uri), "%s:%s",
+ host,
+ port);
+
+ if (opaque)
+ {
+ const int len = strlen(opaque)+16;
+ opaque_kv = gc_malloc(len, false, &gc);
+ openvpn_snprintf (opaque_kv, len, ", opaque=\"%s\"", opaque);
+ }
+
+ DigestCalcHA1(algor,
+ username,
+ realm,
+ password,
+ nonce,
+ (char *)cnonce,
+ session_key);
+ DigestCalcResponse(session_key,
+ nonce,
+ nonce_count,
+ (char *)cnonce,
+ qop,
+ http_method,
+ uri,
+ NULL,
+ response);
+
+ /* format HTTP CONNECT message */
+ openvpn_snprintf (buf, sizeof(buf), "%s %s HTTP/%s",
+ http_method,
+ uri,
+ p->options.http_version);
+
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+
+ /* send HTTP CONNECT message to proxy */
+ if (!send_line_crlf (sd, buf))
+ goto error;
+
+ /* send HOST etc, */
+ if (!add_proxy_headers (p, sd, host, port))
+ goto error;
+
+ /* send digest response */
+ openvpn_snprintf (buf, sizeof(buf), "Proxy-Authorization: Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", qop=%s, nc=%s, cnonce=\"%s\", response=\"%s\"%s",
+ username,
+ realm,
+ nonce,
+ uri,
+ qop,
+ nonce_count,
+ cnonce,
+ response,
+ opaque_kv
+ );
+ msg (D_PROXY, "Send to HTTP proxy: '%s'", buf);
+ if (!send_line_crlf (sd, buf))
+ goto error;
+ if (!send_crlf (sd))
+ goto error;
+
+ /* receive reply from proxy */
+ if (!recv_line (sd, buf, sizeof(buf), p->options.timeout, true, NULL, signal_received))
+ goto error;
+
+ /* remove trailing CR, LF */
+ chomp (buf);
+
+ msg (D_PROXY, "HTTP proxy returned: '%s'", buf);
+
+ /* parse return string */
+ nparms = sscanf (buf, "%*s %d", &status);
+ processed = true;
+ }
+ else
+ {
+ msg (D_PROXY, "HTTP proxy: digest method not supported");
+ goto error;
+ }
+ }
+#endif
+ else if (p->options.auth_retry)
+ {
+ /* figure out what kind of authentication the proxy needs */
+ char *pa = NULL;
+ const int method = get_proxy_authenticate(sd,
+ p->options.timeout,
+ &pa,
+ NULL,
+ signal_received);
+ if (method != HTTP_AUTH_NONE)
+ {
+ if (pa)
+ msg (D_PROXY, "HTTP proxy authenticate '%s'", pa);
+ if (p->options.auth_retry == PAR_NCT && method == HTTP_AUTH_BASIC)
+ {
+ msg (D_PROXY, "HTTP proxy: support for basic auth and other cleartext proxy auth methods is disabled");
+ goto error;
+ }
+ p->auth_method = method;
+ store_proxy_authenticate(p, pa);
+ ret = true;
+ goto done;
+ }
+ else
+ {
+ msg (D_PROXY, "HTTP proxy: do not recognize the authentication method required by proxy");
+ free (pa);
+ goto error;
+ }
+ }
+ else
+ {
+ if (!processed)
+ msg (D_PROXY, "HTTP proxy: no support for proxy authentication method");
+ goto error;
+ }
+
+ /* clear state */
+ if (p->options.auth_retry)
+ clear_user_pass_http();
+ store_proxy_authenticate(p, NULL);
+ }
+
+ /* check return code, success = 200 */
+ if (nparms < 1 || status != 200)
+ {
+ msg (D_LINK_ERRORS, "HTTP proxy returned bad status");
+#if 0
+ /* DEBUGGING -- show a multi-line HTTP error response */
+ dump_residual(sd, p->options.timeout, signal_received);
+#endif
+ goto error;
+ }
+
+ /* SUCCESS */
+
+ /* receive line from proxy and discard */
+ if (!recv_line (sd, NULL, 0, p->options.timeout, true, NULL, signal_received))
+ goto error;
+
+ /*
+ * Toss out any extraneous chars, but don't throw away the
+ * start of the OpenVPN data stream (put it in lookahead).
+ */
+ while (recv_line (sd, NULL, 0, 2, false, lookahead, signal_received))
+ ;
+
+ /* reset queried_creds so that we don't think that the next creds request is due to an auth error */
+ p->queried_creds = false;
+
+#if 0
+ if (lookahead && BLEN (lookahead))
+ msg (M_INFO, "HTTP PROXY: lookahead: %s", format_hex (BPTR (lookahead), BLEN (lookahead), 0));
+#endif
+
+ done:
+ gc_free (&gc);
+ return ret;
+
+ error:
+ /* on error, should we exit or restart? */
+ if (!*signal_received)
+ *signal_received = (p->options.retry ? SIGUSR1 : SIGTERM); /* SOFT-SIGUSR1 -- HTTP proxy error */
+ gc_free (&gc);
+ return ret;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.h
new file mode 100644
index 00000000..4715940c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/proxy.h
@@ -0,0 +1,95 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PROXY_H
+#define PROXY_H
+
+#include "buffer.h"
+#include "misc.h"
+
+/* HTTP CONNECT authentication methods */
+#define HTTP_AUTH_NONE 0
+#define HTTP_AUTH_BASIC 1
+#define HTTP_AUTH_DIGEST 2
+#define HTTP_AUTH_NTLM 3
+#define HTTP_AUTH_NTLM2 4
+#define HTTP_AUTH_N 5 /* number of HTTP_AUTH methods */
+
+struct http_custom_header {
+ const char *name;
+ const char *content;
+};
+
+#define MAX_CUSTOM_HTTP_HEADER 10
+struct http_proxy_options {
+ const char *server;
+ const char *port;
+ bool retry;
+ int timeout;
+
+# define PAR_NO 0 /* don't support any auth retries */
+# define PAR_ALL 1 /* allow all proxy auth protocols */
+# define PAR_NCT 2 /* disable cleartext proxy auth protocols */
+ int auth_retry;
+
+ const char *auth_method_string;
+ const char *auth_file;
+ const char *http_version;
+ const char *user_agent;
+ struct http_custom_header custom_headers[MAX_CUSTOM_HTTP_HEADER];
+};
+
+struct http_proxy_options_simple {
+ const char *server;
+ const char *port;
+ int auth_retry;
+};
+
+struct http_proxy_info {
+ bool defined;
+ int auth_method;
+ struct http_proxy_options options;
+ struct user_pass up;
+ char *proxy_authenticate;
+ bool queried_creds;
+};
+
+struct http_proxy_options *init_http_proxy_options_once (struct http_proxy_options **hpo,
+ struct gc_arena *gc);
+
+struct http_proxy_info *http_proxy_new (const struct http_proxy_options *o);
+
+void http_proxy_close (struct http_proxy_info *hp);
+
+bool establish_http_proxy_passthru (struct http_proxy_info *p,
+ socket_descriptor_t sd, /* already open to proxy */
+ const char *host, /* openvpn server remote */
+ const char *port, /* openvpn server port */
+ struct buffer *lookahead,
+ volatile int *signal_received);
+
+uint8_t *make_base64_string2 (const uint8_t *str, int str_len, struct gc_arena *gc);
+uint8_t *make_base64_string (const uint8_t *str, struct gc_arena *gc);
+
+#endif /* PROXY_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.c
new file mode 100644
index 00000000..6807aac0
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.c
@@ -0,0 +1,976 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if PORT_SHARE
+
+#include "event.h"
+#include "socket.h"
+#include "fdmisc.h"
+#include "crypto.h"
+#include "ps.h"
+
+#include "memdbg.h"
+
+struct port_share *port_share = NULL; /* GLOBAL */
+
+/* size of i/o buffers */
+#define PROXY_CONNECTION_BUFFER_SIZE 1500
+
+/* Command codes for foreground -> background communication */
+#define COMMAND_REDIRECT 10
+#define COMMAND_EXIT 11
+
+/* Response codes for background -> foreground communication */
+#define RESPONSE_INIT_SUCCEEDED 20
+#define RESPONSE_INIT_FAILED 21
+
+/*
+ * Return values for proxy_connection_io functions
+ */
+
+#define IOSTAT_EAGAIN_ON_READ 0 /* recv returned EAGAIN */
+#define IOSTAT_EAGAIN_ON_WRITE 1 /* send returned EAGAIN */
+#define IOSTAT_READ_ERROR 2 /* the other end of our read socket (pc) was closed */
+#define IOSTAT_WRITE_ERROR 3 /* the other end of our write socket (pc->counterpart) was closed */
+#define IOSTAT_GOOD 4 /* nothing to report */
+
+/*
+ * A foreign (non-OpenVPN) connection we are proxying,
+ * usually HTTPS
+ */
+struct proxy_connection {
+ bool defined;
+ struct proxy_connection *next;
+ struct proxy_connection *counterpart;
+ struct buffer buf;
+ bool buffer_initial;
+ int rwflags;
+ int sd;
+ char *jfn;
+};
+
+#if 0
+static const char *
+headc (const struct buffer *buf)
+{
+ static char foo[16];
+ strncpy (foo, BSTR(buf), 15);
+ foo[15] = 0;
+ return foo;
+}
+#endif
+
+static inline void
+close_socket_if_defined (const socket_descriptor_t sd)
+{
+ if (socket_defined (sd))
+ openvpn_close_socket (sd);
+}
+
+/*
+ * Close most of parent's fds.
+ * Keep stdin/stdout/stderr, plus one
+ * other fd which is presumed to be
+ * our pipe back to parent.
+ * Admittedly, a bit of a kludge,
+ * but posix doesn't give us a kind
+ * of FD_CLOEXEC which will stop
+ * fds from crossing a fork().
+ */
+static void
+close_fds_except (int keep)
+{
+ socket_descriptor_t i;
+ closelog ();
+ for (i = 3; i <= 100; ++i)
+ {
+ if (i != keep)
+ openvpn_close_socket (i);
+ }
+}
+
+/*
+ * Usually we ignore signals, because our parent will
+ * deal with them.
+ */
+static void
+set_signals (void)
+{
+ signal (SIGTERM, SIG_DFL);
+
+ signal (SIGINT, SIG_IGN);
+ signal (SIGHUP, SIG_IGN);
+ signal (SIGUSR1, SIG_IGN);
+ signal (SIGUSR2, SIG_IGN);
+ signal (SIGPIPE, SIG_IGN);
+}
+
+/*
+ * Socket read/write functions.
+ */
+
+static int
+recv_control (const socket_descriptor_t fd)
+{
+ unsigned char c;
+ const ssize_t size = read (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return c;
+ else
+ {
+ return -1;
+ }
+}
+
+static int
+send_control (const socket_descriptor_t fd, int code)
+{
+ unsigned char c = (unsigned char) code;
+ const ssize_t size = write (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return (int) size;
+ else
+ return -1;
+}
+
+static int
+cmsg_size ()
+{
+ return CMSG_SPACE(sizeof(socket_descriptor_t));
+}
+
+/*
+ * Send a command (char), data (head), and a file descriptor (sd_send) to a local process
+ * over unix socket sd. Unfortunately, there's no portable way to send file descriptors
+ * to other processes, so this code, as well as its analog (control_message_from_parent below),
+ * is Linux-specific. This function runs in the context of the main process and is used to
+ * send commands, data, and file descriptors to the background process.
+ */
+static void
+port_share_sendmsg (const socket_descriptor_t sd,
+ const char command,
+ const struct buffer *head,
+ const socket_descriptor_t sd_send)
+{
+ if (socket_defined (sd))
+ {
+ struct msghdr mesg;
+ struct cmsghdr* h;
+ struct iovec iov[2];
+ socket_descriptor_t sd_null[2] = { SOCKET_UNDEFINED, SOCKET_UNDEFINED };
+ char cmd;
+ ssize_t status;
+
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE: sendmsg sd=%d len=%d",
+ (int)sd_send,
+ head ? BLEN(head) : -1);
+
+ CLEAR (mesg);
+
+ cmd = command;
+
+ iov[0].iov_base = &cmd;
+ iov[0].iov_len = sizeof (cmd);
+ mesg.msg_iovlen = 1;
+
+ if (head)
+ {
+ iov[1].iov_base = BPTR (head);
+ iov[1].iov_len = BLEN (head);
+ mesg.msg_iovlen = 2;
+ }
+
+ mesg.msg_iov = iov;
+
+ mesg.msg_controllen = cmsg_size ();
+ mesg.msg_control = (char *) malloc (mesg.msg_controllen);
+ check_malloc_return (mesg.msg_control);
+ mesg.msg_flags = 0;
+
+ h = CMSG_FIRSTHDR(&mesg);
+ h->cmsg_level = SOL_SOCKET;
+ h->cmsg_type = SCM_RIGHTS;
+ h->cmsg_len = CMSG_LEN(sizeof(socket_descriptor_t));
+
+ if (socket_defined (sd_send))
+ {
+ *((socket_descriptor_t*)CMSG_DATA(h)) = sd_send;
+ }
+ else
+ {
+ socketpair (PF_UNIX, SOCK_DGRAM, 0, sd_null);
+ *((socket_descriptor_t*)CMSG_DATA(h)) = sd_null[0];
+ }
+
+ status = sendmsg (sd, &mesg, MSG_NOSIGNAL);
+ if (status == -1)
+ msg (M_WARN|M_ERRNO, "PORT SHARE: sendmsg failed -- unable to communicate with background process (%d,%d,%d,%d)",
+ sd, sd_send, sd_null[0], sd_null[1]
+ );
+
+ close_socket_if_defined (sd_null[0]);
+ close_socket_if_defined (sd_null[1]);
+ free (mesg.msg_control);
+ }
+}
+
+static void
+proxy_entry_close_sd (struct proxy_connection *pc, struct event_set *es)
+{
+ if (pc->defined && socket_defined (pc->sd))
+ {
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: delete sd=%d", (int)pc->sd);
+ if (es)
+ event_del (es, pc->sd);
+ openvpn_close_socket (pc->sd);
+ pc->sd = SOCKET_UNDEFINED;
+ }
+}
+
+/*
+ * Mark a proxy entry and its counterpart for close.
+ */
+static void
+proxy_entry_mark_for_close (struct proxy_connection *pc, struct event_set *es)
+{
+ if (pc->defined)
+ {
+ struct proxy_connection *cp = pc->counterpart;
+ proxy_entry_close_sd (pc, es);
+ free_buf (&pc->buf);
+ pc->buffer_initial = false;
+ pc->rwflags = 0;
+ pc->defined = false;
+ if (pc->jfn)
+ {
+ unlink (pc->jfn);
+ free (pc->jfn);
+ pc->jfn = NULL;
+ }
+ if (cp && cp->defined && cp->counterpart == pc)
+ proxy_entry_mark_for_close (cp, es);
+ }
+}
+
+/*
+ * Run through the proxy entry list and delete all entries marked
+ * for close.
+ */
+static void
+proxy_list_housekeeping (struct proxy_connection **list)
+{
+ if (list)
+ {
+ struct proxy_connection *prev = NULL;
+ struct proxy_connection *pc = *list;
+
+ while (pc)
+ {
+ struct proxy_connection *next = pc->next;
+ if (!pc->defined)
+ {
+ free (pc);
+ if (prev)
+ prev->next = next;
+ else
+ *list = next;
+ }
+ else
+ prev = pc;
+ pc = next;
+ }
+ }
+}
+
+/*
+ * Record IP/port of client in filesystem, so that server receiving
+ * the proxy can determine true client origin.
+ */
+static void
+journal_add (const char *journal_dir, struct proxy_connection *pc, struct proxy_connection *cp)
+{
+ struct gc_arena gc = gc_new ();
+ struct openvpn_sockaddr from, to;
+ socklen_t slen, dlen;
+ int fnlen;
+ char *jfn;
+ int fd;
+
+ slen = sizeof(from.addr.sa);
+ dlen = sizeof(to.addr.sa);
+ if (!getpeername (pc->sd, (struct sockaddr *) &from.addr.sa, &slen)
+ && !getsockname (cp->sd, (struct sockaddr *) &to.addr.sa, &dlen))
+ {
+ const char *f = print_openvpn_sockaddr (&from, &gc);
+ const char *t = print_openvpn_sockaddr (&to, &gc);
+ fnlen = strlen(journal_dir) + strlen(t) + 2;
+ jfn = (char *) malloc(fnlen);
+ check_malloc_return (jfn);
+ openvpn_snprintf (jfn, fnlen, "%s/%s", journal_dir, t);
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: client origin %s -> %s", jfn, f);
+ fd = platform_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP);
+ if (fd != -1)
+ {
+ if (write(fd, f, strlen(f)) != strlen(f))
+ msg(M_WARN, "PORT SHARE: writing to journal file (%s) failed", jfn);
+ close (fd);
+ cp->jfn = jfn;
+ }
+ else
+ {
+ msg (M_WARN|M_ERRNO, "PORT SHARE: unable to write journal file in %s", jfn);
+ free (jfn);
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Cleanup function, on proxy process exit.
+ */
+static void
+proxy_list_close (struct proxy_connection **list)
+{
+ if (list)
+ {
+ struct proxy_connection *pc = *list;
+ while (pc)
+ {
+ proxy_entry_mark_for_close (pc, NULL);
+ pc = pc->next;
+ }
+ proxy_list_housekeeping (list);
+ }
+}
+
+static void
+sock_addr_set (struct openvpn_sockaddr *osaddr,
+ const in_addr_t addr,
+ const int port)
+{
+ CLEAR (*osaddr);
+ osaddr->addr.in4.sin_family = AF_INET;
+ osaddr->addr.in4.sin_addr.s_addr = htonl (addr);
+ osaddr->addr.in4.sin_port = htons (port);
+}
+
+static inline void
+proxy_connection_io_requeue (struct proxy_connection *pc, const int rwflags_new, struct event_set *es)
+{
+ if (socket_defined (pc->sd) && pc->rwflags != rwflags_new)
+ {
+ /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags=%d", (int)pc->sd, rwflags_new);*/
+ event_ctl (es, pc->sd, rwflags_new, (void*)pc);
+ pc->rwflags = rwflags_new;
+ }
+}
+
+/*
+ * Create a new pair of proxy_connection entries, one for each
+ * socket file descriptor involved in the proxy. We are given
+ * the client fd, and we should derive our own server fd by connecting
+ * to the server given by server_addr/server_port. Return true
+ * on success and false on failure to connect to server.
+ */
+static bool
+proxy_entry_new (struct proxy_connection **list,
+ struct event_set *es,
+ const struct sockaddr_in server_addr,
+ const socket_descriptor_t sd_client,
+ struct buffer *initial_data,
+ const char *journal_dir)
+{
+ socket_descriptor_t sd_server;
+ int status;
+ struct proxy_connection *pc;
+ struct proxy_connection *cp;
+
+ /* connect to port share server */
+ if ((sd_server = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ {
+ msg (M_WARN|M_ERRNO, "PORT SHARE PROXY: cannot create socket");
+ return false;
+ }
+ status = openvpn_connect (sd_server,(const struct sockaddr*) &server_addr, 5, NULL);
+ if (status)
+ {
+ msg (M_WARN, "PORT SHARE PROXY: connect to port-share server failed");
+ openvpn_close_socket (sd_server);
+ return false;
+ }
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: connect to port-share server succeeded");
+
+ set_nonblock (sd_client);
+ set_nonblock (sd_server);
+
+ /* allocate 2 new proxy_connection objects */
+ ALLOC_OBJ_CLEAR (pc, struct proxy_connection);
+ ALLOC_OBJ_CLEAR (cp, struct proxy_connection);
+
+ /* client object */
+ pc->defined = true;
+ pc->next = cp;
+ pc->counterpart = cp;
+ pc->buf = *initial_data;
+ pc->buffer_initial = true;
+ pc->rwflags = EVENT_UNDEF;
+ pc->sd = sd_client;
+
+ /* server object */
+ cp->defined = true;
+ cp->next = *list;
+ cp->counterpart = pc;
+ cp->buf = alloc_buf (PROXY_CONNECTION_BUFFER_SIZE);
+ cp->buffer_initial = false;
+ cp->rwflags = EVENT_UNDEF;
+ cp->sd = sd_server;
+
+ /* add to list */
+ *list = pc;
+
+ /* add journal entry */
+ if (journal_dir)
+ journal_add (journal_dir, pc, cp);
+
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: NEW CONNECTION [c=%d s=%d]", (int)sd_client, (int)sd_server);
+
+ /* set initial i/o states */
+ proxy_connection_io_requeue (pc, EVENT_READ, es);
+ proxy_connection_io_requeue (cp, EVENT_READ|EVENT_WRITE, es);
+
+ return true;
+}
+
+/*
+ * This function runs in the context of the background proxy process.
+ * Receive a control message from the parent (sent by the port_share_sendmsg
+ * function above) and act on it. Return false if the proxy process should
+ * exit, true otherwise.
+ */
+static bool
+control_message_from_parent (const socket_descriptor_t sd_control,
+ struct proxy_connection **list,
+ struct event_set *es,
+ const struct sockaddr_in server_addr,
+ const int max_initial_buf,
+ const char *journal_dir)
+{
+ /* this buffer needs to be large enough to handle the largest buffer
+ that might be returned by the link_socket_read call in read_incoming_link. */
+ struct buffer buf = alloc_buf (max_initial_buf);
+
+ struct msghdr mesg;
+ struct cmsghdr* h;
+ struct iovec iov[2];
+ char command = 0;
+ ssize_t status;
+ int ret = true;
+
+ CLEAR (mesg);
+
+ iov[0].iov_base = &command;
+ iov[0].iov_len = sizeof (command);
+ iov[1].iov_base = BPTR (&buf);
+ iov[1].iov_len = BCAP (&buf);
+ mesg.msg_iov = iov;
+ mesg.msg_iovlen = 2;
+
+ mesg.msg_controllen = cmsg_size ();
+ mesg.msg_control = (char *) malloc (mesg.msg_controllen);
+ check_malloc_return (mesg.msg_control);
+ mesg.msg_flags = 0;
+
+ h = CMSG_FIRSTHDR(&mesg);
+ h->cmsg_len = CMSG_LEN(sizeof(socket_descriptor_t));
+ h->cmsg_level = SOL_SOCKET;
+ h->cmsg_type = SCM_RIGHTS;
+ *((socket_descriptor_t*)CMSG_DATA(h)) = SOCKET_UNDEFINED;
+
+ status = recvmsg (sd_control, &mesg, MSG_NOSIGNAL);
+ if (status != -1)
+ {
+ if ( h == NULL
+ || h->cmsg_len != CMSG_LEN(sizeof(socket_descriptor_t))
+ || h->cmsg_level != SOL_SOCKET
+ || h->cmsg_type != SCM_RIGHTS )
+ {
+ msg (M_WARN, "PORT SHARE PROXY: received unknown message");
+ }
+ else
+ {
+ const socket_descriptor_t received_fd = *((socket_descriptor_t*)CMSG_DATA(h));
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: RECEIVED sd=%d", (int)received_fd);
+
+ if (status >= 2 && command == COMMAND_REDIRECT)
+ {
+ buf.len = status - 1;
+ if (proxy_entry_new (list,
+ es,
+ server_addr,
+ received_fd,
+ &buf,
+ journal_dir))
+ {
+ CLEAR (buf); /* we gave the buffer to proxy_entry_new */
+ }
+ else
+ {
+ openvpn_close_socket (received_fd);
+ }
+ }
+ else if (status >= 1 && command == COMMAND_EXIT)
+ {
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: RECEIVED COMMAND_EXIT");
+ openvpn_close_socket (received_fd); /* null socket */
+ ret = false;
+ }
+ }
+ }
+ free (mesg.msg_control);
+ free_buf (&buf);
+ return ret;
+}
+
+static int
+proxy_connection_io_recv (struct proxy_connection *pc)
+{
+ /* recv data from socket */
+ const int status = recv (pc->sd, BPTR(&pc->buf), BCAP(&pc->buf), MSG_NOSIGNAL);
+ if (status < 0)
+ {
+ return (errno == EAGAIN) ? IOSTAT_EAGAIN_ON_READ : IOSTAT_READ_ERROR;
+ }
+ else
+ {
+ if (!status)
+ return IOSTAT_READ_ERROR;
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: read[%d] %d", (int)pc->sd, status);
+ pc->buf.len = status;
+ }
+ return IOSTAT_GOOD;
+}
+
+static int
+proxy_connection_io_send (struct proxy_connection *pc, int *bytes_sent)
+{
+ const socket_descriptor_t sd = pc->counterpart->sd;
+ const int status = send (sd, BPTR(&pc->buf), BLEN(&pc->buf), MSG_NOSIGNAL);
+
+ if (status < 0)
+ {
+ const int e = errno;
+ return (e == EAGAIN) ? IOSTAT_EAGAIN_ON_WRITE : IOSTAT_WRITE_ERROR;
+ }
+ else
+ {
+ *bytes_sent += status;
+ if (status != pc->buf.len)
+ {
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: partial write[%d], tried=%d got=%d", (int)sd, pc->buf.len, status);
+ buf_advance (&pc->buf, status);
+ return IOSTAT_EAGAIN_ON_WRITE;
+ }
+ else
+ {
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: wrote[%d] %d", (int)sd, status);
+ pc->buf.len = 0;
+ pc->buf.offset = 0;
+ }
+ }
+
+ /* realloc send buffer after initial send */
+ if (pc->buffer_initial)
+ {
+ free_buf (&pc->buf);
+ pc->buf = alloc_buf (PROXY_CONNECTION_BUFFER_SIZE);
+ pc->buffer_initial = false;
+ }
+ return IOSTAT_GOOD;
+}
+
+/*
+ * Forward data from pc to pc->counterpart.
+ */
+
+static int
+proxy_connection_io_xfer (struct proxy_connection *pc, const int max_transfer)
+{
+ int transferred = 0;
+ while (transferred < max_transfer)
+ {
+ if (!BLEN (&pc->buf))
+ {
+ const int status = proxy_connection_io_recv (pc);
+ if (status != IOSTAT_GOOD)
+ return status;
+ }
+
+ if (BLEN (&pc->buf))
+ {
+ const int status = proxy_connection_io_send (pc, &transferred);
+ if (status != IOSTAT_GOOD)
+ return status;
+ }
+ }
+ return IOSTAT_EAGAIN_ON_READ;
+}
+
+/*
+ * Decide how the receipt of an EAGAIN status should affect our next IO queueing.
+ */
+static bool
+proxy_connection_io_status (const int status, int *rwflags_pc, int *rwflags_cp)
+{
+ switch (status)
+ {
+ case IOSTAT_EAGAIN_ON_READ:
+ *rwflags_pc |= EVENT_READ;
+ *rwflags_cp &= ~EVENT_WRITE;
+ return true;
+ case IOSTAT_EAGAIN_ON_WRITE:
+ *rwflags_pc &= ~EVENT_READ;
+ *rwflags_cp |= EVENT_WRITE;
+ return true;
+ case IOSTAT_READ_ERROR:
+ return false;
+ case IOSTAT_WRITE_ERROR:
+ return false;
+ default:
+ msg (M_FATAL, "PORT SHARE PROXY: unexpected status=%d", status);
+ }
+ return false; /* NOTREACHED */
+}
+
+/*
+ * Dispatch function for forwarding data between the two socket fds involved
+ * in the proxied connection.
+ */
+static int
+proxy_connection_io_dispatch (struct proxy_connection *pc,
+ const int rwflags,
+ struct event_set *es)
+{
+ const int max_transfer_per_iteration = 10000;
+ struct proxy_connection *cp = pc->counterpart;
+ int rwflags_pc = pc->rwflags;
+ int rwflags_cp = cp->rwflags;
+
+ ASSERT(pc->defined && cp->defined && cp->counterpart == pc);
+
+ if (rwflags & EVENT_READ)
+ {
+ const int status = proxy_connection_io_xfer (pc, max_transfer_per_iteration);
+ if (!proxy_connection_io_status (status, &rwflags_pc, &rwflags_cp))
+ goto bad;
+ }
+ if (rwflags & EVENT_WRITE)
+ {
+ const int status = proxy_connection_io_xfer (cp, max_transfer_per_iteration);
+ if (!proxy_connection_io_status (status, &rwflags_cp, &rwflags_pc))
+ goto bad;
+ }
+ proxy_connection_io_requeue (pc, rwflags_pc, es);
+ proxy_connection_io_requeue (cp, rwflags_cp, es);
+
+ return true;
+
+ bad:
+ proxy_entry_mark_for_close (pc, es);
+ return false;
+}
+
+/*
+ * This is the main function for the port share proxy background process.
+ */
+static void
+port_share_proxy (const struct sockaddr_in hostaddr,
+ const socket_descriptor_t sd_control,
+ const int max_initial_buf,
+ const char *journal_dir)
+{
+ if (send_control (sd_control, RESPONSE_INIT_SUCCEEDED) >= 0)
+ {
+ void *sd_control_marker = (void *)1;
+ int maxevents = 256;
+ struct event_set *es;
+ struct event_set_return esr[64];
+ struct proxy_connection *list = NULL;
+ time_t last_housekeeping = 0;
+
+ msg (D_PS_PROXY, "PORT SHARE PROXY: proxy starting");
+
+ es = event_set_init (&maxevents, 0);
+ event_ctl (es, sd_control, EVENT_READ, sd_control_marker);
+ while (true)
+ {
+ int n_events;
+ struct timeval tv;
+ time_t current;
+
+ tv.tv_sec = 10;
+ tv.tv_usec = 0;
+ n_events = event_wait (es, &tv, esr, SIZE(esr));
+ /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: event_wait returned %d", n_events);*/
+ current = time(NULL);
+ if (n_events > 0)
+ {
+ int i;
+ for (i = 0; i < n_events; ++i)
+ {
+ const struct event_set_return *e = &esr[i];
+ if (e->arg == sd_control_marker)
+ {
+ if (!control_message_from_parent (sd_control, &list, es, hostaddr, max_initial_buf, journal_dir))
+ goto done;
+ }
+ else
+ {
+ struct proxy_connection *pc = (struct proxy_connection *)e->arg;
+ if (pc->defined)
+ proxy_connection_io_dispatch (pc, e->rwflags, es);
+ }
+ }
+ }
+ else if (n_events < 0)
+ {
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: event_wait failed");
+ }
+ if (current > last_housekeeping)
+ {
+ proxy_list_housekeeping (&list);
+ last_housekeeping = current;
+ }
+ }
+
+ done:
+ proxy_list_close (&list);
+ event_free (es);
+ }
+ msg (M_INFO, "PORT SHARE PROXY: proxy exiting");
+}
+
+/*
+ * Called from the main OpenVPN process to enable the port
+ * share proxy.
+ */
+struct port_share *
+port_share_open (const char *host,
+ const char *port,
+ const int max_initial_buf,
+ const char *journal_dir)
+{
+ pid_t pid;
+ socket_descriptor_t fd[2];
+ struct sockaddr_in hostaddr;
+ struct port_share *ps;
+ int status;
+ struct addrinfo* ai;
+
+ ALLOC_OBJ_CLEAR (ps, struct port_share);
+ ps->foreground_fd = -1;
+ ps->background_pid = -1;
+
+ /*
+ * Get host's IP address
+ */
+
+ status = openvpn_getaddrinfo (GETADDR_RESOLVE|GETADDR_FATAL,
+ host, port, 0, NULL, AF_INET, &ai);
+ ASSERT (status==0);
+ hostaddr = *((struct sockaddr_in*) ai->ai_addr);
+ freeaddrinfo(ai);
+
+ /*
+ * Make a socket for foreground and background processes
+ * to communicate.
+ */
+ if (socketpair (PF_UNIX, SOCK_DGRAM, 0, fd) == -1)
+ {
+ msg (M_WARN, "PORT SHARE: socketpair call failed");
+ goto error;
+ }
+
+ /*
+ * Fork off background proxy process.
+ */
+ pid = fork ();
+
+ if (pid)
+ {
+ int status;
+
+ /*
+ * Foreground Process
+ */
+
+ ps->background_pid = pid;
+
+ /* close our copy of child's socket */
+ openvpn_close_socket (fd[1]);
+
+ /* don't let future subprocesses inherit child socket */
+ set_cloexec (fd[0]);
+
+ /* wait for background child process to initialize */
+ status = recv_control (fd[0]);
+ if (status == RESPONSE_INIT_SUCCEEDED)
+ {
+ /* note that this will cause possible EAGAIN when writing to
+ control socket if proxy process is backlogged */
+ set_nonblock (fd[0]);
+
+ ps->foreground_fd = fd[0];
+ return ps;
+ }
+ else
+ {
+ msg (M_ERR, "PORT SHARE: unexpected init recv_control status=%d", status);
+ }
+ }
+ else
+ {
+ /*
+ * Background Process
+ */
+
+ /* Ignore most signals (the parent will receive them) */
+ set_signals ();
+
+ /* Let msg know that we forked */
+ msg_forked ();
+
+#ifdef ENABLE_MANAGEMENT
+ /* Don't interact with management interface */
+ management = NULL;
+#endif
+
+ /* close all parent fds except our socket back to parent */
+ close_fds_except (fd[1]);
+
+ /* no blocking on control channel back to parent */
+ set_nonblock (fd[1]);
+
+ /* initialize prng */
+ prng_init (NULL, 0);
+
+ /* execute the event loop */
+ port_share_proxy (hostaddr, fd[1], max_initial_buf, journal_dir);
+
+ openvpn_close_socket (fd[1]);
+
+ exit (0);
+ return 0; /* NOTREACHED */
+ }
+
+ error:
+ port_share_close (ps);
+ return NULL;
+}
+
+void
+port_share_close (struct port_share *ps)
+{
+ if (ps)
+ {
+ if (ps->foreground_fd >= 0)
+ {
+ /* tell background process to exit */
+ port_share_sendmsg (ps->foreground_fd, COMMAND_EXIT, NULL, SOCKET_UNDEFINED);
+
+ /* wait for background process to exit */
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE: waiting for background process to exit");
+ if (ps->background_pid > 0)
+ waitpid (ps->background_pid, NULL, 0);
+ dmsg (D_PS_PROXY_DEBUG, "PORT SHARE: background process exited");
+
+ openvpn_close_socket (ps->foreground_fd);
+ ps->foreground_fd = -1;
+ }
+
+ free (ps);
+ }
+}
+
+void
+port_share_abort (struct port_share *ps)
+{
+ if (ps)
+ {
+ /* tell background process to exit */
+ if (ps->foreground_fd >= 0)
+ {
+ send_control (ps->foreground_fd, COMMAND_EXIT);
+ openvpn_close_socket (ps->foreground_fd);
+ ps->foreground_fd = -1;
+ }
+ }
+}
+
+/*
+ * Given either the first 2 or 3 bytes of an initial client -> server
+ * data payload, return true if the protocol is that of an OpenVPN
+ * client attempting to connect with an OpenVPN server.
+ */
+bool
+is_openvpn_protocol (const struct buffer *buf)
+{
+ const unsigned char *p = (const unsigned char *) BSTR (buf);
+ const int len = BLEN (buf);
+ if (len >= 3)
+ {
+ return p[0] == 0
+ && p[1] >= 14
+ && p[2] == (P_CONTROL_HARD_RESET_CLIENT_V2<<P_OPCODE_SHIFT);
+ }
+ else if (len >= 2)
+ {
+ return p[0] == 0 && p[1] >= 14;
+ }
+ else
+ return true;
+}
+
+/*
+ * Called from the foreground process. Send a message to the background process that it
+ * should proxy the TCP client on sd to the host/port defined in the initial port_share_open
+ * call.
+ */
+void
+port_share_redirect (struct port_share *ps, const struct buffer *head, socket_descriptor_t sd)
+{
+ if (ps)
+ {
+ port_share_sendmsg (ps->foreground_fd, COMMAND_REDIRECT, head, sd);
+ }
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.h
new file mode 100644
index 00000000..e8919d48
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ps.h
@@ -0,0 +1,59 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PS_H
+#define PS_H
+
+#if PORT_SHARE
+
+#include "basic.h"
+#include "buffer.h"
+#include "ssl.h"
+
+typedef void (*post_fork_cleanup_func_t)(void *arg);
+
+struct port_share {
+ /* Foreground's socket to background process */
+ socket_descriptor_t foreground_fd;
+
+ /* Process ID of background process */
+ pid_t background_pid;
+};
+
+extern struct port_share *port_share;
+
+struct port_share *port_share_open (const char *host,
+ const char *port,
+ const int max_initial_buf,
+ const char *journal_dir);
+
+void port_share_close (struct port_share *ps);
+void port_share_abort (struct port_share *ps);
+
+bool is_openvpn_protocol (const struct buffer *buf);
+
+void port_share_redirect (struct port_share *ps, const struct buffer *head, socket_descriptor_t sd);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/push.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/push.c
new file mode 100644
index 00000000..028d838e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/push.c
@@ -0,0 +1,559 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "push.h"
+#include "options.h"
+#include "ssl.h"
+#include "ssl_verify.h"
+#include "manage.h"
+
+#include "memdbg.h"
+
+#if P2MP
+
+/*
+ * Auth username/password
+ *
+ * Client received an authentication failed message from server.
+ * Runs on client.
+ */
+void
+receive_auth_failed (struct context *c, const struct buffer *buffer)
+{
+ msg (M_VERB0, "AUTH: Received control message: %s", BSTR(buffer));
+ c->options.no_advance=true;
+
+ if (c->options.pull)
+ {
+ switch (auth_retry_get ())
+ {
+ case AR_NONE:
+ c->sig->signal_received = SIGTERM; /* SOFT-SIGTERM -- Auth failure error */
+ break;
+ case AR_INTERACT:
+ ssl_purge_auth (false);
+ case AR_NOINTERACT:
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- Auth failure error */
+ break;
+ default:
+ ASSERT (0);
+ }
+ c->sig->signal_text = "auth-failure";
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ const char *reason = NULL;
+ struct buffer buf = *buffer;
+ if (buf_string_compare_advance (&buf, "AUTH_FAILED,") && BLEN (&buf))
+ reason = BSTR (&buf);
+ management_auth_failure (management, UP_TYPE_AUTH, reason);
+ } else
+#endif
+ {
+#ifdef ENABLE_CLIENT_CR
+ struct buffer buf = *buffer;
+ if (buf_string_match_head_str (&buf, "AUTH_FAILED,CRV1:") && BLEN (&buf))
+ {
+ buf_advance (&buf, 12); /* Length of "AUTH_FAILED," substring */
+ ssl_put_auth_challenge (BSTR (&buf));
+ }
+#endif
+ }
+ }
+}
+
+/*
+ * Act on received restart message from server
+ */
+void
+server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv)
+{
+ if (c->options.pull)
+ {
+ struct buffer buf = *buffer;
+ const char *m = "";
+ if (buf_advance (&buf, adv) && buf_read_u8 (&buf) == ',' && BLEN (&buf))
+ m = BSTR (&buf);
+
+ /* preserve cached passwords? */
+ {
+ bool purge = true;
+
+ if (m[0] == '[')
+ {
+ int i;
+ for (i = 1; m[i] != '\0' && m[i] != ']'; ++i)
+ {
+ if (m[i] == 'P')
+ purge = false;
+ }
+ }
+ if (purge)
+ ssl_purge_auth (true);
+ }
+
+ if (restart)
+ {
+ msg (D_STREAM_ERRORS, "Connection reset command was pushed by server ('%s')", m);
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- server-pushed connection reset */
+ c->sig->signal_text = "server-pushed-connection-reset";
+ }
+ else
+ {
+ msg (D_STREAM_ERRORS, "Halt command was pushed by server ('%s')", m);
+ c->sig->signal_received = SIGTERM; /* SOFT-SIGTERM -- server-pushed halt */
+ c->sig->signal_text = "server-pushed-halt";
+ }
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_notify (management, "info", c->sig->signal_text, m);
+#endif
+ }
+}
+
+#if P2MP_SERVER
+
+/*
+ * Send auth failed message from server to client.
+ */
+void
+send_auth_failed (struct context *c, const char *client_reason)
+{
+ struct gc_arena gc = gc_new ();
+ static const char auth_failed[] = "AUTH_FAILED";
+ size_t len;
+
+ schedule_exit (c, c->options.scheduled_exit_interval, SIGTERM);
+
+ len = (client_reason ? strlen(client_reason)+1 : 0) + sizeof(auth_failed);
+ if (len > PUSH_BUNDLE_SIZE)
+ len = PUSH_BUNDLE_SIZE;
+
+ {
+ struct buffer buf = alloc_buf_gc (len, &gc);
+ buf_printf (&buf, auth_failed);
+ if (client_reason)
+ buf_printf (&buf, ",%s", client_reason);
+ send_control_channel_string (c, BSTR (&buf), D_PUSH);
+ }
+
+ gc_free (&gc);
+}
+
+/*
+ * Send restart message from server to client.
+ */
+void
+send_restart (struct context *c, const char *kill_msg)
+{
+ schedule_exit (c, c->options.scheduled_exit_interval, SIGTERM);
+ send_control_channel_string (c, kill_msg ? kill_msg : "RESTART", D_PUSH);
+}
+
+#endif
+
+/*
+ * Push/Pull
+ */
+
+void
+incoming_push_message (struct context *c, const struct buffer *buffer)
+{
+ struct gc_arena gc = gc_new ();
+ unsigned int option_types_found = 0;
+ int status;
+
+ msg (D_PUSH, "PUSH: Received control message: '%s'", sanitize_control_message(BSTR(buffer), &gc));
+
+ status = process_incoming_push_msg (c,
+ buffer,
+ c->options.pull,
+ pull_permission_mask (c),
+ &option_types_found);
+
+ if (status == PUSH_MSG_ERROR)
+ msg (D_PUSH_ERRORS, "WARNING: Received bad push/pull message: %s", sanitize_control_message(BSTR(buffer), &gc));
+ else if (status == PUSH_MSG_REPLY || status == PUSH_MSG_CONTINUATION)
+ {
+ c->options.push_option_types_found |= option_types_found;
+
+ if (status == PUSH_MSG_REPLY)
+ do_up (c, true, c->options.push_option_types_found ); /* delay bringing tun/tap up until --push parms received from remote */
+ event_timeout_clear (&c->c2.push_request_interval);
+ }
+
+ gc_free (&gc);
+}
+
+bool
+send_push_request (struct context *c)
+{
+ const int max_push_requests = c->options.handshake_window / PUSH_REQUEST_INTERVAL;
+ if (++c->c2.n_sent_push_requests <= max_push_requests)
+ {
+ return send_control_channel_string (c, "PUSH_REQUEST", D_PUSH);
+ }
+ else
+ {
+ msg (D_STREAM_ERRORS, "No reply from server after sending %d push requests", max_push_requests);
+ c->sig->signal_received = SIGUSR1; /* SOFT-SIGUSR1 -- server-pushed connection reset */
+ c->sig->signal_text = "no-push-reply";
+ return false;
+ }
+}
+
+#if P2MP_SERVER
+
+bool
+send_push_reply (struct context *c)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer buf = alloc_buf_gc (PUSH_BUNDLE_SIZE, &gc);
+ struct push_entry *e = c->options.push_list.head;
+ bool multi_push = false;
+ static char cmd[] = "PUSH_REPLY";
+ const int extra = 84; /* extra space for possible trailing ifconfig and push-continuation */
+ const int safe_cap = BCAP (&buf) - extra;
+ bool push_sent = false;
+
+ msg( M_INFO, "send_push_reply(): safe_cap=%d", safe_cap );
+
+ buf_printf (&buf, "%s", cmd);
+
+ if ( c->c2.push_ifconfig_ipv6_defined )
+ {
+ /* IPv6 is put into buffer first, could be lengthy */
+ buf_printf( &buf, ",ifconfig-ipv6 %s/%d %s",
+ print_in6_addr( c->c2.push_ifconfig_ipv6_local, 0, &gc),
+ c->c2.push_ifconfig_ipv6_netbits,
+ print_in6_addr( c->c2.push_ifconfig_ipv6_remote, 0, &gc) );
+ if (BLEN (&buf) >= safe_cap)
+ {
+ msg (M_WARN, "--push ifconfig-ipv6 option is too long");
+ goto fail;
+ }
+ }
+
+ while (e)
+ {
+ if (e->enable)
+ {
+ const int l = strlen (e->option);
+ if (BLEN (&buf) + l >= safe_cap)
+ {
+ buf_printf (&buf, ",push-continuation 2");
+ {
+ const bool status = send_control_channel_string (c, BSTR (&buf), D_PUSH);
+ if (!status)
+ goto fail;
+ push_sent = true;
+ multi_push = true;
+ buf_reset_len (&buf);
+ buf_printf (&buf, "%s", cmd);
+ }
+ }
+ if (BLEN (&buf) + l >= safe_cap)
+ {
+ msg (M_WARN, "--push option is too long");
+ goto fail;
+ }
+ buf_printf (&buf, ",%s", e->option);
+ }
+ e = e->next;
+ }
+
+ if (c->c2.push_ifconfig_defined && c->c2.push_ifconfig_local && c->c2.push_ifconfig_remote_netmask)
+ {
+ in_addr_t ifconfig_local = c->c2.push_ifconfig_local;
+ if (c->c2.push_ifconfig_local_alias)
+ ifconfig_local = c->c2.push_ifconfig_local_alias;
+ buf_printf (&buf, ",ifconfig %s %s",
+ print_in_addr_t (ifconfig_local, 0, &gc),
+ print_in_addr_t (c->c2.push_ifconfig_remote_netmask, 0, &gc));
+ }
+ if (multi_push)
+ buf_printf (&buf, ",push-continuation 1");
+
+ /* Send session_id if client supports it */
+ if (c->c2.tls_multi->peer_info && strstr(c->c2.tls_multi->peer_info, "IV_PROTO=2")) {
+ buf_printf(&buf, ",session_id %d", c->c2.tls_multi->vpn_session_id);
+ }
+
+ if (BLEN (&buf) > sizeof(cmd)-1)
+ {
+ const bool status = send_control_channel_string (c, BSTR (&buf), D_PUSH);
+ if (!status)
+ goto fail;
+ push_sent = true;
+ }
+
+ /* If nothing have been pushed, send an empty push,
+ * as the client is expecting a response
+ */
+ if (!push_sent)
+ {
+ bool status = false;
+
+ buf_reset_len (&buf);
+ buf_printf (&buf, "%s", cmd);
+ status = send_control_channel_string (c, BSTR(&buf), D_PUSH);
+ if (!status)
+ goto fail;
+ }
+
+ gc_free (&gc);
+ return true;
+
+ fail:
+ gc_free (&gc);
+ return false;
+}
+
+static void
+push_option_ex (struct options *o, const char *opt, bool enable, int msglevel)
+{
+ if (!string_class (opt, CC_ANY, CC_COMMA))
+ {
+ msg (msglevel, "PUSH OPTION FAILED (illegal comma (',') in string): '%s'", opt);
+ }
+ else
+ {
+ struct push_entry *e;
+ ALLOC_OBJ_CLEAR_GC (e, struct push_entry, &o->gc);
+ e->enable = true;
+ e->option = opt;
+ if (o->push_list.head)
+ {
+ ASSERT(o->push_list.tail);
+ o->push_list.tail->next = e;
+ o->push_list.tail = e;
+ }
+ else
+ {
+ ASSERT(!o->push_list.tail);
+ o->push_list.head = e;
+ o->push_list.tail = e;
+ }
+ }
+}
+
+void
+push_option (struct options *o, const char *opt, int msglevel)
+{
+ push_option_ex (o, opt, true, msglevel);
+}
+
+void
+clone_push_list (struct options *o)
+{
+ if (o->push_list.head)
+ {
+ const struct push_entry *e = o->push_list.head;
+ push_reset (o);
+ while (e)
+ {
+ push_option_ex (o, string_alloc (e->option, &o->gc), true, M_FATAL);
+ e = e->next;
+ }
+ }
+}
+
+void
+push_options (struct options *o, char **p, int msglevel, struct gc_arena *gc)
+{
+ const char **argv = make_extended_arg_array (p, gc);
+ char *opt = print_argv (argv, gc, 0);
+ push_option (o, opt, msglevel);
+}
+
+void
+push_reset (struct options *o)
+{
+ CLEAR (o->push_list);
+}
+#endif
+
+int
+process_incoming_push_msg (struct context *c,
+ const struct buffer *buffer,
+ bool honor_received_options,
+ unsigned int permission_mask,
+ unsigned int *option_types_found)
+{
+ int ret = PUSH_MSG_ERROR;
+ struct buffer buf = *buffer;
+
+#if P2MP_SERVER
+ if (buf_string_compare_advance (&buf, "PUSH_REQUEST"))
+ {
+ if (tls_authentication_status (c->c2.tls_multi, 0) == TLS_AUTHENTICATION_FAILED || c->c2.context_auth == CAS_FAILED)
+ {
+ const char *client_reason = tls_client_reason (c->c2.tls_multi);
+ send_auth_failed (c, client_reason);
+ ret = PUSH_MSG_AUTH_FAILURE;
+ }
+ else if (!c->c2.push_reply_deferred && c->c2.context_auth == CAS_SUCCEEDED)
+ {
+ time_t now;
+
+ openvpn_time(&now);
+ if (c->c2.sent_push_reply_expiry > now)
+ {
+ ret = PUSH_MSG_ALREADY_REPLIED;
+ }
+ else
+ {
+ if (send_push_reply (c))
+ {
+ ret = PUSH_MSG_REQUEST;
+ c->c2.sent_push_reply_expiry = now + 30;
+ }
+ }
+ }
+ else
+ {
+ ret = PUSH_MSG_REQUEST_DEFERRED;
+ }
+ }
+ else
+#endif
+
+ if (honor_received_options && buf_string_compare_advance (&buf, "PUSH_REPLY"))
+ {
+ const uint8_t ch = buf_read_u8 (&buf);
+ if (ch == ',')
+ {
+ struct buffer buf_orig = buf;
+ if (!c->c2.pulled_options_md5_init_done)
+ {
+ md5_state_init (&c->c2.pulled_options_state);
+ c->c2.pulled_options_md5_init_done = true;
+ }
+ if (!c->c2.did_pre_pull_restore)
+ {
+ pre_pull_restore (&c->options, &c->c2.gc);
+ c->c2.did_pre_pull_restore = true;
+ }
+ if (apply_push_options (&c->options,
+ &buf,
+ permission_mask,
+ option_types_found,
+ c->c2.es,
+ c->c2.tls_multi))
+ switch (c->options.push_continuation)
+ {
+ case 0:
+ case 1:
+ md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
+ md5_state_final (&c->c2.pulled_options_state, &c->c2.pulled_options_digest);
+ c->c2.pulled_options_md5_init_done = false;
+ ret = PUSH_MSG_REPLY;
+ break;
+ case 2:
+ md5_state_update (&c->c2.pulled_options_state, BPTR(&buf_orig), BLEN(&buf_orig));
+ ret = PUSH_MSG_CONTINUATION;
+ break;
+ }
+ }
+ else if (ch == '\0')
+ {
+ ret = PUSH_MSG_REPLY;
+ }
+ /* show_settings (&c->options); */
+ }
+ return ret;
+}
+
+#if P2MP_SERVER
+
+/*
+ * Remove iroutes from the push_list.
+ */
+void
+remove_iroutes_from_push_route_list (struct options *o)
+{
+ if (o && o->push_list.head && o->iroutes)
+ {
+ struct gc_arena gc = gc_new ();
+ struct push_entry *e = o->push_list.head;
+
+ /* cycle through the push list */
+ while (e)
+ {
+ char *p[MAX_PARMS];
+ bool enable = true;
+
+ /* parse the push item */
+ CLEAR (p);
+ if (parse_line (e->option, p, SIZE (p), "[PUSH_ROUTE_REMOVE]", 1, D_ROUTE_DEBUG, &gc))
+ {
+ /* is the push item a route directive? */
+ if (p[0] && !strcmp (p[0], "route") && !p[3])
+ {
+ /* get route parameters */
+ bool status1, status2;
+ const in_addr_t network = getaddr (GETADDR_HOST_ORDER, p[1], 0, &status1, NULL);
+ const in_addr_t netmask = getaddr (GETADDR_HOST_ORDER, p[2] ? p[2] : "255.255.255.255", 0, &status2, NULL);
+
+ /* did route parameters parse correctly? */
+ if (status1 && status2)
+ {
+ const struct iroute *ir;
+
+ /* does route match an iroute? */
+ for (ir = o->iroutes; ir != NULL; ir = ir->next)
+ {
+ if (network == ir->network && netmask == netbits_to_netmask (ir->netbits >= 0 ? ir->netbits : 32))
+ {
+ enable = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /* should we copy the push item? */
+ e->enable = enable;
+ if (!enable)
+ msg (D_PUSH, "REMOVE PUSH ROUTE: '%s'", e->option);
+
+ e = e->next;
+ }
+
+ gc_free (&gc);
+ }
+}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/push.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/push.h
new file mode 100644
index 00000000..8c3f1575
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/push.h
@@ -0,0 +1,74 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PUSH_H
+#define PUSH_H
+
+#if P2MP
+
+#include "forward.h"
+
+#define PUSH_MSG_ERROR 0
+#define PUSH_MSG_REQUEST 1
+#define PUSH_MSG_REPLY 2
+#define PUSH_MSG_REQUEST_DEFERRED 3
+#define PUSH_MSG_AUTH_FAILURE 4
+#define PUSH_MSG_CONTINUATION 5
+#define PUSH_MSG_ALREADY_REPLIED 6
+
+void incoming_push_message (struct context *c,
+ const struct buffer *buffer);
+
+int process_incoming_push_msg (struct context *c,
+ const struct buffer *buffer,
+ bool honor_received_options,
+ unsigned int permission_mask,
+ unsigned int *option_types_found);
+
+bool send_push_request (struct context *c);
+
+void receive_auth_failed (struct context *c, const struct buffer *buffer);
+
+void server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv);
+
+#if P2MP_SERVER
+
+void clone_push_list (struct options *o);
+
+void push_option (struct options *o, const char *opt, int msglevel);
+void push_options (struct options *o, char **p, int msglevel, struct gc_arena *gc);
+
+void push_reset (struct options *o);
+
+bool send_push_reply (struct context *c);
+
+void remove_iroutes_from_push_route_list (struct options *o);
+
+void send_auth_failed (struct context *c, const char *client_reason);
+
+void send_restart (struct context *c, const char *kill_msg);
+
+#endif
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/pushlist.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/pushlist.h
new file mode 100644
index 00000000..b2526761
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/pushlist.h
@@ -0,0 +1,42 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#if !defined(PUSHLIST_H) && P2MP && P2MP_SERVER
+#define PUSHLIST_H
+
+/* parameters to be pushed to peer */
+
+struct push_entry {
+ struct push_entry *next;
+ bool enable;
+ const char *option;
+};
+
+struct push_list {
+ struct push_entry *head;
+ struct push_entry *tail;
+};
+
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.c
new file mode 100644
index 00000000..763169ed
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.c
@@ -0,0 +1,757 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * These routines implement a reliability layer on top of UDP,
+ * so that SSL/TLS can be run over UDP.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "buffer.h"
+#include "error.h"
+#include "common.h"
+#include "reliable.h"
+
+#include "memdbg.h"
+
+/*
+ * verify that test - base < extent while allowing for base or test wraparound
+ */
+static inline bool
+reliable_pid_in_range1 (const packet_id_type test,
+ const packet_id_type base,
+ const unsigned int extent)
+{
+ if (test >= base)
+ {
+ if (test - base < extent)
+ return true;
+ }
+ else
+ {
+ if ((test+0x80000000u) - (base+0x80000000u) < extent)
+ return true;
+ }
+
+ return false;
+}
+
+/*
+ * verify that test < base + extent while allowing for base or test wraparound
+ */
+static inline bool
+reliable_pid_in_range2 (const packet_id_type test,
+ const packet_id_type base,
+ const unsigned int extent)
+{
+ if (base + extent >= base)
+ {
+ if (test < base + extent)
+ return true;
+ }
+ else
+ {
+ if ((test+0x80000000u) < (base+0x80000000u) + extent)
+ return true;
+ }
+
+ return false;
+}
+
+/*
+ * verify that p1 < p2 while allowing for p1 or p2 wraparound
+ */
+static inline bool
+reliable_pid_min (const packet_id_type p1,
+ const packet_id_type p2)
+{
+ return !reliable_pid_in_range1 (p1, p2, 0x80000000u);
+}
+
+/* check if a particular packet_id is present in ack */
+static inline bool
+reliable_ack_packet_id_present (struct reliable_ack *ack, packet_id_type pid)
+{
+ int i;
+ for (i = 0; i < ack->len; ++i)
+ if (ack->packet_id[i] == pid)
+ return true;
+ return false;
+}
+
+/* get a packet_id from buf */
+bool
+reliable_ack_read_packet_id (struct buffer *buf, packet_id_type *pid)
+{
+ packet_id_type net_pid;
+
+ if (buf_read (buf, &net_pid, sizeof (net_pid)))
+ {
+ *pid = ntohpid (net_pid);
+ dmsg (D_REL_DEBUG, "ACK read ID " packet_id_format " (buf->len=%d)",
+ (packet_id_print_type)*pid, buf->len);
+ return true;
+ }
+
+ dmsg (D_REL_LOW, "ACK read ID FAILED (buf->len=%d)", buf->len);
+ return false;
+}
+
+/* acknowledge a packet_id by adding it to a struct reliable_ack */
+bool
+reliable_ack_acknowledge_packet_id (struct reliable_ack *ack, packet_id_type pid)
+{
+ if (!reliable_ack_packet_id_present (ack, pid) && ack->len < RELIABLE_ACK_SIZE)
+ {
+ ack->packet_id[ack->len++] = pid;
+ dmsg (D_REL_DEBUG, "ACK acknowledge ID " packet_id_format " (ack->len=%d)",
+ (packet_id_print_type)pid, ack->len);
+ return true;
+ }
+
+ dmsg (D_REL_LOW, "ACK acknowledge ID " packet_id_format " FAILED (ack->len=%d)",
+ (packet_id_print_type)pid, ack->len);
+ return false;
+}
+
+/* read a packet ID acknowledgement record from buf into ack */
+bool
+reliable_ack_read (struct reliable_ack * ack,
+ struct buffer * buf, const struct session_id * sid)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ uint8_t count;
+ packet_id_type net_pid;
+ packet_id_type pid;
+ struct session_id session_id_remote;
+
+ if (!buf_read (buf, &count, sizeof (count)))
+ goto error;
+ for (i = 0; i < count; ++i)
+ {
+ if (!buf_read (buf, &net_pid, sizeof (net_pid)))
+ goto error;
+ if (ack->len >= RELIABLE_ACK_SIZE)
+ goto error;
+ pid = ntohpid (net_pid);
+ ack->packet_id[ack->len++] = pid;
+ }
+ if (count)
+ {
+ if (!session_id_read (&session_id_remote, buf))
+ goto error;
+ if (!session_id_defined (&session_id_remote) ||
+ !session_id_equal (&session_id_remote, sid))
+ {
+ dmsg (D_REL_LOW,
+ "ACK read BAD SESSION-ID FROM REMOTE, local=%s, remote=%s",
+ session_id_print (sid, &gc), session_id_print (&session_id_remote, &gc));
+ goto error;
+ }
+ }
+ gc_free (&gc);
+ return true;
+
+error:
+ gc_free (&gc);
+ return false;
+}
+
+#define ACK_SIZE(n) (sizeof (uint8_t) + ((n) ? SID_SIZE : 0) + sizeof (packet_id_type) * (n))
+
+/* write a packet ID acknowledgement record to buf, */
+/* removing all acknowledged entries from ack */
+bool
+reliable_ack_write (struct reliable_ack * ack,
+ struct buffer * buf,
+ const struct session_id * sid, int max, bool prepend)
+{
+ int i, j;
+ uint8_t n;
+ struct buffer sub;
+
+ n = ack->len;
+ if (n > max)
+ n = max;
+ sub = buf_sub (buf, ACK_SIZE(n), prepend);
+ if (!BDEF (&sub))
+ goto error;
+ ASSERT (buf_write (&sub, &n, sizeof (n)));
+ for (i = 0; i < n; ++i)
+ {
+ packet_id_type pid = ack->packet_id[i];
+ packet_id_type net_pid = htonpid (pid);
+ ASSERT (buf_write (&sub, &net_pid, sizeof (net_pid)));
+ dmsg (D_REL_DEBUG, "ACK write ID " packet_id_format " (ack->len=%d, n=%d)", (packet_id_print_type)pid, ack->len, n);
+ }
+ if (n)
+ {
+ ASSERT (session_id_defined (sid));
+ ASSERT (session_id_write (sid, &sub));
+ for (i = 0, j = n; j < ack->len;)
+ ack->packet_id[i++] = ack->packet_id[j++];
+ ack->len = i;
+ }
+
+ return true;
+
+error:
+ return false;
+}
+
+/* add to extra_frame the maximum number of bytes we will need for reliable_ack_write */
+void
+reliable_ack_adjust_frame_parameters (struct frame* frame, int max)
+{
+ frame_add_to_extra_frame (frame, ACK_SIZE (max));
+}
+
+/* print a reliable ACK record coming off the wire */
+const char *
+reliable_ack_print (struct buffer *buf, bool verbose, struct gc_arena *gc)
+{
+ int i;
+ uint8_t n_ack;
+ struct session_id sid_ack;
+ packet_id_type pid;
+ struct buffer out = alloc_buf_gc (256, gc);
+
+ buf_printf (&out, "[");
+ if (!buf_read (buf, &n_ack, sizeof (n_ack)))
+ goto done;
+ for (i = 0; i < n_ack; ++i)
+ {
+ if (!buf_read (buf, &pid, sizeof (pid)))
+ goto done;
+ pid = ntohpid (pid);
+ buf_printf (&out, " " packet_id_format, (packet_id_print_type)pid);
+ }
+ if (n_ack)
+ {
+ if (!session_id_read (&sid_ack, buf))
+ goto done;
+ if (verbose)
+ buf_printf (&out, " sid=%s", session_id_print (&sid_ack, gc));
+ }
+
+ done:
+ buf_printf (&out, " ]");
+ return BSTR (&out);
+}
+
+/*
+ * struct reliable member functions.
+ */
+
+void
+reliable_init (struct reliable *rel, int buf_size, int offset, int array_size, bool hold)
+{
+ int i;
+
+ CLEAR (*rel);
+ ASSERT (array_size > 0 && array_size <= RELIABLE_CAPACITY);
+ rel->hold = hold;
+ rel->size = array_size;
+ rel->offset = offset;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ e->buf = alloc_buf (buf_size);
+ ASSERT (buf_init (&e->buf, offset));
+ }
+}
+
+void
+reliable_free (struct reliable *rel)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ free_buf (&e->buf);
+ }
+}
+
+/* no active buffers? */
+bool
+reliable_empty (const struct reliable *rel)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ return false;
+ }
+ return true;
+}
+
+/* del acknowledged items from send buf */
+void
+reliable_send_purge (struct reliable *rel, struct reliable_ack *ack)
+{
+ int i, j;
+ for (i = 0; i < ack->len; ++i)
+ {
+ packet_id_type pid = ack->packet_id[i];
+ for (j = 0; j < rel->size; ++j)
+ {
+ struct reliable_entry *e = &rel->array[j];
+ if (e->active && e->packet_id == pid)
+ {
+ dmsg (D_REL_DEBUG,
+ "ACK received for pid " packet_id_format ", deleting from send buffer",
+ (packet_id_print_type)pid);
+#if 0
+ /* DEBUGGING -- how close were we timing out on ACK failure and resending? */
+ {
+ if (e->next_try)
+ {
+ const interval_t wake = e->next_try - now;
+ msg (M_INFO, "ACK " packet_id_format ", wake=%d", pid, wake);
+ }
+ }
+#endif
+ e->active = false;
+ break;
+ }
+ }
+ }
+}
+
+/* print the current sequence of active packet IDs */
+static const char *
+reliable_print_ids (const struct reliable *rel, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ int i;
+
+ buf_printf (&out, "[" packet_id_format "]", (packet_id_print_type)rel->packet_id);
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ buf_printf (&out, " " packet_id_format, (packet_id_print_type)e->packet_id);
+ }
+ return BSTR (&out);
+}
+
+/* true if at least one free buffer available */
+bool
+reliable_can_get (const struct reliable *rel)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (!e->active)
+ return true;
+ }
+ dmsg (D_REL_LOW, "ACK no free receive buffer available: %s", reliable_print_ids (rel, &gc));
+ gc_free (&gc);
+ return false;
+}
+
+/* make sure that incoming packet ID isn't a replay */
+bool
+reliable_not_replay (const struct reliable *rel, packet_id_type id)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ if (reliable_pid_min (id, rel->packet_id))
+ goto bad;
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active && e->packet_id == id)
+ goto bad;
+ }
+ gc_free (&gc);
+ return true;
+
+ bad:
+ dmsg (D_REL_DEBUG, "ACK " packet_id_format " is a replay: %s", (packet_id_print_type)id, reliable_print_ids (rel, &gc));
+ gc_free (&gc);
+ return false;
+}
+
+/* make sure that incoming packet ID won't deadlock the receive buffer */
+bool
+reliable_wont_break_sequentiality (const struct reliable *rel, packet_id_type id)
+{
+ struct gc_arena gc = gc_new ();
+
+ const int ret = reliable_pid_in_range2 (id, rel->packet_id, rel->size);
+
+ if (!ret)
+ {
+ dmsg (D_REL_LOW, "ACK " packet_id_format " breaks sequentiality: %s",
+ (packet_id_print_type)id, reliable_print_ids (rel, &gc));
+ }
+
+ dmsg (D_REL_DEBUG, "ACK RWBS rel->size=%d rel->packet_id=%08x id=%08x ret=%d\n", rel->size, rel->packet_id, id, ret);
+
+ gc_free (&gc);
+ return ret;
+}
+
+/* grab a free buffer */
+struct buffer *
+reliable_get_buf (struct reliable *rel)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (!e->active)
+ {
+ ASSERT (buf_init (&e->buf, rel->offset));
+ return &e->buf;
+ }
+ }
+ return NULL;
+}
+
+/* grab a free buffer, fail if buffer clogged by unacknowledged low packet IDs */
+struct buffer *
+reliable_get_buf_output_sequenced (struct reliable *rel)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ packet_id_type min_id = 0;
+ bool min_id_defined = false;
+ struct buffer *ret = NULL;
+
+ /* find minimum active packet_id */
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ {
+ if (!min_id_defined || reliable_pid_min (e->packet_id, min_id))
+ {
+ min_id_defined = true;
+ min_id = e->packet_id;
+ }
+ }
+ }
+
+ if (!min_id_defined || reliable_pid_in_range1 (rel->packet_id, min_id, rel->size))
+ {
+ ret = reliable_get_buf (rel);
+ }
+ else
+ {
+ dmsg (D_REL_LOW, "ACK output sequence broken: %s", reliable_print_ids (rel, &gc));
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+/* get active buffer for next sequentially increasing key ID */
+struct buffer *
+reliable_get_buf_sequenced (struct reliable *rel)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (e->active && e->packet_id == rel->packet_id)
+ {
+ return &e->buf;
+ }
+ }
+ return NULL;
+}
+
+/* return true if reliable_send would return a non-NULL result */
+bool
+reliable_can_send (const struct reliable *rel)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ int n_active = 0, n_current = 0;
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ {
+ ++n_active;
+ if (now >= e->next_try)
+ ++n_current;
+ }
+ }
+ dmsg (D_REL_DEBUG, "ACK reliable_can_send active=%d current=%d : %s",
+ n_active,
+ n_current,
+ reliable_print_ids (rel, &gc));
+
+ gc_free (&gc);
+ return n_current > 0 && !rel->hold;
+}
+
+#ifdef EXPONENTIAL_BACKOFF
+/* return a unique point-in-time to trigger retry */
+static time_t
+reliable_unique_retry (struct reliable *rel, time_t retry)
+{
+ int i;
+ while (true)
+ {
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (e->active && e->next_try == retry)
+ goto again;
+ }
+ break;
+ again:
+ ++retry;
+ }
+ return retry;
+}
+#endif
+
+/* return next buffer to send to remote */
+struct buffer *
+reliable_send (struct reliable *rel, int *opcode)
+{
+ int i;
+ struct reliable_entry *best = NULL;
+ const time_t local_now = now;
+
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (e->active && local_now >= e->next_try)
+ {
+ if (!best || reliable_pid_min (e->packet_id, best->packet_id))
+ best = e;
+ }
+ }
+ if (best)
+ {
+#ifdef EXPONENTIAL_BACKOFF
+ /* exponential backoff */
+ best->next_try = reliable_unique_retry (rel, local_now + best->timeout);
+ best->timeout *= 2;
+#else
+ /* constant timeout, no backoff */
+ best->next_try = local_now + best->timeout;
+#endif
+ *opcode = best->opcode;
+ dmsg (D_REL_DEBUG, "ACK reliable_send ID " packet_id_format " (size=%d to=%d)",
+ (packet_id_print_type)best->packet_id, best->buf.len,
+ (int)(best->next_try - local_now));
+ return &best->buf;
+ }
+ return NULL;
+}
+
+/* schedule all pending packets for immediate retransmit */
+void
+reliable_schedule_now (struct reliable *rel)
+{
+ int i;
+ dmsg (D_REL_DEBUG, "ACK reliable_schedule_now");
+ rel->hold = false;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ {
+ e->next_try = now;
+ e->timeout = rel->initial_timeout;
+ }
+ }
+}
+
+/* in how many seconds should we wake up to check for timeout */
+/* if we return BIG_TIMEOUT, nothing to wait for */
+interval_t
+reliable_send_timeout (const struct reliable *rel)
+{
+ struct gc_arena gc = gc_new ();
+ interval_t ret = BIG_TIMEOUT;
+ int i;
+ const time_t local_now = now;
+
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ {
+ if (e->next_try <= local_now)
+ {
+ ret = 0;
+ break;
+ }
+ else
+ {
+ ret = min_int (ret, e->next_try - local_now);
+ }
+ }
+ }
+
+ dmsg (D_REL_DEBUG, "ACK reliable_send_timeout %d %s",
+ (int) ret,
+ reliable_print_ids (rel, &gc));
+
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Enable an incoming buffer previously returned by a get function as active.
+ */
+
+void
+reliable_mark_active_incoming (struct reliable *rel, struct buffer *buf,
+ packet_id_type pid, int opcode)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (buf == &e->buf)
+ {
+ e->active = true;
+
+ /* packets may not arrive in sequential order */
+ e->packet_id = pid;
+
+ /* check for replay */
+ ASSERT (!reliable_pid_min (pid, rel->packet_id));
+
+ e->opcode = opcode;
+ e->next_try = 0;
+ e->timeout = 0;
+ dmsg (D_REL_DEBUG, "ACK mark active incoming ID " packet_id_format, (packet_id_print_type)e->packet_id);
+ return;
+ }
+ }
+ ASSERT (0); /* buf not found in rel */
+}
+
+/*
+ * Enable an outgoing buffer previously returned by a get function as active.
+ */
+
+void
+reliable_mark_active_outgoing (struct reliable *rel, struct buffer *buf, int opcode)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (buf == &e->buf)
+ {
+ /* Write mode, increment packet_id (i.e. sequence number)
+ linearly and prepend id to packet */
+ packet_id_type net_pid;
+ e->packet_id = rel->packet_id++;
+ net_pid = htonpid (e->packet_id);
+ ASSERT (buf_write_prepend (buf, &net_pid, sizeof (net_pid)));
+ e->active = true;
+ e->opcode = opcode;
+ e->next_try = 0;
+ e->timeout = rel->initial_timeout;
+ dmsg (D_REL_DEBUG, "ACK mark active outgoing ID " packet_id_format, (packet_id_print_type)e->packet_id);
+ return;
+ }
+ }
+ ASSERT (0); /* buf not found in rel */
+}
+
+/* delete a buffer previously activated by reliable_mark_active() */
+void
+reliable_mark_deleted (struct reliable *rel, struct buffer *buf, bool inc_pid)
+{
+ int i;
+ for (i = 0; i < rel->size; ++i)
+ {
+ struct reliable_entry *e = &rel->array[i];
+ if (buf == &e->buf)
+ {
+ e->active = false;
+ if (inc_pid)
+ rel->packet_id = e->packet_id + 1;
+ return;
+ }
+ }
+ ASSERT (0);
+}
+
+#if 0
+
+void
+reliable_ack_debug_print (const struct reliable_ack *ack, char *desc)
+{
+ int i;
+
+ printf ("********* struct reliable_ack %s\n", desc);
+ for (i = 0; i < ack->len; ++i)
+ {
+ printf (" %d: " packet_id_format "\n", i, (packet_id_print_type) ack->packet_id[i]);
+ }
+}
+
+void
+reliable_debug_print (const struct reliable *rel, char *desc)
+{
+ int i;
+ update_time ();
+
+ printf ("********* struct reliable %s\n", desc);
+ printf (" initial_timeout=%d\n", (int)rel->initial_timeout);
+ printf (" packet_id=" packet_id_format "\n", rel->packet_id);
+ printf (" now=" time_format "\n", now);
+ for (i = 0; i < rel->size; ++i)
+ {
+ const struct reliable_entry *e = &rel->array[i];
+ if (e->active)
+ {
+ printf (" %d: packet_id=" packet_id_format " len=%d", i, e->packet_id, e->buf.len);
+ printf (" next_try=" time_format, e->next_try);
+ printf ("\n");
+ }
+ }
+}
+
+#endif
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_CRYPTO && ENABLE_SSL*/
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.h
new file mode 100644
index 00000000..594ab825
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/reliable.h
@@ -0,0 +1,480 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/**
+ * @file
+ * Reliability Layer module header file.
+ */
+
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#ifndef RELIABLE_H
+#define RELIABLE_H
+
+#include "basic.h"
+#include "buffer.h"
+#include "packet_id.h"
+#include "session_id.h"
+#include "mtu.h"
+
+/** @addtogroup reliable
+ * @{ */
+
+
+#define EXPONENTIAL_BACKOFF
+
+#define RELIABLE_ACK_SIZE 8 /**< The maximum number of packet IDs
+ * waiting to be acknowledged which can
+ * be stored in one \c reliable_ack
+ * structure. */
+
+#define RELIABLE_CAPACITY 8 /**< The maximum number of packets that
+ * the reliability layer for one VPN
+ * tunnel in one direction can store. */
+
+/**
+ * The acknowledgment structure in which packet IDs are stored for later
+ * acknowledgment.
+ */
+struct reliable_ack
+{
+ int len;
+ packet_id_type packet_id[RELIABLE_ACK_SIZE];
+};
+
+/**
+ * The structure in which the reliability layer stores a single incoming
+ * or outgoing packet.
+ */
+struct reliable_entry
+{
+ bool active;
+ interval_t timeout;
+ time_t next_try;
+ packet_id_type packet_id;
+ int opcode;
+ struct buffer buf;
+};
+
+/**
+ * The reliability layer storage structure for one VPN tunnel's control
+ * channel in one direction.
+ */
+struct reliable
+{
+ int size;
+ interval_t initial_timeout;
+ packet_id_type packet_id;
+ int offset;
+ bool hold; /* don't xmit until reliable_schedule_now is called */
+ struct reliable_entry array[RELIABLE_CAPACITY];
+};
+
+
+/**************************************************************************/
+/** @name Functions for processing incoming acknowledgments
+ * @{ */
+
+/**
+ * Read an acknowledgment record from a received packet.
+ *
+ * This function reads the packet ID acknowledgment record from the packet
+ * contained in \a buf. If the record contains acknowledgments, these are
+ * stored in \a ack. This function also compares the packet's session ID
+ * with the expected session ID \a sid, which should be equal.
+ *
+ * @param ack The acknowledgment structure in which received
+ * acknowledgments are to be stored.
+ * @param buf The buffer containing the packet.
+ * @param sid The expected session ID to compare to the session ID in
+ * the packet.
+ *
+ * @return
+ * @li True, if processing was successful.
+ * @li False, if an error occurs during processing.
+ */
+bool reliable_ack_read (struct reliable_ack *ack,
+ struct buffer *buf, const struct session_id *sid);
+
+/**
+ * Remove acknowledged packets from a reliable structure.
+ *
+ * @param rel The reliable structure storing sent packets.
+ * @param ack The acknowledgment structure containing received
+ * acknowledgments.
+ */
+void reliable_send_purge (struct reliable *rel, struct reliable_ack *ack);
+
+/** @} name Functions for processing incoming acknowledgments */
+
+
+/**************************************************************************/
+/** @name Functions for processing outgoing acknowledgments
+ * @{ */
+
+/**
+ * Check whether an acknowledgment structure contains any
+ * packet IDs to be acknowledged.
+ *
+ * @param ack The acknowledgment structure to check.
+ *
+ * @return
+ * @li True, if the acknowledgment structure is empty.
+ * @li False, if there are packet IDs to be acknowledged.
+ */
+static inline bool
+reliable_ack_empty (struct reliable_ack *ack)
+{
+ return !ack->len;
+}
+
+/**
+ * Write a packet ID acknowledgment record to a buffer.
+ *
+ * @param ack The acknowledgment structure containing packet IDs to be
+ * acknowledged.
+ * @param buf The buffer into which the acknowledgment record will be
+ * written.
+ * @param sid The session ID of the VPN tunnel associated with the
+ * packet IDs to be acknowledged.
+ * @param max The maximum number of acknowledgments to be written in
+ * the record.
+ * @param prepend If true, prepend the acknowledgment record in the
+ * buffer; if false, write into the buffer's current position.
+ *
+ * @return
+ * @li True, if processing was successful.
+ * @li False, if an error occurs during processing.
+ */
+bool reliable_ack_write (struct reliable_ack *ack,
+ struct buffer *buf,
+ const struct session_id *sid, int max, bool prepend);
+
+/** @} name Functions for processing outgoing acknowledgments */
+
+
+/**************************************************************************/
+/** @name Functions for initialization and cleanup
+ * @{ */
+
+/**
+ * Initialize a reliable structure.
+ *
+ * @param rel The reliable structure to initialize.
+ * @param buf_size The size of the buffers in which packets will be
+ * stored.
+ * @param offset The size of reserved space at the beginning of the
+ * buffers to allow efficient header prepending.
+ * @param array_size The number of packets that this reliable
+ * structure can store simultaneously.
+ * @param hold description
+ */
+void reliable_init (struct reliable *rel, int buf_size, int offset, int array_size, bool hold);
+
+/**
+ * Free allocated memory associated with a reliable structure.
+ *
+ * @param rel The reliable structured to clean up.
+ */
+void reliable_free (struct reliable *rel);
+
+/* add to extra_frame the maximum number of bytes we will need for reliable_ack_write */
+void reliable_ack_adjust_frame_parameters (struct frame* frame, int max);
+
+/** @} name Functions for initialization and cleanup */
+
+
+/**************************************************************************/
+/** @name Functions for inserting incoming packets
+ * @{ */
+
+/**
+ * Check whether a reliable structure has any free buffers
+ * available for use.
+ *
+ * @param rel The reliable structure to check.
+ *
+ * @return
+ * @li True, if at least one buffer is available for use.
+ * @li False, if all the buffers are active.
+ */
+bool reliable_can_get (const struct reliable *rel);
+
+/**
+ * Check that a received packet's ID is not a replay.
+ *
+ * @param rel The reliable structure for handling this VPN tunnel's
+ * received packets.
+ * @param id The packet ID of the received packet.
+ *
+ * @return
+ * @li True, if the packet ID is not a replay.
+ * @li False, if the packet ID is a replay.
+ */
+bool reliable_not_replay (const struct reliable *rel, packet_id_type id);
+
+/**
+ * Check that a received packet's ID can safely be stored in
+ * the reliable structure's processing window.
+ *
+ * This function checks the difference between the received packet's ID
+ * and the lowest non-acknowledged packet ID in the given reliable
+ * structure. If that difference is larger than the total number of
+ * packets which can be stored, then this packet cannot be stored safely,
+ * because the reliable structure could possibly fill up without leaving
+ * room for all intervening packets. In that case, this received packet
+ * could break the reliable structure's sequentiality, and must therefore
+ * be discarded.
+ *
+ * @param rel The reliable structure for handling this VPN tunnel's
+ * received packets.
+ * @param id The packet ID of the received packet.
+ *
+ * @return
+ * @li True, if the packet can safely be stored.
+ * @li False, if the packet does not fit safely in the reliable
+ * structure's processing window.
+ */
+bool reliable_wont_break_sequentiality (const struct reliable *rel, packet_id_type id);
+
+/**
+ * Read the packet ID of a received packet.
+ *
+ * @param buf The buffer containing the received packet.
+ * @param pid A pointer where the packet's packet ID will be written.
+ *
+ * @return
+ * @li True, if processing was successful.
+ * @li False, if an error occurs during processing.
+ */
+bool reliable_ack_read_packet_id (struct buffer *buf, packet_id_type *pid);
+
+/**
+ * Get the buffer of a free %reliable entry in which to store a
+ * packet.
+ *
+ * @param rel The reliable structure in which to search for a free
+ * entry.
+ *
+ * @return A pointer to a buffer of a free entry in the \a rel
+ * reliable structure. If there are no free entries available, this
+ * function returns NULL.
+ */
+struct buffer *reliable_get_buf (struct reliable *rel);
+
+/**
+ * Mark the %reliable entry associated with the given buffer as active
+ * incoming.
+ *
+ * @param rel The reliable structure associated with this packet.
+ * @param buf The buffer into which the packet has been copied.
+ * @param pid The packet's packet ID.
+ * @param opcode The packet's opcode.
+ */
+void reliable_mark_active_incoming (struct reliable *rel, struct buffer *buf,
+ packet_id_type pid, int opcode);
+
+/**
+ * Record a packet ID for later acknowledgment.
+ *
+ * @param ack The acknowledgment structure which stores this VPN
+ * tunnel's packet IDs for later acknowledgment.
+ * @param pid The packet ID of the received packet which should be
+ * acknowledged.
+ *
+ * @return
+ * @li True, if the packet ID was added to \a ack.
+ * @li False, if the packet ID was already present in \a ack or \a ack
+ * has no free space to store any more packet IDs.
+ */
+bool reliable_ack_acknowledge_packet_id (struct reliable_ack *ack, packet_id_type pid);
+
+/** @} name Functions for inserting incoming packets */
+
+
+/**************************************************************************/
+/** @name Functions for extracting incoming packets
+ * @{ */
+
+/**
+ * Get the buffer of the next sequential and active entry.
+ *
+ * @param rel The reliable structure from which to retrieve the
+ * buffer.
+ *
+ * @return A pointer to the buffer of the entry with the next
+ * sequential key ID. If no such entry is present, this function
+ * returns NULL.
+ */
+struct buffer *reliable_get_buf_sequenced (struct reliable *rel);
+
+/**
+ * Remove an entry from a reliable structure.
+ *
+ * @param rel The reliable structure associated with the given buffer.
+ * @param buf The buffer of the reliable entry which is to be removed.
+ * @param inc_pid If true, the reliable structure's packet ID counter
+ * will be incremented.
+ */
+void reliable_mark_deleted (struct reliable *rel, struct buffer *buf, bool inc_pid);
+
+/** @} name Functions for extracting incoming packets */
+
+
+/**************************************************************************/
+/** @name Functions for inserting outgoing packets
+ * @{ */
+
+/**
+ * Get the buffer of free reliable entry and check whether the
+ * outgoing acknowledgment sequence is still okay.
+ *
+ * @param rel The reliable structure in which to search for a free
+ * entry.
+ *
+ * @return A pointer to a buffer of a free entry in the \a rel
+ * reliable structure. If there are no free entries available, this
+ * function returns NULL. If the outgoing acknowledgment sequence is
+ * broken, this function also returns NULL.
+ */
+struct buffer *reliable_get_buf_output_sequenced (struct reliable *rel);
+
+/**
+ * Mark the reliable entry associated with the given buffer as
+ * active outgoing.
+ *
+ * @param rel The reliable structure for handling this VPN tunnel's
+ * outgoing packets.
+ * @param buf The buffer previously returned by \c
+ * reliable_get_buf_output_sequenced() into which the packet has been
+ * copied.
+ * @param opcode The packet's opcode.
+ */
+void reliable_mark_active_outgoing (struct reliable *rel, struct buffer *buf, int opcode);
+
+/** @} name Functions for inserting outgoing packets */
+
+
+/**************************************************************************/
+/** @name Functions for extracting outgoing packets
+ * @{ */
+
+/**
+ * Check whether a reliable structure has any active entries
+ * ready to be (re)sent.
+ *
+ * @param rel The reliable structure to check.
+ *
+ * @return
+ * @li True, if there are active entries ready to be (re)sent
+ * president.
+ * @li False, if there are no active entries, or the active entries
+ * are not yet ready for resending.
+ */
+bool reliable_can_send (const struct reliable *rel);
+
+/**
+ * Get the next packet to send to the remote peer.
+ *
+ * This function looks for the active entry ready for (re)sending with the
+ * lowest packet ID, and returns the buffer associated with it. This
+ * function also resets the timeout after which that entry will become
+ * ready for resending again.
+ *
+ * @param rel The reliable structure to check.
+ * @param opcode A pointer to an integer in which this function will
+ * store the opcode of the next packet to be sent.
+ *
+ * @return A pointer to the buffer of the next entry to be sent, or
+ * NULL if there are no entries ready for (re)sending present in the
+ * reliable structure. If a valid pointer is returned, then \a opcode
+ * will point to the opcode of that packet.
+ */
+struct buffer *reliable_send (struct reliable *rel, int *opcode);
+
+/** @} name Functions for extracting outgoing packets */
+
+
+/**************************************************************************/
+/** @name Miscellaneous functions
+ * @{ */
+
+/**
+ * Check whether a reliable structure is empty.
+ *
+ * @param rel The reliable structure to check.
+ *
+ * @return
+ * @li True, if there are no active entries in the given reliable
+ * structure.
+ * @li False, if there is at least one active entry present.
+ */
+bool reliable_empty (const struct reliable *rel);
+
+/**
+ * Determined how many seconds until the earliest resend should
+ * be attempted.
+ *
+ * @param rel The reliable structured to check.
+ *
+ * @return The interval in seconds until the earliest resend attempt
+ * of the outgoing packets stored in the \a rel reliable structure. If
+ * the next time for attempting resending of one or more packets has
+ * already passed, this function will return 0.
+ */
+interval_t reliable_send_timeout (const struct reliable *rel);
+
+/**
+ * Reschedule all entries of a reliable structure to be ready
+ * for (re)sending immediately.
+ *
+ * @param rel The reliable structure of which the entries should be
+ * modified.
+ */
+void reliable_schedule_now (struct reliable *rel);
+
+void reliable_debug_print (const struct reliable *rel, char *desc);
+
+/* set sending timeout (after this time we send again until ACK) */
+static inline void
+reliable_set_timeout (struct reliable *rel, interval_t timeout)
+{
+ rel->initial_timeout = timeout;
+}
+
+/* print a reliable ACK record coming off the wire */
+const char *reliable_ack_print (struct buffer *buf, bool verbose, struct gc_arena *gc);
+
+void reliable_ack_debug_print (const struct reliable_ack *ack, char *desc);
+
+/** @} name Miscellaneous functions */
+
+
+/** @} addtogroup reliable */
+
+
+#endif /* RELIABLE_H */
+#endif /* ENABLE_CRYPTO && ENABLE_SSL */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/route.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/route.c
new file mode 100644
index 00000000..562af9fe
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/route.c
@@ -0,0 +1,3110 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Support routines for adding/deleting network routes.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "common.h"
+#include "error.h"
+#include "route.h"
+#include "misc.h"
+#include "socket.h"
+#include "manage.h"
+#include "win32.h"
+#include "options.h"
+
+#include "memdbg.h"
+
+#ifdef WIN32
+#define METRIC_NOT_USED ((DWORD)-1)
+#endif
+
+static void delete_route (struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es);
+
+static void get_bypass_addresses (struct route_bypass *rb, const unsigned int flags);
+
+#ifdef ENABLE_DEBUG
+
+static void
+print_bypass_addresses (const struct route_bypass *rb)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ for (i = 0; i < rb->n_bypass; ++i)
+ {
+ msg (D_ROUTE, "ROUTE: bypass_host_route[%d]=%s",
+ i,
+ print_in_addr_t (rb->bypass[i], 0, &gc));
+ }
+ gc_free (&gc);
+}
+
+#endif
+
+static bool
+add_bypass_address (struct route_bypass *rb, const in_addr_t a)
+{
+ int i;
+ for (i = 0; i < rb->n_bypass; ++i)
+ {
+ if (a == rb->bypass[i]) /* avoid duplicates */
+ return true;
+ }
+ if (rb->n_bypass < N_ROUTE_BYPASS)
+ {
+ rb->bypass[rb->n_bypass++] = a;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+struct route_option_list *
+new_route_option_list (struct gc_arena *a)
+{
+ struct route_option_list *ret;
+ ALLOC_OBJ_CLEAR_GC (ret, struct route_option_list, a);
+ ret->gc = a;
+ return ret;
+}
+
+struct route_ipv6_option_list *
+new_route_ipv6_option_list (struct gc_arena *a)
+{
+ struct route_ipv6_option_list *ret;
+ ALLOC_OBJ_CLEAR_GC (ret, struct route_ipv6_option_list, a);
+ ret->gc = a;
+ return ret;
+}
+
+/*
+ * NOTE: structs are cloned/copied shallow by design.
+ * The routes list from src will stay intact since it is allocated using
+ * the options->gc. The cloned/copied lists will share this common tail
+ * to avoid copying the data around between pulls. Pulled routes use
+ * the c2->gc so they get freed immediately after a reconnect.
+ */
+struct route_option_list *
+clone_route_option_list (const struct route_option_list *src, struct gc_arena *a)
+{
+ struct route_option_list *ret;
+ ALLOC_OBJ_GC (ret, struct route_option_list, a);
+ *ret = *src;
+ return ret;
+}
+
+struct route_ipv6_option_list *
+clone_route_ipv6_option_list (const struct route_ipv6_option_list *src, struct gc_arena *a)
+{
+ struct route_ipv6_option_list *ret;
+ ALLOC_OBJ_GC (ret, struct route_ipv6_option_list, a);
+ *ret = *src;
+ return ret;
+}
+
+void
+copy_route_option_list (struct route_option_list *dest, const struct route_option_list *src, struct gc_arena *a)
+{
+ *dest = *src;
+ dest->gc = a;
+}
+
+void
+copy_route_ipv6_option_list (struct route_ipv6_option_list *dest,
+ const struct route_ipv6_option_list *src,
+ struct gc_arena *a)
+{
+ *dest = *src;
+ dest->gc = a;
+}
+
+static const char *
+route_string (const struct route_ipv4 *r, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ buf_printf (&out, "ROUTE network %s netmask %s gateway %s",
+ print_in_addr_t (r->network, 0, gc),
+ print_in_addr_t (r->netmask, 0, gc),
+ print_in_addr_t (r->gateway, 0, gc)
+ );
+ if (r->flags & RT_METRIC_DEFINED)
+ buf_printf (&out, " metric %d", r->metric);
+ return BSTR (&out);
+}
+
+static bool
+is_route_parm_defined (const char *parm)
+{
+ if (!parm)
+ return false;
+ if (!strcmp (parm, "default"))
+ return false;
+ return true;
+}
+
+static void
+setenv_route_addr (struct env_set *es, const char *key, const in_addr_t addr, int i)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer name = alloc_buf_gc (256, &gc);
+ if (i >= 0)
+ buf_printf (&name, "route_%s_%d", key, i);
+ else
+ buf_printf (&name, "route_%s", key);
+ setenv_str (es, BSTR (&name), print_in_addr_t (addr, 0, &gc));
+ gc_free (&gc);
+}
+
+static bool
+get_special_addr (const struct route_list *rl,
+ const char *string,
+ in_addr_t *out,
+ bool *status)
+{
+ if (status)
+ *status = true;
+ if (!strcmp (string, "vpn_gateway"))
+ {
+ if (rl)
+ {
+ if (rl->spec.flags & RTSA_REMOTE_ENDPOINT)
+ *out = rl->spec.remote_endpoint;
+ else
+ {
+ msg (M_INFO, PACKAGE_NAME " ROUTE: vpn_gateway undefined");
+ if (status)
+ *status = false;
+ }
+ }
+ return true;
+ }
+ else if (!strcmp (string, "net_gateway"))
+ {
+ if (rl)
+ {
+ if (rl->rgi.flags & RGI_ADDR_DEFINED)
+ *out = rl->rgi.gateway.addr;
+ else
+ {
+ msg (M_INFO, PACKAGE_NAME " ROUTE: net_gateway undefined -- unable to get default gateway from system");
+ if (status)
+ *status = false;
+ }
+ }
+ return true;
+ }
+ else if (!strcmp (string, "remote_host"))
+ {
+ if (rl)
+ {
+ if (rl->spec.flags & RTSA_REMOTE_HOST)
+ *out = rl->spec.remote_host;
+ else
+ {
+ msg (M_INFO, PACKAGE_NAME " ROUTE: remote_host undefined");
+ if (status)
+ *status = false;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+bool
+is_special_addr (const char *addr_str)
+{
+ if (addr_str)
+ return get_special_addr (NULL, addr_str, NULL, NULL);
+ else
+ return false;
+}
+
+static bool
+init_route (struct route_ipv4 *r,
+ struct addrinfo **network_list,
+ const struct route_option *ro,
+ const struct route_list *rl)
+{
+ const in_addr_t default_netmask = IPV4_NETMASK_HOST;
+ bool status;
+ int ret;
+ struct in_addr special;
+
+ CLEAR (*r);
+ r->option = ro;
+
+ /* network */
+
+ if (!is_route_parm_defined (ro->network))
+ {
+ goto fail;
+ }
+
+
+ /* get_special_addr replaces specialaddr with a special ip addr
+ like gw. getaddrinfo is called to convert a a addrinfo struct */
+
+ if(get_special_addr (rl, ro->network, &special.s_addr, &status))
+ {
+ special.s_addr = htonl(special.s_addr);
+ ret = openvpn_getaddrinfo(0, inet_ntoa(special), NULL, 0, NULL,
+ AF_INET, network_list);
+ }
+ else
+ ret = openvpn_getaddrinfo(GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL,
+ ro->network, NULL, 0, NULL, AF_INET, network_list);
+
+ status = (ret == 0);
+
+ if (!status)
+ goto fail;
+
+ /* netmask */
+
+ if (is_route_parm_defined (ro->netmask))
+ {
+ r->netmask = getaddr (
+ GETADDR_HOST_ORDER
+ | GETADDR_WARN_ON_SIGNAL,
+ ro->netmask,
+ 0,
+ &status,
+ NULL);
+ if (!status)
+ goto fail;
+ }
+ else
+ r->netmask = default_netmask;
+
+ /* gateway */
+
+ if (is_route_parm_defined (ro->gateway))
+ {
+ if (!get_special_addr (rl, ro->gateway, &r->gateway, &status))
+ {
+ r->gateway = getaddr (
+ GETADDR_RESOLVE
+ | GETADDR_HOST_ORDER
+ | GETADDR_WARN_ON_SIGNAL,
+ ro->gateway,
+ 0,
+ &status,
+ NULL);
+ }
+ if (!status)
+ goto fail;
+ }
+ else
+ {
+ if (rl->spec.flags & RTSA_REMOTE_ENDPOINT)
+ r->gateway = rl->spec.remote_endpoint;
+ else
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE: " PACKAGE_NAME " needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifconfig options");
+ goto fail;
+ }
+ }
+
+ /* metric */
+
+ r->metric = 0;
+ if (is_route_parm_defined (ro->metric))
+ {
+ r->metric = atoi (ro->metric);
+ if (r->metric < 0)
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE: route metric for network %s (%s) must be >= 0",
+ ro->network,
+ ro->metric);
+ goto fail;
+ }
+ r->flags |= RT_METRIC_DEFINED;
+ }
+ else if (rl->spec.flags & RTSA_DEFAULT_METRIC)
+ {
+ r->metric = rl->spec.default_metric;
+ r->flags |= RT_METRIC_DEFINED;
+ }
+
+ r->flags |= RT_DEFINED;
+
+ return true;
+
+ fail:
+ msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve route for host/network: %s",
+ ro->network);
+ return false;
+}
+
+static bool
+init_route_ipv6 (struct route_ipv6 *r6,
+ const struct route_ipv6_option *r6o,
+ const struct route_ipv6_list *rl6 )
+{
+ r6->defined = false;
+
+ if ( !get_ipv6_addr( r6o->prefix, &r6->network, &r6->netbits, NULL, M_WARN ))
+ goto fail;
+
+ /* gateway */
+ if (is_route_parm_defined (r6o->gateway))
+ {
+ if ( inet_pton( AF_INET6, r6o->gateway, &r6->gateway ) != 1 )
+ {
+ msg( M_WARN, PACKAGE_NAME "ROUTE6: cannot parse gateway spec '%s'", r6o->gateway );
+ }
+ }
+ else if (rl6->remote_endpoint_defined)
+ {
+ r6->gateway = rl6->remote_endpoint_ipv6;
+ }
+ else
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE6: " PACKAGE_NAME " needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options");
+ goto fail;
+ }
+
+ /* metric */
+
+ r6->metric_defined = false;
+ r6->metric = -1;
+ if (is_route_parm_defined (r6o->metric))
+ {
+ r6->metric = atoi (r6o->metric);
+ if (r6->metric < 0)
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE: route metric for network %s (%s) must be >= 0",
+ r6o->prefix,
+ r6o->metric);
+ goto fail;
+ }
+ r6->metric_defined = true;
+ }
+ else if (rl6->default_metric_defined)
+ {
+ r6->metric = rl6->default_metric;
+ r6->metric_defined = true;
+ }
+
+ r6->defined = true;
+
+ return true;
+
+ fail:
+ msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve route for host/network: %s",
+ r6o->prefix);
+ r6->defined = false;
+ return false;
+}
+
+void
+add_route_to_option_list (struct route_option_list *l,
+ const char *network,
+ const char *netmask,
+ const char *gateway,
+ const char *metric)
+{
+ struct route_option *ro;
+ ALLOC_OBJ_GC (ro, struct route_option, l->gc);
+ ro->network = network;
+ ro->netmask = netmask;
+ ro->gateway = gateway;
+ ro->metric = metric;
+ ro->next = l->routes;
+ l->routes = ro;
+
+}
+
+void
+add_route_ipv6_to_option_list (struct route_ipv6_option_list *l,
+ const char *prefix,
+ const char *gateway,
+ const char *metric)
+{
+ struct route_ipv6_option *ro;
+ ALLOC_OBJ_GC (ro, struct route_ipv6_option, l->gc);
+ ro->prefix = prefix;
+ ro->gateway = gateway;
+ ro->metric = metric;
+ ro->next = l->routes_ipv6;
+ l->routes_ipv6 = ro;
+}
+
+void
+clear_route_list (struct route_list *rl)
+{
+ gc_free (&rl->gc);
+ CLEAR (*rl);
+}
+
+void
+clear_route_ipv6_list (struct route_ipv6_list *rl6)
+{
+ gc_free (&rl6->gc);
+ CLEAR (*rl6);
+}
+
+void
+route_list_add_vpn_gateway (struct route_list *rl,
+ struct env_set *es,
+ const in_addr_t addr)
+{
+ ASSERT(rl);
+ rl->spec.remote_endpoint = addr;
+ rl->spec.flags |= RTSA_REMOTE_ENDPOINT;
+ setenv_route_addr (es, "vpn_gateway", rl->spec.remote_endpoint, -1);
+}
+
+static void
+add_block_local_item (struct route_list *rl,
+ const struct route_gateway_address *gateway,
+ in_addr_t target)
+{
+ const int rgi_needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
+ if ((rl->rgi.flags & rgi_needed) == rgi_needed
+ && rl->rgi.gateway.netmask < 0xFFFFFFFF)
+ {
+ struct route_ipv4 *r1, *r2;
+ unsigned int l2;
+
+ ALLOC_OBJ_GC (r1, struct route_ipv4, &rl->gc);
+ ALLOC_OBJ_GC (r2, struct route_ipv4, &rl->gc);
+
+ /* split a route into two smaller blocking routes, and direct them to target */
+ l2 = ((~gateway->netmask)+1)>>1;
+ r1->flags = RT_DEFINED;
+ r1->gateway = target;
+ r1->network = gateway->addr & gateway->netmask;
+ r1->netmask = ~(l2-1);
+ r1->next = rl->routes;
+ rl->routes = r1;
+
+ *r2 = *r1;
+ r2->network += l2;
+ r2->next = rl->routes;
+ rl->routes = r2;
+ }
+}
+
+static void
+add_unblock_local (struct route_list *rl)
+{
+ const int rgi_needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
+
+ if (rl->flags & RG_UNBLOCK_LOCAL
+ && (rl->rgi.flags & rgi_needed) == rgi_needed)
+ {
+ /* unblock access to local subnet */
+ struct route_ipv4 *r;
+
+ ALLOC_OBJ_GC (r, struct route_ipv4, &rl->gc);
+ int i;
+
+ CLEAR(*r);
+ r->flags = RT_DEFINED;
+ r->network = rl->rgi.gateway.addr & rl->rgi.gateway.netmask;
+ r->netmask = rl->rgi.gateway.netmask;
+ r->gateway = rl->rgi.gateway.addr;
+ r->next = rl->routes;
+ rl->routes = r;
+
+ /* Additional local networks */
+ for (i = 0; i < rl->rgi.n_addrs; ++i)
+ {
+ const struct route_gateway_address *gwa = &rl->rgi.addrs[i];
+
+ /* omit the add/subnet in &rl->rgi which we processed above */
+ if (!((rl->rgi.gateway.addr & rl->rgi.gateway.netmask) == (gwa->addr & gwa->netmask)
+ && rl->rgi.gateway.netmask == gwa->netmask))
+ {
+ ALLOC_OBJ_GC (r, struct route_ipv4, &rl->gc);
+ CLEAR(*r);
+ r->flags = RT_DEFINED;
+ r->network = gwa->addr & gwa->netmask;
+ r->netmask = gwa->netmask;
+ r->gateway = gwa->addr;
+ r->next = rl->routes;
+ rl->routes=r;
+ }
+ }
+ }
+}
+
+
+static void
+add_block_local (struct route_list *rl)
+{
+ const int rgi_needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
+ if ((rl->flags & RG_BLOCK_LOCAL)
+ && (rl->rgi.flags & rgi_needed) == rgi_needed
+ && (rl->spec.flags & RTSA_REMOTE_ENDPOINT)
+ && rl->spec.remote_host_local != TLA_LOCAL)
+ {
+ size_t i;
+
+#ifndef TARGET_ANDROID
+ /* add bypass for gateway addr */
+ add_bypass_address (&rl->spec.bypass, rl->rgi.gateway.addr);
+#endif
+
+ /* block access to local subnet */
+ add_block_local_item (rl, &rl->rgi.gateway, rl->spec.remote_endpoint);
+
+ /* process additional subnets on gateway interface */
+ for (i = 0; i < rl->rgi.n_addrs; ++i)
+ {
+ const struct route_gateway_address *gwa = &rl->rgi.addrs[i];
+ /* omit the add/subnet in &rl->rgi which we processed above */
+ if (!((rl->rgi.gateway.addr & rl->rgi.gateway.netmask) == (gwa->addr & gwa->netmask)
+ && rl->rgi.gateway.netmask == gwa->netmask))
+ add_block_local_item (rl, gwa, rl->spec.remote_endpoint);
+ }
+ }
+}
+
+
+
+bool
+init_route_list (struct route_list *rl,
+ const struct route_option_list *opt,
+ const char *remote_endpoint,
+ int default_metric,
+ in_addr_t remote_host,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = true;
+
+ clear_route_list (rl);
+
+ rl->flags = opt->flags;
+
+ if (remote_host)
+ {
+ rl->spec.remote_host = remote_host;
+ rl->spec.flags |= RTSA_REMOTE_HOST;
+ }
+
+ if (default_metric)
+ {
+ rl->spec.default_metric = default_metric;
+ rl->spec.flags |= RTSA_DEFAULT_METRIC;
+ }
+
+ get_default_gateway (&rl->rgi);
+ if (rl->rgi.flags & RGI_ADDR_DEFINED)
+ {
+ setenv_route_addr (es, "net_gateway", rl->rgi.gateway.addr, -1);
+#if defined(ENABLE_DEBUG) && !defined(ENABLE_SMALL)
+ print_default_gateway (D_ROUTE, &rl->rgi);
+#endif
+ }
+ else
+ {
+ dmsg (D_ROUTE, "ROUTE: default_gateway=UNDEF");
+ }
+
+ if (rl->spec.flags & RTSA_REMOTE_HOST)
+ rl->spec.remote_host_local = test_local_addr (remote_host, &rl->rgi);
+
+ if (is_route_parm_defined (remote_endpoint))
+ {
+ bool defined = false;
+ rl->spec.remote_endpoint = getaddr (
+ GETADDR_RESOLVE
+ | GETADDR_HOST_ORDER
+ | GETADDR_WARN_ON_SIGNAL,
+ remote_endpoint,
+ 0,
+ &defined,
+ NULL);
+
+ if (defined)
+ {
+ setenv_route_addr (es, "vpn_gateway", rl->spec.remote_endpoint, -1);
+ rl->spec.flags |= RTSA_REMOTE_ENDPOINT;
+ }
+ else
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve default gateway: %s",
+ remote_endpoint);
+ ret = false;
+ }
+ }
+
+
+ add_unblock_local (rl);
+ if (rl->flags & RG_ENABLE)
+ {
+ add_block_local (rl);
+ get_bypass_addresses (&rl->spec.bypass, rl->flags);
+#ifdef ENABLE_DEBUG
+ print_bypass_addresses (&rl->spec.bypass);
+#endif
+ }
+
+ /* parse the routes from opt to rl */
+ {
+ struct route_option *ro;
+ for (ro = opt->routes; ro; ro = ro->next)
+ {
+ struct addrinfo* netlist;
+ struct route_ipv4 r;
+
+ if (!init_route (&r, &netlist, ro, rl))
+ ret = false;
+ else
+ {
+ struct addrinfo* curele;
+ gc_addspecial(netlist, &gc_freeaddrinfo_callback, &gc);
+ for (curele = netlist; curele; curele = curele->ai_next)
+ {
+ struct route_ipv4 *new;
+ ALLOC_OBJ_GC (new, struct route_ipv4, &rl->gc);
+ *new = r;
+ new->network = ntohl (((struct sockaddr_in*)curele->ai_addr)->sin_addr.s_addr);
+ new->next = rl->routes;
+ rl->routes = new;
+ }
+ }
+ }
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+bool
+init_route_ipv6_list (struct route_ipv6_list *rl6,
+ const struct route_ipv6_option_list *opt6,
+ const char *remote_endpoint,
+ int default_metric,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = true;
+
+ clear_route_ipv6_list (rl6);
+
+ rl6->flags = opt6->flags;
+
+ if (default_metric >= 0 )
+ {
+ rl6->default_metric = default_metric;
+ rl6->default_metric_defined = true;
+ }
+
+ /* "default_gateway" is stuff for "redirect-gateway", which we don't
+ * do for IPv6 yet -> TODO
+ */
+ {
+ dmsg (D_ROUTE, "ROUTE6: default_gateway=UNDEF");
+ }
+
+ if ( is_route_parm_defined( remote_endpoint ))
+ {
+ if ( inet_pton( AF_INET6, remote_endpoint,
+ &rl6->remote_endpoint_ipv6) == 1 )
+ {
+ rl6->remote_endpoint_defined = true;
+ }
+ else
+ {
+ msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve default gateway: %s", remote_endpoint);
+ ret = false;
+ }
+ }
+ else
+ rl6->remote_endpoint_defined = false;
+
+
+ /* parse the routes from opt6 to rl6 */
+ {
+ struct route_ipv6_option *ro6;
+ for (ro6 = opt6->routes_ipv6; ro6; ro6 = ro6->next)
+ {
+ struct route_ipv6 *r6;
+ ALLOC_OBJ_GC (r6, struct route_ipv6, &rl6->gc);
+ if (!init_route_ipv6 (r6, ro6, rl6))
+ ret = false;
+ else
+ {
+ r6->next = rl6->routes_ipv6;
+ rl6->routes_ipv6 = r6;
+ }
+ }
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+static void
+add_route3 (in_addr_t network,
+ in_addr_t netmask,
+ in_addr_t gateway,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es)
+{
+ struct route_ipv4 r;
+ CLEAR (r);
+ r.flags = RT_DEFINED;
+ r.network = network;
+ r.netmask = netmask;
+ r.gateway = gateway;
+ add_route (&r, tt, flags, rgi, es);
+}
+
+static void
+del_route3 (in_addr_t network,
+ in_addr_t netmask,
+ in_addr_t gateway,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es)
+{
+ struct route_ipv4 r;
+ CLEAR (r);
+ r.flags = RT_DEFINED|RT_ADDED;
+ r.network = network;
+ r.netmask = netmask;
+ r.gateway = gateway;
+ delete_route (&r, tt, flags, rgi, es);
+}
+
+static void
+add_bypass_routes (struct route_bypass *rb,
+ in_addr_t gateway,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es)
+{
+ int i;
+ for (i = 0; i < rb->n_bypass; ++i)
+ {
+ if (rb->bypass[i])
+ add_route3 (rb->bypass[i],
+ IPV4_NETMASK_HOST,
+ gateway,
+ tt,
+ flags | ROUTE_REF_GW,
+ rgi,
+ es);
+ }
+}
+
+static void
+del_bypass_routes (struct route_bypass *rb,
+ in_addr_t gateway,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es)
+{
+ int i;
+ for (i = 0; i < rb->n_bypass; ++i)
+ {
+ if (rb->bypass[i])
+ del_route3 (rb->bypass[i],
+ IPV4_NETMASK_HOST,
+ gateway,
+ tt,
+ flags | ROUTE_REF_GW,
+ rgi,
+ es);
+ }
+}
+
+static void
+redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ const char err[] = "NOTE: unable to redirect default gateway --";
+
+ if ( rl && rl->flags & RG_ENABLE )
+ {
+ if (!(rl->spec.flags & RTSA_REMOTE_ENDPOINT))
+ {
+ msg (M_WARN, "%s VPN gateway parameter (--route-gateway or --ifconfig) is missing", err);
+ }
+ else if (!(rl->rgi.flags & RGI_ADDR_DEFINED))
+ {
+ msg (M_WARN, "%s Cannot read current default gateway from system", err);
+ }
+ else if (!(rl->spec.flags & RTSA_REMOTE_HOST))
+ {
+ msg (M_WARN, "%s Cannot obtain current remote host address", err);
+ }
+ else
+ {
+#ifndef TARGET_ANDROID
+ bool local = BOOL_CAST(rl->flags & RG_LOCAL);
+ if (rl->flags & RG_AUTO_LOCAL) {
+ const int tla = rl->spec.remote_host_local;
+ if (tla == TLA_NONLOCAL)
+ {
+ dmsg (D_ROUTE, "ROUTE remote_host is NOT LOCAL");
+ local = false;
+ }
+ else if (tla == TLA_LOCAL)
+ {
+ dmsg (D_ROUTE, "ROUTE remote_host is LOCAL");
+ local = true;
+ }
+ }
+ if (!local)
+ {
+ /* route remote host to original default gateway */
+ /* if remote_host is not ipv4 (ie: ipv6), just skip
+ * adding this special /32 route */
+ if (rl->spec.remote_host != IPV4_INVALID_ADDR) {
+ add_route3 (rl->spec.remote_host,
+ IPV4_NETMASK_HOST,
+ rl->rgi.gateway.addr,
+ tt,
+ flags | ROUTE_REF_GW,
+ &rl->rgi,
+ es);
+ rl->iflags |= RL_DID_LOCAL;
+ } else {
+ dmsg (D_ROUTE, "ROUTE remote_host protocol differs from tunneled");
+ }
+ }
+#endif
+
+ /* route DHCP/DNS server traffic through original default gateway */
+ add_bypass_routes (&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags, &rl->rgi, es);
+
+ if (rl->flags & RG_REROUTE_GW)
+ {
+ if (rl->flags & RG_DEF1)
+ {
+ /* add new default route (1st component) */
+ add_route3 (0x00000000,
+ 0x80000000,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+
+ /* add new default route (2nd component) */
+ add_route3 (0x80000000,
+ 0x80000000,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+ }
+ else
+ {
+ /* delete default route */
+ del_route3 (0,
+ 0,
+ rl->rgi.gateway.addr,
+ tt,
+ flags | ROUTE_REF_GW,
+ &rl->rgi,
+ es);
+
+ /* add new default route */
+ add_route3 (0,
+ 0,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+ }
+ }
+
+ /* set a flag so we can undo later */
+ rl->iflags |= RL_DID_REDIRECT_DEFAULT_GATEWAY;
+ }
+ }
+}
+
+static void
+undo_redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ if ( rl && rl->iflags & RL_DID_REDIRECT_DEFAULT_GATEWAY )
+ {
+ /* delete remote host route */
+ if (rl->iflags & RL_DID_LOCAL)
+ {
+ del_route3 (rl->spec.remote_host,
+ IPV4_NETMASK_HOST,
+ rl->rgi.gateway.addr,
+ tt,
+ flags | ROUTE_REF_GW,
+ &rl->rgi,
+ es);
+ rl->iflags &= ~RL_DID_LOCAL;
+ }
+
+ /* delete special DHCP/DNS bypass route */
+ del_bypass_routes (&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags, &rl->rgi, es);
+
+ if (rl->flags & RG_REROUTE_GW)
+ {
+ if (rl->flags & RG_DEF1)
+ {
+ /* delete default route (1st component) */
+ del_route3 (0x00000000,
+ 0x80000000,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+
+ /* delete default route (2nd component) */
+ del_route3 (0x80000000,
+ 0x80000000,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+ }
+ else
+ {
+ /* delete default route */
+ del_route3 (0,
+ 0,
+ rl->spec.remote_endpoint,
+ tt,
+ flags,
+ &rl->rgi,
+ es);
+
+ /* restore original default route */
+ add_route3 (0,
+ 0,
+ rl->rgi.gateway.addr,
+ tt,
+ flags | ROUTE_REF_GW,
+ &rl->rgi,
+ es);
+ }
+ }
+
+ rl->iflags &= ~RL_DID_REDIRECT_DEFAULT_GATEWAY;
+ }
+}
+
+void
+add_routes (struct route_list *rl, struct route_ipv6_list *rl6, const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ redirect_default_route_to_vpn (rl, tt, flags, es);
+ if ( rl && !(rl->iflags & RL_ROUTES_ADDED) )
+ {
+ struct route_ipv4 *r;
+
+#ifdef ENABLE_MANAGEMENT
+ if (management && rl->routes)
+ {
+ management_set_state (management,
+ OPENVPN_STATE_ADD_ROUTES,
+ NULL,
+ 0,
+ 0);
+ }
+#endif
+
+ for (r = rl->routes; r; r = r->next)
+ {
+ check_subnet_conflict (r->network, r->netmask, "route");
+ if (flags & ROUTE_DELETE_FIRST)
+ delete_route (r, tt, flags, &rl->rgi, es);
+ add_route (r, tt, flags, &rl->rgi, es);
+ }
+ rl->iflags |= RL_ROUTES_ADDED;
+ }
+ if (rl6 && !rl6->routes_added)
+ {
+ struct route_ipv6 *r;
+ for (r = rl6->routes_ipv6; r; r = r->next)
+ {
+ if (flags & ROUTE_DELETE_FIRST)
+ delete_route_ipv6 (r, tt, flags, es);
+ add_route_ipv6 (r, tt, flags, es);
+ }
+ rl6->routes_added = true;
+ }
+}
+
+void
+delete_routes (struct route_list *rl, struct route_ipv6_list *rl6,
+ const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ if ( rl && rl->iflags & RL_ROUTES_ADDED )
+ {
+ struct route_ipv4 *r;
+ for (r = rl->routes; r; r = r->next)
+ {
+ delete_route (r, tt, flags, &rl->rgi, es);
+ }
+ rl->iflags &= ~RL_ROUTES_ADDED;
+ }
+
+ undo_redirect_default_route_to_vpn (rl, tt, flags, es);
+
+ if ( rl )
+ {
+ clear_route_list (rl);
+ }
+
+ if ( rl6 && rl6->routes_added )
+ {
+ struct route_ipv6 *r6;
+ for (r6 = rl6->routes_ipv6; r6; r6 = r6->next)
+ {
+ delete_route_ipv6 (r6, tt, flags, es);
+ }
+ rl6->routes_added = false;
+ }
+
+ if ( rl6 )
+ {
+ clear_route_ipv6_list (rl6);
+ }
+}
+
+#ifndef ENABLE_SMALL
+
+static const char *
+show_opt (const char *option)
+{
+ if (!option)
+ return "nil";
+ else
+ return option;
+}
+
+static void
+print_route_option (const struct route_option *ro, int level)
+{
+ msg (level, " route %s/%s/%s/%s",
+ show_opt (ro->network),
+ show_opt (ro->netmask),
+ show_opt (ro->gateway),
+ show_opt (ro->metric));
+}
+
+void
+print_route_options (const struct route_option_list *rol,
+ int level)
+{
+ struct route_option *ro;
+ if (rol->flags & RG_ENABLE)
+ msg (level, " [redirect_default_gateway local=%d]",
+ (rol->flags & RG_LOCAL) != 0);
+ for (ro = rol->routes; ro; ro = ro->next)
+ print_route_option (ro, level);
+}
+
+void
+print_default_gateway(const int msglevel, const struct route_gateway_info *rgi)
+{
+ struct gc_arena gc = gc_new ();
+ if (rgi->flags & RGI_ADDR_DEFINED)
+ {
+ struct buffer out = alloc_buf_gc (256, &gc);
+ buf_printf (&out, "ROUTE_GATEWAY");
+ if (rgi->flags & RGI_ON_LINK)
+ buf_printf (&out, " ON_LINK");
+ else
+ buf_printf (&out, " %s", print_in_addr_t (rgi->gateway.addr, 0, &gc));
+ if (rgi->flags & RGI_NETMASK_DEFINED)
+ buf_printf (&out, "/%s", print_in_addr_t (rgi->gateway.netmask, 0, &gc));
+#ifdef WIN32
+ if (rgi->flags & RGI_IFACE_DEFINED)
+ buf_printf (&out, " I=%u", (unsigned int)rgi->adapter_index);
+#else
+ if (rgi->flags & RGI_IFACE_DEFINED)
+ buf_printf (&out, " IFACE=%s", rgi->iface);
+#endif
+ if (rgi->flags & RGI_HWADDR_DEFINED)
+ buf_printf (&out, " HWADDR=%s", format_hex_ex (rgi->hwaddr, 6, 0, 1, ":", &gc));
+ msg (msglevel, "%s", BSTR (&out));
+ }
+ gc_free (&gc);
+}
+
+#endif
+
+static void
+print_route (const struct route_ipv4 *r, int level)
+{
+ struct gc_arena gc = gc_new ();
+ if (r->flags & RT_DEFINED)
+ msg (level, "%s", route_string (r, &gc));
+ gc_free (&gc);
+}
+
+void
+print_routes (const struct route_list *rl, int level)
+{
+ struct route_ipv4 *r;
+ for (r = rl->routes; r; r = r->next)
+ print_route (r, level);
+}
+
+static void
+setenv_route (struct env_set *es, const struct route_ipv4 *r, int i)
+{
+ struct gc_arena gc = gc_new ();
+ if (r->flags & RT_DEFINED)
+ {
+ setenv_route_addr (es, "network", r->network, i);
+ setenv_route_addr (es, "netmask", r->netmask, i);
+ setenv_route_addr (es, "gateway", r->gateway, i);
+
+ if (r->flags & RT_METRIC_DEFINED)
+ {
+ struct buffer name = alloc_buf_gc (256, &gc);
+ buf_printf (&name, "route_metric_%d", i);
+ setenv_int (es, BSTR (&name), r->metric);
+ }
+ }
+ gc_free (&gc);
+}
+
+void
+setenv_routes (struct env_set *es, const struct route_list *rl)
+{
+ int i = 1;
+ struct route_ipv4 *r;
+ for (r = rl->routes; r; r = r->next)
+ setenv_route (es, r, i++);
+}
+
+static void
+setenv_route_ipv6 (struct env_set *es, const struct route_ipv6 *r6, int i)
+{
+ struct gc_arena gc = gc_new ();
+ if (r6->defined)
+ {
+ struct buffer name1 = alloc_buf_gc( 256, &gc );
+ struct buffer val = alloc_buf_gc( 256, &gc );
+ struct buffer name2 = alloc_buf_gc( 256, &gc );
+
+ buf_printf( &name1, "route_ipv6_network_%d", i );
+ buf_printf( &val, "%s/%d", print_in6_addr( r6->network, 0, &gc ),
+ r6->netbits );
+ setenv_str( es, BSTR(&name1), BSTR(&val) );
+
+ buf_printf( &name2, "route_ipv6_gateway_%d", i );
+ setenv_str( es, BSTR(&name2), print_in6_addr( r6->gateway, 0, &gc ));
+ }
+ gc_free (&gc);
+}
+void
+setenv_routes_ipv6 (struct env_set *es, const struct route_ipv6_list *rl6)
+{
+ int i = 1;
+ struct route_ipv6 *r6;
+ for (r6 = rl6->routes_ipv6; r6; r6 = r6->next)
+ setenv_route_ipv6 (es, r6, i++);
+}
+
+/*
+ * local_route() determines whether the gateway of a provided host
+ * route is on the same interface that owns the default gateway.
+ * It uses the data structure
+ * returned by get_default_gateway() (struct route_gateway_info)
+ * to determine this. If the route is local, LR_MATCH is returned.
+ * When adding routes into the kernel, if LR_MATCH is defined for
+ * a given route, the route should explicitly reference the default
+ * gateway interface as the route destination. For example, here
+ * is an example on Linux that uses LR_MATCH:
+ *
+ * route add -net 10.10.0.1 netmask 255.255.255.255 dev eth0
+ *
+ * This capability is needed by the "default-gateway block-local"
+ * directive, to allow client access to the local subnet to be
+ * blocked but still allow access to the local default gateway.
+ */
+
+/* local_route() return values */
+#define LR_NOMATCH 0 /* route is not local */
+#define LR_MATCH 1 /* route is local */
+#define LR_ERROR 2 /* caller should abort adding route */
+
+static int
+local_route (in_addr_t network,
+ in_addr_t netmask,
+ in_addr_t gateway,
+ const struct route_gateway_info *rgi)
+{
+ /* set LR_MATCH on local host routes */
+ const int rgi_needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED|RGI_IFACE_DEFINED);
+ if (rgi
+ && (rgi->flags & rgi_needed) == rgi_needed
+ && gateway == rgi->gateway.addr
+ && netmask == 0xFFFFFFFF)
+ {
+ if (((network ^ rgi->gateway.addr) & rgi->gateway.netmask) == 0)
+ return LR_MATCH;
+ else
+ {
+ /* examine additional subnets on gateway interface */
+ size_t i;
+ for (i = 0; i < rgi->n_addrs; ++i)
+ {
+ const struct route_gateway_address *gwa = &rgi->addrs[i];
+ if (((network ^ gwa->addr) & gwa->netmask) == 0)
+ return LR_MATCH;
+ }
+ }
+ }
+ return LR_NOMATCH;
+}
+
+/* Return true if the "on-link" form of the route should be used. This is when the gateway for a
+ a route is specified as an interface rather than an address. */
+static inline bool
+is_on_link (const int is_local_route, const unsigned int flags, const struct route_gateway_info *rgi)
+{
+ return rgi && (is_local_route == LR_MATCH || ((flags & ROUTE_REF_GW) && (rgi->flags & RGI_ON_LINK)));
+}
+
+void
+add_route (struct route_ipv4 *r,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi, /* may be NULL */
+ const struct env_set *es)
+{
+ struct gc_arena gc;
+ struct argv argv;
+ const char *network;
+ const char *netmask;
+ const char *gateway;
+ bool status = false;
+ int is_local_route;
+
+ if (!(r->flags & RT_DEFINED))
+ return;
+
+ gc_init (&gc);
+ argv_init (&argv);
+
+ network = print_in_addr_t (r->network, 0, &gc);
+ netmask = print_in_addr_t (r->netmask, 0, &gc);
+ gateway = print_in_addr_t (r->gateway, 0, &gc);
+
+ is_local_route = local_route(r->network, r->netmask, r->gateway, rgi);
+ if (is_local_route == LR_ERROR)
+ goto done;
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ /* FIXME -- add on-link support for ENABLE_IPROUTE */
+ argv_printf (&argv, "%s route add %s/%d via %s",
+ iproute_path,
+ network,
+ count_netmask_bits(netmask),
+ gateway);
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "metric %d", r->metric);
+
+#else
+ argv_printf (&argv, "%s add -net %s netmask %s",
+ ROUTE_PATH,
+ network,
+ netmask);
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "metric %d", r->metric);
+ if (is_on_link (is_local_route, flags, rgi))
+ argv_printf_cat (&argv, "dev %s", rgi->iface);
+ else
+ argv_printf_cat (&argv, "gw %s", gateway);
+
+#endif /*ENABLE_IPROUTE*/
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Linux route add command failed");
+
+#elif defined (TARGET_ANDROID)
+ struct buffer out = alloc_buf_gc (128, &gc);
+
+ if (rgi)
+ buf_printf (&out, "%s %s %s dev %s", network, netmask, gateway, rgi->iface);
+ else
+ buf_printf (&out, "%s %s %s", network, netmask, gateway);
+ management_android_control (management, "ROUTE", buf_bptr(&out));
+
+#elif defined (WIN32)
+ {
+ DWORD ai = TUN_ADAPTER_INDEX_INVALID;
+ argv_printf (&argv, "%s%sc ADD %s MASK %s %s",
+ get_win_sys_path(),
+ WIN_ROUTE_PATH_SUFFIX,
+ network,
+ netmask,
+ gateway);
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "METRIC %d", r->metric);
+ if (is_on_link (is_local_route, flags, rgi))
+ {
+ ai = rgi->adapter_index;
+ argv_printf_cat (&argv, "IF %u", (unsigned int)ai);
+ }
+
+ argv_msg (D_ROUTE, &argv);
+
+ if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_IPAPI)
+ {
+ status = add_route_ipapi (r, tt, ai);
+ msg (D_ROUTE, "Route addition via IPAPI %s", status ? "succeeded" : "failed");
+ }
+ else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_EXE)
+ {
+ netcmd_semaphore_lock ();
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command failed");
+ netcmd_semaphore_release ();
+ }
+ else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_ADAPTIVE)
+ {
+ status = add_route_ipapi (r, tt, ai);
+ msg (D_ROUTE, "Route addition via IPAPI %s [adaptive]", status ? "succeeded" : "failed");
+ if (!status)
+ {
+ msg (D_ROUTE, "Route addition fallback to route.exe");
+ netcmd_semaphore_lock ();
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add command failed [adaptive]");
+ netcmd_semaphore_release ();
+ }
+ }
+ else
+ {
+ ASSERT (0);
+ }
+ }
+
+#elif defined (TARGET_SOLARIS)
+
+ /* example: route add 192.0.2.32 -netmask 255.255.255.224 somegateway */
+
+ argv_printf (&argv, "%s add",
+ ROUTE_PATH);
+
+ argv_printf_cat (&argv, "%s -netmask %s %s",
+ network,
+ netmask,
+ gateway);
+
+ /* Solaris can only distinguish between "metric 0" == "on-link on the
+ * interface where the IP address given is configured" and "metric > 0"
+ * == "use gateway specified" (no finer-grained route metrics available)
+ *
+ * More recent versions of Solaris can also do "-interface", but that
+ * would break backwards compatibility with older versions for no gain.
+ */
+ if (r->flags & RT_METRIC_DEFINED )
+ argv_printf_cat (&argv, "%d", r->metric);
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Solaris route add command failed");
+
+#elif defined(TARGET_FREEBSD)
+
+ argv_printf (&argv, "%s add",
+ ROUTE_PATH);
+
+#if 0
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "-rtt %d", r->metric);
+#endif
+
+ argv_printf_cat (&argv, "-net %s %s %s",
+ network,
+ gateway,
+ netmask);
+
+ /* FIXME -- add on-link support for FreeBSD */
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: FreeBSD route add command failed");
+
+#elif defined(TARGET_DRAGONFLY)
+
+ argv_printf (&argv, "%s add",
+ ROUTE_PATH);
+
+#if 0
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "-rtt %d", r->metric);
+#endif
+
+ argv_printf_cat (&argv, "-net %s %s %s",
+ network,
+ gateway,
+ netmask);
+
+ /* FIXME -- add on-link support for Dragonfly */
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: DragonFly route add command failed");
+
+#elif defined(TARGET_DARWIN)
+
+ argv_printf (&argv, "%s add",
+ ROUTE_PATH);
+
+#if 0
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "-rtt %d", r->metric);
+#endif
+
+ if (is_on_link (is_local_route, flags, rgi))
+ {
+ /* Mac OS X route syntax for ON_LINK:
+ route add -cloning -net 10.10.0.1 -netmask 255.255.255.255 -interface en0 */
+ argv_printf_cat (&argv, "-cloning -net %s -netmask %s -interface %s",
+ network,
+ netmask,
+ rgi->iface);
+ }
+ else
+ {
+ argv_printf_cat (&argv, "-net %s %s %s",
+ network,
+ gateway,
+ netmask);
+ }
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: OS X route add command failed");
+
+#elif defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
+
+ argv_printf (&argv, "%s add",
+ ROUTE_PATH);
+
+#if 0
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "-rtt %d", r->metric);
+#endif
+
+ argv_printf_cat (&argv, "-net %s %s -netmask %s",
+ network,
+ gateway,
+ netmask);
+
+ /* FIXME -- add on-link support for OpenBSD/NetBSD */
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD/NetBSD route add command failed");
+
+#elif defined(TARGET_AIX)
+
+ {
+ int netbits = netmask_to_netbits2(r->netmask);
+ argv_printf (&argv, "%s add -net %s/%d %s",
+ ROUTE_PATH,
+ network, netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+ }
+
+#else
+ msg (M_FATAL, "Sorry, but I don't know how to do 'route' commands on this operating system. Try putting your routes in a --route-up script");
+#endif
+
+ done:
+ if (status)
+ r->flags |= RT_ADDED;
+ else
+ r->flags &= ~RT_ADDED;
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+
+static const char *
+print_in6_addr_netbits_only( struct in6_addr network_copy, int netbits,
+ struct gc_arena * gc)
+{
+ /* clear host bit parts of route
+ * (needed if routes are specified improperly, or if we need to
+ * explicitely setup/clear the "connected" network routes on some OSes)
+ */
+ int byte = 15;
+ int bits_to_clear = 128 - netbits;
+
+ while( byte >= 0 && bits_to_clear > 0 )
+ {
+ if ( bits_to_clear >= 8 )
+ { network_copy.s6_addr[byte--] = 0; bits_to_clear -= 8; }
+ else
+ { network_copy.s6_addr[byte--] &= (0xff << bits_to_clear); bits_to_clear = 0; }
+ }
+
+ return print_in6_addr( network_copy, 0, gc);
+}
+
+void
+add_route_ipv6 (struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ struct gc_arena gc;
+ struct argv argv;
+
+ const char *network;
+ const char *gateway;
+ bool status = false;
+ const char *device = tt->actual_name;
+
+ bool gateway_needed = false;
+
+ if (!r6->defined)
+ return;
+
+ gc_init (&gc);
+ argv_init (&argv);
+
+ network = print_in6_addr_netbits_only( r6->network, r6->netbits, &gc);
+ gateway = print_in6_addr( r6->gateway, 0, &gc);
+
+ if ( !tt->ipv6 )
+ {
+ msg( M_INFO, "add_route_ipv6(): not adding %s/%d, no IPv6 on if %s",
+ network, r6->netbits, device );
+ return;
+ }
+
+ msg( M_INFO, "add_route_ipv6(%s/%d -> %s metric %d) dev %s",
+ network, r6->netbits, gateway, r6->metric, device );
+
+ /*
+ * Filter out routes which are essentially no-ops
+ * (not currently done for IPv6)
+ */
+
+ /* On "tun" interface, we never set a gateway if the operating system
+ * can do "route to interface" - it does not add value, as the target
+ * dev already fully qualifies the route destination on point-to-point
+ * interfaces. OTOH, on "tap" interface, we must always set the
+ * gateway unless the route is to be an on-link network
+ */
+ if ( tt->type == DEV_TYPE_TAP &&
+ !(r6->metric_defined && r6->metric == 0 ) )
+ {
+ gateway_needed = true;
+ }
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ argv_printf (&argv, "%s -6 route add %s/%d dev %s",
+ iproute_path,
+ network,
+ r6->netbits,
+ device);
+ if (gateway_needed)
+ argv_printf_cat (&argv, "via %s", gateway);
+ if (r6->metric_defined && r6->metric > 0 )
+ argv_printf_cat (&argv, " metric %d", r6->metric);
+
+#else
+ argv_printf (&argv, "%s -A inet6 add %s/%d dev %s",
+ ROUTE_PATH,
+ network,
+ r6->netbits,
+ device);
+ if (gateway_needed)
+ argv_printf_cat (&argv, "gw %s", gateway);
+ if (r6->metric_defined && r6->metric > 0 )
+ argv_printf_cat (&argv, " metric %d", r6->metric);
+#endif /*ENABLE_IPROUTE*/
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Linux route -6/-A inet6 add command failed");
+
+#elif defined (TARGET_ANDROID)
+ struct buffer out = alloc_buf_gc (64, &gc);
+
+ buf_printf (&out, "%s/%d %s", network, r6->netbits, device);
+
+ management_android_control (management, "ROUTE6", buf_bptr(&out));
+
+#elif defined (WIN32)
+
+ /* netsh interface ipv6 add route 2001:db8::/32 MyTunDevice */
+ argv_printf (&argv, "%s%sc interface ipv6 add route %s/%d %s",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ network,
+ r6->netbits,
+ device);
+
+ /* next-hop depends on TUN or TAP mode:
+ * - in TAP mode, we use the "real" next-hop
+ * - in TUN mode we use a special-case link-local address that the tapdrvr
+ * knows about and will answer ND (neighbor discovery) packets for
+ */
+ if ( tt->type == DEV_TYPE_TUN )
+ argv_printf_cat( &argv, " %s", "fe80::8" );
+ else
+ argv_printf_cat( &argv, " %s", gateway );
+
+#if 0
+ if (r->metric_defined)
+ argv_printf_cat (&argv, " METRIC %d", r->metric);
+#endif
+
+ /* in some versions of Windows, routes are persistent across reboots by
+ * default, unless "store=active" is set (pointed out by Tony Lim, thanks)
+ */
+ argv_printf_cat( &argv, " store=active" );
+
+ argv_msg (D_ROUTE, &argv);
+
+ netcmd_semaphore_lock ();
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Windows route add ipv6 command failed");
+ netcmd_semaphore_release ();
+
+#elif defined (TARGET_SOLARIS)
+
+ /* example: route add -inet6 2001:db8::/32 somegateway 0 */
+
+ /* for some weird reason, this does not work for me unless I set
+ * "metric 0" - otherwise, the routes will be nicely installed, but
+ * packets will just disappear somewhere. So we use "0" now...
+ */
+
+ argv_printf (&argv, "%s add -inet6 %s/%d %s 0",
+ ROUTE_PATH,
+ network,
+ r6->netbits,
+ gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: Solaris route add -inet6 command failed");
+
+#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)
+
+ argv_printf (&argv, "%s add -inet6 %s/%d",
+ ROUTE_PATH,
+ network,
+ r6->netbits);
+
+ if (gateway_needed)
+ argv_printf_cat (&argv, "%s", gateway);
+ else
+ argv_printf_cat (&argv, "-iface %s", device);
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: *BSD route add -inet6 command failed");
+
+#elif defined(TARGET_DARWIN)
+
+ argv_printf (&argv, "%s add -inet6 %s -prefixlen %d",
+ ROUTE_PATH,
+ network, r6->netbits );
+
+ if (gateway_needed)
+ argv_printf_cat (&argv, "%s", gateway);
+ else
+ argv_printf_cat (&argv, "-iface %s", device);
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: MacOS X route add -inet6 command failed");
+
+#elif defined(TARGET_OPENBSD)
+
+ argv_printf (&argv, "%s add -inet6 %s -prefixlen %d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD route add -inet6 command failed");
+
+#elif defined(TARGET_NETBSD)
+
+ argv_printf (&argv, "%s add -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: NetBSD route add -inet6 command failed");
+
+#elif defined(TARGET_AIX)
+
+ argv_printf (&argv, "%s add -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ status = openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+
+#else
+ msg (M_FATAL, "Sorry, but I don't know how to do 'route ipv6' commands on this operating system. Try putting your routes in a --route-up script");
+#endif
+
+ r6->defined = status;
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+static void
+delete_route (struct route_ipv4 *r,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es)
+{
+ struct gc_arena gc;
+ struct argv argv;
+ const char *network;
+ const char *netmask;
+ const char *gateway;
+ int is_local_route;
+
+ if ((r->flags & (RT_DEFINED|RT_ADDED)) != (RT_DEFINED|RT_ADDED))
+ return;
+
+ gc_init (&gc);
+ argv_init (&argv);
+
+ network = print_in_addr_t (r->network, 0, &gc);
+ netmask = print_in_addr_t (r->netmask, 0, &gc);
+ gateway = print_in_addr_t (r->gateway, 0, &gc);
+
+ is_local_route = local_route(r->network, r->netmask, r->gateway, rgi);
+ if (is_local_route == LR_ERROR)
+ goto done;
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ argv_printf (&argv, "%s route del %s/%d",
+ iproute_path,
+ network,
+ count_netmask_bits(netmask));
+#else
+ argv_printf (&argv, "%s del -net %s netmask %s",
+ ROUTE_PATH,
+ network,
+ netmask);
+#endif /*ENABLE_IPROUTE*/
+ if (r->flags & RT_METRIC_DEFINED)
+ argv_printf_cat (&argv, "metric %d", r->metric);
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: Linux route delete command failed");
+
+#elif defined (WIN32)
+
+ argv_printf (&argv, "%s%sc DELETE %s MASK %s %s",
+ get_win_sys_path(),
+ WIN_ROUTE_PATH_SUFFIX,
+ network,
+ netmask,
+ gateway);
+
+ argv_msg (D_ROUTE, &argv);
+
+ if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_IPAPI)
+ {
+ const bool status = del_route_ipapi (r, tt);
+ msg (D_ROUTE, "Route deletion via IPAPI %s", status ? "succeeded" : "failed");
+ }
+ else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_EXE)
+ {
+ netcmd_semaphore_lock ();
+ openvpn_execve_check (&argv, es, 0, "ERROR: Windows route delete command failed");
+ netcmd_semaphore_release ();
+ }
+ else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_ADAPTIVE)
+ {
+ const bool status = del_route_ipapi (r, tt);
+ msg (D_ROUTE, "Route deletion via IPAPI %s [adaptive]", status ? "succeeded" : "failed");
+ if (!status)
+ {
+ msg (D_ROUTE, "Route deletion fallback to route.exe");
+ netcmd_semaphore_lock ();
+ openvpn_execve_check (&argv, es, 0, "ERROR: Windows route delete command failed [adaptive]");
+ netcmd_semaphore_release ();
+ }
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+#elif defined (TARGET_SOLARIS)
+
+ argv_printf (&argv, "%s delete %s -netmask %s %s",
+ ROUTE_PATH,
+ network,
+ netmask,
+ gateway);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: Solaris route delete command failed");
+
+#elif defined(TARGET_FREEBSD)
+
+ argv_printf (&argv, "%s delete -net %s %s %s",
+ ROUTE_PATH,
+ network,
+ gateway,
+ netmask);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: FreeBSD route delete command failed");
+
+#elif defined(TARGET_DRAGONFLY)
+
+ argv_printf (&argv, "%s delete -net %s %s %s",
+ ROUTE_PATH,
+ network,
+ gateway,
+ netmask);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: DragonFly route delete command failed");
+
+#elif defined(TARGET_DARWIN)
+
+ if (is_on_link (is_local_route, flags, rgi))
+ {
+ argv_printf (&argv, "%s delete -cloning -net %s -netmask %s -interface %s",
+ ROUTE_PATH,
+ network,
+ netmask,
+ rgi->iface);
+ }
+ else
+ {
+ argv_printf (&argv, "%s delete -net %s %s %s",
+ ROUTE_PATH,
+ network,
+ gateway,
+ netmask);
+ }
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: OS X route delete command failed");
+
+#elif defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
+
+ argv_printf (&argv, "%s delete -net %s %s -netmask %s",
+ ROUTE_PATH,
+ network,
+ gateway,
+ netmask);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD/NetBSD route delete command failed");
+
+#elif defined(TARGET_ANDROID)
+ msg (M_NONFATAL, "Sorry, deleting routes on Android is not possible. The VpnService API allows routes to be set on connect only.");
+
+#elif defined(TARGET_AIX)
+
+ {
+ int netbits = netmask_to_netbits2(r->netmask);
+ argv_printf (&argv, "%s delete -net %s/%d %s",
+ ROUTE_PATH,
+ network, netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: AIX route delete command failed");
+ }
+
+#else
+ msg (M_FATAL, "Sorry, but I don't know how to do 'route' commands on this operating system. Try putting your routes in a --route-up script");
+#endif
+
+ done:
+ r->flags &= ~RT_ADDED;
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+void
+delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flags, const struct env_set *es)
+{
+ struct gc_arena gc;
+ struct argv argv;
+ const char *network;
+ const char *gateway;
+ const char *device = tt->actual_name;
+ bool gateway_needed = false;
+
+ if (!r6->defined)
+ return;
+
+ gc_init (&gc);
+ argv_init (&argv);
+
+ network = print_in6_addr_netbits_only( r6->network, r6->netbits, &gc);
+ gateway = print_in6_addr( r6->gateway, 0, &gc);
+
+ if ( !tt->ipv6 )
+ {
+ msg( M_INFO, "delete_route_ipv6(): not deleting %s/%d, no IPv6 on if %s",
+ network, r6->netbits, device );
+ return;
+ }
+
+ msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits );
+
+ /* if we used a gateway on "add route", we also need to specify it on
+ * delete, otherwise some OSes will refuse to delete the route
+ */
+ if ( tt->type == DEV_TYPE_TAP &&
+ !(r6->metric_defined && r6->metric == 0 ) )
+ {
+ gateway_needed = true;
+ }
+
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ argv_printf (&argv, "%s -6 route del %s/%d dev %s",
+ iproute_path,
+ network,
+ r6->netbits,
+ device);
+ if (gateway_needed)
+ argv_printf_cat (&argv, "via %s", gateway);
+#else
+ argv_printf (&argv, "%s -A inet6 del %s/%d dev %s",
+ ROUTE_PATH,
+ network,
+ r6->netbits,
+ device);
+ if (gateway_needed)
+ argv_printf_cat (&argv, "gw %s", gateway);
+ if (r6->metric_defined && r6->metric > 0 )
+ argv_printf_cat (&argv, " metric %d", r6->metric);
+#endif /*ENABLE_IPROUTE*/
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: Linux route -6/-A inet6 del command failed");
+
+#elif defined (WIN32)
+
+ /* netsh interface ipv6 delete route 2001:db8::/32 MyTunDevice */
+ argv_printf (&argv, "%s%sc interface ipv6 delete route %s/%d %s",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ network,
+ r6->netbits,
+ device);
+
+ /* next-hop depends on TUN or TAP mode:
+ * - in TAP mode, we use the "real" next-hop
+ * - in TUN mode we use a special-case link-local address that the tapdrvr
+ * knows about and will answer ND (neighbor discovery) packets for
+ * (and "route deletion without specifying next-hop" does not work...)
+ */
+ if ( tt->type == DEV_TYPE_TUN )
+ argv_printf_cat( &argv, " %s", "fe80::8" );
+ else
+ argv_printf_cat( &argv, " %s", gateway );
+
+#if 0
+ if (r->metric_defined)
+ argv_printf_cat (&argv, "METRIC %d", r->metric);
+#endif
+
+ /* Windows XP to 7 "just delete" routes, wherever they came from, but
+ * in Windows 8(.1?), if you create them with "store=active", this is
+ * how you should delete them as well (pointed out by Cedric Tabary)
+ */
+ argv_printf_cat( &argv, " store=active" );
+
+ argv_msg (D_ROUTE, &argv);
+
+ netcmd_semaphore_lock ();
+ openvpn_execve_check (&argv, es, 0, "ERROR: Windows route delete ipv6 command failed");
+ netcmd_semaphore_release ();
+
+#elif defined (TARGET_SOLARIS)
+
+ /* example: route delete -inet6 2001:db8::/32 somegateway */
+ /* GERT-TODO: this is untested, but should work */
+
+ argv_printf (&argv, "%s delete -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network,
+ r6->netbits,
+ gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: Solaris route delete -inet6 command failed");
+
+#elif defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY)
+
+ argv_printf (&argv, "%s delete -inet6 %s/%d",
+ ROUTE_PATH,
+ network,
+ r6->netbits );
+
+ if (gateway_needed)
+ argv_printf_cat (&argv, "%s", gateway);
+ else
+ argv_printf_cat (&argv, "-iface %s", device);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: *BSD route delete -inet6 command failed");
+
+#elif defined(TARGET_DARWIN)
+
+ argv_printf (&argv, "%s delete -inet6 %s -prefixlen %d",
+ ROUTE_PATH,
+ network, r6->netbits );
+
+ if (gateway_needed)
+ argv_printf_cat (&argv, "%s", gateway);
+ else
+ argv_printf_cat (&argv, "-iface %s", device);
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: MacOS X route delete -inet6 command failed");
+
+#elif defined(TARGET_OPENBSD)
+
+ argv_printf (&argv, "%s delete -inet6 %s -prefixlen %d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: OpenBSD route delete -inet6 command failed");
+
+#elif defined(TARGET_NETBSD)
+
+ argv_printf (&argv, "%s delete -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway );
+
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: NetBSD route delete -inet6 command failed");
+
+#elif defined(TARGET_AIX)
+
+ argv_printf (&argv, "%s delete -inet6 %s/%d %s",
+ ROUTE_PATH,
+ network, r6->netbits, gateway);
+ argv_msg (D_ROUTE, &argv);
+ openvpn_execve_check (&argv, es, 0, "ERROR: AIX route add command failed");
+
+#else
+ msg (M_FATAL, "Sorry, but I don't know how to do 'route ipv6' commands on this operating system. Try putting your routes in a --route-down script");
+#endif
+
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+/*
+ * The --redirect-gateway option requires OS-specific code below
+ * to get the current default gateway.
+ */
+
+#if defined(WIN32)
+
+static const MIB_IPFORWARDTABLE *
+get_windows_routing_table (struct gc_arena *gc)
+{
+ ULONG size = 0;
+ PMIB_IPFORWARDTABLE rt = NULL;
+ DWORD status;
+
+ status = GetIpForwardTable (NULL, &size, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER)
+ {
+ rt = (PMIB_IPFORWARDTABLE) gc_malloc (size, false, gc);
+ status = GetIpForwardTable (rt, &size, TRUE);
+ if (status != NO_ERROR)
+ {
+ msg (D_ROUTE, "NOTE: GetIpForwardTable returned error: %s (code=%u)",
+ strerror_win32 (status, gc),
+ (unsigned int)status);
+ rt = NULL;
+ }
+ }
+ return rt;
+}
+
+static int
+test_route (const IP_ADAPTER_INFO *adapters,
+ const in_addr_t gateway,
+ DWORD *index)
+{
+ int count = 0;
+ DWORD i = adapter_index_of_ip (adapters, gateway, &count, NULL);
+ if (index)
+ *index = i;
+ return count;
+}
+
+static void
+test_route_helper (bool *ret,
+ int *count,
+ int *good,
+ int *ambig,
+ const IP_ADAPTER_INFO *adapters,
+ const in_addr_t gateway)
+{
+ int c;
+
+ ++*count;
+ c = test_route (adapters, gateway, NULL);
+ if (c == 0)
+ *ret = false;
+ else
+ ++*good;
+ if (c > 1)
+ ++*ambig;
+}
+
+/*
+ * If we tried to add routes now, would we succeed?
+ */
+bool
+test_routes (const struct route_list *rl, const struct tuntap *tt)
+{
+ struct gc_arena gc = gc_new ();
+ const IP_ADAPTER_INFO *adapters = get_adapter_info_list (&gc);
+ bool ret = false;
+ int count = 0;
+ int good = 0;
+ int ambig = 0;
+ int len = -1;
+ bool adapter_up = false;
+
+ if (is_adapter_up (tt, adapters))
+ {
+ ret = true;
+ adapter_up = true;
+
+ if (rl)
+ {
+ struct route_ipv4 *r;
+ for (r = rl->routes, len = 0; r; r = r->next, ++len)
+ test_route_helper (&ret, &count, &good, &ambig, adapters, r->gateway);
+
+ if ((rl->flags & RG_ENABLE) && (rl->spec.flags & RTSA_REMOTE_ENDPOINT))
+ test_route_helper (&ret, &count, &good, &ambig, adapters, rl->spec.remote_endpoint);
+ }
+ }
+
+ msg (D_ROUTE, "TEST ROUTES: %d/%d succeeded len=%d ret=%d a=%d u/d=%s",
+ good,
+ count,
+ len,
+ (int)ret,
+ ambig,
+ adapter_up ? "up" : "down");
+
+ gc_free (&gc);
+ return ret;
+}
+
+static const MIB_IPFORWARDROW *
+get_default_gateway_row (const MIB_IPFORWARDTABLE *routes)
+{
+ struct gc_arena gc = gc_new ();
+ DWORD lowest_metric = MAXDWORD;
+ const MIB_IPFORWARDROW *ret = NULL;
+ int i;
+ int best = -1;
+
+ if (routes)
+ {
+ for (i = 0; i < routes->dwNumEntries; ++i)
+ {
+ const MIB_IPFORWARDROW *row = &routes->table[i];
+ const in_addr_t net = ntohl (row->dwForwardDest);
+ const in_addr_t mask = ntohl (row->dwForwardMask);
+ const DWORD index = row->dwForwardIfIndex;
+ const DWORD metric = row->dwForwardMetric1;
+
+ dmsg (D_ROUTE_DEBUG, "GDGR: route[%d] %s/%s i=%d m=%d",
+ i,
+ print_in_addr_t ((in_addr_t) net, 0, &gc),
+ print_in_addr_t ((in_addr_t) mask, 0, &gc),
+ (int)index,
+ (int)metric);
+
+ if (!net && !mask && metric < lowest_metric)
+ {
+ ret = row;
+ lowest_metric = metric;
+ best = i;
+ }
+ }
+ }
+
+ dmsg (D_ROUTE_DEBUG, "GDGR: best=%d lm=%u", best, (unsigned int)lowest_metric);
+
+ gc_free (&gc);
+ return ret;
+}
+
+void
+get_default_gateway (struct route_gateway_info *rgi)
+{
+ struct gc_arena gc = gc_new ();
+
+ const IP_ADAPTER_INFO *adapters = get_adapter_info_list (&gc);
+ const MIB_IPFORWARDTABLE *routes = get_windows_routing_table (&gc);
+ const MIB_IPFORWARDROW *row = get_default_gateway_row (routes);
+ DWORD a_index;
+ const IP_ADAPTER_INFO *ai;
+
+ CLEAR(*rgi);
+
+ if (row)
+ {
+ rgi->gateway.addr = ntohl (row->dwForwardNextHop);
+ if (rgi->gateway.addr)
+ {
+ rgi->flags |= RGI_ADDR_DEFINED;
+ a_index = adapter_index_of_ip (adapters, rgi->gateway.addr, NULL, &rgi->gateway.netmask);
+ if (a_index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ rgi->adapter_index = a_index;
+ rgi->flags |= (RGI_IFACE_DEFINED|RGI_NETMASK_DEFINED);
+ ai = get_adapter (adapters, a_index);
+ if (ai)
+ {
+ memcpy (rgi->hwaddr, ai->Address, 6);
+ rgi->flags |= RGI_HWADDR_DEFINED;
+ }
+ }
+ }
+ }
+
+ gc_free (&gc);
+}
+
+static DWORD
+windows_route_find_if_index (const struct route_ipv4 *r, const struct tuntap *tt)
+{
+ struct gc_arena gc = gc_new ();
+ DWORD ret = TUN_ADAPTER_INDEX_INVALID;
+ int count = 0;
+ const IP_ADAPTER_INFO *adapters = get_adapter_info_list (&gc);
+ const IP_ADAPTER_INFO *tun_adapter = get_tun_adapter (tt, adapters);
+ bool on_tun = false;
+
+ /* first test on tun interface */
+ if (is_ip_in_adapter_subnet (tun_adapter, r->gateway, NULL))
+ {
+ ret = tun_adapter->Index;
+ count = 1;
+ on_tun = true;
+ }
+ else /* test on other interfaces */
+ {
+ count = test_route (adapters, r->gateway, &ret);
+ }
+
+ if (count == 0)
+ {
+ msg (M_WARN, "Warning: route gateway is not reachable on any active network adapters: %s",
+ print_in_addr_t (r->gateway, 0, &gc));
+ ret = TUN_ADAPTER_INDEX_INVALID;
+ }
+ else if (count > 1)
+ {
+ msg (M_WARN, "Warning: route gateway is ambiguous: %s (%d matches)",
+ print_in_addr_t (r->gateway, 0, &gc),
+ count);
+ ret = TUN_ADAPTER_INDEX_INVALID;
+ }
+
+ dmsg (D_ROUTE_DEBUG, "DEBUG: route find if: on_tun=%d count=%d index=%d",
+ on_tun,
+ count,
+ (int)ret);
+
+ gc_free (&gc);
+ return ret;
+}
+
+bool
+add_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt, DWORD adapter_index)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+ DWORD status;
+ const DWORD if_index = (adapter_index == TUN_ADAPTER_INDEX_INVALID) ? windows_route_find_if_index (r, tt) : adapter_index;
+
+ if (if_index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ MIB_IPFORWARDROW fr;
+ CLEAR (fr);
+ fr.dwForwardDest = htonl (r->network);
+ fr.dwForwardMask = htonl (r->netmask);
+ fr.dwForwardPolicy = 0;
+ fr.dwForwardNextHop = htonl (r->gateway);
+ fr.dwForwardIfIndex = if_index;
+ fr.dwForwardType = 4; /* the next hop is not the final dest */
+ fr.dwForwardProto = 3; /* PROTO_IP_NETMGMT */
+ fr.dwForwardAge = 0;
+ fr.dwForwardNextHopAS = 0;
+ fr.dwForwardMetric1 = (r->flags & RT_METRIC_DEFINED) ? r->metric : 1;
+ fr.dwForwardMetric2 = METRIC_NOT_USED;
+ fr.dwForwardMetric3 = METRIC_NOT_USED;
+ fr.dwForwardMetric4 = METRIC_NOT_USED;
+ fr.dwForwardMetric5 = METRIC_NOT_USED;
+
+ if ((r->network & r->netmask) != r->network)
+ msg (M_WARN, "Warning: address %s is not a network address in relation to netmask %s",
+ print_in_addr_t (r->network, 0, &gc),
+ print_in_addr_t (r->netmask, 0, &gc));
+
+ status = CreateIpForwardEntry (&fr);
+
+ if (status == NO_ERROR)
+ ret = true;
+ else
+ {
+ /* failed, try increasing the metric to work around Vista issue */
+ const unsigned int forward_metric_limit = 2048; /* iteratively retry higher metrics up to this limit */
+
+ for ( ; fr.dwForwardMetric1 <= forward_metric_limit; ++fr.dwForwardMetric1)
+ {
+ /* try a different forward type=3 ("the next hop is the final dest") in addition to 4.
+ --redirect-gateway over RRAS seems to need this. */
+ for (fr.dwForwardType = 4; fr.dwForwardType >= 3; --fr.dwForwardType)
+ {
+ status = CreateIpForwardEntry (&fr);
+ if (status == NO_ERROR)
+ {
+ msg (D_ROUTE, "ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=%u and dwForwardType=%u",
+ (unsigned int)fr.dwForwardMetric1,
+ (unsigned int)fr.dwForwardType);
+ ret = true;
+ goto doublebreak;
+ }
+ else if (status != ERROR_BAD_ARGUMENTS)
+ goto doublebreak;
+ }
+ }
+
+ doublebreak:
+ if (status != NO_ERROR)
+ msg (M_WARN, "ROUTE: route addition failed using CreateIpForwardEntry: %s [status=%u if_index=%u]",
+ strerror_win32 (status, &gc),
+ (unsigned int)status,
+ (unsigned int)if_index);
+ }
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+bool
+del_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+ DWORD status;
+ const DWORD if_index = windows_route_find_if_index (r, tt);
+
+ if (if_index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ MIB_IPFORWARDROW fr;
+ CLEAR (fr);
+
+ fr.dwForwardDest = htonl (r->network);
+ fr.dwForwardMask = htonl (r->netmask);
+ fr.dwForwardPolicy = 0;
+ fr.dwForwardNextHop = htonl (r->gateway);
+ fr.dwForwardIfIndex = if_index;
+
+ status = DeleteIpForwardEntry (&fr);
+
+ if (status == NO_ERROR)
+ ret = true;
+ else
+ msg (M_WARN, "ROUTE: route deletion failed using DeleteIpForwardEntry: %s",
+ strerror_win32 (status, &gc));
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+static const char *
+format_route_entry (const MIB_IPFORWARDROW *r, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ buf_printf (&out, "%s %s %s p=%d i=%d t=%d pr=%d a=%d h=%d m=%d/%d/%d/%d/%d",
+ print_in_addr_t (r->dwForwardDest, IA_NET_ORDER, gc),
+ print_in_addr_t (r->dwForwardMask, IA_NET_ORDER, gc),
+ print_in_addr_t (r->dwForwardNextHop, IA_NET_ORDER, gc),
+ (int)r->dwForwardPolicy,
+ (int)r->dwForwardIfIndex,
+ (int)r->dwForwardType,
+ (int)r->dwForwardProto,
+ (int)r->dwForwardAge,
+ (int)r->dwForwardNextHopAS,
+ (int)r->dwForwardMetric1,
+ (int)r->dwForwardMetric2,
+ (int)r->dwForwardMetric3,
+ (int)r->dwForwardMetric4,
+ (int)r->dwForwardMetric5);
+ return BSTR (&out);
+}
+
+/*
+ * Show current routing table
+ */
+void
+show_routes (int msglev)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+
+ const MIB_IPFORWARDTABLE *rt = get_windows_routing_table (&gc);
+
+ msg (msglev, "SYSTEM ROUTING TABLE");
+ if (rt)
+ {
+ for (i = 0; i < rt->dwNumEntries; ++i)
+ {
+ msg (msglev, "%s", format_route_entry (&rt->table[i], &gc));
+ }
+ }
+ gc_free (&gc);
+}
+
+#elif defined(TARGET_LINUX) || defined(TARGET_ANDROID)
+
+void
+get_default_gateway (struct route_gateway_info *rgi)
+{
+ struct gc_arena gc = gc_new ();
+ int sd = -1;
+ char best_name[16];
+ best_name[0] = 0;
+
+ CLEAR(*rgi);
+
+ /* get default gateway IP addr */
+ {
+ FILE *fp = fopen ("/proc/net/route", "r");
+ if (fp)
+ {
+ char line[256];
+ int count = 0;
+ unsigned int lowest_metric = UINT_MAX;
+ in_addr_t best_gw = 0;
+ bool found = false;
+ while (fgets (line, sizeof (line), fp) != NULL)
+ {
+ if (count)
+ {
+ unsigned int net_x = 0;
+ unsigned int mask_x = 0;
+ unsigned int gw_x = 0;
+ unsigned int metric = 0;
+ unsigned int flags = 0;
+ char name[16];
+ name[0] = 0;
+ const int np = sscanf (line, "%15s\t%x\t%x\t%x\t%*s\t%*s\t%d\t%x",
+ name,
+ &net_x,
+ &gw_x,
+ &flags,
+ &metric,
+ &mask_x);
+ if (np == 6 && (flags & IFF_UP))
+ {
+ const in_addr_t net = ntohl (net_x);
+ const in_addr_t mask = ntohl (mask_x);
+ const in_addr_t gw = ntohl (gw_x);
+
+ if (!net && !mask && metric < lowest_metric)
+ {
+ found = true;
+ best_gw = gw;
+ strcpy (best_name, name);
+ lowest_metric = metric;
+ }
+ }
+ }
+ ++count;
+ }
+ fclose (fp);
+
+ if (found)
+ {
+ rgi->gateway.addr = best_gw;
+ rgi->flags |= RGI_ADDR_DEFINED;
+ if (!rgi->gateway.addr && best_name[0])
+ rgi->flags |= RGI_ON_LINK;
+ }
+ }
+ }
+
+ /* scan adapter list */
+ if (rgi->flags & RGI_ADDR_DEFINED)
+ {
+ struct ifreq *ifr, *ifend;
+ in_addr_t addr, netmask;
+ struct ifreq ifreq;
+ struct ifconf ifc;
+ struct ifreq ifs[20]; /* Maximum number of interfaces to scan */
+
+ if ((sd = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ msg (M_WARN, "GDG: socket() failed");
+ goto done;
+ }
+ ifc.ifc_len = sizeof (ifs);
+ ifc.ifc_req = ifs;
+ if (ioctl (sd, SIOCGIFCONF, &ifc) < 0)
+ {
+ msg (M_WARN, "GDG: ioctl(SIOCGIFCONF) failed");
+ goto done;
+ }
+
+ /* scan through interface list */
+ ifend = ifs + (ifc.ifc_len / sizeof (struct ifreq));
+ for (ifr = ifc.ifc_req; ifr < ifend; ifr++)
+ {
+ if (ifr->ifr_addr.sa_family == AF_INET)
+ {
+ /* get interface addr */
+ addr = ntohl(((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr);
+
+ /* get interface name */
+ strncpynt (ifreq.ifr_name, ifr->ifr_name, sizeof (ifreq.ifr_name));
+
+ /* check that the interface is up */
+ if (ioctl (sd, SIOCGIFFLAGS, &ifreq) < 0)
+ continue;
+ if (!(ifreq.ifr_flags & IFF_UP))
+ continue;
+
+ if (rgi->flags & RGI_ON_LINK)
+ {
+ /* check that interface name of current interface
+ matches interface name of best default route */
+ if (strcmp(ifreq.ifr_name, best_name))
+ continue;
+#if 0
+ /* if point-to-point link, use remote addr as route gateway */
+ if ((ifreq.ifr_flags & IFF_POINTOPOINT) && ioctl (sd, SIOCGIFDSTADDR, &ifreq) >= 0)
+ {
+ rgi->gateway.addr = ntohl(((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr.s_addr);
+ if (rgi->gateway.addr)
+ rgi->flags &= ~RGI_ON_LINK;
+ }
+#endif
+ }
+ else
+ {
+ /* get interface netmask */
+ if (ioctl (sd, SIOCGIFNETMASK, &ifreq) < 0)
+ continue;
+ netmask = ntohl(((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr.s_addr);
+
+ /* check that interface matches default route */
+ if (((rgi->gateway.addr ^ addr) & netmask) != 0)
+ continue;
+
+ /* save netmask */
+ rgi->gateway.netmask = netmask;
+ rgi->flags |= RGI_NETMASK_DEFINED;
+ }
+
+ /* save iface name */
+ strncpynt (rgi->iface, ifreq.ifr_name, sizeof(rgi->iface));
+ rgi->flags |= RGI_IFACE_DEFINED;
+
+ /* now get the hardware address. */
+ memset (&ifreq.ifr_hwaddr, 0, sizeof (struct sockaddr));
+ if (ioctl (sd, SIOCGIFHWADDR, &ifreq) < 0)
+ {
+ msg (M_WARN, "GDG: SIOCGIFHWADDR(%s) failed", ifreq.ifr_name);
+ goto done;
+ }
+ memcpy (rgi->hwaddr, &ifreq.ifr_hwaddr.sa_data, 6);
+ rgi->flags |= RGI_HWADDR_DEFINED;
+
+ break;
+ }
+ }
+ }
+
+ done:
+ if (sd >= 0)
+ close (sd);
+ gc_free (&gc);
+}
+
+#elif defined(TARGET_DARWIN) || \
+ defined(TARGET_FREEBSD) || defined(TARGET_DRAGONFLY) || \
+ defined(TARGET_OPENBSD) || defined(TARGET_NETBSD)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+
+struct rtmsg {
+ struct rt_msghdr m_rtm;
+ char m_space[512];
+};
+
+/* the route socket code is identical for all 4 supported BSDs and for
+ * MacOS X (Darwin), with one crucial difference: when going from
+ * 32 bit to 64 bit, the BSDs increased the structure size but kept
+ * source code compatibility by keeping the use of "long", while
+ * MacOS X decided to keep binary compatibility by *changing* the API
+ * to use "uint32_t", thus 32 bit on all OS X variants
+ *
+ * We used to have a large amount of duplicate code here which really
+ * differed only in this (long) vs. (uint32_t) - IMHO, worse than
+ * having a combined block for all BSDs with this single #ifdef inside
+ */
+
+#if defined(TARGET_DARWIN)
+# define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(uint32_t) - 1))) : sizeof(uint32_t))
+#else
+# define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+#endif
+
+#define NEXTADDR(w, u) \
+ if (rtm_addrs & (w)) {\
+ l = ROUNDUP(u.sa_len); memmove(cp, &(u), l); cp += l;\
+ }
+
+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
+
+#define max(a,b) ((a) > (b) ? (a) : (b))
+
+void
+get_default_gateway (struct route_gateway_info *rgi)
+{
+ struct gc_arena gc = gc_new ();
+ struct rtmsg m_rtmsg;
+ int sockfd = -1;
+ int seq, l, pid, rtm_addrs, i;
+ struct sockaddr so_dst, so_mask;
+ char *cp = m_rtmsg.m_space;
+ struct sockaddr *gate = NULL, *ifp = NULL, *sa;
+ struct rt_msghdr *rtm_aux;
+
+# define rtm m_rtmsg.m_rtm
+
+ CLEAR(*rgi);
+
+ /* setup data to send to routing socket */
+ pid = getpid();
+ seq = 0;
+ rtm_addrs = RTA_DST | RTA_NETMASK | RTA_IFP;
+
+ bzero(&m_rtmsg, sizeof(m_rtmsg));
+ bzero(&so_dst, sizeof(so_dst));
+ bzero(&so_mask, sizeof(so_mask));
+ bzero(&rtm, sizeof(struct rt_msghdr));
+
+ rtm.rtm_type = RTM_GET;
+ rtm.rtm_flags = RTF_UP | RTF_GATEWAY;
+ rtm.rtm_version = RTM_VERSION;
+ rtm.rtm_seq = ++seq;
+ rtm.rtm_addrs = rtm_addrs;
+
+ so_dst.sa_family = AF_INET;
+ so_dst.sa_len = sizeof(struct sockaddr_in);
+ so_mask.sa_family = AF_INET;
+ so_mask.sa_len = sizeof(struct sockaddr_in);
+
+ NEXTADDR(RTA_DST, so_dst);
+ NEXTADDR(RTA_NETMASK, so_mask);
+
+ rtm.rtm_msglen = l = cp - (char *)&m_rtmsg;
+
+ /* transact with routing socket */
+ sockfd = socket(PF_ROUTE, SOCK_RAW, 0);
+ if (sockfd < 0)
+ {
+ msg (M_WARN, "GDG: socket #1 failed");
+ goto done;
+ }
+ if (write(sockfd, (char *)&m_rtmsg, l) < 0)
+ {
+ msg (M_WARN, "GDG: problem writing to routing socket");
+ goto done;
+ }
+ do {
+ l = read(sockfd, (char *)&m_rtmsg, sizeof(m_rtmsg));
+ } while (l > 0 && (rtm.rtm_seq != seq || rtm.rtm_pid != pid));
+ close(sockfd);
+ sockfd = -1;
+
+ /* extract return data from routing socket */
+ rtm_aux = &rtm;
+ cp = ((char *)(rtm_aux + 1));
+ if (rtm_aux->rtm_addrs)
+ {
+ for (i = 1; i; i <<= 1)
+ {
+ if (i & rtm_aux->rtm_addrs)
+ {
+ sa = (struct sockaddr *)cp;
+ if (i == RTA_GATEWAY )
+ gate = sa;
+ else if (i == RTA_IFP)
+ ifp = sa;
+ ADVANCE(cp, sa);
+ }
+ }
+ }
+ else
+ goto done;
+
+ /* get gateway addr and interface name */
+ if (gate != NULL )
+ {
+ /* get default gateway addr */
+ rgi->gateway.addr = ntohl(((struct sockaddr_in *)gate)->sin_addr.s_addr);
+ if (rgi->gateway.addr)
+ rgi->flags |= RGI_ADDR_DEFINED;
+
+ if (ifp)
+ {
+ /* get interface name */
+ const struct sockaddr_dl *adl = (struct sockaddr_dl *) ifp;
+ if (adl->sdl_nlen && adl->sdl_nlen < sizeof(rgi->iface))
+ {
+ memcpy (rgi->iface, adl->sdl_data, adl->sdl_nlen);
+ rgi->iface[adl->sdl_nlen] = '\0';
+ rgi->flags |= RGI_IFACE_DEFINED;
+ }
+ }
+ }
+
+ /* get netmask of interface that owns default gateway */
+ if (rgi->flags & RGI_IFACE_DEFINED) {
+ struct ifreq ifr;
+
+ sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sockfd < 0)
+ {
+ msg (M_WARN, "GDG: socket #2 failed");
+ goto done;
+ }
+
+ CLEAR(ifr);
+ ifr.ifr_addr.sa_family = AF_INET;
+ strncpynt(ifr.ifr_name, rgi->iface, IFNAMSIZ);
+
+ if (ioctl(sockfd, SIOCGIFNETMASK, (char *)&ifr) < 0)
+ {
+ msg (M_WARN, "GDG: ioctl #1 failed");
+ goto done;
+ }
+ close(sockfd);
+ sockfd = -1;
+
+ rgi->gateway.netmask = ntohl(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr);
+ rgi->flags |= RGI_NETMASK_DEFINED;
+ }
+
+ /* try to read MAC addr associated with interface that owns default gateway */
+ if (rgi->flags & RGI_IFACE_DEFINED)
+ {
+ struct ifconf ifc;
+ struct ifreq *ifr;
+ const int bufsize = 4096;
+ char *buffer;
+
+ buffer = (char *) gc_malloc (bufsize, true, &gc);
+ sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sockfd < 0)
+ {
+ msg (M_WARN, "GDG: socket #3 failed");
+ goto done;
+ }
+
+ ifc.ifc_len = bufsize;
+ ifc.ifc_buf = buffer;
+
+ if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
+ {
+ msg (M_WARN, "GDG: ioctl #2 failed");
+ goto done;
+ }
+ close(sockfd);
+ sockfd = -1;
+
+ for (cp = buffer; cp <= buffer + ifc.ifc_len - sizeof(struct ifreq); )
+ {
+ ifr = (struct ifreq *)cp;
+ const size_t len = sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
+ if (!ifr->ifr_addr.sa_family)
+ break;
+ if (!strncmp(ifr->ifr_name, rgi->iface, IFNAMSIZ))
+ {
+ if (ifr->ifr_addr.sa_family == AF_LINK)
+ {
+ struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
+ memcpy(rgi->hwaddr, LLADDR(sdl), 6);
+ rgi->flags |= RGI_HWADDR_DEFINED;
+ }
+ }
+ cp += len;
+ }
+ }
+
+ done:
+ if (sockfd >= 0)
+ close(sockfd);
+ gc_free (&gc);
+}
+
+#undef max
+
+#else
+
+/*
+ * This is a platform-specific method that returns data about
+ * the current default gateway. Return data is placed into
+ * a struct route_gateway_info object provided by caller. The
+ * implementation should CLEAR the structure before adding
+ * data to it.
+ *
+ * Data returned includes:
+ * 1. default gateway address (rgi->gateway.addr)
+ * 2. netmask of interface that owns default gateway
+ * (rgi->gateway.netmask)
+ * 3. hardware address (i.e. MAC address) of interface that owns
+ * default gateway (rgi->hwaddr)
+ * 4. interface name (or adapter index on Windows) that owns default
+ * gateway (rgi->iface or rgi->adapter_index)
+ * 5. an array of additional address/netmask pairs defined by
+ * interface that owns default gateway (rgi->addrs with length
+ * given in rgi->n_addrs)
+ *
+ * The flags RGI_x_DEFINED may be used to indicate which of the data
+ * members were successfully returned (set in rgi->flags). All of
+ * the data members are optional, however certain OpenVPN functionality
+ * may be disabled by missing items.
+ */
+void
+get_default_gateway (struct route_gateway_info *rgi)
+{
+ CLEAR(*rgi);
+}
+
+#endif
+
+bool
+netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbits)
+{
+ int i;
+ const int addrlen = sizeof (in_addr_t) * 8;
+
+ if ((network & netmask) == network)
+ {
+ for (i = 0; i <= addrlen; ++i)
+ {
+ in_addr_t mask = netbits_to_netmask (i);
+ if (mask == netmask)
+ {
+ if (i == addrlen)
+ *netbits = -1;
+ else
+ *netbits = i;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+/* similar to netmask_to_netbits(), but don't mess with base address
+ * etc., just convert to netbits - non-mappable masks are returned as "-1"
+ */
+int netmask_to_netbits2 (in_addr_t netmask)
+{
+ int i;
+ const int addrlen = sizeof (in_addr_t) * 8;
+
+ for (i = 0; i <= addrlen; ++i)
+ {
+ in_addr_t mask = netbits_to_netmask (i);
+ if (mask == netmask)
+ {
+ return i;
+ }
+ }
+ return -1;
+}
+
+
+/*
+ * get_bypass_addresses() is used by the redirect-gateway bypass-x
+ * functions to build a route bypass to selected DHCP/DNS servers,
+ * so that outgoing packets to these servers don't end up in the tunnel.
+ */
+
+#if defined(WIN32)
+
+static void
+add_host_route_if_nonlocal (struct route_bypass *rb, const in_addr_t addr)
+{
+ if (test_local_addr(addr, NULL) == TLA_NONLOCAL && addr != 0 && addr != IPV4_NETMASK_HOST)
+ add_bypass_address (rb, addr);
+}
+
+static void
+add_host_route_array (struct route_bypass *rb, const IP_ADDR_STRING *iplist)
+{
+ while (iplist)
+ {
+ bool succeed = false;
+ const in_addr_t ip = getaddr (GETADDR_HOST_ORDER, iplist->IpAddress.String, 0, &succeed, NULL);
+ if (succeed)
+ {
+ add_host_route_if_nonlocal (rb, ip);
+ }
+ iplist = iplist->Next;
+ }
+}
+
+static void
+get_bypass_addresses (struct route_bypass *rb, const unsigned int flags)
+{
+ struct gc_arena gc = gc_new ();
+ /*bool ret_bool = false;*/
+
+ /* get full routing table */
+ const MIB_IPFORWARDTABLE *routes = get_windows_routing_table (&gc);
+
+ /* get the route which represents the default gateway */
+ const MIB_IPFORWARDROW *row = get_default_gateway_row (routes);
+
+ if (row)
+ {
+ /* get the adapter which the default gateway is associated with */
+ const IP_ADAPTER_INFO *dgi = get_adapter_info (row->dwForwardIfIndex, &gc);
+
+ /* get extra adapter info, such as DNS addresses */
+ const IP_PER_ADAPTER_INFO *pai = get_per_adapter_info (row->dwForwardIfIndex, &gc);
+
+ /* Bypass DHCP server address */
+ if ((flags & RG_BYPASS_DHCP) && dgi && dgi->DhcpEnabled)
+ add_host_route_array (rb, &dgi->DhcpServer);
+
+ /* Bypass DNS server addresses */
+ if ((flags & RG_BYPASS_DNS) && pai)
+ add_host_route_array (rb, &pai->DnsServerList);
+ }
+
+ gc_free (&gc);
+}
+
+#else
+
+static void
+get_bypass_addresses (struct route_bypass *rb, const unsigned int flags) /* PLATFORM-SPECIFIC */
+{
+}
+
+#endif
+
+/*
+ * Test if addr is reachable via a local interface (return ILA_LOCAL),
+ * or if it needs to be routed via the default gateway (return
+ * ILA_NONLOCAL). If the target platform doesn't implement this
+ * function, return ILA_NOT_IMPLEMENTED.
+ *
+ * Used by redirect-gateway autolocal feature
+ */
+
+#if defined(WIN32)
+
+int
+test_local_addr (const in_addr_t addr, const struct route_gateway_info *rgi)
+{
+ struct gc_arena gc = gc_new ();
+ const in_addr_t nonlocal_netmask = 0x80000000L; /* routes with netmask <= to this are considered non-local */
+ bool ret = TLA_NONLOCAL;
+
+ /* get full routing table */
+ const MIB_IPFORWARDTABLE *rt = get_windows_routing_table (&gc);
+ if (rt)
+ {
+ int i;
+ for (i = 0; i < rt->dwNumEntries; ++i)
+ {
+ const MIB_IPFORWARDROW *row = &rt->table[i];
+ const in_addr_t net = ntohl (row->dwForwardDest);
+ const in_addr_t mask = ntohl (row->dwForwardMask);
+ if (mask > nonlocal_netmask && (addr & mask) == net)
+ {
+ ret = TLA_LOCAL;
+ break;
+ }
+ }
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+#else
+
+int
+test_local_addr (const in_addr_t addr, const struct route_gateway_info *rgi) /* PLATFORM-SPECIFIC */
+{
+ if (rgi)
+ {
+ if (local_route (addr, 0xFFFFFFFF, rgi->gateway.addr, rgi))
+ return TLA_LOCAL;
+ else
+ return TLA_NONLOCAL;
+ }
+ return TLA_NOT_IMPLEMENTED;
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/route.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/route.h
new file mode 100644
index 00000000..2b1ae3e8
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/route.h
@@ -0,0 +1,335 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Support routines for adding/deleting network routes.
+ */
+
+#ifndef ROUTE_H
+#define ROUTE_H
+
+#include "basic.h"
+#include "tun.h"
+#include "misc.h"
+
+#ifdef WIN32
+/*
+ * Windows route methods
+ */
+#define ROUTE_METHOD_ADAPTIVE 0 /* try IP helper first then route.exe */
+#define ROUTE_METHOD_IPAPI 1 /* use IP helper API */
+#define ROUTE_METHOD_EXE 2 /* use route.exe */
+#define ROUTE_METHOD_MASK 3
+#endif
+
+/*
+ * Route add/delete flags (must stay clear of ROUTE_METHOD bits)
+ */
+#define ROUTE_DELETE_FIRST (1<<2)
+#define ROUTE_REF_GW (1<<3)
+
+struct route_bypass
+{
+# define N_ROUTE_BYPASS 8
+ int n_bypass;
+ in_addr_t bypass[N_ROUTE_BYPASS];
+};
+
+struct route_special_addr
+{
+ /* bits indicating which members below are defined */
+# define RTSA_REMOTE_ENDPOINT (1<<0)
+# define RTSA_REMOTE_HOST (1<<1)
+# define RTSA_DEFAULT_METRIC (1<<2)
+ unsigned int flags;
+
+ in_addr_t remote_endpoint;
+ in_addr_t remote_host;
+ int remote_host_local; /* TLA_x value */
+ struct route_bypass bypass;
+ int default_metric;
+};
+
+struct route_option {
+ struct route_option *next;
+ const char *network;
+ const char *netmask;
+ const char *gateway;
+ const char *metric;
+};
+
+/* redirect-gateway flags */
+#define RG_ENABLE (1<<0)
+#define RG_LOCAL (1<<1)
+#define RG_DEF1 (1<<2)
+#define RG_BYPASS_DHCP (1<<3)
+#define RG_BYPASS_DNS (1<<4)
+#define RG_REROUTE_GW (1<<5)
+#define RG_AUTO_LOCAL (1<<6)
+#define RG_BLOCK_LOCAL (1<<7)
+#define RG_UNBLOCK_LOCAL (1<<8)
+
+struct route_option_list {
+ unsigned int flags; /* RG_x flags */
+ struct route_option *routes;
+ struct gc_arena *gc;
+};
+
+struct route_ipv6_option {
+ struct route_ipv6_option *next;
+ const char *prefix; /* e.g. "2001:db8:1::/64" */
+ const char *gateway; /* e.g. "2001:db8:0::2" */
+ const char *metric; /* e.g. "5" */
+};
+
+struct route_ipv6_option_list {
+ unsigned int flags;
+ struct route_ipv6_option *routes_ipv6;
+ struct gc_arena *gc;
+};
+
+struct route_ipv4 {
+# define RT_DEFINED (1<<0)
+# define RT_ADDED (1<<1)
+# define RT_METRIC_DEFINED (1<<2)
+ struct route_ipv4 *next;
+ unsigned int flags;
+ const struct route_option *option;
+ in_addr_t network;
+ in_addr_t netmask;
+ in_addr_t gateway;
+ int metric;
+};
+
+struct route_ipv6 {
+ struct route_ipv6 *next;
+ bool defined;
+ struct in6_addr network;
+ unsigned int netbits;
+ struct in6_addr gateway;
+ bool metric_defined;
+ int metric;
+};
+
+struct route_ipv6_list {
+ bool routes_added;
+ unsigned int flags;
+ int default_metric;
+ bool default_metric_defined;
+ struct in6_addr remote_endpoint_ipv6;
+ bool remote_endpoint_defined;
+ bool did_redirect_default_gateway; /* TODO (?) */
+ bool did_local; /* TODO (?) */
+ struct route_ipv6 *routes_ipv6;
+ struct gc_arena gc;
+};
+
+
+struct route_gateway_address {
+ in_addr_t addr;
+ in_addr_t netmask;
+};
+
+struct route_gateway_info {
+# define RGI_ADDR_DEFINED (1<<0) /* set if gateway.addr defined */
+# define RGI_NETMASK_DEFINED (1<<1) /* set if gateway.netmask defined */
+# define RGI_HWADDR_DEFINED (1<<2) /* set if hwaddr is defined */
+# define RGI_IFACE_DEFINED (1<<3) /* set if iface is defined */
+# define RGI_OVERFLOW (1<<4) /* set if more interface addresses than will fit in addrs */
+# define RGI_ON_LINK (1<<5)
+ unsigned int flags;
+
+ /* gateway interface */
+# ifdef WIN32
+ DWORD adapter_index; /* interface or ~0 if undefined */
+#else
+ char iface[16]; /* interface name (null terminated), may be empty */
+#endif
+
+ /* gateway interface hardware address */
+ uint8_t hwaddr[6];
+
+ /* gateway/router address */
+ struct route_gateway_address gateway;
+
+ /* address/netmask pairs bound to interface */
+# define RGI_N_ADDRESSES 8
+ int n_addrs; /* len of addrs, may be 0 */
+ struct route_gateway_address addrs[RGI_N_ADDRESSES]; /* local addresses attached to iface */
+};
+
+struct route_list {
+# define RL_DID_REDIRECT_DEFAULT_GATEWAY (1<<0)
+# define RL_DID_LOCAL (1<<1)
+# define RL_ROUTES_ADDED (1<<2)
+ unsigned int iflags;
+
+ struct route_special_addr spec;
+ struct route_gateway_info rgi;
+ unsigned int flags; /* RG_x flags */
+ struct route_ipv4 *routes;
+ struct gc_arena gc;
+};
+
+#if P2MP
+/* internal OpenVPN route */
+struct iroute {
+ in_addr_t network;
+ int netbits;
+ struct iroute *next;
+};
+
+struct iroute_ipv6 {
+ struct in6_addr network;
+ unsigned int netbits;
+ struct iroute_ipv6 *next;
+};
+#endif
+
+struct route_option_list *new_route_option_list (struct gc_arena *a);
+struct route_ipv6_option_list *new_route_ipv6_option_list (struct gc_arena *a);
+
+struct route_option_list *clone_route_option_list (const struct route_option_list *src, struct gc_arena *a);
+struct route_ipv6_option_list *clone_route_ipv6_option_list (const struct route_ipv6_option_list *src, struct gc_arena *a);
+void copy_route_option_list (struct route_option_list *dest, const struct route_option_list *src, struct gc_arena *a);
+void copy_route_ipv6_option_list (struct route_ipv6_option_list *dest,
+ const struct route_ipv6_option_list *src,
+ struct gc_arena *a);
+
+void add_route_ipv6 (struct route_ipv6 *r, const struct tuntap *tt, unsigned int flags, const struct env_set *es);
+void delete_route_ipv6 (const struct route_ipv6 *r, const struct tuntap *tt, unsigned int flags, const struct env_set *es);
+
+void add_route (struct route_ipv4 *r,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct route_gateway_info *rgi,
+ const struct env_set *es);
+
+void add_route_to_option_list (struct route_option_list *l,
+ const char *network,
+ const char *netmask,
+ const char *gateway,
+ const char *metric);
+
+void add_route_ipv6_to_option_list (struct route_ipv6_option_list *l,
+ const char *prefix,
+ const char *gateway,
+ const char *metric);
+
+bool init_route_list (struct route_list *rl,
+ const struct route_option_list *opt,
+ const char *remote_endpoint,
+ int default_metric,
+ in_addr_t remote_host,
+ struct env_set *es);
+
+bool init_route_ipv6_list (struct route_ipv6_list *rl6,
+ const struct route_ipv6_option_list *opt6,
+ const char *remote_endpoint,
+ int default_metric,
+ struct env_set *es);
+
+void route_list_add_vpn_gateway (struct route_list *rl,
+ struct env_set *es,
+ const in_addr_t addr);
+
+void add_routes (struct route_list *rl,
+ struct route_ipv6_list *rl6,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct env_set *es);
+
+void delete_routes (struct route_list *rl,
+ struct route_ipv6_list *rl6,
+ const struct tuntap *tt,
+ unsigned int flags,
+ const struct env_set *es);
+
+void setenv_routes (struct env_set *es, const struct route_list *rl);
+void setenv_routes_ipv6 (struct env_set *es, const struct route_ipv6_list *rl6);
+
+
+
+bool is_special_addr (const char *addr_str);
+
+void get_default_gateway (struct route_gateway_info *rgi);
+void print_default_gateway(const int msglevel, const struct route_gateway_info *rgi);
+
+/*
+ * Test if addr is reachable via a local interface (return ILA_LOCAL),
+ * or if it needs to be routed via the default gateway (return
+ * ILA_NONLOCAL). If the current platform doesn't implement this
+ * function, return ILA_NOT_IMPLEMENTED.
+ */
+#define TLA_NOT_IMPLEMENTED 0
+#define TLA_NONLOCAL 1
+#define TLA_LOCAL 2
+int test_local_addr (const in_addr_t addr, const struct route_gateway_info *rgi);
+
+#ifndef ENABLE_SMALL
+void print_route_options (const struct route_option_list *rol,
+ int level);
+#endif
+
+void print_routes (const struct route_list *rl, int level);
+
+#ifdef WIN32
+
+void show_routes (int msglev);
+bool test_routes (const struct route_list *rl, const struct tuntap *tt);
+bool add_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt, DWORD adapter_index);
+bool del_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt);
+
+#else
+static inline bool test_routes (const struct route_list *rl, const struct tuntap *tt) { return true; }
+#endif
+
+bool netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbits);
+
+static inline in_addr_t
+netbits_to_netmask (const int netbits)
+{
+ const int addrlen = sizeof (in_addr_t) * 8;
+ in_addr_t mask = 0;
+ if (netbits > 0 && netbits <= addrlen)
+ mask = IPV4_NETMASK_HOST << (addrlen-netbits);
+ return mask;
+}
+
+static inline bool
+route_list_vpn_gateway_needed (const struct route_list *rl)
+{
+ if (!rl)
+ return false;
+ else
+ return !(rl->spec.flags & RTSA_REMOTE_ENDPOINT);
+}
+
+static inline int
+route_did_redirect_default_gateway(const struct route_list *rl)
+{
+ return rl && BOOL_CAST(rl->iflags & RL_DID_REDIRECT_DEFAULT_GATEWAY);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.c
new file mode 100644
index 00000000..471330f0
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.c
@@ -0,0 +1,659 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if P2MP_SERVER
+
+#include "buffer.h"
+#include "misc.h"
+#include "crypto.h"
+#include "schedule.h"
+
+#include "memdbg.h"
+
+#ifdef SCHEDULE_TEST
+
+struct status
+{
+ int sru;
+ int ins;
+ int coll;
+ int lsteps;
+};
+
+static struct status z;
+
+#endif
+
+#ifdef ENABLE_DEBUG
+static void
+schedule_entry_debug_info (const char *caller, const struct schedule_entry *e)
+{
+ struct gc_arena gc = gc_new ();
+ if (e)
+ {
+ dmsg (D_SCHEDULER, "SCHEDULE: %s wakeup=[%s] pri=%u",
+ caller,
+ tv_string_abs (&e->tv, &gc),
+ e->pri);
+ }
+ else
+ {
+ dmsg (D_SCHEDULER, "SCHEDULE: %s NULL",
+ caller);
+ }
+ gc_free (&gc);
+}
+#endif
+
+static inline void
+schedule_set_pri (struct schedule_entry *e)
+{
+ e->pri = random ();
+ if (e->pri < 1)
+ e->pri = 1;
+}
+
+/* This is the master key comparison routine. A key is
+ * simply a struct timeval containing the absolute time for
+ * an event. The unique treap priority (pri) is used to ensure
+ * that keys do not collide.
+ */
+static inline int
+schedule_entry_compare (const struct schedule_entry *e1,
+ const struct schedule_entry *e2)
+{
+ if (e1->tv.tv_sec < e2->tv.tv_sec)
+ return -1;
+ else if (e1->tv.tv_sec > e2->tv.tv_sec)
+ return 1;
+ else
+ {
+ if (e1->tv.tv_usec < e2->tv.tv_usec)
+ return -1;
+ else if (e1->tv.tv_usec > e2->tv.tv_usec)
+ return 1;
+ else
+ {
+ if (e1->pri < e2->pri)
+ return -1;
+ else if (e1->pri > e2->pri)
+ return 1;
+ else
+ return 0;
+ }
+ }
+}
+
+/*
+ * Detach a btree node from its parent
+ */
+static inline void
+schedule_detach_parent (struct schedule *s, struct schedule_entry *e)
+{
+ if (e)
+ {
+ if (e->parent)
+ {
+ if (e->parent->lt == e)
+ e->parent->lt = NULL;
+ else if (e->parent->gt == e)
+ e->parent->gt = NULL;
+ else
+ {
+ /* parent <-> child linkage is corrupted */
+ ASSERT (0);
+ }
+ e->parent = NULL;
+ }
+ else
+ {
+ if (s->root == e) /* last element deleted, tree is empty */
+ s->root = NULL;
+ }
+ }
+}
+
+/*
+ *
+ * Given a binary search tree, move a node toward the root
+ * while still maintaining the correct ordering relationships
+ * within the tree. This function is the workhorse
+ * of the tree balancer.
+ *
+ * This code will break on key collisions, which shouldn't
+ * happen because the treap priority is considered part of the key
+ * and is guaranteed to be unique.
+ */
+static void
+schedule_rotate_up (struct schedule *s, struct schedule_entry *e)
+{
+ if (e && e->parent)
+ {
+ struct schedule_entry *lt = e->lt;
+ struct schedule_entry *gt = e->gt;
+ struct schedule_entry *p = e->parent;
+ struct schedule_entry *gp = p->parent;
+
+ if (gp) /* if grandparent exists, modify its child link */
+ {
+ if (gp->gt == p)
+ gp->gt = e;
+ else if (gp->lt == p)
+ gp->lt = e;
+ else
+ {
+ ASSERT (0);
+ }
+ }
+ else /* no grandparent, now we are the root */
+ {
+ s->root = e;
+ }
+
+ /* grandparent is now our parent */
+ e->parent = gp;
+
+ /* parent is now our child */
+ p->parent = e;
+
+ /* reorient former parent's links
+ to reflect new position in the tree */
+ if (p->gt == e)
+ {
+ e->lt = p;
+ p->gt = lt;
+ if (lt)
+ lt->parent = p;
+ }
+ else if (p->lt == e)
+ {
+ e->gt = p;
+ p->lt = gt;
+ if (gt)
+ gt->parent = p;
+ }
+ else
+ {
+ /* parent <-> child linkage is corrupted */
+ ASSERT (0);
+ }
+
+#ifdef SCHEDULE_TEST
+ ++z.sru;
+#endif
+ }
+}
+
+/*
+ * This is the treap deletion algorithm:
+ *
+ * Rotate lesser-priority children up in the tree
+ * until we are childless. Then delete.
+ */
+void
+schedule_remove_node (struct schedule *s, struct schedule_entry *e)
+{
+ while (e->lt || e->gt)
+ {
+ if (e->lt)
+ {
+ if (e->gt)
+ {
+ if (e->lt->pri < e->gt->pri)
+ schedule_rotate_up (s, e->lt);
+ else
+ schedule_rotate_up (s, e->gt);
+ }
+ else
+ schedule_rotate_up (s, e->lt);
+ }
+ else if (e->gt)
+ schedule_rotate_up (s, e->gt);
+ }
+
+ schedule_detach_parent (s, e);
+ e->pri = 0;
+}
+
+/*
+ * Trivially add a node to a binary search tree without
+ * regard for balance.
+ */
+static void
+schedule_insert (struct schedule *s, struct schedule_entry *e)
+{
+ struct schedule_entry *c = s->root;
+ while (true)
+ {
+ const int comp = schedule_entry_compare (e, c);
+
+#ifdef SCHEDULE_TEST
+ ++z.ins;
+#endif
+
+ if (comp == -1)
+ {
+ if (c->lt)
+ {
+ c = c->lt;
+ continue;
+ }
+ else
+ {
+ c->lt = e;
+ e->parent = c;
+ break;
+ }
+ }
+ else if (comp == 1)
+ {
+ if (c->gt)
+ {
+ c = c->gt;
+ continue;
+ }
+ else
+ {
+ c->gt = e;
+ e->parent = c;
+ break;
+ }
+ }
+ else
+ {
+ /* rare key/priority collision -- no big deal,
+ just choose another priority and retry */
+#ifdef SCHEDULE_TEST
+ ++z.coll;
+#endif
+ schedule_set_pri (e);
+ /* msg (M_INFO, "PRI COLLISION pri=%u", e->pri); */
+ c = s->root;
+ continue;
+ }
+ }
+}
+
+/*
+ * Given an element, remove it from the btree if it's already
+ * there and re-insert it based on its current key.
+ */
+void
+schedule_add_modify (struct schedule *s, struct schedule_entry *e)
+{
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_SCHEDULER))
+ schedule_entry_debug_info ("schedule_add_modify", e);
+#endif
+
+ /* already in tree, remove */
+ if (IN_TREE (e))
+ schedule_remove_node (s, e);
+
+ /* set random priority */
+ schedule_set_pri (e);
+
+ if (s->root)
+ schedule_insert (s, e); /* trivial insert into tree */
+ else
+ s->root = e; /* tree was empty, we are the first element */
+
+ /* This is the magic of the randomized treap algorithm which
+ keeps the tree balanced. Move the node up the tree until
+ its own priority is greater than that of its parent */
+ while (e->parent && e->parent->pri > e->pri)
+ schedule_rotate_up (s, e);
+}
+
+/*
+ * Find the earliest event to be scheduled
+ */
+struct schedule_entry *
+schedule_find_least (struct schedule_entry *e)
+{
+ if (e)
+ {
+ while (e->lt)
+ {
+#ifdef SCHEDULE_TEST
+ ++z.lsteps;
+#endif
+ e = e->lt;
+ }
+ }
+
+#ifdef ENABLE_DEBUG
+ if (check_debug_level (D_SCHEDULER))
+ schedule_entry_debug_info ("schedule_find_least", e);
+#endif
+
+ return e;
+}
+
+/*
+ * Public functions below this point
+ */
+
+struct schedule *
+schedule_init (void)
+{
+ struct schedule *s;
+
+ ALLOC_OBJ_CLEAR (s, struct schedule);
+ return s;
+}
+
+void
+schedule_free (struct schedule *s)
+{
+ free (s);
+}
+
+void
+schedule_remove_entry (struct schedule *s, struct schedule_entry *e)
+{
+ s->earliest_wakeup = NULL; /* invalidate cache */
+ schedule_remove_node (s, e);
+}
+
+/*
+ * Debug functions below this point
+ */
+
+#ifdef SCHEDULE_TEST
+
+static inline struct schedule_entry *
+schedule_find_earliest_wakeup (struct schedule *s)
+{
+ return schedule_find_least (s->root);
+}
+
+/*
+ * Recursively check that the treap (btree) is
+ * internally consistent.
+ */
+int
+schedule_debug_entry (const struct schedule_entry* e,
+ int depth,
+ int *count,
+ struct timeval *least,
+ const struct timeval *min,
+ const struct timeval *max)
+{
+ struct gc_arena gc = gc_new ();
+ int maxdepth = depth;
+ if (e)
+ {
+ int d;
+
+ ASSERT (e != e->lt);
+ ASSERT (e != e->gt);
+ ASSERT (e != e->parent);
+ ASSERT (!e->parent || e->parent != e->lt);
+ ASSERT (!e->parent || e->parent != e->gt);
+ ASSERT (!e->lt || e->lt != e->gt);
+
+ if (e->lt)
+ {
+ ASSERT (e->lt->parent == e);
+ ASSERT (schedule_entry_compare (e->lt, e) == -1);
+ ASSERT (e->lt->pri >= e->pri);
+ }
+
+ if (e->gt)
+ {
+ ASSERT (e->gt->parent == e);
+ ASSERT (schedule_entry_compare (e->gt, e));
+ ASSERT (e->gt->pri >= e->pri);
+ }
+
+ ASSERT (tv_le (min, &e->tv));
+ ASSERT (tv_le (&e->tv, max));
+
+ if (count)
+ ++(*count);
+
+ if (least && tv_lt (&e->tv, least))
+ *least = e->tv;
+
+ d = schedule_debug_entry (e->lt, depth+1, count, least, min, &e->tv);
+ if (d > maxdepth)
+ maxdepth = d;
+
+ d = schedule_debug_entry (e->gt, depth+1, count, least, &e->tv, max);
+ if (d > maxdepth)
+ maxdepth = d;
+ }
+ gc_free (&gc);
+ return maxdepth;
+}
+
+int
+schedule_debug (struct schedule *s, int *count, struct timeval *least)
+{
+ struct timeval min;
+ struct timeval max;
+
+ min.tv_sec = 0;
+ min.tv_usec = 0;
+ max.tv_sec = 0x7FFFFFFF;
+ max.tv_usec = 0x7FFFFFFF;
+
+ if (s->root)
+ {
+ ASSERT (s->root->parent == NULL);
+ }
+ return schedule_debug_entry (s->root, 0, count, least, &min, &max);
+}
+
+#if 1
+
+void
+tv_randomize (struct timeval *tv)
+{
+ tv->tv_sec += random() % 100;
+ tv->tv_usec = random () % 100;
+}
+
+#else
+
+void
+tv_randomize (struct timeval *tv)
+{
+ struct gc_arena gc = gc_new ();
+ long int choice = get_random ();
+ if ((choice & 0xFF) == 0)
+ tv->tv_usec += ((choice >> 8) & 0xFF);
+ else
+ prng_bytes ((uint8_t *)tv, sizeof (struct timeval));
+ gc_free (&gc);
+}
+
+#endif
+
+void
+schedule_verify (struct schedule *s)
+{
+ struct gc_arena gc = gc_new ();
+ struct timeval least;
+ int count;
+ int maxlev;
+ struct schedule_entry* e;
+ const struct status zz = z;
+
+ least.tv_sec = least.tv_usec = 0x7FFFFFFF;
+
+ count = 0;
+
+ maxlev = schedule_debug (s, &count, &least);
+
+ e = schedule_find_earliest_wakeup (s);
+
+ if (e)
+ {
+ printf ("Verification Phase count=%d maxlev=%d sru=%d ins=%d coll=%d ls=%d l=%s",
+ count,
+ maxlev,
+ zz.sru,
+ zz.ins,
+ zz.coll,
+ zz.lsteps,
+ tv_string (&e->tv, &gc));
+
+ if (!tv_eq (&least, &e->tv))
+ printf (" [COMPUTED DIFFERENT MIN VALUES!]");
+
+ printf ("\n");
+ }
+
+ CLEAR (z);
+ gc_free (&gc);
+}
+
+void
+schedule_randomize_array (struct schedule_entry **array, int size)
+{
+ int i;
+ for (i = 0; i < size; ++i)
+ {
+ const int src = get_random () % size;
+ struct schedule_entry *tmp = array [i];
+ if (i != src)
+ {
+ array [i] = array [src];
+ array [src] = tmp;
+ }
+ }
+}
+
+void
+schedule_print_work (struct schedule_entry *e, int indent)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ for (i = 0; i < indent; ++i)
+ printf (" ");
+ if (e)
+ {
+ printf ("%s [%u] e=" ptr_format ", p=" ptr_format " lt=" ptr_format " gt=" ptr_format "\n",
+ tv_string (&e->tv, &gc),
+ e->pri,
+ (ptr_type)e,
+ (ptr_type)e->parent,
+ (ptr_type)e->lt,
+ (ptr_type)e->gt);
+ schedule_print_work (e->lt, indent+1);
+ schedule_print_work (e->gt, indent+1);
+ }
+ else
+ printf ("NULL\n");
+ gc_free (&gc);
+}
+
+void
+schedule_print (struct schedule *s)
+{
+ printf ("*************************\n");
+ schedule_print_work (s->root, 0);
+}
+
+void
+schedule_test (void)
+{
+ struct gc_arena gc = gc_new ();
+ int n = 1000;
+ int n_mod = 25;
+
+ int i, j;
+ struct schedule_entry **array;
+ struct schedule *s = schedule_init ();
+ struct schedule_entry* e;
+
+ CLEAR (z);
+ ALLOC_ARRAY (array, struct schedule_entry *, n);
+
+ printf ("Creation/Insertion Phase\n");
+
+ for (i = 0; i < n; ++i)
+ {
+ ALLOC_OBJ_CLEAR (array[i], struct schedule_entry);
+ tv_randomize (&array[i]->tv);
+ /*schedule_print (s);*/
+ /*schedule_verify (s);*/
+ schedule_add_modify (s, array[i]);
+ }
+
+ schedule_randomize_array (array, n);
+
+ /*schedule_print (s);*/
+ schedule_verify (s);
+
+ for (j = 1; j <= n_mod; ++j)
+ {
+ printf ("Modification Phase Pass %d\n", j);
+
+ for (i = 0; i < n; ++i)
+ {
+ e = schedule_find_earliest_wakeup (s);
+ /*printf ("BEFORE %s\n", tv_string (&e->tv, &gc));*/
+ tv_randomize (&e->tv);
+ /*printf ("AFTER %s\n", tv_string (&e->tv, &gc));*/
+ schedule_add_modify (s, e);
+ /*schedule_verify (s);*/
+ /*schedule_print (s);*/
+ }
+ schedule_verify (s);
+ /*schedule_print (s);*/
+ }
+
+ /*printf ("INS=%d\n", z.ins);*/
+
+ while ((e = schedule_find_earliest_wakeup (s)))
+ {
+ schedule_remove_node (s, e);
+ /*schedule_verify (s);*/
+ }
+ schedule_verify (s);
+
+ printf ("S->ROOT is %s\n", s->root ? "NOT NULL" : "NULL");
+
+ for (i = 0; i < n; ++i)
+ {
+ free (array[i]);
+ }
+ free (array);
+ free (s);
+ gc_free (&gc);
+}
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.h
new file mode 100644
index 00000000..71c6d8ca
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/schedule.h
@@ -0,0 +1,132 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SCHEDULE_H
+#define SCHEDULE_H
+
+/*
+ * This code implements an efficient scheduler using
+ * a random treap binary tree.
+ *
+ * The scheduler is used by the server executive to
+ * keep track of which instances need service at a
+ * known time in the future. Instances need to
+ * schedule events for things such as sending
+ * a ping or scheduling a TLS renegotiation.
+ */
+
+#if P2MP_SERVER
+
+/* define to enable a special test mode */
+/*#define SCHEDULE_TEST*/
+
+#include "otime.h"
+#include "error.h"
+
+struct schedule_entry
+{
+ struct timeval tv; /* wakeup time */
+ unsigned int pri; /* random treap priority */
+ struct schedule_entry *parent; /* treap (btree) links */
+ struct schedule_entry *lt;
+ struct schedule_entry *gt;
+};
+
+struct schedule
+{
+ struct schedule_entry *earliest_wakeup; /* cached earliest wakeup */
+ struct schedule_entry *root; /* the root of the treap (btree) */
+};
+
+/* Public functions */
+
+struct schedule *schedule_init (void);
+void schedule_free (struct schedule *s);
+void schedule_remove_entry (struct schedule *s, struct schedule_entry *e);
+
+#ifdef SCHEDULE_TEST
+void schedule_test (void);
+#endif
+
+/* Private Functions */
+
+/* is node already in tree? */
+#define IN_TREE(e) ((e)->pri)
+
+struct schedule_entry *schedule_find_least (struct schedule_entry *e);
+void schedule_add_modify (struct schedule *s, struct schedule_entry *e);
+void schedule_remove_node (struct schedule *s, struct schedule_entry *e);
+
+/* Public inline functions */
+
+/*
+ * Add a struct schedule_entry (whose storage is managed by
+ * caller) to the btree. tv signifies the wakeup time for
+ * a future event. sigma is a time interval measured
+ * in microseconds -- the event window being represented
+ * starts at (tv - sigma) and ends at (tv + sigma).
+ * Event signaling can occur anywere within this interval.
+ * Making the interval larger makes the scheduler more efficient,
+ * while making it smaller results in more precise scheduling.
+ * The caller should treat the passed struct schedule_entry as
+ * an opaque object.
+ */
+static inline void
+schedule_add_entry (struct schedule *s,
+ struct schedule_entry *e,
+ const struct timeval *tv,
+ unsigned int sigma)
+{
+ if (!IN_TREE (e) || !sigma || !tv_within_sigma (tv, &e->tv, sigma))
+ {
+ e->tv = *tv;
+ schedule_add_modify (s, e);
+ s->earliest_wakeup = NULL; /* invalidate cache */
+ }
+}
+
+/*
+ * Return the node with the earliest wakeup time. If two
+ * nodes have the exact same wakeup time, select based on
+ * the random priority assigned to each node (the priority
+ * is randomized every time an entry is re-added).
+ */
+static inline struct schedule_entry *
+schedule_get_earliest_wakeup (struct schedule *s,
+ struct timeval *wakeup)
+{
+ struct schedule_entry *ret;
+
+ /* cache result */
+ if (!s->earliest_wakeup)
+ s->earliest_wakeup = schedule_find_least (s->root);
+ ret = s->earliest_wakeup;
+ if (ret)
+ *wakeup = ret->tv;
+
+ return ret;
+}
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.c
new file mode 100644
index 00000000..2e07b547
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.c
@@ -0,0 +1,67 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Each session is identified by a random 8-byte session identifier.
+ *
+ * For efficiency, the session id is only transmitted over the control
+ * channel (which only sees traffic occasionally when keys are being
+ * negotiated). The data channel sees a smaller version of the session-id --
+ * it is called the key_id and is currently 2 bits long.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "error.h"
+#include "common.h"
+#include "crypto.h"
+#include "session_id.h"
+
+#include "memdbg.h"
+
+const struct session_id x_session_id_zero;
+
+void
+session_id_random (struct session_id *sid)
+{
+ prng_bytes (sid->id, SID_SIZE);
+}
+
+const char *
+session_id_print (const struct session_id *sid, struct gc_arena *gc)
+{
+ return format_hex (sid->id, SID_SIZE, 0, gc);
+}
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_CRYPTO && ENABLE_SSL*/
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.h
new file mode 100644
index 00000000..33909dd4
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/session_id.h
@@ -0,0 +1,86 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Each session is identified by a random 8-byte session identifier.
+ *
+ * For efficiency, the session id is only transmitted over the control
+ * channel (which only sees traffic occasionally when keys are being
+ * negotiated).
+ */
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#ifndef SESSION_ID_H
+#define SESSION_ID_H
+
+#include "basic.h"
+#include "buffer.h"
+
+struct session_id
+{
+ uint8_t id[8];
+};
+
+extern const struct session_id x_session_id_zero;
+
+#define SID_SIZE (sizeof (x_session_id_zero.id))
+
+static inline bool
+session_id_equal (const struct session_id *sid1,
+ const struct session_id *sid2)
+{
+ return !memcmp (sid1->id, sid2->id, SID_SIZE);
+}
+
+static inline bool
+session_id_defined (const struct session_id *sid1)
+{
+ return memcmp (sid1->id, &x_session_id_zero.id, SID_SIZE) != 0;
+}
+
+static inline bool
+session_id_read (struct session_id *sid, struct buffer *buf)
+{
+ return buf_read (buf, sid->id, SID_SIZE);
+}
+
+static inline bool
+session_id_write_prepend (const struct session_id *sid, struct buffer *buf)
+{
+ return buf_write_prepend (buf, sid->id, SID_SIZE);
+}
+
+static inline bool
+session_id_write (const struct session_id *sid, struct buffer *buf)
+{
+ return buf_write (buf, sid->id, SID_SIZE);
+}
+
+void session_id_random (struct session_id *sid);
+
+const char *session_id_print (const struct session_id *sid, struct gc_arena *gc);
+
+#endif /* SESSION_ID_H */
+#endif /* ENABLE_CRYPTO && ENABLE_SSL */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.c
new file mode 100644
index 00000000..c8a7d38b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.c
@@ -0,0 +1,101 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+#include "shaper.h"
+#include "memdbg.h"
+
+#ifdef ENABLE_FEATURE_SHAPER
+
+/*
+ * We want to wake up in delay microseconds. If timeval is larger
+ * than delay, set timeval to delay.
+ */
+bool
+shaper_soonest_event (struct timeval *tv, int delay)
+{
+ bool ret = false;
+ if (delay < 1000000)
+ {
+ if (tv->tv_sec)
+ {
+ tv->tv_sec = 0;
+ tv->tv_usec = delay;
+ ret = true;
+ }
+ else if (delay < tv->tv_usec)
+ {
+ tv->tv_usec = delay;
+ ret = true;
+ }
+ }
+ else
+ {
+ const int sec = delay / 1000000;
+ const int usec = delay % 1000000;
+
+ if (sec < tv->tv_sec)
+ {
+ tv->tv_sec = sec;
+ tv->tv_usec = usec;
+ ret = true;
+ }
+ else if (sec == tv->tv_sec)
+ {
+ if (usec < tv->tv_usec)
+ {
+ tv->tv_usec = usec;
+ ret = true;
+ }
+ }
+ }
+#ifdef SHAPER_DEBUG
+ dmsg (D_SHAPER_DEBUG, "SHAPER shaper_soonest_event sec=%d usec=%d ret=%d",
+ (int)tv->tv_sec, (int)tv->tv_usec, (int)ret);
+#endif
+ return ret;
+}
+
+void
+shaper_reset_wakeup (struct shaper *s)
+{
+ CLEAR (s->wakeup);
+}
+
+void
+shaper_msg (struct shaper *s)
+{
+ msg (M_INFO, "Output Traffic Shaping initialized at %d bytes per second",
+ s->bytes_per_second);
+}
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_FEATURE_SHAPER */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.h
new file mode 100644
index 00000000..afeb9c3c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/shaper.h
@@ -0,0 +1,178 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SHAPER_H
+#define SHAPER_H
+
+/*#define SHAPER_DEBUG*/
+
+#ifdef ENABLE_FEATURE_SHAPER
+
+#include "basic.h"
+#include "integer.h"
+#include "misc.h"
+#include "error.h"
+#include "interval.h"
+
+/*
+ * A simple traffic shaper for
+ * the output direction.
+ */
+
+#define SHAPER_MIN 100 /* bytes per second */
+#define SHAPER_MAX 100000000
+
+#define SHAPER_MAX_TIMEOUT 10 /* seconds */
+
+#define SHAPER_USE_FP
+
+struct shaper
+{
+ int bytes_per_second;
+ struct timeval wakeup;
+
+#ifdef SHAPER_USE_FP
+ double factor;
+#else
+ int factor;
+#endif
+};
+
+void shaper_msg (struct shaper *s);
+void shaper_reset_wakeup (struct shaper *s);
+
+/*
+ * We want to wake up in delay microseconds. If timeval is larger
+ * than delay, set timeval to delay.
+ */
+bool shaper_soonest_event (struct timeval *tv, int delay);
+
+/*
+ * inline functions
+ */
+
+static inline void
+shaper_reset (struct shaper *s, int bytes_per_second)
+{
+ s->bytes_per_second = bytes_per_second ? constrain_int (bytes_per_second, SHAPER_MIN, SHAPER_MAX) : 0;
+
+#ifdef SHAPER_USE_FP
+ s->factor = 1000000.0 / (double)s->bytes_per_second;
+#else
+ s->factor = 1000000 / s->bytes_per_second;
+#endif
+}
+
+static inline void
+shaper_init (struct shaper *s, int bytes_per_second)
+{
+ shaper_reset (s, bytes_per_second);
+ shaper_reset_wakeup (s);
+}
+
+static inline int
+shaper_current_bandwidth (struct shaper *s)
+{
+ return s->bytes_per_second;
+}
+
+/*
+ * Returns traffic shaping delay in microseconds relative to current
+ * time, or 0 if no delay.
+ */
+static inline int
+shaper_delay (struct shaper* s)
+{
+ struct timeval tv;
+ int delay = 0;
+
+ if (tv_defined (&s->wakeup))
+ {
+ ASSERT (!openvpn_gettimeofday (&tv, NULL));
+ delay = tv_subtract (&s->wakeup, &tv, SHAPER_MAX_TIMEOUT);
+#ifdef SHAPER_DEBUG
+ dmsg (D_SHAPER_DEBUG, "SHAPER shaper_delay delay=%d", delay);
+#endif
+ }
+
+ return delay > 0 ? delay : 0;
+}
+
+
+/*
+ * We are about to send a datagram of nbytes bytes.
+ *
+ * Compute when we can send another datagram,
+ * based on target throughput (s->bytes_per_second).
+ */
+static inline void
+shaper_wrote_bytes (struct shaper* s, int nbytes)
+{
+ struct timeval tv;
+
+ /* compute delay in microseconds */
+ tv.tv_sec = 0;
+#ifdef SHAPER_USE_FP
+ tv.tv_usec = min_int ((int)((double)max_int (nbytes, 100) * s->factor), (SHAPER_MAX_TIMEOUT*1000000));
+#else
+ tv.tv_usec = s->bytes_per_second
+ ? min_int (max_int (nbytes, 100) * s->factor, (SHAPER_MAX_TIMEOUT*1000000))
+ : 0;
+#endif
+
+ if (tv.tv_usec)
+ {
+ ASSERT (!openvpn_gettimeofday (&s->wakeup, NULL));
+ tv_add (&s->wakeup, &tv);
+
+#ifdef SHAPER_DEBUG
+ dmsg (D_SHAPER_DEBUG, "SHAPER shaper_wrote_bytes bytes=%d delay=%d sec=%d usec=%d",
+ nbytes,
+ (int)tv.tv_usec,
+ (int)s->wakeup.tv_sec,
+ (int)s->wakeup.tv_usec);
+#endif
+ }
+}
+
+#if 0
+/*
+ * Increase/Decrease bandwidth by a percentage.
+ *
+ * Return true if bandwidth changed.
+ */
+static inline bool
+shaper_change_pct (struct shaper *s, int pct)
+{
+ const int orig_bandwidth = s->bytes_per_second;
+ const int new_bandwidth = orig_bandwidth + (orig_bandwidth * pct / 100);
+ ASSERT (s->bytes_per_second);
+ shaper_reset (s, new_bandwidth);
+ return s->bytes_per_second != orig_bandwidth;
+}
+#endif
+
+#endif /* ENABLE_FEATURE_SHAPER */
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.c
new file mode 100644
index 00000000..90e39a42
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.c
@@ -0,0 +1,400 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "buffer.h"
+#include "error.h"
+#include "win32.h"
+#include "init.h"
+#include "status.h"
+#include "sig.h"
+#include "occ.h"
+#include "manage.h"
+#include "openvpn.h"
+
+#include "memdbg.h"
+
+/* Handle signals */
+
+struct signal_info siginfo_static; /* GLOBAL */
+
+struct signame {
+ int value;
+ const char *upper;
+ const char *lower;
+};
+
+static const struct signame signames[] = {
+ { SIGINT, "SIGINT", "sigint"},
+ { SIGTERM, "SIGTERM", "sigterm" },
+ { SIGHUP, "SIGHUP", "sighup" },
+ { SIGUSR1, "SIGUSR1", "sigusr1" },
+ { SIGUSR2, "SIGUSR2", "sigusr2" }
+};
+
+int
+parse_signal (const char *signame)
+{
+ int i;
+ for (i = 0; i < (int)SIZE (signames); ++i)
+ {
+ if (!strcmp (signame, signames[i].upper))
+ return signames[i].value;
+ }
+ return -1;
+}
+
+const char *
+signal_name (const int sig, const bool upper)
+{
+ int i;
+ for (i = 0; i < (int)SIZE (signames); ++i)
+ {
+ if (sig == signames[i].value)
+ return upper ? signames[i].upper : signames[i].lower;
+ }
+ return "UNKNOWN";
+}
+
+const char *
+signal_description (const int signum, const char *sigtext)
+{
+ if (sigtext)
+ return sigtext;
+ else
+ return signal_name (signum, false);
+}
+
+void
+throw_signal (const int signum)
+{
+ siginfo_static.signal_received = signum;
+ siginfo_static.source = SIG_SOURCE_HARD;
+}
+
+void
+throw_signal_soft (const int signum, const char *signal_text)
+{
+ siginfo_static.signal_received = signum;
+ siginfo_static.source = SIG_SOURCE_SOFT;
+ siginfo_static.signal_text = signal_text;
+}
+
+static void
+signal_reset (struct signal_info *si)
+{
+ if (si)
+ {
+ si->signal_received = 0;
+ si->signal_text = NULL;
+ si->source = SIG_SOURCE_SOFT;
+ }
+}
+
+void
+print_signal (const struct signal_info *si, const char *title, int msglevel)
+{
+ if (si)
+ {
+ const char *type = (si->signal_text ? si->signal_text : "");
+ const char *t = (title ? title : "process");
+ const char *hs;
+ switch (si->source)
+ {
+ case SIG_SOURCE_SOFT:
+ hs= "soft";
+ break;
+ case SIG_SOURCE_HARD:
+ hs = "hard";
+ break;
+ case SIG_SOURCE_CONNECTION_FAILED:
+ hs = "connection failed(soft)";
+ break;
+ default:
+ ASSERT(0);
+ }
+
+ switch (si->signal_received)
+ {
+ case SIGINT:
+ case SIGTERM:
+ msg (msglevel, "%s[%s,%s] received, %s exiting",
+ signal_name (si->signal_received, true), hs, type, t);
+ break;
+ case SIGHUP:
+ case SIGUSR1:
+ msg (msglevel, "%s[%s,%s] received, %s restarting",
+ signal_name (si->signal_received, true), hs, type, t);
+ break;
+ default:
+ msg (msglevel, "Unknown signal %d [%s,%s] received by %s", si->signal_received, hs, type, t);
+ break;
+ }
+ }
+ else
+ msg (msglevel, "Unknown signal received");
+}
+
+/*
+ * Call management interface with restart info
+ */
+void
+signal_restart_status (const struct signal_info *si)
+{
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ int state = -1;
+ switch (si->signal_received)
+ {
+ case SIGINT:
+ case SIGTERM:
+ state = OPENVPN_STATE_EXITING;
+ break;
+ case SIGHUP:
+ case SIGUSR1:
+ state = OPENVPN_STATE_RECONNECTING;
+ break;
+ }
+
+ if (state >= 0)
+ management_set_state (management,
+ state,
+ si->signal_text ? si->signal_text : signal_name (si->signal_received, true),
+ (in_addr_t)0,
+ (in_addr_t)0);
+ }
+#endif
+}
+
+#ifdef HAVE_SIGNAL_H
+
+/* normal signal handler, when we are in event loop */
+static void
+signal_handler (const int signum)
+{
+ throw_signal (signum);
+ signal (signum, signal_handler);
+}
+
+#endif
+
+/* set handlers for unix signals */
+
+#ifdef HAVE_SIGNAL_H
+#define SM_UNDEF 0
+#define SM_PRE_INIT 1
+#define SM_POST_INIT 2
+static int signal_mode; /* GLOBAL */
+#endif
+
+void
+pre_init_signal_catch (void)
+{
+#ifndef WIN32
+#ifdef HAVE_SIGNAL_H
+ signal_mode = SM_PRE_INIT;
+ signal (SIGINT, signal_handler);
+ signal (SIGTERM, signal_handler);
+ signal (SIGHUP, SIG_IGN);
+ signal (SIGUSR1, SIG_IGN);
+ signal (SIGUSR2, SIG_IGN);
+ signal (SIGPIPE, SIG_IGN);
+#endif /* HAVE_SIGNAL_H */
+#endif /* WIN32 */
+}
+
+void
+post_init_signal_catch (void)
+{
+#ifndef WIN32
+#ifdef HAVE_SIGNAL_H
+ signal_mode = SM_POST_INIT;
+ signal (SIGINT, signal_handler);
+ signal (SIGTERM, signal_handler);
+ signal (SIGHUP, signal_handler);
+ signal (SIGUSR1, signal_handler);
+ signal (SIGUSR2, signal_handler);
+ signal (SIGPIPE, SIG_IGN);
+#endif /* HAVE_SIGNAL_H */
+#endif
+}
+
+/* called after daemonization to retain signal settings */
+void
+restore_signal_state (void)
+{
+#ifdef HAVE_SIGNAL_H
+ if (signal_mode == SM_PRE_INIT)
+ pre_init_signal_catch ();
+ else if (signal_mode == SM_POST_INIT)
+ post_init_signal_catch ();
+#endif
+}
+
+/*
+ * Print statistics.
+ *
+ * Triggered by SIGUSR2 or F2 on Windows.
+ */
+void
+print_status (const struct context *c, struct status_output *so)
+{
+ struct gc_arena gc = gc_new ();
+
+ status_reset (so);
+
+ status_printf (so, "OpenVPN STATISTICS");
+ status_printf (so, "Updated,%s", time_string (0, 0, false, &gc));
+ status_printf (so, "TUN/TAP read bytes," counter_format, c->c2.tun_read_bytes);
+ status_printf (so, "TUN/TAP write bytes," counter_format, c->c2.tun_write_bytes);
+ status_printf (so, "TCP/UDP read bytes," counter_format, c->c2.link_read_bytes);
+ status_printf (so, "TCP/UDP write bytes," counter_format, c->c2.link_write_bytes);
+ status_printf (so, "Auth read bytes," counter_format, c->c2.link_read_bytes_auth);
+#ifdef USE_COMP
+ if (c->c2.comp_context)
+ comp_print_stats (c->c2.comp_context, so);
+#endif
+#ifdef PACKET_TRUNCATION_CHECK
+ status_printf (so, "TUN read truncations," counter_format, c->c2.n_trunc_tun_read);
+ status_printf (so, "TUN write truncations," counter_format, c->c2.n_trunc_tun_write);
+ status_printf (so, "Pre-encrypt truncations," counter_format, c->c2.n_trunc_pre_encrypt);
+ status_printf (so, "Post-decrypt truncations," counter_format, c->c2.n_trunc_post_decrypt);
+#endif
+#ifdef WIN32
+ if (tuntap_defined (c->c1.tuntap))
+ status_printf (so, "TAP-WIN32 driver status,\"%s\"",
+ tap_win_getinfo (c->c1.tuntap, &gc));
+#endif
+
+ status_printf (so, "END");
+ status_flush (so);
+ gc_free (&gc);
+}
+
+#ifdef ENABLE_OCC
+/*
+ * Handle the triggering and time-wait of explicit
+ * exit notification.
+ */
+
+static void
+process_explicit_exit_notification_init (struct context *c)
+{
+ msg (M_INFO, "SIGTERM received, sending exit notification to peer");
+ event_timeout_init (&c->c2.explicit_exit_notification_interval, 1, 0);
+ reset_coarse_timers (c);
+ signal_reset (c->sig);
+ halt_non_edge_triggered_signals ();
+ c->c2.explicit_exit_notification_time_wait = now;
+}
+
+void
+process_explicit_exit_notification_timer_wakeup (struct context *c)
+{
+ if (event_timeout_trigger (&c->c2.explicit_exit_notification_interval,
+ &c->c2.timeval,
+ ETT_DEFAULT))
+ {
+ ASSERT (c->c2.explicit_exit_notification_time_wait && c->options.ce.explicit_exit_notification);
+ if (now >= c->c2.explicit_exit_notification_time_wait + c->options.ce.explicit_exit_notification)
+ {
+ event_timeout_clear (&c->c2.explicit_exit_notification_interval);
+ c->sig->signal_received = SIGTERM;
+ c->sig->signal_text = "exit-with-notification";
+ }
+ else
+ {
+ c->c2.occ_op = OCC_EXIT;
+ }
+ }
+}
+#endif
+
+/*
+ * Process signals
+ */
+
+void
+remap_signal (struct context *c)
+{
+ if (c->sig->signal_received == SIGUSR1 && c->options.remap_sigusr1)
+ c->sig->signal_received = c->options.remap_sigusr1;
+}
+
+static void
+process_sigusr2 (const struct context *c)
+{
+ struct status_output *so = status_open (NULL, 0, M_INFO, NULL, 0);
+ print_status (c, so);
+ status_close (so);
+ signal_reset (c->sig);
+}
+
+static bool
+process_sigterm (struct context *c)
+{
+ bool ret = true;
+#ifdef ENABLE_OCC
+ if (c->options.ce.explicit_exit_notification
+ && !c->c2.explicit_exit_notification_time_wait)
+ {
+ process_explicit_exit_notification_init (c);
+ ret = false;
+ }
+#endif
+ return ret;
+}
+
+bool
+process_signal (struct context *c)
+{
+ bool ret = true;
+
+ if (c->sig->signal_received == SIGTERM || c->sig->signal_received == SIGINT)
+ {
+ ret = process_sigterm (c);
+ }
+ else if (c->sig->signal_received == SIGUSR2)
+ {
+ process_sigusr2 (c);
+ ret = false;
+ }
+ return ret;
+}
+
+void
+register_signal (struct context *c, int sig, const char *text)
+{
+ if (c->sig->signal_received != SIGTERM)
+ c->sig->signal_received = sig;
+ c->sig->signal_text = text;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.h
new file mode 100644
index 00000000..c2c7b54e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/sig.h
@@ -0,0 +1,113 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SIG_H
+#define SIG_H
+
+#include "status.h"
+#include "win32.h"
+
+
+
+#define SIG_SOURCE_SOFT 0
+#define SIG_SOURCE_HARD 1
+/* CONNECTION_FAILED is also a "soft" status,
+ * It is thrown if a connection attempt fails
+ */
+#define SIG_SOURCE_CONNECTION_FAILED 2
+
+/*
+ * Signal information, including signal code
+ * and descriptive text.
+ */
+struct signal_info
+{
+ volatile int signal_received;
+ volatile int source;
+ const char *signal_text;
+};
+
+#define IS_SIG(c) ((c)->sig->signal_received)
+
+struct context;
+
+extern struct signal_info siginfo_static;
+
+int parse_signal (const char *signame);
+const char *signal_name (const int sig, const bool upper);
+const char *signal_description (const int signum, const char *sigtext);
+void throw_signal (const int signum);
+void throw_signal_soft (const int signum, const char *signal_text);
+
+void pre_init_signal_catch (void);
+void post_init_signal_catch (void);
+void restore_signal_state (void);
+
+void print_signal (const struct signal_info *si, const char *title, int msglevel);
+void print_status (const struct context *c, struct status_output *so);
+
+void remap_signal (struct context *c);
+
+void signal_restart_status (const struct signal_info *si);
+
+bool process_signal (struct context *c);
+
+void register_signal (struct context *c, int sig, const char *text);
+
+#ifdef ENABLE_OCC
+void process_explicit_exit_notification_timer_wakeup (struct context *c);
+#endif
+
+#ifdef WIN32
+
+static inline void
+get_signal (volatile int *sig)
+{
+ *sig = win32_signal_get (&win32_signal);
+}
+
+static inline void
+halt_non_edge_triggered_signals (void)
+{
+ win32_signal_close (&win32_signal);
+}
+
+#else
+
+static inline void
+get_signal (volatile int *sig)
+{
+ const int i = siginfo_static.signal_received;
+ if (i)
+ *sig = i;
+}
+
+static inline void
+halt_non_edge_triggered_signals (void)
+{
+}
+
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.c
new file mode 100644
index 00000000..24440bae
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.c
@@ -0,0 +1,189 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_SNAPPY)
+
+#include "snappy-c.h"
+
+#include "comp.h"
+#include "error.h"
+#include "otime.h"
+
+#include "memdbg.h"
+
+/* Initial command byte to tell our peer if we compressed */
+#define SNAPPY_COMPRESS_BYTE 0x68
+
+static void
+snap_compress_init (struct compress_context *compctx)
+{
+ msg (D_INIT_MEDIUM, "Snappy compression initializing");
+ ASSERT(compctx->flags & COMP_F_SWAP);
+}
+
+static void
+snap_compress_uninit (struct compress_context *compctx)
+{
+}
+
+static void
+snap_compress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ snappy_status status;
+ bool compressed = false;
+
+ if (buf->len <= 0)
+ return;
+
+ /*
+ * In order to attempt compression, length must be at least COMPRESS_THRESHOLD.
+ */
+ if (buf->len >= COMPRESS_THRESHOLD)
+ {
+ const size_t ps = PAYLOAD_SIZE (frame);
+ size_t zlen = ps + COMP_EXTRA_BUFFER (ps);
+
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+ ASSERT (buf_safe (&work, zlen));
+
+ if (buf->len > ps)
+ {
+ dmsg (D_COMP_ERRORS, "Snappy compression buffer overflow");
+ buf->len = 0;
+ return;
+ }
+
+ status = snappy_compress((const char *)BPTR(buf), (size_t)BLEN(buf), (char *)BPTR(&work), &zlen);
+ if (status != SNAPPY_OK)
+ {
+ dmsg (D_COMP_ERRORS, "Snappy compression error: %d", status);
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, zlen));
+ work.len = zlen;
+ compressed = true;
+
+ dmsg (D_COMP, "Snappy compress %d -> %d", buf->len, work.len);
+ compctx->pre_compress += buf->len;
+ compctx->post_compress += work.len;
+ }
+
+ /* did compression save us anything? */
+ {
+ uint8_t comp_head_byte = NO_COMPRESS_BYTE_SWAP;
+ if (compressed && work.len < buf->len)
+ {
+ *buf = work;
+ comp_head_byte = SNAPPY_COMPRESS_BYTE;
+ }
+
+ {
+ uint8_t *head = BPTR (buf);
+ uint8_t *tail = BEND (buf);
+ ASSERT (buf_safe (buf, 1));
+ ++buf->len;
+
+ /* move head byte of payload to tail */
+ *tail = *head;
+ *head = comp_head_byte;
+ }
+ }
+}
+
+static void
+snap_decompress (struct buffer *buf, struct buffer work,
+ struct compress_context *compctx,
+ const struct frame* frame)
+{
+ size_t zlen = EXPANDED_SIZE (frame);
+ snappy_status status;
+ uint8_t c; /* flag indicating whether or not our peer compressed */
+
+ if (buf->len <= 0)
+ return;
+
+ ASSERT (buf_init (&work, FRAME_HEADROOM (frame)));
+
+ /* do unframing/swap (assumes buf->len > 0) */
+ {
+ uint8_t *head = BPTR (buf);
+ c = *head;
+ --buf->len;
+ *head = *BEND (buf);
+ }
+
+ if (c == SNAPPY_COMPRESS_BYTE) /* packet was compressed */
+ {
+ ASSERT (buf_safe (&work, zlen));
+ status = snappy_uncompress((const char *)BPTR(buf), (size_t)BLEN(buf), (char *)BPTR(&work), &zlen);
+ if (status != SNAPPY_OK)
+ {
+ dmsg (D_COMP_ERRORS, "Snappy decompression error: %d", status);
+ buf->len = 0;
+ return;
+ }
+
+ ASSERT (buf_safe (&work, zlen));
+ work.len = zlen;
+
+ dmsg (D_COMP, "Snappy decompress %d -> %d", buf->len, work.len);
+ compctx->pre_decompress += buf->len;
+ compctx->post_decompress += work.len;
+
+ *buf = work;
+ }
+ else if (c == NO_COMPRESS_BYTE_SWAP) /* packet was not compressed */
+ {
+ ;
+ }
+ else
+ {
+ dmsg (D_COMP_ERRORS, "Bad Snappy decompression header byte: %d", c);
+ buf->len = 0;
+ }
+}
+
+const struct compress_alg snappy_alg = {
+ "snappy",
+ snap_compress_init,
+ snap_compress_uninit,
+ snap_compress,
+ snap_decompress
+};
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_SNAPPY */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.h
new file mode 100644
index 00000000..361a6317
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/snappy.h
@@ -0,0 +1,39 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2012 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OPENVPN_SNAPPY_H
+#define OPENVPN_SNAPPY_H
+
+#if defined(ENABLE_SNAPPY)
+
+#include "buffer.h"
+
+extern const struct compress_alg snappy_alg;
+
+struct snappy_workspace
+{
+};
+
+#endif /* ENABLE_SNAPPY */
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.c
new file mode 100644
index 00000000..9e6bd10c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.c
@@ -0,0 +1,3530 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "socket.h"
+#include "fdmisc.h"
+#include "misc.h"
+#include "gremlin.h"
+#include "plugin.h"
+#include "ps.h"
+#include "manage.h"
+#include "misc.h"
+#include "manage.h"
+#include "openvpn.h"
+
+#include "memdbg.h"
+
+const int proto_overhead[] = { /* indexed by PROTO_x */
+ 0,
+ IPv4_UDP_HEADER_SIZE, /* IPv4 */
+ IPv4_TCP_HEADER_SIZE,
+ IPv4_TCP_HEADER_SIZE,
+ IPv6_UDP_HEADER_SIZE, /* IPv6 */
+ IPv6_TCP_HEADER_SIZE,
+ IPv6_TCP_HEADER_SIZE,
+ IPv6_TCP_HEADER_SIZE,
+};
+
+/*
+ * Convert sockflags/getaddr_flags into getaddr_flags
+ */
+static unsigned int
+sf2gaf(const unsigned int getaddr_flags,
+ const unsigned int sockflags)
+{
+ if (sockflags & SF_HOST_RANDOMIZE)
+ return getaddr_flags | GETADDR_RANDOMIZE;
+ else
+ return getaddr_flags;
+}
+
+/*
+ * Functions related to the translation of DNS names to IP addresses.
+ */
+
+static const char*
+h_errno_msg(int h_errno_err)
+{
+ switch (h_errno_err)
+ {
+ case HOST_NOT_FOUND:
+ return "[HOST_NOT_FOUND] The specified host is unknown.";
+ case NO_DATA:
+ return "[NO_DATA] The requested name is valid but does not have an IP address.";
+ case NO_RECOVERY:
+ return "[NO_RECOVERY] A non-recoverable name server error occurred.";
+ case TRY_AGAIN:
+ return "[TRY_AGAIN] A temporary error occurred on an authoritative name server.";
+ }
+ return "[unknown h_errno value]";
+}
+
+/*
+ * Translate IP addr or hostname to in_addr_t.
+ * If resolve error, try again for
+ * resolve_retry_seconds seconds.
+ */
+in_addr_t
+getaddr (unsigned int flags,
+ const char *hostname,
+ int resolve_retry_seconds,
+ bool *succeeded,
+ volatile int *signal_received)
+{
+ struct addrinfo *ai;
+ int status;
+ status = openvpn_getaddrinfo (flags & ~GETADDR_HOST_ORDER, hostname, NULL,
+ resolve_retry_seconds, signal_received, AF_INET, &ai);
+ if(status==0) {
+ struct in_addr ia;
+ if(succeeded)
+ *succeeded=true;
+ ia = ((struct sockaddr_in*)ai->ai_addr)->sin_addr;
+ freeaddrinfo(ai);
+ return (flags & GETADDR_HOST_ORDER) ? ntohl (ia.s_addr) : ia.s_addr;
+ } else {
+ if(succeeded)
+ *succeeded =false;
+ return 0;
+ }
+}
+
+static inline bool
+streqnull (const char* a, const char* b)
+{
+ if (a == NULL && b == NULL)
+ return true;
+ else if (a == NULL || b == NULL)
+ return false;
+ else
+ return streq (a, b);
+}
+
+/*
+ get_cached_dns_entry return 0 on success and -1
+ otherwise. (like getaddrinfo)
+ */
+static int
+get_cached_dns_entry (struct cached_dns_entry* dns_cache,
+ const char* hostname,
+ const char* servname,
+ int ai_family,
+ int resolve_flags,
+ struct addrinfo **ai)
+{
+ struct cached_dns_entry *ph;
+ int flags;
+
+ /* Only use flags that are relevant for the structure */
+ flags = resolve_flags & GETADDR_CACHE_MASK;
+
+ for (ph = dns_cache; ph ; ph = ph->next)
+ {
+ if (streqnull (ph->hostname, hostname) &&
+ streqnull (ph->servname, servname) &&
+ ph->ai_family == ai_family &&
+ ph->flags == flags)
+ {
+ *ai = ph->ai;
+ return 0;
+ }
+ }
+ return -1;
+}
+
+
+static int
+do_preresolve_host (struct context *c,
+ const char *hostname,
+ const char *servname,
+ const int af,
+ const int flags)
+{
+ struct addrinfo *ai;
+ int status;
+
+ if (get_cached_dns_entry(c->c1.dns_cache,
+ hostname,
+ servname,
+ af,
+ flags,
+ &ai) == 0 )
+ {
+ /* entry already cached, return success */
+ return 0;
+ }
+
+ status = openvpn_getaddrinfo (flags, hostname, servname,
+ c->options.resolve_retry_seconds, NULL,
+ af, &ai);
+ if (status == 0)
+ {
+ struct cached_dns_entry *ph;
+
+ ALLOC_OBJ_CLEAR_GC (ph, struct cached_dns_entry, &c->gc);
+ ph->ai = ai;
+ ph->hostname = hostname;
+ ph->servname = servname;
+ ph->flags = flags & GETADDR_CACHE_MASK;
+
+ if (!c->c1.dns_cache)
+ c->c1.dns_cache = ph;
+ else
+ {
+ struct cached_dns_entry *prev = c->c1.dns_cache;
+ while (prev->next)
+ prev = prev->next;
+ prev->next = ph;
+ }
+
+ gc_addspecial (ai, &gc_freeaddrinfo_callback, &c->gc);
+
+ }
+ return status;
+}
+
+void
+do_preresolve (struct context *c)
+{
+ int i;
+ struct connection_list *l = c->options.connection_list;
+ const unsigned int preresolve_flags = GETADDR_RESOLVE|
+ GETADDR_UPDATE_MANAGEMENT_STATE|
+ GETADDR_MENTION_RESOLVE_RETRY|
+ GETADDR_FATAL;
+
+
+ for (i = 0; i < l->len; ++i)
+ {
+ int status;
+ const char *remote;
+ int flags = preresolve_flags;
+
+ struct connection_entry* ce = c->options.connection_list->array[i];
+
+ if (proto_is_dgram(ce->proto))
+ flags |= GETADDR_DATAGRAM;
+
+ if (c->options.sockflags & SF_HOST_RANDOMIZE)
+ flags |= GETADDR_RANDOMIZE;
+
+ if (c->options.ip_remote_hint)
+ remote = c->options.ip_remote_hint;
+ else
+ remote = ce->remote;
+
+ /* HTTP remote hostname does not need to be resolved */
+ if (! ce->http_proxy_options)
+ {
+ status = do_preresolve_host (c, remote, ce->remote_port, ce->af, flags);
+ if (status != 0)
+ goto err;
+ }
+
+ /* Preresolve proxy */
+ if (ce->http_proxy_options)
+ {
+ status = do_preresolve_host (c,
+ ce->http_proxy_options->server,
+ ce->http_proxy_options->port,
+ ce->af,
+ preresolve_flags);
+
+ if (status != 0)
+ goto err;
+ }
+
+ if (ce->socks_proxy_server)
+ {
+ status = do_preresolve_host (c,
+ ce->socks_proxy_server,
+ ce->socks_proxy_port,
+ ce->af,
+ flags);
+ if (status != 0)
+ goto err;
+ }
+
+ if (ce->bind_local)
+ {
+ flags |= GETADDR_PASSIVE;
+ flags &= ~GETADDR_RANDOMIZE;
+ status = do_preresolve_host (c, ce->local, ce->local_port, ce->af, flags);
+ if (status != 0)
+ goto err;
+
+ }
+
+ }
+ return;
+
+ err:
+ throw_signal_soft (SIGHUP, "Preresolving failed");
+}
+
+/*
+ * Translate IPv4/IPv6 addr or hostname into struct addrinfo
+ * If resolve error, try again for resolve_retry_seconds seconds.
+ */
+int
+openvpn_getaddrinfo (unsigned int flags,
+ const char *hostname,
+ const char *servname,
+ int resolve_retry_seconds,
+ volatile int *signal_received,
+ int ai_family,
+ struct addrinfo **res)
+{
+ struct addrinfo hints;
+ int status;
+ int sigrec = 0;
+ int msglevel = (flags & GETADDR_FATAL) ? M_FATAL : D_RESOLVE_ERRORS;
+ struct gc_arena gc = gc_new ();
+ const char *print_hostname;
+ const char *print_servname;
+
+ ASSERT(res);
+
+#if defined(HAVE_RES_INIT)
+ res_init ();
+#endif
+
+ ASSERT (hostname || servname);
+ ASSERT (!(flags & GETADDR_HOST_ORDER));
+
+ if (hostname && (flags & GETADDR_RANDOMIZE))
+ hostname = hostname_randomize(hostname, &gc);
+
+ if(hostname)
+ print_hostname = hostname;
+ else
+ print_hostname = "undefined";
+
+ if(servname)
+ print_servname = servname;
+ else
+ print_servname = "";
+
+ if (flags & GETADDR_MSG_VIRT_OUT)
+ msglevel |= M_MSG_VIRT_OUT;
+
+ if ((flags & (GETADDR_FATAL_ON_SIGNAL|GETADDR_WARN_ON_SIGNAL))
+ && !signal_received)
+ signal_received = &sigrec;
+
+ /* try numeric ipv6 addr first */
+ CLEAR(hints);
+ hints.ai_family = ai_family;
+ hints.ai_flags = AI_NUMERICHOST;
+
+ if(flags & GETADDR_PASSIVE)
+ hints.ai_flags |= AI_PASSIVE;
+
+ if(flags & GETADDR_DATAGRAM)
+ hints.ai_socktype = SOCK_DGRAM;
+ else
+ hints.ai_socktype = SOCK_STREAM;
+
+ status = getaddrinfo(hostname, servname, &hints, res);
+
+ if (status != 0) /* parse as numeric address failed? */
+ {
+ const int fail_wait_interval = 5; /* seconds */
+ /* Add +4 to cause integer division rounding up (1 + 4) = 5, (0+4)/5=0 */
+ int resolve_retries = (flags & GETADDR_TRY_ONCE) ? 1 :
+ ((resolve_retry_seconds + 4)/ fail_wait_interval);
+ const char *fmt;
+ int level = 0;
+
+ fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s)";
+ if ((flags & GETADDR_MENTION_RESOLVE_RETRY)
+ && !resolve_retry_seconds)
+ fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s) (I would have retried this name query if you had specified the --resolv-retry option.)";
+
+ if (!(flags & GETADDR_RESOLVE) || status == EAI_FAIL)
+ {
+ msg (msglevel, "RESOLVE: Cannot parse IP address: %s:%s (%s)",
+ print_hostname,print_servname, gai_strerror(status));
+ goto done;
+ }
+
+#ifdef ENABLE_MANAGEMENT
+ if (flags & GETADDR_UPDATE_MANAGEMENT_STATE)
+ {
+ if (management)
+ management_set_state (management,
+ OPENVPN_STATE_RESOLVE,
+ NULL,
+ (in_addr_t)0,
+ (in_addr_t)0);
+ }
+#endif
+
+ /*
+ * Resolve hostname
+ */
+ while (true)
+ {
+ /* try hostname lookup */
+ hints.ai_flags &= ~AI_NUMERICHOST;
+ dmsg (D_SOCKET_DEBUG, "GETADDRINFO flags=0x%04x ai_family=%d ai_socktype=%d",
+ flags, hints.ai_family, hints.ai_socktype);
+ status = getaddrinfo(hostname, servname, &hints, res);
+
+ if (signal_received)
+ {
+ get_signal (signal_received);
+ if (*signal_received) /* were we interrupted by a signal? */
+ {
+ if (*signal_received == SIGUSR1) /* ignore SIGUSR1 */
+ {
+ msg (level, "RESOLVE: Ignored SIGUSR1 signal received during DNS resolution attempt");
+ *signal_received = 0;
+ }
+ else
+ {
+ if (0 == status) {
+ ASSERT(res);
+ freeaddrinfo(*res);
+ res = NULL;
+ }
+ goto done;
+ }
+ }
+ }
+
+ /* success? */
+ if (0 == status)
+ break;
+
+ /* resolve lookup failed, should we
+ continue or fail? */
+ level = msglevel;
+ if (resolve_retries > 0)
+ level = D_RESOLVE_ERRORS;
+
+ msg (level,
+ fmt,
+ print_hostname,
+ print_servname,
+ gai_strerror(status));
+
+ if (--resolve_retries <= 0)
+ goto done;
+
+ openvpn_sleep (fail_wait_interval);
+ }
+
+ ASSERT(res);
+
+ /* hostname resolve succeeded */
+
+ /*
+ * Do not choose an IP Addresse by random or change the order *
+ * of IP addresses, doing so will break RFC 3484 address selection *
+ */
+ }
+ else
+ {
+ /* IP address parse succeeded */
+ }
+
+ done:
+ if (signal_received && *signal_received)
+ {
+ int level = 0;
+ if (flags & GETADDR_FATAL_ON_SIGNAL)
+ level = M_FATAL;
+ else if (flags & GETADDR_WARN_ON_SIGNAL)
+ level = M_WARN;
+ msg (level, "RESOLVE: signal received during DNS resolution attempt");
+ }
+
+ gc_free (&gc);
+ return status;
+}
+
+/*
+ * We do our own inet_aton because the glibc function
+ * isn't very good about error checking.
+ */
+int
+openvpn_inet_aton (const char *dotted_quad, struct in_addr *addr)
+{
+ unsigned int a, b, c, d;
+
+ CLEAR (*addr);
+ if (sscanf (dotted_quad, "%u.%u.%u.%u", &a, &b, &c, &d) == 4)
+ {
+ if (a < 256 && b < 256 && c < 256 && d < 256)
+ {
+ addr->s_addr = htonl (a<<24 | b<<16 | c<<8 | d);
+ return OIA_IP; /* good dotted quad */
+ }
+ }
+ if (string_class (dotted_quad, CC_DIGIT|CC_DOT, 0))
+ return OIA_ERROR; /* probably a badly formatted dotted quad */
+ else
+ return OIA_HOSTNAME; /* probably a hostname */
+}
+
+bool
+ip_addr_dotted_quad_safe (const char *dotted_quad)
+{
+ /* verify non-NULL */
+ if (!dotted_quad)
+ return false;
+
+ /* verify length is within limits */
+ if (strlen (dotted_quad) > 15)
+ return false;
+
+ /* verify that all chars are either numeric or '.' and that no numeric
+ substring is greater than 3 chars */
+ {
+ int nnum = 0;
+ const char *p = dotted_quad;
+ int c;
+
+ while ((c = *p++))
+ {
+ if (c >= '0' && c <= '9')
+ {
+ ++nnum;
+ if (nnum > 3)
+ return false;
+ }
+ else if (c == '.')
+ {
+ nnum = 0;
+ }
+ else
+ return false;
+ }
+ }
+
+ /* verify that string will convert to IP address */
+ {
+ struct in_addr a;
+ return openvpn_inet_aton (dotted_quad, &a) == OIA_IP;
+ }
+}
+
+bool
+ipv6_addr_safe (const char *ipv6_text_addr)
+{
+ /* verify non-NULL */
+ if (!ipv6_text_addr)
+ return false;
+
+ /* verify length is within limits */
+ if (strlen (ipv6_text_addr) > INET6_ADDRSTRLEN )
+ return false;
+
+ /* verify that string will convert to IPv6 address */
+ {
+ struct in6_addr a6;
+ return inet_pton( AF_INET6, ipv6_text_addr, &a6 ) == 1;
+ }
+}
+
+static bool
+dns_addr_safe (const char *addr)
+{
+ if (addr)
+ {
+ const size_t len = strlen (addr);
+ return len > 0 && len <= 255 && string_class (addr, CC_ALNUM|CC_DASH|CC_DOT, 0);
+ }
+ else
+ return false;
+}
+
+bool
+ip_or_dns_addr_safe (const char *addr, const bool allow_fqdn)
+{
+ if (ip_addr_dotted_quad_safe (addr))
+ return true;
+ else if (allow_fqdn)
+ return dns_addr_safe (addr);
+ else
+ return false;
+}
+
+bool
+mac_addr_safe (const char *mac_addr)
+{
+ /* verify non-NULL */
+ if (!mac_addr)
+ return false;
+
+ /* verify length is within limits */
+ if (strlen (mac_addr) > 17)
+ return false;
+
+ /* verify that all chars are either alphanumeric or ':' and that no
+ alphanumeric substring is greater than 2 chars */
+ {
+ int nnum = 0;
+ const char *p = mac_addr;
+ int c;
+
+ while ((c = *p++))
+ {
+ if ( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') )
+ {
+ ++nnum;
+ if (nnum > 2)
+ return false;
+ }
+ else if (c == ':')
+ {
+ nnum = 0;
+ }
+ else
+ return false;
+ }
+ }
+
+ /* error-checking is left to script invoked in lladdr.c */
+ return true;
+}
+
+static int
+socket_get_sndbuf (int sd)
+{
+#if defined(HAVE_GETSOCKOPT) && defined(SOL_SOCKET) && defined(SO_SNDBUF)
+ int val;
+ socklen_t len;
+
+ len = sizeof (val);
+ if (getsockopt (sd, SOL_SOCKET, SO_SNDBUF, (void *) &val, &len) == 0
+ && len == sizeof (val))
+ return val;
+#endif
+ return 0;
+}
+
+static void
+socket_set_sndbuf (int sd, int size)
+{
+#if defined(HAVE_SETSOCKOPT) && defined(SOL_SOCKET) && defined(SO_SNDBUF)
+ if (size > 0 && size < SOCKET_SND_RCV_BUF_MAX)
+ {
+ if (setsockopt (sd, SOL_SOCKET, SO_SNDBUF, (void *) &size, sizeof (size)) != 0)
+ {
+ msg (M_WARN, "NOTE: setsockopt SO_SNDBUF=%d failed", size);
+ }
+ }
+#endif
+}
+
+static int
+socket_get_rcvbuf (int sd)
+{
+#if defined(HAVE_GETSOCKOPT) && defined(SOL_SOCKET) && defined(SO_RCVBUF)
+ int val;
+ socklen_t len;
+
+ len = sizeof (val);
+ if (getsockopt (sd, SOL_SOCKET, SO_RCVBUF, (void *) &val, &len) == 0
+ && len == sizeof (val))
+ return val;
+#endif
+ return 0;
+}
+
+static bool
+socket_set_rcvbuf (int sd, int size)
+{
+#if defined(HAVE_SETSOCKOPT) && defined(SOL_SOCKET) && defined(SO_RCVBUF)
+ if (size > 0 && size < SOCKET_SND_RCV_BUF_MAX)
+ {
+ if (setsockopt (sd, SOL_SOCKET, SO_RCVBUF, (void *) &size, sizeof (size)) != 0)
+ {
+ msg (M_WARN, "NOTE: setsockopt SO_RCVBUF=%d failed", size);
+ return false;
+ }
+ }
+ return true;
+#endif
+}
+
+static void
+socket_set_buffers (int fd, const struct socket_buffer_size *sbs)
+{
+ if (sbs)
+ {
+ const int sndbuf_old = socket_get_sndbuf (fd);
+ const int rcvbuf_old = socket_get_rcvbuf (fd);
+
+ if (sbs->sndbuf)
+ socket_set_sndbuf (fd, sbs->sndbuf);
+
+ if (sbs->rcvbuf)
+ socket_set_rcvbuf (fd, sbs->rcvbuf);
+
+ msg (D_OSBUF, "Socket Buffers: R=[%d->%d] S=[%d->%d]",
+ rcvbuf_old,
+ socket_get_rcvbuf (fd),
+ sndbuf_old,
+ socket_get_sndbuf (fd));
+ }
+}
+
+/*
+ * Set other socket options
+ */
+
+static bool
+socket_set_tcp_nodelay (int sd, int state)
+{
+#if defined(WIN32) || (defined(HAVE_SETSOCKOPT) && defined(IPPROTO_TCP) && defined(TCP_NODELAY))
+ if (setsockopt (sd, IPPROTO_TCP, TCP_NODELAY, (void *) &state, sizeof (state)) != 0)
+ {
+ msg (M_WARN, "NOTE: setsockopt TCP_NODELAY=%d failed", state);
+ return false;
+ }
+ else
+ {
+ dmsg (D_OSBUF, "Socket flags: TCP_NODELAY=%d succeeded", state);
+ return true;
+ }
+#else
+ msg (M_WARN, "NOTE: setsockopt TCP_NODELAY=%d failed (No kernel support)", state);
+ return false;
+#endif
+}
+
+static inline void
+socket_set_mark (int sd, int mark)
+{
+#if defined(TARGET_LINUX) && HAVE_DECL_SO_MARK
+ if (mark && setsockopt (sd, SOL_SOCKET, SO_MARK, &mark, sizeof (mark)) != 0)
+ msg (M_WARN, "NOTE: setsockopt SO_MARK=%d failed", mark);
+#endif
+}
+
+static bool
+socket_set_flags (int sd, unsigned int sockflags)
+{
+ if (sockflags & SF_TCP_NODELAY)
+ return socket_set_tcp_nodelay (sd, 1);
+ else
+ return true;
+}
+
+bool
+link_socket_update_flags (struct link_socket *ls, unsigned int sockflags)
+{
+ if (ls && socket_defined (ls->sd))
+ return socket_set_flags (ls->sd, ls->sockflags = sockflags);
+ else
+ return false;
+}
+
+void
+link_socket_update_buffer_sizes (struct link_socket *ls, int rcvbuf, int sndbuf)
+{
+ if (ls && socket_defined (ls->sd))
+ {
+ ls->socket_buffer_sizes.sndbuf = sndbuf;
+ ls->socket_buffer_sizes.rcvbuf = rcvbuf;
+ socket_set_buffers (ls->sd, &ls->socket_buffer_sizes);
+ }
+}
+
+/*
+ * SOCKET INITALIZATION CODE.
+ * Create a TCP/UDP socket
+ */
+
+socket_descriptor_t
+create_socket_tcp (struct addrinfo* addrinfo)
+{
+ socket_descriptor_t sd;
+
+ ASSERT (addrinfo);
+ ASSERT (addrinfo->ai_socktype == SOCK_STREAM);
+
+ if ((sd = socket (addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol)) < 0)
+ msg (M_ERR, "Cannot create TCP socket");
+
+#ifndef WIN32 /* using SO_REUSEADDR on Windows will cause bind to succeed on port conflicts! */
+ /* set SO_REUSEADDR on socket */
+ {
+ int on = 1;
+ if (setsockopt (sd, SOL_SOCKET, SO_REUSEADDR,
+ (void *) &on, sizeof (on)) < 0)
+ msg (M_ERR, "TCP: Cannot setsockopt SO_REUSEADDR on TCP socket");
+ }
+#endif
+
+ return sd;
+}
+
+static socket_descriptor_t
+create_socket_udp (struct addrinfo* addrinfo, const unsigned int flags)
+{
+ socket_descriptor_t sd;
+
+ ASSERT (addrinfo);
+ ASSERT (addrinfo->ai_socktype == SOCK_DGRAM);
+
+ if ((sd = socket (addrinfo->ai_family, addrinfo->ai_socktype, addrinfo->ai_protocol)) < 0)
+ msg (M_ERR, "UDP: Cannot create UDP/UDP6 socket");
+#if ENABLE_IP_PKTINFO
+ else if (flags & SF_USE_IP_PKTINFO)
+ {
+ int pad = 1;
+ if(addrinfo->ai_family == AF_INET)
+ {
+#ifdef IP_PKTINFO
+ if (setsockopt (sd, SOL_IP, IP_PKTINFO,
+ (void*)&pad, sizeof(pad)) < 0)
+ msg(M_ERR, "UDP: failed setsockopt for IP_PKTINFO");
+#elif defined(IP_RECVDSTADDR)
+ if (setsockopt (sd, IPPROTO_IP, IP_RECVDSTADDR,
+ (void*)&pad, sizeof(pad)) < 0)
+ msg(M_ERR, "UDP: failed setsockopt for IP_RECVDSTADDR");
+#else
+#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
+#endif
+ }
+ else if (addrinfo->ai_family == AF_INET6 )
+ {
+#ifndef IPV6_RECVPKTINFO /* Some older Darwin platforms require this */
+ if (setsockopt (sd, IPPROTO_IPV6, IPV6_PKTINFO,
+ (void*)&pad, sizeof(pad)) < 0)
+#else
+ if (setsockopt (sd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
+ (void*)&pad, sizeof(pad)) < 0)
+#endif
+ msg(M_ERR, "UDP: failed setsockopt for IPV6_RECVPKTINFO");
+ }
+ }
+#endif
+ return sd;
+}
+
+static void bind_local (struct link_socket *sock, const sa_family_t ai_family)
+{
+ /* bind to local address/port */
+ if (sock->bind_local)
+ {
+ if (sock->socks_proxy && sock->info.proto == PROTO_UDP)
+ socket_bind (sock->ctrl_sd, sock->info.lsa->bind_local,
+ ai_family, "SOCKS", false);
+ else
+ socket_bind (sock->sd, sock->info.lsa->bind_local,
+ ai_family,
+ "TCP/UDP", sock->info.bind_ipv6_only);
+ }
+}
+
+static void
+create_socket (struct link_socket* sock, struct addrinfo* addr)
+{
+ if (addr->ai_protocol == IPPROTO_UDP || addr->ai_socktype == SOCK_DGRAM)
+ {
+ sock->sd = create_socket_udp (addr, sock->sockflags);
+ sock->sockflags |= SF_GETADDRINFO_DGRAM;
+
+ /* Assume that control socket and data socket to the socks proxy
+ * are using the same IP family */
+ if (sock->socks_proxy)
+ {
+ /* Construct a temporary addrinfo to create the socket,
+ * currently resolve two remote addresses is not supported,
+ * TODO: Rewrite the whole resolve_remote */
+ struct addrinfo addrinfo_tmp = *addr;
+ addrinfo_tmp.ai_socktype = SOCK_STREAM;
+ addrinfo_tmp.ai_protocol = IPPROTO_TCP;
+ sock->ctrl_sd = create_socket_tcp (&addrinfo_tmp);
+ }
+ }
+ else if (addr->ai_protocol == IPPROTO_TCP || addr->ai_socktype == SOCK_STREAM)
+ {
+ sock->sd = create_socket_tcp (addr);
+ }
+ else
+ {
+ ASSERT (0);
+ }
+ /* set socket buffers based on --sndbuf and --rcvbuf options */
+ socket_set_buffers (sock->sd, &sock->socket_buffer_sizes);
+
+ /* set socket to --mark packets with given value */
+ socket_set_mark (sock->sd, sock->mark);
+
+ bind_local (sock, addr->ai_family);
+}
+
+#ifdef TARGET_ANDROID
+static void protect_fd_nonlocal (int fd, const struct sockaddr* addr)
+{
+ /* pass socket FD to management interface to pass on to VPNService API
+ * as "protected socket" (exempt from being routed into tunnel)
+ */
+ if (addr_local (addr)) {
+ msg(M_DEBUG, "Address is local, not protecting socket fd %d", fd);
+ return;
+ }
+
+ msg(M_DEBUG, "Protecting socket fd %d", fd);
+ management->connection.fdtosend = fd;
+ management_android_control (management, "PROTECTFD", __func__);
+}
+#endif
+
+/*
+ * Functions used for establishing a TCP stream connection.
+ */
+static void
+socket_do_listen (socket_descriptor_t sd,
+ const struct addrinfo *local,
+ bool do_listen,
+ bool do_set_nonblock)
+{
+ struct gc_arena gc = gc_new ();
+ if (do_listen)
+ {
+ ASSERT(local);
+ msg (M_INFO, "Listening for incoming TCP connection on %s",
+ print_sockaddr (local->ai_addr, &gc));
+ if (listen (sd, 1))
+ msg (M_ERR, "TCP: listen() failed");
+ }
+
+ /* set socket to non-blocking mode */
+ if (do_set_nonblock)
+ set_nonblock (sd);
+
+ gc_free (&gc);
+}
+
+socket_descriptor_t
+socket_do_accept (socket_descriptor_t sd,
+ struct link_socket_actual *act,
+ const bool nowait)
+{
+ /* af_addr_size WILL return 0 in this case if AFs other than AF_INET
+ * are compiled because act is empty here.
+ * could use getsockname() to support later remote_len check
+ */
+ socklen_t remote_len_af = af_addr_size(act->dest.addr.sa.sa_family);
+ socklen_t remote_len = sizeof(act->dest.addr);
+ socket_descriptor_t new_sd = SOCKET_UNDEFINED;
+
+ CLEAR (*act);
+
+#ifdef HAVE_GETPEERNAME
+ if (nowait)
+ {
+ new_sd = getpeername (sd, &act->dest.addr.sa, &remote_len);
+
+ if (!socket_defined (new_sd))
+ msg (D_LINK_ERRORS | M_ERRNO, "TCP: getpeername() failed");
+ else
+ new_sd = sd;
+ }
+#else
+ if (nowait)
+ msg (M_WARN, "TCP: this OS does not provide the getpeername() function");
+#endif
+ else
+ {
+ new_sd = accept (sd, &act->dest.addr.sa, &remote_len);
+ }
+
+#if 0 /* For debugging only, test the effect of accept() failures */
+ {
+ static int foo = 0;
+ ++foo;
+ if (foo & 1)
+ new_sd = -1;
+ }
+#endif
+
+ if (!socket_defined (new_sd))
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "TCP: accept(%d) failed", sd);
+ }
+ /* only valid if we have remote_len_af!=0 */
+ else if (remote_len_af && remote_len != remote_len_af)
+ {
+ msg (D_LINK_ERRORS, "TCP: Received strange incoming connection with unknown address length=%d", remote_len);
+ openvpn_close_socket (new_sd);
+ new_sd = SOCKET_UNDEFINED;
+ }
+ return new_sd;
+}
+
+static void
+tcp_connection_established (const struct link_socket_actual *act)
+{
+ struct gc_arena gc = gc_new ();
+ msg (M_INFO, "TCP connection established with %s",
+ print_link_socket_actual (act, &gc));
+ gc_free (&gc);
+}
+
+static int
+socket_listen_accept (socket_descriptor_t sd,
+ struct link_socket_actual *act,
+ const char *remote_dynamic,
+ const struct addrinfo *local,
+ bool do_listen,
+ bool nowait,
+ volatile int *signal_received)
+{
+ struct gc_arena gc = gc_new ();
+ /* struct openvpn_sockaddr *remote = &act->dest; */
+ struct openvpn_sockaddr remote_verify = act->dest;
+ int new_sd = SOCKET_UNDEFINED;
+
+ CLEAR (*act);
+ socket_do_listen (sd, local, do_listen, true);
+
+ while (true)
+ {
+ int status;
+ fd_set reads;
+ struct timeval tv;
+
+ FD_ZERO (&reads);
+ FD_SET (sd, &reads);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, &reads, NULL, NULL, &tv);
+
+ get_signal (signal_received);
+ if (*signal_received)
+ {
+ gc_free (&gc);
+ return sd;
+ }
+
+ if (status < 0)
+ msg (D_LINK_ERRORS | M_ERRNO, "TCP: select() failed");
+
+ if (status <= 0)
+ {
+ openvpn_sleep (1);
+ continue;
+ }
+
+ new_sd = socket_do_accept (sd, act, nowait);
+
+ if (socket_defined (new_sd))
+ {
+ struct addrinfo* ai = NULL;
+ if(remote_dynamic)
+ openvpn_getaddrinfo(0, remote_dynamic, NULL, 1, NULL,
+ remote_verify.addr.sa.sa_family, &ai);
+
+ if(ai && !addrlist_match(&remote_verify, ai))
+ {
+ msg (M_WARN,
+ "TCP NOTE: Rejected connection attempt from %s due to --remote setting",
+ print_link_socket_actual (act, &gc));
+ if (openvpn_close_socket (new_sd))
+ msg (M_ERR, "TCP: close socket failed (new_sd)");
+ freeaddrinfo(ai);
+ }
+ else
+ {
+ if(ai)
+ freeaddrinfo(ai);
+ break;
+ }
+ }
+ openvpn_sleep (1);
+ }
+
+ if (!nowait && openvpn_close_socket (sd))
+ msg (M_ERR, "TCP: close socket failed (sd)");
+
+ tcp_connection_established (act);
+
+ gc_free (&gc);
+ return new_sd;
+}
+
+void
+socket_bind (socket_descriptor_t sd,
+ struct addrinfo *local,
+ int ai_family,
+ const char *prefix,
+ bool ipv6only)
+{
+ struct gc_arena gc = gc_new ();
+
+ /* FIXME (schwabe)
+ * getaddrinfo for the bind address might return multiple AF_INET/AF_INET6
+ * entries for the requested protocol.
+ * For example if an address has multiple A records
+ * What is the correct way to deal with it?
+ */
+
+ struct addrinfo* cur;
+
+ ASSERT(local);
+
+
+ /* find the first addrinfo with correct ai_family */
+ for (cur = local; cur; cur=cur->ai_next)
+ {
+ if(cur->ai_family == ai_family)
+ break;
+ }
+ if (!cur)
+ msg (M_FATAL, "%s: Socket bind failed: Addr to bind has no %s record",
+ prefix, addr_family_name(ai_family));
+
+ if (ai_family == AF_INET6)
+ {
+ int v6only = ipv6only ? 1: 0; /* setsockopt must have an "int" */
+
+ msg (M_INFO, "setsockopt(IPV6_V6ONLY=%d)", v6only);
+ if (setsockopt(sd, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, sizeof(v6only)))
+ {
+ msg (M_NONFATAL|M_ERRNO, "Setting IPV6_V6ONLY=%d failed", v6only);
+ }
+ }
+ if (bind (sd, cur->ai_addr, cur->ai_addrlen))
+ {
+ const int errnum = openvpn_errno ();
+ msg (M_FATAL, "%s: Socket bind failed on local address %s: %s",
+ prefix,
+ print_sockaddr_ex (local->ai_addr, ":", PS_SHOW_PORT, &gc),
+ strerror_ts (errnum, &gc));
+ }
+ gc_free (&gc);
+}
+
+int
+openvpn_connect (socket_descriptor_t sd,
+ const struct sockaddr *remote,
+ int connect_timeout,
+ volatile int *signal_received)
+{
+ int status = 0;
+
+#ifdef TARGET_ANDROID
+ protect_fd_nonlocal(sd, remote);
+#endif
+
+#ifdef CONNECT_NONBLOCK
+ set_nonblock (sd);
+ status = connect (sd, remote, af_addr_size(remote->sa_family));
+ if (status)
+ status = openvpn_errno ();
+ if (
+#ifdef WIN32
+ status == WSAEWOULDBLOCK
+#else
+ status == EINPROGRESS
+#endif
+ )
+ {
+ while (true)
+ {
+ fd_set writes;
+ struct timeval tv;
+
+ FD_ZERO (&writes);
+ FD_SET (sd, &writes);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, NULL, &writes, NULL, &tv);
+
+ if (signal_received)
+ {
+ get_signal (signal_received);
+ if (*signal_received)
+ {
+ status = 0;
+ break;
+ }
+ }
+ if (status < 0)
+ {
+ status = openvpn_errno ();
+ break;
+ }
+ if (status <= 0)
+ {
+ if (--connect_timeout < 0)
+ {
+ status = ETIMEDOUT;
+ break;
+ }
+ openvpn_sleep (1);
+ continue;
+ }
+
+ /* got it */
+ {
+ int val = 0;
+ socklen_t len;
+
+ len = sizeof (val);
+ if (getsockopt (sd, SOL_SOCKET, SO_ERROR, (void *) &val, &len) == 0
+ && len == sizeof (val))
+ status = val;
+ else
+ status = openvpn_errno ();
+ break;
+ }
+ }
+ }
+#else
+ status = connect (sd, &remote->addr.sa, af_addr_size(remote->addr.sa.sa_family));
+ if (status)
+ status = openvpn_errno ();
+#endif
+
+ return status;
+}
+
+void set_actual_address (struct link_socket_actual* actual, struct addrinfo* ai)
+{
+ CLEAR (*actual);
+ ASSERT (ai);
+
+ if (ai->ai_family == AF_INET)
+ actual->dest.addr.in4 =
+ *((struct sockaddr_in*) ai->ai_addr);
+ else if (ai->ai_family == AF_INET6)
+ actual->dest.addr.in6 =
+ *((struct sockaddr_in6*) ai->ai_addr);
+ else
+ ASSERT(0);
+
+}
+
+void
+socket_connect (socket_descriptor_t* sd,
+ const struct sockaddr* dest,
+ const int connect_timeout,
+ struct signal_info* sig_info)
+{
+ struct gc_arena gc = gc_new ();
+ int status;
+
+#ifdef CONNECT_NONBLOCK
+ msg (M_INFO, "Attempting to establish TCP connection with %s [nonblock]",
+ print_sockaddr (dest, &gc));
+#else
+ msg (M_INFO, "Attempting to establish TCP connection with %s",
+ print_sockaddr (dest, &gc));
+#endif
+
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ management_set_state (management,
+ OPENVPN_STATE_TCP_CONNECT,
+ NULL,
+ (in_addr_t)0,
+ (in_addr_t)0);
+#endif
+
+ /* Set the actual address */
+ status = openvpn_connect (*sd, dest, connect_timeout, &sig_info->signal_received);
+
+ get_signal (&sig_info->signal_received);
+ if (sig_info->signal_received)
+ goto done;
+
+ if (status) {
+
+ msg (D_LINK_ERRORS,
+ "TCP: connect to %s failed: %s",
+ print_sockaddr (dest, &gc),
+ strerror_ts (status, &gc));
+
+ openvpn_close_socket (*sd);
+ *sd = SOCKET_UNDEFINED;
+ sig_info->signal_received = SIGUSR1;
+ sig_info->source = SIG_SOURCE_CONNECTION_FAILED;
+ } else {
+ msg (M_INFO, "TCP connection established with %s",
+ print_sockaddr (dest, &gc));
+ }
+
+ done:
+ gc_free (&gc);
+}
+
+/* For stream protocols, allocate a buffer to build up packet.
+ Called after frame has been finalized. */
+
+static void
+socket_frame_init (const struct frame *frame, struct link_socket *sock)
+{
+#ifdef WIN32
+ overlapped_io_init (&sock->reads, frame, FALSE, false);
+ overlapped_io_init (&sock->writes, frame, TRUE, false);
+ sock->rw_handle.read = sock->reads.overlapped.hEvent;
+ sock->rw_handle.write = sock->writes.overlapped.hEvent;
+#endif
+
+ if (link_socket_connection_oriented (sock))
+ {
+#ifdef WIN32
+ stream_buf_init (&sock->stream_buf,
+ &sock->reads.buf_init,
+ sock->sockflags,
+ sock->info.proto);
+#else
+ alloc_buf_sock_tun (&sock->stream_buf_data,
+ frame,
+ false,
+ FRAME_HEADROOM_MARKER_READ_STREAM);
+
+ stream_buf_init (&sock->stream_buf,
+ &sock->stream_buf_data,
+ sock->sockflags,
+ sock->info.proto);
+#endif
+ }
+}
+
+/*
+ * Adjust frame structure based on a Path MTU value given
+ * to us by the OS.
+ */
+void
+frame_adjust_path_mtu (struct frame *frame, int pmtu, int proto)
+{
+ frame_set_mtu_dynamic (frame, pmtu - datagram_overhead (proto), SET_MTU_UPPER_BOUND);
+}
+
+static void
+resolve_bind_local (struct link_socket *sock, const sa_family_t af)
+{
+ struct gc_arena gc = gc_new ();
+
+ /* resolve local address if undefined */
+ if (!sock->info.lsa->bind_local)
+ {
+ int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL |
+ GETADDR_FATAL | GETADDR_PASSIVE;
+ int status;
+
+ if(proto_is_dgram(sock->info.proto))
+ flags |= GETADDR_DATAGRAM;
+
+ /* will return AF_{INET|INET6}from local_host */
+ status = get_cached_dns_entry (sock->dns_cache,
+ sock->local_host,
+ sock->local_port,
+ af,
+ flags,
+ &sock->info.lsa->bind_local);
+
+ if (status)
+ status = openvpn_getaddrinfo(flags, sock->local_host, sock->local_port, 0,
+ NULL, af, &sock->info.lsa->bind_local);
+
+ if(status !=0) {
+ msg (M_FATAL, "getaddrinfo() failed for local \"%s:%s\": %s",
+ sock->local_host, sock->local_port,
+ gai_strerror(status));
+ }
+ }
+
+ gc_free (&gc);
+}
+
+static void
+resolve_remote (struct link_socket *sock,
+ int phase,
+ const char **remote_dynamic,
+ volatile int *signal_received)
+{
+ struct gc_arena gc = gc_new ();
+
+ /* resolve remote address if undefined */
+ if (!sock->info.lsa->remote_list)
+ {
+ if (sock->remote_host)
+ {
+ unsigned int flags = sf2gaf(GETADDR_RESOLVE|GETADDR_UPDATE_MANAGEMENT_STATE, sock->sockflags);
+ int retry = 0;
+ int status = -1;
+ struct addrinfo* ai;
+ if (proto_is_dgram(sock->info.proto))
+ flags |= GETADDR_DATAGRAM;
+
+ if (sock->resolve_retry_seconds == RESOLV_RETRY_INFINITE)
+ {
+ if (phase == 2)
+ flags |= (GETADDR_TRY_ONCE | GETADDR_FATAL);
+ retry = 0;
+ }
+ else if (phase == 1)
+ {
+ if (sock->resolve_retry_seconds)
+ {
+ retry = 0;
+ }
+ else
+ {
+ flags |= (GETADDR_FATAL | GETADDR_MENTION_RESOLVE_RETRY);
+ retry = 0;
+ }
+ }
+ else if (phase == 2)
+ {
+ if (sock->resolve_retry_seconds)
+ {
+ flags |= GETADDR_FATAL;
+ retry = sock->resolve_retry_seconds;
+ }
+ else
+ {
+ ASSERT (0);
+ }
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+
+ status = get_cached_dns_entry (sock->dns_cache,
+ sock->remote_host,
+ sock->remote_port,
+ sock->info.af,
+ flags, &ai);
+ if (status)
+ status = openvpn_getaddrinfo (flags, sock->remote_host, sock->remote_port,
+ retry, signal_received, sock->info.af, &ai);
+
+ if(status == 0) {
+ sock->info.lsa->remote_list = ai;
+ sock->info.lsa->current_remote = ai;
+
+ dmsg (D_SOCKET_DEBUG, "RESOLVE_REMOTE flags=0x%04x phase=%d rrs=%d sig=%d status=%d",
+ flags,
+ phase,
+ retry,
+ signal_received ? *signal_received : -1,
+ status);
+ }
+ if (signal_received)
+ {
+ if (*signal_received)
+ goto done;
+ }
+ if (status!=0)
+ {
+ if (signal_received)
+ *signal_received = SIGUSR1;
+ goto done;
+ }
+ }
+ }
+
+ /* should we re-use previous active remote address? */
+ if (link_socket_actual_defined (&sock->info.lsa->actual))
+ {
+ msg (M_INFO, "TCP/UDP: Preserving recently used remote address: %s",
+ print_link_socket_actual (&sock->info.lsa->actual, &gc));
+ if (remote_dynamic)
+ *remote_dynamic = NULL;
+ }
+ else
+ {
+ CLEAR (sock->info.lsa->actual);
+ if(sock->info.lsa->current_remote)
+ {
+ set_actual_address (&sock->info.lsa->actual,
+ sock->info.lsa->current_remote);
+ }
+ }
+
+ done:
+ gc_free (&gc);
+}
+
+
+
+struct link_socket *
+link_socket_new (void)
+{
+ struct link_socket *sock;
+
+ ALLOC_OBJ_CLEAR (sock, struct link_socket);
+ sock->sd = SOCKET_UNDEFINED;
+ sock->ctrl_sd = SOCKET_UNDEFINED;
+ return sock;
+}
+
+void
+link_socket_init_phase1 (struct link_socket *sock,
+ const char *local_host,
+ const char *local_port,
+ const char *remote_host,
+ const char *remote_port,
+ struct cached_dns_entry *dns_cache,
+ int proto,
+ sa_family_t af,
+ bool bind_ipv6_only,
+ int mode,
+ const struct link_socket *accept_from,
+ struct http_proxy_info *http_proxy,
+ struct socks_proxy_info *socks_proxy,
+#ifdef ENABLE_DEBUG
+ int gremlin,
+#endif
+ bool bind_local,
+ bool remote_float,
+ int inetd,
+ struct link_socket_addr *lsa,
+ const char *ipchange_command,
+ const struct plugin_list *plugins,
+ int resolve_retry_seconds,
+ int connect_timeout,
+ int mtu_discover_type,
+ int rcvbuf,
+ int sndbuf,
+ int mark,
+ unsigned int sockflags)
+{
+ ASSERT (sock);
+
+ sock->local_host = local_host;
+ sock->local_port = local_port;
+ sock->remote_host = remote_host;
+ sock->remote_port = remote_port;
+ sock->dns_cache = dns_cache;
+ sock->http_proxy = http_proxy;
+ sock->socks_proxy = socks_proxy;
+ sock->bind_local = bind_local;
+ sock->inetd = inetd;
+ sock->resolve_retry_seconds = resolve_retry_seconds;
+ sock->connect_timeout = connect_timeout;
+ sock->mtu_discover_type = mtu_discover_type;
+
+#ifdef ENABLE_DEBUG
+ sock->gremlin = gremlin;
+#endif
+
+ sock->socket_buffer_sizes.rcvbuf = rcvbuf;
+ sock->socket_buffer_sizes.sndbuf = sndbuf;
+
+ sock->sockflags = sockflags;
+ sock->mark = mark;
+
+ sock->info.proto = proto;
+ sock->info.af = af;
+ sock->info.remote_float = remote_float;
+ sock->info.lsa = lsa;
+ sock->info.bind_ipv6_only = bind_ipv6_only;
+ sock->info.ipchange_command = ipchange_command;
+ sock->info.plugins = plugins;
+
+ sock->mode = mode;
+ if (mode == LS_MODE_TCP_ACCEPT_FROM)
+ {
+ ASSERT (accept_from);
+ ASSERT (sock->info.proto == PROTO_TCP_SERVER);
+ ASSERT (!sock->inetd);
+ sock->sd = accept_from->sd;
+ }
+
+ if (false)
+ ;
+ /* are we running in HTTP proxy mode? */
+ else if (sock->http_proxy)
+ {
+ ASSERT (sock->info.proto == PROTO_TCP_CLIENT);
+ ASSERT (!sock->inetd);
+
+ /* the proxy server */
+ sock->remote_host = http_proxy->options.server;
+ sock->remote_port = http_proxy->options.port;
+
+ /* the OpenVPN server we will use the proxy to connect to */
+ sock->proxy_dest_host = remote_host;
+ sock->proxy_dest_port = remote_port;
+ }
+ /* or in Socks proxy mode? */
+ else if (sock->socks_proxy)
+ {
+ ASSERT (!sock->inetd);
+
+ /* the proxy server */
+ sock->remote_host = socks_proxy->server;
+ sock->remote_port = socks_proxy->port;
+
+ /* the OpenVPN server we will use the proxy to connect to */
+ sock->proxy_dest_host = remote_host;
+ sock->proxy_dest_port = remote_port;
+ }
+ else
+ {
+ sock->remote_host = remote_host;
+ sock->remote_port = remote_port;
+ }
+
+ /* bind behavior for TCP server vs. client */
+ if (sock->info.proto == PROTO_TCP_SERVER)
+ {
+ if (sock->mode == LS_MODE_TCP_ACCEPT_FROM)
+ sock->bind_local = false;
+ else
+ sock->bind_local = true;
+ }
+
+ /* were we started by inetd or xinetd? */
+ if (sock->inetd)
+ {
+ ASSERT (sock->info.proto != PROTO_TCP_CLIENT);
+ ASSERT (socket_defined (inetd_socket_descriptor));
+ sock->sd = inetd_socket_descriptor;
+ }
+ else if (mode != LS_MODE_TCP_ACCEPT_FROM)
+ {
+ if (sock->bind_local) {
+ resolve_bind_local (sock, sock->info.af);
+ }
+ resolve_remote (sock, 1, NULL, NULL);
+ }
+}
+
+static
+void phase2_inetd (struct link_socket* sock, const struct frame *frame,
+ const char *remote_dynamic, volatile int *signal_received)
+{
+ bool remote_changed = false;
+
+ if (sock->info.proto == PROTO_TCP_SERVER) {
+ /* AF_INET as default (and fallback) for inetd */
+ sock->info.lsa->actual.dest.addr.sa.sa_family = AF_INET;
+#ifdef HAVE_GETSOCKNAME
+ {
+ /* inetd: hint family type for dest = local's */
+ struct openvpn_sockaddr local_addr;
+ socklen_t addrlen = sizeof(local_addr);
+ if (getsockname (sock->sd, &local_addr.addr.sa, &addrlen) == 0) {
+ sock->info.lsa->actual.dest.addr.sa.sa_family = local_addr.addr.sa.sa_family;
+ dmsg (D_SOCKET_DEBUG, "inetd(%s): using sa_family=%d from getsockname(%d)",
+ proto2ascii(sock->info.proto, sock->info.af, false),
+ local_addr.addr.sa.sa_family, sock->sd);
+ } else
+ msg (M_WARN, "inetd(%s): getsockname(%d) failed, using AF_INET",
+ proto2ascii(sock->info.proto, sock->info.af, false), sock->sd);
+ }
+#else
+ msg (M_WARN, "inetd(%s): this OS does not provide the getsockname() "
+ "function, using AF_INET",
+ proto2ascii(sock->info.proto, false));
+#endif
+ sock->sd =
+ socket_listen_accept (sock->sd,
+ &sock->info.lsa->actual,
+ remote_dynamic,
+ sock->info.lsa->bind_local,
+ false,
+ sock->inetd == INETD_NOWAIT,
+ signal_received);
+
+ }
+ ASSERT (!remote_changed);
+}
+
+static void
+phase2_set_socket_flags (struct link_socket* sock)
+{
+ /* set misc socket parameters */
+ socket_set_flags (sock->sd, sock->sockflags);
+
+ /* set socket to non-blocking mode */
+ set_nonblock (sock->sd);
+
+ /* set socket file descriptor to not pass across execs, so that
+ scripts don't have access to it */
+ set_cloexec (sock->sd);
+
+ if (socket_defined (sock->ctrl_sd))
+ set_cloexec (sock->ctrl_sd);
+
+ /* set Path MTU discovery options on the socket */
+ set_mtu_discover_type (sock->sd, sock->mtu_discover_type);
+
+#if EXTENDED_SOCKET_ERROR_CAPABILITY
+ /* if the OS supports it, enable extended error passing on the socket */
+ set_sock_extended_error_passing (sock->sd);
+#endif
+}
+
+
+static void
+linksock_print_addr (struct link_socket *sock)
+{
+ struct gc_arena gc = gc_new ();
+ const int msglevel = (sock->mode == LS_MODE_TCP_ACCEPT_FROM) ? D_INIT_MEDIUM : M_INFO;
+
+ /* print local address */
+ if (sock->inetd)
+ msg (msglevel, "%s link local: [inetd]", proto2ascii (sock->info.proto, sock->info.af, true));
+ else if (sock->bind_local)
+ {
+ sa_family_t ai_family = sock->info.lsa->actual.dest.addr.sa.sa_family;
+ /* Socket is always bound on the first matching address,
+ * For bound sockets with no remote addr this is the element of
+ * the list */
+ struct addrinfo *cur;
+ for (cur = sock->info.lsa->bind_local; cur; cur=cur->ai_next)
+ {
+ if(!ai_family || ai_family == cur->ai_family)
+ break;
+ }
+ ASSERT (cur);
+ msg (msglevel, "%s link local (bound): %s",
+ proto2ascii (sock->info.proto, sock->info.af, true),
+ print_sockaddr(cur->ai_addr,&gc));
+ }
+ else
+ msg (msglevel, "%s link local: (not bound)",
+ proto2ascii (sock->info.proto, sock->info.af, true));
+
+ /* print active remote address */
+ msg (msglevel, "%s link remote: %s",
+ proto2ascii (sock->info.proto, sock->info.af, true),
+ print_link_socket_actual_ex (&sock->info.lsa->actual,
+ ":",
+ PS_SHOW_PORT_IF_DEFINED,
+ &gc));
+ gc_free(&gc);
+}
+
+static void
+phase2_tcp_server (struct link_socket *sock, const char *remote_dynamic,
+ volatile int *signal_received)
+{
+ switch (sock->mode)
+ {
+ case LS_MODE_DEFAULT:
+ sock->sd = socket_listen_accept (sock->sd,
+ &sock->info.lsa->actual,
+ remote_dynamic,
+ sock->info.lsa->bind_local,
+ true,
+ false,
+ signal_received);
+ break;
+ case LS_MODE_TCP_LISTEN:
+ socket_do_listen (sock->sd,
+ sock->info.lsa->bind_local,
+ true,
+ false);
+ break;
+ case LS_MODE_TCP_ACCEPT_FROM:
+ sock->sd = socket_do_accept (sock->sd,
+ &sock->info.lsa->actual,
+ false);
+ if (!socket_defined (sock->sd))
+ {
+ *signal_received = SIGTERM;
+ return;
+ }
+ tcp_connection_established (&sock->info.lsa->actual);
+ break;
+ default:
+ ASSERT (0);
+ }
+}
+
+
+static void
+phase2_tcp_client (struct link_socket *sock, struct signal_info *sig_info)
+{
+ bool proxy_retry = false;
+ do {
+ socket_connect (&sock->sd,
+ sock->info.lsa->current_remote->ai_addr,
+ sock->connect_timeout,
+ sig_info);
+
+ if (sig_info->signal_received)
+ return;
+
+ if (false)
+ ;
+ else if (sock->http_proxy)
+ {
+ proxy_retry = establish_http_proxy_passthru (sock->http_proxy,
+ sock->sd,
+ sock->proxy_dest_host,
+ sock->proxy_dest_port,
+ &sock->stream_buf.residual,
+ &sig_info->signal_received);
+ }
+ else if (sock->socks_proxy)
+ {
+ establish_socks_proxy_passthru (sock->socks_proxy,
+ sock->sd,
+ sock->proxy_dest_host,
+ sock->proxy_dest_port,
+ &sig_info->signal_received);
+ }
+ if (proxy_retry)
+ {
+ openvpn_close_socket (sock->sd);
+ sock->sd = create_socket_tcp (sock->info.lsa->current_remote);
+ }
+
+ } while (proxy_retry);
+
+}
+
+static void
+phase2_socks_client (struct link_socket *sock, struct signal_info *sig_info)
+{
+ socket_connect (&sock->ctrl_sd,
+ sock->info.lsa->current_remote->ai_addr,
+ sock->connect_timeout,
+ sig_info);
+
+ if (sig_info->signal_received)
+ return;
+
+ establish_socks_proxy_udpassoc (sock->socks_proxy,
+ sock->ctrl_sd,
+ sock->sd,
+ &sock->socks_relay.dest,
+ &sig_info->signal_received);
+
+ if (sig_info->signal_received)
+ return;
+
+ sock->remote_host = sock->proxy_dest_host;
+ sock->remote_port = sock->proxy_dest_port;
+
+ addr_zero_host(&sock->info.lsa->actual.dest);
+ if (sock->info.lsa->remote_list)
+ {
+ freeaddrinfo(sock->info.lsa->remote_list);
+ sock->info.lsa->current_remote = NULL;
+ sock->info.lsa->remote_list = NULL;
+ }
+
+ resolve_remote (sock, 1, NULL, &sig_info->signal_received);
+}
+
+/* finalize socket initialization */
+void
+link_socket_init_phase2 (struct link_socket *sock,
+ const struct frame *frame,
+ struct signal_info *sig_info)
+{
+ const char *remote_dynamic = NULL;
+ int sig_save = 0;
+
+ ASSERT (sock);
+
+ if (sig_info && sig_info->signal_received)
+ {
+ sig_save = sig_info->signal_received;
+ sig_info->signal_received = 0;
+ }
+
+ /* initialize buffers */
+ socket_frame_init (frame, sock);
+
+ /*
+ * Pass a remote name to connect/accept so that
+ * they can test for dynamic IP address changes
+ * and throw a SIGUSR1 if appropriate.
+ */
+ if (sock->resolve_retry_seconds)
+ remote_dynamic = sock->remote_host;
+
+ /* were we started by inetd or xinetd? */
+ if (sock->inetd)
+ {
+ phase2_inetd (sock, frame, remote_dynamic, &sig_info->signal_received);
+ if (sig_info && sig_info->signal_received)
+ goto done;
+
+ }
+ else
+ {
+ /* Second chance to resolv/create socket */
+ resolve_remote (sock, 2, &remote_dynamic, &sig_info->signal_received);
+
+ /* If a valid remote has been found, create the socket with its addrinfo */
+ if (sock->info.lsa->current_remote)
+ create_socket (sock, sock->info.lsa->current_remote);
+
+ /* If socket has not already been created create it now */
+ if (sock->sd == SOCKET_UNDEFINED)
+ {
+ /* If we have no --remote and have still not figured out the
+ * protocol family to use we will use the first of the bind */
+
+ if (sock->bind_local && !sock->remote_host && sock->info.lsa->bind_local)
+ {
+ /* Warn if this is because neither v4 or v6 was specified
+ * and we should not connect a remote */
+ if (sock->info.af == AF_UNSPEC)
+ msg (M_WARN, "Could not determine IPv4/IPv6 protocol. Using %s",
+ addr_family_name(sock->info.lsa->bind_local->ai_family));
+
+ create_socket (sock, sock->info.lsa->bind_local);
+ }
+ }
+
+ /* Socket still undefined, give a warning and abort connection */
+ if (sock->sd == SOCKET_UNDEFINED)
+ {
+ msg (M_WARN, "Could not determine IPv4/IPv6 protocol");
+ sig_info->signal_received = SIGUSR1;
+ goto done;
+ }
+
+ if (sig_info && sig_info->signal_received)
+ goto done;
+
+ if (sock->info.proto == PROTO_TCP_SERVER)
+ {
+ phase2_tcp_server (sock, remote_dynamic,
+ &sig_info->signal_received);
+ }
+ else if (sock->info.proto == PROTO_TCP_CLIENT)
+ {
+ phase2_tcp_client (sock, sig_info);
+
+ }
+ else if (sock->info.proto == PROTO_UDP && sock->socks_proxy)
+ {
+ phase2_socks_client (sock, sig_info);
+ }
+#ifdef TARGET_ANDROID
+ if (sock->sd != -1)
+ protect_fd_nonlocal (sock->sd, &sock->info.lsa->actual.dest.addr.sa);
+#endif
+ if (sig_info && sig_info->signal_received)
+ goto done;
+ }
+
+ phase2_set_socket_flags(sock);
+ linksock_print_addr(sock);
+
+ done:
+ if (sig_save && sig_info)
+ {
+ if (!sig_info->signal_received)
+ sig_info->signal_received = sig_save;
+ }
+}
+
+void
+link_socket_close (struct link_socket *sock)
+{
+ if (sock)
+ {
+#ifdef ENABLE_DEBUG
+ const int gremlin = GREMLIN_CONNECTION_FLOOD_LEVEL (sock->gremlin);
+#else
+ const int gremlin = 0;
+#endif
+
+ if (socket_defined (sock->sd))
+ {
+#ifdef WIN32
+ close_net_event_win32 (&sock->listen_handle, sock->sd, 0);
+#endif
+ if (!gremlin)
+ {
+ msg (D_LOW, "TCP/UDP: Closing socket");
+ if (openvpn_close_socket (sock->sd))
+ msg (M_WARN | M_ERRNO, "TCP/UDP: Close Socket failed");
+ }
+ sock->sd = SOCKET_UNDEFINED;
+#ifdef WIN32
+ if (!gremlin)
+ {
+ overlapped_io_close (&sock->reads);
+ overlapped_io_close (&sock->writes);
+ }
+#endif
+ }
+
+ if (socket_defined (sock->ctrl_sd))
+ {
+ if (openvpn_close_socket (sock->ctrl_sd))
+ msg (M_WARN | M_ERRNO, "TCP/UDP: Close Socket (ctrl_sd) failed");
+ sock->ctrl_sd = SOCKET_UNDEFINED;
+ }
+
+ stream_buf_close (&sock->stream_buf);
+ free_buf (&sock->stream_buf_data);
+ if (!gremlin)
+ free (sock);
+ }
+}
+
+/* for stream protocols, allow for packet length prefix */
+void
+socket_adjust_frame_parameters (struct frame *frame, int proto)
+{
+ if (link_socket_proto_connection_oriented (proto))
+ frame_add_to_extra_frame (frame, sizeof (packet_size_type));
+}
+
+void
+setenv_trusted (struct env_set *es, const struct link_socket_info *info)
+{
+ setenv_link_socket_actual (es, "trusted", &info->lsa->actual, SA_IP_PORT);
+}
+
+static void
+ipchange_fmt (const bool include_cmd, struct argv *argv, const struct link_socket_info *info, struct gc_arena *gc)
+{
+ const char *host = print_sockaddr_ex (&info->lsa->actual.dest.addr.sa, " ", PS_SHOW_PORT , gc);
+ if (include_cmd)
+ argv_printf (argv, "%sc %s",
+ info->ipchange_command,
+ host);
+ else
+ argv_printf (argv, "%s", host);
+
+}
+
+void
+link_socket_connection_initiated (const struct buffer *buf,
+ struct link_socket_info *info,
+ const struct link_socket_actual *act,
+ const char *common_name,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+
+ info->lsa->actual = *act; /* Note: skip this line for --force-dest */
+ setenv_trusted (es, info);
+ info->connection_established = true;
+
+ /* Print connection initiated message, with common name if available */
+ {
+ struct buffer out = alloc_buf_gc (256, &gc);
+ if (common_name)
+ buf_printf (&out, "[%s] ", common_name);
+ buf_printf (&out, "Peer Connection Initiated with %s", print_link_socket_actual (&info->lsa->actual, &gc));
+ msg (M_INFO, "%s", BSTR (&out));
+ }
+
+ /* set environmental vars */
+ setenv_str (es, "common_name", common_name);
+
+ /* Process --ipchange plugin */
+ if (plugin_defined (info->plugins, OPENVPN_PLUGIN_IPCHANGE))
+ {
+ struct argv argv = argv_new ();
+ ipchange_fmt (false, &argv, info, &gc);
+ if (plugin_call (info->plugins, OPENVPN_PLUGIN_IPCHANGE, &argv, NULL, es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ msg (M_WARN, "WARNING: ipchange plugin call failed");
+ argv_reset (&argv);
+ }
+
+ /* Process --ipchange option */
+ if (info->ipchange_command)
+ {
+ struct argv argv = argv_new ();
+ setenv_str (es, "script_type", "ipchange");
+ ipchange_fmt (true, &argv, info, &gc);
+ openvpn_run_script (&argv, es, 0, "--ipchange");
+ argv_reset (&argv);
+ }
+
+ gc_free (&gc);
+}
+
+void
+link_socket_bad_incoming_addr (struct buffer *buf,
+ const struct link_socket_info *info,
+ const struct link_socket_actual *from_addr)
+{
+ struct gc_arena gc = gc_new ();
+ struct addrinfo* ai;
+
+ switch(from_addr->dest.addr.sa.sa_family)
+ {
+ case AF_INET:
+ case AF_INET6:
+ msg (D_LINK_ERRORS,
+ "TCP/UDP: Incoming packet rejected from %s[%d], expected peer address: %s (allow this incoming source address/port by removing --remote or adding --float)",
+ print_link_socket_actual (from_addr, &gc),
+ (int)from_addr->dest.addr.sa.sa_family,
+ print_sockaddr_ex (info->lsa->remote_list->ai_addr,":" ,PS_SHOW_PORT, &gc));
+ /* print additional remote addresses */
+ for(ai=info->lsa->remote_list->ai_next;ai;ai=ai->ai_next) {
+ msg(D_LINK_ERRORS,"or from peer address: %s",
+ print_sockaddr_ex(ai->ai_addr,":",PS_SHOW_PORT, &gc));
+ }
+ break;
+ }
+ buf->len = 0;
+ gc_free (&gc);
+}
+
+void
+link_socket_bad_outgoing_addr (void)
+{
+ dmsg (D_READ_WRITE, "TCP/UDP: No outgoing address to send packet");
+}
+
+in_addr_t
+link_socket_current_remote (const struct link_socket_info *info)
+{
+ const struct link_socket_addr *lsa = info->lsa;
+
+/*
+ * This logic supports "redirect-gateway" semantic, which
+ * makes sense only for PF_INET routes over PF_INET endpoints
+ *
+ * Maybe in the future consider PF_INET6 endpoints also ...
+ * by now just ignore it
+ *
+ * For --remote entries with multiple addresses this
+ * only return the actual endpoint we have sucessfully connected to
+ */
+ if (lsa->actual.dest.addr.sa.sa_family != AF_INET)
+ return IPV4_INVALID_ADDR;
+
+ if (link_socket_actual_defined (&lsa->actual))
+ return ntohl (lsa->actual.dest.addr.in4.sin_addr.s_addr);
+ else if (lsa->current_remote)
+ return ntohl (((struct sockaddr_in*)lsa->current_remote->ai_addr)
+ ->sin_addr.s_addr);
+ else
+ return 0;
+}
+
+/*
+ * Return a status string describing socket state.
+ */
+const char *
+socket_stat (const struct link_socket *s, unsigned int rwflags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ if (s)
+ {
+ if (rwflags & EVENT_READ)
+ {
+ buf_printf (&out, "S%s",
+ (s->rwflags_debug & EVENT_READ) ? "R" : "r");
+#ifdef WIN32
+ buf_printf (&out, "%s",
+ overlapped_io_state_ascii (&s->reads));
+#endif
+ }
+ if (rwflags & EVENT_WRITE)
+ {
+ buf_printf (&out, "S%s",
+ (s->rwflags_debug & EVENT_WRITE) ? "W" : "w");
+#ifdef WIN32
+ buf_printf (&out, "%s",
+ overlapped_io_state_ascii (&s->writes));
+#endif
+ }
+ }
+ else
+ {
+ buf_printf (&out, "S?");
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Stream buffer functions, used to packetize a TCP
+ * stream connection.
+ */
+
+static inline void
+stream_buf_reset (struct stream_buf *sb)
+{
+ dmsg (D_STREAM_DEBUG, "STREAM: RESET");
+ sb->residual_fully_formed = false;
+ sb->buf = sb->buf_init;
+ buf_reset (&sb->next);
+ sb->len = -1;
+}
+
+void
+stream_buf_init (struct stream_buf *sb,
+ struct buffer *buf,
+ const unsigned int sockflags,
+ const int proto)
+{
+ sb->buf_init = *buf;
+ sb->maxlen = sb->buf_init.len;
+ sb->buf_init.len = 0;
+ sb->residual = alloc_buf (sb->maxlen);
+ sb->error = false;
+#if PORT_SHARE
+ sb->port_share_state = ((sockflags & SF_PORT_SHARE) && (proto == PROTO_TCP_SERVER))
+ ? PS_ENABLED
+ : PS_DISABLED;
+#endif
+ stream_buf_reset (sb);
+
+ dmsg (D_STREAM_DEBUG, "STREAM: INIT maxlen=%d", sb->maxlen);
+}
+
+static inline void
+stream_buf_set_next (struct stream_buf *sb)
+{
+ /* set up 'next' for next i/o read */
+ sb->next = sb->buf;
+ sb->next.offset = sb->buf.offset + sb->buf.len;
+ sb->next.len = (sb->len >= 0 ? sb->len : sb->maxlen) - sb->buf.len;
+ dmsg (D_STREAM_DEBUG, "STREAM: SET NEXT, buf=[%d,%d] next=[%d,%d] len=%d maxlen=%d",
+ sb->buf.offset, sb->buf.len,
+ sb->next.offset, sb->next.len,
+ sb->len, sb->maxlen);
+ ASSERT (sb->next.len > 0);
+ ASSERT (buf_safe (&sb->buf, sb->next.len));
+}
+
+static inline void
+stream_buf_get_final (struct stream_buf *sb, struct buffer *buf)
+{
+ dmsg (D_STREAM_DEBUG, "STREAM: GET FINAL len=%d",
+ buf_defined (&sb->buf) ? sb->buf.len : -1);
+ ASSERT (buf_defined (&sb->buf));
+ *buf = sb->buf;
+}
+
+static inline void
+stream_buf_get_next (struct stream_buf *sb, struct buffer *buf)
+{
+ dmsg (D_STREAM_DEBUG, "STREAM: GET NEXT len=%d",
+ buf_defined (&sb->next) ? sb->next.len : -1);
+ ASSERT (buf_defined (&sb->next));
+ *buf = sb->next;
+}
+
+bool
+stream_buf_read_setup_dowork (struct link_socket* sock)
+{
+ if (sock->stream_buf.residual.len && !sock->stream_buf.residual_fully_formed)
+ {
+ ASSERT (buf_copy (&sock->stream_buf.buf, &sock->stream_buf.residual));
+ ASSERT (buf_init (&sock->stream_buf.residual, 0));
+ sock->stream_buf.residual_fully_formed = stream_buf_added (&sock->stream_buf, 0);
+ dmsg (D_STREAM_DEBUG, "STREAM: RESIDUAL FULLY FORMED [%s], len=%d",
+ sock->stream_buf.residual_fully_formed ? "YES" : "NO",
+ sock->stream_buf.residual.len);
+ }
+
+ if (!sock->stream_buf.residual_fully_formed)
+ stream_buf_set_next (&sock->stream_buf);
+ return !sock->stream_buf.residual_fully_formed;
+}
+
+bool
+stream_buf_added (struct stream_buf *sb,
+ int length_added)
+{
+ dmsg (D_STREAM_DEBUG, "STREAM: ADD length_added=%d", length_added);
+ if (length_added > 0)
+ sb->buf.len += length_added;
+
+ /* if length unknown, see if we can get the length prefix from
+ the head of the buffer */
+ if (sb->len < 0 && sb->buf.len >= (int) sizeof (packet_size_type))
+ {
+ packet_size_type net_size;
+
+#if PORT_SHARE
+ if (sb->port_share_state == PS_ENABLED)
+ {
+ if (!is_openvpn_protocol (&sb->buf))
+ {
+ msg (D_STREAM_ERRORS, "Non-OpenVPN client protocol detected");
+ sb->port_share_state = PS_FOREIGN;
+ sb->error = true;
+ return false;
+ }
+ else
+ sb->port_share_state = PS_DISABLED;
+ }
+#endif
+
+ ASSERT (buf_read (&sb->buf, &net_size, sizeof (net_size)));
+ sb->len = ntohps (net_size);
+
+ if (sb->len < 1 || sb->len > sb->maxlen)
+ {
+ msg (M_WARN, "WARNING: Bad encapsulated packet length from peer (%d), which must be > 0 and <= %d -- please ensure that --tun-mtu or --link-mtu is equal on both peers -- this condition could also indicate a possible active attack on the TCP link -- [Attempting restart...]", sb->len, sb->maxlen);
+ stream_buf_reset (sb);
+ sb->error = true;
+ return false;
+ }
+ }
+
+ /* is our incoming packet fully read? */
+ if (sb->len > 0 && sb->buf.len >= sb->len)
+ {
+ /* save any residual data that's part of the next packet */
+ ASSERT (buf_init (&sb->residual, 0));
+ if (sb->buf.len > sb->len)
+ ASSERT (buf_copy_excess (&sb->residual, &sb->buf, sb->len));
+ dmsg (D_STREAM_DEBUG, "STREAM: ADD returned TRUE, buf_len=%d, residual_len=%d",
+ BLEN (&sb->buf),
+ BLEN (&sb->residual));
+ return true;
+ }
+ else
+ {
+ dmsg (D_STREAM_DEBUG, "STREAM: ADD returned FALSE (have=%d need=%d)", sb->buf.len, sb->len);
+ stream_buf_set_next (sb);
+ return false;
+ }
+}
+
+void
+stream_buf_close (struct stream_buf* sb)
+{
+ free_buf (&sb->residual);
+}
+
+/*
+ * The listen event is a special event whose sole purpose is
+ * to tell us that there's a new incoming connection on a
+ * TCP socket, for use in server mode.
+ */
+event_t
+socket_listen_event_handle (struct link_socket *s)
+{
+#ifdef WIN32
+ if (!defined_net_event_win32 (&s->listen_handle))
+ init_net_event_win32 (&s->listen_handle, FD_ACCEPT, s->sd, 0);
+ return &s->listen_handle;
+#else
+ return s->sd;
+#endif
+}
+
+/*
+ * Format IP addresses in ascii
+ */
+
+const char *
+print_sockaddr_ex (const struct sockaddr *sa,
+ const char* separator,
+ const unsigned int flags,
+ struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (128, gc);
+ bool addr_is_defined;
+ char hostaddr[NI_MAXHOST] = "";
+ char servname[NI_MAXSERV] = "";
+ int status;
+
+ socklen_t salen;
+ switch(sa->sa_family)
+ {
+ case AF_INET:
+ buf_puts (&out, "[AF_INET]");
+ salen = sizeof (struct sockaddr_in);
+ addr_is_defined = ((struct sockaddr_in*) sa)->sin_addr.s_addr != 0;
+ break;
+ case AF_INET6:
+ buf_puts (&out, "[AF_INET6]");
+ salen = sizeof (struct sockaddr_in6);
+ addr_is_defined = !IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6*) sa)->sin6_addr);
+ break;
+ case AF_UNSPEC:
+ return "[AF_UNSPEC]";
+ default:
+ ASSERT(0);
+ }
+
+ status = getnameinfo(sa, salen, hostaddr, sizeof (hostaddr),
+ servname, sizeof(servname), NI_NUMERICHOST | NI_NUMERICSERV);
+
+ if(status!=0) {
+ buf_printf(&out,"[nameinfo() err: %s]",gai_strerror(status));
+ return BSTR(&out);
+ }
+
+ if (!(flags & PS_DONT_SHOW_ADDR))
+ {
+ if (addr_is_defined)
+ buf_puts (&out, hostaddr);
+ else
+ buf_puts (&out, "[undef]");
+ }
+
+ if ((flags & PS_SHOW_PORT) || (flags & PS_SHOW_PORT_IF_DEFINED))
+ {
+ if (separator)
+ buf_puts (&out, separator);
+
+ buf_puts (&out, servname);
+ }
+
+ return BSTR (&out);
+}
+
+const char *
+print_link_socket_actual (const struct link_socket_actual *act, struct gc_arena *gc)
+{
+ return print_link_socket_actual_ex (act, ":", PS_SHOW_PORT|PS_SHOW_PKTINFO, gc);
+}
+
+#ifndef IF_NAMESIZE
+#define IF_NAMESIZE 16
+#endif
+
+const char *
+print_link_socket_actual_ex (const struct link_socket_actual *act,
+ const char *separator,
+ const unsigned int flags,
+ struct gc_arena *gc)
+{
+ if (act)
+ {
+ char ifname[IF_NAMESIZE] = "[undef]";
+ struct buffer out = alloc_buf_gc (128, gc);
+ buf_printf (&out, "%s", print_sockaddr_ex (&act->dest.addr.sa, separator, flags, gc));
+#if ENABLE_IP_PKTINFO
+ if ((flags & PS_SHOW_PKTINFO) && addr_defined_ipi(act))
+ {
+ switch(act->dest.addr.sa.sa_family)
+ {
+ case AF_INET:
+ {
+ struct openvpn_sockaddr sa;
+ CLEAR (sa);
+ sa.addr.in4.sin_family = AF_INET;
+#ifdef IP_PKTINFO
+ sa.addr.in4.sin_addr = act->pi.in4.ipi_spec_dst;
+ if_indextoname(act->pi.in4.ipi_ifindex, ifname);
+#elif defined(IP_RECVDSTADDR)
+ sa.addr.in4.sin_addr = act->pi.in4;
+ ifname[0]=0;
+#else
+#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
+#endif
+ buf_printf (&out, " (via %s%%%s)",
+ print_sockaddr_ex (&sa.addr.sa, separator, 0, gc),
+ ifname);
+ }
+ break;
+ case AF_INET6:
+ {
+ struct sockaddr_in6 sin6;
+ char buf[INET6_ADDRSTRLEN] = "[undef]";
+ CLEAR(sin6);
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_addr = act->pi.in6.ipi6_addr;
+ if_indextoname(act->pi.in6.ipi6_ifindex, ifname);
+ if (getnameinfo((struct sockaddr *)&sin6, sizeof (struct sockaddr_in6),
+ buf, sizeof (buf), NULL, 0, NI_NUMERICHOST) == 0)
+ buf_printf (&out, " (via %s%%%s)", buf, ifname);
+ else
+ buf_printf (&out, " (via [getnameinfo() err]%%%s)", ifname);
+ }
+ break;
+ }
+ }
+#endif
+ return BSTR (&out);
+ }
+ else
+ return "[NULL]";
+}
+
+/*
+ * Convert an in_addr_t in host byte order
+ * to an ascii dotted quad.
+ */
+const char *
+print_in_addr_t (in_addr_t addr, unsigned int flags, struct gc_arena *gc)
+{
+ struct in_addr ia;
+ struct buffer out = alloc_buf_gc (64, gc);
+
+ if (addr || !(flags & IA_EMPTY_IF_UNDEF))
+ {
+ CLEAR (ia);
+ ia.s_addr = (flags & IA_NET_ORDER) ? addr : htonl (addr);
+
+ buf_printf (&out, "%s", inet_ntoa (ia));
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Convert an in6_addr in host byte order
+ * to an ascii representation of an IPv6 address
+ */
+const char *
+print_in6_addr (struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ char tmp_out_buf[64]; /* inet_ntop wants pointer to buffer */
+
+ if ( memcmp(&a6, &in6addr_any, sizeof(a6)) != 0 ||
+ !(flags & IA_EMPTY_IF_UNDEF))
+ {
+ inet_ntop (AF_INET6, &a6, tmp_out_buf, sizeof(tmp_out_buf)-1);
+ buf_printf (&out, "%s", tmp_out_buf );
+ }
+ return BSTR (&out);
+}
+
+#ifndef UINT8_MAX
+# define UINT8_MAX 0xff
+#endif
+
+/* add some offset to an ipv6 address
+ * (add in steps of 8 bits, taking overflow into next round)
+ */
+struct in6_addr add_in6_addr( struct in6_addr base, uint32_t add )
+{
+ int i;
+
+ for( i=15; i>=0 && add > 0 ; i-- )
+ {
+ register int carry;
+ register uint32_t h;
+
+ h = (unsigned char) base.s6_addr[i];
+ base.s6_addr[i] = (h+add) & UINT8_MAX;
+
+ /* using explicit carry for the 8-bit additions will catch
+ * 8-bit and(!) 32-bit overruns nicely
+ */
+ carry = ((h & 0xff) + (add & 0xff)) >> 8;
+ add = (add>>8) + carry;
+ }
+ return base;
+}
+
+/* set environmental variables for ip/port in *addr */
+void
+setenv_sockaddr (struct env_set *es, const char *name_prefix, const struct openvpn_sockaddr *addr, const unsigned int flags)
+{
+ char name_buf[256];
+
+ char buf[128];
+ switch(addr->addr.sa.sa_family)
+ {
+ case AF_INET:
+ if (flags & SA_IP_PORT)
+ openvpn_snprintf (name_buf, sizeof (name_buf), "%s_ip", name_prefix);
+ else
+ openvpn_snprintf (name_buf, sizeof (name_buf), "%s", name_prefix);
+
+ setenv_str (es, name_buf, inet_ntoa (addr->addr.in4.sin_addr));
+
+ if ((flags & SA_IP_PORT) && addr->addr.in4.sin_port)
+ {
+ openvpn_snprintf (name_buf, sizeof (name_buf), "%s_port", name_prefix);
+ setenv_int (es, name_buf, ntohs (addr->addr.in4.sin_port));
+ }
+ break;
+ case AF_INET6:
+ openvpn_snprintf (name_buf, sizeof (name_buf), "%s_ip6", name_prefix);
+ getnameinfo(&addr->addr.sa, sizeof (struct sockaddr_in6),
+ buf, sizeof(buf), NULL, 0, NI_NUMERICHOST);
+ setenv_str (es, name_buf, buf);
+
+ if ((flags & SA_IP_PORT) && addr->addr.in6.sin6_port)
+ {
+ openvpn_snprintf (name_buf, sizeof (name_buf), "%s_port", name_prefix);
+ setenv_int (es, name_buf, ntohs (addr->addr.in6.sin6_port));
+ }
+ break;
+ }
+}
+
+void
+setenv_in_addr_t (struct env_set *es, const char *name_prefix, in_addr_t addr, const unsigned int flags)
+{
+ if (addr || !(flags & SA_SET_IF_NONZERO))
+ {
+ struct openvpn_sockaddr si;
+ CLEAR (si);
+ si.addr.in4.sin_family = AF_INET;
+ si.addr.in4.sin_addr.s_addr = htonl (addr);
+ setenv_sockaddr (es, name_prefix, &si, flags);
+ }
+}
+
+void
+setenv_link_socket_actual (struct env_set *es,
+ const char *name_prefix,
+ const struct link_socket_actual *act,
+ const unsigned int flags)
+{
+ setenv_sockaddr (es, name_prefix, &act->dest, flags);
+}
+
+/*
+ * Convert protocol names between index and ascii form.
+ */
+
+struct proto_names {
+ const char *short_form;
+ const char *display_form;
+ sa_family_t proto_af;
+ int proto;
+};
+
+/* Indexed by PROTO_x */
+static const struct proto_names proto_names[] = {
+ {"proto-uninitialized", "proto-NONE", AF_UNSPEC, PROTO_NONE},
+ /* try IPv4 and IPv6 (client), bind dual-stack (server) */
+ {"udp", "UDP", AF_UNSPEC, PROTO_UDP},
+ {"tcp-server", "TCP_SERVER", AF_UNSPEC, PROTO_TCP_SERVER},
+ {"tcp-client", "TCP_CLIENT", AF_UNSPEC, PROTO_TCP_CLIENT},
+ {"tcp", "TCP", AF_UNSPEC, PROTO_TCP},
+ /* force IPv4 */
+ {"udp4", "UDPv4", AF_INET, PROTO_UDP},
+ {"tcp4-server","TCPv4_SERVER", AF_INET, PROTO_TCP_SERVER},
+ {"tcp4-client","TCPv4_CLIENT", AF_INET, PROTO_TCP_CLIENT},
+ {"tcp4", "TCPv4", AF_INET, PROTO_TCP},
+ /* force IPv6 */
+ {"udp6" ,"UDPv6", AF_INET6, PROTO_UDP},
+ {"tcp6-server","TCPv6_SERVER", AF_INET6, PROTO_TCP_SERVER},
+ {"tcp6-client","TCPv6_CLIENT", AF_INET6, PROTO_TCP_CLIENT},
+ {"tcp6" ,"TCPv6", AF_INET6, PROTO_TCP},
+};
+
+bool
+proto_is_net(int proto)
+{
+ if (proto < 0 || proto >= PROTO_N)
+ ASSERT(0);
+ return proto != PROTO_NONE;
+}
+bool
+proto_is_dgram(int proto)
+{
+ return proto_is_udp(proto);
+}
+
+bool
+proto_is_udp(int proto)
+{
+ if (proto < 0 || proto >= PROTO_N)
+ ASSERT(0);
+ return proto == PROTO_UDP;
+}
+
+bool
+proto_is_tcp(int proto)
+{
+ if (proto < 0 || proto >= PROTO_N)
+ ASSERT(0);
+ return proto == PROTO_TCP_CLIENT || proto == PROTO_TCP_SERVER || proto == PROTO_TCP_CLIENT;
+}
+
+int
+ascii2proto (const char* proto_name)
+{
+ int i;
+ for (i = 0; i < SIZE (proto_names); ++i)
+ if (!strcmp (proto_name, proto_names[i].short_form))
+ return proto_names[i].proto;
+ return -1;
+}
+
+sa_family_t
+ascii2af (const char* proto_name)
+{
+ int i;
+ for (i = 0; i < SIZE (proto_names); ++i)
+ if (!strcmp (proto_name, proto_names[i].short_form))
+ return proto_names[i].proto_af;
+ return 0;
+}
+
+const char *
+proto2ascii (int proto, sa_family_t af, bool display_form)
+{
+ unsigned int i;
+ for (i = 0; i < SIZE (proto_names); ++i)
+ {
+ if(proto_names[i].proto_af == af && proto_names[i].proto == proto)
+ {
+ if(display_form)
+ return proto_names[i].display_form;
+ else
+ return proto_names[i].short_form;
+ }
+ }
+
+ return "[unknown protocol]";
+}
+
+const char *
+proto2ascii_all (struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ int i;
+
+ for (i = 0; i < SIZE (proto_names); ++i)
+ {
+ if (i)
+ buf_printf(&out, " ");
+ buf_printf(&out, "[%s]", proto_names[i].short_form);
+ }
+ return BSTR (&out);
+}
+
+const char *
+addr_family_name (int af)
+{
+ switch (af)
+ {
+ case AF_INET: return "AF_INET";
+ case AF_INET6: return "AF_INET6";
+ }
+ return "AF_UNSPEC";
+}
+
+/*
+ * Given a local proto, return local proto
+ * if !remote, or compatible remote proto
+ * if remote.
+ *
+ * This is used for options compatibility
+ * checking.
+ *
+ * IPv6 and IPv4 protocols are comptabile but OpenVPN
+ * has always sent UDPv4, TCPv4 over the wire. Keep these
+ * strings for backward compatbility
+ */
+const char*
+proto_remote (int proto, bool remote)
+{
+ ASSERT (proto >= 0 && proto < PROTO_N);
+ if (proto == PROTO_UDP)
+ return "UDPv4";
+
+ if ( (remote && proto == PROTO_TCP_CLIENT) ||
+ (!remote && proto == PROTO_TCP_SERVER))
+ return "TCPv4_SERVER";
+ if ( (remote && proto == PROTO_TCP_SERVER) ||
+ (!remote && proto == PROTO_TCP_CLIENT))
+ return "TCPv4_CLIENT";
+
+ ASSERT (0);
+ return ""; /* Make the compiler happy */
+}
+
+/*
+ * Bad incoming address lengths that differ from what
+ * we expect are considered to be fatal errors.
+ */
+void
+bad_address_length (int actual, int expected)
+{
+ msg (M_FATAL, "ERROR: received strange incoming packet with an address length of %d -- we only accept address lengths of %d.",
+ actual,
+ expected);
+}
+
+/*
+ * Socket Read Routines
+ */
+
+int
+link_socket_read_tcp (struct link_socket *sock,
+ struct buffer *buf)
+{
+ int len = 0;
+
+ if (!sock->stream_buf.residual_fully_formed)
+ {
+#ifdef WIN32
+ len = socket_finalize (sock->sd, &sock->reads, buf, NULL);
+#else
+ struct buffer frag;
+ stream_buf_get_next (&sock->stream_buf, &frag);
+ len = recv (sock->sd, BPTR (&frag), BLEN (&frag), MSG_NOSIGNAL);
+#endif
+
+ if (!len)
+ sock->stream_reset = true;
+ if (len <= 0)
+ return buf->len = len;
+ }
+
+ if (sock->stream_buf.residual_fully_formed
+ || stream_buf_added (&sock->stream_buf, len)) /* packet complete? */
+ {
+ stream_buf_get_final (&sock->stream_buf, buf);
+ stream_buf_reset (&sock->stream_buf);
+ return buf->len;
+ }
+ else
+ return buf->len = 0; /* no error, but packet is still incomplete */
+}
+
+#ifndef WIN32
+
+#if ENABLE_IP_PKTINFO
+
+#pragma pack(1) /* needed to keep structure size consistent for 32 vs. 64-bit architectures */
+struct openvpn_in4_pktinfo
+{
+ struct cmsghdr cmsghdr;
+#ifdef HAVE_IN_PKTINFO
+ struct in_pktinfo pi4;
+#elif defined(IP_RECVDSTADDR)
+ struct in_addr pi4;
+#endif
+};
+struct openvpn_in6_pktinfo
+{
+ struct cmsghdr cmsghdr;
+ struct in6_pktinfo pi6;
+};
+
+union openvpn_pktinfo {
+ struct openvpn_in4_pktinfo msgpi4;
+ struct openvpn_in6_pktinfo msgpi6;
+};
+#pragma pack()
+
+static socklen_t
+link_socket_read_udp_posix_recvmsg (struct link_socket *sock,
+ struct buffer *buf,
+ int maxsize,
+ struct link_socket_actual *from)
+{
+ struct iovec iov;
+ union openvpn_pktinfo opi;
+ struct msghdr mesg;
+ socklen_t fromlen = sizeof (from->dest.addr);
+
+ iov.iov_base = BPTR (buf);
+ iov.iov_len = maxsize;
+ mesg.msg_iov = &iov;
+ mesg.msg_iovlen = 1;
+ mesg.msg_name = &from->dest.addr;
+ mesg.msg_namelen = fromlen;
+ mesg.msg_control = &opi;
+ mesg.msg_controllen = sizeof opi;
+ buf->len = recvmsg (sock->sd, &mesg, 0);
+ if (buf->len >= 0)
+ {
+ struct cmsghdr *cmsg;
+ fromlen = mesg.msg_namelen;
+ cmsg = CMSG_FIRSTHDR (&mesg);
+ if (cmsg != NULL
+ && CMSG_NXTHDR (&mesg, cmsg) == NULL
+#ifdef IP_PKTINFO
+ && cmsg->cmsg_level == SOL_IP
+ && cmsg->cmsg_type == IP_PKTINFO
+#elif defined(IP_RECVDSTADDR)
+ && cmsg->cmsg_level == IPPROTO_IP
+ && cmsg->cmsg_type == IP_RECVDSTADDR
+#else
+#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
+#endif
+ && cmsg->cmsg_len >= sizeof (struct openvpn_in4_pktinfo))
+ {
+#ifdef IP_PKTINFO
+ struct in_pktinfo *pkti = (struct in_pktinfo *) CMSG_DATA (cmsg);
+ from->pi.in4.ipi_ifindex = pkti->ipi_ifindex;
+ from->pi.in4.ipi_spec_dst = pkti->ipi_spec_dst;
+#elif defined(IP_RECVDSTADDR)
+ from->pi.in4 = *(struct in_addr*) CMSG_DATA (cmsg);
+#else
+#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
+#endif
+ }
+ else if (cmsg != NULL
+ && CMSG_NXTHDR (&mesg, cmsg) == NULL
+ && cmsg->cmsg_level == IPPROTO_IPV6
+ && cmsg->cmsg_type == IPV6_PKTINFO
+ && cmsg->cmsg_len >= sizeof (struct openvpn_in6_pktinfo))
+ {
+ struct in6_pktinfo *pkti6 = (struct in6_pktinfo *) CMSG_DATA (cmsg);
+ from->pi.in6.ipi6_ifindex = pkti6->ipi6_ifindex;
+ from->pi.in6.ipi6_addr = pkti6->ipi6_addr;
+ }
+ else if (cmsg != NULL)
+ {
+ msg(M_WARN, "CMSG received that cannot be parsed (cmsg_level=%d, cmsg_type=%d, cmsg=len=%d)", (int)cmsg->cmsg_level, (int)cmsg->cmsg_type, (int)cmsg->cmsg_len );
+ }
+ }
+
+ return fromlen;
+}
+#endif
+
+int
+link_socket_read_udp_posix (struct link_socket *sock,
+ struct buffer *buf,
+ int maxsize,
+ struct link_socket_actual *from)
+{
+ socklen_t fromlen = sizeof (from->dest.addr);
+ socklen_t expectedlen = af_addr_size(sock->info.af);
+ addr_zero_host(&from->dest);
+ ASSERT (buf_safe (buf, maxsize));
+#if ENABLE_IP_PKTINFO
+ /* Both PROTO_UDPv4 and PROTO_UDPv6 */
+ if (sock->info.proto == PROTO_UDP && sock->sockflags & SF_USE_IP_PKTINFO)
+ fromlen = link_socket_read_udp_posix_recvmsg (sock, buf, maxsize, from);
+ else
+#endif
+ buf->len = recvfrom (sock->sd, BPTR (buf), maxsize, 0,
+ &from->dest.addr.sa, &fromlen);
+ if (buf->len >= 0 && expectedlen && fromlen != expectedlen)
+ bad_address_length (fromlen, expectedlen);
+ return buf->len;
+}
+
+#endif
+
+/*
+ * Socket Write Routines
+ */
+
+int
+link_socket_write_tcp (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+ packet_size_type len = BLEN (buf);
+ dmsg (D_STREAM_DEBUG, "STREAM: WRITE %d offset=%d", (int)len, buf->offset);
+ ASSERT (len <= sock->stream_buf.maxlen);
+ len = htonps (len);
+ ASSERT (buf_write_prepend (buf, &len, sizeof (len)));
+#ifdef WIN32
+ return link_socket_write_win32 (sock, buf, to);
+#else
+ return link_socket_write_tcp_posix (sock, buf, to);
+#endif
+}
+
+#if ENABLE_IP_PKTINFO
+
+size_t
+link_socket_write_udp_posix_sendmsg (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+ struct iovec iov;
+ struct msghdr mesg;
+ struct cmsghdr *cmsg;
+ union openvpn_pktinfo opi;
+
+ iov.iov_base = BPTR (buf);
+ iov.iov_len = BLEN (buf);
+ mesg.msg_iov = &iov;
+ mesg.msg_iovlen = 1;
+ switch (to->dest.addr.sa.sa_family)
+ {
+ case AF_INET:
+ {
+ mesg.msg_name = &to->dest.addr.sa;
+ mesg.msg_namelen = sizeof (struct sockaddr_in);
+ mesg.msg_control = &opi;
+ mesg.msg_flags = 0;
+#ifdef HAVE_IN_PKTINFO
+ mesg.msg_controllen = sizeof (struct openvpn_in4_pktinfo);
+ cmsg = CMSG_FIRSTHDR (&mesg);
+ cmsg->cmsg_len = sizeof (struct openvpn_in4_pktinfo);
+ cmsg->cmsg_level = SOL_IP;
+ cmsg->cmsg_type = IP_PKTINFO;
+ {
+ struct in_pktinfo *pkti;
+ pkti = (struct in_pktinfo *) CMSG_DATA (cmsg);
+ pkti->ipi_ifindex = to->pi.in4.ipi_ifindex;
+ pkti->ipi_spec_dst = to->pi.in4.ipi_spec_dst;
+ pkti->ipi_addr.s_addr = 0;
+ }
+#elif defined(IP_RECVDSTADDR)
+ ASSERT( CMSG_SPACE(sizeof (struct in_addr)) <= sizeof(opi) );
+ mesg.msg_controllen = CMSG_SPACE(sizeof (struct in_addr));
+ cmsg = CMSG_FIRSTHDR (&mesg);
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
+ cmsg->cmsg_level = IPPROTO_IP;
+ cmsg->cmsg_type = IP_RECVDSTADDR;
+ *(struct in_addr *) CMSG_DATA (cmsg) = to->pi.in4;
+#else
+#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
+#endif
+ break;
+ }
+ case AF_INET6:
+ {
+ struct in6_pktinfo *pkti6;
+ mesg.msg_name = &to->dest.addr.sa;
+ mesg.msg_namelen = sizeof (struct sockaddr_in6);
+ mesg.msg_control = &opi;
+ mesg.msg_controllen = sizeof (struct openvpn_in6_pktinfo);
+ mesg.msg_flags = 0;
+ cmsg = CMSG_FIRSTHDR (&mesg);
+ cmsg->cmsg_len = sizeof (struct openvpn_in6_pktinfo);
+ cmsg->cmsg_level = IPPROTO_IPV6;
+ cmsg->cmsg_type = IPV6_PKTINFO;
+ pkti6 = (struct in6_pktinfo *) CMSG_DATA (cmsg);
+ pkti6->ipi6_ifindex = to->pi.in6.ipi6_ifindex;
+ pkti6->ipi6_addr = to->pi.in6.ipi6_addr;
+ break;
+ }
+ default: ASSERT(0);
+ }
+ return sendmsg (sock->sd, &mesg, 0);
+}
+
+#endif
+
+/*
+ * Win32 overlapped socket I/O functions.
+ */
+
+#ifdef WIN32
+
+int
+socket_recv_queue (struct link_socket *sock, int maxsize)
+{
+ if (sock->reads.iostate == IOSTATE_INITIAL)
+ {
+ WSABUF wsabuf[1];
+ int status;
+
+ /* reset buf to its initial state */
+ if (proto_is_udp(sock->info.proto))
+ {
+ sock->reads.buf = sock->reads.buf_init;
+ }
+ else if (proto_is_tcp(sock->info.proto))
+ {
+ stream_buf_get_next (&sock->stream_buf, &sock->reads.buf);
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+ /* Win32 docs say it's okay to allocate the wsabuf on the stack */
+ wsabuf[0].buf = BPTR (&sock->reads.buf);
+ wsabuf[0].len = maxsize ? maxsize : BLEN (&sock->reads.buf);
+
+ /* check for buffer overflow */
+ ASSERT (wsabuf[0].len <= BLEN (&sock->reads.buf));
+
+ /* the overlapped read will signal this event on I/O completion */
+ ASSERT (ResetEvent (sock->reads.overlapped.hEvent));
+ sock->reads.flags = 0;
+
+ if (proto_is_udp(sock->info.proto))
+ {
+ sock->reads.addr_defined = true;
+ if (sock->info.af == AF_INET)
+ sock->reads.addrlen = sizeof (sock->reads.addr);
+ else
+ sock->reads.addrlen = sizeof (sock->reads.addr6);
+ status = WSARecvFrom(
+ sock->sd,
+ wsabuf,
+ 1,
+ &sock->reads.size,
+ &sock->reads.flags,
+ (struct sockaddr *) &sock->reads.addr,
+ &sock->reads.addrlen,
+ &sock->reads.overlapped,
+ NULL);
+ }
+ else if (proto_is_tcp(sock->info.proto))
+ {
+ sock->reads.addr_defined = false;
+ status = WSARecv(
+ sock->sd,
+ wsabuf,
+ 1,
+ &sock->reads.size,
+ &sock->reads.flags,
+ &sock->reads.overlapped,
+ NULL);
+ }
+ else
+ {
+ status = 0;
+ ASSERT (0);
+ }
+
+ if (!status) /* operation completed immediately? */
+ {
+ int addrlen = af_addr_size(sock->info.lsa->local.addr.sa.sa_family);
+ if (sock->reads.addr_defined && sock->reads.addrlen != addrlen)
+ bad_address_length (sock->reads.addrlen, addrlen);
+ sock->reads.iostate = IOSTATE_IMMEDIATE_RETURN;
+
+ /* since we got an immediate return, we must signal the event object ourselves */
+ ASSERT (SetEvent (sock->reads.overlapped.hEvent));
+ sock->reads.status = 0;
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Receive immediate return [%d,%d]",
+ (int) wsabuf[0].len,
+ (int) sock->reads.size);
+ }
+ else
+ {
+ status = WSAGetLastError ();
+ if (status == WSA_IO_PENDING) /* operation queued? */
+ {
+ sock->reads.iostate = IOSTATE_QUEUED;
+ sock->reads.status = status;
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Receive queued [%d]",
+ (int) wsabuf[0].len);
+ }
+ else /* error occurred */
+ {
+ struct gc_arena gc = gc_new ();
+ ASSERT (SetEvent (sock->reads.overlapped.hEvent));
+ sock->reads.iostate = IOSTATE_IMMEDIATE_RETURN;
+ sock->reads.status = status;
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Receive error [%d]: %s",
+ (int) wsabuf[0].len,
+ strerror_win32 (status, &gc));
+ gc_free (&gc);
+ }
+ }
+ }
+ return sock->reads.iostate;
+}
+
+int
+socket_send_queue (struct link_socket *sock, struct buffer *buf, const struct link_socket_actual *to)
+{
+ if (sock->writes.iostate == IOSTATE_INITIAL)
+ {
+ WSABUF wsabuf[1];
+ int status;
+
+ /* make a private copy of buf */
+ sock->writes.buf = sock->writes.buf_init;
+ sock->writes.buf.len = 0;
+ ASSERT (buf_copy (&sock->writes.buf, buf));
+
+ /* Win32 docs say it's okay to allocate the wsabuf on the stack */
+ wsabuf[0].buf = BPTR (&sock->writes.buf);
+ wsabuf[0].len = BLEN (&sock->writes.buf);
+
+ /* the overlapped write will signal this event on I/O completion */
+ ASSERT (ResetEvent (sock->writes.overlapped.hEvent));
+ sock->writes.flags = 0;
+
+ if (proto_is_udp(sock->info.proto))
+ {
+ /* set destination address for UDP writes */
+ sock->writes.addr_defined = true;
+ if (sock->info.af == AF_INET6)
+ {
+ sock->writes.addr6 = to->dest.addr.in6;
+ sock->writes.addrlen = sizeof (sock->writes.addr6);
+ }
+ else
+ {
+ sock->writes.addr = to->dest.addr.in4;
+ sock->writes.addrlen = sizeof (sock->writes.addr);
+ }
+
+ status = WSASendTo(
+ sock->sd,
+ wsabuf,
+ 1,
+ &sock->writes.size,
+ sock->writes.flags,
+ (struct sockaddr *) &sock->writes.addr,
+ sock->writes.addrlen,
+ &sock->writes.overlapped,
+ NULL);
+ }
+ else if (proto_is_tcp(sock->info.proto))
+ {
+ /* destination address for TCP writes was established on connection initiation */
+ sock->writes.addr_defined = false;
+
+ status = WSASend(
+ sock->sd,
+ wsabuf,
+ 1,
+ &sock->writes.size,
+ sock->writes.flags,
+ &sock->writes.overlapped,
+ NULL);
+ }
+ else
+ {
+ status = 0;
+ ASSERT (0);
+ }
+
+ if (!status) /* operation completed immediately? */
+ {
+ sock->writes.iostate = IOSTATE_IMMEDIATE_RETURN;
+
+ /* since we got an immediate return, we must signal the event object ourselves */
+ ASSERT (SetEvent (sock->writes.overlapped.hEvent));
+
+ sock->writes.status = 0;
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Send immediate return [%d,%d]",
+ (int) wsabuf[0].len,
+ (int) sock->writes.size);
+ }
+ else
+ {
+ status = WSAGetLastError ();
+ if (status == WSA_IO_PENDING) /* operation queued? */
+ {
+ sock->writes.iostate = IOSTATE_QUEUED;
+ sock->writes.status = status;
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Send queued [%d]",
+ (int) wsabuf[0].len);
+ }
+ else /* error occurred */
+ {
+ struct gc_arena gc = gc_new ();
+ ASSERT (SetEvent (sock->writes.overlapped.hEvent));
+ sock->writes.iostate = IOSTATE_IMMEDIATE_RETURN;
+ sock->writes.status = status;
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Send error [%d]: %s",
+ (int) wsabuf[0].len,
+ strerror_win32 (status, &gc));
+
+ gc_free (&gc);
+ }
+ }
+ }
+ return sock->writes.iostate;
+}
+
+int
+socket_finalize (SOCKET s,
+ struct overlapped_io *io,
+ struct buffer *buf,
+ struct link_socket_actual *from)
+{
+ int ret = -1;
+ BOOL status;
+
+ switch (io->iostate)
+ {
+ case IOSTATE_QUEUED:
+ status = WSAGetOverlappedResult(
+ s,
+ &io->overlapped,
+ &io->size,
+ FALSE,
+ &io->flags
+ );
+ if (status)
+ {
+ /* successful return for a queued operation */
+ if (buf)
+ *buf = io->buf;
+ ret = io->size;
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Completion success [%d]", ret);
+ }
+ else
+ {
+ /* error during a queued operation */
+ ret = -1;
+ if (WSAGetLastError() != WSA_IO_INCOMPLETE)
+ {
+ /* if no error (i.e. just not finished yet), then DON'T execute this code */
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+ msg (D_WIN32_IO | M_ERRNO, "WIN32 I/O: Socket Completion error");
+ }
+ }
+ break;
+
+ case IOSTATE_IMMEDIATE_RETURN:
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+ if (io->status)
+ {
+ /* error return for a non-queued operation */
+ WSASetLastError (io->status);
+ ret = -1;
+ msg (D_WIN32_IO | M_ERRNO, "WIN32 I/O: Socket Completion non-queued error");
+ }
+ else
+ {
+ /* successful return for a non-queued operation */
+ if (buf)
+ *buf = io->buf;
+ ret = io->size;
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Completion non-queued success [%d]", ret);
+ }
+ break;
+
+ case IOSTATE_INITIAL: /* were we called without proper queueing? */
+ WSASetLastError (WSAEINVAL);
+ ret = -1;
+ dmsg (D_WIN32_IO, "WIN32 I/O: Socket Completion BAD STATE");
+ break;
+
+ default:
+ ASSERT (0);
+ }
+
+ /* return from address if requested */
+ if (from)
+ {
+ if (ret >= 0 && io->addr_defined)
+ {
+ /* TODO(jjo): streamline this mess */
+ /* in this func we dont have relevant info about the PF_ of this
+ * endpoint, as link_socket_actual will be zero for the 1st received packet
+ *
+ * Test for inets PF_ possible sizes
+ */
+ switch (io->addrlen)
+ {
+ case sizeof(struct sockaddr_in):
+ case sizeof(struct sockaddr_in6):
+ /* TODO(jjo): for some reason (?) I'm getting 24,28 for AF_INET6
+ * under WIN32*/
+ case sizeof(struct sockaddr_in6)-4:
+ break;
+ default:
+ bad_address_length (io->addrlen, af_addr_size(io->addr.sin_family));
+ }
+
+ switch (io->addr.sin_family)
+ {
+ case AF_INET:
+ from->dest.addr.in4 = io->addr;
+ break;
+ case AF_INET6:
+ from->dest.addr.in6 = io->addr6;
+ break;
+ }
+ }
+ else
+ CLEAR (from->dest.addr);
+ }
+
+ if (buf)
+ buf->len = ret;
+ return ret;
+}
+
+#endif /* WIN32 */
+
+/*
+ * Socket event notification
+ */
+
+unsigned int
+socket_set (struct link_socket *s,
+ struct event_set *es,
+ unsigned int rwflags,
+ void *arg,
+ unsigned int *persistent)
+{
+ if (s)
+ {
+ if ((rwflags & EVENT_READ) && !stream_buf_read_setup (s))
+ {
+ ASSERT (!persistent);
+ rwflags &= ~EVENT_READ;
+ }
+
+#ifdef WIN32
+ if (rwflags & EVENT_READ)
+ socket_recv_queue (s, 0);
+#endif
+
+ /* if persistent is defined, call event_ctl only if rwflags has changed since last call */
+ if (!persistent || *persistent != rwflags)
+ {
+ event_ctl (es, socket_event_handle (s), rwflags, arg);
+ if (persistent)
+ *persistent = rwflags;
+ }
+
+ s->rwflags_debug = rwflags;
+ }
+ return rwflags;
+}
+
+void
+sd_close (socket_descriptor_t *sd)
+{
+ if (sd && socket_defined (*sd))
+ {
+ openvpn_close_socket (*sd);
+ *sd = SOCKET_UNDEFINED;
+ }
+}
+
+#if UNIX_SOCK_SUPPORT
+
+/*
+ * code for unix domain sockets
+ */
+
+const char *
+sockaddr_unix_name (const struct sockaddr_un *local, const char *null)
+{
+ if (local && local->sun_family == PF_UNIX)
+ return local->sun_path;
+ else
+ return null;
+}
+
+socket_descriptor_t
+create_socket_unix (void)
+{
+ socket_descriptor_t sd;
+
+ if ((sd = socket (PF_UNIX, SOCK_STREAM, 0)) < 0)
+ msg (M_ERR, "Cannot create unix domain socket");
+ return sd;
+}
+
+void
+socket_bind_unix (socket_descriptor_t sd,
+ struct sockaddr_un *local,
+ const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+
+#ifdef HAVE_UMASK
+ const mode_t orig_umask = umask (0);
+#endif
+
+ if (bind (sd, (struct sockaddr *) local, sizeof (struct sockaddr_un)))
+ {
+ const int errnum = openvpn_errno ();
+ msg (M_FATAL, "%s: Socket bind[%d] failed on unix domain socket %s: %s",
+ prefix,
+ (int)sd,
+ sockaddr_unix_name (local, "NULL"),
+ strerror_ts (errnum, &gc));
+ }
+
+#ifdef HAVE_UMASK
+ umask (orig_umask);
+#endif
+
+ gc_free (&gc);
+}
+
+socket_descriptor_t
+socket_accept_unix (socket_descriptor_t sd,
+ struct sockaddr_un *remote)
+{
+ socklen_t remote_len = sizeof (struct sockaddr_un);
+ socket_descriptor_t ret;
+
+ CLEAR (*remote);
+ ret = accept (sd, (struct sockaddr *) remote, &remote_len);
+ return ret;
+}
+
+int
+socket_connect_unix (socket_descriptor_t sd,
+ struct sockaddr_un *remote)
+{
+ int status = connect (sd, (struct sockaddr *) remote, sizeof (struct sockaddr_un));
+ if (status)
+ status = openvpn_errno ();
+ return status;
+}
+
+void
+sockaddr_unix_init (struct sockaddr_un *local, const char *path)
+{
+ local->sun_family = PF_UNIX;
+ strncpynt (local->sun_path, path, sizeof (local->sun_path));
+}
+
+void
+socket_delete_unix (const struct sockaddr_un *local)
+{
+ const char *name = sockaddr_unix_name (local, NULL);
+#ifdef HAVE_UNLINK
+ if (name && strlen (name))
+ unlink (name);
+#endif
+}
+
+bool
+unix_socket_get_peer_uid_gid (const socket_descriptor_t sd, int *uid, int *gid)
+{
+#ifdef HAVE_GETPEEREID
+ uid_t u;
+ gid_t g;
+ if (getpeereid (sd, &u, &g) == -1)
+ return false;
+ if (uid)
+ *uid = u;
+ if (gid)
+ *gid = g;
+ return true;
+#elif defined(SO_PEERCRED)
+ struct ucred peercred;
+ socklen_t so_len = sizeof(peercred);
+ if (getsockopt(sd, SOL_SOCKET, SO_PEERCRED, &peercred, &so_len) == -1)
+ return false;
+ if (uid)
+ *uid = peercred.uid;
+ if (gid)
+ *gid = peercred.gid;
+ return true;
+#else
+ return false;
+#endif
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.h
new file mode 100644
index 00000000..8e157c67
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/socket.h
@@ -0,0 +1,1175 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SOCKET_H
+#define SOCKET_H
+
+#include "buffer.h"
+#include "common.h"
+#include "error.h"
+#include "proto.h"
+#include "mtu.h"
+#include "win32.h"
+#include "event.h"
+#include "proxy.h"
+#include "socks.h"
+#include "misc.h"
+
+/*
+ * OpenVPN's default port number as assigned by IANA.
+ */
+#define OPENVPN_PORT "1194"
+
+/*
+ * Maximum size passed passed to setsockopt SNDBUF/RCVBUF
+ */
+#define SOCKET_SND_RCV_BUF_MAX 1000000
+
+/*
+ * Number of seconds that "resolv-retry infinite"
+ * represents.
+ */
+#define RESOLV_RETRY_INFINITE 1000000000
+
+/*
+ * packet_size_type is used to communicate packet size
+ * over the wire when stream oriented protocols are
+ * being used
+ */
+
+typedef uint16_t packet_size_type;
+
+/* convert a packet_size_type from host to network order */
+#define htonps(x) htons(x)
+
+/* convert a packet_size_type from network to host order */
+#define ntohps(x) ntohs(x)
+
+/* OpenVPN sockaddr struct */
+struct openvpn_sockaddr
+{
+ /*int dummy;*/ /* add offset to force a bug if sa not explicitly dereferenced */
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in4;
+ struct sockaddr_in6 in6;
+ } addr;
+};
+
+/* struct to hold preresolved host names */
+struct cached_dns_entry {
+ const char *hostname;
+ const char *servname;
+ int ai_family;
+ int flags;
+ struct addrinfo *ai;
+ struct cached_dns_entry *next;
+};
+
+/* actual address of remote, based on source address of received packets */
+struct link_socket_actual
+{
+ /*int dummy;*/ /* add offset to force a bug if dest not explicitly dereferenced */
+
+ struct openvpn_sockaddr dest;
+#if ENABLE_IP_PKTINFO
+ union {
+#ifdef HAVE_IN_PKTINFO
+ struct in_pktinfo in4;
+#elif defined(IP_RECVDSTADDR)
+ struct in_addr in4;
+#endif
+ struct in6_pktinfo in6;
+ } pi;
+#endif
+};
+
+/* IP addresses which are persistant across SIGUSR1s */
+struct link_socket_addr
+{
+ struct addrinfo* bind_local;
+ struct addrinfo* remote_list; /* complete remote list */
+ struct addrinfo* current_remote; /* remote used in the
+ current connection attempt */
+ struct link_socket_actual actual; /* reply to this address */
+};
+
+struct link_socket_info
+{
+ struct link_socket_addr *lsa;
+ bool connection_established;
+ const char *ipchange_command;
+ const struct plugin_list *plugins;
+ bool remote_float;
+ int proto; /* Protocol (PROTO_x defined below) */
+ sa_family_t af; /* Address family like AF_INET, AF_INET6 or AF_UNSPEC*/
+ bool bind_ipv6_only;
+ int mtu_changed; /* Set to true when mtu value is changed */
+};
+
+/*
+ * Used to extract packets encapsulated in streams into a buffer,
+ * in this case IP packets embedded in a TCP stream.
+ */
+struct stream_buf
+{
+ struct buffer buf_init;
+ struct buffer residual;
+ int maxlen;
+ bool residual_fully_formed;
+
+ struct buffer buf;
+ struct buffer next;
+ int len; /* -1 if not yet known */
+
+ bool error; /* if true, fatal TCP error has occurred,
+ requiring that connection be restarted */
+#if PORT_SHARE
+# define PS_DISABLED 0
+# define PS_ENABLED 1
+# define PS_FOREIGN 2
+ int port_share_state;
+#endif
+};
+
+/*
+ * Used to set socket buffer sizes
+ */
+struct socket_buffer_size
+{
+ int rcvbuf;
+ int sndbuf;
+};
+
+/*
+ * This is the main socket structure used by OpenVPN. The SOCKET_
+ * defines try to abstract away our implementation differences between
+ * using sockets on Posix vs. Win32.
+ */
+struct link_socket
+{
+ struct link_socket_info info;
+
+ socket_descriptor_t sd;
+ socket_descriptor_t ctrl_sd; /* only used for UDP over Socks */
+
+#ifdef WIN32
+ struct overlapped_io reads;
+ struct overlapped_io writes;
+ struct rw_handle rw_handle;
+ struct rw_handle listen_handle; /* For listening on TCP socket in server mode */
+#endif
+
+ /* used for printing status info only */
+ unsigned int rwflags_debug;
+
+ /* used for long-term queueing of pre-accepted socket listen */
+ bool listen_persistent_queued;
+
+ const char *remote_host;
+ const char *remote_port;
+ const char *local_host;
+ const char *local_port;
+ struct cached_dns_entry *dns_cache;
+ bool bind_local;
+
+# define INETD_NONE 0
+# define INETD_WAIT 1
+# define INETD_NOWAIT 2
+ int inetd;
+
+# define LS_MODE_DEFAULT 0
+# define LS_MODE_TCP_LISTEN 1
+# define LS_MODE_TCP_ACCEPT_FROM 2
+ int mode;
+
+ int resolve_retry_seconds;
+ int connect_timeout;
+ int mtu_discover_type;
+
+ struct socket_buffer_size socket_buffer_sizes;
+
+ int mtu; /* OS discovered MTU, or 0 if unknown */
+
+# define SF_USE_IP_PKTINFO (1<<0)
+# define SF_TCP_NODELAY (1<<1)
+# define SF_PORT_SHARE (1<<2)
+# define SF_HOST_RANDOMIZE (1<<3)
+# define SF_GETADDRINFO_DGRAM (1<<4)
+ unsigned int sockflags;
+ int mark;
+
+ /* for stream sockets */
+ struct stream_buf stream_buf;
+ struct buffer stream_buf_data;
+ bool stream_reset;
+
+ /* HTTP proxy */
+ struct http_proxy_info *http_proxy;
+
+ /* Socks proxy */
+ struct socks_proxy_info *socks_proxy;
+ struct link_socket_actual socks_relay; /* Socks UDP relay address */
+
+ /* The OpenVPN server we will use the proxy to connect to */
+ const char *proxy_dest_host;
+ const char *proxy_dest_port;
+
+#if PASSTOS_CAPABILITY
+ /* used to get/set TOS. */
+#if defined(TARGET_LINUX)
+ uint8_t ptos;
+#else /* all the BSDs, Solaris, MacOS use plain "int" -> see "man ip" there */
+ int ptos;
+#endif
+ bool ptos_defined;
+#endif
+
+#ifdef ENABLE_DEBUG
+ int gremlin; /* --gremlin bits */
+#endif
+};
+
+/*
+ * Some Posix/Win32 differences.
+ */
+
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
+#ifdef WIN32
+
+#define openvpn_close_socket(s) closesocket(s)
+
+int socket_recv_queue (struct link_socket *sock, int maxsize);
+
+int socket_send_queue (struct link_socket *sock,
+ struct buffer *buf,
+ const struct link_socket_actual *to);
+
+int socket_finalize (
+ SOCKET s,
+ struct overlapped_io *io,
+ struct buffer *buf,
+ struct link_socket_actual *from);
+
+#else
+
+#define openvpn_close_socket(s) close(s)
+
+#endif
+
+struct link_socket *link_socket_new (void);
+
+void socket_bind (socket_descriptor_t sd,
+ struct addrinfo *local,
+ int af_family,
+ const char *prefix,
+ bool ipv6only);
+
+int openvpn_connect (socket_descriptor_t sd,
+ const struct sockaddr *remote,
+ int connect_timeout,
+ volatile int *signal_received);
+
+
+
+/*
+ * Initialize link_socket object.
+ */
+
+void
+link_socket_init_phase1 (struct link_socket *sock,
+ const char *local_host,
+ const char *local_port,
+ const char *remote_host,
+ const char *remote_port,
+ struct cached_dns_entry *dns_cache,
+ int proto,
+ sa_family_t af,
+ bool bind_ipv6_only,
+ int mode,
+ const struct link_socket *accept_from,
+ struct http_proxy_info *http_proxy,
+ struct socks_proxy_info *socks_proxy,
+#ifdef ENABLE_DEBUG
+ int gremlin,
+#endif
+ bool bind_local,
+ bool remote_float,
+ int inetd,
+ struct link_socket_addr *lsa,
+ const char *ipchange_command,
+ const struct plugin_list *plugins,
+ int resolve_retry_seconds,
+ int connect_timeout,
+ int mtu_discover_type,
+ int rcvbuf,
+ int sndbuf,
+ int mark,
+ unsigned int sockflags);
+
+void link_socket_init_phase2 (struct link_socket *sock,
+ const struct frame *frame,
+ struct signal_info *sig_info);
+
+void do_preresolve(struct context *c);
+
+void socket_adjust_frame_parameters (struct frame *frame, int proto);
+
+void frame_adjust_path_mtu (struct frame *frame, int pmtu, int proto);
+
+void link_socket_close (struct link_socket *sock);
+
+void sd_close (socket_descriptor_t *sd);
+
+#define PS_SHOW_PORT_IF_DEFINED (1<<0)
+#define PS_SHOW_PORT (1<<1)
+#define PS_SHOW_PKTINFO (1<<2)
+#define PS_DONT_SHOW_ADDR (1<<3)
+
+const char *print_sockaddr_ex (const struct sockaddr *addr,
+ const char* separator,
+ const unsigned int flags,
+ struct gc_arena *gc);
+
+static inline
+const char *print_openvpn_sockaddr_ex (const struct openvpn_sockaddr *addr,
+ const char* separator,
+ const unsigned int flags,
+ struct gc_arena *gc)
+{
+ return print_sockaddr_ex(&addr->addr.sa, separator, flags, gc);
+}
+
+static inline
+const char *print_openvpn_sockaddr (const struct openvpn_sockaddr *addr,
+ struct gc_arena *gc)
+{
+ return print_sockaddr_ex (&addr->addr.sa, ":", PS_SHOW_PORT, gc);
+}
+
+static inline
+const char *print_sockaddr (const struct sockaddr *addr,
+ struct gc_arena *gc)
+{
+ return print_sockaddr_ex (addr, ":", PS_SHOW_PORT, gc);
+}
+
+
+
+const char *print_link_socket_actual_ex (const struct link_socket_actual *act,
+ const char* separator,
+ const unsigned int flags,
+ struct gc_arena *gc);
+
+const char *print_link_socket_actual (const struct link_socket_actual *act,
+ struct gc_arena *gc);
+
+
+#define IA_EMPTY_IF_UNDEF (1<<0)
+#define IA_NET_ORDER (1<<1)
+const char *print_in_addr_t (in_addr_t addr, unsigned int flags, struct gc_arena *gc);
+const char *print_in6_addr (struct in6_addr addr6, unsigned int flags, struct gc_arena *gc);
+struct in6_addr add_in6_addr( struct in6_addr base, uint32_t add );
+
+#define SA_IP_PORT (1<<0)
+#define SA_SET_IF_NONZERO (1<<1)
+void setenv_sockaddr (struct env_set *es,
+ const char *name_prefix,
+ const struct openvpn_sockaddr *addr,
+ const unsigned int flags);
+
+void setenv_in_addr_t (struct env_set *es,
+ const char *name_prefix,
+ in_addr_t addr,
+ const unsigned int flags);
+
+void setenv_link_socket_actual (struct env_set *es,
+ const char *name_prefix,
+ const struct link_socket_actual *act,
+ const unsigned int flags);
+
+void bad_address_length (int actual, int expected);
+
+/* IPV4_INVALID_ADDR: returned by link_socket_current_remote()
+ * to ease redirect-gateway logic for ipv4 tunnels on ipv6 endpoints
+ */
+#define IPV4_INVALID_ADDR 0xffffffff
+in_addr_t link_socket_current_remote (const struct link_socket_info *info);
+
+void link_socket_connection_initiated (const struct buffer *buf,
+ struct link_socket_info *info,
+ const struct link_socket_actual *addr,
+ const char *common_name,
+ struct env_set *es);
+
+void link_socket_bad_incoming_addr (struct buffer *buf,
+ const struct link_socket_info *info,
+ const struct link_socket_actual *from_addr);
+
+void set_actual_address (struct link_socket_actual* actual,
+ struct addrinfo* ai);
+
+void link_socket_bad_outgoing_addr (void);
+
+void setenv_trusted (struct env_set *es, const struct link_socket_info *info);
+
+bool link_socket_update_flags (struct link_socket *ls, unsigned int sockflags);
+void link_socket_update_buffer_sizes (struct link_socket *ls, int rcvbuf, int sndbuf);
+
+/*
+ * Low-level functions
+ */
+
+/* return values of openvpn_inet_aton */
+#define OIA_HOSTNAME 0
+#define OIA_IP 1
+#define OIA_ERROR -1
+int openvpn_inet_aton (const char *dotted_quad, struct in_addr *addr);
+
+/* integrity validation on pulled options */
+bool ip_addr_dotted_quad_safe (const char *dotted_quad);
+bool ip_or_dns_addr_safe (const char *addr, const bool allow_fqdn);
+bool mac_addr_safe (const char *mac_addr);
+bool ipv6_addr_safe (const char *ipv6_text_addr);
+
+socket_descriptor_t create_socket_tcp (struct addrinfo*);
+
+socket_descriptor_t socket_do_accept (socket_descriptor_t sd,
+ struct link_socket_actual *act,
+ const bool nowait);
+/*
+ * proto related
+ */
+bool proto_is_net(int proto);
+bool proto_is_dgram(int proto);
+bool proto_is_udp(int proto);
+bool proto_is_tcp(int proto);
+
+
+#if UNIX_SOCK_SUPPORT
+
+socket_descriptor_t create_socket_unix (void);
+
+void socket_bind_unix (socket_descriptor_t sd,
+ struct sockaddr_un *local,
+ const char *prefix);
+
+socket_descriptor_t socket_accept_unix (socket_descriptor_t sd,
+ struct sockaddr_un *remote);
+
+int socket_connect_unix (socket_descriptor_t sd,
+ struct sockaddr_un *remote);
+
+void sockaddr_unix_init (struct sockaddr_un *local, const char *path);
+
+const char *sockaddr_unix_name (const struct sockaddr_un *local, const char *null);
+
+void socket_delete_unix (const struct sockaddr_un *local);
+
+bool unix_socket_get_peer_uid_gid (const socket_descriptor_t sd, int *uid, int *gid);
+
+#endif
+
+/*
+ * DNS resolution
+ */
+
+#define GETADDR_RESOLVE (1<<0)
+#define GETADDR_FATAL (1<<1)
+#define GETADDR_HOST_ORDER (1<<2)
+#define GETADDR_MENTION_RESOLVE_RETRY (1<<3)
+#define GETADDR_FATAL_ON_SIGNAL (1<<4)
+#define GETADDR_WARN_ON_SIGNAL (1<<5)
+#define GETADDR_MSG_VIRT_OUT (1<<6)
+#define GETADDR_TRY_ONCE (1<<7)
+#define GETADDR_UPDATE_MANAGEMENT_STATE (1<<8)
+#define GETADDR_RANDOMIZE (1<<9)
+#define GETADDR_PASSIVE (1<<10)
+#define GETADDR_DATAGRAM (1<<11)
+
+#define GETADDR_CACHE_MASK (GETADDR_DATAGRAM|GETADDR_PASSIVE)
+
+in_addr_t getaddr (unsigned int flags,
+ const char *hostname,
+ int resolve_retry_seconds,
+ bool *succeeded,
+ volatile int *signal_received);
+
+int openvpn_getaddrinfo (unsigned int flags,
+ const char *hostname,
+ const char *servname,
+ int resolve_retry_seconds,
+ volatile int *signal_received,
+ int ai_family,
+ struct addrinfo **res);
+
+/*
+ * Transport protocol naming and other details.
+ */
+
+/*
+ * Use enum's instead of #define to allow for easier
+ * optional proto support
+ */
+enum proto_num {
+ PROTO_NONE, /* catch for uninitialized */
+ PROTO_UDP,
+ PROTO_TCP,
+ PROTO_TCP_SERVER,
+ PROTO_TCP_CLIENT,
+ PROTO_N
+};
+
+int ascii2proto (const char* proto_name);
+sa_family_t ascii2af (const char* proto_name);
+const char *proto2ascii (int proto, sa_family_t af, bool display_form);
+const char *proto2ascii_all (struct gc_arena *gc);
+const char *proto_remote (int proto, bool remote);
+const char *addr_family_name(int af);
+
+/*
+ * Overhead added to packets by various protocols.
+ */
+#define IPv4_UDP_HEADER_SIZE 28
+#define IPv4_TCP_HEADER_SIZE 40
+#define IPv6_UDP_HEADER_SIZE 48
+#define IPv6_TCP_HEADER_SIZE 60
+
+extern const int proto_overhead[];
+
+static inline int
+datagram_overhead (int proto)
+{
+ ASSERT (proto >= 0 && proto < PROTO_N);
+ return proto_overhead [proto];
+}
+
+/*
+ * Misc inline functions
+ */
+
+static inline bool
+link_socket_proto_connection_oriented (int proto)
+{
+ return !proto_is_dgram(proto);
+}
+
+static inline bool
+link_socket_connection_oriented (const struct link_socket *sock)
+{
+ if (sock)
+ return link_socket_proto_connection_oriented (sock->info.proto);
+ else
+ return false;
+}
+
+static inline bool
+addr_defined (const struct openvpn_sockaddr *addr)
+{
+ if (!addr) return 0;
+ switch (addr->addr.sa.sa_family) {
+ case AF_INET: return addr->addr.in4.sin_addr.s_addr != 0;
+ case AF_INET6: return !IN6_IS_ADDR_UNSPECIFIED(&addr->addr.in6.sin6_addr);
+ default: return 0;
+ }
+}
+
+static inline bool
+addr_local (const struct sockaddr *addr)
+{
+ if (!addr)
+ return false;
+ switch (addr->sa_family) {
+ case AF_INET:
+ return ((const struct sockaddr_in*)addr)->sin_addr.s_addr == htonl(INADDR_LOOPBACK);
+ case AF_INET6:
+ return IN6_IS_ADDR_LOOPBACK(&((const struct sockaddr_in6*)addr)->sin6_addr);
+ default:
+ return false;
+ }
+}
+
+
+static inline bool
+addr_defined_ipi (const struct link_socket_actual *lsa)
+{
+#if ENABLE_IP_PKTINFO
+ if (!lsa) return 0;
+ switch (lsa->dest.addr.sa.sa_family) {
+#ifdef HAVE_IN_PKTINFO
+ case AF_INET: return lsa->pi.in4.ipi_spec_dst.s_addr != 0;
+#elif defined(IP_RECVDSTADDR)
+ case AF_INET: return lsa->pi.in4.s_addr != 0;
+#endif
+ case AF_INET6: return !IN6_IS_ADDR_UNSPECIFIED(&lsa->pi.in6.ipi6_addr);
+ default: return 0;
+ }
+#else
+ ASSERT(0);
+#endif
+ return false;
+}
+
+static inline bool
+link_socket_actual_defined (const struct link_socket_actual *act)
+{
+ return act && addr_defined (&act->dest);
+}
+
+static inline bool
+addr_match (const struct openvpn_sockaddr *a1, const struct openvpn_sockaddr *a2)
+{
+ switch(a1->addr.sa.sa_family) {
+ case AF_INET:
+ return a1->addr.in4.sin_addr.s_addr == a2->addr.in4.sin_addr.s_addr;
+ case AF_INET6:
+ return IN6_ARE_ADDR_EQUAL(&a1->addr.in6.sin6_addr, &a2->addr.in6.sin6_addr);
+ }
+ ASSERT(0);
+ return false;
+}
+
+static inline bool
+addrlist_match (const struct openvpn_sockaddr *a1, const struct addrinfo *addrlist)
+{
+ const struct addrinfo *curele;
+ for (curele = addrlist; curele; curele=curele->ai_next)
+ {
+ switch(a1->addr.sa.sa_family)
+ {
+ case AF_INET:
+ if (a1->addr.in4.sin_addr.s_addr == ((struct sockaddr_in*)curele->ai_addr)->sin_addr.s_addr)
+ return true;
+ break;
+ case AF_INET6:
+ if (IN6_ARE_ADDR_EQUAL(&a1->addr.in6.sin6_addr, &((struct sockaddr_in6*) curele->ai_addr)->sin6_addr))
+ return true;
+ break;
+ default:
+ ASSERT(0);
+ }
+ }
+ return false;
+}
+
+static inline in_addr_t
+addr_host (const struct openvpn_sockaddr *addr)
+{
+ /*
+ * "public" addr returned is checked against ifconfig for
+ * possible clash: non sense for now given
+ * that we do ifconfig only IPv4
+ */
+ if(addr->addr.sa.sa_family != AF_INET)
+ return 0;
+ return ntohl (addr->addr.in4.sin_addr.s_addr);
+}
+
+
+static inline bool
+addrlist_port_match (const struct openvpn_sockaddr *a1, const struct addrinfo *a2)
+{
+ const struct addrinfo *curele;
+ for(curele=a2;curele;curele = curele->ai_next)
+ {
+ switch(a1->addr.sa.sa_family)
+ {
+ case AF_INET:
+ if (curele->ai_family == AF_INET
+ && a1->addr.in4.sin_addr.s_addr == ((struct sockaddr_in*)curele->ai_addr)->sin_addr.s_addr
+ && a1->addr.in4.sin_port == ((struct sockaddr_in*)curele->ai_addr)->sin_port)
+ return true;
+ break;
+ case AF_INET6:
+ if (curele->ai_family == AF_INET6
+ && IN6_ARE_ADDR_EQUAL(&a1->addr.in6.sin6_addr, &((struct sockaddr_in6*) curele->ai_addr)->sin6_addr)
+ && a1->addr.in6.sin6_port == ((struct sockaddr_in6*) curele->ai_addr)->sin6_port)
+ return true;
+ break;
+ default:
+ ASSERT(0);
+ }
+ }
+ return false;
+}
+
+
+
+static inline bool
+addr_port_match (const struct openvpn_sockaddr *a1, const struct openvpn_sockaddr *a2)
+{
+ switch(a1->addr.sa.sa_family) {
+ case AF_INET:
+ return a1->addr.in4.sin_addr.s_addr == a2->addr.in4.sin_addr.s_addr
+ && a1->addr.in4.sin_port == a2->addr.in4.sin_port;
+ case AF_INET6:
+ return IN6_ARE_ADDR_EQUAL(&a1->addr.in6.sin6_addr, &a2->addr.in6.sin6_addr)
+ && a1->addr.in6.sin6_port == a2->addr.in6.sin6_port;
+ }
+ ASSERT(0);
+ return false;
+}
+
+static inline bool
+addr_match_proto (const struct openvpn_sockaddr *a1,
+ const struct openvpn_sockaddr *a2,
+ const int proto)
+{
+ return link_socket_proto_connection_oriented (proto)
+ ? addr_match (a1, a2)
+ : addr_port_match (a1, a2);
+}
+
+
+static inline bool
+addrlist_match_proto (const struct openvpn_sockaddr *a1,
+ struct addrinfo *addr_list,
+ const int proto)
+{
+ return link_socket_proto_connection_oriented (proto)
+ ? addrlist_match (a1, addr_list)
+ : addrlist_port_match (a1, addr_list);
+}
+
+static inline void
+addr_zero_host(struct openvpn_sockaddr *addr)
+{
+ switch(addr->addr.sa.sa_family) {
+ case AF_INET:
+ addr->addr.in4.sin_addr.s_addr = 0;
+ break;
+ case AF_INET6:
+ memset(&addr->addr.in6.sin6_addr, 0, sizeof (struct in6_addr));
+ break;
+ }
+}
+
+static inline void
+addr_copy_sa(struct openvpn_sockaddr *dst, const struct openvpn_sockaddr *src)
+{
+ dst->addr = src->addr;
+}
+
+static inline bool
+addr_inet4or6(struct sockaddr *addr)
+{
+ return addr->sa_family == AF_INET || addr->sa_family == AF_INET6;
+}
+
+int addr_guess_family(sa_family_t af,const char *name);
+static inline int
+af_addr_size(sa_family_t af)
+{
+ switch(af) {
+ case AF_INET: return sizeof (struct sockaddr_in);
+ case AF_INET6: return sizeof (struct sockaddr_in6);
+ default:
+#if 0
+ /* could be called from socket_do_accept() with empty addr */
+ msg (M_ERR, "Bad address family: %d\n", af);
+ ASSERT(0);
+#endif
+ return 0;
+ }
+}
+
+static inline bool
+link_socket_actual_match (const struct link_socket_actual *a1, const struct link_socket_actual *a2)
+{
+ return addr_port_match (&a1->dest, &a2->dest);
+}
+
+#if PORT_SHARE
+
+static inline bool
+socket_foreign_protocol_detected (const struct link_socket *sock)
+{
+ return link_socket_connection_oriented (sock)
+ && sock->stream_buf.port_share_state == PS_FOREIGN;
+}
+
+static inline const struct buffer *
+socket_foreign_protocol_head (const struct link_socket *sock)
+{
+ return &sock->stream_buf.buf;
+}
+
+static inline int
+socket_foreign_protocol_sd (const struct link_socket *sock)
+{
+ return sock->sd;
+}
+
+#endif
+
+static inline bool
+socket_connection_reset (const struct link_socket *sock, int status)
+{
+ if (link_socket_connection_oriented (sock))
+ {
+ if (sock->stream_reset || sock->stream_buf.error)
+ return true;
+ else if (status < 0)
+ {
+ const int err = openvpn_errno ();
+#ifdef WIN32
+ return err == WSAECONNRESET || err == WSAECONNABORTED;
+#else
+ return err == ECONNRESET;
+#endif
+ }
+ }
+ return false;
+}
+
+static inline bool
+link_socket_verify_incoming_addr (struct buffer *buf,
+ const struct link_socket_info *info,
+ const struct link_socket_actual *from_addr)
+{
+ if (buf->len > 0)
+ {
+ switch (from_addr->dest.addr.sa.sa_family) {
+ case AF_INET6:
+ case AF_INET:
+ if (!link_socket_actual_defined (from_addr))
+ return false;
+ if (info->remote_float || (!info->lsa->remote_list))
+ return true;
+ if (addrlist_match_proto (&from_addr->dest, info->lsa->remote_list, info->proto))
+ return true;
+ }
+ }
+ return false;
+}
+
+static inline void
+link_socket_get_outgoing_addr (struct buffer *buf,
+ const struct link_socket_info *info,
+ struct link_socket_actual **act)
+{
+ if (buf->len > 0)
+ {
+ struct link_socket_addr *lsa = info->lsa;
+ if (link_socket_actual_defined (&lsa->actual))
+ *act = &lsa->actual;
+ else
+ {
+ link_socket_bad_outgoing_addr ();
+ buf->len = 0;
+ *act = NULL;
+ }
+ }
+}
+
+static inline void
+link_socket_set_outgoing_addr (const struct buffer *buf,
+ struct link_socket_info *info,
+ const struct link_socket_actual *act,
+ const char *common_name,
+ struct env_set *es)
+{
+ if (!buf || buf->len > 0)
+ {
+ struct link_socket_addr *lsa = info->lsa;
+ if (
+ /* new or changed address? */
+ (!info->connection_established
+ || !addr_match_proto (&act->dest, &lsa->actual.dest, info->proto)
+ )
+ &&
+ /* address undef or address == remote or --float */
+ (info->remote_float ||
+ (!lsa->remote_list || addrlist_match_proto (&act->dest, lsa->remote_list, info->proto))
+ )
+ )
+ {
+ link_socket_connection_initiated (buf, info, act, common_name, es);
+ }
+ }
+}
+
+/*
+ * Stream buffer handling -- stream_buf is a helper class
+ * to assist in the packetization of stream transport protocols
+ * such as TCP.
+ */
+
+void stream_buf_init (struct stream_buf *sb,
+ struct buffer *buf,
+ const unsigned int sockflags,
+ const int proto);
+
+void stream_buf_close (struct stream_buf* sb);
+bool stream_buf_added (struct stream_buf *sb, int length_added);
+
+static inline bool
+stream_buf_read_setup (struct link_socket* sock)
+{
+ bool stream_buf_read_setup_dowork (struct link_socket* sock);
+ if (link_socket_connection_oriented (sock))
+ return stream_buf_read_setup_dowork (sock);
+ else
+ return true;
+}
+
+/*
+ * Socket Read Routines
+ */
+
+int link_socket_read_tcp (struct link_socket *sock,
+ struct buffer *buf);
+
+#ifdef WIN32
+
+static inline int
+link_socket_read_udp_win32 (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *from)
+{
+ return socket_finalize (sock->sd, &sock->reads, buf, from);
+}
+
+#else
+
+int link_socket_read_udp_posix (struct link_socket *sock,
+ struct buffer *buf,
+ int maxsize,
+ struct link_socket_actual *from);
+
+#endif
+
+/* read a TCP or UDP packet from link */
+static inline int
+link_socket_read (struct link_socket *sock,
+ struct buffer *buf,
+ int maxsize,
+ struct link_socket_actual *from)
+{
+ if (proto_is_udp(sock->info.proto)) /* unified UDPv4 and UDPv6 */
+ {
+ int res;
+
+#ifdef WIN32
+ res = link_socket_read_udp_win32 (sock, buf, from);
+#else
+ res = link_socket_read_udp_posix (sock, buf, maxsize, from);
+#endif
+ return res;
+ }
+ else if (proto_is_tcp(sock->info.proto)) /* unified TCPv4 and TCPv6 */
+ {
+ /* from address was returned by accept */
+ addr_copy_sa(&from->dest, &sock->info.lsa->actual.dest);
+ return link_socket_read_tcp (sock, buf);
+ }
+ else
+ {
+ ASSERT (0);
+ return -1; /* NOTREACHED */
+ }
+}
+
+/*
+ * Socket Write routines
+ */
+
+int link_socket_write_tcp (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to);
+
+#ifdef WIN32
+
+static inline int
+link_socket_write_win32 (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+ int err = 0;
+ int status = 0;
+ if (overlapped_io_active (&sock->writes))
+ {
+ status = socket_finalize (sock->sd, &sock->writes, NULL, NULL);
+ if (status < 0)
+ err = WSAGetLastError ();
+ }
+ socket_send_queue (sock, buf, to);
+ if (status < 0)
+ {
+ WSASetLastError (err);
+ return status;
+ }
+ else
+ return BLEN (buf);
+}
+
+#else
+
+static inline size_t
+link_socket_write_udp_posix (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+#if ENABLE_IP_PKTINFO
+ size_t link_socket_write_udp_posix_sendmsg (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to);
+
+ if (proto_is_udp(sock->info.proto) && (sock->sockflags & SF_USE_IP_PKTINFO)
+ && addr_defined_ipi(to))
+ return link_socket_write_udp_posix_sendmsg (sock, buf, to);
+ else
+#endif
+ return sendto (sock->sd, BPTR (buf), BLEN (buf), 0,
+ (struct sockaddr *) &to->dest.addr.sa,
+ (socklen_t) af_addr_size(to->dest.addr.sa.sa_family));
+}
+
+static inline size_t
+link_socket_write_tcp_posix (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+ return send (sock->sd, BPTR (buf), BLEN (buf), MSG_NOSIGNAL);
+}
+
+#endif
+
+static inline size_t
+link_socket_write_udp (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+#ifdef WIN32
+ return link_socket_write_win32 (sock, buf, to);
+#else
+ return link_socket_write_udp_posix (sock, buf, to);
+#endif
+}
+
+/* write a TCP or UDP packet to link */
+static inline int
+link_socket_write (struct link_socket *sock,
+ struct buffer *buf,
+ struct link_socket_actual *to)
+{
+ if (proto_is_udp(sock->info.proto)) /* unified UDPv4 and UDPv6 */
+ {
+ return link_socket_write_udp (sock, buf, to);
+ }
+ else if (proto_is_tcp(sock->info.proto)) /* unified TCPv4 and TCPv6 */
+ {
+ return link_socket_write_tcp (sock, buf, to);
+ }
+ else
+ {
+ ASSERT (0);
+ return -1; /* NOTREACHED */
+ }
+}
+
+#if PASSTOS_CAPABILITY
+
+/*
+ * Extract TOS bits. Assumes that ipbuf is a valid IPv4 packet.
+ */
+static inline void
+link_socket_extract_tos (struct link_socket *ls, const struct buffer *ipbuf)
+{
+ if (ls && ipbuf)
+ {
+ struct openvpn_iphdr *iph = (struct openvpn_iphdr *) BPTR (ipbuf);
+ ls->ptos = iph->tos;
+ ls->ptos_defined = true;
+ }
+}
+
+/*
+ * Set socket properties to reflect TOS bits which were extracted
+ * from tunnel packet.
+ */
+static inline void
+link_socket_set_tos (struct link_socket *ls)
+{
+ if (ls && ls->ptos_defined)
+ setsockopt (ls->sd, IPPROTO_IP, IP_TOS, (const void *)&ls->ptos, sizeof (ls->ptos));
+}
+
+#endif
+
+/*
+ * Socket I/O wait functions
+ */
+
+static inline bool
+socket_read_residual (const struct link_socket *s)
+{
+ return s && s->stream_buf.residual_fully_formed;
+}
+
+static inline event_t
+socket_event_handle (const struct link_socket *s)
+{
+#ifdef WIN32
+ return &s->rw_handle;
+#else
+ return s->sd;
+#endif
+}
+
+event_t socket_listen_event_handle (struct link_socket *s);
+
+unsigned int
+socket_set (struct link_socket *s,
+ struct event_set *es,
+ unsigned int rwflags,
+ void *arg,
+ unsigned int *persistent);
+
+static inline void
+socket_set_listen_persistent (struct link_socket *s,
+ struct event_set *es,
+ void *arg)
+{
+ if (s && !s->listen_persistent_queued)
+ {
+ event_ctl (es, socket_listen_event_handle (s), EVENT_READ, arg);
+ s->listen_persistent_queued = true;
+ }
+}
+
+static inline void
+socket_reset_listen_persistent (struct link_socket *s)
+{
+#ifdef WIN32
+ reset_net_event_win32 (&s->listen_handle, s->sd);
+#endif
+}
+
+const char *socket_stat (const struct link_socket *s, unsigned int rwflags, struct gc_arena *gc);
+
+#endif /* SOCKET_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.c
new file mode 100644
index 00000000..72bdf550
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.c
@@ -0,0 +1,574 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * 2004-01-30: Added Socks5 proxy support, see RFC 1928
+ * (Christof Meerwald, http://cmeerw.org)
+ *
+ * 2010-10-10: Added Socks5 plain text authentication support (RFC 1929)
+ * (Pierre Bourdon <delroth@gmail.com>)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "common.h"
+#include "misc.h"
+#include "win32.h"
+#include "socket.h"
+#include "fdmisc.h"
+#include "misc.h"
+#include "proxy.h"
+
+#include "memdbg.h"
+
+#define UP_TYPE_SOCKS "SOCKS Proxy"
+
+void
+socks_adjust_frame_parameters (struct frame *frame, int proto)
+{
+ if (proto == PROTO_UDP)
+ frame_add_to_extra_link (frame, 10);
+}
+
+struct socks_proxy_info *
+socks_proxy_new (const char *server,
+ const char *port,
+ const char *authfile,
+ bool retry)
+{
+ struct socks_proxy_info *p;
+
+ ALLOC_OBJ_CLEAR (p, struct socks_proxy_info);
+
+ ASSERT (server);
+ ASSERT (port);
+
+ strncpynt (p->server, server, sizeof (p->server));
+ p->port = port;
+
+ if (authfile)
+ strncpynt (p->authfile, authfile, sizeof (p->authfile));
+ else
+ p->authfile[0] = 0;
+
+ p->retry = retry;
+ p->defined = true;
+
+ return p;
+}
+
+void
+socks_proxy_close (struct socks_proxy_info *sp)
+{
+ free (sp);
+}
+
+static bool
+socks_username_password_auth (struct socks_proxy_info *p,
+ socket_descriptor_t sd,
+ volatile int *signal_received)
+{
+ char to_send[516];
+ char buf[2];
+ int len = 0;
+ const int timeout_sec = 5;
+ struct user_pass creds;
+ ssize_t size;
+
+ creds.defined = 0;
+ get_user_pass (&creds, p->authfile, UP_TYPE_SOCKS, GET_USER_PASS_MANAGEMENT);
+
+ if( !creds.username || (strlen(creds.username) > 255)
+ || !creds.password || (strlen(creds.password) > 255) ) {
+ msg (M_NONFATAL,
+ "SOCKS username and/or password exceeds 255 characters. "
+ "Authentication not possible.");
+ return false;
+ }
+ openvpn_snprintf (to_send, sizeof (to_send), "\x01%c%s%c%s", (int) strlen(creds.username),
+ creds.username, (int) strlen(creds.password), creds.password);
+ size = send (sd, to_send, strlen(to_send), MSG_NOSIGNAL);
+
+ if (size != strlen (to_send))
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_username_password_auth: TCP port write failed on send()");
+ return false;
+ }
+
+ while (len < 2)
+ {
+ int status;
+ ssize_t size;
+ fd_set reads;
+ struct timeval tv;
+ char c;
+
+ FD_ZERO (&reads);
+ FD_SET (sd, &reads);
+ tv.tv_sec = timeout_sec;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, &reads, NULL, NULL, &tv);
+
+ get_signal (signal_received);
+ if (*signal_received)
+ return false;
+
+ /* timeout? */
+ if (status == 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_username_password_auth: TCP port read timeout expired");
+ return false;
+ }
+
+ /* error */
+ if (status < 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_username_password_auth: TCP port read failed on select()");
+ return false;
+ }
+
+ /* read single char */
+ size = recv(sd, &c, 1, MSG_NOSIGNAL);
+
+ /* error? */
+ if (size != 1)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_username_password_auth: TCP port read failed on recv()");
+ return false;
+ }
+
+ /* store char in buffer */
+ buf[len++] = c;
+ }
+
+ /* VER = 5, SUCCESS = 0 --> auth success */
+ if (buf[0] != 5 && buf[1] != 0)
+ {
+ msg (D_LINK_ERRORS, "socks_username_password_auth: server refused the authentication");
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+socks_handshake (struct socks_proxy_info *p,
+ socket_descriptor_t sd,
+ volatile int *signal_received)
+{
+ char buf[2];
+ int len = 0;
+ const int timeout_sec = 5;
+ ssize_t size;
+
+ /* VER = 5, NMETHODS = 1, METHODS = [0 (no auth)] */
+ char method_sel[3] = { 0x05, 0x01, 0x00 };
+ if (p->authfile[0])
+ method_sel[2] = 0x02; /* METHODS = [2 (plain login)] */
+
+ size = send (sd, method_sel, sizeof (method_sel), MSG_NOSIGNAL);
+ if (size != sizeof (method_sel))
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_handshake: TCP port write failed on send()");
+ return false;
+ }
+
+ while (len < 2)
+ {
+ int status;
+ ssize_t size;
+ fd_set reads;
+ struct timeval tv;
+ char c;
+
+ FD_ZERO (&reads);
+ FD_SET (sd, &reads);
+ tv.tv_sec = timeout_sec;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, &reads, NULL, NULL, &tv);
+
+ get_signal (signal_received);
+ if (*signal_received)
+ return false;
+
+ /* timeout? */
+ if (status == 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_handshake: TCP port read timeout expired");
+ return false;
+ }
+
+ /* error */
+ if (status < 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_handshake: TCP port read failed on select()");
+ return false;
+ }
+
+ /* read single char */
+ size = recv(sd, &c, 1, MSG_NOSIGNAL);
+
+ /* error? */
+ if (size != 1)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "socks_handshake: TCP port read failed on recv()");
+ return false;
+ }
+
+ /* store char in buffer */
+ buf[len++] = c;
+ }
+
+ /* VER == 5 */
+ if (buf[0] != '\x05')
+ {
+ msg (D_LINK_ERRORS, "socks_handshake: Socks proxy returned bad status");
+ return false;
+ }
+
+ /* validate that the auth method returned is the one sent */
+ if (buf[1] != method_sel[2])
+ {
+ msg (D_LINK_ERRORS, "socks_handshake: Socks proxy returned unexpected auth");
+ return false;
+ }
+
+ /* select the appropriate authentication method */
+ switch (buf[1])
+ {
+ case 0: /* no authentication */
+ break;
+
+ case 2: /* login/password */
+ if (!p->authfile[0])
+ {
+ msg(D_LINK_ERRORS, "socks_handshake: server asked for username/login auth but we were "
+ "not provided any credentials");
+ return false;
+ }
+
+ if (!socks_username_password_auth(p, sd, signal_received))
+ return false;
+
+ break;
+
+ default: /* unknown auth method */
+ msg(D_LINK_ERRORS, "socks_handshake: unknown SOCKS auth method");
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+recv_socks_reply (socket_descriptor_t sd,
+ struct openvpn_sockaddr *addr,
+ volatile int *signal_received)
+{
+ char atyp = '\0';
+ int alen = 0;
+ int len = 0;
+ char buf[22];
+ const int timeout_sec = 5;
+
+ if (addr != NULL)
+ {
+ addr->addr.in4.sin_family = AF_INET;
+ addr->addr.in4.sin_addr.s_addr = htonl (INADDR_ANY);
+ addr->addr.in4.sin_port = htons (0);
+ }
+
+ while (len < 4 + alen + 2)
+ {
+ int status;
+ ssize_t size;
+ fd_set reads;
+ struct timeval tv;
+ char c;
+
+ FD_ZERO (&reads);
+ FD_SET (sd, &reads);
+ tv.tv_sec = timeout_sec;
+ tv.tv_usec = 0;
+
+ status = select (sd + 1, &reads, NULL, NULL, &tv);
+
+ get_signal (signal_received);
+ if (*signal_received)
+ return false;
+
+ /* timeout? */
+ if (status == 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_socks_reply: TCP port read timeout expired");
+ return false;
+ }
+
+ /* error */
+ if (status < 0)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_socks_reply: TCP port read failed on select()");
+ return false;
+ }
+
+ /* read single char */
+ size = recv(sd, &c, 1, MSG_NOSIGNAL);
+
+ /* error? */
+ if (size != 1)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "recv_socks_reply: TCP port read failed on recv()");
+ return false;
+ }
+
+ if (len == 3)
+ atyp = c;
+
+ if (len == 4)
+ {
+ switch (atyp)
+ {
+ case '\x01': /* IP V4 */
+ alen = 4;
+ break;
+
+ case '\x03': /* DOMAINNAME */
+ alen = (unsigned char) c;
+ break;
+
+ case '\x04': /* IP V6 */
+ alen = 16;
+ break;
+
+ default:
+ msg (D_LINK_ERRORS, "recv_socks_reply: Socks proxy returned bad address type");
+ return false;
+ }
+ }
+
+ /* store char in buffer */
+ if (len < (int)sizeof(buf))
+ buf[len] = c;
+ ++len;
+ }
+
+ /* VER == 5 && REP == 0 (succeeded) */
+ if (buf[0] != '\x05' || buf[1] != '\x00')
+ {
+ msg (D_LINK_ERRORS, "recv_socks_reply: Socks proxy returned bad reply");
+ return false;
+ }
+
+ /* ATYP == 1 (IP V4 address) */
+ if (atyp == '\x01' && addr != NULL)
+ {
+ memcpy (&addr->addr.in4.sin_addr, buf + 4, sizeof (addr->addr.in4.sin_addr));
+ memcpy (&addr->addr.in4.sin_port, buf + 8, sizeof (addr->addr.in4.sin_port));
+ }
+
+
+ return true;
+}
+
+static int
+port_from_servname(const char* servname)
+{
+ int port =0;
+ port = atoi(servname);
+ if(port >0 && port < 65536)
+ return port;
+
+ struct servent* service;
+ service = getservbyname(servname, NULL);
+ if(service)
+ return service->s_port;
+
+ return 0;
+}
+
+void
+establish_socks_proxy_passthru (struct socks_proxy_info *p,
+ socket_descriptor_t sd, /* already open to proxy */
+ const char *host, /* openvpn server remote */
+ const char *servname, /* openvpn server port */
+ volatile int *signal_received)
+{
+ char buf[128];
+ size_t len;
+
+ if (!socks_handshake (p, sd, signal_received))
+ goto error;
+
+ /* format Socks CONNECT message */
+ buf[0] = '\x05'; /* VER = 5 */
+ buf[1] = '\x01'; /* CMD = 1 (CONNECT) */
+ buf[2] = '\x00'; /* RSV */
+ buf[3] = '\x03'; /* ATYP = 3 (DOMAINNAME) */
+
+ len = strlen(host);
+ len = (5 + len + 2 > sizeof(buf)) ? (sizeof(buf) - 5 - 2) : len;
+
+ buf[4] = (char) len;
+ memcpy(buf + 5, host, len);
+
+ int port = port_from_servname (servname);
+ if (port ==0)
+ {
+ msg (D_LINK_ERRORS, "establish_socks_proxy_passthrough: Cannot convert %s to port number", servname);
+ goto error;
+ }
+
+ buf[5 + len] = (char) (port >> 8);
+ buf[5 + len + 1] = (char) (port & 0xff);
+
+ {
+ const ssize_t size = send (sd, buf, 5 + len + 2, MSG_NOSIGNAL);
+ if ((int)size != 5 + (int)len + 2)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "establish_socks_proxy_passthru: TCP port write failed on send()");
+ goto error;
+ }
+ }
+
+
+ /* receive reply from Socks proxy and discard */
+ if (!recv_socks_reply (sd, NULL, signal_received))
+ goto error;
+
+ return;
+
+ error:
+ /* on error, should we exit or restart? */
+ if (!*signal_received)
+ *signal_received = (p->retry ? SIGUSR1 : SIGTERM); /* SOFT-SIGUSR1 -- socks error */
+ return;
+}
+
+void
+establish_socks_proxy_udpassoc (struct socks_proxy_info *p,
+ socket_descriptor_t ctrl_sd, /* already open to proxy */
+ socket_descriptor_t udp_sd,
+ struct openvpn_sockaddr *relay_addr,
+ volatile int *signal_received)
+{
+ if (!socks_handshake (p, ctrl_sd, signal_received))
+ goto error;
+
+ {
+ /* send Socks UDP ASSOCIATE message */
+ /* VER = 5, CMD = 3 (UDP ASSOCIATE), RSV = 0, ATYP = 1 (IP V4),
+ BND.ADDR = 0, BND.PORT = 0 */
+ const ssize_t size = send (ctrl_sd,
+ "\x05\x03\x00\x01\x00\x00\x00\x00\x00\x00",
+ 10, MSG_NOSIGNAL);
+ if (size != 10)
+ {
+ msg (D_LINK_ERRORS | M_ERRNO, "establish_socks_proxy_passthru: TCP port write failed on send()");
+ goto error;
+ }
+ }
+
+ /* receive reply from Socks proxy */
+ CLEAR (*relay_addr);
+ if (!recv_socks_reply (ctrl_sd, relay_addr, signal_received))
+ goto error;
+
+ return;
+
+ error:
+ /* on error, should we exit or restart? */
+ if (!*signal_received)
+ *signal_received = (p->retry ? SIGUSR1 : SIGTERM); /* SOFT-SIGUSR1 -- socks error */
+ return;
+}
+
+/*
+ * Remove the 10 byte socks5 header from an incoming
+ * UDP packet, setting *from to the source address.
+ *
+ * Run after UDP read.
+ */
+void
+socks_process_incoming_udp (struct buffer *buf,
+ struct link_socket_actual *from)
+{
+ int atyp;
+
+ if (BLEN (buf) < 10)
+ goto error;
+
+ buf_read_u16 (buf);
+ if (buf_read_u8 (buf) != 0)
+ goto error;
+
+ atyp = buf_read_u8 (buf);
+ if (atyp != 1) /* ATYP == 1 (IP V4) */
+ goto error;
+
+ buf_read (buf, &from->dest.addr.in4.sin_addr, sizeof (from->dest.addr.in4.sin_addr));
+ buf_read (buf, &from->dest.addr.in4.sin_port, sizeof (from->dest.addr.in4.sin_port));
+
+ return;
+
+ error:
+ buf->len = 0;
+}
+
+/*
+ * Add a 10 byte socks header prior to UDP write.
+ * *to is the destination address.
+ *
+ * Run before UDP write.
+ * Returns the size of the header.
+ */
+int
+socks_process_outgoing_udp (struct buffer *buf,
+ const struct link_socket_actual *to)
+{
+ /*
+ * Get a 10 byte subset buffer prepended to buf --
+ * we expect these bytes will be here because
+ * we allocated frame space in socks_adjust_frame_parameters.
+ */
+ struct buffer head = buf_sub (buf, 10, true);
+
+ /* crash if not enough headroom in buf */
+ ASSERT (buf_defined (&head));
+
+ buf_write_u16 (&head, 0); /* RSV = 0 */
+ buf_write_u8 (&head, 0); /* FRAG = 0 */
+ buf_write_u8 (&head, '\x01'); /* ATYP = 1 (IP V4) */
+ buf_write (&head, &to->dest.addr.in4.sin_addr, sizeof (to->dest.addr.in4.sin_addr));
+ buf_write (&head, &to->dest.addr.in4.sin_port, sizeof (to->dest.addr.in4.sin_port));
+
+ return 10;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.h
new file mode 100644
index 00000000..2475261f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/socks.h
@@ -0,0 +1,74 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * 2004-01-30: Added Socks5 proxy support
+ * (Christof Meerwald, http://cmeerw.org)
+ */
+
+#ifndef SOCKS_H
+#define SOCKS_H
+
+#include "buffer.h"
+
+struct openvpn_sockaddr;
+struct link_socket_actual;
+
+struct socks_proxy_info {
+ bool defined;
+ bool retry;
+
+ char server[128];
+ const char *port;
+ char authfile[256];
+};
+
+void socks_adjust_frame_parameters (struct frame *frame, int proto);
+
+struct socks_proxy_info *socks_proxy_new (const char *server,
+ const char *port,
+ const char *authfile,
+ bool retry);
+
+void socks_proxy_close (struct socks_proxy_info *sp);
+
+void establish_socks_proxy_passthru (struct socks_proxy_info *p,
+ socket_descriptor_t sd, /* already open to proxy */
+ const char *host, /* openvpn server remote */
+ const char *servname, /* openvpn server port */
+ volatile int *signal_received);
+
+void establish_socks_proxy_udpassoc (struct socks_proxy_info *p,
+ socket_descriptor_t ctrl_sd, /* already open to proxy */
+ socket_descriptor_t udp_sd,
+ struct openvpn_sockaddr *relay_addr,
+ volatile int *signal_received);
+
+void socks_process_incoming_udp (struct buffer *buf,
+ struct link_socket_actual *from);
+
+int socks_process_outgoing_udp (struct buffer *buf,
+ const struct link_socket_actual *to);
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.c
new file mode 100644
index 00000000..929f95fa
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.c
@@ -0,0 +1,3611 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.com>
+ * Copyright (C) 2008-2013 David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel SSL/Data channel negotiation Module
+ */
+
+/*
+ * The routines in this file deal with dynamically negotiating
+ * the data channel HMAC and cipher keys through a TLS session.
+ *
+ * Both the TLS session and the data channel are multiplexed
+ * over the same TCP/UDP port.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "error.h"
+#include "common.h"
+#include "socket.h"
+#include "misc.h"
+#include "fdmisc.h"
+#include "interval.h"
+#include "perf.h"
+#include "status.h"
+#include "gremlin.h"
+#include "pkcs11.h"
+#include "route.h"
+
+#include "ssl.h"
+#include "ssl_verify.h"
+#include "ssl_backend.h"
+
+#include "memdbg.h"
+
+#ifndef ENABLE_OCC
+static const char ssl_default_options_string[] = "V0 UNDEF";
+#endif
+
+static inline const char *
+local_options_string (const struct tls_session *session)
+{
+#ifdef ENABLE_OCC
+ return session->opt->local_options;
+#else
+ return ssl_default_options_string;
+#endif
+}
+
+#ifdef MEASURE_TLS_HANDSHAKE_STATS
+
+static int tls_handshake_success; /* GLOBAL */
+static int tls_handshake_error; /* GLOBAL */
+static int tls_packets_generated; /* GLOBAL */
+static int tls_packets_sent; /* GLOBAL */
+
+#define INCR_SENT ++tls_packets_sent
+#define INCR_GENERATED ++tls_packets_generated
+#define INCR_SUCCESS ++tls_handshake_success
+#define INCR_ERROR ++tls_handshake_error
+
+void
+show_tls_performance_stats(void)
+{
+ msg (D_TLS_DEBUG_LOW, "TLS Handshakes, success=%f%% (good=%d, bad=%d), retransmits=%f%%",
+ (double) tls_handshake_success / (tls_handshake_success + tls_handshake_error) * 100.0,
+ tls_handshake_success, tls_handshake_error,
+ (double) (tls_packets_sent - tls_packets_generated) / tls_packets_generated * 100.0);
+}
+#else
+
+#define INCR_SENT
+#define INCR_GENERATED
+#define INCR_SUCCESS
+#define INCR_ERROR
+
+#endif
+
+/**
+ * SSL/TLS Cipher suite name translation table
+ */
+static const tls_cipher_name_pair tls_cipher_name_translation_table[] = {
+ {"ADH-SEED-SHA", "TLS-DH-anon-WITH-SEED-CBC-SHA"},
+ {"AES128-GCM-SHA256", "TLS-RSA-WITH-AES-128-GCM-SHA256"},
+ {"AES128-SHA256", "TLS-RSA-WITH-AES-128-CBC-SHA256"},
+ {"AES128-SHA", "TLS-RSA-WITH-AES-128-CBC-SHA"},
+ {"AES256-GCM-SHA384", "TLS-RSA-WITH-AES-256-GCM-SHA384"},
+ {"AES256-SHA256", "TLS-RSA-WITH-AES-256-CBC-SHA256"},
+ {"AES256-SHA", "TLS-RSA-WITH-AES-256-CBC-SHA"},
+ {"CAMELLIA128-SHA256", "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"CAMELLIA128-SHA", "TLS-RSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"CAMELLIA256-SHA256", "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"CAMELLIA256-SHA", "TLS-RSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"DES-CBC3-SHA", "TLS-RSA-WITH-3DES-EDE-CBC-SHA"},
+ {"DES-CBC-SHA", "TLS-RSA-WITH-DES-CBC-SHA"},
+ {"DH-DSS-SEED-SHA", "TLS-DH-DSS-WITH-SEED-CBC-SHA"},
+ {"DHE-DSS-AES128-GCM-SHA256", "TLS-DHE-DSS-WITH-AES-128-GCM-SHA256"},
+ {"DHE-DSS-AES128-SHA256", "TLS-DHE-DSS-WITH-AES-128-CBC-SHA256"},
+ {"DHE-DSS-AES128-SHA", "TLS-DHE-DSS-WITH-AES-128-CBC-SHA"},
+ {"DHE-DSS-AES256-GCM-SHA384", "TLS-DHE-DSS-WITH-AES-256-GCM-SHA384"},
+ {"DHE-DSS-AES256-SHA256", "TLS-DHE-DSS-WITH-AES-256-CBC-SHA256"},
+ {"DHE-DSS-AES256-SHA", "TLS-DHE-DSS-WITH-AES-256-CBC-SHA"},
+ {"DHE-DSS-CAMELLIA128-SHA256", "TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"DHE-DSS-CAMELLIA128-SHA", "TLS-DHE-DSS-WITH-CAMELLIA-128-CBC-SHA"},
+ {"DHE-DSS-CAMELLIA256-SHA256", "TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"DHE-DSS-CAMELLIA256-SHA", "TLS-DHE-DSS-WITH-CAMELLIA-256-CBC-SHA"},
+ {"DHE-DSS-SEED-SHA", "TLS-DHE-DSS-WITH-SEED-CBC-SHA"},
+ {"DHE-RSA-AES128-GCM-SHA256", "TLS-DHE-RSA-WITH-AES-128-GCM-SHA256"},
+ {"DHE-RSA-AES128-SHA256", "TLS-DHE-RSA-WITH-AES-128-CBC-SHA256"},
+ {"DHE-RSA-AES128-SHA", "TLS-DHE-RSA-WITH-AES-128-CBC-SHA"},
+ {"DHE-RSA-AES256-GCM-SHA384", "TLS-DHE-RSA-WITH-AES-256-GCM-SHA384"},
+ {"DHE-RSA-AES256-SHA256", "TLS-DHE-RSA-WITH-AES-256-CBC-SHA256"},
+ {"DHE-RSA-AES256-SHA", "TLS-DHE-RSA-WITH-AES-256-CBC-SHA"},
+ {"DHE-RSA-CAMELLIA128-SHA256", "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"DHE-RSA-CAMELLIA128-SHA", "TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"DHE-RSA-CAMELLIA256-SHA256", "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"DHE-RSA-CAMELLIA256-SHA", "TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"DHE-RSA-SEED-SHA", "TLS-DHE-RSA-WITH-SEED-CBC-SHA"},
+ {"DH-RSA-SEED-SHA", "TLS-DH-RSA-WITH-SEED-CBC-SHA"},
+ {"ECDH-ECDSA-AES128-GCM-SHA256", "TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256"},
+ {"ECDH-ECDSA-AES128-SHA256", "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA256"},
+ {"ECDH-ECDSA-AES128-SHA", "TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA"},
+ {"ECDH-ECDSA-AES256-GCM-SHA384", "TLS-ECDH-ECDSA-WITH-AES-256-GCM-SHA384"},
+ {"ECDH-ECDSA-AES256-SHA256", "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA256"},
+ {"ECDH-ECDSA-AES256-SHA384", "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384"},
+ {"ECDH-ECDSA-AES256-SHA", "TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA"},
+ {"ECDH-ECDSA-CAMELLIA128-SHA256", "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"ECDH-ECDSA-CAMELLIA128-SHA", "TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"ECDH-ECDSA-CAMELLIA256-SHA256", "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"ECDH-ECDSA-CAMELLIA256-SHA", "TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"ECDH-ECDSA-DES-CBC3-SHA", "TLS-ECDH-ECDSA-WITH-3DES-EDE-CBC-SHA"},
+ {"ECDH-ECDSA-DES-CBC-SHA", "TLS-ECDH-ECDSA-WITH-DES-CBC-SHA"},
+ {"ECDH-ECDSA-RC4-SHA", "TLS-ECDH-ECDSA-WITH-RC4-128-SHA"},
+ {"ECDHE-ECDSA-AES128-GCM-SHA256", "TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256"},
+ {"ECDHE-ECDSA-AES128-SHA256", "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256"},
+ {"ECDHE-ECDSA-AES128-SHA384", "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA384"},
+ {"ECDHE-ECDSA-AES128-SHA", "TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA"},
+ {"ECDHE-ECDSA-AES256-GCM-SHA384", "TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384"},
+ {"ECDHE-ECDSA-AES256-SHA256", "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA256"},
+ {"ECDHE-ECDSA-AES256-SHA384", "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384"},
+ {"ECDHE-ECDSA-AES256-SHA", "TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA"},
+ {"ECDHE-ECDSA-CAMELLIA128-SHA256", "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"ECDHE-ECDSA-CAMELLIA128-SHA", "TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"ECDHE-ECDSA-CAMELLIA256-SHA256", "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"ECDHE-ECDSA-CAMELLIA256-SHA", "TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"ECDHE-ECDSA-DES-CBC3-SHA", "TLS-ECDHE-ECDSA-WITH-3DES-EDE-CBC-SHA"},
+ {"ECDHE-ECDSA-DES-CBC-SHA", "TLS-ECDHE-ECDSA-WITH-DES-CBC-SHA"},
+ {"ECDHE-ECDSA-RC4-SHA", "TLS-ECDHE-ECDSA-WITH-RC4-128-SHA"},
+ {"ECDHE-RSA-AES128-GCM-SHA256", "TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256"},
+ {"ECDHE-RSA-AES128-SHA256", "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256"},
+ {"ECDHE-RSA-AES128-SHA384", "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA384"},
+ {"ECDHE-RSA-AES128-SHA", "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA"},
+ {"ECDHE-RSA-AES256-GCM-SHA384", "TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384"},
+ {"ECDHE-RSA-AES256-SHA256", "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA256"},
+ {"ECDHE-RSA-AES256-SHA384", "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384"},
+ {"ECDHE-RSA-AES256-SHA", "TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA"},
+ {"ECDHE-RSA-CAMELLIA128-SHA256", "TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"ECDHE-RSA-CAMELLIA128-SHA", "TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"ECDHE-RSA-CAMELLIA256-SHA256", "TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"ECDHE-RSA-CAMELLIA256-SHA", "TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"ECDHE-RSA-DES-CBC3-SHA", "TLS-ECDHE-RSA-WITH-3DES-EDE-CBC-SHA"},
+ {"ECDHE-RSA-DES-CBC-SHA", "TLS-ECDHE-RSA-WITH-DES-CBC-SHA"},
+ {"ECDHE-RSA-RC4-SHA", "TLS-ECDHE-RSA-WITH-RC4-128-SHA"},
+ {"ECDH-RSA-AES128-GCM-SHA256", "TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256"},
+ {"ECDH-RSA-AES128-SHA256", "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256"},
+ {"ECDH-RSA-AES128-SHA384", "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA384"},
+ {"ECDH-RSA-AES128-SHA", "TLS-ECDH-RSA-WITH-AES-128-CBC-SHA"},
+ {"ECDH-RSA-AES256-GCM-SHA384", "TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384"},
+ {"ECDH-RSA-AES256-SHA256", "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA256"},
+ {"ECDH-RSA-AES256-SHA384", "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA384"},
+ {"ECDH-RSA-AES256-SHA", "TLS-ECDH-RSA-WITH-AES-256-CBC-SHA"},
+ {"ECDH-RSA-CAMELLIA128-SHA256", "TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA256"},
+ {"ECDH-RSA-CAMELLIA128-SHA", "TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA"},
+ {"ECDH-RSA-CAMELLIA256-SHA256", "TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA256"},
+ {"ECDH-RSA-CAMELLIA256-SHA", "TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA"},
+ {"ECDH-RSA-DES-CBC3-SHA", "TLS-ECDH-RSA-WITH-3DES-EDE-CBC-SHA"},
+ {"ECDH-RSA-DES-CBC-SHA", "TLS-ECDH-RSA-WITH-DES-CBC-SHA"},
+ {"ECDH-RSA-RC4-SHA", "TLS-ECDH-RSA-WITH-RC4-128-SHA"},
+ {"EDH-DSS-DES-CBC3-SHA", "TLS-DHE-DSS-WITH-3DES-EDE-CBC-SHA"},
+ {"EDH-DSS-DES-CBC-SHA", "TLS-DHE-DSS-WITH-DES-CBC-SHA"},
+ {"EDH-RSA-DES-CBC3-SHA", "TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA"},
+ {"EDH-RSA-DES-CBC-SHA", "TLS-DHE-RSA-WITH-DES-CBC-SHA"},
+ {"EXP-DES-CBC-SHA", "TLS-RSA-EXPORT-WITH-DES40-CBC-SHA"},
+ {"EXP-EDH-DSS-DES-CBC-SHA", "TLS-DH-DSS-EXPORT-WITH-DES40-CBC-SHA"},
+ {"EXP-EDH-RSA-DES-CBC-SHA", "TLS-DH-RSA-EXPORT-WITH-DES40-CBC-SHA"},
+ {"EXP-RC2-CBC-MD5", "TLS-RSA-EXPORT-WITH-RC2-CBC-40-MD5"},
+ {"EXP-RC4-MD5", "TLS-RSA-EXPORT-WITH-RC4-40-MD5"},
+ {"NULL-MD5", "TLS-RSA-WITH-NULL-MD5"},
+ {"NULL-SHA256", "TLS-RSA-WITH-NULL-SHA256"},
+ {"NULL-SHA", "TLS-RSA-WITH-NULL-SHA"},
+ {"PSK-3DES-EDE-CBC-SHA", "TLS-PSK-WITH-3DES-EDE-CBC-SHA"},
+ {"PSK-AES128-CBC-SHA", "TLS-PSK-WITH-AES-128-CBC-SHA"},
+ {"PSK-AES256-CBC-SHA", "TLS-PSK-WITH-AES-256-CBC-SHA"},
+ {"PSK-RC4-SHA", "TLS-PSK-WITH-RC4-128-SHA"},
+ {"RC4-MD5", "TLS-RSA-WITH-RC4-128-MD5"},
+ {"RC4-SHA", "TLS-RSA-WITH-RC4-128-SHA"},
+ {"SEED-SHA", "TLS-RSA-WITH-SEED-CBC-SHA"},
+ {"SRP-DSS-3DES-EDE-CBC-SHA", "TLS-SRP-SHA-DSS-WITH-3DES-EDE-CBC-SHA"},
+ {"SRP-DSS-AES-128-CBC-SHA", "TLS-SRP-SHA-DSS-WITH-AES-128-CBC-SHA"},
+ {"SRP-DSS-AES-256-CBC-SHA", "TLS-SRP-SHA-DSS-WITH-AES-256-CBC-SHA"},
+ {"SRP-RSA-3DES-EDE-CBC-SHA", "TLS-SRP-SHA-RSA-WITH-3DES-EDE-CBC-SHA"},
+ {"SRP-RSA-AES-128-CBC-SHA", "TLS-SRP-SHA-RSA-WITH-AES-128-CBC-SHA"},
+ {"SRP-RSA-AES-256-CBC-SHA", "TLS-SRP-SHA-RSA-WITH-AES-256-CBC-SHA"},
+#ifdef ENABLE_CRYPTO_OPENSSL
+ {"DEFAULT", "DEFAULT"},
+ {"ALL", "ALL"},
+ {"HIGH", "HIGH"},
+ {"MEDIUM", "MEDIUM"},
+ {"LOW", "LOW"},
+ {"ECDH", "ECDH"},
+ {"ECDSA", "ECDSA"},
+ {"EDH", "EDH"},
+ {"EXP", "EXP"},
+ {"RSA", "RSA"},
+ {"SRP", "SRP"},
+#endif
+ {NULL, NULL}
+};
+
+const tls_cipher_name_pair *
+tls_get_cipher_name_pair (const char * cipher_name, size_t len) {
+ const tls_cipher_name_pair * pair = tls_cipher_name_translation_table;
+
+ while (pair->openssl_name != NULL) {
+ if ((strlen(pair->openssl_name) == len && 0 == memcmp (cipher_name, pair->openssl_name, len)) ||
+ (strlen(pair->iana_name) == len && 0 == memcmp (cipher_name, pair->iana_name, len))) {
+ return pair;
+ }
+ pair++;
+ }
+
+ // No entry found, return NULL
+ return NULL;
+}
+
+/*
+ * Max number of bytes we will add
+ * for data structures common to both
+ * data and control channel packets.
+ * (opcode only).
+ */
+void
+tls_adjust_frame_parameters(struct frame *frame)
+{
+ frame_add_to_extra_frame (frame, 1); /* space for opcode */
+}
+
+/*
+ * Max number of bytes we will add
+ * to control channel packet.
+ */
+static void
+tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame,
+ struct frame *frame)
+{
+ /*
+ * frame->extra_frame is already initialized with tls_auth buffer requirements,
+ * if --tls-auth is enabled.
+ */
+
+ /* inherit link MTU and extra_link from data channel */
+ frame->link_mtu = data_channel_frame->link_mtu;
+ frame->extra_link = data_channel_frame->extra_link;
+
+ /* set extra_frame */
+ tls_adjust_frame_parameters (frame);
+ reliable_ack_adjust_frame_parameters (frame, CONTROL_SEND_ACK_MAX);
+ frame_add_to_extra_frame (frame, SID_SIZE + sizeof (packet_id_type));
+
+ /* set dynamic link MTU to minimum value */
+ frame_set_mtu_dynamic (frame, 0, SET_MTU_TUN);
+}
+
+void
+init_ssl_lib ()
+{
+ tls_init_lib ();
+
+ crypto_init_lib ();
+}
+
+void
+free_ssl_lib ()
+{
+ crypto_uninit_lib ();
+ prng_uninit();
+
+ tls_free_lib();
+}
+
+/*
+ * OpenSSL library calls pem_password_callback if the
+ * private key is protected by a password.
+ */
+
+static struct user_pass passbuf; /* GLOBAL */
+
+void
+pem_password_setup (const char *auth_file)
+{
+ if (!strlen (passbuf.password))
+ get_user_pass (&passbuf, auth_file, UP_TYPE_PRIVATE_KEY, GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE|GET_USER_PASS_PASSWORD_ONLY);
+}
+
+int
+pem_password_callback (char *buf, int size, int rwflag, void *u)
+{
+ if (buf)
+ {
+ /* prompt for password even if --askpass wasn't specified */
+ pem_password_setup (NULL);
+ strncpynt (buf, passbuf.password, size);
+ purge_user_pass (&passbuf, false);
+
+ return strlen (buf);
+ }
+ return 0;
+}
+
+/*
+ * Auth username/password handling
+ */
+
+static bool auth_user_pass_enabled; /* GLOBAL */
+static struct user_pass auth_user_pass; /* GLOBAL */
+
+#ifdef ENABLE_CLIENT_CR
+static char *auth_challenge; /* GLOBAL */
+#endif
+
+void
+auth_user_pass_setup (const char *auth_file, const struct static_challenge_info *sci)
+{
+ auth_user_pass_enabled = true;
+ if (!auth_user_pass.defined)
+ {
+#if AUTO_USERID
+ get_user_pass_auto_userid (&auth_user_pass, auth_file);
+#else
+# ifdef ENABLE_CLIENT_CR
+ if (auth_challenge) /* dynamic challenge/response */
+ get_user_pass_cr (&auth_user_pass,
+ auth_file,
+ UP_TYPE_AUTH,
+ GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE|GET_USER_PASS_DYNAMIC_CHALLENGE,
+ auth_challenge);
+ else if (sci) /* static challenge response */
+ {
+ int flags = GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE|GET_USER_PASS_STATIC_CHALLENGE;
+ if (sci->flags & SC_ECHO)
+ flags |= GET_USER_PASS_STATIC_CHALLENGE_ECHO;
+ get_user_pass_cr (&auth_user_pass,
+ auth_file,
+ UP_TYPE_AUTH,
+ flags,
+ sci->challenge_text);
+ }
+ else
+# endif
+ get_user_pass (&auth_user_pass, auth_file, UP_TYPE_AUTH, GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE);
+#endif
+ }
+}
+
+/*
+ * Disable password caching
+ */
+void
+ssl_set_auth_nocache (void)
+{
+ passbuf.nocache = true;
+ auth_user_pass.nocache = true;
+}
+
+/*
+ * Set an authentication token
+ */
+void
+ssl_set_auth_token (const char *token)
+{
+ set_auth_token (&auth_user_pass, token);
+}
+
+/*
+ * Forget private key password AND auth-user-pass username/password.
+ */
+void
+ssl_purge_auth (const bool auth_user_pass_only)
+{
+ if (!auth_user_pass_only)
+ {
+#ifdef ENABLE_PKCS11
+ pkcs11_logout ();
+#endif
+ purge_user_pass (&passbuf, true);
+ }
+ purge_user_pass (&auth_user_pass, true);
+#ifdef ENABLE_CLIENT_CR
+ ssl_purge_auth_challenge();
+#endif
+}
+
+#ifdef ENABLE_CLIENT_CR
+
+void
+ssl_purge_auth_challenge (void)
+{
+ free (auth_challenge);
+ auth_challenge = NULL;
+}
+
+void
+ssl_put_auth_challenge (const char *cr_str)
+{
+ ssl_purge_auth_challenge();
+ auth_challenge = string_alloc(cr_str, NULL);
+}
+
+#endif
+
+/*
+ * Parse a TLS version string, returning a TLS_VER_x constant.
+ * If version string is not recognized and extra == "or-highest",
+ * return tls_version_max().
+ */
+int
+tls_version_min_parse(const char *vstr, const char *extra)
+{
+ const int max_version = tls_version_max();
+ if (!strcmp(vstr, "1.0") && TLS_VER_1_0 <= max_version)
+ return TLS_VER_1_0;
+ else if (!strcmp(vstr, "1.1") && TLS_VER_1_1 <= max_version)
+ return TLS_VER_1_1;
+ else if (!strcmp(vstr, "1.2") && TLS_VER_1_2 <= max_version)
+ return TLS_VER_1_2;
+ else if (extra && !strcmp(extra, "or-highest"))
+ return max_version;
+ else
+ return TLS_VER_BAD;
+}
+
+/*
+ * Initialize SSL context.
+ * All files are in PEM format.
+ */
+void
+init_ssl (const struct options *options, struct tls_root_ctx *new_ctx)
+{
+ ASSERT(NULL != new_ctx);
+
+ tls_clear_error();
+
+ if (options->tls_server)
+ {
+ tls_ctx_server_new(new_ctx);
+ tls_ctx_load_dh_params(new_ctx, options->dh_file, options->dh_file_inline);
+ }
+ else /* if client */
+ {
+ tls_ctx_client_new(new_ctx);
+ }
+
+ tls_ctx_set_options(new_ctx, options->ssl_flags);
+
+ if (options->pkcs12_file)
+ {
+ if (0 != tls_ctx_load_pkcs12(new_ctx, options->pkcs12_file,
+ options->pkcs12_file_inline, !options->ca_file))
+ goto err;
+ }
+#ifdef ENABLE_PKCS11
+ else if (options->pkcs11_providers[0])
+ {
+ if (!tls_ctx_use_pkcs11 (new_ctx, options->pkcs11_id_management, options->pkcs11_id))
+ {
+ msg (M_WARN, "Cannot load certificate \"%s\" using PKCS#11 interface",
+ options->pkcs11_id);
+ goto err;
+ }
+ }
+#endif
+#ifdef ENABLE_CRYPTOAPI
+ else if (options->cryptoapi_cert)
+ {
+ tls_ctx_load_cryptoapi(new_ctx, options->cryptoapi_cert);
+ }
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ else if ((options->management_flags & MF_EXTERNAL_KEY) && options->cert_file)
+ {
+ tls_ctx_use_external_private_key(new_ctx, options->cert_file,
+ options->cert_file_inline);
+ }
+#endif
+ else
+ {
+ /* Load Certificate */
+ if (options->cert_file)
+ {
+ tls_ctx_load_cert_file(new_ctx, options->cert_file, options->cert_file_inline);
+ }
+
+ /* Load Private Key */
+ if (options->priv_key_file)
+ {
+ if (0 != tls_ctx_load_priv_file(new_ctx, options->priv_key_file, options->priv_key_file_inline))
+ goto err;
+ }
+ }
+
+ if (options->ca_file || options->ca_path)
+ {
+ tls_ctx_load_ca(new_ctx, options->ca_file, options->ca_file_inline,
+ options->ca_path, options->tls_server);
+ }
+
+ /* Load extra certificates that are part of our own certificate
+ chain but shouldn't be included in the verify chain */
+ if (options->extra_certs_file || options->extra_certs_file_inline)
+ {
+ tls_ctx_load_extra_certs(new_ctx, options->extra_certs_file, options->extra_certs_file_inline);
+ }
+
+ /* Once keys and cert are loaded, load ECDH parameters */
+ if (options->tls_server)
+ tls_ctx_load_ecdh_params(new_ctx, options->ecdh_curve);
+
+ /* Allowable ciphers */
+ tls_ctx_restrict_ciphers(new_ctx, options->cipher_list);
+
+#ifdef ENABLE_CRYPTO_POLARSSL
+ /* Personalise the random by mixing in the certificate */
+ tls_ctx_personalise_random (new_ctx);
+#endif
+
+ tls_clear_error ();
+ return;
+
+ err:
+ tls_clear_error ();
+ tls_ctx_free (new_ctx);
+ return;
+}
+
+/*
+ * Map internal constants to ascii names.
+ */
+static const char *
+state_name (int state)
+{
+ switch (state)
+ {
+ case S_UNDEF:
+ return "S_UNDEF";
+ case S_INITIAL:
+ return "S_INITIAL";
+ case S_PRE_START:
+ return "S_PRE_START";
+ case S_START:
+ return "S_START";
+ case S_SENT_KEY:
+ return "S_SENT_KEY";
+ case S_GOT_KEY:
+ return "S_GOT_KEY";
+ case S_ACTIVE:
+ return "S_ACTIVE";
+ case S_NORMAL_OP:
+ return "S_NORMAL_OP";
+ case S_ERROR:
+ return "S_ERROR";
+ default:
+ return "S_???";
+ }
+}
+
+static const char *
+packet_opcode_name (int op)
+{
+ switch (op)
+ {
+ case P_CONTROL_HARD_RESET_CLIENT_V1:
+ return "P_CONTROL_HARD_RESET_CLIENT_V1";
+ case P_CONTROL_HARD_RESET_SERVER_V1:
+ return "P_CONTROL_HARD_RESET_SERVER_V1";
+ case P_CONTROL_HARD_RESET_CLIENT_V2:
+ return "P_CONTROL_HARD_RESET_CLIENT_V2";
+ case P_CONTROL_HARD_RESET_SERVER_V2:
+ return "P_CONTROL_HARD_RESET_SERVER_V2";
+ case P_CONTROL_SOFT_RESET_V1:
+ return "P_CONTROL_SOFT_RESET_V1";
+ case P_CONTROL_V1:
+ return "P_CONTROL_V1";
+ case P_ACK_V1:
+ return "P_ACK_V1";
+ case P_DATA_V1:
+ return "P_DATA_V1";
+ case P_DATA_V2:
+ return "P_DATA_V2";
+ default:
+ return "P_???";
+ }
+}
+
+static const char *
+session_index_name (int index)
+{
+ switch (index)
+ {
+ case TM_ACTIVE:
+ return "TM_ACTIVE";
+ case TM_UNTRUSTED:
+ return "TM_UNTRUSTED";
+ case TM_LAME_DUCK:
+ return "TM_LAME_DUCK";
+ default:
+ return "TM_???";
+ }
+}
+
+/*
+ * For debugging.
+ */
+static const char *
+print_key_id (struct tls_multi *multi, struct gc_arena *gc)
+{
+ int i;
+ struct buffer out = alloc_buf_gc (256, gc);
+
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ buf_printf (&out, " [key#%d state=%s id=%d sid=%s]", i,
+ state_name (ks->state), ks->key_id,
+ session_id_print (&ks->session_id_remote, gc));
+ }
+
+ return BSTR (&out);
+}
+
+/*
+ * Given a key_method, return true if op
+ * represents the required form of hard_reset.
+ *
+ * If key_method = 0, return true if any
+ * form of hard reset is used.
+ */
+static bool
+is_hard_reset (int op, int key_method)
+{
+ if (!key_method || key_method == 1)
+ if (op == P_CONTROL_HARD_RESET_CLIENT_V1 || op == P_CONTROL_HARD_RESET_SERVER_V1)
+ return true;
+
+ if (!key_method || key_method >= 2)
+ if (op == P_CONTROL_HARD_RESET_CLIENT_V2 || op == P_CONTROL_HARD_RESET_SERVER_V2)
+ return true;
+
+ return false;
+}
+
+/** @addtogroup control_processor
+ * @{ */
+
+/** @name Functions for initialization and cleanup of key_state structures
+ * @{ */
+
+/**
+ * Initialize a \c key_state structure.
+ * @ingroup control_processor
+ *
+ * This function initializes a \c key_state structure associated with a \c
+ * tls_session. It sets up the structure's SSL-BIO, sets the object's \c
+ * key_state.state to \c S_INITIAL, and sets the session ID and key ID two
+ * appropriate values based on the \c tls_session's internal state. It
+ * also initializes a new set of structures for the \link reliable
+ * Reliability Layer\endlink.
+ *
+ * @param session - A pointer to the \c tls_session structure
+ * associated with the \a ks argument.
+ * @param ks - A pointer to the \c key_state structure to be
+ * initialized. This structure should already have
+ * been allocated before calling this function.
+ */
+static void
+key_state_init (struct tls_session *session, struct key_state *ks)
+{
+ update_time ();
+
+ CLEAR (*ks);
+
+ /*
+ * Build TLS object that reads/writes ciphertext
+ * to/from memory BIOs.
+ */
+ key_state_ssl_init(&ks->ks_ssl, &session->opt->ssl_ctx, session->opt->server,
+ session);
+
+ /* Set control-channel initiation mode */
+ ks->initial_opcode = session->initial_opcode;
+ session->initial_opcode = P_CONTROL_SOFT_RESET_V1;
+ ks->state = S_INITIAL;
+ ks->key_id = session->key_id;
+
+ /*
+ * key_id increments to KEY_ID_MASK then recycles back to 1.
+ * This way you know that if key_id is 0, it is the first key.
+ */
+ ++session->key_id;
+ session->key_id &= P_KEY_ID_MASK;
+ if (!session->key_id)
+ session->key_id = 1;
+
+ /* allocate key source material object */
+ ALLOC_OBJ_CLEAR (ks->key_src, struct key_source2);
+
+ /* allocate reliability objects */
+ ALLOC_OBJ_CLEAR (ks->send_reliable, struct reliable);
+ ALLOC_OBJ_CLEAR (ks->rec_reliable, struct reliable);
+ ALLOC_OBJ_CLEAR (ks->rec_ack, struct reliable_ack);
+
+ /* allocate buffers */
+ ks->plaintext_read_buf = alloc_buf (TLS_CHANNEL_BUF_SIZE);
+ ks->plaintext_write_buf = alloc_buf (TLS_CHANNEL_BUF_SIZE);
+ ks->ack_write_buf = alloc_buf (BUF_SIZE (&session->opt->frame));
+ reliable_init (ks->send_reliable, BUF_SIZE (&session->opt->frame),
+ FRAME_HEADROOM (&session->opt->frame), TLS_RELIABLE_N_SEND_BUFFERS,
+ ks->key_id ? false : session->opt->xmit_hold);
+ reliable_init (ks->rec_reliable, BUF_SIZE (&session->opt->frame),
+ FRAME_HEADROOM (&session->opt->frame), TLS_RELIABLE_N_REC_BUFFERS,
+ false);
+ reliable_set_timeout (ks->send_reliable, session->opt->packet_timeout);
+
+ /* init packet ID tracker */
+ packet_id_init (&ks->packet_id,
+ session->opt->tcp_mode,
+ session->opt->replay_window,
+ session->opt->replay_time,
+ "SSL", ks->key_id);
+
+#ifdef MANAGEMENT_DEF_AUTH
+ ks->mda_key_id = session->opt->mda_context->mda_key_id_counter++;
+#endif
+}
+
+
+/**
+ * Cleanup a \c key_state structure.
+ * @ingroup control_processor
+ *
+ * This function cleans up a \c key_state structure. It frees the
+ * associated SSL-BIO, and the structures allocated for the \link reliable
+ * Reliability Layer\endlink.
+ *
+ * @param ks - A pointer to the \c key_state structure to be
+ * cleaned up.
+ * @param clear - Whether the memory allocated for the \a ks object
+ * should be overwritten with 0s.
+ */
+static void
+key_state_free (struct key_state *ks, bool clear)
+{
+ ks->state = S_UNDEF;
+
+ key_state_ssl_free(&ks->ks_ssl);
+
+ free_key_ctx_bi (&ks->key);
+ free_buf (&ks->plaintext_read_buf);
+ free_buf (&ks->plaintext_write_buf);
+ free_buf (&ks->ack_write_buf);
+ buffer_list_free(ks->paybuf);
+
+ if (ks->send_reliable)
+ {
+ reliable_free (ks->send_reliable);
+ free (ks->send_reliable);
+ }
+
+ if (ks->rec_reliable)
+ {
+ reliable_free (ks->rec_reliable);
+ free (ks->rec_reliable);
+ }
+
+ if (ks->rec_ack)
+ free (ks->rec_ack);
+
+ if (ks->key_src)
+ free (ks->key_src);
+
+ packet_id_free (&ks->packet_id);
+
+#ifdef PLUGIN_DEF_AUTH
+ key_state_rm_auth_control_file (ks);
+#endif
+
+ if (clear)
+ CLEAR (*ks);
+}
+
+/** @} name Functions for initialization and cleanup of key_state structures */
+
+/** @} addtogroup control_processor */
+
+
+/*
+ * Must be called if we move a tls_session in memory.
+ */
+static inline void tls_session_set_self_referential_pointers (struct tls_session* session) {
+ session->tls_auth.packet_id = &session->tls_auth_pid;
+}
+
+/**
+ * Returns whether or not the server should check for username/password
+ *
+ * @param session The current TLS session
+ *
+ * @return true if username and password verification is enabled,
+ * false if not.
+ */
+static inline bool
+tls_session_user_pass_enabled(struct tls_session *session)
+{
+ return (session->opt->auth_user_pass_verify_script
+ || plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY)
+#ifdef MANAGEMENT_DEF_AUTH
+ || management_enable_def_auth (management)
+#endif
+ );
+}
+
+
+/** @addtogroup control_processor
+ * @{ */
+
+/** @name Functions for initialization and cleanup of tls_session structures
+ * @{ */
+
+/**
+ * Initialize a \c tls_session structure.
+ * @ingroup control_processor
+ *
+ * This function initializes a \c tls_session structure. This includes
+ * generating a random session ID, and initializing the \c KS_PRIMARY \c
+ * key_state in the \c tls_session.key array.
+ *
+ * @param multi - A pointer to the \c tls_multi structure
+ * associated with the \a session argument.
+ * @param session - A pointer to the \c tls_session structure to be
+ * initialized. This structure should already have
+ * been allocated before calling this function.
+ */
+static void
+tls_session_init (struct tls_multi *multi, struct tls_session *session)
+{
+ struct gc_arena gc = gc_new ();
+
+ dmsg (D_TLS_DEBUG, "TLS: tls_session_init: entry");
+
+ CLEAR (*session);
+
+ /* Set options data to point to parent's option structure */
+ session->opt = &multi->opt;
+
+ /* Randomize session # if it is 0 */
+ while (!session_id_defined(&session->session_id))
+ session_id_random (&session->session_id);
+
+ /* Are we a TLS server or client? */
+ ASSERT (session->opt->key_method >= 1);
+ if (session->opt->key_method == 1)
+ {
+ session->initial_opcode = session->opt->server ?
+ P_CONTROL_HARD_RESET_SERVER_V1 : P_CONTROL_HARD_RESET_CLIENT_V1;
+ }
+ else /* session->opt->key_method >= 2 */
+ {
+ session->initial_opcode = session->opt->server ?
+ P_CONTROL_HARD_RESET_SERVER_V2 : P_CONTROL_HARD_RESET_CLIENT_V2;
+ }
+
+ /* Initialize control channel authentication parameters */
+ session->tls_auth = session->opt->tls_auth;
+
+ /* Set session internal pointers (also called if session object is moved in memory) */
+ tls_session_set_self_referential_pointers (session);
+
+ /* initialize packet ID replay window for --tls-auth */
+ packet_id_init (session->tls_auth.packet_id,
+ session->opt->tcp_mode,
+ session->opt->replay_window,
+ session->opt->replay_time,
+ "TLS_AUTH", session->key_id);
+
+ /* load most recent packet-id to replay protect on --tls-auth */
+ packet_id_persist_load_obj (session->tls_auth.pid_persist, session->tls_auth.packet_id);
+
+ key_state_init (session, &session->key[KS_PRIMARY]);
+
+ dmsg (D_TLS_DEBUG, "TLS: tls_session_init: new session object, sid=%s",
+ session_id_print (&session->session_id, &gc));
+
+ gc_free (&gc);
+}
+
+/**
+ * Clean up a \c tls_session structure.
+ * @ingroup control_processor
+ *
+ * This function cleans up a \c tls_session structure. This includes
+ * cleaning up all associated \c key_state structures.
+ *
+ * @param session - A pointer to the \c tls_session structure to be
+ * cleaned up.
+ * @param clear - Whether the memory allocated for the \a session
+ * object should be overwritten with 0s.
+ */
+static void
+tls_session_free (struct tls_session *session, bool clear)
+{
+ int i;
+
+ if (session->tls_auth.packet_id)
+ packet_id_free (session->tls_auth.packet_id);
+
+ for (i = 0; i < KS_SIZE; ++i)
+ key_state_free (&session->key[i], false);
+
+ if (session->common_name)
+ free (session->common_name);
+
+ cert_hash_free (session->cert_hash_set);
+
+ if (clear)
+ CLEAR (*session);
+}
+
+/** @} name Functions for initialization and cleanup of tls_session structures */
+
+/** @} addtogroup control_processor */
+
+
+static void
+move_session (struct tls_multi* multi, int dest, int src, bool reinit_src)
+{
+ msg (D_TLS_DEBUG_LOW, "TLS: move_session: dest=%s src=%s reinit_src=%d",
+ session_index_name(dest),
+ session_index_name(src),
+ reinit_src);
+ ASSERT (src != dest);
+ ASSERT (src >= 0 && src < TM_SIZE);
+ ASSERT (dest >= 0 && dest < TM_SIZE);
+ tls_session_free (&multi->session[dest], false);
+ multi->session[dest] = multi->session[src];
+ tls_session_set_self_referential_pointers (&multi->session[dest]);
+
+ if (reinit_src)
+ tls_session_init (multi, &multi->session[src]);
+ else
+ CLEAR (multi->session[src]);
+
+ dmsg (D_TLS_DEBUG, "TLS: move_session: exit");
+}
+
+static void
+reset_session (struct tls_multi *multi, struct tls_session *session)
+{
+ tls_session_free (session, false);
+ tls_session_init (multi, session);
+}
+
+/*
+ * Used to determine in how many seconds we should be
+ * called again.
+ */
+static inline void
+compute_earliest_wakeup (interval_t *earliest, interval_t seconds_from_now) {
+ if (seconds_from_now < *earliest)
+ *earliest = seconds_from_now;
+ if (*earliest < 0)
+ *earliest = 0;
+}
+
+/*
+ * Return true if "lame duck" or retiring key has expired and can
+ * no longer be used.
+ */
+static inline bool
+lame_duck_must_die (const struct tls_session* session, interval_t *wakeup)
+{
+ const struct key_state* lame = &session->key[KS_LAME_DUCK];
+ if (lame->state >= S_INITIAL)
+ {
+ const time_t local_now = now;
+ ASSERT (lame->must_die); /* a lame duck key must always have an expiration */
+ if (local_now < lame->must_die)
+ {
+ compute_earliest_wakeup (wakeup, lame->must_die - local_now);
+ return false;
+ }
+ else
+ return true;
+ }
+ else if (lame->state == S_ERROR)
+ return true;
+ else
+ return false;
+}
+
+struct tls_multi *
+tls_multi_init (struct tls_options *tls_options)
+{
+ struct tls_multi *ret;
+
+ ALLOC_OBJ_CLEAR (ret, struct tls_multi);
+
+ /* get command line derived options */
+ ret->opt = *tls_options;
+
+ /* set up pointer to HMAC object for TLS packet authentication */
+ ret->opt.tls_auth.key_ctx_bi = &ret->opt.tls_auth_key;
+
+ /* set up list of keys to be scanned by data channel encrypt and decrypt routines */
+ ASSERT (SIZE (ret->key_scan) == 3);
+ ret->key_scan[0] = &ret->session[TM_ACTIVE].key[KS_PRIMARY];
+ ret->key_scan[1] = &ret->session[TM_ACTIVE].key[KS_LAME_DUCK];
+ ret->key_scan[2] = &ret->session[TM_LAME_DUCK].key[KS_LAME_DUCK];
+
+ /* By default not use P_DATA_V2 */
+ ret->use_session_id = false;
+
+ return ret;
+}
+
+void
+tls_multi_init_finalize (struct tls_multi* multi, const struct frame* frame)
+{
+ tls_init_control_channel_frame_parameters (frame, &multi->opt.frame);
+
+ /* initialize the active and untrusted sessions */
+
+ tls_session_init (multi, &multi->session[TM_ACTIVE]);
+
+ if (!multi->opt.single_session)
+ tls_session_init (multi, &multi->session[TM_UNTRUSTED]);
+}
+
+/*
+ * Initialize and finalize a standalone tls-auth verification object.
+ */
+
+struct tls_auth_standalone *
+tls_auth_standalone_init (struct tls_options *tls_options,
+ struct gc_arena *gc)
+{
+ struct tls_auth_standalone *tas;
+
+ ALLOC_OBJ_CLEAR_GC (tas, struct tls_auth_standalone, gc);
+
+ /* set up pointer to HMAC object for TLS packet authentication */
+ tas->tls_auth_key = tls_options->tls_auth_key;
+ tas->tls_auth_options.key_ctx_bi = &tas->tls_auth_key;
+ tas->tls_auth_options.flags |= CO_PACKET_ID_LONG_FORM;
+
+ /* get initial frame parms, still need to finalize */
+ tas->frame = tls_options->frame;
+
+ return tas;
+}
+
+void
+tls_auth_standalone_finalize (struct tls_auth_standalone *tas,
+ const struct frame *frame)
+{
+ tls_init_control_channel_frame_parameters (frame, &tas->frame);
+}
+
+/*
+ * Set local and remote option compatibility strings.
+ * Used to verify compatibility of local and remote option
+ * sets.
+ */
+void
+tls_multi_init_set_options (struct tls_multi* multi,
+ const char *local,
+ const char *remote)
+{
+#ifdef ENABLE_OCC
+ /* initialize options string */
+ multi->opt.local_options = local;
+ multi->opt.remote_options = remote;
+#endif
+}
+
+/*
+ * Cleanup a tls_multi structure and free associated memory allocations.
+ */
+void
+tls_multi_free (struct tls_multi *multi, bool clear)
+{
+ int i;
+
+ ASSERT (multi);
+
+#ifdef MANAGEMENT_DEF_AUTH
+ man_def_auth_set_client_reason(multi, NULL);
+
+#endif
+#if P2MP_SERVER
+ free (multi->peer_info);
+#endif
+
+ if (multi->locked_cn)
+ free (multi->locked_cn);
+
+ if (multi->locked_username)
+ free (multi->locked_username);
+
+ cert_hash_free (multi->locked_cert_hash_set);
+
+ for (i = 0; i < TM_SIZE; ++i)
+ tls_session_free (&multi->session[i], false);
+
+ if (clear)
+ CLEAR (*multi);
+
+ free(multi);
+}
+
+
+/*
+ * Move a packet authentication HMAC + related fields to or from the front
+ * of the buffer so it can be processed by encrypt/decrypt.
+ */
+
+/*
+ * Dependent on hmac size, opcode size, and session_id size.
+ * Will assert if too small.
+ */
+#define SWAP_BUF_SIZE 256
+
+static bool
+swap_hmac (struct buffer *buf, const struct crypto_options *co, bool incoming)
+{
+ struct key_ctx *ctx;
+
+ ASSERT (co);
+
+ ctx = (incoming ? &co->key_ctx_bi->decrypt : &co->key_ctx_bi->encrypt);
+ ASSERT (ctx->hmac);
+
+ {
+ /* hmac + packet_id (8 bytes) */
+ const int hmac_size = hmac_ctx_size (ctx->hmac) + packet_id_size (true);
+
+ /* opcode + session_id */
+ const int osid_size = 1 + SID_SIZE;
+
+ int e1, e2;
+ uint8_t *b = BPTR (buf);
+ uint8_t buf1[SWAP_BUF_SIZE];
+ uint8_t buf2[SWAP_BUF_SIZE];
+
+ if (incoming)
+ {
+ e1 = osid_size;
+ e2 = hmac_size;
+ }
+ else
+ {
+ e1 = hmac_size;
+ e2 = osid_size;
+ }
+
+ ASSERT (e1 <= SWAP_BUF_SIZE && e2 <= SWAP_BUF_SIZE);
+
+ if (buf->len >= e1 + e2)
+ {
+ memcpy (buf1, b, e1);
+ memcpy (buf2, b + e1, e2);
+ memcpy (b, buf2, e2);
+ memcpy (b + e2, buf1, e1);
+ return true;
+ }
+ else
+ return false;
+ }
+}
+
+#undef SWAP_BUF_SIZE
+
+/*
+ * Write a control channel authentication record.
+ */
+static void
+write_control_auth (struct tls_session *session,
+ struct key_state *ks,
+ struct buffer *buf,
+ struct link_socket_actual **to_link_addr,
+ int opcode,
+ int max_ack,
+ bool prepend_ack)
+{
+ uint8_t *header;
+ struct buffer null = clear_buf ();
+
+ ASSERT (link_socket_actual_defined (&ks->remote_addr));
+ ASSERT (reliable_ack_write
+ (ks->rec_ack, buf, &ks->session_id_remote, max_ack, prepend_ack));
+ ASSERT (session_id_write_prepend (&session->session_id, buf));
+ ASSERT (header = buf_prepend (buf, 1));
+ *header = ks->key_id | (opcode << P_OPCODE_SHIFT);
+ if (session->tls_auth.key_ctx_bi->encrypt.hmac)
+ {
+ /* no encryption, only write hmac */
+ openvpn_encrypt (buf, null, &session->tls_auth, NULL);
+ ASSERT (swap_hmac (buf, &session->tls_auth, false));
+ }
+ *to_link_addr = &ks->remote_addr;
+}
+
+/*
+ * Read a control channel authentication record.
+ */
+static bool
+read_control_auth (struct buffer *buf,
+ const struct crypto_options *co,
+ const struct link_socket_actual *from)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (co->key_ctx_bi->decrypt.hmac)
+ {
+ struct buffer null = clear_buf ();
+
+ /* move the hmac record to the front of the packet */
+ if (!swap_hmac (buf, co, true))
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: cannot locate HMAC in incoming packet from %s",
+ print_link_socket_actual (from, &gc));
+ gc_free (&gc);
+ return false;
+ }
+
+ /* authenticate only (no decrypt) and remove the hmac record
+ from the head of the buffer */
+ openvpn_decrypt (buf, null, co, NULL);
+ if (!buf->len)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: incoming packet authentication failed from %s",
+ print_link_socket_actual (from, &gc));
+ gc_free (&gc);
+ return false;
+ }
+
+ }
+
+ /* advance buffer pointer past opcode & session_id since our caller
+ already read it */
+ buf_advance (buf, SID_SIZE + 1);
+
+ gc_free (&gc);
+ return true;
+}
+
+/*
+ * For debugging, print contents of key_source2 structure.
+ */
+
+static void
+key_source_print (const struct key_source *k,
+ const char *prefix)
+{
+ struct gc_arena gc = gc_new ();
+
+ VALGRIND_MAKE_READABLE ((void *)k->pre_master, sizeof (k->pre_master));
+ VALGRIND_MAKE_READABLE ((void *)k->random1, sizeof (k->random1));
+ VALGRIND_MAKE_READABLE ((void *)k->random2, sizeof (k->random2));
+
+ dmsg (D_SHOW_KEY_SOURCE,
+ "%s pre_master: %s",
+ prefix,
+ format_hex (k->pre_master, sizeof (k->pre_master), 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE,
+ "%s random1: %s",
+ prefix,
+ format_hex (k->random1, sizeof (k->random1), 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE,
+ "%s random2: %s",
+ prefix,
+ format_hex (k->random2, sizeof (k->random2), 0, &gc));
+
+ gc_free (&gc);
+}
+
+static void
+key_source2_print (const struct key_source2 *k)
+{
+ key_source_print (&k->client, "Client");
+ key_source_print (&k->server, "Server");
+}
+
+/*
+ * Generate the hash required by for the \c tls1_PRF function.
+ *
+ * @param md_kt Message digest to use
+ * @param sec Secret to base the hash on
+ * @param sec_len Length of the secret
+ * @param seed Seed to hash
+ * @param seed_len Length of the seed
+ * @param out Output buffer
+ * @param olen Length of the output buffer
+ */
+void
+tls1_P_hash(const md_kt_t *md_kt,
+ const uint8_t *sec,
+ int sec_len,
+ const uint8_t *seed,
+ int seed_len,
+ uint8_t *out,
+ int olen)
+{
+ struct gc_arena gc = gc_new ();
+ int chunk;
+ hmac_ctx_t ctx;
+ hmac_ctx_t ctx_tmp;
+ uint8_t A1[MAX_HMAC_KEY_LENGTH];
+ unsigned int A1_len;
+
+#ifdef ENABLE_DEBUG
+ const int olen_orig = olen;
+ const uint8_t *out_orig = out;
+#endif
+
+ CLEAR(ctx);
+ CLEAR(ctx_tmp);
+
+ dmsg (D_SHOW_KEY_SOURCE, "tls1_P_hash sec: %s", format_hex (sec, sec_len, 0, &gc));
+ dmsg (D_SHOW_KEY_SOURCE, "tls1_P_hash seed: %s", format_hex (seed, seed_len, 0, &gc));
+
+ chunk = md_kt_size(md_kt);
+ A1_len = md_kt_size(md_kt);
+
+ hmac_ctx_init(&ctx, sec, sec_len, md_kt);
+ hmac_ctx_init(&ctx_tmp, sec, sec_len, md_kt);
+
+ hmac_ctx_update(&ctx,seed,seed_len);
+ hmac_ctx_final(&ctx, A1);
+
+ for (;;)
+ {
+ hmac_ctx_reset(&ctx);
+ hmac_ctx_reset(&ctx_tmp);
+ hmac_ctx_update(&ctx,A1,A1_len);
+ hmac_ctx_update(&ctx_tmp,A1,A1_len);
+ hmac_ctx_update(&ctx,seed,seed_len);
+
+ if (olen > chunk)
+ {
+ hmac_ctx_final(&ctx, out);
+ out+=chunk;
+ olen-=chunk;
+ hmac_ctx_final(&ctx_tmp, A1); /* calc the next A1 value */
+ }
+ else /* last one */
+ {
+ hmac_ctx_final(&ctx, A1);
+ memcpy(out,A1,olen);
+ break;
+ }
+ }
+ hmac_ctx_cleanup(&ctx);
+ hmac_ctx_cleanup(&ctx_tmp);
+ CLEAR (A1);
+
+ dmsg (D_SHOW_KEY_SOURCE, "tls1_P_hash out: %s", format_hex (out_orig, olen_orig, 0, &gc));
+ gc_free (&gc);
+}
+
+/*
+ * Use the TLS PRF function for generating data channel keys.
+ * This code is based on the OpenSSL library.
+ *
+ * TLS generates keys as such:
+ *
+ * master_secret[48] = PRF(pre_master_secret[48], "master secret",
+ * ClientHello.random[32] + ServerHello.random[32])
+ *
+ * key_block[] = PRF(SecurityParameters.master_secret[48],
+ * "key expansion",
+ * SecurityParameters.server_random[32] +
+ * SecurityParameters.client_random[32]);
+ *
+ * Notes:
+ *
+ * (1) key_block contains a full set of 4 keys.
+ * (2) The pre-master secret is generated by the client.
+ */
+static void
+tls1_PRF(uint8_t *label,
+ int label_len,
+ const uint8_t *sec,
+ int slen,
+ uint8_t *out1,
+ int olen)
+{
+ struct gc_arena gc = gc_new ();
+ const md_kt_t *md5 = md_kt_get("MD5");
+ const md_kt_t *sha1 = md_kt_get("SHA1");
+ int len,i;
+ const uint8_t *S1,*S2;
+ uint8_t *out2;
+
+ out2 = (uint8_t *) gc_malloc (olen, false, &gc);
+
+ len=slen/2;
+ S1=sec;
+ S2= &(sec[len]);
+ len+=(slen&1); /* add for odd, make longer */
+
+ tls1_P_hash(md5 ,S1,len,label,label_len,out1,olen);
+ tls1_P_hash(sha1,S2,len,label,label_len,out2,olen);
+
+ for (i=0; i<olen; i++)
+ out1[i]^=out2[i];
+
+ memset (out2, 0, olen);
+
+ dmsg (D_SHOW_KEY_SOURCE, "tls1_PRF out[%d]: %s", olen, format_hex (out1, olen, 0, &gc));
+
+ gc_free (&gc);
+}
+
+static void
+openvpn_PRF (const uint8_t *secret,
+ int secret_len,
+ const char *label,
+ const uint8_t *client_seed,
+ int client_seed_len,
+ const uint8_t *server_seed,
+ int server_seed_len,
+ const struct session_id *client_sid,
+ const struct session_id *server_sid,
+ uint8_t *output,
+ int output_len)
+{
+ /* concatenate seed components */
+
+ struct buffer seed = alloc_buf (strlen (label)
+ + client_seed_len
+ + server_seed_len
+ + SID_SIZE * 2);
+
+ ASSERT (buf_write (&seed, label, strlen (label)));
+ ASSERT (buf_write (&seed, client_seed, client_seed_len));
+ ASSERT (buf_write (&seed, server_seed, server_seed_len));
+
+ if (client_sid)
+ ASSERT (buf_write (&seed, client_sid->id, SID_SIZE));
+ if (server_sid)
+ ASSERT (buf_write (&seed, server_sid->id, SID_SIZE));
+
+ /* compute PRF */
+ tls1_PRF (BPTR(&seed), BLEN(&seed), secret, secret_len, output, output_len);
+
+ buf_clear (&seed);
+ free_buf (&seed);
+
+ VALGRIND_MAKE_READABLE ((void *)output, output_len);
+}
+
+/*
+ * Using source entropy from local and remote hosts, mix into
+ * master key.
+ */
+static bool
+generate_key_expansion (struct key_ctx_bi *key,
+ const struct key_type *key_type,
+ const struct key_source2 *key_src,
+ const struct session_id *client_sid,
+ const struct session_id *server_sid,
+ bool server)
+{
+ uint8_t master[48];
+ struct key2 key2;
+ bool ret = false;
+ int i;
+
+ CLEAR (master);
+ CLEAR (key2);
+
+ /* debugging print of source key material */
+ key_source2_print (key_src);
+
+ /* compute master secret */
+ openvpn_PRF (key_src->client.pre_master,
+ sizeof(key_src->client.pre_master),
+ KEY_EXPANSION_ID " master secret",
+ key_src->client.random1,
+ sizeof(key_src->client.random1),
+ key_src->server.random1,
+ sizeof(key_src->server.random1),
+ NULL,
+ NULL,
+ master,
+ sizeof(master));
+
+ /* compute key expansion */
+ openvpn_PRF (master,
+ sizeof(master),
+ KEY_EXPANSION_ID " key expansion",
+ key_src->client.random2,
+ sizeof(key_src->client.random2),
+ key_src->server.random2,
+ sizeof(key_src->server.random2),
+ client_sid,
+ server_sid,
+ (uint8_t*)key2.keys,
+ sizeof(key2.keys));
+
+ key2.n = 2;
+
+ key2_print (&key2, key_type, "Master Encrypt", "Master Decrypt");
+
+ /* check for weak keys */
+ for (i = 0; i < 2; ++i)
+ {
+ fixup_key (&key2.keys[i], key_type);
+ if (!check_key (&key2.keys[i], key_type))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Bad dynamic key generated");
+ goto exit;
+ }
+ }
+
+ /* Initialize OpenSSL key contexts */
+
+ ASSERT (server == true || server == false);
+
+ init_key_ctx (&key->encrypt,
+ &key2.keys[(int)server],
+ key_type,
+ OPENVPN_OP_ENCRYPT,
+ "Data Channel Encrypt");
+
+ init_key_ctx (&key->decrypt,
+ &key2.keys[1-(int)server],
+ key_type,
+ OPENVPN_OP_DECRYPT,
+ "Data Channel Decrypt");
+
+ ret = true;
+
+ exit:
+ CLEAR (master);
+ CLEAR (key2);
+
+ return ret;
+}
+
+static bool
+random_bytes_to_buf (struct buffer *buf,
+ uint8_t *out,
+ int outlen)
+{
+ if (!rand_bytes (out, outlen))
+ msg (M_FATAL, "ERROR: Random number generator cannot obtain entropy for key generation [SSL]");
+ if (!buf_write (buf, out, outlen))
+ return false;
+ return true;
+}
+
+static bool
+key_source2_randomize_write (struct key_source2 *k2,
+ struct buffer *buf,
+ bool server)
+{
+ struct key_source *k = &k2->client;
+ if (server)
+ k = &k2->server;
+
+ CLEAR (*k);
+
+ if (!server)
+ {
+ if (!random_bytes_to_buf (buf, k->pre_master, sizeof (k->pre_master)))
+ return false;
+ }
+
+ if (!random_bytes_to_buf (buf, k->random1, sizeof (k->random1)))
+ return false;
+ if (!random_bytes_to_buf (buf, k->random2, sizeof (k->random2)))
+ return false;
+
+ return true;
+}
+
+static int
+key_source2_read (struct key_source2 *k2,
+ struct buffer *buf,
+ bool server)
+{
+ struct key_source *k = &k2->client;
+
+ if (!server)
+ k = &k2->server;
+
+ CLEAR (*k);
+
+ if (server)
+ {
+ if (!buf_read (buf, k->pre_master, sizeof (k->pre_master)))
+ return 0;
+ }
+
+ if (!buf_read (buf, k->random1, sizeof (k->random1)))
+ return 0;
+ if (!buf_read (buf, k->random2, sizeof (k->random2)))
+ return 0;
+
+ return 1;
+}
+
+static void
+flush_payload_buffer (struct key_state *ks)
+{
+ struct buffer *b;
+
+ while ((b = buffer_list_peek (ks->paybuf)))
+ {
+ key_state_write_plaintext_const (&ks->ks_ssl, b->data, b->len);
+ buffer_list_pop (ks->paybuf);
+ }
+}
+
+/* true if no in/out acknowledgements pending */
+#define FULL_SYNC \
+ (reliable_empty(ks->send_reliable) && reliable_ack_empty (ks->rec_ack))
+
+/*
+ * Move the active key to the lame duck key and reinitialize the
+ * active key.
+ */
+static void
+key_state_soft_reset (struct tls_session *session)
+{
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+ struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */
+
+ ks->must_die = now + session->opt->transition_window; /* remaining lifetime of old key */
+ key_state_free (ks_lame, false);
+ *ks_lame = *ks;
+
+ key_state_init (session, ks);
+ ks->session_id_remote = ks_lame->session_id_remote;
+ ks->remote_addr = ks_lame->remote_addr;
+}
+
+/*
+ * Read/write strings from/to a struct buffer with a u16 length prefix.
+ */
+
+static bool
+write_empty_string (struct buffer *buf)
+{
+ if (!buf_write_u16 (buf, 0))
+ return false;
+ return true;
+}
+
+static bool
+write_string (struct buffer *buf, const char *str, const int maxlen)
+{
+ const int len = strlen (str) + 1;
+ if (len < 1 || (maxlen >= 0 && len > maxlen))
+ return false;
+ if (!buf_write_u16 (buf, len))
+ return false;
+ if (!buf_write (buf, str, len))
+ return false;
+ return true;
+}
+
+static bool
+read_string (struct buffer *buf, char *str, const unsigned int capacity)
+{
+ const int len = buf_read_u16 (buf);
+ if (len < 1 || len > (int)capacity)
+ return false;
+ if (!buf_read (buf, str, len))
+ return false;
+ str[len-1] = '\0';
+ return true;
+}
+
+static char *
+read_string_alloc (struct buffer *buf)
+{
+ const int len = buf_read_u16 (buf);
+ char *str;
+
+ if (len < 1)
+ return NULL;
+ str = (char *) malloc(len);
+ check_malloc_return(str);
+ if (!buf_read (buf, str, len))
+ {
+ free (str);
+ return NULL;
+ }
+ str[len-1] = '\0';
+ return str;
+}
+
+void
+read_string_discard (struct buffer *buf)
+{
+ char *data = read_string_alloc(buf);
+ if (data)
+ free (data);
+}
+
+/*
+ * Handle the reading and writing of key data to and from
+ * the TLS control channel (cleartext).
+ */
+
+static bool
+key_method_1_write (struct buffer *buf, struct tls_session *session)
+{
+ struct key key;
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ ASSERT (session->opt->key_method == 1);
+ ASSERT (buf_init (buf, 0));
+
+ generate_key_random (&key, &session->opt->key_type);
+ if (!check_key (&key, &session->opt->key_type))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Bad encrypting key generated");
+ return false;
+ }
+
+ if (!write_key (&key, &session->opt->key_type, buf))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: write_key failed");
+ return false;
+ }
+
+ init_key_ctx (&ks->key.encrypt, &key, &session->opt->key_type,
+ OPENVPN_OP_ENCRYPT, "Data Channel Encrypt");
+ CLEAR (key);
+
+ /* send local options string */
+ {
+ const char *local_options = local_options_string (session);
+ const int optlen = strlen (local_options) + 1;
+ if (!buf_write (buf, local_options, optlen))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: KM1 write options failed");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static bool
+push_peer_info(struct buffer *buf, struct tls_session *session)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+
+#ifdef ENABLE_PUSH_PEER_INFO
+ if (session->opt->push_peer_info_detail > 0)
+ {
+ struct env_set *es = session->opt->es;
+ struct env_item *e;
+ struct buffer out = alloc_buf_gc (512*3, &gc);
+
+ /* push version */
+ buf_printf (&out, "IV_VER=%s\n", PACKAGE_VERSION);
+
+ /* push platform */
+#if defined(TARGET_LINUX)
+ buf_printf (&out, "IV_PLAT=linux\n");
+#elif defined(TARGET_SOLARIS)
+ buf_printf (&out, "IV_PLAT=solaris\n");
+#elif defined(TARGET_OPENBSD)
+ buf_printf (&out, "IV_PLAT=openbsd\n");
+#elif defined(TARGET_DARWIN)
+ buf_printf (&out, "IV_PLAT=mac\n");
+#elif defined(TARGET_NETBSD)
+ buf_printf (&out, "IV_PLAT=netbsd\n");
+#elif defined(TARGET_FREEBSD)
+ buf_printf (&out, "IV_PLAT=freebsd\n");
+#elif defined(TARGET_ANDROID)
+ buf_printf (&out, "IV_PLAT=android\n");
+#elif defined(WIN32)
+ buf_printf (&out, "IV_PLAT=win\n");
+#endif
+
+ /* support for P_DATA_V2 */
+ buf_printf(&out, "IV_PROTO=2\n");
+
+ /* push compression status */
+#ifdef USE_COMP
+ comp_generate_peer_info_string(&session->opt->comp_options, &out);
+#endif
+
+ if (session->opt->push_peer_info_detail >= 2)
+ {
+ /* push mac addr */
+ struct route_gateway_info rgi;
+ get_default_gateway (&rgi);
+ if (rgi.flags & RGI_HWADDR_DEFINED)
+ buf_printf (&out, "IV_HWADDR=%s\n", format_hex_ex (rgi.hwaddr, 6, 0, 1, ":", &gc));
+ buf_printf (&out, "IV_SSL=%s\n", get_ssl_library_version() );
+ }
+
+ /* push env vars that begin with UV_ and IV_GUI_VER */
+ for (e=es->list; e != NULL; e=e->next)
+ {
+ if (e->string)
+ {
+ if (((strncmp(e->string, "UV_", 3)==0 && session->opt->push_peer_info_detail >= 2)
+ || (strncmp(e->string,"IV_GUI_VER=",sizeof("IV_GUI_VER=")-1)==0))
+ && buf_safe(&out, strlen(e->string)+1))
+ buf_printf (&out, "%s\n", e->string);
+ }
+ }
+
+ if (!write_string(buf, BSTR(&out), -1))
+ goto error;
+ }
+ else
+#endif
+ {
+ if (!write_empty_string (buf)) /* no peer info */
+ goto error;
+ }
+ ret = true;
+
+ error:
+ gc_free (&gc);
+ return ret;
+}
+
+static bool
+key_method_2_write (struct buffer *buf, struct tls_session *session)
+{
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ ASSERT (session->opt->key_method == 2);
+ ASSERT (buf_init (buf, 0));
+
+ /* write a uint32 0 */
+ if (!buf_write_u32 (buf, 0))
+ goto error;
+
+ /* write key_method + flags */
+ if (!buf_write_u8 (buf, (session->opt->key_method & KEY_METHOD_MASK)))
+ goto error;
+
+ /* write key source material */
+ if (!key_source2_randomize_write (ks->key_src, buf, session->opt->server))
+ goto error;
+
+ /* write options string */
+ {
+ if (!write_string (buf, local_options_string (session), TLS_OPTIONS_LEN))
+ goto error;
+ }
+
+ /* write username/password if specified */
+ if (auth_user_pass_enabled)
+ {
+#ifdef ENABLE_CLIENT_CR
+ auth_user_pass_setup (NULL, session->opt->sci);
+#else
+ auth_user_pass_setup (NULL, NULL);
+#endif
+ if (!write_string (buf, auth_user_pass.username, -1))
+ goto error;
+ if (!write_string (buf, auth_user_pass.password, -1))
+ goto error;
+ purge_user_pass (&auth_user_pass, false);
+ }
+ else
+ {
+ if (!write_empty_string (buf)) /* no username */
+ goto error;
+ if (!write_empty_string (buf)) /* no password */
+ goto error;
+ }
+
+ if (!push_peer_info (buf, session))
+ goto error;
+
+ /*
+ * generate tunnel keys if server
+ */
+ if (session->opt->server)
+ {
+ if (ks->authenticated)
+ {
+ if (!generate_key_expansion (&ks->key,
+ &session->opt->key_type,
+ ks->key_src,
+ &ks->session_id_remote,
+ &session->session_id,
+ true))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: server generate_key_expansion failed");
+ goto error;
+ }
+ }
+
+ CLEAR (*ks->key_src);
+ }
+
+ return true;
+
+ error:
+ msg (D_TLS_ERRORS, "TLS Error: Key Method #2 write failed");
+ CLEAR (*ks->key_src);
+ return false;
+}
+
+static bool
+key_method_1_read (struct buffer *buf, struct tls_session *session)
+{
+ int status;
+ struct key key;
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ ASSERT (session->opt->key_method == 1);
+
+ if (!session->verified)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Certificate verification failed (key-method 1)");
+ goto error;
+ }
+
+ status = read_key (&key, &session->opt->key_type, buf);
+ if (status != 1)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Error reading data channel key from plaintext buffer");
+ goto error;
+ }
+
+ if (!check_key (&key, &session->opt->key_type))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Bad decrypting key received from peer");
+ goto error;
+ }
+
+ if (buf->len < 1)
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Missing options string");
+ goto error;
+ }
+
+#ifdef ENABLE_OCC
+ /* compare received remote options string
+ with our locally computed options string */
+ if (!session->opt->disable_occ &&
+ !options_cmp_equal_safe ((char *) BPTR (buf), session->opt->remote_options, buf->len))
+ {
+ options_warning_safe ((char *) BPTR (buf), session->opt->remote_options, buf->len);
+ }
+#endif
+
+ buf_clear (buf);
+
+ init_key_ctx (&ks->key.decrypt, &key, &session->opt->key_type,
+ OPENVPN_OP_DECRYPT, "Data Channel Decrypt");
+ CLEAR (key);
+ ks->authenticated = true;
+ return true;
+
+ error:
+ buf_clear (buf);
+ CLEAR (key);
+ return false;
+}
+
+static bool
+key_method_2_read (struct buffer *buf, struct tls_multi *multi, struct tls_session *session)
+{
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ int key_method_flags;
+ bool username_status, password_status;
+
+ struct gc_arena gc = gc_new ();
+ char *options;
+ struct user_pass *up;
+
+ /* allocate temporary objects */
+ ALLOC_ARRAY_CLEAR_GC (options, char, TLS_OPTIONS_LEN, &gc);
+
+ ASSERT (session->opt->key_method == 2);
+
+ /* discard leading uint32 */
+ ASSERT (buf_advance (buf, 4));
+
+ /* get key method */
+ key_method_flags = buf_read_u8 (buf);
+ if ((key_method_flags & KEY_METHOD_MASK) != 2)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: Unknown key_method/flags=%d received from remote host",
+ key_method_flags);
+ goto error;
+ }
+
+ /* get key source material (not actual keys yet) */
+ if (!key_source2_read (ks->key_src, buf, session->opt->server))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Error reading remote data channel key source entropy from plaintext buffer");
+ goto error;
+ }
+
+ /* get options */
+ if (!read_string (buf, options, TLS_OPTIONS_LEN))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Failed to read required OCC options string");
+ goto error;
+ }
+
+ ks->authenticated = false;
+
+ /* always extract username + password fields from buf, even if not
+ * authenticating for it, because otherwise we can't get at the
+ * peer_info data which follows behind
+ */
+ ALLOC_OBJ_CLEAR_GC (up, struct user_pass, &gc);
+ username_status = read_string (buf, up->username, USER_PASS_LEN);
+ password_status = read_string (buf, up->password, USER_PASS_LEN);
+
+#if P2MP_SERVER
+ /* get peer info from control channel */
+ free (multi->peer_info);
+ multi->peer_info = read_string_alloc (buf);
+ if ( multi->peer_info )
+ output_peer_info_env (session->opt->es, multi->peer_info);
+#endif
+
+ if (tls_session_user_pass_enabled(session))
+ {
+ /* Perform username/password authentication */
+ if (!username_status || !password_status)
+ {
+ CLEAR (*up);
+ if (!(session->opt->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Auth Username/Password was not provided by peer");
+ goto error;
+ }
+ }
+
+ verify_user_pass(up, multi, session);
+ }
+ else
+ {
+ /* Session verification should have occurred during TLS negotiation*/
+ if (!session->verified)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Certificate verification failed (key-method 2)");
+ goto error;
+ }
+ ks->authenticated = true;
+ }
+
+ /* clear username and password from memory */
+ CLEAR (*up);
+
+ /* Perform final authentication checks */
+ if (ks->authenticated)
+ {
+ verify_final_auth_checks(multi, session);
+ }
+
+#ifdef ENABLE_OCC
+ /* check options consistency */
+ if (!session->opt->disable_occ &&
+ !options_cmp_equal (options, session->opt->remote_options))
+ {
+ options_warning (options, session->opt->remote_options);
+ if (session->opt->ssl_flags & SSLF_OPT_VERIFY)
+ {
+ msg (D_TLS_ERRORS, "Option inconsistency warnings triggering disconnect due to --opt-verify");
+ ks->authenticated = false;
+ }
+ }
+#endif
+
+ buf_clear (buf);
+
+ /*
+ * Call OPENVPN_PLUGIN_TLS_FINAL plugin if defined, for final
+ * veto opportunity over authentication decision.
+ */
+ if (ks->authenticated && plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_TLS_FINAL))
+ {
+ if (plugin_call (session->opt->plugins, OPENVPN_PLUGIN_TLS_FINAL, NULL, NULL, session->opt->es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
+ ks->authenticated = false;
+ }
+
+ /*
+ * Generate tunnel keys if client
+ */
+ if (!session->opt->server)
+ {
+ if (!generate_key_expansion (&ks->key,
+ &session->opt->key_type,
+ ks->key_src,
+ &session->session_id,
+ &ks->session_id_remote,
+ false))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: client generate_key_expansion failed");
+ goto error;
+ }
+
+ CLEAR (*ks->key_src);
+ }
+
+ gc_free (&gc);
+ return true;
+
+ error:
+ CLEAR (*ks->key_src);
+ buf_clear (buf);
+ gc_free (&gc);
+ return false;
+}
+
+static int
+auth_deferred_expire_window (const struct tls_options *o)
+{
+ int ret = o->handshake_window;
+ const int r2 = o->renegotiate_seconds / 2;
+
+ if (o->renegotiate_seconds && r2 < ret)
+ ret = r2;
+ return ret;
+}
+
+/*
+ * This is the primary routine for processing TLS stuff inside the
+ * the main event loop. When this routine exits
+ * with non-error status, it will set *wakeup to the number of seconds
+ * when it wants to be called again.
+ *
+ * Return value is true if we have placed a packet in *to_link which we
+ * want to send to our peer.
+ */
+static bool
+tls_process (struct tls_multi *multi,
+ struct tls_session *session,
+ struct buffer *to_link,
+ struct link_socket_actual **to_link_addr,
+ struct link_socket_info *to_link_socket_info,
+ interval_t *wakeup)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer *buf;
+ bool state_change = false;
+ bool active = false;
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+ struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */
+
+ /* Make sure we were initialized and that we're not in an error state */
+ ASSERT (ks->state != S_UNDEF);
+ ASSERT (ks->state != S_ERROR);
+ ASSERT (session_id_defined (&session->session_id));
+
+ /* Should we trigger a soft reset? -- new key, keeps old key for a while */
+ if (ks->state >= S_ACTIVE &&
+ ((session->opt->renegotiate_seconds
+ && now >= ks->established + session->opt->renegotiate_seconds)
+ || (session->opt->renegotiate_bytes
+ && ks->n_bytes >= session->opt->renegotiate_bytes)
+ || (session->opt->renegotiate_packets
+ && ks->n_packets >= session->opt->renegotiate_packets)
+ || (packet_id_close_to_wrapping (&ks->packet_id.send))))
+ {
+ msg (D_TLS_DEBUG_LOW,
+ "TLS: soft reset sec=%d bytes=" counter_format "/%d pkts=" counter_format "/%d",
+ (int)(ks->established + session->opt->renegotiate_seconds - now),
+ ks->n_bytes, session->opt->renegotiate_bytes,
+ ks->n_packets, session->opt->renegotiate_packets);
+ key_state_soft_reset (session);
+ }
+
+ /* Kill lame duck key transition_window seconds after primary key negotiation */
+ if (lame_duck_must_die (session, wakeup)) {
+ key_state_free (ks_lame, true);
+ msg (D_TLS_DEBUG_LOW, "TLS: tls_process: killed expiring key");
+ }
+
+ do
+ {
+ update_time ();
+
+ dmsg (D_TLS_DEBUG, "TLS: tls_process: chg=%d ks=%s lame=%s to_link->len=%d wakeup=%d",
+ state_change,
+ state_name (ks->state),
+ state_name (ks_lame->state),
+ to_link->len,
+ *wakeup);
+
+ state_change = false;
+
+ /*
+ * TLS activity is finished once we get to S_ACTIVE,
+ * though we will still process acknowledgements.
+ *
+ * CHANGED with 2.0 -> now we may send tunnel configuration
+ * info over the control channel.
+ */
+ if (true)
+ {
+ /* Initial handshake */
+ if (ks->state == S_INITIAL)
+ {
+ buf = reliable_get_buf_output_sequenced (ks->send_reliable);
+ if (buf)
+ {
+ ks->must_negotiate = now + session->opt->handshake_window;
+ ks->auth_deferred_expire = now + auth_deferred_expire_window (session->opt);
+
+ /* null buffer */
+ reliable_mark_active_outgoing (ks->send_reliable, buf, ks->initial_opcode);
+ INCR_GENERATED;
+
+ ks->state = S_PRE_START;
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "TLS: Initial Handshake, sid=%s",
+ session_id_print (&session->session_id, &gc));
+
+#ifdef ENABLE_MANAGEMENT
+ if (management && ks->initial_opcode != P_CONTROL_SOFT_RESET_V1)
+ {
+ management_set_state (management,
+ OPENVPN_STATE_WAIT,
+ NULL,
+ 0,
+ 0);
+ }
+#endif
+ }
+ }
+
+ /* Are we timed out on receive? */
+ if (now >= ks->must_negotiate)
+ {
+ if (ks->state < S_ACTIVE)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: TLS key negotiation failed to occur within %d seconds (check your network connectivity)",
+ session->opt->handshake_window);
+ goto error;
+ }
+ else /* assume that ks->state == S_ACTIVE */
+ {
+ dmsg (D_TLS_DEBUG_MED, "STATE S_NORMAL_OP");
+ ks->state = S_NORMAL_OP;
+ ks->must_negotiate = 0;
+ }
+ }
+
+ /* Wait for Initial Handshake ACK */
+ if (ks->state == S_PRE_START && FULL_SYNC)
+ {
+ ks->state = S_START;
+ state_change = true;
+ dmsg (D_TLS_DEBUG_MED, "STATE S_START");
+ }
+
+ /* Wait for ACK */
+ if (((ks->state == S_GOT_KEY && !session->opt->server) ||
+ (ks->state == S_SENT_KEY && session->opt->server)))
+ {
+ if (FULL_SYNC)
+ {
+ ks->established = now;
+ dmsg (D_TLS_DEBUG_MED, "STATE S_ACTIVE");
+ if (check_debug_level (D_HANDSHAKE))
+ print_details (&ks->ks_ssl, "Control Channel:");
+ state_change = true;
+ ks->state = S_ACTIVE;
+ INCR_SUCCESS;
+
+ /* Set outgoing address for data channel packets */
+ link_socket_set_outgoing_addr (NULL, to_link_socket_info, &ks->remote_addr, session->common_name, session->opt->es);
+
+ /* Flush any payload packets that were buffered before our state transitioned to S_ACTIVE */
+ flush_payload_buffer (ks);
+
+#ifdef MEASURE_TLS_HANDSHAKE_STATS
+ show_tls_performance_stats();
+#endif
+ }
+ }
+
+ /* Reliable buffer to outgoing TCP/UDP (send up to CONTROL_SEND_ACK_MAX ACKs
+ for previously received packets) */
+ if (!to_link->len && reliable_can_send (ks->send_reliable))
+ {
+ int opcode;
+ struct buffer b;
+
+ buf = reliable_send (ks->send_reliable, &opcode);
+ ASSERT (buf);
+ b = *buf;
+ INCR_SENT;
+
+ write_control_auth (session, ks, &b, to_link_addr, opcode,
+ CONTROL_SEND_ACK_MAX, true);
+ *to_link = b;
+ active = true;
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Reliable -> TCP/UDP");
+ break;
+ }
+
+#ifndef TLS_AGGREGATE_ACK
+ /* Send 1 or more ACKs (each received control packet gets one ACK) */
+ if (!to_link->len && !reliable_ack_empty (ks->rec_ack))
+ {
+ buf = &ks->ack_write_buf;
+ ASSERT (buf_init (buf, FRAME_HEADROOM (&multi->opt.frame)));
+ write_control_auth (session, ks, buf, to_link_addr, P_ACK_V1,
+ RELIABLE_ACK_SIZE, false);
+ *to_link = *buf;
+ active = true;
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Dedicated ACK -> TCP/UDP");
+ break;
+ }
+#endif
+
+ /* Write incoming ciphertext to TLS object */
+ buf = reliable_get_buf_sequenced (ks->rec_reliable);
+ if (buf)
+ {
+ int status = 0;
+ if (buf->len)
+ {
+ status = key_state_write_ciphertext (&ks->ks_ssl, buf);
+ if (status == -1)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Incoming Ciphertext -> TLS object write error");
+ goto error;
+ }
+ }
+ else
+ {
+ status = 1;
+ }
+ if (status == 1)
+ {
+ reliable_mark_deleted (ks->rec_reliable, buf, true);
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Incoming Ciphertext -> TLS");
+ }
+ }
+
+ /* Read incoming plaintext from TLS object */
+ buf = &ks->plaintext_read_buf;
+ if (!buf->len)
+ {
+ int status;
+
+ ASSERT (buf_init (buf, 0));
+ status = key_state_read_plaintext (&ks->ks_ssl, buf, TLS_CHANNEL_BUF_SIZE);
+ update_time ();
+ if (status == -1)
+ {
+ msg (D_TLS_ERRORS, "TLS Error: TLS object -> incoming plaintext read error");
+ goto error;
+ }
+ if (status == 1)
+ {
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "TLS -> Incoming Plaintext");
+ }
+#if 0 /* show null plaintext reads */
+ if (!status)
+ msg (M_INFO, "TLS plaintext read -> NULL return");
+#endif
+ }
+
+ /* Send Key */
+ buf = &ks->plaintext_write_buf;
+ if (!buf->len && ((ks->state == S_START && !session->opt->server) ||
+ (ks->state == S_GOT_KEY && session->opt->server)))
+ {
+ if (session->opt->key_method == 1)
+ {
+ if (!key_method_1_write (buf, session))
+ goto error;
+ }
+ else if (session->opt->key_method == 2)
+ {
+ if (!key_method_2_write (buf, session))
+ goto error;
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+ state_change = true;
+ dmsg (D_TLS_DEBUG_MED, "STATE S_SENT_KEY");
+ ks->state = S_SENT_KEY;
+ }
+
+ /* Receive Key */
+ buf = &ks->plaintext_read_buf;
+ if (buf->len
+ && ((ks->state == S_SENT_KEY && !session->opt->server)
+ || (ks->state == S_START && session->opt->server)))
+ {
+ if (session->opt->key_method == 1)
+ {
+ if (!key_method_1_read (buf, session))
+ goto error;
+ }
+ else if (session->opt->key_method == 2)
+ {
+ if (!key_method_2_read (buf, multi, session))
+ goto error;
+ }
+ else
+ {
+ ASSERT (0);
+ }
+
+ state_change = true;
+ dmsg (D_TLS_DEBUG_MED, "STATE S_GOT_KEY");
+ ks->state = S_GOT_KEY;
+ }
+
+ /* Write outgoing plaintext to TLS object */
+ buf = &ks->plaintext_write_buf;
+ if (buf->len)
+ {
+ int status = key_state_write_plaintext (&ks->ks_ssl, buf);
+ if (status == -1)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: Outgoing Plaintext -> TLS object write error");
+ goto error;
+ }
+ if (status == 1)
+ {
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Outgoing Plaintext -> TLS");
+ }
+ }
+
+ /* Outgoing Ciphertext to reliable buffer */
+ if (ks->state >= S_START)
+ {
+ buf = reliable_get_buf_output_sequenced (ks->send_reliable);
+ if (buf)
+ {
+ int status = key_state_read_ciphertext (&ks->ks_ssl, buf, PAYLOAD_SIZE_DYNAMIC (&multi->opt.frame));
+ if (status == -1)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Ciphertext -> reliable TCP/UDP transport read error");
+ goto error;
+ }
+ if (status == 1)
+ {
+ reliable_mark_active_outgoing (ks->send_reliable, buf, P_CONTROL_V1);
+ INCR_GENERATED;
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Outgoing Ciphertext -> Reliable");
+ }
+ }
+ }
+ }
+ }
+ while (state_change);
+
+ update_time ();
+
+#ifdef TLS_AGGREGATE_ACK
+ /* Send 1 or more ACKs (each received control packet gets one ACK) */
+ if (!to_link->len && !reliable_ack_empty (ks->rec_ack))
+ {
+ buf = &ks->ack_write_buf;
+ ASSERT (buf_init (buf, FRAME_HEADROOM (&multi->opt.frame)));
+ write_control_auth (session, ks, buf, to_link_addr, P_ACK_V1,
+ RELIABLE_ACK_SIZE, false);
+ *to_link = *buf;
+ active = true;
+ state_change = true;
+ dmsg (D_TLS_DEBUG, "Dedicated ACK -> TCP/UDP");
+ }
+#endif
+
+ /* When should we wake up again? */
+ {
+ if (ks->state >= S_INITIAL)
+ {
+ compute_earliest_wakeup (wakeup,
+ reliable_send_timeout (ks->send_reliable));
+
+ if (ks->must_negotiate)
+ compute_earliest_wakeup (wakeup, ks->must_negotiate - now);
+ }
+
+ if (ks->established && session->opt->renegotiate_seconds)
+ compute_earliest_wakeup (wakeup,
+ ks->established + session->opt->renegotiate_seconds - now);
+
+ /* prevent event-loop spinning by setting minimum wakeup of 1 second */
+ if (*wakeup <= 0)
+ {
+ *wakeup = 1;
+
+ /* if we had something to send to remote, but to_link was busy,
+ let caller know we need to be called again soon */
+ active = true;
+ }
+
+ dmsg (D_TLS_DEBUG, "TLS: tls_process: timeout set to %d", *wakeup);
+
+ gc_free (&gc);
+ return active;
+ }
+
+error:
+ tls_clear_error();
+ ks->state = S_ERROR;
+ msg (D_TLS_ERRORS, "TLS Error: TLS handshake failed");
+ INCR_ERROR;
+ gc_free (&gc);
+ return false;
+}
+
+/*
+ * Called by the top-level event loop.
+ *
+ * Basically decides if we should call tls_process for
+ * the active or untrusted sessions.
+ */
+
+int
+tls_multi_process (struct tls_multi *multi,
+ struct buffer *to_link,
+ struct link_socket_actual **to_link_addr,
+ struct link_socket_info *to_link_socket_info,
+ interval_t *wakeup)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+ int active = TLSMP_INACTIVE;
+ bool error = false;
+ int tas;
+
+ perf_push (PERF_TLS_MULTI_PROCESS);
+
+ tls_clear_error ();
+
+ /*
+ * Process each session object having state of S_INITIAL or greater,
+ * and which has a defined remote IP addr.
+ */
+
+ for (i = 0; i < TM_SIZE; ++i)
+ {
+ struct tls_session *session = &multi->session[i];
+ struct key_state *ks = &session->key[KS_PRIMARY];
+ struct key_state *ks_lame = &session->key[KS_LAME_DUCK];
+
+ /* set initial remote address */
+ if (i == TM_ACTIVE && ks->state == S_INITIAL &&
+ link_socket_actual_defined (&to_link_socket_info->lsa->actual))
+ ks->remote_addr = to_link_socket_info->lsa->actual;
+
+ dmsg (D_TLS_DEBUG,
+ "TLS: tls_multi_process: i=%d state=%s, mysid=%s, stored-sid=%s, stored-ip=%s",
+ i,
+ state_name (ks->state),
+ session_id_print (&session->session_id, &gc),
+ session_id_print (&ks->session_id_remote, &gc),
+ print_link_socket_actual (&ks->remote_addr, &gc));
+
+ if (ks->state >= S_INITIAL && link_socket_actual_defined (&ks->remote_addr))
+ {
+ struct link_socket_actual *tla = NULL;
+
+ update_time ();
+
+ if (tls_process (multi, session, to_link, &tla,
+ to_link_socket_info, wakeup))
+ active = TLSMP_ACTIVE;
+
+ /*
+ * If tls_process produced an outgoing packet,
+ * return the link_socket_actual object (which
+ * contains the outgoing address).
+ */
+ if (tla)
+ {
+ multi->to_link_addr = *tla;
+ *to_link_addr = &multi->to_link_addr;
+ }
+
+ /*
+ * If tls_process hits an error:
+ * (1) If the session has an unexpired lame duck key, preserve it.
+ * (2) Reinitialize the session.
+ * (3) Increment soft error count
+ */
+ if (ks->state == S_ERROR)
+ {
+ ++multi->n_soft_errors;
+
+ if (i == TM_ACTIVE)
+ error = true;
+
+ if (i == TM_ACTIVE
+ && ks_lame->state >= S_ACTIVE
+ && !multi->opt.single_session)
+ move_session (multi, TM_LAME_DUCK, TM_ACTIVE, true);
+ else
+ reset_session (multi, session);
+ }
+ }
+ }
+
+ update_time ();
+
+ tas = tls_authentication_status (multi, TLS_MULTI_AUTH_STATUS_INTERVAL);
+
+ /*
+ * If lame duck session expires, kill it.
+ */
+ if (lame_duck_must_die (&multi->session[TM_LAME_DUCK], wakeup)) {
+ tls_session_free (&multi->session[TM_LAME_DUCK], true);
+ msg (D_TLS_DEBUG_LOW, "TLS: tls_multi_process: killed expiring key");
+ }
+
+ /*
+ * If untrusted session achieves TLS authentication,
+ * move it to active session, usurping any prior session.
+ *
+ * A semi-trusted session is one in which the certificate authentication
+ * succeeded (if cert verification is enabled) but the username/password
+ * verification failed. A semi-trusted session can forward data on the
+ * TLS control channel but not on the tunnel channel.
+ */
+ if (DECRYPT_KEY_ENABLED (multi, &multi->session[TM_UNTRUSTED].key[KS_PRIMARY])) {
+ move_session (multi, TM_ACTIVE, TM_UNTRUSTED, true);
+ msg (D_TLS_DEBUG_LOW, "TLS: tls_multi_process: untrusted session promoted to %strusted",
+ tas == TLS_AUTHENTICATION_SUCCEEDED ? "" : "semi-");
+ }
+
+ /*
+ * A hard error means that TM_ACTIVE hit an S_ERROR state and that no
+ * other key state objects are S_ACTIVE or higher.
+ */
+ if (error)
+ {
+ for (i = 0; i < (int) SIZE (multi->key_scan); ++i)
+ {
+ if (multi->key_scan[i]->state >= S_ACTIVE)
+ goto nohard;
+ }
+ ++multi->n_hard_errors;
+ }
+ nohard:
+
+#ifdef ENABLE_DEBUG
+ /* DEBUGGING -- flood peer with repeating connection attempts */
+ {
+ const int throw_level = GREMLIN_CONNECTION_FLOOD_LEVEL (multi->opt.gremlin);
+ if (throw_level)
+ {
+ for (i = 0; i < (int) SIZE (multi->key_scan); ++i)
+ {
+ if (multi->key_scan[i]->state >= throw_level)
+ {
+ ++multi->n_hard_errors;
+ ++multi->n_soft_errors;
+ }
+ }
+ }
+ }
+#endif
+
+ perf_pop ();
+ gc_free (&gc);
+
+ return (tas == TLS_AUTHENTICATION_FAILED) ? TLSMP_KILL : active;
+}
+
+/*
+ * Pre and post-process the encryption & decryption buffers in order
+ * to implement a multiplexed TLS channel over the TCP/UDP port.
+ */
+
+/*
+ *
+ * When we are in TLS mode, this is the first routine which sees
+ * an incoming packet.
+ *
+ * If it's a data packet, we set opt so that our caller can
+ * decrypt it. We also give our caller the appropriate decryption key.
+ *
+ * If it's a control packet, we authenticate it and process it,
+ * possibly creating a new tls_session if it represents the
+ * first packet of a new session. For control packets, we will
+ * also zero the size of *buf so that our caller ignores the
+ * packet on our return.
+ *
+ * Note that openvpn only allows one active session at a time,
+ * so a new session (once authenticated) will always usurp
+ * an old session.
+ *
+ * Return true if input was an authenticated control channel
+ * packet.
+ *
+ * If we are running in TLS thread mode, all public routines
+ * below this point must be called with the L_TLS lock held.
+ */
+
+bool
+tls_pre_decrypt (struct tls_multi *multi,
+ const struct link_socket_actual *from,
+ struct buffer *buf,
+ struct crypto_options *opt)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+
+ if (buf->len > 0)
+ {
+ int i;
+ int op;
+ int key_id;
+
+ /* get opcode and key ID */
+ {
+ uint8_t c = *BPTR (buf);
+ op = c >> P_OPCODE_SHIFT;
+ key_id = c & P_KEY_ID_MASK;
+ }
+
+ if ((op == P_DATA_V1) || (op == P_DATA_V2))
+ {
+ /* data channel packet */
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+
+ /*
+ * This is the basic test of TLS state compatibility between a local OpenVPN
+ * instance and its remote peer.
+ *
+ * If the test fails, it tells us that we are getting a packet from a source
+ * which claims reference to a prior negotiated TLS session, but the local
+ * OpenVPN instance has no memory of such a negotiation.
+ *
+ * It almost always occurs on UDP sessions when the passive side of the
+ * connection is restarted without the active side restarting as well (the
+ * passive side is the server which only listens for the connections, the
+ * active side is the client which initiates connections).
+ */
+ if (DECRYPT_KEY_ENABLED (multi, ks)
+ && key_id == ks->key_id
+ && ks->authenticated
+#ifdef ENABLE_DEF_AUTH
+ && !ks->auth_deferred
+#endif
+ && link_socket_actual_match (from, &ks->remote_addr))
+ {
+ /* return appropriate data channel decrypt key in opt */
+ opt->key_ctx_bi = &ks->key;
+ opt->packet_id = multi->opt.replay ? &ks->packet_id : NULL;
+ opt->pid_persist = NULL;
+ opt->flags &= multi->opt.crypto_flags_and;
+ opt->flags |= multi->opt.crypto_flags_or;
+
+ ASSERT (buf_advance (buf, op == P_DATA_V1 ? 1 : 4));
+
+ ++ks->n_packets;
+ ks->n_bytes += buf->len;
+ dmsg (D_TLS_KEYSELECT,
+ "TLS: tls_pre_decrypt, key_id=%d, IP=%s",
+ key_id, print_link_socket_actual (from, &gc));
+ gc_free (&gc);
+ return ret;
+ }
+#if 0 /* keys out of sync? */
+ else
+ {
+ dmsg (D_TLS_ERRORS, "TLS_PRE_DECRYPT: [%d] dken=%d rkid=%d lkid=%d auth=%d def=%d match=%d",
+ i,
+ DECRYPT_KEY_ENABLED (multi, ks),
+ key_id,
+ ks->key_id,
+ ks->authenticated,
+#ifdef ENABLE_DEF_AUTH
+ ks->auth_deferred,
+#else
+ -1,
+#endif
+ link_socket_actual_match (from, &ks->remote_addr));
+ }
+#endif
+ }
+
+ msg (D_TLS_ERRORS,
+ "TLS Error: local/remote TLS keys are out of sync: %s [%d]",
+ print_link_socket_actual (from, &gc), key_id);
+ goto error_lite;
+ }
+ else /* control channel packet */
+ {
+ bool do_burst = false;
+ bool new_link = false;
+ struct session_id sid; /* remote session ID */
+
+ /* verify legal opcode */
+ if (op < P_FIRST_OPCODE || op > P_LAST_OPCODE)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: unknown opcode received from %s op=%d",
+ print_link_socket_actual (from, &gc), op);
+ goto error;
+ }
+
+ /* hard reset ? */
+ if (is_hard_reset (op, 0))
+ {
+ /* verify client -> server or server -> client connection */
+ if (((op == P_CONTROL_HARD_RESET_CLIENT_V1
+ || op == P_CONTROL_HARD_RESET_CLIENT_V2) && !multi->opt.server)
+ || ((op == P_CONTROL_HARD_RESET_SERVER_V1
+ || op == P_CONTROL_HARD_RESET_SERVER_V2) && multi->opt.server))
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: client->client or server->server connection attempted from %s",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+ }
+
+ /*
+ * Authenticate Packet
+ */
+ dmsg (D_TLS_DEBUG, "TLS: control channel, op=%s, IP=%s",
+ packet_opcode_name (op), print_link_socket_actual (from, &gc));
+
+ /* get remote session-id */
+ {
+ struct buffer tmp = *buf;
+ buf_advance (&tmp, 1);
+ if (!session_id_read (&sid, &tmp) || !session_id_defined (&sid))
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: session-id not found in packet from %s",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+ }
+
+ /* use session ID to match up packet with appropriate tls_session object */
+ for (i = 0; i < TM_SIZE; ++i)
+ {
+ struct tls_session *session = &multi->session[i];
+ struct key_state *ks = &session->key[KS_PRIMARY];
+
+ dmsg (D_TLS_DEBUG,
+ "TLS: initial packet test, i=%d state=%s, mysid=%s, rec-sid=%s, rec-ip=%s, stored-sid=%s, stored-ip=%s",
+ i,
+ state_name (ks->state),
+ session_id_print (&session->session_id, &gc),
+ session_id_print (&sid, &gc),
+ print_link_socket_actual (from, &gc),
+ session_id_print (&ks->session_id_remote, &gc),
+ print_link_socket_actual (&ks->remote_addr, &gc));
+
+ if (session_id_equal (&ks->session_id_remote, &sid))
+ /* found a match */
+ {
+ if (i == TM_LAME_DUCK) {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: received control packet with stale session-id=%s",
+ session_id_print (&sid, &gc));
+ goto error;
+ }
+ dmsg (D_TLS_DEBUG,
+ "TLS: found match, session[%d], sid=%s",
+ i, session_id_print (&sid, &gc));
+ break;
+ }
+ }
+
+ /*
+ * Initial packet received.
+ */
+
+ if (i == TM_SIZE && is_hard_reset (op, 0))
+ {
+ struct tls_session *session = &multi->session[TM_ACTIVE];
+ struct key_state *ks = &session->key[KS_PRIMARY];
+
+ if (!is_hard_reset (op, multi->opt.key_method))
+ {
+ msg (D_TLS_ERRORS, "TLS ERROR: initial packet local/remote key_method mismatch, local key_method=%d, op=%s",
+ multi->opt.key_method,
+ packet_opcode_name (op));
+ goto error;
+ }
+
+ /*
+ * If we have no session currently in progress, the initial packet will
+ * open a new session in TM_ACTIVE rather than TM_UNTRUSTED.
+ */
+ if (!session_id_defined (&ks->session_id_remote))
+ {
+ if (multi->opt.single_session && multi->n_sessions)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Cannot accept new session request from %s due to session context expire or --single-session [1]",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_set_state (management,
+ OPENVPN_STATE_AUTH,
+ NULL,
+ 0,
+ 0);
+ }
+#endif
+
+ msg (D_TLS_DEBUG_LOW,
+ "TLS: Initial packet from %s, sid=%s",
+ print_link_socket_actual (from, &gc),
+ session_id_print (&sid, &gc));
+
+ do_burst = true;
+ new_link = true;
+ i = TM_ACTIVE;
+ session->untrusted_addr = *from;
+ }
+ }
+
+ if (i == TM_SIZE && is_hard_reset (op, 0))
+ {
+ /*
+ * No match with existing sessions,
+ * probably a new session.
+ */
+ struct tls_session *session = &multi->session[TM_UNTRUSTED];
+
+ /*
+ * If --single-session, don't allow any hard-reset connection request
+ * unless it the the first packet of the session.
+ */
+ if (multi->opt.single_session)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Cannot accept new session request from %s due to session context expire or --single-session [2]",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+
+ if (!is_hard_reset (op, multi->opt.key_method))
+ {
+ msg (D_TLS_ERRORS, "TLS ERROR: new session local/remote key_method mismatch, local key_method=%d, op=%s",
+ multi->opt.key_method,
+ packet_opcode_name (op));
+ goto error;
+ }
+
+ if (!read_control_auth (buf, &session->tls_auth, from))
+ goto error;
+
+ /*
+ * New session-initiating control packet is authenticated at this point,
+ * assuming that the --tls-auth command line option was used.
+ *
+ * Without --tls-auth, we leave authentication entirely up to TLS.
+ */
+ msg (D_TLS_DEBUG_LOW,
+ "TLS: new session incoming connection from %s",
+ print_link_socket_actual (from, &gc));
+
+ new_link = true;
+ i = TM_UNTRUSTED;
+ session->untrusted_addr = *from;
+ }
+ else
+ {
+ struct tls_session *session = &multi->session[i];
+ struct key_state *ks = &session->key[KS_PRIMARY];
+
+ /*
+ * Packet must belong to an existing session.
+ */
+ if (i != TM_ACTIVE && i != TM_UNTRUSTED)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Unroutable control packet received from %s (si=%d op=%s)",
+ print_link_socket_actual (from, &gc),
+ i,
+ packet_opcode_name (op));
+ goto error;
+ }
+
+ /*
+ * Verify remote IP address
+ */
+ if (!new_link && !link_socket_actual_match (&ks->remote_addr, from))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Received control packet from unexpected IP addr: %s",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+
+ /*
+ * Remote is requesting a key renegotiation
+ */
+ if (op == P_CONTROL_SOFT_RESET_V1
+ && DECRYPT_KEY_ENABLED (multi, ks))
+ {
+ if (!read_control_auth (buf, &session->tls_auth, from))
+ goto error;
+
+ key_state_soft_reset (session);
+
+ dmsg (D_TLS_DEBUG,
+ "TLS: received P_CONTROL_SOFT_RESET_V1 s=%d sid=%s",
+ i, session_id_print (&sid, &gc));
+ }
+ else
+ {
+ /*
+ * Remote responding to our key renegotiation request?
+ */
+ if (op == P_CONTROL_SOFT_RESET_V1)
+ do_burst = true;
+
+ if (!read_control_auth (buf, &session->tls_auth, from))
+ goto error;
+
+ dmsg (D_TLS_DEBUG,
+ "TLS: received control channel packet s#=%d sid=%s",
+ i, session_id_print (&sid, &gc));
+ }
+ }
+
+ /*
+ * We have an authenticated packet (if --tls-auth was set).
+ * Now pass to our reliability level which deals with
+ * packet acknowledgements, retransmits, sequencing, etc.
+ */
+ {
+ struct tls_session *session = &multi->session[i];
+ struct key_state *ks = &session->key[KS_PRIMARY];
+
+ /* Make sure we were initialized and that we're not in an error state */
+ ASSERT (ks->state != S_UNDEF);
+ ASSERT (ks->state != S_ERROR);
+ ASSERT (session_id_defined (&session->session_id));
+
+ /* Let our caller know we processed a control channel packet */
+ ret = true;
+
+ /*
+ * Set our remote address and remote session_id
+ */
+ if (new_link)
+ {
+ ks->session_id_remote = sid;
+ ks->remote_addr = *from;
+ ++multi->n_sessions;
+ }
+ else if (!link_socket_actual_match (&ks->remote_addr, from))
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: Existing session control channel packet from unknown IP address: %s",
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+
+ /*
+ * Should we do a retransmit of all unacknowledged packets in
+ * the send buffer? This improves the start-up efficiency of the
+ * initial key negotiation after the 2nd peer comes online.
+ */
+ if (do_burst && !session->burst)
+ {
+ reliable_schedule_now (ks->send_reliable);
+ session->burst = true;
+ }
+
+ /* Check key_id */
+ if (ks->key_id != key_id)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: local/remote key IDs out of sync (%d/%d) ID: %s",
+ ks->key_id, key_id, print_key_id (multi, &gc));
+ goto error;
+ }
+
+ /*
+ * Process incoming ACKs for packets we can now
+ * delete from reliable send buffer
+ */
+ {
+ /* buffers all packet IDs to delete from send_reliable */
+ struct reliable_ack send_ack;
+
+ send_ack.len = 0;
+ if (!reliable_ack_read (&send_ack, buf, &session->session_id))
+ {
+ msg (D_TLS_ERRORS,
+ "TLS Error: reading acknowledgement record from packet");
+ goto error;
+ }
+ reliable_send_purge (ks->send_reliable, &send_ack);
+ }
+
+ if (op != P_ACK_V1 && reliable_can_get (ks->rec_reliable))
+ {
+ packet_id_type id;
+
+ /* Extract the packet ID from the packet */
+ if (reliable_ack_read_packet_id (buf, &id))
+ {
+ /* Avoid deadlock by rejecting packet that would de-sequentialize receive buffer */
+ if (reliable_wont_break_sequentiality (ks->rec_reliable, id))
+ {
+ if (reliable_not_replay (ks->rec_reliable, id))
+ {
+ /* Save incoming ciphertext packet to reliable buffer */
+ struct buffer *in = reliable_get_buf (ks->rec_reliable);
+ ASSERT (in);
+ ASSERT (buf_copy (in, buf));
+ reliable_mark_active_incoming (ks->rec_reliable, in, id, op);
+ }
+
+ /* Process outgoing acknowledgment for packet just received, even if it's a replay */
+ reliable_ack_acknowledge_packet_id (ks->rec_ack, id);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ done:
+ buf->len = 0;
+ opt->key_ctx_bi = NULL;
+ opt->packet_id = NULL;
+ opt->pid_persist = NULL;
+ opt->flags &= multi->opt.crypto_flags_and;
+ gc_free (&gc);
+ return ret;
+
+ error:
+ ++multi->n_soft_errors;
+ error_lite:
+ tls_clear_error();
+ goto done;
+}
+
+/*
+ * This function is similar to tls_pre_decrypt, except it is called
+ * when we are in server mode and receive an initial incoming
+ * packet. Note that we don't modify
+ * any state in our parameter objects. The purpose is solely to
+ * determine whether we should generate a client instance
+ * object, in which case true is returned.
+ *
+ * This function is essentially the first-line HMAC firewall
+ * on the UDP port listener in --mode server mode.
+ */
+bool
+tls_pre_decrypt_lite (const struct tls_auth_standalone *tas,
+ const struct link_socket_actual *from,
+ const struct buffer *buf)
+
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+
+ if (buf->len > 0)
+ {
+ int op;
+ int key_id;
+
+ /* get opcode and key ID */
+ {
+ uint8_t c = *BPTR (buf);
+ op = c >> P_OPCODE_SHIFT;
+ key_id = c & P_KEY_ID_MASK;
+ }
+
+ /* this packet is from an as-yet untrusted source, so
+ scrutinize carefully */
+
+ if (op != P_CONTROL_HARD_RESET_CLIENT_V2)
+ {
+ /*
+ * This can occur due to bogus data or DoS packets.
+ */
+ dmsg (D_TLS_STATE_ERRORS,
+ "TLS State Error: No TLS state for client %s, opcode=%d",
+ print_link_socket_actual (from, &gc),
+ op);
+ goto error;
+ }
+
+ if (key_id != 0)
+ {
+ dmsg (D_TLS_STATE_ERRORS,
+ "TLS State Error: Unknown key ID (%d) received from %s -- 0 was expected",
+ key_id,
+ print_link_socket_actual (from, &gc));
+ goto error;
+ }
+
+ if (buf->len > EXPANDED_SIZE_DYNAMIC (&tas->frame))
+ {
+ dmsg (D_TLS_STATE_ERRORS,
+ "TLS State Error: Large packet (size %d) received from %s -- a packet no larger than %d bytes was expected",
+ buf->len,
+ print_link_socket_actual (from, &gc),
+ EXPANDED_SIZE_DYNAMIC (&tas->frame));
+ goto error;
+ }
+
+ {
+ struct buffer newbuf = clone_buf (buf);
+ struct crypto_options co = tas->tls_auth_options;
+ bool status;
+
+ /*
+ * We are in read-only mode at this point with respect to TLS
+ * control channel state. After we build a new client instance
+ * object, we will process this session-initiating packet for real.
+ */
+ co.flags |= CO_IGNORE_PACKET_ID;
+
+ /* HMAC test, if --tls-auth was specified */
+ status = read_control_auth (&newbuf, &co, from);
+ free_buf (&newbuf);
+ if (!status)
+ goto error;
+
+ /*
+ * At this point, if --tls-auth is being used, we know that
+ * the packet has passed the HMAC test, but we don't know if
+ * it is a replay yet. We will attempt to defeat replays
+ * by not advancing to the S_START state until we
+ * receive an ACK from our first reply to the client
+ * that includes an HMAC of our randomly generated 64 bit
+ * session ID.
+ *
+ * On the other hand if --tls-auth is not being used, we
+ * will proceed to begin the TLS authentication
+ * handshake with only cursory integrity checks having
+ * been performed, since we will be leaving the task
+ * of authentication solely up to TLS.
+ */
+
+ ret = true;
+ }
+ }
+ gc_free (&gc);
+ return ret;
+
+ error:
+
+ tls_clear_error();
+ gc_free (&gc);
+ return ret;
+}
+
+/* Choose the key with which to encrypt a data packet */
+void
+tls_pre_encrypt (struct tls_multi *multi,
+ struct buffer *buf, struct crypto_options *opt)
+{
+ multi->save_ks = NULL;
+ if (buf->len > 0)
+ {
+ int i;
+ struct key_state *ks_select = NULL;
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ if (ks->state >= S_ACTIVE
+ && ks->authenticated
+#ifdef ENABLE_DEF_AUTH
+ && !ks->auth_deferred
+#endif
+ )
+ {
+ if (!ks_select)
+ ks_select = ks;
+ if (now >= ks->auth_deferred_expire)
+ {
+ ks_select = ks;
+ break;
+ }
+ }
+ }
+
+ if (ks_select)
+ {
+ opt->key_ctx_bi = &ks_select->key;
+ opt->packet_id = multi->opt.replay ? &ks_select->packet_id : NULL;
+ opt->pid_persist = NULL;
+ opt->flags &= multi->opt.crypto_flags_and;
+ opt->flags |= multi->opt.crypto_flags_or;
+ multi->save_ks = ks_select;
+ dmsg (D_TLS_KEYSELECT, "TLS: tls_pre_encrypt: key_id=%d", ks_select->key_id);
+ return;
+ }
+ else
+ {
+ struct gc_arena gc = gc_new ();
+ dmsg (D_TLS_KEYSELECT, "TLS Warning: no data channel send key available: %s",
+ print_key_id (multi, &gc));
+ gc_free (&gc);
+ }
+ }
+
+ buf->len = 0;
+ opt->key_ctx_bi = NULL;
+ opt->packet_id = NULL;
+ opt->pid_persist = NULL;
+ opt->flags &= multi->opt.crypto_flags_and;
+}
+
+/* Prepend the appropriate opcode to encrypted buffer prior to TCP/UDP send */
+void
+tls_post_encrypt (struct tls_multi *multi, struct buffer *buf)
+{
+ struct key_state *ks;
+ uint8_t *op;
+ uint32_t sess;
+
+ ks = multi->save_ks;
+ multi->save_ks = NULL;
+ if (buf->len > 0)
+ {
+ ASSERT (ks);
+
+ if (!multi->opt.server && multi->use_session_id)
+ {
+ sess = ((P_DATA_V2 << P_OPCODE_SHIFT) | ks->key_id) | (multi->vpn_session_id << 8);
+ ASSERT (buf_write_prepend (buf, &sess, 4));
+ }
+ else
+ {
+ ASSERT (op = buf_prepend (buf, 1));
+ *op = (P_DATA_V1 << P_OPCODE_SHIFT) | ks->key_id;
+ }
+ ++ks->n_packets;
+ ks->n_bytes += buf->len;
+ }
+}
+
+/*
+ * Send a payload over the TLS control channel.
+ * Called externally.
+ */
+
+bool
+tls_send_payload (struct tls_multi *multi,
+ const uint8_t *data,
+ int size)
+{
+ struct tls_session *session;
+ struct key_state *ks;
+ bool ret = false;
+
+ tls_clear_error();
+
+ ASSERT (multi);
+
+ session = &multi->session[TM_ACTIVE];
+ ks = &session->key[KS_PRIMARY];
+
+ if (ks->state >= S_ACTIVE)
+ {
+ if (key_state_write_plaintext_const (&ks->ks_ssl, data, size) == 1)
+ ret = true;
+ }
+ else
+ {
+ if (!ks->paybuf)
+ ks->paybuf = buffer_list_new (0);
+ buffer_list_push_data (ks->paybuf, data, (size_t)size);
+ ret = true;
+ }
+
+
+ tls_clear_error();
+
+ return ret;
+}
+
+bool
+tls_rec_payload (struct tls_multi *multi,
+ struct buffer *buf)
+{
+ struct tls_session *session;
+ struct key_state *ks;
+ bool ret = false;
+
+ tls_clear_error();
+
+ ASSERT (multi);
+
+ session = &multi->session[TM_ACTIVE];
+ ks = &session->key[KS_PRIMARY];
+
+ if (ks->state >= S_ACTIVE && BLEN (&ks->plaintext_read_buf))
+ {
+ if (buf_copy (buf, &ks->plaintext_read_buf))
+ ret = true;
+ ks->plaintext_read_buf.len = 0;
+ }
+
+ tls_clear_error();
+
+ return ret;
+}
+
+/* Update the remote_addr, needed if a client floats. */
+void
+tls_update_remote_addr (struct tls_multi *multi,
+const struct link_socket_actual *from)
+{
+ struct gc_arena gc = gc_new ();
+ int i;
+
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ if (DECRYPT_KEY_ENABLED (multi, ks) && ks->authenticated && link_socket_actual_defined(&ks->remote_addr))
+ {
+ if (link_socket_actual_match (from, &ks->remote_addr))
+ continue;
+ dmsg (D_TLS_KEYSELECT,
+ "TLS: tls_update_remote_addr from IP=%s to IP=%s",
+ print_link_socket_actual (&ks->remote_addr, &gc),
+ print_link_socket_actual (from, &gc));
+ memcpy(&ks->remote_addr, from, sizeof(*from));
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Dump a human-readable rendition of an openvpn packet
+ * into a garbage collectable string which is returned.
+ */
+const char *
+protocol_dump (struct buffer *buffer, unsigned int flags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ struct buffer buf = *buffer;
+
+ uint8_t c;
+ int op;
+ int key_id;
+
+ int tls_auth_hmac_size = (flags & PD_TLS_AUTH_HMAC_SIZE_MASK);
+
+ if (buf.len <= 0)
+ {
+ buf_printf (&out, "DATA UNDEF len=%d", buf.len);
+ goto done;
+ }
+
+ if (!(flags & PD_TLS))
+ goto print_data;
+
+ /*
+ * Initial byte (opcode)
+ */
+ if (!buf_read (&buf, &c, sizeof (c)))
+ goto done;
+ op = (c >> P_OPCODE_SHIFT);
+ key_id = c & P_KEY_ID_MASK;
+ buf_printf (&out, "%s kid=%d", packet_opcode_name (op), key_id);
+
+ if ((op == P_DATA_V1) || (op == P_DATA_V2))
+ goto print_data;
+
+ /*
+ * Session ID
+ */
+ {
+ struct session_id sid;
+
+ if (!session_id_read (&sid, &buf))
+ goto done;
+ if (flags & PD_VERBOSE)
+ buf_printf (&out, " sid=%s", session_id_print (&sid, gc));
+ }
+
+ /*
+ * tls-auth hmac + packet_id
+ */
+ if (tls_auth_hmac_size)
+ {
+ struct packet_id_net pin;
+ uint8_t tls_auth_hmac[MAX_HMAC_KEY_LENGTH];
+
+ ASSERT (tls_auth_hmac_size <= MAX_HMAC_KEY_LENGTH);
+
+ if (!buf_read (&buf, tls_auth_hmac, tls_auth_hmac_size))
+ goto done;
+ if (flags & PD_VERBOSE)
+ buf_printf (&out, " tls_hmac=%s", format_hex (tls_auth_hmac, tls_auth_hmac_size, 0, gc));
+
+ if (!packet_id_read (&pin, &buf, true))
+ goto done;
+ buf_printf(&out, " pid=%s", packet_id_net_print (&pin, (flags & PD_VERBOSE), gc));
+ }
+
+ /*
+ * ACK list
+ */
+ buf_printf (&out, " %s", reliable_ack_print(&buf, (flags & PD_VERBOSE), gc));
+
+ if (op == P_ACK_V1)
+ goto done;
+
+ /*
+ * Packet ID
+ */
+ {
+ packet_id_type l;
+ if (!buf_read (&buf, &l, sizeof (l)))
+ goto done;
+ l = ntohpid (l);
+ buf_printf (&out, " pid=" packet_id_format, (packet_id_print_type)l);
+ }
+
+print_data:
+ if (flags & PD_SHOW_DATA)
+ buf_printf (&out, " DATA %s", format_hex (BPTR (&buf), BLEN (&buf), 80, gc));
+ else
+ buf_printf (&out, " DATA len=%d", buf.len);
+
+done:
+ return BSTR (&out);
+}
+
+#else
+static void dummy(void) {}
+#endif /* ENABLE_CRYPTO && ENABLE_SSL*/
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.h
new file mode 100644
index 00000000..9bdd641f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl.h
@@ -0,0 +1,513 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel SSL/Data channel negotiation module
+ */
+
+#ifndef OPENVPN_SSL_H
+#define OPENVPN_SSL_H
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "basic.h"
+#include "common.h"
+#include "crypto.h"
+#include "packet_id.h"
+#include "session_id.h"
+#include "reliable.h"
+#include "socket.h"
+#include "mtu.h"
+#include "options.h"
+#include "plugin.h"
+
+#include "ssl_common.h"
+#include "ssl_backend.h"
+
+/* Used in the TLS PRF function */
+#define KEY_EXPANSION_ID "OpenVPN"
+
+/* packet opcode (high 5 bits) and key-id (low 3 bits) are combined in one byte */
+#define P_KEY_ID_MASK 0x07
+#define P_OPCODE_SHIFT 3
+
+/* packet opcodes -- the V1 is intended to allow protocol changes in the future */
+#define P_CONTROL_HARD_RESET_CLIENT_V1 1 /* initial key from client, forget previous state */
+#define P_CONTROL_HARD_RESET_SERVER_V1 2 /* initial key from server, forget previous state */
+#define P_CONTROL_SOFT_RESET_V1 3 /* new key, graceful transition from old to new key */
+#define P_CONTROL_V1 4 /* control channel packet (usually TLS ciphertext) */
+#define P_ACK_V1 5 /* acknowledgement for packets received */
+#define P_DATA_V1 6 /* data channel packet */
+#define P_DATA_V2 9 /* data channel packet with session_id */
+
+/* indicates key_method >= 2 */
+#define P_CONTROL_HARD_RESET_CLIENT_V2 7 /* initial key from client, forget previous state */
+#define P_CONTROL_HARD_RESET_SERVER_V2 8 /* initial key from server, forget previous state */
+
+/* define the range of legal opcodes */
+#define P_FIRST_OPCODE 1
+#define P_LAST_OPCODE 9
+
+/* Should we aggregate TLS
+ * acknowledgements, and tack them onto
+ * control packets? */
+#define TLS_AGGREGATE_ACK
+
+/*
+ * If TLS_AGGREGATE_ACK, set the
+ * max number of acknowledgments that
+ * can "hitch a ride" on an outgoing
+ * non-P_ACK_V1 control packet.
+ */
+#define CONTROL_SEND_ACK_MAX 4
+
+/*
+ * Define number of buffers for send and receive in the reliability layer.
+ */
+#define TLS_RELIABLE_N_SEND_BUFFERS 4 /* also window size for reliablity layer */
+#define TLS_RELIABLE_N_REC_BUFFERS 8
+
+/*
+ * Various timeouts
+ */
+#define TLS_MULTI_REFRESH 15 /* call tls_multi_process once every n seconds */
+#define TLS_MULTI_HORIZON 2 /* call tls_multi_process frequently for n seconds after
+ every packet sent/received action */
+
+/*
+ * The SSL/TLS worker thread will wait at most this many seconds for the
+ * interprocess communication pipe to the main thread to be ready to accept
+ * writes.
+ */
+#define TLS_MULTI_THREAD_SEND_TIMEOUT 5
+
+/* Interval that tls_multi_process should call tls_authentication_status */
+#define TLS_MULTI_AUTH_STATUS_INTERVAL 10
+
+/*
+ * Buffer sizes (also see mtu.h).
+ */
+
+/* Maximum length of OCC options string passed as part of auth handshake */
+#define TLS_OPTIONS_LEN 512
+
+/* Default field in X509 to be username */
+#define X509_USERNAME_FIELD_DEFAULT "CN"
+
+/*
+ * Range of key exchange methods
+ */
+#define KEY_METHOD_MIN 1
+#define KEY_METHOD_MAX 2
+
+/* key method taken from lower 4 bits */
+#define KEY_METHOD_MASK 0x0F
+
+/*
+ * Measure success rate of TLS handshakes, for debugging only
+ */
+/* #define MEASURE_TLS_HANDSHAKE_STATS */
+
+/*
+ * Used in --mode server mode to check tls-auth signature on initial
+ * packets received from new clients.
+ */
+struct tls_auth_standalone
+{
+ struct key_ctx_bi tls_auth_key;
+ struct crypto_options tls_auth_options;
+ struct frame frame;
+};
+
+/*
+ * Prepare the SSL library for use
+ */
+void init_ssl_lib (void);
+
+/*
+ * Free any internal state that the SSL library might have
+ */
+void free_ssl_lib (void);
+
+/**
+ * Build master SSL context object that serves for the whole of OpenVPN
+ * instantiation
+ */
+void init_ssl (const struct options *options, struct tls_root_ctx *ctx);
+
+/** @addtogroup control_processor
+ * @{ */
+
+/** @name Functions for initialization and cleanup of tls_multi structures
+ * @{ */
+
+/**
+ * Allocate and initialize a \c tls_multi structure.
+ * @ingroup control_processor
+ *
+ * This function allocates a new \c tls_multi structure, and performs some
+ * amount of initialization. Afterwards, the \c tls_multi_init_finalize()
+ * function must be called to finalize the structure's initialization
+ * process.
+ *
+ * @param tls_options - The configuration options to be used for this VPN
+ * tunnel.
+ *
+ * @return A newly allocated and initialized \c tls_multi structure.
+ */
+struct tls_multi *tls_multi_init (struct tls_options *tls_options);
+
+/**
+ * Finalize initialization of a \c tls_multi structure.
+ * @ingroup control_processor
+ *
+ * This function initializes the \c TM_ACTIVE \c tls_session, and in
+ * server mode also the \c TM_UNTRUSTED \c tls_session, associated with
+ * this \c tls_multi structure. It also configures the control channel's
+ * \c frame structure based on the data channel's \c frame given in
+ * argument \a frame.
+ *
+ * @param multi - The \c tls_multi structure of which to finalize
+ * initialization.
+ * @param frame - The data channel's \c frame structure.
+ */
+void tls_multi_init_finalize(struct tls_multi *multi,
+ const struct frame *frame);
+
+/*
+ * Initialize a standalone tls-auth verification object.
+ */
+struct tls_auth_standalone *tls_auth_standalone_init (struct tls_options *tls_options,
+ struct gc_arena *gc);
+
+/*
+ * Finalize a standalone tls-auth verification object.
+ */
+void tls_auth_standalone_finalize (struct tls_auth_standalone *tas,
+ const struct frame *frame);
+
+/*
+ * Set local and remote option compatibility strings.
+ * Used to verify compatibility of local and remote option
+ * sets.
+ */
+void tls_multi_init_set_options(struct tls_multi* multi,
+ const char *local,
+ const char *remote);
+
+/**
+ * Cleanup a \c tls_multi structure and free associated memory
+ * allocations.
+ * @ingroup control_processor
+ *
+ * This function cleans up a \c tls_multi structure. This includes
+ * cleaning up all associated \c tls_session structures.
+ *
+ * @param multi - The \c tls_multi structure to clean up in free.
+ * @param clear - Whether the memory allocated for the \a multi
+ * object should be overwritten with 0s.
+ */
+void tls_multi_free (struct tls_multi *multi, bool clear);
+
+/** @} name Functions for initialization and cleanup of tls_multi structures */
+
+/** @} addtogroup control_processor */
+
+#define TLSMP_INACTIVE 0
+#define TLSMP_ACTIVE 1
+#define TLSMP_KILL 2
+
+/*
+ * Called by the top-level event loop.
+ *
+ * Basically decides if we should call tls_process for
+ * the active or untrusted sessions.
+ */
+int tls_multi_process (struct tls_multi *multi,
+ struct buffer *to_link,
+ struct link_socket_actual **to_link_addr,
+ struct link_socket_info *to_link_socket_info,
+ interval_t *wakeup);
+
+
+/**************************************************************************/
+/**
+ * Determine whether an incoming packet is a data channel or control
+ * channel packet, and process accordingly.
+ * @ingroup external_multiplexer
+ *
+ * When OpenVPN is in TLS mode, this is the first function to process an
+ * incoming packet. It inspects the packet's one-byte header which
+ * contains the packet's opcode and key ID. Depending on the opcode, the
+ * packet is processed as a data channel or as a control channel packet.
+ *
+ * @par Data channel packets
+ *
+ * If the opcode indicates the packet is a data channel packet, then the
+ * packet's key ID is used to find the local TLS state it is associated
+ * with. This state is checked whether it is active, authenticated, and
+ * its remote peer is the source of this packet. If these checks passed,
+ * the state's security parameters are loaded into the \a opt crypto
+ * options so that \p openvpn_decrypt() can later use them to authenticate
+ * and decrypt the packet.
+ *
+ * This function then returns false. The \a buf buffer has not been
+ * modified, except for removing the header.
+ *
+ * @par Control channel packets
+ *
+ * If the opcode indicates the packet is a control channel packet, then
+ * this function will process it based on its plaintext header. depending
+ * on the packet's opcode and session ID this function determines if it is
+ * destined for an active TLS session, or whether a new TLS session should
+ * be started. This function also initiates data channel session key
+ * renegotiation if the received opcode requests that.
+ *
+ * If the incoming packet is destined for an active TLS session, then the
+ * packet is inserted into the Reliability Layer and will be handled
+ * later.
+ *
+ * @param multi - The TLS multi structure associated with the VPN tunnel
+ * of this packet.
+ * @param from - The source address of the packet.
+ * @param buf - A buffer structure containing the incoming packet.
+ * @param opt - A crypto options structure that will be loaded with the
+ * appropriate security parameters to handle the packet if it is a
+ * data channel packet.
+ *
+ * @return
+ * @li True if the packet is a control channel packet that has been
+ * processed successfully.
+ * @li False if the packet is a data channel packet, or if an error
+ * occurred during processing of a control channel packet.
+ */
+bool tls_pre_decrypt (struct tls_multi *multi,
+ const struct link_socket_actual *from,
+ struct buffer *buf,
+ struct crypto_options *opt);
+
+
+/**************************************************************************/
+/** @name Functions for managing security parameter state for data channel packets
+ * @{ */
+
+/**
+ * Inspect an incoming packet for which no VPN tunnel is active, and
+ * determine whether a new VPN tunnel should be created.
+ * @ingroup data_crypto
+ *
+ * This function receives the initial incoming packet from a client that
+ * wishes to establish a new VPN tunnel, and determines the packet is a
+ * valid initial packet. It is only used when OpenVPN is running in
+ * server mode.
+ *
+ * The tests performed by this function are whether the packet's opcode is
+ * correct for establishing a new VPN tunnel, whether its key ID is 0, and
+ * whether its size is not too large. This function also performs the
+ * initial HMAC firewall test, if configured to do so.
+ *
+ * The incoming packet and the local VPN tunnel state are not modified by
+ * this function. Its sole purpose is to inspect the packet and determine
+ * whether a new VPN tunnel should be created. If so, that new VPN tunnel
+ * instance will handle processing of the packet.
+ *
+ * @param tas - The standalone TLS authentication setting structure for
+ * this process.
+ * @param from - The source address of the packet.
+ * @param buf - A buffer structure containing the incoming packet.
+ *
+ * @return
+ * @li True if the packet is valid and a new VPN tunnel should be created
+ * for this client.
+ * @li False if the packet is not valid, did not pass the HMAC firewall
+ * test, or some other error occurred.
+ */
+bool tls_pre_decrypt_lite (const struct tls_auth_standalone *tas,
+ const struct link_socket_actual *from,
+ const struct buffer *buf);
+
+
+/**
+ * Choose the appropriate security parameters with which to process an
+ * outgoing packet.
+ * @ingroup data_crypto
+ *
+ * If no appropriate security parameters can be found, or if some other
+ * error occurs, then the buffer is set to empty.
+ *
+ * @param multi - The TLS state for this packet's destination VPN tunnel.
+ * @param buf - The buffer containing the outgoing packet.
+ * @param opt - The crypto options structure into which the appropriate
+ * security parameters should be loaded.
+ */
+void tls_pre_encrypt (struct tls_multi *multi,
+ struct buffer *buf, struct crypto_options *opt);
+
+
+/**
+ * Prepend the one-byte OpenVPN header to the packet, and perform some
+ * accounting for the key state used.
+ * @ingroup data_crypto
+ *
+ * @param multi - The TLS state for this packet's destination VPN tunnel.
+ * @param buf - The buffer containing the outgoing packet.
+ */
+void tls_post_encrypt (struct tls_multi *multi, struct buffer *buf);
+
+/** @} name Functions for managing security parameter state for data channel packets */
+
+/*
+ * Setup private key file password. If auth_file is given, use the
+ * credentials stored in the file.
+ */
+void pem_password_setup (const char *auth_file);
+
+/*
+ * Setup authentication username and password. If auth_file is given, use the
+ * credentials stored in the file.
+ */
+void auth_user_pass_setup (const char *auth_file, const struct static_challenge_info *sc_info);
+
+/*
+ * Ensure that no caching is performed on authentication information
+ */
+void ssl_set_auth_nocache (void);
+
+/*
+ * Purge any stored authentication information, both for key files and tunnel
+ * authentication. If PCKS #11 is enabled, purge authentication for that too.
+ */
+void ssl_purge_auth (const bool auth_user_pass_only);
+
+void ssl_set_auth_token (const char *token);
+
+#ifdef ENABLE_CLIENT_CR
+/*
+ * ssl_get_auth_challenge will parse the server-pushed auth-failed
+ * reason string and return a dynamically allocated
+ * auth_challenge_info struct.
+ */
+void ssl_purge_auth_challenge (void);
+void ssl_put_auth_challenge (const char *cr_str);
+#endif
+
+/*
+ * Reserve any extra space required on frames.
+ */
+void tls_adjust_frame_parameters(struct frame *frame);
+
+/*
+ * Send a payload over the TLS control channel
+ */
+bool tls_send_payload (struct tls_multi *multi,
+ const uint8_t *data,
+ int size);
+
+/*
+ * Receive a payload through the TLS control channel
+ */
+bool tls_rec_payload (struct tls_multi *multi,
+ struct buffer *buf);
+
+/*
+ * Update remote address of a tls_multi structure
+ */
+void tls_update_remote_addr (struct tls_multi *multi,
+ const struct link_socket_actual *from);
+
+#ifdef MANAGEMENT_DEF_AUTH
+static inline char *
+tls_get_peer_info(const struct tls_multi *multi)
+{
+ return multi->peer_info;
+}
+#endif
+
+/*
+ * inline functions
+ */
+
+static inline bool
+tls_initial_packet_received (const struct tls_multi *multi)
+{
+ return multi->n_sessions > 0;
+}
+
+static inline bool
+tls_test_auth_deferred_interval (const struct tls_multi *multi)
+{
+ if (multi)
+ {
+ const struct key_state *ks = &multi->session[TM_ACTIVE].key[KS_PRIMARY];
+ return now < ks->auth_deferred_expire;
+ }
+ return false;
+}
+
+static inline int
+tls_test_payload_len (const struct tls_multi *multi)
+{
+ if (multi)
+ {
+ const struct key_state *ks = &multi->session[TM_ACTIVE].key[KS_PRIMARY];
+ if (ks->state >= S_ACTIVE)
+ return BLEN (&ks->plaintext_read_buf);
+ }
+ return 0;
+}
+
+static inline void
+tls_set_single_session (struct tls_multi *multi)
+{
+ if (multi)
+ multi->opt.single_session = true;
+}
+
+/*
+ * protocol_dump() flags
+ */
+#define PD_TLS_AUTH_HMAC_SIZE_MASK 0xFF
+#define PD_SHOW_DATA (1<<8)
+#define PD_TLS (1<<9)
+#define PD_VERBOSE (1<<10)
+
+const char *protocol_dump (struct buffer *buffer,
+ unsigned int flags,
+ struct gc_arena *gc);
+
+/*
+ * debugging code
+ */
+
+#ifdef MEASURE_TLS_HANDSHAKE_STATS
+void show_tls_performance_stats(void);
+#endif
+
+/*#define EXTRACT_X509_FIELD_TEST*/
+void extract_x509_field_test (void);
+
+#endif /* ENABLE_CRYPTO && ENABLE_SSL */
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_backend.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_backend.h
new file mode 100644
index 00000000..bfd15496
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_backend.h
@@ -0,0 +1,490 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel SSL library backend module
+ */
+
+
+#ifndef SSL_BACKEND_H_
+#define SSL_BACKEND_H_
+
+#include "buffer.h"
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include "ssl_openssl.h"
+#include "ssl_verify_openssl.h"
+#define SSLAPI SSLAPI_OPENSSL
+#endif
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include "ssl_polarssl.h"
+#include "ssl_verify_polarssl.h"
+#define SSLAPI SSLAPI_POLARSSL
+#endif
+
+/* Ensure that SSLAPI got a sane value if SSL is disabled or unknown */
+#ifndef SSLAPI
+#define SSLAPI SSLAPI_NONE
+#endif
+
+/**
+ * prototype for struct tls_session from ssl_common.h
+ */
+struct tls_session;
+
+/**
+ * Get a tls_cipher_name_pair containing OpenSSL and IANA names for supplied TLS cipher name
+ *
+ * @param cipher_name Can be either OpenSSL or IANA cipher name
+ * @return tls_cipher_name_pair* if found, NULL otherwise
+ */
+typedef struct { const char *openssl_name; const char *iana_name; } tls_cipher_name_pair;
+const tls_cipher_name_pair *tls_get_cipher_name_pair (const char *cipher_name, size_t len);
+
+/*
+ *
+ * Functions implemented in ssl.c for use by the backend SSL library
+ *
+ */
+
+/**
+ * Callback to retrieve the user's password
+ *
+ * @param buf Buffer to return the password in
+ * @param size Size of the buffer
+ * @param rwflag Unused, needed for OpenSSL compatibility
+ * @param u Unused, needed for OpenSSL compatibility
+ */
+int pem_password_callback (char *buf, int size, int rwflag, void *u);
+
+/*
+ *
+ * Functions used in ssl.c which must be implemented by the backend SSL library
+ *
+ */
+
+/**
+ * Perform any static initialisation necessary by the library.
+ * Called on OpenVPN initialisation
+ */
+void tls_init_lib();
+
+/**
+ * Free any global SSL library-specific data structures.
+ */
+void tls_free_lib();
+/**
+ * Clear the underlying SSL library's error state.
+ */
+void tls_clear_error();
+
+/**
+ * Parse a TLS version specifier
+ *
+ * @param vstr The TLS version string
+ * @param extra An optional extra parameter, may be NULL
+ *
+ * @return One of the TLS_VER_x constants or TLS_VER_BAD
+ * if a parse error should be flagged.
+ */
+#define TLS_VER_BAD -1
+#define TLS_VER_1_0 0 /* default */
+#define TLS_VER_1_1 1
+#define TLS_VER_1_2 2
+int tls_version_min_parse(const char *vstr, const char *extra);
+
+/**
+ * Return the maximum TLS version (as a TLS_VER_x constant)
+ * supported by current SSL implementation
+ *
+ * @return One of the TLS_VER_x constants (but not TLS_VER_BAD).
+ */
+int tls_version_max(void);
+
+/**
+ * Initialise a library-specific TLS context for a server.
+ *
+ * @param ctx TLS context to initialise
+ */
+void tls_ctx_server_new(struct tls_root_ctx *ctx);
+
+/**
+ * Initialises a library-specific TLS context for a client.
+ *
+ * @param ctx TLS context to initialise
+ */
+void tls_ctx_client_new(struct tls_root_ctx *ctx);
+
+/**
+ * Frees the library-specific TLSv1 context
+ *
+ * @param ctx TLS context to free
+ */
+void tls_ctx_free(struct tls_root_ctx *ctx);
+
+/**
+ * Checks whether the given TLS context is initialised
+ *
+ * @param ctx TLS context to check
+ *
+ * @return true if the context is initialised, false if not.
+ */
+bool tls_ctx_initialised(struct tls_root_ctx *ctx);
+
+/**
+ * Set any library specific options.
+ *
+ * Examples include disabling session caching, the password callback to use,
+ * and session verification parameters.
+ *
+ * @param ctx TLS context to set options on
+ * @param ssl_flags SSL flags to set
+ */
+void tls_ctx_set_options (struct tls_root_ctx *ctx, unsigned int ssl_flags);
+
+/**
+ * Restrict the list of ciphers that can be used within the TLS context.
+ *
+ * @param ctx TLS context to restrict, must be valid.
+ * @param ciphers String containing : delimited cipher names, or NULL to use
+ * sane defaults.
+ */
+void tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers);
+
+/**
+ * Load Diffie Hellman Parameters, and load them into the library-specific
+ * TLS context.
+ *
+ * @param ctx TLS context to use
+ * @param dh_file The file name to load the parameters from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param dh_file_inline A string containing the parameters
+ */
+void tls_ctx_load_dh_params(struct tls_root_ctx *ctx, const char *dh_file,
+ const char *dh_file_inline);
+
+/**
+ * Load Elliptic Curve Parameters, and load them into the library-specific
+ * TLS context.
+ *
+ * @param ctx TLS context to use
+ * @param curve_name The name of the elliptic curve to load.
+ */
+void tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name
+ );
+
+/**
+ * Load PKCS #12 file for key, cert and (optionally) CA certs, and add to
+ * library-specific TLS context.
+ *
+ * @param ctx TLS context to use
+ * @param pkcs12_file The file name to load the information from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param pkcs12_file_inline A string containing the information
+ *
+ * @return 1 if an error occurred, 0 if parsing was
+ * successful.
+ */
+int tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file,
+ const char *pkcs12_file_inline, bool load_ca_file
+ );
+
+/**
+ * Use Windows cryptoapi for key and cert, and add to library-specific TLS
+ * context.
+ *
+ * @param ctx TLS context to use
+ * @param crypto_api_cert String representing the certificate to load.
+ */
+#ifdef ENABLE_CRYPTOAPI
+void tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert);
+#endif /* WIN32 */
+
+/**
+ * Load certificate file into the given TLS context. If the given certificate
+ * file contains a certificate chain, load the whole chain.
+ *
+ * @param ctx TLS context to use
+ * @param cert_file The file name to load the certificate from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param cert_file_inline A string containing the certificate
+ */
+void tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
+ const char *cert_file_inline);
+
+/**
+ * Load private key file into the given TLS context.
+ *
+ * @param ctx TLS context to use
+ * @param priv_key_file The file name to load the private key from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param priv_key_file_inline A string containing the private key
+ *
+ * @return 1 if an error occurred, 0 if parsing was
+ * successful.
+ */
+int tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file,
+ const char *priv_key_file_inline
+ );
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+/**
+ * Tell the management interface to load the given certificate and the external
+ * private key matching the given certificate.
+ *
+ * @param ctx TLS context to use
+ * @param cert_file The file name to load the certificate from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param cert_file_inline A string containing the certificate
+ *
+ * @return 1 if an error occurred, 0 if parsing was
+ * successful.
+ */
+int tls_ctx_use_external_private_key (struct tls_root_ctx *ctx,
+ const char *cert_file, const char *cert_file_inline);
+#endif
+
+
+/**
+ * Load certificate authority certificates from the given file or path.
+ *
+ * Note that not all SSL libraries support loading from a path.
+ *
+ * @param ctx TLS context to use
+ * @param ca_file The file name to load the CAs from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param ca_file_inline A string containing the CAs
+ * @param ca_path The path to load the CAs from
+ */
+void tls_ctx_load_ca (struct tls_root_ctx *ctx, const char *ca_file,
+ const char *ca_file_inline, const char *ca_path, bool tls_server
+ );
+
+/**
+ * Load extra certificate authority certificates from the given file or path.
+ * These Load extra certificates that are part of our own certificate
+ * chain but shouldn't be included in the verify chain.
+ *
+ *
+ * @param ctx TLS context to use
+ * @param extra_certs_file The file name to load the certs from, or
+ * "[[INLINE]]" in the case of inline files.
+ * @param extra_certs_file_inline A string containing the certs
+ */
+void tls_ctx_load_extra_certs (struct tls_root_ctx *ctx, const char *extra_certs_file,
+ const char *extra_certs_file_inline
+ );
+
+#ifdef ENABLE_CRYPTO_POLARSSL
+/**
+ * Add a personalisation string to the PolarSSL RNG, based on the certificate
+ * loaded into the given context.
+ *
+ * @param ctx TLS context to use
+ */
+void tls_ctx_personalise_random(struct tls_root_ctx *ctx);
+#endif
+
+/* **************************************
+ *
+ * Key-state specific functions
+ *
+ ***************************************/
+
+/**
+ * Initialise the SSL channel part of the given key state. Settings will be
+ * loaded from a previously initialised TLS context.
+ *
+ * @param ks_ssl The SSL channel's state info to initialise
+ * @param ssl_ctx The TLS context to use when initialising the channel.
+ * @param is_server Initialise a server?
+ * @param session The session associated with the given key_state
+ */
+void key_state_ssl_init(struct key_state_ssl *ks_ssl,
+ const struct tls_root_ctx *ssl_ctx, bool is_server, struct tls_session *session);
+
+/**
+ * Free the SSL channel part of the given key state.
+ *
+ * @param ks_ssl The SSL channel's state info to free
+ */
+void key_state_ssl_free(struct key_state_ssl *ks_ssl);
+
+/**************************************************************************/
+/** @addtogroup control_tls
+ * @{ */
+
+/** @name Functions for packets to be sent to a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Insert a plaintext buffer into the TLS module.
+ *
+ * After successfully processing the data, the data in \a buf is zeroized,
+ * its length set to zero, and a value of \c 1 is returned.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - The plaintext message to process.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: All the data was processed successfully.
+ * - \c 0: The data was not processed, this function should be called
+ * again later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_write_plaintext (struct key_state_ssl *ks_ssl, struct buffer *buf);
+
+/**
+ * Insert plaintext data into the TLS module.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param data - A pointer to the data to process.
+ * @param len - The length in bytes of the data to process.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: All the data was processed successfully.
+ * - \c 0: The data was not processed, this function should be called
+ * again later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_write_plaintext_const (struct key_state_ssl *ks_ssl,
+ const uint8_t *data, int len);
+
+/**
+ * Extract ciphertext data from the TLS module.
+ *
+ * If the \a buf buffer has a length other than zero, this function does
+ * not perform any action and returns 0.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - A buffer in which to store the ciphertext.
+ * @param maxlen - The maximum number of bytes to extract.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: Data was extracted successfully.
+ * - \c 0: No data was extracted, this function should be called again
+ * later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_read_ciphertext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen);
+
+/** @} name Functions for packets to be sent to a remote OpenVPN peer */
+
+
+/** @name Functions for packets received from a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Insert a ciphertext buffer into the TLS module.
+ *
+ * After successfully processing the data, the data in \a buf is zeroized,
+ * its length set to zero, and a value of \c 1 is returned.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - The ciphertext message to process.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: All the data was processed successfully.
+ * - \c 0: The data was not processed, this function should be called
+ * again later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_write_ciphertext (struct key_state_ssl *ks_ssl,
+ struct buffer *buf);
+
+/**
+ * Extract plaintext data from the TLS module.
+ *
+ * If the \a buf buffer has a length other than zero, this function does
+ * not perform any action and returns 0.
+ *
+ * @param ks_ssl - The security parameter state for this %key
+ * session.
+ * @param buf - A buffer in which to store the plaintext.
+ * @param maxlen - The maximum number of bytes to extract.
+ *
+ * @return The return value indicates whether the data was successfully
+ * processed:
+ * - \c 1: Data was extracted successfully.
+ * - \c 0: No data was extracted, this function should be called again
+ * later to retry.
+ * - \c -1: An error occurred.
+ */
+int key_state_read_plaintext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen);
+
+/** @} name Functions for packets received from a remote OpenVPN peer */
+
+/** @} addtogroup control_tls */
+
+/* **************************************
+ *
+ * Information functions
+ *
+ * Print information for the end user.
+ *
+ ***************************************/
+
+/*
+ * Print a one line summary of SSL/TLS session handshake.
+ */
+void print_details (struct key_state_ssl * ks_ssl, const char *prefix);
+
+/*
+ * Show the TLS ciphers that are available for us to use in the OpenSSL
+ * library.
+ *
+ * @param - list of allowed TLS cipher, or NULL.
+ */
+void show_available_tls_ciphers (const char *tls_ciphers);
+
+/*
+ * Show the available elliptic curves in the crypto library
+ */
+void show_available_curves (void);
+
+/*
+ * The OpenSSL library has a notion of preference in TLS ciphers. Higher
+ * preference == more secure. Return the highest preference cipher.
+ */
+void get_highest_preference_tls_cipher (char *buf, int size);
+
+/**
+ * return a pointer to a static memory area containing the
+ * name and version number of the SSL library in use
+ */
+const char * get_ssl_library_version(void);
+
+#endif /* SSL_BACKEND_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_common.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_common.h
new file mode 100644
index 00000000..2fc72aa6
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_common.h
@@ -0,0 +1,512 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Common Data Structures
+ */
+
+#ifndef SSL_COMMON_H_
+#define SSL_COMMON_H_
+
+#include "session_id.h"
+#include "socket.h"
+#include "packet_id.h"
+#include "crypto.h"
+#include "options.h"
+
+#include "ssl_backend.h"
+
+/* passwords */
+#define UP_TYPE_AUTH "Auth"
+#define UP_TYPE_PRIVATE_KEY "Private Key"
+
+/** @addtogroup control_processor
+ * @{ */
+/**
+ * @name Control channel negotiation states
+ *
+ * These states represent the different phases of control channel
+ * negotiation between OpenVPN peers. OpenVPN servers and clients
+ * progress through the states in a different order, because of their
+ * different roles during exchange of random material. The references to
+ * the \c key_source2 structure in the list below is only valid if %key
+ * method 2 is being used. See the \link key_generation data channel key
+ * generation\endlink related page for more information.
+ *
+ * Clients follow this order:
+ * -# \c S_INITIAL, ready to begin three-way handshake and control
+ * channel negotiation.
+ * -# \c S_PRE_START, have started three-way handshake, waiting for
+ * acknowledgment from remote.
+ * -# \c S_START, initial three-way handshake complete.
+ * -# \c S_SENT_KEY, have sent local part of \c key_source2 random
+ * material.
+ * -# \c S_GOT_KEY, have received remote part of \c key_source2 random
+ * material.
+ * -# \c S_ACTIVE, normal operation during remaining handshake window.
+ * -# \c S_NORMAL_OP, normal operation.
+ *
+ * Servers follow the same order, except for \c S_SENT_KEY and \c
+ * S_GOT_KEY being reversed, because the server first receives the
+ * client's \c key_source2 random material before generating and sending
+ * its own.
+ *
+ * @{
+ */
+#define S_ERROR -1 /**< Error state. */
+#define S_UNDEF 0 /**< Undefined state, used after a \c
+ * key_state is cleaned up. */
+#define S_INITIAL 1 /**< Initial \c key_state state after
+ * initialization by \c key_state_init()
+ * before start of three-way handshake. */
+#define S_PRE_START 2 /**< Waiting for the remote OpenVPN peer
+ * to acknowledge during the initial
+ * three-way handshake. */
+#define S_START 3 /**< Three-way handshake is complete,
+ * start of key exchange. */
+#define S_SENT_KEY 4 /**< Local OpenVPN process has sent its
+ * part of the key material. */
+#define S_GOT_KEY 5 /**< Local OpenVPN process has received
+ * the remote's part of the key
+ * material. */
+#define S_ACTIVE 6 /**< Operational \c key_state state
+ * immediately after negotiation has
+ * completed while still within the
+ * handshake window. */
+/* ready to exchange data channel packets */
+#define S_NORMAL_OP 7 /**< Normal operational \c key_state
+ * state. */
+/** @} name Control channel negotiation states */
+/** @} addtogroup control_processor */
+
+/**
+ * Container for one half of random material to be used in %key method 2
+ * \ref key_generation "data channel key generation".
+ * @ingroup control_processor
+ */
+struct key_source {
+ uint8_t pre_master[48]; /**< Random used for master secret
+ * generation, provided only by client
+ * OpenVPN peer. */
+ uint8_t random1[32]; /**< Seed used for master secret
+ * generation, provided by both client
+ * and server. */
+ uint8_t random2[32]; /**< Seed used for key expansion, provided
+ * by both client and server. */
+};
+
+
+/**
+ * Container for both halves of random material to be used in %key method
+ * 2 \ref key_generation "data channel key generation".
+ * @ingroup control_processor
+ */
+struct key_source2 {
+ struct key_source client; /**< Random provided by client. */
+ struct key_source server; /**< Random provided by server. */
+};
+
+/**
+ * Security parameter state of one TLS and data channel %key session.
+ * @ingroup control_processor
+ *
+ * This structure represents one security parameter session between
+ * OpenVPN peers. It includes the control channel TLS state and the data
+ * channel crypto state. It also contains the reliability layer
+ * structures used for control channel messages.
+ *
+ * A new \c key_state structure is initialized for each hard or soft
+ * reset.
+ *
+ * @see
+ * - This structure should be initialized using the \c key_state_init()
+ * function.
+ * - This structure should be cleaned up using the \c key_state_free()
+ * function.
+ */
+struct key_state
+{
+ int state;
+ int key_id; /* inherited from struct tls_session below */
+
+ struct key_state_ssl ks_ssl; /* contains SSL object and BIOs for the control channel */
+
+ time_t established; /* when our state went S_ACTIVE */
+ time_t must_negotiate; /* key negotiation times out if not finished before this time */
+ time_t must_die; /* this object is destroyed at this time */
+
+ int initial_opcode; /* our initial P_ opcode */
+ struct session_id session_id_remote; /* peer's random session ID */
+ struct link_socket_actual remote_addr; /* peer's IP addr */
+ struct packet_id packet_id; /* for data channel, to prevent replay attacks */
+
+ struct key_ctx_bi key; /* data channel keys for encrypt/decrypt/hmac */
+
+ struct key_source2 *key_src; /* source entropy for key expansion */
+
+ struct buffer plaintext_read_buf;
+ struct buffer plaintext_write_buf;
+ struct buffer ack_write_buf;
+
+ struct reliable *send_reliable; /* holds a copy of outgoing packets until ACK received */
+ struct reliable *rec_reliable; /* order incoming ciphertext packets before we pass to TLS */
+ struct reliable_ack *rec_ack; /* buffers all packet IDs we want to ACK back to sender */
+
+ struct buffer_list *paybuf;
+
+ counter_type n_bytes; /* how many bytes sent/recvd since last key exchange */
+ counter_type n_packets; /* how many packets sent/recvd since last key exchange */
+
+ /*
+ * If bad username/password, TLS connection will come up but 'authenticated' will be false.
+ */
+ bool authenticated;
+ time_t auth_deferred_expire;
+
+#ifdef ENABLE_DEF_AUTH
+ /* If auth_deferred is true, authentication is being deferred */
+ bool auth_deferred;
+#ifdef MANAGEMENT_DEF_AUTH
+ unsigned int mda_key_id;
+ unsigned int mda_status;
+#endif
+#ifdef PLUGIN_DEF_AUTH
+ unsigned int auth_control_status;
+ time_t acf_last_mod;
+ char *auth_control_file;
+#endif
+#endif
+};
+
+/*
+ * Our const options, obtained directly or derived from
+ * command line options.
+ */
+struct tls_options
+{
+ /* our master TLS context from which all SSL objects derived */
+ struct tls_root_ctx ssl_ctx;
+
+ /* data channel cipher, hmac, and key lengths */
+ struct key_type key_type;
+
+ /* true if we are a TLS server, client otherwise */
+ bool server;
+
+ /* if true, don't xmit until first packet from peer is received */
+ bool xmit_hold;
+
+#ifdef ENABLE_OCC
+ /* local and remote options strings
+ that must match between client and server */
+ const char *local_options;
+ const char *remote_options;
+#endif
+
+ /* from command line */
+ int key_method;
+ bool replay;
+ bool single_session;
+#ifdef ENABLE_OCC
+ bool disable_occ;
+#endif
+#ifdef ENABLE_PUSH_PEER_INFO
+ int push_peer_info_detail;
+#endif
+ int transition_window;
+ int handshake_window;
+ interval_t packet_timeout;
+ int renegotiate_bytes;
+ int renegotiate_packets;
+ interval_t renegotiate_seconds;
+
+ /* cert verification parms */
+ const char *verify_command;
+ const char *verify_export_cert;
+ int verify_x509_type;
+ const char *verify_x509_name;
+ const char *crl_file;
+ int ns_cert_type;
+ unsigned remote_cert_ku[MAX_PARMS];
+ const char *remote_cert_eku;
+ uint8_t *verify_hash;
+ char *x509_username_field;
+
+ /* allow openvpn config info to be
+ passed over control channel */
+ bool pass_config_info;
+
+ /* struct crypto_option flags */
+ unsigned int crypto_flags_and;
+ unsigned int crypto_flags_or;
+
+ int replay_window; /* --replay-window parm */
+ int replay_time; /* --replay-window parm */
+ bool tcp_mode;
+
+ /* packet authentication for TLS handshake */
+ struct crypto_options tls_auth;
+ struct key_ctx_bi tls_auth_key;
+
+ /* frame parameters for TLS control channel */
+ struct frame frame;
+
+ /* used for username/password authentication */
+ const char *auth_user_pass_verify_script;
+ bool auth_user_pass_verify_script_via_file;
+ const char *tmp_dir;
+
+ /* use the client-config-dir as a positive authenticator */
+ const char *client_config_dir_exclusive;
+
+ /* instance-wide environment variable set */
+ struct env_set *es;
+ const struct plugin_list *plugins;
+
+ /* compression parms */
+#ifdef USE_COMP
+ struct compress_options comp_options;
+#endif
+
+ /* configuration file SSL-related boolean and low-permutation options */
+# define SSLF_CLIENT_CERT_NOT_REQUIRED (1<<0)
+# define SSLF_USERNAME_AS_COMMON_NAME (1<<1)
+# define SSLF_AUTH_USER_PASS_OPTIONAL (1<<2)
+# define SSLF_OPT_VERIFY (1<<4)
+# define SSLF_CRL_VERIFY_DIR (1<<5)
+# define SSLF_TLS_VERSION_SHIFT 6
+# define SSLF_TLS_VERSION_MASK 0xF /* (uses bit positions 6 to 9) */
+ unsigned int ssl_flags;
+
+#ifdef MANAGEMENT_DEF_AUTH
+ struct man_def_auth_context *mda_context;
+#endif
+
+#ifdef ENABLE_X509_TRACK
+ const struct x509_track *x509_track;
+#endif
+
+#ifdef ENABLE_CLIENT_CR
+ const struct static_challenge_info *sci;
+#endif
+
+ /* --gremlin bits */
+ int gremlin;
+};
+
+/** @addtogroup control_processor
+ * @{ */
+/** @name Index of key_state objects within a tls_session structure
+ *
+ * This is the index of \c tls_session.key
+ *
+ * @{ */
+#define KS_PRIMARY 0 /**< Primary %key state index. */
+#define KS_LAME_DUCK 1 /**< %Key state index that will retire
+ * soon. */
+#define KS_SIZE 2 /**< Size of the \c tls_session.key array. */
+/** @} name Index of key_state objects within a tls_session structure */
+/** @} addtogroup control_processor */
+
+
+/**
+ * Security parameter state of a single session within a VPN tunnel.
+ * @ingroup control_processor
+ *
+ * This structure represents an OpenVPN peer-to-peer control channel
+ * session.
+ *
+ * A \c tls_session remains over soft resets, but a new instance is
+ * initialized for each hard reset.
+ *
+ * @see
+ * - This structure should be initialized using the \c tls_session_init()
+ * function.
+ * - This structure should be cleaned up using the \c tls_session_free()
+ * function.
+ */
+struct tls_session
+{
+ /* const options and config info */
+ struct tls_options *opt;
+
+ /* during hard reset used to control burst retransmit */
+ bool burst;
+
+ /* authenticate control packets */
+ struct crypto_options tls_auth;
+ struct packet_id tls_auth_pid;
+
+ int initial_opcode; /* our initial P_ opcode */
+ struct session_id session_id; /* our random session ID */
+ int key_id; /* increments with each soft reset (for key renegotiation) */
+
+ int limit_next; /* used for traffic shaping on the control channel */
+
+ int verify_maxlevel;
+
+ char *common_name;
+
+ struct cert_hash_set *cert_hash_set;
+
+#ifdef ENABLE_PF
+ uint32_t common_name_hashval;
+#endif
+
+ bool verified; /* true if peer certificate was verified against CA */
+
+ /* not-yet-authenticated incoming client */
+ struct link_socket_actual untrusted_addr;
+
+ struct key_state key[KS_SIZE];
+};
+
+/** @addtogroup control_processor
+ * @{ */
+/** @name Index of tls_session objects within a tls_multi structure
+ *
+ * This is the index of \c tls_multi.session
+ *
+ * Normally three tls_session objects are maintained by an active openvpn
+ * session. The first is the current, TLS authenticated session, the
+ * second is used to process connection requests from a new client that
+ * would usurp the current session if successfully authenticated, and the
+ * third is used as a repository for a "lame-duck" %key in the event that
+ * the primary session resets due to error while the lame-duck %key still
+ * has time left before its expiration. Lame duck keys are used to
+ * maintain the continuity of the data channel connection while a new %key
+ * is being negotiated.
+ *
+ * @{ */
+#define TM_ACTIVE 0 /**< Active \c tls_session. */
+#define TM_UNTRUSTED 1 /**< As yet un-trusted \c tls_session
+ * being negotiated. */
+#define TM_LAME_DUCK 2 /**< Old \c tls_session. */
+#define TM_SIZE 3 /**< Size of the \c tls_multi.session
+ * array. */
+/** @} name Index of tls_session objects within a tls_multi structure */
+/** @} addtogroup control_processor */
+
+
+/*
+ * The number of keys we will scan on encrypt or decrypt. The first
+ * is the "active" key. The second is the lame_duck or retiring key
+ * associated with the active key's session ID. The third is a detached
+ * lame duck session that only occurs in situations where a key renegotiate
+ * failed on the active key, but a lame duck key was still valid. By
+ * preserving the lame duck session, we can be assured of having a data
+ * channel key available even when network conditions are so bad that
+ * we can't negotiate a new key within the time allotted.
+ */
+#define KEY_SCAN_SIZE 3
+
+
+/**
+ * Security parameter state for a single VPN tunnel.
+ * @ingroup control_processor
+ *
+ * An active VPN tunnel running with TLS enabled has one \c tls_multi
+ * object, in which it stores all control channel and data channel
+ * security parameter state. This structure can contain multiple,
+ * possibly simultaneously active, \c tls_context objects to allow for
+ * interruption-less transitions during session renegotiations. Each \c
+ * tls_context represents one control channel session, which can span
+ * multiple data channel security parameter sessions stored in \c
+ * key_state structures.
+ */
+struct tls_multi
+{
+ /* used to coordinate access between main thread and TLS thread */
+ /*MUTEX_PTR_DEFINE (mutex);*/
+
+ /* const options and config info */
+ struct tls_options opt;
+
+ struct key_state* key_scan[KEY_SCAN_SIZE];
+ /**< List of \c key_state objects in the
+ * order they should be scanned by data
+ * channel modules. */
+
+ /*
+ * used by tls_pre_encrypt to communicate the encrypt key
+ * to tls_post_encrypt()
+ */
+ struct key_state *save_ks; /* temporary pointer used between pre/post routines */
+
+ /*
+ * Used to return outgoing address from
+ * tls_multi_process.
+ */
+ struct link_socket_actual to_link_addr;
+
+ int n_sessions; /**< Number of sessions negotiated thus
+ * far. */
+
+ /*
+ * Number of errors.
+ */
+ int n_hard_errors; /* errors due to TLS negotiation failure */
+ int n_soft_errors; /* errors due to unrecognized or failed-to-authenticate incoming packets */
+
+ /*
+ * Our locked common name, username, and cert hashes (cannot change during the life of this tls_multi object)
+ */
+ char *locked_cn;
+ char *locked_username;
+ struct cert_hash_set *locked_cert_hash_set;
+
+#ifdef ENABLE_DEF_AUTH
+ /*
+ * An error message to send to client on AUTH_FAILED
+ */
+ char *client_reason;
+
+ /* Time of last call to tls_authentication_status */
+ time_t tas_last;
+#endif
+
+#if P2MP_SERVER
+ /*
+ * A multi-line string of general-purpose info received from peer
+ * over control channel.
+ */
+ char *peer_info;
+#endif
+
+ /* For P_DATA_V2 */
+ uint32_t vpn_session_id;
+ int use_session_id;
+
+ /*
+ * Our session objects.
+ */
+ struct tls_session session[TM_SIZE];
+ /**< Array of \c tls_session objects
+ * representing control channel
+ * sessions with the remote peer. */
+};
+
+
+#endif /* SSL_COMMON_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.c
new file mode 100644
index 00000000..adf3ae6f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.c
@@ -0,0 +1,1452 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel OpenSSL Backend
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL)
+
+#include "errlevel.h"
+#include "buffer.h"
+#include "misc.h"
+#include "manage.h"
+#include "memdbg.h"
+#include "ssl_backend.h"
+#include "ssl_common.h"
+#include "base64.h"
+
+#ifdef ENABLE_CRYPTOAPI
+#include "cryptoapi.h"
+#endif
+
+#include "ssl_verify_openssl.h"
+
+#include <openssl/err.h>
+#include <openssl/pkcs12.h>
+#include <openssl/x509.h>
+#include <openssl/crypto.h>
+#ifndef OPENSSL_NO_EC
+#include <openssl/ec.h>
+#endif
+
+/*
+ * Allocate space in SSL objects in which to store a struct tls_session
+ * pointer back to parent.
+ *
+ */
+
+int mydata_index; /* GLOBAL */
+
+void
+tls_init_lib()
+{
+ SSL_library_init();
+#ifndef ENABLE_SMALL
+ SSL_load_error_strings();
+#endif
+ OpenSSL_add_all_algorithms ();
+
+ mydata_index = SSL_get_ex_new_index(0, "struct session *", NULL, NULL, NULL);
+ ASSERT (mydata_index >= 0);
+}
+
+void
+tls_free_lib()
+{
+ EVP_cleanup();
+#ifndef ENABLE_SMALL
+ ERR_free_strings();
+#endif
+}
+
+void
+tls_clear_error()
+{
+ ERR_clear_error ();
+}
+
+void
+tls_ctx_server_new(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+
+ ctx->ctx = SSL_CTX_new (SSLv23_server_method ());
+
+ if (ctx->ctx == NULL)
+ msg (M_SSLERR, "SSL_CTX_new SSLv23_server_method");
+}
+
+void
+tls_ctx_client_new(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+
+ ctx->ctx = SSL_CTX_new (SSLv23_client_method ());
+
+ if (ctx->ctx == NULL)
+ msg (M_SSLERR, "SSL_CTX_new SSLv23_client_method");
+}
+
+void
+tls_ctx_free(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+ if (NULL != ctx->ctx)
+ SSL_CTX_free (ctx->ctx);
+ ctx->ctx = NULL;
+}
+
+bool tls_ctx_initialised(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+ return NULL != ctx->ctx;
+}
+
+/*
+ * Print debugging information on SSL/TLS session negotiation.
+ */
+
+#ifndef INFO_CALLBACK_SSL_CONST
+#define INFO_CALLBACK_SSL_CONST const
+#endif
+static void
+info_callback (INFO_CALLBACK_SSL_CONST SSL * s, int where, int ret)
+{
+ if (where & SSL_CB_LOOP)
+ {
+ dmsg (D_HANDSHAKE_VERBOSE, "SSL state (%s): %s",
+ where & SSL_ST_CONNECT ? "connect" :
+ where & SSL_ST_ACCEPT ? "accept" :
+ "undefined", SSL_state_string_long (s));
+ }
+ else if (where & SSL_CB_ALERT)
+ {
+ dmsg (D_HANDSHAKE_VERBOSE, "SSL alert (%s): %s: %s",
+ where & SSL_CB_READ ? "read" : "write",
+ SSL_alert_type_string_long (ret),
+ SSL_alert_desc_string_long (ret));
+ }
+}
+
+/*
+ * Return maximum TLS version supported by local OpenSSL library.
+ * Assume that presence of SSL_OP_NO_TLSvX macro indicates that
+ * TLSvX is supported.
+ */
+int
+tls_version_max(void)
+{
+#if defined(SSL_OP_NO_TLSv1_2)
+ return TLS_VER_1_2;
+#elif defined(SSL_OP_NO_TLSv1_1)
+ return TLS_VER_1_1;
+#else
+ return TLS_VER_1_0;
+#endif
+}
+
+void
+tls_ctx_set_options (struct tls_root_ctx *ctx, unsigned int ssl_flags)
+{
+ ASSERT(NULL != ctx);
+
+ /* process SSL options including minimum TLS version we will accept from peer */
+ {
+ long sslopt = SSL_OP_SINGLE_DH_USE | SSL_OP_NO_TICKET | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
+ const int tls_version_min = (ssl_flags >> SSLF_TLS_VERSION_SHIFT) & SSLF_TLS_VERSION_MASK;
+ if (tls_version_min > TLS_VER_1_0)
+ sslopt |= SSL_OP_NO_TLSv1;
+#ifdef SSL_OP_NO_TLSv1_1
+ if (tls_version_min > TLS_VER_1_1)
+ sslopt |= SSL_OP_NO_TLSv1_1;
+#endif
+#ifdef SSL_OP_NO_TLSv1_2
+ if (tls_version_min > TLS_VER_1_2)
+ sslopt |= SSL_OP_NO_TLSv1_2;
+#endif
+ SSL_CTX_set_options (ctx->ctx, sslopt);
+ }
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ SSL_CTX_set_mode (ctx->ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+ SSL_CTX_set_session_cache_mode (ctx->ctx, SSL_SESS_CACHE_OFF);
+ SSL_CTX_set_default_passwd_cb (ctx->ctx, pem_password_callback);
+
+ /* Require peer certificate verification */
+#if P2MP_SERVER
+ if (ssl_flags & SSLF_CLIENT_CERT_NOT_REQUIRED)
+ {
+ msg (M_WARN, "WARNING: POTENTIALLY DANGEROUS OPTION "
+ "--client-cert-not-required may accept clients which do not present "
+ "a certificate");
+ }
+ else
+#endif
+ SSL_CTX_set_verify (ctx->ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
+ verify_callback);
+
+ SSL_CTX_set_info_callback (ctx->ctx, info_callback);
+}
+
+void
+tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
+{
+ if (ciphers == NULL)
+ {
+ /* Use sane default (disable export, and unsupported cipher modes) */
+ if(!SSL_CTX_set_cipher_list(ctx->ctx, "DEFAULT:!EXP:!PSK:!SRP"))
+ msg(M_SSLERR, "Failed to set default TLS cipher list.");
+ return;
+ }
+
+ /* Parse supplied cipher list and pass on to OpenSSL */
+ size_t begin_of_cipher, end_of_cipher;
+
+ const char *current_cipher;
+ size_t current_cipher_len;
+
+ const tls_cipher_name_pair *cipher_pair;
+
+ char openssl_ciphers[4096];
+ size_t openssl_ciphers_len = 0;
+ openssl_ciphers[0] = '\0';
+
+ ASSERT(NULL != ctx);
+
+ // Translate IANA cipher suite names to OpenSSL names
+ begin_of_cipher = end_of_cipher = 0;
+ for (; begin_of_cipher < strlen(ciphers); begin_of_cipher = end_of_cipher) {
+ end_of_cipher += strcspn(&ciphers[begin_of_cipher], ":");
+ cipher_pair = tls_get_cipher_name_pair(&ciphers[begin_of_cipher], end_of_cipher - begin_of_cipher);
+
+ if (NULL == cipher_pair)
+ {
+ // No translation found, use original
+ current_cipher = &ciphers[begin_of_cipher];
+ current_cipher_len = end_of_cipher - begin_of_cipher;
+
+ // Issue warning on missing translation
+ // %.*s format specifier expects length of type int, so guarantee
+ // that length is small enough and cast to int.
+ msg (M_WARN, "No valid translation found for TLS cipher '%.*s'",
+ constrain_int(current_cipher_len, 0, 256), current_cipher);
+ }
+ else
+ {
+ // Use OpenSSL name
+ current_cipher = cipher_pair->openssl_name;
+ current_cipher_len = strlen(current_cipher);
+
+ if (end_of_cipher - begin_of_cipher == current_cipher_len &&
+ 0 != memcmp (&ciphers[begin_of_cipher], cipher_pair->iana_name,
+ end_of_cipher - begin_of_cipher))
+ {
+ // Non-IANA name used, show warning
+ msg (M_WARN, "Deprecated TLS cipher name '%s', please use IANA name '%s'", cipher_pair->openssl_name, cipher_pair->iana_name);
+ }
+ }
+
+ // Make sure new cipher name fits in cipher string
+ if (((sizeof(openssl_ciphers)-1) - openssl_ciphers_len) < current_cipher_len) {
+ msg(M_SSLERR, "Failed to set restricted TLS cipher list, too long (>%d).", (int)sizeof(openssl_ciphers)-1);
+ }
+
+ // Concatenate cipher name to OpenSSL cipher string
+ memcpy(&openssl_ciphers[openssl_ciphers_len], current_cipher, current_cipher_len);
+ openssl_ciphers_len += current_cipher_len;
+ openssl_ciphers[openssl_ciphers_len] = ':';
+ openssl_ciphers_len++;
+
+ end_of_cipher++;
+ }
+
+ if (openssl_ciphers_len > 0)
+ openssl_ciphers[openssl_ciphers_len-1] = '\0';
+
+ // Set OpenSSL cipher list
+ if(!SSL_CTX_set_cipher_list(ctx->ctx, openssl_ciphers))
+ msg(M_SSLERR, "Failed to set restricted TLS cipher list: %s", openssl_ciphers);
+}
+
+void
+tls_ctx_load_dh_params (struct tls_root_ctx *ctx, const char *dh_file,
+ const char *dh_file_inline
+ )
+{
+ DH *dh;
+ BIO *bio;
+
+ ASSERT(NULL != ctx);
+
+ if (!strcmp (dh_file, INLINE_FILE_TAG) && dh_file_inline)
+ {
+ if (!(bio = BIO_new_mem_buf ((char *)dh_file_inline, -1)))
+ msg (M_SSLERR, "Cannot open memory BIO for inline DH parameters");
+ }
+ else
+ {
+ /* Get Diffie Hellman Parameters */
+ if (!(bio = BIO_new_file (dh_file, "r")))
+ msg (M_SSLERR, "Cannot open %s for DH parameters", dh_file);
+ }
+
+ dh = PEM_read_bio_DHparams (bio, NULL, NULL, NULL);
+ BIO_free (bio);
+
+ if (!dh)
+ msg (M_SSLERR, "Cannot load DH parameters from %s", dh_file);
+ if (!SSL_CTX_set_tmp_dh (ctx->ctx, dh))
+ msg (M_SSLERR, "SSL_CTX_set_tmp_dh");
+
+ msg (D_TLS_DEBUG_LOW, "Diffie-Hellman initialized with %d bit key",
+ 8 * DH_size (dh));
+
+ DH_free (dh);
+}
+
+void
+tls_ctx_load_ecdh_params (struct tls_root_ctx *ctx, const char *curve_name
+ )
+{
+#ifndef OPENSSL_NO_EC
+ int nid = NID_undef;
+ EC_KEY *ecdh = NULL;
+ const char *sname = NULL;
+
+ /* Generate a new ECDH key for each SSL session (for non-ephemeral ECDH) */
+ SSL_CTX_set_options(ctx->ctx, SSL_OP_SINGLE_ECDH_USE);
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ /* OpenSSL 1.0.2 and newer can automatically handle ECDH parameter loading */
+ if (NULL == curve_name) {
+ SSL_CTX_set_ecdh_auto(ctx->ctx, 1);
+ return;
+ }
+#endif
+ /* For older OpenSSL, we'll have to do the parameter loading on our own */
+ if (curve_name != NULL)
+ {
+ /* Use user supplied curve if given */
+ msg (D_TLS_DEBUG, "Using user specified ECDH curve (%s)", curve_name);
+ nid = OBJ_sn2nid(curve_name);
+ }
+ else
+ {
+ /* Extract curve from key */
+ EC_KEY *eckey = NULL;
+ const EC_GROUP *ecgrp = NULL;
+ EVP_PKEY *pkey = NULL;
+
+ /* Little hack to get private key ref from SSL_CTX, yay OpenSSL... */
+ SSL ssl;
+ ssl.cert = ctx->ctx->cert;
+ pkey = SSL_get_privatekey(&ssl);
+
+ msg (D_TLS_DEBUG, "Extracting ECDH curve from private key");
+
+ if (pkey != NULL && (eckey = EVP_PKEY_get1_EC_KEY(pkey)) != NULL &&
+ (ecgrp = EC_KEY_get0_group(eckey)) != NULL)
+ nid = EC_GROUP_get_curve_name(ecgrp);
+ }
+
+ /* Translate NID back to name , just for kicks */
+ sname = OBJ_nid2sn(nid);
+ if (sname == NULL) sname = "(Unknown)";
+
+ /* Create new EC key and set as ECDH key */
+ if (NID_undef == nid || NULL == (ecdh = EC_KEY_new_by_curve_name(nid)))
+ {
+ /* Creating key failed, fall back on sane default */
+ ecdh = EC_KEY_new_by_curve_name(NID_secp384r1);
+ const char *source = (NULL == curve_name) ?
+ "extract curve from certificate" : "use supplied curve";
+ msg (D_TLS_DEBUG_LOW,
+ "Failed to %s (%s), using secp384r1 instead.", source, sname);
+ sname = OBJ_nid2sn(NID_secp384r1);
+ }
+
+ if (!SSL_CTX_set_tmp_ecdh(ctx->ctx, ecdh))
+ msg (M_SSLERR, "SSL_CTX_set_tmp_ecdh: cannot add curve");
+
+ msg (D_TLS_DEBUG_LOW, "ECDH curve %s added", sname);
+
+ EC_KEY_free(ecdh);
+#else
+ msg (M_DEBUG, "Your OpenSSL library was built without elliptic curve support."
+ " Skipping ECDH parameter loading.");
+#endif /* OPENSSL_NO_EC */
+}
+
+int
+tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file,
+ const char *pkcs12_file_inline,
+ bool load_ca_file
+ )
+{
+ FILE *fp;
+ EVP_PKEY *pkey;
+ X509 *cert;
+ STACK_OF(X509) *ca = NULL;
+ PKCS12 *p12;
+ int i;
+ char password[256];
+
+ ASSERT(NULL != ctx);
+
+ if (!strcmp (pkcs12_file, INLINE_FILE_TAG) && pkcs12_file_inline)
+ {
+ BIO *b64 = BIO_new(BIO_f_base64());
+ BIO *bio = BIO_new_mem_buf((void *) pkcs12_file_inline,
+ (int) strlen(pkcs12_file_inline));
+ ASSERT(b64 && bio);
+ BIO_push(b64, bio);
+ p12 = d2i_PKCS12_bio(b64, NULL);
+ if (!p12)
+ msg(M_SSLERR, "Error reading inline PKCS#12 file");
+ BIO_free(b64);
+ BIO_free(bio);
+ }
+ else
+ {
+ /* Load the PKCS #12 file */
+ if (!(fp = platform_fopen(pkcs12_file, "rb")))
+ msg(M_SSLERR, "Error opening file %s", pkcs12_file);
+ p12 = d2i_PKCS12_fp(fp, NULL);
+ fclose(fp);
+ if (!p12)
+ msg(M_SSLERR, "Error reading PKCS#12 file %s", pkcs12_file);
+ }
+
+ /* Parse the PKCS #12 file */
+ if (!PKCS12_parse(p12, "", &pkey, &cert, &ca))
+ {
+ pem_password_callback (password, sizeof(password) - 1, 0, NULL);
+ /* Reparse the PKCS #12 file with password */
+ ca = NULL;
+ if (!PKCS12_parse(p12, password, &pkey, &cert, &ca))
+ {
+#ifdef ENABLE_MANAGEMENT
+ if (management && (ERR_GET_REASON (ERR_peek_error()) == PKCS12_R_MAC_VERIFY_FAILURE))
+ management_auth_failure (management, UP_TYPE_PRIVATE_KEY, NULL);
+#endif
+ PKCS12_free(p12);
+ return 1;
+ }
+ }
+ PKCS12_free(p12);
+
+ /* Load Certificate */
+ if (!SSL_CTX_use_certificate (ctx->ctx, cert))
+ msg (M_SSLERR, "Cannot use certificate");
+
+ /* Load Private Key */
+ if (!SSL_CTX_use_PrivateKey (ctx->ctx, pkey))
+ msg (M_SSLERR, "Cannot use private key");
+ warn_if_group_others_accessible (pkcs12_file);
+
+ /* Check Private Key */
+ if (!SSL_CTX_check_private_key (ctx->ctx))
+ msg (M_SSLERR, "Private key does not match the certificate");
+
+ /* Set Certificate Verification chain */
+ if (load_ca_file)
+ {
+ /* Add CAs from PKCS12 to the cert store and mark them as trusted.
+ * They're also used to fill in the chain of intermediate certs as
+ * necessary.
+ */
+ if (ca && sk_X509_num(ca))
+ {
+ for (i = 0; i < sk_X509_num(ca); i++)
+ {
+ if (!X509_STORE_add_cert(ctx->ctx->cert_store,sk_X509_value(ca, i)))
+ msg (M_SSLERR, "Cannot add certificate to certificate chain (X509_STORE_add_cert)");
+ if (!SSL_CTX_add_client_CA(ctx->ctx, sk_X509_value(ca, i)))
+ msg (M_SSLERR, "Cannot add certificate to client CA list (SSL_CTX_add_client_CA)");
+ }
+ }
+ } else {
+ /* If trusted CA certs were loaded from a PEM file, and we ignore the
+ * ones in PKCS12, do load PKCS12-provided certs to the client extra
+ * certs chain just in case they include intermediate CAs needed to
+ * prove my identity to the other end. This does not make them trusted.
+ */
+ if (ca && sk_X509_num(ca))
+ {
+ for (i = 0; i < sk_X509_num(ca); i++)
+ {
+ if (!SSL_CTX_add_extra_chain_cert(ctx->ctx,sk_X509_value(ca, i)))
+ msg (M_SSLERR, "Cannot add extra certificate to chain (SSL_CTX_add_extra_chain_cert)");
+ }
+ }
+ }
+ return 0;
+}
+
+#ifdef ENABLE_CRYPTOAPI
+void
+tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
+{
+ ASSERT(NULL != ctx);
+
+ /* Load Certificate and Private Key */
+ if (!SSL_CTX_use_CryptoAPI_certificate (ctx->ctx, cryptoapi_cert))
+ msg (M_SSLERR, "Cannot load certificate \"%s\" from Microsoft Certificate Store",
+ cryptoapi_cert);
+}
+#endif /* WIN32 */
+
+static void
+tls_ctx_add_extra_certs (struct tls_root_ctx *ctx, BIO *bio)
+{
+ X509 *cert;
+ for (;;)
+ {
+ cert = NULL;
+ if (!PEM_read_bio_X509 (bio, &cert, 0, NULL)) /* takes ownership of cert */
+ break;
+ if (!cert)
+ msg (M_SSLERR, "Error reading extra certificate");
+ if (SSL_CTX_add_extra_chain_cert(ctx->ctx, cert) != 1)
+ msg (M_SSLERR, "Error adding extra certificate");
+ }
+}
+
+/* Like tls_ctx_load_cert, but returns a copy of the certificate in **X509 */
+static void
+tls_ctx_load_cert_file_and_copy (struct tls_root_ctx *ctx,
+ const char *cert_file, const char *cert_file_inline, X509 **x509
+ )
+{
+ BIO *in = NULL;
+ X509 *x = NULL;
+ int ret = 0;
+ bool inline_file = false;
+
+ ASSERT (NULL != ctx);
+ if (NULL != x509)
+ ASSERT (NULL == *x509);
+
+ inline_file = (strcmp (cert_file, INLINE_FILE_TAG) == 0);
+
+ if (inline_file && cert_file_inline)
+ in = BIO_new_mem_buf ((char *)cert_file_inline, -1);
+ else
+ in = BIO_new_file (cert_file, "r");
+
+ if (in == NULL)
+ {
+ SSLerr (SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB);
+ goto end;
+ }
+
+ x = PEM_read_bio_X509 (in, NULL, ctx->ctx->default_passwd_callback,
+ ctx->ctx->default_passwd_callback_userdata);
+ if (x == NULL)
+ {
+ SSLerr (SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PEM_LIB);
+ goto end;
+ }
+
+ ret = SSL_CTX_use_certificate (ctx->ctx, x);
+ if (ret)
+ tls_ctx_add_extra_certs (ctx, in);
+
+end:
+ if (!ret)
+ {
+ if (inline_file)
+ msg (M_SSLERR, "Cannot load inline certificate file");
+ else
+ msg (M_SSLERR, "Cannot load certificate file %s", cert_file);
+ }
+
+ if (in != NULL)
+ BIO_free(in);
+ if (x509)
+ *x509 = x;
+ else if (x)
+ X509_free (x);
+}
+
+void
+tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
+ const char *cert_file_inline)
+{
+ tls_ctx_load_cert_file_and_copy (ctx, cert_file, cert_file_inline, NULL);
+}
+
+void
+tls_ctx_free_cert_file (X509 *x509)
+{
+ X509_free(x509);
+}
+
+int
+tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file,
+ const char *priv_key_file_inline
+ )
+{
+ SSL_CTX *ssl_ctx = NULL;
+ BIO *in = NULL;
+ EVP_PKEY *pkey = NULL;
+ int ret = 1;
+
+ ASSERT(NULL != ctx);
+
+ ssl_ctx = ctx->ctx;
+
+ if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_file_inline)
+ in = BIO_new_mem_buf ((char *)priv_key_file_inline, -1);
+ else
+ in = BIO_new_file (priv_key_file, "r");
+
+ if (!in)
+ goto end;
+
+ pkey = PEM_read_bio_PrivateKey (in, NULL,
+ ssl_ctx->default_passwd_callback,
+ ssl_ctx->default_passwd_callback_userdata);
+ if (!pkey)
+ goto end;
+
+ if (!SSL_CTX_use_PrivateKey (ssl_ctx, pkey))
+ {
+#ifdef ENABLE_MANAGEMENT
+ if (management && (ERR_GET_REASON (ERR_peek_error()) == EVP_R_BAD_DECRYPT))
+ management_auth_failure (management, UP_TYPE_PRIVATE_KEY, NULL);
+#endif
+ msg (M_WARN|M_SSL, "Cannot load private key file %s", priv_key_file);
+ goto end;
+ }
+ warn_if_group_others_accessible (priv_key_file);
+
+ /* Check Private Key */
+ if (!SSL_CTX_check_private_key (ssl_ctx))
+ msg (M_SSLERR, "Private key does not match the certificate");
+ ret = 0;
+
+end:
+ if (pkey)
+ EVP_PKEY_free (pkey);
+ if (in)
+ BIO_free (in);
+ return ret;
+}
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+/* encrypt */
+static int
+rsa_pub_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ ASSERT(0);
+ return -1;
+}
+
+/* verify arbitrary data */
+static int
+rsa_pub_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ ASSERT(0);
+ return -1;
+}
+
+/* decrypt */
+static int
+rsa_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ ASSERT(0);
+ return -1;
+}
+
+/* called at RSA_free */
+static int
+rsa_finish(RSA *rsa)
+{
+ free ((void*)rsa->meth);
+ rsa->meth = NULL;
+ return 1;
+}
+
+/* sign arbitrary data */
+static int
+rsa_priv_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)
+{
+ /* optional app data in rsa->meth->app_data; */
+ char *in_b64 = NULL;
+ char *out_b64 = NULL;
+ int ret = -1;
+ int len;
+
+ if (padding != RSA_PKCS1_PADDING)
+ {
+ RSAerr (RSA_F_RSA_EAY_PRIVATE_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE);
+ goto done;
+ }
+
+ /* convert 'from' to base64 */
+ if (openvpn_base64_encode (from, flen, &in_b64) <= 0)
+ goto done;
+
+ /* call MI for signature */
+ if (management)
+ out_b64 = management_query_rsa_sig (management, in_b64);
+ if (!out_b64)
+ goto done;
+
+ /* decode base64 signature to binary */
+ len = RSA_size(rsa);
+ ret = openvpn_base64_decode (out_b64, to, len);
+
+ /* verify length */
+ if (ret != len)
+ ret = -1;
+
+ done:
+ if (in_b64)
+ free (in_b64);
+ if (out_b64)
+ free (out_b64);
+ return ret;
+}
+
+int
+tls_ctx_use_external_private_key (struct tls_root_ctx *ctx,
+ const char *cert_file, const char *cert_file_inline)
+{
+ RSA *rsa = NULL;
+ RSA *pub_rsa;
+ RSA_METHOD *rsa_meth;
+ X509 *cert = NULL;
+
+ ASSERT (NULL != ctx);
+
+ tls_ctx_load_cert_file_and_copy (ctx, cert_file, cert_file_inline, &cert);
+
+ ASSERT (NULL != cert);
+
+ /* allocate custom RSA method object */
+ ALLOC_OBJ_CLEAR (rsa_meth, RSA_METHOD);
+ rsa_meth->name = "OpenVPN external private key RSA Method";
+ rsa_meth->rsa_pub_enc = rsa_pub_enc;
+ rsa_meth->rsa_pub_dec = rsa_pub_dec;
+ rsa_meth->rsa_priv_enc = rsa_priv_enc;
+ rsa_meth->rsa_priv_dec = rsa_priv_dec;
+ rsa_meth->init = NULL;
+ rsa_meth->finish = rsa_finish;
+ rsa_meth->flags = RSA_METHOD_FLAG_NO_CHECK;
+ rsa_meth->app_data = NULL;
+
+ /* allocate RSA object */
+ rsa = RSA_new();
+ if (rsa == NULL)
+ {
+ SSLerr(SSL_F_SSL_USE_PRIVATEKEY, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
+ /* get the public key */
+ ASSERT(cert->cert_info->key->pkey); /* NULL before SSL_CTX_use_certificate() is called */
+ pub_rsa = cert->cert_info->key->pkey->pkey.rsa;
+
+ /* initialize RSA object */
+ rsa->n = BN_dup(pub_rsa->n);
+ rsa->flags |= RSA_FLAG_EXT_PKEY;
+ if (!RSA_set_method(rsa, rsa_meth))
+ goto err;
+
+ /* bind our custom RSA object to ssl_ctx */
+ if (!SSL_CTX_use_RSAPrivateKey(ctx->ctx, rsa))
+ goto err;
+
+ X509_free(cert);
+ RSA_free(rsa); /* doesn't necessarily free, just decrements refcount */
+ return 1;
+
+ err:
+ if (cert)
+ X509_free(cert);
+ if (rsa)
+ RSA_free(rsa);
+ else
+ {
+ if (rsa_meth)
+ free(rsa_meth);
+ }
+ msg (M_SSLERR, "Cannot enable SSL external private key capability");
+ return 0;
+}
+
+#endif
+
+static int
+sk_x509_name_cmp(const X509_NAME * const *a, const X509_NAME * const *b)
+{
+ return X509_NAME_cmp (*a, *b);
+}
+
+void
+tls_ctx_load_ca (struct tls_root_ctx *ctx, const char *ca_file,
+ const char *ca_file_inline,
+ const char *ca_path, bool tls_server
+ )
+{
+ STACK_OF(X509_INFO) *info_stack = NULL;
+ STACK_OF(X509_NAME) *cert_names = NULL;
+ X509_LOOKUP *lookup = NULL;
+ X509_STORE *store = NULL;
+ X509_NAME *xn = NULL;
+ BIO *in = NULL;
+ int i, added = 0, prev = 0;
+
+ ASSERT(NULL != ctx);
+
+ store = SSL_CTX_get_cert_store(ctx->ctx);
+ if (!store)
+ msg(M_SSLERR, "Cannot get certificate store (SSL_CTX_get_cert_store)");
+
+ /* Try to add certificates and CRLs from ca_file */
+ if (ca_file)
+ {
+ if (!strcmp (ca_file, INLINE_FILE_TAG) && ca_file_inline)
+ in = BIO_new_mem_buf ((char *)ca_file_inline, -1);
+ else
+ in = BIO_new_file (ca_file, "r");
+
+ if (in)
+ info_stack = PEM_X509_INFO_read_bio (in, NULL, NULL, NULL);
+
+ if (info_stack)
+ {
+ for (i = 0; i < sk_X509_INFO_num (info_stack); i++)
+ {
+ X509_INFO *info = sk_X509_INFO_value (info_stack, i);
+ if (info->crl)
+ X509_STORE_add_crl (store, info->crl);
+
+ if (tls_server && !info->x509)
+ {
+ msg (M_SSLERR, "X509 name was missing in TLS mode");
+ }
+
+ if (info->x509)
+ {
+ X509_STORE_add_cert (store, info->x509);
+ added++;
+
+ if (!tls_server)
+ continue;
+
+ /* Use names of CAs as a client CA list */
+ if (cert_names == NULL)
+ {
+ cert_names = sk_X509_NAME_new (sk_x509_name_cmp);
+ if (!cert_names)
+ continue;
+ }
+
+ xn = X509_get_subject_name (info->x509);
+ if (!xn)
+ continue;
+
+ /* Don't add duplicate CA names */
+ if (sk_X509_NAME_find (cert_names, xn) == -1)
+ {
+ xn = X509_NAME_dup (xn);
+ if (!xn)
+ continue;
+ sk_X509_NAME_push (cert_names, xn);
+ }
+ }
+
+ if (tls_server) {
+ int cnum = sk_X509_NAME_num (cert_names);
+ if (cnum != (prev + 1)) {
+ msg (M_WARN, "Cannot load CA certificate file %s (entry %d did not validate)", np(ca_file), added);
+ }
+ prev = cnum;
+ }
+
+ }
+ sk_X509_INFO_pop_free (info_stack, X509_INFO_free);
+ }
+
+ if (tls_server)
+ SSL_CTX_set_client_CA_list (ctx->ctx, cert_names);
+
+ if (!added)
+ msg (M_SSLERR, "Cannot load CA certificate file %s (no entries were read)", np(ca_file));
+
+ if (tls_server) {
+ int cnum = sk_X509_NAME_num (cert_names);
+ if (cnum != added)
+ msg (M_SSLERR, "Cannot load CA certificate file %s (only %d of %d entries were valid X509 names)", np(ca_file), cnum, added);
+ }
+
+ if (in)
+ BIO_free (in);
+ }
+
+ /* Set a store for certs (CA & CRL) with a lookup on the "capath" hash directory */
+ if (ca_path)
+ {
+ lookup = X509_STORE_add_lookup (store, X509_LOOKUP_hash_dir ());
+ if (lookup && X509_LOOKUP_add_dir (lookup, ca_path, X509_FILETYPE_PEM))
+ msg(M_WARN, "WARNING: experimental option --capath %s", ca_path);
+ else
+ msg(M_SSLERR, "Cannot add lookup at --capath %s", ca_path);
+ X509_STORE_set_flags (store, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
+ }
+}
+
+void
+tls_ctx_load_extra_certs (struct tls_root_ctx *ctx, const char *extra_certs_file,
+ const char *extra_certs_file_inline
+ )
+{
+ BIO *in;
+ if (!strcmp (extra_certs_file, INLINE_FILE_TAG) && extra_certs_file_inline)
+ in = BIO_new_mem_buf ((char *)extra_certs_file_inline, -1);
+ else
+ in = BIO_new_file (extra_certs_file, "r");
+
+ if (in == NULL)
+ msg (M_SSLERR, "Cannot load extra-certs file: %s", extra_certs_file);
+ else
+ tls_ctx_add_extra_certs (ctx, in);
+
+ BIO_free (in);
+}
+
+/* **************************************
+ *
+ * Key-state specific functions
+ *
+ ***************************************/
+/*
+ *
+ * BIO functions
+ *
+ */
+
+#ifdef BIO_DEBUG
+
+#warning BIO_DEBUG defined
+
+static FILE *biofp; /* GLOBAL */
+static bool biofp_toggle; /* GLOBAL */
+static time_t biofp_last_open; /* GLOBAL */
+static const int biofp_reopen_interval = 600; /* GLOBAL */
+
+static void
+close_biofp()
+{
+ if (biofp)
+ {
+ ASSERT (!fclose (biofp));
+ biofp = NULL;
+ }
+}
+
+static void
+open_biofp()
+{
+ const time_t current = time (NULL);
+ const pid_t pid = getpid ();
+
+ if (biofp_last_open + biofp_reopen_interval < current)
+ close_biofp();
+ if (!biofp)
+ {
+ char fn[256];
+ openvpn_snprintf(fn, sizeof(fn), "bio/%d-%d.log", pid, biofp_toggle);
+ biofp = fopen (fn, "w");
+ ASSERT (biofp);
+ biofp_last_open = time (NULL);
+ biofp_toggle ^= 1;
+ }
+}
+
+static void
+bio_debug_data (const char *mode, BIO *bio, const uint8_t *buf, int len, const char *desc)
+{
+ struct gc_arena gc = gc_new ();
+ if (len > 0)
+ {
+ open_biofp();
+ fprintf(biofp, "BIO_%s %s time=" time_format " bio=" ptr_format " len=%d data=%s\n",
+ mode, desc, time (NULL), (ptr_type)bio, len, format_hex (buf, len, 0, &gc));
+ fflush (biofp);
+ }
+ gc_free (&gc);
+}
+
+static void
+bio_debug_oc (const char *mode, BIO *bio)
+{
+ open_biofp();
+ fprintf(biofp, "BIO %s time=" time_format " bio=" ptr_format "\n",
+ mode, time (NULL), (ptr_type)bio);
+ fflush (biofp);
+}
+
+#endif
+
+/*
+ * OpenVPN's interface to SSL/TLS authentication,
+ * encryption, and decryption is exclusively
+ * through "memory BIOs".
+ */
+static BIO *
+getbio (BIO_METHOD * type, const char *desc)
+{
+ BIO *ret;
+ ret = BIO_new (type);
+ if (!ret)
+ msg (M_SSLERR, "Error creating %s BIO", desc);
+ return ret;
+}
+
+/*
+ * Write to an OpenSSL BIO in non-blocking mode.
+ */
+static int
+bio_write (BIO *bio, const uint8_t *data, int size, const char *desc)
+{
+ int i;
+ int ret = 0;
+ ASSERT (size >= 0);
+ if (size)
+ {
+ /*
+ * Free the L_TLS lock prior to calling BIO routines
+ * so that foreground thread can still call
+ * tls_pre_decrypt or tls_pre_encrypt,
+ * allowing tunnel packet forwarding to continue.
+ */
+#ifdef BIO_DEBUG
+ bio_debug_data ("write", bio, data, size, desc);
+#endif
+ i = BIO_write (bio, data, size);
+
+ if (i < 0)
+ {
+ if (BIO_should_retry (bio))
+ {
+ ;
+ }
+ else
+ {
+ msg (D_TLS_ERRORS | M_SSL, "TLS ERROR: BIO write %s error",
+ desc);
+ ret = -1;
+ ERR_clear_error ();
+ }
+ }
+ else if (i != size)
+ {
+ msg (D_TLS_ERRORS | M_SSL,
+ "TLS ERROR: BIO write %s incomplete %d/%d", desc, i, size);
+ ret = -1;
+ ERR_clear_error ();
+ }
+ else
+ { /* successful write */
+ dmsg (D_HANDSHAKE_VERBOSE, "BIO write %s %d bytes", desc, i);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+
+/*
+ * Inline functions for reading from and writing
+ * to BIOs.
+ */
+
+static void
+bio_write_post (const int status, struct buffer *buf)
+{
+ if (status == 1) /* success status return from bio_write? */
+ {
+ memset (BPTR (buf), 0, BLEN (buf)); /* erase data just written */
+ buf->len = 0;
+ }
+}
+
+/*
+ * Read from an OpenSSL BIO in non-blocking mode.
+ */
+static int
+bio_read (BIO *bio, struct buffer *buf, int maxlen, const char *desc)
+{
+ int i;
+ int ret = 0;
+ ASSERT (buf->len >= 0);
+ if (buf->len)
+ {
+ ;
+ }
+ else
+ {
+ int len = buf_forward_capacity (buf);
+ if (maxlen < len)
+ len = maxlen;
+
+ /*
+ * BIO_read brackets most of the serious RSA
+ * key negotiation number crunching.
+ */
+ i = BIO_read (bio, BPTR (buf), len);
+
+ VALGRIND_MAKE_READABLE ((void *) &i, sizeof (i));
+
+#ifdef BIO_DEBUG
+ bio_debug_data ("read", bio, BPTR (buf), i, desc);
+#endif
+ if (i < 0)
+ {
+ if (BIO_should_retry (bio))
+ {
+ ;
+ }
+ else
+ {
+ msg (D_TLS_ERRORS | M_SSL, "TLS_ERROR: BIO read %s error",
+ desc);
+ buf->len = 0;
+ ret = -1;
+ ERR_clear_error ();
+ }
+ }
+ else if (!i)
+ {
+ buf->len = 0;
+ }
+ else
+ { /* successful read */
+ dmsg (D_HANDSHAKE_VERBOSE, "BIO read %s %d bytes", desc, i);
+ buf->len = i;
+ ret = 1;
+ VALGRIND_MAKE_READABLE ((void *) BPTR (buf), BLEN (buf));
+ }
+ }
+ return ret;
+}
+
+void
+key_state_ssl_init(struct key_state_ssl *ks_ssl, const struct tls_root_ctx *ssl_ctx, bool is_server, struct tls_session *session)
+{
+ ASSERT(NULL != ssl_ctx);
+ ASSERT(ks_ssl);
+ CLEAR (*ks_ssl);
+
+ ks_ssl->ssl = SSL_new (ssl_ctx->ctx);
+ if (!ks_ssl->ssl)
+ msg (M_SSLERR, "SSL_new failed");
+
+ /* put session * in ssl object so we can access it
+ from verify callback*/
+ SSL_set_ex_data (ks_ssl->ssl, mydata_index, session);
+
+ ks_ssl->ssl_bio = getbio (BIO_f_ssl (), "ssl_bio");
+ ks_ssl->ct_in = getbio (BIO_s_mem (), "ct_in");
+ ks_ssl->ct_out = getbio (BIO_s_mem (), "ct_out");
+
+#ifdef BIO_DEBUG
+ bio_debug_oc ("open ssl_bio", ks_ssl->ssl_bio);
+ bio_debug_oc ("open ct_in", ks_ssl->ct_in);
+ bio_debug_oc ("open ct_out", ks_ssl->ct_out);
+#endif
+
+ if (is_server)
+ SSL_set_accept_state (ks_ssl->ssl);
+ else
+ SSL_set_connect_state (ks_ssl->ssl);
+
+ SSL_set_bio (ks_ssl->ssl, ks_ssl->ct_in, ks_ssl->ct_out);
+ BIO_set_ssl (ks_ssl->ssl_bio, ks_ssl->ssl, BIO_NOCLOSE);
+}
+
+void key_state_ssl_free(struct key_state_ssl *ks_ssl)
+{
+ if (ks_ssl->ssl) {
+#ifdef BIO_DEBUG
+ bio_debug_oc ("close ssl_bio", ks_ssl->ssl_bio);
+ bio_debug_oc ("close ct_in", ks_ssl->ct_in);
+ bio_debug_oc ("close ct_out", ks_ssl->ct_out);
+#endif
+ BIO_free_all(ks_ssl->ssl_bio);
+ SSL_free (ks_ssl->ssl);
+ }
+}
+
+int
+key_state_write_plaintext (struct key_state_ssl *ks_ssl, struct buffer *buf)
+{
+ int ret = 0;
+ perf_push (PERF_BIO_WRITE_PLAINTEXT);
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+ ASSERT (NULL != ks_ssl);
+
+ ret = bio_write (ks_ssl->ssl_bio, BPTR(buf), BLEN(buf),
+ "tls_write_plaintext");
+ bio_write_post (ret, buf);
+#endif /* ENABLE_CRYPTO_OPENSSL */
+
+ perf_pop ();
+ return ret;
+}
+
+int
+key_state_write_plaintext_const (struct key_state_ssl *ks_ssl, const uint8_t *data, int len)
+{
+ int ret = 0;
+ perf_push (PERF_BIO_WRITE_PLAINTEXT);
+
+ ASSERT (NULL != ks_ssl);
+
+ ret = bio_write (ks_ssl->ssl_bio, data, len, "tls_write_plaintext_const");
+
+ perf_pop ();
+ return ret;
+}
+
+int
+key_state_read_ciphertext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen)
+{
+ int ret = 0;
+ perf_push (PERF_BIO_READ_CIPHERTEXT);
+
+ ASSERT (NULL != ks_ssl);
+
+ ret = bio_read (ks_ssl->ct_out, buf, maxlen, "tls_read_ciphertext");
+
+ perf_pop ();
+ return ret;
+}
+
+int
+key_state_write_ciphertext (struct key_state_ssl *ks_ssl, struct buffer *buf)
+{
+ int ret = 0;
+ perf_push (PERF_BIO_WRITE_CIPHERTEXT);
+
+ ASSERT (NULL != ks_ssl);
+
+ ret = bio_write (ks_ssl->ct_in, BPTR(buf), BLEN(buf), "tls_write_ciphertext");
+ bio_write_post (ret, buf);
+
+ perf_pop ();
+ return ret;
+}
+
+int
+key_state_read_plaintext (struct key_state_ssl *ks_ssl, struct buffer *buf,
+ int maxlen)
+{
+ int ret = 0;
+ perf_push (PERF_BIO_READ_PLAINTEXT);
+
+ ASSERT (NULL != ks_ssl);
+
+ ret = bio_read (ks_ssl->ssl_bio, buf, maxlen, "tls_read_plaintext");
+
+ perf_pop ();
+ return ret;
+}
+
+/* **************************************
+ *
+ * Information functions
+ *
+ * Print information for the end user.
+ *
+ ***************************************/
+void
+print_details (struct key_state_ssl * ks_ssl, const char *prefix)
+{
+ const SSL_CIPHER *ciph;
+ X509 *cert;
+ char s1[256];
+ char s2[256];
+
+ s1[0] = s2[0] = 0;
+ ciph = SSL_get_current_cipher (ks_ssl->ssl);
+ openvpn_snprintf (s1, sizeof (s1), "%s %s, cipher %s %s",
+ prefix,
+ SSL_get_version (ks_ssl->ssl),
+ SSL_CIPHER_get_version (ciph),
+ SSL_CIPHER_get_name (ciph));
+ cert = SSL_get_peer_certificate (ks_ssl->ssl);
+ if (cert != NULL)
+ {
+ EVP_PKEY *pkey = X509_get_pubkey (cert);
+ if (pkey != NULL)
+ {
+ if (pkey->type == EVP_PKEY_RSA && pkey->pkey.rsa != NULL
+ && pkey->pkey.rsa->n != NULL)
+ {
+ openvpn_snprintf (s2, sizeof (s2), ", %d bit RSA",
+ BN_num_bits (pkey->pkey.rsa->n));
+ }
+ else if (pkey->type == EVP_PKEY_DSA && pkey->pkey.dsa != NULL
+ && pkey->pkey.dsa->p != NULL)
+ {
+ openvpn_snprintf (s2, sizeof (s2), ", %d bit DSA",
+ BN_num_bits (pkey->pkey.dsa->p));
+ }
+ EVP_PKEY_free (pkey);
+ }
+ X509_free (cert);
+ }
+ /* The SSL API does not allow us to look at temporary RSA/DH keys,
+ * otherwise we should print their lengths too */
+ msg (D_HANDSHAKE, "%s%s", s1, s2);
+}
+
+void
+show_available_tls_ciphers (const char *cipher_list)
+{
+ struct tls_root_ctx tls_ctx;
+ SSL *ssl;
+ const char *cipher_name;
+ const tls_cipher_name_pair *pair;
+ int priority = 0;
+
+ tls_ctx.ctx = SSL_CTX_new (SSLv23_method ());
+ if (!tls_ctx.ctx)
+ msg (M_SSLERR, "Cannot create SSL_CTX object");
+
+ ssl = SSL_new (tls_ctx.ctx);
+ if (!ssl)
+ msg (M_SSLERR, "Cannot create SSL object");
+
+ tls_ctx_restrict_ciphers(&tls_ctx, cipher_list);
+
+ printf ("Available TLS Ciphers,\n");
+ printf ("listed in order of preference:\n\n");
+ while ((cipher_name = SSL_get_cipher_list (ssl, priority++)))
+ {
+ pair = tls_get_cipher_name_pair(cipher_name, strlen(cipher_name));
+
+ if (NULL == pair) {
+ // No translation found, print warning
+ printf ("%s (No IANA name known to OpenVPN, use OpenSSL name.)\n", cipher_name);
+ } else {
+ printf ("%s\n", pair->iana_name);
+ }
+
+ }
+ printf ("\n");
+
+ SSL_free (ssl);
+ SSL_CTX_free (tls_ctx.ctx);
+}
+
+/*
+ * Show the Elliptic curves that are available for us to use
+ * in the OpenSSL library.
+ */
+void
+show_available_curves()
+{
+#ifndef OPENSSL_NO_EC
+ EC_builtin_curve *curves = NULL;
+ size_t crv_len = 0;
+ size_t n = 0;
+
+ crv_len = EC_get_builtin_curves(NULL, 0);
+
+ curves = OPENSSL_malloc((int)(sizeof(EC_builtin_curve) * crv_len));
+
+ if (curves == NULL)
+ msg (M_SSLERR, "Cannot create EC_builtin_curve object");
+ else
+ {
+ if (EC_get_builtin_curves(curves, crv_len))
+ {
+ printf ("Available Elliptic curves:\n");
+ for (n = 0; n < crv_len; n++)
+ {
+ const char *sname;
+ sname = OBJ_nid2sn(curves[n].nid);
+ if (sname == NULL) sname = "";
+
+ printf("%s\n", sname);
+ }
+ }
+ else
+ {
+ msg (M_SSLERR, "Cannot get list of builtin curves");
+ }
+ OPENSSL_free(curves);
+ }
+#else
+ msg (M_WARN, "Your OpenSSL library was built without elliptic curve support. "
+ "No curves available.");
+#endif
+}
+
+void
+get_highest_preference_tls_cipher (char *buf, int size)
+{
+ SSL_CTX *ctx;
+ SSL *ssl;
+ const char *cipher_name;
+
+ ctx = SSL_CTX_new (SSLv23_method ());
+ if (!ctx)
+ msg (M_SSLERR, "Cannot create SSL_CTX object");
+ ssl = SSL_new (ctx);
+ if (!ssl)
+ msg (M_SSLERR, "Cannot create SSL object");
+
+ cipher_name = SSL_get_cipher_list (ssl, 0);
+ strncpynt (buf, cipher_name, size);
+
+ SSL_free (ssl);
+ SSL_CTX_free (ctx);
+}
+
+const char *
+get_ssl_library_version(void)
+{
+ return SSLeay_version(SSLEAY_VERSION);
+}
+
+#endif /* defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.h
new file mode 100644
index 00000000..97dc7422
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_openssl.h
@@ -0,0 +1,69 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel OpenSSL Backend
+ */
+
+#ifndef SSL_OPENSSL_H_
+#define SSL_OPENSSL_H_
+
+#include <openssl/ssl.h>
+
+/**
+ * SSL_OP_NO_TICKET tells OpenSSL to disable "stateless session resumption",
+ * as this is something we do not want nor need, but could potentially be
+ * used for a future attack. For compatibility reasons we keep building if the
+ * OpenSSL version is too old (pre-0.9.8f) to support stateless session
+ * resumption (and the accompanying SSL_OP_NO_TICKET flag).
+ */
+#ifndef SSL_OP_NO_TICKET
+# define SSL_OP_NO_TICKET 0
+#endif
+
+/**
+ * Structure that wraps the TLS context. Contents differ depending on the
+ * SSL library used.
+ */
+struct tls_root_ctx {
+ SSL_CTX *ctx;
+};
+
+struct key_state_ssl {
+ SSL *ssl; /* SSL object -- new obj created for each new key */
+ BIO *ssl_bio; /* read/write plaintext from here */
+ BIO *ct_in; /* write ciphertext to here */
+ BIO *ct_out; /* read ciphertext from here */
+};
+
+/**
+ * Allocate space in SSL objects in which to store a struct tls_session
+ * pointer back to parent.
+ */
+extern int mydata_index; /* GLOBAL */
+
+void openssl_set_mydata_index (void);
+
+#endif /* SSL_OPENSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.c
new file mode 100644
index 00000000..ddccf1d9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.c
@@ -0,0 +1,1134 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.com>
+ * Copyright (C) 2006-2010, Brainspark B.V.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel PolarSSL Backend
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_POLARSSL)
+
+#include "errlevel.h"
+#include "ssl_backend.h"
+#include "buffer.h"
+#include "misc.h"
+#include "manage.h"
+#include "ssl_common.h"
+
+#include <polarssl/havege.h>
+
+#include "ssl_verify_polarssl.h"
+#include <polarssl/error.h>
+#include <polarssl/pem.h>
+#include <polarssl/sha256.h>
+
+void
+tls_init_lib()
+{
+}
+
+void
+tls_free_lib()
+{
+}
+
+void
+tls_clear_error()
+{
+}
+
+void
+tls_ctx_server_new(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+ CLEAR(*ctx);
+
+ ALLOC_OBJ_CLEAR(ctx->dhm_ctx, dhm_context);
+ ALLOC_OBJ_CLEAR(ctx->priv_key, pk_context);
+
+ ALLOC_OBJ_CLEAR(ctx->ca_chain, x509_crt);
+ ALLOC_OBJ_CLEAR(ctx->crt_chain, x509_crt);
+
+
+ ctx->endpoint = SSL_IS_SERVER;
+ ctx->initialised = true;
+}
+
+void
+tls_ctx_client_new(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+ CLEAR(*ctx);
+
+ ALLOC_OBJ_CLEAR(ctx->dhm_ctx, dhm_context);
+ ALLOC_OBJ_CLEAR(ctx->priv_key, pk_context);
+
+ ALLOC_OBJ_CLEAR(ctx->ca_chain, x509_crt);
+ ALLOC_OBJ_CLEAR(ctx->crt_chain, x509_crt);
+
+ ctx->endpoint = SSL_IS_CLIENT;
+ ctx->initialised = true;
+}
+
+void
+tls_ctx_free(struct tls_root_ctx *ctx)
+{
+ if (ctx)
+ {
+ pk_free(ctx->priv_key);
+ free(ctx->priv_key);
+
+ x509_crt_free(ctx->ca_chain);
+ free(ctx->ca_chain);
+
+ x509_crt_free(ctx->crt_chain);
+ free(ctx->crt_chain);
+
+ dhm_free(ctx->dhm_ctx);
+ free(ctx->dhm_ctx);
+
+#if defined(ENABLE_PKCS11)
+ if (ctx->priv_key_pkcs11 != NULL) {
+ pkcs11_priv_key_free(ctx->priv_key_pkcs11);
+ free(ctx->priv_key_pkcs11);
+ }
+#endif
+#if defined(MANAGMENT_EXTERNAL_KEY)
+ if (ctx->external_key != NULL)
+ free(ctx->external_key);
+#endif
+
+ if (ctx->allowed_ciphers)
+ free(ctx->allowed_ciphers);
+
+ CLEAR(*ctx);
+
+ ctx->initialised = false;
+
+ }
+}
+
+bool
+tls_ctx_initialised(struct tls_root_ctx *ctx)
+{
+ ASSERT(NULL != ctx);
+ return ctx->initialised;
+}
+
+void
+tls_ctx_set_options (struct tls_root_ctx *ctx, unsigned int ssl_flags)
+{
+}
+
+static const char *
+tls_translate_cipher_name (const char * cipher_name) {
+ const tls_cipher_name_pair * pair = tls_get_cipher_name_pair(cipher_name, strlen(cipher_name));
+
+ if (NULL == pair)
+ {
+ // No translation found, return original
+ return cipher_name;
+ }
+
+ if (0 != strcmp(cipher_name, pair->iana_name))
+ {
+ // Deprecated name found, notify user
+ msg(M_WARN, "Deprecated cipher suite name '%s', please use IANA name '%s'", pair->openssl_name, pair->iana_name);
+ }
+
+ return pair->iana_name;
+}
+
+void
+tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
+{
+ char *tmp_ciphers, *tmp_ciphers_orig, *token;
+ int i, cipher_count;
+ int ciphers_len;
+
+ if (NULL == ciphers)
+ return; /* Nothing to do */
+
+ ciphers_len = strlen (ciphers);
+
+ ASSERT (NULL != ctx);
+ ASSERT (0 != ciphers_len);
+
+ /* Get number of ciphers */
+ for (i = 0, cipher_count = 1; i < ciphers_len; i++)
+ if (ciphers[i] == ':')
+ cipher_count++;
+
+ /* Allocate an array for them */
+ ALLOC_ARRAY_CLEAR(ctx->allowed_ciphers, int, cipher_count+1)
+
+ /* Parse allowed ciphers, getting IDs */
+ i = 0;
+ tmp_ciphers_orig = tmp_ciphers = strdup(ciphers);
+
+ token = strtok (tmp_ciphers, ":");
+ while(token)
+ {
+ ctx->allowed_ciphers[i] = ssl_get_ciphersuite_id (
+ tls_translate_cipher_name (token));
+ if (0 != ctx->allowed_ciphers[i])
+ i++;
+ token = strtok (NULL, ":");
+ }
+ free(tmp_ciphers_orig);
+}
+
+void
+tls_ctx_load_dh_params (struct tls_root_ctx *ctx, const char *dh_file,
+ const char *dh_file_inline
+ )
+{
+ if (!strcmp (dh_file, INLINE_FILE_TAG) && dh_file_inline)
+ {
+ if (0 != dhm_parse_dhm(ctx->dhm_ctx, dh_file_inline, strlen(dh_file_inline)))
+ msg (M_FATAL, "Cannot read inline DH parameters");
+ }
+else
+ {
+ if (0 != dhm_parse_dhmfile(ctx->dhm_ctx, dh_file))
+ msg (M_FATAL, "Cannot read DH parameters from file %s", dh_file);
+ }
+
+ msg (D_TLS_DEBUG_LOW, "Diffie-Hellman initialized with " counter_format " bit key",
+ (counter_type) 8 * mpi_size(&ctx->dhm_ctx->P));
+}
+
+void
+tls_ctx_load_ecdh_params (struct tls_root_ctx *ctx, const char *curve_name
+ )
+{
+ if (NULL != curve_name)
+ msg(M_WARN, "WARNING: PolarSSL builds do not support specifying an ECDH "
+ "curve, using default curves.");
+}
+
+int
+tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file,
+ const char *pkcs12_file_inline,
+ bool load_ca_file
+ )
+{
+ msg(M_FATAL, "PKCS #12 files not yet supported for PolarSSL.");
+ return 0;
+}
+
+#ifdef ENABLE_CRYPTOAPI
+void
+tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
+{
+ msg(M_FATAL, "Windows CryptoAPI not yet supported for PolarSSL.");
+}
+#endif /* WIN32 */
+
+void
+tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
+ const char *cert_file_inline
+ )
+{
+ ASSERT(NULL != ctx);
+
+ if (!strcmp (cert_file, INLINE_FILE_TAG) && cert_file_inline)
+ {
+ if (0 != x509_crt_parse(ctx->crt_chain, cert_file_inline,
+ strlen(cert_file_inline)))
+ msg (M_FATAL, "Cannot load inline certificate file");
+ }
+ else
+ {
+ int retval = x509_crt_parse_file(ctx->crt_chain, cert_file);
+ if (0 != retval)
+ {
+ char errstr[128];
+ polarssl_strerror(retval, errstr, sizeof(errstr));
+ msg (M_FATAL, "Cannot load certificate file %s (%s)", cert_file, errstr);
+ }
+ }
+}
+
+int
+tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file,
+ const char *priv_key_file_inline
+ )
+{
+ int status;
+ ASSERT(NULL != ctx);
+
+ if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_file_inline)
+ {
+ status = pk_parse_key(ctx->priv_key,
+ priv_key_file_inline, strlen(priv_key_file_inline),
+ NULL, 0);
+
+ if (POLARSSL_ERR_PEM_PASSWORD_REQUIRED == status)
+ {
+ char passbuf[512] = {0};
+ pem_password_callback(passbuf, 512, 0, NULL);
+ status = pk_parse_key(ctx->priv_key,
+ priv_key_file_inline, strlen(priv_key_file_inline),
+ (unsigned char *) passbuf, strlen(passbuf));
+ }
+ }
+ else
+ {
+ status = pk_parse_keyfile(ctx->priv_key, priv_key_file, NULL);
+ if (POLARSSL_ERR_PEM_PASSWORD_REQUIRED == status)
+ {
+ char passbuf[512] = {0};
+ pem_password_callback(passbuf, 512, 0, NULL);
+ status = pk_parse_keyfile(ctx->priv_key, priv_key_file, passbuf);
+ }
+ }
+ if (0 != status)
+ {
+#ifdef ENABLE_MANAGEMENT
+ if (management && (POLARSSL_ERR_PEM_PASSWORD_MISMATCH == status))
+ management_auth_failure (management, UP_TYPE_PRIVATE_KEY, NULL);
+#endif
+ msg (M_WARN, "Cannot load private key file %s", priv_key_file);
+ return 1;
+ }
+
+ warn_if_group_others_accessible (priv_key_file);
+
+ /* TODO: Check Private Key */
+#if 0
+ if (!SSL_CTX_check_private_key (ctx))
+ msg (M_SSLERR, "Private key does not match the certificate");
+#endif
+ return 0;
+}
+
+#ifdef MANAGMENT_EXTERNAL_KEY
+
+
+struct external_context {
+ size_t signature_length;
+};
+
+int
+tls_ctx_use_external_private_key (struct tls_root_ctx *ctx,
+ const char *cert_file, const char *cert_file_inline)
+{
+ ASSERT(NULL != ctx);
+
+ tls_ctx_load_cert_file(ctx, cert_file, cert_file_inline);
+
+ if (ctx->crt_chain == NULL)
+ return 0;
+
+ /* Most of the initialization happens in key_state_ssl_init() */
+ ALLOC_OBJ_CLEAR (ctx->external_key, struct external_context);
+ ctx->external_key->signature_length = pk_get_len(&ctx->crt_chain->pk);
+
+ return 1;
+}
+
+/**
+ * external_pkcs1_sign implements a PolarSSL rsa_sign_func callback, that uses
+ * the management interface to request an RSA signature for the supplied hash.
+ *
+ * @param ctx_voidptr Management external key context.
+ * @param f_rng (Unused)
+ * @param p_rng (Unused)
+ * @param mode RSA mode (should be RSA_PRIVATE).
+ * @param md_alg Message digest ('hash') algorithm type.
+ * @param hashlen Length of hash (overridden by length specified by md_alg
+ * if md_alg != POLARSSL_MD_NONE).
+ * @param hash The digest ('hash') to sign. Should have a size
+ * matching the length of md_alg (if != POLARSSL_MD_NONE),
+ * or hashlen otherwise.
+ * @param sig Buffer that returns the signature. Should be at least of
+ * size ctx->signature_length.
+ *
+ * @return 0 on success, non-zero polarssl error code on failure.
+ */
+static inline int external_pkcs1_sign( void *ctx_voidptr,
+ int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode,
+ md_type_t md_alg, unsigned int hashlen, const unsigned char *hash,
+ unsigned char *sig )
+{
+ struct external_context * const ctx = ctx_voidptr;
+ char *in_b64 = NULL;
+ char *out_b64 = NULL;
+ int rv;
+ unsigned char *p = sig;
+ size_t asn_len = 0, oid_size = 0, sig_len = 0;
+ const char *oid = NULL;
+
+ if( NULL == ctx )
+ return POLARSSL_ERR_RSA_BAD_INPUT_DATA;
+
+ if( RSA_PRIVATE != mode )
+ return POLARSSL_ERR_RSA_BAD_INPUT_DATA;
+
+ /*
+ * Support a wide range of hashes. TLSv1.1 and before only need SIG_RSA_RAW,
+ * but TLSv1.2 needs the full suite of hashes.
+ *
+ * This code has been taken from PolarSSL pkcs11_sign(), under the GPLv2.0+.
+ */
+ if( md_alg != POLARSSL_MD_NONE )
+ {
+ const md_info_t *md_info = md_info_from_type( md_alg );
+ if( md_info == NULL )
+ return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
+
+ if( oid_get_oid_by_md( md_alg, &oid, &oid_size ) != 0 )
+ return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
+
+ hashlen = md_get_size( md_info );
+ asn_len = 10 + oid_size;
+ }
+
+ sig_len = ctx->signature_length;
+ if ( (SIZE_MAX - hashlen) < asn_len || (hashlen + asn_len) > sig_len )
+ return POLARSSL_ERR_RSA_BAD_INPUT_DATA;
+
+ if( md_alg != POLARSSL_MD_NONE )
+ {
+ /*
+ * DigestInfo ::= SEQUENCE {
+ * digestAlgorithm DigestAlgorithmIdentifier,
+ * digest Digest }
+ *
+ * DigestAlgorithmIdentifier ::= AlgorithmIdentifier
+ *
+ * Digest ::= OCTET STRING
+ */
+ *p++ = ASN1_SEQUENCE | ASN1_CONSTRUCTED;
+ *p++ = (unsigned char) ( 0x08 + oid_size + hashlen );
+ *p++ = ASN1_SEQUENCE | ASN1_CONSTRUCTED;
+ *p++ = (unsigned char) ( 0x04 + oid_size );
+ *p++ = ASN1_OID;
+ *p++ = oid_size & 0xFF;
+ memcpy( p, oid, oid_size );
+ p += oid_size;
+ *p++ = ASN1_NULL;
+ *p++ = 0x00;
+ *p++ = ASN1_OCTET_STRING;
+ *p++ = hashlen;
+
+ /* Determine added ASN length */
+ asn_len = p - sig;
+ }
+
+ /* Copy the hash to be signed */
+ memcpy( p, hash, hashlen );
+
+ /* convert 'from' to base64 */
+ if (openvpn_base64_encode (sig, asn_len + hashlen, &in_b64) <= 0)
+ {
+ rv = POLARSSL_ERR_RSA_BAD_INPUT_DATA;
+ goto done;
+ }
+
+ /* call MI for signature */
+ if (management)
+ out_b64 = management_query_rsa_sig (management, in_b64);
+ if (!out_b64)
+ {
+ rv = POLARSSL_ERR_RSA_PRIVATE_FAILED;
+ goto done;
+ }
+
+ /* decode base64 signature to binary and verify length */
+ if ( openvpn_base64_decode (out_b64, sig, ctx->signature_length) !=
+ ctx->signature_length )
+ {
+ rv = POLARSSL_ERR_RSA_PRIVATE_FAILED;
+ goto done;
+ }
+
+ rv = 0;
+
+done:
+ if (in_b64)
+ free (in_b64);
+ if (out_b64)
+ free (out_b64);
+ return rv;
+}
+
+static inline size_t external_key_len(void *vctx)
+{
+ struct external_context * const ctx = vctx;
+
+ return ctx->signature_length;
+}
+#endif
+
+void tls_ctx_load_ca (struct tls_root_ctx *ctx, const char *ca_file,
+ const char *ca_file_inline,
+ const char *ca_path, bool tls_server
+ )
+{
+ if (ca_path)
+ msg(M_FATAL, "ERROR: PolarSSL cannot handle the capath directive");
+
+ if (ca_file && !strcmp (ca_file, INLINE_FILE_TAG) && ca_file_inline)
+ {
+ if (0 != x509_crt_parse(ctx->ca_chain, (unsigned char *) ca_file_inline,
+ strlen(ca_file_inline)))
+ msg (M_FATAL, "Cannot load inline CA certificates");
+ }
+ else
+ {
+ /* Load CA file for verifying peer supplied certificate */
+ int retval = x509_crt_parse_file(ctx->ca_chain, ca_file);
+ if (0 != retval)
+ {
+ char errstr[128];
+ polarssl_strerror(retval, errstr, sizeof(errstr));
+ msg (M_FATAL, "Cannot load CA certificate file %s (%s)", ca_file, errstr);
+ }
+ }
+}
+
+void
+tls_ctx_load_extra_certs (struct tls_root_ctx *ctx, const char *extra_certs_file,
+ const char *extra_certs_file_inline
+ )
+{
+ ASSERT(NULL != ctx);
+
+ if (!strcmp (extra_certs_file, INLINE_FILE_TAG) && extra_certs_file_inline)
+ {
+ if (0 != x509_crt_parse(ctx->crt_chain,
+ (unsigned char *) extra_certs_file_inline,
+ strlen(extra_certs_file_inline)))
+ msg (M_FATAL, "Cannot load inline extra-certs file");
+ }
+ else
+ {
+ if (0 != x509_crt_parse_file(ctx->crt_chain, extra_certs_file))
+ msg (M_FATAL, "Cannot load extra-certs file: %s", extra_certs_file);
+ }
+}
+
+/* **************************************
+ *
+ * Key-state specific functions
+ *
+ ***************************************/
+
+/*
+ * "Endless buffer"
+ */
+
+static inline void buf_free_entry(buffer_entry *entry)
+{
+ if (NULL != entry)
+ {
+ free(entry->data);
+ free(entry);
+ }
+}
+
+static void buf_free_entries(endless_buffer *buf)
+{
+ while(buf->first_block)
+ {
+ buffer_entry *cur_block = buf->first_block;
+ buf->first_block = cur_block->next_block;
+ buf_free_entry(cur_block);
+ }
+ buf->last_block = NULL;
+}
+
+static int endless_buf_read( void * ctx, unsigned char * out, size_t out_len )
+{
+ endless_buffer *in = (endless_buffer *) ctx;
+ size_t read_len = 0;
+
+ if (in->first_block == NULL)
+ return POLARSSL_ERR_NET_WANT_READ;
+
+ while (in->first_block != NULL && read_len < out_len)
+ {
+ int block_len = in->first_block->length - in->data_start;
+ if (block_len <= out_len - read_len)
+ {
+ buffer_entry *cur_entry = in->first_block;
+ memcpy(out + read_len, cur_entry->data + in->data_start,
+ block_len);
+
+ read_len += block_len;
+
+ in->first_block = cur_entry->next_block;
+ in->data_start = 0;
+
+ if (in->first_block == NULL)
+ in->last_block = NULL;
+
+ buf_free_entry(cur_entry);
+ }
+ else
+ {
+ memcpy(out + read_len, in->first_block->data + in->data_start,
+ out_len - read_len);
+ in->data_start += out_len - read_len;
+ read_len = out_len;
+ }
+ }
+
+ return read_len;
+}
+
+static int endless_buf_write( void *ctx, const unsigned char *in, size_t len )
+{
+ endless_buffer *out = (endless_buffer *) ctx;
+ buffer_entry *new_block = malloc(sizeof(buffer_entry));
+ if (NULL == new_block)
+ return POLARSSL_ERR_NET_SEND_FAILED;
+
+ new_block->data = malloc(len);
+ if (NULL == new_block->data)
+ {
+ free(new_block);
+ return POLARSSL_ERR_NET_SEND_FAILED;
+ }
+
+ new_block->length = len;
+ new_block->next_block = NULL;
+
+ memcpy(new_block->data, in, len);
+
+ if (NULL == out->first_block)
+ out->first_block = new_block;
+
+ if (NULL != out->last_block)
+ out->last_block->next_block = new_block;
+
+ out->last_block = new_block;
+
+ return len;
+}
+
+static void my_debug( void *ctx, int level, const char *str )
+{
+ if (level == 1)
+ {
+ dmsg (D_HANDSHAKE_VERBOSE, "PolarSSL alert: %s", str);
+ }
+}
+
+/*
+ * Further personalise the RNG using a hash of the public key
+ */
+void tls_ctx_personalise_random(struct tls_root_ctx *ctx)
+{
+ static char old_sha256_hash[32] = {0};
+ unsigned char sha256_hash[32] = {0};
+ ctr_drbg_context *cd_ctx = rand_ctx_get();
+
+ if (NULL != ctx->crt_chain)
+ {
+ x509_crt *cert = ctx->crt_chain;
+
+ sha256(cert->tbs.p, cert->tbs.len, sha256_hash, false);
+ if ( 0 != memcmp(old_sha256_hash, sha256_hash, sizeof(sha256_hash)))
+ {
+ ctr_drbg_update(cd_ctx, sha256_hash, 32);
+ memcpy(old_sha256_hash, sha256_hash, sizeof(old_sha256_hash));
+ }
+ }
+}
+
+int
+tls_version_max(void)
+{
+#if defined(SSL_MAJOR_VERSION_3) && defined(SSL_MINOR_VERSION_3)
+ return TLS_VER_1_2;
+#elif defined(SSL_MAJOR_VERSION_3) && defined(SSL_MINOR_VERSION_2)
+ return TLS_VER_1_1;
+#else
+ return TLS_VER_1_0;
+#endif
+}
+
+void key_state_ssl_init(struct key_state_ssl *ks_ssl,
+ const struct tls_root_ctx *ssl_ctx, bool is_server, struct tls_session *session)
+{
+ ASSERT(NULL != ssl_ctx);
+ ASSERT(ks_ssl);
+ CLEAR(*ks_ssl);
+
+ ALLOC_OBJ_CLEAR(ks_ssl->ctx, ssl_context);
+ if (0 == ssl_init(ks_ssl->ctx))
+ {
+ /* Initialise SSL context */
+ ssl_set_dbg (ks_ssl->ctx, my_debug, NULL);
+ ssl_set_endpoint (ks_ssl->ctx, ssl_ctx->endpoint);
+
+ ssl_set_rng (ks_ssl->ctx, ctr_drbg_random, rand_ctx_get());
+
+ if (ssl_ctx->allowed_ciphers)
+ ssl_set_ciphersuites (ks_ssl->ctx, ssl_ctx->allowed_ciphers);
+
+ /* Initialise authentication information */
+ if (is_server)
+ ssl_set_dh_param_ctx (ks_ssl->ctx, ssl_ctx->dhm_ctx );
+#if defined(ENABLE_PKCS11)
+ if (ssl_ctx->priv_key_pkcs11 != NULL)
+ ssl_set_own_cert_alt( ks_ssl->ctx, ssl_ctx->crt_chain,
+ ssl_ctx->priv_key_pkcs11, ssl_pkcs11_decrypt, ssl_pkcs11_sign,
+ ssl_pkcs11_key_len );
+ else
+#endif
+#if defined(MANAGMENT_EXTERNAL_KEY)
+ if (ssl_ctx->external_key != NULL)
+ ssl_set_own_cert_alt( ks_ssl->ctx, ssl_ctx->crt_chain,
+ ssl_ctx->external_key, NULL, external_pkcs1_sign,
+ external_key_len );
+ else
+#endif
+ ssl_set_own_cert( ks_ssl->ctx, ssl_ctx->crt_chain, ssl_ctx->priv_key );
+
+ /* Initialise SSL verification */
+#if P2MP_SERVER
+ if (session->opt->ssl_flags & SSLF_CLIENT_CERT_NOT_REQUIRED)
+ {
+ msg (M_WARN, "WARNING: POTENTIALLY DANGEROUS OPTION "
+ "--client-cert-not-required may accept clients which do not present "
+ "a certificate");
+ }
+ else
+#endif
+ {
+ ssl_set_authmode (ks_ssl->ctx, SSL_VERIFY_REQUIRED);
+ ssl_set_verify (ks_ssl->ctx, verify_callback, session);
+ }
+
+ /* TODO: PolarSSL does not currently support sending the CA chain to the client */
+ ssl_set_ca_chain (ks_ssl->ctx, ssl_ctx->ca_chain, NULL, NULL );
+
+ /* Initialize minimum TLS version */
+ {
+ const int tls_version_min = (session->opt->ssl_flags >> SSLF_TLS_VERSION_SHIFT) & SSLF_TLS_VERSION_MASK;
+ int polar_major;
+ int polar_minor;
+ switch (tls_version_min)
+ {
+ case TLS_VER_1_0:
+ default:
+ polar_major = SSL_MAJOR_VERSION_3;
+ polar_minor = SSL_MINOR_VERSION_1;
+ break;
+#if defined(SSL_MAJOR_VERSION_3) && defined(SSL_MINOR_VERSION_2)
+ case TLS_VER_1_1:
+ polar_major = SSL_MAJOR_VERSION_3;
+ polar_minor = SSL_MINOR_VERSION_2;
+ break;
+#endif
+#if defined(SSL_MAJOR_VERSION_3) && defined(SSL_MINOR_VERSION_3)
+ case TLS_VER_1_2:
+ polar_major = SSL_MAJOR_VERSION_3;
+ polar_minor = SSL_MINOR_VERSION_3;
+ break;
+#endif
+ }
+ ssl_set_min_version(ks_ssl->ctx, polar_major, polar_minor);
+ }
+
+ /* Initialise BIOs */
+ ALLOC_OBJ_CLEAR (ks_ssl->ct_in, endless_buffer);
+ ALLOC_OBJ_CLEAR (ks_ssl->ct_out, endless_buffer);
+ ssl_set_bio (ks_ssl->ctx, endless_buf_read, ks_ssl->ct_in,
+ endless_buf_write, ks_ssl->ct_out);
+ }
+}
+
+void
+key_state_ssl_free(struct key_state_ssl *ks_ssl)
+{
+ if (ks_ssl) {
+ if (ks_ssl->ctx)
+ {
+ ssl_free(ks_ssl->ctx);
+ free(ks_ssl->ctx);
+ }
+ if (ks_ssl->ct_in) {
+ buf_free_entries(ks_ssl->ct_in);
+ free(ks_ssl->ct_in);
+ }
+ if (ks_ssl->ct_out) {
+ buf_free_entries(ks_ssl->ct_out);
+ free(ks_ssl->ct_out);
+ }
+ CLEAR(*ks_ssl);
+ }
+}
+
+int
+key_state_write_plaintext (struct key_state_ssl *ks, struct buffer *buf)
+{
+ int retval = 0;
+ perf_push (PERF_BIO_WRITE_PLAINTEXT);
+
+ ASSERT (NULL != ks);
+ ASSERT (buf);
+ ASSERT (buf->len >= 0);
+
+ if (0 == buf->len)
+ {
+ return 0;
+ perf_pop ();
+ }
+
+ retval = ssl_write(ks->ctx, BPTR(buf), buf->len);
+
+ if (retval < 0)
+ {
+ perf_pop ();
+ if (POLARSSL_ERR_NET_WANT_WRITE == retval || POLARSSL_ERR_NET_WANT_READ == retval)
+ return 0;
+ msg (D_TLS_ERRORS, "TLS ERROR: write tls_write_plaintext error");
+ return -1;
+ }
+
+ if (retval != buf->len)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: write tls_write_plaintext incomplete %d/%d",
+ retval, buf->len);
+ perf_pop ();
+ return -1;
+ }
+
+ /* successful write */
+ dmsg (D_HANDSHAKE_VERBOSE, "write tls_write_plaintext %d bytes", retval);
+
+ memset (BPTR (buf), 0, BLEN (buf)); /* erase data just written */
+ buf->len = 0;
+
+ perf_pop ();
+ return 1;
+}
+
+int
+key_state_write_plaintext_const (struct key_state_ssl *ks, const uint8_t *data, int len)
+{
+ int retval = 0;
+ perf_push (PERF_BIO_WRITE_PLAINTEXT);
+
+ ASSERT (NULL != ks);
+ ASSERT (len >= 0);
+
+ if (0 == len)
+ {
+ perf_pop ();
+ return 0;
+ }
+
+ ASSERT (data);
+
+ retval = ssl_write(ks->ctx, data, len);
+
+ if (retval < 0)
+ {
+ perf_pop ();
+ if (POLARSSL_ERR_NET_WANT_WRITE == retval || POLARSSL_ERR_NET_WANT_READ == retval)
+ return 0;
+ msg (D_TLS_ERRORS, "TLS ERROR: write tls_write_plaintext_const error");
+ return -1;
+ }
+
+ if (retval != len)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: write tls_write_plaintext_const incomplete %d/%d",
+ retval, len);
+ perf_pop ();
+ return -1;
+ }
+
+ /* successful write */
+ dmsg (D_HANDSHAKE_VERBOSE, "write tls_write_plaintext_const %d bytes", retval);
+
+ perf_pop ();
+ return 1;
+}
+
+int
+key_state_read_ciphertext (struct key_state_ssl *ks, struct buffer *buf,
+ int maxlen)
+{
+ int retval = 0;
+ int len = 0;
+ char error_message[1024];
+
+ perf_push (PERF_BIO_READ_CIPHERTEXT);
+
+ ASSERT (NULL != ks);
+ ASSERT (buf);
+ ASSERT (buf->len >= 0);
+
+ if (buf->len)
+ {
+ perf_pop ();
+ return 0;
+ }
+
+ len = buf_forward_capacity (buf);
+ if (maxlen < len)
+ len = maxlen;
+
+ retval = endless_buf_read(ks->ct_out, BPTR(buf), len);
+
+ /* Error during read, check for retry error */
+ if (retval < 0)
+ {
+ perf_pop ();
+ if (POLARSSL_ERR_NET_WANT_WRITE == retval || POLARSSL_ERR_NET_WANT_READ == retval)
+ return 0;
+ error_strerror(retval, error_message, sizeof(error_message));
+ msg (D_TLS_ERRORS, "TLS_ERROR: read tls_read_ciphertext error: %d %s", retval, error_message);
+ buf->len = 0;
+ return -1;
+ }
+ /* Nothing read, try again */
+ if (0 == retval)
+ {
+ buf->len = 0;
+ perf_pop ();
+ return 0;
+ }
+
+ /* successful read */
+ dmsg (D_HANDSHAKE_VERBOSE, "read tls_read_ciphertext %d bytes", retval);
+ buf->len = retval;
+ perf_pop ();
+ return 1;
+}
+
+int
+key_state_write_ciphertext (struct key_state_ssl *ks, struct buffer *buf)
+{
+ int retval = 0;
+ perf_push (PERF_BIO_WRITE_CIPHERTEXT);
+
+ ASSERT (NULL != ks);
+ ASSERT (buf);
+ ASSERT (buf->len >= 0);
+
+ if (0 == buf->len)
+ {
+ perf_pop ();
+ return 0;
+ }
+
+ retval = endless_buf_write(ks->ct_in, BPTR(buf), buf->len);
+
+ if (retval < 0)
+ {
+ perf_pop ();
+
+ if (POLARSSL_ERR_NET_WANT_WRITE == retval || POLARSSL_ERR_NET_WANT_READ == retval)
+ return 0;
+ msg (D_TLS_ERRORS, "TLS ERROR: write tls_write_ciphertext error");
+ return -1;
+ }
+
+ if (retval != buf->len)
+ {
+ msg (D_TLS_ERRORS,
+ "TLS ERROR: write tls_write_ciphertext incomplete %d/%d",
+ retval, buf->len);
+ perf_pop ();
+ return -1;
+ }
+
+ /* successful write */
+ dmsg (D_HANDSHAKE_VERBOSE, "write tls_write_ciphertext %d bytes", retval);
+
+ memset (BPTR (buf), 0, BLEN (buf)); /* erase data just written */
+ buf->len = 0;
+
+ perf_pop ();
+ return 1;
+}
+
+int
+key_state_read_plaintext (struct key_state_ssl *ks, struct buffer *buf,
+ int maxlen)
+{
+ int retval = 0;
+ int len = 0;
+ char error_message[1024];
+
+ perf_push (PERF_BIO_READ_PLAINTEXT);
+
+ ASSERT (NULL != ks);
+ ASSERT (buf);
+ ASSERT (buf->len >= 0);
+
+ if (buf->len)
+ {
+ perf_pop ();
+ return 0;
+ }
+
+ len = buf_forward_capacity (buf);
+ if (maxlen < len)
+ len = maxlen;
+
+ retval = ssl_read(ks->ctx, BPTR(buf), len);
+
+ /* Error during read, check for retry error */
+ if (retval < 0)
+ {
+ if (POLARSSL_ERR_NET_WANT_WRITE == retval || POLARSSL_ERR_NET_WANT_READ == retval)
+ return 0;
+ error_strerror(retval, error_message, sizeof(error_message));
+ msg (D_TLS_ERRORS, "TLS_ERROR: read tls_read_plaintext error: %d %s", retval, error_message);
+ buf->len = 0;
+ perf_pop ();
+ return -1;
+ }
+ /* Nothing read, try again */
+ if (0 == retval)
+ {
+ buf->len = 0;
+ perf_pop ();
+ return 0;
+ }
+
+ /* successful read */
+ dmsg (D_HANDSHAKE_VERBOSE, "read tls_read_plaintext %d bytes", retval);
+ buf->len = retval;
+
+ perf_pop ();
+ return 1;
+}
+
+/* **************************************
+ *
+ * Information functions
+ *
+ * Print information for the end user.
+ *
+ ***************************************/
+void
+print_details (struct key_state_ssl * ks_ssl, const char *prefix)
+{
+ const x509_crt *cert;
+ char s1[256];
+ char s2[256];
+
+ s1[0] = s2[0] = 0;
+ openvpn_snprintf (s1, sizeof (s1), "%s %s, cipher %s",
+ prefix,
+ ssl_get_version (ks_ssl->ctx),
+ ssl_get_ciphersuite(ks_ssl->ctx));
+
+ cert = ssl_get_peer_cert(ks_ssl->ctx);
+ if (cert != NULL)
+ {
+ openvpn_snprintf (s2, sizeof (s2), ", %zu bit key", pk_get_size(&cert->pk));
+ }
+
+ msg (D_HANDSHAKE, "%s%s", s1, s2);
+}
+
+void
+show_available_tls_ciphers (const char *cipher_list)
+{
+ struct tls_root_ctx tls_ctx;
+ const int *ciphers = ssl_list_ciphersuites();
+
+ tls_ctx_server_new(&tls_ctx);
+ tls_ctx_restrict_ciphers(&tls_ctx, cipher_list);
+
+ if (tls_ctx.allowed_ciphers)
+ ciphers = tls_ctx.allowed_ciphers;
+
+#ifndef ENABLE_SMALL
+ printf ("Available TLS Ciphers,\n");
+ printf ("listed in order of preference:\n\n");
+#endif
+
+ while (*ciphers != 0)
+ {
+ printf ("%s\n", ssl_get_ciphersuite_name(*ciphers));
+ ciphers++;
+ }
+ printf ("\n");
+
+ tls_ctx_free(&tls_ctx);
+}
+
+void
+show_available_curves (void)
+{
+ const ecp_curve_info *pcurve = ecp_curve_list();
+
+ if (NULL == pcurve)
+ msg (M_FATAL, "Cannot retrieve curve list from PolarSSL");
+
+ /* Print curve list */
+ printf ("Available Elliptic curves, listed in order of preference:\n\n");
+ while (POLARSSL_ECP_DP_NONE != pcurve->grp_id)
+ {
+ printf("%s\n", pcurve->name);
+ pcurve++;
+ }
+}
+
+void
+get_highest_preference_tls_cipher (char *buf, int size)
+{
+ const char *cipher_name;
+ const int *ciphers = ssl_list_ciphersuites();
+ if (*ciphers == 0)
+ msg (M_FATAL, "Cannot retrieve list of supported SSL ciphers.");
+
+ cipher_name = ssl_get_ciphersuite_name(*ciphers);
+ strncpynt (buf, cipher_name, size);
+}
+
+const char *
+get_ssl_library_version(void)
+{
+ static char polar_version[30];
+ unsigned int pv = version_get_number();
+ sprintf( polar_version, "PolarSSL %d.%d.%d",
+ (pv>>24)&0xff, (pv>>16)&0xff, (pv>>8)&0xff );
+ return polar_version;
+}
+
+#endif /* defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_POLARSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.h
new file mode 100644
index 00000000..b80a509e
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_polarssl.h
@@ -0,0 +1,87 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel PolarSSL Backend
+ */
+
+#ifndef SSL_POLARSSL_H_
+#define SSL_POLARSSL_H_
+
+#include "syshead.h"
+
+#include <polarssl/ssl.h>
+#include <polarssl/x509_crt.h>
+
+#if defined(ENABLE_PKCS11)
+#include <polarssl/pkcs11.h>
+#endif
+
+typedef struct _buffer_entry buffer_entry;
+
+struct _buffer_entry {
+ size_t length;
+ uint8_t *data;
+ buffer_entry *next_block;
+};
+
+typedef struct {
+ size_t data_start;
+ buffer_entry *first_block;
+ buffer_entry *last_block;
+} endless_buffer;
+
+/**
+ * Structure that wraps the TLS context. Contents differ depending on the
+ * SSL library used.
+ *
+ * Either \c priv_key_pkcs11 or \c priv_key must be filled in.
+ */
+struct tls_root_ctx {
+ bool initialised; /**< True if the context has been initialised */
+
+ int endpoint; /**< Whether or not this is a server or a client */
+
+ dhm_context *dhm_ctx; /**< Diffie-Helmann-Merkle context */
+ x509_crt *crt_chain; /**< Local Certificate chain */
+ x509_crt *ca_chain; /**< CA chain for remote verification */
+ pk_context *priv_key; /**< Local private key */
+#if defined(ENABLE_PKCS11)
+ pkcs11_context *priv_key_pkcs11; /**< PKCS11 private key */
+#endif
+#ifdef MANAGMENT_EXTERNAL_KEY
+ struct external_context *external_key; /**< Management external key */
+#endif
+ int * allowed_ciphers; /**< List of allowed ciphers for this connection */
+};
+
+struct key_state_ssl {
+ ssl_context *ctx;
+ endless_buffer *ct_in;
+ endless_buffer *ct_out;
+};
+
+
+#endif /* SSL_POLARSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.c
new file mode 100644
index 00000000..2d10d155
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.c
@@ -0,0 +1,1271 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "misc.h"
+#include "manage.h"
+#include "ssl_verify.h"
+#include "ssl_verify_backend.h"
+
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include "ssl_verify_openssl.h"
+#endif
+
+/** Maximum length of common name */
+#define TLS_USERNAME_LEN 64
+
+/** Legal characters in an X509 name with --compat-names */
+#define X509_NAME_CHAR_CLASS (CC_ALNUM|CC_UNDERBAR|CC_DASH|CC_DOT|CC_AT|CC_SLASH|CC_COLON|CC_EQUAL)
+
+/** Legal characters in a common name with --compat-names */
+#define COMMON_NAME_CHAR_CLASS (CC_ALNUM|CC_UNDERBAR|CC_DASH|CC_DOT|CC_AT|CC_SLASH)
+
+static void
+string_mod_remap_name (char *str, const unsigned int restrictive_flags)
+{
+ if (compat_flag (COMPAT_FLAG_QUERY | COMPAT_NAMES)
+ && !compat_flag (COMPAT_FLAG_QUERY | COMPAT_NO_NAME_REMAPPING))
+ string_mod (str, restrictive_flags, 0, '_');
+ else
+ string_mod (str, CC_PRINT, CC_CRLF, '_');
+}
+
+/*
+ * Export the untrusted IP address and port to the environment
+ */
+static void
+setenv_untrusted (struct tls_session *session)
+{
+ setenv_link_socket_actual (session->opt->es, "untrusted", &session->untrusted_addr, SA_IP_PORT);
+}
+
+/*
+ * Remove authenticated state from all sessions in the given tunnel
+ */
+static void
+tls_deauthenticate (struct tls_multi *multi)
+{
+ if (multi)
+ {
+ int i, j;
+ for (i = 0; i < TM_SIZE; ++i)
+ for (j = 0; j < KS_SIZE; ++j)
+ multi->session[i].key[j].authenticated = false;
+ }
+}
+
+/*
+ * Set the given session's common_name
+ */
+static void
+set_common_name (struct tls_session *session, const char *common_name)
+{
+ if (session->common_name)
+ {
+ free (session->common_name);
+ session->common_name = NULL;
+#ifdef ENABLE_PF
+ session->common_name_hashval = 0;
+#endif
+ }
+ if (common_name)
+ {
+ /* FIXME: Last alloc will never be freed */
+ session->common_name = string_alloc (common_name, NULL);
+#ifdef ENABLE_PF
+ {
+ const uint32_t len = (uint32_t) strlen (common_name);
+ if (len)
+ session->common_name_hashval = hash_func ((const uint8_t*)common_name, len+1, 0);
+ else
+ session->common_name_hashval = 0;
+ }
+#endif
+ }
+}
+
+/*
+ * Retrieve the common name for the given tunnel's active session. If the
+ * common name is NULL or empty, return NULL if null is true, or "UNDEF" if
+ * null is false.
+ */
+const char *
+tls_common_name (const struct tls_multi *multi, const bool null)
+{
+ const char *ret = NULL;
+ if (multi)
+ ret = multi->session[TM_ACTIVE].common_name;
+ if (ret && strlen (ret))
+ return ret;
+ else if (null)
+ return NULL;
+ else
+ return "UNDEF";
+}
+
+/*
+ * Lock the common name for the given tunnel.
+ */
+void
+tls_lock_common_name (struct tls_multi *multi)
+{
+ const char *cn = multi->session[TM_ACTIVE].common_name;
+ if (cn && !multi->locked_cn)
+ multi->locked_cn = string_alloc (cn, NULL);
+}
+
+/*
+ * Lock the username for the given tunnel
+ */
+static bool
+tls_lock_username (struct tls_multi *multi, const char *username)
+{
+ if (multi->locked_username)
+ {
+ if (!username || strcmp (username, multi->locked_username))
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: username attempted to change from '%s' to '%s' -- tunnel disabled",
+ multi->locked_username,
+ np(username));
+
+ /* disable the tunnel */
+ tls_deauthenticate (multi);
+ return false;
+ }
+ }
+ else
+ {
+ if (username)
+ multi->locked_username = string_alloc (username, NULL);
+ }
+ return true;
+}
+
+const char *
+tls_username (const struct tls_multi *multi, const bool null)
+{
+ const char *ret = NULL;
+ if (multi)
+ ret = multi->locked_username;
+ if (ret && strlen (ret))
+ return ret;
+ else if (null)
+ return NULL;
+ else
+ return "UNDEF";
+}
+
+void
+cert_hash_remember (struct tls_session *session, const int error_depth, const unsigned char *sha1_hash)
+{
+ if (error_depth >= 0 && error_depth < MAX_CERT_DEPTH)
+ {
+ if (!session->cert_hash_set)
+ ALLOC_OBJ_CLEAR (session->cert_hash_set, struct cert_hash_set);
+ if (!session->cert_hash_set->ch[error_depth])
+ ALLOC_OBJ (session->cert_hash_set->ch[error_depth], struct cert_hash);
+ {
+ struct cert_hash *ch = session->cert_hash_set->ch[error_depth];
+ memcpy (ch->sha1_hash, sha1_hash, SHA_DIGEST_LENGTH);
+ }
+ }
+}
+
+#if 0
+static void
+cert_hash_print (const struct cert_hash_set *chs, int msglevel)
+{
+ struct gc_arena gc = gc_new ();
+ msg (msglevel, "CERT_HASH");
+ if (chs)
+ {
+ int i;
+ for (i = 0; i < MAX_CERT_DEPTH; ++i)
+ {
+ const struct cert_hash *ch = chs->ch[i];
+ if (ch)
+ msg (msglevel, "%d:%s", i, format_hex(ch->sha1_hash, SHA_DIGEST_LENGTH, 0, &gc));
+ }
+ }
+ gc_free (&gc);
+}
+#endif
+
+void
+cert_hash_free (struct cert_hash_set *chs)
+{
+ if (chs)
+ {
+ int i;
+ for (i = 0; i < MAX_CERT_DEPTH; ++i)
+ free (chs->ch[i]);
+ free (chs);
+ }
+}
+
+static bool
+cert_hash_compare (const struct cert_hash_set *chs1, const struct cert_hash_set *chs2)
+{
+ if (chs1 && chs2)
+ {
+ int i;
+ for (i = 0; i < MAX_CERT_DEPTH; ++i)
+ {
+ const struct cert_hash *ch1 = chs1->ch[i];
+ const struct cert_hash *ch2 = chs2->ch[i];
+
+ if (!ch1 && !ch2)
+ continue;
+ else if (ch1 && ch2 && !memcmp (ch1->sha1_hash, ch2->sha1_hash, SHA_DIGEST_LENGTH))
+ continue;
+ else
+ return false;
+ }
+ return true;
+ }
+ else if (!chs1 && !chs2)
+ return true;
+ else
+ return false;
+}
+
+static struct cert_hash_set *
+cert_hash_copy (const struct cert_hash_set *chs)
+{
+ struct cert_hash_set *dest = NULL;
+ if (chs)
+ {
+ int i;
+ ALLOC_OBJ_CLEAR (dest, struct cert_hash_set);
+ for (i = 0; i < MAX_CERT_DEPTH; ++i)
+ {
+ const struct cert_hash *ch = chs->ch[i];
+ if (ch)
+ {
+ ALLOC_OBJ (dest->ch[i], struct cert_hash);
+ memcpy (dest->ch[i]->sha1_hash, ch->sha1_hash, SHA_DIGEST_LENGTH);
+ }
+ }
+ }
+ return dest;
+}
+void
+tls_lock_cert_hash_set (struct tls_multi *multi)
+{
+ const struct cert_hash_set *chs = multi->session[TM_ACTIVE].cert_hash_set;
+ if (chs && !multi->locked_cert_hash_set)
+ multi->locked_cert_hash_set = cert_hash_copy (chs);
+}
+
+/*
+ * Returns the string associated with the given certificate type.
+ */
+static const char *
+print_nsCertType (int type)
+{
+ switch (type)
+ {
+ case NS_CERT_CHECK_SERVER:
+ return "SERVER";
+ case NS_CERT_CHECK_CLIENT:
+ return "CLIENT";
+ default:
+ return "?";
+ }
+}
+
+/*
+ * Verify the peer's certificate fields.
+ *
+ * @param opt the tls options to verify against
+ * @param peer_cert the peer's certificate
+ * @param subject the peer's extracted subject name
+ * @param subject the peer's extracted common name
+ */
+static result_t
+verify_peer_cert(const struct tls_options *opt, openvpn_x509_cert_t *peer_cert,
+ const char *subject, const char *common_name)
+{
+ /* verify certificate nsCertType */
+ if (opt->ns_cert_type != NS_CERT_CHECK_NONE)
+ {
+ if (SUCCESS == x509_verify_ns_cert_type (peer_cert, opt->ns_cert_type))
+ {
+ msg (D_HANDSHAKE, "VERIFY OK: nsCertType=%s",
+ print_nsCertType (opt->ns_cert_type));
+ }
+ else
+ {
+ msg (D_HANDSHAKE, "VERIFY nsCertType ERROR: %s, require nsCertType=%s",
+ subject, print_nsCertType (opt->ns_cert_type));
+ return FAILURE; /* Reject connection */
+ }
+ }
+
+ /* verify certificate ku */
+ if (opt->remote_cert_ku[0] != 0)
+ {
+ if (SUCCESS == x509_verify_cert_ku (peer_cert, opt->remote_cert_ku, MAX_PARMS))
+ {
+ msg (D_HANDSHAKE, "VERIFY KU OK");
+ }
+ else
+ {
+ msg (D_HANDSHAKE, "VERIFY KU ERROR");
+ return FAILURE; /* Reject connection */
+ }
+ }
+
+ /* verify certificate eku */
+ if (opt->remote_cert_eku != NULL)
+ {
+ if (SUCCESS == x509_verify_cert_eku (peer_cert, opt->remote_cert_eku))
+ {
+ msg (D_HANDSHAKE, "VERIFY EKU OK");
+ }
+ else
+ {
+ msg (D_HANDSHAKE, "VERIFY EKU ERROR");
+ return FAILURE; /* Reject connection */
+ }
+ }
+
+ /* verify X509 name or username against --verify-x509-[user]name */
+ if (opt->verify_x509_type != VERIFY_X509_NONE)
+ {
+ if ( (opt->verify_x509_type == VERIFY_X509_SUBJECT_DN
+ && strcmp (opt->verify_x509_name, subject) == 0)
+ || (opt->verify_x509_type == VERIFY_X509_SUBJECT_RDN
+ && strcmp (opt->verify_x509_name, common_name) == 0)
+ || (opt->verify_x509_type == VERIFY_X509_SUBJECT_RDN_PREFIX
+ && strncmp (opt->verify_x509_name, common_name,
+ strlen (opt->verify_x509_name)) == 0) )
+ msg (D_HANDSHAKE, "VERIFY X509NAME OK: %s", subject);
+ else
+ {
+ msg (D_HANDSHAKE, "VERIFY X509NAME ERROR: %s, must be %s",
+ subject, opt->verify_x509_name);
+ return FAILURE; /* Reject connection */
+ }
+ }
+
+ return SUCCESS;
+}
+
+/*
+ * Export the subject, common_name, and raw certificate fields to the
+ * environment for later verification by scripts and plugins.
+ */
+static void
+verify_cert_set_env(struct env_set *es, openvpn_x509_cert_t *peer_cert, int cert_depth,
+ const char *subject, const char *common_name
+#ifdef ENABLE_X509_TRACK
+ , const struct x509_track *x509_track
+#endif
+ )
+{
+ char envname[64];
+ char *serial = NULL;
+ struct gc_arena gc = gc_new ();
+
+ /* Save X509 fields in environment */
+#ifdef ENABLE_X509_TRACK
+ if (x509_track)
+ x509_setenv_track (x509_track, es, cert_depth, peer_cert);
+ else
+#endif
+ x509_setenv (es, cert_depth, peer_cert);
+
+ /* export subject name string as environmental variable */
+ openvpn_snprintf (envname, sizeof(envname), "tls_id_%d", cert_depth);
+ setenv_str (es, envname, subject);
+
+#if 0
+ /* export common name string as environmental variable */
+ openvpn_snprintf (envname, sizeof(envname), "tls_common_name_%d", cert_depth);
+ setenv_str (es, envname, common_name);
+#endif
+
+ /* export X509 cert SHA1 fingerprint */
+ {
+ unsigned char *sha1_hash = x509_get_sha1_hash(peer_cert, &gc);
+
+ openvpn_snprintf (envname, sizeof(envname), "tls_digest_%d", cert_depth);
+ setenv_str (es, envname, format_hex_ex(sha1_hash, SHA_DIGEST_LENGTH, 0, 1,
+ ":", &gc));
+ }
+
+ /* export serial number as environmental variable */
+ serial = backend_x509_get_serial(peer_cert, &gc);
+ openvpn_snprintf (envname, sizeof(envname), "tls_serial_%d", cert_depth);
+ setenv_str (es, envname, serial);
+
+ /* export serial number in hex as environmental variable */
+ serial = backend_x509_get_serial_hex(peer_cert, &gc);
+ openvpn_snprintf (envname, sizeof(envname), "tls_serial_hex_%d", cert_depth);
+ setenv_str (es, envname, serial);
+
+ gc_free(&gc);
+}
+
+/*
+ * call --tls-verify plug-in(s)
+ */
+static result_t
+verify_cert_call_plugin(const struct plugin_list *plugins, struct env_set *es,
+ int cert_depth, openvpn_x509_cert_t *cert, char *subject)
+{
+ if (plugin_defined (plugins, OPENVPN_PLUGIN_TLS_VERIFY))
+ {
+ int ret;
+ struct argv argv = argv_new ();
+
+ argv_printf (&argv, "%d %s", cert_depth, subject);
+
+ ret = plugin_call_ssl (plugins, OPENVPN_PLUGIN_TLS_VERIFY, &argv, NULL, es, cert_depth, cert);
+
+ argv_reset (&argv);
+
+ if (ret == OPENVPN_PLUGIN_FUNC_SUCCESS)
+ {
+ msg (D_HANDSHAKE, "VERIFY PLUGIN OK: depth=%d, %s",
+ cert_depth, subject);
+ }
+ else
+ {
+ msg (D_HANDSHAKE, "VERIFY PLUGIN ERROR: depth=%d, %s",
+ cert_depth, subject);
+ return FAILURE; /* Reject connection */
+ }
+ }
+ return SUCCESS;
+}
+
+static const char *
+verify_cert_export_cert(openvpn_x509_cert_t *peercert, const char *tmp_dir, struct gc_arena *gc)
+{
+ FILE *peercert_file;
+ const char *peercert_filename="";
+
+ if(!tmp_dir)
+ return NULL;
+
+ /* create tmp file to store peer cert */
+ peercert_filename = create_temp_file (tmp_dir, "pcf", gc);
+
+ /* write peer-cert in tmp-file */
+ peercert_file = fopen(peercert_filename, "w+");
+ if(!peercert_file)
+ {
+ msg (M_ERR, "Failed to open temporary file : %s", peercert_filename);
+ return NULL;
+ }
+
+ if (SUCCESS != x509_write_pem(peercert_file, peercert))
+ msg (M_ERR, "Error writing PEM file containing certificate");
+
+ fclose(peercert_file);
+ return peercert_filename;
+}
+
+
+/*
+ * run --tls-verify script
+ */
+static result_t
+verify_cert_call_command(const char *verify_command, struct env_set *es,
+ int cert_depth, openvpn_x509_cert_t *cert, char *subject, const char *verify_export_cert)
+{
+ const char *tmp_file = NULL;
+ int ret;
+ struct gc_arena gc = gc_new();
+ struct argv argv = argv_new ();
+
+ setenv_str (es, "script_type", "tls-verify");
+
+ if (verify_export_cert)
+ {
+ if ((tmp_file=verify_cert_export_cert(cert, verify_export_cert, &gc)))
+ {
+ setenv_str(es, "peer_cert", tmp_file);
+ }
+ }
+
+ argv_printf (&argv, "%sc %d %s", verify_command, cert_depth, subject);
+
+ argv_msg_prefix (D_TLS_DEBUG, &argv, "TLS: executing verify command");
+ ret = openvpn_run_script (&argv, es, 0, "--tls-verify script");
+
+ if (verify_export_cert)
+ {
+ if (tmp_file)
+ platform_unlink(tmp_file);
+ }
+
+ gc_free(&gc);
+ argv_reset (&argv);
+
+ if (ret)
+ {
+ msg (D_HANDSHAKE, "VERIFY SCRIPT OK: depth=%d, %s",
+ cert_depth, subject);
+ return SUCCESS;
+ }
+
+ msg (D_HANDSHAKE, "VERIFY SCRIPT ERROR: depth=%d, %s",
+ cert_depth, subject);
+ return FAILURE; /* Reject connection */
+}
+
+/*
+ * check peer cert against CRL directory
+ */
+static result_t
+verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert)
+{
+ result_t ret = FAILURE;
+ char fn[256];
+ int fd = -1;
+ struct gc_arena gc = gc_new();
+
+ char *serial = backend_x509_get_serial(cert, &gc);
+
+ if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, OS_SPECIFIC_DIRSEP, serial))
+ {
+ msg (D_HANDSHAKE, "VERIFY CRL: filename overflow");
+ goto cleanup;
+ }
+ fd = platform_open (fn, O_RDONLY, 0);
+ if (fd >= 0)
+ {
+ msg (D_HANDSHAKE, "VERIFY CRL: certificate serial number %s is revoked", serial);
+ goto cleanup;
+ }
+
+ ret = SUCCESS;
+
+cleanup:
+
+ if (fd != -1)
+ close(fd);
+ gc_free(&gc);
+ return ret;
+}
+
+result_t
+verify_cert(struct tls_session *session, openvpn_x509_cert_t *cert, int cert_depth)
+{
+ result_t ret = FAILURE;
+ char *subject = NULL;
+ char common_name[TLS_USERNAME_LEN] = {0};
+ const struct tls_options *opt;
+ struct gc_arena gc = gc_new();
+
+ opt = session->opt;
+ ASSERT (opt);
+
+ session->verified = false;
+
+ /* get the X509 name */
+ subject = x509_get_subject(cert, &gc);
+ if (!subject)
+ {
+ msg (D_TLS_ERRORS, "VERIFY ERROR: depth=%d, could not extract X509 "
+ "subject string from certificate", cert_depth);
+ goto cleanup;
+ }
+
+ /* enforce character class restrictions in X509 name */
+ string_mod_remap_name (subject, X509_NAME_CHAR_CLASS);
+ string_replace_leading (subject, '-', '_');
+
+ /* extract the username (default is CN) */
+ if (SUCCESS != backend_x509_get_username (common_name, TLS_USERNAME_LEN,
+ opt->x509_username_field, cert))
+ {
+ if (!cert_depth)
+ {
+ msg (D_TLS_ERRORS, "VERIFY ERROR: could not extract %s from X509 "
+ "subject string ('%s') -- note that the username length is "
+ "limited to %d characters",
+ opt->x509_username_field,
+ subject,
+ TLS_USERNAME_LEN);
+ goto cleanup;
+ }
+ }
+
+ /* enforce character class restrictions in common name */
+ string_mod_remap_name (common_name, COMMON_NAME_CHAR_CLASS);
+
+ /* warn if cert chain is too deep */
+ if (cert_depth >= MAX_CERT_DEPTH)
+ {
+ msg (D_TLS_ERRORS, "TLS Error: Convoluted certificate chain detected with depth [%d] greater than %d", cert_depth, MAX_CERT_DEPTH);
+ goto cleanup; /* Reject connection */
+ }
+
+ /* verify level 1 cert, i.e. the CA that signed our leaf cert */
+ if (cert_depth == 1 && opt->verify_hash)
+ {
+ unsigned char *sha1_hash = x509_get_sha1_hash(cert, &gc);
+ if (memcmp (sha1_hash, opt->verify_hash, SHA_DIGEST_LENGTH))
+ {
+ msg (D_TLS_ERRORS, "TLS Error: level-1 certificate hash verification failed");
+ goto cleanup;
+ }
+ }
+
+ /* save common name in session object */
+ if (cert_depth == 0)
+ set_common_name (session, common_name);
+
+ session->verify_maxlevel = max_int (session->verify_maxlevel, cert_depth);
+
+ /* export certificate values to the environment */
+ verify_cert_set_env(opt->es, cert, cert_depth, subject, common_name
+#ifdef ENABLE_X509_TRACK
+ , opt->x509_track
+#endif
+ );
+
+ /* export current untrusted IP */
+ setenv_untrusted (session);
+
+ /* If this is the peer's own certificate, verify it */
+ if (cert_depth == 0 && SUCCESS != verify_peer_cert(opt, cert, subject, common_name))
+ goto cleanup;
+
+ /* call --tls-verify plug-in(s), if registered */
+ if (SUCCESS != verify_cert_call_plugin(opt->plugins, opt->es, cert_depth, cert, subject))
+ goto cleanup;
+
+ /* run --tls-verify script */
+ if (opt->verify_command && SUCCESS != verify_cert_call_command(opt->verify_command,
+ opt->es, cert_depth, cert, subject, opt->verify_export_cert))
+ goto cleanup;
+
+ /* check peer cert against CRL */
+ if (opt->crl_file)
+ {
+ if (opt->ssl_flags & SSLF_CRL_VERIFY_DIR)
+ {
+ if (SUCCESS != verify_check_crl_dir(opt->crl_file, cert))
+ goto cleanup;
+ }
+ else
+ {
+ if (SUCCESS != x509_verify_crl(opt->crl_file, cert, subject))
+ goto cleanup;
+ }
+ }
+
+ msg (D_HANDSHAKE, "VERIFY OK: depth=%d, %s", cert_depth, subject);
+ session->verified = true;
+ ret = SUCCESS;
+
+cleanup:
+
+ if (ret != SUCCESS)
+ {
+ tls_clear_error(); /* always? */
+ session->verified = false; /* double sure? */
+ }
+ gc_free(&gc);
+
+ return ret;
+}
+
+/* ***************************************************************************
+ * Functions for the management of deferred authentication when using
+ * user/password authentication.
+ *************************************************************************** */
+
+#ifdef ENABLE_DEF_AUTH
+/* key_state_test_auth_control_file return values,
+ NOTE: acf_merge indexing depends on these values */
+#define ACF_UNDEFINED 0
+#define ACF_SUCCEEDED 1
+#define ACF_DISABLED 2
+#define ACF_FAILED 3
+#endif
+
+#ifdef MANAGEMENT_DEF_AUTH
+void
+man_def_auth_set_client_reason (struct tls_multi *multi, const char *client_reason)
+{
+ if (multi->client_reason)
+ {
+ free (multi->client_reason);
+ multi->client_reason = NULL;
+ }
+ if (client_reason && strlen (client_reason))
+ /* FIXME: Last alloc will never be freed */
+ multi->client_reason = string_alloc (client_reason, NULL);
+}
+
+static inline unsigned int
+man_def_auth_test (const struct key_state *ks)
+{
+ if (management_enable_def_auth (management))
+ return ks->mda_status;
+ else
+ return ACF_DISABLED;
+}
+#endif
+
+#ifdef PLUGIN_DEF_AUTH
+
+/*
+ * auth_control_file functions
+ */
+
+void
+key_state_rm_auth_control_file (struct key_state *ks)
+{
+ if (ks && ks->auth_control_file)
+ {
+ platform_unlink (ks->auth_control_file);
+ free (ks->auth_control_file);
+ ks->auth_control_file = NULL;
+ }
+}
+
+static void
+key_state_gen_auth_control_file (struct key_state *ks, const struct tls_options *opt)
+{
+ struct gc_arena gc = gc_new ();
+ const char *acf;
+
+ key_state_rm_auth_control_file (ks);
+ acf = create_temp_file (opt->tmp_dir, "acf", &gc);
+ if (acf) {
+ ks->auth_control_file = string_alloc (acf, NULL);
+ setenv_str (opt->es, "auth_control_file", ks->auth_control_file);
+ } /* FIXME: Should have better error handling? */
+
+ gc_free (&gc);
+}
+
+static unsigned int
+key_state_test_auth_control_file (struct key_state *ks)
+{
+ if (ks && ks->auth_control_file)
+ {
+ unsigned int ret = ks->auth_control_status;
+ if (ret == ACF_UNDEFINED)
+ {
+ FILE *fp = fopen (ks->auth_control_file, "r");
+ if (fp)
+ {
+ const int c = fgetc (fp);
+ if (c == '1')
+ ret = ACF_SUCCEEDED;
+ else if (c == '0')
+ ret = ACF_FAILED;
+ fclose (fp);
+ ks->auth_control_status = ret;
+ }
+ }
+ return ret;
+ }
+ return ACF_DISABLED;
+}
+
+#endif
+
+/*
+ * Return current session authentication state. Return
+ * value is TLS_AUTHENTICATION_x.
+ */
+
+int
+tls_authentication_status (struct tls_multi *multi, const int latency)
+{
+ bool deferred = false;
+ bool success = false;
+ bool active = false;
+
+#ifdef ENABLE_DEF_AUTH
+ static const unsigned char acf_merge[] =
+ {
+ ACF_UNDEFINED, /* s1=ACF_UNDEFINED s2=ACF_UNDEFINED */
+ ACF_UNDEFINED, /* s1=ACF_UNDEFINED s2=ACF_SUCCEEDED */
+ ACF_UNDEFINED, /* s1=ACF_UNDEFINED s2=ACF_DISABLED */
+ ACF_FAILED, /* s1=ACF_UNDEFINED s2=ACF_FAILED */
+ ACF_UNDEFINED, /* s1=ACF_SUCCEEDED s2=ACF_UNDEFINED */
+ ACF_SUCCEEDED, /* s1=ACF_SUCCEEDED s2=ACF_SUCCEEDED */
+ ACF_SUCCEEDED, /* s1=ACF_SUCCEEDED s2=ACF_DISABLED */
+ ACF_FAILED, /* s1=ACF_SUCCEEDED s2=ACF_FAILED */
+ ACF_UNDEFINED, /* s1=ACF_DISABLED s2=ACF_UNDEFINED */
+ ACF_SUCCEEDED, /* s1=ACF_DISABLED s2=ACF_SUCCEEDED */
+ ACF_DISABLED, /* s1=ACF_DISABLED s2=ACF_DISABLED */
+ ACF_FAILED, /* s1=ACF_DISABLED s2=ACF_FAILED */
+ ACF_FAILED, /* s1=ACF_FAILED s2=ACF_UNDEFINED */
+ ACF_FAILED, /* s1=ACF_FAILED s2=ACF_SUCCEEDED */
+ ACF_FAILED, /* s1=ACF_FAILED s2=ACF_DISABLED */
+ ACF_FAILED /* s1=ACF_FAILED s2=ACF_FAILED */
+ };
+#endif /* ENABLE_DEF_AUTH */
+
+ if (multi)
+ {
+ int i;
+
+#ifdef ENABLE_DEF_AUTH
+ if (latency && multi->tas_last && multi->tas_last + latency >= now)
+ return TLS_AUTHENTICATION_UNDEFINED;
+ multi->tas_last = now;
+#endif /* ENABLE_DEF_AUTH */
+
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ if (DECRYPT_KEY_ENABLED (multi, ks))
+ {
+ active = true;
+ if (ks->authenticated)
+ {
+#ifdef ENABLE_DEF_AUTH
+ unsigned int s1 = ACF_DISABLED;
+ unsigned int s2 = ACF_DISABLED;
+#ifdef PLUGIN_DEF_AUTH
+ s1 = key_state_test_auth_control_file (ks);
+#endif /* PLUGIN_DEF_AUTH */
+#ifdef MANAGEMENT_DEF_AUTH
+ s2 = man_def_auth_test (ks);
+#endif /* MANAGEMENT_DEF_AUTH */
+ ASSERT (s1 < 4 && s2 < 4);
+ switch (acf_merge[(s1<<2) + s2])
+ {
+ case ACF_SUCCEEDED:
+ case ACF_DISABLED:
+ success = true;
+ ks->auth_deferred = false;
+ break;
+ case ACF_UNDEFINED:
+ if (now < ks->auth_deferred_expire)
+ deferred = true;
+ break;
+ case ACF_FAILED:
+ ks->authenticated = false;
+ break;
+ default:
+ ASSERT (0);
+ }
+#else /* !ENABLE_DEF_AUTH */
+ success = true;
+#endif /* ENABLE_DEF_AUTH */
+ }
+ }
+ }
+ }
+
+#if 0
+ dmsg (D_TLS_ERRORS, "TAS: a=%d s=%d d=%d", active, success, deferred);
+#endif
+
+ if (success)
+ return TLS_AUTHENTICATION_SUCCEEDED;
+ else if (!active || deferred)
+ return TLS_AUTHENTICATION_DEFERRED;
+ else
+ return TLS_AUTHENTICATION_FAILED;
+}
+
+#ifdef MANAGEMENT_DEF_AUTH
+/*
+ * For deferred auth, this is where the management interface calls (on server)
+ * to indicate auth failure/success.
+ */
+bool
+tls_authenticate_key (struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
+{
+ bool ret = false;
+ if (multi)
+ {
+ int i;
+ man_def_auth_set_client_reason (multi, client_reason);
+ for (i = 0; i < KEY_SCAN_SIZE; ++i)
+ {
+ struct key_state *ks = multi->key_scan[i];
+ if (ks->mda_key_id == mda_key_id)
+ {
+ ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
+ ret = true;
+ }
+ }
+ }
+ return ret;
+}
+#endif
+
+
+/* ****************************************************************************
+ * Functions to verify username and password
+ *
+ * Authenticate a client using username/password.
+ * Runs on server.
+ *
+ * If you want to add new authentication methods,
+ * this is the place to start.
+ *************************************************************************** */
+
+/*
+ * Verify the user name and password using a script
+ */
+static bool
+verify_user_pass_script (struct tls_session *session, const struct user_pass *up)
+{
+ struct gc_arena gc = gc_new ();
+ struct argv argv = argv_new ();
+ const char *tmp_file = "";
+ bool ret = false;
+
+ /* Is username defined? */
+ if ((session->opt->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL) || strlen (up->username))
+ {
+ /* Set environmental variables prior to calling script */
+ setenv_str (session->opt->es, "script_type", "user-pass-verify");
+
+ if (session->opt->auth_user_pass_verify_script_via_file)
+ {
+ struct status_output *so;
+
+ tmp_file = create_temp_file (session->opt->tmp_dir, "up", &gc);
+ if( tmp_file ) {
+ so = status_open (tmp_file, 0, -1, NULL, STATUS_OUTPUT_WRITE);
+ status_printf (so, "%s", up->username);
+ status_printf (so, "%s", up->password);
+ if (!status_close (so))
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: could not write username/password to file: %s",
+ tmp_file);
+ goto done;
+ }
+ } else {
+ msg (D_TLS_ERRORS, "TLS Auth Error: could not create write "
+ "username/password to temp file");
+ }
+ }
+ else
+ {
+ setenv_str (session->opt->es, "username", up->username);
+ setenv_str (session->opt->es, "password", up->password);
+ }
+
+ /* setenv incoming cert common name for script */
+ setenv_str (session->opt->es, "common_name", session->common_name);
+
+ /* setenv client real IP address */
+ setenv_untrusted (session);
+
+ /* format command line */
+ argv_printf (&argv, "%sc %s", session->opt->auth_user_pass_verify_script, tmp_file);
+
+ /* call command */
+ ret = openvpn_run_script (&argv, session->opt->es, 0,
+ "--auth-user-pass-verify");
+
+ if (!session->opt->auth_user_pass_verify_script_via_file)
+ setenv_del (session->opt->es, "password");
+ }
+ else
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: peer provided a blank username");
+ }
+
+ done:
+ if (tmp_file && strlen (tmp_file) > 0)
+ platform_unlink (tmp_file);
+
+ argv_reset (&argv);
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Verify the username and password using a plugin
+ */
+static int
+verify_user_pass_plugin (struct tls_session *session, const struct user_pass *up, const char *raw_username)
+{
+ int retval = OPENVPN_PLUGIN_FUNC_ERROR;
+#ifdef PLUGIN_DEF_AUTH
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+#endif
+
+ /* Is username defined? */
+ if ((session->opt->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL) || strlen (up->username))
+ {
+ /* set username/password in private env space */
+ setenv_str (session->opt->es, "username", (raw_username ? raw_username : up->username));
+ setenv_str (session->opt->es, "password", up->password);
+
+ /* setenv incoming cert common name for script */
+ setenv_str (session->opt->es, "common_name", session->common_name);
+
+ /* setenv client real IP address */
+ setenv_untrusted (session);
+
+#ifdef PLUGIN_DEF_AUTH
+ /* generate filename for deferred auth control file */
+ key_state_gen_auth_control_file (ks, session->opt);
+#endif
+
+ /* call command */
+ retval = plugin_call (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY, NULL, NULL, session->opt->es);
+
+#ifdef PLUGIN_DEF_AUTH
+ /* purge auth control filename (and file itself) for non-deferred returns */
+ if (retval != OPENVPN_PLUGIN_FUNC_DEFERRED)
+ key_state_rm_auth_control_file (ks);
+#endif
+
+ setenv_del (session->opt->es, "password");
+ if (raw_username)
+ setenv_str (session->opt->es, "username", up->username);
+ }
+ else
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error (verify_user_pass_plugin): peer provided a blank username");
+ }
+
+ return retval;
+}
+
+
+#ifdef MANAGEMENT_DEF_AUTH
+/*
+ * MANAGEMENT_DEF_AUTH internal ssl_verify.c status codes
+ */
+#define KMDA_ERROR 0
+#define KMDA_SUCCESS 1
+#define KMDA_UNDEF 2
+#define KMDA_DEF 3
+
+static int
+verify_user_pass_management (struct tls_session *session, const struct user_pass *up, const char *raw_username)
+{
+ int retval = KMDA_ERROR;
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ /* Is username defined? */
+ if ((session->opt->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL) || strlen (up->username))
+ {
+ /* set username/password in private env space */
+ setenv_str (session->opt->es, "username", (raw_username ? raw_username : up->username));
+ setenv_str (session->opt->es, "password", up->password);
+
+ /* setenv incoming cert common name for script */
+ setenv_str (session->opt->es, "common_name", session->common_name);
+
+ /* setenv client real IP address */
+ setenv_untrusted (session);
+
+ if (management)
+ management_notify_client_needing_auth (management, ks->mda_key_id, session->opt->mda_context, session->opt->es);
+
+ setenv_del (session->opt->es, "password");
+ if (raw_username)
+ setenv_str (session->opt->es, "username", up->username);
+
+ retval = KMDA_SUCCESS;
+ }
+ else
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error (verify_user_pass_management): peer provided a blank username");
+ }
+
+ return retval;
+}
+#endif
+
+/*
+ * Main username/password verification entry point
+ */
+void
+verify_user_pass(struct user_pass *up, struct tls_multi *multi,
+ struct tls_session *session)
+{
+ int s1 = OPENVPN_PLUGIN_FUNC_SUCCESS;
+ bool s2 = true;
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ struct gc_arena gc = gc_new ();
+ char *raw_username = NULL;
+
+#ifdef MANAGEMENT_DEF_AUTH
+ int man_def_auth = KMDA_UNDEF;
+
+ if (management_enable_def_auth (management))
+ man_def_auth = KMDA_DEF;
+#endif
+
+ /*
+ * Preserve the raw username before string_mod remapping, for plugins
+ * and management clients when in --compat-names mode
+ */
+ if (compat_flag (COMPAT_FLAG_QUERY | COMPAT_NAMES))
+ {
+ ALLOC_ARRAY_CLEAR_GC (raw_username, char, USER_PASS_LEN, &gc);
+ strcpy (raw_username, up->username);
+ string_mod (raw_username, CC_PRINT, CC_CRLF, '_');
+ }
+
+ /* enforce character class restrictions in username/password */
+ string_mod_remap_name (up->username, COMMON_NAME_CHAR_CLASS);
+ string_mod (up->password, CC_PRINT, CC_CRLF, '_');
+
+ /* call plugin(s) and/or script */
+#ifdef MANAGEMENT_DEF_AUTH
+ if (man_def_auth == KMDA_DEF)
+ man_def_auth = verify_user_pass_management (session, up, raw_username);
+#endif
+ if (plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY))
+ s1 = verify_user_pass_plugin (session, up, raw_username);
+ if (session->opt->auth_user_pass_verify_script)
+ s2 = verify_user_pass_script (session, up);
+
+ /* check sizing of username if it will become our common name */
+ if ((session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) && strlen (up->username) >= TLS_USERNAME_LEN)
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: --username-as-common name specified and username is longer than the maximum permitted Common Name length of %d characters", TLS_USERNAME_LEN);
+ s1 = OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+
+ /* auth succeeded? */
+ if ((s1 == OPENVPN_PLUGIN_FUNC_SUCCESS
+#ifdef PLUGIN_DEF_AUTH
+ || s1 == OPENVPN_PLUGIN_FUNC_DEFERRED
+#endif
+ ) && s2
+#ifdef MANAGEMENT_DEF_AUTH
+ && man_def_auth != KMDA_ERROR
+#endif
+ && tls_lock_username (multi, up->username))
+ {
+ ks->authenticated = true;
+#ifdef PLUGIN_DEF_AUTH
+ if (s1 == OPENVPN_PLUGIN_FUNC_DEFERRED)
+ ks->auth_deferred = true;
+#endif
+#ifdef MANAGEMENT_DEF_AUTH
+ if (man_def_auth != KMDA_UNDEF)
+ ks->auth_deferred = true;
+#endif
+ if ((session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME))
+ set_common_name (session, up->username);
+#ifdef ENABLE_DEF_AUTH
+ msg (D_HANDSHAKE, "TLS: Username/Password authentication %s for username '%s' %s",
+ ks->auth_deferred ? "deferred" : "succeeded",
+ up->username,
+ (session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) ? "[CN SET]" : "");
+#else
+ msg (D_HANDSHAKE, "TLS: Username/Password authentication %s for username '%s' %s",
+ "succeeded",
+ up->username,
+ (session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) ? "[CN SET]" : "");
+#endif
+ }
+ else
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: Auth Username/Password verification failed for peer");
+ }
+
+ gc_free (&gc);
+}
+
+void
+verify_final_auth_checks(struct tls_multi *multi, struct tls_session *session)
+{
+ struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */
+
+ /* While it shouldn't really happen, don't allow the common name to be NULL */
+ if (!session->common_name)
+ set_common_name (session, "");
+
+ /* Don't allow the CN to change once it's been locked */
+ if (ks->authenticated && multi->locked_cn)
+ {
+ const char *cn = session->common_name;
+ if (cn && strcmp (cn, multi->locked_cn))
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: TLS object CN attempted to change from '%s' to '%s' -- tunnel disabled",
+ multi->locked_cn,
+ cn);
+
+ /* change the common name back to its original value and disable the tunnel */
+ set_common_name (session, multi->locked_cn);
+ tls_deauthenticate (multi);
+ }
+ }
+
+ /* Don't allow the cert hashes to change once they have been locked */
+ if (ks->authenticated && multi->locked_cert_hash_set)
+ {
+ const struct cert_hash_set *chs = session->cert_hash_set;
+ if (chs && !cert_hash_compare (chs, multi->locked_cert_hash_set))
+ {
+ msg (D_TLS_ERRORS, "TLS Auth Error: TLS object CN=%s client-provided SSL certs unexpectedly changed during mid-session reauth",
+ session->common_name);
+
+ /* disable the tunnel */
+ tls_deauthenticate (multi);
+ }
+ }
+
+ /* verify --client-config-dir based authentication */
+ if (ks->authenticated && session->opt->client_config_dir_exclusive)
+ {
+ struct gc_arena gc = gc_new ();
+
+ const char *cn = session->common_name;
+ const char *path = gen_path (session->opt->client_config_dir_exclusive, cn, &gc);
+ if (!cn || !strcmp (cn, CCD_DEFAULT) || !test_file (path))
+ {
+ ks->authenticated = false;
+ msg (D_TLS_ERRORS, "TLS Auth Error: --client-config-dir authentication failed for common name '%s' file='%s'",
+ session->common_name,
+ path ? path : "UNDEF");
+ }
+
+ gc_free (&gc);
+ }
+}
+#endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.h
new file mode 100644
index 00000000..84554f89
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify.h
@@ -0,0 +1,241 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module
+ */
+
+#ifndef SSL_VERIFY_H_
+#define SSL_VERIFY_H_
+
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+
+#include "syshead.h"
+#include "misc.h"
+#include "ssl_common.h"
+
+/* Include OpenSSL-specific code */
+#ifdef ENABLE_CRYPTO_OPENSSL
+#include "ssl_verify_openssl.h"
+#endif
+#ifdef ENABLE_CRYPTO_POLARSSL
+#include "ssl_verify_polarssl.h"
+#endif
+
+#include "ssl_verify_backend.h"
+
+/*
+ * Keep track of certificate hashes at various depths
+ */
+
+/** Maximum certificate depth we will allow */
+#define MAX_CERT_DEPTH 16
+
+/** Structure containing the hash for a single certificate */
+struct cert_hash {
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH]; /**< The SHA1 hash for a certificate */
+};
+
+/** Structure containing the hashes for a full certificate chain */
+struct cert_hash_set {
+ struct cert_hash *ch[MAX_CERT_DEPTH]; /**< Array of certificate hashes */
+};
+
+#define VERIFY_X509_NONE 0
+#define VERIFY_X509_SUBJECT_DN 1
+#define VERIFY_X509_SUBJECT_RDN 2
+#define VERIFY_X509_SUBJECT_RDN_PREFIX 3
+#define TLS_REMOTE_SUBJECT_DN 1 + 0x100
+#define TLS_REMOTE_SUBJECT_RDN_PREFIX 3 + 0x100
+
+#define TLS_AUTHENTICATION_SUCCEEDED 0
+#define TLS_AUTHENTICATION_FAILED 1
+#define TLS_AUTHENTICATION_DEFERRED 2
+#define TLS_AUTHENTICATION_UNDEFINED 3
+
+/*
+ * Return current session authentication state. Return
+ * value is TLS_AUTHENTICATION_x.
+ *
+ * TODO: document this function
+ */
+int tls_authentication_status (struct tls_multi *multi, const int latency);
+
+/** Check whether the \a ks \c key_state is ready to receive data channel
+ * packets.
+ * @ingroup data_crypto
+ *
+ * If true, it is safe to assume that this session has been authenticated
+ * by TLS.
+ *
+ * @note This macro only works if S_SENT_KEY + 1 == S_GOT_KEY. */
+#define DECRYPT_KEY_ENABLED(multi, ks) ((ks)->state >= (S_GOT_KEY - (multi)->opt.server))
+
+/**
+ * Remove the given key state's auth control file, if it exists.
+ *
+ * @param ks The key state the remove the file for
+ */
+void key_state_rm_auth_control_file (struct key_state *ks);
+
+/**
+ * Frees the given set of certificate hashes.
+ *
+ * @param chs The certificate hash set to free.
+ */
+void cert_hash_free (struct cert_hash_set *chs);
+
+/**
+ * Locks the certificate hash set used in the given tunnel
+ *
+ * @param multi The tunnel to lock
+ */
+void tls_lock_cert_hash_set (struct tls_multi *multi);
+
+/**
+ * Locks the common name field for the given tunnel
+ *
+ * @param multi The tunnel to lock
+ */
+void tls_lock_common_name (struct tls_multi *multi);
+
+/**
+ * Returns the common name field for the given tunnel
+ *
+ * @param multi The tunnel to return the common name for
+ * @param null Whether null may be returned. If not, "UNDEF" will be returned.
+ */
+const char *tls_common_name (const struct tls_multi* multi, const bool null);
+
+/**
+ * Returns the username field for the given tunnel
+ *
+ * @param multi The tunnel to return the username for
+ * @param null Whether null may be returned. If not, "UNDEF" will be returned.
+ */
+const char *tls_username (const struct tls_multi *multi, const bool null);
+
+#ifdef ENABLE_PF
+
+/**
+ * Retrieve the given tunnel's common name and its hash value.
+ *
+ * @param multi The tunnel to use
+ * @param cn Common name's string
+ * @param cn_hash Common name's hash value
+ *
+ * @return true if the common name was set, false otherwise.
+ */
+static inline bool
+tls_common_name_hash (const struct tls_multi *multi, const char **cn, uint32_t *cn_hash)
+{
+ if (multi)
+ {
+ const struct tls_session *s = &multi->session[TM_ACTIVE];
+ if (s->common_name && s->common_name[0] != '\0')
+ {
+ *cn = s->common_name;
+ *cn_hash = s->common_name_hashval;
+ return true;
+ }
+ }
+ return false;
+}
+
+#endif
+
+/**
+ * Verify the given username and password, using either an external script, a
+ * plugin, or the management interface.
+ *
+ * If authentication succeeds, the appropriate state is filled into the
+ * session's primary key state's authenticated field. Authentication may also
+ * be deferred, in which case the key state's auth_deferred field is filled in.
+ *
+ * @param up The username and password to verify.
+ * @param multi The TLS multi structure to verify usernames against.
+ * @param session The current TLS session
+ *
+ */
+void verify_user_pass(struct user_pass *up, struct tls_multi *multi,
+ struct tls_session *session);
+
+/**
+ * Perform final authentication checks, including locking of the cn, the allowed
+ * certificate hashes, and whether a client config entry exists in the
+ * client config directory.
+ *
+ * @param multi The TLS multi structure to verify locked structures.
+ * @param session The current TLS session
+ *
+ */
+void verify_final_auth_checks(struct tls_multi *multi, struct tls_session *session);
+
+#ifdef ENABLE_X509_TRACK
+
+struct x509_track
+{
+ const struct x509_track *next;
+ const char *name;
+# define XT_FULL_CHAIN (1<<0)
+ unsigned int flags;
+ int nid;
+};
+
+void x509_track_add (const struct x509_track **ll_head, const char *name, int msglevel, struct gc_arena *gc);
+
+#endif
+
+/*
+ * Certificate checking for verify_nsCertType
+ */
+/** Do not perform Netscape certificate type verification */
+#define NS_CERT_CHECK_NONE (0)
+/** Do not perform Netscape certificate type verification */
+#define NS_CERT_CHECK_SERVER (1<<0)
+/** Do not perform Netscape certificate type verification */
+#define NS_CERT_CHECK_CLIENT (1<<1)
+
+/*
+ * TODO: document
+ */
+#ifdef MANAGEMENT_DEF_AUTH
+bool tls_authenticate_key (struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason);
+void man_def_auth_set_client_reason (struct tls_multi *multi, const char *client_reason);
+#endif
+
+static inline const char *
+tls_client_reason (struct tls_multi *multi)
+{
+#ifdef ENABLE_DEF_AUTH
+ return multi->client_reason;
+#else
+ return NULL;
+#endif
+}
+
+#endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) */
+
+#endif /* SSL_VERIFY_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_backend.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_backend.h
new file mode 100644
index 00000000..4e9ad60f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_backend.h
@@ -0,0 +1,260 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module library-specific backend interface
+ */
+
+#ifndef SSL_VERIFY_BACKEND_H_
+#define SSL_VERIFY_BACKEND_H_
+
+/**
+ * Result of verification function
+ */
+typedef enum { SUCCESS=0, FAILURE=1 } result_t;
+
+/*
+ * Backend support functions.
+ *
+ * The following functions are needed by the backend, but defined in the main
+ * file.
+ */
+
+/*
+ * Verify certificate for the given session. Performs OpenVPN-specific
+ * verification.
+ *
+ * This function must be called for every certificate in the certificate
+ * chain during the certificate verification stage of the handshake.
+ *
+ * @param session TLS Session associated with this tunnel
+ * @param cert Certificate to process
+ * @param cert_depth Depth of the current certificate
+ *
+ * @return \c SUCCESS if verification was successful, \c FAILURE on failure.
+ */
+result_t verify_cert(struct tls_session *session, openvpn_x509_cert_t *cert, int cert_depth);
+
+/*
+ * Remember the given certificate hash, allowing the certificate chain to be
+ * locked between sessions.
+ *
+ * Must be called for every certificate in the verification chain, whether it
+ * is valid or not.
+ *
+ * @param session TLS Session associated with this tunnel
+ * @param cert_depth Depth of the current certificate
+ * @param sha1_hash Hash of the current certificate
+ */
+void cert_hash_remember (struct tls_session *session, const int cert_depth,
+ const unsigned char *sha1_hash);
+
+/*
+ * Library-specific functions.
+ *
+ * The following functions must be implemented on a library-specific basis.
+ */
+
+/*
+ * Retrieve certificate's subject name.
+ *
+ * @param cert Certificate to retrieve the subject from.
+ * @param gc Garbage collection arena to use when allocating string.
+ *
+ * @return a string containing the subject
+ */
+char *x509_get_subject (openvpn_x509_cert_t *cert, struct gc_arena *gc);
+
+/* Retrieve the certificate's SHA1 hash.
+ *
+ * @param cert Certificate to retrieve the hash from.
+ * @param gc Garbage collection arena to use when allocating string.
+ *
+ * @return a string containing the SHA1 hash of the certificate
+ */
+unsigned char *x509_get_sha1_hash (openvpn_x509_cert_t *cert, struct gc_arena *gc);
+
+/*
+ * Retrieve the certificate's username from the specified field.
+ *
+ * If the field is prepended with ext: and ENABLE_X509ALTUSERNAME is enabled,
+ * it will be loaded from an X.509 extension
+ *
+ * @param cn Buffer to return the common name in.
+ * @param cn_len Length of the cn buffer.
+ * @param x509_username_field Name of the field to load from
+ * @param cert Certificate to retrieve the common name from.
+ *
+ * @return \c FAILURE, \c or SUCCESS
+ */
+result_t backend_x509_get_username (char *common_name, int cn_len,
+ char * x509_username_field, openvpn_x509_cert_t *peer_cert);
+
+/*
+ * Return the certificate's serial number in decimal string representation.
+ *
+ * The serial number is returned as a string, since it might be a bignum.
+ *
+ * @param cert Certificate to retrieve the serial number from.
+ * @param gc Garbage collection arena to use when allocating string.
+ *
+ * @return String representation of the certificate's serial number
+ * in decimal notation, or NULL on error.
+ */
+char *backend_x509_get_serial (openvpn_x509_cert_t *cert, struct gc_arena *gc);
+
+/*
+ * Return the certificate's serial number in hex string representation.
+ *
+ * The serial number is returned as a string, since it might be a bignum.
+ *
+ * @param cert Certificate to retrieve the serial number from.
+ * @param gc Garbage collection arena to use when allocating string.
+ *
+ * @return String representation of the certificate's serial number
+ * in hex notation, or NULL on error.
+ */
+char *backend_x509_get_serial_hex (openvpn_x509_cert_t *cert,
+ struct gc_arena *gc);
+
+/*
+ * Save X509 fields to environment, using the naming convention:
+ *
+ * X509_{cert_depth}_{name}={value}
+ *
+ * @param es Environment set to save variables in
+ * @param cert_depth Depth of the certificate
+ * @param cert Certificate to set the environment for
+ */
+void x509_setenv (struct env_set *es, int cert_depth, openvpn_x509_cert_t *cert);
+
+#ifdef ENABLE_X509_TRACK
+
+/*
+ * Start tracking the given attribute.
+ *
+ * The tracked attributes are stored in ll_head.
+ *
+ * @param ll_head The x509_track to store tracked atttributes in
+ * @param name Name of the attribute to track
+ * @param msglevel Message level for errors
+ * @param gc Garbage collection arena for temp data
+ *
+ */
+void x509_track_add (const struct x509_track **ll_head, const char *name,
+ int msglevel, struct gc_arena *gc);
+
+/*
+ * Save X509 fields to environment, using the naming convention:
+ *
+ * X509_{cert_depth}_{name}={value}
+ *
+ * This function differs from setenv_x509 below in the following ways:
+ *
+ * (1) Only explicitly named attributes in xt are saved, per usage
+ * of --x509-track program options.
+ * (2) Only the level 0 cert info is saved unless the XT_FULL_CHAIN
+ * flag is set in xt->flags (corresponds with prepending a '+'
+ * to the name when specified by --x509-track program option).
+ * (3) This function supports both X509 subject name fields as
+ * well as X509 V3 extensions.
+ *
+ * @param xt
+ * @param es Environment set to save variables in
+ * @param cert_depth Depth of the certificate
+ * @param cert Certificate to set the environment for
+ */
+void x509_setenv_track (const struct x509_track *xt, struct env_set *es,
+ const int depth, openvpn_x509_cert_t *x509);
+
+#endif
+
+/*
+ * Check X.509 Netscape certificate type field, if available.
+ *
+ * @param cert Certificate to check.
+ * @param usage One of \c NS_CERT_CHECK_CLIENT, \c NS_CERT_CHECK_SERVER,
+ * or \c NS_CERT_CHECK_NONE.
+ *
+ * @return \c SUCCESS if NS_CERT_CHECK_NONE or if the certificate has
+ * the expected bit set. \c FAILURE if the certificate does
+ * not have NS cert type verification or the wrong bit set.
+ */
+result_t x509_verify_ns_cert_type(const openvpn_x509_cert_t *cert, const int usage);
+
+/*
+ * Verify X.509 key usage extension field.
+ *
+ * @param cert Certificate to check.
+ * @param expected_ku Array of valid key usage values
+ * @param expected_len Length of the key usage array
+ *
+ * @return \c SUCCESS if one of the key usage values matches, \c FAILURE
+ * if key usage is not enabled, or the values do not match.
+ */
+result_t x509_verify_cert_ku (openvpn_x509_cert_t *x509, const unsigned * const expected_ku,
+ int expected_len);
+
+/*
+ * Verify X.509 extended key usage extension field.
+ *
+ * @param cert Certificate to check.
+ * @param expected_oid String representation of the expected Object ID. May be
+ * either the string representation of the numeric OID
+ * (e.g. \c "1.2.3.4", or the descriptive string matching
+ * the OID.
+ *
+ * @return \c SUCCESS if one of the expected OID matches one of the
+ * extended key usage fields, \c FAILURE if extended key
+ * usage is not enabled, or the values do not match.
+ */
+result_t x509_verify_cert_eku (openvpn_x509_cert_t *x509, const char * const expected_oid);
+
+/*
+ * Store the given certificate in pem format in a temporary file in tmp_dir
+ *
+ * @param cert Certificate to store
+ * @param tmp_dir Temporary directory to store the directory
+ * @param gc gc_arena to store temporary objects in
+ *
+ *
+ */
+result_t x509_write_pem(FILE *peercert_file, openvpn_x509_cert_t *peercert);
+
+/*
+ * Check the certificate against a CRL file.
+ *
+ * @param crl_file File name of the CRL file
+ * @param cert Certificate to verify
+ * @param subject Subject of the given certificate
+ *
+ * @return \c SUCCESS if the CRL was not signed by the issuer of the
+ * certificate or does not contain an entry for it.
+ * \c FAILURE otherwise.
+ */
+result_t x509_verify_crl(const char *crl_file, openvpn_x509_cert_t *cert,
+ const char *subject);
+
+#endif /* SSL_VERIFY_BACKEND_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.c
new file mode 100644
index 00000000..cbcff022
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.c
@@ -0,0 +1,630 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module OpenSSL implementation
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL)
+
+#include "ssl_verify_openssl.h"
+
+#include "error.h"
+#include "ssl_openssl.h"
+#include "ssl_verify.h"
+#include "ssl_verify_backend.h"
+
+#include <openssl/x509v3.h>
+#include <openssl/err.h>
+
+int
+verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
+{
+ int ret = 0;
+ struct tls_session *session;
+ SSL *ssl;
+ struct gc_arena gc = gc_new();
+
+ /* get the tls_session pointer */
+ ssl = X509_STORE_CTX_get_ex_data (ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
+ ASSERT (ssl);
+ session = (struct tls_session *) SSL_get_ex_data (ssl, mydata_index);
+ ASSERT (session);
+
+ cert_hash_remember (session, ctx->error_depth,
+ x509_get_sha1_hash(ctx->current_cert, &gc));
+
+ /* did peer present cert which was signed by our root cert? */
+ if (!preverify_ok)
+ {
+ /* get the X509 name */
+ char *subject = x509_get_subject(ctx->current_cert, &gc);
+
+ if (subject)
+ {
+ /* Remote site specified a certificate, but it's not correct */
+ msg (D_TLS_ERRORS, "VERIFY ERROR: depth=%d, error=%s: %s",
+ ctx->error_depth,
+ X509_verify_cert_error_string (ctx->error),
+ subject);
+ }
+
+ ERR_clear_error();
+
+ session->verified = false;
+ goto cleanup;
+ }
+
+ if (SUCCESS != verify_cert(session, ctx->current_cert, ctx->error_depth))
+ goto cleanup;
+
+ ret = 1;
+
+cleanup:
+ gc_free(&gc);
+
+ return ret;
+}
+
+#ifdef ENABLE_X509ALTUSERNAME
+static
+bool extract_x509_extension(X509 *cert, char *fieldname, char *out, int size)
+{
+ bool retval = false;
+ X509_EXTENSION *pExt;
+ char *buf = 0;
+ int length = 0;
+ GENERAL_NAMES *extensions;
+ int nid = OBJ_txt2nid(fieldname);
+
+ extensions = (GENERAL_NAMES *)X509_get_ext_d2i(cert, nid, NULL, NULL);
+ if ( extensions )
+ {
+ int numalts;
+ int i;
+ /* get amount of alternatives,
+ * RFC2459 claims there MUST be at least
+ * one, but we don't depend on it...
+ */
+
+ numalts = sk_GENERAL_NAME_num(extensions);
+
+ /* loop through all alternatives */
+ for (i=0; i<numalts; i++)
+ {
+ /* get a handle to alternative name number i */
+ const GENERAL_NAME *name = sk_GENERAL_NAME_value (extensions, i );
+
+ switch (name->type)
+ {
+ case GEN_EMAIL:
+ ASN1_STRING_to_UTF8((unsigned char**)&buf, name->d.ia5);
+ if ( strlen (buf) != name->d.ia5->length )
+ {
+ msg (D_TLS_ERRORS, "ASN1 ERROR: string contained terminating zero");
+ OPENSSL_free (buf);
+ } else {
+ strncpynt(out, buf, size);
+ OPENSSL_free(buf);
+ retval = true;
+ }
+ break;
+ default:
+ msg (D_TLS_ERRORS, "ASN1 ERROR: can not handle field type %i",
+ name->type);
+ break;
+ }
+ }
+ sk_GENERAL_NAME_free (extensions);
+ }
+ return retval;
+}
+#endif /* ENABLE_X509ALTUSERNAME */
+
+/*
+ * Extract a field from an X509 subject name.
+ *
+ * Example:
+ *
+ * /C=US/ST=CO/L=Denver/O=ORG/CN=First-CN/CN=Test-CA/Email=jim@yonan.net
+ *
+ * The common name is 'Test-CA'
+ *
+ * Return true on success, false on error (insufficient buffer size in 'out'
+ * to contain result is grounds for error).
+ */
+static result_t
+extract_x509_field_ssl (X509_NAME *x509, const char *field_name, char *out,
+ int size)
+{
+ int lastpos = -1;
+ int tmp = -1;
+ X509_NAME_ENTRY *x509ne = 0;
+ ASN1_STRING *asn1 = 0;
+ unsigned char *buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+ int nid = OBJ_txt2nid((char *)field_name);
+
+ ASSERT (size > 0);
+ *out = '\0';
+ do {
+ lastpos = tmp;
+ tmp = X509_NAME_get_index_by_NID(x509, nid, lastpos);
+ } while (tmp > -1);
+
+ /* Nothing found */
+ if (lastpos == -1)
+ return FAILURE;
+
+ x509ne = X509_NAME_get_entry(x509, lastpos);
+ if (!x509ne)
+ return FAILURE;
+
+ asn1 = X509_NAME_ENTRY_get_data(x509ne);
+ if (!asn1)
+ return FAILURE;
+ tmp = ASN1_STRING_to_UTF8(&buf, asn1);
+ if (tmp <= 0)
+ return FAILURE;
+
+ strncpynt(out, (char *)buf, size);
+
+ {
+ const result_t ret = (strlen ((char *)buf) < size) ? SUCCESS: FAILURE;
+ OPENSSL_free (buf);
+ return ret;
+ }
+}
+
+result_t
+backend_x509_get_username (char *common_name, int cn_len,
+ char * x509_username_field, X509 *peer_cert)
+{
+#ifdef ENABLE_X509ALTUSERNAME
+ if (strncmp("ext:",x509_username_field,4) == 0)
+ {
+ if (!extract_x509_extension (peer_cert, x509_username_field+4, common_name, cn_len))
+ return FAILURE;
+ } else
+#endif
+ if (FAILURE == extract_x509_field_ssl (X509_get_subject_name (peer_cert),
+ x509_username_field, common_name, cn_len))
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+char *
+backend_x509_get_serial (openvpn_x509_cert_t *cert, struct gc_arena *gc)
+{
+ ASN1_INTEGER *asn1_i;
+ BIGNUM *bignum;
+ char *openssl_serial, *serial;
+
+ asn1_i = X509_get_serialNumber(cert);
+ bignum = ASN1_INTEGER_to_BN(asn1_i, NULL);
+ openssl_serial = BN_bn2dec(bignum);
+
+ serial = string_alloc(openssl_serial, gc);
+
+ BN_free(bignum);
+ OPENSSL_free(openssl_serial);
+
+ return serial;
+}
+
+char *
+backend_x509_get_serial_hex (openvpn_x509_cert_t *cert, struct gc_arena *gc)
+{
+ const ASN1_INTEGER *asn1_i = X509_get_serialNumber(cert);
+
+ return format_hex_ex(asn1_i->data, asn1_i->length, 0, 1, ":", gc);
+}
+
+unsigned char *
+x509_get_sha1_hash (X509 *cert, struct gc_arena *gc)
+{
+ unsigned char *hash = gc_malloc(SHA_DIGEST_LENGTH, false, gc);
+ memcpy(hash, cert->sha1_hash, SHA_DIGEST_LENGTH);
+ return hash;
+}
+
+char *
+x509_get_subject (X509 *cert, struct gc_arena *gc)
+{
+ BIO *subject_bio = NULL;
+ BUF_MEM *subject_mem;
+ char *subject = NULL;
+ int maxlen = 0;
+
+ /*
+ * Generate the subject string in OpenSSL proprietary format,
+ * when in --compat-names mode
+ */
+ if (compat_flag (COMPAT_FLAG_QUERY | COMPAT_NAMES))
+ {
+ subject = gc_malloc (256, false, gc);
+ X509_NAME_oneline (X509_get_subject_name (cert), subject, 256);
+ subject[255] = '\0';
+ return subject;
+ }
+
+ subject_bio = BIO_new (BIO_s_mem ());
+ if (subject_bio == NULL)
+ goto err;
+
+ X509_NAME_print_ex (subject_bio, X509_get_subject_name (cert),
+ 0, XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_FN_SN |
+ ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_ESC_CTRL);
+
+ if (BIO_eof (subject_bio))
+ goto err;
+
+ BIO_get_mem_ptr (subject_bio, &subject_mem);
+
+ maxlen = subject_mem->length + 1;
+ subject = gc_malloc (maxlen, false, gc);
+
+ memcpy (subject, subject_mem->data, maxlen);
+ subject[maxlen - 1] = '\0';
+
+err:
+ if (subject_bio)
+ BIO_free (subject_bio);
+
+ return subject;
+}
+
+
+#ifdef ENABLE_X509_TRACK
+
+void
+x509_track_add (const struct x509_track **ll_head, const char *name, int msglevel, struct gc_arena *gc)
+{
+ struct x509_track *xt;
+ ALLOC_OBJ_CLEAR_GC (xt, struct x509_track, gc);
+ if (*name == '+')
+ {
+ xt->flags |= XT_FULL_CHAIN;
+ ++name;
+ }
+ xt->name = name;
+ xt->nid = OBJ_txt2nid(name);
+ if (xt->nid != NID_undef)
+ {
+ xt->next = *ll_head;
+ *ll_head = xt;
+ }
+ else
+ msg(msglevel, "x509_track: no such attribute '%s'", name);
+}
+
+/* worker method for setenv_x509_track */
+static void
+do_setenv_x509 (struct env_set *es, const char *name, char *value, int depth)
+{
+ char *name_expand;
+ size_t name_expand_size;
+
+ string_mod (value, CC_ANY, CC_CRLF, '?');
+ msg (D_X509_ATTR, "X509 ATTRIBUTE name='%s' value='%s' depth=%d", name, value, depth);
+ name_expand_size = 64 + strlen (name);
+ name_expand = (char *) malloc (name_expand_size);
+ check_malloc_return (name_expand);
+ openvpn_snprintf (name_expand, name_expand_size, "X509_%d_%s", depth, name);
+ setenv_str (es, name_expand, value);
+ free (name_expand);
+}
+
+void
+x509_setenv_track (const struct x509_track *xt, struct env_set *es, const int depth, X509 *x509)
+{
+ X509_NAME *x509_name = X509_get_subject_name (x509);
+ const char nullc = '\0';
+ int i;
+
+ while (xt)
+ {
+ if (depth == 0 || (xt->flags & XT_FULL_CHAIN))
+ {
+ i = X509_NAME_get_index_by_NID(x509_name, xt->nid, -1);
+ if (i >= 0)
+ {
+ X509_NAME_ENTRY *ent = X509_NAME_get_entry(x509_name, i);
+ if (ent)
+ {
+ ASN1_STRING *val = X509_NAME_ENTRY_get_data (ent);
+ unsigned char *buf;
+ buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+ if (ASN1_STRING_to_UTF8 (&buf, val) > 0)
+ {
+ do_setenv_x509(es, xt->name, (char *)buf, depth);
+ OPENSSL_free (buf);
+ }
+ }
+ }
+ else
+ {
+ i = X509_get_ext_by_NID(x509, xt->nid, -1);
+ if (i >= 0)
+ {
+ X509_EXTENSION *ext = X509_get_ext(x509, i);
+ if (ext)
+ {
+ BIO *bio = BIO_new(BIO_s_mem());
+ if (bio)
+ {
+ if (X509V3_EXT_print(bio, ext, 0, 0))
+ {
+ if (BIO_write(bio, &nullc, 1) == 1)
+ {
+ char *str;
+ BIO_get_mem_data(bio, &str);
+ do_setenv_x509(es, xt->name, str, depth);
+ }
+ }
+ BIO_free(bio);
+ }
+ }
+ }
+ }
+ }
+ xt = xt->next;
+ }
+}
+#endif
+
+/*
+ * Save X509 fields to environment, using the naming convention:
+ *
+ * X509_{cert_depth}_{name}={value}
+ */
+void
+x509_setenv (struct env_set *es, int cert_depth, openvpn_x509_cert_t *peer_cert)
+{
+ int i, n;
+ int fn_nid;
+ ASN1_OBJECT *fn;
+ ASN1_STRING *val;
+ X509_NAME_ENTRY *ent;
+ const char *objbuf;
+ unsigned char *buf;
+ char *name_expand;
+ size_t name_expand_size;
+ X509_NAME *x509 = X509_get_subject_name (peer_cert);
+
+ n = X509_NAME_entry_count (x509);
+ for (i = 0; i < n; ++i)
+ {
+ ent = X509_NAME_get_entry (x509, i);
+ if (!ent)
+ continue;
+ fn = X509_NAME_ENTRY_get_object (ent);
+ if (!fn)
+ continue;
+ val = X509_NAME_ENTRY_get_data (ent);
+ if (!val)
+ continue;
+ fn_nid = OBJ_obj2nid (fn);
+ if (fn_nid == NID_undef)
+ continue;
+ objbuf = OBJ_nid2sn (fn_nid);
+ if (!objbuf)
+ continue;
+ buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+ if (ASN1_STRING_to_UTF8 (&buf, val) <= 0)
+ continue;
+ name_expand_size = 64 + strlen (objbuf);
+ name_expand = (char *) malloc (name_expand_size);
+ check_malloc_return (name_expand);
+ openvpn_snprintf (name_expand, name_expand_size, "X509_%d_%s", cert_depth,
+ objbuf);
+ string_mod (name_expand, CC_PRINT, CC_CRLF, '_');
+ string_mod ((char*)buf, CC_PRINT, CC_CRLF, '_');
+ setenv_str (es, name_expand, (char*)buf);
+ free (name_expand);
+ OPENSSL_free (buf);
+ }
+}
+
+result_t
+x509_verify_ns_cert_type(const openvpn_x509_cert_t *peer_cert, const int usage)
+{
+ if (usage == NS_CERT_CHECK_NONE)
+ return SUCCESS;
+ if (usage == NS_CERT_CHECK_CLIENT)
+ return ((peer_cert->ex_flags & EXFLAG_NSCERT)
+ && (peer_cert->ex_nscert & NS_SSL_CLIENT)) ? SUCCESS: FAILURE;
+ if (usage == NS_CERT_CHECK_SERVER)
+ return ((peer_cert->ex_flags & EXFLAG_NSCERT)
+ && (peer_cert->ex_nscert & NS_SSL_SERVER)) ? SUCCESS: FAILURE;
+
+ return FAILURE;
+}
+
+result_t
+x509_verify_cert_ku (X509 *x509, const unsigned * const expected_ku,
+ int expected_len)
+{
+ ASN1_BIT_STRING *ku = NULL;
+ result_t fFound = FAILURE;
+
+ if ((ku = (ASN1_BIT_STRING *) X509_get_ext_d2i (x509, NID_key_usage, NULL,
+ NULL)) == NULL)
+ {
+ msg (D_HANDSHAKE, "Certificate does not have key usage extension");
+ }
+ else
+ {
+ unsigned nku = 0;
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ if (ASN1_BIT_STRING_get_bit (ku, i))
+ nku |= 1 << (7 - i);
+ }
+
+ /*
+ * Fixup if no LSB bits
+ */
+ if ((nku & 0xff) == 0)
+ {
+ nku >>= 8;
+ }
+
+ msg (D_HANDSHAKE, "Validating certificate key usage");
+ for (i = 0; fFound != SUCCESS && i < expected_len; i++)
+ {
+ if (expected_ku[i] != 0)
+ {
+ msg (D_HANDSHAKE, "++ Certificate has key usage %04x, expects "
+ "%04x", nku, expected_ku[i]);
+
+ if (nku == expected_ku[i])
+ fFound = SUCCESS;
+ }
+ }
+ }
+
+ if (ku != NULL)
+ ASN1_BIT_STRING_free (ku);
+
+ return fFound;
+}
+
+result_t
+x509_verify_cert_eku (X509 *x509, const char * const expected_oid)
+{
+ EXTENDED_KEY_USAGE *eku = NULL;
+ result_t fFound = FAILURE;
+
+ if ((eku = (EXTENDED_KEY_USAGE *) X509_get_ext_d2i (x509, NID_ext_key_usage,
+ NULL, NULL)) == NULL)
+ {
+ msg (D_HANDSHAKE, "Certificate does not have extended key usage extension");
+ }
+ else
+ {
+ int i;
+
+ msg (D_HANDSHAKE, "Validating certificate extended key usage");
+ for (i = 0; SUCCESS != fFound && i < sk_ASN1_OBJECT_num (eku); i++)
+ {
+ ASN1_OBJECT *oid = sk_ASN1_OBJECT_value (eku, i);
+ char szOid[1024];
+
+ if (SUCCESS != fFound && OBJ_obj2txt (szOid, sizeof(szOid), oid, 0) != -1)
+ {
+ msg (D_HANDSHAKE, "++ Certificate has EKU (str) %s, expects %s",
+ szOid, expected_oid);
+ if (!strcmp (expected_oid, szOid))
+ fFound = SUCCESS;
+ }
+ if (SUCCESS != fFound && OBJ_obj2txt (szOid, sizeof(szOid), oid, 1) != -1)
+ {
+ msg (D_HANDSHAKE, "++ Certificate has EKU (oid) %s, expects %s",
+ szOid, expected_oid);
+ if (!strcmp (expected_oid, szOid))
+ fFound = SUCCESS;
+ }
+ }
+ }
+
+ if (eku != NULL)
+ sk_ASN1_OBJECT_pop_free (eku, ASN1_OBJECT_free);
+
+ return fFound;
+}
+
+result_t
+x509_write_pem(FILE *peercert_file, X509 *peercert)
+{
+ if (PEM_write_X509(peercert_file, peercert) < 0)
+ {
+ msg (M_ERR, "Failed to write peer certificate in PEM format");
+ return FAILURE;
+ }
+ return SUCCESS;
+}
+
+/*
+ * check peer cert against CRL
+ */
+result_t
+x509_verify_crl(const char *crl_file, X509 *peer_cert, const char *subject)
+{
+ X509_CRL *crl=NULL;
+ X509_REVOKED *revoked;
+ BIO *in=NULL;
+ int n,i;
+ result_t retval = FAILURE;
+
+ in = BIO_new_file (crl_file, "r");
+
+ if (in == NULL) {
+ msg (M_WARN, "CRL: cannot read: %s", crl_file);
+ goto end;
+ }
+ crl=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
+ if (crl == NULL) {
+ msg (M_WARN, "CRL: cannot read CRL from file %s", crl_file);
+ goto end;
+ }
+
+ if (X509_NAME_cmp(X509_CRL_get_issuer(crl), X509_get_issuer_name(peer_cert)) != 0) {
+ msg (M_WARN, "CRL: CRL %s is from a different issuer than the issuer of "
+ "certificate %s", crl_file, subject);
+ retval = SUCCESS;
+ goto end;
+ }
+
+ n = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl));
+ for (i = 0; i < n; i++) {
+ revoked = (X509_REVOKED *)sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), i);
+ if (ASN1_INTEGER_cmp(revoked->serialNumber, X509_get_serialNumber(peer_cert)) == 0) {
+ msg (D_HANDSHAKE, "CRL CHECK FAILED: %s is REVOKED",subject);
+ goto end;
+ }
+ }
+
+ retval = SUCCESS;
+ msg (D_HANDSHAKE, "CRL CHECK OK: %s",subject);
+
+end:
+ BIO_free(in);
+ if (crl)
+ X509_CRL_free (crl);
+
+ return retval;
+}
+
+#endif /* defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.h
new file mode 100644
index 00000000..5a7e0a19
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_openssl.h
@@ -0,0 +1,76 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module OpenSSL backend
+ */
+
+
+#ifndef SSL_VERIFY_OPENSSL_H_
+#define SSL_VERIFY_OPENSSL_H_
+
+#include <openssl/x509.h>
+
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef X509 openvpn_x509_cert_t;
+#endif
+
+/** @name Function for authenticating a new connection from a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Verify that the remote OpenVPN peer's certificate allows setting up a
+ * VPN tunnel.
+ * @ingroup control_tls
+ *
+ * This callback function is called every time a new TLS session is being
+ * setup to determine whether the remote OpenVPN peer's certificate is
+ * allowed to connect. It is called for once for every certificate in the chain.
+ * The callback functionality is configured in the \c init_ssl() function, which
+ * calls the OpenSSL library's \c SSL_CTX_set_verify() function with \c
+ * verify_callback() as its callback argument.
+ *
+ * It checks preverify_ok, and registers the certificate hash. If these steps
+ * succeed, it calls the \c verify_cert() function, which performs
+ * OpenVPN-specific verification.
+ *
+ * @param preverify_ok - Whether the remote OpenVPN peer's certificate
+ * past verification. A value of 1 means it
+ * verified successfully, 0 means it failed.
+ * @param ctx - The complete context used by the OpenSSL library
+ * to verify the certificate chain.
+ *
+ * @return The return value indicates whether the supplied certificate is
+ * allowed to set up a VPN tunnel. The following values can be
+ * returned:
+ * - \c 0: failure, this certificate is not allowed to connect.
+ * - \c 1: success, this certificate is allowed to connect.
+ */
+int verify_callback (int preverify_ok, X509_STORE_CTX * ctx);
+
+/** @} name Function for authenticating a new connection from a remote OpenVPN peer */
+
+#endif /* SSL_VERIFY_OPENSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.c
new file mode 100644
index 00000000..2b7c214f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.c
@@ -0,0 +1,406 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module PolarSSL backend
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#if defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_POLARSSL)
+
+#include "ssl_verify.h"
+#include <polarssl/error.h>
+#include <polarssl/bignum.h>
+#include <polarssl/oid.h>
+#include <polarssl/sha1.h>
+
+#define MAX_SUBJECT_LENGTH 256
+
+int
+verify_callback (void *session_obj, x509_crt *cert, int cert_depth,
+ int *flags)
+{
+ struct tls_session *session = (struct tls_session *) session_obj;
+ struct gc_arena gc = gc_new();
+
+ ASSERT (cert);
+ ASSERT (session);
+
+ session->verified = false;
+
+ /* Remember certificate hash */
+ cert_hash_remember (session, cert_depth, x509_get_sha1_hash(cert, &gc));
+
+ /* did peer present cert which was signed by our root cert? */
+ if (*flags != 0)
+ {
+ char *subject = x509_get_subject(cert, &gc);
+
+ if (subject)
+ msg (D_TLS_ERRORS, "VERIFY ERROR: depth=%d, flags=%x, %s", cert_depth, *flags, subject);
+ else
+ msg (D_TLS_ERRORS, "VERIFY ERROR: depth=%d, flags=%x, could not extract X509 "
+ "subject string from certificate", *flags, cert_depth);
+
+ /* Leave flags set to non-zero to indicate that the cert is not ok */
+ }
+ else if (SUCCESS != verify_cert(session, cert, cert_depth))
+ {
+ *flags |= BADCERT_OTHER;
+ }
+
+ gc_free(&gc);
+
+ /*
+ * PolarSSL-1.2.0+ expects 0 on anything except fatal errors.
+ */
+ return 0;
+}
+
+#ifdef ENABLE_X509ALTUSERNAME
+# warning "X509 alt user name not yet supported for PolarSSL"
+#endif
+
+result_t
+backend_x509_get_username (char *cn, int cn_len,
+ char *x509_username_field, x509_crt *cert)
+{
+ x509_name *name;
+
+ ASSERT( cn != NULL );
+
+ name = &cert->subject;
+
+ /* Find common name */
+ while( name != NULL )
+ {
+ if( memcmp( name->oid.p, OID_AT_CN, OID_SIZE(OID_AT_CN) ) == 0)
+ break;
+
+ name = name->next;
+ }
+
+ /* Not found, return an error if this is the peer's certificate */
+ if( name == NULL )
+ return FAILURE;
+
+ /* Found, extract CN */
+ if (cn_len > name->val.len)
+ memcpy( cn, name->val.p, name->val.len );
+ else
+ {
+ memcpy( cn, name->val.p, cn_len);
+ cn[cn_len-1] = '\0';
+ }
+
+ return SUCCESS;
+}
+
+char *
+backend_x509_get_serial (openvpn_x509_cert_t *cert, struct gc_arena *gc)
+{
+ char *buf = NULL;
+ size_t buflen = 0;
+ mpi serial_mpi = { 0 };
+ int retval = 0;
+
+ /* Transform asn1 integer serial into PolarSSL MPI */
+ mpi_init(&serial_mpi);
+ retval = mpi_read_binary(&serial_mpi, cert->serial.p, cert->serial.len);
+ if (retval < 0)
+ {
+ char errbuf[128];
+ polarssl_strerror(retval, errbuf, sizeof(errbuf));
+
+ msg(M_WARN, "Failed to retrieve serial from certificate: %s.", errbuf);
+ return NULL;
+ }
+
+ /* Determine decimal representation length, allocate buffer */
+ mpi_write_string(&serial_mpi, 10, buf, &buflen);
+ buf = gc_malloc(buflen, true, gc);
+
+ /* Write MPI serial as decimal string into buffer */
+ retval = mpi_write_string(&serial_mpi, 10, buf, &buflen);
+ if (retval < 0)
+ {
+ char errbuf[128];
+ polarssl_strerror(retval, errbuf, sizeof(errbuf));
+
+ msg(M_WARN, "Failed to write serial to string: %s.", errbuf);
+ return NULL;
+ }
+
+ return buf;
+}
+
+char *
+backend_x509_get_serial_hex (openvpn_x509_cert_t *cert, struct gc_arena *gc)
+{
+ char *buf = NULL;
+ size_t len = cert->serial.len * 3 + 1;
+
+ buf = gc_malloc(len, true, gc);
+
+ if(x509_serial_gets(buf, len-1, &cert->serial) < 0)
+ buf = NULL;
+
+ return buf;
+}
+
+unsigned char *
+x509_get_sha1_hash (x509_crt *cert, struct gc_arena *gc)
+{
+ unsigned char *sha1_hash = gc_malloc(SHA_DIGEST_LENGTH, false, gc);
+ sha1(cert->tbs.p, cert->tbs.len, sha1_hash);
+ return sha1_hash;
+}
+
+char *
+x509_get_subject(x509_crt *cert, struct gc_arena *gc)
+{
+ char tmp_subject[MAX_SUBJECT_LENGTH] = {0};
+ char *subject = NULL;
+
+ int ret = 0;
+
+ ret = x509_dn_gets( tmp_subject, MAX_SUBJECT_LENGTH-1, &cert->subject );
+ if (ret > 0)
+ {
+ /* Allocate the required space for the subject */
+ subject = string_alloc(tmp_subject, gc);
+ }
+
+ return subject;
+}
+
+/*
+ * Save X509 fields to environment, using the naming convention:
+ *
+ * X509_{cert_depth}_{name}={value}
+ */
+void
+x509_setenv (struct env_set *es, int cert_depth, openvpn_x509_cert_t *cert)
+{
+ int i;
+ unsigned char c;
+ const x509_name *name;
+ char s[128];
+
+ name = &cert->subject;
+
+ memset( s, 0, sizeof( s ) );
+
+ while( name != NULL )
+ {
+ char name_expand[64+8];
+ const char *shortname;
+
+ if( 0 == oid_get_attr_short_name(&name->oid, &shortname) )
+ {
+ openvpn_snprintf (name_expand, sizeof(name_expand), "X509_%d_%s",
+ cert_depth, shortname);
+ }
+ else
+ {
+ openvpn_snprintf (name_expand, sizeof(name_expand), "X509_%d_\?\?",
+ cert_depth);
+ }
+
+ for( i = 0; i < name->val.len; i++ )
+ {
+ if( i >= (int) sizeof( s ) - 1 )
+ break;
+
+ c = name->val.p[i];
+ if( c < 32 || c == 127 || ( c > 128 && c < 160 ) )
+ s[i] = '?';
+ else s[i] = c;
+ }
+ s[i] = '\0';
+
+ /* Check both strings, set environment variable */
+ string_mod (name_expand, CC_PRINT, CC_CRLF, '_');
+ string_mod ((char*)s, CC_PRINT, CC_CRLF, '_');
+ setenv_str (es, name_expand, (char*)s);
+
+ name = name->next;
+ }
+}
+
+result_t
+x509_verify_ns_cert_type(const x509_crt *cert, const int usage)
+{
+ if (usage == NS_CERT_CHECK_NONE)
+ return SUCCESS;
+ if (usage == NS_CERT_CHECK_CLIENT)
+ return ((cert->ext_types & EXT_NS_CERT_TYPE)
+ && (cert->ns_cert_type & NS_CERT_TYPE_SSL_CLIENT)) ? SUCCESS : FAILURE;
+ if (usage == NS_CERT_CHECK_SERVER)
+ return ((cert->ext_types & EXT_NS_CERT_TYPE)
+ && (cert->ns_cert_type & NS_CERT_TYPE_SSL_SERVER)) ? SUCCESS : FAILURE;
+
+ return FAILURE;
+}
+
+result_t
+x509_verify_cert_ku (x509_crt *cert, const unsigned * const expected_ku,
+ int expected_len)
+{
+ result_t fFound = FAILURE;
+
+ if(!(cert->ext_types & EXT_KEY_USAGE))
+ {
+ msg (D_HANDSHAKE, "Certificate does not have key usage extension");
+ }
+ else
+ {
+ int i;
+ unsigned nku = cert->key_usage;
+
+ msg (D_HANDSHAKE, "Validating certificate key usage");
+ for (i=0; SUCCESS != fFound && i<expected_len; i++)
+ {
+ if (expected_ku[i] != 0)
+ {
+ msg (D_HANDSHAKE, "++ Certificate has key usage %04x, expects "
+ "%04x", nku, expected_ku[i]);
+
+ if (nku == expected_ku[i])
+ {
+ fFound = SUCCESS;
+ }
+ }
+ }
+ }
+ return fFound;
+}
+
+result_t
+x509_verify_cert_eku (x509_crt *cert, const char * const expected_oid)
+{
+ result_t fFound = FAILURE;
+
+ if (!(cert->ext_types & EXT_EXTENDED_KEY_USAGE))
+ {
+ msg (D_HANDSHAKE, "Certificate does not have extended key usage extension");
+ }
+ else
+ {
+ x509_sequence *oid_seq = &(cert->ext_key_usage);
+
+ msg (D_HANDSHAKE, "Validating certificate extended key usage");
+ while (oid_seq != NULL)
+ {
+ x509_buf *oid = &oid_seq->buf;
+ char oid_num_str[1024];
+ const char *oid_str;
+
+ oid_str = x509_oid_get_description(oid);
+ if (oid_str != NULL)
+ {
+ msg (D_HANDSHAKE, "++ Certificate has EKU (str) %s, expects %s",
+ oid_str, expected_oid);
+ if (!strcmp (expected_oid, oid_str))
+ {
+ fFound = SUCCESS;
+ break;
+ }
+ }
+
+ if (0 < x509_oid_get_numeric_string( oid_num_str,
+ sizeof (oid_num_str), oid))
+ {
+ msg (D_HANDSHAKE, "++ Certificate has EKU (oid) %s, expects %s",
+ oid_num_str, expected_oid);
+ if (!strcmp (expected_oid, oid_num_str))
+ {
+ fFound = SUCCESS;
+ break;
+ }
+ }
+ oid_seq = oid_seq->next;
+ }
+ }
+
+ return fFound;
+}
+
+result_t
+x509_write_pem(FILE *peercert_file, x509_crt *peercert)
+{
+ msg (M_WARN, "PolarSSL does not support writing peer certificate in PEM format");
+ return FAILURE;
+}
+
+/*
+ * check peer cert against CRL
+ */
+result_t
+x509_verify_crl(const char *crl_file, x509_crt *cert, const char *subject)
+{
+ result_t retval = FAILURE;
+ x509_crl crl = {0};
+
+ int polar_retval = x509_crl_parse_file(&crl, crl_file);
+ if (polar_retval != 0)
+ {
+ char errstr[128];
+ polarssl_strerror(polar_retval, errstr, sizeof(errstr));
+ msg (M_WARN, "CRL: cannot read CRL from file %s (%s)", crl_file, errstr);
+ goto end;
+ }
+
+ if(cert->issuer_raw.len != crl.issuer_raw.len ||
+ memcmp(crl.issuer_raw.p, cert->issuer_raw.p, crl.issuer_raw.len) != 0)
+ {
+ msg (M_WARN, "CRL: CRL %s is from a different issuer than the issuer of "
+ "certificate %s", crl_file, subject);
+ retval = SUCCESS;
+ goto end;
+ }
+
+ if (0 != x509_crt_revoked(cert, &crl))
+ {
+ msg (D_HANDSHAKE, "CRL CHECK FAILED: %s is REVOKED", subject);
+ goto end;
+ }
+
+ retval = SUCCESS;
+ msg (D_HANDSHAKE, "CRL CHECK OK: %s",subject);
+
+end:
+ x509_crl_free(&crl);
+ return retval;
+}
+
+#endif /* #if defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_POLARSSL) */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.h
new file mode 100644
index 00000000..2076f2ef
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/ssl_verify_polarssl.h
@@ -0,0 +1,78 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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.
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**
+ * @file Control Channel Verification Module PolarSSL backend
+ */
+
+#ifndef SSL_VERIFY_POLARSSL_H_
+#define SSL_VERIFY_POLARSSL_H_
+
+#include "syshead.h"
+#include <polarssl/x509_crt.h>
+
+#ifndef __OPENVPN_X509_CERT_T_DECLARED
+#define __OPENVPN_X509_CERT_T_DECLARED
+typedef x509_crt openvpn_x509_cert_t;
+#endif
+
+/** @name Function for authenticating a new connection from a remote OpenVPN peer
+ * @{ */
+
+/**
+ * Verify that the remote OpenVPN peer's certificate allows setting up a
+ * VPN tunnel.
+ * @ingroup control_tls
+ *
+ * This callback function is called when a new TLS session is being setup to
+ * determine whether the remote OpenVPN peer's certificate is allowed to
+ * connect. It is called for once for every certificate in the chain. The
+ * callback functionality is configured in the \c init_ssl() function, which
+ * calls the PolarSSL library's \c ssl_set_verify_callback() function with \c
+ * verify_callback() as its callback argument.
+ *
+ * It checks *flags and registers the certificate hash. If these steps succeed,
+ * it calls the \c verify_cert() function, which performs OpenVPN-specific
+ * verification.
+ *
+ * @param session_obj - The OpenVPN \c tls_session associated with this object,
+ * as set during SSL session setup.
+ * @param cert - The certificate used by PolarSSL.
+ * @param cert_depth - The depth of the current certificate in the chain, with
+ * 0 being the actual certificate.
+ * @param flags - Whether the remote OpenVPN peer's certificate
+ * passed verification. A value of 0 means it
+ * verified successfully, any other value means it
+ * failed. \c verify_callback() is considered to have
+ * ok'ed this certificate if flags is 0 when it returns.
+ *
+ * @return The return value is 0 unless a fatal error occurred.
+ */
+int verify_callback (void *session_obj, x509_crt *cert, int cert_depth,
+ int *flags);
+
+/** @} name Function for authenticating a new connection from a remote OpenVPN peer */
+
+#endif /* SSL_VERIFY_POLARSSL_H_ */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/status.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/status.c
new file mode 100644
index 00000000..b7ff4843
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/status.c
@@ -0,0 +1,292 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "status.h"
+#include "perf.h"
+#include "misc.h"
+#include "fdmisc.h"
+
+#include "memdbg.h"
+
+/*
+ * printf-style interface for outputting status info
+ */
+
+static const char *
+print_status_mode (unsigned int flags)
+{
+ switch (flags)
+ {
+ case STATUS_OUTPUT_WRITE:
+ return "WRITE";
+ case STATUS_OUTPUT_READ:
+ return "READ";
+ case STATUS_OUTPUT_READ|STATUS_OUTPUT_WRITE:
+ return "READ/WRITE";
+ default:
+ return "UNDEF";
+ }
+}
+
+struct status_output *
+status_open (const char *filename,
+ const int refresh_freq,
+ const int msglevel,
+ const struct virtual_output *vout,
+ const unsigned int flags)
+{
+ struct status_output *so = NULL;
+ if (filename || msglevel >= 0 || vout)
+ {
+ ALLOC_OBJ_CLEAR (so, struct status_output);
+ so->flags = flags;
+ so->msglevel = msglevel;
+ so->vout = vout;
+ so->fd = -1;
+ buf_reset (&so->read_buf);
+ event_timeout_clear (&so->et);
+ if (filename)
+ {
+ switch (so->flags)
+ {
+ case STATUS_OUTPUT_WRITE:
+ so->fd = platform_open (filename,
+ O_CREAT | O_TRUNC | O_WRONLY,
+ S_IRUSR | S_IWUSR);
+ break;
+ case STATUS_OUTPUT_READ:
+ so->fd = platform_open (filename,
+ O_RDONLY,
+ S_IRUSR | S_IWUSR);
+ break;
+ case STATUS_OUTPUT_READ|STATUS_OUTPUT_WRITE:
+ so->fd = platform_open (filename,
+ O_CREAT | O_RDWR,
+ S_IRUSR | S_IWUSR);
+ break;
+ default:
+ ASSERT (0);
+ }
+ if (so->fd >= 0)
+ {
+ so->filename = string_alloc (filename, NULL);
+ set_cloexec (so->fd);
+
+ /* allocate read buffer */
+ if (so->flags & STATUS_OUTPUT_READ)
+ so->read_buf = alloc_buf (512);
+ }
+ else
+ {
+ msg (M_WARN, "Note: cannot open %s for %s", filename, print_status_mode (so->flags));
+ so->errors = true;
+ }
+ }
+ else
+ so->flags = STATUS_OUTPUT_WRITE;
+
+ if ((so->flags & STATUS_OUTPUT_WRITE) && refresh_freq > 0)
+ {
+ event_timeout_init (&so->et, refresh_freq, 0);
+ }
+ }
+ return so;
+}
+
+bool
+status_trigger (struct status_output *so)
+{
+ if (so)
+ {
+ struct timeval null;
+ CLEAR (null);
+ return event_timeout_trigger (&so->et, &null, ETT_DEFAULT);
+ }
+ else
+ return false;
+}
+
+bool
+status_trigger_tv (struct status_output *so, struct timeval *tv)
+{
+ if (so)
+ return event_timeout_trigger (&so->et, tv, ETT_DEFAULT);
+ else
+ return false;
+}
+
+void
+status_reset (struct status_output *so)
+{
+ if (so && so->fd >= 0)
+ lseek (so->fd, (off_t)0, SEEK_SET);
+}
+
+void
+status_flush (struct status_output *so)
+{
+ if (so && so->fd >= 0 && (so->flags & STATUS_OUTPUT_WRITE))
+ {
+#if defined(HAVE_FTRUNCATE)
+ {
+ const off_t off = lseek (so->fd, (off_t)0, SEEK_CUR);
+ if (ftruncate (so->fd, off) != 0) {
+ msg (M_WARN, "Failed to truncate status file: %s", strerror(errno));
+ }
+ }
+#elif defined(HAVE_CHSIZE)
+ {
+ const long off = (long) lseek (so->fd, (off_t)0, SEEK_CUR);
+ chsize (so->fd, off);
+ }
+#else
+#warning both ftruncate and chsize functions appear to be missing from this OS
+#endif
+
+ /* clear read buffer */
+ if (buf_defined (&so->read_buf))
+ {
+ ASSERT (buf_init (&so->read_buf, 0));
+ }
+ }
+}
+
+/* return false if error occurred */
+bool
+status_close (struct status_output *so)
+{
+ bool ret = true;
+ if (so)
+ {
+ if (so->errors)
+ ret = false;
+ if (so->fd >= 0)
+ {
+ if (close (so->fd) < 0)
+ ret = false;
+ }
+ if (so->filename)
+ free (so->filename);
+ if (buf_defined (&so->read_buf))
+ free_buf (&so->read_buf);
+ free (so);
+ }
+ else
+ ret = false;
+ return ret;
+}
+
+#define STATUS_PRINTF_MAXLEN 512
+
+void
+status_printf (struct status_output *so, const char *format, ...)
+{
+ if (so && (so->flags & STATUS_OUTPUT_WRITE))
+ {
+ char buf[STATUS_PRINTF_MAXLEN+2]; /* leave extra bytes for CR, LF */
+ va_list arglist;
+ int stat;
+
+ va_start (arglist, format);
+ stat = vsnprintf (buf, STATUS_PRINTF_MAXLEN, format, arglist);
+ va_end (arglist);
+ buf[STATUS_PRINTF_MAXLEN - 1] = 0;
+
+ if (stat < 0 || stat >= STATUS_PRINTF_MAXLEN)
+ so->errors = true;
+
+ if (so->msglevel >= 0 && !so->errors)
+ msg (so->msglevel, "%s", buf);
+
+ if (so->fd >= 0 && !so->errors)
+ {
+ int len;
+ strcat (buf, "\n");
+ len = strlen (buf);
+ if (len > 0)
+ {
+ if (write (so->fd, buf, len) != len)
+ so->errors = true;
+ }
+ }
+
+ if (so->vout && !so->errors)
+ {
+ chomp (buf);
+ (*so->vout->func) (so->vout->arg, so->vout->flags_default, buf);
+ }
+ }
+}
+
+bool
+status_read (struct status_output *so, struct buffer *buf)
+{
+ bool ret = false;
+
+ if (so && so->fd >= 0 && (so->flags & STATUS_OUTPUT_READ))
+ {
+ ASSERT (buf_defined (&so->read_buf));
+ ASSERT (buf_defined (buf));
+ while (true)
+ {
+ const int c = buf_read_u8 (&so->read_buf);
+
+ /* read more of file into buffer */
+ if (c == -1)
+ {
+ int len;
+
+ ASSERT (buf_init (&so->read_buf, 0));
+ len = read (so->fd, BPTR (&so->read_buf), BCAP (&so->read_buf));
+ if (len <= 0)
+ break;
+
+ ASSERT (buf_inc_len (&so->read_buf, len));
+ continue;
+ }
+
+ ret = true;
+
+ if (c == '\r')
+ continue;
+
+ if (c == '\n')
+ break;
+
+ buf_write_u8 (buf, c);
+ }
+
+ buf_null_terminate (buf);
+ }
+
+ return ret;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/status.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/status.h
new file mode 100644
index 00000000..af16fd2a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/status.h
@@ -0,0 +1,99 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef STATUS_H
+#define STATUS_H
+
+#include "interval.h"
+
+/*
+ * virtual function interface for status output
+ */
+struct virtual_output {
+ void *arg;
+ unsigned int flags_default;
+ void (*func) (void *arg, const unsigned int flags, const char *str);
+};
+
+static inline void
+virtual_output_print (const struct virtual_output *vo, const unsigned int flags, const char *str)
+{
+ (*vo->func) (vo->arg, flags, str);
+}
+
+/*
+ * printf-style interface for inputting/outputting status info
+ */
+
+struct status_output
+{
+# define STATUS_OUTPUT_READ (1<<0)
+# define STATUS_OUTPUT_WRITE (1<<1)
+ unsigned int flags;
+
+ char *filename;
+ int fd;
+ int msglevel;
+ const struct virtual_output *vout;
+
+ struct buffer read_buf;
+
+ struct event_timeout et;
+
+ bool errors;
+};
+
+struct status_output *status_open (const char *filename,
+ const int refresh_freq,
+ const int msglevel,
+ const struct virtual_output *vout,
+ const unsigned int flags);
+
+bool status_trigger_tv (struct status_output *so, struct timeval *tv);
+bool status_trigger (struct status_output *so);
+void status_reset (struct status_output *so);
+void status_flush (struct status_output *so);
+bool status_close (struct status_output *so);
+void status_printf (struct status_output *so, const char *format, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+ __attribute__ ((format (gnu_printf, 2, 3)))
+#else
+ __attribute__ ((format (__printf__, 2, 3)))
+#endif
+#endif
+ ;
+
+bool status_read (struct status_output *so, struct buffer *buf);
+
+static inline unsigned int
+status_rw_flags (const struct status_output *so)
+{
+ if (so)
+ return so->flags;
+ else
+ return 0;
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/syshead.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/syshead.h
new file mode 100644
index 00000000..dc511cbc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/syshead.h
@@ -0,0 +1,719 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SYSHEAD_H
+#define SYSHEAD_H
+
+#include "compat.h"
+#include "compat-stdbool.h"
+
+/* branch prediction hints */
+#if defined(__GNUC__)
+# define likely(x) __builtin_expect((x),1)
+# define unlikely(x) __builtin_expect((x),0)
+#else
+# define likely(x) (x)
+# define unlikely(x) (x)
+#endif
+
+#ifdef WIN32
+#include <windows.h>
+#include <winsock2.h>
+#define sleep(x) Sleep((x)*1000)
+#define random rand
+#define srandom srand
+#endif
+
+#if defined(__APPLE__)
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070
+#define __APPLE_USE_RFC_3542 1
+#endif
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#ifndef WIN32
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#ifdef HAVE_ERR_H
+#include <err.h>
+#endif
+
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+
+#ifdef HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#endif
+
+#ifdef HAVE_SYS_EPOLL_H
+#include <sys/epoll.h>
+#endif
+
+#ifdef ENABLE_SELINUX
+#include <selinux/selinux.h>
+#endif
+
+#if defined(HAVE_LIBGEN_H)
+#include <libgen.h>
+#endif
+
+#ifdef TARGET_SOLARIS
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#else
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#ifdef TARGET_NETBSD
+#include <net/if_tap.h>
+#endif
+
+#if defined(TARGET_LINUX) || defined (TARGET_ANDROID)
+
+#if defined(HAVE_NETINET_IF_ETHER_H)
+#include <netinet/if_ether.h>
+#endif
+
+#ifdef HAVE_LINUX_IF_TUN_H
+#include <linux/if_tun.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_LINUX_SOCKIOS_H
+#include <linux/sockios.h>
+#endif
+
+#ifdef HAVE_LINUX_TYPES_H
+#include <linux/types.h>
+#endif
+
+#ifdef HAVE_LINUX_ERRQUEUE_H
+#include <linux/errqueue.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#endif /* TARGET_LINUX */
+
+#ifdef TARGET_SOLARIS
+
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#undef S_ERROR
+#endif
+
+#ifdef HAVE_NET_IF_TUN_H
+#include <net/if_tun.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#endif /* TARGET_SOLARIS */
+
+#ifdef TARGET_OPENBSD
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NET_IF_TUN_H
+#include <net/if_tun.h>
+#endif
+
+#endif /* TARGET_OPENBSD */
+
+#ifdef TARGET_FREEBSD
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#ifdef HAVE_NET_IF_TUN_H
+#include <net/if_tun.h>
+#endif
+
+#endif /* TARGET_FREEBSD */
+
+#ifdef TARGET_NETBSD
+
+#ifdef HAVE_NET_IF_TUN_H
+#include <net/if_tun.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#endif /* TARGET_NETBSD */
+
+#ifdef TARGET_DRAGONFLY
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NET_TUN_IF_TUN_H
+#include <net/tun/if_tun.h>
+#endif
+
+#endif /* TARGET_DRAGONFLY */
+
+#ifdef TARGET_DARWIN
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#endif /* TARGET_DARWIN */
+
+#ifdef WIN32
+#include <iphlpapi.h>
+#include <ntddndis.h>
+#include <wininet.h>
+#include <shellapi.h>
+/* The following two headers are needed of PF_INET6 */
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+#ifdef TARGET_DARWIN
+#define _P1003_1B_VISIBLE
+#endif /* TARGET_DARWIN */
+#include <sys/mman.h>
+#endif
+
+/*
+ * Pedantic mode is meant to accomplish lint-style program checking,
+ * not to build a working executable.
+ */
+#ifdef __STRICT_ANSI__
+# define PEDANTIC 1
+# undef HAVE_CPP_VARARG_MACRO_GCC
+# undef HAVE_CPP_VARARG_MACRO_ISO
+# undef EMPTY_ARRAY_SIZE
+# define EMPTY_ARRAY_SIZE 1
+# undef inline
+# define inline
+#else
+# define PEDANTIC 0
+#endif
+
+/*
+ * Do we have the capability to support the --passtos option?
+ */
+#if defined(IPPROTO_IP) && defined(IP_TOS) && defined(HAVE_SETSOCKOPT)
+#define PASSTOS_CAPABILITY 1
+#else
+#define PASSTOS_CAPABILITY 0
+#endif
+
+/*
+ * Do we have nanoseconds gettimeofday?
+ */
+#if defined(HAVE_GETTIMEOFDAY) || defined(WIN32)
+#define HAVE_GETTIMEOFDAY_NANOSECONDS 1
+#endif
+
+/*
+ * Do we have the capability to report extended socket errors?
+ */
+#if defined(HAVE_LINUX_TYPES_H) && defined(HAVE_LINUX_ERRQUEUE_H) && defined(HAVE_SOCK_EXTENDED_ERR) && defined(HAVE_MSGHDR) && defined(HAVE_CMSGHDR) && defined(CMSG_FIRSTHDR) && defined(CMSG_NXTHDR) && defined(IP_RECVERR) && defined(MSG_ERRQUEUE) && defined(SOL_IP) && defined(HAVE_IOVEC)
+#define EXTENDED_SOCKET_ERROR_CAPABILITY 1
+#else
+#define EXTENDED_SOCKET_ERROR_CAPABILITY 0
+#endif
+
+/*
+ * Does this platform support linux-style IP_PKTINFO
+ * or bsd-style IP_RECVDSTADDR ?
+ */
+#if defined(ENABLE_MULTIHOME) && ((defined(HAVE_IN_PKTINFO)&&defined(IP_PKTINFO)) || defined(IP_RECVDSTADDR)) && defined(HAVE_MSGHDR) && defined(HAVE_CMSGHDR) && defined(HAVE_IOVEC) && defined(CMSG_FIRSTHDR) && defined(CMSG_NXTHDR) && defined(HAVE_RECVMSG) && defined(HAVE_SENDMSG)
+#define ENABLE_IP_PKTINFO 1
+#else
+#define ENABLE_IP_PKTINFO 0
+#endif
+
+/*
+ * Does this platform define SOL_IP
+ * or only bsd-style IPPROTO_IP ?
+ */
+#ifndef SOL_IP
+#define SOL_IP IPPROTO_IP
+#endif
+
+/*
+ * Define type sa_family_t if it isn't defined in the socket headers
+ */
+#ifndef HAVE_SA_FAMILY_T
+typedef unsigned short sa_family_t;
+#endif
+
+/*
+ * Disable ESEC
+ */
+#if 0
+#undef EXTENDED_SOCKET_ERROR_CAPABILITY
+#define EXTENDED_SOCKET_ERROR_CAPABILITY 0
+#endif
+
+/*
+ * Do we have a syslog capability?
+ */
+#if defined(HAVE_OPENLOG) && defined(HAVE_SYSLOG)
+#define SYSLOG_CAPABILITY 1
+#else
+#define SYSLOG_CAPABILITY 0
+#endif
+
+/*
+ * Does this OS draw a distinction between binary and ascii files?
+ */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+/*
+ * Directory separation char
+ */
+#ifdef WIN32
+#define OS_SPECIFIC_DIRSEP '\\'
+#else
+#define OS_SPECIFIC_DIRSEP '/'
+#endif
+
+/*
+ * Define a boolean value based
+ * on Win32 status.
+ */
+#ifdef WIN32
+#define WIN32_0_1 1
+#else
+#define WIN32_0_1 0
+#endif
+
+/*
+ * Our socket descriptor type.
+ */
+#ifdef WIN32
+#define SOCKET_UNDEFINED (INVALID_SOCKET)
+typedef SOCKET socket_descriptor_t;
+#else
+#define SOCKET_UNDEFINED (-1)
+typedef int socket_descriptor_t;
+#endif
+
+static inline int
+socket_defined (const socket_descriptor_t sd)
+{
+ return sd != SOCKET_UNDEFINED;
+}
+
+/*
+ * Should statistics counters be 64 bits?
+ */
+#define USE_64_BIT_COUNTERS
+
+/*
+ * Should we enable the use of execve() for calling subprocesses,
+ * instead of system()?
+ */
+#if defined(HAVE_EXECVE) && defined(HAVE_FORK)
+#define ENABLE_FEATURE_EXECVE
+#endif
+
+/*
+ * Do we have point-to-multipoint capability?
+ */
+
+#if defined(ENABLE_CLIENT_SERVER) && defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) && defined(HAVE_GETTIMEOFDAY_NANOSECONDS)
+#define P2MP 1
+#else
+#define P2MP 0
+#endif
+
+#if P2MP && !defined(ENABLE_CLIENT_ONLY)
+#define P2MP_SERVER 1
+#else
+#define P2MP_SERVER 0
+#endif
+
+/*
+ * HTTPS port sharing capability
+ */
+#if defined(ENABLE_PORT_SHARE) && P2MP_SERVER && defined(SCM_RIGHTS) && defined(HAVE_MSGHDR) && defined(HAVE_CMSGHDR) && defined(HAVE_IOVEC) && defined(CMSG_FIRSTHDR) && defined(CMSG_NXTHDR) && defined(HAVE_RECVMSG) && defined(HAVE_SENDMSG)
+#define PORT_SHARE 1
+#else
+#define PORT_SHARE 0
+#endif
+
+/*
+ * Enable deferred authentication?
+ */
+#if defined(ENABLE_DEF_AUTH) && P2MP_SERVER && defined(ENABLE_PLUGIN)
+#define PLUGIN_DEF_AUTH
+#endif
+#if defined(ENABLE_DEF_AUTH) && P2MP_SERVER && defined(ENABLE_MANAGEMENT)
+#define MANAGEMENT_DEF_AUTH
+#endif
+#if !defined(PLUGIN_DEF_AUTH) && !defined(MANAGEMENT_DEF_AUTH)
+#undef ENABLE_DEF_AUTH
+#endif
+
+/*
+ * Enable external private key
+ */
+#if defined(ENABLE_MANAGEMENT) && defined(ENABLE_SSL)
+#define MANAGMENT_EXTERNAL_KEY
+#endif
+
+/* Enable PolarSSL RNG prediction resistance support */
+#ifdef ENABLE_CRYPTO_POLARSSL
+#define ENABLE_PREDICTION_RESISTANCE
+#endif /* ENABLE_CRYPTO_POLARSSL */
+
+/*
+ * MANAGEMENT_IN_EXTRA allows the management interface to
+ * read multi-line inputs from clients.
+ */
+#if defined(MANAGEMENT_DEF_AUTH) || defined(MANAGMENT_EXTERNAL_KEY)
+#define MANAGEMENT_IN_EXTRA
+#endif
+
+/*
+ * Enable packet filter?
+ */
+#if defined(ENABLE_PF) && P2MP_SERVER && defined(ENABLE_PLUGIN) && defined(HAVE_STAT)
+#define PLUGIN_PF
+#endif
+#if defined(ENABLE_PF) && P2MP_SERVER && defined(MANAGEMENT_DEF_AUTH)
+#define MANAGEMENT_PF
+#endif
+#if !defined(PLUGIN_PF) && !defined(MANAGEMENT_PF)
+#undef ENABLE_PF
+#endif
+
+/*
+ * Do we support Unix domain sockets?
+ */
+#if defined(PF_UNIX) && !defined(WIN32)
+#define UNIX_SOCK_SUPPORT 1
+#else
+#define UNIX_SOCK_SUPPORT 0
+#endif
+
+/*
+ * Should we include OCC (options consistency check) code?
+ */
+#ifndef ENABLE_SMALL
+#define ENABLE_OCC
+#endif
+
+/*
+ * Should we include NTLM proxy functionality
+ */
+#if defined(ENABLE_CRYPTO)
+#define NTLM 1
+#else
+#define NTLM 0
+#endif
+
+/*
+ * Should we include proxy digest auth functionality
+ */
+#if defined(ENABLE_CRYPTO)
+#define PROXY_DIGEST_AUTH 1
+#else
+#define PROXY_DIGEST_AUTH 0
+#endif
+
+/*
+ * Do we have CryptoAPI capability?
+ */
+#if defined(WIN32) && defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) && defined(ENABLE_CRYPTO_OPENSSL)
+#define ENABLE_CRYPTOAPI
+#endif
+
+/*
+ * Enable x509-track feature?
+ */
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL) && defined (ENABLE_CRYPTO_OPENSSL)
+#define ENABLE_X509_TRACK
+#endif
+
+/*
+ * Is poll available on this platform?
+ */
+#if defined(HAVE_POLL) && defined(HAVE_SYS_POLL_H)
+#define POLL 1
+#else
+#define POLL 0
+#endif
+
+/*
+ * Is epoll available on this platform?
+ */
+#if defined(HAVE_EPOLL_CREATE) && defined(HAVE_SYS_EPOLL_H)
+#define EPOLL 1
+#else
+#define EPOLL 0
+#endif
+
+/* Disable EPOLL */
+#if 0
+#undef EPOLL
+#define EPOLL 0
+#endif
+
+/*
+ * Reduce sensitivity to system clock instability
+ * and backtracks.
+ */
+#if defined(HAVE_GETTIMEOFDAY_NANOSECONDS)
+#define TIME_BACKTRACK_PROTECTION 1
+#endif
+
+/*
+ * Enable traffic shaper.
+ */
+#if defined(HAVE_GETTIMEOFDAY_NANOSECONDS)
+#define ENABLE_FEATURE_SHAPER 1
+#endif
+
+/*
+ * Is non-blocking connect() supported?
+ */
+#if defined(HAVE_GETSOCKOPT) && defined(SOL_SOCKET) && defined(SO_ERROR) && defined(EINPROGRESS) && defined(ETIMEDOUT)
+#define CONNECT_NONBLOCK
+#endif
+
+/*
+ * Do we have the capability to support the AUTO_USERID feature?
+ */
+#if defined(ENABLE_AUTO_USERID)
+#define AUTO_USERID 1
+#else
+#define AUTO_USERID 0
+#endif
+
+/*
+ * Do we support challenge/response authentication as client?
+ */
+#if defined(ENABLE_MANAGEMENT)
+#define ENABLE_CLIENT_CR
+#endif
+
+/*
+ * Do we support pushing peer info?
+ */
+#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)
+#define ENABLE_PUSH_PEER_INFO
+#endif
+
+/*
+ * Compression support
+ */
+#if defined(ENABLE_SNAPPY) || defined(ENABLE_LZO) || defined(ENABLE_LZ4) || \
+ defined(ENABLE_COMP_STUB)
+#define USE_COMP
+#endif
+
+/*
+ * Enable --memstats option
+ */
+#ifdef TARGET_LINUX
+#define ENABLE_MEMSTATS
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.c
new file mode 100644
index 00000000..e92edc2f
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.c
@@ -0,0 +1,5624 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Support routines for configuring and accessing TUN/TAP
+ * virtual network adapters.
+ *
+ * This file is based on the TUN/TAP driver interface routines
+ * from VTun by Maxim Krasnyansky <max_mk@yahoo.com>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#include "tun.h"
+#include "fdmisc.h"
+#include "common.h"
+#include "misc.h"
+#include "socket.h"
+#include "manage.h"
+#include "route.h"
+#include "win32.h"
+
+#include "memdbg.h"
+#include <string.h>
+
+#ifdef WIN32
+
+/* #define SIMULATE_DHCP_FAILED */ /* simulate bad DHCP negotiation */
+
+#define NI_TEST_FIRST (1<<0)
+#define NI_IP_NETMASK (1<<1)
+#define NI_OPTIONS (1<<2)
+
+static void netsh_ifconfig (const struct tuntap_options *to,
+ const char *flex_name,
+ const in_addr_t ip,
+ const in_addr_t netmask,
+ const unsigned int flags);
+static void netsh_command (const struct argv *a, int n);
+
+static const char *netsh_get_id (const char *dev_node, struct gc_arena *gc);
+
+#endif
+
+#ifdef TARGET_SOLARIS
+static void solaris_error_close (struct tuntap *tt, const struct env_set *es, const char *actual, bool unplumb_inet6);
+#include <stropts.h>
+#endif
+
+#if defined(TARGET_DARWIN) && HAVE_NET_IF_UTUN_H
+#include <sys/kern_control.h>
+#include <net/if_utun.h>
+#include <sys/sys_domain.h>
+#endif
+
+static void clear_tuntap (struct tuntap *tuntap);
+
+bool
+is_dev_type (const char *dev, const char *dev_type, const char *match_type)
+{
+ ASSERT (match_type);
+ if (!dev)
+ return false;
+ if (dev_type)
+ return !strcmp (dev_type, match_type);
+ else
+ return !strncmp (dev, match_type, strlen (match_type));
+}
+
+int
+dev_type_enum (const char *dev, const char *dev_type)
+{
+ if (is_dev_type (dev, dev_type, "tun"))
+ return DEV_TYPE_TUN;
+ else if (is_dev_type (dev, dev_type, "tap"))
+ return DEV_TYPE_TAP;
+ else if (is_dev_type (dev, dev_type, "null"))
+ return DEV_TYPE_NULL;
+ else
+ return DEV_TYPE_UNDEF;
+}
+
+const char *
+dev_type_string (const char *dev, const char *dev_type)
+{
+ switch (dev_type_enum (dev, dev_type))
+ {
+ case DEV_TYPE_TUN:
+ return "tun";
+ case DEV_TYPE_TAP:
+ return "tap";
+ case DEV_TYPE_NULL:
+ return "null";
+ default:
+ return "[unknown-dev-type]";
+ }
+}
+
+/*
+ * Try to predict the actual TUN/TAP device instance name,
+ * before the device is actually opened.
+ */
+const char *
+guess_tuntap_dev (const char *dev,
+ const char *dev_type,
+ const char *dev_node,
+ struct gc_arena *gc)
+{
+#ifdef WIN32
+ const int dt = dev_type_enum (dev, dev_type);
+ if (dt == DEV_TYPE_TUN || dt == DEV_TYPE_TAP)
+ {
+ return netsh_get_id (dev_node, gc);
+ }
+#endif
+
+ /* default case */
+ return dev;
+}
+
+
+/* --ifconfig-nowarn disables some options sanity checking */
+static const char ifconfig_warn_how_to_silence[] = "(silence this warning with --ifconfig-nowarn)";
+
+/*
+ * If !tun, make sure ifconfig_remote_netmask looks
+ * like a netmask.
+ *
+ * If tun, make sure ifconfig_remote_netmask looks
+ * like an IPv4 address.
+ */
+static void
+ifconfig_sanity_check (bool tun, in_addr_t addr, int topology)
+{
+ struct gc_arena gc = gc_new ();
+ const bool looks_like_netmask = ((addr & 0xFF000000) == 0xFF000000);
+ if (tun)
+ {
+ if (looks_like_netmask && (topology == TOP_NET30 || topology == TOP_P2P))
+ msg (M_WARN, "WARNING: Since you are using --dev tun with a point-to-point topology, the second argument to --ifconfig must be an IP address. You are using something (%s) that looks more like a netmask. %s",
+ print_in_addr_t (addr, 0, &gc),
+ ifconfig_warn_how_to_silence);
+ }
+ else /* tap */
+ {
+ if (!looks_like_netmask)
+ msg (M_WARN, "WARNING: Since you are using --dev tap, the second argument to --ifconfig must be a netmask, for example something like 255.255.255.0. %s",
+ ifconfig_warn_how_to_silence);
+ }
+ gc_free (&gc);
+}
+
+/*
+ * For TAP-style devices, generate a broadcast address.
+ */
+static in_addr_t
+generate_ifconfig_broadcast_addr (in_addr_t local,
+ in_addr_t netmask)
+{
+ return local | ~netmask;
+}
+
+/*
+ * Check that --local and --remote addresses do not
+ * clash with ifconfig addresses or subnet.
+ */
+static void
+check_addr_clash (const char *name,
+ int type,
+ in_addr_t public,
+ in_addr_t local,
+ in_addr_t remote_netmask)
+{
+ struct gc_arena gc = gc_new ();
+#if 0
+ msg (M_INFO, "CHECK_ADDR_CLASH type=%d public=%s local=%s, remote_netmask=%s",
+ type,
+ print_in_addr_t (public, 0, &gc),
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote_netmask, 0, &gc));
+#endif
+
+ if (public)
+ {
+ if (type == DEV_TYPE_TUN)
+ {
+ const in_addr_t test_netmask = 0xFFFFFF00;
+ const in_addr_t public_net = public & test_netmask;
+ const in_addr_t local_net = local & test_netmask;
+ const in_addr_t remote_net = remote_netmask & test_netmask;
+
+ if (public == local || public == remote_netmask)
+ msg (M_WARN,
+ "WARNING: --%s address [%s] conflicts with --ifconfig address pair [%s, %s]. %s",
+ name,
+ print_in_addr_t (public, 0, &gc),
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote_netmask, 0, &gc),
+ ifconfig_warn_how_to_silence);
+
+ if (public_net == local_net || public_net == remote_net)
+ msg (M_WARN,
+ "WARNING: potential conflict between --%s address [%s] and --ifconfig address pair [%s, %s] -- this is a warning only that is triggered when local/remote addresses exist within the same /24 subnet as --ifconfig endpoints. %s",
+ name,
+ print_in_addr_t (public, 0, &gc),
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote_netmask, 0, &gc),
+ ifconfig_warn_how_to_silence);
+ }
+ else if (type == DEV_TYPE_TAP)
+ {
+ const in_addr_t public_network = public & remote_netmask;
+ const in_addr_t virtual_network = local & remote_netmask;
+ if (public_network == virtual_network)
+ msg (M_WARN,
+ "WARNING: --%s address [%s] conflicts with --ifconfig subnet [%s, %s] -- local and remote addresses cannot be inside of the --ifconfig subnet. %s",
+ name,
+ print_in_addr_t (public, 0, &gc),
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote_netmask, 0, &gc),
+ ifconfig_warn_how_to_silence);
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Issue a warning if ip/netmask (on the virtual IP network) conflicts with
+ * the settings on the local LAN. This is designed to flag issues where
+ * (for example) the OpenVPN server LAN is running on 192.168.1.x, but then
+ * an OpenVPN client tries to connect from a public location that is also running
+ * off of a router set to 192.168.1.x.
+ */
+void
+check_subnet_conflict (const in_addr_t ip,
+ const in_addr_t netmask,
+ const char *prefix)
+{
+#if 0 /* too many false positives */
+ struct gc_arena gc = gc_new ();
+ in_addr_t lan_gw = 0;
+ in_addr_t lan_netmask = 0;
+
+ if (get_default_gateway (&lan_gw, &lan_netmask) && lan_netmask)
+ {
+ const in_addr_t lan_network = lan_gw & lan_netmask;
+ const in_addr_t network = ip & netmask;
+
+ /* do the two subnets defined by network/netmask and lan_network/lan_netmask intersect? */
+ if ((network & lan_netmask) == lan_network
+ || (lan_network & netmask) == network)
+ {
+ msg (M_WARN, "WARNING: potential %s subnet conflict between local LAN [%s/%s] and remote VPN [%s/%s]",
+ prefix,
+ print_in_addr_t (lan_network, 0, &gc),
+ print_in_addr_t (lan_netmask, 0, &gc),
+ print_in_addr_t (network, 0, &gc),
+ print_in_addr_t (netmask, 0, &gc));
+ }
+ }
+ gc_free (&gc);
+#endif
+}
+
+void
+warn_on_use_of_common_subnets (void)
+{
+ struct gc_arena gc = gc_new ();
+ struct route_gateway_info rgi;
+ const int needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
+
+ get_default_gateway (&rgi);
+ if ((rgi.flags & needed) == needed)
+ {
+ const in_addr_t lan_network = rgi.gateway.addr & rgi.gateway.netmask;
+ if (lan_network == 0xC0A80000 || lan_network == 0xC0A80100)
+ msg (M_WARN, "NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.");
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Return a string to be used for options compatibility check
+ * between peers.
+ */
+const char *
+ifconfig_options_string (const struct tuntap* tt, bool remote, bool disable, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ if (tt->did_ifconfig_setup && !disable)
+ {
+ if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
+ {
+ buf_printf (&out, "%s %s",
+ print_in_addr_t (tt->local & tt->remote_netmask, 0, gc),
+ print_in_addr_t (tt->remote_netmask, 0, gc));
+ }
+ else if (tt->type == DEV_TYPE_TUN)
+ {
+ const char *l, *r;
+ if (remote)
+ {
+ r = print_in_addr_t (tt->local, 0, gc);
+ l = print_in_addr_t (tt->remote_netmask, 0, gc);
+ }
+ else
+ {
+ l = print_in_addr_t (tt->local, 0, gc);
+ r = print_in_addr_t (tt->remote_netmask, 0, gc);
+ }
+ buf_printf (&out, "%s %s", r, l);
+ }
+ else
+ buf_printf (&out, "[undef]");
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Return a status string describing wait state.
+ */
+const char *
+tun_stat (const struct tuntap *tt, unsigned int rwflags, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (64, gc);
+ if (tt)
+ {
+ if (rwflags & EVENT_READ)
+ {
+ buf_printf (&out, "T%s",
+ (tt->rwflags_debug & EVENT_READ) ? "R" : "r");
+#ifdef WIN32
+ buf_printf (&out, "%s",
+ overlapped_io_state_ascii (&tt->reads));
+#endif
+ }
+ if (rwflags & EVENT_WRITE)
+ {
+ buf_printf (&out, "T%s",
+ (tt->rwflags_debug & EVENT_WRITE) ? "W" : "w");
+#ifdef WIN32
+ buf_printf (&out, "%s",
+ overlapped_io_state_ascii (&tt->writes));
+#endif
+ }
+ }
+ else
+ {
+ buf_printf (&out, "T?");
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Return true for point-to-point topology, false for subnet topology
+ */
+bool
+is_tun_p2p (const struct tuntap *tt)
+{
+ bool tun = false;
+
+ if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
+ tun = false;
+ else if (tt->type == DEV_TYPE_TUN)
+ tun = true;
+ else
+ msg (M_FATAL, "Error: problem with tun vs. tap setting"); /* JYFIXME -- needs to be caught earlier, in init_tun? */
+
+ return tun;
+}
+
+/*
+ * Init tun/tap object.
+ *
+ * Set up tuntap structure for ifconfig,
+ * but don't execute yet.
+ */
+struct tuntap *
+init_tun (const char *dev, /* --dev option */
+ const char *dev_type, /* --dev-type option */
+ int topology, /* one of the TOP_x values */
+ const char *ifconfig_local_parm, /* --ifconfig parm 1 */
+ const char *ifconfig_remote_netmask_parm, /* --ifconfig parm 2 */
+ const char *ifconfig_ipv6_local_parm, /* --ifconfig parm 1 IPv6 */
+ int ifconfig_ipv6_netbits_parm,
+ const char *ifconfig_ipv6_remote_parm, /* --ifconfig parm 2 IPv6 */
+ struct addrinfo *local_public,
+ struct addrinfo *remote_public,
+ const bool strict_warn,
+ struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+ struct tuntap *tt;
+
+ ALLOC_OBJ (tt, struct tuntap);
+ clear_tuntap (tt);
+
+ tt->type = dev_type_enum (dev, dev_type);
+ tt->topology = topology;
+
+ if (ifconfig_local_parm && ifconfig_remote_netmask_parm)
+ {
+ bool tun = false;
+ const char *ifconfig_local = NULL;
+ const char *ifconfig_remote_netmask = NULL;
+ const char *ifconfig_broadcast = NULL;
+
+ /*
+ * We only handle TUN/TAP devices here, not --dev null devices.
+ */
+ tun = is_tun_p2p (tt);
+
+ /*
+ * Convert arguments to binary IPv4 addresses.
+ */
+
+ tt->local = getaddr (
+ GETADDR_RESOLVE
+ | GETADDR_HOST_ORDER
+ | GETADDR_FATAL_ON_SIGNAL
+ | GETADDR_FATAL,
+ ifconfig_local_parm,
+ 0,
+ NULL,
+ NULL);
+
+ tt->remote_netmask = getaddr (
+ (tun ? GETADDR_RESOLVE : 0)
+ | GETADDR_HOST_ORDER
+ | GETADDR_FATAL_ON_SIGNAL
+ | GETADDR_FATAL,
+ ifconfig_remote_netmask_parm,
+ 0,
+ NULL,
+ NULL);
+
+ /*
+ * Look for common errors in --ifconfig parms
+ */
+ if (strict_warn)
+ {
+ struct addrinfo *curele;
+ ifconfig_sanity_check (tt->type == DEV_TYPE_TUN, tt->remote_netmask, tt->topology);
+
+ /*
+ * If local_public or remote_public addresses are defined,
+ * make sure they do not clash with our virtual subnet.
+ */
+
+ for(curele=local_public;curele;curele=curele->ai_next) {
+ if(curele->ai_family == AF_INET)
+ check_addr_clash ("local",
+ tt->type,
+ ((struct sockaddr_in*)curele->ai_addr)->sin_addr.s_addr,
+ tt->local,
+ tt->remote_netmask);
+ }
+
+ for (curele=remote_public;curele;curele=curele->ai_next) {
+ if (curele->ai_family == AF_INET)
+ check_addr_clash ("remote",
+ tt->type,
+ ((struct sockaddr_in*)curele->ai_addr)->sin_addr.s_addr,
+ tt->local,
+ tt->remote_netmask);
+ }
+
+ if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
+ check_subnet_conflict (tt->local, tt->remote_netmask, "TUN/TAP adapter");
+ else if (tt->type == DEV_TYPE_TUN)
+ check_subnet_conflict (tt->local, IPV4_NETMASK_HOST, "TUN/TAP adapter");
+ }
+
+ /*
+ * Set ifconfig parameters
+ */
+ ifconfig_local = print_in_addr_t (tt->local, 0, &gc);
+ ifconfig_remote_netmask = print_in_addr_t (tt->remote_netmask, 0, &gc);
+
+ /*
+ * If TAP-style interface, generate broadcast address.
+ */
+ if (!tun)
+ {
+ tt->broadcast = generate_ifconfig_broadcast_addr (tt->local, tt->remote_netmask);
+ ifconfig_broadcast = print_in_addr_t (tt->broadcast, 0, &gc);
+ }
+
+ /*
+ * Set environmental variables with ifconfig parameters.
+ */
+ if (es)
+ {
+ setenv_str (es, "ifconfig_local", ifconfig_local);
+ if (tun)
+ {
+ setenv_str (es, "ifconfig_remote", ifconfig_remote_netmask);
+ }
+ else
+ {
+ setenv_str (es, "ifconfig_netmask", ifconfig_remote_netmask);
+ setenv_str (es, "ifconfig_broadcast", ifconfig_broadcast);
+ }
+ }
+
+ tt->did_ifconfig_setup = true;
+ }
+
+ if (ifconfig_ipv6_local_parm && ifconfig_ipv6_remote_parm)
+ {
+ const char *ifconfig_ipv6_local = NULL;
+ const char *ifconfig_ipv6_remote = NULL;
+
+ /*
+ * Convert arguments to binary IPv6 addresses.
+ */
+
+ if ( inet_pton( AF_INET6, ifconfig_ipv6_local_parm, &tt->local_ipv6 ) != 1 ||
+ inet_pton( AF_INET6, ifconfig_ipv6_remote_parm, &tt->remote_ipv6 ) != 1 )
+ {
+ msg( M_FATAL, "init_tun: problem converting IPv6 ifconfig addresses %s and %s to binary", ifconfig_ipv6_local_parm, ifconfig_ipv6_remote_parm );
+ }
+ tt->netbits_ipv6 = ifconfig_ipv6_netbits_parm;
+
+ /*
+ * Set ifconfig parameters
+ */
+ ifconfig_ipv6_local = print_in6_addr (tt->local_ipv6, 0, &gc);
+ ifconfig_ipv6_remote = print_in6_addr (tt->remote_ipv6, 0, &gc);
+
+ /*
+ * Set environmental variables with ifconfig parameters.
+ */
+ if (es)
+ {
+ setenv_str (es, "ifconfig_ipv6_local", ifconfig_ipv6_local);
+ setenv_int (es, "ifconfig_ipv6_netbits", tt->netbits_ipv6);
+ setenv_str (es, "ifconfig_ipv6_remote", ifconfig_ipv6_remote);
+ }
+ tt->did_ifconfig_ipv6_setup = true;
+ }
+
+ gc_free (&gc);
+ return tt;
+}
+
+/*
+ * Platform specific tun initializations
+ */
+void
+init_tun_post (struct tuntap *tt,
+ const struct frame *frame,
+ const struct tuntap_options *options)
+{
+ tt->options = *options;
+#ifdef WIN32
+ overlapped_io_init (&tt->reads, frame, FALSE, true);
+ overlapped_io_init (&tt->writes, frame, TRUE, true);
+ tt->rw_handle.read = tt->reads.overlapped.hEvent;
+ tt->rw_handle.write = tt->writes.overlapped.hEvent;
+ tt->adapter_index = TUN_ADAPTER_INDEX_INVALID;
+#endif
+}
+
+#if defined(WIN32) || \
+ defined(TARGET_DARWIN) || defined(TARGET_NETBSD) || defined(TARGET_OPENBSD)
+
+/* some of the platforms will auto-add a "network route" pointing
+ * to the interface on "ifconfig tunX 2001:db8::1/64", others need
+ * an extra call to "route add..."
+ * -> helper function to simplify code below
+ */
+void add_route_connected_v6_net(struct tuntap * tt,
+ const struct env_set *es)
+{
+ struct route_ipv6 r6;
+
+ r6.defined = true;
+ r6.network = tt->local_ipv6;
+ r6.netbits = tt->netbits_ipv6;
+ r6.gateway = tt->local_ipv6;
+ r6.metric = 0; /* connected route */
+ r6.metric_defined = true;
+ add_route_ipv6 (&r6, tt, 0, es);
+}
+
+void delete_route_connected_v6_net(struct tuntap * tt,
+ const struct env_set *es)
+{
+ struct route_ipv6 r6;
+
+ r6.defined = true;
+ r6.network = tt->local_ipv6;
+ r6.netbits = tt->netbits_ipv6;
+ r6.gateway = tt->local_ipv6;
+ r6.metric = 0; /* connected route */
+ r6.metric_defined = true;
+ delete_route_ipv6 (&r6, tt, 0, es);
+}
+#endif
+
+
+/* execute the ifconfig command through the shell */
+void
+do_ifconfig (struct tuntap *tt,
+ const char *actual, /* actual device name */
+ int tun_mtu,
+ const struct env_set *es)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (tt->did_ifconfig_setup)
+ {
+ bool tun = false;
+ const char *ifconfig_local = NULL;
+ const char *ifconfig_remote_netmask = NULL;
+ const char *ifconfig_broadcast = NULL;
+ const char *ifconfig_ipv6_local = NULL;
+ const char *ifconfig_ipv6_remote = NULL;
+ bool do_ipv6 = false;
+ struct argv argv;
+
+ argv_init (&argv);
+
+ msg( M_INFO, "do_ifconfig, tt->ipv6=%d, tt->did_ifconfig_ipv6_setup=%d",
+ tt->ipv6, tt->did_ifconfig_ipv6_setup );
+
+ /*
+ * We only handle TUN/TAP devices here, not --dev null devices.
+ */
+ tun = is_tun_p2p (tt);
+
+ /*
+ * Set ifconfig parameters
+ */
+ ifconfig_local = print_in_addr_t (tt->local, 0, &gc);
+ ifconfig_remote_netmask = print_in_addr_t (tt->remote_netmask, 0, &gc);
+
+ if ( tt->ipv6 && tt->did_ifconfig_ipv6_setup )
+ {
+ ifconfig_ipv6_local = print_in6_addr (tt->local_ipv6, 0, &gc);
+ ifconfig_ipv6_remote = print_in6_addr (tt->remote_ipv6, 0, &gc);
+ do_ipv6 = true;
+ }
+
+ /*
+ * If TAP-style device, generate broadcast address.
+ */
+ if (!tun)
+ ifconfig_broadcast = print_in_addr_t (tt->broadcast, 0, &gc);
+
+#ifdef ENABLE_MANAGEMENT
+ if (management)
+ {
+ management_set_state (management,
+ OPENVPN_STATE_ASSIGN_IP,
+ NULL,
+ tt->local,
+ 0);
+ }
+#endif
+
+
+#if defined(TARGET_LINUX)
+#ifdef ENABLE_IPROUTE
+ /*
+ * Set the MTU for the device
+ */
+ argv_printf (&argv,
+ "%s link set dev %s up mtu %d",
+ iproute_path,
+ actual,
+ tun_mtu
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ip link set failed");
+
+ if (tun) {
+
+ /*
+ * Set the address for the device
+ */
+ argv_printf (&argv,
+ "%s addr add dev %s local %s peer %s",
+ iproute_path,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ip addr add failed");
+ } else {
+ argv_printf (&argv,
+ "%s addr add dev %s %s/%d broadcast %s",
+ iproute_path,
+ actual,
+ ifconfig_local,
+ count_netmask_bits(ifconfig_remote_netmask),
+ ifconfig_broadcast
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ip addr add failed");
+ }
+ if ( do_ipv6 )
+ {
+ argv_printf( &argv,
+ "%s -6 addr add %s/%d dev %s",
+ iproute_path,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6,
+ actual
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ip -6 addr add failed");
+ }
+ tt->did_ifconfig = true;
+#else
+ if (tun)
+ argv_printf (&argv,
+ "%s %s %s pointopoint %s mtu %d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d broadcast %s",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu,
+ ifconfig_broadcast
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ifconfig failed");
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s add %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Linux ifconfig inet6 failed");
+ }
+ tt->did_ifconfig = true;
+
+#endif /*ENABLE_IPROUTE*/
+#elif defined(TARGET_ANDROID)
+
+ if (do_ipv6) {
+ struct buffer out6 = alloc_buf_gc (64, &gc);
+ buf_printf (&out6, "%s/%d", ifconfig_ipv6_local,tt->netbits_ipv6);
+ management_android_control(management, "IFCONFIG6",buf_bptr(&out6));
+ }
+
+ struct buffer out = alloc_buf_gc (64, &gc);
+
+ char* top;
+ switch(tt->topology) {
+ case TOP_NET30:
+ top="net30";
+ break;
+ case TOP_P2P:
+ top="p2p";
+ break;
+ case TOP_SUBNET:
+ top="subnet";
+ break;
+ default:
+ top="undef";
+ }
+
+ buf_printf (&out, "%s %s %d %s", ifconfig_local, ifconfig_remote_netmask, tun_mtu, top);
+ management_android_control (management, "IFCONFIG", buf_bptr(&out));
+
+#elif defined(TARGET_SOLARIS)
+
+ /* Solaris 2.6 (and 7?) cannot set all parameters in one go...
+ * example:
+ * ifconfig tun2 10.2.0.2 10.2.0.1 mtu 1450 up
+ * ifconfig tun2 netmask 255.255.255.255
+ */
+ if (tun)
+ {
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+
+ argv_msg (M_INFO, &argv);
+ if (!openvpn_execve_check (&argv, es, 0, "Solaris ifconfig phase-1 failed"))
+ solaris_error_close (tt, es, actual, false);
+
+ argv_printf (&argv,
+ "%s %s netmask 255.255.255.255",
+ IFCONFIG_PATH,
+ actual
+ );
+ }
+ else
+ if (tt->topology == TOP_SUBNET)
+ {
+ argv_printf (&argv,
+ "%s %s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ }
+ else
+ argv_printf (&argv,
+ " %s %s %s netmask %s broadcast + up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask
+ );
+
+ argv_msg (M_INFO, &argv);
+ if (!openvpn_execve_check (&argv, es, 0, "Solaris ifconfig phase-2 failed"))
+ solaris_error_close (tt, es, actual, false);
+
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv, "%s %s inet6 unplumb",
+ IFCONFIG_PATH, actual );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, 0, NULL);
+
+ if ( tt->type == DEV_TYPE_TUN )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 plumb %s/%d %s up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6,
+ ifconfig_ipv6_remote
+ );
+ }
+ else /* tap mode */
+ {
+ /* base IPv6 tap interface needs to be brought up first
+ */
+ argv_printf (&argv, "%s %s inet6 plumb up",
+ IFCONFIG_PATH, actual );
+ argv_msg (M_INFO, &argv);
+ if (!openvpn_execve_check (&argv, es, 0, "Solaris ifconfig IPv6 (prepare) failed"))
+ solaris_error_close (tt, es, actual, true);
+
+ /* we might need to do "ifconfig %s inet6 auto-dhcp drop"
+ * after the system has noticed the interface and fired up
+ * the DHCPv6 client - but this takes quite a while, and the
+ * server will ignore the DHCPv6 packets anyway. So we don't.
+ */
+
+ /* static IPv6 addresses need to go to a subinterface (tap0:1)
+ */
+ argv_printf (&argv,
+ "%s %s inet6 addif %s/%d up",
+ IFCONFIG_PATH, actual,
+ ifconfig_ipv6_local, tt->netbits_ipv6 );
+ }
+ argv_msg (M_INFO, &argv);
+ if (!openvpn_execve_check (&argv, es, 0, "Solaris ifconfig IPv6 failed"))
+ solaris_error_close (tt, es, actual, true);
+ }
+
+ if (!tun && tt->topology == TOP_SUBNET)
+ {
+ /* Add a network route for the local tun interface */
+ struct route_ipv4 r;
+ CLEAR (r);
+ r.flags = RT_DEFINED | RT_METRIC_DEFINED;
+ r.network = tt->local & tt->remote_netmask;
+ r.netmask = tt->remote_netmask;
+ r.gateway = tt->local;
+ r.metric = 0;
+ add_route (&r, tt, 0, NULL, es);
+ }
+
+ tt->did_ifconfig = true;
+
+#elif defined(TARGET_OPENBSD)
+
+ /*
+ * On OpenBSD, tun interfaces are persistent if created with
+ * "ifconfig tunX create", and auto-destroyed if created by
+ * opening "/dev/tunX" (so we just use the /dev/tunX)
+ */
+
+ /* example: ifconfig tun2 10.2.0.2 10.2.0.1 mtu 1450 netmask 255.255.255.255 up */
+ if (tun)
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask 255.255.255.255 up -link0",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else
+ if ( tt->topology == TOP_SUBNET )
+ {
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask %s up -link0",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_local,
+ tun_mtu,
+ ifconfig_remote_netmask
+ );
+ }
+ else
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d broadcast %s link0",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu,
+ ifconfig_broadcast
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "OpenBSD ifconfig failed");
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "OpenBSD ifconfig inet6 failed");
+
+ /* and, hooray, we explicitely need to add a route... */
+ add_route_connected_v6_net(tt, es);
+ }
+ tt->did_ifconfig = true;
+
+#elif defined(TARGET_NETBSD)
+
+/* whether or not NetBSD can do IPv6 can be seen by the availability of
+ * the TUNSIFHEAD ioctl() - see next TARGET_NETBSD block for more details
+ */
+#ifdef TUNSIFHEAD
+# define NETBSD_MULTI_AF
+#endif
+
+ if (tun)
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask 255.255.255.255 up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else
+ if ( tt->topology == TOP_SUBNET )
+ {
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask %s up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_local,
+ tun_mtu,
+ ifconfig_remote_netmask
+ );
+ }
+ else
+ /*
+ * NetBSD has distinct tun and tap devices
+ * so we don't need the "link0" extra parameter to specify we want to do
+ * tunneling at the ethernet level
+ */
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d broadcast %s",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu,
+ ifconfig_broadcast
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "NetBSD ifconfig failed");
+
+ if ( do_ipv6 )
+ {
+#ifdef NETBSD_MULTI_AF
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "NetBSD ifconfig inet6 failed");
+
+ /* and, hooray, we explicitely need to add a route... */
+ add_route_connected_v6_net(tt, es);
+#else
+ msg( M_INFO, "no IPv6 support for tun interfaces on NetBSD before 4.0 (if your system is newer, recompile openvpn)" );
+ tt->ipv6 = false;
+#endif
+ }
+ tt->did_ifconfig = true;
+
+#elif defined(TARGET_DARWIN)
+ /*
+ * Darwin (i.e. Mac OS X) seems to exhibit similar behaviour to OpenBSD...
+ */
+
+ argv_printf (&argv,
+ "%s %s delete",
+ IFCONFIG_PATH,
+ actual);
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, 0, NULL);
+ msg (M_INFO, "NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure");
+
+
+ /* example: ifconfig tun2 10.2.0.2 10.2.0.1 mtu 1450 netmask 255.255.255.255 up */
+ if (tun)
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask 255.255.255.255 up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else
+ {
+ if (tt->topology == TOP_SUBNET)
+ argv_printf (&argv,
+ "%s %s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ }
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "Mac OS X ifconfig failed");
+ tt->did_ifconfig = true;
+
+ /* Add a network route for the local tun interface */
+ if (!tun && tt->topology == TOP_SUBNET)
+ {
+ struct route_ipv4 r;
+ CLEAR (r);
+ r.flags = RT_DEFINED;
+ r.network = tt->local & tt->remote_netmask;
+ r.netmask = tt->remote_netmask;
+ r.gateway = tt->local;
+ add_route (&r, tt, 0, NULL, es);
+ }
+
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "MacOS X ifconfig inet6 failed");
+
+ /* and, hooray, we explicitely need to add a route... */
+ add_route_connected_v6_net(tt, es);
+ }
+
+#elif defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY)
+
+ /* example: ifconfig tun2 10.2.0.2 10.2.0.1 mtu 1450 netmask 255.255.255.255 up */
+ if (tun)
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask 255.255.255.255 up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+ else if ( tt->topology == TOP_SUBNET )
+ {
+ argv_printf (&argv,
+ "%s %s %s %s mtu %d netmask %s up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_local,
+ tun_mtu,
+ ifconfig_remote_netmask
+ );
+ }
+ else
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "FreeBSD ifconfig failed");
+ tt->did_ifconfig = true;
+
+ /* Add a network route for the local tun interface */
+ if (!tun && tt->topology == TOP_SUBNET)
+ {
+ struct route_ipv4 r;
+ CLEAR (r);
+ r.flags = RT_DEFINED;
+ r.network = tt->local & tt->remote_netmask;
+ r.netmask = tt->remote_netmask;
+ r.gateway = tt->local;
+ add_route (&r, tt, 0, NULL, es);
+ }
+
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, S_FATAL, "FreeBSD ifconfig inet6 failed");
+ }
+
+#elif defined(TARGET_AIX)
+ {
+ /* AIX ifconfig will complain if it can't find ODM path in env */
+ struct env_set *aix_es = env_set_create (NULL);
+ env_set_add( aix_es, "ODMDIR=/etc/objrepos" );
+
+ if (tun)
+ msg(M_FATAL, "no tun support on AIX (canthappen)");
+
+ /* example: ifconfig tap0 172.30.1.1 netmask 255.255.254.0 up */
+ argv_printf (&argv,
+ "%s %s %s netmask %s mtu %d up",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_local,
+ ifconfig_remote_netmask,
+ tun_mtu
+ );
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, aix_es, S_FATAL, "AIX ifconfig failed");
+ tt->did_ifconfig = true;
+
+ if ( do_ipv6 )
+ {
+ argv_printf (&argv,
+ "%s %s inet6 %s/%d",
+ IFCONFIG_PATH,
+ actual,
+ ifconfig_ipv6_local,
+ tt->netbits_ipv6
+ );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, aix_es, S_FATAL, "AIX ifconfig inet6 failed");
+ }
+ env_set_destroy (aix_es);
+ }
+#elif defined (WIN32)
+ {
+ /*
+ * Make sure that both ifconfig addresses are part of the
+ * same .252 subnet.
+ */
+ if (tun)
+ {
+ verify_255_255_255_252 (tt->local, tt->remote_netmask);
+ tt->adapter_netmask = ~3;
+ }
+ else
+ {
+ tt->adapter_netmask = tt->remote_netmask;
+ }
+
+ switch (tt->options.ip_win32_type)
+ {
+ case IPW32_SET_MANUAL:
+ msg (M_INFO, "******** NOTE: Please manually set the IP/netmask of '%s' to %s/%s (if it is not already set)",
+ actual,
+ ifconfig_local,
+ print_in_addr_t (tt->adapter_netmask, 0, &gc));
+ break;
+ case IPW32_SET_NETSH:
+ if (!strcmp (actual, "NULL"))
+ msg (M_FATAL, "Error: When using --ip-win32 netsh, if you have more than one TAP-Windows adapter, you must also specify --dev-node");
+
+ netsh_ifconfig (&tt->options,
+ actual,
+ tt->local,
+ tt->adapter_netmask,
+ NI_IP_NETMASK|NI_OPTIONS);
+
+ break;
+ }
+ tt->did_ifconfig = true;
+ }
+
+ /* IPv6 always uses "netsh" interface */
+ if ( do_ipv6 )
+ {
+ char * saved_actual;
+
+ if (!strcmp (actual, "NULL"))
+ msg (M_FATAL, "Error: When using --tun-ipv6, if you have more than one TAP-Windows adapter, you must also specify --dev-node");
+
+ /* example: netsh interface ipv6 set address MyTap 2001:608:8003::d store=active */
+ argv_printf (&argv,
+ "%s%sc interface ipv6 set address %s %s store=active",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ actual,
+ ifconfig_ipv6_local );
+
+ netsh_command (&argv, 4);
+
+ /* explicit route needed */
+ /* on windows, OpenVPN does ifconfig first, open_tun later, so
+ * tt->actual_name might not yet be initialized, but routing code
+ * needs to know interface name - point to "actual", restore later
+ */
+ saved_actual = tt->actual_name;
+ tt->actual_name = (char*) actual;
+ add_route_connected_v6_net(tt, es);
+ tt->actual_name = saved_actual;
+ }
+#else
+ msg (M_FATAL, "Sorry, but I don't know how to do 'ifconfig' commands on this operating system. You should ifconfig your TUN/TAP device manually or use an --up script.");
+#endif
+ argv_reset (&argv);
+ }
+ gc_free (&gc);
+}
+
+static void
+clear_tuntap (struct tuntap *tuntap)
+{
+ CLEAR (*tuntap);
+#ifdef WIN32
+ tuntap->hand = NULL;
+#else
+ tuntap->fd = -1;
+#endif
+#ifdef TARGET_SOLARIS
+ tuntap->ip_fd = -1;
+#endif
+ tuntap->ipv6 = false;
+}
+
+static void
+open_null (struct tuntap *tt)
+{
+ tt->actual_name = string_alloc ("null", NULL);
+}
+
+
+#if defined (TARGET_OPENBSD) || (defined(TARGET_DARWIN) && HAVE_NET_IF_UTUN_H)
+
+/*
+ * OpenBSD and Mac OS X when using utun
+ * have a slightly incompatible TUN device from
+ * the rest of the world, in that it prepends a
+ * uint32 to the beginning of the IP header
+ * to designate the protocol (why not just
+ * look at the version field in the IP header to
+ * determine v4 or v6?).
+ *
+ * We strip off this field on reads and
+ * put it back on writes.
+ *
+ * I have not tested TAP devices on OpenBSD,
+ * but I have conditionalized the special
+ * TUN handling code described above to
+ * go away for TAP devices.
+ */
+
+#include <netinet/ip.h>
+#include <sys/uio.h>
+
+static inline int
+header_modify_read_write_return (int len)
+{
+ if (len > 0)
+ return len > sizeof (u_int32_t) ? len - sizeof (u_int32_t) : 0;
+ else
+ return len;
+}
+
+int
+write_tun_header (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+ struct ip *iph;
+
+ iph = (struct ip *) buf;
+
+ if (tt->ipv6 && iph->ip_v == 6)
+ type = htonl (AF_INET6);
+ else
+ type = htonl (AF_INET);
+
+ iv[0].iov_base = &type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return header_modify_read_write_return (writev (tt->fd, iv, 2));
+ }
+ else
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun_header (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+
+ iv[0].iov_base = &type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return header_modify_read_write_return (readv (tt->fd, iv, 2));
+ }
+ else
+ return read (tt->fd, buf, len);
+}
+#endif
+
+
+#ifndef WIN32
+static void
+open_tun_generic (const char *dev, const char *dev_type, const char *dev_node,
+ bool ipv6_explicitly_supported, bool dynamic,
+ struct tuntap *tt)
+{
+ char tunname[256];
+ char dynamic_name[256];
+ bool dynamic_opened = false;
+
+
+ if ( tt->ipv6 && ! ipv6_explicitly_supported )
+ msg (M_WARN, "NOTE: explicit support for IPv6 tun devices is not provided for this OS");
+
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ }
+ else
+ {
+ /*
+ * --dev-node specified, so open an explicit device node
+ */
+ if (dev_node)
+ {
+ openvpn_snprintf (tunname, sizeof (tunname), "%s", dev_node);
+ }
+ else
+ {
+ /*
+ * dynamic open is indicated by --dev specified without
+ * explicit unit number. Try opening /dev/[dev]n
+ * where n = [0, 255].
+ */
+#ifdef TARGET_NETBSD
+ /* on NetBSD, tap (but not tun) devices are opened by
+ * opening /dev/tap and then querying the system about the
+ * actual device name (tap0, tap1, ...) assigned
+ */
+ if ( dynamic && strcmp( dev, "tap" ) == 0 )
+ {
+ struct ifreq ifr;
+ if ((tt->fd = open ( "/dev/tap", O_RDWR)) < 0)
+ {
+ msg (M_FATAL, "Cannot allocate NetBSD TAP dev dynamically");
+ }
+ if ( ioctl( tt->fd, TAPGIFNAME, (void*)&ifr ) < 0 )
+ {
+ msg (M_FATAL, "Cannot query NetBSD TAP device name");
+ }
+ CLEAR(dynamic_name);
+ strncpy( dynamic_name, ifr.ifr_name, sizeof(dynamic_name)-1 );
+ dynamic_opened = true;
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/%s", dynamic_name );
+ }
+ else
+#endif
+
+ if (dynamic && !has_digit((unsigned char *)dev))
+ {
+ int i;
+ for (i = 0; i < 256; ++i)
+ {
+ openvpn_snprintf (tunname, sizeof (tunname),
+ "/dev/%s%d", dev, i);
+ openvpn_snprintf (dynamic_name, sizeof (dynamic_name),
+ "%s%d", dev, i);
+ if ((tt->fd = open (tunname, O_RDWR)) > 0)
+ {
+ dynamic_opened = true;
+ break;
+ }
+ msg (D_READ_WRITE | M_ERRNO, "Tried opening %s (failed)", tunname);
+ }
+ if (!dynamic_opened)
+ msg (M_FATAL, "Cannot allocate TUN/TAP dev dynamically");
+ }
+ /*
+ * explicit unit number specified
+ */
+ else
+ {
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/%s", dev);
+ }
+ }
+
+ if (!dynamic_opened)
+ {
+ /* has named device existed before? if so, don't destroy at end */
+ if ( if_nametoindex( dev ) > 0 )
+ {
+ msg (M_INFO, "TUN/TAP device %s exists previously, keep at program end", dev );
+ tt->persistent_if = true;
+ }
+
+ if ((tt->fd = open (tunname, O_RDWR)) < 0)
+ msg (M_ERR, "Cannot open TUN/TAP dev %s", tunname);
+ }
+
+ set_nonblock (tt->fd);
+ set_cloexec (tt->fd); /* don't pass fd to scripts */
+ msg (M_INFO, "TUN/TAP device %s opened", tunname);
+
+ /* tt->actual_name is passed to up and down scripts and used as the ifconfig dev name */
+ tt->actual_name = string_alloc (dynamic_opened ? dynamic_name : dev, NULL);
+ }
+}
+
+static void
+close_tun_generic (struct tuntap *tt)
+{
+ if (tt->fd >= 0)
+ close (tt->fd);
+ if (tt->actual_name)
+ free (tt->actual_name);
+ clear_tuntap (tt);
+}
+
+#endif
+
+#if defined (TARGET_ANDROID)
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+#define ANDROID_TUNNAME "vpnservice-tun"
+ int i;
+ struct user_pass up;
+ struct gc_arena gc = gc_new ();
+ bool opentun;
+
+ int oldtunfd = tt->fd;
+
+ for (i = 0; i < tt->options.dns_len; ++i) {
+ management_android_control (management, "DNSSERVER",
+ print_in_addr_t(tt->options.dns[i], 0, &gc));
+ }
+
+ if(tt->options.domain)
+ management_android_control (management, "DNSDOMAIN", tt->options.domain);
+
+ int android_method = managment_android_persisttun_action (management);
+
+ /* Android 4.4 workaround */
+ if (oldtunfd >=0 && android_method == ANDROID_OPEN_AFTER_CLOSE)
+ {
+ close(oldtunfd);
+ openvpn_sleep(2);
+ }
+
+ if (oldtunfd >=0 && android_method == ANDROID_KEEP_OLD_TUN) {
+ /* keep the old fd */
+ opentun = true;
+ } else {
+ opentun = management_android_control (management, "OPENTUN", dev);
+ /* Pick up the fd from management interface after calling the
+ * OPENTUN command */
+ tt->fd = management->connection.lastfdreceived;
+ management->connection.lastfdreceived=-1;
+ }
+
+ if (oldtunfd>=0 && android_method == ANDROID_OPEN_BEFORE_CLOSE)
+ close(oldtunfd);
+
+ /* Set the actual name to a dummy name */
+ tt->actual_name = string_alloc (ANDROID_TUNNAME, NULL);
+
+ if ((tt->fd < 0) || !opentun)
+ msg (M_ERR, "ERROR: Cannot open TUN");
+
+ gc_free (&gc);
+}
+
+void
+close_tun (struct tuntap *tt)
+{
+ if (tt)
+ {
+ close_tun_generic (tt);
+ free (tt);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(TARGET_LINUX)
+#ifdef HAVE_LINUX_IF_TUN_H /* New driver support */
+
+#ifndef HAVE_LINUX_SOCKIOS_H
+#error header file linux/sockios.h required
+#endif
+
+#if !PEDANTIC
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ struct ifreq ifr;
+
+ /*
+ * We handle --dev null specially, we do not open /dev/null for this.
+ */
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ }
+ else
+ {
+ /*
+ * Process --dev-node
+ */
+ const char *node = dev_node;
+ if (!node)
+ node = "/dev/net/tun";
+
+ /*
+ * Open the interface
+ */
+ if ((tt->fd = open (node, O_RDWR)) < 0)
+ {
+ msg (M_ERR, "ERROR: Cannot open TUN/TAP dev %s", node);
+ }
+
+ /*
+ * Process --tun-ipv6
+ */
+ CLEAR (ifr);
+ if (!tt->ipv6)
+ ifr.ifr_flags = IFF_NO_PI;
+
+#if defined(IFF_ONE_QUEUE) && defined(SIOCSIFTXQLEN)
+ ifr.ifr_flags |= IFF_ONE_QUEUE;
+#endif
+
+ /*
+ * Figure out if tun or tap device
+ */
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ ifr.ifr_flags |= IFF_TUN;
+ }
+ else if (tt->type == DEV_TYPE_TAP)
+ {
+ ifr.ifr_flags |= IFF_TAP;
+ }
+ else
+ {
+ msg (M_FATAL, "I don't recognize device %s as a tun or tap device",
+ dev);
+ }
+
+ /*
+ * Set an explicit name, if --dev is not tun or tap
+ */
+ if (strcmp(dev, "tun") && strcmp(dev, "tap"))
+ strncpynt (ifr.ifr_name, dev, IFNAMSIZ);
+
+ /*
+ * Use special ioctl that configures tun/tap device with the parms
+ * we set in ifr
+ */
+ if (ioctl (tt->fd, TUNSETIFF, (void *) &ifr) < 0)
+ {
+ msg (M_ERR, "ERROR: Cannot ioctl TUNSETIFF %s", dev);
+ }
+
+ msg (M_INFO, "TUN/TAP device %s opened", ifr.ifr_name);
+
+ /*
+ * Try making the TX send queue bigger
+ */
+#if defined(IFF_ONE_QUEUE) && defined(SIOCSIFTXQLEN)
+ if (tt->options.txqueuelen) {
+ struct ifreq netifr;
+ int ctl_fd;
+
+ if ((ctl_fd = socket (AF_INET, SOCK_DGRAM, 0)) >= 0)
+ {
+ CLEAR (netifr);
+ strncpynt (netifr.ifr_name, ifr.ifr_name, IFNAMSIZ);
+ netifr.ifr_qlen = tt->options.txqueuelen;
+ if (ioctl (ctl_fd, SIOCSIFTXQLEN, (void *) &netifr) >= 0)
+ msg (D_OSBUF, "TUN/TAP TX queue length set to %d", tt->options.txqueuelen);
+ else
+ msg (M_WARN | M_ERRNO, "Note: Cannot set tx queue length on %s", ifr.ifr_name);
+ close (ctl_fd);
+ }
+ else
+ {
+ msg (M_WARN | M_ERRNO, "Note: Cannot open control socket on %s", ifr.ifr_name);
+ }
+ }
+#endif
+
+ set_nonblock (tt->fd);
+ set_cloexec (tt->fd);
+ tt->actual_name = string_alloc (ifr.ifr_name, NULL);
+ }
+ return;
+}
+
+#else
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ ASSERT (0);
+}
+
+#endif
+
+#else
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ open_tun_generic (dev, dev_type, dev_node, false, true, tt);
+}
+
+#endif /* HAVE_LINUX_IF_TUN_H */
+
+#ifdef ENABLE_FEATURE_TUN_PERSIST
+
+/*
+ * This can be removed in future
+ * when all systems will use newer
+ * linux-headers
+ */
+#ifndef TUNSETOWNER
+#define TUNSETOWNER _IOW('T', 204, int)
+#endif
+#ifndef TUNSETGROUP
+#define TUNSETGROUP _IOW('T', 206, int)
+#endif
+
+void
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, int persist_mode, const char *username, const char *groupname, const struct tuntap_options *options)
+{
+ struct tuntap *tt;
+
+ ALLOC_OBJ (tt, struct tuntap);
+ clear_tuntap (tt);
+ tt->type = dev_type_enum (dev, dev_type);
+ tt->options = *options;
+ open_tun (dev, dev_type, dev_node, tt);
+ if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)
+ msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
+ if (username != NULL)
+ {
+ struct platform_state_user platform_state_user;
+
+ if (!platform_user_get (username, &platform_state_user))
+ msg (M_ERR, "Cannot get user entry for %s", username);
+ else
+ if (ioctl (tt->fd, TUNSETOWNER, platform_state_user.pw->pw_uid) < 0)
+ msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", username, dev);
+ }
+ if (groupname != NULL)
+ {
+ struct platform_state_group platform_state_group;
+
+ if (!platform_group_get (groupname, &platform_state_group))
+ msg (M_ERR, "Cannot get group entry for %s", groupname);
+ else
+ if (ioctl (tt->fd, TUNSETGROUP, platform_state_group.gr->gr_gid) < 0)
+ msg (M_ERR, "Cannot ioctl TUNSETOWNER(%s) %s", groupname, dev);
+ }
+ close_tun (tt);
+ msg (M_INFO, "Persist state set to: %s", (persist_mode ? "ON" : "OFF"));
+}
+
+#endif /* ENABLE_FEATURE_TUN_PERSIST */
+
+void
+close_tun (struct tuntap *tt)
+{
+ if (tt)
+ {
+ if (tt->type != DEV_TYPE_NULL && tt->did_ifconfig)
+ {
+ struct argv argv;
+ struct gc_arena gc = gc_new ();
+ argv_init (&argv);
+
+#ifdef ENABLE_IPROUTE
+ if (is_tun_p2p (tt))
+ {
+ argv_printf (&argv,
+ "%s addr del dev %s local %s peer %s",
+ iproute_path,
+ tt->actual_name,
+ print_in_addr_t (tt->local, 0, &gc),
+ print_in_addr_t (tt->remote_netmask, 0, &gc)
+ );
+ }
+ else
+ {
+ argv_printf (&argv,
+ "%s addr del dev %s %s/%d",
+ iproute_path,
+ tt->actual_name,
+ print_in_addr_t (tt->local, 0, &gc),
+ count_netmask_bits(print_in_addr_t (tt->remote_netmask, 0, &gc))
+ );
+ }
+#else
+ argv_printf (&argv,
+ "%s %s 0.0.0.0",
+ IFCONFIG_PATH,
+ tt->actual_name
+ );
+#endif
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "Linux ip addr del failed");
+
+ argv_reset (&argv);
+ gc_free (&gc);
+ }
+ close_tun_generic (tt);
+ free (tt);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->ipv6)
+ {
+ struct tun_pi pi;
+ struct iphdr *iph;
+ struct iovec vect[2];
+ int ret;
+
+ iph = (struct iphdr *)buf;
+
+ pi.flags = 0;
+
+ if(iph->version == 6)
+ pi.proto = htons(ETH_P_IPV6);
+ else
+ pi.proto = htons(ETH_P_IP);
+
+ vect[0].iov_len = sizeof(pi);
+ vect[0].iov_base = &pi;
+ vect[1].iov_len = len;
+ vect[1].iov_base = buf;
+
+ ret = writev(tt->fd, vect, 2);
+ return(ret - sizeof(pi));
+ }
+ else
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->ipv6)
+ {
+ struct iovec vect[2];
+ struct tun_pi pi;
+ int ret;
+
+ vect[0].iov_len = sizeof(pi);
+ vect[0].iov_base = &pi;
+ vect[1].iov_len = len;
+ vect[1].iov_base = buf;
+
+ ret = readv(tt->fd, vect, 2);
+ return(ret - sizeof(pi));
+ }
+ else
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(TARGET_SOLARIS)
+
+#ifndef TUNNEWPPA
+#error I need the symbol TUNNEWPPA from net/if_tun.h
+#endif
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ int if_fd, ip_muxid, arp_muxid, arp_fd, ppa = -1;
+ struct lifreq ifr;
+ const char *ptr;
+ const char *ip_node, *arp_node;
+ const char *dev_tuntap_type;
+ int link_type;
+ bool is_tun;
+ struct strioctl strioc_if, strioc_ppa;
+
+ /* improved generic TUN/TAP driver from
+ * http://www.whiteboard.ne.jp/~admin2/tuntap/
+ * has IPv6 support
+ */
+ CLEAR(ifr);
+
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ return;
+ }
+
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ ip_node = "/dev/udp";
+ if (!dev_node)
+ dev_node = "/dev/tun";
+ dev_tuntap_type = "tun";
+ link_type = I_PLINK;
+ is_tun = true;
+ }
+ else if (tt->type == DEV_TYPE_TAP)
+ {
+ ip_node = "/dev/udp";
+ if (!dev_node)
+ dev_node = "/dev/tap";
+ arp_node = dev_node;
+ dev_tuntap_type = "tap";
+ link_type = I_PLINK; /* was: I_LINK */
+ is_tun = false;
+ }
+ else
+ {
+ msg (M_FATAL, "I don't recognize device %s as a tun or tap device",
+ dev);
+ }
+
+ if ((tt->ip_fd = open (ip_node, O_RDWR, 0)) < 0)
+ msg (M_ERR, "Can't open %s", ip_node);
+
+ if ((tt->fd = open (dev_node, O_RDWR, 0)) < 0)
+ msg (M_ERR, "Can't open %s", dev_node);
+
+ /* get unit number */
+ if (*dev)
+ {
+ ptr = dev;
+ while (*ptr && !isdigit ((int) *ptr))
+ ptr++;
+ ppa = atoi (ptr);
+ }
+
+ /* Assign a new PPA and get its unit number. */
+ strioc_ppa.ic_cmd = TUNNEWPPA;
+ strioc_ppa.ic_timout = 0;
+ strioc_ppa.ic_len = sizeof(ppa);
+ strioc_ppa.ic_dp = (char *)&ppa;
+
+ if ( *ptr == '\0' ) /* no number given, try dynamic */
+ {
+ bool found_one = false;
+ while( ! found_one && ppa < 64 )
+ {
+ int new_ppa = ioctl (tt->fd, I_STR, &strioc_ppa);
+ if ( new_ppa >= 0 )
+ {
+ msg( M_INFO, "open_tun: got dynamic interface '%s%d'", dev_tuntap_type, new_ppa );
+ ppa = new_ppa;
+ found_one = true;
+ break;
+ }
+ if ( errno != EEXIST )
+ msg (M_ERR, "open_tun: unexpected error trying to find free %s interface", dev_tuntap_type );
+ ppa++;
+ }
+ if ( !found_one )
+ msg (M_ERR, "open_tun: could not find free %s interface, give up.", dev_tuntap_type );
+ }
+ else /* try this particular one */
+ {
+ if ((ppa = ioctl (tt->fd, I_STR, &strioc_ppa)) < 0)
+ msg (M_ERR, "Can't assign PPA for new interface (%s%d)", dev_tuntap_type, ppa );
+ }
+
+ if ((if_fd = open (dev_node, O_RDWR, 0)) < 0)
+ msg (M_ERR, "Can't open %s (2)", dev_node);
+
+ if (ioctl (if_fd, I_PUSH, "ip") < 0)
+ msg (M_ERR, "Can't push IP module");
+
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ /* Assign ppa according to the unit number returned by tun device */
+ if (ioctl (if_fd, IF_UNITSEL, (char *) &ppa) < 0)
+ msg (M_ERR, "Can't set PPA %d", ppa);
+ }
+
+ tt->actual_name = (char *) malloc (32);
+ check_malloc_return (tt->actual_name);
+
+ openvpn_snprintf (tt->actual_name, 32, "%s%d", dev_tuntap_type, ppa);
+
+ if (tt->type == DEV_TYPE_TAP)
+ {
+ if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
+ msg (M_ERR, "Can't get flags\n");
+ strncpynt (ifr.lifr_name, tt->actual_name, sizeof (ifr.lifr_name));
+ ifr.lifr_ppa = ppa;
+ /* Assign ppa according to the unit number returned by tun device */
+ if (ioctl (if_fd, SIOCSLIFNAME, &ifr) < 0)
+ msg (M_ERR, "Can't set PPA %d", ppa);
+ if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) <0)
+ msg (M_ERR, "Can't get flags\n");
+ /* Push arp module to if_fd */
+ if (ioctl (if_fd, I_PUSH, "arp") < 0)
+ msg (M_ERR, "Can't push ARP module");
+
+ /* Pop any modules on the stream */
+ while (true)
+ {
+ if (ioctl (tt->ip_fd, I_POP, NULL) < 0)
+ break;
+ }
+ /* Push arp module to ip_fd */
+ if (ioctl (tt->ip_fd, I_PUSH, "arp") < 0)
+ msg (M_ERR, "Can't push ARP module\n");
+
+ /* Open arp_fd */
+ if ((arp_fd = open (arp_node, O_RDWR, 0)) < 0)
+ msg (M_ERR, "Can't open %s\n", arp_node);
+ /* Push arp module to arp_fd */
+ if (ioctl (arp_fd, I_PUSH, "arp") < 0)
+ msg (M_ERR, "Can't push ARP module\n");
+
+ /* Set ifname to arp */
+ strioc_if.ic_cmd = SIOCSLIFNAME;
+ strioc_if.ic_timout = 0;
+ strioc_if.ic_len = sizeof(ifr);
+ strioc_if.ic_dp = (char *)&ifr;
+ if (ioctl(arp_fd, I_STR, &strioc_if) < 0){
+ msg (M_ERR, "Can't set ifname to arp\n");
+ }
+ }
+
+ if ((ip_muxid = ioctl (tt->ip_fd, link_type, if_fd)) < 0)
+ msg (M_ERR, "Can't link %s device to IP", dev_tuntap_type);
+
+ if (tt->type == DEV_TYPE_TAP) {
+ if ((arp_muxid = ioctl (tt->ip_fd, link_type, arp_fd)) < 0)
+ msg (M_ERR, "Can't link %s device to ARP", dev_tuntap_type);
+ close (arp_fd);
+ }
+
+ CLEAR (ifr);
+ strncpynt (ifr.lifr_name, tt->actual_name, sizeof (ifr.lifr_name));
+ ifr.lifr_ip_muxid = ip_muxid;
+ if (tt->type == DEV_TYPE_TAP) {
+ ifr.lifr_arp_muxid = arp_muxid;
+ }
+
+ if (ioctl (tt->ip_fd, SIOCSLIFMUXID, &ifr) < 0)
+ {
+ if (tt->type == DEV_TYPE_TAP)
+ {
+ ioctl (tt->ip_fd, I_PUNLINK , arp_muxid);
+ }
+ ioctl (tt->ip_fd, I_PUNLINK, ip_muxid);
+ msg (M_ERR, "Can't set multiplexor id");
+ }
+
+ set_nonblock (tt->fd);
+ set_cloexec (tt->fd);
+ set_cloexec (tt->ip_fd);
+
+ msg (M_INFO, "TUN/TAP device %s opened", tt->actual_name);
+}
+
+static void
+solaris_close_tun (struct tuntap *tt)
+{
+ if (tt)
+ {
+ /* IPv6 interfaces need to be 'manually' de-configured */
+ if ( tt->ipv6 && tt->did_ifconfig_ipv6_setup )
+ {
+ struct argv argv;
+ argv_init (&argv);
+ argv_printf( &argv, "%s %s inet6 unplumb",
+ IFCONFIG_PATH, tt->actual_name );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "Solaris ifconfig inet6 unplumb failed");
+ argv_reset (&argv);
+ }
+
+ if (tt->ip_fd >= 0)
+ {
+ struct lifreq ifr;
+ CLEAR (ifr);
+ strncpynt (ifr.lifr_name, tt->actual_name, sizeof (ifr.lifr_name));
+
+ if (ioctl (tt->ip_fd, SIOCGLIFFLAGS, &ifr) < 0)
+ msg (M_WARN | M_ERRNO, "Can't get iface flags");
+
+ if (ioctl (tt->ip_fd, SIOCGLIFMUXID, &ifr) < 0)
+ msg (M_WARN | M_ERRNO, "Can't get multiplexor id");
+
+ if (tt->type == DEV_TYPE_TAP)
+ {
+ if (ioctl (tt->ip_fd, I_PUNLINK, ifr.lifr_arp_muxid) < 0)
+ msg (M_WARN | M_ERRNO, "Can't unlink interface(arp)");
+ }
+
+ if (ioctl (tt->ip_fd, I_PUNLINK, ifr.lifr_ip_muxid) < 0)
+ msg (M_WARN | M_ERRNO, "Can't unlink interface(ip)");
+
+ close (tt->ip_fd);
+ tt->ip_fd = -1;
+ }
+
+ if (tt->fd >= 0)
+ {
+ close (tt->fd);
+ tt->fd = -1;
+ }
+ }
+}
+
+/*
+ * Close TUN device.
+ */
+void
+close_tun (struct tuntap *tt)
+{
+ if (tt)
+ {
+ solaris_close_tun (tt);
+
+ if (tt->actual_name)
+ free (tt->actual_name);
+
+ clear_tuntap (tt);
+ free (tt);
+ }
+}
+
+static void
+solaris_error_close (struct tuntap *tt, const struct env_set *es,
+ const char *actual, bool unplumb_inet6 )
+{
+ struct argv argv;
+ argv_init (&argv);
+
+ if (unplumb_inet6)
+ {
+ argv_printf( &argv, "%s %s inet6 unplumb",
+ IFCONFIG_PATH, actual );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, 0, "Solaris ifconfig inet6 unplumb failed");
+ }
+
+ argv_printf (&argv,
+ "%s %s unplumb",
+ IFCONFIG_PATH,
+ actual);
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, es, 0, "Solaris ifconfig unplumb failed");
+ close_tun (tt);
+ msg (M_FATAL, "Solaris ifconfig failed");
+ argv_reset (&argv);
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ struct strbuf sbuf;
+ sbuf.len = len;
+ sbuf.buf = (char *)buf;
+ return putmsg (tt->fd, NULL, &sbuf, 0) >= 0 ? sbuf.len : -1;
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ struct strbuf sbuf;
+ int f = 0;
+
+ sbuf.maxlen = len;
+ sbuf.buf = (char *)buf;
+ return getmsg (tt->fd, NULL, &sbuf, &f) >= 0 ? sbuf.len : -1;
+}
+
+#elif defined(TARGET_OPENBSD)
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ open_tun_generic (dev, dev_type, dev_node, true, true, tt);
+
+ /* Enable multicast on the interface */
+ if (tt->fd >= 0)
+ {
+ struct tuninfo info;
+
+ if (ioctl (tt->fd, TUNGIFINFO, &info) < 0) {
+ msg (M_WARN | M_ERRNO, "Can't get interface info: %s",
+ strerror(errno));
+ }
+
+#ifdef IFF_MULTICAST /* openbsd 4.x doesn't have this */
+ info.flags |= IFF_MULTICAST;
+#endif
+
+ if (ioctl (tt->fd, TUNSIFINFO, &info) < 0) {
+ msg (M_WARN | M_ERRNO, "Can't set interface info: %s",
+ strerror(errno));
+ }
+ }
+}
+
+/* tun(4): "If the device was created by opening /dev/tunN, it will be
+ * automatically destroyed. Devices created via ifconfig(8) are
+ * only marked as not running and traffic will be dropped
+ * returning EHOSTDOWN."
+ * --> no special handling should be needed - *but* OpenBSD is misbehaving
+ * here: if the interface was put in tap mode ("ifconfig tunN link0"), it
+ * *will* stay around, and needs to be cleaned up manually
+ */
+
+void
+close_tun (struct tuntap* tt)
+{
+ /* only *TAP* devices need destroying, tun devices auto-self-destruct
+ */
+ if (tt && (tt->type == DEV_TYPE_TUN || tt->persistent_if ) )
+ {
+ close_tun_generic (tt);
+ free(tt);
+ }
+ else if (tt)
+ {
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+
+ /* setup command, close tun dev (clears tt->actual_name!), run command
+ */
+
+ argv_init (&argv);
+ argv_printf (&argv, "%s %s destroy",
+ IFCONFIG_PATH, tt->actual_name);
+
+ close_tun_generic (tt);
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "OpenBSD 'destroy tun interface' failed (non-critical)");
+
+ free (tt);
+ }
+}
+
+int
+write_tun(struct tuntap *tt, uint8_t *buf, int len)
+{
+ return write_tun_header (tt, buf, len);
+}
+
+int
+read_tun (struct tuntap *tt, uint8_t *buf, int len)
+{
+ return read_tun_header (tt, buf, len);
+}
+
+#elif defined(TARGET_NETBSD)
+
+/*
+ * NetBSD before 4.0 does not support IPv6 on tun out of the box,
+ * but there exists a patch (sys/net/if_tun.c, 1.79->1.80, see PR 32944).
+ *
+ * NetBSD 4.0 and up do, but we need to put the tun interface into
+ * "multi_af" mode, which will prepend the address family to all packets
+ * (same as OpenBSD and FreeBSD). If this is not enabled, the kernel
+ * silently drops all IPv6 packets on output and gets confused on input.
+ *
+ * On earlier versions, multi_af is not available at all, so we have
+ * two different NetBSD code variants here :-(
+ *
+ */
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+#ifdef NETBSD_MULTI_AF
+ open_tun_generic (dev, dev_type, dev_node, true, true, tt);
+#else
+ open_tun_generic (dev, dev_type, dev_node, false, true, tt);
+#endif
+
+ if (tt->fd >= 0)
+ {
+ int i = IFF_POINTOPOINT|IFF_MULTICAST;
+ ioctl (tt->fd, TUNSIFMODE, &i); /* multicast on */
+ i = 0;
+ ioctl (tt->fd, TUNSLMODE, &i); /* link layer mode off */
+
+#ifdef NETBSD_MULTI_AF
+ if ( tt->type == DEV_TYPE_TUN )
+ {
+ i = 1;
+ if (ioctl (tt->fd, TUNSIFHEAD, &i) < 0) /* multi-af mode on */
+ {
+ msg (M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD): %s", strerror(errno));
+ }
+ }
+#endif
+ }
+}
+
+/* the current way OpenVPN handles tun devices on NetBSD leads to
+ * lingering tunX interfaces after close -> for a full cleanup, they
+ * need to be explicitely destroyed
+ */
+void
+close_tun (struct tuntap *tt)
+{
+ /* only tun devices need destroying, tap devices auto-self-destruct
+ */
+ if (tt && ( tt->type != DEV_TYPE_TUN || tt->persistent_if ) )
+ {
+ close_tun_generic (tt);
+ free(tt);
+ }
+ else if (tt)
+ {
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+
+ /* setup command, close tun dev (clears tt->actual_name!), run command
+ */
+
+ argv_init (&argv);
+ argv_printf (&argv, "%s %s destroy",
+ IFCONFIG_PATH, tt->actual_name);
+
+ close_tun_generic (tt);
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "NetBSD 'destroy tun interface' failed (non-critical)");
+
+ free (tt);
+ }
+}
+
+#ifdef NETBSD_MULTI_AF
+
+static inline int
+netbsd_modify_read_write_return (int len)
+{
+ if (len > 0)
+ return len > sizeof (u_int32_t) ? len - sizeof (u_int32_t) : 0;
+ else
+ return len;
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+ struct openvpn_iphdr *iph;
+
+ iph = (struct openvpn_iphdr *) buf;
+
+ if (tt->ipv6 && OPENVPN_IPH_GET_VER(iph->version_len) == 6)
+ type = htonl (AF_INET6);
+ else
+ type = htonl (AF_INET);
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return netbsd_modify_read_write_return (writev (tt->fd, iv, 2));
+ }
+ else
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return netbsd_modify_read_write_return (readv (tt->fd, iv, 2));
+ }
+ else
+ return read (tt->fd, buf, len);
+}
+
+#else /* not NETBSD_MULTI_AF -> older code, IPv4 only */
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return read (tt->fd, buf, len);
+}
+#endif /* NETBSD_MULTI_AF */
+
+#elif defined(TARGET_FREEBSD)
+
+static inline int
+freebsd_modify_read_write_return (int len)
+{
+ if (len > 0)
+ return len > sizeof (u_int32_t) ? len - sizeof (u_int32_t) : 0;
+ else
+ return len;
+}
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ open_tun_generic (dev, dev_type, dev_node, true, true, tt);
+
+ if (tt->fd >= 0 && tt->type == DEV_TYPE_TUN)
+ {
+ int i = IFF_POINTOPOINT | IFF_MULTICAST;
+
+ if (ioctl (tt->fd, TUNSIFMODE, &i) < 0) {
+ msg (M_WARN | M_ERRNO, "ioctl(TUNSIFMODE): %s", strerror(errno));
+ }
+ i = 1;
+ if (ioctl (tt->fd, TUNSIFHEAD, &i) < 0) {
+ msg (M_WARN | M_ERRNO, "ioctl(TUNSIFHEAD): %s", strerror(errno));
+ }
+ }
+}
+
+/* tun(4): "These network interfaces persist until the if_tun.ko module is
+ * unloaded, or until removed with the ifconfig(8) command."
+ * (verified for FreeBSD 6.3, 7.4, 8.2 and 9, same for tap(4))
+ *
+ * so, to avoid lingering tun/tap interfaces after OpenVPN quits,
+ * we need to call "ifconfig ... destroy" for cleanup
+ */
+void
+close_tun (struct tuntap *tt)
+{
+ if (tt && tt->persistent_if ) /* keep pre-existing if around */
+ {
+ close_tun_generic (tt);
+ free (tt);
+ }
+ else if (tt) /* close and destroy */
+ {
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+
+ /* setup command, close tun dev (clears tt->actual_name!), run command
+ */
+
+ argv_init (&argv);
+ argv_printf (&argv, "%s %s destroy",
+ IFCONFIG_PATH, tt->actual_name);
+
+ close_tun_generic (tt);
+
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "FreeBSD 'destroy tun interface' failed (non-critical)");
+
+ free (tt);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+ struct ip *iph;
+
+ iph = (struct ip *) buf;
+
+ if (tt->ipv6 && iph->ip_v == 6)
+ type = htonl (AF_INET6);
+ else
+ type = htonl (AF_INET);
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return freebsd_modify_read_write_return (writev (tt->fd, iv, 2));
+ }
+ else
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return freebsd_modify_read_write_return (readv (tt->fd, iv, 2));
+ }
+ else
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(TARGET_DRAGONFLY)
+
+static inline int
+dragonfly_modify_read_write_return (int len)
+{
+ if (len > 0)
+ return len > sizeof (u_int32_t) ? len - sizeof (u_int32_t) : 0;
+ else
+ return len;
+}
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ open_tun_generic (dev, dev_type, dev_node, true, true, tt);
+
+ if (tt->fd >= 0)
+ {
+ int i = 0;
+
+ /* Disable extended modes */
+ ioctl (tt->fd, TUNSLMODE, &i);
+ i = 1;
+ ioctl (tt->fd, TUNSIFHEAD, &i);
+ }
+}
+
+void
+close_tun (struct tuntap *tt)
+{
+ if (tt)
+ {
+ close_tun_generic (tt);
+ free (tt);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+ struct ip *iph;
+
+ iph = (struct ip *) buf;
+
+ if (tt->ipv6 && iph->ip_v == 6)
+ type = htonl (AF_INET6);
+ else
+ type = htonl (AF_INET);
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return dragonfly_modify_read_write_return (writev (tt->fd, iv, 2));
+ }
+ else
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ u_int32_t type;
+ struct iovec iv[2];
+
+ iv[0].iov_base = (char *)&type;
+ iv[0].iov_len = sizeof (type);
+ iv[1].iov_base = buf;
+ iv[1].iov_len = len;
+
+ return dragonfly_modify_read_write_return (readv (tt->fd, iv, 2));
+ }
+ else
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(TARGET_DARWIN)
+
+/* Darwin (MacOS X) is mostly "just use the generic stuff", but there
+ * is always one caveat...:
+ *
+ * If IPv6 is configured, and the tun device is closed, the IPv6 address
+ * configured to the tun interface changes to a lingering /128 route
+ * pointing to lo0. Need to unconfigure... (observed on 10.5)
+ */
+
+/*
+ * utun is the native Darwin tun driver present since at least 10.7
+ * Thanks goes to Jonathan Levin for providing an example how to utun
+ * (http://newosxbook.com/src.jl?tree=listings&file=17-15-utun.c)
+ */
+
+#ifdef HAVE_NET_IF_UTUN_H
+
+/* Helper functions that tries to open utun device
+ return -2 on early initialization failures (utun not supported
+ at all (old OS X) and -1 on initlization failure of utun
+ device (utun works but utunX is already used */
+static
+int utun_open_helper (struct ctl_info ctlInfo, int utunnum)
+{
+ struct sockaddr_ctl sc;
+ int fd;
+
+ fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
+
+ if (fd < 0)
+ {
+ msg (M_INFO, "Opening utun (%s): %s", "socket(SYSPROTO_CONTROL)",
+ strerror (errno));
+ return -2;
+ }
+
+ if (ioctl(fd, CTLIOCGINFO, &ctlInfo) == -1)
+ {
+ close (fd);
+ msg (M_INFO, "Opening utun (%s): %s", "ioctl(CTLIOCGINFO)",
+ strerror (errno));
+ return -2;
+ }
+
+
+ sc.sc_id = ctlInfo.ctl_id;
+ sc.sc_len = sizeof(sc);
+ sc.sc_family = AF_SYSTEM;
+ sc.ss_sysaddr = AF_SYS_CONTROL;
+
+ sc.sc_unit = utunnum+1;
+
+
+ /* If the connect is successful, a utun%d device will be created, where "%d"
+ * is (sc.sc_unit - 1) */
+
+ if (connect (fd, (struct sockaddr *)&sc, sizeof(sc)) < 0)
+ {
+ msg (M_INFO, "Opening utun (%s): %s", "connect(AF_SYS_CONTROL)",
+ strerror (errno));
+ close(fd);
+ return -1;
+ }
+
+ set_nonblock (fd);
+ set_cloexec (fd); /* don't pass fd to scripts */
+
+ return fd;
+}
+
+void
+open_darwin_utun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ struct ctl_info ctlInfo;
+ int fd;
+ char utunname[20];
+ int utunnum =-1;
+ socklen_t utunname_len = sizeof(utunname);
+
+ /* dev_node is simply utun, do the normal dynamic utun
+ * otherwise try to parse the utun number */
+ if (dev_node && !strcmp ("utun", dev_node)==0)
+ {
+ if (!sscanf (dev_node, "utun%d", &utunnum)==1)
+ msg (M_FATAL, "Cannot parse 'dev-node %s' please use 'dev-node utunX'"
+ "to use a utun device number X", dev_node);
+ }
+
+
+
+ CLEAR (ctlInfo);
+ if (strlcpy(ctlInfo.ctl_name, UTUN_CONTROL_NAME, sizeof(ctlInfo.ctl_name)) >=
+ sizeof(ctlInfo.ctl_name))
+ {
+ msg (M_ERR, "Opening utun: UTUN_CONTROL_NAME too long");
+ }
+
+ /* try to open first available utun device if no specific utun is requested */
+ if (utunnum == -1)
+ {
+ for (utunnum=0; utunnum<255; utunnum++)
+ {
+ fd = utun_open_helper (ctlInfo, utunnum);
+ /* Break if the fd is valid,
+ * or if early initalization failed (-2) */
+ if (fd !=-1)
+ break;
+ }
+ }
+ else
+ {
+ fd = utun_open_helper (ctlInfo, utunnum);
+ }
+
+ /* opening an utun device failed */
+ tt->fd = fd;
+
+ if (fd < 0)
+ return;
+
+ /* Retrieve the assigned interface name. */
+ if (getsockopt (fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, utunname, &utunname_len))
+ msg (M_ERR | M_ERRNO, "Error retrieving utun interface name");
+
+ tt->actual_name = string_alloc (utunname, NULL);
+
+ msg (M_INFO, "Opened utun device %s", utunname);
+ tt->is_utun = true;
+}
+
+#endif
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+#ifdef HAVE_NET_IF_UTUN_H
+ /* If dev_node does not start start with utun assume regular tun/tap */
+ if ((!dev_node && tt->type==DEV_TYPE_TUN) ||
+ (dev_node && !strncmp (dev_node, "utun", 4)))
+ {
+
+ /* Check if user has specific dev_type tap and forced utun with
+ dev-node utun */
+ if (tt->type!=DEV_TYPE_TUN)
+ msg (M_FATAL, "Cannot use utun devices with --dev-type %s",
+ dev_type_string (dev, dev_type));
+
+ /* Try utun first and fall back to normal tun if utun fails
+ and dev_node is not specified */
+ open_darwin_utun(dev, dev_type, dev_node, tt);
+
+ if (!tt->is_utun)
+ {
+ if (!dev_node)
+ {
+ /* No explicit utun and utun failed, try the generic way) */
+ msg (M_INFO, "Failed to open utun device. Falling back to /dev/tun device");
+ open_tun_generic (dev, dev_type, NULL, true, true, tt);
+ }
+ else
+ {
+ /* Specific utun device or generic utun request with no tun
+ fall back failed, consider this a fatal failure */
+ msg (M_FATAL, "Cannot open utun device");
+ }
+ }
+ }
+ else
+#endif
+ {
+
+ /* Use plain dev-node tun to select /dev/tun style
+ * Unset dev_node variable prior to passing to open_tun_generic to
+ * let open_tun_generic pick the first available tun device */
+
+ if (dev_node && strcmp (dev_node, "tun")==0)
+ dev_node=NULL;
+
+ open_tun_generic (dev, dev_type, dev_node, true, true, tt);
+ }
+}
+
+void
+close_tun (struct tuntap* tt)
+{
+ if (tt)
+ {
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+ argv_init (&argv);
+
+ if ( tt->ipv6 && tt->did_ifconfig_ipv6_setup )
+ {
+ const char * ifconfig_ipv6_local =
+ print_in6_addr (tt->local_ipv6, 0, &gc);
+
+ argv_printf (&argv, "%s delete -inet6 %s",
+ ROUTE_PATH, ifconfig_ipv6_local );
+ argv_msg (M_INFO, &argv);
+ openvpn_execve_check (&argv, NULL, 0, "MacOS X 'remove inet6 route' failed (non-critical)");
+ }
+
+ close_tun_generic (tt);
+ free (tt);
+ argv_reset (&argv);
+ gc_free (&gc);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+#ifdef HAVE_NET_IF_UTUN_H
+ if (tt->is_utun)
+ return write_tun_header (tt, buf, len);
+ else
+#endif
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+#ifdef HAVE_NET_IF_UTUN_H
+ if (tt->is_utun)
+ return read_tun_header (tt, buf, len);
+ else
+#endif
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(TARGET_AIX)
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ char tunname[256];
+ char dynamic_name[20];
+ const char *p;
+ struct argv argv;
+
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ return;
+ }
+
+ if ( tt->type == DEV_TYPE_TUN)
+ {
+ msg(M_FATAL, "no support for 'tun' devices on AIX" );
+ }
+
+ if ( strncmp( dev, "tap", 3 ) != 0 || dev_node )
+ {
+ msg(M_FATAL, "'--dev %s' and/or '--dev-node' not supported on AIX, use '--dev tap0', 'tap1', etc.", dev );
+ }
+
+ if ( strcmp( dev, "tap" ) == 0 ) /* find first free tap dev */
+ { /* (= no /dev/tapN node) */
+ int i;
+ for (i=0; i<99; i++ )
+ {
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/tap%d", i);
+ if ( access( tunname, F_OK ) < 0 && errno == ENOENT )
+ { break; }
+ }
+ if ( i >= 99 )
+ msg( M_FATAL, "cannot find unused tap device" );
+
+ openvpn_snprintf( dynamic_name, sizeof(dynamic_name), "tap%d", i );
+ dev = dynamic_name;
+ }
+ else /* name given, sanity check */
+ {
+ /* ensure that dev name is "tap+<digits>" *only* */
+ p = &dev[3];
+ while( isdigit(*p) ) p++;
+ if ( *p != '\0' )
+ msg( M_FATAL, "TAP device name must be '--dev tapNNNN'" );
+
+ openvpn_snprintf (tunname, sizeof (tunname), "/dev/%s", dev);
+ }
+
+ /* pre-existing device?
+ */
+ if ( access( tunname, F_OK ) < 0 && errno == ENOENT )
+ {
+
+ /* tunnel device must be created with 'ifconfig tapN create'
+ */
+ struct env_set *es = env_set_create (NULL);
+ argv_init (&argv);
+ argv_printf (&argv, "%s %s create", IFCONFIG_PATH, dev);
+ argv_msg (M_INFO, &argv);
+ env_set_add( es, "ODMDIR=/etc/objrepos" );
+ openvpn_execve_check (&argv, es, S_FATAL, "AIX 'create tun interface' failed");
+ env_set_destroy (es);
+ }
+ else
+ {
+ /* we didn't make it, we're not going to break it */
+ tt->persistent_if = TRUE;
+ }
+
+ if ((tt->fd = open (tunname, O_RDWR)) < 0)
+ {
+ msg (M_ERR, "Cannot open TAP device '%s'", tunname);
+ }
+
+ set_nonblock (tt->fd);
+ set_cloexec (tt->fd); /* don't pass fd to scripts */
+ msg (M_INFO, "TUN/TAP device %s opened", tunname);
+
+ /* tt->actual_name is passed to up and down scripts and used as the ifconfig dev name */
+ tt->actual_name = string_alloc(dev, NULL);
+}
+
+/* tap devices need to be manually destroyed on AIX
+ */
+void
+close_tun (struct tuntap* tt)
+{
+ struct gc_arena gc = gc_new ();
+ struct argv argv;
+ struct env_set *es = env_set_create (NULL);
+
+ if (!tt) return;
+
+ /* persistent devices need IP address unconfig, others need destroyal
+ */
+ argv_init (&argv);
+
+ if (tt->persistent_if)
+ {
+ argv_printf (&argv, "%s %s 0.0.0.0 down",
+ IFCONFIG_PATH, tt->actual_name);
+ }
+ else
+ {
+ argv_printf (&argv, "%s %s destroy",
+ IFCONFIG_PATH, tt->actual_name);
+ }
+
+ close_tun_generic (tt);
+ argv_msg (M_INFO, &argv);
+ env_set_add( es, "ODMDIR=/etc/objrepos" );
+ openvpn_execve_check (&argv, es, 0, "AIX 'destroy tap interface' failed (non-critical)");
+
+ free(tt);
+ env_set_destroy (es);
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return read (tt->fd, buf, len);
+}
+
+#elif defined(WIN32)
+
+int
+tun_read_queue (struct tuntap *tt, int maxsize)
+{
+ if (tt->reads.iostate == IOSTATE_INITIAL)
+ {
+ DWORD len;
+ BOOL status;
+ int err;
+
+ /* reset buf to its initial state */
+ tt->reads.buf = tt->reads.buf_init;
+
+ len = maxsize ? maxsize : BLEN (&tt->reads.buf);
+ ASSERT (len <= BLEN (&tt->reads.buf));
+
+ /* the overlapped read will signal this event on I/O completion */
+ ASSERT (ResetEvent (tt->reads.overlapped.hEvent));
+
+ status = ReadFile(
+ tt->hand,
+ BPTR (&tt->reads.buf),
+ len,
+ &tt->reads.size,
+ &tt->reads.overlapped
+ );
+
+ if (status) /* operation completed immediately? */
+ {
+ /* since we got an immediate return, we must signal the event object ourselves */
+ ASSERT (SetEvent (tt->reads.overlapped.hEvent));
+
+ tt->reads.iostate = IOSTATE_IMMEDIATE_RETURN;
+ tt->reads.status = 0;
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Read immediate return [%d,%d]",
+ (int) len,
+ (int) tt->reads.size);
+ }
+ else
+ {
+ err = GetLastError ();
+ if (err == ERROR_IO_PENDING) /* operation queued? */
+ {
+ tt->reads.iostate = IOSTATE_QUEUED;
+ tt->reads.status = err;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Read queued [%d]",
+ (int) len);
+ }
+ else /* error occurred */
+ {
+ struct gc_arena gc = gc_new ();
+ ASSERT (SetEvent (tt->reads.overlapped.hEvent));
+ tt->reads.iostate = IOSTATE_IMMEDIATE_RETURN;
+ tt->reads.status = err;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Read error [%d] : %s",
+ (int) len,
+ strerror_win32 (status, &gc));
+ gc_free (&gc);
+ }
+ }
+ }
+ return tt->reads.iostate;
+}
+
+int
+tun_write_queue (struct tuntap *tt, struct buffer *buf)
+{
+ if (tt->writes.iostate == IOSTATE_INITIAL)
+ {
+ BOOL status;
+ int err;
+
+ /* make a private copy of buf */
+ tt->writes.buf = tt->writes.buf_init;
+ tt->writes.buf.len = 0;
+ ASSERT (buf_copy (&tt->writes.buf, buf));
+
+ /* the overlapped write will signal this event on I/O completion */
+ ASSERT (ResetEvent (tt->writes.overlapped.hEvent));
+
+ status = WriteFile(
+ tt->hand,
+ BPTR (&tt->writes.buf),
+ BLEN (&tt->writes.buf),
+ &tt->writes.size,
+ &tt->writes.overlapped
+ );
+
+ if (status) /* operation completed immediately? */
+ {
+ tt->writes.iostate = IOSTATE_IMMEDIATE_RETURN;
+
+ /* since we got an immediate return, we must signal the event object ourselves */
+ ASSERT (SetEvent (tt->writes.overlapped.hEvent));
+
+ tt->writes.status = 0;
+
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Write immediate return [%d,%d]",
+ BLEN (&tt->writes.buf),
+ (int) tt->writes.size);
+ }
+ else
+ {
+ err = GetLastError ();
+ if (err == ERROR_IO_PENDING) /* operation queued? */
+ {
+ tt->writes.iostate = IOSTATE_QUEUED;
+ tt->writes.status = err;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Write queued [%d]",
+ BLEN (&tt->writes.buf));
+ }
+ else /* error occurred */
+ {
+ struct gc_arena gc = gc_new ();
+ ASSERT (SetEvent (tt->writes.overlapped.hEvent));
+ tt->writes.iostate = IOSTATE_IMMEDIATE_RETURN;
+ tt->writes.status = err;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Write error [%d] : %s",
+ BLEN (&tt->writes.buf),
+ strerror_win32 (err, &gc));
+ gc_free (&gc);
+ }
+ }
+ }
+ return tt->writes.iostate;
+}
+
+int
+tun_finalize (
+ HANDLE h,
+ struct overlapped_io *io,
+ struct buffer *buf)
+{
+ int ret = -1;
+ BOOL status;
+
+ switch (io->iostate)
+ {
+ case IOSTATE_QUEUED:
+ status = GetOverlappedResult(
+ h,
+ &io->overlapped,
+ &io->size,
+ FALSE
+ );
+ if (status)
+ {
+ /* successful return for a queued operation */
+ if (buf)
+ *buf = io->buf;
+ ret = io->size;
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Completion success [%d]", ret);
+ }
+ else
+ {
+ /* error during a queued operation */
+ ret = -1;
+ if (GetLastError() != ERROR_IO_INCOMPLETE)
+ {
+ /* if no error (i.e. just not finished yet),
+ then DON'T execute this code */
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+ msg (D_WIN32_IO | M_ERRNO, "WIN32 I/O: TAP Completion error");
+ }
+ }
+ break;
+
+ case IOSTATE_IMMEDIATE_RETURN:
+ io->iostate = IOSTATE_INITIAL;
+ ASSERT (ResetEvent (io->overlapped.hEvent));
+ if (io->status)
+ {
+ /* error return for a non-queued operation */
+ SetLastError (io->status);
+ ret = -1;
+ msg (D_WIN32_IO | M_ERRNO, "WIN32 I/O: TAP Completion non-queued error");
+ }
+ else
+ {
+ /* successful return for a non-queued operation */
+ if (buf)
+ *buf = io->buf;
+ ret = io->size;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Completion non-queued success [%d]", ret);
+ }
+ break;
+
+ case IOSTATE_INITIAL: /* were we called without proper queueing? */
+ SetLastError (ERROR_INVALID_FUNCTION);
+ ret = -1;
+ dmsg (D_WIN32_IO, "WIN32 I/O: TAP Completion BAD STATE");
+ break;
+
+ default:
+ ASSERT (0);
+ }
+
+ if (buf)
+ buf->len = ret;
+ return ret;
+}
+
+const struct tap_reg *
+get_tap_reg (struct gc_arena *gc)
+{
+ HKEY adapter_key;
+ LONG status;
+ DWORD len;
+ struct tap_reg *first = NULL;
+ struct tap_reg *last = NULL;
+ int i = 0;
+
+ status = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,
+ ADAPTER_KEY,
+ 0,
+ KEY_READ,
+ &adapter_key);
+
+ if (status != ERROR_SUCCESS)
+ msg (M_FATAL, "Error opening registry key: %s", ADAPTER_KEY);
+
+ while (true)
+ {
+ char enum_name[256];
+ char unit_string[256];
+ HKEY unit_key;
+ char component_id_string[] = "ComponentId";
+ char component_id[256];
+ char net_cfg_instance_id_string[] = "NetCfgInstanceId";
+ char net_cfg_instance_id[256];
+ DWORD data_type;
+
+ len = sizeof (enum_name);
+ status = RegEnumKeyEx(
+ adapter_key,
+ i,
+ enum_name,
+ &len,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ if (status == ERROR_NO_MORE_ITEMS)
+ break;
+ else if (status != ERROR_SUCCESS)
+ msg (M_FATAL, "Error enumerating registry subkeys of key: %s",
+ ADAPTER_KEY);
+
+ openvpn_snprintf (unit_string, sizeof(unit_string), "%s\\%s",
+ ADAPTER_KEY, enum_name);
+
+ status = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,
+ unit_string,
+ 0,
+ KEY_READ,
+ &unit_key);
+
+ if (status != ERROR_SUCCESS)
+ dmsg (D_REGISTRY, "Error opening registry key: %s", unit_string);
+ else
+ {
+ len = sizeof (component_id);
+ status = RegQueryValueEx(
+ unit_key,
+ component_id_string,
+ NULL,
+ &data_type,
+ component_id,
+ &len);
+
+ if (status != ERROR_SUCCESS || data_type != REG_SZ)
+ dmsg (D_REGISTRY, "Error opening registry key: %s\\%s",
+ unit_string, component_id_string);
+ else
+ {
+ len = sizeof (net_cfg_instance_id);
+ status = RegQueryValueEx(
+ unit_key,
+ net_cfg_instance_id_string,
+ NULL,
+ &data_type,
+ net_cfg_instance_id,
+ &len);
+
+ if (status == ERROR_SUCCESS && data_type == REG_SZ)
+ {
+ if (!strcmp (component_id, TAP_WIN_COMPONENT_ID))
+ {
+ struct tap_reg *reg;
+ ALLOC_OBJ_CLEAR_GC (reg, struct tap_reg, gc);
+ reg->guid = string_alloc (net_cfg_instance_id, gc);
+
+ /* link into return list */
+ if (!first)
+ first = reg;
+ if (last)
+ last->next = reg;
+ last = reg;
+ }
+ }
+ }
+ RegCloseKey (unit_key);
+ }
+ ++i;
+ }
+
+ RegCloseKey (adapter_key);
+ return first;
+}
+
+const struct panel_reg *
+get_panel_reg (struct gc_arena *gc)
+{
+ LONG status;
+ HKEY network_connections_key;
+ DWORD len;
+ struct panel_reg *first = NULL;
+ struct panel_reg *last = NULL;
+ int i = 0;
+
+ status = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,
+ NETWORK_CONNECTIONS_KEY,
+ 0,
+ KEY_READ,
+ &network_connections_key);
+
+ if (status != ERROR_SUCCESS)
+ msg (M_FATAL, "Error opening registry key: %s", NETWORK_CONNECTIONS_KEY);
+
+ while (true)
+ {
+ char enum_name[256];
+ char connection_string[256];
+ HKEY connection_key;
+ WCHAR name_data[256];
+ DWORD name_type;
+ const WCHAR name_string[] = L"Name";
+
+ len = sizeof (enum_name);
+ status = RegEnumKeyEx(
+ network_connections_key,
+ i,
+ enum_name,
+ &len,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ if (status == ERROR_NO_MORE_ITEMS)
+ break;
+ else if (status != ERROR_SUCCESS)
+ msg (M_FATAL, "Error enumerating registry subkeys of key: %s",
+ NETWORK_CONNECTIONS_KEY);
+
+ openvpn_snprintf (connection_string, sizeof(connection_string),
+ "%s\\%s\\Connection",
+ NETWORK_CONNECTIONS_KEY, enum_name);
+
+ status = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,
+ connection_string,
+ 0,
+ KEY_READ,
+ &connection_key);
+
+ if (status != ERROR_SUCCESS)
+ dmsg (D_REGISTRY, "Error opening registry key: %s", connection_string);
+ else
+ {
+ len = sizeof (name_data);
+ status = RegQueryValueExW(
+ connection_key,
+ name_string,
+ NULL,
+ &name_type,
+ (LPBYTE) name_data,
+ &len);
+
+ if (status != ERROR_SUCCESS || name_type != REG_SZ)
+ dmsg (D_REGISTRY, "Error opening registry key: %s\\%s\\%s",
+ NETWORK_CONNECTIONS_KEY, connection_string, name_string);
+ else
+ {
+ int n;
+ LPSTR name;
+ struct panel_reg *reg;
+
+ ALLOC_OBJ_CLEAR_GC (reg, struct panel_reg, gc);
+ n = WideCharToMultiByte (CP_UTF8, 0, name_data, -1, NULL, 0, NULL, NULL);
+ name = gc_malloc (n, false, gc);
+ WideCharToMultiByte (CP_UTF8, 0, name_data, -1, name, n, NULL, NULL);
+ reg->name = name;
+ reg->guid = string_alloc (enum_name, gc);
+
+ /* link into return list */
+ if (!first)
+ first = reg;
+ if (last)
+ last->next = reg;
+ last = reg;
+ }
+ RegCloseKey (connection_key);
+ }
+ ++i;
+ }
+
+ RegCloseKey (network_connections_key);
+
+ return first;
+}
+
+/*
+ * Check that two addresses are part of the same 255.255.255.252 subnet.
+ */
+void
+verify_255_255_255_252 (in_addr_t local, in_addr_t remote)
+{
+ struct gc_arena gc = gc_new ();
+ const unsigned int mask = 3;
+ const char *err = NULL;
+
+ if (local == remote)
+ {
+ err = "must be different";
+ goto error;
+ }
+ if ((local & (~mask)) != (remote & (~mask)))
+ {
+ err = "must exist within the same 255.255.255.252 subnet. This is a limitation of --dev tun when used with the TAP-WIN32 driver";
+ goto error;
+ }
+ if ((local & mask) == 0
+ || (local & mask) == 3
+ || (remote & mask) == 0
+ || (remote & mask) == 3)
+ {
+ err = "cannot use the first or last address within a given 255.255.255.252 subnet. This is a limitation of --dev tun when used with the TAP-WIN32 driver";
+ goto error;
+ }
+
+ gc_free (&gc);
+ return;
+
+ error:
+ msg (M_FATAL, "There is a problem in your selection of --ifconfig endpoints [local=%s, remote=%s]. The local and remote VPN endpoints %s. Try '" PACKAGE " --show-valid-subnets' option for more info.",
+ print_in_addr_t (local, 0, &gc),
+ print_in_addr_t (remote, 0, &gc),
+ err);
+ gc_free (&gc);
+}
+
+void show_valid_win32_tun_subnets (void)
+{
+ int i;
+ int col = 0;
+
+ printf ("On Windows, point-to-point IP support (i.e. --dev tun)\n");
+ printf ("is emulated by the TAP-Windows driver. The major limitation\n");
+ printf ("imposed by this approach is that the --ifconfig local and\n");
+ printf ("remote endpoints must be part of the same 255.255.255.252\n");
+ printf ("subnet. The following list shows examples of endpoint\n");
+ printf ("pairs which satisfy this requirement. Only the final\n");
+ printf ("component of the IP address pairs is at issue.\n\n");
+ printf ("As an example, the following option would be correct:\n");
+ printf (" --ifconfig 10.7.0.5 10.7.0.6 (on host A)\n");
+ printf (" --ifconfig 10.7.0.6 10.7.0.5 (on host B)\n");
+ printf ("because [5,6] is part of the below list.\n\n");
+
+ for (i = 0; i < 256; i += 4)
+ {
+ printf("[%3d,%3d] ", i+1, i+2);
+ if (++col > 4)
+ {
+ col = 0;
+ printf ("\n");
+ }
+ }
+ if (col)
+ printf ("\n");
+}
+
+void
+show_tap_win_adapters (int msglev, int warnlev)
+{
+ struct gc_arena gc = gc_new ();
+
+ bool warn_panel_null = false;
+ bool warn_panel_dup = false;
+ bool warn_tap_dup = false;
+
+ int links;
+
+ const struct tap_reg *tr;
+ const struct tap_reg *tr1;
+ const struct panel_reg *pr;
+
+ const struct tap_reg *tap_reg = get_tap_reg (&gc);
+ const struct panel_reg *panel_reg = get_panel_reg (&gc);
+
+ msg (msglev, "Available TAP-WIN32 adapters [name, GUID]:");
+
+ /* loop through each TAP-Windows adapter registry entry */
+ for (tr = tap_reg; tr != NULL; tr = tr->next)
+ {
+ links = 0;
+
+ /* loop through each network connections entry in the control panel */
+ for (pr = panel_reg; pr != NULL; pr = pr->next)
+ {
+ if (!strcmp (tr->guid, pr->guid))
+ {
+ msg (msglev, "'%s' %s", pr->name, tr->guid);
+ ++links;
+ }
+ }
+
+ if (links > 1)
+ {
+ warn_panel_dup = true;
+ }
+ else if (links == 0)
+ {
+ /* a TAP adapter exists without a link from the network
+ connections control panel */
+ warn_panel_null = true;
+ msg (msglev, "[NULL] %s", tr->guid);
+ }
+ }
+
+ /* check for TAP-Windows adapter duplicated GUIDs */
+ for (tr = tap_reg; tr != NULL; tr = tr->next)
+ {
+ for (tr1 = tap_reg; tr1 != NULL; tr1 = tr1->next)
+ {
+ if (tr != tr1 && !strcmp (tr->guid, tr1->guid))
+ warn_tap_dup = true;
+ }
+ }
+
+ /* warn on registry inconsistencies */
+ if (warn_tap_dup)
+ msg (warnlev, "WARNING: Some TAP-Windows adapters have duplicate GUIDs");
+
+ if (warn_panel_dup)
+ msg (warnlev, "WARNING: Some TAP-Windows adapters have duplicate links from the Network Connections control panel");
+
+ if (warn_panel_null)
+ msg (warnlev, "WARNING: Some TAP-Windows adapters have no link from the Network Connections control panel");
+
+ gc_free (&gc);
+}
+
+/*
+ * Confirm that GUID is a TAP-Windows adapter.
+ */
+static bool
+is_tap_win (const char *guid, const struct tap_reg *tap_reg)
+{
+ const struct tap_reg *tr;
+
+ for (tr = tap_reg; tr != NULL; tr = tr->next)
+ {
+ if (guid && !strcmp (tr->guid, guid))
+ return true;
+ }
+
+ return false;
+}
+
+static const char *
+guid_to_name (const char *guid, const struct panel_reg *panel_reg)
+{
+ const struct panel_reg *pr;
+
+ for (pr = panel_reg; pr != NULL; pr = pr->next)
+ {
+ if (guid && !strcmp (pr->guid, guid))
+ return pr->name;
+ }
+
+ return NULL;
+}
+
+static const char *
+name_to_guid (const char *name, const struct tap_reg *tap_reg, const struct panel_reg *panel_reg)
+{
+ const struct panel_reg *pr;
+
+ for (pr = panel_reg; pr != NULL; pr = pr->next)
+ {
+ if (name && !strcmp (pr->name, name) && is_tap_win (pr->guid, tap_reg))
+ return pr->guid;
+ }
+
+ return NULL;
+}
+
+static void
+at_least_one_tap_win (const struct tap_reg *tap_reg)
+{
+ if (!tap_reg)
+ msg (M_FATAL, "There are no TAP-Windows adapters on this system. You should be able to create a TAP-Windows adapter by going to Start -> All Programs -> TAP-Windows -> Utilities -> Add a new TAP-Windows virtual ethernet adapter.");
+}
+
+/*
+ * Get an adapter GUID and optional actual_name from the
+ * registry for the TAP device # = device_number.
+ */
+static const char *
+get_unspecified_device_guid (const int device_number,
+ char *actual_name,
+ int actual_name_size,
+ const struct tap_reg *tap_reg_src,
+ const struct panel_reg *panel_reg_src,
+ struct gc_arena *gc)
+{
+ const struct tap_reg *tap_reg = tap_reg_src;
+ struct buffer ret = clear_buf ();
+ struct buffer actual = clear_buf ();
+ int i;
+
+ ASSERT (device_number >= 0);
+
+ /* Make sure we have at least one TAP adapter */
+ if (!tap_reg)
+ return NULL;
+
+ /* The actual_name output buffer may be NULL */
+ if (actual_name)
+ {
+ ASSERT (actual_name_size > 0);
+ buf_set_write (&actual, actual_name, actual_name_size);
+ }
+
+ /* Move on to specified device number */
+ for (i = 0; i < device_number; i++)
+ {
+ tap_reg = tap_reg->next;
+ if (!tap_reg)
+ return NULL;
+ }
+
+ /* Save Network Panel name (if exists) in actual_name */
+ if (actual_name)
+ {
+ const char *act = guid_to_name (tap_reg->guid, panel_reg_src);
+ if (act)
+ buf_printf (&actual, "%s", act);
+ else
+ buf_printf (&actual, "%s", tap_reg->guid);
+ }
+
+ /* Save GUID for return value */
+ ret = alloc_buf_gc (256, gc);
+ buf_printf (&ret, "%s", tap_reg->guid);
+ return BSTR (&ret);
+}
+
+/*
+ * Lookup a --dev-node adapter name in the registry
+ * returning the GUID and optional actual_name.
+ */
+static const char *
+get_device_guid (const char *name,
+ char *actual_name,
+ int actual_name_size,
+ const struct tap_reg *tap_reg,
+ const struct panel_reg *panel_reg,
+ struct gc_arena *gc)
+{
+ struct buffer ret = alloc_buf_gc (256, gc);
+ struct buffer actual = clear_buf ();
+
+ /* Make sure we have at least one TAP adapter */
+ if (!tap_reg)
+ return NULL;
+
+ /* The actual_name output buffer may be NULL */
+ if (actual_name)
+ {
+ ASSERT (actual_name_size > 0);
+ buf_set_write (&actual, actual_name, actual_name_size);
+ }
+
+ /* Check if GUID was explicitly specified as --dev-node parameter */
+ if (is_tap_win (name, tap_reg))
+ {
+ const char *act = guid_to_name (name, panel_reg);
+ buf_printf (&ret, "%s", name);
+ if (act)
+ buf_printf (&actual, "%s", act);
+ else
+ buf_printf (&actual, "%s", name);
+ return BSTR (&ret);
+ }
+
+ /* Lookup TAP adapter in network connections list */
+ {
+ const char *guid = name_to_guid (name, tap_reg, panel_reg);
+ if (guid)
+ {
+ buf_printf (&actual, "%s", name);
+ buf_printf (&ret, "%s", guid);
+ return BSTR (&ret);
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * Get adapter info list
+ */
+const IP_ADAPTER_INFO *
+get_adapter_info_list (struct gc_arena *gc)
+{
+ ULONG size = 0;
+ IP_ADAPTER_INFO *pi = NULL;
+ DWORD status;
+
+ if ((status = GetAdaptersInfo (NULL, &size)) != ERROR_BUFFER_OVERFLOW)
+ {
+ msg (M_INFO, "GetAdaptersInfo #1 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ else
+ {
+ pi = (PIP_ADAPTER_INFO) gc_malloc (size, false, gc);
+ if ((status = GetAdaptersInfo (pi, &size)) == NO_ERROR)
+ return pi;
+ else
+ {
+ msg (M_INFO, "GetAdaptersInfo #2 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ }
+ return pi;
+}
+
+const IP_PER_ADAPTER_INFO *
+get_per_adapter_info (const DWORD index, struct gc_arena *gc)
+{
+ ULONG size = 0;
+ IP_PER_ADAPTER_INFO *pi = NULL;
+ DWORD status;
+
+ if (index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ if ((status = GetPerAdapterInfo (index, NULL, &size)) != ERROR_BUFFER_OVERFLOW)
+ {
+ msg (M_INFO, "GetPerAdapterInfo #1 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ else
+ {
+ pi = (PIP_PER_ADAPTER_INFO) gc_malloc (size, false, gc);
+ if ((status = GetPerAdapterInfo ((ULONG)index, pi, &size)) == ERROR_SUCCESS)
+ return pi;
+ else
+ {
+ msg (M_INFO, "GetPerAdapterInfo #2 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ }
+ }
+ return pi;
+}
+
+static const IP_INTERFACE_INFO *
+get_interface_info_list (struct gc_arena *gc)
+{
+ ULONG size = 0;
+ IP_INTERFACE_INFO *ii = NULL;
+ DWORD status;
+
+ if ((status = GetInterfaceInfo (NULL, &size)) != ERROR_INSUFFICIENT_BUFFER)
+ {
+ msg (M_INFO, "GetInterfaceInfo #1 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ else
+ {
+ ii = (PIP_INTERFACE_INFO) gc_malloc (size, false, gc);
+ if ((status = GetInterfaceInfo (ii, &size)) == NO_ERROR)
+ return ii;
+ else
+ {
+ msg (M_INFO, "GetInterfaceInfo #2 failed (status=%u) : %s",
+ (unsigned int)status,
+ strerror_win32 (status, gc));
+ }
+ }
+ return ii;
+}
+
+static const IP_ADAPTER_INDEX_MAP *
+get_interface_info (DWORD index, struct gc_arena *gc)
+{
+ const IP_INTERFACE_INFO *list = get_interface_info_list (gc);
+ if (list)
+ {
+ int i;
+ for (i = 0; i < list->NumAdapters; ++i)
+ {
+ const IP_ADAPTER_INDEX_MAP *inter = &list->Adapter[i];
+ if (index == inter->Index)
+ return inter;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Given an adapter index, return a pointer to the
+ * IP_ADAPTER_INFO structure for that adapter.
+ */
+
+const IP_ADAPTER_INFO *
+get_adapter (const IP_ADAPTER_INFO *ai, DWORD index)
+{
+ if (ai && index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ const IP_ADAPTER_INFO *a;
+
+ /* find index in the linked list */
+ for (a = ai; a != NULL; a = a->Next)
+ {
+ if (a->Index == index)
+ return a;
+ }
+ }
+ return NULL;
+}
+
+const IP_ADAPTER_INFO *
+get_adapter_info (DWORD index, struct gc_arena *gc)
+{
+ return get_adapter (get_adapter_info_list (gc), index);
+}
+
+static int
+get_adapter_n_ip_netmask (const IP_ADAPTER_INFO *ai)
+{
+ if (ai)
+ {
+ int n = 0;
+ const IP_ADDR_STRING *ip = &ai->IpAddressList;
+
+ while (ip)
+ {
+ ++n;
+ ip = ip->Next;
+ }
+ return n;
+ }
+ else
+ return 0;
+}
+
+static bool
+get_adapter_ip_netmask (const IP_ADAPTER_INFO *ai, const int n, in_addr_t *ip, in_addr_t *netmask)
+{
+ bool ret = false;
+ *ip = 0;
+ *netmask = 0;
+
+ if (ai)
+ {
+ const IP_ADDR_STRING *iplist = &ai->IpAddressList;
+ int i = 0;
+
+ while (iplist)
+ {
+ if (i == n)
+ break;
+ ++i;
+ iplist = iplist->Next;
+ }
+
+ if (iplist)
+ {
+ const unsigned int getaddr_flags = GETADDR_HOST_ORDER;
+ const char *ip_str = iplist->IpAddress.String;
+ const char *netmask_str = iplist->IpMask.String;
+ bool succeed1 = false;
+ bool succeed2 = false;
+
+ if (ip_str && netmask_str && strlen (ip_str) && strlen (netmask_str))
+ {
+ *ip = getaddr (getaddr_flags, ip_str, 0, &succeed1, NULL);
+ *netmask = getaddr (getaddr_flags, netmask_str, 0, &succeed2, NULL);
+ ret = (succeed1 == true && succeed2 == true);
+ }
+ }
+ }
+
+ return ret;
+}
+
+static bool
+test_adapter_ip_netmask (const IP_ADAPTER_INFO *ai, const in_addr_t ip, const in_addr_t netmask)
+{
+ if (ai)
+ {
+ in_addr_t ip_adapter = 0;
+ in_addr_t netmask_adapter = 0;
+ const bool status = get_adapter_ip_netmask (ai, 0, &ip_adapter, &netmask_adapter);
+ return (status && ip_adapter == ip && netmask_adapter == netmask);
+ }
+ else
+ return false;
+}
+
+const IP_ADAPTER_INFO *
+get_tun_adapter (const struct tuntap *tt, const IP_ADAPTER_INFO *list)
+{
+ if (list && tt)
+ return get_adapter (list, tt->adapter_index);
+ else
+ return NULL;
+}
+
+bool
+is_adapter_up (const struct tuntap *tt, const IP_ADAPTER_INFO *list)
+{
+ int i;
+ bool ret = false;
+
+ const IP_ADAPTER_INFO *ai = get_tun_adapter (tt, list);
+
+ if (ai)
+ {
+ const int n = get_adapter_n_ip_netmask (ai);
+
+ /* loop once for every IP/netmask assigned to adapter */
+ for (i = 0; i < n; ++i)
+ {
+ in_addr_t ip, netmask;
+ if (get_adapter_ip_netmask (ai, i, &ip, &netmask))
+ {
+ if (tt->local && tt->adapter_netmask)
+ {
+ /* wait for our --ifconfig parms to match the actual adapter parms */
+ if (tt->local == ip && tt->adapter_netmask == netmask)
+ ret = true;
+ }
+ else
+ {
+ /* --ifconfig was not defined, maybe using a real DHCP server */
+ if (ip && netmask)
+ ret = true;
+ }
+ }
+ }
+ }
+ else
+ ret = true; /* this can occur when TAP adapter is bridged */
+
+ return ret;
+}
+
+bool
+is_ip_in_adapter_subnet (const IP_ADAPTER_INFO *ai, const in_addr_t ip, in_addr_t *highest_netmask)
+{
+ int i;
+ bool ret = false;
+
+ if (highest_netmask)
+ *highest_netmask = 0;
+
+ if (ai)
+ {
+ const int n = get_adapter_n_ip_netmask (ai);
+ for (i = 0; i < n; ++i)
+ {
+ in_addr_t adapter_ip, adapter_netmask;
+ if (get_adapter_ip_netmask (ai, i, &adapter_ip, &adapter_netmask))
+ {
+ if (adapter_ip && adapter_netmask && (ip & adapter_netmask) == (adapter_ip & adapter_netmask))
+ {
+ if (highest_netmask && adapter_netmask > *highest_netmask)
+ *highest_netmask = adapter_netmask;
+ ret = true;
+ }
+ }
+ }
+ }
+ return ret;
+}
+
+DWORD
+adapter_index_of_ip (const IP_ADAPTER_INFO *list,
+ const in_addr_t ip,
+ int *count,
+ in_addr_t *netmask)
+{
+ struct gc_arena gc = gc_new ();
+ DWORD ret = TUN_ADAPTER_INDEX_INVALID;
+ in_addr_t highest_netmask = 0;
+ bool first = true;
+
+ if (count)
+ *count = 0;
+
+ while (list)
+ {
+ in_addr_t hn;
+
+ if (is_ip_in_adapter_subnet (list, ip, &hn))
+ {
+ if (first || hn > highest_netmask)
+ {
+ highest_netmask = hn;
+ if (count)
+ *count = 1;
+ ret = list->Index;
+ first = false;
+ }
+ else if (hn == highest_netmask)
+ {
+ if (count)
+ ++*count;
+ }
+ }
+ list = list->Next;
+ }
+
+ dmsg (D_ROUTE_DEBUG, "DEBUG: IP Locate: ip=%s nm=%s index=%d count=%d",
+ print_in_addr_t (ip, 0, &gc),
+ print_in_addr_t (highest_netmask, 0, &gc),
+ (int)ret,
+ count ? *count : -1);
+
+ if (ret == TUN_ADAPTER_INDEX_INVALID && count)
+ *count = 0;
+
+ if (netmask)
+ *netmask = highest_netmask;
+
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Given an adapter index, return true if the adapter
+ * is DHCP disabled.
+ */
+
+#define DHCP_STATUS_UNDEF 0
+#define DHCP_STATUS_ENABLED 1
+#define DHCP_STATUS_DISABLED 2
+
+static int
+dhcp_status (DWORD index)
+{
+ struct gc_arena gc = gc_new ();
+ int ret = DHCP_STATUS_UNDEF;
+ if (index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ const IP_ADAPTER_INFO *ai = get_adapter_info (index, &gc);
+
+ if (ai)
+ {
+ if (ai->DhcpEnabled)
+ ret = DHCP_STATUS_ENABLED;
+ else
+ ret = DHCP_STATUS_DISABLED;
+ }
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+/*
+ * Delete all temporary address/netmask pairs which were added
+ * to adapter (given by index) by previous calls to AddIPAddress.
+ */
+static void
+delete_temp_addresses (DWORD index)
+{
+ struct gc_arena gc = gc_new ();
+ const IP_ADAPTER_INFO *a = get_adapter_info (index, &gc);
+
+ if (a)
+ {
+ const IP_ADDR_STRING *ip = &a->IpAddressList;
+ while (ip)
+ {
+ DWORD status;
+ const DWORD context = ip->Context;
+
+ if ((status = DeleteIPAddress ((ULONG) context)) == NO_ERROR)
+ {
+ msg (M_INFO, "Successfully deleted previously set dynamic IP/netmask: %s/%s",
+ ip->IpAddress.String,
+ ip->IpMask.String);
+ }
+ else
+ {
+ const char *empty = "0.0.0.0";
+ if (strcmp (ip->IpAddress.String, empty)
+ || strcmp (ip->IpMask.String, empty))
+ msg (M_INFO, "NOTE: could not delete previously set dynamic IP/netmask: %s/%s (status=%u)",
+ ip->IpAddress.String,
+ ip->IpMask.String,
+ (unsigned int)status);
+ }
+ ip = ip->Next;
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Get interface index for use with IP Helper API functions.
+ */
+static DWORD
+get_adapter_index_method_1 (const char *guid)
+{
+ DWORD index;
+ ULONG aindex;
+ wchar_t wbuf[256];
+ _snwprintf (wbuf, SIZE (wbuf), L"\\DEVICE\\TCPIP_%S", guid);
+ wbuf [SIZE(wbuf) - 1] = 0;
+ if (GetAdapterIndex (wbuf, &aindex) != NO_ERROR)
+ index = TUN_ADAPTER_INDEX_INVALID;
+ else
+ index = (DWORD)aindex;
+ return index;
+}
+
+static DWORD
+get_adapter_index_method_2 (const char *guid)
+{
+ struct gc_arena gc = gc_new ();
+ DWORD index = TUN_ADAPTER_INDEX_INVALID;
+
+ const IP_ADAPTER_INFO *list = get_adapter_info_list (&gc);
+
+ while (list)
+ {
+ if (!strcmp (guid, list->AdapterName))
+ {
+ index = list->Index;
+ break;
+ }
+ list = list->Next;
+ }
+
+ gc_free (&gc);
+ return index;
+}
+
+static DWORD
+get_adapter_index (const char *guid)
+{
+ DWORD index;
+ index = get_adapter_index_method_1 (guid);
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ index = get_adapter_index_method_2 (guid);
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ msg (M_INFO, "NOTE: could not get adapter index for %s", guid);
+ return index;
+}
+
+static DWORD
+get_adapter_index_flexible (const char *name) /* actual name or GUID */
+{
+ struct gc_arena gc = gc_new ();
+ DWORD index;
+ index = get_adapter_index_method_1 (name);
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ index = get_adapter_index_method_2 (name);
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ {
+ const struct tap_reg *tap_reg = get_tap_reg (&gc);
+ const struct panel_reg *panel_reg = get_panel_reg (&gc);
+ const char *guid = name_to_guid (name, tap_reg, panel_reg);
+ index = get_adapter_index_method_1 (guid);
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ index = get_adapter_index_method_2 (guid);
+ }
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ msg (M_INFO, "NOTE: could not get adapter index for name/GUID '%s'", name);
+ gc_free (&gc);
+ return index;
+}
+
+/*
+ * Return a string representing a PIP_ADDR_STRING
+ */
+static const char *
+format_ip_addr_string (const IP_ADDR_STRING *ip, struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ while (ip)
+ {
+ buf_printf (&out, "%s", ip->IpAddress.String);
+ if (strlen (ip->IpMask.String))
+ {
+ buf_printf (&out, "/");
+ buf_printf (&out, "%s", ip->IpMask.String);
+ }
+ buf_printf (&out, " ");
+ ip = ip->Next;
+ }
+ return BSTR (&out);
+}
+
+/*
+ * Show info for a single adapter
+ */
+static void
+show_adapter (int msglev, const IP_ADAPTER_INFO *a, struct gc_arena *gc)
+{
+ msg (msglev, "%s", a->Description);
+ msg (msglev, " Index = %d", (int)a->Index);
+ msg (msglev, " GUID = %s", a->AdapterName);
+ msg (msglev, " IP = %s", format_ip_addr_string (&a->IpAddressList, gc));
+ msg (msglev, " MAC = %s", format_hex_ex (a->Address, a->AddressLength, 0, 1, ":", gc));
+ msg (msglev, " GATEWAY = %s", format_ip_addr_string (&a->GatewayList, gc));
+ if (a->DhcpEnabled)
+ {
+ msg (msglev, " DHCP SERV = %s", format_ip_addr_string (&a->DhcpServer, gc));
+ msg (msglev, " DHCP LEASE OBTAINED = %s", time_string (a->LeaseObtained, 0, false, gc));
+ msg (msglev, " DHCP LEASE EXPIRES = %s", time_string (a->LeaseExpires, 0, false, gc));
+ }
+ if (a->HaveWins)
+ {
+ msg (msglev, " PRI WINS = %s", format_ip_addr_string (&a->PrimaryWinsServer, gc));
+ msg (msglev, " SEC WINS = %s", format_ip_addr_string (&a->SecondaryWinsServer, gc));
+ }
+
+ {
+ const IP_PER_ADAPTER_INFO *pai = get_per_adapter_info (a->Index, gc);
+ if (pai)
+ {
+ msg (msglev, " DNS SERV = %s", format_ip_addr_string (&pai->DnsServerList, gc));
+ }
+ }
+}
+
+/*
+ * Show current adapter list
+ */
+void
+show_adapters (int msglev)
+{
+ struct gc_arena gc = gc_new ();
+ const IP_ADAPTER_INFO *ai = get_adapter_info_list (&gc);
+
+ msg (msglev, "SYSTEM ADAPTER LIST");
+ if (ai)
+ {
+ const IP_ADAPTER_INFO *a;
+
+ /* find index in the linked list */
+ for (a = ai; a != NULL; a = a->Next)
+ {
+ show_adapter (msglev, a, &gc);
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Set a particular TAP-Windows adapter (or all of them if
+ * adapter_name == NULL) to allow it to be opened from
+ * a non-admin account. This setting will only persist
+ * for the lifetime of the device object.
+ */
+
+static void
+tap_allow_nonadmin_access_handle (const char *device_path, HANDLE hand)
+{
+ struct security_attributes sa;
+ BOOL status;
+
+ if (!init_security_attributes_allow_all (&sa))
+ msg (M_ERR, "Error: init SA failed");
+
+ status = SetKernelObjectSecurity (hand, DACL_SECURITY_INFORMATION, &sa.sd);
+ if (!status)
+ {
+ msg (M_ERRNO, "Error: SetKernelObjectSecurity failed on %s", device_path);
+ }
+ else
+ {
+ msg (M_INFO|M_NOPREFIX, "TAP-Windows device: %s [Non-admin access allowed]", device_path);
+ }
+}
+
+void
+tap_allow_nonadmin_access (const char *dev_node)
+{
+ struct gc_arena gc = gc_new ();
+ const struct tap_reg *tap_reg = get_tap_reg (&gc);
+ const struct panel_reg *panel_reg = get_panel_reg (&gc);
+ const char *device_guid = NULL;
+ HANDLE hand;
+ char actual_buffer[256];
+ char device_path[256];
+
+ at_least_one_tap_win (tap_reg);
+
+ if (dev_node)
+ {
+ /* Get the device GUID for the device specified with --dev-node. */
+ device_guid = get_device_guid (dev_node, actual_buffer, sizeof (actual_buffer), tap_reg, panel_reg, &gc);
+
+ if (!device_guid)
+ msg (M_FATAL, "TAP-Windows adapter '%s' not found", dev_node);
+
+ /* Open Windows TAP-Windows adapter */
+ openvpn_snprintf (device_path, sizeof(device_path), "%s%s%s",
+ USERMODEDEVICEDIR,
+ device_guid,
+ TAP_WIN_SUFFIX);
+
+ hand = CreateFile (
+ device_path,
+ MAXIMUM_ALLOWED,
+ 0, /* was: FILE_SHARE_READ */
+ 0,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
+ 0
+ );
+
+ if (hand == INVALID_HANDLE_VALUE)
+ msg (M_ERR, "CreateFile failed on TAP device: %s", device_path);
+
+ tap_allow_nonadmin_access_handle (device_path, hand);
+ CloseHandle (hand);
+ }
+ else
+ {
+ int device_number = 0;
+
+ /* Try opening all TAP devices */
+ while (true)
+ {
+ device_guid = get_unspecified_device_guid (device_number,
+ actual_buffer,
+ sizeof (actual_buffer),
+ tap_reg,
+ panel_reg,
+ &gc);
+
+ if (!device_guid)
+ break;
+
+ /* Open Windows TAP-Windows adapter */
+ openvpn_snprintf (device_path, sizeof(device_path), "%s%s%s",
+ USERMODEDEVICEDIR,
+ device_guid,
+ TAP_WIN_SUFFIX);
+
+ hand = CreateFile (
+ device_path,
+ MAXIMUM_ALLOWED,
+ 0, /* was: FILE_SHARE_READ */
+ 0,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
+ 0
+ );
+
+ if (hand == INVALID_HANDLE_VALUE)
+ msg (M_WARN, "CreateFile failed on TAP device: %s", device_path);
+ else
+ {
+ tap_allow_nonadmin_access_handle (device_path, hand);
+ CloseHandle (hand);
+ }
+
+ device_number++;
+ }
+ }
+ gc_free (&gc);
+}
+
+/*
+ * DHCP release/renewal
+ */
+bool
+dhcp_release_by_adapter_index(const DWORD adapter_index)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+ const IP_ADAPTER_INDEX_MAP *inter = get_interface_info (adapter_index, &gc);
+
+ if (inter)
+ {
+ DWORD status = IpReleaseAddress ((IP_ADAPTER_INDEX_MAP *)inter);
+ if (status == NO_ERROR)
+ {
+ msg (D_TUNTAP_INFO, "TAP: DHCP address released");
+ ret = true;
+ }
+ else
+ msg (M_WARN, "NOTE: Release of DHCP-assigned IP address lease on TAP-Windows adapter failed: %s (code=%u)",
+ strerror_win32 (status, &gc),
+ (unsigned int)status);
+ }
+
+ gc_free (&gc);
+ return ret;
+}
+
+static bool
+dhcp_release (const struct tuntap *tt)
+{
+ if (tt && tt->options.ip_win32_type == IPW32_SET_DHCP_MASQ && tt->adapter_index != TUN_ADAPTER_INDEX_INVALID)
+ return dhcp_release_by_adapter_index (tt->adapter_index);
+ else
+ return false;
+}
+
+bool
+dhcp_renew_by_adapter_index (const DWORD adapter_index)
+{
+ struct gc_arena gc = gc_new ();
+ bool ret = false;
+ const IP_ADAPTER_INDEX_MAP *inter = get_interface_info (adapter_index, &gc);
+
+ if (inter)
+ {
+ DWORD status = IpRenewAddress ((IP_ADAPTER_INDEX_MAP *)inter);
+ if (status == NO_ERROR)
+ {
+ msg (D_TUNTAP_INFO, "TAP: DHCP address renewal succeeded");
+ ret = true;
+ }
+ else
+ msg (M_WARN, "WARNING: Failed to renew DHCP IP address lease on TAP-Windows adapter: %s (code=%u)",
+ strerror_win32 (status, &gc),
+ (unsigned int)status);
+ }
+ gc_free (&gc);
+ return ret;
+}
+
+static bool
+dhcp_renew (const struct tuntap *tt)
+{
+ if (tt && tt->options.ip_win32_type == IPW32_SET_DHCP_MASQ && tt->adapter_index != TUN_ADAPTER_INDEX_INVALID)
+ return dhcp_renew_by_adapter_index (tt->adapter_index);
+ else
+ return false;
+}
+
+/*
+ * netsh functions
+ */
+
+static void
+netsh_command (const struct argv *a, int n)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ {
+ bool status;
+ openvpn_sleep (1);
+ netcmd_semaphore_lock ();
+ argv_msg_prefix (M_INFO, a, "NETSH");
+ status = openvpn_execve_check (a, NULL, 0, "ERROR: netsh command failed");
+ netcmd_semaphore_release ();
+ if (status)
+ return;
+ openvpn_sleep (4);
+ }
+ msg (M_FATAL, "NETSH: command failed");
+}
+
+void
+ipconfig_register_dns (const struct env_set *es)
+{
+ struct argv argv;
+ bool status;
+ const char err[] = "ERROR: Windows ipconfig command failed";
+
+ msg (D_TUNTAP_INFO, "Start net commands...");
+ netcmd_semaphore_lock ();
+
+ argv_init (&argv);
+
+ argv_printf (&argv, "%s%sc stop dnscache",
+ get_win_sys_path(),
+ WIN_NET_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
+ argv_printf (&argv, "%s%sc start dnscache",
+ get_win_sys_path(),
+ WIN_NET_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
+ argv_printf (&argv, "%s%sc /flushdns",
+ get_win_sys_path(),
+ WIN_IPCONFIG_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
+ argv_printf (&argv, "%s%sc /registerdns",
+ get_win_sys_path(),
+ WIN_IPCONFIG_PATH_SUFFIX);
+ argv_msg (D_TUNTAP_INFO, &argv);
+ status = openvpn_execve_check (&argv, es, 0, err);
+ argv_reset(&argv);
+
+ netcmd_semaphore_release ();
+ msg (D_TUNTAP_INFO, "End net commands...");
+}
+
+void
+ip_addr_string_to_array (in_addr_t *dest, int *dest_len, const IP_ADDR_STRING *src)
+{
+ int i = 0;
+ while (src)
+ {
+ const unsigned int getaddr_flags = GETADDR_HOST_ORDER;
+ const char *ip_str = src->IpAddress.String;
+ in_addr_t ip = 0;
+ bool succeed = false;
+
+ if (i >= *dest_len)
+ break;
+ if (!ip_str || !strlen (ip_str))
+ break;
+
+ ip = getaddr (getaddr_flags, ip_str, 0, &succeed, NULL);
+ if (!succeed)
+ break;
+ dest[i++] = ip;
+
+ src = src->Next;
+ }
+ *dest_len = i;
+
+#if 0
+ {
+ struct gc_arena gc = gc_new ();
+ msg (M_INFO, "ip_addr_string_to_array [%d]", *dest_len);
+ for (i = 0; i < *dest_len; ++i)
+ {
+ msg (M_INFO, "%s", print_in_addr_t (dest[i], 0, &gc));
+ }
+ gc_free (&gc);
+ }
+#endif
+}
+
+static bool
+ip_addr_one_to_one (const in_addr_t *a1, const int a1len, const IP_ADDR_STRING *ias)
+{
+ in_addr_t a2[8];
+ int a2len = SIZE(a2);
+ int i;
+
+ ip_addr_string_to_array (a2, &a2len, ias);
+ /*msg (M_INFO, "a1len=%d a2len=%d", a1len, a2len);*/
+ if (a1len != a2len)
+ return false;
+
+ for (i = 0; i < a1len; ++i)
+ {
+ if (a1[i] != a2[i])
+ return false;
+ }
+ return true;
+}
+
+static bool
+ip_addr_member_of (const in_addr_t addr, const IP_ADDR_STRING *ias)
+{
+ in_addr_t aa[8];
+ int len = SIZE(aa);
+ int i;
+
+ ip_addr_string_to_array (aa, &len, ias);
+ for (i = 0; i < len; ++i)
+ {
+ if (addr == aa[i])
+ return true;
+ }
+ return false;
+}
+
+static void
+netsh_ifconfig_options (const char *type,
+ const in_addr_t *addr_list,
+ const int addr_len,
+ const IP_ADDR_STRING *current,
+ const char *flex_name,
+ const bool test_first)
+{
+ struct gc_arena gc = gc_new ();
+ struct argv argv = argv_new ();
+ bool delete_first = false;
+
+ /* first check if we should delete existing DNS/WINS settings from TAP interface */
+ if (test_first)
+ {
+ if (!ip_addr_one_to_one (addr_list, addr_len, current))
+ delete_first = true;
+ }
+ else
+ delete_first = true;
+
+ /* delete existing DNS/WINS settings from TAP interface */
+ if (delete_first)
+ {
+ argv_printf (&argv, "%s%sc interface ip delete %s %s all",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ type,
+ flex_name);
+ netsh_command (&argv, 2);
+ }
+
+ /* add new DNS/WINS settings to TAP interface */
+ {
+ int count = 0;
+ int i;
+ for (i = 0; i < addr_len; ++i)
+ {
+ if (delete_first || !test_first || !ip_addr_member_of (addr_list[i], current))
+ {
+ const char *fmt = count ?
+ "%s%sc interface ip add %s %s %s"
+ : "%s%sc interface ip set %s %s static %s";
+
+ argv_printf (&argv, fmt,
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ type,
+ flex_name,
+ print_in_addr_t (addr_list[i], 0, &gc));
+ netsh_command (&argv, 2);
+
+ ++count;
+ }
+ else
+ {
+ msg (M_INFO, "NETSH: \"%s\" %s %s [already set]",
+ flex_name,
+ type,
+ print_in_addr_t (addr_list[i], 0, &gc));
+ }
+ }
+ }
+
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+static void
+init_ip_addr_string2 (IP_ADDR_STRING *dest, const IP_ADDR_STRING *src1, const IP_ADDR_STRING *src2)
+{
+ CLEAR (dest[0]);
+ CLEAR (dest[1]);
+ if (src1)
+ {
+ dest[0] = *src1;
+ dest[0].Next = NULL;
+ }
+ if (src2)
+ {
+ dest[1] = *src2;
+ dest[0].Next = &dest[1];
+ dest[1].Next = NULL;
+ }
+}
+
+static void
+netsh_ifconfig (const struct tuntap_options *to,
+ const char *flex_name,
+ const in_addr_t ip,
+ const in_addr_t netmask,
+ const unsigned int flags)
+{
+ struct gc_arena gc = gc_new ();
+ struct argv argv = argv_new ();
+ const IP_ADAPTER_INFO *ai = NULL;
+ const IP_PER_ADAPTER_INFO *pai = NULL;
+
+ if (flags & NI_TEST_FIRST)
+ {
+ const IP_ADAPTER_INFO *list = get_adapter_info_list (&gc);
+ const int index = get_adapter_index_flexible (flex_name);
+ ai = get_adapter (list, index);
+ pai = get_per_adapter_info (index, &gc);
+ }
+
+ if (flags & NI_IP_NETMASK)
+ {
+ if (test_adapter_ip_netmask (ai, ip, netmask))
+ {
+ msg (M_INFO, "NETSH: \"%s\" %s/%s [already set]",
+ flex_name,
+ print_in_addr_t (ip, 0, &gc),
+ print_in_addr_t (netmask, 0, &gc));
+ }
+ else
+ {
+ /* example: netsh interface ip set address my-tap static 10.3.0.1 255.255.255.0 */
+ argv_printf (&argv, "%s%sc interface ip set address %s static %s %s",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ flex_name,
+ print_in_addr_t (ip, 0, &gc),
+ print_in_addr_t (netmask, 0, &gc));
+
+ netsh_command (&argv, 4);
+ }
+ }
+
+ /* set WINS/DNS options */
+ if (flags & NI_OPTIONS)
+ {
+ IP_ADDR_STRING wins[2];
+ CLEAR (wins[0]);
+ CLEAR (wins[1]);
+
+ netsh_ifconfig_options ("dns",
+ to->dns,
+ to->dns_len,
+ pai ? &pai->DnsServerList : NULL,
+ flex_name,
+ BOOL_CAST (flags & NI_TEST_FIRST));
+ if (ai && ai->HaveWins)
+ init_ip_addr_string2 (wins, &ai->PrimaryWinsServer, &ai->SecondaryWinsServer);
+
+ netsh_ifconfig_options ("wins",
+ to->wins,
+ to->wins_len,
+ ai ? wins : NULL,
+ flex_name,
+ BOOL_CAST (flags & NI_TEST_FIRST));
+ }
+
+ argv_reset (&argv);
+ gc_free (&gc);
+}
+
+static void
+netsh_enable_dhcp (const struct tuntap_options *to,
+ const char *actual_name)
+{
+ struct argv argv;
+ argv_init (&argv);
+
+ /* example: netsh interface ip set address my-tap dhcp */
+ argv_printf (&argv,
+ "%s%sc interface ip set address %s dhcp",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ actual_name);
+
+ netsh_command (&argv, 4);
+
+ argv_reset (&argv);
+}
+
+/*
+ * Return a TAP name for netsh commands.
+ */
+static const char *
+netsh_get_id (const char *dev_node, struct gc_arena *gc)
+{
+ const struct tap_reg *tap_reg = get_tap_reg (gc);
+ const struct panel_reg *panel_reg = get_panel_reg (gc);
+ struct buffer actual = alloc_buf_gc (256, gc);
+ const char *guid;
+
+ at_least_one_tap_win (tap_reg);
+
+ if (dev_node)
+ {
+ guid = get_device_guid (dev_node, BPTR (&actual), BCAP (&actual), tap_reg, panel_reg, gc);
+ }
+ else
+ {
+ guid = get_unspecified_device_guid (0, BPTR (&actual), BCAP (&actual), tap_reg, panel_reg, gc);
+
+ if (get_unspecified_device_guid (1, NULL, 0, tap_reg, panel_reg, gc)) /* ambiguous if more than one TAP-Windows adapter */
+ guid = NULL;
+ }
+
+ if (!guid)
+ return "NULL"; /* not found */
+ else if (strcmp (BPTR (&actual), "NULL"))
+ return BPTR (&actual); /* control panel name */
+ else
+ return guid; /* no control panel name, return GUID instead */
+}
+
+/*
+ * Called iteratively on TAP-Windows wait-for-initialization polling loop
+ */
+void
+tun_standby_init (struct tuntap *tt)
+{
+ tt->standby_iter = 0;
+}
+
+bool
+tun_standby (struct tuntap *tt)
+{
+ bool ret = true;
+ ++tt->standby_iter;
+ if (tt->options.ip_win32_type == IPW32_SET_ADAPTIVE)
+ {
+ if (tt->standby_iter == IPW32_SET_ADAPTIVE_TRY_NETSH)
+ {
+ msg (M_INFO, "NOTE: now trying netsh (this may take some time)");
+ netsh_ifconfig (&tt->options,
+ tt->actual_name,
+ tt->local,
+ tt->adapter_netmask,
+ NI_TEST_FIRST|NI_IP_NETMASK|NI_OPTIONS);
+ }
+ else if (tt->standby_iter >= IPW32_SET_ADAPTIVE_TRY_NETSH*2)
+ {
+ ret = false;
+ }
+ }
+ return ret;
+}
+
+/*
+ * Convert DHCP options from the command line / config file
+ * into a raw DHCP-format options string.
+ */
+
+static void
+write_dhcp_u8 (struct buffer *buf, const int type, const int data, bool *error)
+{
+ if (!buf_safe (buf, 3))
+ {
+ *error = true;
+ msg (M_WARN, "write_dhcp_u8: buffer overflow building DHCP options");
+ return;
+ }
+ buf_write_u8 (buf, type);
+ buf_write_u8 (buf, 1);
+ buf_write_u8 (buf, data);
+}
+
+static void
+write_dhcp_u32_array (struct buffer *buf, const int type, const uint32_t *data, const unsigned int len, bool *error)
+{
+ if (len > 0)
+ {
+ int i;
+ const int size = len * sizeof (uint32_t);
+
+ if (!buf_safe (buf, 2 + size))
+ {
+ *error = true;
+ msg (M_WARN, "write_dhcp_u32_array: buffer overflow building DHCP options");
+ return;
+ }
+ if (size < 1 || size > 255)
+ {
+ *error = true;
+ msg (M_WARN, "write_dhcp_u32_array: size (%d) must be > 0 and <= 255", size);
+ return;
+ }
+ buf_write_u8 (buf, type);
+ buf_write_u8 (buf, size);
+ for (i = 0; i < len; ++i)
+ buf_write_u32 (buf, data[i]);
+ }
+}
+
+static void
+write_dhcp_str (struct buffer *buf, const int type, const char *str, bool *error)
+{
+ const int len = strlen (str);
+ if (!buf_safe (buf, 2 + len))
+ {
+ *error = true;
+ msg (M_WARN, "write_dhcp_str: buffer overflow building DHCP options");
+ return;
+ }
+ if (len < 1 || len > 255)
+ {
+ *error = true;
+ msg (M_WARN, "write_dhcp_str: string '%s' must be > 0 bytes and <= 255 bytes", str);
+ return;
+ }
+ buf_write_u8 (buf, type);
+ buf_write_u8 (buf, len);
+ buf_write (buf, str, len);
+}
+
+static bool
+build_dhcp_options_string (struct buffer *buf, const struct tuntap_options *o)
+{
+ bool error = false;
+ if (o->domain)
+ write_dhcp_str (buf, 15, o->domain, &error);
+
+ if (o->netbios_scope)
+ write_dhcp_str (buf, 47, o->netbios_scope, &error);
+
+ if (o->netbios_node_type)
+ write_dhcp_u8 (buf, 46, o->netbios_node_type, &error);
+
+ write_dhcp_u32_array (buf, 6, (uint32_t*)o->dns, o->dns_len, &error);
+ write_dhcp_u32_array (buf, 44, (uint32_t*)o->wins, o->wins_len, &error);
+ write_dhcp_u32_array (buf, 42, (uint32_t*)o->ntp, o->ntp_len, &error);
+ write_dhcp_u32_array (buf, 45, (uint32_t*)o->nbdd, o->nbdd_len, &error);
+
+ /* the MS DHCP server option 'Disable Netbios-over-TCP/IP
+ is implemented as vendor option 001, value 002.
+ A value of 001 means 'leave NBT alone' which is the default */
+ if (o->disable_nbt)
+ {
+ if (!buf_safe (buf, 8))
+ {
+ msg (M_WARN, "build_dhcp_options_string: buffer overflow building DHCP options");
+ return false;
+ }
+ buf_write_u8 (buf, 43);
+ buf_write_u8 (buf, 6); /* total length field */
+ buf_write_u8 (buf, 0x001);
+ buf_write_u8 (buf, 4); /* length of the vendor specified field */
+ buf_write_u32 (buf, 0x002);
+ }
+ return !error;
+}
+
+static void
+fork_dhcp_action (struct tuntap *tt)
+{
+ if (tt->options.dhcp_pre_release || tt->options.dhcp_renew)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer cmd = alloc_buf_gc (256, &gc);
+ const int verb = 3;
+ const int pre_sleep = 1;
+
+ buf_printf (&cmd, "openvpn --verb %d --tap-sleep %d", verb, pre_sleep);
+ if (tt->options.dhcp_pre_release)
+ buf_printf (&cmd, " --dhcp-pre-release");
+ if (tt->options.dhcp_renew)
+ buf_printf (&cmd, " --dhcp-renew");
+ buf_printf (&cmd, " --dhcp-internal %u", (unsigned int)tt->adapter_index);
+
+ fork_to_self (BSTR (&cmd));
+ gc_free (&gc);
+ }
+}
+
+void
+fork_register_dns_action (struct tuntap *tt)
+{
+ if (tt && tt->options.register_dns)
+ {
+ struct gc_arena gc = gc_new ();
+ struct buffer cmd = alloc_buf_gc (256, &gc);
+ const int verb = 3;
+
+ buf_printf (&cmd, "openvpn --verb %d --register-dns --rdns-internal", verb);
+ fork_to_self (BSTR (&cmd));
+ gc_free (&gc);
+ }
+}
+
+static uint32_t
+dhcp_masq_addr (const in_addr_t local, const in_addr_t netmask, const int offset)
+{
+ struct gc_arena gc = gc_new ();
+ in_addr_t dsa; /* DHCP server addr */
+
+ if (offset < 0)
+ dsa = (local | (~netmask)) + offset;
+ else
+ dsa = (local & netmask) + offset;
+
+ if (dsa == local)
+ msg (M_FATAL, "ERROR: There is a clash between the --ifconfig local address and the internal DHCP server address -- both are set to %s -- please use the --ip-win32 dynamic option to choose a different free address from the --ifconfig subnet for the internal DHCP server", print_in_addr_t (dsa, 0, &gc));
+
+ if ((local & netmask) != (dsa & netmask))
+ msg (M_FATAL, "ERROR: --ip-win32 dynamic [offset] : offset is outside of --ifconfig subnet");
+
+ gc_free (&gc);
+ return htonl(dsa);
+}
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ struct gc_arena gc = gc_new ();
+ char device_path[256];
+ const char *device_guid = NULL;
+ DWORD len;
+ bool dhcp_masq = false;
+ bool dhcp_masq_post = false;
+
+ /*netcmd_semaphore_lock ();*/
+
+ msg( M_INFO, "open_tun, tt->ipv6=%d", tt->ipv6 );
+
+ if (tt->type == DEV_TYPE_NULL)
+ {
+ open_null (tt);
+ gc_free (&gc);
+ return;
+ }
+ else if (tt->type == DEV_TYPE_TAP || tt->type == DEV_TYPE_TUN)
+ {
+ ;
+ }
+ else
+ {
+ msg (M_FATAL|M_NOPREFIX, "Unknown virtual device type: '%s'", dev);
+ }
+
+ /*
+ * Lookup the device name in the registry, using the --dev-node high level name.
+ */
+ {
+ const struct tap_reg *tap_reg = get_tap_reg (&gc);
+ const struct panel_reg *panel_reg = get_panel_reg (&gc);
+ char actual_buffer[256];
+
+ at_least_one_tap_win (tap_reg);
+
+ if (dev_node)
+ {
+ /* Get the device GUID for the device specified with --dev-node. */
+ device_guid = get_device_guid (dev_node, actual_buffer, sizeof (actual_buffer), tap_reg, panel_reg, &gc);
+
+ if (!device_guid)
+ msg (M_FATAL, "TAP-Windows adapter '%s' not found", dev_node);
+
+ /* Open Windows TAP-Windows adapter */
+ openvpn_snprintf (device_path, sizeof(device_path), "%s%s%s",
+ USERMODEDEVICEDIR,
+ device_guid,
+ TAP_WIN_SUFFIX);
+
+ tt->hand = CreateFile (
+ device_path,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, /* was: FILE_SHARE_READ */
+ 0,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
+ 0
+ );
+
+ if (tt->hand == INVALID_HANDLE_VALUE)
+ msg (M_ERR, "CreateFile failed on TAP device: %s", device_path);
+ }
+ else
+ {
+ int device_number = 0;
+
+ /* Try opening all TAP devices until we find one available */
+ while (true)
+ {
+ device_guid = get_unspecified_device_guid (device_number,
+ actual_buffer,
+ sizeof (actual_buffer),
+ tap_reg,
+ panel_reg,
+ &gc);
+
+ if (!device_guid)
+ msg (M_FATAL, "All TAP-Windows adapters on this system are currently in use.");
+
+ /* Open Windows TAP-Windows adapter */
+ openvpn_snprintf (device_path, sizeof(device_path), "%s%s%s",
+ USERMODEDEVICEDIR,
+ device_guid,
+ TAP_WIN_SUFFIX);
+
+ tt->hand = CreateFile (
+ device_path,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, /* was: FILE_SHARE_READ */
+ 0,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
+ 0
+ );
+
+ if (tt->hand == INVALID_HANDLE_VALUE)
+ msg (D_TUNTAP_INFO, "CreateFile failed on TAP device: %s", device_path);
+ else
+ break;
+
+ device_number++;
+ }
+ }
+
+ /* translate high-level device name into a device instance
+ GUID using the registry */
+ tt->actual_name = string_alloc (actual_buffer, NULL);
+ }
+
+ msg (M_INFO, "TAP-WIN32 device [%s] opened: %s", tt->actual_name, device_path);
+ tt->adapter_index = get_adapter_index (device_guid);
+
+ /* get driver version info */
+ {
+ ULONG info[3];
+ CLEAR (info);
+ if (DeviceIoControl (tt->hand, TAP_WIN_IOCTL_GET_VERSION,
+ &info, sizeof (info),
+ &info, sizeof (info), &len, NULL))
+ {
+ msg (D_TUNTAP_INFO, "TAP-Windows Driver Version %d.%d %s",
+ (int) info[0],
+ (int) info[1],
+ (info[2] ? "(DEBUG)" : ""));
+
+ }
+ if (!(info[0] == TAP_WIN_MIN_MAJOR && info[1] >= TAP_WIN_MIN_MINOR))
+ msg (M_FATAL, "ERROR: This version of " PACKAGE_NAME " requires a TAP-Windows driver that is at least version %d.%d -- If you recently upgraded your " PACKAGE_NAME " distribution, a reboot is probably required at this point to get Windows to see the new driver.",
+ TAP_WIN_MIN_MAJOR,
+ TAP_WIN_MIN_MINOR);
+
+ /* usage of numeric constants is ugly, but this is really tied to
+ * *this* version of the driver
+ */
+ if ( tt->ipv6 && tt->type == DEV_TYPE_TUN &&
+ info[0] == 9 && info[1] < 8)
+ {
+ msg( M_INFO, "WARNING: Tap-Win32 driver version %d.%d does not support IPv6 in TUN mode. IPv6 will be disabled. Upgrade to Tap-Win32 9.8 (2.2-beta3 release or later) or use TAP mode to get IPv6", (int) info[0], (int) info[1] );
+ tt->ipv6 = false;
+ }
+
+ /* tap driver 9.8 (2.2.0 and 2.2.1 release) is buggy
+ */
+ if ( tt->type == DEV_TYPE_TUN &&
+ info[0] == 9 && info[1] == 8)
+ {
+ msg( M_FATAL, "ERROR: Tap-Win32 driver version %d.%d is buggy regarding small IPv4 packets in TUN mode. Upgrade to Tap-Win32 9.9 (2.2.2 release or later) or use TAP mode", (int) info[0], (int) info[1] );
+ }
+ }
+
+ /* get driver MTU */
+ {
+ ULONG mtu;
+ if (DeviceIoControl (tt->hand, TAP_WIN_IOCTL_GET_MTU,
+ &mtu, sizeof (mtu),
+ &mtu, sizeof (mtu), &len, NULL))
+ {
+ tt->post_open_mtu = (int) mtu;
+ msg (D_MTU_INFO, "TAP-Windows MTU=%d", (int) mtu);
+ }
+ }
+
+ /*
+ * Preliminaries for setting TAP-Windows adapter TCP/IP
+ * properties via --ip-win32 dynamic or --ip-win32 adaptive.
+ */
+ if (tt->did_ifconfig_setup)
+ {
+ if (tt->options.ip_win32_type == IPW32_SET_DHCP_MASQ)
+ {
+ /*
+ * If adapter is set to non-DHCP, set to DHCP mode.
+ */
+ if (dhcp_status (tt->adapter_index) == DHCP_STATUS_DISABLED)
+ netsh_enable_dhcp (&tt->options, tt->actual_name);
+ dhcp_masq = true;
+ dhcp_masq_post = true;
+ }
+ else if (tt->options.ip_win32_type == IPW32_SET_ADAPTIVE)
+ {
+ /*
+ * If adapter is set to non-DHCP, use netsh right away.
+ */
+ if (dhcp_status (tt->adapter_index) != DHCP_STATUS_ENABLED)
+ {
+ netsh_ifconfig (&tt->options,
+ tt->actual_name,
+ tt->local,
+ tt->adapter_netmask,
+ NI_TEST_FIRST|NI_IP_NETMASK|NI_OPTIONS);
+ }
+ else
+ {
+ dhcp_masq = true;
+ }
+ }
+ }
+
+ /* set point-to-point mode if TUN device */
+
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ if (!tt->did_ifconfig_setup)
+ {
+ msg (M_FATAL, "ERROR: --dev tun also requires --ifconfig");
+ }
+
+ if (tt->topology == TOP_SUBNET)
+ {
+ in_addr_t ep[3];
+ BOOL status;
+
+ ep[0] = htonl (tt->local);
+ ep[1] = htonl (tt->local & tt->remote_netmask);
+ ep[2] = htonl (tt->remote_netmask);
+
+ status = DeviceIoControl (tt->hand, TAP_WIN_IOCTL_CONFIG_TUN,
+ ep, sizeof (ep),
+ ep, sizeof (ep), &len, NULL);
+
+ msg (status ? M_INFO : M_FATAL, "Set TAP-Windows TUN subnet mode network/local/netmask = %s/%s/%s [%s]",
+ print_in_addr_t (ep[1], IA_NET_ORDER, &gc),
+ print_in_addr_t (ep[0], IA_NET_ORDER, &gc),
+ print_in_addr_t (ep[2], IA_NET_ORDER, &gc),
+ status ? "SUCCEEDED" : "FAILED");
+
+ } else {
+
+ in_addr_t ep[2];
+ ep[0] = htonl (tt->local);
+ ep[1] = htonl (tt->remote_netmask);
+
+ if (!DeviceIoControl (tt->hand, TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT,
+ ep, sizeof (ep),
+ ep, sizeof (ep), &len, NULL))
+ msg (M_FATAL, "ERROR: The TAP-Windows driver rejected a DeviceIoControl call to set Point-to-Point mode, which is required for --dev tun");
+ }
+ }
+
+ /* should we tell the TAP-Windows driver to masquerade as a DHCP server as a means
+ of setting the adapter address? */
+ if (dhcp_masq)
+ {
+ uint32_t ep[4];
+
+ /* We will answer DHCP requests with a reply to set IP/subnet to these values */
+ ep[0] = htonl (tt->local);
+ ep[1] = htonl (tt->adapter_netmask);
+
+ /* At what IP address should the DHCP server masquerade at? */
+ if (tt->type == DEV_TYPE_TUN)
+ {
+ if (tt->topology == TOP_SUBNET)
+ {
+ if (tt->options.dhcp_masq_custom_offset)
+ ep[2] = dhcp_masq_addr (tt->local, tt->remote_netmask, tt->options.dhcp_masq_offset);
+ else
+ ep[2] = dhcp_masq_addr (tt->local, tt->remote_netmask, -1);
+ }
+ else
+ ep[2] = htonl (tt->remote_netmask);
+ }
+ else
+ {
+ ASSERT (tt->type == DEV_TYPE_TAP);
+ ep[2] = dhcp_masq_addr (tt->local, tt->adapter_netmask, tt->options.dhcp_masq_custom_offset ? tt->options.dhcp_masq_offset : 0);
+ }
+
+ /* lease time in seconds */
+ ep[3] = (uint32_t) tt->options.dhcp_lease_time;
+
+ ASSERT (ep[3] > 0);
+
+#ifndef SIMULATE_DHCP_FAILED /* this code is disabled to simulate bad DHCP negotiation */
+ if (!DeviceIoControl (tt->hand, TAP_WIN_IOCTL_CONFIG_DHCP_MASQ,
+ ep, sizeof (ep),
+ ep, sizeof (ep), &len, NULL))
+ msg (M_FATAL, "ERROR: The TAP-Windows driver rejected a DeviceIoControl call to set TAP_WIN_IOCTL_CONFIG_DHCP_MASQ mode");
+
+ msg (M_INFO, "Notified TAP-Windows driver to set a DHCP IP/netmask of %s/%s on interface %s [DHCP-serv: %s, lease-time: %d]",
+ print_in_addr_t (tt->local, 0, &gc),
+ print_in_addr_t (tt->adapter_netmask, 0, &gc),
+ device_guid,
+ print_in_addr_t (ep[2], IA_NET_ORDER, &gc),
+ ep[3]
+ );
+
+ /* user-supplied DHCP options capability */
+ if (tt->options.dhcp_options)
+ {
+ struct buffer buf = alloc_buf (256);
+ if (build_dhcp_options_string (&buf, &tt->options))
+ {
+ msg (D_DHCP_OPT, "DHCP option string: %s", format_hex (BPTR (&buf), BLEN (&buf), 0, &gc));
+ if (!DeviceIoControl (tt->hand, TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT,
+ BPTR (&buf), BLEN (&buf),
+ BPTR (&buf), BLEN (&buf), &len, NULL))
+ msg (M_FATAL, "ERROR: The TAP-Windows driver rejected a TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT DeviceIoControl call");
+ }
+ else
+ msg (M_WARN, "DHCP option string not set due to error");
+ free_buf (&buf);
+ }
+#endif
+ }
+
+ /* set driver media status to 'connected' */
+ {
+ ULONG status = TRUE;
+ if (!DeviceIoControl (tt->hand, TAP_WIN_IOCTL_SET_MEDIA_STATUS,
+ &status, sizeof (status),
+ &status, sizeof (status), &len, NULL))
+ msg (M_WARN, "WARNING: The TAP-Windows driver rejected a TAP_WIN_IOCTL_SET_MEDIA_STATUS DeviceIoControl call.");
+ }
+
+ /* possible wait for adapter to come up */
+ {
+ int s = tt->options.tap_sleep;
+ if (s > 0)
+ {
+ msg (M_INFO, "Sleeping for %d seconds...", s);
+ openvpn_sleep (s);
+ }
+ }
+
+ /* possibly use IP Helper API to set IP address on adapter */
+ {
+ const DWORD index = tt->adapter_index;
+
+ /* flush arp cache */
+ if (index != TUN_ADAPTER_INDEX_INVALID)
+ {
+ DWORD status;
+
+ if ((status = FlushIpNetTable (index)) == NO_ERROR)
+ msg (M_INFO, "Successful ARP Flush on interface [%u] %s",
+ (unsigned int)index,
+ device_guid);
+ else
+ msg (D_TUNTAP_INFO, "NOTE: FlushIpNetTable failed on interface [%u] %s (status=%u) : %s",
+ (unsigned int)index,
+ device_guid,
+ (unsigned int)status,
+ strerror_win32 (status, &gc));
+ }
+
+ /*
+ * If the TAP-Windows driver is masquerading as a DHCP server
+ * make sure the TCP/IP properties for the adapter are
+ * set correctly.
+ */
+ if (dhcp_masq_post)
+ {
+ /* check dhcp enable status */
+ if (dhcp_status (index) == DHCP_STATUS_DISABLED)
+ msg (M_WARN, "WARNING: You have selected '--ip-win32 dynamic', which will not work unless the TAP-Windows TCP/IP properties are set to 'Obtain an IP address automatically'");
+
+ /* force an explicit DHCP lease renewal on TAP adapter? */
+ if (tt->options.dhcp_pre_release)
+ dhcp_release (tt);
+ if (tt->options.dhcp_renew)
+ dhcp_renew (tt);
+ }
+ else
+ fork_dhcp_action (tt);
+
+ if (tt->did_ifconfig_setup && tt->options.ip_win32_type == IPW32_SET_IPAPI)
+ {
+ DWORD status;
+ const char *error_suffix = "I am having trouble using the Windows 'IP helper API' to automatically set the IP address -- consider using other --ip-win32 methods (not 'ipapi')";
+
+ /* couldn't get adapter index */
+ if (index == TUN_ADAPTER_INDEX_INVALID)
+ {
+ msg (M_FATAL, "ERROR: unable to get adapter index for interface %s -- %s",
+ device_guid,
+ error_suffix);
+ }
+
+ /* check dhcp enable status */
+ if (dhcp_status (index) == DHCP_STATUS_DISABLED)
+ msg (M_WARN, "NOTE: You have selected (explicitly or by default) '--ip-win32 ipapi', which has a better chance of working correctly if the TAP-Windows TCP/IP properties are set to 'Obtain an IP address automatically'");
+
+ /* delete previously added IP addresses which were not
+ correctly deleted */
+ delete_temp_addresses (index);
+
+ /* add a new IP address */
+ if ((status = AddIPAddress (htonl(tt->local),
+ htonl(tt->adapter_netmask),
+ index,
+ &tt->ipapi_context,
+ &tt->ipapi_instance)) == NO_ERROR)
+ msg (M_INFO, "Succeeded in adding a temporary IP/netmask of %s/%s to interface %s using the Win32 IP Helper API",
+ print_in_addr_t (tt->local, 0, &gc),
+ print_in_addr_t (tt->adapter_netmask, 0, &gc),
+ device_guid
+ );
+ else
+ msg (M_FATAL, "ERROR: AddIPAddress %s/%s failed on interface %s, index=%d, status=%u (windows error: '%s') -- %s",
+ print_in_addr_t (tt->local, 0, &gc),
+ print_in_addr_t (tt->adapter_netmask, 0, &gc),
+ device_guid,
+ (int)index,
+ (unsigned int)status,
+ strerror_win32 (status, &gc),
+ error_suffix);
+ tt->ipapi_context_defined = true;
+ }
+ }
+ /*netcmd_semaphore_release ();*/
+ gc_free (&gc);
+}
+
+const char *
+tap_win_getinfo (const struct tuntap *tt, struct gc_arena *gc)
+{
+ if (tt && tt->hand != NULL)
+ {
+ struct buffer out = alloc_buf_gc (256, gc);
+ DWORD len;
+ if (DeviceIoControl (tt->hand, TAP_WIN_IOCTL_GET_INFO,
+ BSTR (&out), BCAP (&out),
+ BSTR (&out), BCAP (&out),
+ &len, NULL))
+ {
+ return BSTR (&out);
+ }
+ }
+ return NULL;
+}
+
+void
+tun_show_debug (struct tuntap *tt)
+{
+ if (tt && tt->hand != NULL)
+ {
+ struct buffer out = alloc_buf (1024);
+ DWORD len;
+ while (DeviceIoControl (tt->hand, TAP_WIN_IOCTL_GET_LOG_LINE,
+ BSTR (&out), BCAP (&out),
+ BSTR (&out), BCAP (&out),
+ &len, NULL))
+ {
+ msg (D_TAP_WIN_DEBUG, "TAP-Windows: %s", BSTR (&out));
+ }
+ free_buf (&out);
+ }
+}
+
+void
+close_tun (struct tuntap *tt)
+{
+ struct gc_arena gc = gc_new ();
+
+ if (tt)
+ {
+ if ( tt->ipv6 && tt->did_ifconfig_ipv6_setup )
+ {
+ const char *ifconfig_ipv6_local;
+ struct argv argv;
+ argv_init (&argv);
+
+ /* remove route pointing to interface */
+ delete_route_connected_v6_net(tt, NULL);
+
+ /* "store=active" is needed in Windows 8(.1) to delete the
+ * address we added (pointed out by Cedric Tabary).
+ */
+
+ /* netsh interface ipv6 delete address \"%s\" %s */
+ ifconfig_ipv6_local = print_in6_addr (tt->local_ipv6, 0, &gc);
+ argv_printf (&argv,
+ "%s%sc interface ipv6 delete address %s %s store=active",
+ get_win_sys_path(),
+ NETSH_PATH_SUFFIX,
+ tt->actual_name,
+ ifconfig_ipv6_local );
+
+ netsh_command (&argv, 1);
+ argv_reset (&argv);
+ }
+#if 1
+ if (tt->ipapi_context_defined)
+ {
+ DWORD status;
+ if ((status = DeleteIPAddress (tt->ipapi_context)) != NO_ERROR)
+ {
+ msg (M_WARN, "Warning: DeleteIPAddress[%u] failed on TAP-Windows adapter, status=%u : %s",
+ (unsigned int)tt->ipapi_context,
+ (unsigned int)status,
+ strerror_win32 (status, &gc));
+ }
+ }
+#endif
+
+ if (tt->options.dhcp_release)
+ dhcp_release (tt);
+
+ if (tt->hand != NULL)
+ {
+ dmsg (D_WIN32_IO_LOW, "Attempting CancelIO on TAP-Windows adapter");
+ if (!CancelIo (tt->hand))
+ msg (M_WARN | M_ERRNO, "Warning: CancelIO failed on TAP-Windows adapter");
+ }
+
+ dmsg (D_WIN32_IO_LOW, "Attempting close of overlapped read event on TAP-Windows adapter");
+ overlapped_io_close (&tt->reads);
+
+ dmsg (D_WIN32_IO_LOW, "Attempting close of overlapped write event on TAP-Windows adapter");
+ overlapped_io_close (&tt->writes);
+
+ if (tt->hand != NULL)
+ {
+ dmsg (D_WIN32_IO_LOW, "Attempting CloseHandle on TAP-Windows adapter");
+ if (!CloseHandle (tt->hand))
+ msg (M_WARN | M_ERRNO, "Warning: CloseHandle failed on TAP-Windows adapter");
+ }
+
+ if (tt->actual_name)
+ free (tt->actual_name);
+
+ clear_tuntap (tt);
+ free (tt);
+ }
+ gc_free (&gc);
+}
+
+/*
+ * Convert --ip-win32 constants between index and ascii form.
+ */
+
+struct ipset_names {
+ const char *short_form;
+};
+
+/* Indexed by IPW32_SET_x */
+static const struct ipset_names ipset_names[] = {
+ {"manual"},
+ {"netsh"},
+ {"ipapi"},
+ {"dynamic"},
+ {"adaptive"}
+};
+
+int
+ascii2ipset (const char* name)
+{
+ int i;
+ ASSERT (IPW32_SET_N == SIZE (ipset_names));
+ for (i = 0; i < IPW32_SET_N; ++i)
+ if (!strcmp (name, ipset_names[i].short_form))
+ return i;
+ return -1;
+}
+
+const char *
+ipset2ascii (int index)
+{
+ ASSERT (IPW32_SET_N == SIZE (ipset_names));
+ if (index < 0 || index >= IPW32_SET_N)
+ return "[unknown --ip-win32 type]";
+ else
+ return ipset_names[index].short_form;
+}
+
+const char *
+ipset2ascii_all (struct gc_arena *gc)
+{
+ struct buffer out = alloc_buf_gc (256, gc);
+ int i;
+
+ ASSERT (IPW32_SET_N == SIZE (ipset_names));
+ for (i = 0; i < IPW32_SET_N; ++i)
+ {
+ if (i)
+ buf_printf(&out, " ");
+ buf_printf(&out, "[%s]", ipset2ascii(i));
+ }
+ return BSTR (&out);
+}
+
+#else /* generic */
+
+void
+open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
+{
+ open_tun_generic (dev, dev_type, dev_node, false, true, tt);
+}
+
+void
+close_tun (struct tuntap* tt)
+{
+ if (tt)
+ {
+ close_tun_generic (tt);
+ free (tt);
+ }
+}
+
+int
+write_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return write (tt->fd, buf, len);
+}
+
+int
+read_tun (struct tuntap* tt, uint8_t *buf, int len)
+{
+ return read (tt->fd, buf, len);
+}
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.h
new file mode 100644
index 00000000..631b53c6
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/tun.h
@@ -0,0 +1,489 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TUN_H
+#define TUN_H
+
+#ifdef WIN32
+#include <winioctl.h>
+#include <tap-windows.h>
+#endif
+
+#include "buffer.h"
+#include "error.h"
+#include "mtu.h"
+#include "win32.h"
+#include "event.h"
+#include "proto.h"
+#include "misc.h"
+
+#if defined(WIN32) || defined(TARGET_ANDROID)
+
+#define TUN_ADAPTER_INDEX_INVALID ((DWORD)-1)
+
+/* time constants for --ip-win32 adaptive */
+#define IPW32_SET_ADAPTIVE_DELAY_WINDOW 300
+#define IPW32_SET_ADAPTIVE_TRY_NETSH 20
+
+struct tuntap_options {
+ /* --ip-win32 options */
+ bool ip_win32_defined;
+
+# define IPW32_SET_MANUAL 0 /* "--ip-win32 manual" */
+# define IPW32_SET_NETSH 1 /* "--ip-win32 netsh" */
+# define IPW32_SET_IPAPI 2 /* "--ip-win32 ipapi" */
+# define IPW32_SET_DHCP_MASQ 3 /* "--ip-win32 dynamic" */
+# define IPW32_SET_ADAPTIVE 4 /* "--ip-win32 adaptive" */
+# define IPW32_SET_N 5
+ int ip_win32_type;
+
+ /* --ip-win32 dynamic options */
+ bool dhcp_masq_custom_offset;
+ int dhcp_masq_offset;
+ int dhcp_lease_time;
+
+ /* --tap-sleep option */
+ int tap_sleep;
+
+ /* --dhcp-option options */
+
+ bool dhcp_options;
+
+ const char *domain; /* DOMAIN (15) */
+
+ const char *netbios_scope; /* NBS (47) */
+
+ int netbios_node_type; /* NBT 1,2,4,8 (46) */
+
+#define N_DHCP_ADDR 4 /* Max # of addresses allowed for
+ DNS, WINS, etc. */
+
+ /* DNS (6) */
+ in_addr_t dns[N_DHCP_ADDR];
+ int dns_len;
+
+ /* WINS (44) */
+ in_addr_t wins[N_DHCP_ADDR];
+ int wins_len;
+
+ /* NTP (42) */
+ in_addr_t ntp[N_DHCP_ADDR];
+ int ntp_len;
+
+ /* NBDD (45) */
+ in_addr_t nbdd[N_DHCP_ADDR];
+ int nbdd_len;
+
+ /* DISABLE_NBT (43, Vendor option 001) */
+ bool disable_nbt;
+
+ bool dhcp_renew;
+ bool dhcp_pre_release;
+ bool dhcp_release;
+
+ bool register_dns;
+};
+
+#elif TARGET_LINUX
+
+struct tuntap_options {
+ int txqueuelen;
+};
+
+#else
+
+struct tuntap_options {
+ int dummy; /* not used */
+};
+
+#endif
+
+/*
+ * Define a TUN/TAP dev.
+ */
+
+struct tuntap
+{
+# define TUNNEL_TYPE(tt) ((tt) ? ((tt)->type) : DEV_TYPE_UNDEF)
+ int type; /* DEV_TYPE_x as defined in proto.h */
+
+# define TUNNEL_TOPOLOGY(tt) ((tt) ? ((tt)->topology) : TOP_UNDEF)
+ int topology; /* one of the TOP_x values */
+
+ bool did_ifconfig_setup;
+ bool did_ifconfig_ipv6_setup;
+ bool did_ifconfig;
+
+ bool ipv6;
+
+ bool persistent_if; /* if existed before, keep on program end */
+
+ struct tuntap_options options; /* options set on command line */
+
+ char *actual_name; /* actual name of TUN/TAP dev, usually including unit number */
+
+ /* number of TX buffers */
+ int txqueuelen;
+
+ /* ifconfig parameters */
+ in_addr_t local;
+ in_addr_t remote_netmask;
+ in_addr_t broadcast;
+
+ struct in6_addr local_ipv6;
+ struct in6_addr remote_ipv6;
+ int netbits_ipv6;
+
+#ifdef WIN32
+ HANDLE hand;
+ struct overlapped_io reads;
+ struct overlapped_io writes;
+ struct rw_handle rw_handle;
+
+ /* used for setting interface address via IP Helper API
+ or DHCP masquerade */
+ bool ipapi_context_defined;
+ ULONG ipapi_context;
+ ULONG ipapi_instance;
+ in_addr_t adapter_netmask;
+
+ /* Windows adapter index for TAP-Windows adapter,
+ ~0 if undefined */
+ DWORD adapter_index;
+
+ int standby_iter;
+#else
+ int fd; /* file descriptor for TUN/TAP dev */
+#endif
+
+#ifdef TARGET_SOLARIS
+ int ip_fd;
+#endif
+
+#ifdef HAVE_NET_IF_UTUN_H
+ bool is_utun;
+#endif
+ /* used for printing status info only */
+ unsigned int rwflags_debug;
+
+ /* Some TUN/TAP drivers like to be ioctled for mtu
+ after open */
+ int post_open_mtu;
+};
+
+static inline bool
+tuntap_defined (const struct tuntap *tt)
+{
+#ifdef WIN32
+ return tt && tt->hand != NULL;
+#else
+ return tt && tt->fd >= 0;
+#endif
+}
+
+/*
+ * Function prototypes
+ */
+
+void open_tun (const char *dev, const char *dev_type, const char *dev_node,
+ struct tuntap *tt);
+
+void close_tun (struct tuntap *tt);
+
+int write_tun (struct tuntap* tt, uint8_t *buf, int len);
+
+int read_tun (struct tuntap* tt, uint8_t *buf, int len);
+
+void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
+ int persist_mode, const char *username,
+ const char *groupname, const struct tuntap_options *options);
+
+const char *guess_tuntap_dev (const char *dev,
+ const char *dev_type,
+ const char *dev_node,
+ struct gc_arena *gc);
+
+struct tuntap *init_tun (const char *dev, /* --dev option */
+ const char *dev_type, /* --dev-type option */
+ int topology, /* one of the TOP_x values */
+ const char *ifconfig_local_parm, /* --ifconfig parm 1 */
+ const char *ifconfig_remote_netmask_parm, /* --ifconfig parm 2 */
+ const char *ifconfig_ipv6_local_parm, /* --ifconfig parm 1 / IPv6 */
+ int ifconfig_ipv6_netbits_parm, /* --ifconfig parm 1 / bits */
+ const char *ifconfig_ipv6_remote_parm, /* --ifconfig parm 2 / IPv6 */
+ struct addrinfo *local_public,
+ struct addrinfo *remote_public,
+ const bool strict_warn,
+ struct env_set *es);
+
+void init_tun_post (struct tuntap *tt,
+ const struct frame *frame,
+ const struct tuntap_options *options);
+
+void do_ifconfig (struct tuntap *tt,
+ const char *actual, /* actual device name */
+ int tun_mtu,
+ const struct env_set *es);
+
+bool is_dev_type (const char *dev, const char *dev_type, const char *match_type);
+int dev_type_enum (const char *dev, const char *dev_type);
+const char *dev_type_string (const char *dev, const char *dev_type);
+
+const char *ifconfig_options_string (const struct tuntap* tt, bool remote, bool disable, struct gc_arena *gc);
+
+bool is_tun_p2p (const struct tuntap *tt);
+
+void check_subnet_conflict (const in_addr_t ip,
+ const in_addr_t netmask,
+ const char *prefix);
+
+void warn_on_use_of_common_subnets (void);
+
+/*
+ * Inline functions
+ */
+
+static inline void
+tun_adjust_frame_parameters (struct frame* frame, int size)
+{
+ frame_add_to_extra_tun (frame, size);
+}
+
+/*
+ * Should ifconfig be called before or after
+ * tun dev open?
+ */
+
+#define IFCONFIG_BEFORE_TUN_OPEN 0
+#define IFCONFIG_AFTER_TUN_OPEN 1
+
+#define IFCONFIG_DEFAULT IFCONFIG_AFTER_TUN_OPEN
+
+static inline int
+ifconfig_order(void)
+{
+#if defined(TARGET_LINUX)
+ return IFCONFIG_AFTER_TUN_OPEN;
+#elif defined(TARGET_SOLARIS)
+ return IFCONFIG_AFTER_TUN_OPEN;
+#elif defined(TARGET_OPENBSD)
+ return IFCONFIG_AFTER_TUN_OPEN;
+#elif defined(TARGET_DARWIN)
+ return IFCONFIG_AFTER_TUN_OPEN;
+#elif defined(TARGET_NETBSD)
+ return IFCONFIG_AFTER_TUN_OPEN;
+#elif defined(WIN32)
+ return IFCONFIG_BEFORE_TUN_OPEN;
+#elif defined(TARGET_ANDROID)
+ return IFCONFIG_BEFORE_TUN_OPEN;
+#else
+ return IFCONFIG_DEFAULT;
+#endif
+}
+
+#define ROUTE_BEFORE_TUN 0
+#define ROUTE_AFTER_TUN 1
+#define ROUTE_ORDER_DEFAULT ROUTE_AFTER_TUN
+
+static inline int
+route_order(void)
+{
+#if defined(TARGET_ANDROID)
+ return ROUTE_BEFORE_TUN;
+#else
+ return ROUTE_ORDER_DEFAULT;
+#endif
+}
+
+
+#ifdef WIN32
+
+#define TUN_PASS_BUFFER
+
+struct tap_reg
+{
+ const char *guid;
+ struct tap_reg *next;
+};
+
+struct panel_reg
+{
+ const char *name;
+ const char *guid;
+ struct panel_reg *next;
+};
+
+int ascii2ipset (const char* name);
+const char *ipset2ascii (int index);
+const char *ipset2ascii_all (struct gc_arena *gc);
+
+void verify_255_255_255_252 (in_addr_t local, in_addr_t remote);
+
+const IP_ADAPTER_INFO *get_adapter_info_list (struct gc_arena *gc);
+const IP_ADAPTER_INFO *get_tun_adapter (const struct tuntap *tt, const IP_ADAPTER_INFO *list);
+
+const IP_ADAPTER_INFO *get_adapter_info (DWORD index, struct gc_arena *gc);
+const IP_PER_ADAPTER_INFO *get_per_adapter_info (const DWORD index, struct gc_arena *gc);
+const IP_ADAPTER_INFO *get_adapter (const IP_ADAPTER_INFO *ai, DWORD index);
+
+bool is_adapter_up (const struct tuntap *tt, const IP_ADAPTER_INFO *list);
+bool is_ip_in_adapter_subnet (const IP_ADAPTER_INFO *ai, const in_addr_t ip, in_addr_t *highest_netmask);
+
+DWORD adapter_index_of_ip (const IP_ADAPTER_INFO *list,
+ const in_addr_t ip,
+ int *count,
+ in_addr_t *netmask);
+
+void show_tap_win_adapters (int msglev, int warnlev);
+void show_adapters (int msglev);
+
+void tap_allow_nonadmin_access (const char *dev_node);
+
+void show_valid_win32_tun_subnets (void);
+const char *tap_win_getinfo (const struct tuntap *tt, struct gc_arena *gc);
+void tun_show_debug (struct tuntap *tt);
+
+bool dhcp_release_by_adapter_index(const DWORD adapter_index);
+bool dhcp_renew_by_adapter_index (const DWORD adapter_index);
+
+void fork_register_dns_action (struct tuntap *tt);
+void ipconfig_register_dns (const struct env_set *es);
+
+void tun_standby_init (struct tuntap *tt);
+bool tun_standby (struct tuntap *tt);
+
+int tun_read_queue (struct tuntap *tt, int maxsize);
+int tun_write_queue (struct tuntap *tt, struct buffer *buf);
+int tun_finalize (HANDLE h, struct overlapped_io *io, struct buffer *buf);
+
+static inline bool
+tuntap_stop (int status)
+{
+ /*
+ * This corresponds to the STATUS_NO_SUCH_DEVICE
+ * error in tapdrvr.c.
+ */
+ if (status < 0)
+ {
+ return openvpn_errno () == ERROR_FILE_NOT_FOUND;
+ }
+ return false;
+}
+
+static inline int
+tun_write_win32 (struct tuntap *tt, struct buffer *buf)
+{
+ int err = 0;
+ int status = 0;
+ if (overlapped_io_active (&tt->writes))
+ {
+ status = tun_finalize (tt->hand, &tt->writes, NULL);
+ if (status < 0)
+ err = GetLastError ();
+ }
+ tun_write_queue (tt, buf);
+ if (status < 0)
+ {
+ SetLastError (err);
+ return status;
+ }
+ else
+ return BLEN (buf);
+}
+
+static inline int
+read_tun_buffered (struct tuntap *tt, struct buffer *buf, int maxsize)
+{
+ return tun_finalize (tt->hand, &tt->reads, buf);
+}
+
+static inline int
+write_tun_buffered (struct tuntap *tt, struct buffer *buf)
+{
+ return tun_write_win32 (tt, buf);
+}
+
+#else
+
+static inline bool
+tuntap_stop (int status)
+{
+ return false;
+}
+
+static inline void
+tun_standby_init (struct tuntap *tt)
+{
+}
+
+static inline bool
+tun_standby (struct tuntap *tt)
+{
+ return true;
+}
+
+#endif
+
+/*
+ * TUN/TAP I/O wait functions
+ */
+
+static inline event_t
+tun_event_handle (const struct tuntap *tt)
+{
+#ifdef WIN32
+ return &tt->rw_handle;
+#else
+ return tt->fd;
+#endif
+}
+
+static inline unsigned int
+tun_set (struct tuntap *tt,
+ struct event_set *es,
+ unsigned int rwflags,
+ void *arg,
+ unsigned int *persistent)
+{
+ if (tuntap_defined (tt))
+ {
+ /* if persistent is defined, call event_ctl only if rwflags has changed since last call */
+ if (!persistent || *persistent != rwflags)
+ {
+ event_ctl (es, tun_event_handle (tt), rwflags, arg);
+ if (persistent)
+ *persistent = rwflags;
+ }
+#ifdef WIN32
+ if (rwflags & EVENT_READ)
+ tun_read_queue (tt, 0);
+#endif
+ tt->rwflags_debug = rwflags;
+ }
+ return rwflags;
+}
+
+const char *tun_stat (const struct tuntap *tt, unsigned int rwflags, struct gc_arena *gc);
+
+#endif /* TUN_H */
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.c b/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.c
new file mode 100644
index 00000000..7c89a5a9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.c
@@ -0,0 +1,1022 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Win32-specific OpenVPN code, targetted at the mingw
+ * development environment.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+
+#include "syshead.h"
+
+#ifdef WIN32
+
+#include "buffer.h"
+#include "error.h"
+#include "mtu.h"
+#include "sig.h"
+#include "win32.h"
+#include "misc.h"
+
+#include "memdbg.h"
+
+/*
+ * Windows internal socket API state (opaque).
+ */
+static struct WSAData wsa_state; /* GLOBAL */
+
+/*
+ * Should we call win32_pause() on program exit?
+ */
+static bool pause_exit_enabled = false; /* GLOBAL */
+
+/*
+ * win32_signal is used to get input from the keyboard
+ * if we are running in a console, or get input from an
+ * event object if we are running as a service.
+ */
+
+struct win32_signal win32_signal; /* GLOBAL */
+
+/*
+ * Save our old window title so we can restore
+ * it on exit.
+ */
+struct window_title window_title; /* GLOBAL*/
+
+/*
+ * Special global semaphore used to protect network
+ * shell commands from simultaneous instantiation.
+ */
+
+struct semaphore netcmd_semaphore; /* GLOBAL */
+
+/*
+ * Windows system pathname such as c:\windows
+ */
+static char *win_sys_path = NULL; /* GLOBAL */
+
+void
+init_win32 (void)
+{
+ if (WSAStartup(0x0101, &wsa_state))
+ {
+ msg (M_ERR, "WSAStartup failed");
+ }
+ window_title_clear (&window_title);
+ win32_signal_clear (&win32_signal);
+ netcmd_semaphore_init ();
+}
+
+void
+uninit_win32 (void)
+{
+ netcmd_semaphore_close ();
+ if (pause_exit_enabled)
+ {
+ if (win32_signal.mode == WSO_MODE_UNDEF)
+ {
+ struct win32_signal w;
+ win32_signal_open (&w, WSO_FORCE_CONSOLE, NULL, false);
+ win32_pause (&w);
+ win32_signal_close (&w);
+ }
+ else
+ win32_pause (&win32_signal);
+ }
+ window_title_restore (&window_title);
+ win32_signal_close (&win32_signal);
+ WSACleanup ();
+ free (win_sys_path);
+}
+
+void
+set_pause_exit_win32 (void)
+{
+ pause_exit_enabled = true;
+}
+
+bool
+init_security_attributes_allow_all (struct security_attributes *obj)
+{
+ CLEAR (*obj);
+
+ obj->sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+ obj->sa.lpSecurityDescriptor = &obj->sd;
+ obj->sa.bInheritHandle = FALSE;
+ if (!InitializeSecurityDescriptor (&obj->sd, SECURITY_DESCRIPTOR_REVISION))
+ return false;
+ if (!SetSecurityDescriptorDacl (&obj->sd, TRUE, NULL, FALSE))
+ return false;
+ return true;
+}
+
+void
+overlapped_io_init (struct overlapped_io *o,
+ const struct frame *frame,
+ BOOL event_state,
+ bool tuntap_buffer) /* if true: tuntap buffer, if false: socket buffer */
+{
+ CLEAR (*o);
+
+ /* manual reset event, initially set according to event_state */
+ o->overlapped.hEvent = CreateEvent (NULL, TRUE, event_state, NULL);
+ if (o->overlapped.hEvent == NULL)
+ msg (M_ERR, "Error: overlapped_io_init: CreateEvent failed");
+
+ /* allocate buffer for overlapped I/O */
+ alloc_buf_sock_tun (&o->buf_init, frame, tuntap_buffer, 0);
+}
+
+void
+overlapped_io_close (struct overlapped_io *o)
+{
+ if (o->overlapped.hEvent)
+ {
+ if (!CloseHandle (o->overlapped.hEvent))
+ msg (M_WARN | M_ERRNO, "Warning: CloseHandle failed on overlapped I/O event object");
+ }
+ free_buf (&o->buf_init);
+}
+
+char *
+overlapped_io_state_ascii (const struct overlapped_io *o)
+{
+ switch (o->iostate)
+ {
+ case IOSTATE_INITIAL:
+ return "0";
+ case IOSTATE_QUEUED:
+ return "Q";
+ case IOSTATE_IMMEDIATE_RETURN:
+ return "1";
+ }
+ return "?";
+}
+
+/*
+ * Event-based notification of network events
+ */
+
+void
+init_net_event_win32 (struct rw_handle *event, long network_events, socket_descriptor_t sd, unsigned int flags)
+{
+ /* manual reset events, initially set to unsignaled */
+
+ /* initialize write event */
+ if (!(flags & NE32_PERSIST_EVENT) || !event->write)
+ {
+ if (flags & NE32_WRITE_EVENT)
+ {
+ event->write = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (event->write == NULL)
+ msg (M_ERR, "Error: init_net_event_win32: CreateEvent (write) failed");
+ }
+ else
+ event->write = NULL;
+ }
+
+ /* initialize read event */
+ if (!(flags & NE32_PERSIST_EVENT) || !event->read)
+ {
+ event->read = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (event->read == NULL)
+ msg (M_ERR, "Error: init_net_event_win32: CreateEvent (read) failed");
+ }
+
+ /* setup network events to change read event state */
+ if (WSAEventSelect (sd, event->read, network_events) != 0)
+ msg (M_FATAL | M_ERRNO, "Error: init_net_event_win32: WSAEventSelect call failed");
+}
+
+long
+reset_net_event_win32 (struct rw_handle *event, socket_descriptor_t sd)
+{
+ WSANETWORKEVENTS wne;
+ if (WSAEnumNetworkEvents (sd, event->read, &wne) != 0)
+ {
+ msg (M_FATAL | M_ERRNO, "Error: reset_net_event_win32: WSAEnumNetworkEvents call failed");
+ return 0; /* NOTREACHED */
+ }
+ else
+ return wne.lNetworkEvents;
+}
+
+void
+close_net_event_win32 (struct rw_handle *event, socket_descriptor_t sd, unsigned int flags)
+{
+ if (event->read)
+ {
+ if (socket_defined (sd))
+ {
+ if (WSAEventSelect (sd, event->read, 0) != 0)
+ msg (M_WARN | M_ERRNO, "Warning: close_net_event_win32: WSAEventSelect call failed");
+ }
+ if (!ResetEvent (event->read))
+ msg (M_WARN | M_ERRNO, "Warning: ResetEvent (read) failed in close_net_event_win32");
+ if (!(flags & NE32_PERSIST_EVENT))
+ {
+ if (!CloseHandle (event->read))
+ msg (M_WARN | M_ERRNO, "Warning: CloseHandle (read) failed in close_net_event_win32");
+ event->read = NULL;
+ }
+ }
+
+ if (event->write)
+ {
+ if (!ResetEvent (event->write))
+ msg (M_WARN | M_ERRNO, "Warning: ResetEvent (write) failed in close_net_event_win32");
+ if (!(flags & NE32_PERSIST_EVENT))
+ {
+ if (!CloseHandle (event->write))
+ msg (M_WARN | M_ERRNO, "Warning: CloseHandle (write) failed in close_net_event_win32");
+ event->write = NULL;
+ }
+ }
+}
+
+/*
+ * struct net_event_win32
+ */
+
+void
+net_event_win32_init (struct net_event_win32 *ne)
+{
+ CLEAR (*ne);
+ ne->sd = SOCKET_UNDEFINED;
+}
+
+void
+net_event_win32_start (struct net_event_win32 *ne, long network_events, socket_descriptor_t sd)
+{
+ ASSERT (!socket_defined (ne->sd));
+ ne->sd = sd;
+ ne->event_mask = 0;
+ init_net_event_win32 (&ne->handle, network_events, sd, NE32_PERSIST_EVENT|NE32_WRITE_EVENT);
+}
+
+void
+net_event_win32_reset_write (struct net_event_win32 *ne)
+{
+ BOOL status;
+ if (ne->event_mask & FD_WRITE)
+ status = SetEvent (ne->handle.write);
+ else
+ status = ResetEvent (ne->handle.write);
+ if (!status)
+ msg (M_WARN | M_ERRNO, "Warning: SetEvent/ResetEvent failed in net_event_win32_reset_write");
+}
+
+void
+net_event_win32_reset (struct net_event_win32 *ne)
+{
+ ne->event_mask |= reset_net_event_win32 (&ne->handle, ne->sd);
+}
+
+void
+net_event_win32_stop (struct net_event_win32 *ne)
+{
+ if (net_event_win32_defined (ne))
+ close_net_event_win32 (&ne->handle, ne->sd, NE32_PERSIST_EVENT);
+ ne->sd = SOCKET_UNDEFINED;
+ ne->event_mask = 0;
+}
+
+void
+net_event_win32_close (struct net_event_win32 *ne)
+{
+ if (net_event_win32_defined (ne))
+ close_net_event_win32 (&ne->handle, ne->sd, 0);
+ net_event_win32_init (ne);
+}
+
+/*
+ * Simulate *nix signals on Windows.
+ *
+ * Two modes:
+ * (1) Console mode -- map keyboard function keys to signals
+ * (2) Service mode -- map Windows event object to SIGTERM
+ */
+
+void
+win32_signal_clear (struct win32_signal *ws)
+{
+ CLEAR (*ws);
+}
+
+void
+win32_signal_open (struct win32_signal *ws,
+ int force,
+ const char *exit_event_name,
+ bool exit_event_initial_state)
+{
+ CLEAR (*ws);
+
+ ws->mode = WSO_MODE_UNDEF;
+ ws->in.read = INVALID_HANDLE_VALUE;
+ ws->in.write = INVALID_HANDLE_VALUE;
+ ws->console_mode_save = 0;
+ ws->console_mode_save_defined = false;
+
+ if (force == WSO_NOFORCE || force == WSO_FORCE_CONSOLE)
+ {
+ /*
+ * Try to open console.
+ */
+ ws->in.read = GetStdHandle (STD_INPUT_HANDLE);
+ if (ws->in.read != INVALID_HANDLE_VALUE)
+ {
+ if (GetConsoleMode (ws->in.read, &ws->console_mode_save))
+ {
+ /* running on a console */
+ const DWORD new_console_mode = ws->console_mode_save
+ & ~(ENABLE_WINDOW_INPUT
+ | ENABLE_PROCESSED_INPUT
+ | ENABLE_LINE_INPUT
+ | ENABLE_ECHO_INPUT
+ | ENABLE_MOUSE_INPUT);
+
+ if (new_console_mode != ws->console_mode_save)
+ {
+ if (!SetConsoleMode (ws->in.read, new_console_mode))
+ msg (M_ERR, "Error: win32_signal_open: SetConsoleMode failed");
+ ws->console_mode_save_defined = true;
+ }
+ ws->mode = WSO_MODE_CONSOLE;
+ }
+ else
+ ws->in.read = INVALID_HANDLE_VALUE; /* probably running as a service */
+ }
+ }
+
+ /*
+ * If console open failed, assume we are running
+ * as a service.
+ */
+ if ((force == WSO_NOFORCE || force == WSO_FORCE_SERVICE)
+ && !HANDLE_DEFINED (ws->in.read) && exit_event_name)
+ {
+ struct security_attributes sa;
+
+ if (!init_security_attributes_allow_all (&sa))
+ msg (M_ERR, "Error: win32_signal_open: init SA failed");
+
+ ws->in.read = CreateEvent (&sa.sa,
+ TRUE,
+ exit_event_initial_state ? TRUE : FALSE,
+ exit_event_name);
+ if (ws->in.read == NULL)
+ {
+ msg (M_WARN|M_ERRNO, "NOTE: CreateEvent '%s' failed", exit_event_name);
+ }
+ else
+ {
+ if (WaitForSingleObject (ws->in.read, 0) != WAIT_TIMEOUT)
+ msg (M_FATAL, "ERROR: Exit Event ('%s') is signaled", exit_event_name);
+ else
+ ws->mode = WSO_MODE_SERVICE;
+ }
+ }
+}
+
+static bool
+keyboard_input_available (struct win32_signal *ws)
+{
+ ASSERT (ws->mode == WSO_MODE_CONSOLE);
+ if (HANDLE_DEFINED (ws->in.read))
+ {
+ DWORD n;
+ if (GetNumberOfConsoleInputEvents (ws->in.read, &n))
+ return n > 0;
+ }
+ return false;
+}
+
+static unsigned int
+keyboard_ir_to_key (INPUT_RECORD *ir)
+{
+ if (ir->Event.KeyEvent.uChar.AsciiChar == 0)
+ return ir->Event.KeyEvent.wVirtualScanCode;
+
+ if ((ir->Event.KeyEvent.dwControlKeyState
+ & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
+ && (ir->Event.KeyEvent.wVirtualKeyCode != 18))
+ return ir->Event.KeyEvent.wVirtualScanCode * 256;
+
+ return ir->Event.KeyEvent.uChar.AsciiChar;
+}
+
+static unsigned int
+win32_keyboard_get (struct win32_signal *ws)
+{
+ ASSERT (ws->mode == WSO_MODE_CONSOLE);
+ if (HANDLE_DEFINED (ws->in.read))
+ {
+ INPUT_RECORD ir;
+ do {
+ DWORD n;
+ if (!keyboard_input_available (ws))
+ return 0;
+ if (!ReadConsoleInput (ws->in.read, &ir, 1, &n))
+ return 0;
+ } while (ir.EventType != KEY_EVENT || ir.Event.KeyEvent.bKeyDown != TRUE);
+
+ return keyboard_ir_to_key (&ir);
+ }
+ else
+ return 0;
+}
+
+void
+win32_signal_close (struct win32_signal *ws)
+{
+ if (ws->mode == WSO_MODE_SERVICE && HANDLE_DEFINED (ws->in.read))
+ CloseHandle (ws->in.read);
+ if (ws->console_mode_save_defined)
+ {
+ if (!SetConsoleMode (ws->in.read, ws->console_mode_save))
+ msg (M_ERR, "Error: win32_signal_close: SetConsoleMode failed");
+ }
+ CLEAR (*ws);
+}
+
+/*
+ * Return true if interrupt occurs in service mode.
+ */
+bool
+win32_service_interrupt (struct win32_signal *ws)
+{
+ if (ws->mode == WSO_MODE_SERVICE)
+ {
+ if (HANDLE_DEFINED (ws->in.read)
+ && WaitForSingleObject (ws->in.read, 0) == WAIT_OBJECT_0)
+ return true;
+ }
+ return false;
+}
+
+int
+win32_signal_get (struct win32_signal *ws)
+{
+ int ret = 0;
+ if (siginfo_static.signal_received)
+ {
+ ret = siginfo_static.signal_received;
+ }
+ else
+ {
+ if (ws->mode == WSO_MODE_SERVICE)
+ {
+ if (win32_service_interrupt (ws))
+ ret = SIGTERM;
+ }
+ else if (ws->mode == WSO_MODE_CONSOLE)
+ {
+ switch (win32_keyboard_get (ws))
+ {
+ case 0x3B: /* F1 -> USR1 */
+ ret = SIGUSR1;
+ break;
+ case 0x3C: /* F2 -> USR2 */
+ ret = SIGUSR2;
+ break;
+ case 0x3D: /* F3 -> HUP */
+ ret = SIGHUP;
+ break;
+ case 0x3E: /* F4 -> TERM */
+ ret = SIGTERM;
+ break;
+ }
+ }
+ if (ret)
+ {
+ siginfo_static.signal_received = ret;
+ siginfo_static.source = SIG_SOURCE_HARD;
+ }
+ }
+ return ret;
+}
+
+void
+win32_pause (struct win32_signal *ws)
+{
+ if (ws->mode == WSO_MODE_CONSOLE && HANDLE_DEFINED (ws->in.read))
+ {
+ int status;
+ msg (M_INFO|M_NOPREFIX, "Press any key to continue...");
+ do {
+ status = WaitForSingleObject (ws->in.read, INFINITE);
+ } while (!win32_keyboard_get (ws));
+ }
+}
+
+/* window functions */
+
+void
+window_title_clear (struct window_title *wt)
+{
+ CLEAR (*wt);
+}
+
+void
+window_title_save (struct window_title *wt)
+{
+ if (!wt->saved)
+ {
+ if (!GetConsoleTitle (wt->old_window_title, sizeof (wt->old_window_title)))
+ {
+ wt->old_window_title[0] = 0;
+ wt->saved = false;
+ }
+ else
+ wt->saved = true;
+ }
+}
+
+void
+window_title_restore (const struct window_title *wt)
+{
+ if (wt->saved)
+ SetConsoleTitle (wt->old_window_title);
+}
+
+void
+window_title_generate (const char *title)
+{
+ struct gc_arena gc = gc_new ();
+ struct buffer out = alloc_buf_gc (256, &gc);
+ if (!title)
+ title = "";
+ buf_printf (&out, "[%s] " PACKAGE_NAME " " PACKAGE_VERSION " F4:EXIT F1:USR1 F2:USR2 F3:HUP", title);
+ SetConsoleTitle (BSTR (&out));
+ gc_free (&gc);
+}
+
+/* semaphore functions */
+
+void
+semaphore_clear (struct semaphore *s)
+{
+ CLEAR (*s);
+}
+
+void
+semaphore_open (struct semaphore *s, const char *name)
+{
+ struct security_attributes sa;
+
+ s->locked = false;
+ s->name = name;
+ s->hand = NULL;
+
+ if (init_security_attributes_allow_all (&sa))
+ s->hand = CreateSemaphore(&sa.sa, 1, 1, name);
+
+ if (s->hand == NULL)
+ msg (M_WARN|M_ERRNO, "WARNING: Cannot create Win32 semaphore '%s'", name);
+ else
+ dmsg (D_SEMAPHORE, "Created Win32 semaphore '%s'", s->name);
+}
+
+bool
+semaphore_lock (struct semaphore *s, int timeout_milliseconds)
+{
+ bool ret = true;
+
+ if (s->hand)
+ {
+ DWORD status;
+ ASSERT (!s->locked);
+
+ dmsg (D_SEMAPHORE_LOW, "Attempting to lock Win32 semaphore '%s' prior to net shell command (timeout = %d sec)",
+ s->name,
+ timeout_milliseconds / 1000);
+ status = WaitForSingleObject (s->hand, timeout_milliseconds);
+ if (status == WAIT_FAILED)
+ msg (M_ERR, "Wait failed on Win32 semaphore '%s'", s->name);
+ ret = (status == WAIT_TIMEOUT) ? false : true;
+ if (ret)
+ {
+ dmsg (D_SEMAPHORE, "Locked Win32 semaphore '%s'", s->name);
+ s->locked = true;
+ }
+ else
+ {
+ dmsg (D_SEMAPHORE, "Wait on Win32 semaphore '%s' timed out after %d milliseconds",
+ s->name,
+ timeout_milliseconds);
+ }
+ }
+ return ret;
+}
+
+void
+semaphore_release (struct semaphore *s)
+{
+ if (s->hand)
+ {
+ ASSERT (s->locked);
+ dmsg (D_SEMAPHORE, "Releasing Win32 semaphore '%s'", s->name);
+ if (!ReleaseSemaphore(s->hand, 1, NULL))
+ msg (M_WARN | M_ERRNO, "ReleaseSemaphore failed on Win32 semaphore '%s'",
+ s->name);
+ s->locked = false;
+ }
+}
+
+void
+semaphore_close (struct semaphore *s)
+{
+ if (s->hand)
+ {
+ if (s->locked)
+ semaphore_release (s);
+ dmsg (D_SEMAPHORE, "Closing Win32 semaphore '%s'", s->name);
+ CloseHandle (s->hand);
+ s->hand = NULL;
+ }
+}
+
+/*
+ * Special global semaphore used to protect network
+ * shell commands from simultaneous instantiation.
+ */
+
+void
+netcmd_semaphore_init (void)
+{
+ semaphore_open (&netcmd_semaphore, PACKAGE "_netcmd");
+}
+
+void
+netcmd_semaphore_close (void)
+{
+ semaphore_close (&netcmd_semaphore);
+}
+
+void
+netcmd_semaphore_lock (void)
+{
+ const int timeout_seconds = 600;
+ if (!semaphore_lock (&netcmd_semaphore, timeout_seconds * 1000))
+ msg (M_FATAL, "Cannot lock net command semaphore");
+}
+
+void
+netcmd_semaphore_release (void)
+{
+ semaphore_release (&netcmd_semaphore);
+}
+
+/*
+ * Return true if filename is safe to be used on Windows,
+ * by avoiding the following reserved names:
+ *
+ * CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
+ * LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, and CLOCK$
+ *
+ * See: http://msdn.microsoft.com/en-us/library/aa365247.aspx
+ * and http://msdn.microsoft.com/en-us/library/86k9f82k(VS.80).aspx
+ */
+
+static bool
+cmp_prefix (const char *str, const bool n, const char *pre)
+{
+ size_t i = 0;
+
+ if (!str)
+ return false;
+
+ while (true)
+ {
+ const int c1 = pre[i];
+ int c2 = str[i];
+ ++i;
+ if (c1 == '\0')
+ {
+ if (n)
+ {
+ if (isdigit (c2))
+ c2 = str[i];
+ else
+ return false;
+ }
+ return c2 == '\0' || c2 == '.';
+ }
+ else if (c2 == '\0')
+ return false;
+ if (c1 != tolower(c2))
+ return false;
+ }
+}
+
+bool
+win_safe_filename (const char *fn)
+{
+ if (cmp_prefix (fn, false, "con"))
+ return false;
+ if (cmp_prefix (fn, false, "prn"))
+ return false;
+ if (cmp_prefix (fn, false, "aux"))
+ return false;
+ if (cmp_prefix (fn, false, "nul"))
+ return false;
+ if (cmp_prefix (fn, true, "com"))
+ return false;
+ if (cmp_prefix (fn, true, "lpt"))
+ return false;
+ if (cmp_prefix (fn, false, "clock$"))
+ return false;
+ return true;
+}
+
+/*
+ * Service functions for openvpn_execve
+ */
+
+static char *
+env_block (const struct env_set *es)
+{
+ char * force_path = "PATH=C:\\Windows\\System32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem";
+
+ if (es)
+ {
+ struct env_item *e;
+ char *ret;
+ char *p;
+ size_t nchars = 1;
+ bool path_seen = false;
+
+ for (e = es->list; e != NULL; e = e->next)
+ nchars += strlen (e->string) + 1;
+
+ nchars += strlen(force_path)+1;
+
+ ret = (char *) malloc (nchars);
+ check_malloc_return (ret);
+
+ p = ret;
+ for (e = es->list; e != NULL; e = e->next)
+ {
+ if (env_allowed (e->string))
+ {
+ strcpy (p, e->string);
+ p += strlen (e->string) + 1;
+ }
+ if ( strncmp(e->string, "PATH=", 5 ) == 0 )
+ path_seen = true;
+ }
+
+ /* make sure PATH is set */
+ if ( !path_seen )
+ {
+ msg( M_INFO, "env_block: add %s", force_path );
+ strcpy( p, force_path );
+ p += strlen(force_path) + 1;
+ }
+
+ *p = '\0';
+ return ret;
+ }
+ else
+ return NULL;
+}
+
+static WCHAR *
+wide_cmd_line (const struct argv *a, struct gc_arena *gc)
+{
+ size_t nchars = 1;
+ size_t maxlen = 0;
+ size_t i;
+ struct buffer buf;
+ char *work = NULL;
+
+ if (!a)
+ return NULL;
+
+ for (i = 0; i < a->argc; ++i)
+ {
+ const char *arg = a->argv[i];
+ const size_t len = strlen (arg);
+ nchars += len + 3;
+ if (len > maxlen)
+ maxlen = len;
+ }
+
+ work = gc_malloc (maxlen + 1, false, gc);
+ check_malloc_return (work);
+ buf = alloc_buf_gc (nchars, gc);
+
+ for (i = 0; i < a->argc; ++i)
+ {
+ const char *arg = a->argv[i];
+ strcpy (work, arg);
+ string_mod (work, CC_PRINT, CC_DOUBLE_QUOTE|CC_CRLF, '_');
+ if (i)
+ buf_printf (&buf, " ");
+ if (string_class (work, CC_ANY, CC_SPACE))
+ buf_printf (&buf, "%s", work);
+ else
+ buf_printf (&buf, "\"%s\"", work);
+ }
+
+ return wide_string (BSTR (&buf), gc);
+}
+
+/*
+ * Attempt to simulate fork/execve on Windows
+ */
+int
+openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+ int ret = -1;
+ static bool exec_warn = false;
+
+ if (a && a->argv[0])
+ {
+ if (openvpn_execve_allowed (flags))
+ {
+ struct gc_arena gc = gc_new ();
+ STARTUPINFOW start_info;
+ PROCESS_INFORMATION proc_info;
+
+ char *env = env_block (es);
+ WCHAR *cl = wide_cmd_line (a, &gc);
+ WCHAR *cmd = wide_string (a->argv[0], &gc);
+
+ /* this allows console programs to run, and is ignored otherwise */
+ DWORD proc_flags = CREATE_NO_WINDOW;
+
+ CLEAR (start_info);
+ CLEAR (proc_info);
+
+ /* fill in STARTUPINFO struct */
+ GetStartupInfoW(&start_info);
+ start_info.cb = sizeof(start_info);
+ start_info.dwFlags = STARTF_USESHOWWINDOW;
+ start_info.wShowWindow = SW_HIDE;
+
+ if (CreateProcessW (cmd, cl, NULL, NULL, FALSE, proc_flags, env, NULL, &start_info, &proc_info))
+ {
+ DWORD exit_status = 0;
+ CloseHandle (proc_info.hThread);
+ WaitForSingleObject (proc_info.hProcess, INFINITE);
+ if (GetExitCodeProcess (proc_info.hProcess, &exit_status))
+ ret = (int)exit_status;
+ else
+ msg (M_WARN|M_ERRNO, "openvpn_execve: GetExitCodeProcess %S failed", cmd);
+ CloseHandle (proc_info.hProcess);
+ }
+ else
+ {
+ msg (M_WARN|M_ERRNO, "openvpn_execve: CreateProcess %S failed", cmd);
+ }
+ free (env);
+ gc_free (&gc);
+ }
+ else if (!exec_warn && (script_security < SSEC_SCRIPTS))
+ {
+ msg (M_WARN, SCRIPT_SECURITY_WARNING);
+ exec_warn = true;
+ }
+ }
+ else
+ {
+ msg (M_WARN, "openvpn_execve: called with empty argv");
+ }
+ return ret;
+}
+
+WCHAR *
+wide_string (const char* utf8, struct gc_arena *gc)
+{
+ int n = MultiByteToWideChar (CP_UTF8, 0, utf8, -1, NULL, 0);
+ WCHAR *ucs16 = gc_malloc (n * sizeof (WCHAR), false, gc);
+ MultiByteToWideChar (CP_UTF8, 0, utf8, -1, ucs16, n);
+ return ucs16;
+}
+
+/*
+ * call ourself in another process
+ */
+void
+fork_to_self (const char *cmdline)
+{
+ STARTUPINFO start_info;
+ PROCESS_INFORMATION proc_info;
+ char self_exe[256];
+ char *cl = string_alloc (cmdline, NULL);
+ DWORD status;
+
+ CLEAR (start_info);
+ CLEAR (proc_info);
+ CLEAR (self_exe);
+
+ status = GetModuleFileName (NULL, self_exe, sizeof(self_exe));
+ if (status == 0 || status == sizeof(self_exe))
+ {
+ msg (M_WARN|M_ERRNO, "fork_to_self: CreateProcess failed: cannot get module name via GetModuleFileName");
+ goto done;
+ }
+
+ /* fill in STARTUPINFO struct */
+ GetStartupInfo(&start_info);
+ start_info.cb = sizeof(start_info);
+ start_info.dwFlags = STARTF_USESHOWWINDOW;
+ start_info.wShowWindow = SW_HIDE;
+
+ if (CreateProcess (self_exe, cl, NULL, NULL, FALSE, 0, NULL, NULL, &start_info, &proc_info))
+ {
+ CloseHandle (proc_info.hThread);
+ CloseHandle (proc_info.hProcess);
+ }
+ else
+ {
+ msg (M_WARN|M_ERRNO, "fork_to_self: CreateProcess failed: %s", cmdline);
+ }
+
+ done:
+ free (cl);
+}
+
+char *
+get_win_sys_path (void)
+{
+ ASSERT (win_sys_path);
+ return win_sys_path;
+}
+
+void
+set_win_sys_path (const char *newpath, struct env_set *es)
+{
+ free (win_sys_path);
+ win_sys_path = string_alloc (newpath, NULL);
+ setenv_str (es, SYS_PATH_ENV_VAR_NAME, win_sys_path); /* route.exe needs this */
+}
+
+void
+set_win_sys_path_via_env (struct env_set *es)
+{
+ char buf[256];
+ DWORD status = GetEnvironmentVariable (SYS_PATH_ENV_VAR_NAME, buf, sizeof(buf));
+ if (!status)
+ msg (M_ERR, "Cannot find environmental variable %s", SYS_PATH_ENV_VAR_NAME);
+ if (status > sizeof (buf) - 1)
+ msg (M_FATAL, "String overflow attempting to read environmental variable %s", SYS_PATH_ENV_VAR_NAME);
+ set_win_sys_path (buf, es);
+}
+
+
+const char *
+win_get_tempdir()
+{
+ static char tmpdir[MAX_PATH];
+ WCHAR wtmpdir[MAX_PATH];
+
+ if (!GetTempPathW(_countof(wtmpdir), wtmpdir))
+ {
+ /* Warn if we can't find a valid temporary directory, which should
+ * be unlikely.
+ */
+ msg (M_WARN, "Could not find a suitable temporary directory."
+ " (GetTempPath() failed). Consider using --tmp-dir");
+ return NULL;
+ }
+
+ if (WideCharToMultiByte (CP_UTF8, 0, wtmpdir, -1, NULL, 0, NULL, NULL) > sizeof (tmpdir))
+ {
+ msg (M_WARN, "Could not get temporary directory. Path is too long."
+ " Consider using --tmp-dir");
+ return NULL;
+ }
+
+ WideCharToMultiByte (CP_UTF8, 0, wtmpdir, -1, tmpdir, sizeof (tmpdir), NULL, NULL);
+ return tmpdir;
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.h b/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.h
new file mode 100644
index 00000000..cc18f027
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpn/win32.h
@@ -0,0 +1,275 @@
+/*
+ * OpenVPN -- An application to securely tunnel IP networks
+ * over a single UDP port, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifdef WIN32
+#ifndef OPENVPN_WIN32_H
+#define OPENVPN_WIN32_H
+
+#include "mtu.h"
+
+/* location of executables */
+#define SYS_PATH_ENV_VAR_NAME "SystemRoot" /* environmental variable name that normally contains the system path */
+#define NETSH_PATH_SUFFIX "\\system32\\netsh.exe"
+#define WIN_ROUTE_PATH_SUFFIX "\\system32\\route.exe"
+#define WIN_IPCONFIG_PATH_SUFFIX "\\system32\\ipconfig.exe"
+#define WIN_NET_PATH_SUFFIX "\\system32\\net.exe"
+
+/*
+ * Win32-specific OpenVPN code, targetted at the mingw
+ * development environment.
+ */
+
+/* MSVC headers do not define this macro, so do it here */
+#ifndef IN6_ARE_ADDR_EQUAL
+#define IN6_ARE_ADDR_EQUAL(a,b) \
+ (memcmp ((const void*)(a), (const void*)(b), sizeof (struct in6_addr)) == 0)
+#endif
+
+void init_win32 (void);
+void uninit_win32 (void);
+
+void set_pause_exit_win32 (void);
+
+struct security_attributes
+{
+ SECURITY_ATTRIBUTES sa;
+ SECURITY_DESCRIPTOR sd;
+};
+
+#define HANDLE_DEFINED(h) ((h) != NULL && (h) != INVALID_HANDLE_VALUE)
+
+/*
+ * Save old window title.
+ */
+struct window_title
+{
+ bool saved;
+ char old_window_title [256];
+};
+
+struct rw_handle {
+ HANDLE read;
+ HANDLE write;
+};
+
+/*
+ * Event-based notification of incoming TCP connections
+ */
+
+#define NE32_PERSIST_EVENT (1<<0)
+#define NE32_WRITE_EVENT (1<<1)
+
+static inline bool
+defined_net_event_win32 (const struct rw_handle *event)
+{
+ return event->read != NULL;
+}
+
+void init_net_event_win32 (struct rw_handle *event, long network_events, socket_descriptor_t sd, unsigned int flags);
+long reset_net_event_win32 (struct rw_handle *event, socket_descriptor_t sd);
+void close_net_event_win32 (struct rw_handle *event, socket_descriptor_t sd, unsigned int flags);
+
+/*
+ * A stateful variant of the net_event_win32 functions above
+ */
+
+struct net_event_win32
+{
+ struct rw_handle handle;
+ socket_descriptor_t sd;
+ long event_mask;
+};
+
+void net_event_win32_init (struct net_event_win32 *ne);
+void net_event_win32_start (struct net_event_win32 *ne, long network_events, socket_descriptor_t sd);
+void net_event_win32_reset (struct net_event_win32 *ne);
+void net_event_win32_reset_write (struct net_event_win32 *ne);
+void net_event_win32_stop (struct net_event_win32 *ne);
+void net_event_win32_close (struct net_event_win32 *ne);
+
+static inline bool
+net_event_win32_defined (const struct net_event_win32 *ne)
+{
+ return defined_net_event_win32 (&ne->handle);
+}
+
+static inline struct rw_handle *
+net_event_win32_get_event (struct net_event_win32 *ne)
+{
+ return &ne->handle;
+}
+
+static inline long
+net_event_win32_get_event_mask (const struct net_event_win32 *ne)
+{
+ return ne->event_mask;
+}
+
+static inline void
+net_event_win32_clear_selected_events (struct net_event_win32 *ne, long selected_events)
+{
+ ne->event_mask &= ~selected_events;
+}
+
+/*
+ * Signal handling
+ */
+struct win32_signal {
+# define WSO_MODE_UNDEF 0
+# define WSO_MODE_SERVICE 1
+# define WSO_MODE_CONSOLE 2
+ int mode;
+ struct rw_handle in;
+ DWORD console_mode_save;
+ bool console_mode_save_defined;
+};
+
+extern struct win32_signal win32_signal; /* static/global */
+extern struct window_title window_title; /* static/global */
+
+void win32_signal_clear (struct win32_signal *ws);
+
+/* win32_signal_open startup type */
+#define WSO_NOFORCE 0
+#define WSO_FORCE_SERVICE 1
+#define WSO_FORCE_CONSOLE 2
+
+void win32_signal_open (struct win32_signal *ws,
+ int force, /* set to WSO force parm */
+ const char *exit_event_name,
+ bool exit_event_initial_state);
+
+void win32_signal_close (struct win32_signal *ws);
+
+int win32_signal_get (struct win32_signal *ws);
+
+void win32_pause (struct win32_signal *ws);
+
+bool win32_service_interrupt (struct win32_signal *ws);
+
+/*
+ * Set the text on the window title bar
+ */
+
+void window_title_clear (struct window_title *wt);
+void window_title_save (struct window_title *wt);
+void window_title_restore (const struct window_title *wt);
+void window_title_generate (const char *title);
+
+/*
+ * We try to do all Win32 I/O using overlapped
+ * (i.e. asynchronous) I/O for a performance win.
+ */
+struct overlapped_io {
+# define IOSTATE_INITIAL 0
+# define IOSTATE_QUEUED 1 /* overlapped I/O has been queued */
+# define IOSTATE_IMMEDIATE_RETURN 2 /* I/O function returned immediately without queueing */
+ int iostate;
+ OVERLAPPED overlapped;
+ DWORD size;
+ DWORD flags;
+ int status;
+ bool addr_defined;
+ union {
+ struct sockaddr_in addr;
+ struct sockaddr_in6 addr6;
+ };
+ int addrlen;
+ struct buffer buf_init;
+ struct buffer buf;
+};
+
+void overlapped_io_init (struct overlapped_io *o,
+ const struct frame *frame,
+ BOOL event_state,
+ bool tuntap_buffer);
+
+void overlapped_io_close (struct overlapped_io *o);
+
+static inline bool
+overlapped_io_active (struct overlapped_io *o)
+{
+ return o->iostate == IOSTATE_QUEUED || o->iostate == IOSTATE_IMMEDIATE_RETURN;
+}
+
+char *overlapped_io_state_ascii (const struct overlapped_io *o);
+
+/*
+ * Use to control access to resources that only one
+ * OpenVPN process on a given machine can access at
+ * a given time.
+ */
+
+struct semaphore
+{
+ const char *name;
+ bool locked;
+ HANDLE hand;
+};
+
+void semaphore_clear (struct semaphore *s);
+void semaphore_open (struct semaphore *s, const char *name);
+bool semaphore_lock (struct semaphore *s, int timeout_milliseconds);
+void semaphore_release (struct semaphore *s);
+void semaphore_close (struct semaphore *s);
+
+/*
+ * Special global semaphore used to protect network
+ * shell commands from simultaneous instantiation.
+ *
+ * It seems you can't run more than one instance
+ * of netsh on the same machine at the same time.
+ */
+
+extern struct semaphore netcmd_semaphore;
+void netcmd_semaphore_init (void);
+void netcmd_semaphore_close (void);
+void netcmd_semaphore_lock (void);
+void netcmd_semaphore_release (void);
+
+/* Set Win32 security attributes structure to allow all access */
+bool init_security_attributes_allow_all (struct security_attributes *obj);
+
+/* return true if filename is safe to be used on Windows */
+bool win_safe_filename (const char *fn);
+
+/* add constant environmental variables needed by Windows */
+struct env_set;
+
+/* get and set the current windows system path */
+void set_win_sys_path (const char *newpath, struct env_set *es);
+void set_win_sys_path_via_env (struct env_set *es);
+char *get_win_sys_path (void);
+
+/* call self in a subprocess */
+void fork_to_self (const char *cmdline);
+
+/* Find temporary directory */
+const char *win_get_tempdir();
+
+/* Convert a string from UTF-8 to UCS-2 */
+WCHAR *wide_string (const char* utf8, struct gc_arena *gc);
+
+#endif
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/Makefile.am
new file mode 100644
index 00000000..a989c25c
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/Makefile.am
@@ -0,0 +1,27 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+include $(top_srcdir)/build/ltrc.inc
+
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ openvpnserv.vcxproj \
+ openvpnserv.vcxproj.filters
+
+if WIN32
+sbin_PROGRAMS = openvpnserv
+endif
+
+openvpnserv_SOURCES = \
+ openvpnserv.c \
+ service.h service.c \
+ openvpnserv_resources.rc
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.c b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.c
new file mode 100755
index 00000000..56f5a025
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.c
@@ -0,0 +1,534 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This program allows one or more OpenVPN processes to be started
+ * as a service. To build, you must get the service sample from the
+ * Platform SDK and replace Simple.c with this file.
+ *
+ * You should also apply service.patch to
+ * service.c and service.h from the Platform SDK service sample.
+ *
+ * This code is designed to be built with the mingw compiler.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+#include <windows.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <process.h>
+#include "service.h"
+
+/* bool definitions */
+#define bool int
+#define true 1
+#define false 0
+
+/* These are new for 2000/XP, so they aren't in the mingw headers yet */
+#ifndef BELOW_NORMAL_PRIORITY_CLASS
+#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
+#endif
+#ifndef ABOVE_NORMAL_PRIORITY_CLASS
+#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
+#endif
+
+struct security_attributes
+{
+ SECURITY_ATTRIBUTES sa;
+ SECURITY_DESCRIPTOR sd;
+};
+
+/*
+ * This event is initially created in the non-signaled
+ * state. It will transition to the signaled state when
+ * we have received a terminate signal from the Service
+ * Control Manager which will cause an asynchronous call
+ * of ServiceStop below.
+ */
+#define EXIT_EVENT_NAME PACKAGE "_exit_1"
+
+/*
+ * Which registry key in HKLM should
+ * we get config info from?
+ */
+#define REG_KEY "SOFTWARE\\" PACKAGE_NAME
+
+static HANDLE exit_event = NULL;
+
+/* clear an object */
+#define CLEAR(x) memset(&(x), 0, sizeof(x))
+
+/*
+ * Message handling
+ */
+#define M_INFO (0) /* informational */
+#define M_SYSERR (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */
+#define M_ERR (MSG_FLAGS_ERROR) /* error */
+
+/* write error to event log */
+#define MSG(flags, ...) \
+ { \
+ char x_msg[256]; \
+ openvpn_snprintf (x_msg, sizeof(x_msg), __VA_ARGS__); \
+ AddToMessageLog ((flags), x_msg); \
+ }
+
+/* get a registry string */
+#define QUERY_REG_STRING(name, data) \
+ { \
+ len = sizeof (data); \
+ status = RegQueryValueEx(openvpn_key, name, NULL, &type, data, &len); \
+ if (status != ERROR_SUCCESS || type != REG_SZ) \
+ { \
+ SetLastError (status); \
+ MSG (M_SYSERR, error_format_str, name); \
+ RegCloseKey (openvpn_key); \
+ goto finish; \
+ } \
+ }
+
+/* get a registry string */
+#define QUERY_REG_DWORD(name, data) \
+ { \
+ len = sizeof (DWORD); \
+ status = RegQueryValueEx(openvpn_key, name, NULL, &type, (LPBYTE)&data, &len); \
+ if (status != ERROR_SUCCESS || type != REG_DWORD || len != sizeof (DWORD)) \
+ { \
+ SetLastError (status); \
+ MSG (M_SYSERR, error_format_dword, name); \
+ RegCloseKey (openvpn_key); \
+ goto finish; \
+ } \
+ }
+
+/*
+ * This is necessary due to certain buggy implementations of snprintf,
+ * that don't guarantee null termination for size > 0.
+ * (copied from ../buffer.c, line 217)
+ * (git: 100644 blob e2f8caab0a5b2a870092c6cd508a1a50c21c3ba3 buffer.c)
+ */
+
+int openvpn_snprintf(char *str, size_t size, const char *format, ...)
+{
+ va_list arglist;
+ int len = -1;
+ if (size > 0)
+ {
+ va_start (arglist, format);
+ len = vsnprintf (str, size, format, arglist);
+ va_end (arglist);
+ str[size - 1] = 0;
+ }
+ return (len >= 0 && len < size);
+}
+
+
+bool
+init_security_attributes_allow_all (struct security_attributes *obj)
+{
+ CLEAR (*obj);
+
+ obj->sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+ obj->sa.lpSecurityDescriptor = &obj->sd;
+ obj->sa.bInheritHandle = TRUE;
+ if (!InitializeSecurityDescriptor (&obj->sd, SECURITY_DESCRIPTOR_REVISION))
+ return false;
+ if (!SetSecurityDescriptorDacl (&obj->sd, TRUE, NULL, FALSE))
+ return false;
+ return true;
+}
+
+HANDLE
+create_event (const char *name, bool allow_all, bool initial_state, bool manual_reset)
+{
+ if (allow_all)
+ {
+ struct security_attributes sa;
+ if (!init_security_attributes_allow_all (&sa))
+ return NULL;
+ return CreateEvent (&sa.sa, (BOOL)manual_reset, (BOOL)initial_state, name);
+ }
+ else
+ return CreateEvent (NULL, (BOOL)manual_reset, (BOOL)initial_state, name);
+}
+
+void
+close_if_open (HANDLE h)
+{
+ if (h != NULL)
+ CloseHandle (h);
+}
+
+static bool
+match (const WIN32_FIND_DATA *find, const char *ext)
+{
+ int i;
+
+ if (find->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ return false;
+
+ if (!strlen (ext))
+ return true;
+
+ i = strlen (find->cFileName) - strlen (ext) - 1;
+ if (i < 1)
+ return false;
+
+ return find->cFileName[i] == '.' && !_stricmp (find->cFileName + i + 1, ext);
+}
+
+/*
+ * Modify the extension on a filename.
+ */
+static bool
+modext (char *dest, int size, const char *src, const char *newext)
+{
+ int i;
+
+ if (size > 0 && (strlen (src) + 1) <= size)
+ {
+ strcpy (dest, src);
+ dest [size - 1] = '\0';
+ i = strlen (dest);
+ while (--i >= 0)
+ {
+ if (dest[i] == '\\')
+ break;
+ if (dest[i] == '.')
+ {
+ dest[i] = '\0';
+ break;
+ }
+ }
+ if (strlen (dest) + strlen(newext) + 2 <= size)
+ {
+ strcat (dest, ".");
+ strcat (dest, newext);
+ return true;
+ }
+ dest [0] = '\0';
+ }
+ return false;
+}
+
+VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
+{
+ char exe_path[MAX_PATH];
+ char config_dir[MAX_PATH];
+ char ext_string[16];
+ char log_dir[MAX_PATH];
+ char priority_string[64];
+ char append_string[2];
+
+ DWORD priority;
+ bool append;
+
+ ResetError ();
+
+ if (!ReportStatusToSCMgr(SERVICE_START_PENDING, NO_ERROR, 3000))
+ {
+ MSG (M_ERR, "ReportStatusToSCMgr #1 failed");
+ goto finish;
+ }
+
+ /*
+ * Create our exit event
+ */
+ exit_event = create_event (EXIT_EVENT_NAME, false, false, true);
+ if (!exit_event)
+ {
+ MSG (M_ERR, "CreateEvent failed");
+ goto finish;
+ }
+
+ /*
+ * If exit event is already signaled, it means we were not
+ * shut down properly.
+ */
+ if (WaitForSingleObject (exit_event, 0) != WAIT_TIMEOUT)
+ {
+ MSG (M_ERR, "Exit event is already signaled -- we were not shut down properly");
+ goto finish;
+ }
+
+ if (!ReportStatusToSCMgr(SERVICE_START_PENDING, NO_ERROR, 3000))
+ {
+ MSG (M_ERR, "ReportStatusToSCMgr #2 failed");
+ goto finish;
+ }
+
+ /*
+ * Read info from registry in key HKLM\SOFTWARE\OpenVPN
+ */
+ {
+ HKEY openvpn_key;
+ LONG status;
+ DWORD len;
+ DWORD type;
+
+ static const char error_format_str[] =
+ "Error querying registry key of type REG_SZ: HKLM\\" REG_KEY "\\%s";
+
+ static const char error_format_dword[] =
+ "Error querying registry key of type REG_DWORD: HKLM\\" REG_KEY "\\%s";
+
+ status = RegOpenKeyEx(
+ HKEY_LOCAL_MACHINE,
+ REG_KEY,
+ 0,
+ KEY_READ,
+ &openvpn_key);
+
+ if (status != ERROR_SUCCESS)
+ {
+ SetLastError (status);
+ MSG (M_SYSERR, "Registry key HKLM\\" REG_KEY " not found");
+ goto finish;
+ }
+
+ /* get path to openvpn.exe */
+ QUERY_REG_STRING ("exe_path", exe_path);
+
+ /* get path to configuration directory */
+ QUERY_REG_STRING ("config_dir", config_dir);
+
+ /* get extension on configuration files */
+ QUERY_REG_STRING ("config_ext", ext_string);
+
+ /* get path to log directory */
+ QUERY_REG_STRING ("log_dir", log_dir);
+
+ /* get priority for spawned OpenVPN subprocesses */
+ QUERY_REG_STRING ("priority", priority_string);
+
+ /* should we truncate or append to logfile? */
+ QUERY_REG_STRING ("log_append", append_string);
+
+ RegCloseKey (openvpn_key);
+ }
+
+ /* set process priority */
+ priority = NORMAL_PRIORITY_CLASS;
+ if (!_stricmp (priority_string, "IDLE_PRIORITY_CLASS"))
+ priority = IDLE_PRIORITY_CLASS;
+ else if (!_stricmp (priority_string, "BELOW_NORMAL_PRIORITY_CLASS"))
+ priority = BELOW_NORMAL_PRIORITY_CLASS;
+ else if (!_stricmp (priority_string, "NORMAL_PRIORITY_CLASS"))
+ priority = NORMAL_PRIORITY_CLASS;
+ else if (!_stricmp (priority_string, "ABOVE_NORMAL_PRIORITY_CLASS"))
+ priority = ABOVE_NORMAL_PRIORITY_CLASS;
+ else if (!_stricmp (priority_string, "HIGH_PRIORITY_CLASS"))
+ priority = HIGH_PRIORITY_CLASS;
+ else
+ {
+ MSG (M_ERR, "Unknown priority name: %s", priority_string);
+ goto finish;
+ }
+
+ /* set log file append/truncate flag */
+ append = false;
+ if (append_string[0] == '0')
+ append = false;
+ else if (append_string[0] == '1')
+ append = true;
+ else
+ {
+ MSG (M_ERR, "Log file append flag (given as '%s') must be '0' or '1'", append_string);
+ goto finish;
+ }
+
+ /*
+ * Instantiate an OpenVPN process for each configuration
+ * file found.
+ */
+ {
+ WIN32_FIND_DATA find_obj;
+ HANDLE find_handle;
+ BOOL more_files;
+ char find_string[MAX_PATH];
+
+ openvpn_snprintf (find_string, MAX_PATH, "%s\\*", config_dir);
+
+ find_handle = FindFirstFile (find_string, &find_obj);
+ if (find_handle == INVALID_HANDLE_VALUE)
+ {
+ MSG (M_ERR, "Cannot get configuration file list using: %s", find_string);
+ goto finish;
+ }
+
+ /*
+ * Loop over each config file
+ */
+ do {
+ HANDLE log_handle = NULL;
+ STARTUPINFO start_info;
+ PROCESS_INFORMATION proc_info;
+ struct security_attributes sa;
+ char log_file[MAX_PATH];
+ char log_path[MAX_PATH];
+ char command_line[256];
+
+ CLEAR (start_info);
+ CLEAR (proc_info);
+ CLEAR (sa);
+
+ if (!ReportStatusToSCMgr(SERVICE_START_PENDING, NO_ERROR, 3000))
+ {
+ MSG (M_ERR, "ReportStatusToSCMgr #3 failed");
+ FindClose (find_handle);
+ goto finish;
+ }
+
+ /* does file have the correct type and extension? */
+ if (match (&find_obj, ext_string))
+ {
+ /* get log file pathname */
+ if (!modext (log_file, sizeof (log_file), find_obj.cFileName, "log"))
+ {
+ MSG (M_ERR, "Cannot construct logfile name based on: %s", find_obj.cFileName);
+ FindClose (find_handle);
+ goto finish;
+ }
+ openvpn_snprintf (log_path, sizeof(log_path),
+ "%s\\%s", log_dir, log_file);
+
+ /* construct command line */
+ openvpn_snprintf (command_line, sizeof(command_line), PACKAGE " --service %s 1 --config \"%s\"",
+ EXIT_EVENT_NAME,
+ find_obj.cFileName);
+
+ /* Make security attributes struct for logfile handle so it can
+ be inherited. */
+ if (!init_security_attributes_allow_all (&sa))
+ {
+ MSG (M_SYSERR, "InitializeSecurityDescriptor start_" PACKAGE " failed");
+ goto finish;
+ }
+
+ /* open logfile as stdout/stderr for soon-to-be-spawned subprocess */
+ log_handle = CreateFile (log_path,
+ GENERIC_WRITE,
+ FILE_SHARE_READ,
+ &sa.sa,
+ append ? OPEN_ALWAYS : CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+
+ if (log_handle == INVALID_HANDLE_VALUE)
+ {
+ MSG (M_SYSERR, "Cannot open logfile: %s", log_path);
+ FindClose (find_handle);
+ goto finish;
+ }
+
+ /* append to logfile? */
+ if (append)
+ {
+ if (SetFilePointer (log_handle, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER)
+ {
+ MSG (M_SYSERR, "Cannot seek to end of logfile: %s", log_path);
+ FindClose (find_handle);
+ goto finish;
+ }
+ }
+
+ /* fill in STARTUPINFO struct */
+ GetStartupInfo(&start_info);
+ start_info.cb = sizeof(start_info);
+ start_info.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
+ start_info.wShowWindow = SW_HIDE;
+ start_info.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ start_info.hStdOutput = start_info.hStdError = log_handle;
+
+ /* create an OpenVPN process for one config file */
+ if (!CreateProcess(exe_path,
+ command_line,
+ NULL,
+ NULL,
+ TRUE,
+ priority | CREATE_NEW_CONSOLE,
+ NULL,
+ config_dir,
+ &start_info,
+ &proc_info))
+ {
+ MSG (M_SYSERR, "CreateProcess failed, exe='%s' cmdline='%s' dir='%s'",
+ exe_path,
+ command_line,
+ config_dir);
+
+ FindClose (find_handle);
+ CloseHandle (log_handle);
+ goto finish;
+ }
+
+ /* close unneeded handles */
+ Sleep (1000); /* try to prevent race if we close logfile
+ handle before child process DUPs it */
+ if (!CloseHandle (proc_info.hProcess)
+ || !CloseHandle (proc_info.hThread)
+ || !CloseHandle (log_handle))
+ {
+ MSG (M_SYSERR, "CloseHandle failed");
+ goto finish;
+ }
+ }
+
+ /* more files to process? */
+ more_files = FindNextFile (find_handle, &find_obj);
+
+ } while (more_files);
+
+ FindClose (find_handle);
+ }
+
+ /* we are now fully started */
+ if (!ReportStatusToSCMgr(SERVICE_RUNNING, NO_ERROR, 0))
+ {
+ MSG (M_ERR, "ReportStatusToSCMgr SERVICE_RUNNING failed");
+ goto finish;
+ }
+
+ /* wait for our shutdown signal */
+ if (WaitForSingleObject (exit_event, INFINITE) != WAIT_OBJECT_0)
+ {
+ MSG (M_ERR, "wait for shutdown signal failed");
+ }
+
+ finish:
+ ServiceStop ();
+ if (exit_event)
+ CloseHandle (exit_event);
+}
+
+VOID ServiceStop()
+{
+ if (exit_event)
+ SetEvent(exit_event);
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj
new file mode 100644
index 00000000..0b75ed01
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}</ProjectGuid>
+ <RootNamespace>openvpnserv</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)-Output\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>$(SOURCEBASE);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="openvpnserv.c" />
+ <ClCompile Include="service.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="service.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpnserv_resources.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\build\msvc\msvc-generate\msvc-generate.vcxproj">
+ <Project>{8598c2c8-34c4-47a1-99b0-7c295a890615}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters
new file mode 100644
index 00000000..0c89b4f4
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="openvpnserv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="service.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="service.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="openvpnserv_resources.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv_resources.rc b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv_resources.rc
new file mode 100644
index 00000000..7980193b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/openvpnserv_resources.rc
@@ -0,0 +1,43 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#include <config-msvc-version.h>
+#endif
+#include <winresrc.h>
+
+#pragma code_page(65001) /* UTF8 */
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION OPENVPN_VERSION_RESOURCE
+ PRODUCTVERSION OPENVPN_VERSION_RESOURCE
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "The OpenVPN Project"
+ VALUE "FileDescription", "OpenVPN Service"
+ VALUE "FileVersion", PACKAGE_VERSION ".0"
+ VALUE "InternalName", "OpenVPN"
+ VALUE "LegalCopyright", "Copyright © The OpenVPN Project"
+ VALUE "OriginalFilename", "openvpnserv.exe"
+ VALUE "ProductName", "OpenVPN"
+ VALUE "ProductVersion", PACKAGE_VERSION ".0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.c b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.c
new file mode 100644
index 00000000..d7562b38
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.c
@@ -0,0 +1,700 @@
+/*---------------------------------------------------------------------------
+THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
+ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
+PARTICULAR PURPOSE.
+
+Copyright (C) 1993 - 2000. Microsoft Corporation. All rights reserved.
+
+MODULE: service.c
+
+PURPOSE: Implements functions required by all Windows NT services
+
+FUNCTIONS:
+ main(int argc, char **argv);
+ service_ctrl(DWORD dwCtrlCode);
+ service_main(DWORD dwArgc, LPTSTR *lpszArgv);
+ CmdInstallService();
+ CmdRemoveService();
+ CmdStartService();
+ CmdDebugService(int argc, char **argv);
+ ControlHandler ( DWORD dwCtrlType );
+ GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
+
+---------------------------------------------------------------------------*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#elif defined(_MSC_VER)
+#include "config-msvc.h"
+#endif
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <process.h>
+#include <tchar.h>
+
+#include "service.h"
+
+// internal variables
+SERVICE_STATUS ssStatus; // current status of the service
+SERVICE_STATUS_HANDLE sshStatusHandle;
+DWORD dwErr = 0;
+BOOL bDebug = FALSE;
+TCHAR szErr[256];
+
+// internal function prototypes
+VOID WINAPI service_ctrl(DWORD dwCtrlCode);
+VOID WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv);
+int CmdInstallService();
+int CmdRemoveService();
+int CmdStartService();
+VOID CmdDebugService(int argc, char **argv);
+BOOL WINAPI ControlHandler ( DWORD dwCtrlType );
+LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
+
+//
+// FUNCTION: main
+//
+// PURPOSE: entrypoint for service
+//
+// PARAMETERS:
+// argc - number of command line arguments
+// argv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+// main() either performs the command line task, or
+// call StartServiceCtrlDispatcher to register the
+// main service thread. When the this call returns,
+// the service has stopped, so exit.
+//
+int __cdecl main(int argc, char **argv)
+{
+ SERVICE_TABLE_ENTRY dispatchTable[] =
+ {
+ { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main},
+ { NULL, NULL}
+ };
+
+ if ( (argc > 1) &&
+ ((*argv[1] == '-') || (*argv[1] == '/')) )
+ {
+ if ( _stricmp( "install", argv[1]+1 ) == 0 )
+ {
+ return CmdInstallService();
+ }
+ else if ( _stricmp( "remove", argv[1]+1 ) == 0 )
+ {
+ return CmdRemoveService();
+ }
+ else if ( _stricmp( "start", argv[1]+1 ) == 0)
+ {
+ return CmdStartService();
+ }
+ else if ( _stricmp( "debug", argv[1]+1 ) == 0 )
+ {
+ bDebug = TRUE;
+ CmdDebugService(argc, argv);
+ }
+ else
+ {
+ goto dispatch;
+ }
+ return 0;
+ }
+
+ // if it doesn't match any of the above parameters
+ // the service control manager may be starting the service
+ // so we must call StartServiceCtrlDispatcher
+ dispatch:
+ // this is just to be friendly
+ printf( "%s -install to install the service\n", SZAPPNAME );
+ printf( "%s -start to start the service\n", SZAPPNAME );
+ printf( "%s -remove to remove the service\n", SZAPPNAME );
+ printf( "%s -debug <params> to run as a console app for debugging\n", SZAPPNAME );
+ printf( "\nStartServiceCtrlDispatcher being called.\n" );
+ printf( "This may take several seconds. Please wait.\n" );
+
+ if (!StartServiceCtrlDispatcher(dispatchTable))
+ AddToMessageLog(MSG_FLAGS_ERROR, TEXT("StartServiceCtrlDispatcher failed."));
+
+ return 0;
+}
+
+
+
+//
+// FUNCTION: service_main
+//
+// PURPOSE: To perform actual initialization of the service
+//
+// PARAMETERS:
+// dwArgc - number of command line arguments
+// lpszArgv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+// This routine performs the service initialization and then calls
+// the user defined ServiceStart() routine to perform majority
+// of the work.
+//
+void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
+{
+
+ // register our service control handler:
+ //
+ sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);
+
+ if (!sshStatusHandle)
+ goto cleanup;
+
+ // SERVICE_STATUS members that don't change in example
+ //
+ ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ ssStatus.dwServiceSpecificExitCode = 0;
+
+
+ // report the status to the service control manager.
+ //
+ if (!ReportStatusToSCMgr(
+ SERVICE_START_PENDING, // service state
+ NO_ERROR, // exit code
+ 3000)) // wait hint
+ goto cleanup;
+
+
+ ServiceStart( dwArgc, lpszArgv );
+
+ cleanup:
+
+ // try to report the stopped status to the service control manager.
+ //
+ if (sshStatusHandle)
+ (VOID)ReportStatusToSCMgr(
+ SERVICE_STOPPED,
+ dwErr,
+ 0);
+
+ return;
+}
+
+
+
+//
+// FUNCTION: service_ctrl
+//
+// PURPOSE: This function is called by the SCM whenever
+// ControlService() is called on this service.
+//
+// PARAMETERS:
+// dwCtrlCode - type of control requested
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+VOID WINAPI service_ctrl(DWORD dwCtrlCode)
+{
+ // Handle the requested control code.
+ //
+ switch (dwCtrlCode)
+ {
+ // Stop the service.
+ //
+ // SERVICE_STOP_PENDING should be reported before
+ // setting the Stop Event - hServerStopEvent - in
+ // ServiceStop(). This avoids a race condition
+ // which may result in a 1053 - The Service did not respond...
+ // error.
+ case SERVICE_CONTROL_STOP:
+ ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0);
+ ServiceStop();
+ return;
+
+ // Update the service status.
+ //
+ case SERVICE_CONTROL_INTERROGATE:
+ break;
+
+ // invalid control code
+ //
+ default:
+ break;
+
+ }
+
+ ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
+}
+
+
+
+//
+// FUNCTION: ReportStatusToSCMgr()
+//
+// PURPOSE: Sets the current status of the service and
+// reports it to the Service Control Manager
+//
+// PARAMETERS:
+// dwCurrentState - the state of the service
+// dwWin32ExitCode - error code to report
+// dwWaitHint - worst case estimate to next checkpoint
+//
+// RETURN VALUE:
+// TRUE - success
+// FALSE - failure
+//
+// COMMENTS:
+//
+BOOL ReportStatusToSCMgr(DWORD dwCurrentState,
+ DWORD dwWin32ExitCode,
+ DWORD dwWaitHint)
+{
+ static DWORD dwCheckPoint = 1;
+ BOOL fResult = TRUE;
+
+
+ if ( !bDebug ) // when debugging we don't report to the SCM
+ {
+ if (dwCurrentState == SERVICE_START_PENDING)
+ ssStatus.dwControlsAccepted = 0;
+ else
+ ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+
+ ssStatus.dwCurrentState = dwCurrentState;
+ ssStatus.dwWin32ExitCode = dwWin32ExitCode;
+ ssStatus.dwWaitHint = dwWaitHint;
+
+ if ( ( dwCurrentState == SERVICE_RUNNING ) ||
+ ( dwCurrentState == SERVICE_STOPPED ) )
+ ssStatus.dwCheckPoint = 0;
+ else
+ ssStatus.dwCheckPoint = dwCheckPoint++;
+
+
+ // Report the status of the service to the service control manager.
+ //
+ if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus)))
+ {
+ AddToMessageLog(MSG_FLAGS_ERROR, TEXT("SetServiceStatus"));
+ }
+ }
+ return fResult;
+}
+
+
+
+//
+// FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
+//
+// PURPOSE: Allows any thread to log an error message
+//
+// PARAMETERS:
+// lpszMsg - text for message
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void AddToMessageLog(DWORD flags, LPTSTR lpszMsg)
+{
+ TCHAR szMsg [(sizeof(SZSERVICENAME) / sizeof(TCHAR)) + 100 ];
+ HANDLE hEventSource;
+ LPCSTR lpszStrings[2];
+
+ if ( !bDebug )
+ {
+ if (flags & MSG_FLAGS_SYS_CODE)
+ dwErr = GetLastError();
+ else
+ dwErr = 0;
+
+ // Use event logging to log the error.
+ //
+ hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
+
+ _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SZSERVICENAME), (int)dwErr);
+ lpszStrings[0] = szMsg;
+ lpszStrings[1] = lpszMsg;
+
+ if (hEventSource != NULL)
+ {
+ ReportEvent(hEventSource, // handle of event source
+ // event type
+ (flags & MSG_FLAGS_ERROR)
+ ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE,
+ 0, // event category
+ 0, // event ID
+ NULL, // current user's SID
+ 2, // strings in lpszStrings
+ 0, // no bytes of raw data
+ lpszStrings, // array of error strings
+ NULL); // no raw data
+
+ (VOID) DeregisterEventSource(hEventSource);
+ }
+ }
+}
+
+void ResetError (void)
+{
+ dwErr = 0;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// The following code handles service installation and removal
+//
+
+
+//
+// FUNCTION: CmdInstallService()
+//
+// PURPOSE: Installs the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// 0 if success
+//
+// COMMENTS:
+//
+int CmdInstallService()
+{
+ SC_HANDLE schService;
+ SC_HANDLE schSCManager;
+
+ TCHAR szPath[512];
+
+ int ret = 0;
+
+ if ( GetModuleFileName( NULL, szPath+1, 510 ) == 0 )
+ {
+ _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
+ return 1;
+ }
+ szPath[0] = '\"';
+ strcat(szPath, "\"");
+
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE // access required
+ );
+ if ( schSCManager )
+ {
+ schService = CreateService(
+ schSCManager, // SCManager database
+ TEXT(SZSERVICENAME), // name of service
+ TEXT(SZSERVICEDISPLAYNAME), // name to display
+ SERVICE_QUERY_STATUS, // desired access
+ SERVICE_WIN32_OWN_PROCESS, // service type
+ SERVICE_DEMAND_START, // start type -- alternative: SERVICE_AUTO_START
+ SERVICE_ERROR_NORMAL, // error control type
+ szPath, // service's binary
+ NULL, // no load ordering group
+ NULL, // no tag identifier
+ TEXT(SZDEPENDENCIES), // dependencies
+ NULL, // LocalSystem account
+ NULL); // no password
+
+ if ( schService )
+ {
+ _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ CloseServiceHandle(schService);
+ }
+ else
+ {
+ _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
+ ret = 1;
+ }
+
+ CloseServiceHandle(schSCManager);
+ }
+ else
+ {
+ _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+ return ret;
+}
+
+//
+// FUNCTION: CmdStartService()
+//
+// PURPOSE: Start the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// 0 if success
+//
+// COMMENTS:
+
+int CmdStartService()
+{
+ int ret = 0;
+
+ SC_HANDLE schSCManager;
+ SC_HANDLE schService;
+
+
+ // Open a handle to the SC Manager database.
+ schSCManager = OpenSCManager(
+ NULL, // local machine
+ NULL, // ServicesActive database
+ SC_MANAGER_ALL_ACCESS); // full access rights
+
+ if (NULL == schSCManager) {
+ _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+
+ schService = OpenService(
+ schSCManager, // SCM database
+ SZSERVICENAME, // service name
+ SERVICE_ALL_ACCESS);
+
+ if (schService == NULL) {
+ _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+
+ if (!StartService(
+ schService, // handle to service
+ 0, // number of arguments
+ NULL) ) // no arguments
+ {
+ _tprintf(TEXT("StartService failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+ else
+ {
+ _tprintf(TEXT("Service Started\n"));
+ ret = 0;
+ }
+ CloseServiceHandle(schService);
+ CloseServiceHandle(schSCManager);
+ return ret;
+}
+
+//
+// FUNCTION: CmdRemoveService()
+//
+// PURPOSE: Stops and removes the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// 0 if success
+//
+// COMMENTS:
+//
+int CmdRemoveService()
+{
+ SC_HANDLE schService;
+ SC_HANDLE schSCManager;
+
+ int ret = 0;
+
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_CONNECT // access required
+ );
+ if ( schSCManager )
+ {
+ schService = OpenService(schSCManager, TEXT(SZSERVICENAME), DELETE | SERVICE_STOP | SERVICE_QUERY_STATUS);
+
+ if (schService)
+ {
+ // try to stop the service
+ if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
+ {
+ _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
+ Sleep( 1000 );
+
+ while ( QueryServiceStatus( schService, &ssStatus ) )
+ {
+ if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING )
+ {
+ _tprintf(TEXT("."));
+ Sleep( 1000 );
+ }
+ else
+ break;
+ }
+
+ if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
+ _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ else
+ {
+ _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ ret = 1;
+ }
+
+ }
+
+ // now remove the service
+ if ( DeleteService(schService) )
+ _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ else
+ {
+ _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+
+
+ CloseServiceHandle(schService);
+ }
+ else
+ {
+ _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+
+ CloseServiceHandle(schSCManager);
+ }
+ else
+ {
+ _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+ ret = 1;
+ }
+ return ret;
+}
+
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// The following code is for running the service as a console app
+//
+
+
+//
+// FUNCTION: CmdDebugService(int argc, char ** argv)
+//
+// PURPOSE: Runs the service as a console application
+//
+// PARAMETERS:
+// argc - number of command line arguments
+// argv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void CmdDebugService(int argc, char ** argv)
+{
+ DWORD dwArgc;
+ LPTSTR *lpszArgv;
+
+#ifdef UNICODE
+ lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
+ if (NULL == lpszArgv)
+ {
+ // CommandLineToArvW failed!!
+ _tprintf(TEXT("CmdDebugService CommandLineToArgvW returned NULL\n"));
+ return;
+ }
+#else
+ dwArgc = (DWORD) argc;
+ lpszArgv = argv;
+#endif
+
+ _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
+
+ SetConsoleCtrlHandler( ControlHandler, TRUE );
+
+ ServiceStart( dwArgc, lpszArgv );
+
+#ifdef UNICODE
+// Must free memory allocated for arguments
+
+ GlobalFree(lpszArgv);
+#endif // UNICODE
+
+}
+
+
+//
+// FUNCTION: ControlHandler ( DWORD dwCtrlType )
+//
+// PURPOSE: Handled console control events
+//
+// PARAMETERS:
+// dwCtrlType - type of control event
+//
+// RETURN VALUE:
+// True - handled
+// False - unhandled
+//
+// COMMENTS:
+//
+BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
+{
+ switch ( dwCtrlType )
+ {
+ case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate
+ case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in debug mode
+ _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
+ ServiceStop();
+ return TRUE;
+ break;
+
+ }
+ return FALSE;
+}
+
+//
+// FUNCTION: GetLastErrorText
+//
+// PURPOSE: copies error message text to string
+//
+// PARAMETERS:
+// lpszBuf - destination buffer
+// dwSize - size of buffer
+//
+// RETURN VALUE:
+// destination buffer
+//
+// COMMENTS:
+//
+LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize )
+{
+ DWORD dwRet;
+ LPTSTR lpszTemp = NULL;
+
+ dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ NULL,
+ GetLastError(),
+ LANG_NEUTRAL,
+ (LPTSTR)&lpszTemp,
+ 0,
+ NULL );
+
+ // supplied buffer is not long enough
+ if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) )
+ lpszBuf[0] = TEXT('\0');
+ else
+ {
+ lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); //remove cr and newline character
+ _stprintf( lpszBuf, TEXT("%s (0x%x)"), lpszTemp, (int)GetLastError() );
+ }
+
+ if ( lpszTemp )
+ LocalFree((HLOCAL) lpszTemp );
+
+ return lpszBuf;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.h b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.h
new file mode 100644
index 00000000..e89a89fb
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/openvpnserv/service.h
@@ -0,0 +1,139 @@
+/*---------------------------------------------------------------------------
+THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
+ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
+PARTICULAR PURPOSE.
+
+Copyright (C) 1993 - 2000. Microsoft Corporation. All rights reserved.
+
+ MODULE: service.h
+
+ Comments: The use of this header file and the accompanying service.c
+ file simplifies the process of writting a service. You as a developer
+ simply need to follow the TODO's outlined in this header file, and
+ implement the ServiceStart() and ServiceStop() functions.
+
+ There is no need to modify the code in service.c. Just add service.c
+ to your project and link with the following libraries...
+
+ libcmt.lib kernel32.lib advapi.lib shell32.lib
+
+ This code also supports unicode. Be sure to compile both service.c and
+ and code #include "service.h" with the same Unicode setting.
+
+ Upon completion, your code will have the following command line interface
+
+ <service exe> -? to display this list
+ <service exe> -install to install the service
+ <service exe> -remove to remove the service
+ <service exe> -debug <params> to run as a console app for debugging
+
+ Note: This code also implements Ctrl+C and Ctrl+Break handlers
+ when using the debug option. These console events cause
+ your ServiceStop routine to be called
+
+ Also, this code only handles the OWN_SERVICE service type
+ running in the LOCAL_SYSTEM security context.
+
+ To control your service ( start, stop, etc ) you may use the
+ Services control panel applet or the NET.EXE program.
+
+ To aid in writing/debugging service, the
+ SDK contains a utility (MSTOOLS\BIN\SC.EXE) that
+ can be used to control, configure, or obtain service status.
+ SC displays complete status for any service/driver
+ in the service database, and allows any of the configuration
+ parameters to be easily changed at the command line.
+ For more information on SC.EXE, type SC at the command line.
+
+
+------------------------------------------------------------------------------*/
+
+#ifndef _SERVICE_H
+#define _SERVICE_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+//// todo: change to desired strings
+////
+// name of the executable
+#define SZAPPNAME PACKAGE "serv"
+// internal name of the service
+#define SZSERVICENAME PACKAGE_NAME "Service"
+// displayed name of the service
+#define SZSERVICEDISPLAYNAME PACKAGE_NAME " Service"
+// list of service dependencies - "dep1\0dep2\0\0"
+#define SZDEPENDENCIES TAP_WIN_COMPONENT_ID "\0Dhcp\0\0"
+//////////////////////////////////////////////////////////////////////////////
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//// todo: ServiceStart()must be defined by in your code.
+//// The service should use ReportStatusToSCMgr to indicate
+//// progress. This routine must also be used by StartService()
+//// to report to the SCM when the service is running.
+////
+//// If a ServiceStop procedure is going to take longer than
+//// 3 seconds to execute, it should spawn a thread to
+//// execute the stop code, and return. Otherwise, the
+//// ServiceControlManager will believe that the service has
+//// stopped responding
+////
+ VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
+ VOID ServiceStop();
+//////////////////////////////////////////////////////////////////////////////
+
+
+
+//////////////////////////////////////////////////////////////////////////////
+//// The following are procedures which
+//// may be useful to call within the above procedures,
+//// but require no implementation by the user.
+//// They are implemented in service.c
+
+//
+// FUNCTION: ReportStatusToSCMgr()
+//
+// PURPOSE: Sets the current status of the service and
+// reports it to the Service Control Manager
+//
+// PARAMETERS:
+// dwCurrentState - the state of the service
+// dwWin32ExitCode - error code to report
+// dwWaitHint - worst case estimate to next checkpoint
+//
+// RETURN VALUE:
+// TRUE - success
+// FALSE - failure
+//
+ BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
+
+
+//
+// FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
+//
+// PURPOSE: Allows any thread to log an error message
+//
+// PARAMETERS:
+// lpszMsg - text for message
+//
+// RETURN VALUE:
+// none
+//
+# define MSG_FLAGS_ERROR (1<<0)
+# define MSG_FLAGS_SYS_CODE (1<<1)
+ void AddToMessageLog(DWORD flags, LPTSTR lpszMsg);
+ void ResetError (void);
+//////////////////////////////////////////////////////////////////////////////
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.am
new file mode 100644
index 00000000..17b72b94
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.am
@@ -0,0 +1,15 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+SUBDIRS = auth-pam down-root
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.in b/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.in
new file mode 100644
index 00000000..6a366c4b
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/Makefile.in
@@ -0,0 +1,546 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 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@
+
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/plugins
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_emptyarray.m4 \
+ $(top_srcdir)/m4/ax_socklen_t.m4 \
+ $(top_srcdir)/m4/ax_varargs.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/version.m4 \
+ $(top_srcdir)/compat.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GIT = @GIT@
+GREP = @GREP@
+IFCONFIG = @IFCONFIG@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPROUTE = @IPROUTE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPAM_CFLAGS = @LIBPAM_CFLAGS@
+LIBPAM_LIBS = @LIBPAM_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_LIBS = @LZO_LIBS@
+MAKEINFO = @MAKEINFO@
+MAN2HTML = @MAN2HTML@
+MKDIR_P = @MKDIR_P@
+NETSTAT = @NETSTAT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CRYPTO_CFLAGS = @OPENSSL_CRYPTO_CFLAGS@
+OPENSSL_CRYPTO_LIBS = @OPENSSL_CRYPTO_LIBS@
+OPENSSL_SSL_CFLAGS = @OPENSSL_SSL_CFLAGS@
+OPENSSL_SSL_LIBS = @OPENSSL_SSL_LIBS@
+OPTIONAL_CRYPTO_CFLAGS = @OPTIONAL_CRYPTO_CFLAGS@
+OPTIONAL_CRYPTO_LIBS = @OPTIONAL_CRYPTO_LIBS@
+OPTIONAL_DL_LIBS = @OPTIONAL_DL_LIBS@
+OPTIONAL_LZO_CFLAGS = @OPTIONAL_LZO_CFLAGS@
+OPTIONAL_LZO_LIBS = @OPTIONAL_LZO_LIBS@
+OPTIONAL_PKCS11_HELPER_CFLAGS = @OPTIONAL_PKCS11_HELPER_CFLAGS@
+OPTIONAL_PKCS11_HELPER_LIBS = @OPTIONAL_PKCS11_HELPER_LIBS@
+OPTIONAL_SELINUX_LIBS = @OPTIONAL_SELINUX_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKCS11_HELPER_CFLAGS = @PKCS11_HELPER_CFLAGS@
+PKCS11_HELPER_LIBS = @PKCS11_HELPER_LIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PLUGIN_AUTH_PAM_CFLAGS = @PLUGIN_AUTH_PAM_CFLAGS@
+PLUGIN_AUTH_PAM_LIBS = @PLUGIN_AUTH_PAM_LIBS@
+POLARSSL_CFLAGS = @POLARSSL_CFLAGS@
+POLARSSL_LIBS = @POLARSSL_LIBS@
+RANLIB = @RANLIB@
+RC = @RC@
+ROUTE = @ROUTE@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKETS_LIBS = @SOCKETS_LIBS@
+STRIP = @STRIP@
+TAP_CFLAGS = @TAP_CFLAGS@
+TAP_WIN_COMPONENT_ID = @TAP_WIN_COMPONENT_ID@
+TAP_WIN_MIN_MAJOR = @TAP_WIN_MIN_MAJOR@
+TAP_WIN_MIN_MINOR = @TAP_WIN_MIN_MINOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+plugindir = @plugindir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sampledir = @sampledir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+SUBDIRS = auth-pam down-root
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(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/plugins/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/plugins/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
+
+# 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"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @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) $(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
+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)
+ @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 \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); 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; \
+ 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" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+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)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+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:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive 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-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.am
new file mode 100644
index 00000000..2aef311a
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.am
@@ -0,0 +1,28 @@
+#
+# OpenVPN (TM) PAM Auth Plugin -- OpenVPN Plugin
+#
+# Copyright (C) 2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include \
+ $(PLUGIN_AUTH_PAM_CFLAGS) \
+ $(OPTIONAL_CRYPTO_CFLAGS)
+
+if ENABLE_PLUGIN_AUTH_PAM
+plugin_LTLIBRARIES = openvpn-plugin-auth-pam.la
+dist_doc_DATA = README.auth-pam
+endif
+
+openvpn_plugin_auth_pam_la_SOURCES = \
+ auth-pam.c \
+ pamdl.c pamdl.h \
+ auth-pam.exports
+openvpn_plugin_auth_pam_la_LIBADD = \
+ $(PLUGIN_AUTH_PAM_LIBS)
+openvpn_plugin_auth_pam_la_LDFLAGS = $(AM_LDFLAGS) \
+ -export-symbols "$(srcdir)/auth-pam.exports" \
+ -module -shared -avoid-version -no-undefined
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.in b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.in
new file mode 100644
index 00000000..74c23306
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/Makefile.in
@@ -0,0 +1,570 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 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@
+
+#
+# OpenVPN (TM) PAM Auth Plugin -- OpenVPN Plugin
+#
+# Copyright (C) 2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/plugins/auth-pam
+DIST_COMMON = $(am__dist_doc_DATA_DIST) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_emptyarray.m4 \
+ $(top_srcdir)/m4/ax_socklen_t.m4 \
+ $(top_srcdir)/m4/ax_varargs.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/version.m4 \
+ $(top_srcdir)/compat.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(docdir)"
+pluginLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(plugin_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+openvpn_plugin_auth_pam_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_openvpn_plugin_auth_pam_la_OBJECTS = auth-pam.lo pamdl.lo
+openvpn_plugin_auth_pam_la_OBJECTS = \
+ $(am_openvpn_plugin_auth_pam_la_OBJECTS)
+openvpn_plugin_auth_pam_la_LINK = $(LIBTOOL) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(openvpn_plugin_auth_pam_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+@ENABLE_PLUGIN_AUTH_PAM_TRUE@am_openvpn_plugin_auth_pam_la_rpath = \
+@ENABLE_PLUGIN_AUTH_PAM_TRUE@ -rpath $(plugindir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+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)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(openvpn_plugin_auth_pam_la_SOURCES)
+DIST_SOURCES = $(openvpn_plugin_auth_pam_la_SOURCES)
+am__dist_doc_DATA_DIST = README.auth-pam
+dist_docDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_doc_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GIT = @GIT@
+GREP = @GREP@
+IFCONFIG = @IFCONFIG@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPROUTE = @IPROUTE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPAM_CFLAGS = @LIBPAM_CFLAGS@
+LIBPAM_LIBS = @LIBPAM_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_LIBS = @LZO_LIBS@
+MAKEINFO = @MAKEINFO@
+MAN2HTML = @MAN2HTML@
+MKDIR_P = @MKDIR_P@
+NETSTAT = @NETSTAT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CRYPTO_CFLAGS = @OPENSSL_CRYPTO_CFLAGS@
+OPENSSL_CRYPTO_LIBS = @OPENSSL_CRYPTO_LIBS@
+OPENSSL_SSL_CFLAGS = @OPENSSL_SSL_CFLAGS@
+OPENSSL_SSL_LIBS = @OPENSSL_SSL_LIBS@
+OPTIONAL_CRYPTO_CFLAGS = @OPTIONAL_CRYPTO_CFLAGS@
+OPTIONAL_CRYPTO_LIBS = @OPTIONAL_CRYPTO_LIBS@
+OPTIONAL_DL_LIBS = @OPTIONAL_DL_LIBS@
+OPTIONAL_LZO_CFLAGS = @OPTIONAL_LZO_CFLAGS@
+OPTIONAL_LZO_LIBS = @OPTIONAL_LZO_LIBS@
+OPTIONAL_PKCS11_HELPER_CFLAGS = @OPTIONAL_PKCS11_HELPER_CFLAGS@
+OPTIONAL_PKCS11_HELPER_LIBS = @OPTIONAL_PKCS11_HELPER_LIBS@
+OPTIONAL_SELINUX_LIBS = @OPTIONAL_SELINUX_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKCS11_HELPER_CFLAGS = @PKCS11_HELPER_CFLAGS@
+PKCS11_HELPER_LIBS = @PKCS11_HELPER_LIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PLUGIN_AUTH_PAM_CFLAGS = @PLUGIN_AUTH_PAM_CFLAGS@
+PLUGIN_AUTH_PAM_LIBS = @PLUGIN_AUTH_PAM_LIBS@
+POLARSSL_CFLAGS = @POLARSSL_CFLAGS@
+POLARSSL_LIBS = @POLARSSL_LIBS@
+RANLIB = @RANLIB@
+RC = @RC@
+ROUTE = @ROUTE@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKETS_LIBS = @SOCKETS_LIBS@
+STRIP = @STRIP@
+TAP_CFLAGS = @TAP_CFLAGS@
+TAP_WIN_COMPONENT_ID = @TAP_WIN_COMPONENT_ID@
+TAP_WIN_MIN_MAJOR = @TAP_WIN_MIN_MAJOR@
+TAP_WIN_MIN_MINOR = @TAP_WIN_MIN_MINOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+plugindir = @plugindir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sampledir = @sampledir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include
+
+@ENABLE_PLUGIN_AUTH_PAM_TRUE@plugin_LTLIBRARIES = openvpn-plugin-auth-pam.la
+@ENABLE_PLUGIN_AUTH_PAM_TRUE@dist_doc_DATA = README.auth-pam
+openvpn_plugin_auth_pam_la_SOURCES = \
+ auth-pam.c \
+ pamdl.c pamdl.h \
+ auth-pam.exports
+
+openvpn_plugin_auth_pam_la_LIBADD = \
+ $(PLUGIN_AUTH_PAM_LIBS)
+
+openvpn_plugin_auth_pam_la_LDFLAGS = $(AM_LDFLAGS) \
+ -export-symbols "$(srcdir)/auth-pam.exports" \
+ -module -shared -avoid-version -no-undefined
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(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/plugins/auth-pam/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/plugins/auth-pam/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-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pluginLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \
+ done
+
+clean-pluginLTLIBRARIES:
+ -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
+ @list='$(plugin_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
+openvpn-plugin-auth-pam.la: $(openvpn_plugin_auth_pam_la_OBJECTS) $(openvpn_plugin_auth_pam_la_DEPENDENCIES)
+ $(openvpn_plugin_auth_pam_la_LINK) $(am_openvpn_plugin_auth_pam_la_rpath) $(openvpn_plugin_auth_pam_la_OBJECTS) $(openvpn_plugin_auth_pam_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth-pam.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pamdl.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
+@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
+@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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-dist_docDATA: $(dist_doc_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
+ @list='$(dist_doc_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
+ $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
+ done
+
+uninstall-dist_docDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_doc_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(docdir)/$$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)
+ @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 \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); 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; \
+ 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) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(docdir)"; 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:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_docDATA install-pluginLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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-dist_docDATA uninstall-pluginLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pluginLTLIBRARIES 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-dist_docDATA install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pluginLTLIBRARIES install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-dist_docDATA uninstall-pluginLTLIBRARIES
+
+ $(PLUGIN_AUTH_PAM_CFLAGS)
+# 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/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/README.auth-pam b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/README.auth-pam
new file mode 100644
index 00000000..e1236902
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/README.auth-pam
@@ -0,0 +1,74 @@
+openvpn-auth-pam
+
+SYNOPSIS
+
+The openvpn-auth-pam module implements username/password
+authentication via PAM, and essentially allows any authentication
+method supported by PAM (such as LDAP, RADIUS, or Linux Shadow
+passwords) to be used with OpenVPN. While PAM supports
+username/password authentication, this can be combined with X509
+certificates to provide two indepedent levels of authentication.
+
+This module uses a split privilege execution model which will
+function even if you drop openvpn daemon privileges using the user,
+group, or chroot directives.
+
+BUILD
+
+To build openvpn-auth-pam, you will need to have the pam-devel
+package installed.
+
+Build with the "make" command. The module will be named
+openvpn-auth-pam.so
+
+USAGE
+
+To use this plugin module, add to your OpenVPN config file:
+
+ plugin openvpn-auth-pam.so service-type
+
+The required service-type parameter corresponds to
+the PAM service definition file usually found
+in /etc/pam.d.
+
+This plugin also supports the usage of a list of name/value
+pairs to answer PAM module queries.
+
+For example:
+
+ plugin openvpn-auth-pam.so "login login USERNAME password PASSWORD"
+
+tells auth-pam to (a) use the "login" PAM module, (b) answer a
+"login" query with the username given by the OpenVPN client, and
+(c) answer a "password" query with the password given by the
+OpenVPN client. This provides flexibility in dealing with the different
+types of query strings which different PAM modules might generate.
+For example, suppose you were using a PAM module called
+"test" which queried for "name" rather than "login":
+
+ plugin openvpn-auth-pam.so "test name USERNAME password PASSWORD"
+
+While "USERNAME" "COMMONNAME" and "PASSWORD" are special strings which substitute
+to client-supplied values, it is also possible to name literal values
+to use as PAM module query responses. For example, suppose that the
+login module queried for a third parameter, "domain" which
+is to be answered with the constant value "mydomain.com":
+
+ plugin openvpn-auth-pam.so "login login USERNAME password PASSWORD domain mydomain.com"
+
+The following OpenVPN directives can also influence
+the operation of this plugin:
+
+ client-cert-not-required
+ username-as-common-name
+
+Run OpenVPN with --verb 7 or higher to get debugging output from
+this plugin, including the list of queries presented by the
+underlying PAM module. This is a useful debugging tool to figure
+out which queries a given PAM module is making, so that you can
+craft the appropriate plugin directive to answer it.
+
+CAVEATS
+
+This module will only work on *nix systems which support PAM,
+not Windows.
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.c b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.c
new file mode 100644
index 00000000..bd717927
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.c
@@ -0,0 +1,806 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * OpenVPN plugin module to do PAM authentication using a split
+ * privilege model.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <security/pam_appl.h>
+
+#ifdef USE_PAM_DLOPEN
+#include "pamdl.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <syslog.h>
+
+#include <openvpn-plugin.h>
+
+#define DEBUG(verb) ((verb) >= 4)
+
+/* Command codes for foreground -> background communication */
+#define COMMAND_VERIFY 0
+#define COMMAND_EXIT 1
+
+/* Response codes for background -> foreground communication */
+#define RESPONSE_INIT_SUCCEEDED 10
+#define RESPONSE_INIT_FAILED 11
+#define RESPONSE_VERIFY_SUCCEEDED 12
+#define RESPONSE_VERIFY_FAILED 13
+
+/*
+ * Plugin state, used by foreground
+ */
+struct auth_pam_context
+{
+ /* Foreground's socket to background process */
+ int foreground_fd;
+
+ /* Process ID of background process */
+ pid_t background_pid;
+
+ /* Verbosity level of OpenVPN */
+ int verb;
+};
+
+/*
+ * Name/Value pairs for conversation function.
+ * Special Values:
+ *
+ * "USERNAME" -- substitute client-supplied username
+ * "PASSWORD" -- substitute client-specified password
+ * "COMMONNAME" -- substitute client certificate common name
+ */
+
+#define N_NAME_VALUE 16
+
+struct name_value {
+ const char *name;
+ const char *value;
+};
+
+struct name_value_list {
+ int len;
+ struct name_value data[N_NAME_VALUE];
+};
+
+/*
+ * Used to pass the username/password
+ * to the PAM conversation function.
+ */
+struct user_pass {
+ int verb;
+
+ char username[128];
+ char password[128];
+ char common_name[128];
+
+ const struct name_value_list *name_value_list;
+};
+
+/* Background process function */
+static void pam_server (int fd, const char *service, int verb, const struct name_value_list *name_value_list);
+
+/* Read 'tosearch', replace all occurences of 'searchfor' with 'replacewith' and return
+ * a pointer to the NEW string. Does not modify the input strings. Will not enter an
+ * infinite loop with clever 'searchfor' and 'replacewith' strings.
+ * Daniel Johnson - Progman2000@usa.net / djohnson@progman.us
+ */
+static char *
+searchandreplace(const char *tosearch, const char *searchfor, const char *replacewith)
+{
+ const char *searching=tosearch;
+ char *scratch;
+ char temp[strlen(tosearch)*10];
+ temp[0]=0;
+
+ if (!tosearch || !searchfor || !replacewith) return 0;
+ if (!strlen(tosearch) || !strlen(searchfor) || !strlen(replacewith)) return 0;
+
+ scratch = strstr(searching,searchfor);
+ if (!scratch) return strdup(tosearch);
+
+ while (scratch) {
+ strncat(temp,searching,scratch-searching);
+ strcat(temp,replacewith);
+
+ searching=scratch+strlen(searchfor);
+ scratch = strstr(searching,searchfor);
+ }
+ return strdup(temp);
+}
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Return the length of a string array
+ */
+static int
+string_array_len (const char *array[])
+{
+ int i = 0;
+ if (array)
+ {
+ while (array[i])
+ ++i;
+ }
+ return i;
+}
+
+/*
+ * Socket read/write functions.
+ */
+
+static int
+recv_control (int fd)
+{
+ unsigned char c;
+ const ssize_t size = read (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return c;
+ else
+ {
+ /*fprintf (stderr, "AUTH-PAM: DEBUG recv_control.read=%d\n", (int)size);*/
+ return -1;
+ }
+}
+
+static int
+send_control (int fd, int code)
+{
+ unsigned char c = (unsigned char) code;
+ const ssize_t size = write (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return (int) size;
+ else
+ return -1;
+}
+
+static int
+recv_string (int fd, char *buffer, int len)
+{
+ if (len > 0)
+ {
+ ssize_t size;
+ memset (buffer, 0, len);
+ size = read (fd, buffer, len);
+ buffer[len-1] = 0;
+ if (size >= 1)
+ return (int)size;
+ }
+ return -1;
+}
+
+static int
+send_string (int fd, const char *string)
+{
+ const int len = strlen (string) + 1;
+ const ssize_t size = write (fd, string, len);
+ if (size == len)
+ return (int) size;
+ else
+ return -1;
+}
+
+#ifdef DO_DAEMONIZE
+
+/*
+ * Daemonize if "daemon" env var is true.
+ * Preserve stderr across daemonization if
+ * "daemon_log_redirect" env var is true.
+ */
+static void
+daemonize (const char *envp[])
+{
+ const char *daemon_string = get_env ("daemon", envp);
+ if (daemon_string && daemon_string[0] == '1')
+ {
+ const char *log_redirect = get_env ("daemon_log_redirect", envp);
+ int fd = -1;
+ if (log_redirect && log_redirect[0] == '1')
+ fd = dup (2);
+ if (daemon (0, 0) < 0)
+ {
+ fprintf (stderr, "AUTH-PAM: daemonization failed\n");
+ }
+ else if (fd >= 3)
+ {
+ dup2 (fd, 2);
+ close (fd);
+ }
+ }
+}
+
+#endif
+
+/*
+ * Close most of parent's fds.
+ * Keep stdin/stdout/stderr, plus one
+ * other fd which is presumed to be
+ * our pipe back to parent.
+ * Admittedly, a bit of a kludge,
+ * but posix doesn't give us a kind
+ * of FD_CLOEXEC which will stop
+ * fds from crossing a fork().
+ */
+static void
+close_fds_except (int keep)
+{
+ int i;
+ closelog ();
+ for (i = 3; i <= 100; ++i)
+ {
+ if (i != keep)
+ close (i);
+ }
+}
+
+/*
+ * Usually we ignore signals, because our parent will
+ * deal with them.
+ */
+static void
+set_signals (void)
+{
+ signal (SIGTERM, SIG_DFL);
+
+ signal (SIGINT, SIG_IGN);
+ signal (SIGHUP, SIG_IGN);
+ signal (SIGUSR1, SIG_IGN);
+ signal (SIGUSR2, SIG_IGN);
+ signal (SIGPIPE, SIG_IGN);
+}
+
+/*
+ * Return 1 if query matches match.
+ */
+static int
+name_value_match (const char *query, const char *match)
+{
+ while (!isalnum (*query))
+ {
+ if (*query == '\0')
+ return 0;
+ ++query;
+ }
+ return strncasecmp (match, query, strlen (match)) == 0;
+}
+
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
+{
+ pid_t pid;
+ int fd[2];
+
+ struct auth_pam_context *context;
+ struct name_value_list name_value_list;
+
+ const int base_parms = 2;
+
+ /*
+ * Allocate our context
+ */
+ context = (struct auth_pam_context *) calloc (1, sizeof (struct auth_pam_context));
+ if (!context)
+ goto error;
+ context->foreground_fd = -1;
+
+ /*
+ * Intercept the --auth-user-pass-verify callback.
+ */
+ *type_mask = OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY);
+
+ /*
+ * Make sure we have two string arguments: the first is the .so name,
+ * the second is the PAM service type.
+ */
+ if (string_array_len (argv) < base_parms)
+ {
+ fprintf (stderr, "AUTH-PAM: need PAM service parameter\n");
+ goto error;
+ }
+
+ /*
+ * See if we have optional name/value pairs to match against
+ * PAM module queried fields in the conversation function.
+ */
+ name_value_list.len = 0;
+ if (string_array_len (argv) > base_parms)
+ {
+ const int nv_len = string_array_len (argv) - base_parms;
+ int i;
+
+ if ((nv_len & 1) == 1 || (nv_len / 2) > N_NAME_VALUE)
+ {
+ fprintf (stderr, "AUTH-PAM: bad name/value list length\n");
+ goto error;
+ }
+
+ name_value_list.len = nv_len / 2;
+ for (i = 0; i < name_value_list.len; ++i)
+ {
+ const int base = base_parms + i * 2;
+ name_value_list.data[i].name = argv[base];
+ name_value_list.data[i].value = argv[base+1];
+ }
+ }
+
+ /*
+ * Get verbosity level from environment
+ */
+ {
+ const char *verb_string = get_env ("verb", envp);
+ if (verb_string)
+ context->verb = atoi (verb_string);
+ }
+
+ /*
+ * Make a socket for foreground and background processes
+ * to communicate.
+ */
+ if (socketpair (PF_UNIX, SOCK_DGRAM, 0, fd) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: socketpair call failed\n");
+ goto error;
+ }
+
+ /*
+ * Fork off the privileged process. It will remain privileged
+ * even after the foreground process drops its privileges.
+ */
+ pid = fork ();
+
+ if (pid)
+ {
+ int status;
+
+ /*
+ * Foreground Process
+ */
+
+ context->background_pid = pid;
+
+ /* close our copy of child's socket */
+ close (fd[1]);
+
+ /* don't let future subprocesses inherit child socket */
+ if (fcntl (fd[0], F_SETFD, FD_CLOEXEC) < 0)
+ fprintf (stderr, "AUTH-PAM: Set FD_CLOEXEC flag on socket file descriptor failed\n");
+
+ /* wait for background child process to initialize */
+ status = recv_control (fd[0]);
+ if (status == RESPONSE_INIT_SUCCEEDED)
+ {
+ context->foreground_fd = fd[0];
+ return (openvpn_plugin_handle_t) context;
+ }
+ }
+ else
+ {
+ /*
+ * Background Process
+ */
+
+ /* close all parent fds except our socket back to parent */
+ close_fds_except (fd[1]);
+
+ /* Ignore most signals (the parent will receive them) */
+ set_signals ();
+
+#ifdef DO_DAEMONIZE
+ /* Daemonize if --daemon option is set. */
+ daemonize (envp);
+#endif
+
+ /* execute the event loop */
+ pam_server (fd[1], argv[1], context->verb, &name_value_list);
+
+ close (fd[1]);
+
+ exit (0);
+ return 0; /* NOTREACHED */
+ }
+
+ error:
+ if (context)
+ free (context);
+ return NULL;
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
+{
+ struct auth_pam_context *context = (struct auth_pam_context *) handle;
+
+ if (type == OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY && context->foreground_fd >= 0)
+ {
+ /* get username/password from envp string array */
+ const char *username = get_env ("username", envp);
+ const char *password = get_env ("password", envp);
+ const char *common_name = get_env ("common_name", envp) ? get_env ("common_name", envp) : "";
+
+ if (username && strlen (username) > 0 && password)
+ {
+ if (send_control (context->foreground_fd, COMMAND_VERIFY) == -1
+ || send_string (context->foreground_fd, username) == -1
+ || send_string (context->foreground_fd, password) == -1
+ || send_string (context->foreground_fd, common_name) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: Error sending auth info to background process\n");
+ }
+ else
+ {
+ const int status = recv_control (context->foreground_fd);
+ if (status == RESPONSE_VERIFY_SUCCEEDED)
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ if (status == -1)
+ fprintf (stderr, "AUTH-PAM: Error receiving auth confirmation from background process\n");
+ }
+ }
+ }
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct auth_pam_context *context = (struct auth_pam_context *) handle;
+
+ if (DEBUG (context->verb))
+ fprintf (stderr, "AUTH-PAM: close\n");
+
+ if (context->foreground_fd >= 0)
+ {
+ /* tell background process to exit */
+ if (send_control (context->foreground_fd, COMMAND_EXIT) == -1)
+ fprintf (stderr, "AUTH-PAM: Error signaling background process to exit\n");
+
+ /* wait for background process to exit */
+ if (context->background_pid > 0)
+ waitpid (context->background_pid, NULL, 0);
+
+ close (context->foreground_fd);
+ context->foreground_fd = -1;
+ }
+
+ free (context);
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_abort_v1 (openvpn_plugin_handle_t handle)
+{
+ struct auth_pam_context *context = (struct auth_pam_context *) handle;
+
+ /* tell background process to exit */
+ if (context && context->foreground_fd >= 0)
+ {
+ send_control (context->foreground_fd, COMMAND_EXIT);
+ close (context->foreground_fd);
+ context->foreground_fd = -1;
+ }
+}
+
+/*
+ * PAM conversation function
+ */
+static int
+my_conv (int n, const struct pam_message **msg_array,
+ struct pam_response **response_array, void *appdata_ptr)
+{
+ const struct user_pass *up = ( const struct user_pass *) appdata_ptr;
+ struct pam_response *aresp;
+ int i;
+ int ret = PAM_SUCCESS;
+
+ *response_array = NULL;
+
+ if (n <= 0 || n > PAM_MAX_NUM_MSG)
+ return (PAM_CONV_ERR);
+ if ((aresp = calloc (n, sizeof *aresp)) == NULL)
+ return (PAM_BUF_ERR);
+
+ /* loop through each PAM-module query */
+ for (i = 0; i < n; ++i)
+ {
+ const struct pam_message *msg = msg_array[i];
+ aresp[i].resp_retcode = 0;
+ aresp[i].resp = NULL;
+
+ if (DEBUG (up->verb))
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: my_conv[%d] query='%s' style=%d\n",
+ i,
+ msg->msg ? msg->msg : "NULL",
+ msg->msg_style);
+ }
+
+ if (up->name_value_list && up->name_value_list->len > 0)
+ {
+ /* use name/value list match method */
+ const struct name_value_list *list = up->name_value_list;
+ int j;
+
+ /* loop through name/value pairs */
+ for (j = 0; j < list->len; ++j)
+ {
+ const char *match_name = list->data[j].name;
+ const char *match_value = list->data[j].value;
+
+ if (name_value_match (msg->msg, match_name))
+ {
+ /* found name/value match */
+ aresp[i].resp = NULL;
+
+ if (DEBUG (up->verb))
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: name match found, query/match-string ['%s', '%s'] = '%s'\n",
+ msg->msg,
+ match_name,
+ match_value);
+
+ if (strstr(match_value, "USERNAME"))
+ aresp[i].resp = searchandreplace(match_value, "USERNAME", up->username);
+ else if (strstr(match_value, "PASSWORD"))
+ aresp[i].resp = searchandreplace(match_value, "PASSWORD", up->password);
+ else if (strstr(match_value, "COMMONNAME"))
+ aresp[i].resp = searchandreplace(match_value, "COMMONNAME", up->common_name);
+ else
+ aresp[i].resp = strdup (match_value);
+
+ if (aresp[i].resp == NULL)
+ ret = PAM_CONV_ERR;
+ break;
+ }
+ }
+
+ if (j == list->len)
+ ret = PAM_CONV_ERR;
+ }
+ else
+ {
+ /* use PAM_PROMPT_ECHO_x hints */
+ switch (msg->msg_style)
+ {
+ case PAM_PROMPT_ECHO_OFF:
+ aresp[i].resp = strdup (up->password);
+ if (aresp[i].resp == NULL)
+ ret = PAM_CONV_ERR;
+ break;
+
+ case PAM_PROMPT_ECHO_ON:
+ aresp[i].resp = strdup (up->username);
+ if (aresp[i].resp == NULL)
+ ret = PAM_CONV_ERR;
+ break;
+
+ case PAM_ERROR_MSG:
+ case PAM_TEXT_INFO:
+ break;
+
+ default:
+ ret = PAM_CONV_ERR;
+ break;
+ }
+ }
+ }
+
+ if (ret == PAM_SUCCESS)
+ *response_array = aresp;
+ return ret;
+}
+
+/*
+ * Return 1 if authenticated and 0 if failed.
+ * Called once for every username/password
+ * to be authenticated.
+ */
+static int
+pam_auth (const char *service, const struct user_pass *up)
+{
+ struct pam_conv conv;
+ pam_handle_t *pamh = NULL;
+ int status = PAM_SUCCESS;
+ int ret = 0;
+ const int name_value_list_provided = (up->name_value_list && up->name_value_list->len > 0);
+
+ /* Initialize PAM */
+ conv.conv = my_conv;
+ conv.appdata_ptr = (void *)up;
+ status = pam_start (service, name_value_list_provided ? NULL : up->username, &conv, &pamh);
+ if (status == PAM_SUCCESS)
+ {
+ /* Call PAM to verify username/password */
+ status = pam_authenticate(pamh, 0);
+ if (status == PAM_SUCCESS)
+ status = pam_acct_mgmt (pamh, 0);
+ if (status == PAM_SUCCESS)
+ ret = 1;
+
+ /* Output error message if failed */
+ if (!ret)
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: user '%s' failed to authenticate: %s\n",
+ up->username,
+ pam_strerror (pamh, status));
+ }
+
+ /* Close PAM */
+ pam_end (pamh, status);
+ }
+
+ return ret;
+}
+
+/*
+ * Background process -- runs with privilege.
+ */
+static void
+pam_server (int fd, const char *service, int verb, const struct name_value_list *name_value_list)
+{
+ struct user_pass up;
+ int command;
+#ifdef USE_PAM_DLOPEN
+ static const char pam_so[] = "libpam.so";
+#endif
+
+ /*
+ * Do initialization
+ */
+ if (DEBUG (verb))
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: INIT service='%s'\n", service);
+
+#ifdef USE_PAM_DLOPEN
+ /*
+ * Load PAM shared object
+ */
+ if (!dlopen_pam (pam_so))
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: could not load PAM lib %s: %s\n", pam_so, dlerror());
+ send_control (fd, RESPONSE_INIT_FAILED);
+ goto done;
+ }
+#endif
+
+ /*
+ * Tell foreground that we initialized successfully
+ */
+ if (send_control (fd, RESPONSE_INIT_SUCCEEDED) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: write error on response socket [1]\n");
+ goto done;
+ }
+
+ /*
+ * Event loop
+ */
+ while (1)
+ {
+ memset (&up, 0, sizeof (up));
+ up.verb = verb;
+ up.name_value_list = name_value_list;
+
+ /* get a command from foreground process */
+ command = recv_control (fd);
+
+ if (DEBUG (verb))
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: received command code: %d\n", command);
+
+ switch (command)
+ {
+ case COMMAND_VERIFY:
+ if (recv_string (fd, up.username, sizeof (up.username)) == -1
+ || recv_string (fd, up.password, sizeof (up.password)) == -1
+ || recv_string (fd, up.common_name, sizeof (up.common_name)) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: read error on command channel: code=%d, exiting\n",
+ command);
+ goto done;
+ }
+
+ if (DEBUG (verb))
+ {
+#if 0
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: USER/PASS: %s/%s\n",
+ up.username, up.password);
+#else
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: USER: %s\n", up.username);
+#endif
+ }
+
+ if (pam_auth (service, &up)) /* Succeeded */
+ {
+ if (send_control (fd, RESPONSE_VERIFY_SUCCEEDED) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: write error on response socket [2]\n");
+ goto done;
+ }
+ }
+ else /* Failed */
+ {
+ if (send_control (fd, RESPONSE_VERIFY_FAILED) == -1)
+ {
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: write error on response socket [3]\n");
+ goto done;
+ }
+ }
+ break;
+
+ case COMMAND_EXIT:
+ goto done;
+
+ case -1:
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: read error on command channel\n");
+ goto done;
+
+ default:
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: unknown command code: code=%d, exiting\n",
+ command);
+ goto done;
+ }
+ }
+ done:
+
+#ifdef USE_PAM_DLOPEN
+ dlclose_pam ();
+#endif
+ if (DEBUG (verb))
+ fprintf (stderr, "AUTH-PAM: BACKGROUND: EXIT\n");
+
+ return;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.exports b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.exports
new file mode 100644
index 00000000..b07937cc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/auth-pam.exports
@@ -0,0 +1,4 @@
+openvpn_plugin_open_v1
+openvpn_plugin_func_v1
+openvpn_plugin_close_v1
+openvpn_plugin_abort_v1
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.c b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.c
new file mode 100644
index 00000000..26e98215
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.c
@@ -0,0 +1,184 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef USE_PAM_DLOPEN
+/*
+ * If you want to dynamically load libpam using dlopen() or something,
+ * then dlopen( ' this shared object ' ); It takes care of exporting
+ * the right symbols to any modules loaded by libpam.
+ *
+ * Modified by JY for use with openvpn-pam-auth
+ */
+
+#include <stdio.h>
+#include <dlfcn.h>
+#include <security/pam_appl.h>
+
+#include "pamdl.h"
+
+static void *libpam_h = NULL;
+
+#define RESOLVE_PAM_FUNCTION(x, y, z, err) \
+ { \
+ union { const void *tpointer; y (*fn) z ; } fptr; \
+ fptr.tpointer = dlsym(libpam_h, #x); real_##x = fptr.fn; \
+ if (real_##x == NULL) { \
+ fprintf (stderr, "PAMDL: unable to resolve '%s': %s\n", #x, dlerror()); \
+ return err; \
+ } \
+ }
+
+int
+dlopen_pam (const char *so)
+{
+ if (libpam_h == NULL)
+ {
+ libpam_h = dlopen(so, RTLD_GLOBAL|RTLD_NOW);
+ }
+ return libpam_h != NULL;
+}
+
+void
+dlclose_pam (void)
+{
+ if (libpam_h != NULL)
+ {
+ dlclose(libpam_h);
+ libpam_h = NULL;
+ }
+}
+
+int pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh)
+{
+ int (*real_pam_start)(const char *, const char *,
+ const struct pam_conv *,
+ pam_handle_t **);
+ RESOLVE_PAM_FUNCTION(pam_start, int, (const char *, const char *,
+ const struct pam_conv *,
+ pam_handle_t **), PAM_ABORT);
+ return real_pam_start(service_name, user, pam_conversation, pamh);
+}
+
+int pam_end(pam_handle_t *pamh, int pam_status)
+{
+ int (*real_pam_end)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_end, int, (pam_handle_t *, int), PAM_ABORT);
+ return real_pam_end(pamh, pam_status);
+}
+
+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item)
+{
+ int (*real_pam_set_item)(pam_handle_t *, int, const void *);
+ RESOLVE_PAM_FUNCTION(pam_set_item, int,
+ (pam_handle_t *, int, const void *), PAM_ABORT);
+ return real_pam_set_item(pamh, item_type, item);
+}
+
+int pam_get_item(const pam_handle_t *pamh, int item_type, const void **item)
+{
+ int (*real_pam_get_item)(const pam_handle_t *, int, const void **);
+ RESOLVE_PAM_FUNCTION(pam_get_item, int,
+ (const pam_handle_t *, int, const void **),
+ PAM_ABORT);
+ return real_pam_get_item(pamh, item_type, item);
+}
+
+int pam_fail_delay(pam_handle_t *pamh, unsigned int musec_delay)
+{
+ int (*real_pam_fail_delay)(pam_handle_t *, unsigned int);
+ RESOLVE_PAM_FUNCTION(pam_fail_delay, int, (pam_handle_t *, unsigned int),
+ PAM_ABORT);
+ return real_pam_fail_delay(pamh, musec_delay);
+}
+
+typedef const char * const_char_pointer;
+
+const_char_pointer pam_strerror(pam_handle_t *pamh, int errnum)
+{
+ const_char_pointer (*real_pam_strerror)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_strerror, const_char_pointer,
+ (pam_handle_t *, int), NULL);
+ return real_pam_strerror(pamh, errnum);
+}
+
+int pam_putenv(pam_handle_t *pamh, const char *name_value)
+{
+ int (*real_pam_putenv)(pam_handle_t *, const char *);
+ RESOLVE_PAM_FUNCTION(pam_putenv, int, (pam_handle_t *, const char *),
+ PAM_ABORT);
+ return real_pam_putenv(pamh, name_value);
+}
+
+const_char_pointer pam_getenv(pam_handle_t *pamh, const char *name)
+{
+ const_char_pointer (*real_pam_getenv)(pam_handle_t *, const char *);
+ RESOLVE_PAM_FUNCTION(pam_getenv, const_char_pointer,
+ (pam_handle_t *, const char *), NULL);
+ return real_pam_getenv(pamh, name);
+}
+
+typedef char ** char_ppointer;
+char_ppointer pam_getenvlist(pam_handle_t *pamh)
+{
+ char_ppointer (*real_pam_getenvlist)(pam_handle_t *);
+ RESOLVE_PAM_FUNCTION(pam_getenvlist, char_ppointer, (pam_handle_t *),
+ NULL);
+ return real_pam_getenvlist(pamh);
+}
+
+/* Authentication management */
+
+int pam_authenticate(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_authenticate)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_authenticate, int, (pam_handle_t *, int),
+ PAM_ABORT);
+ return real_pam_authenticate(pamh, flags);
+}
+
+int pam_setcred(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_setcred)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_setcred, int, (pam_handle_t *, int), PAM_ABORT);
+ return real_pam_setcred(pamh, flags);
+}
+
+/* Account Management API's */
+
+int pam_acct_mgmt(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_acct_mgmt)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_acct_mgmt, int, (pam_handle_t *, int), PAM_ABORT);
+ return real_pam_acct_mgmt(pamh, flags);
+}
+
+/* Session Management API's */
+
+int pam_open_session(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_open_session)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_open_session, int, (pam_handle_t *, int),
+ PAM_ABORT);
+ return real_pam_open_session(pamh, flags);
+}
+
+int pam_close_session(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_close_session)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_close_session, int, (pam_handle_t *, int),
+ PAM_ABORT);
+ return real_pam_close_session(pamh, flags);
+}
+
+/* Password Management API's */
+
+int pam_chauthtok(pam_handle_t *pamh, int flags)
+{
+ int (*real_pam_chauthtok)(pam_handle_t *, int);
+ RESOLVE_PAM_FUNCTION(pam_chauthtok, int, (pam_handle_t *, int), PAM_ABORT);
+ return real_pam_chauthtok(pamh, flags);
+}
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.h b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.h
new file mode 100644
index 00000000..12ba0684
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/auth-pam/pamdl.h
@@ -0,0 +1,5 @@
+#ifdef USE_PAM_DLOPEN
+/* Dynamically load and unload the PAM library */
+int dlopen_pam (const char *so);
+void dlclose_pam (void);
+#endif
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.am b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.am
new file mode 100644
index 00000000..7ca5a4e1
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.am
@@ -0,0 +1,24 @@
+#
+# OpenVPN (TM) Down Root Plugin -- OpenVPN Plugin
+#
+# Copyright (C) 2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include \
+ $(OPTIONAL_CRYPTO_CFLAGS)
+
+if ENABLE_PLUGIN_DOWN_ROOT
+plugin_LTLIBRARIES = openvpn-plugin-down-root.la
+dist_doc_DATA = README.down-root
+endif
+
+openvpn_plugin_down_root_la_SOURCES = \
+ down-root.c \
+ down-root.exports
+openvpn_plugin_down_root_la_LDFLAGS = $(AM_LDFLAGS) \
+ -export-symbols "$(srcdir)/down-root.exports" \
+ -module -shared -avoid-version -no-undefined
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.in b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.in
new file mode 100644
index 00000000..fa06a466
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/Makefile.in
@@ -0,0 +1,563 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 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@
+
+#
+# OpenVPN (TM) Down Root Plugin -- OpenVPN Plugin
+#
+# Copyright (C) 2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/plugins/down-root
+DIST_COMMON = $(am__dist_doc_DATA_DIST) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_emptyarray.m4 \
+ $(top_srcdir)/m4/ax_socklen_t.m4 \
+ $(top_srcdir)/m4/ax_varargs.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/version.m4 \
+ $(top_srcdir)/compat.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(docdir)"
+pluginLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(plugin_LTLIBRARIES)
+openvpn_plugin_down_root_la_LIBADD =
+am_openvpn_plugin_down_root_la_OBJECTS = down-root.lo
+openvpn_plugin_down_root_la_OBJECTS = \
+ $(am_openvpn_plugin_down_root_la_OBJECTS)
+openvpn_plugin_down_root_la_LINK = $(LIBTOOL) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(openvpn_plugin_down_root_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+@ENABLE_PLUGIN_DOWN_ROOT_TRUE@am_openvpn_plugin_down_root_la_rpath = \
+@ENABLE_PLUGIN_DOWN_ROOT_TRUE@ -rpath $(plugindir)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+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)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(openvpn_plugin_down_root_la_SOURCES)
+DIST_SOURCES = $(openvpn_plugin_down_root_la_SOURCES)
+am__dist_doc_DATA_DIST = README.down-root
+dist_docDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_doc_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GIT = @GIT@
+GREP = @GREP@
+IFCONFIG = @IFCONFIG@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPROUTE = @IPROUTE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPAM_CFLAGS = @LIBPAM_CFLAGS@
+LIBPAM_LIBS = @LIBPAM_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_LIBS = @LZO_LIBS@
+MAKEINFO = @MAKEINFO@
+MAN2HTML = @MAN2HTML@
+MKDIR_P = @MKDIR_P@
+NETSTAT = @NETSTAT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CRYPTO_CFLAGS = @OPENSSL_CRYPTO_CFLAGS@
+OPENSSL_CRYPTO_LIBS = @OPENSSL_CRYPTO_LIBS@
+OPENSSL_SSL_CFLAGS = @OPENSSL_SSL_CFLAGS@
+OPENSSL_SSL_LIBS = @OPENSSL_SSL_LIBS@
+OPTIONAL_CRYPTO_CFLAGS = @OPTIONAL_CRYPTO_CFLAGS@
+OPTIONAL_CRYPTO_LIBS = @OPTIONAL_CRYPTO_LIBS@
+OPTIONAL_DL_LIBS = @OPTIONAL_DL_LIBS@
+OPTIONAL_LZO_CFLAGS = @OPTIONAL_LZO_CFLAGS@
+OPTIONAL_LZO_LIBS = @OPTIONAL_LZO_LIBS@
+OPTIONAL_PKCS11_HELPER_CFLAGS = @OPTIONAL_PKCS11_HELPER_CFLAGS@
+OPTIONAL_PKCS11_HELPER_LIBS = @OPTIONAL_PKCS11_HELPER_LIBS@
+OPTIONAL_SELINUX_LIBS = @OPTIONAL_SELINUX_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKCS11_HELPER_CFLAGS = @PKCS11_HELPER_CFLAGS@
+PKCS11_HELPER_LIBS = @PKCS11_HELPER_LIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PLUGIN_AUTH_PAM_CFLAGS = @PLUGIN_AUTH_PAM_CFLAGS@
+PLUGIN_AUTH_PAM_LIBS = @PLUGIN_AUTH_PAM_LIBS@
+POLARSSL_CFLAGS = @POLARSSL_CFLAGS@
+POLARSSL_LIBS = @POLARSSL_LIBS@
+RANLIB = @RANLIB@
+RC = @RC@
+ROUTE = @ROUTE@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKETS_LIBS = @SOCKETS_LIBS@
+STRIP = @STRIP@
+TAP_CFLAGS = @TAP_CFLAGS@
+TAP_WIN_COMPONENT_ID = @TAP_WIN_COMPONENT_ID@
+TAP_WIN_MIN_MAJOR = @TAP_WIN_MIN_MAJOR@
+TAP_WIN_MIN_MINOR = @TAP_WIN_MIN_MINOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+plugindir = @plugindir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sampledir = @sampledir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include
+
+@ENABLE_PLUGIN_DOWN_ROOT_TRUE@plugin_LTLIBRARIES = openvpn-plugin-down-root.la
+@ENABLE_PLUGIN_DOWN_ROOT_TRUE@dist_doc_DATA = README.down-root
+openvpn_plugin_down_root_la_SOURCES = \
+ down-root.c \
+ down-root.exports
+
+openvpn_plugin_down_root_la_LDFLAGS = $(AM_LDFLAGS) \
+ -export-symbols "$(srcdir)/down-root.exports" \
+ -module -shared -avoid-version -no-undefined
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(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/plugins/down-root/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/plugins/down-root/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-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pluginLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \
+ done
+
+clean-pluginLTLIBRARIES:
+ -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
+ @list='$(plugin_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
+openvpn-plugin-down-root.la: $(openvpn_plugin_down_root_la_OBJECTS) $(openvpn_plugin_down_root_la_DEPENDENCIES)
+ $(openvpn_plugin_down_root_la_LINK) $(am_openvpn_plugin_down_root_la_rpath) $(openvpn_plugin_down_root_la_OBJECTS) $(openvpn_plugin_down_root_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/down-root.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
+@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
+@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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-dist_docDATA: $(dist_doc_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
+ @list='$(dist_doc_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
+ $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
+ done
+
+uninstall-dist_docDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_doc_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(docdir)/$$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)
+ @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 \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); 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; \
+ 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) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(docdir)"; 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:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_docDATA install-pluginLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -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-dist_docDATA uninstall-pluginLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pluginLTLIBRARIES 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-dist_docDATA install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pluginLTLIBRARIES install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-dist_docDATA uninstall-pluginLTLIBRARIES
+
+# 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/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/README.down-root b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/README.down-root
new file mode 100644
index 00000000..d337ffe9
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/README.down-root
@@ -0,0 +1,29 @@
+down-root -- an OpenVPN Plugin Module
+
+SYNOPSIS
+
+The down-root module allows an OpenVPN configuration to
+call a down script with root privileges, even when privileges
+have been dropped using --user/--group/--chroot.
+
+This module uses a split privilege execution model which will
+fork() before OpenVPN drops root privileges, at the point where
+the --up script is usually called. The module will then remain
+in a wait state until it receives a message from OpenVPN via
+pipe to execute the down script. Thus, the down script will be
+run in the same execution environment as the up script.
+
+BUILD
+
+Build this module with the "make" command. The plugin
+module will be named openvpn-down-root.so
+
+USAGE
+
+To use this module, add to your OpenVPN config file:
+
+ plugin openvpn-down-root.so "command ..."
+
+CAVEATS
+
+This module will only work on *nix systems, not Windows.
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.c b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.c
new file mode 100644
index 00000000..d51d0e55
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.c
@@ -0,0 +1,557 @@
+/*
+ * 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,
+ * packet encryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ *
+ * 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 (see the file COPYING included with this
+ * distribution); if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * OpenVPN plugin module to do privileged down-script execution.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <syslog.h>
+
+#include <openvpn-plugin.h>
+
+#define DEBUG(verb) ((verb) >= 7)
+
+/* Command codes for foreground -> background communication */
+#define COMMAND_RUN_SCRIPT 0
+#define COMMAND_EXIT 1
+
+/* Response codes for background -> foreground communication */
+#define RESPONSE_INIT_SUCCEEDED 10
+#define RESPONSE_INIT_FAILED 11
+#define RESPONSE_SCRIPT_SUCCEEDED 12
+#define RESPONSE_SCRIPT_FAILED 13
+
+/* Background process function */
+static void down_root_server (const int fd, char *command, const char *argv[], const char *envp[], const int verb);
+
+/*
+ * Plugin state, used by foreground
+ */
+struct down_root_context
+{
+ /* Foreground's socket to background process */
+ int foreground_fd;
+
+ /* Process ID of background process */
+ pid_t background_pid;
+
+ /* Verbosity level of OpenVPN */
+ int verb;
+
+ /* down command */
+ char *command;
+};
+
+/*
+ * Given an environmental variable name, search
+ * the envp array for its value, returning it
+ * if found or NULL otherwise.
+ */
+static const char *
+get_env (const char *name, const char *envp[])
+{
+ if (envp)
+ {
+ int i;
+ const int namelen = strlen (name);
+ for (i = 0; envp[i]; ++i)
+ {
+ if (!strncmp (envp[i], name, namelen))
+ {
+ const char *cp = envp[i] + namelen;
+ if (*cp == '=')
+ return cp + 1;
+ }
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Return the length of a string array
+ */
+static int
+string_array_len (const char *array[])
+{
+ int i = 0;
+ if (array)
+ {
+ while (array[i])
+ ++i;
+ }
+ return i;
+}
+
+/*
+ * Socket read/write functions.
+ */
+
+static int
+recv_control (int fd)
+{
+ unsigned char c;
+ const ssize_t size = read (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return c;
+ else
+ return -1;
+}
+
+static int
+send_control (int fd, int code)
+{
+ unsigned char c = (unsigned char) code;
+ const ssize_t size = write (fd, &c, sizeof (c));
+ if (size == sizeof (c))
+ return (int) size;
+ else
+ return -1;
+}
+
+/*
+ * Daemonize if "daemon" env var is true.
+ * Preserve stderr across daemonization if
+ * "daemon_log_redirect" env var is true.
+ */
+static void
+daemonize (const char *envp[])
+{
+ const char *daemon_string = get_env ("daemon", envp);
+ if (daemon_string && daemon_string[0] == '1')
+ {
+ const char *log_redirect = get_env ("daemon_log_redirect", envp);
+ int fd = -1;
+ if (log_redirect && log_redirect[0] == '1')
+ fd = dup (2);
+ if (daemon (0, 0) < 0)
+ {
+ fprintf (stderr, "DOWN-ROOT: daemonization failed\n");
+ }
+ else if (fd >= 3)
+ {
+ dup2 (fd, 2);
+ close (fd);
+ }
+ }
+}
+
+/*
+ * Close most of parent's fds.
+ * Keep stdin/stdout/stderr, plus one
+ * other fd which is presumed to be
+ * our pipe back to parent.
+ * Admittedly, a bit of a kludge,
+ * but posix doesn't give us a kind
+ * of FD_CLOEXEC which will stop
+ * fds from crossing a fork().
+ */
+static void
+close_fds_except (int keep)
+{
+ int i;
+ closelog ();
+ for (i = 3; i <= 100; ++i)
+ {
+ if (i != keep)
+ close (i);
+ }
+}
+
+/*
+ * Usually we ignore signals, because our parent will
+ * deal with them.
+ */
+static void
+set_signals (void)
+{
+ signal (SIGTERM, SIG_DFL);
+
+ signal (SIGINT, SIG_IGN);
+ signal (SIGHUP, SIG_IGN);
+ signal (SIGUSR1, SIG_IGN);
+ signal (SIGUSR2, SIG_IGN);
+ signal (SIGPIPE, SIG_IGN);
+}
+
+/*
+ * convert system() return into a success/failure value
+ */
+int
+system_ok (int stat)
+{
+#ifdef WIN32
+ return stat == 0;
+#else
+ return stat != -1 && WIFEXITED (stat) && WEXITSTATUS (stat) == 0;
+#endif
+}
+
+static char *
+build_command_line (const char *argv[])
+{
+ int size = 0;
+ int n = 0;
+ int i;
+ char *string;
+
+ /* precompute size */
+ if (argv)
+ {
+ for (i = 0; argv[i]; ++i)
+ {
+ size += (strlen (argv[i]) + 1); /* string length plus trailing space */
+ ++n;
+ }
+ }
+ ++size; /* for null terminator */
+
+ /* allocate memory */
+ string = (char *) malloc (size);
+ if (!string)
+ {
+ fprintf (stderr, "DOWN-ROOT: out of memory\n");
+ exit (1);
+ }
+ string[0] = '\0';
+
+ /* build string */
+ for (i = 0; i < n; ++i)
+ {
+ strcat (string, argv[i]);
+ if (i + 1 < n)
+ strcat (string, " ");
+ }
+ return string;
+}
+
+static void
+free_context (struct down_root_context *context)
+{
+ if (context)
+ {
+ if (context->command)
+ free (context->command);
+ free (context);
+ }
+}
+
+OPENVPN_EXPORT openvpn_plugin_handle_t
+openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
+{
+ struct down_root_context *context;
+
+ /*
+ * Allocate our context
+ */
+ context = (struct down_root_context *) calloc (1, sizeof (struct down_root_context));
+ if (!context)
+ goto error;
+ context->foreground_fd = -1;
+
+ /*
+ * Intercept the --up and --down callbacks
+ */
+ *type_mask = OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_UP) | OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_DOWN);
+
+ /*
+ * Make sure we have two string arguments: the first is the .so name,
+ * the second is the script command.
+ */
+ if (string_array_len (argv) < 2)
+ {
+ fprintf (stderr, "DOWN-ROOT: need down script command\n");
+ goto error;
+ }
+
+ /*
+ * Save our argument in context
+ */
+ context->command = build_command_line (&argv[1]);
+
+ /*
+ * Get verbosity level from environment
+ */
+ {
+ const char *verb_string = get_env ("verb", envp);
+ if (verb_string)
+ context->verb = atoi (verb_string);
+ }
+
+ return (openvpn_plugin_handle_t) context;
+
+ error:
+ free_context (context);
+ return NULL;
+}
+
+OPENVPN_EXPORT int
+openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
+{
+ struct down_root_context *context = (struct down_root_context *) handle;
+
+ if (type == OPENVPN_PLUGIN_UP && context->foreground_fd == -1) /* fork off a process to hold onto root */
+ {
+ pid_t pid;
+ int fd[2];
+
+ /*
+ * Make a socket for foreground and background processes
+ * to communicate.
+ */
+ if (socketpair (PF_UNIX, SOCK_DGRAM, 0, fd) == -1)
+ {
+ fprintf (stderr, "DOWN-ROOT: socketpair call failed\n");
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+
+ /*
+ * Fork off the privileged process. It will remain privileged
+ * even after the foreground process drops its privileges.
+ */
+ pid = fork ();
+
+ if (pid)
+ {
+ int status;
+
+ /*
+ * Foreground Process
+ */
+
+ context->background_pid = pid;
+
+ /* close our copy of child's socket */
+ close (fd[1]);
+
+ /* don't let future subprocesses inherit child socket */
+ if (fcntl (fd[0], F_SETFD, FD_CLOEXEC) < 0)
+ fprintf (stderr, "DOWN-ROOT: Set FD_CLOEXEC flag on socket file descriptor failed\n");
+
+ /* wait for background child process to initialize */
+ status = recv_control (fd[0]);
+ if (status == RESPONSE_INIT_SUCCEEDED)
+ {
+ context->foreground_fd = fd[0];
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ }
+ }
+ else
+ {
+ /*
+ * Background Process
+ */
+
+ /* close all parent fds except our socket back to parent */
+ close_fds_except (fd[1]);
+
+ /* Ignore most signals (the parent will receive them) */
+ set_signals ();
+
+ /* Daemonize if --daemon option is set. */
+ daemonize (envp);
+
+ /* execute the event loop */
+ down_root_server (fd[1], context->command, argv, envp, context->verb);
+
+ close (fd[1]);
+ exit (0);
+ return 0; /* NOTREACHED */
+ }
+ }
+ else if (type == OPENVPN_PLUGIN_DOWN && context->foreground_fd >= 0)
+ {
+ if (send_control (context->foreground_fd, COMMAND_RUN_SCRIPT) == -1)
+ {
+ fprintf (stderr, "DOWN-ROOT: Error sending script execution signal to background process\n");
+ }
+ else
+ {
+ const int status = recv_control (context->foreground_fd);
+ if (status == RESPONSE_SCRIPT_SUCCEEDED)
+ return OPENVPN_PLUGIN_FUNC_SUCCESS;
+ if (status == -1)
+ fprintf (stderr, "DOWN-ROOT: Error receiving script execution confirmation from background process\n");
+ }
+ }
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)
+{
+ struct down_root_context *context = (struct down_root_context *) handle;
+
+ if (DEBUG (context->verb))
+ fprintf (stderr, "DOWN-ROOT: close\n");
+
+ if (context->foreground_fd >= 0)
+ {
+ /* tell background process to exit */
+ if (send_control (context->foreground_fd, COMMAND_EXIT) == -1)
+ fprintf (stderr, "DOWN-ROOT: Error signaling background process to exit\n");
+
+ /* wait for background process to exit */
+ if (context->background_pid > 0)
+ waitpid (context->background_pid, NULL, 0);
+
+ close (context->foreground_fd);
+ context->foreground_fd = -1;
+ }
+
+ free_context (context);
+}
+
+OPENVPN_EXPORT void
+openvpn_plugin_abort_v1 (openvpn_plugin_handle_t handle)
+{
+ struct down_root_context *context = (struct down_root_context *) handle;
+
+ if (context && context->foreground_fd >= 0)
+ {
+ /* tell background process to exit */
+ send_control (context->foreground_fd, COMMAND_EXIT);
+ close (context->foreground_fd);
+ context->foreground_fd = -1;
+ }
+}
+
+/*
+ * Background process -- runs with privilege.
+ */
+static void
+down_root_server (const int fd, char *command, const char *argv[], const char *envp[], const int verb)
+{
+ const char *p[3];
+ char *command_line = NULL;
+ char *argv_cat = NULL;
+ int i;
+
+ /*
+ * Do initialization
+ */
+ if (DEBUG (verb))
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: INIT command='%s'\n", command);
+
+ /*
+ * Tell foreground that we initialized successfully
+ */
+ if (send_control (fd, RESPONSE_INIT_SUCCEEDED) == -1)
+ {
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: write error on response socket [1]\n");
+ goto done;
+ }
+
+ /*
+ * Build command line
+ */
+ if (string_array_len (argv) >= 2)
+ argv_cat = build_command_line (&argv[1]);
+ else
+ argv_cat = build_command_line (NULL);
+ p[0] = command;
+ p[1] = argv_cat;
+ p[2] = NULL;
+ command_line = build_command_line (p);
+
+ /*
+ * Save envp in environment
+ */
+ for (i = 0; envp[i]; ++i)
+ {
+ putenv ((char *)envp[i]);
+ }
+
+ /*
+ * Event loop
+ */
+ while (1)
+ {
+ int command_code;
+ int status;
+
+ /* get a command from foreground process */
+ command_code = recv_control (fd);
+
+ if (DEBUG (verb))
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: received command code: %d\n", command_code);
+
+ switch (command_code)
+ {
+ case COMMAND_RUN_SCRIPT:
+ status = system (command_line);
+ if (system_ok (status)) /* Succeeded */
+ {
+ if (send_control (fd, RESPONSE_SCRIPT_SUCCEEDED) == -1)
+ {
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: write error on response socket [2]\n");
+ goto done;
+ }
+ }
+ else /* Failed */
+ {
+ if (send_control (fd, RESPONSE_SCRIPT_FAILED) == -1)
+ {
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: write error on response socket [3]\n");
+ goto done;
+ }
+ }
+ break;
+
+ case COMMAND_EXIT:
+ goto done;
+
+ case -1:
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: read error on command channel\n");
+ goto done;
+
+ default:
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: unknown command code: code=%d, exiting\n",
+ command_code);
+ goto done;
+ }
+ }
+
+ done:
+ if (argv_cat)
+ free (argv_cat);
+ if (command_line)
+ free (command_line);
+ if (DEBUG (verb))
+ fprintf (stderr, "DOWN-ROOT: BACKGROUND: EXIT\n");
+
+ return;
+}
diff --git a/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.exports b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.exports
new file mode 100644
index 00000000..b07937cc
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/src/plugins/down-root/down-root.exports
@@ -0,0 +1,4 @@
+openvpn_plugin_open_v1
+openvpn_plugin_func_v1
+openvpn_plugin_close_v1
+openvpn_plugin_abort_v1
diff --git a/ics-openvpn-stripped/main/openvpn/tests/Makefile.am b/ics-openvpn-stripped/main/openvpn/tests/Makefile.am
new file mode 100644
index 00000000..b7980e04
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/Makefile.am
@@ -0,0 +1,23 @@
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh
+
+TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)"
+TESTS = $(test_scripts)
+
+dist_noinst_SCRIPTS = \
+ $(test_scripts) \
+ t_cltsrv-down.sh
+
diff --git a/ics-openvpn-stripped/main/openvpn/tests/t_client.rc-sample b/ics-openvpn-stripped/main/openvpn/tests/t_client.rc-sample
new file mode 100644
index 00000000..6e666077
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/t_client.rc-sample
@@ -0,0 +1,93 @@
+#
+# this is sourced from t_client.sh and defines which openvpn client tests
+# to run
+#
+# (sample config, copy to t_client.rc and adapt to your environment)
+#
+#
+# define these - if empty, no tests will run
+#
+top_srcdir="${top_srcdir:-..}"
+CA_CERT="${top_srcdir}/sample/sample-keys/ca.crt"
+CLIENT_KEY="${top_srcdir}/sample/sample-keys/client.key"
+CLIENT_CERT="${top_srcdir}/sample/sample-keys/client.crt"
+#
+# remote host (used as macro below)
+#
+REMOTE=mytestserver
+#
+# tests to run (list suffixes for config stanzas below)
+#
+TEST_RUN_LIST="1 2"
+
+#
+# use "sudo" (etc) to give openvpn the necessary privileges
+# if this is not active, "make check" must be run as root
+#
+#RUN_SUDO=sudo
+
+#
+# base confic that is the same for all the p2mp test runs
+#
+OPENVPN_BASE_P2MP="--client --ca $CA_CERT \
+ --cert $CLIENT_CERT --key $CLIENT_KEY \
+ --ns-cert-type server --nobind --comp-lzo --verb 3"
+
+# base config for p2p tests
+#
+OPENVPN_BASE_P2P="..."
+
+#
+#
+# now define the individual tests - all variables suffixed with _1, _2 etc
+# will be used in test run "1", "2", etc.
+#
+# if something is not defined here, the corresponding test is not run
+#
+# possible test options:
+#
+# RUN_TITLE_x="what is being tested on here" (purely informational)
+# OPENVPN_CONF_x = "how to call ./openvpn" [mandatory]
+# EXPECT_IFCONFIG4_x = "this IPv4 address needs to show up in ifconfig"
+# EXPECT_IFCONFIG6_x = "this IPv6 address needs to show up in ifconfig"
+# PING4_HOSTS_x = "these hosts musts ping when openvpn is up (IPv4 fping)"
+# PING6_HOSTS_x = "these hosts musts ping when openvpn is up (IPv6 fping6)"
+#
+# Test 1: UDP / p2mp tun
+# specify IPv4+IPv6 addresses expected from server and ping targets
+#
+RUN_TITLE_1="testing tun/udp/ipv4+ipv6"
+OPENVPN_CONF_1="$OPENVPN_BASE_P2MP --dev tun --proto udp --remote $REMOTE --port 51194"
+EXPECT_IFCONFIG4_1="10.100.50.6"
+EXPECT_IFCONFIG6_1="2001:db8:a050::1:0"
+PING4_HOSTS_1="10.100.50.1 10.100.0.1"
+PING6_HOSTS_1="2001:db8::1 2001:db8:a050::1"
+
+# Test 2: TCP / p2mp tun
+#
+RUN_TITLE_2="testing tun/tcp/ipv4+ipv6"
+OPENVPN_CONF_2="$OPENVPN_BASE_P2MP --dev tun --proto tcp --remote $REMOTE --port 51194"
+EXPECT_IFCONFIG4_2="10.100.51.6"
+EXPECT_IFCONFIG6_2="2001:db8:a051::1:0"
+PING4_HOSTS_2="10.100.51.1 10.100.0.1"
+PING6_HOSTS_2="2001:db8::1 2001:db8:a051::1"
+
+# Test 3: UDP / p2p tun
+# ...
+
+# Test 4: TCP / p2p tun
+# ...
+
+# Test 5: UDP / p2mp tap
+# ...
+
+# Test 6: TCP / p2mp tun
+# ...
+
+# Test 7: UDP / p2p tap
+# ...
+
+# Test 8: TCP / p2p tap
+# ...
+
+# Test 9: whatever you want to test... :-)
diff --git a/ics-openvpn-stripped/main/openvpn/tests/t_client.sh.in b/ics-openvpn-stripped/main/openvpn/tests/t_client.sh.in
new file mode 100755
index 00000000..d4f7c4ab
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/t_client.sh.in
@@ -0,0 +1,347 @@
+#!@SHELL@
+#
+# run OpenVPN client against ``test reference'' server
+# - check that ping, http, ... via tunnel works
+# - check that interface config / routes are properly cleaned after test end
+#
+# prerequisites:
+# - openvpn binary in current directory
+# - writable current directory to create subdir for logs
+# - t_client.rc in current directory OR source dir that specifies tests
+# - for "ping4" checks: fping binary in $PATH
+# - for "ping6" checks: fping6 binary in $PATH
+#
+
+srcdir="${srcdir:-.}"
+top_builddir="${top_builddir:-..}"
+if [ -r "${top_builddir}"/t_client.rc ] ; then
+ . "${top_builddir}"/t_client.rc
+elif [ -r "${srcdir}"/t_client.rc ] ; then
+ . "${srcdir}"/t_client.rc
+else
+ echo "$0: cannot find 't_client.rc' in build dir ('${top_builddir}')" >&2
+ echo "$0: or source directory ('${srcdir}'). SKIPPING TEST." >&2
+ exit 77
+fi
+
+# Check for external dependencies
+which fping > /dev/null
+if [ $? -ne 0 ]; then
+ echo "$0: fping is not available in \$PATH" >&2
+ exit 77
+fi
+which fping6 > /dev/null
+if [ $? -ne 0 ]; then
+ echo "$0: fping6 is not available in \$PATH" >&2
+ exit 77
+fi
+
+if [ ! -x "${top_builddir}/src/openvpn/openvpn" ]
+then
+ echo "no (executable) openvpn binary in current build tree. FAIL." >&2
+ exit 1
+fi
+
+if [ ! -w . ]
+then
+ echo "current directory is not writable (required for logging). FAIL." >&2
+ exit 1
+fi
+
+if [ -z "$CA_CERT" ] ; then
+ echo "CA_CERT not defined in 't_client.rc'. SKIP test." >&2
+ exit 77
+fi
+
+if [ -z "$TEST_RUN_LIST" ] ; then
+ echo "TEST_RUN_LIST empty, no tests defined. SKIP test." >&2
+ exit 77
+fi
+
+# make sure we have permissions to run ifconfig/route from OpenVPN
+# can't use "id -u" here - doesn't work on Solaris
+ID=`id`
+if expr "$ID" : "uid=0" >/dev/null
+then :
+else
+ if [ -z "$RUN_SUDO" ]
+ then
+ echo "$0: this test must run be as root, or RUN_SUDO=... " >&2
+ echo " must be set correctly in 't_client.rc'. SKIP." >&2
+ exit 77
+ fi
+fi
+
+LOGDIR=t_client-`hostname`-`date +%Y%m%d-%H%M%S`
+if mkdir $LOGDIR
+then :
+else
+ echo "can't create log directory '$LOGDIR'. FAIL." >&2
+ exit 1
+fi
+
+exit_code=0
+
+# ----------------------------------------------------------
+# helper functions
+# ----------------------------------------------------------
+# print failure message, increase FAIL counter
+fail()
+{
+ echo ""
+ echo "FAIL: $@" >&2
+ fail_count=$(( $fail_count + 1 ))
+}
+
+# print "all interface IP addresses" + "all routes"
+# this is higly system dependent...
+get_ifconfig_route()
+{
+ # linux / iproute2? (-> if configure got a path)
+ if [ -n "@IPROUTE@" ]
+ then
+ echo "-- linux iproute2 --"
+ @IPROUTE@ addr show | grep -v valid_lft
+ @IPROUTE@ route show
+ @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g'
+ return
+ fi
+
+ # try uname
+ case `uname -s` in
+ Linux)
+ echo "-- linux / ifconfig --"
+ LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)"
+ LANG=C @NETSTAT@ -rn -4 -6
+ return
+ ;;
+ FreeBSD|NetBSD|Darwin)
+ echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --"
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
+ return
+ ;;
+ OpenBSD)
+ echo "-- OpenBSD --"
+ @IFCONFIG@ -a | egrep "(flags=|inet)" | \
+ sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//'
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
+ return
+ ;;
+ SunOS)
+ echo "-- Solaris --"
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }'
+ return
+ ;;
+ AIX)
+ echo "-- AIX --"
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }'
+ return
+ ;;
+ esac
+
+ echo "get_ifconfig_route(): no idea how to get info on your OS. FAIL." >&2
+ exit 20
+}
+
+# ----------------------------------------------------------
+# check ifconfig
+# arg1: "4" or "6" -> for message
+# arg2: IPv4/IPv6 address that must show up in out of "get_ifconfig_route"
+check_ifconfig()
+{
+ proto=$1 ; shift
+ expect_list="$@"
+
+ if [ -z "$expect_list" ] ; then return ; fi
+
+ for expect in $expect_list
+ do
+ if get_ifconfig_route | fgrep "$expect" >/dev/null
+ then :
+ else
+ fail "check_ifconfig(): expected IPv$proto address '$expect' not found in ifconfig output."
+ fi
+ done
+}
+
+# ----------------------------------------------------------
+# run pings
+# arg1: "4" or "6" -> fping/fing6
+# arg2: "want_ok" or "want_fail" (expected ping result)
+# arg3... -> fping arguments (host list)
+run_ping_tests()
+{
+ proto=$1 ; want=$2 ; shift ; shift
+ targetlist="$@"
+
+ # "no targets" is fine
+ if [ -z "$targetlist" ] ; then return ; fi
+
+ case $proto in
+ 4) cmd=fping ;;
+ 6) cmd=fping6 ;;
+ *) echo "internal error in run_ping_tests arg 1: '$proto'" >&2
+ exit 1 ;;
+ esac
+
+ case $want in
+ want_ok) sizes_list="64 1440 3000" ;;
+ want_fail) sizes_list="64" ;;
+ esac
+
+ for bytes in $sizes_list
+ do
+ echo "run IPv$proto ping tests ($want), $bytes byte packets..."
+
+ echo "$cmd -b $bytes -C 20 -p 250 -q $targetlist" >>$LOGDIR/$SUF:fping.out
+ $cmd -b $bytes -C 20 -p 250 -q $targetlist >>$LOGDIR/$SUF:fping.out 2>&1
+
+ # while OpenVPN is running, pings must succeed (want='want_ok')
+ # before OpenVPN is up, pings must NOT succeed (want='want_fail')
+
+ rc=$?
+ if [ $rc = 0 ] # all ping OK
+ then
+ if [ $want = "want_fail" ] # not what we want
+ then
+ fail "IPv$proto ping test succeeded, but needs to *fail*."
+ fi
+ else # ping failed
+ if [ $want = "want_ok" ] # not what we wanted
+ then
+ fail "IPv$proto ping test ($bytes bytes) failed, but should succeed."
+ fi
+ fi
+ done
+}
+
+# ----------------------------------------------------------
+# main test loop
+# ----------------------------------------------------------
+SUMMARY_OK=
+SUMMARY_FAIL=
+
+for SUF in $TEST_RUN_LIST
+do
+ # get config variables
+ eval test_prep=\"\$PREPARE_$SUF\"
+ eval test_cleanup=\"\$CLEANUP_$SUF\"
+ eval test_run_title=\"\$RUN_TITLE_$SUF\"
+ eval openvpn_conf=\"\$OPENVPN_CONF_$SUF\"
+ eval expect_ifconfig4=\"\$EXPECT_IFCONFIG4_$SUF\"
+ eval expect_ifconfig6=\"\$EXPECT_IFCONFIG6_$SUF\"
+ eval ping4_hosts=\"\$PING4_HOSTS_$SUF\"
+ eval ping6_hosts=\"\$PING6_HOSTS_$SUF\"
+
+ echo -e "\n### test run $SUF: '$test_run_title' ###\n"
+ fail_count=0
+
+ if [ -n "$test_prep" ]; then
+ echo -e "running preparation: '$test_prep'"
+ eval $test_prep
+ fi
+
+ echo "save pre-openvpn ifconfig + route"
+ get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_pre.txt
+
+ echo -e "\nrun pre-openvpn ping tests - targets must not be reachable..."
+ run_ping_tests 4 want_fail "$ping4_hosts"
+ run_ping_tests 6 want_fail "$ping6_hosts"
+ if [ "$fail_count" = 0 ] ; then
+ echo -e "OK.\n"
+ else
+ echo -e "FAIL: make sure that ping hosts are ONLY reachable via VPN, SKIP test $SUF".
+ exit_code=31
+ continue
+ fi
+
+ echo " run openvpn $openvpn_conf"
+ echo "# src/openvpn/openvpn $openvpn_conf" >$LOGDIR/$SUF:openvpn.log
+ $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log &
+ opid=$!
+
+ # make sure openvpn client is terminated in case shell exits
+ trap "$RUN_SUDO kill $opid" 0
+ trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15
+
+ echo "wait for connection to establish..."
+ sleep ${SETUP_TIME_WAIT:-10}
+
+ # test whether OpenVPN process is still there
+ if $RUN_SUDO kill -0 $opid
+ then :
+ else
+ echo -e "OpenVPN process has failed to start up, check log ($LOGDIR/$SUF:openvpn.log). FAIL.\ntail of logfile follows:\n..." >&2
+ tail $LOGDIR/$SUF:openvpn.log >&2
+ trap - 0 1 2 3 15
+ exit 10
+ fi
+
+ # compare whether anything changed in ifconfig/route setup?
+ echo "save ifconfig+route"
+ get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
+
+ echo -n "compare pre-openvpn ifconfig+route with current values..."
+ if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+ $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+ then
+ fail "no differences between ifconfig/route before OpenVPN start and now."
+ else
+ echo -e " OK!\n"
+ fi
+
+ # expected ifconfig values in there?
+ check_ifconfig 4 "$expect_ifconfig4"
+ check_ifconfig 6 "$expect_ifconfig6"
+
+ run_ping_tests 4 want_ok "$ping4_hosts"
+ run_ping_tests 6 want_ok "$ping6_hosts"
+ echo -e "ping tests done.\n"
+
+ echo "stopping OpenVPN"
+ $RUN_SUDO kill $opid
+ wait $!
+ rc=$?
+ if [ $rc != 0 ] ; then
+ fail "OpenVPN return code $rc, expect 0"
+ fi
+
+ echo -e "\nsave post-openvpn ifconfig + route..."
+ get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_post.txt
+
+ echo -n "compare pre- and post-openvpn ifconfig + route..."
+ if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+ $LOGDIR/$SUF:ifconfig_route_post.txt >$LOGDIR/$SUF:ifconfig_route_diff.txt
+ then
+ echo -e " OK.\n"
+ else
+ cat $LOGDIR/$SUF:ifconfig_route_diff.txt >&2
+ fail "differences between pre- and post-ifconfig/route"
+ fi
+ if [ "$fail_count" = 0 ] ; then
+ echo -e "test run $SUF: all tests OK.\n"
+ SUMMARY_OK="$SUMMARY_OK $SUF"
+ else
+ echo -e "test run $SUF: $fail_count test failures. FAIL.\n";
+ SUMMARY_FAIL="$SUMMARY_FAIL $SUF"
+ exit_code=30
+ fi
+
+ if [ -n "$test_cleanup" ]; then
+ echo -e "cleaning up: '$test_cleanup'"
+ eval $test_cleanup
+ fi
+
+done
+
+if [ -z "$SUMMARY_OK" ] ; then SUMMARY_OK=" none"; fi
+if [ -z "$SUMMARY_FAIL" ] ; then SUMMARY_FAIL=" none"; fi
+echo "Test sets succeded:$SUMMARY_OK."
+echo "Test sets failed:$SUMMARY_FAIL."
+
+# remove trap handler
+trap - 0 1 2 3 15
+exit $exit_code
diff --git a/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv-down.sh b/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv-down.sh
new file mode 100755
index 00000000..2ef852aa
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv-down.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo "${role}:${signal}" >&3
diff --git a/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv.sh b/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv.sh
new file mode 100755
index 00000000..752251e4
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/t_cltsrv.sh
@@ -0,0 +1,91 @@
+#! /bin/sh
+#
+# t_cltsrv.sh - script to test OpenVPN's crypto loopback
+# Copyright (C) 2005, 2006, 2008 Matthias Andree
+#
+# 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.
+
+set -e
+srcdir="${srcdir:-.}"
+top_srcdir="${top_srcdir:-..}"
+top_builddir="${top_builddir:-..}"
+trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
+trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3
+addopts=
+case `uname -s` in
+ FreeBSD)
+ # FreeBSD jails map the outgoing IP to the jail IP - we need to
+ # allow the real IP unless we want the test to run forever.
+ if test "`sysctl 2>/dev/null -n security.jail.jailed`" = 1 \
+ || ps -ostate= -p $$ | grep -q J; then
+ addopts="--float"
+ if test "x`ifconfig | grep inet`" = x ; then
+ echo "###"
+ echo "### To run the test in a FreeBSD jail, you MUST add an IP alias for the jail's IP."
+ echo "###"
+ exit 77
+ fi
+ fi
+ ;;
+esac
+
+# make sure that the --down script is executable -- fail (rather than
+# skip) test if it isn't.
+downscript="../tests/t_cltsrv-down.sh"
+root="${top_srcdir}/sample"
+test -x "${root}/${downscript}" || chmod +x "${root}/${downscript}" || { echo >&2 "${root}/${downscript} is not executable, failing." ; exit 1 ; }
+echo "The following test will take about two minutes." >&2
+echo "If the addresses are in use, this test will retry up to two times." >&2
+
+# go
+success=0
+for i in 1 2 3 ; do
+ set +e
+ (
+ "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" &
+ "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client"
+ ) 3>log.$$.signal >log.$$ 2>&1
+ e1=$?
+ wait $!
+ e2=$?
+ grep 'TCP/UDP: Socket bind failed on local address.*in use' log.$$ >/dev/null && {
+ echo 'address in use, retrying in 150 s'
+ sleep 150
+ continue
+ }
+ grep -v ':inactive$' log.$$.signal >/dev/null && { cat log.$$.signal ; echo ; cat log.$$ ; exit 1 ; }
+ success=1
+ break
+done
+
+set -e
+
+# exit code - defaults to 0, PASS
+ec=0
+
+if [ $success != 1 ] ; then
+ # couldn't run test -- addresses in use, skip test
+ cat log.$$
+ ec=77
+elif [ $e1 != 0 ] || [ $e2 != 0 ] ; then
+ # failure -- fail test
+ cat log.$$
+ ec=1
+fi
+
+rm log.$$ log.$$.signal
+trap 0
+exit $ec
diff --git a/ics-openvpn-stripped/main/openvpn/tests/t_lpback.sh b/ics-openvpn-stripped/main/openvpn/tests/t_lpback.sh
new file mode 100755
index 00000000..8f88ad92
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/tests/t_lpback.sh
@@ -0,0 +1,57 @@
+#! /bin/sh
+#
+# t_lpback.sh - script to test OpenVPN's crypto loopback
+# Copyright (C) 2005 Matthias Andree
+# Copyright (C) 2014 Steffan Karger
+#
+# 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.
+
+set -eu
+top_builddir="${top_builddir:-..}"
+trap "rm -f key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15
+trap "rm -f key.$$ log.$$ ; exit 1" 0 3
+
+# Get list of supported ciphers from openvpn --show-ciphers output
+CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
+ sed -e '1,/^$/d' -e s'/ .*//' -e '/^\s*$/d' | sort)
+
+# SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is
+# broken (see http://rt.openssl.org/Ticket/Display.html?id=2867), so exclude
+# that cipher from this test.
+# GD, 2014-07-06 so is DES-CFB1
+# GD, 2014-07-06 do not test RC5-* either (fails on NetBSD w/o libcrypto_rc5)
+CIPHERS=$(echo "$CIPHERS" | egrep -v '^(DES-EDE3-CFB1|DES-CFB1|RC5-)' )
+
+"${top_builddir}/src/openvpn/openvpn" --genkey --secret key.$$
+set +e
+
+e=0
+for cipher in ${CIPHERS}
+do
+ echo -n "Testing cipher ${cipher}... "
+ ( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ --cipher ${cipher} ) >log.$$ 2>&1
+ if [ $? != 0 ] ; then
+ echo "FAILED"
+ cat log.$$
+ e=1
+ else
+ echo "OK"
+ fi
+done
+
+rm key.$$ log.$$
+trap 0
+exit $e
diff --git a/ics-openvpn-stripped/main/openvpn/version.m4 b/ics-openvpn-stripped/main/openvpn/version.m4
new file mode 100644
index 00000000..376661f7
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/version.m4
@@ -0,0 +1,10 @@
+dnl define the OpenVPN version
+define([PRODUCT_NAME], [OpenVPN])
+define([PRODUCT_TARNAME], [openvpn])
+define([PRODUCT_VERSION], [2.3_git])
+define([PRODUCT_BUGREPORT], [openvpn-users@lists.sourceforge.net])
+define([PRODUCT_VERSION_RESOURCE], [2,3,0,0])
+dnl define the TAP version
+define([PRODUCT_TAP_WIN_COMPONENT_ID], [tap0901])
+define([PRODUCT_TAP_WIN_MIN_MAJOR], [9])
+define([PRODUCT_TAP_WIN_MIN_MINOR], [9])
diff --git a/ics-openvpn-stripped/main/openvpn/version.sh.in b/ics-openvpn-stripped/main/openvpn/version.sh.in
new file mode 100644
index 00000000..2af5a364
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/version.sh.in
@@ -0,0 +1,4 @@
+OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@"
+OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@"
+OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@"
+OPENVPN_PACKAGE_HOST="@host@"
diff --git a/ics-openvpn-stripped/main/ovpn3/Android.mk b/ics-openvpn-stripped/main/ovpn3/Android.mk
new file mode 100644
index 00000000..7f037ac0
--- /dev/null
+++ b/ics-openvpn-stripped/main/ovpn3/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)/
+
+include $(CLEAR_VARS)
+
+LOCAL_LDLIBS := -lz
+LOCAL_C_INCLUDES := openssl/include lzo/include openssl/crypto openssl openvpn/src/compat openvpn3/client openvpn3 boost_1_55_0 polarssl/include snappy
+LOCAL_CPP_FEATURES += exceptions rtti
+
+#LOCAL_SHARED_LIBRARIES := libssl libcrypto
+LOCAL_SHARED_LIBRARIES := polarssl-dynamic
+#LOCAL_STATIC_LIBRARIES := libssl_static libcrypto_static liblzo-static
+LOCAL_STATIC_LIBRARIES := liblzo-static snappy-static
+
+#LOCAL_CFLAGS= -DHAVE_CONFIG_H -DTARGET_ABI=\"${TARGET_ABI}\" -DUSE_OPENSSL -DOPENSSL_NO_ENGINE
+LOCAL_CFLAGS= -DHAVE_CONFIG_H -DTARGET_ABI=\"${TARGET_ABI}\" -DUSE_POLARSSL -DHAVE_SNAPPY -DHAVE_LZO
+
+#ifneq ($(TARGET_ARCH),mips)
+#LOCAL_STATIC_LIBRARIES += breakpad_client
+#LOCAL_CFLAGS += -DGOOGLE_BREAKPAD=1
+#endif
+
+LOCAL_MODULE = ovpn3
+
+LOCAL_SRC_FILES:= \
+ ../openvpn3/javacli/ovpncli_wrap.cxx \
+ boostsrc/error_code.cpp \
+ ../openvpn3/client/ovpncli.cpp \
+
+
+#ifneq ($(TARGET_ARCH),mips)
+#LOCAL_SRC_FILES+=src/openvpn/breakpad.cpp
+#endif
+
+
+
+include $(BUILD_SHARED_LIBRARY)
+#include $(BUILD_EXECUTABLE)
+
+
+
diff --git a/ics-openvpn-stripped/main/ovpn3/boostsrc/error_code.cpp b/ics-openvpn-stripped/main/ovpn3/boostsrc/error_code.cpp
new file mode 100644
index 00000000..6772d154
--- /dev/null
+++ b/ics-openvpn-stripped/main/ovpn3/boostsrc/error_code.cpp
@@ -0,0 +1,430 @@
+// error_code support implementation file ----------------------------------//
+
+// Copyright Beman Dawes 2002, 2006
+
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See library home page at http://www.boost.org/libs/system
+
+//----------------------------------------------------------------------------//
+
+#include <boost/config/warning_disable.hpp>
+
+// define BOOST_SYSTEM_SOURCE so that <boost/system/config.hpp> knows
+// the library is being built (possibly exporting rather than importing code)
+#define BOOST_SYSTEM_SOURCE
+
+#include <boost/system/config.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/cerrno.hpp>
+#include <vector>
+#include <cstdlib>
+#include <cassert>
+
+using namespace boost::system;
+using namespace boost::system::errc;
+
+#include <cstring> // for strerror/strerror_r
+
+# if defined( BOOST_WINDOWS_API )
+# include <windows.h>
+# include "local_free_on_destruction.hpp"
+# ifndef ERROR_INCORRECT_SIZE
+# define ERROR_INCORRECT_SIZE ERROR_BAD_ARGUMENTS
+# endif
+# endif
+
+//----------------------------------------------------------------------------//
+
+namespace
+{
+#if defined(__PGI)
+ using boost::system::errc::invalid_argument;
+#endif
+ // standard error categories ---------------------------------------------//
+
+ class generic_error_category : public error_category
+ {
+ public:
+ generic_error_category(){}
+ const char * name() const;
+ std::string message( int ev ) const;
+ };
+
+ class system_error_category : public error_category
+ {
+ public:
+ system_error_category(){}
+ const char * name() const;
+ std::string message( int ev ) const;
+ error_condition default_error_condition( int ev ) const;
+ };
+
+ // generic_error_category implementation ---------------------------------//
+
+ const char * generic_error_category::name() const
+ {
+ return "generic";
+ }
+
+ std::string generic_error_category::message( int ev ) const
+ {
+ static std::string unknown_err( "Unknown error" );
+ // strerror_r is preferred because it is always thread safe,
+ // however, we fallback to strerror in certain cases because:
+ // -- Windows doesn't provide strerror_r.
+ // -- HP and Sun do provide strerror_r on newer systems, but there is
+ // no way to tell if is available at runtime and in any case their
+ // versions of strerror are thread safe anyhow.
+ // -- Linux only sometimes provides strerror_r.
+ // -- Tru64 provides strerror_r only when compiled -pthread.
+ // -- VMS doesn't provide strerror_r, but on this platform, strerror is
+ // thread safe.
+ # if defined(BOOST_WINDOWS_API) || defined(__hpux) || defined(__sun)\
+ || (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR)))\
+ || (defined(__osf__) && !defined(_REENTRANT))\
+ || (defined(__INTEGRITY))\
+ || (defined(__vms))\
+ || (defined(__QNXNTO__))
+ const char * c_str = std::strerror( ev );
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
+ # else // use strerror_r
+ char buf[64];
+ char * bp = buf;
+ std::size_t sz = sizeof(buf);
+ # if defined(__CYGWIN__) || defined(__USE_GNU)
+ // Oddball version of strerror_r
+ const char * c_str = strerror_r( ev, bp, sz );
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
+ # else
+ // POSIX version of strerror_r
+ int result;
+ for (;;)
+ {
+ // strerror_r returns 0 on success, otherwise ERANGE if buffer too small,
+ // invalid_argument if ev not a valid error number
+ # if defined (__sgi)
+ const char * c_str = strerror( ev );
+ result = 0;
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
+ # else
+ result = strerror_r( ev, bp, sz );
+ # endif
+ if (result == 0 )
+ break;
+ else
+ {
+ # if defined(__linux)
+ // Linux strerror_r returns -1 on error, with error number in errno
+ result = errno;
+ # endif
+ if ( result != ERANGE ) break;
+ if ( sz > sizeof(buf) ) std::free( bp );
+ sz *= 2;
+ if ( (bp = static_cast<char*>(std::malloc( sz ))) == 0 )
+ return std::string( "ENOMEM" );
+ }
+ }
+ std::string msg;
+ try
+ {
+ msg = ( ( result == invalid_argument ) ? "Unknown error" : bp );
+ }
+
+# ifndef BOOST_NO_EXCEPTIONS
+ // See ticket #2098
+ catch(...)
+ {
+ // just eat the exception
+ }
+# endif
+
+ if ( sz > sizeof(buf) ) std::free( bp );
+ sz = 0;
+ return msg;
+ # endif // else POSIX version of strerror_r
+ # endif // else use strerror_r
+ }
+ // system_error_category implementation --------------------------------//
+
+ const char * system_error_category::name() const
+ {
+ return "system";
+ }
+
+ error_condition system_error_category::default_error_condition( int ev ) const
+ {
+ switch ( ev )
+ {
+ case 0: return make_error_condition( success );
+# if defined(BOOST_POSIX_API)
+ // POSIX-like O/S -> posix_errno decode table ---------------------------//
+ case E2BIG: return make_error_condition( argument_list_too_long );
+ case EACCES: return make_error_condition( permission_denied );
+ case EADDRINUSE: return make_error_condition( address_in_use );
+ case EADDRNOTAVAIL: return make_error_condition( address_not_available );
+ case EAFNOSUPPORT: return make_error_condition( address_family_not_supported );
+ case EAGAIN: return make_error_condition( resource_unavailable_try_again );
+# if EALREADY != EBUSY // EALREADY and EBUSY are the same on QNX Neutrino
+ case EALREADY: return make_error_condition( connection_already_in_progress );
+# endif
+ case EBADF: return make_error_condition( bad_file_descriptor );
+ case EBADMSG: return make_error_condition( bad_message );
+ case EBUSY: return make_error_condition( device_or_resource_busy );
+ case ECANCELED: return make_error_condition( operation_canceled );
+ case ECHILD: return make_error_condition( no_child_process );
+ case ECONNABORTED: return make_error_condition( connection_aborted );
+ case ECONNREFUSED: return make_error_condition( connection_refused );
+ case ECONNRESET: return make_error_condition( connection_reset );
+ case EDEADLK: return make_error_condition( resource_deadlock_would_occur );
+ case EDESTADDRREQ: return make_error_condition( destination_address_required );
+ case EDOM: return make_error_condition( argument_out_of_domain );
+ case EEXIST: return make_error_condition( file_exists );
+ case EFAULT: return make_error_condition( bad_address );
+ case EFBIG: return make_error_condition( file_too_large );
+ case EHOSTUNREACH: return make_error_condition( host_unreachable );
+ case EIDRM: return make_error_condition( identifier_removed );
+ case EILSEQ: return make_error_condition( illegal_byte_sequence );
+ case EINPROGRESS: return make_error_condition( operation_in_progress );
+ case EINTR: return make_error_condition( interrupted );
+ case EINVAL: return make_error_condition( invalid_argument );
+ case EIO: return make_error_condition( io_error );
+ case EISCONN: return make_error_condition( already_connected );
+ case EISDIR: return make_error_condition( is_a_directory );
+ case ELOOP: return make_error_condition( too_many_symbolic_link_levels );
+ case EMFILE: return make_error_condition( too_many_files_open );
+ case EMLINK: return make_error_condition( too_many_links );
+ case EMSGSIZE: return make_error_condition( message_size );
+ case ENAMETOOLONG: return make_error_condition( filename_too_long );
+ case ENETDOWN: return make_error_condition( network_down );
+ case ENETRESET: return make_error_condition( network_reset );
+ case ENETUNREACH: return make_error_condition( network_unreachable );
+ case ENFILE: return make_error_condition( too_many_files_open_in_system );
+ case ENOBUFS: return make_error_condition( no_buffer_space );
+ case ENODATA: return make_error_condition( no_message_available );
+ case ENODEV: return make_error_condition( no_such_device );
+ case ENOENT: return make_error_condition( no_such_file_or_directory );
+ case ENOEXEC: return make_error_condition( executable_format_error );
+ case ENOLCK: return make_error_condition( no_lock_available );
+ case ENOLINK: return make_error_condition( no_link );
+ case ENOMEM: return make_error_condition( not_enough_memory );
+ case ENOMSG: return make_error_condition( no_message );
+ case ENOPROTOOPT: return make_error_condition( no_protocol_option );
+ case ENOSPC: return make_error_condition( no_space_on_device );
+ case ENOSR: return make_error_condition( no_stream_resources );
+ case ENOSTR: return make_error_condition( not_a_stream );
+ case ENOSYS: return make_error_condition( function_not_supported );
+ case ENOTCONN: return make_error_condition( not_connected );
+ case ENOTDIR: return make_error_condition( not_a_directory );
+ # if ENOTEMPTY != EEXIST // AIX treats ENOTEMPTY and EEXIST as the same value
+ case ENOTEMPTY: return make_error_condition( directory_not_empty );
+ # endif // ENOTEMPTY != EEXIST
+ # if ENOTRECOVERABLE != ECONNRESET // the same on some Broadcom chips
+ case ENOTRECOVERABLE: return make_error_condition( state_not_recoverable );
+ # endif // ENOTRECOVERABLE != ECONNRESET
+ case ENOTSOCK: return make_error_condition( not_a_socket );
+ case ENOTSUP: return make_error_condition( not_supported );
+ case ENOTTY: return make_error_condition( inappropriate_io_control_operation );
+ case ENXIO: return make_error_condition( no_such_device_or_address );
+ # if EOPNOTSUPP != ENOTSUP
+ case EOPNOTSUPP: return make_error_condition( operation_not_supported );
+ # endif // EOPNOTSUPP != ENOTSUP
+ case EOVERFLOW: return make_error_condition( value_too_large );
+ # if EOWNERDEAD != ECONNABORTED // the same on some Broadcom chips
+ case EOWNERDEAD: return make_error_condition( owner_dead );
+ # endif // EOWNERDEAD != ECONNABORTED
+ case EPERM: return make_error_condition( operation_not_permitted );
+ case EPIPE: return make_error_condition( broken_pipe );
+ case EPROTO: return make_error_condition( protocol_error );
+ case EPROTONOSUPPORT: return make_error_condition( protocol_not_supported );
+ case EPROTOTYPE: return make_error_condition( wrong_protocol_type );
+ case ERANGE: return make_error_condition( result_out_of_range );
+ case EROFS: return make_error_condition( read_only_file_system );
+ case ESPIPE: return make_error_condition( invalid_seek );
+ case ESRCH: return make_error_condition( no_such_process );
+ case ETIME: return make_error_condition( stream_timeout );
+ case ETIMEDOUT: return make_error_condition( timed_out );
+ case ETXTBSY: return make_error_condition( text_file_busy );
+ # if EAGAIN != EWOULDBLOCK
+ case EWOULDBLOCK: return make_error_condition( operation_would_block );
+ # endif // EAGAIN != EWOULDBLOCK
+ case EXDEV: return make_error_condition( cross_device_link );
+ #else
+ // Windows system -> posix_errno decode table ---------------------------//
+ // see WinError.h comments for descriptions of errors
+ case ERROR_ACCESS_DENIED: return make_error_condition( permission_denied );
+ case ERROR_ALREADY_EXISTS: return make_error_condition( file_exists );
+ case ERROR_BAD_UNIT: return make_error_condition( no_such_device );
+ case ERROR_BUFFER_OVERFLOW: return make_error_condition( filename_too_long );
+ case ERROR_BUSY: return make_error_condition( device_or_resource_busy );
+ case ERROR_BUSY_DRIVE: return make_error_condition( device_or_resource_busy );
+ case ERROR_CANNOT_MAKE: return make_error_condition( permission_denied );
+ case ERROR_CANTOPEN: return make_error_condition( io_error );
+ case ERROR_CANTREAD: return make_error_condition( io_error );
+ case ERROR_CANTWRITE: return make_error_condition( io_error );
+ case ERROR_CURRENT_DIRECTORY: return make_error_condition( permission_denied );
+ case ERROR_DEV_NOT_EXIST: return make_error_condition( no_such_device );
+ case ERROR_DEVICE_IN_USE: return make_error_condition( device_or_resource_busy );
+ case ERROR_DIR_NOT_EMPTY: return make_error_condition( directory_not_empty );
+ case ERROR_DIRECTORY: return make_error_condition( invalid_argument ); // WinError.h: "The directory name is invalid"
+ case ERROR_DISK_FULL: return make_error_condition( no_space_on_device );
+ case ERROR_FILE_EXISTS: return make_error_condition( file_exists );
+ case ERROR_FILE_NOT_FOUND: return make_error_condition( no_such_file_or_directory );
+ case ERROR_HANDLE_DISK_FULL: return make_error_condition( no_space_on_device );
+ case ERROR_INVALID_ACCESS: return make_error_condition( permission_denied );
+ case ERROR_INVALID_DRIVE: return make_error_condition( no_such_device );
+ case ERROR_INVALID_FUNCTION: return make_error_condition( function_not_supported );
+ case ERROR_INVALID_HANDLE: return make_error_condition( invalid_argument );
+ case ERROR_INVALID_NAME: return make_error_condition( invalid_argument );
+ case ERROR_LOCK_VIOLATION: return make_error_condition( no_lock_available );
+ case ERROR_LOCKED: return make_error_condition( no_lock_available );
+ case ERROR_NEGATIVE_SEEK: return make_error_condition( invalid_argument );
+ case ERROR_NOACCESS: return make_error_condition( permission_denied );
+ case ERROR_NOT_ENOUGH_MEMORY: return make_error_condition( not_enough_memory );
+ case ERROR_NOT_READY: return make_error_condition( resource_unavailable_try_again );
+ case ERROR_NOT_SAME_DEVICE: return make_error_condition( cross_device_link );
+ case ERROR_OPEN_FAILED: return make_error_condition( io_error );
+ case ERROR_OPEN_FILES: return make_error_condition( device_or_resource_busy );
+ case ERROR_OPERATION_ABORTED: return make_error_condition( operation_canceled );
+ case ERROR_OUTOFMEMORY: return make_error_condition( not_enough_memory );
+ case ERROR_PATH_NOT_FOUND: return make_error_condition( no_such_file_or_directory );
+ case ERROR_READ_FAULT: return make_error_condition( io_error );
+ case ERROR_RETRY: return make_error_condition( resource_unavailable_try_again );
+ case ERROR_SEEK: return make_error_condition( io_error );
+ case ERROR_SHARING_VIOLATION: return make_error_condition( permission_denied );
+ case ERROR_TOO_MANY_OPEN_FILES: return make_error_condition( too_many_files_open );
+ case ERROR_WRITE_FAULT: return make_error_condition( io_error );
+ case ERROR_WRITE_PROTECT: return make_error_condition( permission_denied );
+ case WSAEACCES: return make_error_condition( permission_denied );
+ case WSAEADDRINUSE: return make_error_condition( address_in_use );
+ case WSAEADDRNOTAVAIL: return make_error_condition( address_not_available );
+ case WSAEAFNOSUPPORT: return make_error_condition( address_family_not_supported );
+ case WSAEALREADY: return make_error_condition( connection_already_in_progress );
+ case WSAEBADF: return make_error_condition( bad_file_descriptor );
+ case WSAECONNABORTED: return make_error_condition( connection_aborted );
+ case WSAECONNREFUSED: return make_error_condition( connection_refused );
+ case WSAECONNRESET: return make_error_condition( connection_reset );
+ case WSAEDESTADDRREQ: return make_error_condition( destination_address_required );
+ case WSAEFAULT: return make_error_condition( bad_address );
+ case WSAEHOSTUNREACH: return make_error_condition( host_unreachable );
+ case WSAEINPROGRESS: return make_error_condition( operation_in_progress );
+ case WSAEINTR: return make_error_condition( interrupted );
+ case WSAEINVAL: return make_error_condition( invalid_argument );
+ case WSAEISCONN: return make_error_condition( already_connected );
+ case WSAEMFILE: return make_error_condition( too_many_files_open );
+ case WSAEMSGSIZE: return make_error_condition( message_size );
+ case WSAENAMETOOLONG: return make_error_condition( filename_too_long );
+ case WSAENETDOWN: return make_error_condition( network_down );
+ case WSAENETRESET: return make_error_condition( network_reset );
+ case WSAENETUNREACH: return make_error_condition( network_unreachable );
+ case WSAENOBUFS: return make_error_condition( no_buffer_space );
+ case WSAENOPROTOOPT: return make_error_condition( no_protocol_option );
+ case WSAENOTCONN: return make_error_condition( not_connected );
+ case WSAENOTSOCK: return make_error_condition( not_a_socket );
+ case WSAEOPNOTSUPP: return make_error_condition( operation_not_supported );
+ case WSAEPROTONOSUPPORT: return make_error_condition( protocol_not_supported );
+ case WSAEPROTOTYPE: return make_error_condition( wrong_protocol_type );
+ case WSAETIMEDOUT: return make_error_condition( timed_out );
+ case WSAEWOULDBLOCK: return make_error_condition( operation_would_block );
+ #endif
+ default: return error_condition( ev, system_category() );
+ }
+ }
+
+# if !defined( BOOST_WINDOWS_API )
+
+ std::string system_error_category::message( int ev ) const
+ {
+ return generic_category().message( ev );
+ }
+# else
+
+ std::string system_error_category::message( int ev ) const
+ {
+# ifndef BOOST_NO_ANSI_APIS
+ LPVOID lpMsgBuf = 0;
+ DWORD retval = ::FormatMessageA(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ ev,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+ detail::local_free_on_destruction lfod(lpMsgBuf);
+ if (retval == 0)
+ return std::string("Unknown error");
+
+ std::string str( static_cast<LPCSTR>(lpMsgBuf) );
+# else // WinCE workaround
+ LPVOID lpMsgBuf = 0;
+ DWORD retval = ::FormatMessageW(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ ev,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPWSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+ detail::local_free_on_destruction lfod(lpMsgBuf);
+ if (retval == 0)
+ return std::string("Unknown error");
+
+ int num_chars = (wcslen( static_cast<LPCWSTR>(lpMsgBuf) ) + 1) * 2;
+ LPSTR narrow_buffer = (LPSTR)_alloca( num_chars );
+ if (::WideCharToMultiByte(CP_ACP, 0, static_cast<LPCWSTR>(lpMsgBuf), -1, narrow_buffer, num_chars, NULL, NULL) == 0)
+ return std::string("Unknown error");
+
+ std::string str( narrow_buffer );
+# endif
+ while ( str.size()
+ && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') )
+ str.erase( str.size()-1 );
+ if ( str.size() && str[str.size()-1] == '.' )
+ { str.erase( str.size()-1 ); }
+ return str;
+ }
+# endif
+
+} // unnamed namespace
+
+namespace boost
+{
+ namespace system
+ {
+
+# ifndef BOOST_SYSTEM_NO_DEPRECATED
+ BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;
+ // note that it doesn't matter if this
+ // isn't initialized before use since
+ // the only use is to take its
+ // address for comparison purposes
+# endif
+
+ BOOST_SYSTEM_DECL const error_category & system_category()
+ {
+ static const system_error_category system_category_const;
+ return system_category_const;
+ }
+
+ BOOST_SYSTEM_DECL const error_category & generic_category()
+ {
+ static const generic_error_category generic_category_const;
+ return generic_category_const;
+ }
+
+ } // namespace system
+} // namespace boost
diff --git a/ics-openvpn-stripped/main/snappy/Android.mk b/ics-openvpn-stripped/main/snappy/Android.mk
new file mode 100644
index 00000000..cdd26003
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/Android.mk
@@ -0,0 +1,35 @@
+
+LOCAL_PATH:= $(call my-dir)
+
+
+common_SRC_FILES:= \
+ snappy-c.cc \
+ snappy-sinksource.cc \
+ snappy-stubs-internal.cc \
+ snappy.cc
+
+common_C_INCLUDES += $(LOCAL_PATH)/ $(LOCAL_PATH)/conf
+
+# static library
+# =====================================================
+
+include $(CLEAR_VARS)
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_SRC_FILES:= $(common_SRC_FILES)
+LOCAL_C_INCLUDES:= $(common_C_INCLUDES)
+LOCAL_MODULE := snappy-static
+LOCAL_PRELINK_MODULE:= false
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_STATIC_LIBRARY)
+
+# dynamic library
+# =====================================================
+
+# include $(CLEAR_VARS)
+# LOCAL_SRC_FILES:= $(common_SRC_FILES)
+# LOCAL_C_INCLUDES:= $(common_C_INCLUDES)
+# LOCAL_MODULE := liblzo
+# LOCAL_PRELINK_MODULE:= false
+# LOCAL_MODULE_TAGS := optional
+# include $(BUILD_SHARED_LIBRARY)
+
diff --git a/ics-openvpn-stripped/main/snappy/COPYING b/ics-openvpn-stripped/main/snappy/COPYING
new file mode 100644
index 00000000..8d6bd9fe
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/COPYING
@@ -0,0 +1,28 @@
+Copyright 2011, Google 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:
+
+ * 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 Google Inc. 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.
diff --git a/ics-openvpn-stripped/main/snappy/conf/config.h b/ics-openvpn-stripped/main/snappy/conf/config.h
new file mode 100644
index 00000000..e0bf3214
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/conf/config.h
@@ -0,0 +1,129 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define to 1 if the compiler supports __builtin_ctz and friends. */
+#define HAVE_BUILTIN_CTZ 1
+
+/* Define to 1 if the compiler supports __builtin_expect. */
+#define HAVE_BUILTIN_EXPECT 1
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+/* #undef HAVE_BYTESWAP_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Use the gflags package for command-line parsing. */
+/* #undef HAVE_GFLAGS */
+
+/* Defined when Google Test is available. */
+/* #undef HAVE_GTEST */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `fastlz' library (-lfastlz). */
+/* #undef HAVE_LIBFASTLZ */
+
+/* Define to 1 if you have the `lzf' library (-llzf). */
+/* #undef HAVE_LIBLZF */
+
+/* Define to 1 if you have the `lzo2' library (-llzo2). */
+/* #undef HAVE_LIBLZO2 */
+
+/* Define to 1 if you have the `quicklz' library (-lquicklz). */
+/* #undef HAVE_LIBQUICKLZ */
+
+/* Define to 1 if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_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 <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/byteswap.h> header file. */
+/* #undef HAVE_SYS_BYTESWAP_H */
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+/* #undef HAVE_SYS_ENDIAN_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "snappy"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "snappy"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "snappy 1.1.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "snappy"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.1.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.1.0"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
diff --git a/ics-openvpn-stripped/main/snappy/snappy-c.cc b/ics-openvpn-stripped/main/snappy/snappy-c.cc
new file mode 100644
index 00000000..473a0b09
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-c.cc
@@ -0,0 +1,90 @@
+// Copyright 2011 Martin Gieseking <martin.gieseking@uos.de>.
+//
+// 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 Google Inc. 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.
+
+#include "snappy.h"
+#include "snappy-c.h"
+
+extern "C" {
+
+snappy_status snappy_compress(const char* input,
+ size_t input_length,
+ char* compressed,
+ size_t *compressed_length) {
+ if (*compressed_length < snappy_max_compressed_length(input_length)) {
+ return SNAPPY_BUFFER_TOO_SMALL;
+ }
+ snappy::RawCompress(input, input_length, compressed, compressed_length);
+ return SNAPPY_OK;
+}
+
+snappy_status snappy_uncompress(const char* compressed,
+ size_t compressed_length,
+ char* uncompressed,
+ size_t* uncompressed_length) {
+ size_t real_uncompressed_length;
+ if (!snappy::GetUncompressedLength(compressed,
+ compressed_length,
+ &real_uncompressed_length)) {
+ return SNAPPY_INVALID_INPUT;
+ }
+ if (*uncompressed_length < real_uncompressed_length) {
+ return SNAPPY_BUFFER_TOO_SMALL;
+ }
+ if (!snappy::RawUncompress(compressed, compressed_length, uncompressed)) {
+ return SNAPPY_INVALID_INPUT;
+ }
+ *uncompressed_length = real_uncompressed_length;
+ return SNAPPY_OK;
+}
+
+size_t snappy_max_compressed_length(size_t source_length) {
+ return snappy::MaxCompressedLength(source_length);
+}
+
+snappy_status snappy_uncompressed_length(const char *compressed,
+ size_t compressed_length,
+ size_t *result) {
+ if (snappy::GetUncompressedLength(compressed,
+ compressed_length,
+ result)) {
+ return SNAPPY_OK;
+ } else {
+ return SNAPPY_INVALID_INPUT;
+ }
+}
+
+snappy_status snappy_validate_compressed_buffer(const char *compressed,
+ size_t compressed_length) {
+ if (snappy::IsValidCompressedBuffer(compressed, compressed_length)) {
+ return SNAPPY_OK;
+ } else {
+ return SNAPPY_INVALID_INPUT;
+ }
+}
+
+} // extern "C"
diff --git a/ics-openvpn-stripped/main/snappy/snappy-c.h b/ics-openvpn-stripped/main/snappy/snappy-c.h
new file mode 100644
index 00000000..c6c2a860
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-c.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2011 Martin Gieseking <martin.gieseking@uos.de>.
+ *
+ * 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 Google Inc. 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.
+ *
+ * Plain C interface (a wrapper around the C++ implementation).
+ */
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+
+/*
+ * Return values; see the documentation for each function to know
+ * what each can return.
+ */
+typedef enum {
+ SNAPPY_OK = 0,
+ SNAPPY_INVALID_INPUT = 1,
+ SNAPPY_BUFFER_TOO_SMALL = 2
+} snappy_status;
+
+/*
+ * Takes the data stored in "input[0..input_length-1]" and stores
+ * it in the array pointed to by "compressed".
+ *
+ * <compressed_length> signals the space available in "compressed".
+ * If it is not at least equal to "snappy_max_compressed_length(input_length)",
+ * SNAPPY_BUFFER_TOO_SMALL is returned. After successful compression,
+ * <compressed_length> contains the true length of the compressed output,
+ * and SNAPPY_OK is returned.
+ *
+ * Example:
+ * size_t output_length = snappy_max_compressed_length(input_length);
+ * char* output = (char*)malloc(output_length);
+ * if (snappy_compress(input, input_length, output, &output_length)
+ * == SNAPPY_OK) {
+ * ... Process(output, output_length) ...
+ * }
+ * free(output);
+ */
+snappy_status snappy_compress(const char* input,
+ size_t input_length,
+ char* compressed,
+ size_t* compressed_length);
+
+/*
+ * Given data in "compressed[0..compressed_length-1]" generated by
+ * calling the snappy_compress routine, this routine stores
+ * the uncompressed data to
+ * uncompressed[0..uncompressed_length-1].
+ * Returns failure (a value not equal to SNAPPY_OK) if the message
+ * is corrupted and could not be decrypted.
+ *
+ * <uncompressed_length> signals the space available in "uncompressed".
+ * If it is not at least equal to the value returned by
+ * snappy_uncompressed_length for this stream, SNAPPY_BUFFER_TOO_SMALL
+ * is returned. After successful decompression, <uncompressed_length>
+ * contains the true length of the decompressed output.
+ *
+ * Example:
+ * size_t output_length;
+ * if (snappy_uncompressed_length(input, input_length, &output_length)
+ * != SNAPPY_OK) {
+ * ... fail ...
+ * }
+ * char* output = (char*)malloc(output_length);
+ * if (snappy_uncompress(input, input_length, output, &output_length)
+ * == SNAPPY_OK) {
+ * ... Process(output, output_length) ...
+ * }
+ * free(output);
+ */
+snappy_status snappy_uncompress(const char* compressed,
+ size_t compressed_length,
+ char* uncompressed,
+ size_t* uncompressed_length);
+
+/*
+ * Returns the maximal size of the compressed representation of
+ * input data that is "source_length" bytes in length.
+ */
+size_t snappy_max_compressed_length(size_t source_length);
+
+/*
+ * REQUIRES: "compressed[]" was produced by snappy_compress()
+ * Returns SNAPPY_OK and stores the length of the uncompressed data in
+ * *result normally. Returns SNAPPY_INVALID_INPUT on parsing error.
+ * This operation takes O(1) time.
+ */
+snappy_status snappy_uncompressed_length(const char* compressed,
+ size_t compressed_length,
+ size_t* result);
+
+/*
+ * Check if the contents of "compressed[]" can be uncompressed successfully.
+ * Does not return the uncompressed data; if so, returns SNAPPY_OK,
+ * or if not, returns SNAPPY_INVALID_INPUT.
+ * Takes time proportional to compressed_length, but is usually at least a
+ * factor of four faster than actual decompression.
+ */
+snappy_status snappy_validate_compressed_buffer(const char* compressed,
+ size_t compressed_length);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* UTIL_SNAPPY_OPENSOURCE_SNAPPY_C_H_ */
diff --git a/ics-openvpn-stripped/main/snappy/snappy-internal.h b/ics-openvpn-stripped/main/snappy/snappy-internal.h
new file mode 100644
index 00000000..c99d3313
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-internal.h
@@ -0,0 +1,150 @@
+// Copyright 2008 Google 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:
+//
+// * 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 Google Inc. 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.
+//
+// Internals shared between the Snappy implementation and its unittest.
+
+#ifndef UTIL_SNAPPY_SNAPPY_INTERNAL_H_
+#define UTIL_SNAPPY_SNAPPY_INTERNAL_H_
+
+#include "snappy-stubs-internal.h"
+
+namespace snappy {
+namespace internal {
+
+class WorkingMemory {
+ public:
+ WorkingMemory() : large_table_(NULL) { }
+ ~WorkingMemory() { delete[] large_table_; }
+
+ // Allocates and clears a hash table using memory in "*this",
+ // stores the number of buckets in "*table_size" and returns a pointer to
+ // the base of the hash table.
+ uint16* GetHashTable(size_t input_size, int* table_size);
+
+ private:
+ uint16 small_table_[1<<10]; // 2KB
+ uint16* large_table_; // Allocated only when needed
+
+ DISALLOW_COPY_AND_ASSIGN(WorkingMemory);
+};
+
+// Flat array compression that does not emit the "uncompressed length"
+// prefix. Compresses "input" string to the "*op" buffer.
+//
+// REQUIRES: "input_length <= kBlockSize"
+// REQUIRES: "op" points to an array of memory that is at least
+// "MaxCompressedLength(input_length)" in size.
+// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
+// REQUIRES: "table_size" is a power of two
+//
+// Returns an "end" pointer into "op" buffer.
+// "end - op" is the compressed size of "input".
+char* CompressFragment(const char* input,
+ size_t input_length,
+ char* op,
+ uint16* table,
+ const int table_size);
+
+// Return the largest n such that
+//
+// s1[0,n-1] == s2[0,n-1]
+// and n <= (s2_limit - s2).
+//
+// Does not read *s2_limit or beyond.
+// Does not read *(s1 + (s2_limit - s2)) or beyond.
+// Requires that s2_limit >= s2.
+//
+// Separate implementation for x86_64, for speed. Uses the fact that
+// x86_64 is little endian.
+#if defined(ARCH_K8)
+static inline int FindMatchLength(const char* s1,
+ const char* s2,
+ const char* s2_limit) {
+ assert(s2_limit >= s2);
+ int matched = 0;
+
+ // Find out how long the match is. We loop over the data 64 bits at a
+ // time until we find a 64-bit block that doesn't match; then we find
+ // the first non-matching bit and use that to calculate the total
+ // length of the match.
+ while (PREDICT_TRUE(s2 <= s2_limit - 8)) {
+ if (PREDICT_FALSE(UNALIGNED_LOAD64(s2) == UNALIGNED_LOAD64(s1 + matched))) {
+ s2 += 8;
+ matched += 8;
+ } else {
+ // On current (mid-2008) Opteron models there is a 3% more
+ // efficient code sequence to find the first non-matching byte.
+ // However, what follows is ~10% better on Intel Core 2 and newer,
+ // and we expect AMD's bsf instruction to improve.
+ uint64 x = UNALIGNED_LOAD64(s2) ^ UNALIGNED_LOAD64(s1 + matched);
+ int matching_bits = Bits::FindLSBSetNonZero64(x);
+ matched += matching_bits >> 3;
+ return matched;
+ }
+ }
+ while (PREDICT_TRUE(s2 < s2_limit)) {
+ if (PREDICT_TRUE(s1[matched] == *s2)) {
+ ++s2;
+ ++matched;
+ } else {
+ return matched;
+ }
+ }
+ return matched;
+}
+#else
+static inline int FindMatchLength(const char* s1,
+ const char* s2,
+ const char* s2_limit) {
+ // Implementation based on the x86-64 version, above.
+ assert(s2_limit >= s2);
+ int matched = 0;
+
+ while (s2 <= s2_limit - 4 &&
+ UNALIGNED_LOAD32(s2) == UNALIGNED_LOAD32(s1 + matched)) {
+ s2 += 4;
+ matched += 4;
+ }
+ if (LittleEndian::IsLittleEndian() && s2 <= s2_limit - 4) {
+ uint32 x = UNALIGNED_LOAD32(s2) ^ UNALIGNED_LOAD32(s1 + matched);
+ int matching_bits = Bits::FindLSBSetNonZero(x);
+ matched += matching_bits >> 3;
+ } else {
+ while ((s2 < s2_limit) && (s1[matched] == *s2)) {
+ ++s2;
+ ++matched;
+ }
+ }
+ return matched;
+}
+#endif
+
+} // end namespace internal
+} // end namespace snappy
+
+#endif // UTIL_SNAPPY_SNAPPY_INTERNAL_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy-sinksource.cc b/ics-openvpn-stripped/main/snappy/snappy-sinksource.cc
new file mode 100644
index 00000000..5844552c
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-sinksource.cc
@@ -0,0 +1,71 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+
+#include <string.h>
+
+#include "snappy-sinksource.h"
+
+namespace snappy {
+
+Source::~Source() { }
+
+Sink::~Sink() { }
+
+char* Sink::GetAppendBuffer(size_t length, char* scratch) {
+ return scratch;
+}
+
+ByteArraySource::~ByteArraySource() { }
+
+size_t ByteArraySource::Available() const { return left_; }
+
+const char* ByteArraySource::Peek(size_t* len) {
+ *len = left_;
+ return ptr_;
+}
+
+void ByteArraySource::Skip(size_t n) {
+ left_ -= n;
+ ptr_ += n;
+}
+
+UncheckedByteArraySink::~UncheckedByteArraySink() { }
+
+void UncheckedByteArraySink::Append(const char* data, size_t n) {
+ // Do no copying if the caller filled in the result of GetAppendBuffer()
+ if (data != dest_) {
+ memcpy(dest_, data, n);
+ }
+ dest_ += n;
+}
+
+char* UncheckedByteArraySink::GetAppendBuffer(size_t len, char* scratch) {
+ return dest_;
+}
+
+}
diff --git a/ics-openvpn-stripped/main/snappy/snappy-sinksource.h b/ics-openvpn-stripped/main/snappy/snappy-sinksource.h
new file mode 100644
index 00000000..faabfa1e
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-sinksource.h
@@ -0,0 +1,137 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+
+#ifndef UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_
+#define UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_
+
+#include <stddef.h>
+
+
+namespace snappy {
+
+// A Sink is an interface that consumes a sequence of bytes.
+class Sink {
+ public:
+ Sink() { }
+ virtual ~Sink();
+
+ // Append "bytes[0,n-1]" to this.
+ virtual void Append(const char* bytes, size_t n) = 0;
+
+ // Returns a writable buffer of the specified length for appending.
+ // May return a pointer to the caller-owned scratch buffer which
+ // must have at least the indicated length. The returned buffer is
+ // only valid until the next operation on this Sink.
+ //
+ // After writing at most "length" bytes, call Append() with the
+ // pointer returned from this function and the number of bytes
+ // written. Many Append() implementations will avoid copying
+ // bytes if this function returned an internal buffer.
+ //
+ // If a non-scratch buffer is returned, the caller may only pass a
+ // prefix of it to Append(). That is, it is not correct to pass an
+ // interior pointer of the returned array to Append().
+ //
+ // The default implementation always returns the scratch buffer.
+ virtual char* GetAppendBuffer(size_t length, char* scratch);
+
+
+ private:
+ // No copying
+ Sink(const Sink&);
+ void operator=(const Sink&);
+};
+
+// A Source is an interface that yields a sequence of bytes
+class Source {
+ public:
+ Source() { }
+ virtual ~Source();
+
+ // Return the number of bytes left to read from the source
+ virtual size_t Available() const = 0;
+
+ // Peek at the next flat region of the source. Does not reposition
+ // the source. The returned region is empty iff Available()==0.
+ //
+ // Returns a pointer to the beginning of the region and store its
+ // length in *len.
+ //
+ // The returned region is valid until the next call to Skip() or
+ // until this object is destroyed, whichever occurs first.
+ //
+ // The returned region may be larger than Available() (for example
+ // if this ByteSource is a view on a substring of a larger source).
+ // The caller is responsible for ensuring that it only reads the
+ // Available() bytes.
+ virtual const char* Peek(size_t* len) = 0;
+
+ // Skip the next n bytes. Invalidates any buffer returned by
+ // a previous call to Peek().
+ // REQUIRES: Available() >= n
+ virtual void Skip(size_t n) = 0;
+
+ private:
+ // No copying
+ Source(const Source&);
+ void operator=(const Source&);
+};
+
+// A Source implementation that yields the contents of a flat array
+class ByteArraySource : public Source {
+ public:
+ ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) { }
+ virtual ~ByteArraySource();
+ virtual size_t Available() const;
+ virtual const char* Peek(size_t* len);
+ virtual void Skip(size_t n);
+ private:
+ const char* ptr_;
+ size_t left_;
+};
+
+// A Sink implementation that writes to a flat array without any bound checks.
+class UncheckedByteArraySink : public Sink {
+ public:
+ explicit UncheckedByteArraySink(char* dest) : dest_(dest) { }
+ virtual ~UncheckedByteArraySink();
+ virtual void Append(const char* data, size_t n);
+ virtual char* GetAppendBuffer(size_t len, char* scratch);
+
+ // Return the current output pointer so that a caller can see how
+ // many bytes were produced.
+ // Note: this is not a Sink method.
+ char* CurrentDestination() const { return dest_; }
+ private:
+ char* dest_;
+};
+
+
+}
+
+#endif // UTIL_SNAPPY_SNAPPY_SINKSOURCE_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.cc b/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.cc
new file mode 100644
index 00000000..6ed33437
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.cc
@@ -0,0 +1,42 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+
+#include <algorithm>
+#include <string>
+
+#include "snappy-stubs-internal.h"
+
+namespace snappy {
+
+void Varint::Append32(string* s, uint32 value) {
+ char buf[Varint::kMax32];
+ const char* p = Varint::Encode32(buf, value);
+ s->append(buf, p - buf);
+}
+
+} // namespace snappy
diff --git a/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.h b/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.h
new file mode 100644
index 00000000..12393b62
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-stubs-internal.h
@@ -0,0 +1,491 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+//
+// Various stubs for the open-source version of Snappy.
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string>
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#include "snappy-stubs-public.h"
+
+#if defined(__x86_64__)
+
+// Enable 64-bit optimized versions of some routines.
+#define ARCH_K8 1
+
+#endif
+
+// Needed by OS X, among others.
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
+// Pull in std::min, std::ostream, and the likes. This is safe because this
+// header file is never used from any public header files.
+using namespace std;
+
+// The size of an array, if known at compile-time.
+// Will give unexpected results if used on a pointer.
+// We undefine it first, since some compilers already have a definition.
+#ifdef ARRAYSIZE
+#undef ARRAYSIZE
+#endif
+#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a)))
+
+// Static prediction hints.
+#ifdef HAVE_BUILTIN_EXPECT
+#define PREDICT_FALSE(x) (__builtin_expect(x, 0))
+#define PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
+#else
+#define PREDICT_FALSE(x) x
+#define PREDICT_TRUE(x) x
+#endif
+
+// This is only used for recomputing the tag byte table used during
+// decompression; for simplicity we just remove it from the open-source
+// version (anyone who wants to regenerate it can just do the call
+// themselves within main()).
+#define DEFINE_bool(flag_name, default_value, description) \
+ bool FLAGS_ ## flag_name = default_value
+#define DECLARE_bool(flag_name) \
+ extern bool FLAGS_ ## flag_name
+
+namespace snappy {
+
+static const uint32 kuint32max = static_cast<uint32>(0xFFFFFFFF);
+static const int64 kint64max = static_cast<int64>(0x7FFFFFFFFFFFFFFFLL);
+
+// Potentially unaligned loads and stores.
+
+// x86 and PowerPC can simply do these loads and stores native.
+
+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__)
+
+#define UNALIGNED_LOAD16(_p) (*reinterpret_cast<const uint16 *>(_p))
+#define UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_p))
+#define UNALIGNED_LOAD64(_p) (*reinterpret_cast<const uint64 *>(_p))
+
+#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast<uint16 *>(_p) = (_val))
+#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast<uint32 *>(_p) = (_val))
+#define UNALIGNED_STORE64(_p, _val) (*reinterpret_cast<uint64 *>(_p) = (_val))
+
+// ARMv7 and newer support native unaligned accesses, but only of 16-bit
+// and 32-bit values (not 64-bit); older versions either raise a fatal signal,
+// do an unaligned read and rotate the words around a bit, or do the reads very
+// slowly (trip through kernel mode). There's no simple #define that says just
+// “ARMv7 or higher”, so we have to filter away all ARMv5 and ARMv6
+// sub-architectures.
+//
+// This is a mess, but there's not much we can do about it.
+
+#elif defined(__arm__) && \
+ !defined(__ARM_ARCH_4__) && \
+ !defined(__ARM_ARCH_4T__) && \
+ !defined(__ARM_ARCH_5__) && \
+ !defined(__ARM_ARCH_5T__) && \
+ !defined(__ARM_ARCH_5TE__) && \
+ !defined(__ARM_ARCH_5TEJ__) && \
+ !defined(__ARM_ARCH_6__) && \
+ !defined(__ARM_ARCH_6J__) && \
+ !defined(__ARM_ARCH_6K__) && \
+ !defined(__ARM_ARCH_6Z__) && \
+ !defined(__ARM_ARCH_6ZK__) && \
+ !defined(__ARM_ARCH_6T2__)
+
+#define UNALIGNED_LOAD16(_p) (*reinterpret_cast<const uint16 *>(_p))
+#define UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_p))
+
+#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast<uint16 *>(_p) = (_val))
+#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast<uint32 *>(_p) = (_val))
+
+// TODO(user): NEON supports unaligned 64-bit loads and stores.
+// See if that would be more efficient on platforms supporting it,
+// at least for copies.
+
+inline uint64 UNALIGNED_LOAD64(const void *p) {
+ uint64 t;
+ memcpy(&t, p, sizeof t);
+ return t;
+}
+
+inline void UNALIGNED_STORE64(void *p, uint64 v) {
+ memcpy(p, &v, sizeof v);
+}
+
+#else
+
+// These functions are provided for architectures that don't support
+// unaligned loads and stores.
+
+inline uint16 UNALIGNED_LOAD16(const void *p) {
+ uint16 t;
+ memcpy(&t, p, sizeof t);
+ return t;
+}
+
+inline uint32 UNALIGNED_LOAD32(const void *p) {
+ uint32 t;
+ memcpy(&t, p, sizeof t);
+ return t;
+}
+
+inline uint64 UNALIGNED_LOAD64(const void *p) {
+ uint64 t;
+ memcpy(&t, p, sizeof t);
+ return t;
+}
+
+inline void UNALIGNED_STORE16(void *p, uint16 v) {
+ memcpy(p, &v, sizeof v);
+}
+
+inline void UNALIGNED_STORE32(void *p, uint32 v) {
+ memcpy(p, &v, sizeof v);
+}
+
+inline void UNALIGNED_STORE64(void *p, uint64 v) {
+ memcpy(p, &v, sizeof v);
+}
+
+#endif
+
+// This can be more efficient than UNALIGNED_LOAD64 + UNALIGNED_STORE64
+// on some platforms, in particular ARM.
+inline void UnalignedCopy64(const void *src, void *dst) {
+ if (sizeof(void *) == 8) {
+ UNALIGNED_STORE64(dst, UNALIGNED_LOAD64(src));
+ } else {
+ const char *src_char = reinterpret_cast<const char *>(src);
+ char *dst_char = reinterpret_cast<char *>(dst);
+
+ UNALIGNED_STORE32(dst_char, UNALIGNED_LOAD32(src_char));
+ UNALIGNED_STORE32(dst_char + 4, UNALIGNED_LOAD32(src_char + 4));
+ }
+}
+
+// The following guarantees declaration of the byte swap functions.
+#ifdef WORDS_BIGENDIAN
+
+#ifdef HAVE_SYS_BYTEORDER_H
+#include <sys/byteorder.h>
+#endif
+
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
+#ifdef _MSC_VER
+#include <stdlib.h>
+#define bswap_16(x) _byteswap_ushort(x)
+#define bswap_32(x) _byteswap_ulong(x)
+#define bswap_64(x) _byteswap_uint64(x)
+
+#elif defined(__APPLE__)
+// Mac OS X / Darwin features
+#include <libkern/OSByteOrder.h>
+#define bswap_16(x) OSSwapInt16(x)
+#define bswap_32(x) OSSwapInt32(x)
+#define bswap_64(x) OSSwapInt64(x)
+
+#elif defined(HAVE_BYTESWAP_H)
+#include <byteswap.h>
+
+#elif defined(bswap32)
+// FreeBSD defines bswap{16,32,64} in <sys/endian.h> (already #included).
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+
+#elif defined(BSWAP_64)
+// Solaris 10 defines BSWAP_{16,32,64} in <sys/byteorder.h> (already #included).
+#define bswap_16(x) BSWAP_16(x)
+#define bswap_32(x) BSWAP_32(x)
+#define bswap_64(x) BSWAP_64(x)
+
+#else
+
+inline uint16 bswap_16(uint16 x) {
+ return (x << 8) | (x >> 8);
+}
+
+inline uint32 bswap_32(uint32 x) {
+ x = ((x & 0xff00ff00UL) >> 8) | ((x & 0x00ff00ffUL) << 8);
+ return (x >> 16) | (x << 16);
+}
+
+inline uint64 bswap_64(uint64 x) {
+ x = ((x & 0xff00ff00ff00ff00ULL) >> 8) | ((x & 0x00ff00ff00ff00ffULL) << 8);
+ x = ((x & 0xffff0000ffff0000ULL) >> 16) | ((x & 0x0000ffff0000ffffULL) << 16);
+ return (x >> 32) | (x << 32);
+}
+
+#endif
+
+#endif // WORDS_BIGENDIAN
+
+// Convert to little-endian storage, opposite of network format.
+// Convert x from host to little endian: x = LittleEndian.FromHost(x);
+// convert x from little endian to host: x = LittleEndian.ToHost(x);
+//
+// Store values into unaligned memory converting to little endian order:
+// LittleEndian.Store16(p, x);
+//
+// Load unaligned values stored in little endian converting to host order:
+// x = LittleEndian.Load16(p);
+class LittleEndian {
+ public:
+ // Conversion functions.
+#ifdef WORDS_BIGENDIAN
+
+ static uint16 FromHost16(uint16 x) { return bswap_16(x); }
+ static uint16 ToHost16(uint16 x) { return bswap_16(x); }
+
+ static uint32 FromHost32(uint32 x) { return bswap_32(x); }
+ static uint32 ToHost32(uint32 x) { return bswap_32(x); }
+
+ static bool IsLittleEndian() { return false; }
+
+#else // !defined(WORDS_BIGENDIAN)
+
+ static uint16 FromHost16(uint16 x) { return x; }
+ static uint16 ToHost16(uint16 x) { return x; }
+
+ static uint32 FromHost32(uint32 x) { return x; }
+ static uint32 ToHost32(uint32 x) { return x; }
+
+ static bool IsLittleEndian() { return true; }
+
+#endif // !defined(WORDS_BIGENDIAN)
+
+ // Functions to do unaligned loads and stores in little-endian order.
+ static uint16 Load16(const void *p) {
+ return ToHost16(UNALIGNED_LOAD16(p));
+ }
+
+ static void Store16(void *p, uint16 v) {
+ UNALIGNED_STORE16(p, FromHost16(v));
+ }
+
+ static uint32 Load32(const void *p) {
+ return ToHost32(UNALIGNED_LOAD32(p));
+ }
+
+ static void Store32(void *p, uint32 v) {
+ UNALIGNED_STORE32(p, FromHost32(v));
+ }
+};
+
+// Some bit-manipulation functions.
+class Bits {
+ public:
+ // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.
+ static int Log2Floor(uint32 n);
+
+ // Return the first set least / most significant bit, 0-indexed. Returns an
+ // undefined value if n == 0. FindLSBSetNonZero() is similar to ffs() except
+ // that it's 0-indexed.
+ static int FindLSBSetNonZero(uint32 n);
+ static int FindLSBSetNonZero64(uint64 n);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Bits);
+};
+
+#ifdef HAVE_BUILTIN_CTZ
+
+inline int Bits::Log2Floor(uint32 n) {
+ return n == 0 ? -1 : 31 ^ __builtin_clz(n);
+}
+
+inline int Bits::FindLSBSetNonZero(uint32 n) {
+ return __builtin_ctz(n);
+}
+
+inline int Bits::FindLSBSetNonZero64(uint64 n) {
+ return __builtin_ctzll(n);
+}
+
+#else // Portable versions.
+
+inline int Bits::Log2Floor(uint32 n) {
+ if (n == 0)
+ return -1;
+ int log = 0;
+ uint32 value = n;
+ for (int i = 4; i >= 0; --i) {
+ int shift = (1 << i);
+ uint32 x = value >> shift;
+ if (x != 0) {
+ value = x;
+ log += shift;
+ }
+ }
+ assert(value == 1);
+ return log;
+}
+
+inline int Bits::FindLSBSetNonZero(uint32 n) {
+ int rc = 31;
+ for (int i = 4, shift = 1 << 4; i >= 0; --i) {
+ const uint32 x = n << shift;
+ if (x != 0) {
+ n = x;
+ rc -= shift;
+ }
+ shift >>= 1;
+ }
+ return rc;
+}
+
+// FindLSBSetNonZero64() is defined in terms of FindLSBSetNonZero().
+inline int Bits::FindLSBSetNonZero64(uint64 n) {
+ const uint32 bottombits = static_cast<uint32>(n);
+ if (bottombits == 0) {
+ // Bottom bits are zero, so scan in top bits
+ return 32 + FindLSBSetNonZero(static_cast<uint32>(n >> 32));
+ } else {
+ return FindLSBSetNonZero(bottombits);
+ }
+}
+
+#endif // End portable versions.
+
+// Variable-length integer encoding.
+class Varint {
+ public:
+ // Maximum lengths of varint encoding of uint32.
+ static const int kMax32 = 5;
+
+ // Attempts to parse a varint32 from a prefix of the bytes in [ptr,limit-1].
+ // Never reads a character at or beyond limit. If a valid/terminated varint32
+ // was found in the range, stores it in *OUTPUT and returns a pointer just
+ // past the last byte of the varint32. Else returns NULL. On success,
+ // "result <= limit".
+ static const char* Parse32WithLimit(const char* ptr, const char* limit,
+ uint32* OUTPUT);
+
+ // REQUIRES "ptr" points to a buffer of length sufficient to hold "v".
+ // EFFECTS Encodes "v" into "ptr" and returns a pointer to the
+ // byte just past the last encoded byte.
+ static char* Encode32(char* ptr, uint32 v);
+
+ // EFFECTS Appends the varint representation of "value" to "*s".
+ static void Append32(string* s, uint32 value);
+};
+
+inline const char* Varint::Parse32WithLimit(const char* p,
+ const char* l,
+ uint32* OUTPUT) {
+ const unsigned char* ptr = reinterpret_cast<const unsigned char*>(p);
+ const unsigned char* limit = reinterpret_cast<const unsigned char*>(l);
+ uint32 b, result;
+ if (ptr >= limit) return NULL;
+ b = *(ptr++); result = b & 127; if (b < 128) goto done;
+ if (ptr >= limit) return NULL;
+ b = *(ptr++); result |= (b & 127) << 7; if (b < 128) goto done;
+ if (ptr >= limit) return NULL;
+ b = *(ptr++); result |= (b & 127) << 14; if (b < 128) goto done;
+ if (ptr >= limit) return NULL;
+ b = *(ptr++); result |= (b & 127) << 21; if (b < 128) goto done;
+ if (ptr >= limit) return NULL;
+ b = *(ptr++); result |= (b & 127) << 28; if (b < 16) goto done;
+ return NULL; // Value is too long to be a varint32
+ done:
+ *OUTPUT = result;
+ return reinterpret_cast<const char*>(ptr);
+}
+
+inline char* Varint::Encode32(char* sptr, uint32 v) {
+ // Operate on characters as unsigneds
+ unsigned char* ptr = reinterpret_cast<unsigned char*>(sptr);
+ static const int B = 128;
+ if (v < (1<<7)) {
+ *(ptr++) = v;
+ } else if (v < (1<<14)) {
+ *(ptr++) = v | B;
+ *(ptr++) = v>>7;
+ } else if (v < (1<<21)) {
+ *(ptr++) = v | B;
+ *(ptr++) = (v>>7) | B;
+ *(ptr++) = v>>14;
+ } else if (v < (1<<28)) {
+ *(ptr++) = v | B;
+ *(ptr++) = (v>>7) | B;
+ *(ptr++) = (v>>14) | B;
+ *(ptr++) = v>>21;
+ } else {
+ *(ptr++) = v | B;
+ *(ptr++) = (v>>7) | B;
+ *(ptr++) = (v>>14) | B;
+ *(ptr++) = (v>>21) | B;
+ *(ptr++) = v>>28;
+ }
+ return reinterpret_cast<char*>(ptr);
+}
+
+// If you know the internal layout of the std::string in use, you can
+// replace this function with one that resizes the string without
+// filling the new space with zeros (if applicable) --
+// it will be non-portable but faster.
+inline void STLStringResizeUninitialized(string* s, size_t new_size) {
+ s->resize(new_size);
+}
+
+// Return a mutable char* pointing to a string's internal buffer,
+// which may not be null-terminated. Writing through this pointer will
+// modify the string.
+//
+// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the
+// next call to a string method that invalidates iterators.
+//
+// As of 2006-04, there is no standard-blessed way of getting a
+// mutable reference to a string's internal buffer. However, issue 530
+// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#530)
+// proposes this as the method. It will officially be part of the standard
+// for C++0x. This should already work on all current implementations.
+inline char* string_as_array(string* str) {
+ return str->empty() ? NULL : &*str->begin();
+}
+
+} // namespace snappy
+
+#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h b/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h
new file mode 100644
index 00000000..96d88650
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h
@@ -0,0 +1,85 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: sesse@google.com (Steinar H. Gunderson)
+//
+// 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 Google Inc. 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.
+//
+// Various type stubs for the open-source version of Snappy.
+//
+// This file cannot include config.h, as it is included from snappy.h,
+// which is a public header. Instead, snappy-stubs-public.h is generated by
+// from snappy-stubs-public.h.in at configure time.
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+
+#if 1
+#include <stdint.h>
+#endif
+
+#if 1
+#include <stddef.h>
+#endif
+
+#define SNAPPY_MAJOR 1
+#define SNAPPY_MINOR 1
+#define SNAPPY_PATCHLEVEL 0
+#define SNAPPY_VERSION \
+ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
+
+#include <string>
+
+namespace snappy {
+
+#if 1
+typedef int8_t int8;
+typedef uint8_t uint8;
+typedef int16_t int16;
+typedef uint16_t uint16;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
+#else
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+#endif
+
+typedef std::string string;
+
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+} // namespace snappy
+
+#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h.in b/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h.in
new file mode 100644
index 00000000..f0babcbe
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-stubs-public.h.in
@@ -0,0 +1,85 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+// Author: sesse@google.com (Steinar H. Gunderson)
+//
+// 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 Google Inc. 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.
+//
+// Various type stubs for the open-source version of Snappy.
+//
+// This file cannot include config.h, as it is included from snappy.h,
+// which is a public header. Instead, snappy-stubs-public.h is generated by
+// from snappy-stubs-public.h.in at configure time.
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
+
+#if @ac_cv_have_stdint_h@
+#include <stdint.h>
+#endif
+
+#if @ac_cv_have_stddef_h@
+#include <stddef.h>
+#endif
+
+#define SNAPPY_MAJOR @SNAPPY_MAJOR@
+#define SNAPPY_MINOR @SNAPPY_MINOR@
+#define SNAPPY_PATCHLEVEL @SNAPPY_PATCHLEVEL@
+#define SNAPPY_VERSION \
+ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL)
+
+#include <string>
+
+namespace snappy {
+
+#if @ac_cv_have_stdint_h@
+typedef int8_t int8;
+typedef uint8_t uint8;
+typedef int16_t int16;
+typedef uint16_t uint16;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
+#else
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+#endif
+
+typedef std::string string;
+
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+} // namespace snappy
+
+#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy-test.cc b/ics-openvpn-stripped/main/snappy/snappy-test.cc
new file mode 100644
index 00000000..46194109
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-test.cc
@@ -0,0 +1,606 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+//
+// Various stubs for the unit tests for the open-source version of Snappy.
+
+#include "snappy-test.h"
+
+#ifdef HAVE_WINDOWS_H
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#include <algorithm>
+
+DEFINE_bool(run_microbenchmarks, true,
+ "Run microbenchmarks before doing anything else.");
+
+namespace snappy {
+
+string ReadTestDataFile(const string& base, size_t size_limit) {
+ string contents;
+ const char* srcdir = getenv("srcdir"); // This is set by Automake.
+ string prefix;
+ if (srcdir) {
+ prefix = string(srcdir) + "/";
+ }
+ file::GetContents(prefix + "testdata/" + base, &contents, file::Defaults()
+ ).CheckSuccess();
+ if (size_limit > 0) {
+ contents = contents.substr(0, size_limit);
+ }
+ return contents;
+}
+
+string ReadTestDataFile(const string& base) {
+ return ReadTestDataFile(base, 0);
+}
+
+string StringPrintf(const char* format, ...) {
+ char buf[4096];
+ va_list ap;
+ va_start(ap, format);
+ vsnprintf(buf, sizeof(buf), format, ap);
+ va_end(ap);
+ return buf;
+}
+
+bool benchmark_running = false;
+int64 benchmark_real_time_us = 0;
+int64 benchmark_cpu_time_us = 0;
+string *benchmark_label = NULL;
+int64 benchmark_bytes_processed = 0;
+
+void ResetBenchmarkTiming() {
+ benchmark_real_time_us = 0;
+ benchmark_cpu_time_us = 0;
+}
+
+#ifdef WIN32
+LARGE_INTEGER benchmark_start_real;
+FILETIME benchmark_start_cpu;
+#else // WIN32
+struct timeval benchmark_start_real;
+struct rusage benchmark_start_cpu;
+#endif // WIN32
+
+void StartBenchmarkTiming() {
+#ifdef WIN32
+ QueryPerformanceCounter(&benchmark_start_real);
+ FILETIME dummy;
+ CHECK(GetProcessTimes(
+ GetCurrentProcess(), &dummy, &dummy, &dummy, &benchmark_start_cpu));
+#else
+ gettimeofday(&benchmark_start_real, NULL);
+ if (getrusage(RUSAGE_SELF, &benchmark_start_cpu) == -1) {
+ perror("getrusage(RUSAGE_SELF)");
+ exit(1);
+ }
+#endif
+ benchmark_running = true;
+}
+
+void StopBenchmarkTiming() {
+ if (!benchmark_running) {
+ return;
+ }
+
+#ifdef WIN32
+ LARGE_INTEGER benchmark_stop_real;
+ LARGE_INTEGER benchmark_frequency;
+ QueryPerformanceCounter(&benchmark_stop_real);
+ QueryPerformanceFrequency(&benchmark_frequency);
+
+ double elapsed_real = static_cast<double>(
+ benchmark_stop_real.QuadPart - benchmark_start_real.QuadPart) /
+ benchmark_frequency.QuadPart;
+ benchmark_real_time_us += elapsed_real * 1e6 + 0.5;
+
+ FILETIME benchmark_stop_cpu, dummy;
+ CHECK(GetProcessTimes(
+ GetCurrentProcess(), &dummy, &dummy, &dummy, &benchmark_stop_cpu));
+
+ ULARGE_INTEGER start_ulargeint;
+ start_ulargeint.LowPart = benchmark_start_cpu.dwLowDateTime;
+ start_ulargeint.HighPart = benchmark_start_cpu.dwHighDateTime;
+
+ ULARGE_INTEGER stop_ulargeint;
+ stop_ulargeint.LowPart = benchmark_stop_cpu.dwLowDateTime;
+ stop_ulargeint.HighPart = benchmark_stop_cpu.dwHighDateTime;
+
+ benchmark_cpu_time_us +=
+ (stop_ulargeint.QuadPart - start_ulargeint.QuadPart + 5) / 10;
+#else // WIN32
+ struct timeval benchmark_stop_real;
+ gettimeofday(&benchmark_stop_real, NULL);
+ benchmark_real_time_us +=
+ 1000000 * (benchmark_stop_real.tv_sec - benchmark_start_real.tv_sec);
+ benchmark_real_time_us +=
+ (benchmark_stop_real.tv_usec - benchmark_start_real.tv_usec);
+
+ struct rusage benchmark_stop_cpu;
+ if (getrusage(RUSAGE_SELF, &benchmark_stop_cpu) == -1) {
+ perror("getrusage(RUSAGE_SELF)");
+ exit(1);
+ }
+ benchmark_cpu_time_us += 1000000 * (benchmark_stop_cpu.ru_utime.tv_sec -
+ benchmark_start_cpu.ru_utime.tv_sec);
+ benchmark_cpu_time_us += (benchmark_stop_cpu.ru_utime.tv_usec -
+ benchmark_start_cpu.ru_utime.tv_usec);
+#endif // WIN32
+
+ benchmark_running = false;
+}
+
+void SetBenchmarkLabel(const string& str) {
+ if (benchmark_label) {
+ delete benchmark_label;
+ }
+ benchmark_label = new string(str);
+}
+
+void SetBenchmarkBytesProcessed(int64 bytes) {
+ benchmark_bytes_processed = bytes;
+}
+
+struct BenchmarkRun {
+ int64 real_time_us;
+ int64 cpu_time_us;
+};
+
+struct BenchmarkCompareCPUTime {
+ bool operator() (const BenchmarkRun& a, const BenchmarkRun& b) const {
+ return a.cpu_time_us < b.cpu_time_us;
+ }
+};
+
+void Benchmark::Run() {
+ for (int test_case_num = start_; test_case_num <= stop_; ++test_case_num) {
+ // Run a few iterations first to find out approximately how fast
+ // the benchmark is.
+ const int kCalibrateIterations = 100;
+ ResetBenchmarkTiming();
+ StartBenchmarkTiming();
+ (*function_)(kCalibrateIterations, test_case_num);
+ StopBenchmarkTiming();
+
+ // Let each test case run for about 200ms, but at least as many
+ // as we used to calibrate.
+ // Run five times and pick the median.
+ const int kNumRuns = 5;
+ const int kMedianPos = kNumRuns / 2;
+ int num_iterations = 0;
+ if (benchmark_real_time_us > 0) {
+ num_iterations = 200000 * kCalibrateIterations / benchmark_real_time_us;
+ }
+ num_iterations = max(num_iterations, kCalibrateIterations);
+ BenchmarkRun benchmark_runs[kNumRuns];
+
+ for (int run = 0; run < kNumRuns; ++run) {
+ ResetBenchmarkTiming();
+ StartBenchmarkTiming();
+ (*function_)(num_iterations, test_case_num);
+ StopBenchmarkTiming();
+
+ benchmark_runs[run].real_time_us = benchmark_real_time_us;
+ benchmark_runs[run].cpu_time_us = benchmark_cpu_time_us;
+ }
+
+ string heading = StringPrintf("%s/%d", name_.c_str(), test_case_num);
+ string human_readable_speed;
+
+ nth_element(benchmark_runs,
+ benchmark_runs + kMedianPos,
+ benchmark_runs + kNumRuns,
+ BenchmarkCompareCPUTime());
+ int64 real_time_us = benchmark_runs[kMedianPos].real_time_us;
+ int64 cpu_time_us = benchmark_runs[kMedianPos].cpu_time_us;
+ if (cpu_time_us <= 0) {
+ human_readable_speed = "?";
+ } else {
+ int64 bytes_per_second =
+ benchmark_bytes_processed * 1000000 / cpu_time_us;
+ if (bytes_per_second < 1024) {
+ human_readable_speed = StringPrintf("%dB/s", bytes_per_second);
+ } else if (bytes_per_second < 1024 * 1024) {
+ human_readable_speed = StringPrintf(
+ "%.1fkB/s", bytes_per_second / 1024.0f);
+ } else if (bytes_per_second < 1024 * 1024 * 1024) {
+ human_readable_speed = StringPrintf(
+ "%.1fMB/s", bytes_per_second / (1024.0f * 1024.0f));
+ } else {
+ human_readable_speed = StringPrintf(
+ "%.1fGB/s", bytes_per_second / (1024.0f * 1024.0f * 1024.0f));
+ }
+ }
+
+ fprintf(stderr,
+#ifdef WIN32
+ "%-18s %10I64d %10I64d %10d %s %s\n",
+#else
+ "%-18s %10lld %10lld %10d %s %s\n",
+#endif
+ heading.c_str(),
+ static_cast<long long>(real_time_us * 1000 / num_iterations),
+ static_cast<long long>(cpu_time_us * 1000 / num_iterations),
+ num_iterations,
+ human_readable_speed.c_str(),
+ benchmark_label->c_str());
+ }
+}
+
+#ifdef HAVE_LIBZ
+
+ZLib::ZLib()
+ : comp_init_(false),
+ uncomp_init_(false) {
+ Reinit();
+}
+
+ZLib::~ZLib() {
+ if (comp_init_) { deflateEnd(&comp_stream_); }
+ if (uncomp_init_) { inflateEnd(&uncomp_stream_); }
+}
+
+void ZLib::Reinit() {
+ compression_level_ = Z_DEFAULT_COMPRESSION;
+ window_bits_ = MAX_WBITS;
+ mem_level_ = 8; // DEF_MEM_LEVEL
+ if (comp_init_) {
+ deflateEnd(&comp_stream_);
+ comp_init_ = false;
+ }
+ if (uncomp_init_) {
+ inflateEnd(&uncomp_stream_);
+ uncomp_init_ = false;
+ }
+ first_chunk_ = true;
+}
+
+void ZLib::Reset() {
+ first_chunk_ = true;
+}
+
+// --------- COMPRESS MODE
+
+// Initialization method to be called if we hit an error while
+// compressing. On hitting an error, call this method before returning
+// the error.
+void ZLib::CompressErrorInit() {
+ deflateEnd(&comp_stream_);
+ comp_init_ = false;
+ Reset();
+}
+
+int ZLib::DeflateInit() {
+ return deflateInit2(&comp_stream_,
+ compression_level_,
+ Z_DEFLATED,
+ window_bits_,
+ mem_level_,
+ Z_DEFAULT_STRATEGY);
+}
+
+int ZLib::CompressInit(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen) {
+ int err;
+
+ comp_stream_.next_in = (Bytef*)source;
+ comp_stream_.avail_in = (uInt)*sourceLen;
+ if ((uLong)comp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR;
+ comp_stream_.next_out = dest;
+ comp_stream_.avail_out = (uInt)*destLen;
+ if ((uLong)comp_stream_.avail_out != *destLen) return Z_BUF_ERROR;
+
+ if ( !first_chunk_ ) // only need to set up stream the first time through
+ return Z_OK;
+
+ if (comp_init_) { // we've already initted it
+ err = deflateReset(&comp_stream_);
+ if (err != Z_OK) {
+ LOG(WARNING) << "ERROR: Can't reset compress object; creating a new one";
+ deflateEnd(&comp_stream_);
+ comp_init_ = false;
+ }
+ }
+ if (!comp_init_) { // first use
+ comp_stream_.zalloc = (alloc_func)0;
+ comp_stream_.zfree = (free_func)0;
+ comp_stream_.opaque = (voidpf)0;
+ err = DeflateInit();
+ if (err != Z_OK) return err;
+ comp_init_ = true;
+ }
+ return Z_OK;
+}
+
+// In a perfect world we'd always have the full buffer to compress
+// when the time came, and we could just call Compress(). Alas, we
+// want to do chunked compression on our webserver. In this
+// application, we compress the header, send it off, then compress the
+// results, send them off, then compress the footer. Thus we need to
+// use the chunked compression features of zlib.
+int ZLib::CompressAtMostOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen,
+ int flush_mode) { // Z_FULL_FLUSH or Z_FINISH
+ int err;
+
+ if ( (err=CompressInit(dest, destLen, source, sourceLen)) != Z_OK )
+ return err;
+
+ // This is used to figure out how many bytes we wrote *this chunk*
+ int compressed_size = comp_stream_.total_out;
+
+ // Some setup happens only for the first chunk we compress in a run
+ if ( first_chunk_ ) {
+ first_chunk_ = false;
+ }
+
+ // flush_mode is Z_FINISH for all mode, Z_SYNC_FLUSH for incremental
+ // compression.
+ err = deflate(&comp_stream_, flush_mode);
+
+ *sourceLen = comp_stream_.avail_in;
+
+ if ((err == Z_STREAM_END || err == Z_OK)
+ && comp_stream_.avail_in == 0
+ && comp_stream_.avail_out != 0 ) {
+ // we processed everything ok and the output buffer was large enough.
+ ;
+ } else if (err == Z_STREAM_END && comp_stream_.avail_in > 0) {
+ return Z_BUF_ERROR; // should never happen
+ } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) {
+ // an error happened
+ CompressErrorInit();
+ return err;
+ } else if (comp_stream_.avail_out == 0) { // not enough space
+ err = Z_BUF_ERROR;
+ }
+
+ assert(err == Z_OK || err == Z_STREAM_END || err == Z_BUF_ERROR);
+ if (err == Z_STREAM_END)
+ err = Z_OK;
+
+ // update the crc and other metadata
+ compressed_size = comp_stream_.total_out - compressed_size; // delta
+ *destLen = compressed_size;
+
+ return err;
+}
+
+int ZLib::CompressChunkOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int flush_mode) { // Z_FULL_FLUSH or Z_FINISH
+ const int ret =
+ CompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode);
+ if (ret == Z_BUF_ERROR)
+ CompressErrorInit();
+ return ret;
+}
+
+// This routine only initializes the compression stream once. Thereafter, it
+// just does a deflateReset on the stream, which should be faster.
+int ZLib::Compress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen) {
+ int err;
+ if ( (err=CompressChunkOrAll(dest, destLen, source, sourceLen,
+ Z_FINISH)) != Z_OK )
+ return err;
+ Reset(); // reset for next call to Compress
+
+ return Z_OK;
+}
+
+
+// --------- UNCOMPRESS MODE
+
+int ZLib::InflateInit() {
+ return inflateInit2(&uncomp_stream_, MAX_WBITS);
+}
+
+// Initialization method to be called if we hit an error while
+// uncompressing. On hitting an error, call this method before
+// returning the error.
+void ZLib::UncompressErrorInit() {
+ inflateEnd(&uncomp_stream_);
+ uncomp_init_ = false;
+ Reset();
+}
+
+int ZLib::UncompressInit(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen) {
+ int err;
+
+ uncomp_stream_.next_in = (Bytef*)source;
+ uncomp_stream_.avail_in = (uInt)*sourceLen;
+ // Check for source > 64K on 16-bit machine:
+ if ((uLong)uncomp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR;
+
+ uncomp_stream_.next_out = dest;
+ uncomp_stream_.avail_out = (uInt)*destLen;
+ if ((uLong)uncomp_stream_.avail_out != *destLen) return Z_BUF_ERROR;
+
+ if ( !first_chunk_ ) // only need to set up stream the first time through
+ return Z_OK;
+
+ if (uncomp_init_) { // we've already initted it
+ err = inflateReset(&uncomp_stream_);
+ if (err != Z_OK) {
+ LOG(WARNING)
+ << "ERROR: Can't reset uncompress object; creating a new one";
+ UncompressErrorInit();
+ }
+ }
+ if (!uncomp_init_) {
+ uncomp_stream_.zalloc = (alloc_func)0;
+ uncomp_stream_.zfree = (free_func)0;
+ uncomp_stream_.opaque = (voidpf)0;
+ err = InflateInit();
+ if (err != Z_OK) return err;
+ uncomp_init_ = true;
+ }
+ return Z_OK;
+}
+
+// If you compressed your data a chunk at a time, with CompressChunk,
+// you can uncompress it a chunk at a time with UncompressChunk.
+// Only difference bewteen chunked and unchunked uncompression
+// is the flush mode we use: Z_SYNC_FLUSH (chunked) or Z_FINISH (unchunked).
+int ZLib::UncompressAtMostOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen,
+ int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH
+ int err = Z_OK;
+
+ if ( (err=UncompressInit(dest, destLen, source, sourceLen)) != Z_OK ) {
+ LOG(WARNING) << "UncompressInit: Error: " << err << " SourceLen: "
+ << *sourceLen;
+ return err;
+ }
+
+ // This is used to figure out how many output bytes we wrote *this chunk*:
+ const uLong old_total_out = uncomp_stream_.total_out;
+
+ // This is used to figure out how many input bytes we read *this chunk*:
+ const uLong old_total_in = uncomp_stream_.total_in;
+
+ // Some setup happens only for the first chunk we compress in a run
+ if ( first_chunk_ ) {
+ first_chunk_ = false; // so we don't do this again
+
+ // For the first chunk *only* (to avoid infinite troubles), we let
+ // there be no actual data to uncompress. This sometimes triggers
+ // when the input is only the gzip header, say.
+ if ( *sourceLen == 0 ) {
+ *destLen = 0;
+ return Z_OK;
+ }
+ }
+
+ // We'll uncompress as much as we can. If we end OK great, otherwise
+ // if we get an error that seems to be the gzip footer, we store the
+ // gzip footer and return OK, otherwise we return the error.
+
+ // flush_mode is Z_SYNC_FLUSH for chunked mode, Z_FINISH for all mode.
+ err = inflate(&uncomp_stream_, flush_mode);
+
+ // Figure out how many bytes of the input zlib slurped up:
+ const uLong bytes_read = uncomp_stream_.total_in - old_total_in;
+ CHECK_LE(source + bytes_read, source + *sourceLen);
+ *sourceLen = uncomp_stream_.avail_in;
+
+ if ((err == Z_STREAM_END || err == Z_OK) // everything went ok
+ && uncomp_stream_.avail_in == 0) { // and we read it all
+ ;
+ } else if (err == Z_STREAM_END && uncomp_stream_.avail_in > 0) {
+ LOG(WARNING)
+ << "UncompressChunkOrAll: Received some extra data, bytes total: "
+ << uncomp_stream_.avail_in << " bytes: "
+ << string(reinterpret_cast<const char *>(uncomp_stream_.next_in),
+ min(int(uncomp_stream_.avail_in), 20));
+ UncompressErrorInit();
+ return Z_DATA_ERROR; // what's the extra data for?
+ } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) {
+ // an error happened
+ LOG(WARNING) << "UncompressChunkOrAll: Error: " << err
+ << " avail_out: " << uncomp_stream_.avail_out;
+ UncompressErrorInit();
+ return err;
+ } else if (uncomp_stream_.avail_out == 0) {
+ err = Z_BUF_ERROR;
+ }
+
+ assert(err == Z_OK || err == Z_BUF_ERROR || err == Z_STREAM_END);
+ if (err == Z_STREAM_END)
+ err = Z_OK;
+
+ *destLen = uncomp_stream_.total_out - old_total_out; // size for this call
+
+ return err;
+}
+
+int ZLib::UncompressChunkOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH
+ const int ret =
+ UncompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode);
+ if (ret == Z_BUF_ERROR)
+ UncompressErrorInit();
+ return ret;
+}
+
+int ZLib::UncompressAtMost(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen) {
+ return UncompressAtMostOrAll(dest, destLen, source, sourceLen, Z_SYNC_FLUSH);
+}
+
+// We make sure we've uncompressed everything, that is, the current
+// uncompress stream is at a compressed-buffer-EOF boundary. In gzip
+// mode, we also check the gzip footer to make sure we pass the gzip
+// consistency checks. We RETURN true iff both types of checks pass.
+bool ZLib::UncompressChunkDone() {
+ assert(!first_chunk_ && uncomp_init_);
+ // Make sure we're at the end-of-compressed-data point. This means
+ // if we call inflate with Z_FINISH we won't consume any input or
+ // write any output
+ Bytef dummyin, dummyout;
+ uLongf dummylen = 0;
+ if ( UncompressChunkOrAll(&dummyout, &dummylen, &dummyin, 0, Z_FINISH)
+ != Z_OK ) {
+ return false;
+ }
+
+ // Make sure that when we exit, we can start a new round of chunks later
+ Reset();
+
+ return true;
+}
+
+// Uncompresses the source buffer into the destination buffer.
+// The destination buffer must be long enough to hold the entire
+// decompressed contents.
+//
+// We only initialize the uncomp_stream once. Thereafter, we use
+// inflateReset, which should be faster.
+//
+// Returns Z_OK on success, otherwise, it returns a zlib error code.
+int ZLib::Uncompress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen) {
+ int err;
+ if ( (err=UncompressChunkOrAll(dest, destLen, source, sourceLen,
+ Z_FINISH)) != Z_OK ) {
+ Reset(); // let us try to compress again
+ return err;
+ }
+ if ( !UncompressChunkDone() ) // calls Reset()
+ return Z_DATA_ERROR;
+ return Z_OK; // stream_end is ok
+}
+
+#endif // HAVE_LIBZ
+
+} // namespace snappy
diff --git a/ics-openvpn-stripped/main/snappy/snappy-test.h b/ics-openvpn-stripped/main/snappy/snappy-test.h
new file mode 100644
index 00000000..f7ba79ed
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy-test.h
@@ -0,0 +1,580 @@
+// Copyright 2011 Google 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:
+//
+// * 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 Google Inc. 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.
+//
+// Various stubs for the unit tests for the open-source version of Snappy.
+
+#ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
+#define UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
+
+#include <iostream>
+#include <string>
+
+#include "snappy-stubs-internal.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#include <string>
+
+#ifdef HAVE_GTEST
+
+#include <gtest/gtest.h>
+#undef TYPED_TEST
+#define TYPED_TEST TEST
+#define INIT_GTEST(argc, argv) ::testing::InitGoogleTest(argc, *argv)
+
+#else
+
+// Stubs for if the user doesn't have Google Test installed.
+
+#define TEST(test_case, test_subcase) \
+ void Test_ ## test_case ## _ ## test_subcase()
+#define INIT_GTEST(argc, argv)
+
+#define TYPED_TEST TEST
+#define EXPECT_EQ CHECK_EQ
+#define EXPECT_NE CHECK_NE
+#define EXPECT_FALSE(cond) CHECK(!(cond))
+
+#endif
+
+#ifdef HAVE_GFLAGS
+
+#include <gflags/gflags.h>
+
+// This is tricky; both gflags and Google Test want to look at the command line
+// arguments. Google Test seems to be the most happy with unknown arguments,
+// though, so we call it first and hope for the best.
+#define InitGoogle(argv0, argc, argv, remove_flags) \
+ INIT_GTEST(argc, argv); \
+ google::ParseCommandLineFlags(argc, argv, remove_flags);
+
+#else
+
+// If we don't have the gflags package installed, these can only be
+// changed at compile time.
+#define DEFINE_int32(flag_name, default_value, description) \
+ static int FLAGS_ ## flag_name = default_value;
+
+#define InitGoogle(argv0, argc, argv, remove_flags) \
+ INIT_GTEST(argc, argv)
+
+#endif
+
+#ifdef HAVE_LIBZ
+#include "zlib.h"
+#endif
+
+#ifdef HAVE_LIBLZO2
+#include "lzo/lzo1x.h"
+#endif
+
+#ifdef HAVE_LIBLZF
+extern "C" {
+#include "lzf.h"
+}
+#endif
+
+#ifdef HAVE_LIBFASTLZ
+#include "fastlz.h"
+#endif
+
+#ifdef HAVE_LIBQUICKLZ
+#include "quicklz.h"
+#endif
+
+namespace {
+
+namespace File {
+ void Init() { }
+} // namespace File
+
+namespace file {
+ int Defaults() { }
+
+ class DummyStatus {
+ public:
+ void CheckSuccess() { }
+ };
+
+ DummyStatus GetContents(const string& filename, string* data, int unused) {
+ FILE* fp = fopen(filename.c_str(), "rb");
+ if (fp == NULL) {
+ perror(filename.c_str());
+ exit(1);
+ }
+
+ data->clear();
+ while (!feof(fp)) {
+ char buf[4096];
+ size_t ret = fread(buf, 1, 4096, fp);
+ if (ret == 0 && ferror(fp)) {
+ perror("fread");
+ exit(1);
+ }
+ data->append(string(buf, ret));
+ }
+
+ fclose(fp);
+ }
+
+ DummyStatus SetContents(const string& filename,
+ const string& str,
+ int unused) {
+ FILE* fp = fopen(filename.c_str(), "wb");
+ if (fp == NULL) {
+ perror(filename.c_str());
+ exit(1);
+ }
+
+ int ret = fwrite(str.data(), str.size(), 1, fp);
+ if (ret != 1) {
+ perror("fwrite");
+ exit(1);
+ }
+
+ fclose(fp);
+ }
+} // namespace file
+
+} // namespace
+
+namespace snappy {
+
+#define FLAGS_test_random_seed 301
+typedef string TypeParam;
+
+void Test_CorruptedTest_VerifyCorrupted();
+void Test_Snappy_SimpleTests();
+void Test_Snappy_MaxBlowup();
+void Test_Snappy_RandomData();
+void Test_Snappy_FourByteOffset();
+void Test_SnappyCorruption_TruncatedVarint();
+void Test_SnappyCorruption_UnterminatedVarint();
+void Test_Snappy_ReadPastEndOfBuffer();
+void Test_Snappy_FindMatchLength();
+void Test_Snappy_FindMatchLengthRandom();
+
+string ReadTestDataFile(const string& base, size_t size_limit);
+
+string ReadTestDataFile(const string& base);
+
+// A sprintf() variant that returns a std::string.
+// Not safe for general use due to truncation issues.
+string StringPrintf(const char* format, ...);
+
+// A simple, non-cryptographically-secure random generator.
+class ACMRandom {
+ public:
+ explicit ACMRandom(uint32 seed) : seed_(seed) {}
+
+ int32 Next();
+
+ int32 Uniform(int32 n) {
+ return Next() % n;
+ }
+ uint8 Rand8() {
+ return static_cast<uint8>((Next() >> 1) & 0x000000ff);
+ }
+ bool OneIn(int X) { return Uniform(X) == 0; }
+
+ // Skewed: pick "base" uniformly from range [0,max_log] and then
+ // return "base" random bits. The effect is to pick a number in the
+ // range [0,2^max_log-1] with bias towards smaller numbers.
+ int32 Skewed(int max_log);
+
+ private:
+ static const uint32 M = 2147483647L; // 2^31-1
+ uint32 seed_;
+};
+
+inline int32 ACMRandom::Next() {
+ static const uint64 A = 16807; // bits 14, 8, 7, 5, 2, 1, 0
+ // We are computing
+ // seed_ = (seed_ * A) % M, where M = 2^31-1
+ //
+ // seed_ must not be zero or M, or else all subsequent computed values
+ // will be zero or M respectively. For all other values, seed_ will end
+ // up cycling through every number in [1,M-1]
+ uint64 product = seed_ * A;
+
+ // Compute (product % M) using the fact that ((x << 31) % M) == x.
+ seed_ = (product >> 31) + (product & M);
+ // The first reduction may overflow by 1 bit, so we may need to repeat.
+ // mod == M is not possible; using > allows the faster sign-bit-based test.
+ if (seed_ > M) {
+ seed_ -= M;
+ }
+ return seed_;
+}
+
+inline int32 ACMRandom::Skewed(int max_log) {
+ const int32 base = (Next() - 1) % (max_log+1);
+ return (Next() - 1) & ((1u << base)-1);
+}
+
+// A wall-time clock. This stub is not super-accurate, nor resistant to the
+// system time changing.
+class CycleTimer {
+ public:
+ CycleTimer() : real_time_us_(0) {}
+
+ void Start() {
+#ifdef WIN32
+ QueryPerformanceCounter(&start_);
+#else
+ gettimeofday(&start_, NULL);
+#endif
+ }
+
+ void Stop() {
+#ifdef WIN32
+ LARGE_INTEGER stop;
+ LARGE_INTEGER frequency;
+ QueryPerformanceCounter(&stop);
+ QueryPerformanceFrequency(&frequency);
+
+ double elapsed = static_cast<double>(stop.QuadPart - start_.QuadPart) /
+ frequency.QuadPart;
+ real_time_us_ += elapsed * 1e6 + 0.5;
+#else
+ struct timeval stop;
+ gettimeofday(&stop, NULL);
+
+ real_time_us_ += 1000000 * (stop.tv_sec - start_.tv_sec);
+ real_time_us_ += (stop.tv_usec - start_.tv_usec);
+#endif
+ }
+
+ double Get() {
+ return real_time_us_ * 1e-6;
+ }
+
+ private:
+ int64 real_time_us_;
+#ifdef WIN32
+ LARGE_INTEGER start_;
+#else
+ struct timeval start_;
+#endif
+};
+
+// Minimalistic microbenchmark framework.
+
+typedef void (*BenchmarkFunction)(int, int);
+
+class Benchmark {
+ public:
+ Benchmark(const string& name, BenchmarkFunction function) :
+ name_(name), function_(function) {}
+
+ Benchmark* DenseRange(int start, int stop) {
+ start_ = start;
+ stop_ = stop;
+ return this;
+ }
+
+ void Run();
+
+ private:
+ const string name_;
+ const BenchmarkFunction function_;
+ int start_, stop_;
+};
+#define BENCHMARK(benchmark_name) \
+ Benchmark* Benchmark_ ## benchmark_name = \
+ (new Benchmark(#benchmark_name, benchmark_name))
+
+extern Benchmark* Benchmark_BM_UFlat;
+extern Benchmark* Benchmark_BM_UValidate;
+extern Benchmark* Benchmark_BM_ZFlat;
+
+void ResetBenchmarkTiming();
+void StartBenchmarkTiming();
+void StopBenchmarkTiming();
+void SetBenchmarkLabel(const string& str);
+void SetBenchmarkBytesProcessed(int64 bytes);
+
+#ifdef HAVE_LIBZ
+
+// Object-oriented wrapper around zlib.
+class ZLib {
+ public:
+ ZLib();
+ ~ZLib();
+
+ // Wipe a ZLib object to a virgin state. This differs from Reset()
+ // in that it also breaks any state.
+ void Reinit();
+
+ // Call this to make a zlib buffer as good as new. Here's the only
+ // case where they differ:
+ // CompressChunk(a); CompressChunk(b); CompressChunkDone(); vs
+ // CompressChunk(a); Reset(); CompressChunk(b); CompressChunkDone();
+ // You'll want to use Reset(), then, when you interrupt a compress
+ // (or uncompress) in the middle of a chunk and want to start over.
+ void Reset();
+
+ // According to the zlib manual, when you Compress, the destination
+ // buffer must have size at least src + .1%*src + 12. This function
+ // helps you calculate that. Augment this to account for a potential
+ // gzip header and footer, plus a few bytes of slack.
+ static int MinCompressbufSize(int uncompress_size) {
+ return uncompress_size + uncompress_size/1000 + 40;
+ }
+
+ // Compresses the source buffer into the destination buffer.
+ // sourceLen is the byte length of the source buffer.
+ // Upon entry, destLen is the total size of the destination buffer,
+ // which must be of size at least MinCompressbufSize(sourceLen).
+ // Upon exit, destLen is the actual size of the compressed buffer.
+ //
+ // This function can be used to compress a whole file at once if the
+ // input file is mmap'ed.
+ //
+ // Returns Z_OK if success, Z_MEM_ERROR if there was not
+ // enough memory, Z_BUF_ERROR if there was not enough room in the
+ // output buffer. Note that if the output buffer is exactly the same
+ // size as the compressed result, we still return Z_BUF_ERROR.
+ // (check CL#1936076)
+ int Compress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen);
+
+ // Uncompresses the source buffer into the destination buffer.
+ // The destination buffer must be long enough to hold the entire
+ // decompressed contents.
+ //
+ // Returns Z_OK on success, otherwise, it returns a zlib error code.
+ int Uncompress(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen);
+
+ // Uncompress data one chunk at a time -- ie you can call this
+ // more than once. To get this to work you need to call per-chunk
+ // and "done" routines.
+ //
+ // Returns Z_OK if success, Z_MEM_ERROR if there was not
+ // enough memory, Z_BUF_ERROR if there was not enough room in the
+ // output buffer.
+
+ int UncompressAtMost(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen);
+
+ // Checks gzip footer information, as needed. Mostly this just
+ // makes sure the checksums match. Whenever you call this, it
+ // will assume the last 8 bytes from the previous UncompressChunk
+ // call are the footer. Returns true iff everything looks ok.
+ bool UncompressChunkDone();
+
+ private:
+ int InflateInit(); // sets up the zlib inflate structure
+ int DeflateInit(); // sets up the zlib deflate structure
+
+ // These init the zlib data structures for compressing/uncompressing
+ int CompressInit(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen);
+ int UncompressInit(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen);
+ // Initialization method to be called if we hit an error while
+ // uncompressing. On hitting an error, call this method before
+ // returning the error.
+ void UncompressErrorInit();
+
+ // Helper function for Compress
+ int CompressChunkOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int flush_mode);
+ int CompressAtMostOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen,
+ int flush_mode);
+
+ // Likewise for UncompressAndUncompressChunk
+ int UncompressChunkOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int flush_mode);
+
+ int UncompressAtMostOrAll(Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen,
+ int flush_mode);
+
+ // Initialization method to be called if we hit an error while
+ // compressing. On hitting an error, call this method before
+ // returning the error.
+ void CompressErrorInit();
+
+ int compression_level_; // compression level
+ int window_bits_; // log base 2 of the window size used in compression
+ int mem_level_; // specifies the amount of memory to be used by
+ // compressor (1-9)
+ z_stream comp_stream_; // Zlib stream data structure
+ bool comp_init_; // True if we have initialized comp_stream_
+ z_stream uncomp_stream_; // Zlib stream data structure
+ bool uncomp_init_; // True if we have initialized uncomp_stream_
+
+ // These are used only with chunked compression.
+ bool first_chunk_; // true if we need to emit headers with this chunk
+};
+
+#endif // HAVE_LIBZ
+
+} // namespace snappy
+
+DECLARE_bool(run_microbenchmarks);
+
+static void RunSpecifiedBenchmarks() {
+ if (!FLAGS_run_microbenchmarks) {
+ return;
+ }
+
+ fprintf(stderr, "Running microbenchmarks.\n");
+#ifndef NDEBUG
+ fprintf(stderr, "WARNING: Compiled with assertions enabled, will be slow.\n");
+#endif
+#ifndef __OPTIMIZE__
+ fprintf(stderr, "WARNING: Compiled without optimization, will be slow.\n");
+#endif
+ fprintf(stderr, "Benchmark Time(ns) CPU(ns) Iterations\n");
+ fprintf(stderr, "---------------------------------------------------\n");
+
+ snappy::Benchmark_BM_UFlat->Run();
+ snappy::Benchmark_BM_UValidate->Run();
+ snappy::Benchmark_BM_ZFlat->Run();
+
+ fprintf(stderr, "\n");
+}
+
+#ifndef HAVE_GTEST
+
+static inline int RUN_ALL_TESTS() {
+ fprintf(stderr, "Running correctness tests.\n");
+ snappy::Test_CorruptedTest_VerifyCorrupted();
+ snappy::Test_Snappy_SimpleTests();
+ snappy::Test_Snappy_MaxBlowup();
+ snappy::Test_Snappy_RandomData();
+ snappy::Test_Snappy_FourByteOffset();
+ snappy::Test_SnappyCorruption_TruncatedVarint();
+ snappy::Test_SnappyCorruption_UnterminatedVarint();
+ snappy::Test_Snappy_ReadPastEndOfBuffer();
+ snappy::Test_Snappy_FindMatchLength();
+ snappy::Test_Snappy_FindMatchLengthRandom();
+ fprintf(stderr, "All tests passed.\n");
+
+ return 0;
+}
+
+#endif // HAVE_GTEST
+
+// For main().
+namespace snappy {
+
+static void CompressFile(const char* fname);
+static void UncompressFile(const char* fname);
+static void MeasureFile(const char* fname);
+
+// Logging.
+
+#define LOG(level) LogMessage()
+#define VLOG(level) true ? (void)0 : \
+ snappy::LogMessageVoidify() & snappy::LogMessage()
+
+class LogMessage {
+ public:
+ LogMessage() { }
+ ~LogMessage() {
+ cerr << endl;
+ }
+
+ LogMessage& operator<<(const std::string& msg) {
+ cerr << msg;
+ return *this;
+ }
+ LogMessage& operator<<(int x) {
+ cerr << x;
+ return *this;
+ }
+};
+
+// Asserts, both versions activated in debug mode only,
+// and ones that are always active.
+
+#define CRASH_UNLESS(condition) \
+ PREDICT_TRUE(condition) ? (void)0 : \
+ snappy::LogMessageVoidify() & snappy::LogMessageCrash()
+
+class LogMessageCrash : public LogMessage {
+ public:
+ LogMessageCrash() { }
+ ~LogMessageCrash() {
+ cerr << endl;
+ abort();
+ }
+};
+
+// This class is used to explicitly ignore values in the conditional
+// logging macros. This avoids compiler warnings like "value computed
+// is not used" and "statement has no effect".
+
+class LogMessageVoidify {
+ public:
+ LogMessageVoidify() { }
+ // This has to be an operator with a precedence lower than << but
+ // higher than ?:
+ void operator&(const LogMessage&) { }
+};
+
+#define CHECK(cond) CRASH_UNLESS(cond)
+#define CHECK_LE(a, b) CRASH_UNLESS((a) <= (b))
+#define CHECK_GE(a, b) CRASH_UNLESS((a) >= (b))
+#define CHECK_EQ(a, b) CRASH_UNLESS((a) == (b))
+#define CHECK_NE(a, b) CRASH_UNLESS((a) != (b))
+#define CHECK_LT(a, b) CRASH_UNLESS((a) < (b))
+#define CHECK_GT(a, b) CRASH_UNLESS((a) > (b))
+
+} // namespace
+
+using snappy::CompressFile;
+using snappy::UncompressFile;
+using snappy::MeasureFile;
+
+#endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
diff --git a/ics-openvpn-stripped/main/snappy/snappy.cc b/ics-openvpn-stripped/main/snappy/snappy.cc
new file mode 100644
index 00000000..1230321f
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy.cc
@@ -0,0 +1,1119 @@
+// Copyright 2005 Google 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:
+//
+// * 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 Google Inc. 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.
+
+#include "snappy.h"
+#include "snappy-internal.h"
+#include "snappy-sinksource.h"
+
+#include <stdio.h>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+
+namespace snappy {
+
+// Any hash function will produce a valid compressed bitstream, but a good
+// hash function reduces the number of collisions and thus yields better
+// compression for compressible input, and more speed for incompressible
+// input. Of course, it doesn't hurt if the hash function is reasonably fast
+// either, as it gets called a lot.
+static inline uint32 HashBytes(uint32 bytes, int shift) {
+ uint32 kMul = 0x1e35a7bd;
+ return (bytes * kMul) >> shift;
+}
+static inline uint32 Hash(const char* p, int shift) {
+ return HashBytes(UNALIGNED_LOAD32(p), shift);
+}
+
+size_t MaxCompressedLength(size_t source_len) {
+ // Compressed data can be defined as:
+ // compressed := item* literal*
+ // item := literal* copy
+ //
+ // The trailing literal sequence has a space blowup of at most 62/60
+ // since a literal of length 60 needs one tag byte + one extra byte
+ // for length information.
+ //
+ // Item blowup is trickier to measure. Suppose the "copy" op copies
+ // 4 bytes of data. Because of a special check in the encoding code,
+ // we produce a 4-byte copy only if the offset is < 65536. Therefore
+ // the copy op takes 3 bytes to encode, and this type of item leads
+ // to at most the 62/60 blowup for representing literals.
+ //
+ // Suppose the "copy" op copies 5 bytes of data. If the offset is big
+ // enough, it will take 5 bytes to encode the copy op. Therefore the
+ // worst case here is a one-byte literal followed by a five-byte copy.
+ // I.e., 6 bytes of input turn into 7 bytes of "compressed" data.
+ //
+ // This last factor dominates the blowup, so the final estimate is:
+ return 32 + source_len + source_len/6;
+}
+
+enum {
+ LITERAL = 0,
+ COPY_1_BYTE_OFFSET = 1, // 3 bit length + 3 bits of offset in opcode
+ COPY_2_BYTE_OFFSET = 2,
+ COPY_4_BYTE_OFFSET = 3
+};
+
+// Copy "len" bytes from "src" to "op", one byte at a time. Used for
+// handling COPY operations where the input and output regions may
+// overlap. For example, suppose:
+// src == "ab"
+// op == src + 2
+// len == 20
+// After IncrementalCopy(src, op, len), the result will have
+// eleven copies of "ab"
+// ababababababababababab
+// Note that this does not match the semantics of either memcpy()
+// or memmove().
+static inline void IncrementalCopy(const char* src, char* op, int len) {
+ assert(len > 0);
+ do {
+ *op++ = *src++;
+ } while (--len > 0);
+}
+
+// Equivalent to IncrementalCopy except that it can write up to ten extra
+// bytes after the end of the copy, and that it is faster.
+//
+// The main part of this loop is a simple copy of eight bytes at a time until
+// we've copied (at least) the requested amount of bytes. However, if op and
+// src are less than eight bytes apart (indicating a repeating pattern of
+// length < 8), we first need to expand the pattern in order to get the correct
+// results. For instance, if the buffer looks like this, with the eight-byte
+// <src> and <op> patterns marked as intervals:
+//
+// abxxxxxxxxxxxx
+// [------] src
+// [------] op
+//
+// a single eight-byte copy from <src> to <op> will repeat the pattern once,
+// after which we can move <op> two bytes without moving <src>:
+//
+// ababxxxxxxxxxx
+// [------] src
+// [------] op
+//
+// and repeat the exercise until the two no longer overlap.
+//
+// This allows us to do very well in the special case of one single byte
+// repeated many times, without taking a big hit for more general cases.
+//
+// The worst case of extra writing past the end of the match occurs when
+// op - src == 1 and len == 1; the last copy will read from byte positions
+// [0..7] and write to [4..11], whereas it was only supposed to write to
+// position 1. Thus, ten excess bytes.
+
+namespace {
+
+const int kMaxIncrementCopyOverflow = 10;
+
+} // namespace
+
+static inline void IncrementalCopyFastPath(const char* src, char* op, int len) {
+ while (op - src < 8) {
+ UnalignedCopy64(src, op);
+ len -= op - src;
+ op += op - src;
+ }
+ while (len > 0) {
+ UnalignedCopy64(src, op);
+ src += 8;
+ op += 8;
+ len -= 8;
+ }
+}
+
+static inline char* EmitLiteral(char* op,
+ const char* literal,
+ int len,
+ bool allow_fast_path) {
+ int n = len - 1; // Zero-length literals are disallowed
+ if (n < 60) {
+ // Fits in tag byte
+ *op++ = LITERAL | (n << 2);
+
+ // The vast majority of copies are below 16 bytes, for which a
+ // call to memcpy is overkill. This fast path can sometimes
+ // copy up to 15 bytes too much, but that is okay in the
+ // main loop, since we have a bit to go on for both sides:
+ //
+ // - The input will always have kInputMarginBytes = 15 extra
+ // available bytes, as long as we're in the main loop, and
+ // if not, allow_fast_path = false.
+ // - The output will always have 32 spare bytes (see
+ // MaxCompressedLength).
+ if (allow_fast_path && len <= 16) {
+ UnalignedCopy64(literal, op);
+ UnalignedCopy64(literal + 8, op + 8);
+ return op + len;
+ }
+ } else {
+ // Encode in upcoming bytes
+ char* base = op;
+ int count = 0;
+ op++;
+ while (n > 0) {
+ *op++ = n & 0xff;
+ n >>= 8;
+ count++;
+ }
+ assert(count >= 1);
+ assert(count <= 4);
+ *base = LITERAL | ((59+count) << 2);
+ }
+ memcpy(op, literal, len);
+ return op + len;
+}
+
+static inline char* EmitCopyLessThan64(char* op, size_t offset, int len) {
+ assert(len <= 64);
+ assert(len >= 4);
+ assert(offset < 65536);
+
+ if ((len < 12) && (offset < 2048)) {
+ size_t len_minus_4 = len - 4;
+ assert(len_minus_4 < 8); // Must fit in 3 bits
+ *op++ = COPY_1_BYTE_OFFSET + ((len_minus_4) << 2) + ((offset >> 8) << 5);
+ *op++ = offset & 0xff;
+ } else {
+ *op++ = COPY_2_BYTE_OFFSET + ((len-1) << 2);
+ LittleEndian::Store16(op, offset);
+ op += 2;
+ }
+ return op;
+}
+
+static inline char* EmitCopy(char* op, size_t offset, int len) {
+ // Emit 64 byte copies but make sure to keep at least four bytes reserved
+ while (len >= 68) {
+ op = EmitCopyLessThan64(op, offset, 64);
+ len -= 64;
+ }
+
+ // Emit an extra 60 byte copy if have too much data to fit in one copy
+ if (len > 64) {
+ op = EmitCopyLessThan64(op, offset, 60);
+ len -= 60;
+ }
+
+ // Emit remainder
+ op = EmitCopyLessThan64(op, offset, len);
+ return op;
+}
+
+
+bool GetUncompressedLength(const char* start, size_t n, size_t* result) {
+ uint32 v = 0;
+ const char* limit = start + n;
+ if (Varint::Parse32WithLimit(start, limit, &v) != NULL) {
+ *result = v;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+namespace internal {
+uint16* WorkingMemory::GetHashTable(size_t input_size, int* table_size) {
+ // Use smaller hash table when input.size() is smaller, since we
+ // fill the table, incurring O(hash table size) overhead for
+ // compression, and if the input is short, we won't need that
+ // many hash table entries anyway.
+ assert(kMaxHashTableSize >= 256);
+ size_t htsize = 256;
+ while (htsize < kMaxHashTableSize && htsize < input_size) {
+ htsize <<= 1;
+ }
+
+ uint16* table;
+ if (htsize <= ARRAYSIZE(small_table_)) {
+ table = small_table_;
+ } else {
+ if (large_table_ == NULL) {
+ large_table_ = new uint16[kMaxHashTableSize];
+ }
+ table = large_table_;
+ }
+
+ *table_size = htsize;
+ memset(table, 0, htsize * sizeof(*table));
+ return table;
+}
+} // end namespace internal
+
+// For 0 <= offset <= 4, GetUint32AtOffset(GetEightBytesAt(p), offset) will
+// equal UNALIGNED_LOAD32(p + offset). Motivation: On x86-64 hardware we have
+// empirically found that overlapping loads such as
+// UNALIGNED_LOAD32(p) ... UNALIGNED_LOAD32(p+1) ... UNALIGNED_LOAD32(p+2)
+// are slower than UNALIGNED_LOAD64(p) followed by shifts and casts to uint32.
+//
+// We have different versions for 64- and 32-bit; ideally we would avoid the
+// two functions and just inline the UNALIGNED_LOAD64 call into
+// GetUint32AtOffset, but GCC (at least not as of 4.6) is seemingly not clever
+// enough to avoid loading the value multiple times then. For 64-bit, the load
+// is done when GetEightBytesAt() is called, whereas for 32-bit, the load is
+// done at GetUint32AtOffset() time.
+
+#ifdef ARCH_K8
+
+typedef uint64 EightBytesReference;
+
+static inline EightBytesReference GetEightBytesAt(const char* ptr) {
+ return UNALIGNED_LOAD64(ptr);
+}
+
+static inline uint32 GetUint32AtOffset(uint64 v, int offset) {
+ assert(offset >= 0);
+ assert(offset <= 4);
+ return v >> (LittleEndian::IsLittleEndian() ? 8 * offset : 32 - 8 * offset);
+}
+
+#else
+
+typedef const char* EightBytesReference;
+
+static inline EightBytesReference GetEightBytesAt(const char* ptr) {
+ return ptr;
+}
+
+static inline uint32 GetUint32AtOffset(const char* v, int offset) {
+ assert(offset >= 0);
+ assert(offset <= 4);
+ return UNALIGNED_LOAD32(v + offset);
+}
+
+#endif
+
+// Flat array compression that does not emit the "uncompressed length"
+// prefix. Compresses "input" string to the "*op" buffer.
+//
+// REQUIRES: "input" is at most "kBlockSize" bytes long.
+// REQUIRES: "op" points to an array of memory that is at least
+// "MaxCompressedLength(input.size())" in size.
+// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
+// REQUIRES: "table_size" is a power of two
+//
+// Returns an "end" pointer into "op" buffer.
+// "end - op" is the compressed size of "input".
+namespace internal {
+char* CompressFragment(const char* input,
+ size_t input_size,
+ char* op,
+ uint16* table,
+ const int table_size) {
+ // "ip" is the input pointer, and "op" is the output pointer.
+ const char* ip = input;
+ assert(input_size <= kBlockSize);
+ assert((table_size & (table_size - 1)) == 0); // table must be power of two
+ const int shift = 32 - Bits::Log2Floor(table_size);
+ assert(static_cast<int>(kuint32max >> shift) == table_size - 1);
+ const char* ip_end = input + input_size;
+ const char* base_ip = ip;
+ // Bytes in [next_emit, ip) will be emitted as literal bytes. Or
+ // [next_emit, ip_end) after the main loop.
+ const char* next_emit = ip;
+
+ const size_t kInputMarginBytes = 15;
+ if (PREDICT_TRUE(input_size >= kInputMarginBytes)) {
+ const char* ip_limit = input + input_size - kInputMarginBytes;
+
+ for (uint32 next_hash = Hash(++ip, shift); ; ) {
+ assert(next_emit < ip);
+ // The body of this loop calls EmitLiteral once and then EmitCopy one or
+ // more times. (The exception is that when we're close to exhausting
+ // the input we goto emit_remainder.)
+ //
+ // In the first iteration of this loop we're just starting, so
+ // there's nothing to copy, so calling EmitLiteral once is
+ // necessary. And we only start a new iteration when the
+ // current iteration has determined that a call to EmitLiteral will
+ // precede the next call to EmitCopy (if any).
+ //
+ // Step 1: Scan forward in the input looking for a 4-byte-long match.
+ // If we get close to exhausting the input then goto emit_remainder.
+ //
+ // Heuristic match skipping: If 32 bytes are scanned with no matches
+ // found, start looking only at every other byte. If 32 more bytes are
+ // scanned, look at every third byte, etc.. When a match is found,
+ // immediately go back to looking at every byte. This is a small loss
+ // (~5% performance, ~0.1% density) for compressible data due to more
+ // bookkeeping, but for non-compressible data (such as JPEG) it's a huge
+ // win since the compressor quickly "realizes" the data is incompressible
+ // and doesn't bother looking for matches everywhere.
+ //
+ // The "skip" variable keeps track of how many bytes there are since the
+ // last match; dividing it by 32 (ie. right-shifting by five) gives the
+ // number of bytes to move ahead for each iteration.
+ uint32 skip = 32;
+
+ const char* next_ip = ip;
+ const char* candidate;
+ do {
+ ip = next_ip;
+ uint32 hash = next_hash;
+ assert(hash == Hash(ip, shift));
+ uint32 bytes_between_hash_lookups = skip++ >> 5;
+ next_ip = ip + bytes_between_hash_lookups;
+ if (PREDICT_FALSE(next_ip > ip_limit)) {
+ goto emit_remainder;
+ }
+ next_hash = Hash(next_ip, shift);
+ candidate = base_ip + table[hash];
+ assert(candidate >= base_ip);
+ assert(candidate < ip);
+
+ table[hash] = ip - base_ip;
+ } while (PREDICT_TRUE(UNALIGNED_LOAD32(ip) !=
+ UNALIGNED_LOAD32(candidate)));
+
+ // Step 2: A 4-byte match has been found. We'll later see if more
+ // than 4 bytes match. But, prior to the match, input
+ // bytes [next_emit, ip) are unmatched. Emit them as "literal bytes."
+ assert(next_emit + 16 <= ip_end);
+ op = EmitLiteral(op, next_emit, ip - next_emit, true);
+
+ // Step 3: Call EmitCopy, and then see if another EmitCopy could
+ // be our next move. Repeat until we find no match for the
+ // input immediately after what was consumed by the last EmitCopy call.
+ //
+ // If we exit this loop normally then we need to call EmitLiteral next,
+ // though we don't yet know how big the literal will be. We handle that
+ // by proceeding to the next iteration of the main loop. We also can exit
+ // this loop via goto if we get close to exhausting the input.
+ EightBytesReference input_bytes;
+ uint32 candidate_bytes = 0;
+
+ do {
+ // We have a 4-byte match at ip, and no need to emit any
+ // "literal bytes" prior to ip.
+ const char* base = ip;
+ int matched = 4 + FindMatchLength(candidate + 4, ip + 4, ip_end);
+ ip += matched;
+ size_t offset = base - candidate;
+ assert(0 == memcmp(base, candidate, matched));
+ op = EmitCopy(op, offset, matched);
+ // We could immediately start working at ip now, but to improve
+ // compression we first update table[Hash(ip - 1, ...)].
+ const char* insert_tail = ip - 1;
+ next_emit = ip;
+ if (PREDICT_FALSE(ip >= ip_limit)) {
+ goto emit_remainder;
+ }
+ input_bytes = GetEightBytesAt(insert_tail);
+ uint32 prev_hash = HashBytes(GetUint32AtOffset(input_bytes, 0), shift);
+ table[prev_hash] = ip - base_ip - 1;
+ uint32 cur_hash = HashBytes(GetUint32AtOffset(input_bytes, 1), shift);
+ candidate = base_ip + table[cur_hash];
+ candidate_bytes = UNALIGNED_LOAD32(candidate);
+ table[cur_hash] = ip - base_ip;
+ } while (GetUint32AtOffset(input_bytes, 1) == candidate_bytes);
+
+ next_hash = HashBytes(GetUint32AtOffset(input_bytes, 2), shift);
+ ++ip;
+ }
+ }
+
+ emit_remainder:
+ // Emit the remaining bytes as a literal
+ if (next_emit < ip_end) {
+ op = EmitLiteral(op, next_emit, ip_end - next_emit, false);
+ }
+
+ return op;
+}
+} // end namespace internal
+
+// Signature of output types needed by decompression code.
+// The decompression code is templatized on a type that obeys this
+// signature so that we do not pay virtual function call overhead in
+// the middle of a tight decompression loop.
+//
+// class DecompressionWriter {
+// public:
+// // Called before decompression
+// void SetExpectedLength(size_t length);
+//
+// // Called after decompression
+// bool CheckLength() const;
+//
+// // Called repeatedly during decompression
+// bool Append(const char* ip, size_t length);
+// bool AppendFromSelf(uint32 offset, size_t length);
+//
+// // The difference between TryFastAppend and Append is that TryFastAppend
+// // is allowed to read up to <available> bytes from the input buffer,
+// // whereas Append is allowed to read <length>.
+// //
+// // Also, TryFastAppend is allowed to return false, declining the append,
+// // without it being a fatal error -- just "return false" would be
+// // a perfectly legal implementation of TryFastAppend. The intention
+// // is for TryFastAppend to allow a fast path in the common case of
+// // a small append.
+// //
+// // NOTE(user): TryFastAppend must always return decline (return false)
+// // if <length> is 61 or more, as in this case the literal length is not
+// // decoded fully. In practice, this should not be a big problem,
+// // as it is unlikely that one would implement a fast path accepting
+// // this much data.
+// bool TryFastAppend(const char* ip, size_t available, size_t length);
+// };
+
+// -----------------------------------------------------------------------
+// Lookup table for decompression code. Generated by ComputeTable() below.
+// -----------------------------------------------------------------------
+
+// Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits
+static const uint32 wordmask[] = {
+ 0u, 0xffu, 0xffffu, 0xffffffu, 0xffffffffu
+};
+
+// Data stored per entry in lookup table:
+// Range Bits-used Description
+// ------------------------------------
+// 1..64 0..7 Literal/copy length encoded in opcode byte
+// 0..7 8..10 Copy offset encoded in opcode byte / 256
+// 0..4 11..13 Extra bytes after opcode
+//
+// We use eight bits for the length even though 7 would have sufficed
+// because of efficiency reasons:
+// (1) Extracting a byte is faster than a bit-field
+// (2) It properly aligns copy offset so we do not need a <<8
+static const uint16 char_table[256] = {
+ 0x0001, 0x0804, 0x1001, 0x2001, 0x0002, 0x0805, 0x1002, 0x2002,
+ 0x0003, 0x0806, 0x1003, 0x2003, 0x0004, 0x0807, 0x1004, 0x2004,
+ 0x0005, 0x0808, 0x1005, 0x2005, 0x0006, 0x0809, 0x1006, 0x2006,
+ 0x0007, 0x080a, 0x1007, 0x2007, 0x0008, 0x080b, 0x1008, 0x2008,
+ 0x0009, 0x0904, 0x1009, 0x2009, 0x000a, 0x0905, 0x100a, 0x200a,
+ 0x000b, 0x0906, 0x100b, 0x200b, 0x000c, 0x0907, 0x100c, 0x200c,
+ 0x000d, 0x0908, 0x100d, 0x200d, 0x000e, 0x0909, 0x100e, 0x200e,
+ 0x000f, 0x090a, 0x100f, 0x200f, 0x0010, 0x090b, 0x1010, 0x2010,
+ 0x0011, 0x0a04, 0x1011, 0x2011, 0x0012, 0x0a05, 0x1012, 0x2012,
+ 0x0013, 0x0a06, 0x1013, 0x2013, 0x0014, 0x0a07, 0x1014, 0x2014,
+ 0x0015, 0x0a08, 0x1015, 0x2015, 0x0016, 0x0a09, 0x1016, 0x2016,
+ 0x0017, 0x0a0a, 0x1017, 0x2017, 0x0018, 0x0a0b, 0x1018, 0x2018,
+ 0x0019, 0x0b04, 0x1019, 0x2019, 0x001a, 0x0b05, 0x101a, 0x201a,
+ 0x001b, 0x0b06, 0x101b, 0x201b, 0x001c, 0x0b07, 0x101c, 0x201c,
+ 0x001d, 0x0b08, 0x101d, 0x201d, 0x001e, 0x0b09, 0x101e, 0x201e,
+ 0x001f, 0x0b0a, 0x101f, 0x201f, 0x0020, 0x0b0b, 0x1020, 0x2020,
+ 0x0021, 0x0c04, 0x1021, 0x2021, 0x0022, 0x0c05, 0x1022, 0x2022,
+ 0x0023, 0x0c06, 0x1023, 0x2023, 0x0024, 0x0c07, 0x1024, 0x2024,
+ 0x0025, 0x0c08, 0x1025, 0x2025, 0x0026, 0x0c09, 0x1026, 0x2026,
+ 0x0027, 0x0c0a, 0x1027, 0x2027, 0x0028, 0x0c0b, 0x1028, 0x2028,
+ 0x0029, 0x0d04, 0x1029, 0x2029, 0x002a, 0x0d05, 0x102a, 0x202a,
+ 0x002b, 0x0d06, 0x102b, 0x202b, 0x002c, 0x0d07, 0x102c, 0x202c,
+ 0x002d, 0x0d08, 0x102d, 0x202d, 0x002e, 0x0d09, 0x102e, 0x202e,
+ 0x002f, 0x0d0a, 0x102f, 0x202f, 0x0030, 0x0d0b, 0x1030, 0x2030,
+ 0x0031, 0x0e04, 0x1031, 0x2031, 0x0032, 0x0e05, 0x1032, 0x2032,
+ 0x0033, 0x0e06, 0x1033, 0x2033, 0x0034, 0x0e07, 0x1034, 0x2034,
+ 0x0035, 0x0e08, 0x1035, 0x2035, 0x0036, 0x0e09, 0x1036, 0x2036,
+ 0x0037, 0x0e0a, 0x1037, 0x2037, 0x0038, 0x0e0b, 0x1038, 0x2038,
+ 0x0039, 0x0f04, 0x1039, 0x2039, 0x003a, 0x0f05, 0x103a, 0x203a,
+ 0x003b, 0x0f06, 0x103b, 0x203b, 0x003c, 0x0f07, 0x103c, 0x203c,
+ 0x0801, 0x0f08, 0x103d, 0x203d, 0x1001, 0x0f09, 0x103e, 0x203e,
+ 0x1801, 0x0f0a, 0x103f, 0x203f, 0x2001, 0x0f0b, 0x1040, 0x2040
+};
+
+// In debug mode, allow optional computation of the table at startup.
+// Also, check that the decompression table is correct.
+#ifndef NDEBUG
+DEFINE_bool(snappy_dump_decompression_table, false,
+ "If true, we print the decompression table at startup.");
+
+static uint16 MakeEntry(unsigned int extra,
+ unsigned int len,
+ unsigned int copy_offset) {
+ // Check that all of the fields fit within the allocated space
+ assert(extra == (extra & 0x7)); // At most 3 bits
+ assert(copy_offset == (copy_offset & 0x7)); // At most 3 bits
+ assert(len == (len & 0x7f)); // At most 7 bits
+ return len | (copy_offset << 8) | (extra << 11);
+}
+
+static void ComputeTable() {
+ uint16 dst[256];
+
+ // Place invalid entries in all places to detect missing initialization
+ int assigned = 0;
+ for (int i = 0; i < 256; i++) {
+ dst[i] = 0xffff;
+ }
+
+ // Small LITERAL entries. We store (len-1) in the top 6 bits.
+ for (unsigned int len = 1; len <= 60; len++) {
+ dst[LITERAL | ((len-1) << 2)] = MakeEntry(0, len, 0);
+ assigned++;
+ }
+
+ // Large LITERAL entries. We use 60..63 in the high 6 bits to
+ // encode the number of bytes of length info that follow the opcode.
+ for (unsigned int extra_bytes = 1; extra_bytes <= 4; extra_bytes++) {
+ // We set the length field in the lookup table to 1 because extra
+ // bytes encode len-1.
+ dst[LITERAL | ((extra_bytes+59) << 2)] = MakeEntry(extra_bytes, 1, 0);
+ assigned++;
+ }
+
+ // COPY_1_BYTE_OFFSET.
+ //
+ // The tag byte in the compressed data stores len-4 in 3 bits, and
+ // offset/256 in 5 bits. offset%256 is stored in the next byte.
+ //
+ // This format is used for length in range [4..11] and offset in
+ // range [0..2047]
+ for (unsigned int len = 4; len < 12; len++) {
+ for (unsigned int offset = 0; offset < 2048; offset += 256) {
+ dst[COPY_1_BYTE_OFFSET | ((len-4)<<2) | ((offset>>8)<<5)] =
+ MakeEntry(1, len, offset>>8);
+ assigned++;
+ }
+ }
+
+ // COPY_2_BYTE_OFFSET.
+ // Tag contains len-1 in top 6 bits, and offset in next two bytes.
+ for (unsigned int len = 1; len <= 64; len++) {
+ dst[COPY_2_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(2, len, 0);
+ assigned++;
+ }
+
+ // COPY_4_BYTE_OFFSET.
+ // Tag contents len-1 in top 6 bits, and offset in next four bytes.
+ for (unsigned int len = 1; len <= 64; len++) {
+ dst[COPY_4_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(4, len, 0);
+ assigned++;
+ }
+
+ // Check that each entry was initialized exactly once.
+ if (assigned != 256) {
+ fprintf(stderr, "ComputeTable: assigned only %d of 256\n", assigned);
+ abort();
+ }
+ for (int i = 0; i < 256; i++) {
+ if (dst[i] == 0xffff) {
+ fprintf(stderr, "ComputeTable: did not assign byte %d\n", i);
+ abort();
+ }
+ }
+
+ if (FLAGS_snappy_dump_decompression_table) {
+ printf("static const uint16 char_table[256] = {\n ");
+ for (int i = 0; i < 256; i++) {
+ printf("0x%04x%s",
+ dst[i],
+ ((i == 255) ? "\n" : (((i%8) == 7) ? ",\n " : ", ")));
+ }
+ printf("};\n");
+ }
+
+ // Check that computed table matched recorded table
+ for (int i = 0; i < 256; i++) {
+ if (dst[i] != char_table[i]) {
+ fprintf(stderr, "ComputeTable: byte %d: computed (%x), expect (%x)\n",
+ i, static_cast<int>(dst[i]), static_cast<int>(char_table[i]));
+ abort();
+ }
+ }
+}
+#endif /* !NDEBUG */
+
+// Helper class for decompression
+class SnappyDecompressor {
+ private:
+ Source* reader_; // Underlying source of bytes to decompress
+ const char* ip_; // Points to next buffered byte
+ const char* ip_limit_; // Points just past buffered bytes
+ uint32 peeked_; // Bytes peeked from reader (need to skip)
+ bool eof_; // Hit end of input without an error?
+ char scratch_[5]; // Temporary buffer for PeekFast() boundaries
+
+ // Ensure that all of the tag metadata for the next tag is available
+ // in [ip_..ip_limit_-1]. Also ensures that [ip,ip+4] is readable even
+ // if (ip_limit_ - ip_ < 5).
+ //
+ // Returns true on success, false on error or end of input.
+ bool RefillTag();
+
+ public:
+ explicit SnappyDecompressor(Source* reader)
+ : reader_(reader),
+ ip_(NULL),
+ ip_limit_(NULL),
+ peeked_(0),
+ eof_(false) {
+ }
+
+ ~SnappyDecompressor() {
+ // Advance past any bytes we peeked at from the reader
+ reader_->Skip(peeked_);
+ }
+
+ // Returns true iff we have hit the end of the input without an error.
+ bool eof() const {
+ return eof_;
+ }
+
+ // Read the uncompressed length stored at the start of the compressed data.
+ // On succcess, stores the length in *result and returns true.
+ // On failure, returns false.
+ bool ReadUncompressedLength(uint32* result) {
+ assert(ip_ == NULL); // Must not have read anything yet
+ // Length is encoded in 1..5 bytes
+ *result = 0;
+ uint32 shift = 0;
+ while (true) {
+ if (shift >= 32) return false;
+ size_t n;
+ const char* ip = reader_->Peek(&n);
+ if (n == 0) return false;
+ const unsigned char c = *(reinterpret_cast<const unsigned char*>(ip));
+ reader_->Skip(1);
+ *result |= static_cast<uint32>(c & 0x7f) << shift;
+ if (c < 128) {
+ break;
+ }
+ shift += 7;
+ }
+ return true;
+ }
+
+ // Process the next item found in the input.
+ // Returns true if successful, false on error or end of input.
+ template <class Writer>
+ void DecompressAllTags(Writer* writer) {
+ const char* ip = ip_;
+
+ // We could have put this refill fragment only at the beginning of the loop.
+ // However, duplicating it at the end of each branch gives the compiler more
+ // scope to optimize the <ip_limit_ - ip> expression based on the local
+ // context, which overall increases speed.
+ #define MAYBE_REFILL() \
+ if (ip_limit_ - ip < 5) { \
+ ip_ = ip; \
+ if (!RefillTag()) return; \
+ ip = ip_; \
+ }
+
+ MAYBE_REFILL();
+ for ( ;; ) {
+ const unsigned char c = *(reinterpret_cast<const unsigned char*>(ip++));
+
+ if ((c & 0x3) == LITERAL) {
+ size_t literal_length = (c >> 2) + 1u;
+ if (writer->TryFastAppend(ip, ip_limit_ - ip, literal_length)) {
+ assert(literal_length < 61);
+ ip += literal_length;
+ MAYBE_REFILL();
+ continue;
+ }
+ if (PREDICT_FALSE(literal_length >= 61)) {
+ // Long literal.
+ const size_t literal_length_length = literal_length - 60;
+ literal_length =
+ (LittleEndian::Load32(ip) & wordmask[literal_length_length]) + 1;
+ ip += literal_length_length;
+ }
+
+ size_t avail = ip_limit_ - ip;
+ while (avail < literal_length) {
+ if (!writer->Append(ip, avail)) return;
+ literal_length -= avail;
+ reader_->Skip(peeked_);
+ size_t n;
+ ip = reader_->Peek(&n);
+ avail = n;
+ peeked_ = avail;
+ if (avail == 0) return; // Premature end of input
+ ip_limit_ = ip + avail;
+ }
+ if (!writer->Append(ip, literal_length)) {
+ return;
+ }
+ ip += literal_length;
+ MAYBE_REFILL();
+ } else {
+ const uint32 entry = char_table[c];
+ const uint32 trailer = LittleEndian::Load32(ip) & wordmask[entry >> 11];
+ const uint32 length = entry & 0xff;
+ ip += entry >> 11;
+
+ // copy_offset/256 is encoded in bits 8..10. By just fetching
+ // those bits, we get copy_offset (since the bit-field starts at
+ // bit 8).
+ const uint32 copy_offset = entry & 0x700;
+ if (!writer->AppendFromSelf(copy_offset + trailer, length)) {
+ return;
+ }
+ MAYBE_REFILL();
+ }
+ }
+
+#undef MAYBE_REFILL
+ }
+};
+
+bool SnappyDecompressor::RefillTag() {
+ const char* ip = ip_;
+ if (ip == ip_limit_) {
+ // Fetch a new fragment from the reader
+ reader_->Skip(peeked_); // All peeked bytes are used up
+ size_t n;
+ ip = reader_->Peek(&n);
+ peeked_ = n;
+ if (n == 0) {
+ eof_ = true;
+ return false;
+ }
+ ip_limit_ = ip + n;
+ }
+
+ // Read the tag character
+ assert(ip < ip_limit_);
+ const unsigned char c = *(reinterpret_cast<const unsigned char*>(ip));
+ const uint32 entry = char_table[c];
+ const uint32 needed = (entry >> 11) + 1; // +1 byte for 'c'
+ assert(needed <= sizeof(scratch_));
+
+ // Read more bytes from reader if needed
+ uint32 nbuf = ip_limit_ - ip;
+ if (nbuf < needed) {
+ // Stitch together bytes from ip and reader to form the word
+ // contents. We store the needed bytes in "scratch_". They
+ // will be consumed immediately by the caller since we do not
+ // read more than we need.
+ memmove(scratch_, ip, nbuf);
+ reader_->Skip(peeked_); // All peeked bytes are used up
+ peeked_ = 0;
+ while (nbuf < needed) {
+ size_t length;
+ const char* src = reader_->Peek(&length);
+ if (length == 0) return false;
+ uint32 to_add = min<uint32>(needed - nbuf, length);
+ memcpy(scratch_ + nbuf, src, to_add);
+ nbuf += to_add;
+ reader_->Skip(to_add);
+ }
+ assert(nbuf == needed);
+ ip_ = scratch_;
+ ip_limit_ = scratch_ + needed;
+ } else if (nbuf < 5) {
+ // Have enough bytes, but move into scratch_ so that we do not
+ // read past end of input
+ memmove(scratch_, ip, nbuf);
+ reader_->Skip(peeked_); // All peeked bytes are used up
+ peeked_ = 0;
+ ip_ = scratch_;
+ ip_limit_ = scratch_ + nbuf;
+ } else {
+ // Pass pointer to buffer returned by reader_.
+ ip_ = ip;
+ }
+ return true;
+}
+
+template <typename Writer>
+static bool InternalUncompress(Source* r,
+ Writer* writer,
+ uint32 max_len) {
+ // Read the uncompressed length from the front of the compressed input
+ SnappyDecompressor decompressor(r);
+ uint32 uncompressed_len = 0;
+ if (!decompressor.ReadUncompressedLength(&uncompressed_len)) return false;
+ return InternalUncompressAllTags(
+ &decompressor, writer, uncompressed_len, max_len);
+}
+
+template <typename Writer>
+static bool InternalUncompressAllTags(SnappyDecompressor* decompressor,
+ Writer* writer,
+ uint32 uncompressed_len,
+ uint32 max_len) {
+ // Protect against possible DoS attack
+ if (static_cast<uint64>(uncompressed_len) > max_len) {
+ return false;
+ }
+
+ writer->SetExpectedLength(uncompressed_len);
+
+ // Process the entire input
+ decompressor->DecompressAllTags(writer);
+ return (decompressor->eof() && writer->CheckLength());
+}
+
+bool GetUncompressedLength(Source* source, uint32* result) {
+ SnappyDecompressor decompressor(source);
+ return decompressor.ReadUncompressedLength(result);
+}
+
+size_t Compress(Source* reader, Sink* writer) {
+ size_t written = 0;
+ size_t N = reader->Available();
+ char ulength[Varint::kMax32];
+ char* p = Varint::Encode32(ulength, N);
+ writer->Append(ulength, p-ulength);
+ written += (p - ulength);
+
+ internal::WorkingMemory wmem;
+ char* scratch = NULL;
+ char* scratch_output = NULL;
+
+ while (N > 0) {
+ // Get next block to compress (without copying if possible)
+ size_t fragment_size;
+ const char* fragment = reader->Peek(&fragment_size);
+ assert(fragment_size != 0); // premature end of input
+ const size_t num_to_read = min(N, kBlockSize);
+ size_t bytes_read = fragment_size;
+
+ size_t pending_advance = 0;
+ if (bytes_read >= num_to_read) {
+ // Buffer returned by reader is large enough
+ pending_advance = num_to_read;
+ fragment_size = num_to_read;
+ } else {
+ // Read into scratch buffer
+ if (scratch == NULL) {
+ // If this is the last iteration, we want to allocate N bytes
+ // of space, otherwise the max possible kBlockSize space.
+ // num_to_read contains exactly the correct value
+ scratch = new char[num_to_read];
+ }
+ memcpy(scratch, fragment, bytes_read);
+ reader->Skip(bytes_read);
+
+ while (bytes_read < num_to_read) {
+ fragment = reader->Peek(&fragment_size);
+ size_t n = min<size_t>(fragment_size, num_to_read - bytes_read);
+ memcpy(scratch + bytes_read, fragment, n);
+ bytes_read += n;
+ reader->Skip(n);
+ }
+ assert(bytes_read == num_to_read);
+ fragment = scratch;
+ fragment_size = num_to_read;
+ }
+ assert(fragment_size == num_to_read);
+
+ // Get encoding table for compression
+ int table_size;
+ uint16* table = wmem.GetHashTable(num_to_read, &table_size);
+
+ // Compress input_fragment and append to dest
+ const int max_output = MaxCompressedLength(num_to_read);
+
+ // Need a scratch buffer for the output, in case the byte sink doesn't
+ // have room for us directly.
+ if (scratch_output == NULL) {
+ scratch_output = new char[max_output];
+ } else {
+ // Since we encode kBlockSize regions followed by a region
+ // which is <= kBlockSize in length, a previously allocated
+ // scratch_output[] region is big enough for this iteration.
+ }
+ char* dest = writer->GetAppendBuffer(max_output, scratch_output);
+ char* end = internal::CompressFragment(fragment, fragment_size,
+ dest, table, table_size);
+ writer->Append(dest, end - dest);
+ written += (end - dest);
+
+ N -= num_to_read;
+ reader->Skip(pending_advance);
+ }
+
+ delete[] scratch;
+ delete[] scratch_output;
+
+ return written;
+}
+
+// -----------------------------------------------------------------------
+// Flat array interfaces
+// -----------------------------------------------------------------------
+
+// A type that writes to a flat array.
+// Note that this is not a "ByteSink", but a type that matches the
+// Writer template argument to SnappyDecompressor::DecompressAllTags().
+class SnappyArrayWriter {
+ private:
+ char* base_;
+ char* op_;
+ char* op_limit_;
+
+ public:
+ inline explicit SnappyArrayWriter(char* dst)
+ : base_(dst),
+ op_(dst) {
+ }
+
+ inline void SetExpectedLength(size_t len) {
+ op_limit_ = op_ + len;
+ }
+
+ inline bool CheckLength() const {
+ return op_ == op_limit_;
+ }
+
+ inline bool Append(const char* ip, size_t len) {
+ char* op = op_;
+ const size_t space_left = op_limit_ - op;
+ if (space_left < len) {
+ return false;
+ }
+ memcpy(op, ip, len);
+ op_ = op + len;
+ return true;
+ }
+
+ inline bool TryFastAppend(const char* ip, size_t available, size_t len) {
+ char* op = op_;
+ const size_t space_left = op_limit_ - op;
+ if (len <= 16 && available >= 16 && space_left >= 16) {
+ // Fast path, used for the majority (about 95%) of invocations.
+ UnalignedCopy64(ip, op);
+ UnalignedCopy64(ip + 8, op + 8);
+ op_ = op + len;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ inline bool AppendFromSelf(size_t offset, size_t len) {
+ char* op = op_;
+ const size_t space_left = op_limit_ - op;
+
+ if (op - base_ <= offset - 1u) { // -1u catches offset==0
+ return false;
+ }
+ if (len <= 16 && offset >= 8 && space_left >= 16) {
+ // Fast path, used for the majority (70-80%) of dynamic invocations.
+ UnalignedCopy64(op - offset, op);
+ UnalignedCopy64(op - offset + 8, op + 8);
+ } else {
+ if (space_left >= len + kMaxIncrementCopyOverflow) {
+ IncrementalCopyFastPath(op - offset, op, len);
+ } else {
+ if (space_left < len) {
+ return false;
+ }
+ IncrementalCopy(op - offset, op, len);
+ }
+ }
+
+ op_ = op + len;
+ return true;
+ }
+};
+
+bool RawUncompress(const char* compressed, size_t n, char* uncompressed) {
+ ByteArraySource reader(compressed, n);
+ return RawUncompress(&reader, uncompressed);
+}
+
+bool RawUncompress(Source* compressed, char* uncompressed) {
+ SnappyArrayWriter output(uncompressed);
+ return InternalUncompress(compressed, &output, kuint32max);
+}
+
+bool Uncompress(const char* compressed, size_t n, string* uncompressed) {
+ size_t ulength;
+ if (!GetUncompressedLength(compressed, n, &ulength)) {
+ return false;
+ }
+ // Protect against possible DoS attack
+ if ((static_cast<uint64>(ulength) + uncompressed->size()) >
+ uncompressed->max_size()) {
+ return false;
+ }
+ STLStringResizeUninitialized(uncompressed, ulength);
+ return RawUncompress(compressed, n, string_as_array(uncompressed));
+}
+
+
+// A Writer that drops everything on the floor and just does validation
+class SnappyDecompressionValidator {
+ private:
+ size_t expected_;
+ size_t produced_;
+
+ public:
+ inline SnappyDecompressionValidator() : produced_(0) { }
+ inline void SetExpectedLength(size_t len) {
+ expected_ = len;
+ }
+ inline bool CheckLength() const {
+ return expected_ == produced_;
+ }
+ inline bool Append(const char* ip, size_t len) {
+ produced_ += len;
+ return produced_ <= expected_;
+ }
+ inline bool TryFastAppend(const char* ip, size_t available, size_t length) {
+ return false;
+ }
+ inline bool AppendFromSelf(size_t offset, size_t len) {
+ if (produced_ <= offset - 1u) return false; // -1u catches offset==0
+ produced_ += len;
+ return produced_ <= expected_;
+ }
+};
+
+bool IsValidCompressedBuffer(const char* compressed, size_t n) {
+ ByteArraySource reader(compressed, n);
+ SnappyDecompressionValidator writer;
+ return InternalUncompress(&reader, &writer, kuint32max);
+}
+
+void RawCompress(const char* input,
+ size_t input_length,
+ char* compressed,
+ size_t* compressed_length) {
+ ByteArraySource reader(input, input_length);
+ UncheckedByteArraySink writer(compressed);
+ Compress(&reader, &writer);
+
+ // Compute how many bytes were added
+ *compressed_length = (writer.CurrentDestination() - compressed);
+}
+
+size_t Compress(const char* input, size_t input_length, string* compressed) {
+ // Pre-grow the buffer to the max length of the compressed output
+ compressed->resize(MaxCompressedLength(input_length));
+
+ size_t compressed_length;
+ RawCompress(input, input_length, string_as_array(compressed),
+ &compressed_length);
+ compressed->resize(compressed_length);
+ return compressed_length;
+}
+
+
+} // end namespace snappy
+
diff --git a/ics-openvpn-stripped/main/snappy/snappy.h b/ics-openvpn-stripped/main/snappy/snappy.h
new file mode 100644
index 00000000..03ef6ce5
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy.h
@@ -0,0 +1,163 @@
+// Copyright 2005 and onwards Google Inc.
+//
+// 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 Google Inc. 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.
+//
+// A light-weight compression algorithm. It is designed for speed of
+// compression and decompression, rather than for the utmost in space
+// savings.
+//
+// For getting better compression ratios when you are compressing data
+// with long repeated sequences or compressing data that is similar to
+// other data, while still compressing fast, you might look at first
+// using BMDiff and then compressing the output of BMDiff with
+// Snappy.
+
+#ifndef UTIL_SNAPPY_SNAPPY_H__
+#define UTIL_SNAPPY_SNAPPY_H__
+
+#include <stddef.h>
+#include <string>
+
+#include "snappy-stubs-public.h"
+
+namespace snappy {
+ class Source;
+ class Sink;
+
+ // ------------------------------------------------------------------------
+ // Generic compression/decompression routines.
+ // ------------------------------------------------------------------------
+
+ // Compress the bytes read from "*source" and append to "*sink". Return the
+ // number of bytes written.
+ size_t Compress(Source* source, Sink* sink);
+
+ // Find the uncompressed length of the given stream, as given by the header.
+ // Note that the true length could deviate from this; the stream could e.g.
+ // be truncated.
+ //
+ // Also note that this leaves "*source" in a state that is unsuitable for
+ // further operations, such as RawUncompress(). You will need to rewind
+ // or recreate the source yourself before attempting any further calls.
+ bool GetUncompressedLength(Source* source, uint32* result);
+
+ // ------------------------------------------------------------------------
+ // Higher-level string based routines (should be sufficient for most users)
+ // ------------------------------------------------------------------------
+
+ // Sets "*output" to the compressed version of "input[0,input_length-1]".
+ // Original contents of *output are lost.
+ //
+ // REQUIRES: "input[]" is not an alias of "*output".
+ size_t Compress(const char* input, size_t input_length, string* output);
+
+ // Decompresses "compressed[0,compressed_length-1]" to "*uncompressed".
+ // Original contents of "*uncompressed" are lost.
+ //
+ // REQUIRES: "compressed[]" is not an alias of "*uncompressed".
+ //
+ // returns false if the message is corrupted and could not be decompressed
+ bool Uncompress(const char* compressed, size_t compressed_length,
+ string* uncompressed);
+
+
+ // ------------------------------------------------------------------------
+ // Lower-level character array based routines. May be useful for
+ // efficiency reasons in certain circumstances.
+ // ------------------------------------------------------------------------
+
+ // REQUIRES: "compressed" must point to an area of memory that is at
+ // least "MaxCompressedLength(input_length)" bytes in length.
+ //
+ // Takes the data stored in "input[0..input_length]" and stores
+ // it in the array pointed to by "compressed".
+ //
+ // "*compressed_length" is set to the length of the compressed output.
+ //
+ // Example:
+ // char* output = new char[snappy::MaxCompressedLength(input_length)];
+ // size_t output_length;
+ // RawCompress(input, input_length, output, &output_length);
+ // ... Process(output, output_length) ...
+ // delete [] output;
+ void RawCompress(const char* input,
+ size_t input_length,
+ char* compressed,
+ size_t* compressed_length);
+
+ // Given data in "compressed[0..compressed_length-1]" generated by
+ // calling the Snappy::Compress routine, this routine
+ // stores the uncompressed data to
+ // uncompressed[0..GetUncompressedLength(compressed)-1]
+ // returns false if the message is corrupted and could not be decrypted
+ bool RawUncompress(const char* compressed, size_t compressed_length,
+ char* uncompressed);
+
+ // Given data from the byte source 'compressed' generated by calling
+ // the Snappy::Compress routine, this routine stores the uncompressed
+ // data to
+ // uncompressed[0..GetUncompressedLength(compressed,compressed_length)-1]
+ // returns false if the message is corrupted and could not be decrypted
+ bool RawUncompress(Source* compressed, char* uncompressed);
+
+ // Returns the maximal size of the compressed representation of
+ // input data that is "source_bytes" bytes in length;
+ size_t MaxCompressedLength(size_t source_bytes);
+
+ // REQUIRES: "compressed[]" was produced by RawCompress() or Compress()
+ // Returns true and stores the length of the uncompressed data in
+ // *result normally. Returns false on parsing error.
+ // This operation takes O(1) time.
+ bool GetUncompressedLength(const char* compressed, size_t compressed_length,
+ size_t* result);
+
+ // Returns true iff the contents of "compressed[]" can be uncompressed
+ // successfully. Does not return the uncompressed data. Takes
+ // time proportional to compressed_length, but is usually at least
+ // a factor of four faster than actual decompression.
+ bool IsValidCompressedBuffer(const char* compressed,
+ size_t compressed_length);
+
+ // The size of a compression block. Note that many parts of the compression
+ // code assumes that kBlockSize <= 65536; in particular, the hash table
+ // can only store 16-bit offsets, and EmitCopy() also assumes the offset
+ // is 65535 bytes or less. Note also that if you change this, it will
+ // affect the framing format (see framing_format.txt).
+ //
+ // Note that there might be older data around that is compressed with larger
+ // block sizes, so the decompression code should not rely on the
+ // non-existence of long backreferences.
+ static const int kBlockLog = 16;
+ static const size_t kBlockSize = 1 << kBlockLog;
+
+ static const int kMaxHashTableBits = 14;
+ static const size_t kMaxHashTableSize = 1 << kMaxHashTableBits;
+
+} // end namespace snappy
+
+
+#endif // UTIL_SNAPPY_SNAPPY_H__
diff --git a/ics-openvpn-stripped/main/snappy/snappy_unittest.cc b/ics-openvpn-stripped/main/snappy/snappy_unittest.cc
new file mode 100644
index 00000000..59c108f4
--- /dev/null
+++ b/ics-openvpn-stripped/main/snappy/snappy_unittest.cc
@@ -0,0 +1,1164 @@
+// Copyright 2005 and onwards Google Inc.
+//
+// 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 Google Inc. 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.
+
+#include <math.h>
+#include <stdlib.h>
+
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "snappy.h"
+#include "snappy-internal.h"
+#include "snappy-test.h"
+#include "snappy-sinksource.h"
+
+DEFINE_int32(start_len, -1,
+ "Starting prefix size for testing (-1: just full file contents)");
+DEFINE_int32(end_len, -1,
+ "Starting prefix size for testing (-1: just full file contents)");
+DEFINE_int32(bytes, 10485760,
+ "How many bytes to compress/uncompress per file for timing");
+
+DEFINE_bool(zlib, false,
+ "Run zlib compression (http://www.zlib.net)");
+DEFINE_bool(lzo, false,
+ "Run LZO compression (http://www.oberhumer.com/opensource/lzo/)");
+DEFINE_bool(quicklz, false,
+ "Run quickLZ compression (http://www.quicklz.com/)");
+DEFINE_bool(liblzf, false,
+ "Run libLZF compression "
+ "(http://www.goof.com/pcg/marc/liblzf.html)");
+DEFINE_bool(fastlz, false,
+ "Run FastLZ compression (http://www.fastlz.org/");
+DEFINE_bool(snappy, true, "Run snappy compression");
+
+
+DEFINE_bool(write_compressed, false,
+ "Write compressed versions of each file to <file>.comp");
+DEFINE_bool(write_uncompressed, false,
+ "Write uncompressed versions of each file to <file>.uncomp");
+
+namespace snappy {
+
+
+#ifdef HAVE_FUNC_MMAP
+
+// To test against code that reads beyond its input, this class copies a
+// string to a newly allocated group of pages, the last of which
+// is made unreadable via mprotect. Note that we need to allocate the
+// memory with mmap(), as POSIX allows mprotect() only on memory allocated
+// with mmap(), and some malloc/posix_memalign implementations expect to
+// be able to read previously allocated memory while doing heap allocations.
+class DataEndingAtUnreadablePage {
+ public:
+ explicit DataEndingAtUnreadablePage(const string& s) {
+ const size_t page_size = getpagesize();
+ const size_t size = s.size();
+ // Round up space for string to a multiple of page_size.
+ size_t space_for_string = (size + page_size - 1) & ~(page_size - 1);
+ alloc_size_ = space_for_string + page_size;
+ mem_ = mmap(NULL, alloc_size_,
+ PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ CHECK_NE(MAP_FAILED, mem_);
+ protected_page_ = reinterpret_cast<char*>(mem_) + space_for_string;
+ char* dst = protected_page_ - size;
+ memcpy(dst, s.data(), size);
+ data_ = dst;
+ size_ = size;
+ // Make guard page unreadable.
+ CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_NONE));
+ }
+
+ ~DataEndingAtUnreadablePage() {
+ // Undo the mprotect.
+ CHECK_EQ(0, mprotect(protected_page_, getpagesize(), PROT_READ|PROT_WRITE));
+ CHECK_EQ(0, munmap(mem_, alloc_size_));
+ }
+
+ const char* data() const { return data_; }
+ size_t size() const { return size_; }
+
+ private:
+ size_t alloc_size_;
+ void* mem_;
+ char* protected_page_;
+ const char* data_;
+ size_t size_;
+};
+
+#else // HAVE_FUNC_MMAP
+
+// Fallback for systems without mmap.
+typedef string DataEndingAtUnreadablePage;
+
+#endif
+
+enum CompressorType {
+ ZLIB, LZO, LIBLZF, QUICKLZ, FASTLZ, SNAPPY
+};
+
+const char* names[] = {
+ "ZLIB", "LZO", "LIBLZF", "QUICKLZ", "FASTLZ", "SNAPPY"
+};
+
+static size_t MinimumRequiredOutputSpace(size_t input_size,
+ CompressorType comp) {
+ switch (comp) {
+#ifdef ZLIB_VERSION
+ case ZLIB:
+ return ZLib::MinCompressbufSize(input_size);
+#endif // ZLIB_VERSION
+
+#ifdef LZO_VERSION
+ case LZO:
+ return input_size + input_size/64 + 16 + 3;
+#endif // LZO_VERSION
+
+#ifdef LZF_VERSION
+ case LIBLZF:
+ return input_size;
+#endif // LZF_VERSION
+
+#ifdef QLZ_VERSION_MAJOR
+ case QUICKLZ:
+ return input_size + 36000; // 36000 is used for scratch.
+#endif // QLZ_VERSION_MAJOR
+
+#ifdef FASTLZ_VERSION
+ case FASTLZ:
+ return max(static_cast<int>(ceil(input_size * 1.05)), 66);
+#endif // FASTLZ_VERSION
+
+ case SNAPPY:
+ return snappy::MaxCompressedLength(input_size);
+
+ default:
+ LOG(FATAL) << "Unknown compression type number " << comp;
+ }
+}
+
+// Returns true if we successfully compressed, false otherwise.
+//
+// If compressed_is_preallocated is set, do not resize the compressed buffer.
+// This is typically what you want for a benchmark, in order to not spend
+// time in the memory allocator. If you do set this flag, however,
+// "compressed" must be preinitialized to at least MinCompressbufSize(comp)
+// number of bytes, and may contain junk bytes at the end after return.
+static bool Compress(const char* input, size_t input_size, CompressorType comp,
+ string* compressed, bool compressed_is_preallocated) {
+ if (!compressed_is_preallocated) {
+ compressed->resize(MinimumRequiredOutputSpace(input_size, comp));
+ }
+
+ switch (comp) {
+#ifdef ZLIB_VERSION
+ case ZLIB: {
+ ZLib zlib;
+ uLongf destlen = compressed->size();
+ int ret = zlib.Compress(
+ reinterpret_cast<Bytef*>(string_as_array(compressed)),
+ &destlen,
+ reinterpret_cast<const Bytef*>(input),
+ input_size);
+ CHECK_EQ(Z_OK, ret);
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ return true;
+ }
+#endif // ZLIB_VERSION
+
+#ifdef LZO_VERSION
+ case LZO: {
+ unsigned char* mem = new unsigned char[LZO1X_1_15_MEM_COMPRESS];
+ lzo_uint destlen;
+ int ret = lzo1x_1_15_compress(
+ reinterpret_cast<const uint8*>(input),
+ input_size,
+ reinterpret_cast<uint8*>(string_as_array(compressed)),
+ &destlen,
+ mem);
+ CHECK_EQ(LZO_E_OK, ret);
+ delete[] mem;
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ break;
+ }
+#endif // LZO_VERSION
+
+#ifdef LZF_VERSION
+ case LIBLZF: {
+ int destlen = lzf_compress(input,
+ input_size,
+ string_as_array(compressed),
+ input_size);
+ if (destlen == 0) {
+ // lzf *can* cause lots of blowup when compressing, so they
+ // recommend to limit outsize to insize, and just not compress
+ // if it's bigger. Ideally, we'd just swap input and output.
+ compressed->assign(input, input_size);
+ destlen = input_size;
+ }
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ break;
+ }
+#endif // LZF_VERSION
+
+#ifdef QLZ_VERSION_MAJOR
+ case QUICKLZ: {
+ qlz_state_compress *state_compress = new qlz_state_compress;
+ int destlen = qlz_compress(input,
+ string_as_array(compressed),
+ input_size,
+ state_compress);
+ delete state_compress;
+ CHECK_NE(0, destlen);
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ break;
+ }
+#endif // QLZ_VERSION_MAJOR
+
+#ifdef FASTLZ_VERSION
+ case FASTLZ: {
+ // Use level 1 compression since we mostly care about speed.
+ int destlen = fastlz_compress_level(
+ 1,
+ input,
+ input_size,
+ string_as_array(compressed));
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ CHECK_NE(destlen, 0);
+ break;
+ }
+#endif // FASTLZ_VERSION
+
+ case SNAPPY: {
+ size_t destlen;
+ snappy::RawCompress(input, input_size,
+ string_as_array(compressed),
+ &destlen);
+ CHECK_LE(destlen, snappy::MaxCompressedLength(input_size));
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ break;
+ }
+
+
+ default: {
+ return false; // the asked-for library wasn't compiled in
+ }
+ }
+ return true;
+}
+
+static bool Uncompress(const string& compressed, CompressorType comp,
+ int size, string* output) {
+ switch (comp) {
+#ifdef ZLIB_VERSION
+ case ZLIB: {
+ output->resize(size);
+ ZLib zlib;
+ uLongf destlen = output->size();
+ int ret = zlib.Uncompress(
+ reinterpret_cast<Bytef*>(string_as_array(output)),
+ &destlen,
+ reinterpret_cast<const Bytef*>(compressed.data()),
+ compressed.size());
+ CHECK_EQ(Z_OK, ret);
+ CHECK_EQ(static_cast<uLongf>(size), destlen);
+ break;
+ }
+#endif // ZLIB_VERSION
+
+#ifdef LZO_VERSION
+ case LZO: {
+ output->resize(size);
+ lzo_uint destlen;
+ int ret = lzo1x_decompress(
+ reinterpret_cast<const uint8*>(compressed.data()),
+ compressed.size(),
+ reinterpret_cast<uint8*>(string_as_array(output)),
+ &destlen,
+ NULL);
+ CHECK_EQ(LZO_E_OK, ret);
+ CHECK_EQ(static_cast<lzo_uint>(size), destlen);
+ break;
+ }
+#endif // LZO_VERSION
+
+#ifdef LZF_VERSION
+ case LIBLZF: {
+ output->resize(size);
+ int destlen = lzf_decompress(compressed.data(),
+ compressed.size(),
+ string_as_array(output),
+ output->size());
+ if (destlen == 0) {
+ // This error probably means we had decided not to compress,
+ // and thus have stored input in output directly.
+ output->assign(compressed.data(), compressed.size());
+ destlen = compressed.size();
+ }
+ CHECK_EQ(destlen, size);
+ break;
+ }
+#endif // LZF_VERSION
+
+#ifdef QLZ_VERSION_MAJOR
+ case QUICKLZ: {
+ output->resize(size);
+ qlz_state_decompress *state_decompress = new qlz_state_decompress;
+ int destlen = qlz_decompress(compressed.data(),
+ string_as_array(output),
+ state_decompress);
+ delete state_decompress;
+ CHECK_EQ(destlen, size);
+ break;
+ }
+#endif // QLZ_VERSION_MAJOR
+
+#ifdef FASTLZ_VERSION
+ case FASTLZ: {
+ output->resize(size);
+ int destlen = fastlz_decompress(compressed.data(),
+ compressed.length(),
+ string_as_array(output),
+ size);
+ CHECK_EQ(destlen, size);
+ break;
+ }
+#endif // FASTLZ_VERSION
+
+ case SNAPPY: {
+ snappy::RawUncompress(compressed.data(), compressed.size(),
+ string_as_array(output));
+ break;
+ }
+
+
+ default: {
+ return false; // the asked-for library wasn't compiled in
+ }
+ }
+ return true;
+}
+
+static void Measure(const char* data,
+ size_t length,
+ CompressorType comp,
+ int repeats,
+ int block_size) {
+ // Run tests a few time and pick median running times
+ static const int kRuns = 5;
+ double ctime[kRuns];
+ double utime[kRuns];
+ int compressed_size = 0;
+
+ {
+ // Chop the input into blocks
+ int num_blocks = (length + block_size - 1) / block_size;
+ vector<const char*> input(num_blocks);
+ vector<size_t> input_length(num_blocks);
+ vector<string> compressed(num_blocks);
+ vector<string> output(num_blocks);
+ for (int b = 0; b < num_blocks; b++) {
+ int input_start = b * block_size;
+ int input_limit = min<int>((b+1)*block_size, length);
+ input[b] = data+input_start;
+ input_length[b] = input_limit-input_start;
+
+ // Pre-grow the output buffer so we don't measure string append time.
+ compressed[b].resize(MinimumRequiredOutputSpace(block_size, comp));
+ }
+
+ // First, try one trial compression to make sure the code is compiled in
+ if (!Compress(input[0], input_length[0], comp, &compressed[0], true)) {
+ LOG(WARNING) << "Skipping " << names[comp] << ": "
+ << "library not compiled in";
+ return;
+ }
+
+ for (int run = 0; run < kRuns; run++) {
+ CycleTimer ctimer, utimer;
+
+ for (int b = 0; b < num_blocks; b++) {
+ // Pre-grow the output buffer so we don't measure string append time.
+ compressed[b].resize(MinimumRequiredOutputSpace(block_size, comp));
+ }
+
+ ctimer.Start();
+ for (int b = 0; b < num_blocks; b++)
+ for (int i = 0; i < repeats; i++)
+ Compress(input[b], input_length[b], comp, &compressed[b], true);
+ ctimer.Stop();
+
+ // Compress once more, with resizing, so we don't leave junk
+ // at the end that will confuse the decompressor.
+ for (int b = 0; b < num_blocks; b++) {
+ Compress(input[b], input_length[b], comp, &compressed[b], false);
+ }
+
+ for (int b = 0; b < num_blocks; b++) {
+ output[b].resize(input_length[b]);
+ }
+
+ utimer.Start();
+ for (int i = 0; i < repeats; i++)
+ for (int b = 0; b < num_blocks; b++)
+ Uncompress(compressed[b], comp, input_length[b], &output[b]);
+ utimer.Stop();
+
+ ctime[run] = ctimer.Get();
+ utime[run] = utimer.Get();
+ }
+
+ compressed_size = 0;
+ for (int i = 0; i < compressed.size(); i++) {
+ compressed_size += compressed[i].size();
+ }
+ }
+
+ sort(ctime, ctime + kRuns);
+ sort(utime, utime + kRuns);
+ const int med = kRuns/2;
+
+ float comp_rate = (length / ctime[med]) * repeats / 1048576.0;
+ float uncomp_rate = (length / utime[med]) * repeats / 1048576.0;
+ string x = names[comp];
+ x += ":";
+ string urate = (uncomp_rate >= 0)
+ ? StringPrintf("%.1f", uncomp_rate)
+ : string("?");
+ printf("%-7s [b %dM] bytes %6d -> %6d %4.1f%% "
+ "comp %5.1f MB/s uncomp %5s MB/s\n",
+ x.c_str(),
+ block_size/(1<<20),
+ static_cast<int>(length), static_cast<uint32>(compressed_size),
+ (compressed_size * 100.0) / max<int>(1, length),
+ comp_rate,
+ urate.c_str());
+}
+
+
+static int VerifyString(const string& input) {
+ string compressed;
+ DataEndingAtUnreadablePage i(input);
+ const size_t written = snappy::Compress(i.data(), i.size(), &compressed);
+ CHECK_EQ(written, compressed.size());
+ CHECK_LE(compressed.size(),
+ snappy::MaxCompressedLength(input.size()));
+ CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
+
+ string uncompressed;
+ DataEndingAtUnreadablePage c(compressed);
+ CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed));
+ CHECK_EQ(uncompressed, input);
+ return uncompressed.size();
+}
+
+
+// Test that data compressed by a compressor that does not
+// obey block sizes is uncompressed properly.
+static void VerifyNonBlockedCompression(const string& input) {
+ if (input.length() > snappy::kBlockSize) {
+ // We cannot test larger blocks than the maximum block size, obviously.
+ return;
+ }
+
+ string prefix;
+ Varint::Append32(&prefix, input.size());
+
+ // Setup compression table
+ snappy::internal::WorkingMemory wmem;
+ int table_size;
+ uint16* table = wmem.GetHashTable(input.size(), &table_size);
+
+ // Compress entire input in one shot
+ string compressed;
+ compressed += prefix;
+ compressed.resize(prefix.size()+snappy::MaxCompressedLength(input.size()));
+ char* dest = string_as_array(&compressed) + prefix.size();
+ char* end = snappy::internal::CompressFragment(input.data(), input.size(),
+ dest, table, table_size);
+ compressed.resize(end - compressed.data());
+
+ // Uncompress into string
+ string uncomp_str;
+ CHECK(snappy::Uncompress(compressed.data(), compressed.size(), &uncomp_str));
+ CHECK_EQ(uncomp_str, input);
+
+}
+
+// Expand the input so that it is at least K times as big as block size
+static string Expand(const string& input) {
+ static const int K = 3;
+ string data = input;
+ while (data.size() < K * snappy::kBlockSize) {
+ data += input;
+ }
+ return data;
+}
+
+static int Verify(const string& input) {
+ VLOG(1) << "Verifying input of size " << input.size();
+
+ // Compress using string based routines
+ const int result = VerifyString(input);
+
+
+ VerifyNonBlockedCompression(input);
+ if (!input.empty()) {
+ VerifyNonBlockedCompression(Expand(input));
+ }
+
+
+ return result;
+}
+
+// This test checks to ensure that snappy doesn't coredump if it gets
+// corrupted data.
+
+static bool IsValidCompressedBuffer(const string& c) {
+ return snappy::IsValidCompressedBuffer(c.data(), c.size());
+}
+static bool Uncompress(const string& c, string* u) {
+ return snappy::Uncompress(c.data(), c.size(), u);
+}
+
+TYPED_TEST(CorruptedTest, VerifyCorrupted) {
+ string source = "making sure we don't crash with corrupted input";
+ VLOG(1) << source;
+ string dest;
+ TypeParam uncmp;
+ snappy::Compress(source.data(), source.size(), &dest);
+
+ // Mess around with the data. It's hard to simulate all possible
+ // corruptions; this is just one example ...
+ CHECK_GT(dest.size(), 3);
+ dest[1]--;
+ dest[3]++;
+ // this really ought to fail.
+ CHECK(!IsValidCompressedBuffer(TypeParam(dest)));
+ CHECK(!Uncompress(TypeParam(dest), &uncmp));
+
+ // This is testing for a security bug - a buffer that decompresses to 100k
+ // but we lie in the snappy header and only reserve 0 bytes of memory :)
+ source.resize(100000);
+ for (int i = 0; i < source.length(); ++i) {
+ source[i] = 'A';
+ }
+ snappy::Compress(source.data(), source.size(), &dest);
+ dest[0] = dest[1] = dest[2] = dest[3] = 0;
+ CHECK(!IsValidCompressedBuffer(TypeParam(dest)));
+ CHECK(!Uncompress(TypeParam(dest), &uncmp));
+
+ if (sizeof(void *) == 4) {
+ // Another security check; check a crazy big length can't DoS us with an
+ // over-allocation.
+ // Currently this is done only for 32-bit builds. On 64-bit builds,
+ // where 3 GB might be an acceptable allocation size, Uncompress()
+ // attempts to decompress, and sometimes causes the test to run out of
+ // memory.
+ dest[0] = dest[1] = dest[2] = dest[3] = 0xff;
+ // This decodes to a really large size, i.e., about 3 GB.
+ dest[4] = 'k';
+ CHECK(!IsValidCompressedBuffer(TypeParam(dest)));
+ CHECK(!Uncompress(TypeParam(dest), &uncmp));
+ } else {
+ LOG(WARNING) << "Crazy decompression lengths not checked on 64-bit build";
+ }
+
+ // This decodes to about 2 MB; much smaller, but should still fail.
+ dest[0] = dest[1] = dest[2] = 0xff;
+ dest[3] = 0x00;
+ CHECK(!IsValidCompressedBuffer(TypeParam(dest)));
+ CHECK(!Uncompress(TypeParam(dest), &uncmp));
+
+ // try reading stuff in from a bad file.
+ for (int i = 1; i <= 3; ++i) {
+ string data = ReadTestDataFile(StringPrintf("baddata%d.snappy", i).c_str(),
+ 0);
+ string uncmp;
+ // check that we don't return a crazy length
+ size_t ulen;
+ CHECK(!snappy::GetUncompressedLength(data.data(), data.size(), &ulen)
+ || (ulen < (1<<20)));
+ uint32 ulen2;
+ snappy::ByteArraySource source(data.data(), data.size());
+ CHECK(!snappy::GetUncompressedLength(&source, &ulen2) ||
+ (ulen2 < (1<<20)));
+ CHECK(!IsValidCompressedBuffer(TypeParam(data)));
+ CHECK(!Uncompress(TypeParam(data), &uncmp));
+ }
+}
+
+// Helper routines to construct arbitrary compressed strings.
+// These mirror the compression code in snappy.cc, but are copied
+// here so that we can bypass some limitations in the how snappy.cc
+// invokes these routines.
+static void AppendLiteral(string* dst, const string& literal) {
+ if (literal.empty()) return;
+ int n = literal.size() - 1;
+ if (n < 60) {
+ // Fit length in tag byte
+ dst->push_back(0 | (n << 2));
+ } else {
+ // Encode in upcoming bytes
+ char number[4];
+ int count = 0;
+ while (n > 0) {
+ number[count++] = n & 0xff;
+ n >>= 8;
+ }
+ dst->push_back(0 | ((59+count) << 2));
+ *dst += string(number, count);
+ }
+ *dst += literal;
+}
+
+static void AppendCopy(string* dst, int offset, int length) {
+ while (length > 0) {
+ // Figure out how much to copy in one shot
+ int to_copy;
+ if (length >= 68) {
+ to_copy = 64;
+ } else if (length > 64) {
+ to_copy = 60;
+ } else {
+ to_copy = length;
+ }
+ length -= to_copy;
+
+ if ((to_copy < 12) && (offset < 2048)) {
+ assert(to_copy-4 < 8); // Must fit in 3 bits
+ dst->push_back(1 | ((to_copy-4) << 2) | ((offset >> 8) << 5));
+ dst->push_back(offset & 0xff);
+ } else if (offset < 65536) {
+ dst->push_back(2 | ((to_copy-1) << 2));
+ dst->push_back(offset & 0xff);
+ dst->push_back(offset >> 8);
+ } else {
+ dst->push_back(3 | ((to_copy-1) << 2));
+ dst->push_back(offset & 0xff);
+ dst->push_back((offset >> 8) & 0xff);
+ dst->push_back((offset >> 16) & 0xff);
+ dst->push_back((offset >> 24) & 0xff);
+ }
+ }
+}
+
+TEST(Snappy, SimpleTests) {
+ Verify("");
+ Verify("a");
+ Verify("ab");
+ Verify("abc");
+
+ Verify("aaaaaaa" + string(16, 'b') + string("aaaaa") + "abc");
+ Verify("aaaaaaa" + string(256, 'b') + string("aaaaa") + "abc");
+ Verify("aaaaaaa" + string(2047, 'b') + string("aaaaa") + "abc");
+ Verify("aaaaaaa" + string(65536, 'b') + string("aaaaa") + "abc");
+ Verify("abcaaaaaaa" + string(65536, 'b') + string("aaaaa") + "abc");
+}
+
+// Verify max blowup (lots of four-byte copies)
+TEST(Snappy, MaxBlowup) {
+ string input;
+ for (int i = 0; i < 20000; i++) {
+ ACMRandom rnd(i);
+ uint32 bytes = static_cast<uint32>(rnd.Next());
+ input.append(reinterpret_cast<char*>(&bytes), sizeof(bytes));
+ }
+ for (int i = 19999; i >= 0; i--) {
+ ACMRandom rnd(i);
+ uint32 bytes = static_cast<uint32>(rnd.Next());
+ input.append(reinterpret_cast<char*>(&bytes), sizeof(bytes));
+ }
+ Verify(input);
+}
+
+TEST(Snappy, RandomData) {
+ ACMRandom rnd(FLAGS_test_random_seed);
+
+ const int num_ops = 20000;
+ for (int i = 0; i < num_ops; i++) {
+ if ((i % 1000) == 0) {
+ VLOG(0) << "Random op " << i << " of " << num_ops;
+ }
+
+ string x;
+ int len = rnd.Uniform(4096);
+ if (i < 100) {
+ len = 65536 + rnd.Uniform(65536);
+ }
+ while (x.size() < len) {
+ int run_len = 1;
+ if (rnd.OneIn(10)) {
+ run_len = rnd.Skewed(8);
+ }
+ char c = (i < 100) ? rnd.Uniform(256) : rnd.Skewed(3);
+ while (run_len-- > 0 && x.size() < len) {
+ x += c;
+ }
+ }
+
+ Verify(x);
+ }
+}
+
+TEST(Snappy, FourByteOffset) {
+ // The new compressor cannot generate four-byte offsets since
+ // it chops up the input into 32KB pieces. So we hand-emit the
+ // copy manually.
+
+ // The two fragments that make up the input string.
+ string fragment1 = "012345689abcdefghijklmnopqrstuvwxyz";
+ string fragment2 = "some other string";
+
+ // How many times each fragment is emitted.
+ const int n1 = 2;
+ const int n2 = 100000 / fragment2.size();
+ const int length = n1 * fragment1.size() + n2 * fragment2.size();
+
+ string compressed;
+ Varint::Append32(&compressed, length);
+
+ AppendLiteral(&compressed, fragment1);
+ string src = fragment1;
+ for (int i = 0; i < n2; i++) {
+ AppendLiteral(&compressed, fragment2);
+ src += fragment2;
+ }
+ AppendCopy(&compressed, src.size(), fragment1.size());
+ src += fragment1;
+ CHECK_EQ(length, src.size());
+
+ string uncompressed;
+ CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
+ CHECK(snappy::Uncompress(compressed.data(), compressed.size(),
+ &uncompressed));
+ CHECK_EQ(uncompressed, src);
+}
+
+
+static bool CheckUncompressedLength(const string& compressed,
+ size_t* ulength) {
+ const bool result1 = snappy::GetUncompressedLength(compressed.data(),
+ compressed.size(),
+ ulength);
+
+ snappy::ByteArraySource source(compressed.data(), compressed.size());
+ uint32 length;
+ const bool result2 = snappy::GetUncompressedLength(&source, &length);
+ CHECK_EQ(result1, result2);
+ return result1;
+}
+
+TEST(SnappyCorruption, TruncatedVarint) {
+ string compressed, uncompressed;
+ size_t ulength;
+ compressed.push_back('\xf0');
+ CHECK(!CheckUncompressedLength(compressed, &ulength));
+ CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
+ CHECK(!snappy::Uncompress(compressed.data(), compressed.size(),
+ &uncompressed));
+}
+
+TEST(SnappyCorruption, UnterminatedVarint) {
+ string compressed, uncompressed;
+ size_t ulength;
+ compressed.push_back(128);
+ compressed.push_back(128);
+ compressed.push_back(128);
+ compressed.push_back(128);
+ compressed.push_back(128);
+ compressed.push_back(10);
+ CHECK(!CheckUncompressedLength(compressed, &ulength));
+ CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
+ CHECK(!snappy::Uncompress(compressed.data(), compressed.size(),
+ &uncompressed));
+}
+
+TEST(Snappy, ReadPastEndOfBuffer) {
+ // Check that we do not read past end of input
+
+ // Make a compressed string that ends with a single-byte literal
+ string compressed;
+ Varint::Append32(&compressed, 1);
+ AppendLiteral(&compressed, "x");
+
+ string uncompressed;
+ DataEndingAtUnreadablePage c(compressed);
+ CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed));
+ CHECK_EQ(uncompressed, string("x"));
+}
+
+// Check for an infinite loop caused by a copy with offset==0
+TEST(Snappy, ZeroOffsetCopy) {
+ const char* compressed = "\x40\x12\x00\x00";
+ // \x40 Length (must be > kMaxIncrementCopyOverflow)
+ // \x12\x00\x00 Copy with offset==0, length==5
+ char uncompressed[100];
+ EXPECT_FALSE(snappy::RawUncompress(compressed, 4, uncompressed));
+}
+
+TEST(Snappy, ZeroOffsetCopyValidation) {
+ const char* compressed = "\x05\x12\x00\x00";
+ // \x05 Length
+ // \x12\x00\x00 Copy with offset==0, length==5
+ EXPECT_FALSE(snappy::IsValidCompressedBuffer(compressed, 4));
+}
+
+
+namespace {
+
+int TestFindMatchLength(const char* s1, const char *s2, unsigned length) {
+ return snappy::internal::FindMatchLength(s1, s2, s2 + length);
+}
+
+} // namespace
+
+TEST(Snappy, FindMatchLength) {
+ // Exercise all different code paths through the function.
+ // 64-bit version:
+
+ // Hit s1_limit in 64-bit loop, hit s1_limit in single-character loop.
+ EXPECT_EQ(6, TestFindMatchLength("012345", "012345", 6));
+ EXPECT_EQ(11, TestFindMatchLength("01234567abc", "01234567abc", 11));
+
+ // Hit s1_limit in 64-bit loop, find a non-match in single-character loop.
+ EXPECT_EQ(9, TestFindMatchLength("01234567abc", "01234567axc", 9));
+
+ // Same, but edge cases.
+ EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc!", 11));
+ EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc?", 11));
+
+ // Find non-match at once in first loop.
+ EXPECT_EQ(0, TestFindMatchLength("01234567xxxxxxxx", "?1234567xxxxxxxx", 16));
+ EXPECT_EQ(1, TestFindMatchLength("01234567xxxxxxxx", "0?234567xxxxxxxx", 16));
+ EXPECT_EQ(4, TestFindMatchLength("01234567xxxxxxxx", "01237654xxxxxxxx", 16));
+ EXPECT_EQ(7, TestFindMatchLength("01234567xxxxxxxx", "0123456?xxxxxxxx", 16));
+
+ // Find non-match in first loop after one block.
+ EXPECT_EQ(8, TestFindMatchLength("abcdefgh01234567xxxxxxxx",
+ "abcdefgh?1234567xxxxxxxx", 24));
+ EXPECT_EQ(9, TestFindMatchLength("abcdefgh01234567xxxxxxxx",
+ "abcdefgh0?234567xxxxxxxx", 24));
+ EXPECT_EQ(12, TestFindMatchLength("abcdefgh01234567xxxxxxxx",
+ "abcdefgh01237654xxxxxxxx", 24));
+ EXPECT_EQ(15, TestFindMatchLength("abcdefgh01234567xxxxxxxx",
+ "abcdefgh0123456?xxxxxxxx", 24));
+
+ // 32-bit version:
+
+ // Short matches.
+ EXPECT_EQ(0, TestFindMatchLength("01234567", "?1234567", 8));
+ EXPECT_EQ(1, TestFindMatchLength("01234567", "0?234567", 8));
+ EXPECT_EQ(2, TestFindMatchLength("01234567", "01?34567", 8));
+ EXPECT_EQ(3, TestFindMatchLength("01234567", "012?4567", 8));
+ EXPECT_EQ(4, TestFindMatchLength("01234567", "0123?567", 8));
+ EXPECT_EQ(5, TestFindMatchLength("01234567", "01234?67", 8));
+ EXPECT_EQ(6, TestFindMatchLength("01234567", "012345?7", 8));
+ EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 8));
+ EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 7));
+ EXPECT_EQ(7, TestFindMatchLength("01234567!", "0123456??", 7));
+
+ // Hit s1_limit in 32-bit loop, hit s1_limit in single-character loop.
+ EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd", "xxxxxxabcd", 10));
+ EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd?", "xxxxxxabcd?", 10));
+ EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcdef", "xxxxxxabcdef", 13));
+
+ // Same, but edge cases.
+ EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc!", 12));
+ EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc?", 12));
+
+ // Hit s1_limit in 32-bit loop, find a non-match in single-character loop.
+ EXPECT_EQ(11, TestFindMatchLength("xxxxxx0123abc", "xxxxxx0123axc", 13));
+
+ // Find non-match at once in first loop.
+ EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123xxxxxxxx",
+ "xxxxxx?123xxxxxxxx", 18));
+ EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123xxxxxxxx",
+ "xxxxxx0?23xxxxxxxx", 18));
+ EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123xxxxxxxx",
+ "xxxxxx0132xxxxxxxx", 18));
+ EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123xxxxxxxx",
+ "xxxxxx012?xxxxxxxx", 18));
+
+ // Same, but edge cases.
+ EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123", "xxxxxx?123", 10));
+ EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123", "xxxxxx0?23", 10));
+ EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123", "xxxxxx0132", 10));
+ EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123", "xxxxxx012?", 10));
+
+ // Find non-match in first loop after one block.
+ EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123xx",
+ "xxxxxxabcd?123xx", 16));
+ EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123xx",
+ "xxxxxxabcd0?23xx", 16));
+ EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123xx",
+ "xxxxxxabcd0132xx", 16));
+ EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123xx",
+ "xxxxxxabcd012?xx", 16));
+
+ // Same, but edge cases.
+ EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd?123", 14));
+ EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0?23", 14));
+ EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0132", 14));
+ EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd012?", 14));
+}
+
+TEST(Snappy, FindMatchLengthRandom) {
+ const int kNumTrials = 10000;
+ const int kTypicalLength = 10;
+ ACMRandom rnd(FLAGS_test_random_seed);
+
+ for (int i = 0; i < kNumTrials; i++) {
+ string s, t;
+ char a = rnd.Rand8();
+ char b = rnd.Rand8();
+ while (!rnd.OneIn(kTypicalLength)) {
+ s.push_back(rnd.OneIn(2) ? a : b);
+ t.push_back(rnd.OneIn(2) ? a : b);
+ }
+ DataEndingAtUnreadablePage u(s);
+ DataEndingAtUnreadablePage v(t);
+ int matched = snappy::internal::FindMatchLength(
+ u.data(), v.data(), v.data() + t.size());
+ if (matched == t.size()) {
+ EXPECT_EQ(s, t);
+ } else {
+ EXPECT_NE(s[matched], t[matched]);
+ for (int j = 0; j < matched; j++) {
+ EXPECT_EQ(s[j], t[j]);
+ }
+ }
+ }
+}
+
+
+static void CompressFile(const char* fname) {
+ string fullinput;
+ file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess();
+
+ string compressed;
+ Compress(fullinput.data(), fullinput.size(), SNAPPY, &compressed, false);
+
+ file::SetContents(string(fname).append(".comp"), compressed, file::Defaults())
+ .CheckSuccess();
+}
+
+static void UncompressFile(const char* fname) {
+ string fullinput;
+ file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess();
+
+ size_t uncompLength;
+ CHECK(CheckUncompressedLength(fullinput, &uncompLength));
+
+ string uncompressed;
+ uncompressed.resize(uncompLength);
+ CHECK(snappy::Uncompress(fullinput.data(), fullinput.size(), &uncompressed));
+
+ file::SetContents(string(fname).append(".uncomp"), uncompressed,
+ file::Defaults()).CheckSuccess();
+}
+
+static void MeasureFile(const char* fname) {
+ string fullinput;
+ file::GetContents(fname, &fullinput, file::Defaults()).CheckSuccess();
+ printf("%-40s :\n", fname);
+
+ int start_len = (FLAGS_start_len < 0) ? fullinput.size() : FLAGS_start_len;
+ int end_len = fullinput.size();
+ if (FLAGS_end_len >= 0) {
+ end_len = min<int>(fullinput.size(), FLAGS_end_len);
+ }
+ for (int len = start_len; len <= end_len; len++) {
+ const char* const input = fullinput.data();
+ int repeats = (FLAGS_bytes + len) / (len + 1);
+ if (FLAGS_zlib) Measure(input, len, ZLIB, repeats, 1024<<10);
+ if (FLAGS_lzo) Measure(input, len, LZO, repeats, 1024<<10);
+ if (FLAGS_liblzf) Measure(input, len, LIBLZF, repeats, 1024<<10);
+ if (FLAGS_quicklz) Measure(input, len, QUICKLZ, repeats, 1024<<10);
+ if (FLAGS_fastlz) Measure(input, len, FASTLZ, repeats, 1024<<10);
+ if (FLAGS_snappy) Measure(input, len, SNAPPY, repeats, 4096<<10);
+
+ // For block-size based measurements
+ if (0 && FLAGS_snappy) {
+ Measure(input, len, SNAPPY, repeats, 8<<10);
+ Measure(input, len, SNAPPY, repeats, 16<<10);
+ Measure(input, len, SNAPPY, repeats, 32<<10);
+ Measure(input, len, SNAPPY, repeats, 64<<10);
+ Measure(input, len, SNAPPY, repeats, 256<<10);
+ Measure(input, len, SNAPPY, repeats, 1024<<10);
+ }
+ }
+}
+
+static struct {
+ const char* label;
+ const char* filename;
+ size_t size_limit;
+} files[] = {
+ { "html", "html", 0 },
+ { "urls", "urls.10K", 0 },
+ { "jpg", "house.jpg", 0 },
+ { "jpg_200", "house.jpg", 200 },
+ { "pdf", "mapreduce-osdi-1.pdf", 0 },
+ { "html4", "html_x_4", 0 },
+ { "cp", "cp.html", 0 },
+ { "c", "fields.c", 0 },
+ { "lsp", "grammar.lsp", 0 },
+ { "xls", "kennedy.xls", 0 },
+ { "xls_200", "kennedy.xls", 200 },
+ { "txt1", "alice29.txt", 0 },
+ { "txt2", "asyoulik.txt", 0 },
+ { "txt3", "lcet10.txt", 0 },
+ { "txt4", "plrabn12.txt", 0 },
+ { "bin", "ptt5", 0 },
+ { "bin_200", "ptt5", 200 },
+ { "sum", "sum", 0 },
+ { "man", "xargs.1", 0 },
+ { "pb", "geo.protodata", 0 },
+ { "gaviota", "kppkn.gtb", 0 },
+};
+
+static void BM_UFlat(int iters, int arg) {
+ StopBenchmarkTiming();
+
+ // Pick file to process based on "arg"
+ CHECK_GE(arg, 0);
+ CHECK_LT(arg, ARRAYSIZE(files));
+ string contents = ReadTestDataFile(files[arg].filename,
+ files[arg].size_limit);
+
+ string zcontents;
+ snappy::Compress(contents.data(), contents.size(), &zcontents);
+ char* dst = new char[contents.size()];
+
+ SetBenchmarkBytesProcessed(static_cast<int64>(iters) *
+ static_cast<int64>(contents.size()));
+ SetBenchmarkLabel(files[arg].label);
+ StartBenchmarkTiming();
+ while (iters-- > 0) {
+ CHECK(snappy::RawUncompress(zcontents.data(), zcontents.size(), dst));
+ }
+ StopBenchmarkTiming();
+
+ delete[] dst;
+}
+BENCHMARK(BM_UFlat)->DenseRange(0, ARRAYSIZE(files) - 1);
+
+static void BM_UValidate(int iters, int arg) {
+ StopBenchmarkTiming();
+
+ // Pick file to process based on "arg"
+ CHECK_GE(arg, 0);
+ CHECK_LT(arg, ARRAYSIZE(files));
+ string contents = ReadTestDataFile(files[arg].filename,
+ files[arg].size_limit);
+
+ string zcontents;
+ snappy::Compress(contents.data(), contents.size(), &zcontents);
+
+ SetBenchmarkBytesProcessed(static_cast<int64>(iters) *
+ static_cast<int64>(contents.size()));
+ SetBenchmarkLabel(files[arg].label);
+ StartBenchmarkTiming();
+ while (iters-- > 0) {
+ CHECK(snappy::IsValidCompressedBuffer(zcontents.data(), zcontents.size()));
+ }
+ StopBenchmarkTiming();
+}
+BENCHMARK(BM_UValidate)->DenseRange(0, 4);
+
+
+static void BM_ZFlat(int iters, int arg) {
+ StopBenchmarkTiming();
+
+ // Pick file to process based on "arg"
+ CHECK_GE(arg, 0);
+ CHECK_LT(arg, ARRAYSIZE(files));
+ string contents = ReadTestDataFile(files[arg].filename,
+ files[arg].size_limit);
+
+ char* dst = new char[snappy::MaxCompressedLength(contents.size())];
+
+ SetBenchmarkBytesProcessed(static_cast<int64>(iters) *
+ static_cast<int64>(contents.size()));
+ StartBenchmarkTiming();
+
+ size_t zsize = 0;
+ while (iters-- > 0) {
+ snappy::RawCompress(contents.data(), contents.size(), dst, &zsize);
+ }
+ StopBenchmarkTiming();
+ const double compression_ratio =
+ static_cast<double>(zsize) / std::max<size_t>(1, contents.size());
+ SetBenchmarkLabel(StringPrintf("%s (%.2f %%)",
+ files[arg].label, 100.0 * compression_ratio));
+ VLOG(0) << StringPrintf("compression for %s: %zd -> %zd bytes",
+ files[arg].label, contents.size(), zsize);
+ delete[] dst;
+}
+BENCHMARK(BM_ZFlat)->DenseRange(0, ARRAYSIZE(files) - 1);
+
+
+} // namespace snappy
+
+
+int main(int argc, char** argv) {
+ InitGoogle(argv[0], &argc, &argv, true);
+ File::Init();
+ RunSpecifiedBenchmarks();
+
+
+ if (argc >= 2) {
+ for (int arg = 1; arg < argc; arg++) {
+ if (FLAGS_write_compressed) {
+ CompressFile(argv[arg]);
+ } else if (FLAGS_write_uncompressed) {
+ UncompressFile(argv[arg]);
+ } else {
+ MeasureFile(argv[arg]);
+ }
+ }
+ return 0;
+ }
+
+ return RUN_ALL_TESTS();
+}
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java
index 16519418..218dd000 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/LaunchVPN.java
@@ -2,8 +2,6 @@ package de.blinkt.openvpn;
import se.leap.bitmaskclient.R;
-import java.io.IOException;
-
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
@@ -18,13 +16,17 @@ import android.text.InputType;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
-import android.widget.*;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+
+import java.io.IOException;
import de.blinkt.openvpn.activities.LogWindow;
-import de.blinkt.openvpn.core.VpnStatus;
-import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
import de.blinkt.openvpn.core.ProfileManager;
import de.blinkt.openvpn.core.VPNLaunchHelper;
+import de.blinkt.openvpn.core.VpnStatus;
+import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
/**
* This Activity actually handles two stages of a launcher shortcut's life cycle.
@@ -109,7 +111,6 @@ public class LaunchVPN extends Activity {
}
}
-
@Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
index d351610d..e2ebfd42 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
@@ -2,6 +2,7 @@ package de.blinkt.openvpn;
import se.leap.bitmaskclient.R;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -12,6 +13,7 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.security.KeyChain;
import android.security.KeyChainException;
+import android.text.TextUtils;
import android.util.Base64;
import org.spongycastle.util.io.pem.PemObject;
@@ -113,8 +115,8 @@ public class VpnProfile implements Serializable {
public boolean mUseDefaultRoute = true;
public boolean mUsePull = true;
public String mCustomRoutes;
- public boolean mCheckRemoteCN = false;
- public boolean mExpectTLSCert = true;
+ public boolean mCheckRemoteCN = true;
+ public boolean mExpectTLSCert = false;
public String mRemoteCN = "";
public String mPassword = "";
public String mUsername = "";
@@ -179,6 +181,7 @@ public class VpnProfile implements Serializable {
mUseDefaultRoute = false;
mUseDefaultRoutev6 = false;
mExpectTLSCert = false;
+ mCheckRemoteCN = false;
mPersistTun = false;
mAllowLocalLAN = true;
}
@@ -197,10 +200,7 @@ public class VpnProfile implements Serializable {
public void upgradeProfile(){
if(mProfileVersion< 2) {
/* default to the behaviour the OS used */
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
- mAllowLocalLAN = true;
- else
- mAllowLocalLAN = false;
+ mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT;
}
mProfileVersion= CURRENT_PROFILE_VERSION;
@@ -211,7 +211,7 @@ public class VpnProfile implements Serializable {
File cacheDir = context.getCacheDir();
String cfg = "";
- // Enable managment interface
+ // Enable management interface
cfg += "# Enables connection to GUI\n";
cfg += "management ";
@@ -228,6 +228,9 @@ public class VpnProfile implements Serializable {
cfg += "machine-readable-output\n";
+ // Users are confused by warnings that are misleading...
+ cfg += "ifconfig-nowarn\n";
+
boolean useTLSClient = (mAuthenticationType != TYPE_STATICKEYS);
@@ -325,7 +328,7 @@ public class VpnProfile implements Serializable {
else
cfg += insertFileData("tls-auth", mTLSAuthFilename);
- if (nonNull(mTLSAuthDirection)) {
+ if (!TextUtils.isEmpty(mTLSAuthDirection)) {
cfg += "key-direction ";
cfg += mTLSAuthDirection;
cfg += "\n";
@@ -334,10 +337,10 @@ public class VpnProfile implements Serializable {
}
if (!mUsePull) {
- if (nonNull(mIPv4Address))
+ if (!TextUtils.isEmpty(mIPv4Address))
cfg += "ifconfig " + cidrToIPAndNetmask(mIPv4Address) + "\n";
- if (nonNull(mIPv6Address))
+ if (!TextUtils.isEmpty(mIPv6Address))
cfg += "ifconfig-ipv6 " + mIPv6Address + "\n";
}
@@ -375,11 +378,11 @@ public class VpnProfile implements Serializable {
cfg += routes;
if (mOverrideDNS || !mUsePull) {
- if (nonNull(mDNS1))
+ if (!TextUtils.isEmpty(mDNS1))
cfg += "dhcp-option DNS " + mDNS1 + "\n";
- if (nonNull(mDNS2))
+ if (!TextUtils.isEmpty(mDNS2))
cfg += "dhcp-option DNS " + mDNS2 + "\n";
- if (nonNull(mSearchDomain))
+ if (!TextUtils.isEmpty(mSearchDomain))
cfg += "dhcp-option DOMAIN " + mSearchDomain + "\n";
}
@@ -420,11 +423,11 @@ public class VpnProfile implements Serializable {
cfg += "remote-cert-tls server\n";
}
- if (nonNull(mCipher)) {
+ if (!TextUtils.isEmpty(mCipher)) {
cfg += "cipher " + mCipher + "\n";
}
- if (nonNull(mAuth)) {
+ if (!TextUtils.isEmpty(mAuth)) {
cfg += "auth " + mAuth + "\n";
}
@@ -486,13 +489,6 @@ public class VpnProfile implements Serializable {
}
}
- private boolean nonNull(String val) {
- if (val == null || val.equals(""))
- return false;
- else
- return true;
- }
-
private Collection<String> getCustomRoutes(String routes) {
Vector<String> cidrRoutes = new Vector<String>();
if (routes == null) {
@@ -634,8 +630,8 @@ public class VpnProfile implements Serializable {
synchronized String[] getKeyStoreCertificates(Context context,int tries) {
PrivateKey privateKey = null;
- X509Certificate[] cachain;
- Exception exp=null;
+ X509Certificate[] caChain;
+ Exception exp;
try {
privateKey = KeyChain.getPrivateKey(context, mAlias);
mPrivateKey = privateKey;
@@ -643,18 +639,18 @@ public class VpnProfile implements Serializable {
String keystoreChain = null;
- cachain = KeyChain.getCertificateChain(context, mAlias);
- if(cachain == null)
+ caChain = KeyChain.getCertificateChain(context, mAlias);
+ if(caChain == null)
throw new NoCertReturnedException("No certificate returned from Keystore");
- if (cachain.length <= 1 && !nonNull(mCaFilename)) {
+ if (caChain.length <= 1 && TextUtils.isEmpty(mCaFilename)) {
VpnStatus.logMessage(VpnStatus.LogLevel.ERROR, "", context.getString(R.string.keychain_nocacert));
} else {
StringWriter ksStringWriter = new StringWriter();
PemWriter pw = new PemWriter(ksStringWriter);
- for (int i = 1; i < cachain.length; i++) {
- X509Certificate cert = cachain[i];
+ for (int i = 1; i < caChain.length; i++) {
+ X509Certificate cert = caChain[i];
pw.writeObject(new PemObject("CERTIFICATE", cert.getEncoded()));
}
pw.close();
@@ -663,7 +659,7 @@ public class VpnProfile implements Serializable {
String caout = null;
- if (nonNull(mCaFilename)) {
+ if (!TextUtils.isEmpty(mCaFilename)) {
try {
Certificate cacert = X509Utils.getCertificateFromFile(mCaFilename);
StringWriter caoutWriter = new StringWriter();
@@ -682,8 +678,8 @@ public class VpnProfile implements Serializable {
StringWriter certout = new StringWriter();
- if (cachain.length >= 1) {
- X509Certificate usercert = cachain[0];
+ if (caChain.length >= 1) {
+ X509Certificate usercert = caChain[0];
PemWriter upw = new PemWriter(certout);
upw.writeObject(new PemObject("CERTIFICATE", usercert.getEncoded()));
@@ -728,15 +724,14 @@ public class VpnProfile implements Serializable {
}
return getKeyStoreCertificates(context, tries-1);
}
- if (exp != null) {
- exp.printStackTrace();
- VpnStatus.logError(R.string.keyChainAccessError, exp.getLocalizedMessage());
- VpnStatus.logError(R.string.keychain_access);
- if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {
- if (!mAlias.matches("^[a-zA-Z0-9]$")) {
- VpnStatus.logError(R.string.jelly_keystore_alphanumeric_bug);
- }
+ exp.printStackTrace();
+ VpnStatus.logError(R.string.keyChainAccessError, exp.getLocalizedMessage());
+
+ VpnStatus.logError(R.string.keychain_access);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {
+ if (!mAlias.matches("^[a-zA-Z0-9]$")) {
+ VpnStatus.logError(R.string.jelly_keystore_alphanumeric_bug);
}
}
return null;
@@ -799,7 +794,7 @@ public class VpnProfile implements Serializable {
}
public boolean requireTLSKeyPassword() {
- if (!nonNull(mClientKeyFilename))
+ if (TextUtils.isEmpty(mClientKeyFilename))
return false;
String data = "";
@@ -840,13 +835,13 @@ public class VpnProfile implements Serializable {
}
if (mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) {
- if (requireTLSKeyPassword() && !nonNull(mKeyPassword))
+ if (requireTLSKeyPassword() && TextUtils.isEmpty(mKeyPassword))
if (mTransientPCKS12PW == null) {
return R.string.private_key_password;
}
}
- if (isUserPWAuth() && !(nonNull(mUsername) && (nonNull(mPassword) || mTransientPW != null))) {
+ if (isUserPWAuth() && !(!TextUtils.isEmpty(mUsername) && (!TextUtils.isEmpty(mPassword) || mTransientPW != null))) {
return R.string.password;
}
return 0;
@@ -891,12 +886,15 @@ public class VpnProfile implements Serializable {
try {
+ /* ECB is perfectly fine in this special case, since we are using it for
+ the public/private part in the TLS exchange
+ */
+ @SuppressLint("GetInstance")
+ Cipher rsaSigner = Cipher.getInstance("RSA/ECB/PKCS1PADDING");
- Cipher rsasinger = Cipher.getInstance("RSA/ECB/PKCS1PADDING");
-
- rsasinger.init(Cipher.ENCRYPT_MODE, privkey);
+ rsaSigner.init(Cipher.ENCRYPT_MODE, privkey);
- byte[] signed_bytes = rsasinger.doFinal(data);
+ byte[] signed_bytes = rsaSigner.doFinal(data);
return Base64.encodeToString(signed_bytes, Base64.NO_WRAP);
} catch (NoSuchAlgorithmException e) {
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
index da011c98..8e418053 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/activities/DisconnectVPN.java
@@ -43,8 +43,8 @@ public class DisconnectVPN extends Activity implements DialogInterface.OnClickLi
}
@Override
- protected void onStop() {
- super.onStop();
+ protected void onPause() {
+ super.onPause();
unbindService(mConnection);
}
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index 378b6b92..d23b521f 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -1,7 +1,5 @@
package de.blinkt.openvpn.core;
-import de.blinkt.openvpn.VpnProfile;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
@@ -10,6 +8,8 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Vector;
+import de.blinkt.openvpn.VpnProfile;
+
//! Openvpn Config FIle Parser, probably not 100% accurate but close enough
// And remember, this is valid :)
@@ -31,11 +31,17 @@ public class ConfigParser {
BufferedReader br =new BufferedReader(reader);
+ int lineno=0;
while (true){
String line = br.readLine();
+ lineno++;
if(line==null)
break;
+ if (lineno==1 && (line.startsWith("PK\003\004")
+ || (line.startsWith("PK\007\008"))))
+ throw new ConfigParseError("Input looks like a ZIP Archive. Import is only possible for OpenVPN config files (.ovpn/.conf)");
+
// Check for OpenVPN Access Server Meta information
if (line.startsWith("# OVPN_ACCESS_SERVER_")) {
Vector<String> metaarg = parsemeta(line);
@@ -440,8 +446,8 @@ public class ConfigParser {
}
Vector<String> rport = getOption("rport", 1,1);
- if(port!=null){
- np.mServerPort = port.get(1);
+ if(rport!=null){
+ np.mServerPort = rport.get(1);
}
Vector<String> proto = getOption("proto", 1,1);
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
index 990e70d8..81a17ef9 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java
@@ -5,6 +5,8 @@ import android.text.TextUtils;
import junit.framework.Assert;
+import org.jetbrains.annotations.NotNull;
+
import java.math.BigInteger;
import java.net.Inet6Address;
import java.util.*;
@@ -23,13 +25,18 @@ public class NetworkSpace {
private BigInteger lastAddress;
+ /**
+ * sorts the networks with following criteria:
+ * 1. compares first 1 of the network
+ * 2. smaller networks are returned as smaller
+ */
@Override
- public int compareTo(ipAddress another) {
+ public int compareTo(@NotNull ipAddress another) {
int comp = getFirstAddress().compareTo(another.getFirstAddress());
if (comp != 0)
return comp;
- // bigger mask means smaller address block
+
if (networkMask > another.networkMask)
return -1;
else if (another.networkMask == networkMask)
@@ -38,6 +45,22 @@ public class NetworkSpace {
return 1;
}
+ /**
+ * Warning ignores the included integer
+ *
+ * @param o
+ * the object to compare this instance with.
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof ipAddress))
+ return super.equals(o);
+
+
+ ipAddress on = (ipAddress) o;
+ return (networkMask == on.networkMask) && on.getFirstAddress().equals(getFirstAddress());
+ }
+
public ipAddress(CIDRIP ip, boolean include) {
included = include;
netAddress = BigInteger.valueOf(ip.getInt());
@@ -110,10 +133,10 @@ public class NetworkSpace {
public ipAddress[] split() {
- ipAddress firsthalf = new ipAddress(getFirstAddress(), networkMask + 1, included, isV4);
- ipAddress secondhalf = new ipAddress(firsthalf.getLastAddress().add(BigInteger.ONE), networkMask + 1, included, isV4);
- if (BuildConfig.DEBUG) Assert.assertTrue(secondhalf.getLastAddress().equals(getLastAddress()));
- return new ipAddress[]{firsthalf, secondhalf};
+ ipAddress firstHalf = new ipAddress(getFirstAddress(), networkMask + 1, included, isV4);
+ ipAddress secondHalf = new ipAddress(firstHalf.getLastAddress().add(BigInteger.ONE), networkMask + 1, included, isV4);
+ if (BuildConfig.DEBUG) Assert.assertTrue(secondHalf.getLastAddress().equals(getLastAddress()));
+ return new ipAddress[]{firstHalf, secondHalf};
}
String getIPv4Address() {
@@ -185,7 +208,7 @@ public class NetworkSpace {
return ipsDone;
while (currentNet!=null) {
- // Check if it and the next of it are compatbile
+ // Check if it and the next of it are compatible
ipAddress nextNet = networks.poll();
if (BuildConfig.DEBUG) Assert.assertNotNull(currentNet);
@@ -202,9 +225,12 @@ public class NetworkSpace {
// Simply forget our current network
currentNet=nextNet;
} else {
- // our currentnet is included in next and types differ. Need to split the next network
+ // our currentNet is included in next and types differ. Need to split the next network
ipAddress[] newNets = nextNet.split();
+
+ // TODO: The contains method of the Priority is stupid linear search
+
// First add the second half to keep the order in networks
if (!networks.contains(newNets[1]))
networks.add(newNets[1]);
@@ -226,6 +252,7 @@ public class NetworkSpace {
}
// This network is bigger than the next and last ip of current >= next
+ //noinspection StatementWithEmptyBody
if (currentNet.included == nextNet.included) {
// Next network is in included in our network with the same type,
// simply ignore the next and move on
@@ -238,7 +265,7 @@ public class NetworkSpace {
if (BuildConfig.DEBUG) {
Assert.assertTrue (newNets[1].getFirstAddress().equals(nextNet.getFirstAddress()));
Assert.assertTrue (newNets[1].getLastAddress().equals(currentNet.getLastAddress()));
- // Splitted second equal the next network, do not add it
+ // split second equal the next network, do not add it
}
networks.add(nextNet);
} else {
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
index 0de54ed7..67c05e7d 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
@@ -48,8 +48,6 @@ public class OpenVPNThread implements Runnable {
public void stopProcess() {
mProcess.destroy();
}
-
-
@Override
public void run() {
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
index 4cba4f5f..e6e5be25 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java
@@ -9,11 +9,9 @@ import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
import android.util.Log;
-import org.jetbrains.annotations.NotNull;
+import junit.framework.Assert;
-import se.leap.bitmaskclient.R;
-import de.blinkt.openvpn.VpnProfile;
-import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
+import org.jetbrains.annotations.NotNull;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -22,7 +20,16 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.Vector;
+
+import se.leap.bitmaskclient.BuildConfig;
+import se.leap.bitmaskclient.R;
+import de.blinkt.openvpn.VpnProfile;
+import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
@@ -391,7 +398,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
*/
if(routeparts.length==5) {
- assert(routeparts[3].equals("dev"));
+ if (BuildConfig.DEBUG) Assert.assertEquals("dev", routeparts[3]);
mOpenVPNService.addRoute(routeparts[0], routeparts[1], routeparts[2], routeparts[4]);
} else if (routeparts.length >= 3) {
mOpenVPNService.addRoute(routeparts[0], routeparts[1], routeparts[2], null);
diff --git a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
index 43b27212..9d61247a 100644
--- a/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
+++ b/ics-openvpn-stripped/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
@@ -72,6 +72,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
private OpenVPNManagement mManagement;
private String mLastTunCfg;
private String mRemoteGW;
+ private Object mProcessLock = new Object();
// From: http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java
public static String humanReadableByteCount(long bytes, boolean mbit) {
@@ -110,7 +111,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
}
private void endVpnService() {
- mProcessThread = null;
+ synchronized (mProcessLock) {
+ mProcessThread = null;
+ }
VpnStatus.removeByteCountListener(this);
unregisterDeviceStateReceiver();
ProfileManager.setConntectedVpnProfileDisconnected(this);
@@ -124,46 +127,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
}
}
- private void showNotification(String msg, String tickerText, boolean lowpriority, long when, ConnectionStatus status) {
- String ns = Context.NOTIFICATION_SERVICE;
- NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
-
-
- int icon = getIconByConnectionStatus(status);
-
- android.app.Notification.Builder nbuilder = new Notification.Builder(this);
-
- if (mProfile != null)
- nbuilder.setContentTitle(getString(R.string.notifcation_title, mProfile.mName));
- else
- nbuilder.setContentTitle(getString(R.string.notifcation_title_notconnect));
-
- nbuilder.setContentText(msg);
- nbuilder.setOnlyAlertOnce(true);
- nbuilder.setOngoing(true);
- nbuilder.setContentIntent(getLogPendingIntent());
- nbuilder.setSmallIcon(icon);
-
-
- if (when != 0)
- nbuilder.setWhen(when);
-
-
- // Try to set the priority available since API 16 (Jellybean)
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
- jbNotificationExtras(lowpriority, nbuilder);
-
- if (tickerText != null && !tickerText.equals(""))
- nbuilder.setTicker(tickerText);
-
- @SuppressWarnings("deprecation")
- Notification notification = nbuilder.getNotification();
-
-
- mNotificationManager.notify(OPENVPN_STATUS, notification);
- startForeground(OPENVPN_STATUS, notification);
- }
-
private int getIconByConnectionStatus(ConnectionStatus level) {
switch (level) {
case LEVEL_CONNECTED:
@@ -314,11 +277,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mProfile = ProfileManager.get(this, profileUUID);
- String startTitle = getString(R.string.start_vpn_title, mProfile.mName);
- String startTicker = getString(R.string.start_vpn_ticker, mProfile.mName);
- showNotification(startTitle, startTicker,
- false, 0, LEVEL_CONNECTING_NO_SERVER_REPLY_YET);
-
// Set a flag that we are starting a new VPN
mStarting = true;
// Stop the previous session by interrupting the thread.
@@ -330,13 +288,14 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
//ignore
}
-
- if (mProcessThread != null) {
- mProcessThread.interrupt();
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- //ignore
+ synchronized (mProcessLock) {
+ if (mProcessThread != null) {
+ mProcessThread.interrupt();
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ //ignore
+ }
}
}
// An old running VPN should now be exited
@@ -380,9 +339,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
processThread = new OpenVPNThread(this, argv, env, nativelibdir);
}
- mProcessThread = new Thread(processThread, "OpenVPNProcessThread");
- mProcessThread.start();
-
+ synchronized (mProcessLock) {
+ mProcessThread = new Thread(processThread, "OpenVPNProcessThread");
+ mProcessThread.start();
+ }
if (mDeviceStateReceiver != null)
unregisterDeviceStateReceiver();
@@ -416,11 +376,12 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
@Override
public void onDestroy() {
- if (mProcessThread != null) {
- mManagement.stopVPN();
-
- mProcessThread.interrupt();
+ synchronized (mProcessLock) {
+ if (mProcessThread != null) {
+ mManagement.stopVPN();
+ }
}
+
if (mDeviceStateReceiver != null) {
this.unregisterReceiver(mDeviceStateReceiver);
}
@@ -639,10 +600,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mMtu = mtu;
mRemoteGW=null;
+ long netMaskAsInt = CIDRIP.getInt(netmask);
if (mLocalIP.len == 32 && !netmask.equals("255.255.255.255")) {
// get the netmask as IP
- long netMaskAsInt = CIDRIP.getInt(netmask);
int masklen;
if ("net30".equals(mode))
@@ -655,11 +616,18 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
if ((netMaskAsInt & mask) == (mLocalIP.getInt() & mask )) {
mLocalIP.len = masklen;
} else {
+ mLocalIP.len = 32;
if (!"p2p".equals(mode))
VpnStatus.logWarning(R.string.ip_not_cidr, local, netmask, mode);
- mRemoteGW=netmask;
}
}
+ if (("p2p".equals(mode)) && mLocalIP.len < 32 || "net30".equals("net30") && mLocalIP.len < 30) {
+ VpnStatus.logWarning(R.string.ip_looks_like_subnet, local, netmask, mode);
+ }
+
+
+ // Configurations are sometimes really broken...
+ mRemoteGW=netmask;
}
public void setLocalIPv6(String ipv6addr) {
@@ -690,14 +658,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mDisplayBytecount = false;
}
- // Other notifications are shown,
- // This also mean we are no longer connected, ignore bytecount messages until next
- // CONNECTED
- // Does not work :(
- String msg = getString(resid);
- String ticker = msg;
- showNotification(msg + " " + logmessage, ticker, lowpriority , 0, level);
-
}
}
@@ -717,9 +677,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
humanReadableByteCount(diffIn / OpenVPNManagement.mBytecountInterval, true),
humanReadableByteCount(out, false),
humanReadableByteCount(diffOut / OpenVPNManagement.mBytecountInterval, true));
-
- boolean lowpriority = !mNotificationAlwaysVisible;
- showNotification(netstat, null, lowpriority, mConnecttime, LEVEL_CONNECTED);
}
}
@@ -746,7 +703,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
} else {
String release = Build.VERSION.RELEASE;
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && !release.startsWith("4.4.3")
- && !release.startsWith("4.4.4") && !release.startsWith("4.4.5"))
+ && !release.startsWith("4.4.4") && !release.startsWith("4.4.5") && !release.startsWith("4.4.6"))
// There will be probably no 4.4.4 or 4.4.5 version, so don't waste effort to do parsing here
return "OPEN_AFTER_CLOSE";
else
diff --git a/ics-openvpn-stripped/main/src/main/res/values-cs/strings.xml b/ics-openvpn-stripped/main/src/main/res/values-cs/strings.xml
index 2377062e..f9b00af9 100755
--- a/ics-openvpn-stripped/main/src/main/res/values-cs/strings.xml
+++ b/ics-openvpn-stripped/main/src/main/res/values-cs/strings.xml
@@ -215,6 +215,7 @@
<string name="vpn_import_hint">Použij ikonu &lt;img src=\"ic_menu_archive\"/&gt; k imporu existujícího (.ovpn nebo .conf) profilu z SD karty.</string>
<string name="faq_hint">Ujisti se, že jsi si pročetl FAQ. Je zde nápověda pro rychlý start.</string>
<string name="faq_routing_title">Nastavení směrování/rozhraní</string>
+ <string name="faq_routing">Směrování a konfigurace rozhraní není provedena pomocí tradičních příkazů ifconfig/route, ale pomocí VPNService API. To má za následek odlišnou konfiguraci směrování, než na jiných operačních systémech. Konfigurace VPN tunelu se skládá z IP adresy a sítě, která má být směrována skrze toto rozhraní. Zejména není potřeba adresa protistrany nebo brány. Speciální směrování pro dosažení VPN serveru (například v případě použití redirect-gataway direktivy) také není potřeba. Aplikace bude toto nastavení při importu konfigurace ignorovat. Aplikace pomocí VPNService API zajišťuje, že spojení k VPN serveru není směrováno skrze tunel. Povoleno je pouze specifikování sítí, které se mají směrovat skrze tunel. Aplikace se snaží detekovat sítě, které by neměli procházet tunelem (např. route x.x.x.x y.y.y.y net_gateway) a vypočítává nastavení směrování tak, aby emulovalo správné chováni jako na ostatních platformách. Logovací okno ukazuje konfiguraci VPNService při navázání spojení.</string>
<string name="persisttun_summary">Nevracej se ke spojení mimo VPN, zatímco se OpenVPN připojuje.</string>
<string name="persistent_tun_title">Trvalý tun</string>
<string name="openvpn_log">OpenVPN Log</string>
@@ -311,10 +312,11 @@
<string name="unhandled_exception_context">%3$s: %1$s\n\n%2$s</string>
<string name="faq_system_dialog_xposed">Pokud máš rootnuté zařízení, můžeš nainstalovat &lt;a href=\"http://xposed.info/\"&gt;Xposed framework&lt;/a&gt; a &lt;a href=\"http://repo.xposed.info/module/de.blinkt.vpndialogxposed\"&gt;VPN potvrzovací modul&lt;/a&gt; na vlastní nebezpečí\"</string>
<string name="full_licenses">Plné licence</string>
- <string name="blocklocal_summary">Sítě přímo připojené na lokální interface nebudou směrovány skrze VPN. Odškrtnutím této volby bude přesměrován všechen lokální provoz do VPN.</string>
+ <string name="blocklocal_summary">Sítě přímo připojené na lokální rozhraní nebudou směrovány skrze VPN. Odškrtnutím této volby bude přesměrován všechen lokální provoz do VPN.</string>
<string name="blocklocal_title">Nepoužívat VPN pro lokální sítě</string>
<string name="userpw_file">Soubor pro Jméno/Heslo</string>
<string name="imported_from_file">[Importováno z: %s]</string>
- <string name="files_missing_hint">Některé soubory nemohly být nalezeny. Prosím vyberte profil, který chcete importovat:</string>
+ <string name="files_missing_hint">Některé soubory nemohly být nalezeny. Prosím vyber profil, který chceš importovat:</string>
+ <string name="openvpn_is_no_free_vpn">Pro používání této aplikace je potřeba VPN poskytovatel/brána, která podporuje OpenVPN (často je to zaměstnavatel). Pro více informací a návod na nastavení OpenVPN serveru navštiv http://community.openvpn.net/</string>
<string name="import_log">Import logu:</string>
</resources>
diff --git a/ics-openvpn-stripped/main/src/main/res/values-hu/strings.xml b/ics-openvpn-stripped/main/src/main/res/values-hu/strings.xml
new file mode 100755
index 00000000..6f864d83
--- /dev/null
+++ b/ics-openvpn-stripped/main/src/main/res/values-hu/strings.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.net-->
+<!-- Generated by crowdin.net -->
+<resources>
+ <string name="app">OpenVPN Androidhoz</string>
+ <string name="address">Szerver cím:</string>
+ <string name="port">Szerver port:</string>
+ <string name="location">Hely</string>
+ <string name="cant_read_folder">A könyvtár nem olvasható</string>
+ <string name="select">Választ</string>
+ <string name="cancel">Mégsem</string>
+ <string name="no_data">Nincs Adat</string>
+ <string name="useLZO">LZO tömörítés</string>
+ <string name="client_no_certificate">Nincs Tanúsítvány</string>
+ <string name="client_certificate_title">Kliens Tanúsítvány</string>
+ <string name="client_key_title">Kliens Privátkulcs</string>
+ <string name="client_pkcs12_title">PKCS12 Fájl</string>
+ <string name="ca_title">CA Tanúsítvány</string>
+ <string name="no_certificate">Válasszon egy tanúsítványt</string>
+ <string name="copyright_guicode">A forráskód és a hibakezelő elérhetősége http://code.google.com/p/ics-openvpn/</string>
+ <string name="copyright_others">A program a következő komponenseket használja; a licenszek összes részletei a forráskódban találhatóak</string>
+ <string name="about">Névjegy</string>
+ <string name="vpn_list_title">Profilok</string>
+ <string name="vpn_type">Típus</string>
+ <string name="pkcs12pwquery">PKCS12 Jelszó</string>
+ <string name="file_select">Válasszon&#8230;</string>
+ <string name="file_nothing_selected">Válasszon egy fájlt</string>
+ <string name="useTLSAuth">TLS-hitelesítés használata</string>
+ <string name="tls_direction">TLS irány</string>
+ <string name="ipv6_dialog_tile">Adja meg az IPv6 címet CIDR formában (pl.: 2000:dd::23/64)</string>
+ <string name="ipv4_dialog_title">Adja meg az IPv4 címet CIDR formában (pl.: 1.2.3.4/24)</string>
+ <string name="ipv4_address">IPv4 Cím</string>
+ <string name="ipv6_address">IPv6 Cím</string>
+ <string name="custom_option_warning">Egyéni OpenVPN opciók megadása. Körültekintéssel használja! Vegye figyelembe, hogy a tun-nal kapcsolatos OpenVPN beállítások nem támogatottak a VPNSettings felépítéséből adódóan. Ha úgy gondolja, hogy egy fontos opció hiányzik, lépjen kapcsolatba a fejlesztőkkel</string>
+ <string name="auth_username">Felhasználónév</string>
+ <string name="auth_pwquery">Jelszó</string>
+ <string name="static_keys_info">A statikus konfigurációhoz a TLS Auth Key-ek statikus kulcsokként lesznek használva</string>
+ <string name="configure_the_vpn">A VPN beállítása</string>
+ <string name="menu_add_profile">Profil hozzáadása</string>
+ <string name="add_profile_name_prompt">Adja meg az új Profil nevét</string>
+ <string name="duplicate_profile_name">Kérlek, egyedi profilnevet válassz magadnak</string>
+ <string name="profilename">Profil név</string>
+ <string name="no_keystore_cert_selected">Válassz egy felhasználói tanúsítványt</string>
+ <string name="no_error_found">hiba nem található</string>
+ <string name="config_error_found">Hiba a beállításokban</string>
+ <string name="ipv4_format_error">Hiba az IPv4 cím elemzésekor</string>
+ <string name="custom_route_format_error">Hiba az egyéni útvonalak elemzésekor</string>
+ <string name="pw_query_hint">(a lekérdezés igénye szerint hagyja üresen)</string>
+ <string name="vpn_shortcut">OpenVPN parancsikon</string>
+ <string name="vpn_launch_title">Csatlakozás a VPN-hez</string>
+ <string name="shortcut_profile_notfound">A parancsikonban kiválasztott Profil nem létezik</string>
+ <string name="random_host_prefix">Véletlen Host Prefix</string>
+ <string name="random_host_summary">6 random karakter hozzáadása a hosztnév elejére</string>
+ <string name="custom_config_title">Egyéni Beállítások engedélyezése</string>
+ <string name="custom_config_summary">Egyéni beállítások megadása. Óvatosan használja!</string>
+ <string name="route_rejected">Az Android elutasította az útvonalat</string>
+ <string name="cancel_connection">Szétkapcsolás</string>
+ <string name="cancel_connection_long">VPN kapcsolat szétkapcsolása</string>
+ <string name="clear_log">napló törlése</string>
+ <string name="title_cancel">jóváhagyás törlése</string>
+ <string name="cancel_connection_query">VPN kapcsolat/kapcsolódás megszakítása?</string>
+ <string name="remove_vpn">VPN kapcsolat eltávolítása</string>
+ <string name="check_remote_tlscert">Ellenőrzi, hogy a kiszolgáló használ-e tanúsitványt TLS Server kiterjesztéssel (--remote-cert-tls server)</string>
+ <string name="check_remote_tlscert_title">TLS server tanúsítvány megkövetelése</string>
+ <string name="remote_tlscn_check_summary">Ellenőrzi a Távoli Kiszolgáló Tanúsítvány Subject DN mezőt</string>
+ <string name="remote_tlscn_check_title">Tanúsítvány Kiszolgálónév Ellenőrzés</string>
+ <string name="enter_tlscn_dialog">Adja meg a távoli tanúsítvány DN ellenőrzését (pl.: C=DE, L=Paderborn, OU=Avian IP Carriers, CN=openvpn.blinkt.de)\n\nAdja meg a teljes DN-t vagy az RDN-t (openvpn.blinkt.de a példában) vagy egy RDN prefix-et az ellenőrzéshez.\n\nRDN prefix használatakor a \"Server\" egyezik a \"Server-1\"-gyel és a \"Server-2\"-vel\n\nA mező üresen hagyásakor az RDN a kiszolgáló nevével kerül ellenőrzésre.\n\nTovábbi részleteket az OpenVPN 2.3.1+ manuál oldalon talál —verify-x509-name</string>
+ <string name="enter_tlscn_title">Távoli tanúsítvány tárgy</string>
+ <string name="tls_key_auth">TLS Key Hitelesítés engedélyetése</string>
+ <string name="tls_auth_file">TLS Auth Fájl</string>
+ <string name="pull_on_summary">IP címek, útvonalak és időzítések lekérése a kiszolgálótól.</string>
+ <string name="pull_off_summary">Nem történt információkérés a kiszolgálótól. Alul meg kell adni a beállításokat.</string>
+ <string name="use_pull">Pull Beállítások</string>
+ <string name="dns">DNS</string>
+ <string name="override_dns">A kiszolgálótól kapott DNS Beállítások felülbírálása</string>
+ <string name="dns_override_summary">Saját DNS Szerverek használata</string>
+ <string name="searchdomain">searchDomain</string>
+ <string name="dns1_summary">a használatban levő DNS-kiszolgáló.</string>
+ <string name="dns_server">DNS szerver</string>
+ <string name="secondary_dns_message">A másodlagos DNS-kiszolgáló használható, ha a normál DNS-kiszolgáló nem érhető el.</string>
+ <string name="backup_dns">tartalék DNS szerver</string>
+ <string name="ignored_pushed_routes">Push-olt útvonalak figyelmen kívül hagyása</string>
+ <string name="ignore_routes_summary">A szerver által push-olt útvonalak figyelmen kívül hagyása.</string>
+ <string name="default_route_summary">A teljes forgalom átirányítása a VPN-re</string>
+ <string name="use_default_title">használja az alapértelmezett útvonalat</string>
+ <string name="custom_route_message">Egyéni útvonalak megadása. A célt csak CIDR formátumban adja meg. \"10.0.0.0/8 2002::/16\" átirányítaná a 10.0.0.0/8 és 2002::/16 hálózatokat a VPN-en.</string>
+ <string name="custom_route_message_excluded">Útvonalak amikek nem a VPN-en át kell route-olni.</string>
+ <string name="custom_routes_title">Egyéni útvonalak</string>
+ <string name="custom_routes_title_excluded">Hálózat kivételek</string>
+ <string name="log_verbosity_level">Napló részletességi szint</string>
+ <string name="float_summary">Hitelesített csomagok engedélyezése minden IP-ről</string>
+ <string name="float_title">Lebegő szerver engedélyezése</string>
+ <string name="custom_options_title">Egyéni beállítások</string>
+ <string name="edit_vpn">VPN-beállítások szerkesztése</string>
+ <string name="remove_vpn_query">\'%s\' VPN Profil eltávolítása?</string>
+ <string name="tun_error_helpful">Néhány egyedi ICS image-en a /dev/tun hozzáférési jogai rosszak lehetnek, vagy a tun modul teljesen hiányzik. CM9 imagek-en próbálja a fix tulajdonos opciót az általános beállításokban</string>
+ <string name="tun_open_error">Nem sikerült megnyitni a tun interfészt</string>
+ <string name="error">"Hiba:"</string>
+ <string name="clear">töröl</string>
+ <string name="last_openvpn_tun_config">tun interfész megnyitása:</string>
+ <string name="local_ip_info">Helyi IPv4: %1$s/%2$d IPv6: %3$s MTU: %4$d</string>
+ <string name="dns_server_info">DNS Szerver: %1$s, Domain: %2$s</string>
+ <string name="routes_info_incl">Útvonalak: %1$s %2$s</string>
+ <string name="routes_info_excl">Kizárt útvonalak: %1$s %2$s</string>
+ <string name="routes_debug">VpnService útvonalak telepítve: %1$s %2$s</string>
+ <string name="ip_not_cidr">Érkezett interfész információk: %1$s és %2$s, feltételezve a második cím a távoli oldali cím. /32 alhálózati maszk lesz használva a helyi IP-hez. OpenVPN beállította a módokat: \"%3$s\".</string>
+ <string name="route_not_cidr">Nincs értelme a %1$s és %2$s-nek, mint IP útvonalnak CIDR alhálózati maszkkal, /32 alhálózati maszk kerül használatra.</string>
+ <string name="route_not_netip">Az %1$s/%2$s útvonal javítva: %3$s/%2$s</string>
+ <string name="keychain_access">Nem sikerült hozzáférni az Android Keychain Tanúsivànyokhoz. Ezt egy firmware frissítés vagy az alkalmazás/beállításainak visszaállítása okozhatja. Kérem szerkessze meg a VPN-t, és újra válassza ki a tanúsítványokat az alapvető beállításoknál, hogy visszaálljanak a tanúsítványok hozzáférési jogai.</string>
+ <string name="version_info">%1$s %2$s</string>
+ <string name="send_logfile">naplófájl küldése</string>
+ <string name="send">küld</string>
+ <string name="ics_openvpn_log_file">ICS OpenVPN naplófájl</string>
+ <string name="copied_entry">Naplóbejegyzés másolva a vágólapra</string>
+ <string name="tap_mode">Tap mód</string>
+ <string name="faq_tap_mode">Tap mód nem lehetséges nem-root VPN API-val. Ez által az alkalmazás nem kínál tap támogatást</string>
+ <string name="tap_faq2">Megint? Viccelsz? Nem, a tap mód tényleg nem támogatott és további levelek küldése hogy támogatott lesz-e sem fog segíteni.</string>
+ <string name="tap_faq3">Harmadszor is? Tulajdonképpen lehetne írni egy tap emulátort a tun alapján ami képes layer2 adatokat is küldeni és fogadni, de ennek a tap emulátornak implementálnia kell ARP-t és lehetőleg egy DHCP klienst is. Nem tudok róla, hogy bárki is ezen az irányon dolgozna. Ha lenne kedve ilyet kódolni, lépjen kapcsolatba velem.</string>
+ <string name="faq">GYIK</string>
+ <string name="copying_log_entries">naplóbejegyzések másolása</string>
+ <string name="faq_copying">Másoláshoz nyomja le és tartsa lenyomva a naplóbejegyzést. A teljes napló küldéséhez használja a Napló Küldése opciót. Használja a hardver menü gombot ha nem látható a GUI-ban.</string>
+ <string name="faq_shortcut">Parancsikon az indításhoz</string>
+ <string name="faq_howto_shortcut">Az asztalra helyezhet egy OpenVPN parancsikont. A képernyőkezelő programtól függően parancsikont vagy widget-et helyezhet el.</string>
+ <string name="no_vpn_support_image">Az image-ed nem támogatja a VPNService API-t, elnézést :(</string>
+ <string name="encryption">Titkosítás</string>
+ <string name="cipher_dialog_title">Adja meg a titkosítási módszert</string>
+ <string name="chipher_dialog_message">Adja meg az OpenVPN által használt titkosítási algoritmust. Hagyja üresen az alapértelmezett kódoláshoz.</string>
+ <string name="auth_dialog_message">Adja meg az OpenVPN által használt authentication digest-et. Hagyja üresen az alapértelmezett digest-hez.</string>
+ <string name="settings_auth">Hitelesítés/Titkosítás</string>
+ <string name="file_explorer_tab">Fájlkezelő</string>
+ <string name="inline_file_tab">Beágyazott fájl</string>
+ <string name="error_importing_file">Hiba a fájl importálása közben</string>
+ <string name="import_error_message">Nem sikerült importálni a Fájlt a fájlrendszerből</string>
+ <string name="inline_file_data">[[Beágyazott fájladatok]]</string>
+ <string name="opentun_no_ipaddr">IP információ nélküli tun eszköz megnyitás megtagadva</string>
+ <string name="menu_import">Profil import ovpn fájlból</string>
+ <string name="menu_import_short">Import</string>
+ <string name="import_content_resolve_error">Nem sikerült beolvasni az importálási profilt</string>
+ <string name="error_reading_config_file">Hiba a konfigurációs fájl olvasása közben</string>
+ <string name="add_profile">Profil hozzáadása</string>
+ <string name="import_could_not_open">%1$s fájl nem található, pedig az importált konfigurációs fájlban hivatkozás van rá</string>
+ <string name="importing_config">Konfigurációs fájl importálása %1$s forrásból</string>
+ <string name="import_warning_custom_options">A konfiguráció tartalmaz néhány opciót, amik nincsenek UI konfigurációhoz rendelve. Ezek az opciók az egyéni konfiguráció alatt találhatók. Az egyéni konfiguráció lent látható:</string>
+ <string name="import_done">Konfigurációs fájl olvasása kész.</string>
+ <string name="nobind_summary">Ne bind-eljen helyi címhez és porthoz</string>
+ <string name="no_bind">Nincs helyi bind</string>
+ <string name="import_configuration_file">Konfigurációs fájl importálása</string>
+ <string name="faq_security_title">Biztonsági szempontok</string>
+ <string name="import_vpn">Import</string>
+ <string name="broken_image_cert_title">Hiba a tanúsítvány kiválasztása során</string>
+ <string name="broken_image_cert">Exception történt az Android 4.0+ tanúsítvány legördülő megjelenítésekor. Ennek sohasem szabad megtörténnie, mivel ez egy szavványos Android 4.0+ funkció. Lehet, hogy az Android ROM tanúsítványtár támogatása nem működik megfelelően</string>
+ <string name="ipv4">IPv4</string>
+ <string name="ipv6">IPv6</string>
+ <string name="speed_waiting">Állapot üzenetre várakozás&#8230;</string>
+ <string name="converted_profile">importált profil</string>
+ <string name="converted_profile_i">%d profil importálva</string>
+ <string name="broken_images">Működésképtelen image-ek</string>
+ <string name="pkcs12_file_encryption_key">PKCS12 Fájltitkosítási kulcs</string>
+ <string name="private_key_password">Privát kulcs jelszó</string>
+ <string name="password">Jelszó</string>
+ <string name="file_icon">fájlikon</string>
+ <string name="tls_authentication">TLS hitelesítés</string>
+ <string name="generated_config">Generált konfiguráció</string>
+ <string name="generalsettings">Beállítások</string>
+ <string name="owner_fix_summary">/dev/tun tulajdonosának beállítása. Néhány CM9 image-hez ez kell, hogy a VPNService API működjön. Root szükséges.</string>
+ <string name="owner_fix">Fix tulajdonos a /dev/tun-hoz</string>
+ <string name="generated_config_summary">Generált OpenVPN konfigurációs fájl megmutatása</string>
+ <string name="edit_profile_title">\"%s\" szerkesztése</string>
+ <string name="building_configration">Konfiguráció felépítése&#8230;</string>
+ <string name="netchange_summary">Ennek az opciónak a bekapcsolása erőlteti az újracsatlakozást ha a hálózati állapot megváltozik (pl.: WiFi-re/ről mobil-ra/ról)</string>
+ <string name="netchange">Újracsatlakozás hálózatváltáskor</string>
+ <string name="netstatus">Hálózati állapot: %s</string>
+ <string name="extracahint">A CA tanúsítvány általában visszajön az Android Keystore-ból. Adjon meg egy külön tanúsítványt ha tanúsítvány-ellenőrzési hibát kap.</string>
+ <string name="select_file">Választ</string>
+ <string name="keychain_nocacert">Nem jött vissza CA tanúsítvány az Android keystore olvasása során. A hitelesítés valószínűleg sikertelen lesz.</string>
+ <string name="show_log_summary">Napló ablak mutatása a csatlakozás alatt. A napló ablak mindig elérető a rolóról is.</string>
+ <string name="show_log_window">Naplózási ablak mutatása</string>
+ <string name="mobile_info">%1$s (%2$s) %3$s, Android API %4$d</string>
+ <string name="error_rsa_sign">Hiba az Android keystore %1$s: %2$s kulccsal való belépéskor</string>
+ <string name="faq_system_dialogs_title">Kapcsolat figyelmeztetés és értesítés hang</string>
+ <string name="translationby">A magyar fordítást készítette Juhász Sándor &lt;msc@digitaltrip.hu&gt;</string>
+ <string name="ipdns">IP és DNS</string>
+ <string name="basic">Alapvető</string>
+ <string name="routing">Útválasztás</string>
+ <string name="obscure">Obscure OpenVPN beállítások. Általában nem szükséges.</string>
+ <string name="advanced">Speciális</string>
+ <string name="export_config_title">ICS Openvpn Konfiguráció</string>
+ <string name="warn_no_dns">Nincsenek DNS szerverek használatban. A névfeloldás nem működik. Fontolja meg az egyéni DNS szerverek beállítását. Kérjük, vegye figyelembe, hogy az Android továbbra is ugyanazokat a proxy beállításokat fogja használni a mobil/WiFi csatlakozáshoz, mint amit a DNS szerverek megadása előtt.</string>
+ <string name="dns_add_error">Nem lehet hozzáadni a %1$s DNS szervert, a rendszer elutasította: %2$s</string>
+ <string name="ip_add_error">A \"%1$s\" IP címet nem lehet konfigurálni, a rendszer elutasította: %2$s</string>
+ <string name="faq_howto_title">Quick Start</string>
+ <string name="setting_loadtun_summary">Próbálja meg betölteni a tun.ko kernel modult mielőtt megpróbál csatlakozni. Root-olt eszköz szükséges.</string>
+ <string name="setting_loadtun">Tun modul betöltése</string>
+ <string name="importpkcs12fromconfig">PKCS12 konfiguráció importálása az Android Keystore-ba</string>
+ <string name="getproxy_error">Hiba a proxy beállítások lekérésekor: %s</string>
+ <string name="using_proxy">Proxy használatban: %1$s %2$d</string>
+ <string name="use_system_proxy">Rendszerproxy használata</string>
+ <string name="use_system_proxy_summary">Rendszerszintű konfiguráció használata a HTTP/HTTPS proxy csatlakozáshoz.</string>
+ <string name="donatewithpaypal">&lt;a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;amp;cmd=_s-xclick\"&gt;Adakozhat PayPal-al&lt;/a&gt; </string>
+ <string name="onbootrestartsummary">Az OpenVPN újracsatlakozik a VPN-hez ha az aktív volt az újraindításkoz/leállításkor.</string>
+ <string name="onbootrestart">Újracsatlakozás újraindításkor</string>
+ <string name="ignore">Hagyja figyelmen kívül</string>
+ <string name="restart">Újraindítás</string>
+ <string name="restart_vpn_after_change">A konfiguráció változások a VPN újraindítása után lépnek életbe. (Újra)indítja most a VPN-t?</string>
+ <string name="configuration_changed">A konfiguráció megváltozott</string>
+ <string name="log_no_last_vpn">A legutóbb csatlakozott profil nem található</string>
+ <string name="no_vpn_profiles_defined">Nincsenek VPN profilok definiálva.</string>
+ <string name="add_new_vpn_hint">Használd az &lt;img src=\"ic_menu_add\"/&gt; ikont új VPN hozzáadásához</string>
+ <string name="vpn_import_hint">Használd az &lt;img src=\"ic_menu_archive\"/&gt; ikont egy SD-kártyán meglevő (.ovpn or .conf) profil importálásához.</string>
+ <string name="faq_hint">Tekintse meg a FAQ-ot. Ott van egy a kezdeti lépéseket segítő leírás.</string>
+ <string name="faq_routing_title">Routing/Interfész Beállítás</string>
+ <string name="persisttun_summary">Ne térjen vissza VPN kapcsolat nélküli módba, amikor az OpenVPN újracsatlakozik.</string>
+ <string name="persistent_tun_title">Megmaradó tun</string>
+ <string name="openvpn_log">OpenVPN Napló</string>
+ <string name="import_config">OpenVPN konfiguráció importálása</string>
+ <string name="battery_consumption_title">Akkumulátor használat</string>
+ <string name="vpn_tethering_title">VPN és Internetmegosztás</string>
+ <string name="connection_retries">Csatlakozás újrapróbálkozások</string>
+ <string name="reconnection_settings">Újracsatlakozás beállítások</string>
+ <string name="connectretrymessage">Csatlakozási próbálkozások közötti várakozási idő másodpercben.</string>
+ <string name="connectretrywait">Csatlakozások közotti idő másodpercben</string>
+ <string name="minidump_generated">Az OpenVPN váratlanul összeomlott. Kérem, gondolja meg a főmenüben levő Minidump elküldése opció használatát</string>
+ <string name="send_minidump">Minidump elküldése a fejlesztőnek</string>
+ <string name="send_minidump_summary">Hibakeresési információkat küld a fejlesztőnek a legutóbbi összeomlásról</string>
+ <string name="notifcation_title">OpenVPN - %s</string>
+ <string name="session_ipv4string">%1$s - %2$s</string>
+ <string name="session_ipv6string">%1$s - %3$s, %2$s</string>
+ <string name="state_connecting">Csatlakozás</string>
+ <string name="state_wait">Várakozás a szerver válaszára</string>
+ <string name="state_auth">Hitelesítés</string>
+ <string name="state_get_config">Kliens konfiguráció lekérése</string>
+ <string name="state_assign_ip">IP címek kiosztása</string>
+ <string name="state_add_routes">Útvonalak hozzáadása</string>
+ <string name="state_connected">Csatlakoztatva</string>
+ <string name="state_disconnected">Szétkapcsolás</string>
+ <string name="state_reconnecting">Újracsatlakozás</string>
+ <string name="state_exiting">Kilépés</string>
+ <string name="state_noprocess">Nem fut</string>
+ <string name="state_resolve">Állomásnevek feloldása</string>
+ <string name="state_tcp_connect">Csatlakozás (TCP)</string>
+ <string name="state_auth_failed">Hitelesítési hiba</string>
+ <string name="state_nonetwork">Várakozás használható hálózatra</string>
+ <string name="statusline_bytecount">↓%2$s/s %1$s - ↑%4$s/s %3$s</string>
+ <string name="notifcation_title_notconnect">Nincs kapcsolat</string>
+ <string name="start_vpn_title">Csatlakozás VPN-hez %s</string>
+ <string name="start_vpn_ticker">Csatlakozás VPN-hez %s</string>
+ <string name="jelly_keystore_alphanumeric_bug">Néhány Android 4.1-es verzió alatt problémába ütközhet ha a hitelesítési tanúsítvány nevében nem csak alfanumerikus karakterek szerepelnek (mint pl szóköz, alulvonás vagy kötőjel). Speciális karakterek nélkül próbálja újra importálni</string>
+ <string name="encryption_cipher">Titkosítás</string>
+ <string name="packet_auth">Csomag hitelesítés</string>
+ <string name="auth_dialog_title">Adja meg a csomaghitelesítési metódust</string>
+ <string name="mobile_info_extended">%1$s (%2$s) %3$s, Android API %4$d, %5$s, %6$s verzió</string>
+ <string name="built_by">%s fordítóval</string>
+ <string name="debug_build">hibakeresési fordítás</string>
+ <string name="official_build">hivatalos build</string>
+ <string name="make_selection_inline">Másolás profilba</string>
+ <string name="crashdump">Crashdump</string>
+ <string name="add">Hozzáad</string>
+ <string name="send_config">Konfig fájl küldése</string>
+ <string name="complete_dn">Teljes DN</string>
+ <string name="remotetlsnote">Az importált konfiguráció a régi tls-remote konfigurációt használta, ami egy másik DN formátumban volt.</string>
+ <string name="rdn">RDN (közös név)</string>
+ <string name="rdn_prefix">RDN előtag</string>
+ <string name="tls_remote_deprecated">tls-remote (elavult)</string>
+ <string name="help_translate">Segíthetsz fordítani ha meglátogatod http://crowdin.net/project/ics-openvpn/invite</string>
+ <string name="prompt">%1$s próbálkozás %2$s vezérlésre</string>
+ <string name="remote_trust">Megbízom ebben az alkalmazásban.</string>
+ <string name="no_external_app_allowed">Egy alkalmazás sem használhat külső API-t</string>
+ <string name="allowed_apps">Engedélyezett alkalmazások: %s</string>
+ <string name="clearappsdialog">Engedélyezett külső alkalmazások listájának törlése?\nAz engedélyezett alkalmazások aktuális listája:\n\n%s</string>
+ <string name="screenoff_title">VPN kapcsolat szüneteltetése a képernyő lekapcsolása után</string>
+ <string name="screenoff_pause">Kapcsolat szüneteltetése a képernyő kikapcsolt állapotában: kevesebb mint %1$s %2$ss alatt</string>
+ <string name="screen_nopersistenttun">Figyelmeztetés: Megmaradó tun nem engedélyezett ehhez a VPN-hez. A forgalom a normál internetcsatlakozáson megy amikor a képernyő ki van kapcsolva.</string>
+ <string name="save_password">Jelszó mentése</string>
+ <string name="timestamp_short">Rövid</string>
+ <string name="timestamp_iso">ISO</string>
+ <string name="timestamps">Időbélyegzők</string>
+ <string name="timestamps_none">Egyik sem</string>
+ <string name="uploaded_data">Feltöltés</string>
+ <string name="downloaded_data">Letöltés</string>
+ <string name="vpn_status">Vpn állapot</string>
+ <string name="logview_options">Nézet beállításai</string>
+ <string name="unhandled_exception">Nem kezelt kivétel: %1$s\n\n%2$s</string>
+ <string name="full_licenses">Teljes engedélyek</string>
+</resources>
diff --git a/ics-openvpn-stripped/main/src/main/res/values-in/strings.xml b/ics-openvpn-stripped/main/src/main/res/values-in/strings.xml
new file mode 100755
index 00000000..0a7d32b0
--- /dev/null
+++ b/ics-openvpn-stripped/main/src/main/res/values-in/strings.xml
@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Generated by crowdin.net-->
+<!-- Generated by crowdin.net -->
+<resources>
+ <string name="app">OpenVPN untuk Android</string>
+ <string name="address">Alamat Server:</string>
+ <string name="port">Port server:</string>
+ <string name="location">Lokasi</string>
+ <string name="cant_read_folder">Gagal membaca direktori</string>
+ <string name="select">Pilih</string>
+ <string name="cancel">Batal</string>
+ <string name="no_data">Tak ada data</string>
+ <string name="useLZO">Kompresi LZO</string>
+ <string name="client_no_certificate">Tanpa Sertifikat</string>
+ <string name="client_certificate_title">Sertifikat Klien</string>
+ <string name="client_key_title">Kunci Sertifikat Klien</string>
+ <string name="client_pkcs12_title">Berkas PKCS12</string>
+ <string name="ca_title">Sertifikat CA</string>
+ <string name="no_certificate">Anda harus memilih sertifikat</string>
+ <string name="copyright_guicode">Kode program dan perekam masalah tersedia di</string>
+ <string name="copyright_others">Aplikasi memakai komponen berikut; lihat kode program untuk lebih jelas mengenai lisensi</string>
+ <string name="about">Tentang…</string>
+ <string name="vpn_list_title">Profil</string>
+ <string name="vpn_type">Tipe</string>
+ <string name="pkcs12pwquery">Password PKCS12</string>
+ <string name="file_select">Pilih&#8230;</string>
+ <string name="file_nothing_selected">Anda harus memilih berkas (file)</string>
+ <string name="useTLSAuth">Pakai otentikasi TLS</string>
+ <string name="tls_direction">Pengarah TLS</string>
+ <string name="ipv6_dialog_tile">Masukkan IPv6 Address/Netmask dalam format CIDR (contoh: 2000:dd::23/64)</string>
+ <string name="ipv4_dialog_title">Masukkan IPv4 Address/Netmask dalam format CIDR (contoh: 1.2.3.4/24)</string>
+ <string name="ipv4_address">Alamat IPv4</string>
+ <string name="ipv6_address">Alamat IPv6</string>
+ <string name="custom_option_warning">Masukan seting openvpn. Gunakan dengan hati-hati. Harap dicatat, TUN yanng terkait seting OpenVPN tidak didukung oleh VPNsettings. Jika anda berpikir ada hal penting belum tersedia, hubungi pembuatnya</string>
+ <string name="auth_username">Nama Penguna</string>
+ <string name="auth_pwquery">Password</string>
+ <string name="static_keys_info">Untuk konfigurasi statis, kunci otentifikasi TLS akan digunakan sebagai kunci konfigurasi statis</string>
+ <string name="configure_the_vpn">Konfigurasi VPN</string>
+ <string name="menu_add_profile">Tambah Profil</string>
+ <string name="add_profile_name_prompt">Masukkan nama profil yang baru</string>
+ <string name="duplicate_profile_name">Silakan masukan UPN (Unique Profile Name)</string>
+ <string name="profilename">Nama profil</string>
+ <string name="no_keystore_cert_selected">Anda harus memilih sertifikat pengguna</string>
+ <string name="no_error_found">Tidak ada kesalahan</string>
+ <string name="config_error_found">Konfigurasi Salah</string>
+ <string name="ipv4_format_error">Gagal menganalisa alamat IPV4</string>
+ <string name="custom_route_format_error">Gagal menganalisa rute buatan</string>
+ <string name="pw_query_hint">(biarkan kosong untuk antrian permintaan)</string>
+ <string name="vpn_shortcut">Jalan Pintas OpenVPN</string>
+ <string name="vpn_launch_title">Hubungkan VPN</string>
+ <string name="shortcut_profile_notfound">Profil di shrotcut tidak ada</string>
+ <string name="random_host_prefix">Acak awalan Host </string>
+ <string name="random_host_summary">Tambah 6 karakter acak di depan nama host</string>
+ <string name="custom_config_title">Aktifkan pilihan buatan</string>
+ <string name="custom_config_summary">Tentukan seting buatan. Gunakan hati-hati</string>
+ <string name="route_rejected">Rute ditolak Android</string>
+ <string name="cancel_connection">Putus</string>
+ <string name="cancel_connection_long">Memutuskan sambungan VPN</string>
+ <string name="clear_log">Bersihkan catatan</string>
+ <string name="title_cancel">Batal Konfirmasi</string>
+ <string name="cancel_connection_query">Putuskan sambungan VPN/Batalkan usaha menyambungkan VPN?</string>
+ <string name="remove_vpn">Singkirkan VPN</string>
+ <string name="check_remote_tlscert">Memeriksa apakah server menggunakan sertifikat dengan ekstensi TLS Server (--server remote-cert-tls)</string>
+ <string name="check_remote_tlscert_title">Mengharapkan sertifikat server TLS</string>
+ <string name="remote_tlscn_check_summary">Memeriksa sertifikat Remote Server Subjek DN</string>
+ <string name="remote_tlscn_check_title">Cek nama sertifikat Host</string>
+ <string name="enter_tlscn_dialog">Tentukan nilai ynag digunakan untuk memverifikasi sertifikat remote DN (misal C=nama perusahaan, L=Kota lokasi, OU=nama departemen perusahaan, CN=openvpn.blinkt.de. Tentukan DN atau RDN yang lengkap (dalam contoh : openvpn.blinkt.de) atau sebuah awalan RDN untuk verifikasi. Saat memakai RDN awalan \"server\" cocok dengan \"server-1\" dan \"server-2\". Mengosongkan field akan membuat RDN diperiksa dengan nama host server. Lebih jelasnya lihat OpenVPN 2.3.1 manpage di bagian -verify-x509-name</string>
+ <string name="enter_tlscn_title">Subyek sertifikat remote</string>
+ <string name="tls_key_auth">Aktifkan otentifikasi kunci TLS</string>
+ <string name="tls_auth_file">Berkas otintikasi TLS</string>
+ <string name="pull_on_summary">Meminta pilihan alamat IP, rute dan waktu dari server.</string>
+ <string name="pull_off_summary">Tidak ada informasi diminta dari server. Seting harus ditentukan di bawah ini</string>
+ <string name="use_pull">Tarik pengaturan</string>
+ <string name="dns">DNS</string>
+ <string name="override_dns">Menimpa pengaturan DNS oleh Server</string>
+ <string name="dns_override_summary">Gunakan server DNS pribadi</string>
+ <string name="searchdomain">Cari domain</string>
+ <string name="dns1_summary">Server DNS yang akan digunakan</string>
+ <string name="dns_server">Server DNS</string>
+ <string name="secondary_dns_message">Server DNS sekunder digunakan jika Server DNS yang normal tidak dapat dicapai.</string>
+ <string name="backup_dns">Server DNS cadangan</string>
+ <string name="ignored_pushed_routes">Abaikan rute yang diberikan</string>
+ <string name="ignore_routes_summary">Abaikan rute yang diberikan server</string>
+ <string name="default_route_summary">Alihkan semua lalulintas data melalui VPN</string>
+ <string name="use_default_title">Gunakan rute standar</string>
+ <string name="custom_route_message">Masukkan rute butan sendiri. Masukkan tujuan dalam format CIDR. \"10.0.0.0/8 2002:: / 16\" akan mengarahkan jaringan 10.0.0.0/8 dan 2002:: / 16 melalui jaringan VPN</string>
+ <string name="custom_routes_title">Rute buatan sendiri</string>
+ <string name="log_verbosity_level">Tingkat rincian catatan</string>
+ <string name="float_summary">Ijinkan paket terotentifikasi dari semua IP</string>
+ <string name="float_title">Ijinkan server mengambang</string>
+ <string name="custom_options_title">Pilihan buatan</string>
+ <string name="edit_vpn">Ubah seting OpenVPN</string>
+ <string name="remove_vpn_query">Hapus profil \'%s\'?</string>
+ <string name="tun_error_helpful">Pada beberapa setelan manual gambar ICS izin pada/dev/tun mungkin salah, atau modul tun mungkin hilang sepenuhnya. Untuk gambar CM9, coba perbaiki pilihan kepemilikannya di bawah pengaturan umum</string>
+ <string name="tun_open_error">Gagal membuka layanan antarmuka TUN</string>
+ <string name="error">"Kesalahan: "</string>
+ <string name="clear">Bersihkan</string>
+ <string name="last_openvpn_tun_config">Membuka interface tun :</string>
+ <string name="local_ip_info">IPv4 lokal : %1$s/%2$d IPv6: %3$s MTU: %4$d</string>
+ <string name="dns_server_info">DNS Server: %1$s, Domain: %2$s</string>
+ <string name="ip_not_cidr">Memilki informasi antarmuka %1$s dan %2$s, asumsi alamat kedua adalah alamat remote. Menggunakan netmask /32 untuk IP lokal. Mode yang diberikan oleh OpenVPN adalah \"%3$s\".</string>
+ <string name="route_not_cidr">Tidak masuk akal membuat %1$s dan %2$s sebagai rute IP dengan netmask CIDR, Gunakan /32 sebagai netmask.</string>
+ <string name="route_not_netip">rute yang diperbaiki %1$s/%2$s hingga %3$s/%2$s</string>
+ <string name="keychain_access">Tidak dapat mengakses sertifikat Keychain Android. Dapat disebabkan karena upgrade firmware atau pengembalian backup pengaturan app. Mohon ubah VPN, dan pilih ulang sertifikat berbasis pengaturan dasar agar izin mengakses sertifikat dapat dibuat ulang.</string>
+ <string name="version_info">%1$s %2$s</string>
+ <string name="send_logfile">Kirim berkas catatan</string>
+ <string name="send">Kirim</string>
+ <string name="ics_openvpn_log_file">Berkas catatan ICS OpenVPN</string>
+ <string name="copied_entry">Salin catatan masuk ke clipboard</string>
+ <string name="tap_mode">Mode TAP</string>
+ <string name="faq_tap_mode">Mode TAP tidak diijinkan tanpa VPN API non admin/root. Karena itu aplikasi ini tidak dapat memberikan dukungan mode TAP</string>
+ <string name="tap_faq2">Lagi ? Becanda ? mode TAP benar-benar tidak didukung dan mengirim email menanyakan apakah akan ada dukungan TAP, tidak akan membantu</string>
+ <string name="tap_faq3">Untuk ketiga kalinya? Sebenarnya, seseorang bisa menulis emulator TAP berdasarkan tun yang akan menambahkan lapisan2 informasi pengiriman dan lapisan2 informasi penerimaan. Tapi emulator TAP ini juga harus menerapkan ARP dan mungkin klien DHCP. Saya tidak tau apakah ada yang bekerja ke arah ini. Hubungi saya jika Anda ingin memulai menulis kode2 emulator TAP ini.</string>
+ <string name="faq">FAQ</string>
+ <string name="copying_log_entries">Menyalin catatan</string>
+ <string name="faq_copying">Untuk menyalin satu catatan masuk, Tekan dan tahan di catatan masuk. Untuk meyanlin\mengirim seluruh catatan, gunakan opsi Kirim Log. Gunakan tombol perangkat keras jika tidak terlihat di GUI.</string>
+ <string name="faq_shortcut">Jalan pintas memulai</string>
+ <string name="faq_howto_shortcut">Anda dapat menempatkan jalan pintas untuk memulai OpenVPN pada desktop Anda. Tergantung pada program homescreen Anda, Anda harus menambahkan jalan pintas atau widget.</string>
+ <string name="no_vpn_support_image">Gambar Anda tidak mendukung VPNService API, maaf:(</string>
+ <string name="encryption">Enkripsi</string>
+ <string name="cipher_dialog_title">Masukkan metode enkripsi</string>
+ <string name="chipher_dialog_message">Masukkan sandi enkripsi algoritma yang digunakan oleh OpenVPN. Biarkan kosong untuk menggunakan sandi default.</string>
+ <string name="auth_dialog_message">Masukkan digest otentikasi yang digunakan OpenVPN. Biarkan kosong untuk menggunakan standar digest.</string>
+ <string name="settings_auth">Otentikasi/Enkripsi</string>
+ <string name="file_explorer_tab">Penjelajah berkas</string>
+ <string name="inline_file_tab">Inline File</string>
+ <string name="error_importing_file">Gagal mengambil berkas</string>
+ <string name="import_error_message">Tidak dapat mengambil berkas dari filesystem</string>
+ <string name="inline_file_data">[[Inline file data]]</string>
+ <string name="opentun_no_ipaddr">TUN tidak dapat dibuka tanpa informasi IP</string>
+ <string name="menu_import">Ambil profil dari berkas ovpn</string>
+ <string name="menu_import_short">Ambil</string>
+ <string name="import_content_resolve_error">Tidak dapat membaca profil yang akan diambil</string>
+ <string name="error_reading_config_file">Kesalahan membaca berkas konfigurasi</string>
+ <string name="add_profile">Tambah Profil</string>
+ <string name="import_could_not_open">Tidak dapat menemukan berkas %1$s yang disebut dalam berkas konfigurasi</string>
+ <string name="importing_config">Mengambil berkas konfigurasi dari sumber %1$s</string>
+ <string name="import_warning_custom_options">Konfigurasi Anda memiliki beberapa pilihan konfigurasi yang tidak dipetakan ke konfigurasi UI. Pilihan ini ditambahkan sebagai opsi konfigurasi kustom. Konfigurasi kustom ditampilkan di bawah ini:</string>
+ <string name="import_done">Berkas konfigurasi selesai dibaca</string>
+ <string name="nobind_summary">Jangan kaitkan ke alamat dan port lokal</string>
+ <string name="no_bind">Tidak ada ikatan lokal</string>
+ <string name="import_configuration_file">Ambil berkas konfigurasi</string>
+ <string name="faq_security_title">Pertimbangan Keamanan</string>
+ <string name="faq_security">"Karena OpenVPN adalah sensitif pada isu keamanan, beberapa catatan tentang keamanan dianggap perlu. Semua data pada sdcard pada dasarnya tidak aman. Setiap app dapat membaca (misalnya program ini tidak perlu hak khusus untuk membaca sd-card). Data dari aplikasi ini hanya dapat dibaca oleh aplikasi itu sendiri. Dengan menggunakan opsi impor untuk cacert/cert/kunci dalam file dialog data yang disimpan dalam profil VPN. Profil VPN hanya dapat diakses oleh aplikasi ini. (Jangan lupa untuk menghapus salinan pada sd-card setelah itu). Bahkan meskipun dapat diakses hanya dengan aplikasi ini data masih tidak terenkripsi. Dengan melakukan rooting atau eksploitasi lainnya maka memungkinkan mengambil data. Sandi-sandi (passwords) juga tersimpan dalam teks biasa. Berkas pkcs12 sangat dianjurkan Anda mengimpornya ke android keystore."</string>
+ <string name="import_vpn">Impor</string>
+ <string name="broken_image_cert_title">Kesalahan menampilkan sertifikat</string>
+ <string name="broken_image_cert">Mendapat pesan kesalahan saat berusaha menampilkan layar pemilihan sertifikat Android 4.0+. Ini seharusnya tidak terjadi karena ini fitur standar Android 4.0 +. Mungkin ROM Android anda yang mengurus penyimpanan sertifikat rusak</string>
+ <string name="ipv4">IPv4</string>
+ <string name="ipv6">IPv6</string>
+ <string name="speed_waiting">Menunggu pesan status&#8230;</string>
+ <string name="converted_profile">Profil yang diambil</string>
+ <string name="converted_profile_i">profil yang diambil %d</string>
+ <string name="broken_images">Gambar rusak</string>
+ <string name="broken_images_faq">Image HTC yang resmi diketahui memiliki masalah routing yang ganjilyang menyebabkan trafik data tidak melalui tunnel (Lihat di &lt;a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=18\"&gt;Issue 18&lt;/a&gt; di bagian bug tracker.))&lt;/p&gt;&lt;p&gt; Image SONY resmi yang lama dari Xperia Arc S and Xperia Ray telah dilaporkan tidak memiliki VPNService dalam Imagenya. (Lihat juga &lt;a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=29\"&gt;Issue 29&lt;/a&gt; di bagian bug tracker.))&lt;/p&gt;&lt;p&gt;Pada image yang dibuat non resmi, modul TUN mungkin tak ada atau hak /dev/tun mungkin salah. Beberapa image CM9 memerlukan pilihan \"Fix ownership\" di bagian \"Device specific hacks\" diaktfikan. .&lt;/p&gt;&lt;p&gt; Lebih penting lagi, jika device anda memiliki image android yang lengkap, laporkan pada vendor anda. Semakin banyak laporan masuk, semakin tinggi kemungkinan vendor melakukan perbaikan.&lt;/p&gt;</string>
+ <string name="pkcs12_file_encryption_key">Berkas kunci enkripsi PKCS12</string>
+ <string name="private_key_password">Sandi kunci pribadi</string>
+ <string name="password">Sandi</string>
+ <string name="file_icon">ikon berkas</string>
+ <string name="tls_authentication">Otentikasi TLS</string>
+ <string name="generated_config">Konfigurasi Dibuat</string>
+ <string name="generalsettings">Pengaturan</string>
+ <string name="owner_fix_summary">Mencoba menetapkan pemilik /dev/tun ke sistem. Beberapa gambar CM9 memerlukan ini untuk membuat API VPNService bekerja. Memerlukan akses Root.</string>
+ <string name="owner_fix">Perbaiki kepemilikan /dev/tun</string>
+ <string name="generated_config_summary">Tunjukkan berkas konfigurasi OpenVPN yang dibuat</string>
+ <string name="edit_profile_title">Mengubah \"%s\"</string>
+ <string name="building_configration">Membuat konfigurasi&#8230;</string>
+ <string name="netchange_summary">Menyalakan pilihan ini akan memaksa menyambung kembali jika keadaan jaringan berubah (misalnya WiFi dari mobile)</string>
+ <string name="netchange">Koneksi ulang saat ganti jaringan</string>
+ <string name="netstatus">Status jaringan: %s</string>
+ <string name="extracahint">Sertifikat CA biasanya kembali dari Android Keystore. Tentukan sertifikat terpisah jika Anda mendapatkan kesalahan verifikasi sertifikat.</string>
+ <string name="select_file">Pilih</string>
+ <string name="keychain_nocacert">Tidak ada sertifikat CA yang didapat saat membaca dari Android Keystore. Otentifikasi mungkin gagal</string>
+ <string name="show_log_summary">Tampilkan jendela catatan saat terkoneksi. Jendela catatan juga dapat diakses melalui status notifikasi</string>
+ <string name="show_log_window">Tampilkan jendela catatan</string>
+ <string name="mobile_info">Berjalan di %1$s (%2$s) %3$s, Android API %4$d</string>
+ <string name="error_rsa_sign">Kesalahan masuk dengan kunci Android keystore %1$s: %2$s</string>
+ <string name="faq_system_dialogs">Peringatan sambungan VPN yang memberitahukan Anda bahwa aplikasi ini dapat mencegat semua lalu lintas dikeluarkan oleh sistem untuk mencegah penyalahgunaan dari sambungan VPNService API.\nPemberitahuan sambungan VPN (simbol kunci) juga dikeluarkan oleh sistem Android untuk memberitahu VPN yang sedang berlangsung. Pada beberapa gambar pemberitahuan ini memainkan suara. \nAndroid memperkenalkan sistem dialog ini untuk keselamatan Anda sendiri dan memastikan bahwa mereka tidak membuat masalah. (Pada beberapa gambar sayangnya ini termasuk peringatan suara)</string>
+ <string name="faq_system_dialogs_title">Peringatan sambungan dan pemberitahuan melalui suara</string>
+ <string name="translationby">Terjemah Bahasa Indonesia oleh Dayro</string>
+ <string name="ipdns">IP dan DNS</string>
+ <string name="basic">Dasar</string>
+ <string name="routing">Rute</string>
+ <string name="obscure">Mengaburkan pengaturan OpenVPN. Biasanya tidak diperlukan.</string>
+ <string name="advanced">Lanjutan</string>
+ <string name="export_config_title">Konfigurasi ICS Openvpn</string>
+ <string name="warn_no_dns">Tidak DNS server yang digunakan. Name Resolution mungkin akan gagal bekerja. Pertimbangkan pengaturan server DNS. Harap dicatat Android akan terus memakai pengaturan proxy untuk koneksi mobile/wifi saat tidak ada server DNS diatur.</string>
+ <string name="dns_add_error">Tak bisa menambahkan Server DNS \"%1$s\", ditolak oleh sistem: %2$s</string>
+ <string name="faq_howto">&lt;p&gt; Ambil konfigurasi yang dapat berjalan (diuji pada komputer Anda atau download dari penyedia/organisasi) &lt;/p&gt; &lt;p&gt; Satu file(berkas) saja tanpa tambahan berkas pem/pks12. Anda dapat kirim imel berkas dan membuka lampirannya. Jika Anda memiliki beberapa berkas, salin ke sd-card &lt;/p&gt; &lt;p&gt; klik pada lampiran imel atau gunakan ikon folder dalam daftar vpn untuk mengimpor berkas konfigurasi &lt;/p&gt; &lt;p&gt; jika ada berkas yang kurang, salin file hilang ke sd-card. &lt;/p&gt; &lt;p&gt; klik pada simbol Simpan untuk menambahkan VPN yang diimpor ke daftar VPN &lt;/p&gt; &lt;p &gt; Connect VPN dengan mengklik nama VPN &lt;/p&gt; &lt;p&gt; jika ada kesalahan atau peringatan di catatan, coba pahami peringatannya dan coba untuk memperbaikinya &lt;/p&gt; </string>
+ <string name="faq_howto_title">Mulai Cepat</string>
+ <string name="setting_loadtun_summary">Coba pakai tun.ko kernel sebelum mencoba koneksi. Membutuhkan perangkat yang sudah diroot. Google: android superuser</string>
+ <string name="setting_loadtun">Pakai modul TUN</string>
+ <string name="importpkcs12fromconfig">Ambil PKCS12 dari konfigurasi ke Android Keystore</string>
+ <string name="getproxy_error">Gagal mendapatkan pengaturan proxy: %s</string>
+ <string name="using_proxy">Menggunakan proxy %1$s %2$d</string>
+ <string name="use_system_proxy">Gunakan sistem proxy</string>
+ <string name="use_system_proxy_summary">Gunakan konfigurasi lebih luas untuk menyambung system melalui proxy HTTP/HTTPS</string>
+ <string name="donatewithpaypal">Anda dapat melakukan donasi &lt;a href=\"https://www.paypal.com/cgi-bin/webscr?hosted_button_id=R2M6ZP9AF25LS&amp;amp;cmd=_s-xclick\"&gt;dengan PayPal&lt;/a&gt; </string>
+ <string name="onbootrestartsummary">OpenVPN akan menyambung kembali VPN jika VPN aktif pada saat sistem reboot/shutdown. Silakan baca FAQ tentang peringatan sambungan sebelum menggunakan pilihan ini.</string>
+ <string name="onbootrestart">Koneksi ulang saat perangkat dihidupkan kembali</string>
+ <string name="ignore">Abaikan</string>
+ <string name="restart">Restart</string>
+ <string name="restart_vpn_after_change">Perubahan konfigurasi baru diterapkan setelah restart VPN. Restart VPN sekarang?</string>
+ <string name="configuration_changed">Konfigurasi berubah</string>
+ <string name="log_no_last_vpn">Tak bisa menentukan profil terhubung terakhir untuk diubah</string>
+ <string name="faq_duplicate_notification_title">Pemberitahuan berganda</string>
+ <string name="faq_duplicate_notification">Jika Android kekurangan sistem memori (RAM), aplikasi dan layanan yang tidak diperlukan pada saat itu akan dihapus dari memori aktif. Sambungan VPN yang sedang aktif juga ditutup. Untuk memastikan bahwa sambungan/OpenVPN tetap berjalan, OpenVPN diberikan prioritas yang lebih tinggi. Untuk menjalankan dengan prioritas lebih tinggi, aplikasi harus menampilkan pemberitahuan. Ikon pemberitahuan dijalankan oleh sistem seperti dijelaskan dalam FAQ entri sebelumnya. Ini tidak dihitung sebagai pemberitahuan app yang berjalan dengan prioritas lebih tinggi.</string>
+ <string name="no_vpn_profiles_defined">Tak ada profil VPN yang didefinisikan.</string>
+ <string name="add_new_vpn_hint">Gunakan ikon &lt; img src = \"ic_menu_add\" / &gt; untuk menambah VPN baru</string>
+ <string name="vpn_import_hint">Gunakan ikon &lt; img src = \"ic_menu_archive\" / &gt; untuk mengimpor profil (.ovpn atau .conf) yang ada dari sdcard Anda.</string>
+ <string name="faq_hint">Pastikan untuk juga memeriksa FAQ. Ada petunjuk untuk memudahkan anda.</string>
+ <string name="faq_routing_title">Konfigurasi rute\antarmuka</string>
+ <string name="persisttun_summary">Jangan kembali ke status tidak ada koneksi VPN ketika OpenVPN mencoba terhubung kembali.</string>
+ <string name="persistent_tun_title">Paksa mode TUN</string>
+ <string name="openvpn_log">Catatan OpenVPN</string>
+ <string name="import_config">Ambil konfigurasi VPN</string>
+ <string name="battery_consumption_title">Konsumsi baterai</string>
+ <string name="baterry_consumption">Berdasarkan tes pribadi, alasan utama tingginya konsumsi baterai oleh OpenVPN adalah paket keepalive. Sebagian besar server OpenVPN memiliki parameter konfigurasi seperti \'keepalive 10 60\' yang membuat klien dan server bertukar paket keepalive setiap 10 detik. &lt;p&gt; Dengan kecilnya paket ini dan tidak memakai trafik terlalu banyak, mereka menjaga jaringan radio mobile tetap sibuk dan meningkatkan konsumsi energi. (See also &lt;a href=\"http://developer.android.com/training/efficient-downloads/efficient-network-access.html#RadioStateMachine\"&gt;The Radio State Machine | Android Developers&lt;/a&gt;) &lt;p&gt; Seting keepalive ini tidak bisa dirubah di klien. Hanya Admin sistem OpenVPN yang dapat merubah seting ini. &lt;p&gt; Sayangnya membuat keepalive lebih besar dari 60 detik tanpa UDP dapat membuat beberapa gateway NAT memutus koneksi karena anggapan tidak ada aktifitas pada periode tertentu (timeout). Memakai TCP dengan waktu timeout lebih lama dapat bekerja, tapi membuat tunnel TCP di jalur TCP menyebabkan koneksi yang buruk dan tingginya angka kehilangan paket data ((See &lt;a href=\"http://sites.inka.de/bigred/devel/tcp-tcp.html\"&gt;Why TCP Over TCP Is A Bad Idea&lt;/a&gt;)</string>
+ <string name="faq_tethering">Fitur penggandengan Android (melalui WiFi, USB atau Bluetooth) dan API VPNService (digunakan oleh program ini) tidak bekerja bersama-sama. Untuk keterangan lanjut lihat &lt; href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=34\" &gt; mengeluarkan #34 &lt;/a&gt;</string>
+ <string name="vpn_tethering_title">VPN dan penarikan</string>
+ <string name="connection_retries">Mengulang koneksi</string>
+ <string name="reconnection_settings">Pengaturan rekoneksi</string>
+ <string name="connectretrymessage">Jumlah detik untuk menunggu antar usaha koneksi</string>
+ <string name="connectretrywait">Detik antar koneksi</string>
+ <string name="minidump_generated">OpenVPN crash tak terduga. Silakan mempertimbangkan mengirim menggunakan pilihan Minidump di Menu Utama</string>
+ <string name="send_minidump">Mengirim MiniDump untuk pengembang</string>
+ <string name="send_minidump_summary">Mengirim informasi debug tentang kegagalan aplikasi yang terakhir ke pengembang</string>
+ <string name="notifcation_title">OpenVPN - %s</string>
+ <string name="session_ipv4string">%1$s - %2$s</string>
+ <string name="session_ipv6string">%1$s - %3$s, %2$s</string>
+ <string name="state_connecting">Menghubungkan</string>
+ <string name="state_wait">Menunggu jawaban server</string>
+ <string name="state_auth">Melakukan otentifikasi</string>
+ <string name="state_get_config">Mengambil konfigurasi klien</string>
+ <string name="state_assign_ip">Menetapkan alamat IP</string>
+ <string name="state_add_routes">Menambahkan rute</string>
+ <string name="state_connected">Terhubung</string>
+ <string name="state_disconnected">Putus</string>
+ <string name="state_reconnecting">Menghubungkan kembali</string>
+ <string name="state_exiting">Keluar</string>
+ <string name="state_noprocess">Tidak berjalan</string>
+ <string name="state_resolve">Mengenali nama host</string>
+ <string name="state_tcp_connect">Menghubungkan (TCP)</string>
+ <string name="state_auth_failed">Otentifikasi gagal</string>
+ <string name="state_nonetwork">Menunggu jaringan yang dapat dipakai</string>
+ <string name="statusline_bytecount">↓%2$s/s %1$s - ↑%4$s/s %3$s</string>
+ <string name="notifcation_title_notconnect">Tidak terhubung</string>
+ <string name="start_vpn_title">Menghubungkan ke VPN %s</string>
+ <string name="start_vpn_ticker">Menghubungkan ke VPN %s</string>
+ <string name="jelly_keystore_alphanumeric_bug">Beberapa versi Android 4.1 memiliki masalah jika nama sertifikat keystore berisi karakter non alfanumerik (seperti spasi, garis bawah atau tanda hubung). Cobalah import ulang sertifikat tanpa karakter khusus</string>
+ <string name="encryption_cipher">Enkripsi sandi</string>
+ <string name="packet_auth">Otentikasi paket</string>
+ <string name="auth_dialog_title">Masukkan metode otentikasi paket</string>
+ <string name="mobile_info_extended">Berjalan pada Android API %4$d, versi %5$s %1$s (%2$s) %3$s, %6$s</string>
+ <string name="built_by">dibangun oleh %s</string>
+ <string name="debug_build">Pengembangan debug</string>
+ <string name="official_build">Build Resmi</string>
+ <string name="make_selection_inline">Salin ke profil</string>
+ <string name="crashdump">Data saat terjadi crash</string>
+ <string name="add">Tambahkan</string>
+ <string name="send_config">Mengirim config file</string>
+ <string name="complete_dn">DN lengkap</string>
+ <string name="remotetlsnote">Konfigurasi yang diimpor menggunakan opsi tls-remote DEPRECATED tua dengan menggunakan format DN yang berbeda.</string>
+ <string name="rdn">RDN (nama umum)</string>
+ <string name="rdn_prefix">RDN awalan</string>
+ <string name="tls_remote_deprecated">TLS-remote (DEPRECATED)</string>
+ <string name="help_translate">Anda dapat membantu menerjemahkan dengan mengunjungi http://crowdin.net/project/ics-openvpn/invite</string>
+ <string name="prompt">%1$s berusaha mengendalikan %2$s</string>
+ <string name="remote_trust">Saya percaya aplikasi ini.</string>
+ <string name="no_external_app_allowed">App tidak diizinkan untuk menggunakan API eksternal</string>
+ <string name="allowed_apps">apps yang diijinkan : %s</string>
+ <string name="clearappsdialog">Hapus daftar aplikasi eksternal yang dibolehkan? \nDaftar apps yang dibolehkan terkini:\n\n%s </string>
+ <string name="screenoff_summary">\"Pause VPN ketika layar off dan data yang ditransfer dalam 60 detik kurang dari 64kB. Ketika opsi \"Persistent Tun\" diaktifkan, memberhentikan VPN akan membuat perangkat Anda tidak memiliki koneksi jaringan. Jika tidak memakai \"Persistent Tun\" maka perangkat akan menampilkan Tidak ada koneksi VPN.</string>
+ <string name="screenoff_title">Sambungan VPN jeda setelah layar mati</string>
+ <string name="screenoff_pause">Hentikan sambungan dalam kondisi layar mati: kurang dari %1$s dalam %2$ss</string>
+ <string name="screen_nopersistenttun">Peringatan: Pemaksaan tun tidak diaktifkan untuk VPN ini. Lalu lintas akan menggunakan koneksi Internet normal ketika layar dimatikan.</string>
+ <string name="save_password">Menyimpan sandi</string>
+ <string name="pauseVPN">Jeda VPN</string>
+ <string name="resumevpn">Lanjutkan VPN</string>
+ <string name="state_userpause">Pause VPN diminta oleh pengguna</string>
+ <string name="state_screenoff">VPN dijeda - layar off</string>
+ <string name="device_specific">Perangkat dengan spesifikasi Hacks</string>
+ <string name="cannotparsecert">Tidak dapat menampilkan informasi sertifikat</string>
+ <string name="appbehaviour">Prilaku Aplikasi</string>
+ <string name="vpnbehaviour">Prilaku VPN</string>
+</resources>
diff --git a/ics-openvpn-stripped/main/src/main/res/values-ja/strings.xml b/ics-openvpn-stripped/main/src/main/res/values-ja/strings.xml
index 162d56f0..fddc6dea 100755
--- a/ics-openvpn-stripped/main/src/main/res/values-ja/strings.xml
+++ b/ics-openvpn-stripped/main/src/main/res/values-ja/strings.xml
@@ -286,6 +286,7 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="tls_remote_deprecated"> tls-remote (非推奨)</string>
<string name="help_translate">翻訳作業を手伝っていただける方は次のURLへ http://crowdin.net/project/ics-openvpn/invite</string>
<string name="prompt">%1$s は %2$s を制御しようとしています。</string>
+ <string name="remote_warning">このまま進むと、あなたはOpenVPN for Androidの完全な制御とすべての通信を傍受する権限をアプリケーションに対し与えることになります。<b>アプリケーションが信頼できない限り、承諾しないでください。</b>さもないと、あなたのデータがマルウェアにより漏洩させられる危険があります。</string>
<string name="remote_trust">私はこのアプリケーションを信頼します</string>
<string name="no_external_app_allowed">外部APIの使用を許可されたアプリはありません</string>
<string name="allowed_apps">許可アプリ: %s</string>
@@ -307,6 +308,7 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="permission_icon_app">OpenVPN for Androidを使用しようと試みるアプリのアイコン</string>
<string name="faq_vpndialog43_title">Android 4.3以降用VPN確認ダイアログ</string>
<string name="donatePlayStore">ほかの手段として、Play Storeで私に寄付できます。</string>
+ <string name="thanks_for_donation">%s の寄付をお寄せいただきありがとうございます!</string>
<string name="logCleared">ログがクリアされました。</string>
<string name="show_password">パスワードを表示する</string>
<string name="keyChainAccessError">キーチェーン アクセス エラー: %s</string>
@@ -316,12 +318,17 @@ OpenVPNの接続を保証するためには、アプリケーションを高い
<string name="uploaded_data">アップロード</string>
<string name="downloaded_data">ダウンロード</string>
<string name="vpn_status">VPNの状態</string>
+ <string name="logview_options">オプションを表示</string>
<string name="unhandled_exception">未処理の例外: %1$s\n\n%2$s</string>
<string name="unhandled_exception_context">%3$s: %1$s\n\n%2$s</string>
<string name="faq_system_dialog_xposed">もしあなたがデバイスをroot化しているのであれば、 &lt;a href=\"http://xposed.info/\"&gt;Xposed framework&lt;/a&gt;と&lt;a href=\"http://repo.xposed.info/module/de.blinkt.vpndialogxposed\"&gt;VPN Dialog confirm module&lt;/a&gt; を自己責任においてインストールできます</string>
<string name="full_licenses">フルライセンス</string>
<string name="blocklocal_summary">ローカルインターフェイスに直接接続されているネットワークはVPNを経由しません。
このオプションを外すとローカルネットワーク宛のすべての通信をVPNにリダイレクトします。</string>
+ <string name="blocklocal_title">ローカルネットワークはVPNを経由しない</string>
+ <string name="userpw_file">ユーザー名/パスワードファイル</string>
+ <string name="imported_from_file">[インポート元: %s]</string>
<string name="files_missing_hint">いくつかのファイルが見つかりませんでした。プロファイルをインポートするファイルを選択してください:</string>
+ <string name="openvpn_is_no_free_vpn">このアプリを使用するには、(多くの場合、あなたの雇用者によって提供される)OpenVPNをサポートするVPNプロバイダ/ VPNゲートウェイが必要です。あなた独自のOpenVPNサーバーをセットアップするためにはhttp://community.openvpn.net/ をチェックしてください。</string>
<string name="import_log">インポートログ:</string>
</resources>
diff --git a/ics-openvpn-stripped/main/src/main/res/values-tr/strings.xml b/ics-openvpn-stripped/main/src/main/res/values-tr/strings.xml
index aef446d1..4ae6f407 100755
--- a/ics-openvpn-stripped/main/src/main/res/values-tr/strings.xml
+++ b/ics-openvpn-stripped/main/src/main/res/values-tr/strings.xml
@@ -309,4 +309,6 @@
<string name="full_licenses">Lisanslar</string>
<string name="blocklocal_title">Yerel ağlar için Bypass VPN</string>
<string name="userpw_file">Kullanıcı adı / Şifre dosyası</string>
+ <string name="imported_from_file">[Buradan içeri aktar: %s]</string>
+ <string name="import_log">Kaydı içe aktar:</string>
</resources>
diff --git a/ics-openvpn-stripped/main/src/main/res/values/strings.xml b/ics-openvpn-stripped/main/src/main/res/values/strings.xml
index 6cd45b66..a054d16b 100755
--- a/ics-openvpn-stripped/main/src/main/res/values/strings.xml
+++ b/ics-openvpn-stripped/main/src/main/res/values/strings.xml
@@ -117,7 +117,7 @@
<string name="tap_faq3">A third time? Actually, one could write a a tap emulator based on tun that would add layer2 information on send and strip layer2 information on receive. But this tap emulator would also have to implement ARP and possibly a DHCP client. I am not aware of anybody doing any work in this direction. Contact me if you want to start coding on this.</string>
<string name="faq">FAQ</string>
<string name="copying_log_entries">Copying log entries</string>
- <string name="faq_copying">To copy a single log entry press and hold on the log entry. To copy/send the whole log use the Send Log option. Use the hardware menu button if not visible in the GUI.</string>
+ <string name="faq_copying">To copy a single log entry press and hold on the log entry. To copy/send the whole log use the Send Log option. Use the hardware menu button, if the button is not visible in the GUI.</string>
<string name="faq_shortcut">Shortcut to start</string>
<string name="faq_howto_shortcut">You can place a shortcut to start OpenVPN on your desktop. Depending on your homescreen program you will have to add either a shortcut or a widget.</string>
<string name="no_vpn_support_image">Your image does not support the VPNService API, sorry :(</string>
@@ -190,7 +190,7 @@
<string name="warn_no_dns">No DNS servers being used. Name resolution may not work. Consider setting custom DNS Servers. Please also note that Android will keep using your proxy settings specified for your mobile/Wi-Fi connection when no DNS servers are set.</string>
<string name="dns_add_error">Could not add DNS Server \"%1$s\", rejected by the system: %2$s</string>
<string name="ip_add_error">Could not configure IP Address \"%1$s\", rejected by the system: %2$s</string>
- <string name="faq_howto">&lt;p&gt;Get a working config (tested on your computer or download from your provider/organisation)&lt;/p&gt;&lt;p&gt;If it is a single file no with no extra pem/pks12 files you can email the file yourself and open the attachment. If you have multiple files put them on your sd card.&lt;/p&gt;&lt;p&gt;Click on the email attachment/Use the folder icon in the vpn list to import the config file&lt;/p&gt;&lt;p&gt;If there are errors about missing files put the missing files on your sd card.&lt;/p&gt;&lt;p&gt;Click on the save symbol to add the imported VPN to your VPN list&lt;/p&gt;&lt;p&gt;Connect the VPN by clicking on the name of the VPN&lt;/p&gt;&lt;p&gt;If there are error or warnings in the log try to understand the warnings/error and try to fix them&lt;/p&gt; </string>
+ <string name="faq_howto">&lt;p&gt;Get a working config (tested on your computer or download from your provider/organisation)&lt;/p&gt;&lt;p&gt;If it is a single file with no extra pem/pks12 files you can email the file yourself and open the attachment. If you have multiple files put them on your sd card.&lt;/p&gt;&lt;p&gt;Click on the email attachment/Use the folder icon in the vpn list to import the config file&lt;/p&gt;&lt;p&gt;If there are errors about missing files put the missing files on your sd card.&lt;/p&gt;&lt;p&gt;Click on the save symbol to add the imported VPN to your VPN list&lt;/p&gt;&lt;p&gt;Connect the VPN by clicking on the name of the VPN&lt;/p&gt;&lt;p&gt;If there are error or warnings in the log try to understand the warnings/error and try to fix them&lt;/p&gt; </string>
<string name="faq_howto_title">Quick Start</string>
<string name="setting_loadtun_summary">Try to load the tun.ko kernel module before trying to connect. Needs rooted devices.</string>
<string name="setting_loadtun">Load tun module</string>
@@ -214,7 +214,7 @@
<string name="vpn_import_hint">Use the &lt;img src=\"ic_menu_archive\"/&gt; icon to import an existing (.ovpn or .conf) profile from your sdcard.</string>
<string name="faq_hint">Be sure to also check out the FAQ. There is a quick start guide.</string>
<string name="faq_routing_title">Routing/Interface Configuration</string>
- <string name="faq_routing">The Routing and interface configuration is not done via traditional ifconfig/route commands but by using the VPNService API. This results in a different routing configuration than on other OSes. The configuration for the VPN tunnel consists of the IP address and the networks that should be routed over this interface. Especially no peer partner address or gateway address is needed. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel. Only specifying networks to be routed via tunnel is supported. The app tries to detect networks that should not be routed over tunnel (e.g. route x.x.x.x y.y.y.y net_gateway) and calculates a route set that excludes this routes to emulate the behaviour of other platforms. The log windows shows the configuration of the VPNService upon establishing a connection.</string>
+ <string name="faq_routing">The Routing and interface configuration is not done via traditional ifconfig/route commands but by using the VPNService API. This results in a different routing configuration than on other OSes. \nThe configuration of the VPN tunnel consists of the IP address and the networks that should be routed over this interface. Especially, no peer partner address or gateway address is needed or required. Special routes to reach the VPN Server (for example added when using redirect-gateway) are not needed either. The application will consequently ignore these settings when importing a configuration. The app ensures with the VPNService API that the connection to the server is not routed through the VPN tunnel.\nThe VPNService API does not allow specifying networks that should not be routed via the VPN. As a workaround the app tries to detect networks that should not be routed over tunnel (e.g. route x.x.x.x y.y.y.y net_gateway) and calculates a set of routes that excludes this routes to emulate the behaviour of other platforms. The log windows shows the configuration of the VPNService upon establishing a connection.\nBehind the scenes: Android 4.4+ does use policy routing. Using route/ifconfig will not show the installed routes. Instead use ip rule, iptables -t mangle -L</string>
<string name="persisttun_summary">Do not fallback to no VPN connection when OpenVPN is reconnecting.</string>
<string name="persistent_tun_title">Persistent tun</string>
<string name="openvpn_log">OpenVPN Log</string>
@@ -318,4 +318,5 @@
<string name="files_missing_hint">Some files could not be found. Please select the files to import the profile:</string>
<string name="openvpn_is_no_free_vpn">To use this app you need a VPN provider/VPN gateway supporting OpenVPN (often provided by your employer). Check out http://community.openvpn.net/ for more information on OpenVPN and how to setup your own OpenVPN server.</string>
<string name="import_log">Import log:</string>
+ <string name="ip_looks_like_subnet">Vpn topology \"%3$s\" specified but ifconfig %1$s %2$s looks more like an IP address with a network mask. Assuming \"subnet\" topology.</string>
</resources>