"Fossies" - the Fresh Open Source Software Archive

Member "clamav-0.102.3/m4/acinclude.m4" (12 May 2020, 30527 Bytes) of package /linux/misc/clamav-0.102.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl @synopsis AC_CREATE_TARGET_H [(HEADER-FILE [,PREFIX)]
    2 dnl
    3 dnl create the header-file and let it contain '#defines'
    4 dnl for the target platform. This macro is used for libraries
    5 dnl that have platform-specific quirks. Instead of inventing a
    6 dnl target-specific target.h.in files, just let it create a
    7 dnl header file from the definitions of AC_CANONICAL_SYSTEM
    8 dnl and put only ifdef's in the installed header-files.
    9 dnl
   10 dnl if the HEADER-FILE is absent, [target.h] is used.
   11 dnl if the PREFIX is absent, [TARGET] is used. 
   12 dnl the prefix can be the packagename. (y:a-z-:A-Z_:)
   13 dnl
   14 dnl the defines look like...
   15 dnl
   16 dnl #ifndef TARGET_CPU_M68K
   17 dnl #define TARGET_CPU_M68K "m68k"
   18 dnl #endif
   19 dnl
   20 dnl #ifndef TARGET_OS_LINUX
   21 dnl #define TARGET_OS_LINUX "linux-gnu"
   22 dnl #endif
   23 dnl
   24 dnl #ifndef TARGET_OS_TYPE                     /* the string itself */
   25 dnl #define TARGET_OS_TYPE "linux-gnu"
   26 dnl #endif
   27 dnl 
   28 dnl detail:  in the case of hppa1.1, the three idents "hppa1_1" "hppa1" 
   29 dnl and "hppa"  are derived, for an m68k it just two, "m68k" and "m"
   30 dnl
   31 dnl the CREATE_TARGET_H__ variant is almost the same function, but everything 
   32 dnl is lowercased instead of uppercased, and there is a "__" in front of
   33 dnl each prefix, so it looks like...
   34 dnl 
   35 dnl #ifndef __target_os_linux
   36 dnl #define __target_os_linux "linux-gnulibc2"
   37 dnl #endif
   38 dnl
   39 dnl #ifndef __target_os__                     /* the string itself */
   40 dnl #define __target_os__ "linux-gnulibc2"
   41 dnl #endif
   42 dnl
   43 dnl #ifndef __target_cpu_i586
   44 dnl #define __target_cpu_i586 "i586"
   45 dnl #endif
   46 dnl
   47 dnl #ifndef __target_arch_i386                
   48 dnl #define __target_arch_i386 "i386"
   49 dnl #endif
   50 dnl
   51 dnl #ifndef __target_arch__                   /* cpu family arch */
   52 dnl #define __target_arch__ "i386"
   53 dnl #endif
   54 dnl
   55 dnl other differences: the default string-define is "__" insteadof "_TYPE" 
   56 dnl
   57 dnl personally I prefer the second variant (which had been the first in
   58 dnl the devprocess of this file but I assume people will often fallback
   59 dnl to the primary variant presented herein).
   60 dnl
   61 dnl NOTE: CREATE_TARGET_H does also fill HOST_OS-defines
   62 dnl functionality has been split over functions called CREATE_TARGET_H_UPPER 
   63 dnl CREATE_TARGET_H_LOWER CREATE_TARGET_HOST_UPPER CREATE_TARGET_HOST_LOWER
   64 dnl CREATE_TARGET_H  uses CREATE_TARGET_H_UPPER    CREATE_TARGET_HOST_UPPER
   65 dnl CREATE_TARGET_H_ uses CREATE_TARGET_H_LOWER    CREATE_TARGET_HOST_LOWER
   66 dnl
   67 dnl there is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for
   68 dnl PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever created
   69 dnl (the prefix is a bit different, since we add an extra -target- and -host-)
   70 dnl 
   71 dnl @version: $Id: acinclude.m4,v 1.8 2006/12/22 19:45:32 acab Exp $
   72 dnl @author Guido Draheim <guidod@gmx.de>                 STATUS: used often
   73 
   74 AC_DEFUN([AC_CREATE_TARGET_H],
   75 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
   76 AC_CREATE_TARGET_H_UPPER($1,$2)
   77 AC_CREATE_TARGET_HOST_UPPER($1,$2)
   78 ])
   79 
   80 AC_DEFUN([AC_CREATE_TARGET_OS_H],
   81 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
   82 AC_CREATE_TARGET_H_LOWER($1,$2)
   83 AC_CREATE_TARGET_HOST_LOWER($1,$2)
   84 ])
   85 
   86 AC_DEFUN([AC_CREATE_TARGET_H__],
   87 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
   88 AC_CREATE_TARGET_H_LOWER($1,$2)
   89 AC_CREATE_TARGET_HOST_LOWER($1,$2)
   90 ])
   91 
   92 dnl [(OUT-FILE [, PREFIX])]  defaults: PREFIX=$PACKAGE OUTFILE=$PREFIX-target.h
   93 AC_DEFUN([AC_CREATE_PREFIX_TARGET_H],[dnl
   94 ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
   95 ac_prefix_conf_OUT=`echo ifelse($1, , $ac_prefix_conf_PKG-target.h, $1)`
   96 ac_prefix_conf_PRE=`echo $ac_prefix_conf_PKG-target | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:'`
   97 AC_CREATE_TARGET_H_UPPER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
   98 ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-host | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:'`
   99 AC_CREATE_TARGET_HOST_UPPER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
  100 ])
  101 
  102 dnl [(OUT-FILE[, PREFIX])]  defaults: PREFIX=$PACKAGE OUTFILE=$PREFIX-target.h
  103 AC_DEFUN([AC_CREATE_PREFIX_TARGET_H_],[dnl
  104 ac_prefix_conf_PKG=`echo ifelse($2, , $PACKAGE, $2)`
  105 ac_prefix_conf_OUT=`echo ifelse($1, , $ac_prefix_conf_PKG-target.h, $1)`
  106 ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-target | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
  107 AC_CREATE_TARGET_H_LOWER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
  108 ac_prefix_conf_PRE=`echo __$ac_prefix_conf_PKG-host | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:'`
  109 AC_CREATE_TARGET_HOST_LOWER($ac_prefix_conf_PRE,$ac_perfix_conf_OUT)
  110 ])
  111 
  112 AC_DEFUN([AC_CREATE_TARGET_H_FILE],[dnl
  113 ac_need_target_h_file_new=true
  114 ])
  115 
  116 AC_DEFUN([AC_CREATE_TARGET_H_UPPER],
  117 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
  118 AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
  119 changequote({, })dnl
  120 ac_need_target_h_file=ifelse($1, , target.h, $1)
  121 ac_need_target_h_prefix=`echo ifelse($2, , target, $2) | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e 's:[^A-Z0-9_]::g'`
  122 #
  123 target_os0=`echo "$target_os"  | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
  124 target_os1=`echo "$target_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
  125 target_os2=`echo "$target_os0" | sed -e 's:\([^_]*\).*:\1:' `
  126 target_os3=`echo "$target_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
  127 #
  128 target_cpu0=`echo "$target_cpu"  | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
  129 target_cpu1=`echo "$target_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
  130 target_cpu2=`echo "$target_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
  131 target_cpu3=`echo "$target_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
  132 #
  133 target_cpu_arch0=`echo "$target_cpu_arch" | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:'`
  134 #
  135 changequote([, ])dnl
  136 #
  137 if $ac_need_target_h_file_new ; then
  138 AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
  139 echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
  140 echo /'*' on `date` '*'/ >>$ac_need_target_h_file
  141 ac_need_target_h_file_new=false
  142 fi
  143 echo /'*' target uppercase defines '*'/ >>$ac_need_target_h_file
  144 dnl
  145 old1=""
  146 old2=""
  147 for i in $target_os0 $target_os1 $target_os2 $target_os3 "TYPE"
  148 do
  149   if test "$old1" != "$i"; then
  150   if test "$old2" != "$i"; then
  151    echo " " >>$ac_need_target_h_file
  152    echo "#ifndef "$ac_need_target_h_prefix"_OS_"$i >>$ac_need_target_h_file
  153    echo "#define "$ac_need_target_h_prefix"_OS_"$i '"'"$target_os"'"' >>$ac_need_target_h_file
  154    echo "#endif" >>$ac_need_target_h_file
  155   fi
  156   fi
  157   old2="$old1"
  158   old1="$i"
  159 done
  160 #
  161 old1=""
  162 old2=""
  163 for i in $target_cpu0 $target_cpu1 $target_cpu2 $target_cpu3 "TYPE" 
  164 do
  165   if test "$old1" != "$i"; then
  166   if test "$old2" != "$i"; then
  167    echo " " >>$ac_need_target_h_file
  168    echo "#ifndef "$ac_need_target_h_prefix"_CPU_"$i >>$ac_need_target_h_file
  169    echo "#define "$ac_need_target_h_prefix"_CPU_"$i '"'"$target_cpu"'"' >>$ac_need_target_h_file
  170    echo "#endif" >>$ac_need_target_h_file
  171   fi
  172   fi
  173   old2="$old1"
  174   old1="$i"
  175 done
  176 #
  177 old1=""
  178 old2=""
  179 for i in $target_cpu_arch0 "TYPE" 
  180 do
  181   if test "$old1" != "$i"; then
  182   if test "$old2" != "$i"; then
  183    echo " " >>$ac_need_target_h_file
  184    echo "#ifndef "$ac_need_target_h_prefix"_ARCH_"$i >>$ac_need_target_h_file
  185    echo "#define "$ac_need_target_h_prefix"_ARCH_"$i '"'"$target_cpu_arch"'"' >>$ac_need_target_h_file
  186    echo "#endif" >>$ac_need_target_h_file
  187   fi
  188   fi
  189   old2="$old1"
  190   old1="$i"
  191 done
  192 ])
  193 
  194 dnl
  195 dnl ... the lowercase variant ...
  196 dnl
  197 AC_DEFUN([AC_CREATE_TARGET_H_LOWER],
  198 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
  199 AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
  200 changequote({, })dnl
  201 ac_need_target_h_file=`echo ifelse($1, , target-os.h, $1)`
  202 ac_need_target_h_prefix=`echo ifelse($2, , target, $2) | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:' -e 's:[^a-z0-9_]::g'`
  203 #
  204 target_os0=`echo "$target_os"  | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
  205 target_os1=`echo "$target_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
  206 target_os2=`echo "$target_os0" | sed -e 's:\([^_]*\).*:\1:' `
  207 target_os3=`echo "$target_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
  208 #
  209 target_cpu0=`echo "$target_cpu"  | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
  210 target_cpu1=`echo "$target_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
  211 target_cpu2=`echo "$target_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
  212 target_cpu3=`echo "$target_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
  213 #
  214 target_cpu_arch0=`echo "$target_cpu_arch" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ:abcdefghijklmnopqrstuvwxyz:'`
  215 #
  216 changequote([, ])dnl
  217 #
  218 if $ac_need_target_h_file_new ; then
  219 AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
  220 echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
  221 echo /'*' on `date` '*'/ >>$ac_need_target_h_file
  222 ac_need_target_h_file_new=false
  223 fi
  224 echo /'*' target lowercase defines '*'/ >>$ac_need_target_h_file
  225 dnl
  226 old1=""
  227 old2=""
  228 for i in $target_os0 $target_os1 $target_os2 $target_os3 "_"; 
  229 do
  230   if test "$old1" != "$i"; then
  231   if test "$old2" != "$i"; then
  232    echo " " >>$ac_need_target_h_file
  233    echo "#ifndef __"$ac_need_target_h_prefix"_os_"$i >>$ac_need_target_h_file
  234    echo "#define __"$ac_need_target_h_prefix"_os_"$i '"'"$target_os"'"' >>$ac_need_target_h_file
  235    echo "#endif" >>$ac_need_target_h_file
  236   fi
  237   fi
  238   old2="$old1"
  239   old1="$i"
  240 done
  241 #
  242 old1=""
  243 old2=""
  244 for i in $target_cpu0 $target_cpu1 $target_cpu2 $target_cpu3 "_" 
  245 do
  246   if test "$old1" != "$i"; then
  247   if test "$old2" != "$i"; then
  248    echo " " >>$ac_need_target_h_file
  249    echo "#ifndef __"$ac_need_target_h_prefix"_cpu_"$i >>$ac_need_target_h_file
  250    echo "#define __"$ac_need_target_h_prefix"_cpu_"$i '"'"$target_cpu"'"' >>$ac_need_target_h_file
  251    echo "#endif" >>$ac_need_target_h_file
  252   fi
  253   fi
  254   old2="$old1"
  255   old1="$i"
  256 done
  257 #
  258 old1=""
  259 old2=""
  260 for i in $target_cpu_arch0 "_" 
  261 do
  262   if test "$old1" != "$i"; then
  263   if test "$old2" != "$i"; then
  264    echo " " >>$ac_need_target_h_file
  265    echo "#ifndef __"$ac_need_target_h_prefix"_arch_"$i >>$ac_need_target_h_file
  266    echo "#define __"$ac_need_target_h_prefix"_arch_"$i '"'"$target_cpu_arch"'"' >>$ac_need_target_h_file
  267    echo "#endif" >>$ac_need_target_h_file
  268   fi
  269   fi
  270   old2="$old1"
  271   old1="$i"
  272 done
  273 ])
  274 
  275 dnl -------------------------------------------------------------------
  276 dnl
  277 dnl ... the uppercase variant for the host ...
  278 dnl
  279 AC_DEFUN([AC_CREATE_TARGET_HOST_UPPER],
  280 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
  281 AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
  282 changequote({, })dnl
  283 ac_need_target_h_file=`echo ifelse($1, , target.h, $1)`
  284 ac_need_target_h_prefix=`echo ifelse($2, , host, $2) | sed -e 'y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:' -e 's:[^A-Z0-9_]::g'`
  285 #
  286 host_os0=`echo "$host_os"  | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9_]::g'`
  287 host_os1=`echo "$host_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
  288 host_os2=`echo "$host_os0" | sed -e 's:\([^_]*\).*:\1:' `
  289 host_os3=`echo "$host_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
  290 #
  291 host_cpu0=`echo "$host_cpu"  | sed -e 'y:abcdefghijklmnopqrstuvwxyz.-:ABCDEFGHIJKLMNOPQRSTUVWXYZ__:' -e 's:[^A-Z0-9]::g'`
  292 host_cpu1=`echo "$host_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
  293 host_cpu2=`echo "$host_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
  294 host_cpu3=`echo "$host_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
  295 #
  296 host_cpu_arch0=`echo "$host_cpu_arch" | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:'`
  297 #
  298 changequote([, ])dnl
  299 #
  300 if $ac_need_target_h_file_new ; then
  301 AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
  302 echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
  303 echo /'*' on `date` '*'/ >>$ac_need_target_h_file
  304 ac_need_target_h_file_new=false
  305 fi
  306 echo /'*' host uppercase defines '*'/ >>$ac_need_target_h_file
  307 dnl
  308 old1=""
  309 old2=""
  310 for i in $host_os0 $host_os1 $host_os2 $host_os3 "TYPE"
  311 do
  312   if test "$old1" != "$i"; then
  313   if test "$old2" != "$i"; then
  314    echo " " >>$ac_need_target_h_file
  315    echo "#ifndef "$ac_need_target_h_prefix"_OS_"$i >>$ac_need_target_h_file
  316    echo "#define "$ac_need_target_h_prefix"_OS_"$i '"'"$host_os"'"' >>$ac_need_target_h_file
  317    echo "#endif" >>$ac_need_target_h_file
  318   fi
  319   fi
  320   old2="$old1"
  321   old1="$i"
  322 done
  323 #
  324 old1=""
  325 old2=""
  326 for i in $host_cpu0 $host_cpu1 $host_cpu2 $host_cpu3 "TYPE" 
  327 do
  328   if test "$old1" != "$i"; then
  329   if test "$old2" != "$i"; then
  330    echo " " >>$ac_need_target_h_file
  331    echo "#ifndef "$ac_need_target_h_prefix"_CPU_"$i >>$ac_need_target_h_file
  332    echo "#define "$ac_need_target_h_prefix"_CPU_"$i '"'"$host_cpu"'"' >>$ac_need_target_h_file
  333    echo "#endif" >>$ac_need_target_h_file
  334   fi
  335   fi
  336   old2="$old1"
  337   old1="$i"
  338 done
  339 #
  340 old1=""
  341 old2=""
  342 for i in $host_cpu_arch0 "TYPE" 
  343 do
  344   if test "$old1" != "$i"; then
  345   if test "$old2" != "$i"; then
  346    echo " " >>$ac_need_target_h_file
  347    echo "#ifndef "$ac_need_target_h_prefix"_ARCH_"$i >>$ac_need_target_h_file
  348    echo "#define "$ac_need_target_h_prefix"_ARCH_"$i '"'"$host_cpu_arch"'"' >>$ac_need_target_h_file
  349    echo "#endif" >>$ac_need_target_h_file
  350   fi
  351   fi
  352   old2="$old1"
  353   old1="$i"
  354 done
  355 ])
  356 
  357 dnl ---------------------------------------------------------------------
  358 dnl
  359 dnl ... the lowercase variant for the host ...
  360 dnl
  361 AC_DEFUN([AC_CREATE_TARGET_HOST_LOWER],
  362 [AC_REQUIRE([AC_CANONICAL_CPU_ARCH])
  363 AC_REQUIRE([AC_CREATE_TARGET_H_FILE])
  364 changequote({, })dnl
  365 ac_need_target_h_file=`echo ifelse($1, , target.h, $1)`
  366 ac_need_target_h_prefix=`echo ifelse($2, , host, $2) | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:' -e 's:[^a-z0-9_]::g'`
  367 #
  368 host_os0=`echo "$host_os"  | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
  369 host_os1=`echo "$host_os0" | sed -e 's:\([^0-9]*\).*:\1:' `
  370 host_os2=`echo "$host_os0" | sed -e 's:\([^_]*\).*:\1:' `
  371 host_os3=`echo "$host_os2" | sed -e 's:\([^0-9]*\).*:\1:' `
  372 #
  373 host_cpu0=`echo "$host_cpu"  | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ.-:abcdefghijklmnopqrstuvwxyz__:' -e 's:[^a-z0-9_]::g'`
  374 host_cpu1=`echo "$host_cpu0" | sed -e 's:\([^0-9]*\).*:\1:' `
  375 host_cpu2=`echo "$host_cpu0" | sed -e 's:\([^_]*\).*:\1:' `
  376 host_cpu3=`echo "$host_cpu2" | sed -e 's:\([^0-9]*\).*:\1:' `
  377 #
  378 host_cpu_arch0=`echo "$host_cpu_arch" | sed -e 'y:ABCDEFGHIJKLMNOPQRSTUVWXYZ:abcdefghijklmnopqrstuvwxyz:'`
  379 #
  380 changequote([, ])dnl
  381 #
  382 if $ac_need_target_h_file_new ; then
  383 AC_MSG_RESULT(creating $ac_need_target_h_file - canonical system defines)
  384 echo /'*' automatically generated by $PACKAGE configure '*'/ >$ac_need_target_h_file
  385 echo /'*' on `date` '*'/ >>$ac_need_target_h_file
  386 ac_need_target_h_file_new=false
  387 fi
  388 echo /'*' host lowercase defines '*'/ >>$ac_need_target_h_file
  389 dnl
  390 old1=""
  391 old2=""
  392 for i in $host_os0 $host_os1 $host_os2 $host_os3 "_"; 
  393 do
  394   if test "$old1" != "$i"; then
  395   if test "$old2" != "$i"; then
  396    echo " " >>$ac_need_target_h_file
  397    echo "#ifndef __"$ac_need_target_h_prefix"_os_"$i >>$ac_need_target_h_file
  398    echo "#define __"$ac_need_target_h_prefix"_os_"$i '"'"$host_os"'"' >>$ac_need_target_h_file
  399    echo "#endif" >>$ac_need_target_h_file
  400   fi
  401   fi
  402   old2="$old1"
  403   old1="$i"
  404 done
  405 #
  406 old1=""
  407 old2=""
  408 for i in $host_cpu0 $host_cpu1 $host_cpu2 $host_cpu3 "_" 
  409 do
  410   if test "$old1" != "$i"; then
  411   if test "$old2" != "$i"; then
  412    echo " " >>$ac_need_target_h_file
  413    echo "#ifndef __"$ac_need_target_h_prefix"_cpu_"$i >>$ac_need_target_h_file
  414    echo "#define __"$ac_need_target_h_prefix"_cpu_"$i '"'"$host_cpu"'"' >>$ac_need_target_h_file
  415    echo "#endif" >>$ac_need_target_h_file
  416   fi
  417   fi
  418   old2="$old1"
  419   old1="$i"
  420 done
  421 #
  422 old1=""
  423 old2=""
  424 for i in $host_cpu_arch0 "_" 
  425 do
  426   if test "$old1" != "$i"; then
  427   if test "$old2" != "$i"; then
  428    echo " " >>$ac_need_target_h_file
  429    echo "#ifndef __"$ac_need_target_h_prefix"_arch_"$i >>$ac_need_target_h_file
  430    echo "#define __"$ac_need_target_h_prefix"_arch_"$i '"'"$host_cpu_arch"'"' >>$ac_need_target_h_file
  431    echo "#endif" >>$ac_need_target_h_file
  432   fi
  433   fi
  434   old2="$old1"
  435   old1="$i"
  436 done
  437 ])
  438 
  439 dnl -------------------------------------------------------------------
  440 
  441 dnl
  442 dnl the instruction set architecture (ISA) has evolved for a small set
  443 dnl of cpu types. So they often have specific names, e.g. sparclite,
  444 dnl yet they share quite a few similarities. This macro will set the
  445 dnl shell-var $target_cpu_arch to the basic type. Note that these
  446 dnl names are often in conflict with their original 32-bit type name
  447 dnl of these processors, just use them for directory-handling or add
  448 dnl a prefix/suffix to distinguish them from $target_cpu
  449 dnl
  450 dnl this macros has been invented since config.guess is sometimes
  451 dnl too specific about the cpu-type. I chose the names along the lines
  452 dnl of linux/arch/ which is modelled after widespread arch-naming, IMHO.
  453 dnl
  454 AC_DEFUN([AC_CANONICAL_CPU_ARCH],
  455 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
  456 target_cpu_arch="unknown"
  457 case $target_cpu in
  458  i386*|i486*|i586*|i686*|i786*) target_cpu_arch=i386 ;;
  459  power*)   target_cpu_arch=ppc ;;
  460  arm*)     target_cpu_arch=arm ;;
  461  sparc64*) target_cpu_arch=sparc64 ;;
  462  sparc*)   target_cpu_arch=sparc ;;
  463  mips64*)  target_cpu_arch=mips64 ;;
  464  mips*)    target_cpu_arch=mips ;;
  465  alpha*)   target_cpu_arch=alpha ;;
  466  hppa1*)   target_cpu_arch=hppa1 ;;
  467  hppa2*)   target_cpu_arch=hppa2 ;;
  468  arm*)     target_cpu_arch=arm ;;
  469  m68???|mcf54??) target_cpu_arch=m68k ;;
  470  *)        target_cpu_arch="$target_cpu" ;;
  471 esac
  472 
  473 host_cpu_arch="unknown"
  474 case $host_cpu in
  475  i386*|i486*|i586*|i686*|i786*) host_cpu_arch=i386 ;;
  476  power*)   host_cpu_arch=ppc ;;
  477  arm*)     host_cpu_arch=arm ;;
  478  sparc64*) host_cpu_arch=sparc64 ;;
  479  sparc*)   host_cpu_arch=sparc ;;
  480  mips64*)  host_cpu_arch=mips64 ;;
  481  mips*)    host_cpu_arch=mips ;;
  482  alpha*)   host_cpu_arch=alpha ;;
  483  hppa1*)   host_cpu_arch=hppa1 ;;
  484  hppa2*)   host_cpu_arch=hppa2 ;;
  485  arm*)     host_cpu_arch=arm ;;
  486  m68???|mcf54??) host_cpu_arch=m68k ;;
  487  *)        host_cpu_arch="$target_cpu" ;;
  488 esac
  489 ])
  490 
  491 dnl @synopsis AC_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]])
  492 dnl
  493 dnl This macro checks for the size of TYPE using compile checks, not
  494 dnl run checks. You can supply extra HEADERS to look into. the check
  495 dnl will cycle through 1 2 4 8 16 and any EXTRA_SIZES the user
  496 dnl supplies. If a match is found, it will #define SIZEOF_`TYPE' to
  497 dnl that value. Otherwise it will emit a configure time error
  498 dnl indicating the size of the type could not be determined.
  499 dnl
  500 dnl The trick is that C will not allow duplicate case labels. While
  501 dnl this is valid C code:
  502 dnl
  503 dnl      switch (0) case 0: case 1:;
  504 dnl
  505 dnl The following is not:
  506 dnl
  507 dnl      switch (0) case 0: case 0:;
  508 dnl
  509 dnl Thus, the AC_TRY_COMPILE will fail if the currently tried size
  510 dnl does not match.
  511 dnl
  512 dnl Here is an example skeleton configure.in script, demonstrating the
  513 dnl macro's usage:
  514 dnl
  515 dnl      AC_PROG_CC
  516 dnl      AC_CHECK_HEADERS(stddef.h unistd.h)
  517 dnl      AC_TYPE_SIZE_T
  518 dnl      AC_CHECK_TYPE(ssize_t, int)
  519 dnl
  520 dnl      headers='#ifdef HAVE_STDDEF_H
  521 dnl      #include <stddef.h>
  522 dnl      #endif
  523 dnl      #ifdef HAVE_UNISTD_H
  524 dnl      #include <unistd.h>
  525 dnl      #endif
  526 dnl      '
  527 dnl
  528 dnl      AC_COMPILE_CHECK_SIZEOF(char)
  529 dnl      AC_COMPILE_CHECK_SIZEOF(short)
  530 dnl      AC_COMPILE_CHECK_SIZEOF(int)
  531 dnl      AC_COMPILE_CHECK_SIZEOF(long)
  532 dnl      AC_COMPILE_CHECK_SIZEOF(unsigned char *)
  533 dnl      AC_COMPILE_CHECK_SIZEOF(void *)
  534 dnl      AC_COMPILE_CHECK_SIZEOF(size_t, $headers)
  535 dnl      AC_COMPILE_CHECK_SIZEOF(ssize_t, $headers)
  536 dnl      AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers)
  537 dnl      AC_COMPILE_CHECK_SIZEOF(off_t, $headers)
  538 dnl
  539 dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu>
  540 dnl @version $Id: acinclude.m4,v 1.8 2006/12/22 19:45:32 acab Exp $
  541 dnl
  542 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
  543 [changequote(<<, >>)dnl
  544 dnl The name to #define.
  545 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  546 dnl The cache variable name.
  547 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  548 changequote([, ])dnl
  549 AC_MSG_CHECKING(size of $1)
  550 AC_CACHE_VAL(AC_CV_NAME,
  551 [for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
  552   AC_TRY_COMPILE([#include "confdefs.h"
  553 #include <sys/types.h>
  554 $2
  555 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  556   if test x$AC_CV_NAME != x ; then break; fi
  557 done
  558 ])
  559 if test x$AC_CV_NAME = x ; then
  560   AC_MSG_ERROR([cannot determine a size for $1])
  561 fi
  562 AC_MSG_RESULT($AC_CV_NAME)
  563 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
  564 undefine([AC_TYPE_NAME])dnl
  565 undefine([AC_CV_NAME])dnl
  566 ])
  567 dnl Add --enable-maintainer-mode option to configure.
  568 dnl From Jim Meyering
  569 
  570 dnl serial 1
  571 
  572 AC_DEFUN([AM_MAINTAINER_MODE],
  573 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  574   dnl maintainer-mode is disabled by default
  575   AC_ARG_ENABLE(maintainer-mode,
  576 [AS_HELP_STRING([--enable-maintainer-mode], [make rules and dependencies not useful
  577                                             (and sometimes confusing) to the casual installer])],
  578       USE_MAINTAINER_MODE=$enableval,
  579       USE_MAINTAINER_MODE=no)
  580   AC_MSG_RESULT($USE_MAINTAINER_MODE)
  581   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
  582   MAINT=$MAINTAINER_MODE_TRUE
  583   AC_SUBST(MAINT)dnl
  584 ]
  585 )
  586 
  587 dnl AC_C_CVE_2008_1372
  588 dnl Checks DoS in bzlib 
  589 AC_DEFUN([AC_C_CVE_2008_1372],
  590 [AC_CACHE_CHECK([for CVE-2008-1372], [ac_cv_c_cve_2008_1372],
  591 [
  592 save_LIBS="$LIBS"
  593 LIBS="$LIBCLAMAV_LIBS $LIBBZ2"
  594 AC_TRY_RUN([
  595 #include <string.h>
  596 #include <stdlib.h>
  597 #include <stdio.h>
  598 #include <bzlib.h>
  599 
  600 #ifdef NOBZ2PREFIX
  601 #define BZ2_bzReadOpen bzReadOpen
  602 #define BZ2_bzReadClose bzReadClose
  603 #define BZ2_bzRead bzRead
  604 #define BZ2_bzDecompressInit bzDecompressInit
  605 #define BZ2_bzDecompress bzDecompress
  606 #define BZ2_bzDecompressEnd bzDecompressEnd
  607 #endif
  608 
  609 const unsigned char poc[] = {
  610   0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x20, 0x0c,
  611   0xa6, 0x9c, 0x00, 0x00, 0xc2, 0xfb, 0x90, 0xca, 0x10, 0x04, 0x00, 0x40,
  612   0x03, 0x77, 0x80, 0x06, 0x00, 0x7a, 0x2f, 0xde, 0x40, 0x04, 0x00, 0x40,
  613   0x08, 0x30, 0x00, 0xb9, 0xb0, 0x4a, 0x89, 0xa3, 0x43, 0x4d, 0x00, 0x00,
  614   0x01, 0xb5, 0x04, 0xa4, 0x6a, 0x19, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91,
  615   0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00,
  616   0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
  617   0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a,
  618   0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a,
  619   0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x2a, 0xad, 0x2a, 0x91, 0x32,
  620   0x9a, 0x32, 0x0d, 0x06, 0x8d, 0x00, 0x03, 0xf7, 0x13, 0xd2, 0xf5, 0x54,
  621   0x5b, 0x20, 0x4b, 0x34, 0x40, 0x8a, 0x6b, 0xaa, 0x64, 0xd8, 0x30, 0x9d,
  622   0x8a, 0x9a, 0x52, 0x44, 0x13, 0x46, 0x37, 0xd9, 0x0a, 0x3c, 0xa6, 0xee,
  623   0xe9, 0xee, 0xec, 0x6d, 0x4a, 0x65, 0xc2, 0x32, 0xcb, 0x43, 0x82, 0x48,
  624   0xa1, 0x26, 0xc3, 0x43, 0x11, 0x47, 0x0a, 0x5e, 0xc1, 0x30, 0x55, 0x84,
  625   0xb1, 0x25, 0x7a, 0x2b, 0x86, 0x0e, 0xc8, 0x1a, 0x45, 0x10, 0xf1, 0xa9,
  626   0x19, 0x00, 0x30, 0x3c, 0x2a, 0xeb, 0x16, 0x6a, 0x75, 0x86, 0x60, 0xd0,
  627   0xc7, 0xd0, 0x94, 0x34, 0xf1, 0x6b, 0x49, 0x9f, 0x30, 0x4e, 0x0f, 0x70,
  628   0xbe, 0x12, 0x28, 0xe9, 0x7d, 0x10, 0x80, 0x35, 0x53, 0xaf, 0x72, 0xe1,
  629   0x83, 0x90, 0xb8, 0xf8, 0x4b, 0x1a, 0xa4, 0x29, 0x1b, 0x90, 0xe1, 0x4a,
  630   0x0f, 0xc5, 0xdc, 0x91, 0x4e, 0x14, 0x24, 0x08, 0x03, 0x29, 0xa7, 0x00
  631 };
  632 const unsigned int poc_len = 252;
  633 
  634 int main (int argc, char **argv) {
  635         bz_stream bz;
  636         char buf[1024];
  637 
  638         memset(&bz, 0, sizeof(bz));
  639         bz.next_in = (char *)&poc;
  640         bz.avail_in = poc_len;
  641         bz.next_out = buf;
  642         bz.avail_out = sizeof(buf);
  643         if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK)
  644                 return 1;
  645 
  646         while((BZ2_bzDecompress(&bz))==BZ_OK) {
  647                 bz.next_out = buf;
  648                 bz.avail_out = sizeof(buf);
  649         }
  650         BZ2_bzDecompressEnd(&bz);
  651         return 0;
  652 }
  653 ], [ac_cv_c_cve_2008_1372=ok], [
  654 if test $? -gt 127; then 
  655 	ac_cv_c_cve_2008_1372=bugged
  656 else
  657 	ac_cv_c_cve_2008_1372=linkfailed
  658 fi
  659 ], [ac_cv_c_cve_2008_1372=ok])
  660 LIBS="$save_LIBS"
  661 ])
  662 ])
  663 
  664 dnl AC_C_CVE_2010_0405
  665 dnl Checks DoS in bzlib 
  666 AC_DEFUN([AC_C_CVE_2010_0405],
  667 [AC_CACHE_CHECK([for CVE-2010-0405], [ac_cv_c_cve_2010_0405],
  668 [
  669 save_LIBS="$LIBS"
  670 LIBS="$LIBCLAMAV_LIBS $LIBBZ2"
  671 AC_TRY_RUN([
  672 #include <string.h>
  673 #include <stdlib.h>
  674 #include <stdio.h>
  675 #include <bzlib.h>
  676 #ifdef HAVE_UNISTD_H
  677 #include <unistd.h>
  678 #endif
  679 
  680 #ifdef NOBZ2PREFIX
  681 #define BZ2_bzReadOpen bzReadOpen
  682 #define BZ2_bzReadClose bzReadClose
  683 #define BZ2_bzRead bzRead
  684 #define BZ2_bzDecompressInit bzDecompressInit
  685 #define BZ2_bzDecompress bzDecompress
  686 #define BZ2_bzDecompressEnd bzDecompressEnd
  687 #endif
  688 
  689 const unsigned char poc[] = {
  690 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  691 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  692 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  693 0xff, 0xff, 0xfe, 0x20, 0x2c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  694 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  695 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  696 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  697 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  698 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  699 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  700 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
  701 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  702 0x00, 0x00, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
  703 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  704 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
  705 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
  706 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01,
  707 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff
  708 };
  709 const unsigned int poc_len = 280;
  710 
  711 int main (int argc, char **argv) {
  712         bz_stream bz;
  713         char buf[1024];
  714 
  715         memset(&bz, 0, sizeof(bz));
  716         bz.next_in = (char *)&poc;
  717         bz.avail_in = poc_len;
  718         bz.next_out = buf;
  719         bz.avail_out = sizeof(buf);
  720 
  721 	alarm(10);
  722 
  723         if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK)
  724                 return 1;
  725 
  726         while((BZ2_bzDecompress(&bz))==BZ_OK) {
  727                 bz.next_out = buf;
  728                 bz.avail_out = sizeof(buf);
  729         }
  730         BZ2_bzDecompressEnd(&bz);
  731         return 0;
  732 }
  733 ], [ac_cv_c_cve_2010_0405=ok], [
  734 if test $? -gt 127; then 
  735 	ac_cv_c_cve_2010_0405=bugged
  736 else
  737 	ac_cv_c_cve_2010_0405=linkfailed
  738 fi
  739 ], [ac_cv_c_cve_2010_0405=ok])
  740 LIBS="$save_LIBS"
  741 ])
  742 ])
  743 
  744 dnl AC_LIB_FIND(LIBNAME, HEADER, LINKTESTCODE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
  745 dnl Checks for flags needed to link with LIBNAME, for the existence of HEADER,
  746 dnl and the ability to link with LINKTESTCODE.
  747 dnl If successful sets LIB${LIBNAME}, LTLIB${LIBNAME}, INC${LIBNAME} variables,
  748 dnl AC_DEFINEs HAVE_LIB${LIBNAME} to 1, defines HAVE_LIB${LIBNAME} to yes,
  749 dnl and evaluates ACTION-IF-FOUND.
  750 dnl Otherwise evaluates ACTION-IF-NOT-FOUND.
  751 dnl --------------------------------------------------------------------------------
  752 AC_DEFUN([AC_LIB_FIND],
  753 [
  754 	dnl Prerequisites of AC_LIB_LINKFLAGS_BODY
  755   	AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  756 	AC_REQUIRE([AC_LIB_RPATH])
  757 	m4_if($#,5,,[m4_fatal([$0: invalid number of arguments: $#])])
  758   	define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  759                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  760 		save_CPPFLAGS="$CPPFLAGS"
  761 		save_LIBS="$LIBS"
  762 		AC_LIB_LINKFLAGS_BODY([$1])
  763 		CPPFLAGS="$CPPFLAGS $INC[]NAME"
  764 		AC_CHECK_HEADER([$2], [have_header=yes],[have_header=no])
  765 		ac_cv_findlib_[]NAME[]_libs=
  766 		ac_cv_findlib_[]NAME[]_ltlibs=
  767 		ac_cv_findlib_[]NAME[]_inc=
  768 		AS_IF([test "$have_header" = "yes"],[
  769 				LIBS="$LIBS $LIB[]NAME"
  770 				AC_MSG_CHECKING([linking with $1])
  771 				AC_LINK_IFELSE([AC_LANG_SOURCE([$3])],[
  772 					ac_cv_findlib_[]NAME[]_libs="$LIB[]NAME"
  773 					ac_cv_findlib_[]NAME[]_ltlibs="$LTLIB[]NAME"
  774 					ac_cv_findlib_[]NAME[]_inc="$INC[]NAME"
  775 					AC_MSG_RESULT([ok])
  776 				])
  777 		])
  778 		CPPFLAGS="$save_CPPFLAGS"
  779 		LIBS="$save_LIBS"
  780 	AS_IF([test "X$ac_cv_findlib_[]NAME[]_libs" = "X"],[
  781 			AC_MSG_NOTICE([unable to compile/link with $1])
  782 			HAVE_LIB[]NAME=no
  783 			$5
  784 		],[
  785 			AC_MSG_NOTICE([Compiling and linking with $1 by using $ac_cv_findlib_[]NAME[]_inc $ac_cv_findlib_[]NAME[]_libs])
  786 			AC_DEFINE([HAVE_LIB]NAME,1,[Define to '1' if you have the $2 library])
  787 			HAVE_LIB[]NAME=yes
  788 			LIB[]NAME="$ac_cv_findlib_[]NAME[]_libs"
  789 			LTLIB[]NAME="$ac_cv_findlib_[]NAME[]_ltlibs"
  790 			INC[]NAME="$ac_cv_findlib_[]NAME[]_inc"
  791 			$4
  792 	])
  793 	undefine([NAME])	
  794 ])
  795 
  796 dnl Try to set a correct default libdir for multiarch systems
  797 AC_DEFUN([AC_LIB_MULTILIB_GUESS],
  798 [
  799 	# Only modify libdir if user has not overridden it
  800 	default_libdir='${exec_prefix}/lib'
  801 	if test "$libdir" = "$default_libdir"; then
  802 		AC_MSG_CHECKING([for multiarch libdir])
  803 		# Based on http://lists.gnu.org/archive/html/autoconf/2008-09/msg00072.html
  804 		if test "$GCC" = yes; then
  805 			ac_multilibdir=`$CC -print-multi-os-directory $CFLAGS $CPPFLAGS $LDFLAGS` || ac_multilibdir=.
  806 		else
  807 			ac_multilibdir=.
  808 		fi
  809 		case "$ac_multilibdir" in
  810 			 # I don't know if the first two cases can happen, but it would be a
  811 			 # bad idea to override $exec_prefix
  812 			 /* | ../../* | .) acl_libdirstem=lib ;;
  813 			 ../*)             acl_libdirstem=`echo $ac_multilibdir | sed 's/^...//' ` ;;
  814 			*)                 acl_libdirstem=lib/$ac_multilibdir ;;
  815 		esac
  816 		libdir='${exec_prefix}/'$acl_libdirstem
  817 		AC_MSG_RESULT([$libdir])
  818 	else
  819 		acl_libdirstem=lib
  820 		if test -d "$libdir"; then
  821 			case "$libdir" in
  822 				*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  823 				*) searchdir=`cd "$libdir" && pwd`
  824 				   case "$searchdir" in
  825 					*/lib64 ) acl_libdirstem=lib64 ;;
  826 				   esac
  827 			esac
  828 		fi
  829 	fi
  830 ])
  831 
  832 dnl CL_MSG_STATUS([featurename],[have_feature], [enable_feature])
  833 AC_DEFUN([CL_MSG_STATUS],
  834 [
  835    m4_if($#,3,,[m4_fatal([$0: invalid number of arguments: $#])])
  836    AS_ECHO_N(["              $1: "])
  837    AS_IF([test "x$3" = "xno"], [AS_ECHO(["$2 (disabled)"])],
  838 	 [test "x$3" = "xyes"], [AS_ECHO(["$2"])],
  839 	 [test "x$3" = "x"], [AS_ECHO(["$2"])],
  840 	 [AS_ECHO(["$2 ($3)"])])
  841 ])