~hrvojem/percona-pam-for-mysql/theme-makefile

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Ignacio Nin
  • Date: 2011-10-25 17:46:19 UTC
  • mfrom: (5.2.5 percona-pam-for-mysql)
  • Revision ID: ignacio.nin@percona.com-20111025174619-282sxunqwow5522m
Autoconf, RPM support

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
 
 
3
# (C) 2011 Percona Inc.
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; version 2 of the License.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program; if not, write to the Free Software
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
17
#
 
18
#
 
19
AC_PREREQ([2.61])
 
20
AC_INIT([Percona PAM plugin], [0.1], [mysql-dev@percona.com])
 
21
AC_CONFIG_SRCDIR([src/lib_auth_pam_client.h])
 
22
AM_INIT_AUTOMAKE
 
23
 
 
24
# Checks for programs.
 
25
AC_PROG_CXX
 
26
AC_PROG_AWK
 
27
AC_PROG_CC
 
28
AC_PROG_CPP
 
29
AC_PROG_INSTALL
 
30
AC_PROG_LN_S
 
31
AC_PROG_MAKE_SET
 
32
AC_PROG_RANLIB
 
33
AC_PROG_LIBTOOL
 
34
 
 
35
AC_CHECK_PROGS([BZR], [bzr])
 
36
 
 
37
# mysql_config
 
38
AC_ARG_WITH([mysql_config],
 
39
    AC_HELP_STRING(
 
40
        [--with-mysql_config=PROGRAM],
 
41
        [location of the mysql_config program]),
 
42
    [mysql_config_prog="$withval"])
 
43
AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], [$mysql_config_prog])
 
44
 
 
45
if test "x$MYSQL_CONFIG" = "x"
 
46
then
 
47
    AC_MSG_ERROR([Unable to find mysql_config. Please install or specify.])
 
48
fi
 
49
 
 
50
# Checks for libraries.
 
51
AC_CHECK_LIB([pam], [pam_start], ,
 
52
    AC_MSG_ERROR(
 
53
        [Unable to find PAM. Please install the PAM development libraries])
 
54
)
 
55
 
 
56
# Checks for header files.
 
57
MYSQL_INCLUDES="$(mysql_config --include)"
 
58
 
 
59
save_CFLAGS="${CFLAGS}"
 
60
save_CPPFLAGS="${CPPFLAGS}"
 
61
 
 
62
CFLAGS="${CFLAGS} ${MYSQL_INCLUDES}"
 
63
CPPFLAGS="${CPPFLAGS} ${MYSQL_INCLUDES}"
 
64
 
 
65
AC_CHECK_HEADERS([string.h unistd.h])
 
66
AC_CHECK_HEADER([mysql/plugin.h], [],
 
67
    AC_MSG_ERROR(
 
68
       [Unable to find mysql/plugin.h. Please install the mysql
 
69
        development headers]))
 
70
 
 
71
CFLAGS="${save_CFLAGS}"
 
72
CPPFLAGS="${save_CPPFLAGS}"
 
73
 
 
74
AC_SUBST([MYSQL_INCLUDES])
 
75
 
 
76
# Checks for typedefs, structures, and compiler characteristics.
 
77
 
 
78
# Checks for library functions.
 
79
AC_FUNC_MALLOC
 
80
AC_CHECK_FUNCS([getpass strchr strdup])
 
81
 
 
82
# Get the plugin dir
 
83
PLUGINDIR=$([$MYSQL_CONFIG --plugindir])
 
84
AC_SUBST([PLUGINDIR])
 
85
 
 
86
# Get the revision if bzr is present
 
87
if test "x${BZR}" != "x"
 
88
then
 
89
    if cd "$(dirname "$0")" && bzr status >& /dev/null
 
90
    then
 
91
        REVISION="$(cd "$(dirname "$0")"; ${BZR} log -r-1 | grep ^revno: | cut -d ' ' -f 2)"
 
92
    else
 
93
        REVISION=0
 
94
    fi
 
95
else
 
96
    REVISION=0
 
97
fi
 
98
 
 
99
AC_SUBST([REVISION])
 
100
 
 
101
# Output files
 
102
AC_CONFIG_FILES([Makefile
 
103
                 src/Makefile
 
104
                 build/build-binary.sh
 
105
                 build/percona-pam-plugin.spec])
 
106
AC_OUTPUT