Browse code

move hardware acceleration code to contrib/hwaccel/hwaccel.patch

git-svn: trunk@3209

Tomasz Kojm authored on 2007/09/07 23:22:10
Showing 35 changed files
... ...
@@ -1,3 +1,8 @@
1
+Fri Sep  7 15:28:54 CEST 2007 (tk)
2
+----------------------------------
3
+  * libclamav, clamd, clamscan: move hardware acceleration code to
4
+				contrib/hwaccel/hwaccel.patch
5
+
1 6
 Thu Sep  6 17:18:01 BST 2007 (njh)
2 7
 ----------------------------------
3 8
   * libclamav/pdf.c:	Ensure consistency with other archivers when attempted
... ...
@@ -186,6 +186,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
186 186
 PACKAGE_VERSION = @PACKAGE_VERSION@
187 187
 PATH_SEPARATOR = @PATH_SEPARATOR@
188 188
 RANLIB = @RANLIB@
189
+SED = @SED@
189 190
 SET_MAKE = @SET_MAKE@
190 191
 SHELL = @SHELL@
191 192
 STRIP = @STRIP@
... ...
@@ -13,7 +13,7 @@
13 13
 
14 14
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
15 15
 
16
-# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
16
+# serial 51 Debian 1.5.24-1 AC_PROG_LIBTOOL
17 17
 
18 18
 
19 19
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
... ...
@@ -176,7 +176,7 @@ test -z "$STRIP" && STRIP=:
176 176
 test -z "$ac_objext" && ac_objext=o
177 177
 
178 178
 # Determine commands to create old-style static archives.
179
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
179
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
180 180
 old_postinstall_cmds='chmod 644 $oldlib'
181 181
 old_postuninstall_cmds=
182 182
 
... ...
@@ -263,8 +263,9 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
263 263
 # Check for compiler boilerplate output or warnings with
264 264
 # the simple compiler test code.
265 265
 AC_DEFUN([_LT_COMPILER_BOILERPLATE],
266
-[ac_outfile=conftest.$ac_objext
267
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
266
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
267
+ac_outfile=conftest.$ac_objext
268
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
268 269
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
269 270
 _lt_compiler_boilerplate=`cat conftest.err`
270 271
 $rm conftest*
... ...
@@ -276,8 +277,9 @@ $rm conftest*
276 276
 # Check for linker boilerplate output or warnings with
277 277
 # the simple link test code.
278 278
 AC_DEFUN([_LT_LINKER_BOILERPLATE],
279
-[ac_outfile=conftest.$ac_objext
280
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
279
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
280
+ac_outfile=conftest.$ac_objext
281
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
281 282
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
282 283
 _lt_linker_boilerplate=`cat conftest.err`
283 284
 $rm conftest*
... ...
@@ -293,12 +295,20 @@ $rm conftest*
293 293
 # If we don't find anything, use the default library path according
294 294
 # to the aix ld manual.
295 295
 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
296
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
297
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
298
-}'`
296
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
297
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
298
+lt_aix_libpath_sed='
299
+    /Import File Strings/,/^$/ {
300
+	/^0/ {
301
+	    s/^0  *\(.*\)$/\1/
302
+	    p
303
+	}
304
+    }'
305
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
299 306
 # Check for a 64-bit object if we didn't find anything.
300
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
301
-}'`; fi],[])
307
+if test -z "$aix_libpath"; then
308
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
309
+fi],[])
302 310
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
303 311
 ])# _LT_AC_SYS_LIBPATH_AIX
304 312
 
... ...
@@ -529,13 +539,17 @@ ia64-*-hpux*)
529 529
   rm -rf conftest*
530 530
   ;;
531 531
 
532
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
532
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
533
+s390*-*linux*|sparc*-*linux*)
533 534
   # Find out which ABI we are using.
534 535
   echo 'int i;' > conftest.$ac_ext
535 536
   if AC_TRY_EVAL(ac_compile); then
536 537
     case `/usr/bin/file conftest.o` in
537 538
     *32-bit*)
538 539
       case $host in
540
+        x86_64-*kfreebsd*-gnu)
541
+          LD="${LD-ld} -m elf_i386_fbsd"
542
+          ;;
539 543
         x86_64-*linux*)
540 544
           LD="${LD-ld} -m elf_i386"
541 545
           ;;
... ...
@@ -552,6 +566,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
552 552
       ;;
553 553
     *64-bit*)
554 554
       case $host in
555
+        x86_64-*kfreebsd*-gnu)
556
+          LD="${LD-ld} -m elf_x86_64_fbsd"
557
+          ;;
555 558
         x86_64-*linux*)
556 559
           LD="${LD-ld} -m elf_x86_64"
557 560
           ;;
... ...
@@ -623,7 +640,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
623 623
 AC_CACHE_CHECK([$1], [$2],
624 624
   [$2=no
625 625
   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
626
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
626
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
627 627
    lt_compiler_flag="$3"
628 628
    # Insert the option either (1) after the last *FLAGS variable, or
629 629
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -664,11 +681,12 @@ fi
664 664
 # ------------------------------------------------------------
665 665
 # Check whether the given compiler option works
666 666
 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
667
-[AC_CACHE_CHECK([$1], [$2],
667
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
668
+AC_CACHE_CHECK([$1], [$2],
668 669
   [$2=no
669 670
    save_LDFLAGS="$LDFLAGS"
670 671
    LDFLAGS="$LDFLAGS $3"
671
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
672
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
672 673
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
673 674
      # The linker can only warn and ignore the option if not recognized
674 675
      # So say no if there are warnings
... ...
@@ -782,24 +800,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
782 782
     fi
783 783
     ;;
784 784
   *)
785
-    # If test is not a shell built-in, we'll probably end up computing a
786
-    # maximum length that is only half of the actual maximum length, but
787
-    # we can't tell.
788
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
789
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
785
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
786
+    if test -n "$lt_cv_sys_max_cmd_len"; then
787
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
788
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
789
+    else
790
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
791
+      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
790 792
 	       = "XX$teststring") >/dev/null 2>&1 &&
791
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
792
-	    lt_cv_sys_max_cmd_len=$new_result &&
793
-	    test $i != 17 # 1/2 MB should be enough
794
-    do
795
-      i=`expr $i + 1`
796
-      teststring=$teststring$teststring
797
-    done
798
-    teststring=
799
-    # Add a significant safety factor because C++ compilers can tack on massive
800
-    # amounts of additional arguments before passing them to the linker.
801
-    # It appears as though 1/2 is a usable value.
802
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
793
+	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
794
+	      lt_cv_sys_max_cmd_len=$new_result &&
795
+	      test $i != 17 # 1/2 MB should be enough
796
+      do
797
+        i=`expr $i + 1`
798
+        teststring=$teststring$teststring
799
+      done
800
+      teststring=
801
+      # Add a significant safety factor because C++ compilers can tack on massive
802
+      # amounts of additional arguments before passing them to the linker.
803
+      # It appears as though 1/2 is a usable value.
804
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
805
+    fi
803 806
     ;;
804 807
   esac
805 808
 ])
... ...
@@ -1026,7 +1047,8 @@ fi
1026 1026
 # ---------------------------------
1027 1027
 # Check to see if options -c and -o are simultaneously supported by compiler
1028 1028
 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1029
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1029
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
1030
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1030 1031
 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1031 1032
   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1032 1033
   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
... ...
@@ -1034,7 +1056,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1034 1034
    mkdir conftest
1035 1035
    cd conftest
1036 1036
    mkdir out
1037
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1037
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1038 1038
 
1039 1039
    lt_compiler_flag="-o out/conftest2.$ac_objext"
1040 1040
    # Insert the option either (1) after the last *FLAGS variable, or
... ...
@@ -1174,6 +1196,7 @@ else
1174 1174
    darwin*)
1175 1175
        if test -n "$STRIP" ; then
1176 1176
          striplib="$STRIP -x"
1177
+         old_striplib="$STRIP -S"
1177 1178
          AC_MSG_RESULT([yes])
1178 1179
        else
1179 1180
   AC_MSG_RESULT([no])
... ...
@@ -1191,7 +1214,8 @@ fi
1191 1191
 # -----------------------------
1192 1192
 # PORTME Fill in your ld.so characteristics
1193 1193
 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1194
-[AC_MSG_CHECKING([dynamic linker characteristics])
1194
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
1195
+AC_MSG_CHECKING([dynamic linker characteristics])
1195 1196
 library_names_spec=
1196 1197
 libname_spec='lib$name'
1197 1198
 soname_spec=
... ...
@@ -1205,20 +1229,58 @@ shlibpath_overrides_runpath=unknown
1205 1205
 version_type=none
1206 1206
 dynamic_linker="$host_os ld.so"
1207 1207
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1208
+m4_if($1,[],[
1208 1209
 if test "$GCC" = yes; then
1209
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1210
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
1210
+  case $host_os in
1211
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1212
+    *) lt_awk_arg="/^libraries:/" ;;
1213
+  esac
1214
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1215
+  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
1211 1216
     # if the path contains ";" then we assume it to be the separator
1212 1217
     # otherwise default to the standard path separator (i.e. ":") - it is
1213 1218
     # assumed that no part of a normal pathname contains ";" but that should
1214 1219
     # okay in the real world where ";" in dirpaths is itself problematic.
1215
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
1220
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
1216 1221
   else
1217
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1222
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
1218 1223
   fi
1224
+  # Ok, now we have the path, separated by spaces, we can step through it
1225
+  # and add multilib dir if necessary.
1226
+  lt_tmp_lt_search_path_spec=
1227
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1228
+  for lt_sys_path in $lt_search_path_spec; do
1229
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1230
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1231
+    else
1232
+      test -d "$lt_sys_path" && \
1233
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1234
+    fi
1235
+  done
1236
+  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1237
+BEGIN {RS=" "; FS="/|\n";} {
1238
+  lt_foo="";
1239
+  lt_count=0;
1240
+  for (lt_i = NF; lt_i > 0; lt_i--) {
1241
+    if ($lt_i != "" && $lt_i != ".") {
1242
+      if ($lt_i == "..") {
1243
+        lt_count++;
1244
+      } else {
1245
+        if (lt_count == 0) {
1246
+          lt_foo="/" $lt_i lt_foo;
1247
+        } else {
1248
+          lt_count--;
1249
+        }
1250
+      }
1251
+    }
1252
+  }
1253
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1254
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1255
+}'`
1256
+  sys_lib_search_path_spec=`echo $lt_search_path_spec`
1219 1257
 else
1220 1258
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1221
-fi
1259
+fi])
1222 1260
 need_lib_prefix=unknown
1223 1261
 hardcode_into_libs=no
1224 1262
 
... ...
@@ -1375,12 +1437,8 @@ darwin* | rhapsody*)
1375 1375
   shlibpath_overrides_runpath=yes
1376 1376
   shlibpath_var=DYLD_LIBRARY_PATH
1377 1377
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1378
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
1379
-  if test "$GCC" = yes; then
1380
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
1381
-  else
1382
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
1383
-  fi
1378
+  m4_if([$1], [],[
1379
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
1384 1380
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
1385 1381
   ;;
1386 1382
 
... ...
@@ -1434,7 +1492,7 @@ freebsd* | dragonfly*)
1434 1434
     shlibpath_overrides_runpath=no
1435 1435
     hardcode_into_libs=yes
1436 1436
     ;;
1437
-  freebsd*) # from 4.6 on
1437
+  *) # from 4.6 on, and DragonFly
1438 1438
     shlibpath_overrides_runpath=yes
1439 1439
     hardcode_into_libs=yes
1440 1440
     ;;
... ...
@@ -1497,7 +1555,7 @@ hpux9* | hpux10* | hpux11*)
1497 1497
   postinstall_cmds='chmod 555 $lib'
1498 1498
   ;;
1499 1499
 
1500
-interix3*)
1500
+interix[[3-9]]*)
1501 1501
   version_type=linux
1502 1502
   need_lib_prefix=no
1503 1503
   need_version=no
... ...
@@ -1568,7 +1626,7 @@ linux* | k*bsd*-gnu)
1568 1568
 
1569 1569
   # Append ld.so.conf contents to the search path
1570 1570
   if test -f /etc/ld.so.conf; then
1571
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
1571
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
1572 1572
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1573 1573
   fi
1574 1574
 
... ...
@@ -1674,6 +1732,10 @@ osf3* | osf4* | osf5*)
1674 1674
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1675 1675
   ;;
1676 1676
 
1677
+rdos*)
1678
+  dynamic_linker=no
1679
+  ;;
1680
+
1677 1681
 solaris*)
1678 1682
   version_type=linux
1679 1683
   need_lib_prefix=no
... ...
@@ -1779,7 +1841,8 @@ fi
1779 1779
 # _LT_AC_TAGCONFIG
1780 1780
 # ----------------
1781 1781
 AC_DEFUN([_LT_AC_TAGCONFIG],
1782
-[AC_ARG_WITH([tags],
1782
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
1783
+AC_ARG_WITH([tags],
1783 1784
     [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1784 1785
         [include additional configurations @<:@automatic@:>@])],
1785 1786
     [tagnames="$withval"])
... ...
@@ -2040,7 +2103,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2040 2040
 
2041 2041
 # AC_PATH_TOOL_PREFIX
2042 2042
 # -------------------
2043
-# find a file program which can recognise shared library
2043
+# find a file program which can recognize shared library
2044 2044
 AC_DEFUN([AC_PATH_TOOL_PREFIX],
2045 2045
 [AC_REQUIRE([AC_PROG_EGREP])dnl
2046 2046
 AC_MSG_CHECKING([for $1])
... ...
@@ -2103,7 +2166,7 @@ fi
2103 2103
 
2104 2104
 # AC_PATH_MAGIC
2105 2105
 # -------------
2106
-# find a file program which can recognise a shared library
2106
+# find a file program which can recognize a shared library
2107 2107
 AC_DEFUN([AC_PATH_MAGIC],
2108 2108
 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2109 2109
 if test -z "$lt_cv_path_MAGIC_CMD"; then
... ...
@@ -2250,7 +2313,7 @@ esac
2250 2250
 # how to check for library dependencies
2251 2251
 #  -- PORTME fill in with the dynamic library characteristics
2252 2252
 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2253
-[AC_CACHE_CHECK([how to recognise dependent libraries],
2253
+[AC_CACHE_CHECK([how to recognize dependent libraries],
2254 2254
 lt_cv_deplibs_check_method,
2255 2255
 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2256 2256
 lt_cv_file_magic_test_file=
... ...
@@ -2289,9 +2352,15 @@ cygwin*)
2289 2289
 
2290 2290
 mingw* | pw32*)
2291 2291
   # Base MSYS/MinGW do not provide the 'file' command needed by
2292
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
2293
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2294
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
2292
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2293
+  # unless we find 'file', for example because we are cross-compiling.
2294
+  if ( file / ) >/dev/null 2>&1; then
2295
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2296
+    lt_cv_file_magic_cmd='func_win32_libid'
2297
+  else
2298
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2299
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
2300
+  fi
2295 2301
   ;;
2296 2302
 
2297 2303
 darwin* | rhapsody*)
... ...
@@ -2336,7 +2405,7 @@ hpux10.20* | hpux11*)
2336 2336
   esac
2337 2337
   ;;
2338 2338
 
2339
-interix3*)
2339
+interix[[3-9]]*)
2340 2340
   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
2341 2341
   lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
2342 2342
   ;;
... ...
@@ -2386,6 +2455,10 @@ osf3* | osf4* | osf5*)
2386 2386
   lt_cv_deplibs_check_method=pass_all
2387 2387
   ;;
2388 2388
 
2389
+rdos*)
2390
+  lt_cv_deplibs_check_method=pass_all
2391
+  ;;
2392
+
2389 2393
 solaris*)
2390 2394
   lt_cv_deplibs_check_method=pass_all
2391 2395
   ;;
... ...
@@ -2438,7 +2511,7 @@ AC_DEFUN([AC_PROG_NM],
2438 2438
   lt_cv_path_NM="$NM"
2439 2439
 else
2440 2440
   lt_nm_to_check="${ac_tool_prefix}nm"
2441
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
2441
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
2442 2442
     lt_nm_to_check="$lt_nm_to_check nm"
2443 2443
   fi
2444 2444
   for lt_tmp_nm in $lt_nm_to_check; do
... ...
@@ -2654,10 +2727,10 @@ objext=o
2654 2654
 _LT_AC_TAGVAR(objext, $1)=$objext
2655 2655
 
2656 2656
 # Code to be used in simple compile tests
2657
-lt_simple_compile_test_code="int some_variable = 0;\n"
2657
+lt_simple_compile_test_code="int some_variable = 0;"
2658 2658
 
2659 2659
 # Code to be used in simple link tests
2660
-lt_simple_link_test_code='int main(){return(0);}\n'
2660
+lt_simple_link_test_code='int main(){return(0);}'
2661 2661
 
2662 2662
 _LT_AC_SYS_COMPILER
2663 2663
 
... ...
@@ -2759,10 +2832,10 @@ objext=o
2759 2759
 _LT_AC_TAGVAR(objext, $1)=$objext
2760 2760
 
2761 2761
 # Code to be used in simple compile tests
2762
-lt_simple_compile_test_code="int some_variable = 0;\n"
2762
+lt_simple_compile_test_code="int some_variable = 0;"
2763 2763
 
2764 2764
 # Code to be used in simple link tests
2765
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
2765
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
2766 2766
 
2767 2767
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
2768 2768
 _LT_AC_SYS_COMPILER
... ...
@@ -2908,7 +2981,7 @@ case $host_os in
2908 2908
 	   strings "$collect2name" | grep resolve_lib_name >/dev/null
2909 2909
 	then
2910 2910
 	  # We have reworked collect2
2911
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2911
+	  :
2912 2912
 	else
2913 2913
 	  # We have old collect2
2914 2914
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
... ...
@@ -3067,10 +3140,10 @@ case $host_os in
3067 3067
       case $cc_basename in
3068 3068
         xlc*)
3069 3069
          output_verbose_link_cmd='echo'
3070
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
3070
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
3071 3071
           _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3072 3072
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3073
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3073
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3074 3074
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3075 3075
           ;;
3076 3076
        *)
... ...
@@ -3153,9 +3226,7 @@ case $host_os in
3153 3153
       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3154 3154
 
3155 3155
       case $host_cpu in
3156
-      hppa*64*|ia64*)
3157
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
3158
-        ;;
3156
+      hppa*64*|ia64*) ;;
3159 3157
       *)
3160 3158
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3161 3159
         ;;
... ...
@@ -3223,7 +3294,7 @@ case $host_os in
3223 3223
 	;;
3224 3224
     esac
3225 3225
     ;;
3226
-  interix3*)
3226
+  interix[[3-9]]*)
3227 3227
     _LT_AC_TAGVAR(hardcode_direct, $1)=no
3228 3228
     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3229 3229
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
... ...
@@ -3343,6 +3414,29 @@ case $host_os in
3343 3343
 	# dependencies.
3344 3344
 	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3345 3345
 	;;
3346
+      *)
3347
+	case `$CC -V 2>&1 | sed 5q` in
3348
+	*Sun\ C*)
3349
+	  # Sun C++ 5.9
3350
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3351
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3352
+	  _LT_AC_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'
3353
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3354
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
3355
+
3356
+	  # Not sure whether something based on
3357
+	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3358
+	  # would be better.
3359
+	  output_verbose_link_cmd='echo'
3360
+
3361
+	  # Archives containing C++ object files must be created using
3362
+	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3363
+	  # necessary to make sure instantiated templates are included
3364
+	  # in the archive.
3365
+	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3366
+	  ;;
3367
+	esac
3368
+	;;
3346 3369
     esac
3347 3370
     ;;
3348 3371
   lynxos*)
... ...
@@ -3381,16 +3475,20 @@ case $host_os in
3381 3381
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3382 3382
     ;;
3383 3383
   openbsd*)
3384
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3385
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3386
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3387
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3388
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3389
-      _LT_AC_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'
3390
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3391
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3384
+    if test -f /usr/libexec/ld.so; then
3385
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3386
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3387
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3388
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3389
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3390
+	_LT_AC_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'
3391
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3392
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3393
+      fi
3394
+      output_verbose_link_cmd='echo'
3395
+    else
3396
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3392 3397
     fi
3393
-    output_verbose_link_cmd='echo'
3394 3398
     ;;
3395 3399
   osf3*)
3396 3400
     case $cc_basename in
... ...
@@ -3552,15 +3650,10 @@ case $host_os in
3552 3552
 	case $host_os in
3553 3553
 	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3554 3554
 	  *)
3555
-	    # The C++ compiler is used as linker so we must use $wl
3556
-	    # flag to pass the commands to the underlying system
3557
-	    # linker. We must also pass each convience library through
3558
-	    # to the system linker between allextract/defaultextract.
3559
-	    # The C++ compiler will combine linker options so we
3560
-	    # cannot just pass the convience library names through
3561
-	    # without $wl.
3555
+	    # The compiler driver will combine and reorder linker options,
3556
+	    # but understands `-z linker_flag'.
3562 3557
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3563
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
3558
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
3564 3559
 	    ;;
3565 3560
 	esac
3566 3561
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
... ...
@@ -3607,6 +3700,12 @@ case $host_os in
3607 3607
 	  fi
3608 3608
 
3609 3609
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3610
+	  case $host_os in
3611
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3612
+	  *)
3613
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3614
+	    ;;
3615
+	  esac
3610 3616
 	fi
3611 3617
 	;;
3612 3618
     esac
... ...
@@ -3850,7 +3949,7 @@ $rm -f confest.$objext
3850 3850
 # PORTME: override above test on systems where it is broken
3851 3851
 ifelse([$1],[CXX],
3852 3852
 [case $host_os in
3853
-interix3*)
3853
+interix[[3-9]]*)
3854 3854
   # Interix 3.5 installs completely hosed .la files for C++, so rather than
3855 3855
   # hack all around it, let's just trust "g++" to DTRT.
3856 3856
   _LT_AC_TAGVAR(predep_objects,$1)=
... ...
@@ -3858,13 +3957,46 @@ interix3*)
3858 3858
   _LT_AC_TAGVAR(postdeps,$1)=
3859 3859
   ;;
3860 3860
 
3861
+linux*)
3862
+  case `$CC -V 2>&1 | sed 5q` in
3863
+  *Sun\ C*)
3864
+    # Sun C++ 5.9
3865
+    #
3866
+    # The more standards-conforming stlport4 library is
3867
+    # incompatible with the Cstd library. Avoid specifying
3868
+    # it if it's in CXXFLAGS. Ignore libCrun as
3869
+    # -library=stlport4 depends on it.
3870
+    case " $CXX $CXXFLAGS " in
3871
+    *" -library=stlport4 "*)
3872
+      solaris_use_stlport4=yes
3873
+      ;;
3874
+    esac
3875
+    if test "$solaris_use_stlport4" != yes; then
3876
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3877
+    fi
3878
+    ;;
3879
+  esac
3880
+  ;;
3881
+
3861 3882
 solaris*)
3862 3883
   case $cc_basename in
3863 3884
   CC*)
3885
+    # The more standards-conforming stlport4 library is
3886
+    # incompatible with the Cstd library. Avoid specifying
3887
+    # it if it's in CXXFLAGS. Ignore libCrun as
3888
+    # -library=stlport4 depends on it.
3889
+    case " $CXX $CXXFLAGS " in
3890
+    *" -library=stlport4 "*)
3891
+      solaris_use_stlport4=yes
3892
+      ;;
3893
+    esac
3894
+
3864 3895
     # Adding this requires a known-good setup of shared libraries for
3865 3896
     # Sun compiler versions before 5.6, else PIC objects from an old
3866 3897
     # archive will be linked into the output, leading to subtle bugs.
3867
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
3898
+    if test "$solaris_use_stlport4" != yes; then
3899
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3900
+    fi
3868 3901
     ;;
3869 3902
   esac
3870 3903
   ;;
... ...
@@ -3913,10 +4045,17 @@ objext=o
3913 3913
 _LT_AC_TAGVAR(objext, $1)=$objext
3914 3914
 
3915 3915
 # Code to be used in simple compile tests
3916
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
3916
+lt_simple_compile_test_code="\
3917
+      subroutine t
3918
+      return
3919
+      end
3920
+"
3917 3921
 
3918 3922
 # Code to be used in simple link tests
3919
-lt_simple_link_test_code="      program t\n      end\n"
3923
+lt_simple_link_test_code="\
3924
+      program t
3925
+      end
3926
+"
3920 3927
 
3921 3928
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
3922 3929
 _LT_AC_SYS_COMPILER
... ...
@@ -3995,10 +4134,10 @@ objext=o
3995 3995
 _LT_AC_TAGVAR(objext, $1)=$objext
3996 3996
 
3997 3997
 # Code to be used in simple compile tests
3998
-lt_simple_compile_test_code="class foo {}\n"
3998
+lt_simple_compile_test_code="class foo {}"
3999 3999
 
4000 4000
 # Code to be used in simple link tests
4001
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
4001
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
4002 4002
 
4003 4003
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
4004 4004
 _LT_AC_SYS_COMPILER
... ...
@@ -4051,7 +4190,7 @@ objext=o
4051 4051
 _LT_AC_TAGVAR(objext, $1)=$objext
4052 4052
 
4053 4053
 # Code to be used in simple compile tests
4054
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
4054
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
4055 4055
 
4056 4056
 # Code to be used in simple link tests
4057 4057
 lt_simple_link_test_code="$lt_simple_compile_test_code"
... ...
@@ -4140,6 +4279,7 @@ if test -f "$ltmain"; then
4140 4140
     _LT_AC_TAGVAR(module_cmds, $1) \
4141 4141
     _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4142 4142
     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4143
+    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
4143 4144
     _LT_AC_TAGVAR(exclude_expsyms, $1) \
4144 4145
     _LT_AC_TAGVAR(include_expsyms, $1); do
4145 4146
 
... ...
@@ -4186,7 +4326,7 @@ ifelse([$1], [],
4186 4186
 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4187 4187
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
4188 4188
 #
4189
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4189
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
4190 4190
 # Free Software Foundation, Inc.
4191 4191
 #
4192 4192
 # This file is part of GNU Libtool:
... ...
@@ -4511,7 +4651,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4511 4511
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4512 4512
 
4513 4513
 # Fix the shell variable \$srcfile for the compiler.
4514
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
4514
+fix_srcfile_path=$lt_fix_srcfile_path
4515 4515
 
4516 4516
 # Set to yes if exported symbols are required.
4517 4517
 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
... ...
@@ -4594,6 +4734,7 @@ fi
4594 4594
 # ---------------------------------
4595 4595
 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4596 4596
 [AC_REQUIRE([AC_CANONICAL_HOST])
4597
+AC_REQUIRE([LT_AC_PROG_SED])
4597 4598
 AC_REQUIRE([AC_PROG_NM])
4598 4599
 AC_REQUIRE([AC_OBJEXT])
4599 4600
 # Check for command to grab the raw symbol name followed by C symbol from nm.
... ...
@@ -4820,12 +4961,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
4820 4820
       # like `-m68040'.
4821 4821
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4822 4822
       ;;
4823
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4823
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4824 4824
       # PIC is the default for these OSes.
4825 4825
       ;;
4826
-    mingw* | os2* | pw32*)
4826
+    mingw* | cygwin* | os2* | pw32*)
4827 4827
       # This hack is so that the source file can tell whether it is being
4828 4828
       # built for inclusion in a dll (and should export symbols for example).
4829
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4830
+      # (--disable-auto-import) libraries
4829 4831
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4830 4832
       ;;
4831 4833
     darwin* | rhapsody*)
... ...
@@ -4837,7 +4980,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
4837 4837
       # DJGPP does not support shared libraries at all
4838 4838
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4839 4839
       ;;
4840
-    interix3*)
4840
+    interix[[3-9]]*)
4841 4841
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4842 4842
       # Instead, we relocate shared libraries at runtime.
4843 4843
       ;;
... ...
@@ -4973,6 +5116,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
4973 4973
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4974 4974
 	    ;;
4975 4975
 	  *)
4976
+	    case `$CC -V 2>&1 | sed 5q` in
4977
+	    *Sun\ C*)
4978
+	      # Sun C++ 5.9
4979
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4980
+	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4981
+	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4982
+	      ;;
4983
+	    esac
4976 4984
 	    ;;
4977 4985
 	esac
4978 4986
 	;;
... ...
@@ -5093,13 +5244,15 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
5093 5093
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5094 5094
       ;;
5095 5095
 
5096
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5096
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5097 5097
       # PIC is the default for these OSes.
5098 5098
       ;;
5099 5099
 
5100
-    mingw* | pw32* | os2*)
5100
+    mingw* | cygwin* | pw32* | os2*)
5101 5101
       # This hack is so that the source file can tell whether it is being
5102 5102
       # built for inclusion in a dll (and should export symbols for example).
5103
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5104
+      # (--disable-auto-import) libraries
5103 5105
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5104 5106
       ;;
5105 5107
 
... ...
@@ -5109,7 +5262,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
5109 5109
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5110 5110
       ;;
5111 5111
 
5112
-    interix3*)
5112
+    interix[[3-9]]*)
5113 5113
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5114 5114
       # Instead, we relocate shared libraries at runtime.
5115 5115
       ;;
... ...
@@ -5167,7 +5320,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
5167 5167
        esac
5168 5168
        ;;
5169 5169
 
5170
-    mingw* | pw32* | os2*)
5170
+    mingw* | cygwin* | pw32* | os2*)
5171 5171
       # This hack is so that the source file can tell whether it is being
5172 5172
       # built for inclusion in a dll (and should export symbols for example).
5173 5173
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
... ...
@@ -5219,6 +5372,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
5219 5219
         # All Alpha code is PIC.
5220 5220
         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5221 5221
         ;;
5222
+      *)
5223
+        case `$CC -V 2>&1 | sed 5q` in
5224
+	*Sun\ C*)
5225
+	  # Sun C 5.9
5226
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5227
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5228
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5229
+	  ;;
5230
+	*Sun\ F*)
5231
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5232
+	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5233
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5234
+	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5235
+	  ;;
5236
+	esac
5237
+	;;
5222 5238
       esac
5223 5239
       ;;
5224 5240
 
... ...
@@ -5228,6 +5397,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
5228 5228
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5229 5229
       ;;
5230 5230
 
5231
+    rdos*)
5232
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5233
+      ;;
5234
+
5231 5235
     solaris*)
