home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.lbl.gov / 2014.05.ftp.ee.lbl.gov.tar / ftp.ee.lbl.gov / acld-1.11.tar.gz / acld-1.11.tar / acld-1.11 / configure.in < prev    next >
Text File  |  2011-11-03  |  5KB  |  213 lines

  1. AC_REVISION([@(#) $Id: configure.in 801 2011-11-04 00:47:24Z leres $ (LBL)])
  2. dnl
  3. AC_COPYRIGHT([Copyright (c) 2002, 2007, 2008, 2009, 2010, 2011
  4.     The Regents of the University of California.  All rights reserved.])
  5. dnl
  6. dnl Process this file with autoconf to produce a configure script.
  7. dnl
  8.  
  9. AC_INIT
  10. AC_CONFIG_SRCDIR(acld.c)
  11.  
  12. AC_CANONICAL_TARGET
  13.  
  14. umask 002
  15.  
  16. if test -z "$PWD" ; then
  17.     PWD=`pwd`
  18. fi
  19.  
  20. AC_LBL_C_INIT(V_CCOPT, V_INCLS)
  21. AC_PROG_INSTALL
  22.  
  23. AC_CHECK_HEADERS(memory.h paths.h)
  24.  
  25. dnl
  26. dnl FreeBSD doesn't use malloc.h but stupidly has one...
  27. dnl autoconf sets sets the wrong mandir under FreeBSD 
  28. dnl Install a startup script if we have the right one
  29. dnl
  30. case "$target_os" in
  31.  
  32. freebsd*)
  33.     INSTALL_START="install-localrcd"
  34.     eval _t="${mandir}"
  35.     eval _t="${_t}"
  36.     if test "${_t}" = "NONE/share/man"; then
  37.         mandir="/usr/local/man"
  38.         AC_MSG_NOTICE(Mapping FreeBSD mandir to ${mandir})
  39.     fi
  40.         ;;
  41.  
  42. linux*)
  43.     AC_PATH_PROG(UPDATERCD, update-rc.d)
  44.     if test -n "$UPDATERCD" ; then
  45.         INSTALL_START="install-updatercd"
  46.     fi
  47.     ;;
  48.  
  49. *)
  50.     if test -d "/usr/local/etc/rc.d/"; then
  51.         INSTALL_START="install-localrcd"
  52.     fi
  53.         AC_CHECK_HEADERS(malloc.h)
  54.         ;;
  55. esac
  56.  
  57.  
  58. AC_LBL_SOCKADDR_SA_LEN
  59.  
  60. AC_LBL_CHECK_TYPE(int32_t, int)
  61. AC_LBL_CHECK_TYPE(u_int16_t, u_short)
  62. AC_LBL_CHECK_TYPE(u_int32_t, u_int)
  63. AC_LBL_SOCKLEN_T
  64.  
  65. AC_REPLACE_FUNCS(daemon strerror inet_aton)
  66. AC_CHECK_FUNCS(setsid)
  67.  
  68. AC_ARG_ENABLE([ipv6],
  69.     [AS_HELP_STRING([--disable-ipv6],
  70.     [disable ipv6 support @<:@default=check@:>@])],
  71.     ac_cv_enable_ipv6=${enable_ipv6})
  72.  
  73. AC_MSG_CHECKING(for ipv6)
  74. if test "${ac_cv_enable_ipv6}" = "" -o \
  75.     "${ac_cv_enable_ipv6}" = yes ; then
  76.     AC_TRY_COMPILE([
  77. #        include <sys/types.h>
  78. #        include <sys/socket.h>
  79. #        include <netinet/in.h>
  80. #        include <arpa/inet.h>],
  81.         [int foo(void)
  82.         {
  83.             struct sockaddr_in6 sin6;
  84.             return (inet_pton(AF_INET, "foo", &sin6));
  85.         }],
  86.         ac_cv_have_ipv6=yes,
  87.         ac_cv_have_ipv6=no)
  88.     AC_MSG_RESULT($ac_cv_have_ipv6)
  89.     if test "${ac_cv_enable_ipv6}" = yes -a \
  90.         ${ac_cv_have_ipv6} = no ; then
  91.         AC_MSG_ERROR(ipv6 explicitly enabled but not supported)
  92.     fi
  93. else
  94.     AC_MSG_RESULT([disabled])
  95. fi
  96.  
  97. AC_MSG_CHECKING(for altzone)
  98. AC_CACHE_VAL(ac_cv_have_altzone,
  99.     AC_TRY_COMPILE([
  100. #    include <sys/types.h>
  101. #    include <time.h>],
  102.     [int i = altzone],
  103.     ac_cv_have_altzone=yes,
  104.     ac_cv_have_altzone=no))
  105. AC_MSG_RESULT($ac_cv_have_altzone)
  106. if test $ac_cv_have_altzone = yes ; then
  107.     AC_DEFINE(HAVE_ALTZONE)
  108. fi
  109.  
  110. AC_LBL_LIBRARY_NET
  111.  
  112. AC_LBL_BROCCOLI(V_CCOPT, V_INCLS, 1.4.0)
  113.  
  114. if test "$ac_cv_have_broccoli" = yes ; then
  115.     ACLC="aclc"
  116.     dnl XXX don't want this for aclc
  117.     dnl AC_LIBOBJ([broccoli])
  118.     BRODSRCS="broccoli.c"
  119.     V_LIBHDRS="${V_LIBHDRS} broccoli.h"
  120. fi
  121.  
  122. AC_ARG_ENABLE([cforce],
  123.     [AS_HELP_STRING([--disable-cforce],
  124.     [disable cForce support @<:@default=check@:>@])],
  125.     ac_cv_enable_cforce=${enableval})
  126.  
  127. AC_MSG_CHECKING(for cForce)
  128. if test "${ac_cv_enable_cforce}" = "" -o \
  129.     "${ac_cv_enable_cforce}" = yes ; then
  130.     f="/home/cpacket/cForce/bin/cforce_linux.so"
  131.     if test -f ${f}; then
  132.         LIBS="${LIBS} ${f}"
  133.         AC_DEFINE(HAVE_CFORCE)
  134.         CFORCESRCS="cforce.c"
  135.         ac_cv_have_cforce="yes"
  136.     else
  137.         ac_cv_have_cforce="no"
  138.     fi
  139.     f="/home/cpacket/cForce/example_c/cforce.h"
  140.     if test -f ${f}; then
  141.         V_INCLS="$V_INCLS -I`dirname ${f}`"
  142.     fi
  143.     AC_MSG_RESULT(${ac_cv_have_cforce})
  144.  
  145.     if test "${ac_cv_enable_cforce}" = yes -a \
  146.         ${ac_cv_have_cforce} = no ; then
  147.         AC_MSG_ERROR(cForce explicitly enabled but not supported)
  148.     fi
  149. else
  150.     AC_MSG_RESULT([disabled])
  151. fi
  152.  
  153. AC_LBL_TYPE_SIGNAL
  154. AC_LBL_UNION_WAIT
  155.  
  156. VERSION="`cat VERSION`"
  157.  
  158. expect="expect"
  159. AC_PATH_PROG(EXPECT, ${expect}, "")
  160.  
  161. if test -z "$EXPECT" ; then
  162.     AC_MSG_ERROR([${expect} is required for acld to run])
  163. fi
  164.  
  165. python="python"
  166. AC_PATH_PROG(PYTHON, ${python}, "")
  167. if test -z "$PYTHON" ; then
  168.     PYTHON="/usr/bin/env python"
  169. fi
  170.  
  171. AC_LBL_DEVEL(V_CCOPT)
  172. if test -f .devel ; then
  173.     AC_DEFINE(DEBUG)
  174. fi
  175.  
  176. AC_LBL_LD_RUN_PATH
  177.     
  178. if test -r lbl/gnuc.h ; then
  179.     rm -f gnuc.h
  180.     ln -s lbl/gnuc.h gnuc.h
  181. fi
  182.  
  183. PREFIX=${ac_default_prefix}
  184.  
  185. AC_SUBST(ACLC)
  186. AC_SUBST(BROCCOLI_VERSION)
  187. AC_SUBST(BRODSRCS)
  188. AC_SUBST(CFLAGS)
  189. AC_SUBST(CFORCESRCS)
  190. AC_SUBST(CPPFLAGS)
  191. AC_SUBST(EXPECT)
  192. AC_SUBST(INSTALL_START)
  193. AC_SUBST(LDFLAGS)
  194. AC_SUBST(LIBS)
  195. AC_SUBST(PREFIX)
  196. AC_SUBST(PYTHON)
  197. AC_SUBST(VERSION)
  198. AC_SUBST(V_CCOPT)
  199. AC_SUBST(V_ENVIRONMENT)
  200. AC_SUBST(V_INCLS)
  201. AC_SUBST(V_LIBHDRS)
  202.  
  203. scripts="acl.exp aclcompact.sh acld.sh acld-init.d.sh aclfw.sh check_acld.py"
  204. AC_CONFIG_FILES(Makefile ${scripts})
  205. AC_OUTPUT
  206. chmod +x ${scripts}
  207.  
  208. if test -f .devel ; then
  209.     make depend
  210. fi
  211.  
  212. exit 0
  213.