"Fossies" - the Fresh Open Source Software Archive

Member "mpack-1.6/cmulocal/nadine.m4" (21 Dec 2002, 4463 Bytes) of package /linux/misc/old/mpack-1.6.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 nadine.m4--The nadine event library
    2 dnl Derrick Brashear
    3 dnl from KTH kafs and Arla
    4 dnl $Id: nadine.m4,v 1.5 2002/12/21 18:44:25 cg2v Exp $
    5 
    6 AC_DEFUN(CMU_NADINE_INC_WHERE1, [
    7 saved_CPPFLAGS=$CPPFLAGS
    8 CPPFLAGS="$saved_CPPFLAGS -I$1"
    9 CMU_CHECK_HEADER_NOCACHE(libevent/libevent.h,
   10 ac_cv_found_event_inc=yes,
   11 ac_cv_found_event_inc=no)
   12 CPPFLAGS=$saved_CPPFLAGS
   13 ])
   14 
   15 AC_DEFUN(CMU_NADINE_INC_WHERE, [
   16    for i in $1; do
   17       AC_MSG_CHECKING(for nadine headers in $i)
   18       CMU_NADINE_INC_WHERE1($i)
   19 dnl      CMU_TEST_INCPATH($i, ssl)
   20 dnl   CMU_TEST_INCPATH isn't very versatile
   21       if test "$ac_cv_found_event_inc" = "yes"; then
   22         if test \! -f $i/libevent/libevent.h ; then
   23           ac_cv_found_event_inc=no
   24         fi
   25       fi
   26       if test "$ac_cv_found_event_inc" = "yes"; then
   27         ac_cv_event_where_inc=$i
   28         AC_MSG_RESULT(found)
   29         break
   30       else
   31         AC_MSG_RESULT(not found)
   32       fi
   33     done
   34 ])
   35 
   36 AC_DEFUN(CMU_NADINE_LIB_WHERE1, [
   37 saved_LIBS=$LIBS
   38 LIBS="$saved_LIBS -L$1 -levent"
   39 AC_TRY_LINK(,
   40 [libevent_Initialize();],
   41 [ac_cv_found_event_lib=yes],
   42 ac_cv_found_event_lib=no)
   43 LIBS=$saved_LIBS
   44 ])
   45 
   46 AC_DEFUN(CMU_NADINE_LIB_WHERE, [
   47    for i in $1; do
   48       AC_MSG_CHECKING(for event libraries in $i)
   49       CMU_NADINE_LIB_WHERE1($i)
   50       dnl deal with false positives from implicit link paths
   51       CMU_TEST_LIBPATH($i, event)
   52       if test "$ac_cv_found_event_lib" = "yes" ; then
   53         ac_cv_event_where_lib=$i
   54         AC_MSG_RESULT(found)
   55         break
   56       else
   57         AC_MSG_RESULT(not found)
   58       fi
   59     done
   60 ])
   61 
   62 AC_DEFUN(CMU_NADINE, [
   63 AC_REQUIRE([CMU_SOCKETS])
   64 AC_ARG_WITH(nadine,
   65 	[  --with-nadine=PREFIX      Compile with nadine libevent support],
   66 	[if test "X$with_nadine" = "X"; then
   67 		with_nadine=yes
   68 	fi])
   69 AC_ARG_WITH(nadine-lib,
   70 	[  --with-nadine-lib=dir     use nadine libraries in dir],
   71 	[if test "$withval" = "yes" -o "$withval" = "no"; then
   72 		AC_MSG_ERROR([No argument for --with-nadine-lib])
   73 	fi])
   74 AC_ARG_WITH(nadine-include,
   75 	[  --with-nadine-include=dir use nadine headers in dir],
   76 	[if test "$withval" = "yes" -o "$withval" = "no"; then
   77 		AC_MSG_ERROR([No argument for --with-nadine-include])
   78 	fi])
   79 
   80         if test "$with_ucdsnmp" = "no" ; then
   81              AC_MSG_WARN([Nadine requires UCD SNMP. Disabling Nadine support])
   82              with_nadine=no
   83              with_nadine_lib=no
   84              with_nadine_include=no
   85         fi
   86 	if test "X$with_nadine" != "X"; then
   87 	  if test "$with_nadine" != "yes" -a "$with_nadine" != no; then
   88 	    ac_cv_event_where_lib=$with_nadine/lib
   89 	    ac_cv_event_where_inc=$with_nadine/include
   90 	  fi
   91 	fi
   92 
   93 	if test "$with_nadine" != "no"; then 
   94 	  if test "X$with_nadine_lib" != "X"; then
   95 	    ac_cv_event_where_lib=$with_nadine_lib
   96 	  fi
   97 	  if test "X$ac_cv_event_where_lib" = "X"; then
   98 	    CMU_NADINE_LIB_WHERE(/usr/local/lib /usr/ng/lib /usr/lib)
   99 	  fi
  100 
  101 	  if test "X$with_nadine_include" != "X"; then
  102 	    ac_cv_event_where_inc=$with_nadine_include
  103 	  fi
  104 	  if test "X$ac_cv_event_where_inc" = "X"; then
  105 	    CMU_NADINE_INC_WHERE(/usr/local/include /usr/ng/include /usr/include)
  106 	  fi
  107 	fi
  108 
  109 	AC_MSG_CHECKING(whether to include nadine)
  110 	if test "X$ac_cv_event_where_lib" = "X" -a "X$ac_cv_event_where_inc" = "X"; then
  111 	  ac_cv_found_event=no
  112 	  AC_MSG_RESULT(no)
  113 	else
  114 	  ac_cv_found_event=yes
  115 	  AC_MSG_RESULT(yes)
  116 	  NADINE_INC_DIR=$ac_cv_event_where_inc
  117 	  NADINE_LIB_DIR=$ac_cv_event_where_lib
  118 	  NADINE_INC_FLAGS="-I${NADINE_INC_DIR}"
  119 	  NADINE_LIB_FLAGS="-L${NADINE_LIB_DIR} -levent"
  120 	  if test "X$RPATH" = "X"; then
  121 		RPATH=""
  122 	  fi
  123 	  case "${host}" in
  124 	    *-*-linux*)
  125 	      if test "X$RPATH" = "X"; then
  126 	        RPATH="-Wl,-rpath,${NADINE_LIB_DIR}"
  127 	      else 
  128  		RPATH="${RPATH}:${NADINE_LIB_DIR}"
  129 	      fi
  130 	      ;;
  131 	    *-*-hpux*)
  132 	      if test "X$RPATH" = "X"; then
  133 	        RPATH="-Wl,+b${NADINE_LIB_DIR}"
  134 	      else 
  135 		RPATH="${RPATH}:${NADINE_LIB_DIR}"
  136 	      fi
  137 	      ;;
  138 	    *-*-irix*)
  139 	      if test "X$RPATH" = "X"; then
  140 	        RPATH="-Wl,-rpath,${NADINE_LIB_DIR}"
  141 	      else 
  142 		RPATH="${RPATH}:${NADINE_LIB_DIR}"
  143 	      fi
  144 	      ;;
  145 	    *-*-solaris2*)
  146 	      if test "$ac_cv_prog_gcc" = yes; then
  147 		if test "X$RPATH" = "X"; then
  148 		  RPATH="-Wl,-R${NADINE_LIB_DIR}"
  149 		else 
  150 		  RPATH="${RPATH}:${NADINE_LIB_DIR}"
  151 		fi
  152 	      else
  153 	        RPATH="${RPATH} -R${NADINE_LIB_DIR}"
  154 	      fi
  155 	      ;;
  156 	  esac
  157 	  AC_SUBST(RPATH)
  158 	fi
  159 	AC_SUBST(NADINE_INC_DIR)
  160 	AC_SUBST(NADINE_LIB_DIR)
  161 	AC_SUBST(NADINE_INC_FLAGS)
  162 	AC_SUBST(NADINE_LIB_FLAGS)
  163 	])
  164