"Fossies" - the Fresh Open Source Software Archive

Member "rbldnsd-0.998/configure" (23 Jul 2013, 7883 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) Bash 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": 0.997_vs_0.998.

    1 #! /bin/sh
    2 # autoconf-style configuration script
    3 #
    4 set -e
    5 
    6 name=rbldnsd
    7 
    8 
    9 if [ -f rbldnsd.h -a -f rbldnsd_util.c -a -f debian/changelog ] ; then :
   10 else
   11   echo "configure: error: sources not found at `pwd`" >&2
   12   exit 1
   13 fi
   14 
   15 options="ipv6 stats master_dump zlib dso asserts"
   16 
   17 for opt in $options; do
   18   eval enable_$opt=
   19 done
   20 
   21 if [ -f config.status ]; then
   22   . ./config.status
   23 fi
   24 
   25 enable() {
   26   opt=`echo "$1" | sed 's/^--[^-]*-//'`
   27   case "$opt" in
   28     ipv6|stats|master_dump|zlib|dso|asserts) ;;
   29     master-dump) opt=master_dump ;;
   30     *) echo "configure: unrecognized option \`$1'" >&2; exit 1;;
   31   esac
   32   eval enable_$opt=$2
   33 }
   34 
   35 while [ $# -gt 0 ]; do
   36   case "$1" in
   37     --disable-*|--without-*|--no-*) enable "$1" n;;
   38     --enable-*|--with-*) enable "$1" y;;
   39     --help | --hel | --he | --h | -help | -hel | -he | -h )
   40       cat <<EOF
   41 configure: configure $name package.
   42 Usage: ./configure [options]
   43 where options are:
   44  --enable-option, --with-option --
   45    enable the named option/feature
   46  --disable-option, --without-option, --no-option --
   47    disable the named option/feature
   48  --help - print this help and exit
   49 Optional features (all enabled by default if system supports a feature):
   50   ipv6 - enable/disable IP version 6 (IPv6) support
   51   stats - enable/disable runtime statistics
   52   master-dump - enable/disable master-format (bind) dump support (-d option)
   53   zlib - zlib support
   54   dso - dynamic extensions (using shared objects) -- disabled by default
   55   asserts - enable/disable debugging assertions -- disabled by default
   56 EOF
   57       exit 0
   58       ;;
   59     *) echo "configure: unknown option \`$1'" >&2; exit 1 ;;
   60   esac
   61   shift
   62 done
   63 
   64 . ./configure.lib
   65 
   66 rm -f confdef.h
   67 cat >confdef.h <<EOF
   68 /* $name autoconfiguration header file.
   69  * Generated automatically by configure. */
   70 
   71 EOF
   72 
   73 set -- $(sed -n -e '/[^0-9].* (.*)$/ { s/\(.*\) (\(.*\))$/\1 \2/p; q; }' NEWS)
   74 VERSION=$1; shift
   75 VERSION_DATE="$*"
   76 
   77 ac_msg "configure: $name"
   78 ac_result "$VERSION ($VERSION_DATE)"
   79 
   80 ac_subst VERSION VERSION_DATE
   81 
   82 ac_prog_c_compiler
   83 ac_prog_ranlib
   84 
   85 if ac_header_check_v stdint.h
   86 then :
   87 else
   88   echo "#define NO_STDINT_H 1" >>confdef.h
   89 
   90   if ac_yesno "sizes of standard integer types" \
   91      ac_compile_run <<EOF
   92 #include <stdio.h>
   93 int main() {
   94   printf("#define SIZEOF_SHORT %d\n", sizeof(short));
   95   printf("#define SIZEOF_INT %d\n", sizeof(int));
   96   printf("#define SIZEOF_LONG %d\n", sizeof(long));
   97   return 0;
   98 }
   99 EOF
  100   then
  101     cat conftest.out >> confdef.h
  102   else
  103     ac_fatal "cannot determine sizes of standard types"
  104   fi
  105   if ac_yesno "for long long" \
  106      ac_compile_run <<EOF
  107 #include <stdio.h>
  108 int main() {
  109   long long x;
  110   printf("#define SIZEOF_LONG_LONG %d\n", sizeof(long long));
  111   return 0;
  112 }
  113 EOF
  114   then
  115     cat conftest.out >>confdef.h
  116   else
  117     echo "#define NO_LONG_LONG" >>confdef.h
  118   fi
  119 fi
  120 
  121 if ac_compile_run_v "whether C compiler defines __SIZEOF_POINTER__" <<EOF
  122 #include <stdio.h>
  123 int main() {
  124 #ifdef __SIZEOF_POINTER__
  125   return 0;
  126 #else
  127   printf("#define __SIZEOF_POINTER__ %d\n", sizeof(int *));
  128   return 1;
  129 #endif
  130 }
  131 EOF
  132 then :
  133 else
  134   cat conftest.out >>confdef.h
  135 fi
  136 
  137 if ac_verbose "byte order" "big-endian" "little-endian" \
  138    ac_compile_run <<EOF
  139 int main() {
  140   long one = 1;
  141   if (*(char *)&one)
  142     return 1; /* little-endian */
  143   return 0;
  144 }
  145 EOF
  146 then
  147   echo "#define WORDS_BIGENDIAN 1" >>confdef.h
  148 fi
  149 
  150 has_inline=
  151 for c in inline __inline; do
  152   if ac_compile_v "for $c" <<EOF
  153 static $c int foo() { return 0; }
  154 int main() { return foo(); }
  155 EOF
  156   then
  157     has_inline=$c
  158     break
  159   fi
  160 done
  161 if [ "$has_inline" != inline ]; then
  162   echo "#define inline" $has_inline >>confdef.h
  163 fi
  164 
  165 if ac_compile_v "for socklen_t" <<EOF
  166 #include <sys/types.h>
  167 #include <sys/socket.h>
  168 int foo() { socklen_t len; len = 0; return len; }
  169 EOF
  170 then :
  171 else
  172   echo "#define socklen_t int" >>confdef.h
  173 fi
  174 
  175 if ac_library_find_v 'connect()' "" "-lsocket -lnsl" <<EOF
  176 int main() { gethostbyname(); connect(); return 0; }
  177 EOF
  178 then :
  179 else
  180   ac_fatal "cannot find libraries needed for sockets"
  181 fi
  182 
  183 if [ n = "$enable_ipv6" ]; then
  184   echo "#define NO_IPv6 1   /* option disabled */" >>confdef.h
  185 else
  186 
  187 if ac_link_v "for IPv6" <<EOF
  188 #include <sys/types.h>
  189 #include <sys/socket.h>
  190 #include <netinet/in.h>
  191 #include <netdb.h>
  192 int main() {
  193   char h[200];
  194   char s[200];
  195   struct sockaddr_in6 sa;
  196   sa.sin6_family = AF_INET6;
  197   getnameinfo((struct sockaddr*)&sa, sizeof(sa), h, sizeof(h), s, sizeof(s), 0);
  198   return 0;
  199 }
  200 EOF
  201 then :
  202 else
  203   if [ "$enable_ipv6" ]; then
  204     ac_fatal "IPv6 is requested but not available"
  205   fi
  206   echo "#define NO_IPv6 1" >>confdef.h
  207 fi
  208 fi # enable_ipv6?
  209 
  210 if ac_link_v "for mallinfo()" <<EOF
  211 #include <sys/types.h>
  212 #include <stdlib.h>
  213 #include <malloc.h>
  214 int main() {
  215   struct mallinfo mi = mallinfo();
  216   return 0;
  217 }
  218 EOF
  219 then :
  220 else
  221   echo "#define NO_MEMINFO 1" >>confdef.h
  222 fi
  223 
  224 if ac_link_v "for poll()" <<EOF
  225 #include <sys/types.h>
  226 #include <sys/poll.h>
  227 int main() {
  228   struct pollfd pfd[2];
  229   return poll(pfd, 2, 10);
  230 }
  231 EOF
  232 then :
  233 else
  234   echo "#define NO_POLL 1" >>confdef.h
  235 
  236   if ac_header_check_v "sys/select.h"
  237   then :
  238   else
  239     echo "#define NO_SELECT_H 1" >>confdefs.h
  240   fi
  241 fi
  242 
  243 if ac_link_v "for vsnprintf()" <<EOF
  244 #include <stdio.h>
  245 #include <string.h>
  246 #include <stdarg.h>
  247 int test(char *fmt, ...) {
  248   va_list ap;
  249   char buf[40];
  250   va_start(ap, fmt);
  251   vsnprintf(buf, sizeof(buf), fmt, ap);
  252   return 0;
  253 }
  254 int main() {
  255   test("test%d", 40);
  256   return 0;
  257 }
  258 EOF
  259 then :
  260 else
  261   ac_fatal "$name requires working vsnprintf() routine"
  262 fi
  263 
  264 if ac_link_v "for writev()/readv()" <<EOF
  265 #include <sys/types.h>
  266 #include <unistd.h>
  267 #include <sys/uio.h>
  268 int main() {
  269   struct iovec iov;
  270   return writev(1, &iov, 1) && readv(1, &iov, 1);
  271 }
  272 EOF
  273 then :
  274 else
  275   echo "#define NO_IOVEC 1" >>confdef.h
  276 fi
  277 
  278 if ac_link_v "for setitimer()" <<EOF
  279 #include <sys/types.h>
  280 #include <sys/time.h>
  281 int main() {
  282   struct itimerval itv;
  283   itv.it_interval.tv_sec  = itv.it_value.tv_sec  = 10;
  284   itv.it_interval.tv_usec = itv.it_value.tv_usec = 20;
  285   setitimer(ITIMER_REAL, &itv, 0);
  286   return 0;
  287 }
  288 EOF
  289 then
  290   echo "#define HAVE_SETITIMER 1" >>confdef.h
  291 fi
  292 
  293 if [ n = "$enable_zlib" ]; then
  294   echo "#define NO_ZLIB 1   /* option disabled */" >>confdef.h
  295 elif ac_link_v "for zlib support" -lz <<EOF
  296 #include <sys/types.h>
  297 #include <stdio.h>
  298 #include <zlib.h>
  299 int main() {
  300   z_stream z;
  301   int r;
  302   r = inflateInit2(&z, 0);
  303   r = inflate(&z, Z_NO_FLUSH);
  304   r = inflateEnd(&z);
  305   return 0;
  306 }
  307 EOF
  308 then
  309   LIBS="$LIBS -lz"
  310 elif [ "$enable_zlib" ]; then
  311   ac_fatal "zlib support is requested but not found/available"
  312 else
  313   echo "#define NO_ZLIB" >>confdef.h
  314 fi
  315 
  316 if [ -z "$enable_dso" ]; then
  317   echo "#define NO_DSO      1   /* disabled by default */" >> confdef.h
  318 elif [ n = "$enable_dso" ]; then
  319   echo "#define NO_DSO      1   /* option disabled */" >>confdef.h
  320 elif ac_link_v "for dlopen() in -dl with -rdynamic" -ldl -rdynamic <<EOF
  321 #include <dlfcn.h>
  322 int main() {
  323   void *handle, *func;
  324   handle = dlopen("testfile", RTLD_NOW);
  325   func = dlsym(handle, "function");
  326   return 0;
  327 }
  328 EOF
  329 then
  330   LIBS="$LIBS -ldl -rdynamic"
  331 elif [ "$enable_dso" ]; then
  332   ac_fatal "dso support requires dlopen() in -ldl"
  333 else
  334   echo "#define NO_DSO  1   /* not available */" >> confdef.h
  335 fi
  336 
  337 if [ n = "$enable_stats" ]; then
  338   echo "#define NO_STATS    1   /* option disabled */" >>confdef.h
  339 fi
  340 if [ n = "$enable_master_dump" ]; then
  341   echo "#define NO_MASTER_DUMP  1   /* option disabled */" >>confdef.h
  342 fi
  343 if [ y != "$enable_asserts" ]; then
  344   echo "#define NDEBUG      1   /* option disabled */" >>confdef.h
  345 fi
  346 
  347 ac_output Makefile
  348 ac_msg "creating config.h"
  349 mv -f confdef.h config.h
  350 ac_result ok
  351 ac_msg "creating config.status"
  352 rm -f config.status
  353 {
  354 echo "# automatically generated by configure to hold command-line options"
  355 echo
  356 found=
  357 for opt in $options; do
  358   eval val=\$enable_$opt
  359   if [ -n "$val" ]; then
  360     echo enable_$opt=$val
  361     found=y
  362   fi
  363 done
  364 if [ ! "$found" ]; then
  365   echo "# (no options encountered)"
  366 fi
  367 } > config.status
  368 ac_result ok
  369 
  370 ac_result "all done."
  371 exit 0