Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 783 lines (707 sloc) 19.516 kb
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
1 dnl -*- mode: m4; -*-
2
555dcd9 Revert autoconf version prereq
alonbl authored
3 AC_PREREQ(2.60)
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
4
5 define([PACKAGE_VERSION_MAJOR], [0])
6fd2220 Bump the version number
martin authored
6 define([PACKAGE_VERSION_MINOR], [12])
7 define([PACKAGE_VERSION_FIX], [0])
450e1fc Merge [3794:3803/trunk]
martin authored
8 define([PACKAGE_SUFFIX], [-svn])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
9
78ac13a Add PACKAGE_SUFFIX
alonbl authored
10 AC_INIT([opensc],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
11 AC_CONFIG_AUX_DIR([.])
7d6cf6b Prepare for libtool-2
alonbl authored
12 AC_CONFIG_HEADERS([config.h])
a9db36f Rename aclocal->m4 to be more standard
alonbl authored
13 AC_CONFIG_MACRO_DIR([m4])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
14 AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
15
16 OPENSC_VERSION_MAJOR="PACKAGE_VERSION_MAJOR"
17 OPENSC_VERSION_MINOR="PACKAGE_VERSION_MINOR"
18 OPENSC_VERSION_FIX="PACKAGE_VERSION_FIX"
19
20 # LT Version numbers, remember to change them just *before* a release.
21 # (Code changed: REVISION++)
f49f765 Fix libtool versioning issues
alonbl authored
22 # (Oldest interface removed: OLDEST++)
23 # (Interfaces added: CURRENT++, REVISION=0)
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
24 OPENSC_LT_CURRENT="2"
f49f765 Fix libtool versioning issues
alonbl authored
25 OPENSC_LT_OLDEST="2"
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
26 OPENSC_LT_REVISION="0"
27 OPENSC_LT_AGE="0"
f49f765 Fix libtool versioning issues
alonbl authored
28 OPENSC_LT_AGE="$((${OPENSC_LT_CURRENT}-${OPENSC_LT_OLDEST}))"
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
29
30 AC_CONFIG_SRCDIR([src/libopensc/sc.c])
31
32 AC_CANONICAL_HOST
33 AC_PROG_CC
34 PKG_PROG_PKG_CONFIG
35 AC_C_BIGENDIAN
36
37 AC_MSG_CHECKING([svn checkout])
87db3c9 More separate srcdir fixups
alonbl authored
38 if test -e "${srcdir}/packaged"; then
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
39 svn_checkout="no"
40 else
41 svn_checkout="yes"
42 fi
43 AC_MSG_RESULT([${svn_checkout}])
44
45 AC_ARG_WITH(
46 [cygwin-native],
7d6cf6b Prepare for libtool-2
alonbl authored
47 [AS_HELP_STRING([--with-cygwin-native],[compile native win32])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
48 ,
49 [with_cygwin_native="no"]
50 )
51
52 dnl Check for some target-specific stuff
53 test -z "${WIN32}" && WIN32="no"
54 test -z "${CYGWIN}" && CYGWIN="no"
55 case "${host}" in
56 *-*-hpux*)
57 CPPFLAGS="${CPPFLAGS} -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
58 ;;
59 *-*-solaris*)
60 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
61 LDFLAGS="${LDFLAGS} -L/usr/local/lib -R/usr/local/lib"
62 need_dash_r="1"
63 ;;
64 *-*-sunos4*)
65 CPPFLAGS="${CPPFLAGS} -DSUNOS4"
66 ;;
67 *-*-aix*)
68 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
69 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
70 if test "${LD}" != "gcc" -a -z "${blibpath}"; then
71 blibpath="/usr/lib:/lib:/usr/local/lib"
72 fi
73 ;;
74 *-*-osf*)
75 CPPFLAGS="${CPPFLAGS} -D_POSIX_PII_SOCKET"
76 ;;
77 *-*-darwin*)
c9c6f9f Correct iconv support
alonbl authored
78 LIBS="${LIBS} -Wl,-framework,CoreFoundation"
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
79 if test "${GCC}" = "yes"; then
80 CFLAGS="${CFLAGS} -no-cpp-precomp"
81 fi
82 ;;
bb6f6f7 mingw32->mingw*
alonbl authored
83 *-mingw*|*-winnt*)
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
84 WIN32="yes"
85 CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
f49f765 Fix libtool versioning issues
alonbl authored
86 WIN_LIBPREFIX="lib"
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
87 ;;
88 *-cygwin*)
89 AC_MSG_CHECKING([cygwin mode to use])
90 CYGWIN="yes"
91 if test "${with_cygwin_native}" = "yes"; then
92 AC_MSG_RESULT([Using native win32])
93 CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
94 CFLAGS="${CFLAGS} -mno-cygwin"
95 WIN32="yes"
96 else
97 AC_MSG_RESULT([Using cygwin])
98 CPPFLAGS="${CPPFLAGS} -DCRYPTOKI_FORCE_WIN32"
f49f765 Fix libtool versioning issues
alonbl authored
99 WIN_LIBPREFIX="cyg"
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
100 AC_DEFINE([USE_CYGWIN], [1], [Define if you are on Cygwin])
101 fi
102 ;;
103 esac
104
105 AC_ARG_ENABLE(
106 [strict],
7d6cf6b Prepare for libtool-2
alonbl authored
107 [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@disabled@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
108 ,
109 [enable_strict="no"]
110 )
111
112 AC_ARG_ENABLE(
113 [pedantic],
7d6cf6b Prepare for libtool-2
alonbl authored
114 [AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@disabled@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
115 ,
116 [enable_pedantic="no"]
117 )
118
119 AC_ARG_ENABLE(
120 [zlib],
7d6cf6b Prepare for libtool-2
alonbl authored
121 [AS_HELP_STRING([--enable-zlib],[enable zlib linkage @<:@detect@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
122 ,
123 [enable_zlib="detect"]
124 )
125
126 AC_ARG_ENABLE(
127 [readline],
7d6cf6b Prepare for libtool-2
alonbl authored
128 [AS_HELP_STRING([--enable-readline],[enable readline linkage @<:@detect@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
129 ,
130 [enable_readline="detect"]
131 )
132
133 AC_ARG_ENABLE(
c9c6f9f Correct iconv support
alonbl authored
134 [iconv],
135 [AS_HELP_STRING([--enable-iconv],[enable iconv linkage @<:@detect@:>@])],
136 ,
137 [enable_iconv="detect"]
138 )
139
140 AC_ARG_ENABLE(
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
141 [openssl],
7d6cf6b Prepare for libtool-2
alonbl authored
142 [AS_HELP_STRING([--enable-openssl],[enable openssl linkage @<:@detect@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
143 ,
144 [enable_openssl="detect"]
145 )
146
147 AC_ARG_ENABLE(
148 [openct],
7d6cf6b Prepare for libtool-2
alonbl authored
149 [AS_HELP_STRING([--enable-openct],[enable openct linkage @<:@disabled@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
150 ,
151 [enable_openct="no"]
152 )
153
154 AC_ARG_ENABLE(
155 [pcsc],
450e1fc Merge [3794:3803/trunk]
martin authored
156 [AS_HELP_STRING([--disable-pcsc],[disable pcsc support @<:@enabled@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
157 ,
450e1fc Merge [3794:3803/trunk]
martin authored
158 [enable_pcsc="yes"]
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
159 )
160
161 AC_ARG_ENABLE(
c398f55 Allow to turn off CT-API support
martin authored
162 [ctapi],
163 [AS_HELP_STRING([--enable-ctapi],[enable CT-API support @<:@disabled@:>@])],
164 ,
165 [enable_ctapi="no"]
166 )
167
168 AC_ARG_ENABLE(
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
169 [man],
7d6cf6b Prepare for libtool-2
alonbl authored
170 [AS_HELP_STRING([--disable-man],[disable installation of manuals @<:@enabled for none Windows@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
171 ,
172 [
173 if test "${WIN32}" = "yes"; then
174 enable_man="no"
175 else
176 enable_man="yes"
177 fi
178 ]
179 )
180
181 AC_ARG_ENABLE(
182 [doc],
7d6cf6b Prepare for libtool-2
alonbl authored
183 [AS_HELP_STRING([--enable-doc],[enable installation of documents @<:@disabled@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
184 ,
185 [enable_doc="no"]
186 )
187
188 AC_ARG_WITH(
d0e0dd2 Cleanup conventions to meet other OpenSC projects
alonbl authored
189 [xsl-stylesheetsdir],
7d6cf6b Prepare for libtool-2
alonbl authored
190 [AS_HELP_STRING([--with-xsl-stylesheetsdir=PATH],[docbook xsl-stylesheets for svn build @<:@detect@:>@])],
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
191 [xslstylesheetsdir="${withval}"],
192 [xslstylesheetsdir="detect"]
193 )
194
195 AC_ARG_WITH(
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
196 [pcsc-provider],
7d6cf6b Prepare for libtool-2
alonbl authored
197 [AS_HELP_STRING([--with-pcsc-provider=PATH],[Path to system pcsc provider @<:@system default@:>@])],
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
198 ,
199 [with_pcsc_provider="detect"]
200 )
201
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
202 dnl Checks for programs.
203 AC_PROG_CPP
204 AC_PROG_INSTALL
205 AC_PROG_LN_S
c9af12d Add some missing AC_PROG
alonbl authored
206 AC_PROG_MKDIR_P
207 AC_PROG_SED
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
208 AC_PROG_MAKE_SET
209
210 dnl Add libtool support.
a379627 Detect libtool-1 or libtool-2 at runtime
alonbl authored
211 ifdef(
212 [LT_INIT],
213 [
214 LT_INIT([win32-dll])
215 LT_LANG([Windows Resource])
216 ],
217 [
218 AC_LIBTOOL_WIN32_DLL
219 AC_LIBTOOL_RC
220 AC_PROG_LIBTOOL
221 ]
222 )
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
223
224 dnl These required for svn checkout
225 AC_ARG_VAR([XSLTPROC], [xsltproc utility])
226 AC_ARG_VAR([SVN], [subversion utility])
227 AC_ARG_VAR([WGET], [wget utility])
228 AC_ARG_VAR([WGET_OPTS], [wget options])
229 AC_ARG_VAR([TR], [tr utility])
230 AC_CHECK_PROGS([XSLTPROC],[xsltproc])
231 AC_CHECK_PROGS([SVN],[svn])
232 AC_CHECK_PROGS([WGET],[wget])
233 AC_CHECK_PROGS([TR],[tr])
234 test -z "${WGET_OPTS}" && WGET_OPTS="-nv"
235
236 if test "${xslstylesheetsdir}" = "detect"; then
237 AC_MSG_CHECKING([xsl-stylesheets])
238 xslstylesheetsdir="no"
239 for f in \
240 /usr/share/xml/docbook/stylesheet/nwalsh \
241 /usr/share/sgml/docbook/*; do
242
243 test -e "${f}/html/docbook.xsl" && xslstylesheetsdir="${f}"
244 done
245 AC_MSG_RESULT([${xslstylesheetsdir}])
246 elif test "${xslstylesheetsdir}" != "no"; then
247 AC_MSG_CHECKING([xsl-stylesheets])
248 test -e "${xslstylesheetsdir}/html/docbook.xsl" || AC_MSG_ERROR([invalid])
249 fi
250
251 dnl svn checkout dependencies
252 if test "${svn_checkout}" = "yes"; then
253 AC_MSG_CHECKING([XSLTPROC requirement])
254 if test -n "${XSLTPROC}"; then
255 AC_MSG_RESULT([ok])
256 else
257 if test "${enable_man}" = "yes" -o "${enable_doc}" = "yes"; then
258 AC_MSG_ERROR([Missing XSLTPROC svn build with man or doc])
259 else
260 AC_MSG_WARN(["make dist" will not work])
261 fi
262 fi
263
264 if test "${enable_man}" = "yes"; then
265 test "${xslstylesheetsdir}" = "no" && AC_MSG_ERROR([xsl-stylesheets are required for svn build with man])
266 fi
267
268 AC_MSG_CHECKING([svn doc build dependencies])
269 if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then
270 AC_MSG_RESULT([ok])
271 else
272 if test "${enable_doc}" = "yes"; then
273 AC_MSG_ERROR([Missing SVN, TR or WGET for svn doc build])
274 else
275 AC_MSG_WARN(["make dist" will not work])
276 fi
277 fi
278 fi
279
280 dnl C Compiler features
281 AC_C_INLINE
282
283 dnl Checks for header files.
284 AC_HEADER_STDC
285 AC_HEADER_SYS_WAIT
286 AC_CHECK_HEADERS([ \
287 errno.h fcntl.h malloc.h stdlib.h \
288 inttypes.h string.h strings.h \
95a5ab0 Re-implement PIN cache on PKCS#15 layer; remove it from PKCS#11. Re-n…
martin authored
289 sys/time.h unistd.h locale.h getopt.h sys/mman.h
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
290 ])
291
292 dnl Checks for typedefs, structures, and compiler characteristics.
293 AC_C_CONST
294 AC_TYPE_UID_T
295 AC_TYPE_SIZE_T
296 AC_HEADER_TIME
297
298 dnl Checks for library functions.
299 AC_FUNC_ERROR_AT_LINE
300 AC_FUNC_STAT
301 AC_FUNC_VPRINTF
302 AC_CHECK_FUNCS([ \
303 getpass gettimeofday memset mkdir \
304 strdup strerror setutent vsyslog \
305 setlocale getopt_long \
306 strlcpy
307 ])
308
309 dnl See if socket() is found from libsocket
310 AC_CHECK_LIB(
311 [socket],
312 [socket],
313 [
314 LIBS="${LIBS} -lsocket"
315 AC_CHECK_LIB(
316 [resolv],
317 [res_query],
318 [LIBS="${LIBS} -lresolv"]
319 )
320 ]
321 )
322
323 AC_ARG_VAR([LTLIB_CFLAGS], [C compiler flags for libltdl])
324 AC_ARG_VAR([LTLIB_LIBS], [linker flags for libltdl])
325 if test -z "${LTLIB_LIBS}"; then
326 AC_CHECK_LIB(
327 [ltdl],
328 [lt_dlopen],
329 [LTLIB_LIBS="-lltdl"],
330 [AC_MSG_ERROR([ltdl not found, please install libltdl and/or libtool])]
331 )
332 fi
333 saved_CFLAGS="${CFLAGS}"
334 CFLAGS="${CFLAGS} ${LTLIB_CFLAGS}"
335 AC_CHECK_HEADER(
336 [ltdl.h],
337 ,
338 [AC_MSG_ERROR([ltdl.h not found, please install libltdl and/or libtool])]
339 )
340 CFLAGS="${saved_CFLAGS}"
341
0e03c6d add cardmod a minidrivers for windows
flc authored
342 dnl for minidriver basecsp
343 test -z "${CARDMOD}" && CARDMOD="no"
344
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
345 if test "${WIN32}" = "no"; then
346 dnl Special check for pthread support.
347 ACX_PTHREAD(
348 [AC_DEFINE(
349 [HAVE_PTHREAD],
350 [1],
351 [Define if you have POSIX threads libraries and header files.]
352 )],
353 [AC_MSG_ERROR([POSIX thread support required])]
354 )
355 CC="${PTHREAD_CC}"
0e03c6d add cardmod a minidrivers for windows
flc authored
356 else
357 dnl win32 special test for minidriver
358 AC_CHECK_HEADER([cardmod.h])
359 if test "${ac_cv_header_cardmod_h}" != "yes"; then
360 saved_CFLAGS="${CFLAGS}"
361 CFLAGS="${CFLAGS} -Isrc/libopensc"
362 AC_MSG_CHECKING([secondary check for carmod.h presence])
363 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
364 #include <windows.h>
365 #include <internal-winscard.h>
366 #include <cardmod.h>
367 int main(int argc, char **argv) { return 0;}]])],
368 [CARDMOD="yes"],
369 [CARDMOD="no"])
370 AC_MSG_RESULT(["${CARDMOD}"])
371 CFLAGS="${saved_CFLAGS}"
372 else
373 CARDMOD="yes"
374 fi
375 if test "${CARDMOD}" = "yes"; then
376 AC_DEFINE([HAVE_CARDMOD_H], [], [card minidriver header])
377 fi
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
378 fi
379
380 AC_ARG_VAR([ZLIB_CFLAGS], [C compiler flags for zlib])
381 AC_ARG_VAR([ZLIB_LIBS], [linker flags for zlib])
382 if test -z "${ZLIB_LIBS}"; then
383 AC_CHECK_LIB(
384 [z],
385 [inflate],
386 [ZLIB_LIBS="-lz"]
387 )
388 fi
389 saved_CFLAGS="${CFLAGS}"
390 CFLAGS="${CFLAGS} ${ZLIB_CFLAGS}"
391 AC_CHECK_HEADERS([zlib.h])
392 CFLAGS="${saved_CFLAGS}"
393 test -n "${ZLIB_LIBS}" -a "${ac_cv_header_zlib_h}" = "yes" && have_zlib="yes"
394
5e5a053 Fixup autoconf detection
alonbl authored
395 case "${enable_zlib}" in
396 no)
397 have_zlib="no"
398 ;;
399 detect)
400 if test "${have_zlib}" = "yes"; then
401 enable_zlib="yes"
402 else
403 enable_zlib="no"
404 fi
405 ;;
406 esac
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
407
408 if test "${enable_zlib}" = "yes"; then
409 if test "${have_zlib}" = "yes"; then
410 AC_DEFINE([ENABLE_ZLIB], [1], [Use zlib libraries and header files])
411 else
412 AC_MSG_ERROR([zlib linkage required, but no zlib was found])
413 fi
414 fi
415
416 AC_ARG_VAR([READLINE_CFLAGS], [C compiler flags for readline])
417 AC_ARG_VAR([READLINE_LIBS], [linker flags for readline])
418 if test -z "${READLINE_LIBS}"; then
419 for l in "" -lncurses -ltermcap; do
420 unset ac_cv_lib_readline_readline
421 AC_CHECK_LIB(
422 [readline],
423 [readline],
424 [READLINE_LIBS="-lreadline ${l}"],
425 ,
426 ["${l}"]
427 )
428 test -n "${READLINE_LIBS}" && break;
429 done
430 fi
431 saved_CFLAGS="${CFLAGS}"
432 CFLAGS="${CFLAGS} ${READLINE_CFLAGS}"
433 AC_CHECK_HEADERS([readline/readline.h])
434 CFLAGS="${saved_CFLAGS}"
435 test -n "${READLINE_LIBS}" -a "${ac_cv_header_readline_readline_h}" = "yes" && have_readline="yes"
436
5e5a053 Fixup autoconf detection
alonbl authored
437 case "${enable_readline}" in
438 no)
439 have_readline="no"
440 ;;
441 detect)
442 if test "${have_readline}" = "yes"; then
443 enable_readline="yes"
444 else
445 enable_readline="no"
446 fi
447 ;;
448 esac
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
449
450 if test "${enable_readline}" = "yes"; then
451 if test "${have_readline}" = "yes"; then
452 AC_DEFINE([ENABLE_READLINE], [1], [Use readline libraries and header files])
453 else
454 AC_MSG_ERROR([readline linkage required, but no readline was found])
455 fi
456 fi
457
c9c6f9f Correct iconv support
alonbl authored
458 AC_ARG_VAR([ICONV_CFLAGS], [C compiler flags for iconv])
459 AC_ARG_VAR([ICONV_LIBS], [linker flags for iconv])
96d387b Fix external iconv override
alonbl authored
460 if test -n "${ICONV_LIBS}"; then
461 ac_cv_lib_iconv="yes"
462 else
c9c6f9f Correct iconv support
alonbl authored
463 AC_MSG_CHECKING([if iconv library available within libc])
464 AC_LINK_IFELSE(
465 [AC_LANG_FUNC_LINK_TRY([iconv])],
466 [
467 AC_MSG_RESULT([yes])
468 ac_cv_lib_iconv="yes"
469 ],
470 [
471 AC_MSG_RESULT([no])
472 AC_CHECK_LIB(
473 [iconv],
474 [iconv],
475 [
476 ac_cv_lib_iconv="yes"
477 ICONV_LIBS="-liconv"
23e247c Fix GNU libiconv detection
alonbl authored
478 ],
479 [AC_CHECK_LIB(
480 [iconv],
481 [libiconv],
482 [
483 ac_cv_lib_iconv="yes"
484 ICONV_LIBS="-liconv"
485 ]
486 )]
c9c6f9f Correct iconv support
alonbl authored
487 )
488 ]
489 )
490 fi
491 saved_CFLAGS="${CFLAGS}"
492 CFLAGS="${CFLAGS} ${ICONV_CFLAGS}"
493 AC_CHECK_HEADERS([iconv.h])
494 CFLAGS="${saved_CFLAGS}"
495 test "${ac_cv_lib_iconv}" = "yes" -a "${ac_cv_header_iconv_h}" = "yes" && have_iconv="yes"
496
497 case "${enable_iconv}" in
498 no)
499 have_iconv="no"
500 ;;
501 detect)
502 if test "${have_iconv}" = "yes"; then
503 enable_iconv="yes"
504 else
505 enable_iconv="no"
506 fi
507 ;;
508 esac
509
510 if test "${enable_iconv}" = "yes"; then
511 if test "${have_iconv}" = "yes"; then
512 AC_DEFINE([ENABLE_ICONV], [1], [Use iconv libraries and header files])
513 else
514 AC_MSG_ERROR([iconv linkage required, but no iconv was found])
515 fi
516 fi
517
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
518 PKG_CHECK_MODULES(
519 [OPENSSL],
520 [libcrypto >= 0.9.7],
521 [have_openssl="yes"],
522 [PKG_CHECK_MODULES(
523 [OPENSSL],
524 [openssl >= 0.9.7],
525 [have_openssl="yes"],
526 [AC_CHECK_LIB(
527 [crypto],
528 [RSA_version],
529 [
530 have_openssl="yes"
531 OPENSSL_LIBS="-lcrypto"
532 ],
533 [have_openssl="no"]
534 )]
535 )]
536 )
537
5e5a053 Fixup autoconf detection
alonbl authored
538 case "${enable_openssl}" in
539 no)
540 have_openssl="no"
541 ;;
542 detect)
543 if test "${have_openssl}" = "yes"; then
544 enable_openssl="yes"
545 else
546 enable_openssl="no"
547 fi
548 ;;
549 esac
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
550
551 if test "${enable_openssl}" = "yes"; then
552 if test "${have_openssl}" = "yes"; then
553 AC_DEFINE([ENABLE_OPENSSL], [1], [Have OpenSSL libraries and header files])
554 else
555 AC_MSG_ERROR([OpenSSL linkage required, but no OpenSSL was found])
556 fi
557 fi
558
559 if test "${enable_openct}" = "yes"; then
560 PKG_CHECK_MODULES(
561 [OPENCT],
562 [libopenct],
563 [AC_DEFINE([ENABLE_OPENCT], [1], [Have OpenCT libraries and header files])],
564 [AC_MSG_ERROR([openct requested but not available])]
565 )
566 fi
567
c398f55 Allow to turn off CT-API support
martin authored
568 if test "${enable_ctapi}" = "yes"; then
569 AC_DEFINE([ENABLE_CTAPI], [1], [Enable CT-API support])
570 fi
571
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
572 if test "${enable_pcsc}" = "yes"; then
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
573 if test "${WIN32}" != "yes"; then
dc3f8f6 Default PCSC CFLAGS from pkg-config
alonbl authored
574 PKG_CHECK_EXISTS(
575 [libpcsclite],
576 [PKG_CHECK_MODULES([PCSC], [libpcsclite])]
577 )
578 if test -z "${PCSC_CFLAGS}"; then
579 case "${host}" in
580 *-*-darwin*)
581 PCSC_CFLAGS="-I/System/Library/Frameworks/PCSC.framework/Headers"
582 ;;
583 *)
584 PCSC_CFLAGS="-I/usr/include/PCSC"
585 ;;
586 esac
587 fi
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
588 fi
589
51824ac Revert r3612, the autoconf warning is correct and be the default in f…
alonbl authored
590 saved_CFLAGS="${CFLAGS}"
591 CFLAGS="${CFLAGS} ${PCSC_CFLAGS}"
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
592 # We must cope with mingw32 that does not have winscard.h mingw64 has it.
593 AC_CHECK_HEADERS([winscard.h],,[test "${WIN32}" != "yes" && AC_MSG_ERROR([winscard.h is required for pcsc])])
51824ac Revert r3612, the autoconf warning is correct and be the default in f…
alonbl authored
594 CFLAGS="${saved_CFLAGS}"
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
595
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
596 if test "${with_pcsc_provider}" = "detect"; then
597 case "${host}" in
598 *-*-darwin*)
94d8849 Fix default PC/SC provider for darwin, thanks to Martin Paljak
alonbl authored
599 DEFAULT_PCSC_PROVIDER="/System/Library/Frameworks/PCSC.framework/PCSC"
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
600 ;;
bb6f6f7 mingw32->mingw*
alonbl authored
601 *-mingw*|*-winnt*|*-cygwin*)
0e2c664 Rename PC/SC library into PC/SC provider.
alonbl authored
602 DEFAULT_PCSC_PROVIDER="winscard.dll"
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
603 ;;
604 *)
450e1fc Merge [3794:3803/trunk]
martin authored
605 DEFAULT_PCSC_PROVIDER="libpcsclite.so.1"
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
606 ;;
607 esac
0e2c664 Rename PC/SC library into PC/SC provider.
alonbl authored
608 else
609 DEFAULT_PCSC_PROVIDER="${with_pcsc_provider}"
3f7aa03 Add --with-pcsc-module to configure
alonbl authored
610 fi
0e2c664 Rename PC/SC library into PC/SC provider.
alonbl authored
611 AC_DEFINE_UNQUOTED([DEFAULT_PCSC_PROVIDER], ["${DEFAULT_PCSC_PROVIDER}"], [Default PC/SC provider])
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
612 AC_DEFINE([ENABLE_PCSC], [1], [Define if PC/SC is to be enabled])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
613 fi
614
615 OPENSC_FEATURES=""
616 if test "${enable_zlib}" = "yes"; then
617 OPENSC_FEATURES="${OPENSC_FEATURES} zlib"
618 OPTIONAL_ZLIB_CFLAGS="${ZLIB_CFLAGS}"
619 OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}"
620 fi
621 if test "${enable_readline}" = "yes"; then
622 OPENSC_FEATURES="${OPENSC_FEATURES} readline"
623 OPTIONAL_READLINE_CFLAGS="${READLINE_CFLAGS}"
624 OPTIONAL_READLINE_LIBS="${READLINE_LIBS}"
625 fi
c9c6f9f Correct iconv support
alonbl authored
626 if test "${enable_iconv}" = "yes"; then
627 OPENSC_FEATURES="${OPENSC_FEATURES} iconv"
628 OPTIONAL_ICONV_CFLAGS="${ICONV_CFLAGS}"
629 OPTIONAL_ICONV_LIBS="${ICONV_LIBS}"
630 fi
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
631 if test "${enable_openssl}" = "yes"; then
632 OPENSC_FEATURES="${OPENSC_FEATURES} openssl"
633 OPTIONAL_OPENSSL_CFLAGS="${OPENSSL_CFLAGS}"
634 OPTIONAL_OPENSSL_LIBS="${OPENSSL_LIBS}"
635 fi
636 if test "${enable_openct}" = "yes"; then
637 OPENSC_FEATURES="${OPENSC_FEATURES} openct"
638 OPTIONAL_OPENCT_CFLAGS="${OPENCT_CFLAGS}"
639 OPTIONAL_OPENCT_LIBS="${OPENCT_LIBS}"
640 fi
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
641 if test "${enable_pcsc}" = "yes"; then
642 OPENSC_FEATURES="${OPENSC_FEATURES} pcsc(${DEFAULT_PCSC_PROVIDER})"
643 OPTIONAL_PCSC_CFLAGS="${PCSC_CFLAGS}"
644 fi
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
645
c398f55 Allow to turn off CT-API support
martin authored
646 if test "${enable_ctapi}" = "yes"; then
647 OPENSC_FEATURES="${OPENSC_FEATURES} ctapi"
648 fi
649
584e0a1 Expose version components into config.h
alonbl authored
650 AC_DEFINE_UNQUOTED([OPENSC_VERSION_MAJOR], [${OPENSC_VERSION_MAJOR}], [OpenSC version major component])
651 AC_DEFINE_UNQUOTED([OPENSC_VERSION_MINOR], [${OPENSC_VERSION_MINOR}], [OpenSC version minor component])
652 AC_DEFINE_UNQUOTED([OPENSC_VERSION_FIX], [${OPENSC_VERSION_FIX}], [OpenSC version fix component])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
653 AC_DEFINE_UNQUOTED([OPENSC_FEATURES], ["${OPENSC_FEATURES}"], [Enabled OpenSC features])
654
655 openscincludedir="\$(includedir)/opensc"
656 pkcs11dir="\$(libdir)/pkcs11"
657 pkgconfigdir="\$(libdir)/pkgconfig"
658
659 AC_SUBST([openscincludedir])
660 AC_SUBST([pkcs11dir])
661 AC_SUBST([pkgconfigdir])
662 AC_SUBST([xslstylesheetsdir])
663 AC_SUBST([OPENSC_VERSION_MAJOR])
664 AC_SUBST([OPENSC_VERSION_MINOR])
665 AC_SUBST([OPENSC_VERSION_FIX])
666 AC_SUBST([OPENSC_LT_CURRENT])
667 AC_SUBST([OPENSC_LT_REVISION])
668 AC_SUBST([OPENSC_LT_AGE])
97a3455 Fix typo
alonbl authored
669 AC_SUBST([OPENSC_LT_OLDEST])
f49f765 Fix libtool versioning issues
alonbl authored
670 AC_SUBST([WIN_LIBPREFIX])
0e2c664 Rename PC/SC library into PC/SC provider.
alonbl authored
671 AC_SUBST([DEFAULT_PCSC_PROVIDER])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
672 AC_SUBST([OPTIONAL_ZLIB_CFLAGS])
673 AC_SUBST([OPTIONAL_ZLIB_LIBS])
674 AC_SUBST([OPTIONAL_READLINE_CFLAGS])
675 AC_SUBST([OPTIONAL_READLINE_LIBS])
cdbd4c1 More iconv build fixes
alonbl authored
676 AC_SUBST([OPTIONAL_ICONV_CFLAGS])
677 AC_SUBST([OPTIONAL_ICONV_LIBS])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
678 AC_SUBST([OPTIONAL_OPENSSL_CFLAGS])
679 AC_SUBST([OPTIONAL_OPENSSL_LIBS])
680 AC_SUBST([OPTIONAL_OPENCT_CFLAGS])
681 AC_SUBST([OPTIONAL_OPENCT_LIBS])
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
682 AC_SUBST([OPTIONAL_PCSC_CFLAGS])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
683
684 AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"])
685 AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"])
686 AM_CONDITIONAL([ENABLE_ZLIB], [test "${enable_zlib}" = "yes"])
687 AM_CONDITIONAL([ENABLE_READLINE], [test "${enable_readline}" = "yes"])
c9c6f9f Correct iconv support
alonbl authored
688 AM_CONDITIONAL([ENABLE_ICONV], [test "${enable_iconv}" = "yes"])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
689 AM_CONDITIONAL([ENABLE_OPENSSL], [test "${enable_openssl}" = "yes"])
690 AM_CONDITIONAL([ENABLE_OPENCT], [test "${enable_openct}" = "yes"])
691 AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"])
692 AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
693 AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
0e03c6d add cardmod a minidrivers for windows
flc authored
694 AM_CONDITIONAL([CARDMOD], [test "${CARDMOD}" = "yes"])
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
695
696 if test "${enable_pedantic}" = "yes"; then
697 enable_strict="yes";
698 CFLAGS="${CFLAGS} -pedantic"
699 fi
700 if test "${enable_strict}" = "yes"; then
701 CFLAGS="${CFLAGS} -Wall -Wextra"
702 fi
703 if test "$GCC" = "yes"; then
704 # This should be resolved not ignored.
705 CFLAGS="-fno-strict-aliasing ${CFLAGS}"
706 fi
707
7d6cf6b Prepare for libtool-2
alonbl authored
708 AC_CONFIG_FILES([
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
709 Makefile
710 doc/Makefile
711 doc/nonpersistent/Makefile
712 etc/Makefile
713 src/Makefile
714 src/common/Makefile
715 src/include/Makefile
d840777 Distribute autoconf generated files for MSVC build
alonbl authored
716 src/include/winconfig.h
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
717 src/include/opensc/Makefile
718 src/libopensc/Makefile
719 src/libopensc/opensc-config
720 src/libopensc/libopensc.pc
721 src/libopensc/libpkcs15init.pc
722 src/libopensc/libscconf.pc
723 src/openssh/Makefile
724 src/pkcs11/Makefile
725 src/pkcs15init/Makefile
726 src/scconf/Makefile
727 src/tests/Makefile
728 src/tests/regression/Makefile
729 src/tools/Makefile
0e03c6d add cardmod a minidrivers for windows
flc authored
730 src/cardmod/Makefile
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
731 win32/Makefile
a6f9f02 [WINDOWS] Remove tool specific file description support resource file
alonbl authored
732 win32/versioninfo.rc
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
733 ])
7d6cf6b Prepare for libtool-2
alonbl authored
734 AC_OUTPUT
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
735
736 cat <<EOF
737
738 OpenSC has been configured with the following options:
739
740
741 Version: ${PACKAGE_VERSION}
742 User binaries: $(eval eval eval echo "${bindir}")
743 Configuration files: $(eval eval eval echo "${sysconfdir}")
744 XSL stylesheets: ${xslstylesheetsdir}
745
746 man support: ${enable_man}
747 doc support: ${enable_doc}
748 zlib support: ${enable_zlib}
749 readline support: ${enable_readline}
c9c6f9f Correct iconv support
alonbl authored
750 iconv support: ${enable_iconv}
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
751 OpenSSL support: ${enable_openssl}
752 PC/SC support: ${enable_pcsc}
753 OpenCT support: ${enable_openct}
c398f55 Allow to turn off CT-API support
martin authored
754 CT-API support: ${enable_ctapi}
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
755
0e2c664 Rename PC/SC library into PC/SC provider.
alonbl authored
756 PC/SC default provider: ${DEFAULT_PCSC_PROVIDER}
d0e0dd2 Cleanup conventions to meet other OpenSC projects
alonbl authored
757
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
758 Host: ${host}
759 Compiler: ${CC}
760 Preprocessor flags: ${CPPFLAGS}
761 Compiler flags: ${CFLAGS}
762 Linker flags: ${LDFLAGS}
763 Libraries: ${LIBS}
764
765 LTLIB_CFLAGS: ${LTLIB_CFLAGS}
766 LTLIB_LIBS: ${LTLIB_LIBS}
767 READLINE_CFLAGS: ${READLINE_CFLAGS}
768 READLINE_LIBS: ${READLINE_LIBS}
769 ZLIB_CFLAGS: ${ZLIB_CFLAGS}
770 ZLIB_LIBS: ${ZLIB_LIBS}
c9c6f9f Correct iconv support
alonbl authored
771 ICONV_CFLAGS: ${ICONV_CFLAGS}
772 ICONV_LIBS: ${ICONV_LIBS}
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
773 OPENSSL_CFLAGS: ${OPENSSL_CFLAGS}
774 OPENSSL_LIBS: ${OPENSSL_LIBS}
775 OPENCT_CFLAGS: ${OPENCT_CFLAGS}
776 OPENCT_LIBS: ${OPENCT_LIBS}
d7941bf Re-add pcsc-lite compile-time dependency
alonbl authored
777 PCSC_CFLAGS: ${PCSC_CFLAGS}
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
778
0e03c6d add cardmod a minidrivers for windows
flc authored
779 CARDMOD: ${CARDMOD}
780
0a809dd Complete rewrite of OpenSC build system.
alonbl authored
781 EOF
782
Something went wrong with that request. Please try again.