| 1 | dnl -*- mode: m4; -*- |
|---|
| 2 | |
|---|
| 3 | AC_PREREQ(2.60) |
|---|
| 4 | |
|---|
| 5 | define([PACKAGE_VERSION_MAJOR], [0]) |
|---|
| 6 | define([PACKAGE_VERSION_MINOR], [12]) |
|---|
| 7 | define([PACKAGE_VERSION_FIX], [3]) |
|---|
| 8 | define([PACKAGE_SUFFIX], [-pre1]) |
|---|
| 9 | |
|---|
| 10 | AC_INIT([opensc],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX]) |
|---|
| 11 | AC_CONFIG_AUX_DIR([.]) |
|---|
| 12 | AC_CONFIG_HEADERS([config.h]) |
|---|
| 13 | AC_CONFIG_MACRO_DIR([m4]) |
|---|
| 14 | AM_INIT_AUTOMAKE(foreign 1.10) |
|---|
| 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++) |
|---|
| 22 | # (Oldest interface removed: OLDEST++) |
|---|
| 23 | # (Interfaces added: CURRENT++, REVISION=0) |
|---|
| 24 | OPENSC_LT_CURRENT="3" |
|---|
| 25 | OPENSC_LT_OLDEST="3" |
|---|
| 26 | OPENSC_LT_REVISION="0" |
|---|
| 27 | OPENSC_LT_AGE="0" |
|---|
| 28 | OPENSC_LT_AGE="$((${OPENSC_LT_CURRENT}-${OPENSC_LT_OLDEST}))" |
|---|
| 29 | |
|---|
| 30 | AC_CONFIG_SRCDIR([src/libopensc/sc.c]) |
|---|
| 31 | |
|---|
| 32 | # silent build by default |
|---|
| 33 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
|---|
| 34 | |
|---|
| 35 | AC_CANONICAL_HOST |
|---|
| 36 | AC_PROG_CC |
|---|
| 37 | PKG_PROG_PKG_CONFIG |
|---|
| 38 | AC_C_BIGENDIAN |
|---|
| 39 | |
|---|
| 40 | AC_ARG_WITH( |
|---|
| 41 | [cygwin-native], |
|---|
| 42 | [AS_HELP_STRING([--with-cygwin-native],[compile native win32])], |
|---|
| 43 | , |
|---|
| 44 | [with_cygwin_native="no"] |
|---|
| 45 | ) |
|---|
| 46 | |
|---|
| 47 | dnl Check for some target-specific stuff |
|---|
| 48 | test -z "${WIN32}" && WIN32="no" |
|---|
| 49 | test -z "${CYGWIN}" && CYGWIN="no" |
|---|
| 50 | case "${host}" in |
|---|
| 51 | *-*-solaris*) |
|---|
| 52 | CPPFLAGS="${CPPFLAGS} -I/usr/local/include" |
|---|
| 53 | LDFLAGS="${LDFLAGS} -L/usr/local/lib -R/usr/local/lib" |
|---|
| 54 | ;; |
|---|
| 55 | *-mingw*|*-winnt*) |
|---|
| 56 | WIN32="yes" |
|---|
| 57 | CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN" |
|---|
| 58 | WIN_LIBPREFIX="lib" |
|---|
| 59 | ;; |
|---|
| 60 | *-cygwin*) |
|---|
| 61 | AC_MSG_CHECKING([cygwin mode to use]) |
|---|
| 62 | CYGWIN="yes" |
|---|
| 63 | if test "${with_cygwin_native}" = "yes"; then |
|---|
| 64 | AC_MSG_RESULT([Using native win32]) |
|---|
| 65 | CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN" |
|---|
| 66 | CFLAGS="${CFLAGS} -mno-cygwin" |
|---|
| 67 | WIN32="yes" |
|---|
| 68 | else |
|---|
| 69 | AC_MSG_RESULT([Using cygwin]) |
|---|
| 70 | CPPFLAGS="${CPPFLAGS} -DCRYPTOKI_FORCE_WIN32" |
|---|
| 71 | WIN_LIBPREFIX="cyg" |
|---|
| 72 | AC_DEFINE([USE_CYGWIN], [1], [Define if you are on Cygwin]) |
|---|
| 73 | fi |
|---|
| 74 | ;; |
|---|
| 75 | esac |
|---|
| 76 | |
|---|
| 77 | AC_ARG_ENABLE( |
|---|
| 78 | [strict], |
|---|
| 79 | [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@disabled@:>@])], |
|---|
| 80 | , |
|---|
| 81 | [enable_strict="no"] |
|---|
| 82 | ) |
|---|
| 83 | |
|---|
| 84 | AC_ARG_ENABLE( |
|---|
| 85 | [pedantic], |
|---|
| 86 | [AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@disabled@:>@])], |
|---|
| 87 | , |
|---|
| 88 | [enable_pedantic="no"] |
|---|
| 89 | ) |
|---|
| 90 | |
|---|
| 91 | AC_ARG_ENABLE( |
|---|
| 92 | [zlib], |
|---|
| 93 | [AS_HELP_STRING([--enable-zlib],[enable zlib linkage @<:@detect@:>@])], |
|---|
| 94 | , |
|---|
| 95 | [enable_zlib="detect"] |
|---|
| 96 | ) |
|---|
| 97 | |
|---|
| 98 | AC_ARG_ENABLE( |
|---|
| 99 | [readline], |
|---|
| 100 | [AS_HELP_STRING([--enable-readline],[enable readline linkage @<:@detect@:>@])], |
|---|
| 101 | , |
|---|
| 102 | [enable_readline="detect"] |
|---|
| 103 | ) |
|---|
| 104 | |
|---|
| 105 | AC_ARG_ENABLE( |
|---|
| 106 | [openssl], |
|---|
| 107 | [AS_HELP_STRING([--enable-openssl],[enable openssl linkage @<:@detect@:>@])], |
|---|
| 108 | , |
|---|
| 109 | [enable_openssl="detect"] |
|---|
| 110 | ) |
|---|
| 111 | |
|---|
| 112 | AC_ARG_ENABLE( |
|---|
| 113 | [openct], |
|---|
| 114 | [AS_HELP_STRING([--enable-openct],[enable openct linkage @<:@disabled@:>@])], |
|---|
| 115 | , |
|---|
| 116 | [enable_openct="no"] |
|---|
| 117 | ) |
|---|
| 118 | |
|---|
| 119 | AC_ARG_ENABLE( |
|---|
| 120 | [pcsc], |
|---|
| 121 | [AS_HELP_STRING([--disable-pcsc],[disable pcsc support @<:@enabled@:>@])], |
|---|
| 122 | , |
|---|
| 123 | [enable_pcsc="yes"] |
|---|
| 124 | ) |
|---|
| 125 | |
|---|
| 126 | AC_ARG_ENABLE( |
|---|
| 127 | [ctapi], |
|---|
| 128 | [AS_HELP_STRING([--enable-ctapi],[enable CT-API support @<:@disabled@:>@])], |
|---|
| 129 | , |
|---|
| 130 | [enable_ctapi="no"] |
|---|
| 131 | ) |
|---|
| 132 | |
|---|
| 133 | AC_ARG_ENABLE( |
|---|
| 134 | [minidriver], |
|---|
| 135 | [AS_HELP_STRING([--enable-minidriver],[enable minidriver on Windows @<:@disabled@:>@])], |
|---|
| 136 | , |
|---|
| 137 | [enable_minidriver="no"] |
|---|
| 138 | ) |
|---|
| 139 | |
|---|
| 140 | AC_ARG_ENABLE( |
|---|
| 141 | [man], |
|---|
| 142 | [AS_HELP_STRING([--disable-man],[disable installation of manuals @<:@enabled for none Windows@:>@])], |
|---|
| 143 | , |
|---|
| 144 | [enable_man="detect"] |
|---|
| 145 | ) |
|---|
| 146 | |
|---|
| 147 | AC_ARG_ENABLE( |
|---|
| 148 | [doc], |
|---|
| 149 | [AS_HELP_STRING([--enable-doc],[enable installation of documents @<:@disabled@:>@])], |
|---|
| 150 | , |
|---|
| 151 | [enable_doc="no"] |
|---|
| 152 | ) |
|---|
| 153 | |
|---|
| 154 | AC_ARG_WITH( |
|---|
| 155 | [xsl-stylesheetsdir], |
|---|
| 156 | [AS_HELP_STRING([--with-xsl-stylesheetsdir=PATH],[docbook xsl-stylesheets for svn build @<:@detect@:>@])], |
|---|
| 157 | [xslstylesheetsdir="${withval}"], |
|---|
| 158 | [xslstylesheetsdir="detect"] |
|---|
| 159 | ) |
|---|
| 160 | |
|---|
| 161 | AC_ARG_WITH( |
|---|
| 162 | [pcsc-provider], |
|---|
| 163 | [AS_HELP_STRING([--with-pcsc-provider=PATH],[Path to system pcsc provider @<:@system default@:>@])], |
|---|
| 164 | , |
|---|
| 165 | [with_pcsc_provider="detect"] |
|---|
| 166 | ) |
|---|
| 167 | dnl ./configure check |
|---|
| 168 | reader_count="" |
|---|
| 169 | for rdriver in "${enable_pcsc}" "${enable_openct}" "${enable_ctapi}"; do |
|---|
| 170 | test "${rdriver}" = "yes" && reader_count="${reader_count}x" |
|---|
| 171 | done |
|---|
| 172 | if test "${reader_count}" != "x"; then |
|---|
| 173 | AC_MSG_ERROR([Only one of --enable-pcsc, --enable-openct, --enable-ctapi can be specified!]) |
|---|
| 174 | fi |
|---|
| 175 | |
|---|
| 176 | dnl Checks for programs. |
|---|
| 177 | AC_PROG_CPP |
|---|
| 178 | AC_PROG_INSTALL |
|---|
| 179 | AC_PROG_LN_S |
|---|
| 180 | AC_PROG_MKDIR_P |
|---|
| 181 | AC_PROG_SED |
|---|
| 182 | AC_PROG_MAKE_SET |
|---|
| 183 | |
|---|
| 184 | dnl Add libtool support. |
|---|
| 185 | ifdef( |
|---|
| 186 | [LT_INIT], |
|---|
| 187 | [ |
|---|
| 188 | LT_INIT([win32-dll]) |
|---|
| 189 | LT_LANG([Windows Resource]) |
|---|
| 190 | ], |
|---|
| 191 | [ |
|---|
| 192 | AC_LIBTOOL_WIN32_DLL |
|---|
| 193 | AC_LIBTOOL_RC |
|---|
| 194 | AC_PROG_LIBTOOL |
|---|
| 195 | ] |
|---|
| 196 | ) |
|---|
| 197 | |
|---|
| 198 | dnl These required for repository checkout |
|---|
| 199 | AC_ARG_VAR([XSLTPROC], [xsltproc utility]) |
|---|
| 200 | AC_ARG_VAR([git], [git]) |
|---|
| 201 | AC_CHECK_PROGS([XSLTPROC],[xsltproc]) |
|---|
| 202 | AC_CHECK_PROGS([GIT],[git]) |
|---|
| 203 | |
|---|
| 204 | AC_MSG_CHECKING([xsl-stylesheets]) |
|---|
| 205 | if test "${xslstylesheetsdir}" = "detect"; then |
|---|
| 206 | xslstylesheetsdir="no" |
|---|
| 207 | for f in \ |
|---|
| 208 | /usr/share/xml/docbook/stylesheet/nwalsh \ |
|---|
| 209 | /usr/share/xml/docbook/stylesheet/nwalsh/current \ |
|---|
| 210 | /opt/local/share/xsl/docbook-xsl \ |
|---|
| 211 | /sw/share/xml/xsl/docbook-xsl \ |
|---|
| 212 | /usr/share/sgml/docbook/*; do |
|---|
| 213 | |
|---|
| 214 | test -e "${f}/html/docbook.xsl" && xslstylesheetsdir="${f}" |
|---|
| 215 | done |
|---|
| 216 | elif test "${xslstylesheetsdir}" != "no"; then |
|---|
| 217 | test -e "${xslstylesheetsdir}/html/docbook.xsl" || AC_MSG_ERROR([invalid]) |
|---|
| 218 | fi |
|---|
| 219 | AC_MSG_RESULT([${xslstylesheetsdir}]) |
|---|
| 220 | |
|---|
| 221 | dnl C Compiler features |
|---|
| 222 | AC_C_INLINE |
|---|
| 223 | |
|---|
| 224 | dnl Checks for header files. |
|---|
| 225 | AC_HEADER_STDC |
|---|
| 226 | AC_HEADER_SYS_WAIT |
|---|
| 227 | AC_HEADER_ASSERT |
|---|
| 228 | AC_CHECK_HEADERS([ \ |
|---|
| 229 | errno.h fcntl.h malloc.h stdlib.h \ |
|---|
| 230 | inttypes.h string.h strings.h \ |
|---|
| 231 | sys/time.h unistd.h getopt.h sys/mman.h |
|---|
| 232 | ]) |
|---|
| 233 | |
|---|
| 234 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 235 | AC_C_CONST |
|---|
| 236 | AC_TYPE_UID_T |
|---|
| 237 | AC_TYPE_SIZE_T |
|---|
| 238 | AC_HEADER_TIME |
|---|
| 239 | |
|---|
| 240 | dnl Checks for library functions. |
|---|
| 241 | AC_FUNC_ERROR_AT_LINE |
|---|
| 242 | AC_FUNC_STAT |
|---|
| 243 | AC_FUNC_VPRINTF |
|---|
| 244 | AC_CHECK_FUNCS([ \ |
|---|
| 245 | getpass gettimeofday memset mkdir \ |
|---|
| 246 | strdup strerror getopt_long getopt_long_only \ |
|---|
| 247 | strlcpy strlcat |
|---|
| 248 | ]) |
|---|
| 249 | AC_CHECK_SIZEOF(void *) |
|---|
| 250 | if test "${ac_cv_sizeof_void_p}" = 8; then |
|---|
| 251 | LIBRARY_BITNESS="64" |
|---|
| 252 | else |
|---|
| 253 | LIBRARY_BITNESS="32" |
|---|
| 254 | fi |
|---|
| 255 | |
|---|
| 256 | dnl See if socket() is found from libsocket |
|---|
| 257 | AC_CHECK_LIB( |
|---|
| 258 | [socket], |
|---|
| 259 | [socket], |
|---|
| 260 | [ |
|---|
| 261 | LIBS="${LIBS} -lsocket" |
|---|
| 262 | AC_CHECK_LIB( |
|---|
| 263 | [resolv], |
|---|
| 264 | [res_query], |
|---|
| 265 | [LIBS="${LIBS} -lresolv"] |
|---|
| 266 | ) |
|---|
| 267 | ] |
|---|
| 268 | ) |
|---|
| 269 | |
|---|
| 270 | if test "${WIN32}" = "no"; then |
|---|
| 271 | dnl dl support |
|---|
| 272 | AC_CHECK_LIB( |
|---|
| 273 | [dl], |
|---|
| 274 | [dlopen], |
|---|
| 275 | , |
|---|
| 276 | [AC_MSG_ERROR([libdl required])] |
|---|
| 277 | ) |
|---|
| 278 | |
|---|
| 279 | dnl Special check for pthread support. |
|---|
| 280 | ACX_PTHREAD( |
|---|
| 281 | [AC_DEFINE( |
|---|
| 282 | [HAVE_PTHREAD], |
|---|
| 283 | [1], |
|---|
| 284 | [Define if you have POSIX threads libraries and header files.] |
|---|
| 285 | )], |
|---|
| 286 | [AC_MSG_ERROR([POSIX thread support required])] |
|---|
| 287 | ) |
|---|
| 288 | CC="${PTHREAD_CC}" |
|---|
| 289 | fi |
|---|
| 290 | |
|---|
| 291 | if test "${enable_minidriver}" = "yes"; then |
|---|
| 292 | dnl win32 special test for minidriver |
|---|
| 293 | AC_CHECK_HEADER( |
|---|
| 294 | [cardmod.h], |
|---|
| 295 | , |
|---|
| 296 | [AC_MSG_ERROR([cardmod.h is not found and required for minidriver])] |
|---|
| 297 | ) |
|---|
| 298 | AC_DEFINE([ENABLE_MINIDRIVER], [1], [Enable minidriver support]) |
|---|
| 299 | fi |
|---|
| 300 | |
|---|
| 301 | AC_ARG_VAR([ZLIB_CFLAGS], [C compiler flags for zlib]) |
|---|
| 302 | AC_ARG_VAR([ZLIB_LIBS], [linker flags for zlib]) |
|---|
| 303 | if test -z "${ZLIB_LIBS}"; then |
|---|
| 304 | AC_CHECK_LIB( |
|---|
| 305 | [z], |
|---|
| 306 | [inflate], |
|---|
| 307 | [ZLIB_LIBS="-lz"] |
|---|
| 308 | ) |
|---|
| 309 | fi |
|---|
| 310 | saved_CFLAGS="${CFLAGS}" |
|---|
| 311 | CFLAGS="${CFLAGS} ${ZLIB_CFLAGS}" |
|---|
| 312 | AC_CHECK_HEADERS([zlib.h]) |
|---|
| 313 | CFLAGS="${saved_CFLAGS}" |
|---|
| 314 | test -n "${ZLIB_LIBS}" -a "${ac_cv_header_zlib_h}" = "yes" && have_zlib="yes" |
|---|
| 315 | |
|---|
| 316 | case "${enable_zlib}" in |
|---|
| 317 | no) |
|---|
| 318 | have_zlib="no" |
|---|
| 319 | ;; |
|---|
| 320 | detect) |
|---|
| 321 | if test "${have_zlib}" = "yes"; then |
|---|
| 322 | enable_zlib="yes" |
|---|
| 323 | else |
|---|
| 324 | enable_zlib="no" |
|---|
| 325 | fi |
|---|
| 326 | ;; |
|---|
| 327 | esac |
|---|
| 328 | |
|---|
| 329 | if test "${enable_zlib}" = "yes"; then |
|---|
| 330 | if test "${have_zlib}" = "yes"; then |
|---|
| 331 | AC_DEFINE([ENABLE_ZLIB], [1], [Use zlib libraries and header files]) |
|---|
| 332 | else |
|---|
| 333 | AC_MSG_ERROR([zlib linkage required, but no zlib was found]) |
|---|
| 334 | fi |
|---|
| 335 | fi |
|---|
| 336 | |
|---|
| 337 | AC_ARG_VAR([READLINE_CFLAGS], [C compiler flags for readline]) |
|---|
| 338 | AC_ARG_VAR([READLINE_LIBS], [linker flags for readline]) |
|---|
| 339 | if test -z "${READLINE_LIBS}"; then |
|---|
| 340 | for l in "" -lncurses -ltermcap; do |
|---|
| 341 | unset ac_cv_lib_readline_readline |
|---|
| 342 | AC_CHECK_LIB( |
|---|
| 343 | [readline], |
|---|
| 344 | [readline], |
|---|
| 345 | [READLINE_LIBS="-lreadline ${l}"], |
|---|
| 346 | , |
|---|
| 347 | ["${l}"] |
|---|
| 348 | ) |
|---|
| 349 | test -n "${READLINE_LIBS}" && break; |
|---|
| 350 | done |
|---|
| 351 | fi |
|---|
| 352 | saved_CFLAGS="${CFLAGS}" |
|---|
| 353 | CFLAGS="${CFLAGS} ${READLINE_CFLAGS}" |
|---|
| 354 | AC_CHECK_HEADERS([readline/readline.h]) |
|---|
| 355 | CFLAGS="${saved_CFLAGS}" |
|---|
| 356 | test -n "${READLINE_LIBS}" -a "${ac_cv_header_readline_readline_h}" = "yes" && have_readline="yes" |
|---|
| 357 | |
|---|
| 358 | case "${enable_readline}" in |
|---|
| 359 | no) |
|---|
| 360 | have_readline="no" |
|---|
| 361 | ;; |
|---|
| 362 | detect) |
|---|
| 363 | if test "${have_readline}" = "yes"; then |
|---|
| 364 | enable_readline="yes" |
|---|
| 365 | else |
|---|
| 366 | enable_readline="no" |
|---|
| 367 | fi |
|---|
| 368 | ;; |
|---|
| 369 | esac |
|---|
| 370 | |
|---|
| 371 | if test "${enable_readline}" = "yes"; then |
|---|
| 372 | if test "${have_readline}" = "yes"; then |
|---|
| 373 | AC_DEFINE([ENABLE_READLINE], [1], [Use readline libraries and header files]) |
|---|
| 374 | else |
|---|
| 375 | AC_MSG_ERROR([readline linkage required, but no readline was found]) |
|---|
| 376 | fi |
|---|
| 377 | fi |
|---|
| 378 | |
|---|
| 379 | PKG_CHECK_MODULES( |
|---|
| 380 | [OPENSSL], |
|---|
| 381 | [libcrypto >= 0.9.7], |
|---|
| 382 | [have_openssl="yes"], |
|---|
| 383 | [PKG_CHECK_MODULES( |
|---|
| 384 | [OPENSSL], |
|---|
| 385 | [openssl >= 0.9.7], |
|---|
| 386 | [have_openssl="yes"], |
|---|
| 387 | [AC_CHECK_LIB( |
|---|
| 388 | [crypto], |
|---|
| 389 | [RSA_version], |
|---|
| 390 | [ |
|---|
| 391 | have_openssl="yes" |
|---|
| 392 | OPENSSL_LIBS="-lcrypto" |
|---|
| 393 | ], |
|---|
| 394 | [have_openssl="no"] |
|---|
| 395 | )] |
|---|
| 396 | )] |
|---|
| 397 | ) |
|---|
| 398 | |
|---|
| 399 | case "${enable_openssl}" in |
|---|
| 400 | no) |
|---|
| 401 | have_openssl="no" |
|---|
| 402 | ;; |
|---|
| 403 | detect) |
|---|
| 404 | if test "${have_openssl}" = "yes"; then |
|---|
| 405 | enable_openssl="yes" |
|---|
| 406 | else |
|---|
| 407 | enable_openssl="no" |
|---|
| 408 | fi |
|---|
| 409 | ;; |
|---|
| 410 | esac |
|---|
| 411 | |
|---|
| 412 | if test "${enable_openssl}" = "yes"; then |
|---|
| 413 | if test "${have_openssl}" = "yes"; then |
|---|
| 414 | AC_DEFINE([ENABLE_OPENSSL], [1], [Have OpenSSL libraries and header files]) |
|---|
| 415 | else |
|---|
| 416 | AC_MSG_ERROR([OpenSSL linkage required, but no OpenSSL was found]) |
|---|
| 417 | fi |
|---|
| 418 | fi |
|---|
| 419 | |
|---|
| 420 | if test "${enable_openct}" = "yes"; then |
|---|
| 421 | PKG_CHECK_MODULES( |
|---|
| 422 | [OPENCT], |
|---|
| 423 | [libopenct], |
|---|
| 424 | [AC_DEFINE([ENABLE_OPENCT], [1], [Have OpenCT libraries and header files])], |
|---|
| 425 | [AC_MSG_ERROR([openct requested but not available])] |
|---|
| 426 | ) |
|---|
| 427 | fi |
|---|
| 428 | |
|---|
| 429 | if test "${enable_ctapi}" = "yes"; then |
|---|
| 430 | AC_DEFINE([ENABLE_CTAPI], [1], [Enable CT-API support]) |
|---|
| 431 | fi |
|---|
| 432 | |
|---|
| 433 | if test "${enable_pcsc}" = "yes"; then |
|---|
| 434 | if test "${WIN32}" != "yes"; then |
|---|
| 435 | PKG_CHECK_EXISTS( |
|---|
| 436 | [libpcsclite], |
|---|
| 437 | [PKG_CHECK_MODULES([PCSC], [libpcsclite])] |
|---|
| 438 | ) |
|---|
| 439 | if test -z "${PCSC_CFLAGS}"; then |
|---|
| 440 | case "${host}" in |
|---|
| 441 | *-*-darwin*) |
|---|
| 442 | PCSC_CFLAGS="-I/System/Library/Frameworks/PCSC.framework/Headers" |
|---|
| 443 | ;; |
|---|
| 444 | *) |
|---|
| 445 | PCSC_CFLAGS="-I/usr/include/PCSC" |
|---|
| 446 | ;; |
|---|
| 447 | esac |
|---|
| 448 | fi |
|---|
| 449 | fi |
|---|
| 450 | |
|---|
| 451 | saved_CFLAGS="${CFLAGS}" |
|---|
| 452 | CFLAGS="${CFLAGS} ${PCSC_CFLAGS}" |
|---|
| 453 | # We must cope with mingw32 that does not have winscard.h mingw64 has it. |
|---|
| 454 | AC_CHECK_HEADERS([winscard.h],,[test "${WIN32}" != "yes" && AC_MSG_ERROR([winscard.h is required for pcsc])]) |
|---|
| 455 | CFLAGS="${saved_CFLAGS}" |
|---|
| 456 | |
|---|
| 457 | if test "${with_pcsc_provider}" = "detect"; then |
|---|
| 458 | case "${host}" in |
|---|
| 459 | *-*-darwin*) |
|---|
| 460 | DEFAULT_PCSC_PROVIDER="/System/Library/Frameworks/PCSC.framework/PCSC" |
|---|
| 461 | ;; |
|---|
| 462 | *-mingw*|*-winnt*|*-cygwin*) |
|---|
| 463 | DEFAULT_PCSC_PROVIDER="winscard.dll" |
|---|
| 464 | ;; |
|---|
| 465 | *) |
|---|
| 466 | DEFAULT_PCSC_PROVIDER="libpcsclite.so.1" |
|---|
| 467 | ;; |
|---|
| 468 | esac |
|---|
| 469 | else |
|---|
| 470 | DEFAULT_PCSC_PROVIDER="${with_pcsc_provider}" |
|---|
| 471 | fi |
|---|
| 472 | AC_DEFINE_UNQUOTED([DEFAULT_PCSC_PROVIDER], ["${DEFAULT_PCSC_PROVIDER}"], [Default PC/SC provider]) |
|---|
| 473 | AC_DEFINE([ENABLE_PCSC], [1], [Define if PC/SC is to be enabled]) |
|---|
| 474 | fi |
|---|
| 475 | |
|---|
| 476 | if test "${enable_man}" = "detect"; then |
|---|
| 477 | if test "${WIN32}" = "yes"; then |
|---|
| 478 | enable_man="no" |
|---|
| 479 | elif test -n "${XSLTPROC}" -a "${xslstylesheetsdir}" != "no"; then |
|---|
| 480 | enable_man="yes" |
|---|
| 481 | else |
|---|
| 482 | enable_man="no" |
|---|
| 483 | fi |
|---|
| 484 | fi |
|---|
| 485 | |
|---|
| 486 | if test "${enable_man}" = "yes" -o "${enable_doc}" = "yes"; then |
|---|
| 487 | AC_MSG_CHECKING([XSLTPROC requirement]) |
|---|
| 488 | test -n "${XSLTPROC}" || AC_MSG_ERROR([Missing XSLTPROC]) |
|---|
| 489 | test "${xslstylesheetsdir}" != "no" || AC_MSG_ERROR([Missing xslstylesheetsdir]) |
|---|
| 490 | AC_MSG_RESULT([ok]) |
|---|
| 491 | fi |
|---|
| 492 | |
|---|
| 493 | OPENSC_FEATURES="" |
|---|
| 494 | if test "${enable_zlib}" = "yes"; then |
|---|
| 495 | OPENSC_FEATURES="${OPENSC_FEATURES} zlib" |
|---|
| 496 | OPTIONAL_ZLIB_CFLAGS="${ZLIB_CFLAGS}" |
|---|
| 497 | OPTIONAL_ZLIB_LIBS="${ZLIB_LIBS}" |
|---|
| 498 | fi |
|---|
| 499 | if test "${enable_readline}" = "yes"; then |
|---|
| 500 | OPENSC_FEATURES="${OPENSC_FEATURES} readline" |
|---|
| 501 | OPTIONAL_READLINE_CFLAGS="${READLINE_CFLAGS}" |
|---|
| 502 | OPTIONAL_READLINE_LIBS="${READLINE_LIBS}" |
|---|
| 503 | fi |
|---|
| 504 | if test "${enable_openssl}" = "yes"; then |
|---|
| 505 | OPENSC_FEATURES="${OPENSC_FEATURES} openssl" |
|---|
| 506 | OPTIONAL_OPENSSL_CFLAGS="${OPENSSL_CFLAGS}" |
|---|
| 507 | OPTIONAL_OPENSSL_LIBS="${OPENSSL_LIBS}" |
|---|
| 508 | fi |
|---|
| 509 | if test "${enable_openct}" = "yes"; then |
|---|
| 510 | OPENSC_FEATURES="${OPENSC_FEATURES} openct" |
|---|
| 511 | OPTIONAL_OPENCT_CFLAGS="${OPENCT_CFLAGS}" |
|---|
| 512 | OPTIONAL_OPENCT_LIBS="${OPENCT_LIBS}" |
|---|
| 513 | fi |
|---|
| 514 | if test "${enable_pcsc}" = "yes"; then |
|---|
| 515 | OPENSC_FEATURES="${OPENSC_FEATURES} pcsc(${DEFAULT_PCSC_PROVIDER})" |
|---|
| 516 | OPTIONAL_PCSC_CFLAGS="${PCSC_CFLAGS}" |
|---|
| 517 | fi |
|---|
| 518 | if test "${enable_ctapi}" = "yes"; then |
|---|
| 519 | OPENSC_FEATURES="${OPENSC_FEATURES} ctapi" |
|---|
| 520 | fi |
|---|
| 521 | |
|---|
| 522 | AC_DEFINE_UNQUOTED([OPENSC_VERSION_MAJOR], [${OPENSC_VERSION_MAJOR}], [OpenSC version major component]) |
|---|
| 523 | AC_DEFINE_UNQUOTED([OPENSC_VERSION_MINOR], [${OPENSC_VERSION_MINOR}], [OpenSC version minor component]) |
|---|
| 524 | AC_DEFINE_UNQUOTED([OPENSC_VERSION_FIX], [${OPENSC_VERSION_FIX}], [OpenSC version fix component]) |
|---|
| 525 | AC_DEFINE_UNQUOTED([OPENSC_FEATURES], ["${OPENSC_FEATURES}"], [Enabled OpenSC features]) |
|---|
| 526 | |
|---|
| 527 | pkcs11dir="\$(libdir)/pkcs11" |
|---|
| 528 | |
|---|
| 529 | AC_SUBST([pkcs11dir]) |
|---|
| 530 | AC_SUBST([xslstylesheetsdir]) |
|---|
| 531 | AC_SUBST([OPENSC_VERSION_MAJOR]) |
|---|
| 532 | AC_SUBST([OPENSC_VERSION_MINOR]) |
|---|
| 533 | AC_SUBST([OPENSC_VERSION_FIX]) |
|---|
| 534 | AC_SUBST([OPENSC_LT_CURRENT]) |
|---|
| 535 | AC_SUBST([OPENSC_LT_REVISION]) |
|---|
| 536 | AC_SUBST([OPENSC_LT_AGE]) |
|---|
| 537 | AC_SUBST([OPENSC_LT_OLDEST]) |
|---|
| 538 | AC_SUBST([WIN_LIBPREFIX]) |
|---|
| 539 | AC_SUBST([DEFAULT_PCSC_PROVIDER]) |
|---|
| 540 | AC_SUBST([OPTIONAL_ZLIB_CFLAGS]) |
|---|
| 541 | AC_SUBST([OPTIONAL_ZLIB_LIBS]) |
|---|
| 542 | AC_SUBST([OPTIONAL_READLINE_CFLAGS]) |
|---|
| 543 | AC_SUBST([OPTIONAL_READLINE_LIBS]) |
|---|
| 544 | AC_SUBST([OPTIONAL_OPENSSL_CFLAGS]) |
|---|
| 545 | AC_SUBST([OPTIONAL_OPENSSL_LIBS]) |
|---|
| 546 | AC_SUBST([OPTIONAL_OPENCT_CFLAGS]) |
|---|
| 547 | AC_SUBST([OPTIONAL_OPENCT_LIBS]) |
|---|
| 548 | AC_SUBST([OPTIONAL_PCSC_CFLAGS]) |
|---|
| 549 | AC_SUBST([LIBRARY_BITNESS]) |
|---|
| 550 | |
|---|
| 551 | AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"]) |
|---|
| 552 | AM_CONDITIONAL([ENABLE_ZLIB], [test "${enable_zlib}" = "yes"]) |
|---|
| 553 | AM_CONDITIONAL([ENABLE_READLINE], [test "${enable_readline}" = "yes"]) |
|---|
| 554 | AM_CONDITIONAL([ENABLE_OPENSSL], [test "${enable_openssl}" = "yes"]) |
|---|
| 555 | AM_CONDITIONAL([ENABLE_OPENCT], [test "${enable_openct}" = "yes"]) |
|---|
| 556 | AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"]) |
|---|
| 557 | AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) |
|---|
| 558 | AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"]) |
|---|
| 559 | AM_CONDITIONAL([ENABLE_MINIDRIVER], [test "${enable_minidriver}" = "yes"]) |
|---|
| 560 | |
|---|
| 561 | if test "${enable_pedantic}" = "yes"; then |
|---|
| 562 | enable_strict="yes"; |
|---|
| 563 | CFLAGS="${CFLAGS} -pedantic" |
|---|
| 564 | fi |
|---|
| 565 | if test "${enable_strict}" = "yes"; then |
|---|
| 566 | CFLAGS="${CFLAGS} -Wall -Wextra" |
|---|
| 567 | fi |
|---|
| 568 | if test "$GCC" = "yes"; then |
|---|
| 569 | # This should be resolved not ignored. |
|---|
| 570 | CFLAGS="-fno-strict-aliasing ${CFLAGS}" |
|---|
| 571 | fi |
|---|
| 572 | |
|---|
| 573 | AC_CONFIG_FILES([ |
|---|
| 574 | Makefile |
|---|
| 575 | doc/Makefile |
|---|
| 576 | doc/tools/Makefile |
|---|
| 577 | etc/Makefile |
|---|
| 578 | src/Makefile |
|---|
| 579 | src/common/Makefile |
|---|
| 580 | src/libopensc/Makefile |
|---|
| 581 | src/libopensc/libopensc.pc |
|---|
| 582 | src/pkcs11/Makefile |
|---|
| 583 | src/pkcs15init/Makefile |
|---|
| 584 | src/scconf/Makefile |
|---|
| 585 | src/tests/Makefile |
|---|
| 586 | src/tests/regression/Makefile |
|---|
| 587 | src/tools/Makefile |
|---|
| 588 | src/minidriver/Makefile |
|---|
| 589 | src/minidriver/opensc-minidriver.inf |
|---|
| 590 | win32/Makefile |
|---|
| 591 | win32/versioninfo.rc |
|---|
| 592 | win32/winconfig.h |
|---|
| 593 | win32/OpenSC.iss |
|---|
| 594 | win32/OpenSC.wxs |
|---|
| 595 | MacOSX/Makefile |
|---|
| 596 | MacOSX/build-package |
|---|
| 597 | MacOSX/10.5/resources/ReadMe.html |
|---|
| 598 | MacOSX/10.6/resources/ReadMe.html |
|---|
| 599 | ]) |
|---|
| 600 | AC_OUTPUT |
|---|
| 601 | |
|---|
| 602 | cat <<EOF |
|---|
| 603 | |
|---|
| 604 | OpenSC has been configured with the following options: |
|---|
| 605 | |
|---|
| 606 | |
|---|
| 607 | Version: ${PACKAGE_VERSION} |
|---|
| 608 | User binaries: $(eval eval eval echo "${bindir}") |
|---|
| 609 | Configuration files: $(eval eval eval echo "${sysconfdir}") |
|---|
| 610 | XSL stylesheets: ${xslstylesheetsdir} |
|---|
| 611 | |
|---|
| 612 | man support: ${enable_man} |
|---|
| 613 | doc support: ${enable_doc} |
|---|
| 614 | zlib support: ${enable_zlib} |
|---|
| 615 | readline support: ${enable_readline} |
|---|
| 616 | OpenSSL support: ${enable_openssl} |
|---|
| 617 | PC/SC support: ${enable_pcsc} |
|---|
| 618 | OpenCT support: ${enable_openct} |
|---|
| 619 | CT-API support: ${enable_ctapi} |
|---|
| 620 | minidriver support: ${enable_minidriver} |
|---|
| 621 | |
|---|
| 622 | PC/SC default provider: ${DEFAULT_PCSC_PROVIDER} |
|---|
| 623 | |
|---|
| 624 | Host: ${host} |
|---|
| 625 | Compiler: ${CC} |
|---|
| 626 | Preprocessor flags: ${CPPFLAGS} |
|---|
| 627 | Compiler flags: ${CFLAGS} |
|---|
| 628 | Linker flags: ${LDFLAGS} |
|---|
| 629 | Libraries: ${LIBS} |
|---|
| 630 | |
|---|
| 631 | READLINE_CFLAGS: ${READLINE_CFLAGS} |
|---|
| 632 | READLINE_LIBS: ${READLINE_LIBS} |
|---|
| 633 | ZLIB_CFLAGS: ${ZLIB_CFLAGS} |
|---|
| 634 | ZLIB_LIBS: ${ZLIB_LIBS} |
|---|
| 635 | OPENSSL_CFLAGS: ${OPENSSL_CFLAGS} |
|---|
| 636 | OPENSSL_LIBS: ${OPENSSL_LIBS} |
|---|
| 637 | OPENCT_CFLAGS: ${OPENCT_CFLAGS} |
|---|
| 638 | OPENCT_LIBS: ${OPENCT_LIBS} |
|---|
| 639 | PCSC_CFLAGS: ${PCSC_CFLAGS} |
|---|
| 640 | |
|---|
| 641 | EOF |
|---|
| 642 | |
|---|