"Fossies" - the Fresh Open Source Software Archive

Member "rbldnsd-0.998/configure.lib" (14 Jun 2015, 5512 Bytes) of package /linux/misc/dns/rbldnsd-0.998.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.lib": 0.997_vs_0.998.

    1 # configure.lib
    2 # a library of shell routines for simple autoconf system
    3 #
    4 
    5 set -e
    6 ac_substitutes=
    7 rm -f conftest* config.log
    8 exec 5>config.log
    9 cat <<EOF >&5
   10 This file contains any messages produced by compilers etc while
   11 running configure, to aid debugging if configure script makes a mistake.
   12 
   13 EOF
   14 
   15 case `echo "a\c"` in
   16   *c*) ac_en=-n ac_ec= ;;
   17   *)   ac_en= ac_ec='\c' ;;
   18 esac
   19 
   20 ##### Messages
   21 ac_msg() {
   22   echo $ac_en "$*... $ac_ec"
   23   echo ">>> $*" >&5
   24 }
   25 ac_checking() {
   26   echo $ac_en "checking $*... $ac_ec"
   27   echo ">>> checking $*" >&5
   28 }
   29 ac_result() {
   30   echo "$1"
   31   echo "=== $1" >&5
   32 }
   33 ac_fatal() {
   34   echo "configure: fatal: $*" >&2
   35   echo "=== FATAL: $*" >&5
   36   exit 1
   37 }
   38 ac_warning() {
   39   echo "configure: warning: $*" >&2
   40   echo "=== WARNING: $*" >&5
   41 }
   42 
   43 # ac_run command...
   44 # captures output in conftest.out
   45 ac_run() {
   46   # apparently UnixWare (for one) /bin/sh optimizes the following "if"
   47   # "away", by checking if there's such a command BEFORE redirecting
   48   # output.  So error message (like "gcc: command not found") goes
   49   # to stderr instead of to conftest.out, and `cat conftest.out' below
   50   # fails.
   51   if "$@" >conftest.out 2>&1; then
   52     return 0
   53   else
   54     echo "==== Command invocation failed. Command line was:" >&5
   55     echo "$*" >&5
   56     echo "==== compiler input was:" >&5
   57     cat conftest.c >&5
   58     echo "==== output was:" >&5
   59     cat conftest.out >&5
   60     echo "====" >&5
   61     return 1
   62   fi
   63 }
   64 
   65 # ac_verbose "feature" "ok" "bad" command...
   66 ac_verbose() {
   67   ac_checking "$1"
   68   ok=$2 bad=$3; shift 3
   69   if "$@"; then
   70     ac_result $ok
   71     return 0
   72   else
   73     ac_result $bad
   74     return 1
   75   fi
   76 }
   77 
   78 # common case for ac_verbose: yes/no result
   79 ac_yesno() {
   80   ac_checking "$1"
   81   shift
   82   if "$@"; then
   83     ac_result yes
   84     return 0
   85   else
   86     ac_result no
   87     return 1
   88   fi
   89 }
   90 
   91 ac_subst() {
   92   ac_substitutes="$ac_substitutes $*"
   93 }
   94 
   95 ac_define() {
   96   if [ -f confdefs.h ]; then
   97     echo "#define $1    ${2:-1}" >>confdefs.h
   98   else
   99     CDEFS="$CDEFS -D$1=${2:-1}"
  100   fi
  101 }
  102 
  103 ##### Compiling, linking
  104 
  105 # run a compiler
  106 ac_run_compiler() {
  107   rm -f conftest*; cat >conftest.c
  108   ac_run $CC $CFLAGS conftest.c "$@"
  109 }
  110 
  111 ac_compile() {
  112   ac_run_compiler -c
  113 }
  114 ac_compile_v() {
  115   what="$1"; shift
  116   ac_yesno "$what" ac_compile "$@"
  117 }
  118 
  119 ac_link() {
  120   ac_run_compiler -o conftest "$@" $LIBS
  121 }
  122 
  123 ac_link_v() {
  124   what="$1"; shift
  125   ac_yesno "$what" ac_link "$@"
  126 }
  127 
  128 ac_cpp() {
  129   ac_run_compiler -E "$@"
  130 }
  131 ac_cpp_v() {
  132   what="$1"; shift
  133   ac_yesno "$what" ac_cpp "$@"
  134 }
  135 
  136 ### check for C compiler.  Set $CC, $CFLAGS etc
  137 ac_prog_c_compiler() {
  138   ac_checking "for C compiler"
  139   rm -f conftest*
  140   echo 'int main(int argc, char **argv) { return 0; }' >conftest.c
  141 
  142   if [ -n "$CC" ]; then
  143     if ac_run $CC -o conftest conftest.c && ac_run ./conftest; then
  144       ac_result "\$CC ($CC)"
  145     else
  146       ac_result no
  147       ac_fatal "\$CC ($CC) is not a working compiler"
  148     fi
  149   else
  150     for cc in gcc cc ; do
  151       if ac_run $cc -o conftest conftest.c && ac_run ./conftest; then
  152         ac_result "$cc"
  153         CC=$cc
  154         break
  155       fi
  156     done
  157     if [ -z "$CC" ]; then
  158       ac_result no
  159       ac_fatal "no working C compiler found in \$PATH. please set \$CC variable"
  160     fi
  161   fi
  162   if [ -z "$CFLAGS" ]; then
  163     if ac_grep_cpp_v "whether C compiler ($CC) is GNU CC" yEs <<EOF
  164 #ifdef __GNUC__
  165   yEs;
  166 #endif
  167 EOF
  168     then
  169       CFLAGS="-Wall -W -O2 -pipe"
  170     else
  171       CFLAGS=-O
  172     fi
  173   fi
  174   cc="$CC $CFLAGS"
  175   ccld="$cc"
  176   if [ -n "$LDFLAGS" ]; then ccld="$ccld $LDFLAGS"; fi
  177   if [ -n "$LIBS" ]; then ccld="$ccld $LIBS"; fi
  178   if ac_yesno "whether the C compiler ($ccld)
  179            can produce executables" \
  180      ac_compile_run <<EOF
  181 int main() { return 0; }
  182 EOF
  183   then :
  184   else
  185     ac_fatal "no working C compiler found"
  186   fi
  187   LD='$(CC)'
  188   [ -n "$AR" ] || AR=ar
  189   [ -n "$ARFLAGS" ] || ARFLAGS=rv
  190   [ -n "$AWK" ] || AWK=awk
  191   ac_substitutes="$ac_substitutes CC CFLAGS LD LDFLAGS LIBS AR ARFLAGS AWK"
  192 }
  193 
  194 
  195 ac_prog_ranlib() {
  196   ac_checking "for ranlib"
  197   if [ -n "$RANLIB" ]; then
  198     ac_result "\$RANLIB ($RANLIB)"
  199   else
  200     ifs="$IFS"
  201     IFS=:
  202     for dir in $PATH; do
  203       [ -n "$dir" ] || dir=.
  204       if [ -f $dir/ranlib ]; then
  205         RANLIB=ranlib
  206         break
  207       fi
  208     done
  209     IFS="$ifs"
  210     if [ -z "$RANLIB" ]; then ac_result no; RANLIB=:
  211     else ac_result "$RANLIB"
  212     fi
  213   fi
  214   ac_substitutes="$ac_substitutes RANLIB"
  215 }
  216 
  217 ac_header_check_v() {
  218   ac_cpp_v "for $1" <<EOF
  219 #include <$1>
  220 EOF
  221 }
  222 
  223 ac_library_find_v() {
  224   ac_checking "for libraries needed for $1"
  225   shift
  226   fond=
  227   rm -f conftest*; cat >conftest.c
  228   for lib in "$@"; do
  229     if ac_run $CC $CFLAGS $LDFLAGS conftest.c -o conftest $LIBS $lib; then
  230       found=y
  231       break
  232     fi
  233   done
  234   if [ ! "$found" ]; then
  235     ac_result "not found"
  236     return 1
  237   fi
  238   if [ -z "$lib" ]; then
  239     ac_result "ok (none needed)"
  240   else
  241     ac_result "ok ($lib)"
  242     LIBS="$LIBS $lib"
  243   fi
  244 }
  245 
  246 ac_compile_run() {
  247   ac_link "$@" && ac_run ./conftest
  248 }
  249 
  250 ac_compile_run_v() {
  251   what="$1"; shift
  252   ac_yesno "$what" ac_compile_run "$@"
  253 }
  254 
  255 ac_grep_cpp() {
  256   pattern="$1"; shift
  257   ac_cpp "$@" && grep "$pattern" conftest.out >/dev/null
  258 }
  259 ac_grep_cpp_v() {
  260   ac_yesno "$1" ac_grep_cpp "$2"
  261 }
  262 
  263 ac_output() {
  264   for var in $ac_substitutes; do
  265     eval echo "\"s|@$var@|\$$var|\""
  266   done >conftest.sed
  267   for file in "$@"; do
  268     ac_msg "creating $file"
  269     if [ -f $file.in ]; then
  270       sed -f conftest.sed $file.in > $file.tmp
  271       mv -f $file.tmp $file
  272       ac_result ok
  273     else
  274       ac_result failed
  275       ac_fatal "$file.in not found"
  276     fi
  277   done
  278   rm -f conftest*
  279 }