File: configure.ac

package info (click to toggle)
pkcs11-data 0.7.3-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,496 kB
  • ctags: 36
  • sloc: sh: 9,174; ansic: 853; makefile: 49
file content (141 lines) | stat: -rw-r--r-- 3,296 bytes parent folder | download
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#
# Copyright (c) 2005-2008 Alon Bar-Lev <alon.barlev@gmail.com>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (see the file COPYING.GPL included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#

AC_PREREQ([2.60])

define([PACKAGE_VERSION_MAJOR], [0])
define([PACKAGE_VERSION_MINOR], [7])
define([PACKAGE_VERSION_FIX], [3])

AC_INIT([pkcs11-data], [PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX])
AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([pkcs11-data.c])

PKCS11_DATA_VERSION_MAJOR="PACKAGE_VERSION_MAJOR"
PKCS11_DATA_VERSION_MINOR="PACKAGE_VERSION_MINOR"
PKCS11_DATA_VERSION_FIX="PACKAGE_VERSION_FIX"

AC_CANONICAL_HOST

AC_ARG_WITH([cygwin-native],
	[AC_HELP_STRING([--with-cygwin-native], [Compile native win32])],
	[CYGWIN_NATIVE="${withval}"],
	[CYGWIN_NATIVE="no"]
)

WIN32="no"
CYGWIN="no"
case "${host}" in
	*-mingw32*)
		WIN32="yes"
	;;
	*-cygwin*)
		AC_MSG_CHECKING([cygwin mode to use])
		CYGWIN="yes"
		if test "${CYGWIN_NATIVE}" = "yes"; then
			AC_MSG_RESULT([Using native win32])
			CFLAGS="${CFLAGS} -mno-cygwin"
			WIN32="yes"
		else
			AC_MSG_RESULT([Using cygwin])
		fi
	;;
	*)
	;;
esac

AC_ARG_ENABLE(
	[strict],
	[AC_HELP_STRING([--enable-strict], [enable strict compiler warnings (debugging option)])],
	,
	[enable_strict="no"]
)

AC_ARG_ENABLE(
	[pedantic],
	[AC_HELP_STRING([--enable-pedantic], [nable pedantic compiler warnings (debugging option)])],
	,
	[enable_pedantic="no"]
)

AC_PROG_CC
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
AC_LIBTOOL_RC
AC_PROG_LIBTOOL

if test "${WIN32}" = "yes"; then
	AC_CHECK_PROGS([MAN2HTML], [man2html])
	test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
fi

AC_FUNC_MKTIME
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([ \
	gettimeofday memmove memset socket strchr strdup strerror strrchr \
	snprintf \
])

PKG_CHECK_MODULES([PKCS11_HELPER], [libpkcs11-helper-1 >= 1.02],, [AC_MSG_ERROR([Cannot locate pkcs11-helper])])
PKCS11_HELPER_1_CHECK_FEATURES([data token])

# Checks for header files.
AC_HEADER_STDC
AC_C_CONST
AC_C_VOLATILE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

AC_CHECK_HEADERS([[ \
	stdio.h \
	stdlib.h \
	stdargs.h \
	malloc.h \
	ctype.h \
	string.h \
	errno.h \
]])
AC_CHECK_HEADERS([ \
	signal.h \
	unistd.h \
])

AC_SUBST([PKCS11_DATA_VERSION_MAJOR])
AC_SUBST([PKCS11_DATA_VERSION_MINOR])
AC_SUBST([PKCS11_DATA_VERSION_FIX])

AM_CONDITIONAL([WIN32], [test "${WIN32}" = yes])

if test "${enable_pedantic}" = "yes"; then
	enable_strict="yes";
	CFLAGS="${CFLAGS} -pedantic"
fi
if test "${enable_strict}" = "yes"; then
	CFLAGS="${CFLAGS} -Wall -Wextra"
fi

AC_OUTPUT([
	Makefile
	versioninfo.rc
])