File: configure.in

package info (click to toggle)
libnss-db 2.2.3pre1-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,484 kB
  • sloc: sh: 7,113; ansic: 4,507; makefile: 497; yacc: 318
file content (124 lines) | stat: -rw-r--r-- 2,971 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
dnl Process this file with autoconf to produce a configure script. -*-m4-*-
AC_INIT(src/db-alias.c)
AM_INIT_AUTOMAKE(nss_db, 2.2.3)
AM_CONFIG_HEADER(config.h)

dnl Set of available languages.
ALL_LINGUAS="de nl pl sv"

# Check for a --with-db argument.
AC_ARG_WITH(db, dnl
  --with-db=DIR         find Berkeley DB library and headers with prefix DIR,
	    [dnl
case "$with_db" in
yes|''|no) ;;
*) libdb_include="-I$withval/include"
   libdb_libs="-L$withval/lib" ;;
esac
])
AC_ARG_WITH(db-include, dnl
  --with-db-include=DIR  find Berkeley DB headers in DIR,
            [dnl
case "$with_db_include" in
''|no) ;;
*) libdb_include="-I$withval" ;;
esac
])
AC_ARG_WITH(db-lib, dnl
  --with-db-lib=DIR      find Berkeley DB library in DIR,
            [dnl
case "$with_db_lib" in
''|no) ;;
*) libdb_libs="-L$withval" ;;
esac
])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP			dnl Later checks need this.
AM_DISABLE_STATIC		dnl Makes no sense for a NSS module
AM_PROG_LIBTOOL

DB_CFLAGS="$libdb_include"
DB_LIBS="$libdb_libs"

CPPFLAGS="$CPPFLAGS $DB_CFLAGS"

AC_CHECK_HEADER(db.h,, AC_MSG_ERROR([
*** Could not find Berkeley DB headers.]))

AC_CHECK_LIB(db, db_version,, AC_MSG_ERROR([
*** Could not find Berkeley DB library.]))

AC_CACHE_CHECK([Berkeley DB version], nss_db_cv_db_version,
  [AC_TRY_CPP(
    [
#    include <db.h>
#    ifndef DB_VERSION_STRING
#     error "Unknown"
#    endif
#    if DB_VERSION_MAJOR < 2
#     error "Too old"
#    endif
#    if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 4
#     error "Too old"
#    endif
    ],
    nss_db_cv_db_version="ok",
    nss_db_cv_db_version="not ok")
  ])

if test "$nss_db_cv_db_version" != "ok"; then
AC_MSG_ERROR([
*** Unsupported Berkeley DB version detected.])
fi

AC_ARG_WITH(selinux,AC_HELP_STRING(--with-selinux,[enable SELinux support [[default=auto]]]),
selinux=$withval,
selinux=auto)

libsave="$LIBS"
if test x$selinux != xno ; then
  AC_CHECK_HEADERS(selinux/selinux.h)
  if test x$ac_cv_header_selinux_selinux_h = xno ; then
    if test x$selinux = xyes ; then
      AC_MSG_ERROR([SELinux not detected])
    else
      AC_MSG_WARN([SELinux not detected])
      selinux=no
    fi
  fi
fi

if test x$selinux != xno ; then
  AC_CHECK_FUNC(setfscreatecon,,[AC_CHECK_LIB(selinux,setfscreatecon)])
  if test x$ac_cv_func_setfscreatecon = xno ; then
    if test x$ac_cv_lib_selinux_setfscreatecon = xno ; then
      if test x$selinux = xyes ; then
        AC_MSG_ERROR([SELinux not detected])
      else
        AC_MSG_WARN([SELinux not detected])
        selinux=no
      fi
    fi
  fi
fi
if test x$selinux != xno ; then
  AC_DEFINE(SELINUX,1,[Define to have makedb set SELinux file contexts on created files.])
fi

SELINUX_LIBS="$LIBS"
LIBS="$libsave"

slibdir='${libdir}'

AC_SUBST(DB_CFLAGS)
AC_SUBST(DB_LIBS)
AC_SUBST(SELINUX_LIBS)
AC_SUBST(slibdir)

dnl Internationalization macros.
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.18.1)

AC_OUTPUT([Makefile src/Makefile po/Makefile.in])