5232 5236
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5233 5237
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
... ...
@@ -5322,7 +5495,8 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5322 5322
 # ------------------------------------
5323 5323
 # See if the linker supports building shared libraries.
5324 5324
 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5325
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5325
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
5326
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5326 5327
 ifelse([$1],[CXX],[
5327 5328
   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5328 5329
   case $host_os in
... ...
@@ -5339,7 +5513,7 @@ ifelse([$1],[CXX],[
5339 5339
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5340 5340
   ;;
5341 5341
   cygwin* | mingw*)
5342
-    _LT_AC_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'
5342
+    _LT_AC_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'
5343 5343
   ;;
5344 5344
   linux* | k*bsd*-gnu)
5345 5345
     _LT_AC_TAGVAR(link_all_deplibs, $1)=no
... ...
@@ -5481,7 +5655,7 @@ EOF
5481 5481
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5482 5482
       _LT_AC_TAGVAR(always_export_symbols, $1)=no
5483 5483
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5484
-      _LT_AC_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'
5484
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5485 5485
 
5486 5486
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5487 5487
         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
... ...
@@ -5499,7 +5673,7 @@ EOF
5499 5499
       fi
5500 5500
       ;;
5501 5501
 
5502
-    interix3*)
5502
+    interix[[3-9]]*)
5503 5503
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
5504 5504
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5505 5505
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
... ...
@@ -5514,7 +5688,7 @@ EOF
5514 5514
       _LT_AC_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'
5515 5515
       ;;
5516 5516
 
5517
-    linux* | k*bsd*-gnu)
5517
+    gnu* | linux* | k*bsd*-gnu)
5518 5518
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5519 5519
 	tmp_addflag=
5520 5520
 	case $cc_basename,$host_cpu in
... ...
@@ -5532,13 +5706,22 @@ EOF
5532 5532
 	ifc* | ifort*)			# Intel Fortran compiler
5533 5533
 	  tmp_addflag=' -nofor_main' ;;
5534 5534
 	esac
5535
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5535
+	case `$CC -V 2>&1 | sed 5q` in
5536
+	*Sun\ C*)			# Sun C 5.9
5537
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
5538
+	  tmp_sharedflag='-G' ;;
5539
+	*Sun\ F*)			# Sun Fortran 8.3
5540
+	  tmp_sharedflag='-G' ;;
5541
+	*)
5542
+	  tmp_sharedflag='-shared' ;;
5543
+	esac
5544
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5536 5545
 
5537 5546
 	if test $supports_anon_versioning = yes; then
5538 5547
 	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5539 5548
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5540 5549
   $echo "local: *; };" >> $output_objdir/$libname.ver~
5541
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5550
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5542 5551
 	fi
5543 5552
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
5544 5553
       else
... ...
@@ -5579,7 +5762,7 @@ EOF
5579 5579
 
5580 5580
     sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5581 5581
       case `$LD -v 2>&1` in
5582
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
5582
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5583 5583
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5584 5584
 	cat <<_LT_EOF 1>&2
5585 5585
 
... ...
@@ -5698,7 +5881,7 @@ _LT_EOF
5698 5698
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5699 5699
 	  then
5700 5700
   	  # We have reworked collect2
5701
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5701
+  	  :
5702 5702
 	  else
5703 5703
   	  # We have old collect2
5704 5704
   	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
... ...
@@ -5791,7 +5974,7 @@ _LT_EOF
5791 5791
       # The linker will automatically build a .lib file if we build a DLL.
5792 5792
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
5793 5793
       # FIXME: Should let the user specify the lib program.
5794
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
5794
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5795 5795
       _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
5796 5796
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5797 5797
       ;;
... ...
@@ -5833,10 +6016,10 @@ _LT_EOF
5833 5833
       case $cc_basename in
5834 5834
         xlc*)
5835 5835
          output_verbose_link_cmd='echo'
5836
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
5836
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
5837 5837
          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5838 5838
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5839
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5839
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5840 5840
           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
5841 5841
           ;;
5842 5842
        *)
... ...
@@ -5998,24 +6181,28 @@ _LT_EOF
5998 5998
       ;;
5999 5999
 
6000 6000
     openbsd*)
6001
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6002
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6003
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6004
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6005
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6006
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6007
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6001
+      if test -f /usr/libexec/ld.so; then
6002
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6003
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6004
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6005
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6006
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6007
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6008
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6009
+	else
6010
+	  case $host_os in
6011
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6012
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6013
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6014
+	     ;;
6015
+	   *)
6016
+	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6017
+	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6018
+	     ;;
6019
+	  esac
6020
+        fi
6008 6021
       else
6009
-       case $host_os in
6010
-	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6011
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6012
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6013
-	   ;;
6014
-	 *)
6015
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6016
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6017
-	   ;;
6018
-       esac
6022
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6019 6023
       fi
6020 6024
       ;;
6021 6025
 
... ...
@@ -6074,17 +6261,16 @@ _LT_EOF
6074 6074
       case $host_os in
6075 6075
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6076 6076
       *)
6077
- 	# The compiler driver will combine linker options so we
6078
- 	# cannot just pass the convience library names through
6079
- 	# without $wl, iff we do not link with $LD.
6080
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
6077
+	# The compiler driver will combine and reorder linker options,
6078
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6079
+	# but is careful enough not to reorder.
6081 6080
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
6082
- 	case $wlarc in
6083
- 	'')
6084
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
6085
- 	*)
6086
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
6087
- 	esac ;;
6081
+	if test "$GCC" = yes; then
6082
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6083
+	else
6084
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6085
+	fi
6086
+	;;
6088 6087
       esac
6089 6088
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6090 6089
       ;;
... ...
@@ -6141,7 +6327,7 @@ _LT_EOF
6141 6141
       fi
6142 6142
       ;;
6143 6143
 
6144
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
6144
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6145 6145
       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6146 6146
       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6147 6147
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
... ...
@@ -6216,7 +6402,7 @@ x|xyes)
6216 6216
       # to ld, don't add -lc before -lgcc.
6217 6217
       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6218 6218
       $rm conftest*
6219
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
6219
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6220 6220
 
6221 6221
       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6222 6222
         soname=conftest
... ...
@@ -6319,6 +6505,30 @@ AC_DEFUN([LT_AC_PROG_RC],
6319 6319
 [AC_CHECK_TOOL(RC, windres, no)
6320 6320
 ])
6321 6321
 
6322
+
6323
+# Cheap backport of AS_EXECUTABLE_P and required macros
6324
+# from Autoconf 2.59; we should not use $as_executable_p directly.
6325
+
6326
+# _AS_TEST_PREPARE
6327
+# ----------------
6328
+m4_ifndef([_AS_TEST_PREPARE],
6329
+[m4_defun([_AS_TEST_PREPARE],
6330
+[if test -x / >/dev/null 2>&1; then
6331
+  as_executable_p='test -x'
6332
+else
6333
+  as_executable_p='test -f'
6334
+fi
6335
+])])# _AS_TEST_PREPARE
6336
+
6337
+# AS_EXECUTABLE_P
6338
+# ---------------
6339
+# Check whether a file is executable.
6340
+m4_ifndef([AS_EXECUTABLE_P],
6341
+[m4_defun([AS_EXECUTABLE_P],
6342
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6343
+$as_executable_p $1[]dnl
6344
+])])# AS_EXECUTABLE_P
6345
+
6322 6346
 # NOTE: This macro has been submitted for inclusion into   #
6323 6347
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6324 6348
 #  a released version of Autoconf we should remove this    #
... ...
@@ -6339,12 +6549,13 @@ do
6339 6339
   test -z "$as_dir" && as_dir=.
6340 6340
   for lt_ac_prog in sed gsed; do
6341 6341
     for ac_exec_ext in '' $ac_executable_extensions; do
6342
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
6342
+      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
6343 6343
         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6344 6344
       fi
6345 6345
     done
6346 6346
   done
6347 6347
 done
6348
+IFS=$as_save_IFS
6348 6349
 lt_ac_max=0
6349 6350
 lt_ac_count=0
6350 6351
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
... ...
@@ -6377,6 +6588,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6377 6377
 done
6378 6378
 ])
6379 6379
 SED=$lt_cv_path_SED
6380
+AC_SUBST([SED])
6380 6381
 AC_MSG_RESULT([$SED])
6381 6382
 ])
6382 6383
 
... ...
@@ -180,9 +180,6 @@
180 180
 /* Define to 1 if you have a working `mmap' system call. */
181 181
 #undef HAVE_MMAP
182 182
 
183
-/* Support for NodalCore acceleration */
184
-#undef HAVE_NCORE
185
-
186 183
 /* Define to 1 if you have the <ndir.h> header file. */
187 184
 #undef HAVE_NDIR_H
188 185
 
... ...
@@ -171,6 +171,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
171 171
 PACKAGE_VERSION = @PACKAGE_VERSION@
172 172
 PATH_SEPARATOR = @PATH_SEPARATOR@
173 173
 RANLIB = @RANLIB@
174
+SED = @SED@
174 175
 SET_MAKE = @SET_MAKE@
175 176
 SHELL = @SHELL@
176 177
 STRIP = @STRIP@
... ...
@@ -156,6 +156,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
156 156
 PACKAGE_VERSION = @PACKAGE_VERSION@
157 157
 PATH_SEPARATOR = @PATH_SEPARATOR@
158 158
 RANLIB = @RANLIB@
159
+SED = @SED@
159 160
 SET_MAKE = @SET_MAKE@
160 161
 SHELL = @SHELL@
161 162
 STRIP = @STRIP@
... ...
@@ -176,6 +176,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
176 176
 PACKAGE_VERSION = @PACKAGE_VERSION@
177 177
 PATH_SEPARATOR = @PATH_SEPARATOR@
178 178
 RANLIB = @RANLIB@
179
+SED = @SED@
179 180
 SET_MAKE = @SET_MAKE@
180 181
 SHELL = @SHELL@
181 182
 STRIP = @STRIP@
... ...
@@ -312,15 +312,6 @@ int main(int argc, char **argv)
312 312
     else
313 313
 	logg("Disabling URL based phishing detection.\n");
314 314
 
315
-    if(cfgopt(copt, "NodalCoreAcceleration")->enabled) {
316
-#ifdef HAVE_NCORE
317
-	dboptions |= CL_DB_NCORE;
318
-	logg("Enabling support for hardware acceleration.\n");
319
-#else
320
-	logg("^Support for hardware acceleration not compiled in.\n");
321
-#endif
322
-    }
323
-
324 315
     if((ret = cl_load(dbdir, &engine, &sigs, dboptions))) {
325 316
 	logg("!%s\n", cl_strerror(ret));
326 317
 	logg_close();
... ...
@@ -610,11 +610,6 @@ int acceptloop_th(int *socketds, int nsockets, struct cl_engine *engine, unsigne
610 610
 	}
611 611
 
612 612
 	pthread_mutex_lock(&reload_mutex);
613
-	if(reload && cfgopt(copt, "NodalCoreAcceleration")->enabled) {
614
-	    logg("^RELOAD is not available in hardware accelerated mode (yet).\n");
615
-	    logg("^Please restart the daemon manually.\n");
616
-	    reload = 0;
617
-	}
618 613
 	if(reload) {
619 614
 	    pthread_mutex_unlock(&reload_mutex);
620 615
 	    engine = reload_db(engine, dboptions, copt, FALSE, &ret);
... ...
@@ -165,6 +165,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
165 165
 PACKAGE_VERSION = @PACKAGE_VERSION@
166 166
 PATH_SEPARATOR = @PATH_SEPARATOR@
167 167
 RANLIB = @RANLIB@
168
+SED = @SED@
168 169
 SET_MAKE = @SET_MAKE@
169 170
 SHELL = @SHELL@
170 171
 STRIP = @STRIP@
... ...
@@ -56,7 +56,6 @@
56 56
 
57 57
 void move_infected(const char *filename, const struct optstruct *opt);
58 58
 int notremoved = 0, notmoved = 0;
59
-static int ncore = 0;
60 59
 
61 60
 static int dsresult(int sockd, const struct optstruct *opt)
62 61
 {
... ...
@@ -389,11 +388,6 @@ static int dconnect(const struct optstruct *opt)
389 389
 	return -1;
390 390
     }
391 391
 
392
-#ifdef HAVE_NCORE
393
-    if(cfgopt(copt, "NodalCoreAcceleration")->enabled)
394
-	ncore = 1;
395
-#endif
396
-
397 392
     freecfg(copt);
398 393
 
399 394
     return sockd;
... ...
@@ -409,7 +403,7 @@ int client(const struct optstruct *opt, int *infected)
409 409
 
410 410
     *infected = 0;
411 411
 
412
-    if(ncore || opt_check(opt, "multiscan"))
412
+    if(opt_check(opt, "multiscan"))
413 413
 	scantype = "MULTISCAN";
414 414
 
415 415
     /* parse argument list */
... ...
@@ -159,6 +159,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
159 159
 PACKAGE_VERSION = @PACKAGE_VERSION@
160 160
 PATH_SEPARATOR = @PATH_SEPARATOR@
161 161
 RANLIB = @RANLIB@
162
+SED = @SED@
162 163
 SET_MAKE = @SET_MAKE@
163 164
 SHELL = @SHELL@
164 165
 STRIP = @STRIP@
... ...
@@ -224,10 +224,7 @@ int main(int argc, char **argv)
224 224
 	dms += (dms < 0) ? (1000000):(0);
225 225
 	logg("\n----------- SCAN SUMMARY -----------\n");
226 226
 	logg("Known viruses: %u\n", info.sigs);
227
-	if(opt_check(opt, "ncore"))
228
-	    logg("Engine version: %s [ncore]\n", cl_retver());
229
-	else
230
-	    logg("Engine version: %s\n", cl_retver());
227
+	logg("Engine version: %s\n", cl_retver());
231 228
 	logg("Scanned directories: %u\n", info.dirs);
232 229
 	logg("Scanned files: %u\n", info.files);
233 230
 	logg("Infected files: %u\n", info.ifiles);
... ...
@@ -294,9 +291,6 @@ void help(void)
294 294
     mprintf("    --include=PATT                       Only scan file names containing PATT\n");
295 295
     mprintf("    --include-dir=PATT                   Only scan directories containing PATT\n");
296 296
 #endif
297
-#ifdef HAVE_NCORE
298
-    mprintf("\n    --ncore                            Use hardware acceleration\n");
299
-#endif
300 297
     mprintf("\n");
301 298
     mprintf("    --detect-pua                         Detect Possibly Unwanted Applications\n");
302 299
     mprintf("    --no-mail                            Disable mail file support\n");
... ...
@@ -59,9 +59,6 @@ static struct option clamscan_longopt[] = {
59 59
     {"max-recursion", 1, 0, 0},
60 60
     {"max-dir-recursion", 1, 0, 0},
61 61
     {"max-mail-recursion", 1, 0, 0},
62
-#ifdef HAVE_NCORE
63
-    {"ncore", 0, 0, 0},
64
-#endif
65 62
     {"detect-pua", 0, 0, 0},
66 63
     {"disable-archive", 0, 0, 0},
67 64
     {"no-archive", 0, 0, 0},
... ...
@@ -164,9 +164,6 @@ int scanmanager(const struct optstruct *opt)
164 164
     }
165 165
 #endif
166 166
 
167
-    if(opt_check(opt, "ncore"))
168
-	dboptions |= CL_DB_NCORE;
169
-
170 167
     if(!opt_check(opt, "no-phishing-sigs"))
171 168
 	dboptions |= CL_DB_PHISHING;
172 169
 
... ...
@@ -855,6 +855,7 @@ CCDEPMODE
855 855
 am__fastdepCC_TRUE
856 856
 am__fastdepCC_FALSE
857 857
 LN_S
858
+SED
858 859
 GREP
859 860
 EGREP
860 861
 ECHO
... ...
@@ -1499,7 +1500,6 @@ Optional Features:
1499 1499
                           (and sometimes confusing) to the casual installer
1500 1500
   --disable-zlib-vcheck	  do not check for buggy zlib version
1501 1501
   --disable-bzip2	  disable bzip2 support
1502
-  --disable-ncore	  disable support for NodalCore acceleration (default=auto)
1503 1502
   --disable-dns           disable support for database verification through
1504 1503
                           DNS
1505 1504
   --disable-clamuko	  disable clamuko support (Linux, DragonFly and FreeBSD only)
... ...
@@ -4096,12 +4096,13 @@ do
4096 4096
   test -z "$as_dir" && as_dir=.
4097 4097
   for lt_ac_prog in sed gsed; do
4098 4098
     for ac_exec_ext in '' $ac_executable_extensions; do
4099
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
4099
+      if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
4100 4100
         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
4101 4101
       fi
4102 4102
     done
4103 4103
   done
4104 4104
 done
4105
+IFS=$as_save_IFS
4105 4106
 lt_ac_max=0
4106 4107
 lt_ac_count=0
4107 4108
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
... ...
@@ -4136,6 +4137,7 @@ done
4136 4136
 fi
4137 4137
 
4138 4138
 SED=$lt_cv_path_SED
4139
+
4139 4140
 { echo "$as_me:$LINENO: result: $SED" >&5
4140 4141
 echo "${ECHO_T}$SED" >&6; }
4141 4142
 
... ...
@@ -4486,8 +4488,8 @@ fi
4486 4486
 echo "${ECHO_T}$lt_cv_path_NM" >&6; }
4487 4487
 NM="$lt_cv_path_NM"
4488 4488
 
4489
-{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
4490
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
4489
+{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
4490
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
4491 4491
 if test "${lt_cv_deplibs_check_method+set}" = set; then
4492 4492
   echo $ECHO_N "(cached) $ECHO_C" >&6
4493 4493
 else
... ...
@@ -4528,9 +4530,15 @@ cygwin*)
4528 4528
 
4529 4529
 mingw* | pw32*)
4530 4530
   # Base MSYS/MinGW do not provide the 'file' command needed by
4531
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
4532
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4533
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
4531
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4532
+  # unless we find 'file', for example because we are cross-compiling.
4533
+  if ( file / ) >/dev/null 2>&1; then
4534
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4535
+    lt_cv_file_magic_cmd='func_win32_libid'
4536
+  else
4537
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4538
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
4539
+  fi
4534 4540
   ;;
4535 4541
 
4536 4542
 darwin* | rhapsody*)
... ...
@@ -4575,7 +4583,7 @@ hpux10.20* | hpux11*)
4575 4575
   esac
4576 4576
   ;;
4577 4577
 
4578
-interix3*)
4578
+interix[3-9]*)
4579 4579
   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4580 4580
   lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
4581 4581
   ;;
... ...
@@ -4625,6 +4633,10 @@ osf3* | osf4* | osf5*)
4625 4625
   lt_cv_deplibs_check_method=pass_all
4626 4626
   ;;
4627 4627
 
4628
+rdos*)
4629
+  lt_cv_deplibs_check_method=pass_all
4630
+  ;;
4631
+
4628 4632
 solaris*)
4629 4633
   lt_cv_deplibs_check_method=pass_all
4630 4634
   ;;
... ...
@@ -4712,7 +4724,7 @@ ia64-*-hpux*)
4712 4712
   ;;
4713 4713
 *-*-irix6*)
4714 4714
   # Find out which ABI we are using.
4715
-  echo '#line 4715 "configure"' > conftest.$ac_ext
4715
+  echo '#line 4727 "configure"' > conftest.$ac_ext
4716 4716
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
4717 4717
   (eval $ac_compile) 2>&5
4718 4718
   ac_status=$?
... ...
@@ -4747,7 +4759,8 @@ ia64-*-hpux*)
4747 4747
   rm -rf conftest*
4748 4748
   ;;
4749 4749
 
4750
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
4750
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
4751
+s390*-*linux*|sparc*-*linux*)
4751 4752
   # Find out which ABI we are using.
4752 4753
   echo 'int i;' > conftest.$ac_ext
4753 4754
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
... ...
@@ -4758,6 +4771,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
4758 4758
     case `/usr/bin/file conftest.o` in
4759 4759
     *32-bit*)
4760 4760
       case $host in
4761
+        x86_64-*kfreebsd*-gnu)
4762
+          LD="${LD-ld} -m elf_i386_fbsd"
4763
+          ;;
4761 4764
         x86_64-*linux*)
4762 4765
           LD="${LD-ld} -m elf_i386"
4763 4766
           ;;
... ...
@@ -4774,6 +4790,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
4774 4774
       ;;
4775 4775
     *64-bit*)
4776 4776
       case $host in
4777
+        x86_64-*kfreebsd*-gnu)
4778
+          LD="${LD-ld} -m elf_x86_64_fbsd"
4779
+          ;;
4777 4780
         x86_64-*linux*)
4778 4781
           LD="${LD-ld} -m elf_x86_64"
4779 4782
           ;;
... ...
@@ -6562,24 +6581,27 @@ else
6562 6562
     fi
6563 6563
     ;;
6564 6564
   *)
6565
-    # If test is not a shell built-in, we'll probably end up computing a
6566
-    # maximum length that is only half of the actual maximum length, but
6567
-    # we can't tell.
6568
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
6569
-    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
6565
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
6566
+    if test -n "$lt_cv_sys_max_cmd_len"; then
6567
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
6568
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
6569
+    else
6570
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
6571
+      while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
6570 6572
 	       = "XX$teststring") >/dev/null 2>&1 &&
6571
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
6572
-	    lt_cv_sys_max_cmd_len=$new_result &&
6573
-	    test $i != 17 # 1/2 MB should be enough
6574
-    do
6575
-      i=`expr $i + 1`
6576
-      teststring=$teststring$teststring
6577
-    done
6578
-    teststring=
6579
-    # Add a significant safety factor because C++ compilers can tack on massive
6580
-    # amounts of additional arguments before passing them to the linker.
6581
-    # It appears as though 1/2 is a usable value.
6582
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6573
+	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
6574
+	      lt_cv_sys_max_cmd_len=$new_result &&
6575
+	      test $i != 17 # 1/2 MB should be enough
6576
+      do
6577
+        i=`expr $i + 1`
6578
+        teststring=$teststring$teststring
6579
+      done
6580
+      teststring=
6581
+      # Add a significant safety factor because C++ compilers can tack on massive
6582
+      # amounts of additional arguments before passing them to the linker.
6583
+      # It appears as though 1/2 is a usable value.
6584
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
6585
+    fi
6583 6586
     ;;
6584 6587
   esac
6585 6588
 
... ...
@@ -6596,6 +6618,7 @@ fi
6596 6596
 
6597 6597
 
6598 6598
 
6599
+
6599 6600
 # Check for command to grab the raw symbol name followed by C symbol from nm.
6600 6601
 { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
6601 6602
 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
... ...
@@ -7184,7 +7207,7 @@ test -z "$STRIP" && STRIP=:
7184 7184
 test -z "$ac_objext" && ac_objext=o
7185 7185
 
7186 7186
 # Determine commands to create old-style static archives.
7187
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
7187
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
7188 7188
 old_postinstall_cmds='chmod 644 $oldlib'
7189 7189
 old_postuninstall_cmds=
7190 7190
 
... ...
@@ -7384,10 +7407,10 @@ objext=o
7384 7384
 objext=$objext
7385 7385
 
7386 7386
 # Code to be used in simple compile tests
7387
-lt_simple_compile_test_code="int some_variable = 0;\n"
7387
+lt_simple_compile_test_code="int some_variable = 0;"
7388 7388
 
7389 7389
 # Code to be used in simple link tests
7390
-lt_simple_link_test_code='int main(){return(0);}\n'
7390
+lt_simple_link_test_code='int main(){return(0);}'
7391 7391
 
7392 7392
 
7393 7393
 # If no C compiler was specified, use CC.
... ...
@@ -7402,13 +7425,13 @@ compiler=$CC
7402 7402
 
7403 7403
 # save warnings/boilerplate of simple test code
7404 7404
 ac_outfile=conftest.$ac_objext
7405
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
7405
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
7406 7406
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7407 7407
 _lt_compiler_boilerplate=`cat conftest.err`
7408 7408
 $rm conftest*
7409 7409
 
7410 7410
 ac_outfile=conftest.$ac_objext
7411
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
7411
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
7412 7412
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7413 7413
 _lt_linker_boilerplate=`cat conftest.err`
7414 7414
 $rm conftest*
... ...
@@ -7428,7 +7451,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
7428 7428
 else
7429 7429
   lt_cv_prog_compiler_rtti_exceptions=no
7430 7430
   ac_outfile=conftest.$ac_objext
7431
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7431
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7432 7432
    lt_compiler_flag="-fno-rtti -fno-exceptions"
7433 7433
    # Insert the option either (1) after the last *FLAGS variable, or
7434 7434
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -7439,11 +7462,11 @@ else
7439 7439
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7440 7440
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7441 7441
    -e 's:$: $lt_compiler_flag:'`
7442
-   (eval echo "\"\$as_me:7442: $lt_compile\"" >&5)
7442
+   (eval echo "\"\$as_me:7465: $lt_compile\"" >&5)
7443 7443
    (eval "$lt_compile" 2>conftest.err)
7444 7444
    ac_status=$?
7445 7445
    cat conftest.err >&5
7446
-   echo "$as_me:7446: \$? = $ac_status" >&5
7446
+   echo "$as_me:7469: \$? = $ac_status" >&5
7447 7447
    if (exit $ac_status) && test -s "$ac_outfile"; then
7448 7448
      # The compiler can only warn and ignore the option if not recognized
7449 7449
      # So say no if there are warnings other than the usual output.
... ...
@@ -7494,13 +7517,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
7494 7494
       lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
7495 7495
       ;;
7496 7496
 
7497
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7497
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7498 7498
       # PIC is the default for these OSes.
7499 7499
       ;;
7500 7500
 
7501
-    mingw* | pw32* | os2*)
7501
+    mingw* | cygwin* | pw32* | os2*)
7502 7502
       # This hack is so that the source file can tell whether it is being
7503 7503
       # built for inclusion in a dll (and should export symbols for example).
7504
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
7505
+      # (--disable-auto-import) libraries
7504 7506
       lt_prog_compiler_pic='-DDLL_EXPORT'
7505 7507
       ;;
7506 7508
 
... ...
@@ -7510,7 +7535,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
7510 7510
       lt_prog_compiler_pic='-fno-common'
7511 7511
       ;;
7512 7512
 
7513
-    interix3*)
7513
+    interix[3-9]*)
7514 7514
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7515 7515
       # Instead, we relocate shared libraries at runtime.
7516 7516
       ;;
... ...
@@ -7568,7 +7593,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
7568 7568
        esac
7569 7569
        ;;
7570 7570
 
7571
-    mingw* | pw32* | os2*)
7571
+    mingw* | cygwin* | pw32* | os2*)
7572 7572
       # This hack is so that the source file can tell whether it is being
7573 7573
       # built for inclusion in a dll (and should export symbols for example).
7574 7574
       lt_prog_compiler_pic='-DDLL_EXPORT'
... ...
@@ -7620,6 +7645,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
7620 7620
         # All Alpha code is PIC.
7621 7621
         lt_prog_compiler_static='-non_shared'
7622 7622
         ;;
7623
+      *)
7624
+        case `$CC -V 2>&1 | sed 5q` in
7625
+	*Sun\ C*)
7626
+	  # Sun C 5.9
7627
+	  lt_prog_compiler_pic='-KPIC'
7628
+	  lt_prog_compiler_static='-Bstatic'
7629
+	  lt_prog_compiler_wl='-Wl,'
7630
+	  ;;
7631
+	*Sun\ F*)
7632
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
7633
+	  lt_prog_compiler_pic='-KPIC'
7634
+	  lt_prog_compiler_static='-Bstatic'
7635
+	  lt_prog_compiler_wl=''
7636
+	  ;;
7637
+	esac
7638
+	;;
7623 7639
       esac
7624 7640
       ;;
7625 7641
 
... ...
@@ -7629,6 +7670,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
7629 7629
       lt_prog_compiler_static='-non_shared'
7630 7630
       ;;
7631 7631
 
7632
+    rdos*)
7633
+      lt_prog_compiler_static='-non_shared'
7634
+      ;;
7635
+
7632 7636
     solaris*)
7633 7637
       lt_prog_compiler_pic='-KPIC'
7634 7638
       lt_prog_compiler_static='-Bstatic'
... ...
@@ -7696,7 +7741,7 @@ if test "${lt_prog_compiler_pic_works+set}" = set; then
7696 7696
 else
7697 7697
   lt_prog_compiler_pic_works=no
7698 7698
   ac_outfile=conftest.$ac_objext
7699
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7699
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7700 7700
    lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
7701 7701
    # Insert the option either (1) after the last *FLAGS variable, or
7702 7702
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -7707,11 +7752,11 @@ else
7707 7707
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7708 7708
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7709 7709
    -e 's:$: $lt_compiler_flag:'`
7710
-   (eval echo "\"\$as_me:7710: $lt_compile\"" >&5)
7710
+   (eval echo "\"\$as_me:7755: $lt_compile\"" >&5)
7711 7711
    (eval "$lt_compile" 2>conftest.err)
7712 7712
    ac_status=$?
7713 7713
    cat conftest.err >&5
7714
-   echo "$as_me:7714: \$? = $ac_status" >&5
7714
+   echo "$as_me:7759: \$? = $ac_status" >&5
7715 7715
    if (exit $ac_status) && test -s "$ac_outfile"; then
7716 7716
      # The compiler can only warn and ignore the option if not recognized
7717 7717
      # So say no if there are warnings other than the usual output.
... ...
@@ -7760,7 +7805,7 @@ else
7760 7760
   lt_prog_compiler_static_works=no
7761 7761
    save_LDFLAGS="$LDFLAGS"
7762 7762
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
7763
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
7763
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
7764 7764
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
7765 7765
      # The linker can only warn and ignore the option if not recognized
7766 7766
      # So say no if there are warnings
... ...
@@ -7800,7 +7845,7 @@ else
7800 7800
    mkdir conftest
7801 7801
    cd conftest
7802 7802
    mkdir out
7803
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7803
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7804 7804
 
7805 7805
    lt_compiler_flag="-o out/conftest2.$ac_objext"
7806 7806
    # Insert the option either (1) after the last *FLAGS variable, or
... ...
@@ -7811,11 +7856,11 @@ else
7811 7811
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7812 7812
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7813 7813
    -e 's:$: $lt_compiler_flag:'`
7814
-   (eval echo "\"\$as_me:7814: $lt_compile\"" >&5)
7814
+   (eval echo "\"\$as_me:7859: $lt_compile\"" >&5)
7815 7815
    (eval "$lt_compile" 2>out/conftest.err)
7816 7816
    ac_status=$?
7817 7817
    cat out/conftest.err >&5
7818
-   echo "$as_me:7818: \$? = $ac_status" >&5
7818
+   echo "$as_me:7863: \$? = $ac_status" >&5
7819 7819
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
7820 7820
    then
7821 7821
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -8007,7 +8052,7 @@ EOF
8007 8007
       allow_undefined_flag=unsupported
8008 8008
       always_export_symbols=no
8009 8009
       enable_shared_with_static_runtimes=yes
8010
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
8010
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8011 8011
 
8012 8012
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
8013 8013
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
... ...
@@ -8025,7 +8070,7 @@ EOF
8025 8025
       fi
8026 8026
       ;;
8027 8027
 
8028
-    interix3*)
8028
+    interix[3-9]*)
8029 8029
       hardcode_direct=no
8030 8030
       hardcode_shlibpath_var=no
8031 8031
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
... ...
@@ -8040,7 +8085,7 @@ EOF
8040 8040
       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'
8041 8041
       ;;
8042 8042
 
8043
-    linux* | k*bsd*-gnu)
8043
+    gnu* | linux* | k*bsd*-gnu)
8044 8044
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
8045 8045
 	tmp_addflag=
8046 8046
 	case $cc_basename,$host_cpu in
... ...
@@ -8058,13 +8103,22 @@ EOF
8058 8058
 	ifc* | ifort*)			# Intel Fortran compiler
8059 8059
 	  tmp_addflag=' -nofor_main' ;;
8060 8060
 	esac
8061
-	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8061
+	case `$CC -V 2>&1 | sed 5q` in
8062
+	*Sun\ C*)			# Sun C 5.9
8063
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
8064
+	  tmp_sharedflag='-G' ;;
8065
+	*Sun\ F*)			# Sun Fortran 8.3
8066
+	  tmp_sharedflag='-G' ;;
8067
+	*)
8068
+	  tmp_sharedflag='-shared' ;;
8069
+	esac
8070
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8062 8071
 
8063 8072
 	if test $supports_anon_versioning = yes; then
8064 8073
 	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
8065 8074
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8066 8075
   $echo "local: *; };" >> $output_objdir/$libname.ver~
8067
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8076
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8068 8077
 	fi
8069 8078
 	link_all_deplibs=no
8070 8079
       else
... ...
@@ -8224,7 +8278,7 @@ _LT_EOF
8224 8224
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
8225 8225
 	  then
8226 8226
   	  # We have reworked collect2
8227
-  	  hardcode_direct=yes
8227
+  	  :
8228 8228
 	  else
8229 8229
   	  # We have old collect2
8230 8230
   	  hardcode_direct=unsupported
... ...
@@ -8298,11 +8352,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8298 8298
        } && test -s conftest$ac_exeext &&
8299 8299
        $as_test_x conftest$ac_exeext; then
8300 8300
 
8301
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
8302
-}'`
8301
+lt_aix_libpath_sed='
8302
+    /Import File Strings/,/^$/ {
8303
+	/^0/ {
8304
+	    s/^0  *\(.*\)$/\1/
8305
+	    p
8306
+	}
8307
+    }'
8308
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8303 8309
 # Check for a 64-bit object if we didn't find anything.
8304
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
8305
-}'`; fi
8310
+if test -z "$aix_libpath"; then
8311
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8312
+fi
8306 8313
 else
