PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/config/ac_genders.m4

https://code.google.com/
m4 | 60 lines | 35 code | 7 blank | 18 comment | 0 complexity | 4bc9674308e84ddeae71258ee9c49b65 MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Jim Garlick <garlick@llnl.gov>
 6#
 7#  SYNOPSIS:
 8#    AC_GENDERS
 9#
10#  DESCRIPTION:
11#    Checks for genders support. 
12#
13#  WARNINGS:
14#    This macro must be placed after AC_PROG_CC or equivalent.
15##*****************************************************************************
16
17AC_DEFUN([AC_GENDERS],
18[
19  #
20  # Check for whether to include libgenders module
21  #
22  AC_MSG_CHECKING([for whether to build genders module])
23  AC_ARG_WITH([genders],
24    AC_HELP_STRING([--with-genders],
25      [Build genders module for libgenders support]),
26    [ case "$withval" in
27        no)  ac_with_libgenders=no ;;
28        yes) ac_with_libgenders=yes ;;
29        *)   AC_MSG_RESULT([doh!])
30             AC_MSG_ERROR([bad value "$withval" for --with-genders]) ;;
31      esac
32    ]
33  )
34  AC_MSG_RESULT([${ac_with_libgenders=no}])
35    
36  if test "$ac_with_libgenders" = "yes"; then
37    AC_CHECK_LIB([genders], [genders_handle_create], 
38                 [ac_have_libgenders=yes], [])
39
40    if test "$ac_have_libgenders" != "yes" ; then
41       AC_MSG_NOTICE([Cannot support genders without libgenders])
42    fi 
43
44    if test "$ac_have_libgenders" = "yes"; then
45      AC_ADD_STATIC_MODULE("genders")
46      AC_DEFINE([HAVE_LIBGENDERS], [1], [Define if you have libgenders.])
47      GENDERS_LIBS="-lgenders"
48
49      AC_CHECK_LIB([genders], [genders_query],
50          [AC_DEFINE( [HAVE_GENDERS_QUERY], [1],
51                      [Define if genders library has genders_query.])],
52          [ac_have_genders_query=no]
53      )
54    fi
55
56  fi
57
58  AC_SUBST(HAVE_LIBGENDERS)
59  AC_SUBST(GENDERS_LIBS)
60])