~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina5/tina-libs/m4/ac_find_tina.m4

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 dnl
  2 dnl AC_FIND_TINA : find the tina library system
  3 dnl (Note this file should be kept in sync with ac_find_tina.m4
  4 dnl  in the tina-tools/m4 directory)
  5 dnl
  6 dnl a.lacey@man.ac.uk
  7 dnl
  8 dnl The variables provided are :
  9 dnl     tina_libraries          
 10 dnl     tina_includes             
 11 dnl
 12 dnl $Id: ac_find_tina.m4,v 1.3 2004/11/30 16:30:33 paul Exp $
 13 dnl
 14 AC_DEFUN([AC_FIND_TINA],
 15 [
 16 
 17 AC_MSG_CHECKING(for tina libs)
 18 
 19 tina_includes=
 20 tina_libraries=
 21 with_tina="no"
 22 
 23 AC_ARG_WITH(tina-includes,
 24 [  --with-tina-includes=DIR    tina include files are in DIR],
 25 tina_includes="$withval")
 26 
 27 AC_ARG_WITH(tina-libraries,
 28 [  --with-tina-libraries=DIR   tina libraries are in DIR],
 29 tina_libraries="$withval")
 30 
 31 #
 32 # search for tina include files
 33 #
 34 
 35 if test "$tina_includes" = ""; then
 36 AC_CACHE_VAL(ac_cv_tina_includes,
 37 [
 38 ac_tina_save_LIBS="$LIBS"
 39 ac_tina_save_INCLUDES="$INCLUDES"
 40 ac_tina_save_CPPFLAGS="$CPPFLAGS"
 41 ac_tina_save_LDFLAGS="$LDFLAGS"
 42 #
 43 LIBS="$LIBS"
 44 INCLUDES="$INCLUDES"
 45 CPPFLAGS="$CPPFLAGS"
 46 LDFLAGS="$LDFLAGS"
 47 #
 48 ac_cv_tina_includes="none"
 49 AC_TRY_COMPILE([#include <tina/sys/sysDef.h>],[int a;],
 50 [
 51 # tina/sys/sysDef.h is in the standard search path.
 52 ac_cv_tina_includes=
 53 ],
 54 [
 55 # tina/sys/sysDef.h is not in the standard search path.
 56 # Locate it and put its directory in `tina_includes'
 57 #
 58 # Lets guess where things might be
 59 # Its usual to have tina-libs<version> alongside the tina-tools for instance
 60 # or maybe the includes are in a standard place?
 61 ac_tina_curdir=`pwd`
 62 for dir in "${src}" "${src}"/* "${src}"/../tina-libs* \
 63            "${ac_tina_curdir}" "${ac_tina_curdir}"/* "${ac_tina_curdir}"/../tina-libs* \
 64                         /usr/local/tina-libs* /usr/tina-libs* /usr/local/src/tina-libs* /usr/src/tina-libs* \
 65                         /usr/include /usr/local/include /usr/local/*/include \
 66             /usr/include/* /usr/local/include/*; do
 67 if test -f "$dir/tina/sys/sysDef.h"; then
 68 ac_cv_tina_includes="$dir"
 69 break
 70 fi
 71 done
 72 ])
 73 #
 74 LIBS="$ac_tina_save_LIBS"
 75 INCLUDES="$ac_tina_save_INCLUDES"
 76 CPPFLAGS="$ac_tina_save_CPPFLAGS"
 77 LDFLAGS="$ac_tina_save_LDFLAGS"
 78 ])
 79 tina_includes="$ac_cv_tina_includes"
 80 fi
 81 
 82 
 83 #
 84 # Now for the libraries.
 85 #
 86 if test "$tina_libraries" = ""; then
 87 AC_CACHE_VAL(ac_cv_tina_libraries,
 88 [
 89 ac_tina_save_LIBS="$LIBS"
 90 ac_tina_save_INCLUDES="$INCLUDES"
 91 ac_tina_save_CPPFLAGS="$CPPFLAGS"
 92 ac_tina_save_LDFLAGS="$LDFLAGS"
 93 
 94 #
 95 # try and link to the tinaSys library
 96 #
 97 LIBS="-ltinaSys $LIBS"
 98 INCLUDES="$INCLUDES $tina_includes"
 99 CPPFLAGS="$CPPFLAGS"
100 LDFLAGS="$LDFLAGS"
101 #
102 ac_cv_tina_libraries="none"
103 AC_TRY_LINK([#include <tina/sys/sysPro.h>],[ralloc(2);],
104 [
105 # if this works libtinaSys is in the standard search path.
106 ac_cv_tina_libraries=
107 ],
108 [
109 # libtinaSys not in the standard search path.
110 # Locate it and put its directory in `tina_libraries'
111 #
112 # As with the includes we look in "that kind of place"!
113 #
114 for dir in "${src}"/lib "${src}"/*/lib "${src}"/../tina-libs*/lib \
115            "${ac_tina_curdir}"/lib "${ac_tina_curdir}"/*/lib "${ac_tina_curdir}"/../tina-libs*/lib \
116                         /usr/local/tina-libs* /usr/tina-libs* /usr/local/src/tina-libs* /usr/src/tina-libs* \
117                         /usr/lib /usr/local/lib /usr/local/*/lib \
118             /usr/lib/* /usr/local/*/lib; do
119 if test -d "$dir" && test "`ls $dir/libtinaSys.* 2> /dev/null`" != ""; then
120 ac_cv_tina_libraries="$dir"
121 break
122 fi
123 done
124 ])
125 #
126 LIBS="$ac_tina_save_LIBS"
127 INCLUDES="$ac_tina_save_INCLUDES"
128 CPPFLAGS="$ac_tina_save_CPPFLAGS"
129 LDFLAGS="$ac_tina_save_LDFLAGS"
130 ])
131 #
132 tina_libraries="$ac_cv_tina_libraries"
133 fi
134 #
135 
136 #
137 # make variables accessible
138 #
139 
140 if test "$tina_includes" = "" || test "$tina_libraries" = ""; then
141         with_tina="no"
142         AC_MSG_RESULT(no)
143 else
144         with_tina="yes"
145         AC_MSG_RESULT(yes)
146 fi
147 
148 AC_SUBST(tina_includes)
149 AC_SUBST(tina_libraries)
150 AC_SUBST(with_tina)
151 ])

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.