8307 8314
   echo "$as_me: failed program was:" >&5
8308 8315
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -8357,11 +8418,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8357 8357
        } && test -s conftest$ac_exeext &&
8358 8358
        $as_test_x conftest$ac_exeext; then
8359 8359
 
8360
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
8361
-}'`
8360
+lt_aix_libpath_sed='
8361
+    /Import File Strings/,/^$/ {
8362
+	/^0/ {
8363
+	    s/^0  *\(.*\)$/\1/
8364
+	    p
8365
+	}
8366
+    }'
8367
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8362 8368
 # Check for a 64-bit object if we didn't find anything.
8363
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
8364
-}'`; fi
8369
+if test -z "$aix_libpath"; then
8370
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8371
+fi
8365 8372
 else
8366 8373
   echo "$as_me: failed program was:" >&5
8367 8374
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -8415,7 +8483,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8415 8415
       # The linker will automatically build a .lib file if we build a DLL.
8416 8416
       old_archive_From_new_cmds='true'
8417 8417
       # FIXME: Should let the user specify the lib program.
8418
-      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
8418
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8419 8419
       fix_srcfile_path='`cygpath -w "$srcfile"`'
8420 8420
       enable_shared_with_static_runtimes=yes
8421 8421
       ;;
... ...
@@ -8457,10 +8525,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8457 8457
       case $cc_basename in
8458 8458
         xlc*)
8459 8459
          output_verbose_link_cmd='echo'
8460
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
8460
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
8461 8461
          module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
8462 8462
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
8463
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8463
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8464 8464
           module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
8465 8465
           ;;
8466 8466
        *)
... ...
@@ -8622,24 +8690,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8622 8622
       ;;
8623 8623
 
8624 8624
     openbsd*)
8625
-      hardcode_direct=yes
8626
-      hardcode_shlibpath_var=no
8627
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8628
-	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8629
-	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8630
-	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8631
-	export_dynamic_flag_spec='${wl}-E'
8625
+      if test -f /usr/libexec/ld.so; then
8626
+	hardcode_direct=yes
8627
+	hardcode_shlibpath_var=no
8628
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8629
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8630
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8631
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8632
+	  export_dynamic_flag_spec='${wl}-E'
8633
+	else
8634
+	  case $host_os in
8635
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8636
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8637
+	     hardcode_libdir_flag_spec='-R$libdir'
8638
+	     ;;
8639
+	   *)
8640
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8641
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8642
+	     ;;
8643
+	  esac
8644
+        fi
8632 8645
       else
8633
-       case $host_os in
8634
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8635
-	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8636
-	   hardcode_libdir_flag_spec='-R$libdir'
8637
-	   ;;
8638
-	 *)
8639
-	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8640
-	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8641
-	   ;;
8642
-       esac
8646
+	ld_shlibs=no
8643 8647
       fi
8644 8648
       ;;
8645 8649
 
... ...
@@ -8698,17 +8770,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8698 8698
       case $host_os in
8699 8699
       solaris2.[0-5] | solaris2.[0-5].*) ;;
8700 8700
       *)
8701
- 	# The compiler driver will combine linker options so we
8702
- 	# cannot just pass the convience library names through
8703
- 	# without $wl, iff we do not link with $LD.
8704
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
8701
+	# The compiler driver will combine and reorder linker options,
8702
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
8703
+	# but is careful enough not to reorder.
8705 8704
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
8706
- 	case $wlarc in
8707
- 	'')
8708
- 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
8709
- 	*)
8710
- 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
8711
- 	esac ;;
8705
+	if test "$GCC" = yes; then
8706
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8707
+	else
8708
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
8709
+	fi
8710
+	;;
8712 8711
       esac
8713 8712
       link_all_deplibs=yes
8714 8713
       ;;
... ...
@@ -8765,7 +8836,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8765 8765
       fi
8766 8766
       ;;
8767 8767
 
8768
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
8768
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
8769 8769
       no_undefined_flag='${wl}-z,text'
8770 8770
       archive_cmds_need_lc=no
8771 8771
       hardcode_shlibpath_var=no
... ...
@@ -8842,7 +8913,7 @@ x|xyes)
8842 8842
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
8843 8843
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
8844 8844
       $rm conftest*
8845
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
8845
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8846 8846
 
8847 8847
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8848 8848
   (eval $ac_compile) 2>&5
... ...
@@ -8900,17 +8971,55 @@ shlibpath_overrides_runpath=unknown
8900 8900
 version_type=none
8901 8901
 dynamic_linker="$host_os ld.so"
8902 8902
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
8903
+
8903 8904
 if test "$GCC" = yes; then
8904
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
8905
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
8905
+  case $host_os in
8906
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
8907
+    *) lt_awk_arg="/^libraries:/" ;;
8908
+  esac
8909
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
8910
+  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
8906 8911
     # if the path contains ";" then we assume it to be the separator
8907 8912
     # otherwise default to the standard path separator (i.e. ":") - it is
8908 8913
     # assumed that no part of a normal pathname contains ";" but that should
8909 8914
     # okay in the real world where ";" in dirpaths is itself problematic.
8910
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
8915
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
8911 8916
   else
8912
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
8917
+    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
8913 8918
   fi
8919
+  # Ok, now we have the path, separated by spaces, we can step through it
8920
+  # and add multilib dir if necessary.
8921
+  lt_tmp_lt_search_path_spec=
8922
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
8923
+  for lt_sys_path in $lt_search_path_spec; do
8924
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
8925
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
8926
+    else
8927
+      test -d "$lt_sys_path" && \
8928
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
8929
+    fi
8930
+  done
8931
+  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
8932
+BEGIN {RS=" "; FS="/|\n";} {
8933
+  lt_foo="";
8934
+  lt_count=0;
8935
+  for (lt_i = NF; lt_i > 0; lt_i--) {
8936
+    if ($lt_i != "" && $lt_i != ".") {
8937
+      if ($lt_i == "..") {
8938
+        lt_count++;
8939
+      } else {
8940
+        if (lt_count == 0) {
8941
+          lt_foo="/" $lt_i lt_foo;
8942
+        } else {
8943
+          lt_count--;
8944
+        }
8945
+      }
8946
+    }
8947
+  }
8948
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
8949
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
8950
+}'`
8951
+  sys_lib_search_path_spec=`echo $lt_search_path_spec`
8914 8952
 else
8915 8953
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
8916 8954
 fi
... ...
@@ -9070,12 +9179,8 @@ darwin* | rhapsody*)
9070 9070
   shlibpath_overrides_runpath=yes
9071 9071
   shlibpath_var=DYLD_LIBRARY_PATH
9072 9072
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
9073
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
9074
-  if test "$GCC" = yes; then
9075
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
9076
-  else
9077
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
9078
-  fi
9073
+
9074
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
9079 9075
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
9080 9076
   ;;
9081 9077
 
... ...
@@ -9129,7 +9234,7 @@ freebsd* | dragonfly*)
9129 9129
     shlibpath_overrides_runpath=no
9130 9130
     hardcode_into_libs=yes
9131 9131
     ;;
9132
-  freebsd*) # from 4.6 on
9132
+  *) # from 4.6 on, and DragonFly
9133 9133
     shlibpath_overrides_runpath=yes
9134 9134
     hardcode_into_libs=yes
9135 9135
     ;;
... ...
@@ -9192,7 +9297,7 @@ hpux9* | hpux10* | hpux11*)
9192 9192
   postinstall_cmds='chmod 555 $lib'
9193 9193
   ;;
9194 9194
 
9195
-interix3*)
9195
+interix[3-9]*)
9196 9196
   version_type=linux
9197 9197
   need_lib_prefix=no
9198 9198
   need_version=no
... ...
@@ -9263,7 +9368,7 @@ linux* | k*bsd*-gnu)
9263 9263
 
9264 9264
   # Append ld.so.conf contents to the search path
9265 9265
   if test -f /etc/ld.so.conf; then
9266
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9266
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9267 9267
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
9268 9268
   fi
9269 9269
 
... ...
@@ -9369,6 +9474,10 @@ osf3* | osf4* | osf5*)
9369 9369
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9370 9370
   ;;
9371 9371
 
9372
+rdos*)
9373
+  dynamic_linker=no
9374
+  ;;
9375
+
9372 9376
 solaris*)
9373 9377
   version_type=linux
9374 9378
   need_lib_prefix=no
... ...
@@ -9522,6 +9631,7 @@ else
9522 9522
    darwin*)
9523 9523
        if test -n "$STRIP" ; then
9524 9524
          striplib="$STRIP -x"
9525
+         old_striplib="$STRIP -S"
9525 9526
          { echo "$as_me:$LINENO: result: yes" >&5
9526 9527
 echo "${ECHO_T}yes" >&6; }
9527 9528
        else
... ...
@@ -10108,7 +10218,7 @@ else
10108 10108
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10109 10109
   lt_status=$lt_dlunknown
10110 10110
   cat > conftest.$ac_ext <<EOF
10111
-#line 10111 "configure"
10111
+#line 10221 "configure"
10112 10112
 #include "confdefs.h"
10113 10113
 
10114 10114
 #if HAVE_DLFCN_H
... ...
@@ -10208,7 +10318,7 @@ else
10208 10208
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10209 10209
   lt_status=$lt_dlunknown
10210 10210
   cat > conftest.$ac_ext <<EOF
10211
-#line 10211 "configure"
10211
+#line 10321 "configure"
10212 10212
 #include "confdefs.h"
10213 10213
 
10214 10214
 #if HAVE_DLFCN_H
... ...
@@ -10406,6 +10516,7 @@ if test -f "$ltmain"; then
10406 10406
     module_cmds \
10407 10407
     module_expsym_cmds \
10408 10408
     lt_cv_prog_compiler_c_o \
10409
+    fix_srcfile_path \
10409 10410
     exclude_expsyms \
10410 10411
     include_expsyms; do
10411 10412
 
... ...
@@ -10450,7 +10561,7 @@ echo "$as_me: creating $ofile" >&6;}
10450 10450
 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
10451 10451
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
10452 10452
 #
10453
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
10453
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
10454 10454
 # Free Software Foundation, Inc.
10455 10455
 #
10456 10456
 # This file is part of GNU Libtool:
... ...
@@ -10774,7 +10885,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
10774 10774
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
10775 10775
 
10776 10776
 # Fix the shell variable \$srcfile for the compiler.
10777
-fix_srcfile_path="$fix_srcfile_path"
10777
+fix_srcfile_path=$lt_fix_srcfile_path
10778 10778
 
10779 10779
 # Set to yes if exported symbols are required.
10780 10780
 always_export_symbols=$always_export_symbols
... ...
@@ -10943,10 +11054,10 @@ objext=o
10943 10943
 objext_CXX=$objext
10944 10944
 
10945 10945
 # Code to be used in simple compile tests
10946
-lt_simple_compile_test_code="int some_variable = 0;\n"
10946
+lt_simple_compile_test_code="int some_variable = 0;"
10947 10947
 
10948 10948
 # Code to be used in simple link tests
10949
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
10949
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
10950 10950
 
10951 10951
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
10952 10952
 
... ...
@@ -10962,13 +11073,13 @@ compiler=$CC
10962 10962
 
10963 10963
 # save warnings/boilerplate of simple test code
10964 10964
 ac_outfile=conftest.$ac_objext
10965
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
10965
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
10966 10966
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
10967 10967
 _lt_compiler_boilerplate=`cat conftest.err`
10968 10968
 $rm conftest*
10969 10969
 
10970 10970
 ac_outfile=conftest.$ac_objext
10971
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
10971
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
10972 10972
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
10973 10973
 _lt_linker_boilerplate=`cat conftest.err`
10974 10974
 $rm conftest*
... ...
@@ -11227,7 +11338,7 @@ case $host_os in
11227 11227
 	   strings "$collect2name" | grep resolve_lib_name >/dev/null
11228 11228
 	then
11229 11229
 	  # We have reworked collect2
11230
-	  hardcode_direct_CXX=yes
11230
+	  :
11231 11231
 	else
11232 11232
 	  # We have old collect2
11233 11233
 	  hardcode_direct_CXX=unsupported
... ...
@@ -11301,11 +11412,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11301 11301
        } && test -s conftest$ac_exeext &&
11302 11302
        $as_test_x conftest$ac_exeext; then
11303 11303
 
11304
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
11305
-}'`
11304
+lt_aix_libpath_sed='
11305
+    /Import File Strings/,/^$/ {
11306
+	/^0/ {
11307
+	    s/^0  *\(.*\)$/\1/
11308
+	    p
11309
+	}
11310
+    }'
11311
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11306 11312
 # Check for a 64-bit object if we didn't find anything.
11307
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
11308
-}'`; fi
11313
+if test -z "$aix_libpath"; then
11314
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11315
+fi
11309 11316
 else
11310 11317
   echo "$as_me: failed program was:" >&5
11311 11318
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -11361,11 +11479,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11361 11361
        } && test -s conftest$ac_exeext &&
11362 11362
        $as_test_x conftest$ac_exeext; then
11363 11363
 
11364
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
11365
-}'`
11364
+lt_aix_libpath_sed='
11365
+    /Import File Strings/,/^$/ {
11366
+	/^0/ {
11367
+	    s/^0  *\(.*\)$/\1/
11368
+	    p
11369
+	}
11370
+    }'
11371
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11366 11372
 # Check for a 64-bit object if we didn't find anything.
11367
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
11368
-}'`; fi
11373
+if test -z "$aix_libpath"; then
11374
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11375
+fi
11369 11376
 else
11370 11377
   echo "$as_me: failed program was:" >&5
11371 11378
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -11484,10 +11609,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11484 11484
       case $cc_basename in
11485 11485
         xlc*)
11486 11486
          output_verbose_link_cmd='echo'
11487
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
11487
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
11488 11488
           module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
11489 11489
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
11490
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11490
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11491 11491
           module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
11492 11492
           ;;
11493 11493
        *)
... ...
@@ -11570,9 +11695,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11570 11570
       hardcode_libdir_separator_CXX=:
11571 11571
 
11572 11572
       case $host_cpu in
11573
-      hppa*64*|ia64*)
11574
-	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
11575
-        ;;
11573
+      hppa*64*|ia64*) ;;
11576 11574
       *)
11577 11575
 	export_dynamic_flag_spec_CXX='${wl}-E'
11578 11576
         ;;
... ...
@@ -11640,7 +11763,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11640 11640
 	;;
11641 11641
     esac
11642 11642
     ;;
11643
-  interix3*)
11643
+  interix[3-9]*)
11644 11644
     hardcode_direct_CXX=no
11645 11645
     hardcode_shlibpath_var_CXX=no
11646 11646
     hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
... ...
@@ -11760,6 +11883,29 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11760 11760
 	# dependencies.
11761 11761
 	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
11762 11762
 	;;
11763
+      *)
11764
+	case `$CC -V 2>&1 | sed 5q` in
11765
+	*Sun\ C*)
11766
+	  # Sun C++ 5.9
11767
+	  no_undefined_flag_CXX=' -zdefs'
11768
+	  archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
11769
+	  archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
11770
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
11771
+	  whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
11772
+
11773
+	  # Not sure whether something based on
11774
+	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
11775
+	  # would be better.
11776
+	  output_verbose_link_cmd='echo'
11777
+
11778
+	  # Archives containing C++ object files must be created using
11779
+	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
11780
+	  # necessary to make sure instantiated templates are included
11781
+	  # in the archive.
11782
+	  old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
11783
+	  ;;
11784
+	esac
11785
+	;;
11763 11786
     esac
11764 11787
     ;;
11765 11788
   lynxos*)
... ...
@@ -11798,16 +11944,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11798 11798
     ld_shlibs_CXX=no
11799 11799
     ;;
11800 11800
   openbsd*)
11801
-    hardcode_direct_CXX=yes
11802
-    hardcode_shlibpath_var_CXX=no
11803
-    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
11804
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
11805
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11806
-      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
11807
-      export_dynamic_flag_spec_CXX='${wl}-E'
11808
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11801
+    if test -f /usr/libexec/ld.so; then
11802
+      hardcode_direct_CXX=yes
11803
+      hardcode_shlibpath_var_CXX=no
11804
+      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
11805
+      hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
11806
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
11807
+	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
11808
+	export_dynamic_flag_spec_CXX='${wl}-E'
11809
+	whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
11810
+      fi
11811
+      output_verbose_link_cmd='echo'
11812
+    else
11813
+      ld_shlibs_CXX=no
11809 11814
     fi
11810
-    output_verbose_link_cmd='echo'
11811 11815
     ;;
11812 11816
   osf3*)
11813 11817
     case $cc_basename in
... ...
@@ -11969,15 +12119,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
11969 11969
 	case $host_os in
11970 11970
 	  solaris2.[0-5] | solaris2.[0-5].*) ;;
11971 11971
 	  *)
11972
-	    # The C++ compiler is used as linker so we must use $wl
11973
-	    # flag to pass the commands to the underlying system
11974
-	    # linker. We must also pass each convience library through
11975
-	    # to the system linker between allextract/defaultextract.
11976
-	    # The C++ compiler will combine linker options so we
11977
-	    # cannot just pass the convience library names through
11978
-	    # without $wl.
11972
+	    # The compiler driver will combine and reorder linker options,
11973
+	    # but understands `-z linker_flag'.
11979 11974
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
11980
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
11975
+	    whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
11981 11976
 	    ;;
11982 11977
 	esac
11983 11978
 	link_all_deplibs_CXX=yes
... ...
@@ -12024,6 +12169,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
12024 12024
 	  fi
12025 12025
 
12026 12026
 	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
12027
+	  case $host_os in
12028
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
12029
+	  *)
12030
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
12031
+	    ;;
12032
+	  esac
12027 12033
 	fi
12028 12034
 	;;
12029 12035
     esac
... ...
@@ -12215,7 +12366,7 @@ $rm -f confest.$objext
12215 12215
 
12216 12216
 # PORTME: override above test on systems where it is broken
12217 12217
 case $host_os in
12218
-interix3*)
12218
+interix[3-9]*)
12219 12219
   # Interix 3.5 installs completely hosed .la files for C++, so rather than
12220 12220
   # hack all around it, let's just trust "g++" to DTRT.
12221 12221
   predep_objects_CXX=
... ...
@@ -12223,13 +12374,46 @@ interix3*)
12223 12223
   postdeps_CXX=
12224 12224
   ;;
12225 12225
 
12226
+linux*)
12227
+  case `$CC -V 2>&1 | sed 5q` in
12228
+  *Sun\ C*)
12229
+    # Sun C++ 5.9
12230
+    #
12231
+    # The more standards-conforming stlport4 library is
12232
+    # incompatible with the Cstd library. Avoid specifying
12233
+    # it if it's in CXXFLAGS. Ignore libCrun as
12234
+    # -library=stlport4 depends on it.
12235
+    case " $CXX $CXXFLAGS " in
12236
+    *" -library=stlport4 "*)
12237
+      solaris_use_stlport4=yes
12238
+      ;;
12239
+    esac
12240
+    if test "$solaris_use_stlport4" != yes; then
12241
+      postdeps_CXX='-library=Cstd -library=Crun'
12242
+    fi
12243
+    ;;
12244
+  esac
12245
+  ;;
12246
+
12226 12247
 solaris*)
12227 12248
   case $cc_basename in
12228 12249
   CC*)
12250
+    # The more standards-conforming stlport4 library is
12251
+    # incompatible with the Cstd library. Avoid specifying
12252
+    # it if it's in CXXFLAGS. Ignore libCrun as
12253
+    # -library=stlport4 depends on it.
12254
+    case " $CXX $CXXFLAGS " in
12255
+    *" -library=stlport4 "*)
12256
+      solaris_use_stlport4=yes
12257
+      ;;
12258
+    esac
12259
+
12229 12260
     # Adding this requires a known-good setup of shared libraries for
12230 12261
     # Sun compiler versions before 5.6, else PIC objects from an old
12231 12262
     # archive will be linked into the output, leading to subtle bugs.
12232
-    postdeps_CXX='-lCstd -lCrun'
12263
+    if test "$solaris_use_stlport4" != yes; then
12264
+      postdeps_CXX='-library=Cstd -library=Crun'
12265
+    fi
12233 12266
     ;;
12234 12267
   esac
12235 12268
   ;;
... ...
@@ -12266,12 +12450,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
12266 12266
       # like `-m68040'.
12267 12267
       lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
12268 12268
       ;;
12269
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
12269
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
12270 12270
       # PIC is the default for these OSes.
12271 12271
       ;;
12272
-    mingw* | os2* | pw32*)
12272
+    mingw* | cygwin* | os2* | pw32*)
12273 12273
       # This hack is so that the source file can tell whether it is being
12274 12274
       # built for inclusion in a dll (and should export symbols for example).
12275
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
12276
+      # (--disable-auto-import) libraries
12275 12277
       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
12276 12278
       ;;
12277 12279
     darwin* | rhapsody*)
... ...
@@ -12283,7 +12469,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
12283 12283
       # DJGPP does not support shared libraries at all
12284 12284
       lt_prog_compiler_pic_CXX=
12285 12285
       ;;
12286
-    interix3*)
12286
+    interix[3-9]*)
12287 12287
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
12288 12288
       # Instead, we relocate shared libraries at runtime.
12289 12289
       ;;
... ...
@@ -12419,6 +12605,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
12419 12419
 	    lt_prog_compiler_static_CXX='-non_shared'
12420 12420
 	    ;;
12421 12421
 	  *)
12422
+	    case `$CC -V 2>&1 | sed 5q` in
12423
+	    *Sun\ C*)
12424
+	      # Sun C++ 5.9
12425
+	      lt_prog_compiler_pic_CXX='-KPIC'
12426
+	      lt_prog_compiler_static_CXX='-Bstatic'
12427
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
12428
+	      ;;
12429
+	    esac
12422 12430
 	    ;;
12423 12431
 	esac
12424 12432
 	;;
... ...
@@ -12533,7 +12727,7 @@ if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
12533 12533
 else
12534 12534
   lt_prog_compiler_pic_works_CXX=no
12535 12535
   ac_outfile=conftest.$ac_objext
12536
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
12536
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
12537 12537
    lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
12538 12538
    # Insert the option either (1) after the last *FLAGS variable, or
12539 12539
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -12544,11 +12738,11 @@ else
12544 12544
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
12545 12545
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
12546 12546
    -e 's:$: $lt_compiler_flag:'`
12547
-   (eval echo "\"\$as_me:12547: $lt_compile\"" >&5)
12547
+   (eval echo "\"\$as_me:12741: $lt_compile\"" >&5)
12548 12548
    (eval "$lt_compile" 2>conftest.err)
12549 12549
    ac_status=$?
12550 12550
    cat conftest.err >&5
12551
-   echo "$as_me:12551: \$? = $ac_status" >&5
12551
+   echo "$as_me:12745: \$? = $ac_status" >&5
12552 12552
    if (exit $ac_status) && test -s "$ac_outfile"; then
12553 12553
      # The compiler can only warn and ignore the option if not recognized
12554 12554
      # So say no if there are warnings other than the usual output.
... ...
@@ -12597,7 +12791,7 @@ else
12597 12597
   lt_prog_compiler_static_works_CXX=no
12598 12598
    save_LDFLAGS="$LDFLAGS"
12599 12599
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
12600
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
12600
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
12601 12601
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
12602 12602
      # The linker can only warn and ignore the option if not recognized
12603 12603
      # So say no if there are warnings
... ...
@@ -12637,7 +12831,7 @@ else
12637 12637
    mkdir conftest
12638 12638
    cd conftest
12639 12639
    mkdir out
12640
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
12640
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
12641 12641
 
12642 12642
    lt_compiler_flag="-o out/conftest2.$ac_objext"
12643 12643
    # Insert the option either (1) after the last *FLAGS variable, or
... ...
@@ -12648,11 +12842,11 @@ else
12648 12648
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
12649 12649
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
12650 12650
    -e 's:$: $lt_compiler_flag:'`
12651
-   (eval echo "\"\$as_me:12651: $lt_compile\"" >&5)
12651
+   (eval echo "\"\$as_me:12845: $lt_compile\"" >&5)
12652 12652
    (eval "$lt_compile" 2>out/conftest.err)
12653 12653
    ac_status=$?
12654 12654
    cat out/conftest.err >&5
12655
-   echo "$as_me:12655: \$? = $ac_status" >&5
12655
+   echo "$as_me:12849: \$? = $ac_status" >&5
12656 12656
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
12657 12657
    then
12658 12658
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -12718,7 +12912,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
12718 12718
     export_symbols_cmds_CXX="$ltdll_cmds"
12719 12719
   ;;
12720 12720
   cygwin* | mingw*)
12721
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
12721
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
12722 12722
   ;;
12723 12723
   linux* | k*bsd*-gnu)
12724 12724
     link_all_deplibs_CXX=no
... ...
@@ -12752,7 +12946,7 @@ x|xyes)
12752 12752
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
12753 12753
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
12754 12754
       $rm conftest*
12755
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
12755
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
12756 12756
 
12757 12757
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12758 12758
   (eval $ac_compile) 2>&5
... ...
@@ -12810,20 +13004,7 @@ shlibpath_overrides_runpath=unknown
12810 12810
 version_type=none
12811 12811
 dynamic_linker="$host_os ld.so"
12812 12812
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
12813
-if test "$GCC" = yes; then
12814
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
12815
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
12816
-    # if the path contains ";" then we assume it to be the separator
12817
-    # otherwise default to the standard path separator (i.e. ":") - it is
12818
-    # assumed that no part of a normal pathname contains ";" but that should
12819
-    # okay in the real world where ";" in dirpaths is itself problematic.
12820
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
12821
-  else
12822
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
12823
-  fi
12824
-else
12825
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
12826
-fi
12813
+
12827 12814
 need_lib_prefix=unknown
12828 12815
 hardcode_into_libs=no
12829 12816
 
... ...
@@ -12980,12 +13161,7 @@ darwin* | rhapsody*)
12980 12980
   shlibpath_overrides_runpath=yes
12981 12981
   shlibpath_var=DYLD_LIBRARY_PATH
12982 12982
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
12983
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
12984
-  if test "$GCC" = yes; then
12985
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
12986
-  else
12987
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
12988
-  fi
12983
+
12989 12984
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
12990 12985
   ;;
12991 12986
 
... ...
@@ -13039,7 +13215,7 @@ freebsd* | dragonfly*)
13039 13039
     shlibpath_overrides_runpath=no
13040 13040
     hardcode_into_libs=yes
13041 13041
     ;;
13042
-  freebsd*) # from 4.6 on
13042
+  *) # from 4.6 on, and DragonFly
13043 13043
     shlibpath_overrides_runpath=yes
13044 13044
     hardcode_into_libs=yes
13045 13045
     ;;
... ...
@@ -13102,7 +13278,7 @@ hpux9* | hpux10* | hpux11*)
13102 13102
   postinstall_cmds='chmod 555 $lib'
13103 13103
   ;;
13104 13104
 
