| 1 | dnl -*- mode: m4; -*- |
|---|
| 2 | dnl Process this file with autoconf to produce a configure script. |
|---|
| 3 | |
|---|
| 4 | # Require autoconf 2.52 |
|---|
| 5 | AC_PREREQ(2.52) |
|---|
| 6 | |
|---|
| 7 | AC_INIT(COPYING) |
|---|
| 8 | AM_INIT_AUTOMAKE(opensc, 0.9.0-alpha) |
|---|
| 9 | AM_CONFIG_HEADER(config.h) |
|---|
| 10 | |
|---|
| 11 | AC_CONFIG_SRCDIR(src/libopensc/sc.c) |
|---|
| 12 | |
|---|
| 13 | # LT Version numbers, remember to change them just *before* a release. |
|---|
| 14 | # (Code changed: REVISION++) |
|---|
| 15 | # (Interfaces added/removed/changed: CURRENT++, REVISION=0) |
|---|
| 16 | # (Interfaces added: AGE++) |
|---|
| 17 | # (Interfaces removed: AGE=0) |
|---|
| 18 | OPENSC_LT_CURRENT=0 |
|---|
| 19 | OPENSC_LT_REVISION=8 |
|---|
| 20 | OPENSC_LT_AGE=0 |
|---|
| 21 | |
|---|
| 22 | AC_SUBST(OPENSC_LT_CURRENT) |
|---|
| 23 | AC_SUBST(OPENSC_LT_REVISION) |
|---|
| 24 | AC_SUBST(OPENSC_LT_AGE) |
|---|
| 25 | |
|---|
| 26 | AC_CANONICAL_HOST |
|---|
| 27 | AC_PROG_CC |
|---|
| 28 | AC_C_BIGENDIAN |
|---|
| 29 | |
|---|
| 30 | dnl Check for some target-specific stuff |
|---|
| 31 | case "$host" in |
|---|
| 32 | *-*-hpux*) |
|---|
| 33 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED" |
|---|
| 34 | AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase]) |
|---|
| 35 | ;; |
|---|
| 36 | *-*-solaris*) |
|---|
| 37 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
|---|
| 38 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" |
|---|
| 39 | need_dash_r=1 |
|---|
| 40 | AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase]) |
|---|
| 41 | ;; |
|---|
| 42 | *-*-sunos4*) |
|---|
| 43 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
|---|
| 44 | AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase]) |
|---|
| 45 | ;; |
|---|
| 46 | *-*-aix*) |
|---|
| 47 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" |
|---|
| 48 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
|---|
| 49 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
|---|
| 50 | blibpath="/usr/lib:/lib:/usr/local/lib" |
|---|
| 51 | fi |
|---|
| 52 | ;; |
|---|
| 53 | *-*-osf*) |
|---|
| 54 | CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET" |
|---|
| 55 | ;; |
|---|
| 56 | *-*-darwin*) |
|---|
| 57 | LIBS="$LIBS -lobjc" |
|---|
| 58 | if test "$GCC" = "yes"; then |
|---|
| 59 | CFLAGS="$CFLAGS -no-cpp-precomp" |
|---|
| 60 | fi |
|---|
| 61 | with_bundles=yes |
|---|
| 62 | ;; |
|---|
| 63 | esac |
|---|
| 64 | |
|---|
| 65 | AC_ARG_WITH(common-dir, |
|---|
| 66 | [ --with-common-dir=PATH Specify path for common installation libraries], |
|---|
| 67 | [ |
|---|
| 68 | if test "x$withval" != "xno" ; then |
|---|
| 69 | trycommondir=$withval |
|---|
| 70 | fi |
|---|
| 71 | ] |
|---|
| 72 | ) |
|---|
| 73 | |
|---|
| 74 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 75 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 76 | AC_CACHE_CHECK([for common directory], ac_cv_commondir, [ |
|---|
| 77 | for commondir in $trycommondir "" /usr/local /usr/pkg /opt ; do |
|---|
| 78 | # Skip directories if they don't exist |
|---|
| 79 | if test ! -z "$commondir" -a ! -d "$commondir/" ; then |
|---|
| 80 | continue; |
|---|
| 81 | fi |
|---|
| 82 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 83 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 84 | |
|---|
| 85 | if test ! -z "$commondir" -a "x$commondir" != "x/usr"; then |
|---|
| 86 | LDFLAGS="-L$commondir/lib $saved_LDFLAGS" |
|---|
| 87 | if test ! -z "$need_dash_r" ; then |
|---|
| 88 | LDFLAGS="-R$commondir/lib $LDFLAGS" |
|---|
| 89 | fi |
|---|
| 90 | CPPFLAGS="-I$commondir/include $saved_CPPFLAGS" |
|---|
| 91 | fi |
|---|
| 92 | break; |
|---|
| 93 | done |
|---|
| 94 | |
|---|
| 95 | if test -z "$commondir" ; then |
|---|
| 96 | commondir="(system)" |
|---|
| 97 | fi |
|---|
| 98 | ac_cv_commondir=$commondir |
|---|
| 99 | ]) |
|---|
| 100 | |
|---|
| 101 | dnl Options |
|---|
| 102 | AM_MAINTAINER_MODE |
|---|
| 103 | |
|---|
| 104 | dnl Checks for programs. |
|---|
| 105 | AC_PROG_CPP |
|---|
| 106 | AC_PROG_INSTALL |
|---|
| 107 | AC_PROG_LN_S |
|---|
| 108 | AC_PROG_MAKE_SET |
|---|
| 109 | AM_PROG_LEX |
|---|
| 110 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
|---|
| 111 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
|---|
| 112 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
|---|
| 113 | |
|---|
| 114 | dnl Special check for pthread support. |
|---|
| 115 | ACX_PTHREAD( |
|---|
| 116 | [ |
|---|
| 117 | AC_DEFINE(HAVE_PTHREAD,1, |
|---|
| 118 | [Define if you have POSIX threads libraries and header files.]) |
|---|
| 119 | ], [ |
|---|
| 120 | AC_MSG_ERROR([POSIX thread support required]) |
|---|
| 121 | ]) |
|---|
| 122 | LIBS="$PTHREAD_LIBS $LIBS" |
|---|
| 123 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
|---|
| 124 | CC="$PTHREAD_CC" |
|---|
| 125 | |
|---|
| 126 | dnl Add libtool support. |
|---|
| 127 | AM_PROG_LIBTOOL |
|---|
| 128 | dnl Automatically update the libtool script if it becomes out-of-date. |
|---|
| 129 | #AC_SUBST(LIBTOOL_DEPS) |
|---|
| 130 | |
|---|
| 131 | dnl Checks for header files. |
|---|
| 132 | AC_HEADER_STDC |
|---|
| 133 | AC_HEADER_SYS_WAIT |
|---|
| 134 | AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h locale.h getopt.h dlfcn.h utmp.h security/pam_appl.h security/_pam_macros.h pam/pam_appl.h pam/_pam_macros.h]) |
|---|
| 135 | |
|---|
| 136 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 137 | AC_C_CONST |
|---|
| 138 | AC_TYPE_UID_T |
|---|
| 139 | AC_TYPE_SIZE_T |
|---|
| 140 | AC_HEADER_TIME |
|---|
| 141 | |
|---|
| 142 | dnl Checks for library functions. |
|---|
| 143 | AC_FUNC_ERROR_AT_LINE |
|---|
| 144 | AC_FUNC_STAT |
|---|
| 145 | AC_FUNC_VPRINTF |
|---|
| 146 | AC_CHECK_FUNCS([getpass gettimeofday memset mkdir strdup strerror setutent vsyslog setlocale]) |
|---|
| 147 | |
|---|
| 148 | dnl C Compiler features |
|---|
| 149 | AC_C_INLINE |
|---|
| 150 | if test "$GCC" = "yes"; then |
|---|
| 151 | CFLAGS="-Wall -fno-strict-aliasing $CFLAGS" |
|---|
| 152 | fi |
|---|
| 153 | |
|---|
| 154 | AC_SUBST(LIBDL) |
|---|
| 155 | AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no) |
|---|
| 156 | |
|---|
| 157 | dnl See if socket() is found from libsocket |
|---|
| 158 | AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket" ac_cv_func_socket_in_lsocket=yes], ac_cv_func_socket_in_lsocket=no) |
|---|
| 159 | |
|---|
| 160 | ac_cv_func_res_query_in_lresolv=no |
|---|
| 161 | if test x$ac_cv_func_socket_in_lsocket = xyes; then |
|---|
| 162 | AC_CHECK_LIB(resolv, res_query, [LIBS="$LIBS -lresolv" ac_cv_func_res_query_in_lresolv=yes]) |
|---|
| 163 | fi |
|---|
| 164 | |
|---|
| 165 | AC_SUBST(GETOPTSRC) |
|---|
| 166 | AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define if you have the `getopt_long' function.]), |
|---|
| 167 | [GETOPTSRC="$GETOPTSRC \$(top_srcdir)/src/common/getopt.c \$(top_srcdir)/src/common/getopt1.c" |
|---|
| 168 | CPPFLAGS="-I\$(top_srcdir)/src/common $CPPFLAGS" |
|---|
| 169 | AC_DEFINE(HAVE_GETOPT_H, 1, [Define if you have the <getopt.h> header file.])]) |
|---|
| 170 | |
|---|
| 171 | AC_CHECK_HEADERS([readline/readline.h]) |
|---|
| 172 | AC_SUBST(LIBREADLINE) |
|---|
| 173 | saved_LIBS="$LIBS" |
|---|
| 174 | # libreadline will also need libtermcap on some OSes |
|---|
| 175 | for add in "" "-ltermcap"; do |
|---|
| 176 | if test "x$add" != x; then |
|---|
| 177 | AC_MSG_CHECKING([for readline with]) |
|---|
| 178 | AC_MSG_RESULT($add) |
|---|
| 179 | fi |
|---|
| 180 | LIBS="$saved_LIBS $add" |
|---|
| 181 | unset ac_cv_lib_readline_readline |
|---|
| 182 | AC_CHECK_LIB(readline, readline, [ |
|---|
| 183 | LIBREADLINE="-lreadline $add" |
|---|
| 184 | ac_cv_func_readline_lreadline=yes |
|---|
| 185 | ], ac_cv_func_readline_lreadline=no) |
|---|
| 186 | test "x$ac_cv_func_readline_lreadline" = xyes && break |
|---|
| 187 | done |
|---|
| 188 | LIBS="$LIBS $LIBREADLINE" |
|---|
| 189 | AC_CHECK_FUNCS(readline) |
|---|
| 190 | LIBS="$saved_LIBS" |
|---|
| 191 | |
|---|
| 192 | AC_ARG_WITH(flex-dir, |
|---|
| 193 | [ --with-flex-dir=PATH Specify path to flex installation], |
|---|
| 194 | [ |
|---|
| 195 | if test "x$withval" != "xno" ; then |
|---|
| 196 | tryflexdir=$withval |
|---|
| 197 | fi |
|---|
| 198 | ] |
|---|
| 199 | ) |
|---|
| 200 | |
|---|
| 201 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 202 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 203 | AC_SUBST(LIBFL) |
|---|
| 204 | AC_CACHE_CHECK([for flex directory], ac_cv_flexdir, [ |
|---|
| 205 | for flexdir in $tryflexdir "" /usr/local/flex /usr/lib/flex /usr/local/flex /usr/lib/flex /usr/local /usr/pkg /opt /opt/flex ; do |
|---|
| 206 | # Skip directories if they don't exist |
|---|
| 207 | if test ! -z "$flexdir" -a ! -d "$flexdir/" ; then |
|---|
| 208 | continue; |
|---|
| 209 | fi |
|---|
| 210 | |
|---|
| 211 | LIBFL="-lfl" |
|---|
| 212 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 213 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 214 | if test ! -z "$flexdir" -a "x$flexdir" != "x/usr"; then |
|---|
| 215 | LDFLAGS="-L$flexdir/lib $saved_LDFLAGS" |
|---|
| 216 | if test ! -z "$need_dash_r" ; then |
|---|
| 217 | LDFLAGS="-R$flexdir/lib $LDFLAGS" |
|---|
| 218 | fi |
|---|
| 219 | CPPFLAGS="-I$flexdir/include $saved_CPPFLAGS" |
|---|
| 220 | fi |
|---|
| 221 | break; |
|---|
| 222 | done |
|---|
| 223 | |
|---|
| 224 | if test -z "$flexdir" ; then |
|---|
| 225 | flexdir="(system)" |
|---|
| 226 | fi |
|---|
| 227 | ac_cv_flexdir=$flexdir |
|---|
| 228 | ]) |
|---|
| 229 | |
|---|
| 230 | dnl The big mess with OpenSSL |
|---|
| 231 | AC_ARG_WITH(openssl, |
|---|
| 232 | [ --with-openssl=PATH use OpenSSL in PATH], |
|---|
| 233 | [tryssldir=$withval]) |
|---|
| 234 | |
|---|
| 235 | SSL_MSG="no" |
|---|
| 236 | ENGINE_MSG="no" |
|---|
| 237 | saved_LIBS="$LIBS" |
|---|
| 238 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 239 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 240 | AC_SUBST(LIBCRYPTO) |
|---|
| 241 | AC_SUBST(ENGINE_LINK) |
|---|
| 242 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
|---|
| 243 | for ssldir in $tryssldir $trycommondir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
|---|
| 244 | # Skip empty variables |
|---|
| 245 | if test -z "$ssldir"; then |
|---|
| 246 | continue; |
|---|
| 247 | fi |
|---|
| 248 | # Disable OpenSSL support |
|---|
| 249 | if test "x$ssldir" = "xno" ; then |
|---|
| 250 | SSL_MSG="no (disabled)" |
|---|
| 251 | ENGINE_MSG="no (disabled)" |
|---|
| 252 | break; |
|---|
| 253 | fi |
|---|
| 254 | # Skip directories if they don't exist |
|---|
| 255 | if test ! -d "$ssldir/" ; then |
|---|
| 256 | continue; |
|---|
| 257 | fi |
|---|
| 258 | LIBCRYPTO="-lcrypto" |
|---|
| 259 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 260 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 261 | LIBS="$saved_LIBS $LIBCRYPTO" |
|---|
| 262 | |
|---|
| 263 | if test "x$ssldir" != "x/usr"; then |
|---|
| 264 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
|---|
| 265 | if test ! -z "$need_dash_r" ; then |
|---|
| 266 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
|---|
| 267 | fi |
|---|
| 268 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
|---|
| 269 | fi |
|---|
| 270 | |
|---|
| 271 | # Basic test to check for compatible version and correct linking |
|---|
| 272 | # *does not* test for RSA - that comes later. |
|---|
| 273 | AC_TRY_RUN( |
|---|
| 274 | [ |
|---|
| 275 | #include <string.h> |
|---|
| 276 | #include <openssl/rand.h> |
|---|
| 277 | int main(void) |
|---|
| 278 | { |
|---|
| 279 | char a[2048]; |
|---|
| 280 | memset(a, 0, sizeof(a)); |
|---|
| 281 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 282 | return(RAND_status() <= 0); |
|---|
| 283 | } |
|---|
| 284 | ], |
|---|
| 285 | [ |
|---|
| 286 | SSL_MSG="yes" |
|---|
| 287 | ], [] |
|---|
| 288 | ) |
|---|
| 289 | |
|---|
| 290 | if test "x$SSL_MSG" != "xyes" |
|---|
| 291 | then |
|---|
| 292 | continue |
|---|
| 293 | fi |
|---|
| 294 | |
|---|
| 295 | # latest openssl version with engine |
|---|
| 296 | # properly integrated? |
|---|
| 297 | AC_TRY_RUN( |
|---|
| 298 | [ |
|---|
| 299 | #include <stdlib.h> |
|---|
| 300 | #include <string.h> |
|---|
| 301 | #include <openssl/opensslv.h> |
|---|
| 302 | |
|---|
| 303 | int main(void) |
|---|
| 304 | { |
|---|
| 305 | |
|---|
| 306 | if(OPENSSL_VERSION_NUMBER >= 0x0090704fL) { |
|---|
| 307 | exit(0); |
|---|
| 308 | } else { |
|---|
| 309 | exit(1); |
|---|
| 310 | } |
|---|
| 311 | } |
|---|
| 312 | ], |
|---|
| 313 | [ |
|---|
| 314 | GOOD_OPENSSL=yes |
|---|
| 315 | ], |
|---|
| 316 | [ |
|---|
| 317 | GOOD_OPENSSL=no |
|---|
| 318 | ] |
|---|
| 319 | ) |
|---|
| 320 | |
|---|
| 321 | if test "x$GOOD_OPENSSL" == "xyes" |
|---|
| 322 | then |
|---|
| 323 | # engine has to be there and working |
|---|
| 324 | LIBS="$saved_LIBS $LIBCRYPTO" |
|---|
| 325 | AC_TRY_RUN( |
|---|
| 326 | [ |
|---|
| 327 | #include <string.h> |
|---|
| 328 | #include <openssl/opensslv.h> |
|---|
| 329 | #include <openssl/engine.h> |
|---|
| 330 | #include <openssl/rand.h> |
|---|
| 331 | int main(void) |
|---|
| 332 | { |
|---|
| 333 | char a[2048]; |
|---|
| 334 | ENGINE *e; |
|---|
| 335 | |
|---|
| 336 | e = ENGINE_new(); |
|---|
| 337 | ENGINE_load_dynamic(); |
|---|
| 338 | if (!e) return 1; |
|---|
| 339 | memset(a, 0, sizeof(a)); |
|---|
| 340 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 341 | return(RAND_status() <= 0); |
|---|
| 342 | } |
|---|
| 343 | ], |
|---|
| 344 | [ |
|---|
| 345 | ENGINE_MSG=yes |
|---|
| 346 | ENGINE_LINK="$LIBCRYPTO" |
|---|
| 347 | ], [ |
|---|
| 348 | # should never happen, |
|---|
| 349 | # every 0.9.7* version has engine |
|---|
| 350 | # support integrated, it can't |
|---|
| 351 | # be missing. |
|---|
| 352 | AC_MSG_ERROR([OpenSSL support broken: openssl >= 0.9.7d without engine detected.]) |
|---|
| 353 | ]) |
|---|
| 354 | break; |
|---|
| 355 | else |
|---|
| 356 | # openssl found, but version less than 0.9.7d |
|---|
| 357 | |
|---|
| 358 | # openssl with engine support? |
|---|
| 359 | LIBCRYPTOA="$ssldir/lib/libcrypto.a $LIBDL" |
|---|
| 360 | LIBS="$saved_LIBS $LIBCRYPTOA" |
|---|
| 361 | AC_TRY_RUN( |
|---|
| 362 | [ |
|---|
| 363 | #include <string.h> |
|---|
| 364 | #include <openssl/opensslv.h> |
|---|
| 365 | #include <openssl/engine.h> |
|---|
| 366 | #include <openssl/rand.h> |
|---|
| 367 | int main(void) |
|---|
| 368 | { |
|---|
| 369 | char a[2048]; |
|---|
| 370 | ENGINE *e; |
|---|
| 371 | |
|---|
| 372 | e = ENGINE_new(); |
|---|
| 373 | ENGINE_load_dynamic(); |
|---|
| 374 | if (!e) return 1; |
|---|
| 375 | memset(a, 0, sizeof(a)); |
|---|
| 376 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 377 | return(RAND_status() <= 0); |
|---|
| 378 | } |
|---|
| 379 | ], |
|---|
| 380 | [ |
|---|
| 381 | ENGINE_MSG=yes |
|---|
| 382 | ENGINE_LINK="$LIBCRYPTOA" |
|---|
| 383 | ], [] |
|---|
| 384 | ) |
|---|
| 385 | break; |
|---|
| 386 | fi |
|---|
| 387 | |
|---|
| 388 | done |
|---|
| 389 | |
|---|
| 390 | if test "x$SSL_MSG" = "xyes" ; then |
|---|
| 391 | ac_cv_openssldir="$ssldir" |
|---|
| 392 | else |
|---|
| 393 | ac_cv_openssldir="no" |
|---|
| 394 | fi |
|---|
| 395 | ], [SSL_MSG=yes]) |
|---|
| 396 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 397 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 398 | LIBS="$saved_LIBS" |
|---|
| 399 | |
|---|
| 400 | if test "x$SSL_MSG" = "xyes" ; then |
|---|
| 401 | AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries]) |
|---|
| 402 | else |
|---|
| 403 | LIBCRYPTO="" |
|---|
| 404 | LIBCRYPTOA="" |
|---|
| 405 | ENGINE_LINK="" |
|---|
| 406 | fi |
|---|
| 407 | AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes") |
|---|
| 408 | AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes") |
|---|
| 409 | |
|---|
| 410 | AC_SUBST(OPENSSL_LDFLAGS) |
|---|
| 411 | if test "x$ENGINE_MSG" = "xyes" ; then |
|---|
| 412 | for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do |
|---|
| 413 | AC_MSG_CHECKING([whether we can use $openssl_ldflag]) |
|---|
| 414 | saved_CFLAGS=$CFLAGS |
|---|
| 415 | CFLAGS="$CFLAGS $openssl_ldflag" |
|---|
| 416 | AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no") |
|---|
| 417 | CFLAGS=$saved_CFLAGS |
|---|
| 418 | AC_MSG_RESULT($ac_cv_use_openssl_flag) |
|---|
| 419 | if test "$ac_cv_use_openssl_flag" = "yes"; then |
|---|
| 420 | OPENSSL_LDFLAGS="$openssl_ldflag" |
|---|
| 421 | break; |
|---|
| 422 | fi |
|---|
| 423 | done |
|---|
| 424 | fi |
|---|
| 425 | |
|---|
| 426 | AC_ARG_WITH(pam-dir, |
|---|
| 427 | [ --with-pam-dir=PATH Specify path for PAM installation libraries], |
|---|
| 428 | [ |
|---|
| 429 | if test "x$withval" != "xno" ; then |
|---|
| 430 | trypamdir=$withval |
|---|
| 431 | fi |
|---|
| 432 | ] |
|---|
| 433 | ) |
|---|
| 434 | |
|---|
| 435 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 436 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 437 | AC_CACHE_CHECK([for pam directory], ac_cv_pamdir, [ |
|---|
| 438 | for pamdir in $trypamdir "" /usr/local /usr/pkg /opt ; do |
|---|
| 439 | # Skip directories if they don't exist |
|---|
| 440 | if test ! -z "$pamdir" -a ! -d "$pamdir/" ; then |
|---|
| 441 | continue; |
|---|
| 442 | fi |
|---|
| 443 | |
|---|
| 444 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 445 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 446 | if test ! -z "$pamdir" -a "x$pamdir" != "x/usr"; then |
|---|
| 447 | LDFLAGS="-L$pamdir/lib $saved_LDFLAGS" |
|---|
| 448 | if test ! -z "$need_dash_r" ; then |
|---|
| 449 | LDFLAGS="-R$pamdir/lib $LDFLAGS" |
|---|
| 450 | fi |
|---|
| 451 | CPPFLAGS="-I$pamdir/include $saved_CPPFLAGS" |
|---|
| 452 | fi |
|---|
| 453 | break; |
|---|
| 454 | done |
|---|
| 455 | |
|---|
| 456 | if test -z "$pamdir" ; then |
|---|
| 457 | pamdir="(system)" |
|---|
| 458 | fi |
|---|
| 459 | ac_cv_pamdir=$pamdir |
|---|
| 460 | ]) |
|---|
| 461 | |
|---|
| 462 | dnl Check for PAM libs |
|---|
| 463 | PAM_MSG="no" |
|---|
| 464 | no_pam="" |
|---|
| 465 | AC_SUBST(LIBPAM) |
|---|
| 466 | saved_LIBS="$LIBS" |
|---|
| 467 | AC_MSG_CHECKING([PAM support]) |
|---|
| 468 | AC_ARG_WITH(pam, |
|---|
| 469 | [ --with-pam Enable PAM support], |
|---|
| 470 | [ |
|---|
| 471 | if test "x$withval" = "xno" ; then |
|---|
| 472 | AC_MSG_RESULT(disabled) |
|---|
| 473 | no_pam=1 |
|---|
| 474 | fi |
|---|
| 475 | ], |
|---|
| 476 | ) |
|---|
| 477 | if test -z "$no_pam" ; then |
|---|
| 478 | if test "x$ac_cv_header_security_pam_appl_h" = "xyes" -o "x$ac_cv_header_pam_pam_appl_h" = "xyes"; then |
|---|
| 479 | AC_MSG_RESULT(yes) |
|---|
| 480 | PAM_MSG="yes" |
|---|
| 481 | AC_CHECK_LIB(pam, pam_set_item, [LIBPAM="$LIBPAM -lpam"], AC_MSG_ERROR([*** libpam missing])) |
|---|
| 482 | LIBS="$LIBS $LIBPAM" |
|---|
| 483 | AC_CHECK_FUNCS(pam_getenvlist) |
|---|
| 484 | AC_CHECK_FUNCS(pam_putenv) |
|---|
| 485 | disable_shadow=yes |
|---|
| 486 | AC_DEFINE(HAVE_PAM, 1, [Have Pluggable Authentication Modules]) |
|---|
| 487 | else |
|---|
| 488 | AC_MSG_RESULT(no) |
|---|
| 489 | fi |
|---|
| 490 | fi |
|---|
| 491 | LIBS="$saved_LIBS" |
|---|
| 492 | AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes") |
|---|
| 493 | |
|---|
| 494 | dnl Check for SIA libs |
|---|
| 495 | AC_SUBST(LIBSIA) |
|---|
| 496 | SIA_MSG="no" |
|---|
| 497 | no_osfsia="" |
|---|
| 498 | AC_MSG_CHECKING([SIA support]) |
|---|
| 499 | AC_ARG_WITH(osfsia, |
|---|
| 500 | [ --with-osfsia Enable Digital Unix SIA], |
|---|
| 501 | [ |
|---|
| 502 | if test "x$withval" = "xno" ; then |
|---|
| 503 | AC_MSG_RESULT(disabled) |
|---|
| 504 | no_osfsia=1 |
|---|
| 505 | fi |
|---|
| 506 | ], |
|---|
| 507 | ) |
|---|
| 508 | if test -z "$no_osfsia" ; then |
|---|
| 509 | if test -f /etc/sia/matrix.conf; then |
|---|
| 510 | AC_MSG_RESULT(yes) |
|---|
| 511 | AC_DEFINE(HAVE_OSF_SIA, 1, [Have Digital Unix SIA]) |
|---|
| 512 | LIBSIA="$LIBSIA -lsecurity -ldb -lm -laud" |
|---|
| 513 | SIA_MSG="yes" |
|---|
| 514 | else |
|---|
| 515 | AC_MSG_RESULT(no) |
|---|
| 516 | fi |
|---|
| 517 | fi |
|---|
| 518 | |
|---|
| 519 | AM_CONDITIONAL(HAVE_SIA, test "x$SIA_MSG" = "xyes") |
|---|
| 520 | |
|---|
| 521 | PCSC_MSG=no |
|---|
| 522 | pcsc_path=/usr |
|---|
| 523 | AC_SUBST(CFLAGS_PCSC) |
|---|
| 524 | AC_SUBST(LIBPCSC) |
|---|
| 525 | |
|---|
| 526 | case "$host" in |
|---|
| 527 | *-*-darwin*) |
|---|
| 528 | PCSC_MSG=yes |
|---|
| 529 | CFLAGS_PCSC="" |
|---|
| 530 | LIBPCSC="-Wl,-framework,PCSC" |
|---|
| 531 | ;; |
|---|
| 532 | esac |
|---|
| 533 | |
|---|
| 534 | saved_LIBS="$LIBS" |
|---|
| 535 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 536 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 537 | AC_ARG_WITH(pcsclite, |
|---|
| 538 | [ --with-pcsclite=PATH use PC/SC Lite in PATH], |
|---|
| 539 | [pcsc_path=$withval]) |
|---|
| 540 | if test "x$pcsc_path" = "xno"; then |
|---|
| 541 | PCSC_MSG="no" |
|---|
| 542 | fi |
|---|
| 543 | if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then |
|---|
| 544 | AC_MSG_CHECKING(for PC/SC Lite support) |
|---|
| 545 | for pcscdir in /pcsc ""; do |
|---|
| 546 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 547 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 548 | LIBS="-lpcsclite $saved_LIBS" |
|---|
| 549 | CFLAGS_PCSC="" |
|---|
| 550 | |
|---|
| 551 | for pcsc_libdir in $pcsc_path/lib$pcscdir \ |
|---|
| 552 | $pcsc_path$pcscdir/lib \ |
|---|
| 553 | $pcsc_path$pcscdir; do |
|---|
| 554 | if test -d $pcsc_libdir; then |
|---|
| 555 | if test -n "${need_dash_r}"; then |
|---|
| 556 | LDFLAGS="-R${pcsc_libdir}/ ${LDFLAGS}" |
|---|
| 557 | fi |
|---|
| 558 | LDFLAGS="-L${pcsc_libdir} ${LDFLAGS}" |
|---|
| 559 | fi |
|---|
| 560 | done |
|---|
| 561 | |
|---|
| 562 | for pcsc_incdir in $pcsc_path/include$pcscdir \ |
|---|
| 563 | $pcsc_path$pcscdir/include \ |
|---|
| 564 | $pcsc_path$pcscdir; do |
|---|
| 565 | if test -d $pcsc_incdir; then |
|---|
| 566 | CFLAGS_PCSC="-I${pcsc_incdir}" |
|---|
| 567 | break; |
|---|
| 568 | fi |
|---|
| 569 | done |
|---|
| 570 | |
|---|
| 571 | CPPFLAGS="${CFLAGS_PCSC} ${CPPFLAGS}" |
|---|
| 572 | AC_TRY_LINK([#include <stdlib.h> |
|---|
| 573 | #include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes) |
|---|
| 574 | if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes"; then |
|---|
| 575 | PCSC_MSG=yes |
|---|
| 576 | break; |
|---|
| 577 | fi |
|---|
| 578 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 579 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 580 | LIBS="$saved_LIBS" |
|---|
| 581 | CFLAGS_PCSC="" |
|---|
| 582 | done |
|---|
| 583 | AC_MSG_RESULT($PCSC_MSG) |
|---|
| 584 | if test "x$PCSC_MSG" = "xyes" ; then |
|---|
| 585 | LIBPCSC="-lpcsclite" |
|---|
| 586 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 587 | LIBS="$saved_LIBS" |
|---|
| 588 | fi |
|---|
| 589 | fi |
|---|
| 590 | AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes") |
|---|
| 591 | if test "x$PCSC_MSG" = "xyes"; then |
|---|
| 592 | AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation]) |
|---|
| 593 | else |
|---|
| 594 | LIBPCSC="" |
|---|
| 595 | CFLAGS_PCSC="" |
|---|
| 596 | fi |
|---|
| 597 | |
|---|
| 598 | OPENCT_MSG=no |
|---|
| 599 | openct_path=/usr |
|---|
| 600 | AC_SUBST(OPENCT_CFLAGS) |
|---|
| 601 | AC_SUBST(OPENCT_LDFLAGS) |
|---|
| 602 | AC_SUBST(OPENCT_LIBS) |
|---|
| 603 | |
|---|
| 604 | saved_LIBS="$LIBS" |
|---|
| 605 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 606 | saved_CFLAGS="$CFLAGS" |
|---|
| 607 | AC_ARG_WITH(openct, |
|---|
| 608 | [ --with-openct=PATH use OpenCT in PATH], |
|---|
| 609 | [openct_path=$withval]) |
|---|
| 610 | if test "x$openct_path" = "xno"; then |
|---|
| 611 | OPENCT_MSG="no" |
|---|
| 612 | fi |
|---|
| 613 | if test "x$openct_path" != "xno" -a "x$OPENCT_MSG" != "xyes"; then |
|---|
| 614 | AC_MSG_CHECKING(for OpenCT support) |
|---|
| 615 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 616 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 617 | LIBS="$saved_LIBS" |
|---|
| 618 | |
|---|
| 619 | OPENCT_CFLAGS="-I${openct_path}/include" |
|---|
| 620 | OPENCT_LIBS="-lopenct" |
|---|
| 621 | OPENCT_LDFLAGS="" |
|---|
| 622 | if test -n "${need_dash_r}"; then |
|---|
| 623 | OPENCT_LDFLAGS="-R${openct_path}/lib" |
|---|
| 624 | fi |
|---|
| 625 | OPENCT_LDFLAGS="-L${openct_path}/lib $OPENCT_LDFLAGS" |
|---|
| 626 | |
|---|
| 627 | LIBS="$OPENCT_LIBS $saved_LIBS" |
|---|
| 628 | LDFLAGS="$OPENCT_LDFLAGS $saved_LDFLAGS" |
|---|
| 629 | CFLAGS="$OPENCT_CFLAGS $saved_CFLAGS" |
|---|
| 630 | |
|---|
| 631 | AC_TRY_LINK([#include <openct/openct.h>],[ct_reader_connect(0);],OPENCT_MSG=yes,OPENCT_MSG=no) |
|---|
| 632 | AC_MSG_RESULT($OPENCT_MSG) |
|---|
| 633 | |
|---|
| 634 | CFLAGS="$saved_CFLAGS" |
|---|
| 635 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 636 | LIBS="$saved_LIBS" |
|---|
| 637 | fi |
|---|
| 638 | |
|---|
| 639 | AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes") |
|---|
| 640 | if test "x$OPENCT_MSG" = "xyes"; then |
|---|
| 641 | AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) |
|---|
| 642 | else |
|---|
| 643 | OPENCT_LDFLAGS="" |
|---|
| 644 | OPENCT_LIBS="" |
|---|
| 645 | OPENCT_CFLAGS="" |
|---|
| 646 | fi |
|---|
| 647 | |
|---|
| 648 | # Check for user-specified random device, otherwise check /dev/urandom |
|---|
| 649 | AC_ARG_WITH(random, |
|---|
| 650 | [ --with-random=FILE read entropy from FILE (default=/dev/urandom)], |
|---|
| 651 | [ |
|---|
| 652 | if test "x$withval" != "xno" ; then |
|---|
| 653 | RANDOM_POOL="$withval"; |
|---|
| 654 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool]) |
|---|
| 655 | fi |
|---|
| 656 | ], |
|---|
| 657 | [ |
|---|
| 658 | # Check for random device |
|---|
| 659 | AC_CHECK_FILE("/dev/urandom", |
|---|
| 660 | [ |
|---|
| 661 | RANDOM_POOL="/dev/urandom"; |
|---|
| 662 | AC_SUBST(RANDOM_POOL) |
|---|
| 663 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool]) |
|---|
| 664 | ] |
|---|
| 665 | ) |
|---|
| 666 | ] |
|---|
| 667 | ) |
|---|
| 668 | |
|---|
| 669 | # Check for PRNGD/EGD pool file |
|---|
| 670 | AC_ARG_WITH(prngd-port, |
|---|
| 671 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT], |
|---|
| 672 | [ |
|---|
| 673 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
|---|
| 674 | PRNGD_PORT="$withval" |
|---|
| 675 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT, [Port number of PRNGD/EGD random number socket]) |
|---|
| 676 | fi |
|---|
| 677 | ] |
|---|
| 678 | ) |
|---|
| 679 | |
|---|
| 680 | # Check for PRNGD/EGD pool file |
|---|
| 681 | AC_ARG_WITH(prngd-socket, |
|---|
| 682 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
|---|
| 683 | [ |
|---|
| 684 | if test "x$withval" != "xno" ; then |
|---|
| 685 | PRNGD_SOCKET="$withval" |
|---|
| 686 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket]) |
|---|
| 687 | fi |
|---|
| 688 | ], |
|---|
| 689 | [ |
|---|
| 690 | # Check for existing socket only if we don't have a random device already |
|---|
| 691 | if test -z "$RANDOM_POOL" ; then |
|---|
| 692 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
|---|
| 693 | # Insert other locations here |
|---|
| 694 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy /tmp/entropy; do |
|---|
| 695 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
|---|
| 696 | PRNGD_SOCKET="$sock" |
|---|
| 697 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket]) |
|---|
| 698 | break; |
|---|
| 699 | fi |
|---|
| 700 | done |
|---|
| 701 | if test ! -z "$PRNGD_SOCKET" ; then |
|---|
| 702 | AC_MSG_RESULT($PRNGD_SOCKET) |
|---|
| 703 | else |
|---|
| 704 | AC_MSG_RESULT(not found) |
|---|
| 705 | fi |
|---|
| 706 | fi |
|---|
| 707 | ] |
|---|
| 708 | ) |
|---|
| 709 | |
|---|
| 710 | ### BEGIN LDAP SPECIFIC OPTIONS |
|---|
| 711 | dnl ldap autoconf magic partly taken from pam_ldap |
|---|
| 712 | |
|---|
| 713 | dnl --enable-ldap option. |
|---|
| 714 | AC_ARG_ENABLE(ldap, |
|---|
| 715 | [ --enable-ldap enable use of LDAP for authentication. [default=yes]], |
|---|
| 716 | , enable_ldap=yes) |
|---|
| 717 | AC_ARG_ENABLE(ldap-ssl, [ --disable-ldap-ssl disable SSL/TSL support for ldap]) |
|---|
| 718 | AC_ARG_WITH(ldap-lib, [ --with-ldap-lib=type select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]]) |
|---|
| 719 | AC_ARG_WITH(ldap-dir, [ --with-ldap-dir=DIR base directory of ldap SDK]) |
|---|
| 720 | |
|---|
| 721 | AC_SUBST(LIBLDAP) |
|---|
| 722 | LDAP_MSG="no" |
|---|
| 723 | if (test x$enable_ldap = xyes); then |
|---|
| 724 | if test -n "$with_ldap_dir"; then |
|---|
| 725 | CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include" |
|---|
| 726 | LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib" |
|---|
| 727 | case "$target_os" in |
|---|
| 728 | solaris*) LDFLAGS="$LDFLAGS -Wl,-R$with_ldap_dir/lib" ;; |
|---|
| 729 | *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;; |
|---|
| 730 | esac |
|---|
| 731 | fi |
|---|
| 732 | |
|---|
| 733 | AC_CHECK_HEADERS(lber.h ldap.h ldap_ssl.h) |
|---|
| 734 | |
|---|
| 735 | dnl check which ldap library we have |
|---|
| 736 | if test -z "$with_ldap_lib"; then |
|---|
| 737 | with_ldap_lib=auto |
|---|
| 738 | fi |
|---|
| 739 | |
|---|
| 740 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then |
|---|
| 741 | AC_CHECK_LIB(lber, ber_init, LIBLDAP="-llber $LIBLDAP" found_lber_lib=yes) |
|---|
| 742 | saved_LIBS="$LIBS" |
|---|
| 743 | LIBS="$LIBS $LIBLDAP" |
|---|
| 744 | AC_CHECK_LIB(ldap, ldap_search, LIBLDAP="-lldap $LIBLDAP" found_ldap_lib=yes) |
|---|
| 745 | AC_CHECK_LIB(ldap, ldap_start_tls_s, LIBLDAP="-lssl $LIBLDAP" need_ssl_lib=yes) |
|---|
| 746 | LIBS="$saved_LIBS" |
|---|
| 747 | fi |
|---|
| 748 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then |
|---|
| 749 | AC_CHECK_LIB(ldap50, ldap_search, LIBLDAP="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 750 | fi |
|---|
| 751 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then |
|---|
| 752 | AC_CHECK_LIB(ldapssl41, ldap_search, LIBLDAP="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 753 | if test -z "$found_ldap_lib"; then |
|---|
| 754 | AC_CHECK_LIB(ldapssl40, ldap_search, LIBLDAP="-lldapssl40 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 755 | fi |
|---|
| 756 | fi |
|---|
| 757 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then |
|---|
| 758 | AC_CHECK_LIB(ldapssl30, ldap_search, LIBLDAP="-lldapssl30 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 759 | fi |
|---|
| 760 | |
|---|
| 761 | if test -n "$found_ldap_lib" -a "x$ac_cv_header_ldap_h" = "xyes"; then |
|---|
| 762 | AC_DEFINE(LDAP_REFERRALS,1,[This is needed for the native Solaris LDAP SDK]) |
|---|
| 763 | AC_DEFINE(HAVE_LDAP, 1, [Use LDAP for authentication etc.]) |
|---|
| 764 | LDAP_MSG="yes" |
|---|
| 765 | |
|---|
| 766 | saved_LIBS="$LIBS" |
|---|
| 767 | LIBS="$LIBS $LIBLDAP" |
|---|
| 768 | AC_CHECK_FUNCS(ldap_init) |
|---|
| 769 | if test "$enable_ldap_ssl" \!= "no"; then |
|---|
| 770 | AC_CHECK_FUNCS(ldapssl_init ldap_start_tls_s ldap_pvt_tls_set_option) |
|---|
| 771 | fi |
|---|
| 772 | LIBS="$saved_LIBS" |
|---|
| 773 | fi |
|---|
| 774 | fi |
|---|
| 775 | AM_CONDITIONAL(HAVE_LDAP, test "x$LDAP_MSG" = "xyes") |
|---|
| 776 | ### END LDAP SPECIFIC OPTIONS |
|---|
| 777 | |
|---|
| 778 | ### BEGIN ASSUAN SPECIFIC OPTIONS |
|---|
| 779 | ASSUAN_MSG="no" |
|---|
| 780 | AC_SUBST(CFLAGS_ASSUAN) |
|---|
| 781 | AC_SUBST(LIBASSUAN) |
|---|
| 782 | LIBASSUAN="-lassuan" |
|---|
| 783 | AC_ARG_WITH(assuan, |
|---|
| 784 | [ --with-assuan=PATH use Assuan libraries in PATH], |
|---|
| 785 | [ |
|---|
| 786 | if test -n "${need_dash_r}"; then |
|---|
| 787 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
|---|
| 788 | else |
|---|
| 789 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
|---|
| 790 | fi |
|---|
| 791 | CFLAGS_ASSUAN="-I${withval}/include ${CFLAGS_ASSUAN}" |
|---|
| 792 | ] |
|---|
| 793 | ) |
|---|
| 794 | |
|---|
| 795 | AC_CHECK_LIB(assuan, assuan_pipe_connect, ASSUAN_MSG="yes", ASSUAN_MSG="no") |
|---|
| 796 | if test "x$ASSUAN_MSG" != "xno" ; then |
|---|
| 797 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 798 | CPPFLAGS="$CFLAGS_ASSUAN $CPPFLAGS" |
|---|
| 799 | AC_CHECK_HEADER(assuan.h, ASSUAN_MSG="yes", ASSUAN_MSG="no") |
|---|
| 800 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 801 | fi |
|---|
| 802 | AM_CONDITIONAL(HAVE_ASSUAN, test "x$ASSUAN_MSG" = "xyes") |
|---|
| 803 | ### END ASSUAN SPECIFIC OPTIONS |
|---|
| 804 | |
|---|
| 805 | PLUGINDIR="/usr/lib/mozilla/plugins" |
|---|
| 806 | AC_ARG_WITH(plugin-dir, |
|---|
| 807 | [ --with-plugin-dir=PATH install Mozilla plugin to PATH [[/usr/lib/mozilla/plugins]]], |
|---|
| 808 | [ |
|---|
| 809 | PLUGINDIR="$withval" |
|---|
| 810 | ] |
|---|
| 811 | ) |
|---|
| 812 | AC_SUBST(PLUGINDIR) |
|---|
| 813 | |
|---|
| 814 | BUNDLEDIR="${libdir}" |
|---|
| 815 | AC_ARG_WITH(bundle-dir, |
|---|
| 816 | [ --with-bundle-dir=PATH install MacOS X bundles to PATH [[EPREFIX/lib]]], |
|---|
| 817 | [ |
|---|
| 818 | BUNDLEDIR="$withval" |
|---|
| 819 | ] |
|---|
| 820 | ) |
|---|
| 821 | AC_SUBST(BUNDLEDIR) |
|---|
| 822 | |
|---|
| 823 | # Check for PIN entry program used by OpenSC Signer |
|---|
| 824 | PIN_ENTRY="/usr/local/bin/gpinentry" |
|---|
| 825 | AC_ARG_WITH(pin-entry, |
|---|
| 826 | [ --with-pin-entry=PROG Run PROG as PIN-entry for OpenSC Signer], |
|---|
| 827 | [ |
|---|
| 828 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
|---|
| 829 | PIN_ENTRY="$withval" |
|---|
| 830 | fi |
|---|
| 831 | ] |
|---|
| 832 | ) |
|---|
| 833 | AC_DEFINE_UNQUOTED(PIN_ENTRY, "$PIN_ENTRY", [PIN-entry program for OpenSC Signer]) |
|---|
| 834 | |
|---|
| 835 | dnl Check for SGML processor |
|---|
| 836 | AC_ARG_WITH(docbook, |
|---|
| 837 | [ --without-docbook do no generate html manual (needs docbook)], |
|---|
| 838 | with_docbook=$withval) |
|---|
| 839 | AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc) |
|---|
| 840 | if test "x$XSLTPROC" = "x"; then |
|---|
| 841 | if test "x$with_docbook" = "xyes"; then |
|---|
| 842 | AC_MSG_ERROR([Docbook support requested, but cannot find xsltproc]) |
|---|
| 843 | fi |
|---|
| 844 | with_docbook=no |
|---|
| 845 | fi |
|---|
| 846 | AM_CONDITIONAL(HAVE_DOCBOOK, test "x$with_docbook" = "xyes") |
|---|
| 847 | |
|---|
| 848 | if test "x$prefix" = xNONE; then |
|---|
| 849 | prefix=$ac_default_prefix |
|---|
| 850 | fi |
|---|
| 851 | if test "x$exec_prefix" = xNONE; then |
|---|
| 852 | exec_prefix='${prefix}' |
|---|
| 853 | fi |
|---|
| 854 | |
|---|
| 855 | dnl Enable/disable debugging messages. |
|---|
| 856 | AC_ARG_ENABLE(debug, |
|---|
| 857 | [ --enable-debug enable debug messages. [default=no]], |
|---|
| 858 | , enable_debug=no) |
|---|
| 859 | if (test x$enable_debug = xyes); then |
|---|
| 860 | AC_DEFINE(DEBUG, 1, [Enable debug messages.]) |
|---|
| 861 | fi |
|---|
| 862 | |
|---|
| 863 | CPPFLAGS="-I\${top_builddir}/src/include $CPPFLAGS" |
|---|
| 864 | AM_CONDITIONAL(HAVE_BUNDLES, test "x$with_bundles" = "xyes") |
|---|
| 865 | |
|---|
| 866 | scldap_etc_path=`eval echo ${sysconfdir}` ; scldap_etc_path=`eval echo ${scldap_etc_path}` |
|---|
| 867 | AC_DEFINE_UNQUOTED(SCLDAP_ETC_PATH, "$scldap_etc_path", [etc path for libscldap]) |
|---|
| 868 | scldap_conf_path=`eval echo ${scldap_etc_path}/scldap.conf` |
|---|
| 869 | AC_DEFINE_UNQUOTED(SCLDAP_CONF_PATH, "$scldap_conf_path", [default config file for libscldap]) |
|---|
| 870 | |
|---|
| 871 | opensc_etc_path=`eval echo ${sysconfdir}` ; opensc_etc_path=`eval echo ${opensc_etc_path}` |
|---|
| 872 | AC_DEFINE_UNQUOTED(OPENSC_ETC_PATH, "$opensc_etc_path", [etc path for libopensc]) |
|---|
| 873 | opensc_conf_path=`eval echo ${opensc_etc_path}/opensc.conf` |
|---|
| 874 | AC_DEFINE_UNQUOTED(OPENSC_CONF_PATH, "$opensc_conf_path", [default config file for libopensc]) |
|---|
| 875 | |
|---|
| 876 | AC_SUBST(LIBSCCONF) |
|---|
| 877 | LIBSCCONF="\${top_builddir}/src/scconf/libscconf.la" |
|---|
| 878 | AC_SUBST(LIBSCLDAP) |
|---|
| 879 | if test "x$LDAP_MSG" = "xyes" ; then |
|---|
| 880 | LIBSCLDAP="\${top_builddir}/src/scldap/libscldap.la" |
|---|
| 881 | fi |
|---|
| 882 | AC_SUBST(LIBOPENSC) |
|---|
| 883 | LIBOPENSC="\${top_builddir}/src/libopensc/libopensc.la" |
|---|
| 884 | |
|---|
| 885 | # Pass information about installed OpenSC requirements, so that |
|---|
| 886 | # a proper opensc-config file will be build. |
|---|
| 887 | OPENSC_LIBS="-L${libdir} -lopensc" |
|---|
| 888 | OPENSC_CFLAGS="" |
|---|
| 889 | AC_SUBST(OPENSC_LIBS) |
|---|
| 890 | AC_SUBST(OPENSC_CFLAGS) |
|---|
| 891 | |
|---|
| 892 | pkgdata=`eval echo ${datadir}/${PACKAGE}` ; pkgdata=`eval echo ${pkgdata}` |
|---|
| 893 | AC_SUBST(pkgdata) |
|---|
| 894 | |
|---|
| 895 | AC_OUTPUT([ |
|---|
| 896 | Makefile |
|---|
| 897 | aclocal/Makefile |
|---|
| 898 | docs/Makefile |
|---|
| 899 | docs/pkcs15-profile.5 |
|---|
| 900 | etc/Makefile |
|---|
| 901 | macos/Makefile |
|---|
| 902 | src/Makefile |
|---|
| 903 | src/common/Makefile |
|---|
| 904 | src/include/Makefile |
|---|
| 905 | src/include/opensc/Makefile |
|---|
| 906 | src/include/opensc/rsaref/Makefile |
|---|
| 907 | src/libopensc/Makefile |
|---|
| 908 | src/libopensc/opensc-config |
|---|
| 909 | src/libopensc/libopensc.pc |
|---|
| 910 | src/openscd/Makefile |
|---|
| 911 | src/openssh/Makefile |
|---|
| 912 | src/pam/Makefile |
|---|
| 913 | src/pkcs11/Makefile |
|---|
| 914 | src/pkcs11/rsaref/Makefile |
|---|
| 915 | src/pkcs15init/Makefile |
|---|
| 916 | src/scam/Makefile |
|---|
| 917 | src/scconf/Makefile |
|---|
| 918 | src/scdl/Makefile |
|---|
| 919 | src/scldap/Makefile |
|---|
| 920 | src/scrandom/Makefile |
|---|
| 921 | src/sia/Makefile |
|---|
| 922 | src/signer/Makefile |
|---|
| 923 | src/signer/npinclude/Makefile |
|---|
| 924 | src/sslengines/Makefile |
|---|
| 925 | src/tests/Makefile |
|---|
| 926 | src/tests/regression/Makefile |
|---|
| 927 | src/tools/Makefile |
|---|
| 928 | win32/Makefile |
|---|
| 929 | ]) |
|---|
| 930 | |
|---|
| 931 | if test ! -z "$RANDOM_POOL" ; then |
|---|
| 932 | RAND_MSG="device ($RANDOM_POOL)" |
|---|
| 933 | else |
|---|
| 934 | if test ! -z "$PRNGD_PORT" ; then |
|---|
| 935 | RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)" |
|---|
| 936 | elif test ! -z "$PRNGD_SOCKET" ; then |
|---|
| 937 | RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)" |
|---|
| 938 | else |
|---|
| 939 | RAND_MSG="Builtin kluge" |
|---|
| 940 | BUILTIN_RNG=1 |
|---|
| 941 | fi |
|---|
| 942 | fi |
|---|
| 943 | |
|---|
| 944 | dnl Someone please show me a better way :) |
|---|
| 945 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
|---|
| 946 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
|---|
| 947 | C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}` |
|---|
| 948 | |
|---|
| 949 | echo "" |
|---|
| 950 | echo "OpenSC has been configured with the following options" |
|---|
| 951 | |
|---|
| 952 | echo "" |
|---|
| 953 | echo "User binaries: ${B}" |
|---|
| 954 | echo "Configuration files: ${C}" |
|---|
| 955 | |
|---|
| 956 | echo "" |
|---|
| 957 | echo "Host: ${host}" |
|---|
| 958 | echo "Compiler: ${CC}" |
|---|
| 959 | echo "Compiler flags: ${CFLAGS}" |
|---|
| 960 | echo "Preprocessor flags: ${CPPFLAGS}" |
|---|
| 961 | echo "Linker flags: ${LDFLAGS}" |
|---|
| 962 | echo "Libraries: ${LIBS}" |
|---|
| 963 | |
|---|
| 964 | echo "" |
|---|
| 965 | echo "Random number collection: ${RAND_MSG}" |
|---|
| 966 | echo "OpenSSL support: ${SSL_MSG}" |
|---|
| 967 | echo " with engine: ${ENGINE_MSG}" |
|---|
| 968 | echo "PC/SC support: ${PCSC_MSG}" |
|---|
| 969 | echo "OpenCT support: ${OPENCT_MSG}" |
|---|
| 970 | echo "Assuan support: ${ASSUAN_MSG}" |
|---|
| 971 | echo "LDAP support: ${LDAP_MSG}" |
|---|
| 972 | echo "PAM support: ${PAM_MSG}" |
|---|
| 973 | case "$host" in |
|---|
| 974 | *-*-osf*) |
|---|
| 975 | echo "SIA support: ${SIA_MSG}" |
|---|
| 976 | ;; |
|---|
| 977 | esac |
|---|
| 978 | echo "" |
|---|
| 979 | |
|---|
| 980 | if test "x$ENGINE_MSG" = "xno" -a "x$SSL_MSG" = "xyes"; then |
|---|
| 981 | echo "OpenSSL was found. But to use the engine you will need" |
|---|
| 982 | echo "version 0.9.7a or later." |
|---|
| 983 | fi |
|---|
| 984 | |
|---|
| 985 | if test ! -z "$BUILTIN_RNG"; then |
|---|
| 986 | echo "WARNING: you are using the builtin random number service." |
|---|
| 987 | echo "The random number service is very simple and is only" |
|---|
| 988 | echo "intended for testing purposes. Please request your OS" |
|---|
| 989 | echo "vendor to include /dev/random in future versions of" |
|---|
| 990 | echo "their OS. Or use PRNGD/EGD instead, your choice." |
|---|
| 991 | fi |
|---|