/contrib/bind9/isc-config.sh.in

https://bitbucket.org/freebsd/freebsd-head/ · Autoconf · 149 lines · 125 code · 7 blank · 17 comment · 15 complexity · bf3fb6b40846886048ef1500143d16f0 MD5 · raw file

  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
  4. # Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
  5. #
  6. # Permission to use, copy, modify, and/or distribute this software for any
  7. # purpose with or without fee is hereby granted, provided that the above
  8. # copyright notice and this permission notice appear in all copies.
  9. #
  10. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  11. # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  12. # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  13. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  14. # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  15. # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. # PERFORMANCE OF THIS SOFTWARE.
  17. # $Id: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $
  18. prefix=@prefix@
  19. exec_prefix=@exec_prefix@
  20. exec_prefix_set=
  21. usage()
  22. {
  23. cat << EOF
  24. Usage: isc-config [OPTIONS] [LIBRARIES]
  25. Options:
  26. [--prefix[=DIR]]
  27. [--exec-prefix[=DIR]]
  28. [--version]
  29. [--libs]
  30. [--cflags]
  31. Libraries:
  32. isc
  33. isccc
  34. isccfg
  35. dns
  36. lwres
  37. bind9
  38. EOF
  39. exit $1
  40. }
  41. if test $# -eq 0; then
  42. usage 1 1>&2
  43. fi
  44. while test $# -gt 0; do
  45. case "$1" in
  46. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  47. *) optarg= ;;
  48. esac
  49. case "$1" in
  50. --prefix=*)
  51. prefix=$optarg
  52. if test "x$exec_prefix_set" = x ; then
  53. exec_prefix=$prefix
  54. fi
  55. ;;
  56. --prefix)
  57. echo_prefix=true
  58. ;;
  59. --exec-prefix=*)
  60. exec_prefix=$optarg
  61. ;;
  62. --exec-prefix)
  63. echo_exec_prefix=true
  64. ;;
  65. --version)
  66. echo @BIND9_VERSION@
  67. exit 0
  68. ;;
  69. --cflags)
  70. echo_cflags=true
  71. ;;
  72. --libs)
  73. echo_libs=true;
  74. ;;
  75. isc)
  76. libisc=true;
  77. ;;
  78. isccc)
  79. libisccc=true;
  80. libisc=true;
  81. ;;
  82. isccfg)
  83. libisccfg=true;
  84. libisc=true;
  85. ;;
  86. dns)
  87. libdns=true;
  88. libisc=true;
  89. ;;
  90. lwres)
  91. liblwres=true;
  92. ;;
  93. bind9)
  94. libdns=true;
  95. libisc=true;
  96. libisccfg=true;
  97. libbind9=true;
  98. ;;
  99. *)
  100. usage 1 1>&2
  101. esac
  102. shift
  103. done
  104. if test x"$echo_prefix" = x"true" ; then
  105. echo $prefix
  106. fi
  107. if test x"$echo_exec_prefix" = x"true" ; then
  108. echo $exec_prefix
  109. fi
  110. if test x"$echo_cflags" = x"true"; then
  111. includes="-I${exec_prefix}/include"
  112. if test x"$libisc" = x"true"; then
  113. includes="$includes @ALWAYS_DEFINES@ @STD_CINCLUDES@ @STD_CDEFINES@ @CCOPT@"
  114. fi
  115. echo $includes
  116. fi
  117. if test x"$echo_libs" = x"true"; then
  118. libs=-L${exec_prefix}/lib
  119. if test x"$liblwres" = x"true" ; then
  120. libs="$libs -llwres"
  121. fi
  122. if test x"$libbind9" = x"true" ; then
  123. libs="$libs -lbind9"
  124. fi
  125. if test x"$libdns" = x"true" ; then
  126. libs="$libs -ldns @DNS_CRYPTO_LIBS@"
  127. fi
  128. if test x"$libisccfg" = x"true" ; then
  129. libs="$libs -lisccfg"
  130. fi
  131. if test x"$libisccc" = x"true" ; then
  132. libs="$libs -lisccc"
  133. fi
  134. if test x"$libisc" = x"true" ; then
  135. libs="$libs -lisc"
  136. needothers=true
  137. fi
  138. if test x"$needothers" = x"true" ; then
  139. libs="$libs @CCOPT@ @LIBS@"
  140. fi
  141. echo $libs
  142. fi