13105
-interix3*)
13105
+interix[3-9]*)
13106 13106
   version_type=linux
13107 13107
   need_lib_prefix=no
13108 13108
   need_version=no
... ...
@@ -13173,7 +13349,7 @@ linux* | k*bsd*-gnu)
13173 13173
 
13174 13174
   # Append ld.so.conf contents to the search path
13175 13175
   if test -f /etc/ld.so.conf; then
13176
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
13176
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
13177 13177
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
13178 13178
   fi
13179 13179
 
... ...
@@ -13279,6 +13455,10 @@ osf3* | osf4* | osf5*)
13279 13279
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
13280 13280
   ;;
13281 13281
 
13282
+rdos*)
13283
+  dynamic_linker=no
13284
+  ;;
13285
+
13282 13286
 solaris*)
13283 13287
   version_type=linux
13284 13288
   need_lib_prefix=no
... ...
@@ -13473,6 +13653,7 @@ if test -f "$ltmain"; then
13473 13473
     module_cmds_CXX \
13474 13474
     module_expsym_cmds_CXX \
13475 13475
     lt_cv_prog_compiler_c_o_CXX \
13476
+    fix_srcfile_path_CXX \
13476 13477
     exclude_expsyms_CXX \
13477 13478
     include_expsyms_CXX; do
13478 13479
 
... ...
@@ -13793,7 +13974,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
13793 13793
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
13794 13794
 
13795 13795
 # Fix the shell variable \$srcfile for the compiler.
13796
-fix_srcfile_path="$fix_srcfile_path_CXX"
13796
+fix_srcfile_path=$lt_fix_srcfile_path
13797 13797
 
13798 13798
 # Set to yes if exported symbols are required.
13799 13799
 always_export_symbols=$always_export_symbols_CXX
... ...
@@ -13884,10 +14065,17 @@ objext=o
13884 13884
 objext_F77=$objext
13885 13885
 
13886 13886
 # Code to be used in simple compile tests
13887
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
13887
+lt_simple_compile_test_code="\
13888
+      subroutine t
13889
+      return
13890
+      end
13891
+"
13888 13892
 
13889 13893
 # Code to be used in simple link tests
13890
-lt_simple_link_test_code="      program t\n      end\n"
13894
+lt_simple_link_test_code="\
13895
+      program t
13896
+      end
13897
+"
13891 13898
 
13892 13899
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
13893 13900
 
... ...
@@ -13903,13 +14091,13 @@ compiler=$CC
13903 13903
 
13904 13904
 # save warnings/boilerplate of simple test code
13905 13905
 ac_outfile=conftest.$ac_objext
13906
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
13906
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
13907 13907
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
13908 13908
 _lt_compiler_boilerplate=`cat conftest.err`
13909 13909
 $rm conftest*
13910 13910
 
13911 13911
 ac_outfile=conftest.$ac_objext
13912
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
13912
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
13913 13913
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
13914 13914
 _lt_linker_boilerplate=`cat conftest.err`
13915 13915
 $rm conftest*
... ...
@@ -13996,13 +14184,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
13996 13996
       lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
13997 13997
       ;;
13998 13998
 
13999
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
13999
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
14000 14000
       # PIC is the default for these OSes.
14001 14001
       ;;
14002 14002
 
14003
-    mingw* | pw32* | os2*)
14003
+    mingw* | cygwin* | pw32* | os2*)
14004 14004
       # This hack is so that the source file can tell whether it is being
14005 14005
       # built for inclusion in a dll (and should export symbols for example).
14006
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
14007
+      # (--disable-auto-import) libraries
14006 14008
       lt_prog_compiler_pic_F77='-DDLL_EXPORT'
14007 14009
       ;;
14008 14010
 
... ...
@@ -14012,7 +14202,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
14012 14012
       lt_prog_compiler_pic_F77='-fno-common'
14013 14013
       ;;
14014 14014
 
14015
-    interix3*)
14015
+    interix[3-9]*)
14016 14016
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
14017 14017
       # Instead, we relocate shared libraries at runtime.
14018 14018
       ;;
... ...
@@ -14070,7 +14260,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
14070 14070
        esac
14071 14071
        ;;
14072 14072
 
14073
-    mingw* | pw32* | os2*)
14073
+    mingw* | cygwin* | pw32* | os2*)
14074 14074
       # This hack is so that the source file can tell whether it is being
14075 14075
       # built for inclusion in a dll (and should export symbols for example).
14076 14076
       lt_prog_compiler_pic_F77='-DDLL_EXPORT'
... ...
@@ -14122,6 +14312,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
14122 14122
         # All Alpha code is PIC.
14123 14123
         lt_prog_compiler_static_F77='-non_shared'
14124 14124
         ;;
14125
+      *)
14126
+        case `$CC -V 2>&1 | sed 5q` in
14127
+	*Sun\ C*)
14128
+	  # Sun C 5.9
14129
+	  lt_prog_compiler_pic_F77='-KPIC'
14130
+	  lt_prog_compiler_static_F77='-Bstatic'
14131
+	  lt_prog_compiler_wl_F77='-Wl,'
14132
+	  ;;
14133
+	*Sun\ F*)
14134
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
14135
+	  lt_prog_compiler_pic_F77='-KPIC'
14136
+	  lt_prog_compiler_static_F77='-Bstatic'
14137
+	  lt_prog_compiler_wl_F77=''
14138
+	  ;;
14139
+	esac
14140
+	;;
14125 14141
       esac
14126 14142
       ;;
14127 14143
 
... ...
@@ -14131,6 +14337,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
14131 14131
       lt_prog_compiler_static_F77='-non_shared'
14132 14132
       ;;
14133 14133
 
14134
+    rdos*)
14135
+      lt_prog_compiler_static_F77='-non_shared'
14136
+      ;;
14137
+
14134 14138
     solaris*)
14135 14139
       lt_prog_compiler_pic_F77='-KPIC'
14136 14140
       lt_prog_compiler_static_F77='-Bstatic'
... ...
@@ -14198,7 +14408,7 @@ if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
14198 14198
 else
14199 14199
   lt_prog_compiler_pic_works_F77=no
14200 14200
   ac_outfile=conftest.$ac_objext
14201
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
14201
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14202 14202
    lt_compiler_flag="$lt_prog_compiler_pic_F77"
14203 14203
    # Insert the option either (1) after the last *FLAGS variable, or
14204 14204
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -14209,11 +14419,11 @@ else
14209 14209
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14210 14210
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14211 14211
    -e 's:$: $lt_compiler_flag:'`
14212
-   (eval echo "\"\$as_me:14212: $lt_compile\"" >&5)
14212
+   (eval echo "\"\$as_me:14422: $lt_compile\"" >&5)
14213 14213
    (eval "$lt_compile" 2>conftest.err)
14214 14214
    ac_status=$?
14215 14215
    cat conftest.err >&5
14216
-   echo "$as_me:14216: \$? = $ac_status" >&5
14216
+   echo "$as_me:14426: \$? = $ac_status" >&5
14217 14217
    if (exit $ac_status) && test -s "$ac_outfile"; then
14218 14218
      # The compiler can only warn and ignore the option if not recognized
14219 14219
      # So say no if there are warnings other than the usual output.
... ...
@@ -14262,7 +14472,7 @@ else
14262 14262
   lt_prog_compiler_static_works_F77=no
14263 14263
    save_LDFLAGS="$LDFLAGS"
14264 14264
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
14265
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
14265
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
14266 14266
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
14267 14267
      # The linker can only warn and ignore the option if not recognized
14268 14268
      # So say no if there are warnings
... ...
@@ -14302,7 +14512,7 @@ else
14302 14302
    mkdir conftest
14303 14303
    cd conftest
14304 14304
    mkdir out
14305
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
14305
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14306 14306
 
14307 14307
    lt_compiler_flag="-o out/conftest2.$ac_objext"
14308 14308
    # Insert the option either (1) after the last *FLAGS variable, or
... ...
@@ -14313,11 +14523,11 @@ else
14313 14313
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14314 14314
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14315 14315
    -e 's:$: $lt_compiler_flag:'`
14316
-   (eval echo "\"\$as_me:14316: $lt_compile\"" >&5)
14316
+   (eval echo "\"\$as_me:14526: $lt_compile\"" >&5)
14317 14317
    (eval "$lt_compile" 2>out/conftest.err)
14318 14318
    ac_status=$?
14319 14319
    cat out/conftest.err >&5
14320
-   echo "$as_me:14320: \$? = $ac_status" >&5
14320
+   echo "$as_me:14530: \$? = $ac_status" >&5
14321 14321
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
14322 14322
    then
14323 14323
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -14509,7 +14719,7 @@ EOF
14509 14509
       allow_undefined_flag_F77=unsupported
14510 14510
       always_export_symbols_F77=no
14511 14511
       enable_shared_with_static_runtimes_F77=yes
14512
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
14512
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
14513 14513
 
14514 14514
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
14515 14515
         archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
... ...
@@ -14527,7 +14737,7 @@ EOF
14527 14527
       fi
14528 14528
       ;;
14529 14529
 
14530
-    interix3*)
14530
+    interix[3-9]*)
14531 14531
       hardcode_direct_F77=no
14532 14532
       hardcode_shlibpath_var_F77=no
14533 14533
       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
... ...
@@ -14542,7 +14752,7 @@ EOF
14542 14542
       archive_expsym_cmds_F77='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'
14543 14543
       ;;
14544 14544
 
14545
-    linux* | k*bsd*-gnu)
14545
+    gnu* | linux* | k*bsd*-gnu)
14546 14546
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
14547 14547
 	tmp_addflag=
14548 14548
 	case $cc_basename,$host_cpu in
... ...
@@ -14560,13 +14770,22 @@ EOF
14560 14560
 	ifc* | ifort*)			# Intel Fortran compiler
14561 14561
 	  tmp_addflag=' -nofor_main' ;;
14562 14562
 	esac
14563
-	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
14563
+	case `$CC -V 2>&1 | sed 5q` in
14564
+	*Sun\ C*)			# Sun C 5.9
14565
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
14566
+	  tmp_sharedflag='-G' ;;
14567
+	*Sun\ F*)			# Sun Fortran 8.3
14568
+	  tmp_sharedflag='-G' ;;
14569
+	*)
14570
+	  tmp_sharedflag='-shared' ;;
14571
+	esac
14572
+	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
14564 14573
 
14565 14574
 	if test $supports_anon_versioning = yes; then
14566 14575
 	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
14567 14576
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
14568 14577
   $echo "local: *; };" >> $output_objdir/$libname.ver~
14569
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
14578
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
14570 14579
 	fi
14571 14580
 	link_all_deplibs_F77=no
14572 14581
       else
... ...
@@ -14726,7 +14945,7 @@ _LT_EOF
14726 14726
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
14727 14727
 	  then
14728 14728
   	  # We have reworked collect2
14729
-  	  hardcode_direct_F77=yes
14729
+  	  :
14730 14730
 	  else
14731 14731
   	  # We have old collect2
14732 14732
   	  hardcode_direct_F77=unsupported
... ...
@@ -14790,11 +15009,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14790 14790
        } && test -s conftest$ac_exeext &&
14791 14791
        $as_test_x conftest$ac_exeext; then
14792 14792
 
14793
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
14794
-}'`
14793
+lt_aix_libpath_sed='
14794
+    /Import File Strings/,/^$/ {
14795
+	/^0/ {
14796
+	    s/^0  *\(.*\)$/\1/
14797
+	    p
14798
+	}
14799
+    }'
14800
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
14795 14801
 # Check for a 64-bit object if we didn't find anything.
14796
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
14797
-}'`; fi
14802
+if test -z "$aix_libpath"; then
14803
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
14804
+fi
14798 14805
 else
14799 14806
   echo "$as_me: failed program was:" >&5
14800 14807
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -14839,11 +15065,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14839 14839
        } && test -s conftest$ac_exeext &&
14840 14840
        $as_test_x conftest$ac_exeext; then
14841 14841
 
14842
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
14843
-}'`
14842
+lt_aix_libpath_sed='
14843
+    /Import File Strings/,/^$/ {
14844
+	/^0/ {
14845
+	    s/^0  *\(.*\)$/\1/
14846
+	    p
14847
+	}
14848
+    }'
14849
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
14844 14850
 # Check for a 64-bit object if we didn't find anything.
14845
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
14846
-}'`; fi
14851
+if test -z "$aix_libpath"; then
14852
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
14853
+fi
14847 14854
 else
14848 14855
   echo "$as_me: failed program was:" >&5
14849 14856
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -14897,7 +15130,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
14897 14897
       # The linker will automatically build a .lib file if we build a DLL.
14898 14898
       old_archive_From_new_cmds_F77='true'
14899 14899
       # FIXME: Should let the user specify the lib program.
14900
-      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
14900
+      old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
14901 14901
       fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
14902 14902
       enable_shared_with_static_runtimes_F77=yes
14903 14903
       ;;
... ...
@@ -14939,10 +15172,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
14939 14939
       case $cc_basename in
14940 14940
         xlc*)
14941 14941
          output_verbose_link_cmd='echo'
14942
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
14942
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
14943 14943
          module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
14944 14944
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
14945
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
14945
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
14946 14946
           module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
14947 14947
           ;;
14948 14948
        *)
... ...
@@ -15104,24 +15337,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
15104 15104
       ;;
15105 15105
 
15106 15106
     openbsd*)
15107
-      hardcode_direct_F77=yes
15108
-      hardcode_shlibpath_var_F77=no
15109
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
15110
-	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
15111
-	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
15112
-	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
15113
-	export_dynamic_flag_spec_F77='${wl}-E'
15107
+      if test -f /usr/libexec/ld.so; then
15108
+	hardcode_direct_F77=yes
15109
+	hardcode_shlibpath_var_F77=no
15110
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
15111
+	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
15112
+	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
15113
+	  hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
15114
+	  export_dynamic_flag_spec_F77='${wl}-E'
15115
+	else
15116
+	  case $host_os in
15117
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
15118
+	     archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
15119
+	     hardcode_libdir_flag_spec_F77='-R$libdir'
15120
+	     ;;
15121
+	   *)
15122
+	     archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
15123
+	     hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
15124
+	     ;;
15125
+	  esac
15126
+        fi
15114 15127
       else
15115
-       case $host_os in
15116
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
15117
-	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
15118
-	   hardcode_libdir_flag_spec_F77='-R$libdir'
15119
-	   ;;
15120
-	 *)
15121
-	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
15122
-	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
15123
-	   ;;
15124
-       esac
15128
+	ld_shlibs_F77=no
15125 15129
       fi
15126 15130
       ;;
15127 15131
 
... ...
@@ -15180,17 +15417,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
15180 15180
       case $host_os in
15181 15181
       solaris2.[0-5] | solaris2.[0-5].*) ;;
15182 15182
       *)
15183
- 	# The compiler driver will combine linker options so we
15184
- 	# cannot just pass the convience library names through
15185
- 	# without $wl, iff we do not link with $LD.
15186
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
15183
+	# The compiler driver will combine and reorder linker options,
15184
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
15185
+	# but is careful enough not to reorder.
15187 15186
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
15188
- 	case $wlarc in
15189
- 	'')
15190
- 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
15191
- 	*)
15192
- 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
15193
- 	esac ;;
15187
+	if test "$GCC" = yes; then
15188
+	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
15189
+	else
15190
+	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
15191
+	fi
15192
+	;;
15194 15193
       esac
15195 15194
       link_all_deplibs_F77=yes
15196 15195
       ;;
... ...
@@ -15247,7 +15483,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
15247 15247
       fi
15248 15248
       ;;
15249 15249
 
15250
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
15250
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
15251 15251
       no_undefined_flag_F77='${wl}-z,text'
15252 15252
       archive_cmds_need_lc_F77=no
15253 15253
       hardcode_shlibpath_var_F77=no
... ...
@@ -15324,7 +15560,7 @@ x|xyes)
15324 15324
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
15325 15325
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
15326 15326
       $rm conftest*
15327
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
15327
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15328 15328
 
15329 15329
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
15330 15330
   (eval $ac_compile) 2>&5
... ...
@@ -15382,20 +15618,7 @@ shlibpath_overrides_runpath=unknown
15382 15382
 version_type=none
15383 15383
 dynamic_linker="$host_os ld.so"
15384 15384
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
15385
-if test "$GCC" = yes; then
15386
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
15387
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
15388
-    # if the path contains ";" then we assume it to be the separator
15389
-    # otherwise default to the standard path separator (i.e. ":") - it is
15390
-    # assumed that no part of a normal pathname contains ";" but that should
15391
-    # okay in the real world where ";" in dirpaths is itself problematic.
15392
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
15393
-  else
15394
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
15395
-  fi
15396
-else
15397
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
15398
-fi
15385
+
15399 15386
 need_lib_prefix=unknown
15400 15387
 hardcode_into_libs=no
15401 15388
 
... ...
@@ -15552,12 +15775,7 @@ darwin* | rhapsody*)
15552 15552
   shlibpath_overrides_runpath=yes
15553 15553
   shlibpath_var=DYLD_LIBRARY_PATH
15554 15554
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
15555
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
15556
-  if test "$GCC" = yes; then
15557
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
15558
-  else
15559
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
15560
-  fi
15555
+
15561 15556
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
15562 15557
   ;;
15563 15558
 
... ...
@@ -15611,7 +15829,7 @@ freebsd* | dragonfly*)
15611 15611
     shlibpath_overrides_runpath=no
15612 15612
     hardcode_into_libs=yes
15613 15613
     ;;
15614
-  freebsd*) # from 4.6 on
15614
+  *) # from 4.6 on, and DragonFly
15615 15615
     shlibpath_overrides_runpath=yes
15616 15616
     hardcode_into_libs=yes
15617 15617
     ;;
... ...
@@ -15674,7 +15892,7 @@ hpux9* | hpux10* | hpux11*)
15674 15674
   postinstall_cmds='chmod 555 $lib'
15675 15675
   ;;
15676 15676
 
15677
-interix3*)
15677
+interix[3-9]*)
15678 15678
   version_type=linux
15679 15679
   need_lib_prefix=no
15680 15680
   need_version=no
... ...
@@ -15745,7 +15963,7 @@ linux* | k*bsd*-gnu)
15745 15745
 
15746 15746
   # Append ld.so.conf contents to the search path
15747 15747
   if test -f /etc/ld.so.conf; then
15748
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
15748
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
15749 15749
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
15750 15750
   fi
15751 15751
 
... ...
@@ -15851,6 +16069,10 @@ osf3* | osf4* | osf5*)
15851 15851
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
15852 15852
   ;;
15853 15853
 
15854
+rdos*)
15855
+  dynamic_linker=no
15856
+  ;;
15857
+
15854 15858
 solaris*)
15855 15859
   version_type=linux
15856 15860
   need_lib_prefix=no
... ...
@@ -16045,6 +16267,7 @@ if test -f "$ltmain"; then
16045 16045
     module_cmds_F77 \
16046 16046
     module_expsym_cmds_F77 \
16047 16047
     lt_cv_prog_compiler_c_o_F77 \
16048
+    fix_srcfile_path_F77 \
16048 16049
     exclude_expsyms_F77 \
16049 16050
     include_expsyms_F77; do
16050 16051
 
... ...
@@ -16365,7 +16588,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
16365 16365
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
16366 16366
 
16367 16367
 # Fix the shell variable \$srcfile for the compiler.
16368
-fix_srcfile_path="$fix_srcfile_path_F77"
16368
+fix_srcfile_path=$lt_fix_srcfile_path
16369 16369
 
16370 16370
 # Set to yes if exported symbols are required.
16371 16371
 always_export_symbols=$always_export_symbols_F77
... ...
@@ -16423,10 +16646,10 @@ objext=o
16423 16423
 objext_GCJ=$objext
16424 16424
 
16425 16425
 # Code to be used in simple compile tests
16426
-lt_simple_compile_test_code="class foo {}\n"
16426
+lt_simple_compile_test_code="class foo {}"
16427 16427
 
16428 16428
 # Code to be used in simple link tests
16429
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
16429
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
16430 16430
 
16431 16431
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
16432 16432
 
... ...
@@ -16442,13 +16665,13 @@ compiler=$CC
16442 16442
 
16443 16443
 # save warnings/boilerplate of simple test code
16444 16444
 ac_outfile=conftest.$ac_objext
16445
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
16445
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
16446 16446
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
16447 16447
 _lt_compiler_boilerplate=`cat conftest.err`
16448 16448
 $rm conftest*
16449 16449
 
16450 16450
 ac_outfile=conftest.$ac_objext
16451
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
16451
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
16452 16452
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
16453 16453
 _lt_linker_boilerplate=`cat conftest.err`
16454 16454
 $rm conftest*
... ...
@@ -16489,7 +16712,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
16489 16489
 else
16490 16490
   lt_cv_prog_compiler_rtti_exceptions=no
16491 16491
   ac_outfile=conftest.$ac_objext
16492
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
16492
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16493 16493
    lt_compiler_flag="-fno-rtti -fno-exceptions"
16494 16494
    # Insert the option either (1) after the last *FLAGS variable, or
16495 16495
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -16500,11 +16723,11 @@ else
16500 16500
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16501 16501
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16502 16502
    -e 's:$: $lt_compiler_flag:'`
16503
-   (eval echo "\"\$as_me:16503: $lt_compile\"" >&5)
16503
+   (eval echo "\"\$as_me:16726: $lt_compile\"" >&5)
16504 16504
    (eval "$lt_compile" 2>conftest.err)
16505 16505
    ac_status=$?
16506 16506
    cat conftest.err >&5
16507
-   echo "$as_me:16507: \$? = $ac_status" >&5
16507
+   echo "$as_me:16730: \$? = $ac_status" >&5
16508 16508
    if (exit $ac_status) && test -s "$ac_outfile"; then
16509 16509
      # The compiler can only warn and ignore the option if not recognized
16510 16510
      # So say no if there are warnings other than the usual output.
... ...
@@ -16555,13 +16778,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
16555 16555
       lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
16556 16556
       ;;
16557 16557
 
16558
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
16558
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
16559 16559
       # PIC is the default for these OSes.
16560 16560
       ;;
16561 16561
 
16562
-    mingw* | pw32* | os2*)
16562
+    mingw* | cygwin* | pw32* | os2*)
16563 16563
       # This hack is so that the source file can tell whether it is being
16564 16564
       # built for inclusion in a dll (and should export symbols for example).
16565
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
16566
+      # (--disable-auto-import) libraries
16565 16567
       lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
16566 16568
       ;;
16567 16569
 
... ...
@@ -16571,7 +16796,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
16571 16571
       lt_prog_compiler_pic_GCJ='-fno-common'
16572 16572
       ;;
16573 16573
 
16574
-    interix3*)
16574
+    interix[3-9]*)
16575 16575
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
16576 16576
       # Instead, we relocate shared libraries at runtime.
16577 16577
       ;;
... ...
@@ -16629,7 +16854,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
16629 16629
        esac
16630 16630
        ;;
16631 16631
 
16632
-    mingw* | pw32* | os2*)
16632
+    mingw* | cygwin* | pw32* | os2*)
16633 16633
       # This hack is so that the source file can tell whether it is being
16634 16634
       # built for inclusion in a dll (and should export symbols for example).
16635 16635
       lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
... ...
@@ -16681,6 +16906,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
16681 16681
         # All Alpha code is PIC.
16682 16682
         lt_prog_compiler_static_GCJ='-non_shared'
16683 16683
         ;;
16684
+      *)
16685
+        case `$CC -V 2>&1 | sed 5q` in
16686
+	*Sun\ C*)
16687
+	  # Sun C 5.9
16688
+	  lt_prog_compiler_pic_GCJ='-KPIC'
16689
+	  lt_prog_compiler_static_GCJ='-Bstatic'
16690
+	  lt_prog_compiler_wl_GCJ='-Wl,'
16691
+	  ;;
16692
+	*Sun\ F*)
16693
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
16694
+	  lt_prog_compiler_pic_GCJ='-KPIC'
16695
+	  lt_prog_compiler_static_GCJ='-Bstatic'
16696
+	  lt_prog_compiler_wl_GCJ=''
16697
+	  ;;
16698
+	esac
16699
+	;;
16684 16700
       esac
16685 16701
       ;;
16686 16702
 
... ...
@@ -16690,6 +16931,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
16690 16690
       lt_prog_compiler_static_GCJ='-non_shared'
16691 16691
       ;;
16692 16692
 
16693
+    rdos*)
16694
+      lt_prog_compiler_static_GCJ='-non_shared'
16695
+      ;;
16696
+
16693 16697
     solaris*)
16694 16698
       lt_prog_compiler_pic_GCJ='-KPIC'
16695 16699
       lt_prog_compiler_static_GCJ='-Bstatic'
... ...
@@ -16757,7 +17002,7 @@ if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
16757 16757
 else
16758 16758
   lt_prog_compiler_pic_works_GCJ=no
16759 16759
   ac_outfile=conftest.$ac_objext
16760
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
16760
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16761 16761
    lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
16762 16762
    # Insert the option either (1) after the last *FLAGS variable, or
16763 16763
    # (2) before a word containing "conftest.", or (3) at the end.
... ...
@@ -16768,11 +17013,11 @@ else
16768 16768
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16769 16769
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16770 16770
    -e 's:$: $lt_compiler_flag:'`
16771
-   (eval echo "\"\$as_me:16771: $lt_compile\"" >&5)
16771
+   (eval echo "\"\$as_me:17016: $lt_compile\"" >&5)
16772 16772
    (eval "$lt_compile" 2>conftest.err)
16773 16773
    ac_status=$?
16774 16774
    cat conftest.err >&5
16775
-   echo "$as_me:16775: \$? = $ac_status" >&5
16775
+   echo "$as_me:17020: \$? = $ac_status" >&5
16776 16776
    if (exit $ac_status) && test -s "$ac_outfile"; then
16777 16777
      # The compiler can only warn and ignore the option if not recognized
16778 16778
      # So say no if there are warnings other than the usual output.
... ...
@@ -16821,7 +17066,7 @@ else
16821 16821
   lt_prog_compiler_static_works_GCJ=no
16822 16822
    save_LDFLAGS="$LDFLAGS"
16823 16823
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
16824
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
16824
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
16825 16825
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16826 16826
      # The linker can only warn and ignore the option if not recognized
16827 16827
      # So say no if there are warnings
... ...
@@ -16861,7 +17106,7 @@ else
16861 16861
    mkdir conftest
16862 16862
    cd conftest
16863 16863
    mkdir out
16864
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
16864
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
16865 16865
 
16866 16866
    lt_compiler_flag="-o out/conftest2.$ac_objext"
16867 16867
    # Insert the option either (1) after the last *FLAGS variable, or
... ...
@@ -16872,11 +17117,11 @@ else
16872 16872
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16873 16873
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16874 16874
    -e 's:$: $lt_compiler_flag:'`
16875
-   (eval echo "\"\$as_me:16875: $lt_compile\"" >&5)
16875
+   (eval echo "\"\$as_me:17120: $lt_compile\"" >&5)
16876 16876
    (eval "$lt_compile" 2>out/conftest.err)
16877 16877
    ac_status=$?
16878 16878
    cat out/conftest.err >&5
16879
-   echo "$as_me:16879: \$? = $ac_status" >&5
16879
+   echo "$as_me:17124: \$? = $ac_status" >&5
16880 16880
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
16881 16881
    then
16882 16882
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -17068,7 +17313,7 @@ EOF
17068 17068
       allow_undefined_flag_GCJ=unsupported
17069 17069
       always_export_symbols_GCJ=no
17070 17070
       enable_shared_with_static_runtimes_GCJ=yes
17071
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
17071
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
17072 17072
 
17073 17073
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
17074 17074
         archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
... ...
@@ -17086,7 +17331,7 @@ EOF
17086 17086
       fi
17087 17087
       ;;
17088 17088
 
17089
-    interix3*)
17089
+    interix[3-9]*)
17090 17090
       hardcode_direct_GCJ=no
17091 17091
       hardcode_shlibpath_var_GCJ=no
17092 17092
       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
... ...
@@ -17101,7 +17346,7 @@ EOF
17101 17101
       archive_expsym_cmds_GCJ='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'
17102 17102
       ;;
17103 17103
 
17104
-    linux* | k*bsd*-gnu)
17104
+    gnu* | linux* | k*bsd*-gnu)
17105 17105
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
17106 17106
 	tmp_addflag=
17107 17107
 	case $cc_basename,$host_cpu in
... ...
@@ -17119,13 +17364,22 @@ EOF
17119 17119
 	ifc* | ifort*)			# Intel Fortran compiler
17120 17120
 	  tmp_addflag=' -nofor_main' ;;
17121 17121
 	esac
17122
-	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
17122
+	case `$CC -V 2>&1 | sed 5q` in
17123
+	*Sun\ C*)			# Sun C 5.9
17124
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
17125
+	  tmp_sharedflag='-G' ;;
17126
+	*Sun\ F*)			# Sun Fortran 8.3
17127
+	  tmp_sharedflag='-G' ;;
17128
+	*)
17129
+	  tmp_sharedflag='-shared' ;;
17130
+	esac
17131
+	archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
17123 17132
 
17124 17133
 	if test $supports_anon_versioning = yes; then
17125 17134
 	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
17126 17135
   cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
17127 17136
   $echo "local: *; };" >> $output_objdir/$libname.ver~
17128
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
17137
+	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
17129 17138
 	fi
17130 17139
 	link_all_deplibs_GCJ=no
17131 17140
       else
... ...
@@ -17285,7 +17539,7 @@ _LT_EOF
17285 17285
   	   strings "$collect2name" | grep resolve_lib_name >/dev/null
17286 17286
 	  then
17287 17287
   	  # We have reworked collect2
17288
-  	  hardcode_direct_GCJ=yes
17288
+  	  :
17289 17289
 	  else
17290 17290
   	  # We have old collect2
17291 17291
   	  hardcode_direct_GCJ=unsupported
... ...
@@ -17359,11 +17613,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17359 17359
        } && test -s conftest$ac_exeext &&
17360 17360
        $as_test_x conftest$ac_exeext; then
17361 17361
 
17362
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
17363
-}'`
17362
+lt_aix_libpath_sed='
17363
+    /Import File Strings/,/^$/ {
17364
+	/^0/ {
17365
+	    s/^0  *\(.*\)$/\1/
17366
+	    p
17367
+	}
17368
+    }'
17369
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
17364 17370
 # Check for a 64-bit object if we didn't find anything.
