File: configure.ac

package info (click to toggle)
acr38 1.7.11-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 1,804 kB
  • ctags: 574
  • sloc: sh: 9,151; ansic: 4,031; makefile: 52
file content (223 lines) | stat: -rw-r--r-- 5,812 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.52)
AC_INIT([ACR38UDriver], [1.7.11])
AC_CONFIG_SRCDIR([src/driver/AdmHndlr.c])
AC_CONFIG_AUX_DIR(build)
AC_CONFIG_HEADER([config.h])

# Default install dir
AC_PREFIX_DEFAULT(/usr/local)

# Include commands that automake needs
AM_INIT_AUTOMAKE

AC_ARG_ENABLE(debug,
	AC_HELP_STRING([--enable-debug],[enable debug messages from driver PCSC handler]),
	[ case "${enableval}" in
		yes)
			debug=true ;;
		no)
			debug=false ;;
		*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
	esac],
	[debug=false])

if test x${debug} = xtrue ; then
	AC_DEFINE(PCSC_DEBUG, 1, [enable PCSC debug messaging.])
fi

AC_ARG_ENABLE(debugt1,
	AC_HELP_STRING([--enable-debugT1],[enable debug messages from driver T1 handler]),
	[ case "${enableval}" in
		yes)
			debug=true ;;
		no)
			debug=false ;;
		*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
	esac],
	[debug=false])

if test x${debug} = xtrue ; then
	AC_DEFINE(T1_DEBUG, 1, [enable T1 debug messaging.])
fi

AC_ARG_ENABLE(debugusb,
	AC_HELP_STRING([--enable-debugUSB],[enable debug messages from driver USB handler]),
	[ case "${enableval}" in
		yes)
			debug=true ;;
		no)
			debug=false ;;
		*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
	esac],
	[debug=false])

if test x${debug} = xtrue ; then
	AC_DEFINE(USBDEBUG, 1, [enable USB debug messaging.])
fi

# --enable-pcscdropdir=DIR	; pcsclite installation directory
AC_ARG_ENABLE([pcscdropdir],
            AS_HELP_STRING([--enable-pcscdropdir=DIR],
                           [installation directory of PCSCLITE (default to PREFIX)]),
            [pcscdropdir=$enableval],
            [pcscdropdir=false])

if test "${pcscdropdir}" = false ; then
	if test "$prefix" = NONE ; then
		pcscdropdir="$ac_default_prefix"
	else
		pcscdropdir="$prefix"
	fi
fi

# removed by ZETES
# AC_SUBST([PKG_PCSC_CONFIG_PATH],[$pcscdropdir/lib/pkgconfig])
# removed by ZETES
# AC_SUBST([PKG_PCSCLITE],[$pcscdropdir/lib/pkgconfig/libpcsclite.pc])

# added by ZETES ...
PKG_PCSCLITE="libpcsclite"
# ... added by ZETES

# Check if pkg-config exists
AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])
if test "$PKGCONFIG" = "yes"; then
	if ! `pkg-config --print-errors --atleast-version=1.2.0 $PKG_PCSCLITE`
	then
		AC_MSG_ERROR([install pcsc-lite 1.2.0 or later])
	fi
fi

# Check for libusb 0.1.12
PKG_LIBUSB="libusb"
if test "$PKGCONFIG" = "yes"; then
	if ! `pkg-config --print-errors --atleast-version=0.1.12 $PKG_LIBUSB`
	then
		AC_MSG_ERROR([install libusb 0.1.12 or later])
	fi
fi

# --enable-usbdropdir=DIR
AC_ARG_ENABLE([usbdropdir],
			AC_HELP_STRING([--enable-usbdropdir=DIR],
						   [directory containing USB drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
			[usbdropdir="${enableval}"],
			[usbdropdir=false])

if test "${usbdropdir}" = false ; then
	if test "$PKGCONFIG" = yes ; then
		usbdropdir=`pkg-config $PKG_PCSCLITE --variable=usbdropdir`
	else
		usbdropdir=""
	fi
	if test -z "$usbdropdir" ; then
		if test "$prefix" = NONE ; then
			usbdropdir="$ac_default_prefix/pcsc/drivers"
		else
			usbdropdir="$prefix/pcsc/drivers"
		fi
	fi
fi

AC_SUBST(usbdropdir)

AC_MSG_RESULT([USB drop directory      : $usbdropdir])
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])

#AC_SUBST(CTRLLIBCFLAGS)
#AC_SUBST(CTRLLIBLIBS)
#
#if test "$prefix" = NONE ; then
#	CTRLLIBPKG=$ac_default_prefix/lib/pkgconfig/libacr38ucontrol.pc
#else
#	CTRLLIBPKG=$prefix/lib/pkgconfig/libacr38ucontrol.pc
#fi
#
#CTRLLIBCFLAGS=`pkg-config --cflags $(CTRLLIBPKG)`
#CTRLLIBLIBS=`pkg-config --libs $(CTRLLIBPKG)`

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lpcsclite':
#AC_CHECK_LIB([pcsclite], [main])
# FIXME: Replace `main' with a function in `-lpthread':
#AC_CHECK_LIB([pthread], [main])

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h memory.h stdlib.h string.h sys/ioctl.h syslog.h unistd.h])

# Test if pcsclite-1.2.9betaX is installed
#if test -d $pcsclite_inc/PCSC; then
#	echo "PCSCLITE-1.2.9 or above is installed"
#	pcsclite_inc="$pcsclite_inc/PCSC"
#else
#	echo "PCSCLITE-1.2.0 is installed"
#fi

# Setup the compiler and linker flag
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS `pkg-config --cflags $PKG_PCSCLITE`"
CFLAGS="$CFLAGS `pkg-config --cflags $PKG_LIBUSB`"

# Check for pcsclite header files
# removed by ZETES NO_PCSC_MSG="Please install PCSCLITE 1.2.0 or later before building the driver!!"
# removed by ZETES AC_CHECK_HEADER([pcsclite.h],,[AC_MSG_ERROR([$NO_PCSC_MSG])],[#include <pcsclite.h>])

# removed by ZETES CFLAGS=$OLD_CFLAGS

AC_SUBST(LIBPCSCLITE)
LIBPCSCLITE=`pkg-config --libs $PKG_PCSCLITE`

AC_SUBST(LIBUSB)
LIBUSB=`pkg-config --libs $PKG_LIBUSB`

# Select OS specific versions of source files.
AC_SUBST(BUNDLE_HOST)
AC_SUBST(DYN_LIB_EXT)
case "$host" in
*-*-darwin*)
	BUNDLE_HOST="MacOS"
	DYN_LIB_EXT="dylib"
	AM_CONDITIONAL(NEED_PARSER, true)

	AC_SUBST(COREFOUNDATION)
	COREFOUNDATION="-Wl,-framework,CoreFoundation"

	AC_SUBST(IOKIT)
	IOKIT="-Wl,-framework,IOKit"
	if test "$GCC" = "yes"; then
		CFLAGS="$CFLAGS -no-cpp-precomp"
	fi
	;;
*)
	BUNDLE_HOST="Linux"
	DYN_LIB_EXT="so"
	AM_CONDITIONAL(NEED_PARSER, false)
esac

CFLAGS="$CFLAGS -Wall"

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([select strerror strncpy memcpy])

AC_CONFIG_FILES([Makefile
                 src/driver/Makefile
                 src/controllib/Makefile
                 src/controllib/libacr38ucontrol.pc])

AC_OUTPUT