17365
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
17366
-}'`; fi
17371
+if test -z "$aix_libpath"; then
17372
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
17373
+fi
17367 17374
 else
17368 17375
   echo "$as_me: failed program was:" >&5
17369 17376
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -17418,11 +17679,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17418 17418
        } && test -s conftest$ac_exeext &&
17419 17419
        $as_test_x conftest$ac_exeext; then
17420 17420
 
17421
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
17422
-}'`
17421
+lt_aix_libpath_sed='
17422
+    /Import File Strings/,/^$/ {
17423
+	/^0/ {
17424
+	    s/^0  *\(.*\)$/\1/
17425
+	    p
17426
+	}
17427
+    }'
17428
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
17423 17429
 # Check for a 64-bit object if we didn't find anything.
17424
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
17425
-}'`; fi
17430
+if test -z "$aix_libpath"; then
17431
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
17432
+fi
17426 17433
 else
17427 17434
   echo "$as_me: failed program was:" >&5
17428 17435
 sed 's/^/| /' conftest.$ac_ext >&5
... ...
@@ -17476,7 +17744,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
17476 17476
       # The linker will automatically build a .lib file if we build a DLL.
17477 17477
       old_archive_From_new_cmds_GCJ='true'
17478 17478
       # FIXME: Should let the user specify the lib program.
17479
-      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
17479
+      old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
17480 17480
       fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
17481 17481
       enable_shared_with_static_runtimes_GCJ=yes
17482 17482
       ;;
... ...
@@ -17518,10 +17786,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
17518 17518
       case $cc_basename in
17519 17519
         xlc*)
17520 17520
          output_verbose_link_cmd='echo'
17521
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
17521
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
17522 17522
          module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
17523 17523
           # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
17524
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
17524
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
17525 17525
           module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
17526 17526
           ;;
17527 17527
        *)
... ...
@@ -17683,24 +17951,28 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
17683 17683
       ;;
17684 17684
 
17685 17685
     openbsd*)
17686
-      hardcode_direct_GCJ=yes
17687
-      hardcode_shlibpath_var_GCJ=no
17688
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
17689
-	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17690
-	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
17691
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
17692
-	export_dynamic_flag_spec_GCJ='${wl}-E'
17686
+      if test -f /usr/libexec/ld.so; then
17687
+	hardcode_direct_GCJ=yes
17688
+	hardcode_shlibpath_var_GCJ=no
17689
+	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
17690
+	  archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17691
+	  archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
17692
+	  hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
17693
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
17694
+	else
17695
+	  case $host_os in
17696
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
17697
+	     archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
17698
+	     hardcode_libdir_flag_spec_GCJ='-R$libdir'
17699
+	     ;;
17700
+	   *)
17701
+	     archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17702
+	     hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
17703
+	     ;;
17704
+	  esac
17705
+        fi
17693 17706
       else
17694
-       case $host_os in
17695
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
17696
-	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
17697
-	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
17698
-	   ;;
17699
-	 *)
17700
-	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
17701
-	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
17702
-	   ;;
17703
-       esac
17707
+	ld_shlibs_GCJ=no
17704 17708
       fi
17705 17709
       ;;
17706 17710
 
... ...
@@ -17759,17 +18031,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
17759 17759
       case $host_os in
17760 17760
       solaris2.[0-5] | solaris2.[0-5].*) ;;
17761 17761
       *)
17762
- 	# The compiler driver will combine linker options so we
17763
- 	# cannot just pass the convience library names through
17764
- 	# without $wl, iff we do not link with $LD.
17765
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
17762
+	# The compiler driver will combine and reorder linker options,
17763
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
17764
+	# but is careful enough not to reorder.
17766 17765
  	# Supported since Solaris 2.6 (maybe 2.5.1?)
17767
- 	case $wlarc in
17768
- 	'')
17769
- 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
17770
- 	*)
17771
- 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
17772
- 	esac ;;
17766
+	if test "$GCC" = yes; then
17767
+	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
17768
+	else
17769
+	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
17770
+	fi
17771
+	;;
17773 17772
       esac
17774 17773
       link_all_deplibs_GCJ=yes
17775 17774
       ;;
... ...
@@ -17826,7 +18097,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
17826 17826
       fi
17827 17827
       ;;
17828 17828
 
17829
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
17829
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
17830 17830
       no_undefined_flag_GCJ='${wl}-z,text'
17831 17831
       archive_cmds_need_lc_GCJ=no
17832 17832
       hardcode_shlibpath_var_GCJ=no
... ...
@@ -17903,7 +18174,7 @@ x|xyes)
17903 17903
       { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
17904 17904
 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
17905 17905
       $rm conftest*
17906
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
17906
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
17907 17907
 
17908 17908
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
17909 17909
   (eval $ac_compile) 2>&5
... ...
@@ -17961,20 +18232,7 @@ shlibpath_overrides_runpath=unknown
17961 17961
 version_type=none
17962 17962
 dynamic_linker="$host_os ld.so"
17963 17963
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
17964
-if test "$GCC" = yes; then
17965
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
17966
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
17967
-    # if the path contains ";" then we assume it to be the separator
17968
-    # otherwise default to the standard path separator (i.e. ":") - it is
17969
-    # assumed that no part of a normal pathname contains ";" but that should
17970
-    # okay in the real world where ";" in dirpaths is itself problematic.
17971
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
17972
-  else
17973
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
17974
-  fi
17975
-else
17976
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
17977
-fi
17964
+
17978 17965
 need_lib_prefix=unknown
17979 17966
 hardcode_into_libs=no
17980 17967
 
... ...
@@ -18131,12 +18389,7 @@ darwin* | rhapsody*)
18131 18131
   shlibpath_overrides_runpath=yes
18132 18132
   shlibpath_var=DYLD_LIBRARY_PATH
18133 18133
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
18134
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
18135
-  if test "$GCC" = yes; then
18136
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
18137
-  else
18138
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
18139
-  fi
18134
+
18140 18135
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
18141 18136
   ;;
18142 18137
 
... ...
@@ -18190,7 +18443,7 @@ freebsd* | dragonfly*)
18190 18190
     shlibpath_overrides_runpath=no
18191 18191
     hardcode_into_libs=yes
18192 18192
     ;;
18193
-  freebsd*) # from 4.6 on
18193
+  *) # from 4.6 on, and DragonFly
18194 18194
     shlibpath_overrides_runpath=yes
18195 18195
     hardcode_into_libs=yes
18196 18196
     ;;
... ...
@@ -18253,7 +18506,7 @@ hpux9* | hpux10* | hpux11*)
18253 18253
   postinstall_cmds='chmod 555 $lib'
18254 18254
   ;;
18255 18255
 
18256
-interix3*)
18256
+interix[3-9]*)
18257 18257
   version_type=linux
18258 18258
   need_lib_prefix=no
18259 18259
   need_version=no
... ...
@@ -18324,7 +18577,7 @@ linux* | k*bsd*-gnu)
18324 18324
 
18325 18325
   # Append ld.so.conf contents to the search path
18326 18326
   if test -f /etc/ld.so.conf; then
18327
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
18327
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
18328 18328
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
18329 18329
   fi
18330 18330
 
... ...
@@ -18430,6 +18683,10 @@ osf3* | osf4* | osf5*)
18430 18430
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
18431 18431
   ;;
18432 18432
 
18433
+rdos*)
18434
+  dynamic_linker=no
18435
+  ;;
18436
+
18433 18437
 solaris*)
18434 18438
   version_type=linux
18435 18439
   need_lib_prefix=no
... ...
@@ -18624,6 +18881,7 @@ if test -f "$ltmain"; then
18624 18624
     module_cmds_GCJ \
18625 18625
     module_expsym_cmds_GCJ \
18626 18626
     lt_cv_prog_compiler_c_o_GCJ \
18627
+    fix_srcfile_path_GCJ \
18627 18628
     exclude_expsyms_GCJ \
18628 18629
     include_expsyms_GCJ; do
18629 18630
 
... ...
@@ -18944,7 +19202,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
18944 18944
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
18945 18945
 
18946 18946
 # Fix the shell variable \$srcfile for the compiler.
18947
-fix_srcfile_path="$fix_srcfile_path_GCJ"
18947
+fix_srcfile_path=$lt_fix_srcfile_path
18948 18948
 
18949 18949
 # Set to yes if exported symbols are required.
18950 18950
 always_export_symbols=$always_export_symbols_GCJ
... ...
@@ -19001,7 +19259,7 @@ objext=o
19001 19001
 objext_RC=$objext
19002 19002
 
19003 19003
 # Code to be used in simple compile tests
19004
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
19004
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
19005 19005
 
19006 19006
 # Code to be used in simple link tests
19007 19007
 lt_simple_link_test_code="$lt_simple_compile_test_code"
... ...
@@ -19020,13 +19278,13 @@ compiler=$CC
19020 19020
 
19021 19021
 # save warnings/boilerplate of simple test code
19022 19022
 ac_outfile=conftest.$ac_objext
19023
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
19023
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
19024 19024
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19025 19025
 _lt_compiler_boilerplate=`cat conftest.err`
19026 19026
 $rm conftest*
19027 19027
 
19028 19028
 ac_outfile=conftest.$ac_objext
19029
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
19029
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
19030 19030
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19031 19031
 _lt_linker_boilerplate=`cat conftest.err`
19032 19032
 $rm conftest*
... ...
@@ -19104,6 +19362,7 @@ if test -f "$ltmain"; then
19104 19104
     module_cmds_RC \
19105 19105
     module_expsym_cmds_RC \
19106 19106
     lt_cv_prog_compiler_c_o_RC \
19107
+    fix_srcfile_path_RC \
19107 19108
     exclude_expsyms_RC \
19108 19109
     include_expsyms_RC; do
19109 19110
 
... ...
@@ -19424,7 +19683,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
19424 19424
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
19425 19425
 
19426 19426
 # Fix the shell variable \$srcfile for the compiler.
19427
-fix_srcfile_path="$fix_srcfile_path_RC"
19427
+fix_srcfile_path=$lt_fix_srcfile_path
19428 19428
 
19429 19429
 # Set to yes if exported symbols are required.
19430 19430
 always_export_symbols=$always_export_symbols_RC
... ...
@@ -21867,227 +22126,6 @@ fi
21867 21867
 
21868 21868
 fi
21869 21869
 
21870
-# Check whether --enable-ncore was given.
21871
-if test "${enable_ncore+set}" = set; then
21872
-  enableval=$enable_ncore; want_ncore=$enableval
21873
-else
21874
-  want_ncore="auto"
21875
-fi
21876
-
21877
-
21878
-if test "$want_ncore" = "auto"
21879
-then
21880
-    { echo "$as_me:$LINENO: checking for sn_sigscan_initdb in -lsn_sigscan" >&5
21881
-echo $ECHO_N "checking for sn_sigscan_initdb in -lsn_sigscan... $ECHO_C" >&6; }
21882
-if test "${ac_cv_lib_sn_sigscan_sn_sigscan_initdb+set}" = set; then
21883
-  echo $ECHO_N "(cached) $ECHO_C" >&6
21884
-else
21885
-  ac_check_lib_save_LIBS=$LIBS
21886
-LIBS="-lsn_sigscan  $LIBS"
21887
-cat >conftest.$ac_ext <<_ACEOF
21888
-/* confdefs.h.  */
21889
-_ACEOF
21890
-cat confdefs.h >>conftest.$ac_ext
21891
-cat >>conftest.$ac_ext <<_ACEOF
21892
-/* end confdefs.h.  */
21893
-
21894
-/* Override any GCC internal prototype to avoid an error.
21895
-   Use char because int might match the return type of a GCC
21896
-   builtin and then its argument prototype would still apply.  */
21897
-#ifdef __cplusplus
21898
-extern "C"
21899
-#endif
21900
-char sn_sigscan_initdb ();
21901
-int
21902
-main ()
21903
-{
21904
-return sn_sigscan_initdb ();
21905
-  ;
21906
-  return 0;
21907
-}
21908
-_ACEOF
21909
-rm -f conftest.$ac_objext conftest$ac_exeext
21910
-if { (ac_try="$ac_link"
21911
-case "(($ac_try" in
21912
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21913
-  *) ac_try_echo=$ac_try;;
21914
-esac
21915
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21916
-  (eval "$ac_link") 2>conftest.er1
21917
-  ac_status=$?
21918
-  grep -v '^ *+' conftest.er1 >conftest.err
21919
-  rm -f conftest.er1
21920
-  cat conftest.err >&5
21921
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
21922
-  (exit $ac_status); } && {
21923
-	 test -z "$ac_c_werror_flag" ||
21924
-	 test ! -s conftest.err
21925
-       } && test -s conftest$ac_exeext &&
21926
-       $as_test_x conftest$ac_exeext; then
21927
-  ac_cv_lib_sn_sigscan_sn_sigscan_initdb=yes
21928
-else
21929
-  echo "$as_me: failed program was:" >&5
21930
-sed 's/^/| /' conftest.$ac_ext >&5
21931
-
21932
-	ac_cv_lib_sn_sigscan_sn_sigscan_initdb=no
21933
-fi
21934
-
21935
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21936
-      conftest$ac_exeext conftest.$ac_ext
21937
-LIBS=$ac_check_lib_save_LIBS
21938
-fi
21939
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_sn_sigscan_sn_sigscan_initdb" >&5
21940
-echo "${ECHO_T}$ac_cv_lib_sn_sigscan_sn_sigscan_initdb" >&6; }
21941
-if test $ac_cv_lib_sn_sigscan_sn_sigscan_initdb = yes; then
21942
-  have_sigscan=yes
21943
-fi
21944
-
21945
-    if test "$have_sigscan" = "yes"; then
21946
-	want_ncore="yes"
21947
-    fi
21948
-fi
21949
-
21950
-if test "$want_ncore" = "yes"
21951
-then
21952
-    if test "${ac_cv_header_dlfcn_h+set}" = set; then
21953
-  { echo "$as_me:$LINENO: checking for dlfcn.h" >&5
21954
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
21955
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
21956
-  echo $ECHO_N "(cached) $ECHO_C" >&6
21957
-fi
21958
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
21959
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
21960
-else
21961
-  # Is the header compilable?
21962
-{ echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
21963
-echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; }
21964
-cat >conftest.$ac_ext <<_ACEOF
21965
-/* confdefs.h.  */
21966
-_ACEOF
21967
-cat confdefs.h >>conftest.$ac_ext
21968
-cat >>conftest.$ac_ext <<_ACEOF
21969
-/* end confdefs.h.  */
21970
-$ac_includes_default
21971
-#include <dlfcn.h>
21972
-_ACEOF
21973
-rm -f conftest.$ac_objext
21974
-if { (ac_try="$ac_compile"
21975
-case "(($ac_try" in
21976
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21977
-  *) ac_try_echo=$ac_try;;
21978
-esac
21979
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
21980
-  (eval "$ac_compile") 2>conftest.er1
21981
-  ac_status=$?
21982
-  grep -v '^ *+' conftest.er1 >conftest.err
21983
-  rm -f conftest.er1
21984
-  cat conftest.err >&5
21985
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
21986
-  (exit $ac_status); } && {
21987
-	 test -z "$ac_c_werror_flag" ||
21988
-	 test ! -s conftest.err
21989
-       } && test -s conftest.$ac_objext; then
21990
-  ac_header_compiler=yes
21991
-else
21992
-  echo "$as_me: failed program was:" >&5
21993
-sed 's/^/| /' conftest.$ac_ext >&5
21994
-
21995
-	ac_header_compiler=no
21996
-fi
21997
-
21998
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21999
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
22000
-echo "${ECHO_T}$ac_header_compiler" >&6; }
22001
-
22002
-# Is the header present?
22003
-{ echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
22004
-echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; }
22005
-cat >conftest.$ac_ext <<_ACEOF
22006
-/* confdefs.h.  */
22007
-_ACEOF
22008
-cat confdefs.h >>conftest.$ac_ext
22009
-cat >>conftest.$ac_ext <<_ACEOF
22010
-/* end confdefs.h.  */
22011
-#include <dlfcn.h>
22012
-_ACEOF
22013
-if { (ac_try="$ac_cpp conftest.$ac_ext"
22014
-case "(($ac_try" in
22015
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22016
-  *) ac_try_echo=$ac_try;;
22017
-esac
22018
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
22019
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
22020
-  ac_status=$?
22021
-  grep -v '^ *+' conftest.er1 >conftest.err
22022
-  rm -f conftest.er1
22023
-  cat conftest.err >&5
22024
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
22025
-  (exit $ac_status); } >/dev/null && {
22026
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
22027
-	 test ! -s conftest.err
22028
-       }; then
22029
-  ac_header_preproc=yes
22030
-else
22031
-  echo "$as_me: failed program was:" >&5
22032
-sed 's/^/| /' conftest.$ac_ext >&5
22033
-
22034
-  ac_header_preproc=no
22035
-fi
22036
-
22037
-rm -f conftest.err conftest.$ac_ext
22038
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
22039
-echo "${ECHO_T}$ac_header_preproc" >&6; }
22040
-
22041
-# So?  What about this header?
22042
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
22043
-  yes:no: )
22044
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
22045
-echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
22046
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
22047
-echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
22048
-    ac_header_preproc=yes
22049
-    ;;
22050
-  no:yes:* )
22051
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
22052
-echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
22053
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h:     check for missing prerequisite headers?" >&5
22054
-echo "$as_me: WARNING: dlfcn.h:     check for missing prerequisite headers?" >&2;}
22055
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
22056
-echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
22057
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h:     section \"Present But Cannot Be Compiled\"" >&5
22058
-echo "$as_me: WARNING: dlfcn.h:     section \"Present But Cannot Be Compiled\"" >&2;}
22059
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
22060
-echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
22061
-    { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
22062
-echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
22063
-
22064
-    ;;
22065
-esac
22066
-{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
22067
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
22068
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
22069
-  echo $ECHO_N "(cached) $ECHO_C" >&6
22070
-else
22071
-  ac_cv_header_dlfcn_h=$ac_header_preproc
22072
-fi
22073
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
22074
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
22075
-
22076
-fi
22077
-if test $ac_cv_header_dlfcn_h = yes; then
22078
-  LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -ldl" ;
22079
-cat >>confdefs.h <<\_ACEOF
22080
-#define HAVE_NCORE 1
22081
-_ACEOF
22082
-
22083
-else
22084
-  { echo "$as_me:$LINENO: WARNING: ****** NodalCore support disabled (no support for dlopen)" >&5
22085
-echo "$as_me: WARNING: ****** NodalCore support disabled (no support for dlopen)" >&2;}
22086
-fi
22087
-
22088
-
22089
-fi
22090
-
22091 21870
 # Check whether --enable-dns was given.
22092 21871
 if test "${enable_dns+set}" = set; then
22093 21872
   enableval=$enable_dns; want_dns=$enableval
... ...
@@ -26690,6 +26728,7 @@ CCDEPMODE!$CCDEPMODE$ac_delim
26690 26690
 am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
26691 26691
 am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
26692 26692
 LN_S!$LN_S$ac_delim
26693
+SED!$SED$ac_delim
26693 26694
 GREP!$GREP$ac_delim
26694 26695
 EGREP!$EGREP$ac_delim
26695 26696
 ECHO!$ECHO$ac_delim
... ...
@@ -26698,7 +26737,6 @@ RANLIB!$RANLIB$ac_delim
26698 26698
 CPP!$CPP$ac_delim
26699 26699
 CXX!$CXX$ac_delim
26700 26700
 CXXFLAGS!$CXXFLAGS$ac_delim
26701
-ac_ct_CXX!$ac_ct_CXX$ac_delim
26702 26701
 _ACEOF
26703 26702
 
26704 26703
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
... ...
@@ -26740,6 +26778,7 @@ _ACEOF
26740 26740
 ac_delim='%!_!# '
26741 26741
 for ac_last_try in false false false false false :; do
26742 26742
   cat >conf$$subs.sed <<_ACEOF
26743
+ac_ct_CXX!$ac_ct_CXX$ac_delim
26743 26744
 CXXDEPMODE!$CXXDEPMODE$ac_delim
26744 26745
 am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
26745 26746
 am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
... ...
@@ -26771,7 +26810,7 @@ LIBOBJS!$LIBOBJS$ac_delim
26771 26771
 LTLIBOBJS!$LTLIBOBJS$ac_delim
26772 26772
 _ACEOF
26773 26773
 
26774
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then
26774
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then
26775 26775
     break
26776 26776
   elif $ac_last_try; then
26777 26777
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
... ...
@@ -151,23 +151,6 @@ then
151 151
     AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H,1,have bzip2)], AC_MSG_WARN([****** bzip2 support disabled]))
152 152
 fi
153 153
 
154
-AC_ARG_ENABLE(ncore,
155
-[  --disable-ncore	  disable support for NodalCore acceleration (default=auto)],
156
-want_ncore=$enableval, want_ncore="auto")
157
-
158
-if test "$want_ncore" = "auto"
159
-then
160
-    AC_CHECK_LIB(sn_sigscan, sn_sigscan_initdb, have_sigscan=yes,)
161
-    if test "$have_sigscan" = "yes"; then
162
-	want_ncore="yes"
163
-    fi
164
-fi
165
-
166
-if test "$want_ncore" = "yes"
167
-then
168
-    AC_CHECK_HEADER(dlfcn.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -ldl" ; AC_DEFINE(HAVE_NCORE,1,Support for NodalCore acceleration)], AC_MSG_WARN([****** NodalCore support disabled (no support for dlopen)]))
169
-fi
170
-
171 154
 AC_ARG_ENABLE(dns,
172 155
     AC_HELP_STRING([--disable-dns], [disable support for database verification through DNS]),
173 156
     [want_dns=$enableval], [want_dns=yes]
174 157
new file mode 100644
... ...
@@ -0,0 +1,1073 @@
0
+diff -Nura clamav-devel/clamd/clamd.c clamav-devel.hwaccel/clamd/clamd.c
1
+--- clamav-devel/clamd/clamd.c	2007-09-07 14:04:34.000000000 +0200
2
+@@ -312,6 +312,15 @@
3
+     else
4
+ 	logg("Disabling URL based phishing detection.\n");
5
+ 
6
++    if(cfgopt(copt, "NodalCoreAcceleration")->enabled) {
7
++#ifdef HAVE_NCORE
8
++	dboptions |= CL_DB_NCORE;
9
++	logg("Enabling support for hardware acceleration.\n");
10
++#else
11
++	logg("^Support for hardware acceleration not compiled in.\n");
12
++#endif
13
++    }
14
++
15
+     if((ret = cl_load(dbdir, &engine, &sigs, dboptions))) {
16
+ 	logg("!%s\n", cl_strerror(ret));
17
+ 	logg_close();
18
+diff -Nura clamav-devel/clamd/server-th.c clamav-devel.hwaccel/clamd/server-th.c
19
+--- clamav-devel/clamd/server-th.c	2007-09-07 14:04:16.000000000 +0200
20
+@@ -610,6 +610,11 @@
21
+ 	}
22
+ 
23
+ 	pthread_mutex_lock(&reload_mutex);
24
++	if(reload && cfgopt(copt, "NodalCoreAcceleration")->enabled) {
25
++	    logg("^RELOAD is not available in hardware accelerated mode (yet).\n");
26
++	    logg("^Please restart the daemon manually.\n");
27
++	    reload = 0;
28
++	}
29
+ 	if(reload) {
30
+ 	    pthread_mutex_unlock(&reload_mutex);
31
+ 	    engine = reload_db(engine, dboptions, copt, FALSE, &ret);
32
+diff -Nura clamav-devel/clamdscan/client.c clamav-devel.hwaccel/clamdscan/client.c
33
+--- clamav-devel/clamdscan/client.c	2007-09-07 14:05:26.000000000 +0200
34
+@@ -56,6 +56,7 @@
35
+ 
36
+ void move_infected(const char *filename, const struct optstruct *opt);
37
+ int notremoved = 0, notmoved = 0;
38
++static int ncore = 0;
39
+ 
40
+ static int dsresult(int sockd, const struct optstruct *opt)
41
+ {
42
+@@ -388,6 +389,11 @@
43
+ 	return -1;
44
+     }
45
+ 
46
++#ifdef HAVE_NCORE
47
++    if(cfgopt(copt, "NodalCoreAcceleration")->enabled)
48
++	ncore = 1;
49
++#endif
50
++
51
+     freecfg(copt);
52
+ 
53
+     return sockd;
54
+@@ -403,7 +409,7 @@
55
+ 
56
+     *infected = 0;
57
+ 
58
+-    if(opt_check(opt, "multiscan"))
59
++    if(ncore || opt_check(opt, "multiscan"))
60
+ 	scantype = "MULTISCAN";
61
+ 
62
+     /* parse argument list */
63
+diff -Nura clamav-devel/clamscan/clamscan.c clamav-devel.hwaccel/clamscan/clamscan.c
64
+--- clamav-devel/clamscan/clamscan.c	2007-09-07 14:06:16.000000000 +0200
65
+@@ -224,7 +224,10 @@
66
+ 	dms += (dms < 0) ? (1000000):(0);
67
+ 	logg("\n----------- SCAN SUMMARY -----------\n");
68
+ 	logg("Known viruses: %u\n", info.sigs);
69
+-	logg("Engine version: %s\n", cl_retver());
70
++	if(opt_check(opt, "ncore"))
71
++	    logg("Engine version: %s [ncore]\n", cl_retver());
72
++	else
73
++	    logg("Engine version: %s\n", cl_retver());
74
+ 	logg("Scanned directories: %u\n", info.dirs);
75
+ 	logg("Scanned files: %u\n", info.files);
76
+ 	logg("Infected files: %u\n", info.ifiles);
77
+@@ -291,6 +294,9 @@
78
+     mprintf("    --include=PATT                       Only scan file names containing PATT\n");
79
+     mprintf("    --include-dir=PATT                   Only scan directories containing PATT\n");
80
+ #endif
81
++#ifdef HAVE_NCORE
82
++    mprintf("\n    --ncore                            Use hardware acceleration\n");
83
++#endif
84
+     mprintf("\n");
85
+     mprintf("    --detect-pua                         Detect Possibly Unwanted Applications\n");
86
+     mprintf("    --no-mail                            Disable mail file support\n");
87
+diff -Nura clamav-devel/clamscan/clamscan_opt.h clamav-devel.hwaccel/clamscan/clamscan_opt.h
88
+--- clamav-devel/clamscan/clamscan_opt.h	2007-09-07 14:06:51.000000000 +0200
89
+@@ -59,6 +59,9 @@
90
+     {"max-recursion", 1, 0, 0},
91
+     {"max-dir-recursion", 1, 0, 0},
92
+     {"max-mail-recursion", 1, 0, 0},
93
++#ifdef HAVE_NCORE
94
++    {"ncore", 0, 0, 0},
95
++#endif
96
+     {"detect-pua", 0, 0, 0},
97
+     {"disable-archive", 0, 0, 0},
98
+     {"no-archive", 0, 0, 0},
99
+diff -Nura clamav-devel/clamscan/manager.c clamav-devel.hwaccel/clamscan/manager.c
100
+--- clamav-devel/clamscan/manager.c	2007-09-07 14:06:38.000000000 +0200
101
+@@ -164,6 +164,9 @@
102
+     }
103
+ #endif
104
+ 
105
++    if(opt_check(opt, "ncore"))
106
++	dboptions |= CL_DB_NCORE;
107
++
108
+     if(!opt_check(opt, "no-phishing-sigs"))
109
+ 	dboptions |= CL_DB_PHISHING;
110
+ 
111
+diff -Nura clamav-devel/configure.in clamav-devel.hwaccel/configure.in
112
+--- clamav-devel/configure.in	2007-09-07 14:14:41.000000000 +0200
113
+@@ -151,6 +151,23 @@
114
+     AC_CHECK_HEADER(bzlib.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lbz2"; AC_DEFINE(HAVE_BZLIB_H,1,have bzip2)], AC_MSG_WARN([****** bzip2 support disabled]))
115
+ fi
116
+ 
117
++AC_ARG_ENABLE(ncore,
118
++[  --disable-ncore	  disable support for NodalCore acceleration (default=auto)],
119
++want_ncore=$enableval, want_ncore="auto")
120
++
121
++if test "$want_ncore" = "auto"
122
++then
123
++    AC_CHECK_LIB(sn_sigscan, sn_sigscan_initdb, have_sigscan=yes,)
124
++    if test "$have_sigscan" = "yes"; then
125
++	want_ncore="yes"
126
++    fi
127
++fi
128
++
129
++if test "$want_ncore" = "yes"
130
++then
131
++    AC_CHECK_HEADER(dlfcn.h,[LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -ldl" ; AC_DEFINE(HAVE_NCORE,1,Support for NodalCore acceleration)], AC_MSG_WARN([****** NodalCore support disabled (no support for dlopen)]))
132
++fi
133
++
134
+ AC_ARG_ENABLE(dns,
135
+     AC_HELP_STRING([--disable-dns], [disable support for database verification through DNS]),
136
+     [want_dns=$enableval], [want_dns=yes]
137
+diff -Nura clamav-devel/docs/clamdoc.tex clamav-devel.hwaccel/docs/clamdoc.tex
138
+--- clamav-devel/docs/clamdoc.tex	2007-09-07 14:07:40.000000000 +0200
139
+@@ -659,6 +659,19 @@
140
+ 	\item CryptFF
141
+     \end{itemize}
142
+ 
143
++    \subsection{Hardware acceleration}
144
++    ClamAV 0.90 comes with support for Sensory Networks' NodalCore
145
++    acceleration technology. Thanks to specialized Security Processing Unit
146
++    built into NodalCore C-Series accelerators it is possible to achieve more
147
++    performance than is possible by just adding general purpose CPUs.
148
++    Additionally, Sensory Networks' CorePAKT technology ensures that compiled
149
++    signature databases occupy a memory footprint smaller than any other
150
++    competing technology on the market - in many cases by up to 90\%. The
151
++    ability to store multiple databases in compressed format whilst still
152
++    achieving high throughputs makes NodalCore ideal for applications
153
++    demanding high performance on large signature databases such as ClamAV.\\
154
++    For more information please visit \url{http://www.clamav.net/nodalcore/}
155
++
156
+     \subsection{API}
157
+ 
158
+     \subsubsection{Header file}
159
+@@ -687,6 +700,8 @@
160
+     \begin{itemize}
161
+ 	\item \textbf{CL\_DB\_STDOPT}\\
162
+ 	This is an alias for a recommended set of scan options.
163
++	\item \textbf{CL\_DB\_NCORE}\\
164
++	Initialize NodalCore and load the hardware database (if applicable).
165
+ 	\item \textbf{CL\_DB\_PHISHING}\\
166
+ 	Load phishing signatures.
167
+ 	\item \textbf{CL\_DB\_PHISHING\_URLS}\\
168
+diff -Nura clamav-devel/docs/man/clamd.conf.5.in clamav-devel.hwaccel/docs/man/clamd.conf.5.in
169
+--- clamav-devel/docs/man/clamd.conf.5.in	2007-09-07 15:04:51.000000000 +0200
170
+@@ -310,6 +310,11 @@
171
+ .br 
172
+ Default: no
173
+ .TP 
174
++\fBNodalCoreAcceleration BOOL\fR
175
++Enable support for Sensory Networks' NodalCore hardware accelerator.
176
++.br
177
++Default: no
178
++.TP 
179
+ \fBClamukoScanOnAccess BOOL\fR
180
+ Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.
181
+ .br 
182
+diff -Nura clamav-devel/etc/clamd.conf clamav-devel.hwaccel/etc/clamd.conf
183
+--- clamav-devel/etc/clamd.conf	2007-09-07 14:07:56.000000000 +0200
184
+@@ -314,6 +314,10 @@
185
+ # Default: no
186
+ #ArchiveBlockMax no
187
+ 
188
++# Enable support for Sensory Networks' NodalCore hardware accelerator.
189
++# Default: no
190
++#NodalCoreAcceleration yes
191
++
192
+ 
193
+ ##
194
+ ## Clamuko settings
195
+diff -Nura clamav-devel/libclamav/Makefile.am clamav-devel.hwaccel/libclamav/Makefile.am
196
+--- clamav-devel/libclamav/Makefile.am	2007-09-07 14:16:27.000000000 +0200
197
+@@ -31,6 +31,8 @@
198
+         matcher-ac.h \
199
+         matcher-bm.c \
200
+         matcher-bm.h \
201
++	matcher-ncore.c \
202
++	matcher-ncore.h \
203
+         matcher.c \
204
+         matcher.h \
205
+         md5.c \
206
+diff -Nura clamav-devel/libclamav/clamav.h clamav-devel.hwaccel/libclamav/clamav.h
207
+--- clamav-devel/libclamav/clamav.h	2007-09-07 14:38:43.000000000 +0200
208
+@@ -64,7 +64,13 @@
209
+ #define CL_ELOCKDB	-126 /* can't lock DB directory */
210
+ #define CL_EARJ         -127 /* ARJ handler error */
211
+ 
212
++/* NodalCore */
213
++#define CL_ENCINIT	-200 /* NodalCore initialization failed */
214
++#define	CL_ENCLOAD	-201 /* error loading NodalCore database */
215
++#define CL_ENCIO	-202 /* general NodalCore I/O error */
216
++
217
+ /* db options */
218
++#define CL_DB_NCORE	    0x1
219
+ #define CL_DB_PHISHING	    0x2
220
+ #define CL_DB_ACONLY	    0x4 /* WARNING: only for developers */
221
+ #define CL_DB_PHISHING_URLS 0x8
222
+@@ -105,6 +111,7 @@
223
+ 
224
+ struct cl_engine {
225
+     unsigned int refcount; /* reference counter */
226
++    unsigned short ncore;
227
+     unsigned short sdb;
228
+     unsigned int dboptions;
229
+ 
230
+@@ -123,6 +130,9 @@
231
+     /* RAR metadata */
232
+     void *rar_mlist;
233
+ 
234
++    /* NodalCore database handle */
235
++    void *ncdb;
236
++
237
+     /* Phishing .pdb and .wdb databases*/
238
+     void *whitelist_matcher;
239
+     void *domainlist_matcher;
240
+diff -Nura clamav-devel/libclamav/matcher-ncore.c clamav-devel.hwaccel/libclamav/matcher-ncore.c
241
+--- clamav-devel/libclamav/matcher-ncore.c	1970-01-01 01:00:00.000000000 +0100
242
+@@ -0,0 +1,606 @@
243
++/*
244
++ *  Copyright (C) 2006 Sensory Networks, Inc.
245
++ *	      Written by Tomasz Kojm, dlopen() support by Peter Duthie
246
++ *
247
++ *  This program is free software; you can redistribute it and/or modify
248
++ *  it under the terms of the GNU General Public License version 2 as
249
++ *  published by the Free Software Foundation.
250
++ *
251
++ *  This program is distributed in the hope that it will be useful,
252
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
253
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
254
++ *  GNU General Public License for more details.
255
++ *
256
++ *  You should have received a copy of the GNU General Public License
257
++ *  along with this program; if not, write to the Free Software
258
++ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
259
++ *  MA 02110-1301, USA.
260
++ */
261
++
262
++#if HAVE_CONFIG_H
263
++#include "clamav-config.h"
264
++#endif
265
++
266
++#ifdef HAVE_NCORE
267
++
268
++#include <stdio.h>
269
++#include <stdlib.h>
270
++#ifdef	HAVE_UNISTD_H
271
++#include <unistd.h>
272
++#endif
273
++#include <string.h>
274
++#include <sys/types.h>
275
++#include <sys/stat.h>
276
++#include <fcntl.h>
277
++#include <ctype.h>
278
++#ifdef HAVE_NCORE
279
++#include <dlfcn.h>
280
++#endif
281
++
282
++#include "clamav.h"
283
++#include "matcher.h"
284
++#include "cltypes.h"
285
++#include "md5.h"
286
++#include "readdb.h"
287
++#include "str.h"
288
++#include "matcher-ncore.h"
289
++
290
++#define HWBUFFSIZE 32768
291
++
292
++/* Globals */
293
++static void *g_ncore_dllhandle = 0;
294
++static const char *g_ncore_dllpath = "/usr/lib/libsn_sigscan.so";
295
++
296
++/* Function pointer types */
297
++typedef int (*sn_sigscan_initdb_t)(void **);
298
++typedef int (*sn_sigscan_loaddb_t)(void *dbhandle, const char *filename,
299
++        int devicenum, unsigned int *count);
300
++typedef int (*sn_sigscan_load2dbs_t)(void *dbhandle, const char *baseFilename,
301
++        const char *incrFilename, int devicenum, unsigned int *count);
302
++typedef int (*sn_sigscan_closedb_t)(void *dbhandle);
303
++typedef int (*sn_sigscan_createstream_t)(void *dbhandle,
304
++        const uint32_t *dbMaskData, unsigned int dbMaskWords,
305
++        void **streamhandle);
306
++typedef int (*sn_sigscan_writestream_t)(void *streamhandle, const char *buffer,
307
++        unsigned int len);
308
++typedef int (*sn_sigscan_closestream_t)(void *streamhandle,
309
++        void **resulthandle);
310
++typedef int (*sn_sigscan_resultcount_t)(void *resulthandle);
311
++typedef int (*sn_sigscan_resultget_name_t)(void *resulthandle,
312
++        unsigned int index, const char **matchname);
313
++typedef int (*sn_sigscan_resultget_startoffset_t)(void *resulthandle,
314
++        unsigned int index, unsigned long long *startoffset);
315
++typedef int (*sn_sigscan_resultget_endoffset_t)(void *resulthandle,
316
++        unsigned int index, unsigned long long *endoffset);
317
++typedef int (*sn_sigscan_resultget_targettype_t)(void *resulthandle,
318
++        unsigned int index, int *targettype);
319
++typedef int (*sn_sigscan_resultget_offsetstring_t)(void *resulthandle,
320
++        unsigned int index, const char **offsetstring);
321
++typedef int (*sn_sigscan_resultget_extradata_t)(void *resulthandle,
322
++        unsigned int index, const char **optionalsigdata);
323
++typedef int (*sn_sigscan_resultfree_t)(void *resulthandle);
324
++typedef void (*sn_sigscan_error_function_t)(const char *msg);
325
++typedef int (*sn_sigscan_seterrorlogger_t)(sn_sigscan_error_function_t errfn);
326
++
327
++/* Function pointer values */
328
++sn_sigscan_initdb_t sn_sigscan_initdb_f = 0;
329
++sn_sigscan_loaddb_t sn_sigscan_loaddb_f = 0;
330
++sn_sigscan_load2dbs_t sn_sigscan_load2dbs_f = 0;
331
++sn_sigscan_closedb_t sn_sigscan_closedb_f = 0;
332
++sn_sigscan_createstream_t sn_sigscan_createstream_f = 0;
333
++sn_sigscan_writestream_t sn_sigscan_writestream_f = 0;
334
++sn_sigscan_closestream_t sn_sigscan_closestream_f = 0;
335
++sn_sigscan_resultcount_t sn_sigscan_resultcount_f = 0;
336
++sn_sigscan_resultget_name_t sn_sigscan_resultget_name_f = 0;
337
++sn_sigscan_resultget_startoffset_t sn_sigscan_resultget_startoffset_f = 0;
338
++sn_sigscan_resultget_endoffset_t sn_sigscan_resultget_endoffset_f = 0;
339
++sn_sigscan_resultget_targettype_t sn_sigscan_resultget_targettype_f = 0;
340
++sn_sigscan_resultget_offsetstring_t sn_sigscan_resultget_offsetstring_f = 0;
341
++sn_sigscan_resultget_extradata_t sn_sigscan_resultget_extradata_f = 0;
342
++sn_sigscan_resultfree_t sn_sigscan_resultfree_f = 0;
343
++sn_sigscan_seterrorlogger_t sn_sigscan_seterrorlogger_f = 0;
344
++
345
++static int cli_ncore_dlinit()
346
++{
347
++    if(access(g_ncore_dllpath, R_OK) == -1) {
348
++	cli_dbgmsg("cli_ncore_dlinit: Can't access %s\n", g_ncore_dllpath);
349
++	return CL_ENCINIT;
350
++    }
351
++
352
++    g_ncore_dllhandle = dlopen(g_ncore_dllpath, RTLD_NOW | RTLD_LOCAL);
353
++    if(!g_ncore_dllhandle) {
354
++	cli_dbgmsg("cli_ncore_dlinit: dlopen() failed for %s\n", g_ncore_dllpath);
355
++	return CL_ENCINIT;
356
++    }
357
++
358
++    /* get the symbols */
359
++    sn_sigscan_initdb_f = (sn_sigscan_initdb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_initdb");
360
++    sn_sigscan_loaddb_f = (sn_sigscan_loaddb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_loaddb");
361
++    sn_sigscan_load2dbs_f = (sn_sigscan_load2dbs_t)dlsym(g_ncore_dllhandle, "sn_sigscan_load2dbs");
362
++    sn_sigscan_closedb_f = (sn_sigscan_closedb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_closedb");
363
++    sn_sigscan_createstream_f = (sn_sigscan_createstream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_createstream");
364
++    sn_sigscan_writestream_f = (sn_sigscan_writestream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_writestream");
365
++    sn_sigscan_closestream_f = (sn_sigscan_closestream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_closestream");
366
++    sn_sigscan_resultcount_f = (sn_sigscan_resultcount_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultcount");
367
++    sn_sigscan_resultget_name_f = (sn_sigscan_resultget_name_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_name");
368
++    sn_sigscan_resultget_startoffset_f = (sn_sigscan_resultget_startoffset_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_startoffset");
369
++    sn_sigscan_resultget_endoffset_f = (sn_sigscan_resultget_endoffset_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_endoffset");
370
++    sn_sigscan_resultget_targettype_f = (sn_sigscan_resultget_targettype_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_targettype");
371
++    sn_sigscan_resultget_offsetstring_f = (sn_sigscan_resultget_offsetstring_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_offsetstring");
372
++    sn_sigscan_resultget_extradata_f = (sn_sigscan_resultget_extradata_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_extradata");
373
++    sn_sigscan_resultfree_f = (sn_sigscan_resultfree_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultfree");
374
++    sn_sigscan_seterrorlogger_f = (sn_sigscan_seterrorlogger_t)dlsym(g_ncore_dllhandle, "sn_sigscan_seterrorlogger");
375
++
376
++    /* Check that we got all the symbols */
377
++    if(sn_sigscan_initdb_f && sn_sigscan_loaddb_f && sn_sigscan_load2dbs_f &&
378
++            sn_sigscan_closedb_f && sn_sigscan_createstream_f &&
379
++            sn_sigscan_writestream_f && sn_sigscan_closestream_f &&
380
++            sn_sigscan_resultcount_f && sn_sigscan_resultget_name_f &&
381
++            sn_sigscan_resultget_startoffset_f &&
382
++            sn_sigscan_resultget_endoffset_f &&
383
++            sn_sigscan_resultget_targettype_f &&
384
++            sn_sigscan_resultget_offsetstring_f &&
385
++            sn_sigscan_resultget_extradata_f && sn_sigscan_resultfree_f &&
386
++            sn_sigscan_seterrorlogger_f)
387
++    {
388
++        return CL_SUCCESS;
389
++    }
390
++
391
++    dlclose(g_ncore_dllhandle);
392
++    g_ncore_dllhandle = 0;
393
++    return CL_ENCINIT;
394
++}
395
++
396
++int cli_ncore_scanbuff(const char *buffer, unsigned int length, const char **virname, const struct cl_engine *engine, unsigned short ftype, unsigned int *targettab)
397
++{
398
++	void *streamhandle;
399
++	void *resulthandle;
400
++	static const uint32_t datamask[2] = { 0xffffffff, 0xffffffff };
401
++	int count, hret, i;
402
++	char *pt;
403
++	int ret = CL_CLEAN;
404
++
405
++
406
++    /* TODO: Setup proper data bitmask (need specs) */
407
++    /* Create the hardware scanning stream */
408
++    hret = (*sn_sigscan_createstream_f)(engine->ncdb, datamask, 2, &streamhandle);
409
++    if(hret) {
410
++        cli_errmsg("cli_ncore_scanbuff: can't create new hardware stream: %d\n", hret);
411
++        return CL_ENCIO;
412
++    }
413
++
414
++    /* Write data to the hardware scanning stream */
415
++    hret = (*sn_sigscan_writestream_f)(streamhandle, buffer, length);
416
++    if(hret) {
417
++        cli_errmsg("cli_ncore_scanbuff: can't write %u bytes to hardware stream: %d\n", length, hret);
418
++        (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
419
++        (*sn_sigscan_resultfree_f)(resulthandle);
420
++        return CL_ENCIO;
421
++    }
422
++
423
++    /* Close the hardware scanning stream and collect the result */
424
++    hret = (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
425
++    if(hret) {
426
++        cli_errmsg("cli_ncore_scanbuff: can't close hardware stream: %d\n", hret);
427
++        return CL_ENCIO;
428
++    }
429
++
430
++    /* Iterate through the results */
431
++    count = (*sn_sigscan_resultcount_f)(resulthandle);
432
++    for(i = 0; i < count; i++) {
433
++        const char *matchname = NULL, *offsetstring = NULL, *optionalsigdata = NULL;
434
++        unsigned int targettype = 0;
435
++
436
++        /* Acquire the name of the result */
437
++        hret = (*sn_sigscan_resultget_name_f)(resulthandle, i, &matchname);
438
++        if(hret) {
439
++            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_name failed for result %u: %d\n", i, hret);
440
++            (*sn_sigscan_resultfree_f)(resulthandle);
441
++            return CL_ENCIO;
442
++        }
443
++        if(!matchname) {
444
++            cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: Signature without name\n", i);
445
++            (*sn_sigscan_resultfree_f)(resulthandle);
446
++            return CL_EMALFDB;
447
++        }
448
++
449
++        /* Acquire the result file type and check that it is correct */
450
++        hret = (*sn_sigscan_resultget_targettype_f)(resulthandle, i, &targettype);
451
++        if(hret) {
452
++            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_targettype failed for result %u, signature %s: %d\n", i, matchname, hret);
453
++            (*sn_sigscan_resultfree_f)(resulthandle);
454
++            return CL_ENCIO;
455
++        }
456
++
457
++        if(targettype && targettab[targettype] != ftype) {
458
++            cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Target type: %u, expected: %u\n", i, matchname, targettab[targettype], ftype);
459
++            continue;
460
++        }
461
++
462
++        hret = (*sn_sigscan_resultget_offsetstring_f)(resulthandle, i, &offsetstring);
463
++        if(hret) {
464
++            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_offsetstring failed for result %u, signature %s: %d\n", i, matchname, hret);
465
++            (*sn_sigscan_resultfree_f)(resulthandle);
466
++            return CL_ENCIO;
467
++        }
468
++        if(offsetstring) {
469
++            cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Offset based signature not supported in buffer mode\n", i, matchname);
470
++            continue;
471
++        }
472
++
473
++        hret = (*sn_sigscan_resultget_extradata_f)(resulthandle, i, &optionalsigdata);
474
++        if(hret) {
475
++            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_extradata failed for result %u, signature %s: %d\n", i, matchname, hret);
476
++            (*sn_sigscan_resultfree_f)(resulthandle);
477
++            return CL_ENCIO;
478
++        }
479
++        if(optionalsigdata && strlen(optionalsigdata)) {
480
++            pt = cli_strtok(optionalsigdata, 1, ":");
481
++            if(pt) {
482
++                if(!isdigit(*pt)) {
483
++                    free(pt);
484
++                    cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
485
++                    (*sn_sigscan_resultfree_f)(resulthandle);
486
++                    return CL_EMALFDB;
487
++                }
488
++
489
++                if((unsigned int) atoi(pt) < cl_retflevel()) {
490
++                    cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Signature max flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
491
++                    free(pt);
492
++                    continue;
493
++                }
494
++
495
++                free(pt);
496
++                pt = cli_strtok(optionalsigdata, 0, ":");
497
++                if(pt) {
498
++                    if(!isdigit(*pt)) {
499
++                        free(pt);
500
++                        cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
501
++                        (*sn_sigscan_resultfree_f)(resulthandle);
502
++                        return CL_EMALFDB;
503
++                    }
504
++
505
++                    if((unsigned int) atoi(pt) > cl_retflevel()) {
506
++                        cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Signature required flevel: %u, current: %u\n", i, matchname, atoi(pt), cl_retflevel());
507
++                        free(pt);
508
++                        continue;
509
++                    }
510
++                    free(pt);
511
++                }
512
++
513
++            } else {
514
++                if(!isdigit(*optionalsigdata)) {
515
++                    cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
516
++                    (*sn_sigscan_resultfree_f)(resulthandle);
517
++                    return CL_EMALFDB;
518
++                }
519
++
520
++                if((unsigned int) atoi(optionalsigdata) > cl_retflevel()) {
521
++                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %u, current: %u\n", i, matchname, atoi(optionalsigdata), cl_retflevel());
522
++                    continue;
523
++                }
524
++            }
525
++        }
526
++
527
++        /* Store the name of the match */
528
++        *virname = matchname;
529
++        ret = CL_VIRUS;
530
++        break;
531
++    }
532
++
533
++    /* Clean up the result structure */
534
++    hret = (*sn_sigscan_resultfree_f)(resulthandle);
535
++    if(hret) {
536
++        cli_errmsg("cli_ncore_scanbuff: can't free results: %d\n", ret);
537
++        return CL_ENCIO;
538
++    }
539
++
540
++    return ret;
541
++}
542
++
543
++int cli_ncore_scandesc(int desc, cli_ctx *ctx, unsigned short ftype, int *cont, unsigned int *targettab, cli_md5_ctx *md5ctx)
544
++{
545
++	void *streamhandle;
546
++	void *resulthandle;
547
++	uint32_t datamask[2] = { 0xffffffff, 0xffffffff };
548
++	struct cli_target_info info;
549
++	int i, count, hret, bytes, ret = CL_CLEAN;
550
++	off_t origoff;
551
++	*cont = 0;
552
++	char *buffer;
553
++
554
++
555
++    /* TODO: Setup proper data bitmask (need specs) */
556
++    /* Create the hardware scanning stream */
557
++    hret = (*sn_sigscan_createstream_f)(ctx->engine->ncdb, datamask, 2, &streamhandle);
558
++    if(hret) {
559
++        cli_errmsg("cli_ncore_scandesc: can't create new hardware stream: %d\n", hret);
560
++        return CL_ENCIO;
561
++    }
562
++
563
++    /* Obtain the initial offset */
564
++    origoff = lseek(desc, 0, SEEK_CUR);
565
++    if(origoff == -1) {
566
++        cli_errmsg("cli_ncore_scandesc: lseek() failed for descriptor %d\n", desc);
567
++	(*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
568
++        (*sn_sigscan_resultfree_f)(resulthandle);
569
++        return CL_EIO;
570
++    }
571
++
572
++    buffer = (char *) cli_calloc(HWBUFFSIZE, sizeof(char));
573
++    if(!buffer) {
574
++        cli_dbgmsg("cli_ncore_scandesc: unable to cli_calloc(%u)\n", HWBUFFSIZE);
575
++	(*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
576
++        (*sn_sigscan_resultfree_f)(resulthandle);
577
++        return CL_EMEM;
578
++    }
579
++
580
++    /* Initialize the MD5 hasher */
581
++    if(ctx->engine->md5_hlist)
582
++        MD5_Init(md5ctx);
583
++
584
++    /* Read and scan the data */
585
++    while ((bytes = cli_readn(desc, buffer, HWBUFFSIZE)) > 0) {
586
++        hret = (*sn_sigscan_writestream_f)(streamhandle, buffer, bytes);
587
++        if(hret) {
588
++            cli_errmsg("cli_ncore_scandesc: can't write to hardware stream: %d\n", hret);
589
++            ret = CL_ENCIO;
590
++            break;
591
++        } else {
592
++            if(ctx->scanned)
593
++                *ctx->scanned += bytes / CL_COUNT_PRECISION;
594
++ 
595
++    	    if(ctx->engine->md5_hlist)
596
++                MD5_Update(md5ctx, buffer, bytes);
597
++        }
598
++    }
599
++
600
++    free(buffer);
601
++
602
++    /* Close the stream and get the result */
603
++    hret = (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
604
++    if(hret) {
605
++        cli_errmsg("cli_ncore_scandesc: can't close hardware stream: %d\n", hret);
606
++        return CL_ENCIO;
607
++    }
608
++
609
++    memset(&info, 0, sizeof(info));
610
++
611
++    /* Iterate over the list of results */
612
++    count = (*sn_sigscan_resultcount_f)(resulthandle);
613
++    for(i = 0; i < count; i++) {
614
++    	const char *matchname = NULL, *offsetstring = NULL, *optionalsigdata = NULL;
615
++    	unsigned long long startoffset = 0;
616
++    	unsigned int targettype = 0, maxshift = 0;
617
++        char *pt;
618
++
619
++        /* Get the description of the match */
620
++        hret = (*sn_sigscan_resultget_name_f)(resulthandle, i, &matchname);
621
++        if(hret) {
622
++            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_name failed for result %u: %d\n", i, hret);
623
++            (*sn_sigscan_resultfree_f)(resulthandle);
624
++	    if(info.exeinfo.section)
625
++		free(info.exeinfo.section);
626
++            return CL_ENCIO;
627
++        }
628
++
629
++        if(!matchname) {
630
++            cli_errmsg("cli_ncore_scandesc: HW Result[%u]: Signature without name\n", i);
631
++            (*sn_sigscan_resultfree_f)(resulthandle);
632
++	    if(info.exeinfo.section)
633
++		free(info.exeinfo.section);
634
++            return CL_EMALFDB;
635
++        }
636
++
637
++        hret = (*sn_sigscan_resultget_targettype_f)(resulthandle, i, &targettype);
638
++        if(hret) {
639
++    	    cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_targettype failed for result %d, signature %s: %d\n", i, matchname, hret);
640
++    	    (*sn_sigscan_resultfree_f)(resulthandle);
641
++	    if(info.exeinfo.section)
642
++		free(info.exeinfo.section);
643
++    	    return CL_ENCIO;
644
++        }
645
++        if(targettype && targettab[targettype] != ftype) {
646
++    	    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Target type: %u, expected: %d\n", i, matchname, targettab[targettype], ftype);
647
++            continue;
648
++        }
649
++
650
++        hret = (*sn_sigscan_resultget_offsetstring_f)(resulthandle, i, &offsetstring);
651
++        if(hret) {
652
++            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_offsetstring failed for result %u, signature %s: %d\n", i, matchname, hret);
653
++            (*sn_sigscan_resultfree_f)(resulthandle);
654
++	    if(info.exeinfo.section)
655
++		free(info.exeinfo.section);
656
++            return CL_ENCIO;
657
++        }
658
++
659
++        hret = (*sn_sigscan_resultget_startoffset_f)(resulthandle, i, &startoffset);
660
++        if(hret) {
661
++    	    cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_startoffset failed for result %u, signature %s: %d\n", i, matchname, hret);
662
++    	    (*sn_sigscan_resultfree_f)(resulthandle);
663
++	    if(info.exeinfo.section)
664
++		free(info.exeinfo.section);
665
++    	    return CL_ENCIO;
666
++        }
667
++        if(offsetstring && strcmp(offsetstring, "*")) {
668
++	    off_t off = cli_caloff(offsetstring, &info, desc, ftype, &hret, &maxshift);
669
++
670
++    	    if(hret == -1) {
671
++                cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Bad offset in signature\n", i, matchname);
672
++                (*sn_sigscan_resultfree_f)(resulthandle);
673
++		if(info.exeinfo.section)
674
++		    free(info.exeinfo.section);
675
++                return CL_EMALFDB;
676
++            }
677
++	    if(maxshift) {
678
++		if((startoffset < (unsigned long long) off) || (startoffset > (unsigned long long) off + maxshift)) {
679
++		    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Virus offset: %Lu, expected: [%Lu..%Lu]\n", i, matchname, startoffset, off, off + maxshift);
680
++		    continue;
681
++		}
682
++	    } else if(startoffset != (unsigned long long) off) {
683
++                cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Virus offset: %Lu, expected: %Lu\n", i, matchname, startoffset, off);
684
++                continue;
685
++            }
686
++        }
687
++
688
++        hret = (*sn_sigscan_resultget_extradata_f)(resulthandle, i, &optionalsigdata);
689
++        if(hret) {
690
++            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_extradata failed for result %d, signature %s: %d\n", i, matchname, hret);
691
++            (*sn_sigscan_resultfree_f)(resulthandle);
692
++	    if(info.exeinfo.section)
693
++		free(info.exeinfo.section);
694
++            return CL_ENCIO;
695
++        }
696
++
697
++        if(optionalsigdata && strlen(optionalsigdata)) {
698
++    	    pt = cli_strtok(optionalsigdata, 1, ":");
699
++    	    if(pt) {
700
++    	        if(!isdigit(*pt)) {
701
++    		    free(pt);
702
++                    cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
703
++		    (*sn_sigscan_resultfree_f)(resulthandle);
704
++		    if(info.exeinfo.section)
705
++			free(info.exeinfo.section);
706
++                    return CL_EMALFDB;
707
++                }
708
++
709
++                if((unsigned int) atoi(pt) < cl_retflevel()) {
710
++                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature max flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
711
++                    free(pt);
712
++                    continue;
713
++                }
714
++
715
++                free(pt);
716
++
717
++    	        pt = cli_strtok(optionalsigdata, 0, ":");
718
++    	        if(pt) {
719
++                    if(!isdigit(*pt)) {
720
++                        free(pt);
721
++                        cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
722
++			(*sn_sigscan_resultfree_f)(resulthandle);
723
++			if(info.exeinfo.section)
724
++			    free(info.exeinfo.section);
725
++                        return CL_EMALFDB;
726
++                    }
727
++
728
++                    if((unsigned int) atoi(pt) > cl_retflevel()) {
729
++                        cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
730
++                        free(pt);
731
++                        continue;
732
++                    }
733
++                    free(pt);
734
++                }
735
++            } else {
736
++                if(!isdigit(*optionalsigdata)) {
737
++                    cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
738
++                    (*sn_sigscan_resultfree_f)(resulthandle);
739
++		    if(info.exeinfo.section)
740
++			free(info.exeinfo.section);
741
++                    return CL_EMALFDB;
742
++                }
743
++
744
++                if((unsigned int) atoi(optionalsigdata) > cl_retflevel()) {
745
++                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %d, current: %d\n", i, matchname, atoi(optionalsigdata), cl_retflevel());
746
++                    continue;
747
++                }
748
++            }
749
++        }
750
++
751
++        *ctx->virname = matchname;
752
++        ret = CL_VIRUS;
753
++        break;
754
++    }
755
++
756
++    if(info.exeinfo.section)
757
++	free(info.exeinfo.section);
758
++
759
++    hret = (*sn_sigscan_resultfree_f)(resulthandle);
760
++    if(hret) {
761
++        cli_errmsg("cli_ncore_scandesc: can't free results: %d\n", ret);
762
++        return CL_ENCIO;
763
++    }
764
++
765
++    if(ctx->engine->md5_hlist) {
766
++        unsigned char digest[16];
767
++        struct cli_md5_node *md5_node;
768
++        MD5_Final(digest, md5ctx);
769
++
770
++        md5_node = cli_vermd5(digest, ctx->engine);
771
++        if(md5_node) {
772
++            struct stat sb;
773
++            if(fstat(desc, &sb) == -1)
774
++                return CL_EIO;
775
++
776
++    	    if((unsigned int) sb.st_size != md5_node->size) {
777
++                cli_warnmsg("Detected false positive MD5 match. Please report.\n");
778
++            } else {
779
++                if(md5_node->fp) {
780
++                    cli_dbgmsg("Eliminated false positive match (fp sig: %s)\n", md5_node->virname);
781
++                    ret = CL_CLEAN;
782
++                } else {
783
++                    if(ctx->virname)
784
++                        *ctx->virname = md5_node->virname;
785
++
786
++                    ret = CL_VIRUS;
787
++                }
788
++            }
789
++        }
790
++    }
791
++
792
++    if(ret == CL_VIRUS || (ftype != CL_TYPE_UNKNOWN_TEXT && ftype != CL_TYPE_UNKNOWN_DATA))
793
++        return ret;
794
++
795
++    if(lseek(desc, origoff, SEEK_SET) == -1) {
796
++        cli_errmsg("cli_ncore_scandesc: lseek() failed for descriptor %d\n", desc);
797
++        return CL_EIO;
798
++    }
799
++
800
++    *cont = 1;
801
++    return ret;
802
++}
803
++
804
++int cli_ncore_load(const char *filename, struct cl_engine **engine, unsigned int *signo, unsigned int options)
805
++{
806
++	int ret = 0;
807
++	unsigned int newsigs = 0;
808
++
809
++
810
++    if((ret = cli_initengine(engine, options))) {
811
++	cl_free(*engine);
812
++	return ret;
813
++    }
814
++
815
++    if((ret = cli_ncore_dlinit())) {
816
++	cl_free(*engine);
817
++	return ret;
818
++    }
819
++
820
++    ret = (*sn_sigscan_initdb_f)(&(*engine)->ncdb);
821
++    if(ret) {
822
++        cli_errmsg("cli_ncore_load: error initializing the matcher: %d\n", ret);
823
++        cl_free(*engine);
824
++        return CL_ENCINIT;
825
++    }
826
++
827
++    (*engine)->ncore = 1;
828
++
829
++    ret = (*sn_sigscan_loaddb_f)((*engine)->ncdb, filename, 0, &newsigs);
830
++    if(ret) {
831
++        cli_errmsg("cli_ncore_load: can't load hardware database: %d\n", ret);
832
++        cl_free(*engine);
833
++        return CL_ENCLOAD;
834
++    }
835
++
836
++    *signo += newsigs;
837
++    return CL_SUCCESS;
838
++}
839
++
840
++void cli_ncore_unload(struct cl_engine *engine)
841
++{
842
++	int ret;
843
++
844
++    ret = (*sn_sigscan_closedb_f)(engine->ncdb);
845
++    if(ret)
846
++        cli_errmsg("cl_free: can't close hardware database: %d\n", ret);
847
++}
848
++#endif
849
+diff -Nura clamav-devel/libclamav/matcher-ncore.h clamav-devel.hwaccel/libclamav/matcher-ncore.h
850
+--- clamav-devel/libclamav/matcher-ncore.h	1970-01-01 01:00:00.000000000 +0100
851
+@@ -0,0 +1,34 @@
852
++/*
853
++ *  Copyright (C) 2006 Sensory Networks, Inc.
854
++ *	      Written by Tomasz Kojm, dlopen() support by Peter Duthie
855
++ *
856
++ *  This program is free software; you can redistribute it and/or modify
857
++ *  it under the terms of the GNU General Public License version 2 as
858
++ *  published by the Free Software Foundation.
859
++ *
860
++ *  This program is distributed in the hope that it will be useful,
861
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
862
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
863
++ *  GNU General Public License for more details.
864
++ *
865
++ *  You should have received a copy of the GNU General Public License
866
++ *  along with this program; if not, write to the Free Software
867
++ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
868
++ *  MA 02110-1301, USA.
869
++ */
870
++
871
++#ifndef __MATCHER_NCORE_H
872
++#define __MATCHER_NCORE_H
873
++
874
++#include "clamav.h"
875
++#include "md5.h"
876
++
877
++int cli_ncore_scanbuff(const char *buffer, unsigned int length, const char **virname, const struct cl_engine *engine, unsigned short ftype, unsigned int *targettab);
878
++
879
++int cli_ncore_scandesc(int desc, cli_ctx *ctx, unsigned short ftype, int *cont, unsigned int *targettab, cli_md5_ctx *md5ctx);
880
++
881
++int cli_ncore_load(const char *filename, struct cl_engine **engine, unsigned int *signo, unsigned int options);
882
++
883
++void cli_ncore_unload(struct cl_engine *engine);
884
++
885
++#endif
886
+diff -Nura clamav-devel/libclamav/matcher.c clamav-devel.hwaccel/libclamav/matcher.c
887
+--- clamav-devel/libclamav/matcher.c	2007-09-07 14:09:42.000000000 +0200
888
+@@ -42,6 +42,10 @@
889
+ #include "str.h"
890
+ #include "cltypes.h"
891
+ 
892
++#ifdef HAVE_NCORE
893
++#include "matcher-ncore.h"
894
++#endif
895
++
896
+ static cli_file_t targettab[CL_TARGET_TABLE_SIZE] = { 0, CL_TYPE_MSEXE, CL_TYPE_MSOLE2, CL_TYPE_HTML, CL_TYPE_MAIL, CL_TYPE_GRAPHICS, CL_TYPE_ELF };
897
+ 
898
+ int cli_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cl_engine *engine, cli_file_t ftype)
899
+@@ -57,6 +61,11 @@
900
+ 	return CL_ENULLARG;
901
+     }
902
+ 
903
++#ifdef HAVE_NCORE
904
++    if(engine->ncore)
905
++	return cli_ncore_scanbuff(buffer, length, virname, engine, ftype, targettab);
906
++#endif
907
++
908
+     groot = engine->root[0]; /* generic signatures */
909
+ 
910
+     if(ftype) {
911
+@@ -292,6 +301,16 @@
912
+ 	return CL_ENULLARG;
913
+     }
914
+ 
915
++#ifdef HAVE_NCORE
916
++    if(ctx->engine->ncore) {
917
++	    int cont;
918
++
919
++	ret = cli_ncore_scandesc(desc, ctx, ftype, &cont, targettab, &md5ctx);
920
++	if(!cont)
921
++	    return ret;
922
++    }
923
++#endif
924
++
925
+     if(!ftonly)
926
+ 	groot = ctx->engine->root[0]; /* generic signatures */
927
+ 
928
+diff -Nura clamav-devel/libclamav/others.c clamav-devel.hwaccel/libclamav/others.c
929
+--- clamav-devel/libclamav/others.c	2007-09-07 14:13:47.000000000 +0200
930
+@@ -186,6 +186,12 @@
931
+ 	    return "Bad format or broken data";
932
+ 	case CL_ESUPPORT:
933
+ 	    return "Not supported data format";
934
++	case CL_ENCINIT:
935
++	    return "NodalCore initialization failure";
936
++	case CL_ENCLOAD:
937
++	    return "Error loading NodalCore database";
938
++	case CL_ENCIO:
939
++	    return "NodalCore accelerator Input/Output error";
940
+ 	case CL_ELOCKDB:
941
+ 	    return "Unable to lock database directory";
942
+ 	case CL_EARJ:
943
+diff -Nura clamav-devel/libclamav/readdb.c clamav-devel.hwaccel/libclamav/readdb.c
944
+--- clamav-devel/libclamav/readdb.c	2007-09-07 14:12:44.000000000 +0200
945
+@@ -70,6 +70,10 @@
946
+ static pthread_mutex_t cli_ref_mutex = PTHREAD_MUTEX_INITIALIZER;
947
+ #endif
948
+ 
949
++#ifdef HAVE_NCORE
950
++#include "matcher-ncore.h"
951
++#endif
952
++
953
+ /* Prototypes for old public functions just to shut up some gcc warnings;
954
+  * to be removed in 1.0
955
+  */
956
+@@ -960,7 +964,10 @@
957
+     }
958
+ 
959
+     if(cli_strbcasestr(filename, ".db")) {
960
+-	ret = cli_loaddb(fd, engine, signo, options);
961
++	if(options & CL_DB_NCORE)
962
++	    skipped = 1;
963
++	else
964
++	    ret = cli_loaddb(fd, engine, signo, options);
965
+ 
966
+     } else if(cli_strbcasestr(filename, ".cvd")) {
967
+ 	    int warn = 0;
968
+@@ -992,16 +999,23 @@
969
+ 	    skipped = 1;
970
+ 
971
+     } else if(cli_strbcasestr(filename, ".ndb")) {
972
+-	ret = cli_loadndb(fd, engine, signo, 0, options);
973
++	if(options & CL_DB_NCORE)
974
++	    skipped = 1;
975
++	else
976
++	    ret = cli_loadndb(fd, engine, signo, 0, options);
977
+ 
978
+     } else if(cli_strbcasestr(filename, ".ndu")) {
979
+-	if(!(options & CL_DB_PUA))
980
++	if(!(options & CL_DB_PUA) || (options & CL_DB_NCORE))
981
+ 	    skipped = 1;
982
+ 	else
983
+ 	    ret = cli_loadndb(fd, engine, signo, 0, options);
984
+ 
985
+     } else if(cli_strbcasestr(filename, ".sdb")) {
986
+-	ret = cli_loadndb(fd, engine, signo, 1, options);
987
++	/* FIXME: Add support in ncore mode */
988
++	if(options & CL_DB_NCORE)
989
++	    skipped = 1;
990
++	else
991
++	    ret = cli_loadndb(fd, engine, signo, 1, options);
992
+ 
993
+     } else if(cli_strbcasestr(filename, ".zmd")) {
994
+ 	ret = cli_loadmd(fd, engine, signo, 1, options);
995
+@@ -1012,6 +1026,13 @@
996
+     } else if(cli_strbcasestr(filename, ".cfg")) {
997
+ 	ret = cli_dconf_load(fd, engine, options);
998
+ 
999
++    } else if(cli_strbcasestr(filename, ".ncdb")) {
1000
++#ifdef HAVE_NCORE
1001
++	if(options & CL_DB_NCORE)
1002
++	    ret = cli_ncore_load(filename, engine, signo, options);
1003
++	else
1004
++#endif
1005
++	    skipped = 1;
1006
+     } else if(cli_strbcasestr(filename, ".wdb")) {
1007
+ 	if(options & CL_DB_PHISHING_URLS)
1008
+ 	    ret = cli_loadwdb(fd, engine, options);
1009
+@@ -1106,6 +1127,7 @@
1010
+ 	     cli_strbcasestr(dent->d_name, ".rmd")  ||
1011
+ 	     cli_strbcasestr(dent->d_name, ".pdb")  ||
1012
+ 	     cli_strbcasestr(dent->d_name, ".wdb")  ||
1013
++	     cli_strbcasestr(dent->d_name, ".ncdb") ||
1014
+ 	     cli_strbcasestr(dent->d_name, ".inc")  ||
1015
+ 	     cli_strbcasestr(dent->d_name, ".cvd"))) {
1016
+ 
1017
+@@ -1263,6 +1285,7 @@
1018
+ 	    cli_strbcasestr(dent->d_name, ".cfg")  ||
1019
+ 	    cli_strbcasestr(dent->d_name, ".pdb")  ||
1020
+ 	    cli_strbcasestr(dent->d_name, ".wdb")  ||
1021
++	    cli_strbcasestr(dent->d_name, ".ncdb")  ||
1022
+ 	    cli_strbcasestr(dent->d_name, ".inc")   ||
1023
+ 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
1024
+ 
1025
+@@ -1373,6 +1396,7 @@
1026
+ 	    cli_strbcasestr(dent->d_name, ".cfg")  ||
1027
+ 	    cli_strbcasestr(dent->d_name, ".pdb")  ||
1028
+ 	    cli_strbcasestr(dent->d_name, ".wdb")  ||
1029
++	    cli_strbcasestr(dent->d_name, ".ncdb")  ||
1030
+ 	    cli_strbcasestr(dent->d_name, ".inc")   ||
1031
+ 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
1032
+ 
1033
+@@ -1485,6 +1509,11 @@
1034
+     pthread_mutex_unlock(&cli_ref_mutex);
1035
+ #endif
1036
+ 
1037
++#ifdef HAVE_NCORE
1038
++    if(engine->ncore)
1039
++	cli_ncore_unload(engine);
1040
++#endif
1041
++
1042
+     if(engine->root) {
1043
+ 	for(i = 0; i < CL_TARGET_TABLE_SIZE; i++) {
1044
+ 	    if((root = engine->root[i])) {
1045
+diff -Nura clamav-devel/shared/cfgparser.c clamav-devel.hwaccel/shared/cfgparser.c
1046
+--- clamav-devel/shared/cfgparser.c	2007-09-07 14:57:04.000000000 +0200
1047
+@@ -91,6 +91,7 @@
1048
+     {"AllowSupplementaryGroups", OPT_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM},
1049
+     {"SelfCheck", OPT_NUM, 1800, NULL, 0, OPT_CLAMD},
1050
+     {"VirusEvent", OPT_FULLSTR, -1, NULL, 0, OPT_CLAMD},
1051
++    {"NodalCoreAcceleration", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
1052
+     {"ClamukoScanOnAccess", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
1053
+     {"ClamukoScanOnOpen", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
1054
+     {"ClamukoScanOnClose", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
... ...
@@ -136,6 +136,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
136 136
 PACKAGE_VERSION = @PACKAGE_VERSION@
137 137
 PATH_SEPARATOR = @PATH_SEPARATOR@
138 138
 RANLIB = @RANLIB@
139
+SED = @SED@
139 140
 SET_MAKE = @SET_MAKE@
140 141
 SHELL = @SHELL@
141 142
 STRIP = @STRIP@
... ...
@@ -141,6 +141,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
141 141
 PACKAGE_VERSION = @PACKAGE_VERSION@
142 142
 PATH_SEPARATOR = @PATH_SEPARATOR@
143 143
 RANLIB = @RANLIB@
144
+SED = @SED@
144 145
 SET_MAKE = @SET_MAKE@
145 146
 SHELL = @SHELL@
146 147
 STRIP = @STRIP@
... ...
@@ -659,19 +659,6 @@ N * * * *	/usr/local/bin/freshclam --quiet
659 659
 	\item CryptFF
660 660
     \end{itemize}
661 661
 
662
-    \subsection{Hardware acceleration}
663
-    ClamAV 0.90 comes with support for Sensory Networks' NodalCore
664
-    acceleration technology. Thanks to specialized Security Processing Unit
665
-    built into NodalCore C-Series accelerators it is possible to achieve more
666
-    performance than is possible by just adding general purpose CPUs.
667
-    Additionally, Sensory Networks' CorePAKT technology ensures that compiled
668
-    signature databases occupy a memory footprint smaller than any other
669
-    competing technology on the market - in many cases by up to 90\%. The
670
-    ability to store multiple databases in compressed format whilst still
671
-    achieving high throughputs makes NodalCore ideal for applications
672
-    demanding high performance on large signature databases such as ClamAV.\\
673
-    For more information please visit \url{http://www.clamav.net/nodalcore/}
674
-
675 662
     \subsection{API}
676 663
 
677 664
     \subsubsection{Header file}
... ...
@@ -700,8 +687,6 @@ N * * * *	/usr/local/bin/freshclam --quiet
700 700
     \begin{itemize}
701 701
 	\item \textbf{CL\_DB\_STDOPT}\\
702 702
 	This is an alias for a recommended set of scan options.
703
-	\item \textbf{CL\_DB\_NCORE}\\
704
-	Initialize NodalCore and load the hardware database (if applicable).
705 703
 	\item \textbf{CL\_DB\_PHISHING}\\
706 704
 	Load phishing signatures.
707 705
 	\item \textbf{CL\_DB\_PHISHING\_URLS}\\
... ...
@@ -310,11 +310,6 @@ Mark archives as viruses (e.g RAR.ExceededFileSize, Zip.ExceededFilesLimit) if A
310 310
 .br 
311 311
 Default: no
312 312
 .TP 
313
-\fBNodalCoreAcceleration BOOL\fR
314
-Enable support for Sensory Networks' NodalCore hardware accelerator.
315
-.br
316
-Default: no
317
-.TP 
318 313
 \fBClamukoScanOnAccess BOOL\fR
319 314
 Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.
320 315
 .br 
... ...
@@ -134,6 +134,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
134 134
 PACKAGE_VERSION = @PACKAGE_VERSION@
135 135
 PATH_SEPARATOR = @PATH_SEPARATOR@
136 136
 RANLIB = @RANLIB@
137
+SED = @SED@
137 138
 SET_MAKE = @SET_MAKE@
138 139
 SHELL = @SHELL@
139 140
 STRIP = @STRIP@
... ...
@@ -314,10 +314,6 @@ LocalSocket /tmp/clamd.socket
314 314
 # Default: no
315 315
 #ArchiveBlockMax no
316 316
 
317
-# Enable support for Sensory Networks' NodalCore hardware accelerator.
318
-# Default: no
319
-#NodalCoreAcceleration yes
320
-
321 317
 
322 318
 ##
323 319
 ## Clamuko settings
... ...
@@ -160,6 +160,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
160 160
 PACKAGE_VERSION = @PACKAGE_VERSION@
161 161
 PATH_SEPARATOR = @PATH_SEPARATOR@
162 162
 RANLIB = @RANLIB@
163
+SED = @SED@
163 164
 SET_MAKE = @SET_MAKE@
164 165
 SHELL = @SHELL@
165 166
 STRIP = @STRIP@
... ...
@@ -31,8 +31,6 @@ libclamav_la_SOURCES = \
31 31
         matcher-ac.h \
32 32
         matcher-bm.c \
33 33
         matcher-bm.h \
34
-	matcher-ncore.c \
35
-	matcher-ncore.h \
36 34
         matcher.c \
37 35
         matcher.h \
38 36
         md5.c \
... ...
@@ -77,13 +77,13 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
77 77
 libLTLIBRARIES_INSTALL = $(INSTALL)
78 78
 LTLIBRARIES = $(lib_LTLIBRARIES)
79 79
 libclamav_la_DEPENDENCIES =
80
-am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher-ncore.lo \
81
-	matcher.lo md5.lo others.lo readdb.lo cvd.lo dsig.lo str.lo \
82
-	scanners.lo filetypes.lo rtf.lo blob.lo mbox.lo message.lo \
83
-	snprintf.lo table.lo text.lo ole2_extract.lo vba_extract.lo \
84
-	msexpand.lo pe.lo upx.lo htmlnorm.lo chmunpack.lo rebuildpe.lo \
85
-	petite.lo wwunpack.lo unsp.lo aspack.lo packlibs.lo fsg.lo \
86
-	mew.lo upack.lo line.lo untar.lo unzip.lo special.lo binhex.lo \
80
+am_libclamav_la_OBJECTS = matcher-ac.lo matcher-bm.lo matcher.lo \
81
+	md5.lo others.lo readdb.lo cvd.lo dsig.lo str.lo scanners.lo \
82
+	filetypes.lo rtf.lo blob.lo mbox.lo message.lo snprintf.lo \
83
+	table.lo text.lo ole2_extract.lo vba_extract.lo msexpand.lo \
84
+	pe.lo upx.lo htmlnorm.lo chmunpack.lo rebuildpe.lo petite.lo \
85
+	wwunpack.lo unsp.lo aspack.lo packlibs.lo fsg.lo mew.lo \
86
+	upack.lo line.lo untar.lo unzip.lo special.lo binhex.lo \
87 87
 	is_tar.lo tnef.lo unrar15.lo unrarvm.lo unrar.lo \
88 88
 	unrarfilter.lo unrarppm.lo unrar20.lo unrarcmd.lo unarj.lo \
89 89
 	LZMADecode.lo bzlib.lo infblock.lo nulsft.lo pdf.lo spin.lo \
... ...
@@ -177,6 +177,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
177 177
 PACKAGE_VERSION = @PACKAGE_VERSION@
178 178
 PATH_SEPARATOR = @PATH_SEPARATOR@
179 179
 RANLIB = @RANLIB@
180
+SED = @SED@
180 181
 SET_MAKE = @SET_MAKE@
181 182
 SHELL = @SHELL@
182 183
 STRIP = @STRIP@
... ...
@@ -245,8 +246,6 @@ libclamav_la_SOURCES = \
245 245
         matcher-ac.h \
246 246
         matcher-bm.c \
247 247
         matcher-bm.h \
248
-	matcher-ncore.c \
249
-	matcher-ncore.h \
250 248
         matcher.c \
251 249
         matcher.h \
252 250
         md5.c \
... ...
@@ -486,7 +485,6 @@ distclean-compile:
486 486
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lockdb.Plo@am__quote@
487 487
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matcher-ac.Plo@am__quote@
488 488
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matcher-bm.Plo@am__quote@
489
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matcher-ncore.Plo@am__quote@
490 489
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matcher.Plo@am__quote@
491 490
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbox.Plo@am__quote@
492 491
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
... ...
@@ -64,13 +64,7 @@ extern "C"
64 64
 #define CL_ELOCKDB	-126 /* can't lock DB directory */
65 65
 #define CL_EARJ         -127 /* ARJ handler error */
66 66
 
67
-/* NodalCore */
68
-#define CL_ENCINIT	-200 /* NodalCore initialization failed */
69
-#define	CL_ENCLOAD	-201 /* error loading NodalCore database */
70
-#define CL_ENCIO	-202 /* general NodalCore I/O error */
71
-
72 67
 /* db options */
73
-#define CL_DB_NCORE	    0x1
74 68
 #define CL_DB_PHISHING	    0x2
75 69
 #define CL_DB_ACONLY	    0x4 /* WARNING: only for developers */
76 70
 #define CL_DB_PHISHING_URLS 0x8
... ...
@@ -111,7 +105,6 @@ extern "C"
111 111
 
112 112
 struct cl_engine {
113 113
     unsigned int refcount; /* reference counter */
114
-    unsigned short ncore;
115 114
     unsigned short sdb;
116 115
     unsigned int dboptions;
117 116
 
... ...
@@ -130,9 +123,6 @@ struct cl_engine {
130 130
     /* RAR metadata */
131 131
     void *rar_mlist;
132 132
 
133
-    /* NodalCore database handle */
134
-    void *ncdb;
135
-
136 133
     /* Phishing .pdb and .wdb databases*/
137 134
     void *whitelist_matcher;
138 135
     void *domainlist_matcher;
139 136
deleted file mode 100644
... ...
@@ -1,606 +0,0 @@
1
-/*
2
- *  Copyright (C) 2006 Sensory Networks, Inc.
3
- *	      Written by Tomasz Kojm, dlopen() support by Peter Duthie
4
- *
5
- *  This program is free software; you can redistribute it and/or modify
6
- *  it under the terms of the GNU General Public License version 2 as
7
- *  published by the Free Software Foundation.
8
- *
9
- *  This program is distributed in the hope that it will be useful,
10
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
- *  GNU General Public License for more details.
13
- *
14
- *  You should have received a copy of the GNU General Public License
15
- *  along with this program; if not, write to the Free Software
16
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
- *  MA 02110-1301, USA.
18
- */
19
-
20
-#if HAVE_CONFIG_H
21
-#include "clamav-config.h"
22
-#endif
23
-
24
-#ifdef HAVE_NCORE
25
-
26
-#include <stdio.h>
27
-#include <stdlib.h>
28
-#ifdef	HAVE_UNISTD_H
29
-#include <unistd.h>
30
-#endif
31
-#include <string.h>
32
-#include <sys/types.h>
33
-#include <sys/stat.h>
34
-#include <fcntl.h>
35
-#include <ctype.h>
36
-#ifdef HAVE_NCORE
37
-#include <dlfcn.h>
38
-#endif
39
-
40
-#include "clamav.h"
41
-#include "matcher.h"
42
-#include "cltypes.h"
43
-#include "md5.h"
44
-#include "readdb.h"
45
-#include "str.h"
46
-#include "matcher-ncore.h"
47
-
48
-#define HWBUFFSIZE 32768
49
-
50
-/* Globals */
51
-static void *g_ncore_dllhandle = 0;
52
-static const char *g_ncore_dllpath = "/usr/lib/libsn_sigscan.so";
53
-
54
-/* Function pointer types */
55
-typedef int (*sn_sigscan_initdb_t)(void **);
56
-typedef int (*sn_sigscan_loaddb_t)(void *dbhandle, const char *filename,
57
-        int devicenum, unsigned int *count);
58
-typedef int (*sn_sigscan_load2dbs_t)(void *dbhandle, const char *baseFilename,
59
-        const char *incrFilename, int devicenum, unsigned int *count);
60
-typedef int (*sn_sigscan_closedb_t)(void *dbhandle);
61
-typedef int (*sn_sigscan_createstream_t)(void *dbhandle,
62
-        const uint32_t *dbMaskData, unsigned int dbMaskWords,
63
-        void **streamhandle);
64
-typedef int (*sn_sigscan_writestream_t)(void *streamhandle, const char *buffer,
65
-        unsigned int len);
66
-typedef int (*sn_sigscan_closestream_t)(void *streamhandle,
67
-        void **resulthandle);
68
-typedef int (*sn_sigscan_resultcount_t)(void *resulthandle);
69
-typedef int (*sn_sigscan_resultget_name_t)(void *resulthandle,
70
-        unsigned int index, const char **matchname);
71
-typedef int (*sn_sigscan_resultget_startoffset_t)(void *resulthandle,
72
-        unsigned int index, unsigned long long *startoffset);
73
-typedef int (*sn_sigscan_resultget_endoffset_t)(void *resulthandle,
74
-        unsigned int index, unsigned long long *endoffset);
75
-typedef int (*sn_sigscan_resultget_targettype_t)(void *resulthandle,
76
-        unsigned int index, int *targettype);
77
-typedef int (*sn_sigscan_resultget_offsetstring_t)(void *resulthandle,
78
-        unsigned int index, const char **offsetstring);
79
-typedef int (*sn_sigscan_resultget_extradata_t)(void *resulthandle,
80
-        unsigned int index, const char **optionalsigdata);
81
-typedef int (*sn_sigscan_resultfree_t)(void *resulthandle);
82
-typedef void (*sn_sigscan_error_function_t)(const char *msg);
83
-typedef int (*sn_sigscan_seterrorlogger_t)(sn_sigscan_error_function_t errfn);
84
-
85
-/* Function pointer values */
86
-sn_sigscan_initdb_t sn_sigscan_initdb_f = 0;
87
-sn_sigscan_loaddb_t sn_sigscan_loaddb_f = 0;
88
-sn_sigscan_load2dbs_t sn_sigscan_load2dbs_f = 0;
89
-sn_sigscan_closedb_t sn_sigscan_closedb_f = 0;
90
-sn_sigscan_createstream_t sn_sigscan_createstream_f = 0;
91
-sn_sigscan_writestream_t sn_sigscan_writestream_f = 0;
92
-sn_sigscan_closestream_t sn_sigscan_closestream_f = 0;
93
-sn_sigscan_resultcount_t sn_sigscan_resultcount_f = 0;
94
-sn_sigscan_resultget_name_t sn_sigscan_resultget_name_f = 0;
95
-sn_sigscan_resultget_startoffset_t sn_sigscan_resultget_startoffset_f = 0;
96
-sn_sigscan_resultget_endoffset_t sn_sigscan_resultget_endoffset_f = 0;
97
-sn_sigscan_resultget_targettype_t sn_sigscan_resultget_targettype_f = 0;
98
-sn_sigscan_resultget_offsetstring_t sn_sigscan_resultget_offsetstring_f = 0;
99
-sn_sigscan_resultget_extradata_t sn_sigscan_resultget_extradata_f = 0;
100
-sn_sigscan_resultfree_t sn_sigscan_resultfree_f = 0;
101
-sn_sigscan_seterrorlogger_t sn_sigscan_seterrorlogger_f = 0;
102
-
103
-static int cli_ncore_dlinit()
104
-{
105
-    if(access(g_ncore_dllpath, R_OK) == -1) {
106
-	cli_dbgmsg("cli_ncore_dlinit: Can't access %s\n", g_ncore_dllpath);
107
-	return CL_ENCINIT;
108
-    }
109
-
110
-    g_ncore_dllhandle = dlopen(g_ncore_dllpath, RTLD_NOW | RTLD_LOCAL);
111
-    if(!g_ncore_dllhandle) {
112
-	cli_dbgmsg("cli_ncore_dlinit: dlopen() failed for %s\n", g_ncore_dllpath);
113
-	return CL_ENCINIT;
114
-    }
115
-
116
-    /* get the symbols */
117
-    sn_sigscan_initdb_f = (sn_sigscan_initdb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_initdb");
118
-    sn_sigscan_loaddb_f = (sn_sigscan_loaddb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_loaddb");
119
-    sn_sigscan_load2dbs_f = (sn_sigscan_load2dbs_t)dlsym(g_ncore_dllhandle, "sn_sigscan_load2dbs");
120
-    sn_sigscan_closedb_f = (sn_sigscan_closedb_t)dlsym(g_ncore_dllhandle, "sn_sigscan_closedb");
121
-    sn_sigscan_createstream_f = (sn_sigscan_createstream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_createstream");
122
-    sn_sigscan_writestream_f = (sn_sigscan_writestream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_writestream");
123
-    sn_sigscan_closestream_f = (sn_sigscan_closestream_t)dlsym(g_ncore_dllhandle, "sn_sigscan_closestream");
124
-    sn_sigscan_resultcount_f = (sn_sigscan_resultcount_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultcount");
125
-    sn_sigscan_resultget_name_f = (sn_sigscan_resultget_name_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_name");
126
-    sn_sigscan_resultget_startoffset_f = (sn_sigscan_resultget_startoffset_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_startoffset");
127
-    sn_sigscan_resultget_endoffset_f = (sn_sigscan_resultget_endoffset_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_endoffset");
128
-    sn_sigscan_resultget_targettype_f = (sn_sigscan_resultget_targettype_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_targettype");
129
-    sn_sigscan_resultget_offsetstring_f = (sn_sigscan_resultget_offsetstring_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_offsetstring");
130
-    sn_sigscan_resultget_extradata_f = (sn_sigscan_resultget_extradata_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultget_extradata");
131
-    sn_sigscan_resultfree_f = (sn_sigscan_resultfree_t)dlsym(g_ncore_dllhandle, "sn_sigscan_resultfree");
132
-    sn_sigscan_seterrorlogger_f = (sn_sigscan_seterrorlogger_t)dlsym(g_ncore_dllhandle, "sn_sigscan_seterrorlogger");
133
-
134
-    /* Check that we got all the symbols */
135
-    if(sn_sigscan_initdb_f && sn_sigscan_loaddb_f && sn_sigscan_load2dbs_f &&
136
-            sn_sigscan_closedb_f && sn_sigscan_createstream_f &&
137
-            sn_sigscan_writestream_f && sn_sigscan_closestream_f &&
138
-            sn_sigscan_resultcount_f && sn_sigscan_resultget_name_f &&
139
-            sn_sigscan_resultget_startoffset_f &&
140
-            sn_sigscan_resultget_endoffset_f &&
141
-            sn_sigscan_resultget_targettype_f &&
142
-            sn_sigscan_resultget_offsetstring_f &&
143
-            sn_sigscan_resultget_extradata_f && sn_sigscan_resultfree_f &&
144
-            sn_sigscan_seterrorlogger_f)
145
-    {
146
-        return CL_SUCCESS;
147
-    }
148
-
149
-    dlclose(g_ncore_dllhandle);
150
-    g_ncore_dllhandle = 0;
151
-    return CL_ENCINIT;
152
-}
153
-
154
-int cli_ncore_scanbuff(const char *buffer, unsigned int length, const char **virname, const struct cl_engine *engine, unsigned short ftype, unsigned int *targettab)
155
-{
156
-	void *streamhandle;
157
-	void *resulthandle;
158
-	static const uint32_t datamask[2] = { 0xffffffff, 0xffffffff };
159
-	int count, hret, i;
160
-	char *pt;
161
-	int ret = CL_CLEAN;
162
-
163
-
164
-    /* TODO: Setup proper data bitmask (need specs) */
165
-    /* Create the hardware scanning stream */
166
-    hret = (*sn_sigscan_createstream_f)(engine->ncdb, datamask, 2, &streamhandle);
167
-    if(hret) {
168
-        cli_errmsg("cli_ncore_scanbuff: can't create new hardware stream: %d\n", hret);
169
-        return CL_ENCIO;
170
-    }
171
-
172
-    /* Write data to the hardware scanning stream */
173
-    hret = (*sn_sigscan_writestream_f)(streamhandle, buffer, length);
174
-    if(hret) {
175
-        cli_errmsg("cli_ncore_scanbuff: can't write %u bytes to hardware stream: %d\n", length, hret);
176
-        (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
177
-        (*sn_sigscan_resultfree_f)(resulthandle);
178
-        return CL_ENCIO;
179
-    }
180
-
181
-    /* Close the hardware scanning stream and collect the result */
182
-    hret = (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
183
-    if(hret) {
184
-        cli_errmsg("cli_ncore_scanbuff: can't close hardware stream: %d\n", hret);
185
-        return CL_ENCIO;
186
-    }
187
-
188
-    /* Iterate through the results */
189
-    count = (*sn_sigscan_resultcount_f)(resulthandle);
190
-    for(i = 0; i < count; i++) {
191
-        const char *matchname = NULL, *offsetstring = NULL, *optionalsigdata = NULL;
192
-        unsigned int targettype = 0;
193
-
194
-        /* Acquire the name of the result */
195
-        hret = (*sn_sigscan_resultget_name_f)(resulthandle, i, &matchname);
196
-        if(hret) {
197
-            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_name failed for result %u: %d\n", i, hret);
198
-            (*sn_sigscan_resultfree_f)(resulthandle);
199
-            return CL_ENCIO;
200
-        }
201
-        if(!matchname) {
202
-            cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: Signature without name\n", i);
203
-            (*sn_sigscan_resultfree_f)(resulthandle);
204
-            return CL_EMALFDB;
205
-        }
206
-
207
-        /* Acquire the result file type and check that it is correct */
208
-        hret = (*sn_sigscan_resultget_targettype_f)(resulthandle, i, &targettype);
209
-        if(hret) {
210
-            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_targettype failed for result %u, signature %s: %d\n", i, matchname, hret);
211
-            (*sn_sigscan_resultfree_f)(resulthandle);
212
-            return CL_ENCIO;
213
-        }
214
-
215
-        if(targettype && targettab[targettype] != ftype) {
216
-            cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Target type: %u, expected: %u\n", i, matchname, targettab[targettype], ftype);
217
-            continue;
218
-        }
219
-
220
-        hret = (*sn_sigscan_resultget_offsetstring_f)(resulthandle, i, &offsetstring);
221
-        if(hret) {
222
-            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_offsetstring failed for result %u, signature %s: %d\n", i, matchname, hret);
223
-            (*sn_sigscan_resultfree_f)(resulthandle);
224
-            return CL_ENCIO;
225
-        }
226
-        if(offsetstring) {
227
-            cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Offset based signature not supported in buffer mode\n", i, matchname);
228
-            continue;
229
-        }
230
-
231
-        hret = (*sn_sigscan_resultget_extradata_f)(resulthandle, i, &optionalsigdata);
232
-        if(hret) {
233
-            cli_errmsg("cli_ncore_scanbuff: sn_sigscan_resultget_extradata failed for result %u, signature %s: %d\n", i, matchname, hret);
234
-            (*sn_sigscan_resultfree_f)(resulthandle);
235
-            return CL_ENCIO;
236
-        }
237
-        if(optionalsigdata && strlen(optionalsigdata)) {
238
-            pt = cli_strtok(optionalsigdata, 1, ":");
239
-            if(pt) {
240
-                if(!isdigit(*pt)) {
241
-                    free(pt);
242
-                    cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
243
-                    (*sn_sigscan_resultfree_f)(resulthandle);
244
-                    return CL_EMALFDB;
245
-                }
246
-
247
-                if((unsigned int) atoi(pt) < cl_retflevel()) {
248
-                    cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Signature max flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
249
-                    free(pt);
250
-                    continue;
251
-                }
252
-
253
-                free(pt);
254
-                pt = cli_strtok(optionalsigdata, 0, ":");
255
-                if(pt) {
256
-                    if(!isdigit(*pt)) {
257
-                        free(pt);
258
-                        cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
259
-                        (*sn_sigscan_resultfree_f)(resulthandle);
260
-                        return CL_EMALFDB;
261
-                    }
262
-
263
-                    if((unsigned int) atoi(pt) > cl_retflevel()) {
264
-                        cli_dbgmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Signature required flevel: %u, current: %u\n", i, matchname, atoi(pt), cl_retflevel());
265
-                        free(pt);
266
-                        continue;
267
-                    }
268
-                    free(pt);
269
-                }
270
-
271
-            } else {
272
-                if(!isdigit(*optionalsigdata)) {
273
-                    cli_errmsg("cli_ncore_scanbuff: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
274
-                    (*sn_sigscan_resultfree_f)(resulthandle);
275
-                    return CL_EMALFDB;
276
-                }
277
-
278
-                if((unsigned int) atoi(optionalsigdata) > cl_retflevel()) {
279
-                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %u, current: %u\n", i, matchname, atoi(optionalsigdata), cl_retflevel());
280
-                    continue;
281
-                }
282
-            }
283
-        }
284
-
285
-        /* Store the name of the match */
286
-        *virname = matchname;
287
-        ret = CL_VIRUS;
288
-        break;
289
-    }
290
-
291
-    /* Clean up the result structure */
292
-    hret = (*sn_sigscan_resultfree_f)(resulthandle);
293
-    if(hret) {
294
-        cli_errmsg("cli_ncore_scanbuff: can't free results: %d\n", ret);
295
-        return CL_ENCIO;
296
-    }
297
-
298
-    return ret;
299
-}
300
-
301
-int cli_ncore_scandesc(int desc, cli_ctx *ctx, unsigned short ftype, int *cont, unsigned int *targettab, cli_md5_ctx *md5ctx)
302
-{
303
-	void *streamhandle;
304
-	void *resulthandle;
305
-	uint32_t datamask[2] = { 0xffffffff, 0xffffffff };
306
-	struct cli_target_info info;
307
-	int i, count, hret, bytes, ret = CL_CLEAN;
308
-	off_t origoff;
309
-	*cont = 0;
310
-	char *buffer;
311
-
312
-
313
-    /* TODO: Setup proper data bitmask (need specs) */
314
-    /* Create the hardware scanning stream */
315
-    hret = (*sn_sigscan_createstream_f)(ctx->engine->ncdb, datamask, 2, &streamhandle);
316
-    if(hret) {
317
-        cli_errmsg("cli_ncore_scandesc: can't create new hardware stream: %d\n", hret);
318
-        return CL_ENCIO;
319
-    }
320
-
321
-    /* Obtain the initial offset */
322
-    origoff = lseek(desc, 0, SEEK_CUR);
323
-    if(origoff == -1) {
324
-        cli_errmsg("cli_ncore_scandesc: lseek() failed for descriptor %d\n", desc);
325
-	(*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
326
-        (*sn_sigscan_resultfree_f)(resulthandle);
327
-        return CL_EIO;
328
-    }
329
-
330
-    buffer = (char *) cli_calloc(HWBUFFSIZE, sizeof(char));
331
-    if(!buffer) {
332
-        cli_dbgmsg("cli_ncore_scandesc: unable to cli_calloc(%u)\n", HWBUFFSIZE);
333
-	(*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
334
-        (*sn_sigscan_resultfree_f)(resulthandle);
335
-        return CL_EMEM;
336
-    }
337
-
338
-    /* Initialize the MD5 hasher */
339
-    if(ctx->engine->md5_hlist)
340
-        MD5_Init(md5ctx);
341
-
342
-    /* Read and scan the data */
343
-    while ((bytes = cli_readn(desc, buffer, HWBUFFSIZE)) > 0) {
344
-        hret = (*sn_sigscan_writestream_f)(streamhandle, buffer, bytes);
345
-        if(hret) {
346
-            cli_errmsg("cli_ncore_scandesc: can't write to hardware stream: %d\n", hret);
347
-            ret = CL_ENCIO;
348
-            break;
349
-        } else {
350
-            if(ctx->scanned)
351
-                *ctx->scanned += bytes / CL_COUNT_PRECISION;
352
- 
353
-    	    if(ctx->engine->md5_hlist)
354
-                MD5_Update(md5ctx, buffer, bytes);
355
-        }
356
-    }
357
-
358
-    free(buffer);
359
-
360
-    /* Close the stream and get the result */
361
-    hret = (*sn_sigscan_closestream_f)(streamhandle, &resulthandle);
362
-    if(hret) {
363
-        cli_errmsg("cli_ncore_scandesc: can't close hardware stream: %d\n", hret);
364
-        return CL_ENCIO;
365
-    }
366
-
367
-    memset(&info, 0, sizeof(info));
368
-
369
-    /* Iterate over the list of results */
370
-    count = (*sn_sigscan_resultcount_f)(resulthandle);
371
-    for(i = 0; i < count; i++) {
372
-    	const char *matchname = NULL, *offsetstring = NULL, *optionalsigdata = NULL;
373
-    	unsigned long long startoffset = 0;
374
-    	unsigned int targettype = 0, maxshift = 0;
375
-        char *pt;
376
-
377
-        /* Get the description of the match */
378
-        hret = (*sn_sigscan_resultget_name_f)(resulthandle, i, &matchname);
379
-        if(hret) {
380
-            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_name failed for result %u: %d\n", i, hret);
381
-            (*sn_sigscan_resultfree_f)(resulthandle);
382
-	    if(info.exeinfo.section)
383
-		free(info.exeinfo.section);
384
-            return CL_ENCIO;
385
-        }
386
-
387
-        if(!matchname) {
388
-            cli_errmsg("cli_ncore_scandesc: HW Result[%u]: Signature without name\n", i);
389
-            (*sn_sigscan_resultfree_f)(resulthandle);
390
-	    if(info.exeinfo.section)
391
-		free(info.exeinfo.section);
392
-            return CL_EMALFDB;
393
-        }
394
-
395
-        hret = (*sn_sigscan_resultget_targettype_f)(resulthandle, i, &targettype);
396
-        if(hret) {
397
-    	    cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_targettype failed for result %d, signature %s: %d\n", i, matchname, hret);
398
-    	    (*sn_sigscan_resultfree_f)(resulthandle);
399
-	    if(info.exeinfo.section)
400
-		free(info.exeinfo.section);
401
-    	    return CL_ENCIO;
402
-        }
403
-        if(targettype && targettab[targettype] != ftype) {
404
-    	    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Target type: %u, expected: %d\n", i, matchname, targettab[targettype], ftype);
405
-            continue;
406
-        }
407
-
408
-        hret = (*sn_sigscan_resultget_offsetstring_f)(resulthandle, i, &offsetstring);
409
-        if(hret) {
410
-            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_offsetstring failed for result %u, signature %s: %d\n", i, matchname, hret);
411
-            (*sn_sigscan_resultfree_f)(resulthandle);
412
-	    if(info.exeinfo.section)
413
-		free(info.exeinfo.section);
414
-            return CL_ENCIO;
415
-        }
416
-
417
-        hret = (*sn_sigscan_resultget_startoffset_f)(resulthandle, i, &startoffset);
418
-        if(hret) {
419
-    	    cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_startoffset failed for result %u, signature %s: %d\n", i, matchname, hret);
420
-    	    (*sn_sigscan_resultfree_f)(resulthandle);
421
-	    if(info.exeinfo.section)
422
-		free(info.exeinfo.section);
423
-    	    return CL_ENCIO;
424
-        }
425
-        if(offsetstring && strcmp(offsetstring, "*")) {
426
-	    off_t off = cli_caloff(offsetstring, &info, desc, ftype, &hret, &maxshift);
427
-
428
-    	    if(hret == -1) {
429
-                cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Bad offset in signature\n", i, matchname);
430
-                (*sn_sigscan_resultfree_f)(resulthandle);
431
-		if(info.exeinfo.section)
432
-		    free(info.exeinfo.section);
433
-                return CL_EMALFDB;
434
-            }
435
-	    if(maxshift) {
436
-		if((startoffset < (unsigned long long) off) || (startoffset > (unsigned long long) off + maxshift)) {
437
-		    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Virus offset: %Lu, expected: [%Lu..%Lu]\n", i, matchname, startoffset, off, off + maxshift);
438
-		    continue;
439
-		}
440
-	    } else if(startoffset != (unsigned long long) off) {
441
-                cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Virus offset: %Lu, expected: %Lu\n", i, matchname, startoffset, off);
442
-                continue;
443
-            }
444
-        }
445
-
446
-        hret = (*sn_sigscan_resultget_extradata_f)(resulthandle, i, &optionalsigdata);
447
-        if(hret) {
448
-            cli_errmsg("cli_ncore_scandesc: sn_sigscan_resultget_extradata failed for result %d, signature %s: %d\n", i, matchname, hret);
449
-            (*sn_sigscan_resultfree_f)(resulthandle);
450
-	    if(info.exeinfo.section)
451
-		free(info.exeinfo.section);
452
-            return CL_ENCIO;
453
-        }
454
-
455
-        if(optionalsigdata && strlen(optionalsigdata)) {
456
-    	    pt = cli_strtok(optionalsigdata, 1, ":");
457
-    	    if(pt) {
458
-    	        if(!isdigit(*pt)) {
459
-    		    free(pt);
460
-                    cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
461
-		    (*sn_sigscan_resultfree_f)(resulthandle);
462
-		    if(info.exeinfo.section)
463
-			free(info.exeinfo.section);
464
-                    return CL_EMALFDB;
465
-                }
466
-
467
-                if((unsigned int) atoi(pt) < cl_retflevel()) {
468
-                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature max flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
469
-                    free(pt);
470
-                    continue;
471
-                }
472
-
473
-                free(pt);
474
-
475
-    	        pt = cli_strtok(optionalsigdata, 0, ":");
476
-    	        if(pt) {
477
-                    if(!isdigit(*pt)) {
478
-                        free(pt);
479
-                        cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
480
-			(*sn_sigscan_resultfree_f)(resulthandle);
481
-			if(info.exeinfo.section)
482
-			    free(info.exeinfo.section);
483
-                        return CL_EMALFDB;
484
-                    }
485
-
486
-                    if((unsigned int) atoi(pt) > cl_retflevel()) {
487
-                        cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %d, current: %d\n", i, matchname, atoi(pt), cl_retflevel());
488
-                        free(pt);
489
-                        continue;
490
-                    }
491
-                    free(pt);
492
-                }
493
-            } else {
494
-                if(!isdigit(*optionalsigdata)) {
495
-                    cli_errmsg("cli_ncore_scandesc: HW Result[%u]: %s: Incorrect optional signature data: %s\n", i, matchname, optionalsigdata);
496
-                    (*sn_sigscan_resultfree_f)(resulthandle);
497
-		    if(info.exeinfo.section)
498
-			free(info.exeinfo.section);
499
-                    return CL_EMALFDB;
500
-                }
501
-
502
-                if((unsigned int) atoi(optionalsigdata) > cl_retflevel()) {
503
-                    cli_dbgmsg("cli_ncore_scandesc: HW Result[%u]: %s: Signature required flevel: %d, current: %d\n", i, matchname, atoi(optionalsigdata), cl_retflevel());
504
-                    continue;
505
-                }
506
-            }
507
-        }
508
-
509
-        *ctx->virname = matchname;
510
-        ret = CL_VIRUS;
511
-        break;
512
-    }
513
-
514
-    if(info.exeinfo.section)
515
-	free(info.exeinfo.section);
516
-
517
-    hret = (*sn_sigscan_resultfree_f)(resulthandle);
518
-    if(hret) {
519
-        cli_errmsg("cli_ncore_scandesc: can't free results: %d\n", ret);
520
-        return CL_ENCIO;
521
-    }
522
-
523
-    if(ctx->engine->md5_hlist) {
524
-        unsigned char digest[16];
525
-        struct cli_md5_node *md5_node;
526
-        MD5_Final(digest, md5ctx);
527
-
528
-        md5_node = cli_vermd5(digest, ctx->engine);
529
-        if(md5_node) {
530
-            struct stat sb;
531
-            if(fstat(desc, &sb) == -1)
532
-                return CL_EIO;
533
-
534
-    	    if((unsigned int) sb.st_size != md5_node->size) {
535
-                cli_warnmsg("Detected false positive MD5 match. Please report.\n");
536
-            } else {
537
-                if(md5_node->fp) {
538
-                    cli_dbgmsg("Eliminated false positive match (fp sig: %s)\n", md5_node->virname);
539
-                    ret = CL_CLEAN;
540
-                } else {
541
-                    if(ctx->virname)
542
-                        *ctx->virname = md5_node->virname;
543
-
544
-                    ret = CL_VIRUS;
545
-                }
546
-            }
547
-        }
548
-    }
549
-
550
-    if(ret == CL_VIRUS || (ftype != CL_TYPE_UNKNOWN_TEXT && ftype != CL_TYPE_UNKNOWN_DATA))
551
-        return ret;
552
-
553
-    if(lseek(desc, origoff, SEEK_SET) == -1) {
554
-        cli_errmsg("cli_ncore_scandesc: lseek() failed for descriptor %d\n", desc);
555
-        return CL_EIO;
556
-    }
557
-
558
-    *cont = 1;
559
-    return ret;
560
-}
561
-
562
-int cli_ncore_load(const char *filename, struct cl_engine **engine, unsigned int *signo, unsigned int options)
563
-{
564
-	int ret = 0;
565
-	unsigned int newsigs = 0;
566
-
567
-
568
-    if((ret = cli_initengine(engine, options))) {
569
-	cl_free(*engine);
570
-	return ret;
571
-    }
572
-
573
-    if((ret = cli_ncore_dlinit())) {
574
-	cl_free(*engine);
575
-	return ret;
576
-    }
577
-
578
-    ret = (*sn_sigscan_initdb_f)(&(*engine)->ncdb);
579
-    if(ret) {
580
-        cli_errmsg("cli_ncore_load: error initializing the matcher: %d\n", ret);
581
-        cl_free(*engine);
582
-        return CL_ENCINIT;
583
-    }
584
-
585
-    (*engine)->ncore = 1;
586
-
587
-    ret = (*sn_sigscan_loaddb_f)((*engine)->ncdb, filename, 0, &newsigs);
588
-    if(ret) {
589
-        cli_errmsg("cli_ncore_load: can't load hardware database: %d\n", ret);
590
-        cl_free(*engine);
591
-        return CL_ENCLOAD;
592
-    }
593
-
594
-    *signo += newsigs;
595
-    return CL_SUCCESS;
596
-}
597
-
598
-void cli_ncore_unload(struct cl_engine *engine)
599
-{
600
-	int ret;
601
-
602
-    ret = (*sn_sigscan_closedb_f)(engine->ncdb);
603
-    if(ret)
604
-        cli_errmsg("cl_free: can't close hardware database: %d\n", ret);
605
-}
606
-#endif
607 1
deleted file mode 100644
... ...
@@ -1,34 +0,0 @@
1
-/*
2
- *  Copyright (C) 2006 Sensory Networks, Inc.
3
- *	      Written by Tomasz Kojm, dlopen() support by Peter Duthie
4
- *
5
- *  This program is free software; you can redistribute it and/or modify
6
- *  it under the terms of the GNU General Public License version 2 as
7
- *  published by the Free Software Foundation.
8
- *
9
- *  This program is distributed in the hope that it will be useful,
10
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
- *  GNU General Public License for more details.
13
- *
14
- *  You should have received a copy of the GNU General Public License
15
- *  along with this program; if not, write to the Free Software
16
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17
- *  MA 02110-1301, USA.
18
- */
19
-
20
-#ifndef __MATCHER_NCORE_H
21
-#define __MATCHER_NCORE_H
22
-
23
-#include "clamav.h"
24
-#include "md5.h"
25
-
26
-int cli_ncore_scanbuff(const char *buffer, unsigned int length, const char **virname, const struct cl_engine *engine, unsigned short ftype, unsigned int *targettab);
27
-
28
-int cli_ncore_scandesc(int desc, cli_ctx *ctx, unsigned short ftype, int *cont, unsigned int *targettab, cli_md5_ctx *md5ctx);
29
-
30
-int cli_ncore_load(const char *filename, struct cl_engine **engine, unsigned int *signo, unsigned int options);
31
-
32
-void cli_ncore_unload(struct cl_engine *engine);
33
-
34
-#endif
... ...
@@ -42,10 +42,6 @@
42 42
 #include "str.h"
43 43
 #include "cltypes.h"
44 44
 
45
-#ifdef HAVE_NCORE
46
-#include "matcher-ncore.h"
47
-#endif
48
-
49 45
 static cli_file_t targettab[CL_TARGET_TABLE_SIZE] = { 0, CL_TYPE_MSEXE, CL_TYPE_MSOLE2, CL_TYPE_HTML, CL_TYPE_MAIL, CL_TYPE_GRAPHICS, CL_TYPE_ELF };
50 46
 
51 47
 int cli_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cl_engine *engine, cli_file_t ftype)
... ...
@@ -61,11 +57,6 @@ int cli_scanbuff(const unsigned char *buffer, uint32_t length, const char **virn
61 61
 	return CL_ENULLARG;
62 62
     }
63 63
 
64
-#ifdef HAVE_NCORE
65
-    if(engine->ncore)
66
-	return cli_ncore_scanbuff(buffer, length, virname, engine, ftype, targettab);
67
-#endif
68
-
69 64
     groot = engine->root[0]; /* generic signatures */
70 65
 
71 66
     if(ftype) {
... ...
@@ -301,16 +292,6 @@ int cli_scandesc(int desc, cli_ctx *ctx, uint8_t otfrec, cli_file_t ftype, uint8
301 301
 	return CL_ENULLARG;
302 302
     }
303 303
 
304
-#ifdef HAVE_NCORE
305
-    if(ctx->engine->ncore) {
306
-	    int cont;
307
-
308
-	ret = cli_ncore_scandesc(desc, ctx, ftype, &cont, targettab, &md5ctx);
309
-	if(!cont)
310
-	    return ret;
311
-    }
312
-#endif
313
-
314 304
     if(!ftonly)
315 305
 	groot = ctx->engine->root[0]; /* generic signatures */
316 306
 
... ...
@@ -186,12 +186,6 @@ const char *cl_strerror(int clerror)
186 186
 	    return "Bad format or broken data";
187 187
 	case CL_ESUPPORT:
188 188
 	    return "Not supported data format";
189
-	case CL_ENCINIT:
190
-	    return "NodalCore initialization failure";
191
-	case CL_ENCLOAD:
192
-	    return "Error loading NodalCore database";
193
-	case CL_ENCIO:
194
-	    return "NodalCore accelerator Input/Output error";
195 189
 	case CL_ELOCKDB:
196 190
 	    return "Unable to lock database directory";
197 191
 	case CL_EARJ:
... ...
@@ -70,10 +70,6 @@
70 70
 static pthread_mutex_t cli_ref_mutex = PTHREAD_MUTEX_INITIALIZER;
71 71
 #endif
72 72
 
73
-#ifdef HAVE_NCORE
74
-#include "matcher-ncore.h"
75
-#endif
76
-
77 73
 /* Prototypes for old public functions just to shut up some gcc warnings;
78 74
  * to be removed in 1.0
79 75
  */
... ...
@@ -964,10 +960,7 @@ static int cli_load(const char *filename, struct cl_engine **engine, unsigned in
964 964
     }
965 965
 
966 966
     if(cli_strbcasestr(filename, ".db")) {
967
-	if(options & CL_DB_NCORE)
968
-	    skipped = 1;
969
-	else
970
-	    ret = cli_loaddb(fd, engine, signo, options);
967
+	ret = cli_loaddb(fd, engine, signo, options);
971 968
 
972 969
     } else if(cli_strbcasestr(filename, ".cvd")) {
973 970
 	    int warn = 0;
... ...
@@ -999,23 +992,16 @@ static int cli_load(const char *filename, struct cl_engine **engine, unsigned in
999 999
 	    skipped = 1;
1000 1000
 
1001 1001
     } else if(cli_strbcasestr(filename, ".ndb")) {
1002
-	if(options & CL_DB_NCORE)
1003
-	    skipped = 1;
1004
-	else
1005
-	    ret = cli_loadndb(fd, engine, signo, 0, options);
1002
+	ret = cli_loadndb(fd, engine, signo, 0, options);
1006 1003
 
1007 1004
     } else if(cli_strbcasestr(filename, ".ndu")) {
1008
-	if(!(options & CL_DB_PUA) || (options & CL_DB_NCORE))
1005
+	if(!(options & CL_DB_PUA))
1009 1006
 	    skipped = 1;
1010 1007
 	else
1011 1008
 	    ret = cli_loadndb(fd, engine, signo, 0, options);
1012 1009
 
1013 1010
     } else if(cli_strbcasestr(filename, ".sdb")) {
1014
-	/* FIXME: Add support in ncore mode */
1015
-	if(options & CL_DB_NCORE)
1016
-	    skipped = 1;
1017
-	else
1018
-	    ret = cli_loadndb(fd, engine, signo, 1, options);
1011
+	ret = cli_loadndb(fd, engine, signo, 1, options);
1019 1012
 
1020 1013
     } else if(cli_strbcasestr(filename, ".zmd")) {
1021 1014
 	ret = cli_loadmd(fd, engine, signo, 1, options);
... ...
@@ -1026,13 +1012,6 @@ static int cli_load(const char *filename, struct cl_engine **engine, unsigned in
1026 1026
     } else if(cli_strbcasestr(filename, ".cfg")) {
1027 1027
 	ret = cli_dconf_load(fd, engine, options);
1028 1028
 
1029
-    } else if(cli_strbcasestr(filename, ".ncdb")) {
1030
-#ifdef HAVE_NCORE
1031
-	if(options & CL_DB_NCORE)
1032
-	    ret = cli_ncore_load(filename, engine, signo, options);
1033
-	else
1034
-#endif
1035
-	    skipped = 1;
1036 1029
     } else if(cli_strbcasestr(filename, ".wdb")) {
1037 1030
 	if(options & CL_DB_PHISHING_URLS)
1038 1031
 	    ret = cli_loadwdb(fd, engine, options);
... ...
@@ -1127,7 +1106,6 @@ static int cli_loaddbdir_l(const char *dirname, struct cl_engine **engine, unsig
1127 1127
 	     cli_strbcasestr(dent->d_name, ".rmd")  ||
1128 1128
 	     cli_strbcasestr(dent->d_name, ".pdb")  ||
1129 1129
 	     cli_strbcasestr(dent->d_name, ".wdb")  ||
1130
-	     cli_strbcasestr(dent->d_name, ".ncdb") ||
1131 1130
 	     cli_strbcasestr(dent->d_name, ".inc")  ||
1132 1131
 	     cli_strbcasestr(dent->d_name, ".cvd"))) {
1133 1132
 
... ...
@@ -1285,7 +1263,6 @@ int cl_statinidir(const char *dirname, struct cl_stat *dbstat)
1285 1285
 	    cli_strbcasestr(dent->d_name, ".cfg")  ||
1286 1286
 	    cli_strbcasestr(dent->d_name, ".pdb")  ||
1287 1287
 	    cli_strbcasestr(dent->d_name, ".wdb")  ||
1288
-	    cli_strbcasestr(dent->d_name, ".ncdb")  ||
1289 1288
 	    cli_strbcasestr(dent->d_name, ".inc")   ||
1290 1289
 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
1291 1290
 
... ...
@@ -1396,7 +1373,6 @@ int cl_statchkdir(const struct cl_stat *dbstat)
1396 1396
 	    cli_strbcasestr(dent->d_name, ".cfg")  ||
1397 1397
 	    cli_strbcasestr(dent->d_name, ".pdb")  ||
1398 1398
 	    cli_strbcasestr(dent->d_name, ".wdb")  ||
1399
-	    cli_strbcasestr(dent->d_name, ".ncdb")  ||
1400 1399
 	    cli_strbcasestr(dent->d_name, ".inc")   ||
1401 1400
 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
1402 1401
 
... ...
@@ -1509,11 +1485,6 @@ void cl_free(struct cl_engine *engine)
1509 1509
     pthread_mutex_unlock(&cli_ref_mutex);
1510 1510
 #endif
1511 1511
 
1512
-#ifdef HAVE_NCORE
1513
-    if(engine->ncore)
1514
-	cli_ncore_unload(engine);
1515
-#endif
1516
-
1517 1512
     if(engine->root) {
1518 1513
 	for(i = 0; i < CL_TARGET_TABLE_SIZE; i++) {
1519 1514
 	    if((root = engine->root[i])) {
... ...
@@ -91,7 +91,6 @@ struct cfgoption cfg_options[] = {
91 91
     {"AllowSupplementaryGroups", OPT_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM},
92 92
     {"SelfCheck", OPT_NUM, 1800, NULL, 0, OPT_CLAMD},
93 93
     {"VirusEvent", OPT_FULLSTR, -1, NULL, 0, OPT_CLAMD},
94
-    {"NodalCoreAcceleration", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
95 94
     {"ClamukoScanOnAccess", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
96 95
     {"ClamukoScanOnOpen", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
97 96
     {"ClamukoScanOnClose", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
... ...
@@ -159,6 +159,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
159 159
 PACKAGE_VERSION = @PACKAGE_VERSION@
160 160
 PATH_SEPARATOR = @PATH_SEPARATOR@
161 161
 RANLIB = @RANLIB@
162
+SED = @SED@
162 163
 SET_MAKE = @SET_MAKE@
163 164
 SHELL = @SHELL@
164 165
 STRIP = @STRIP@