| 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.4) |
|---|
| 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=1 |
|---|
| 19 | OPENSC_LT_REVISION=0 |
|---|
| 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 | if test "x$tryssldir" = "x" ; then |
|---|
| 244 | tryssldir="$trycommandir /usr/ /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl" |
|---|
| 245 | fi |
|---|
| 246 | |
|---|
| 247 | for ssldir in $tryssldir ; do |
|---|
| 248 | # Skip empty variables |
|---|
| 249 | if test -z "$ssldir"; then |
|---|
| 250 | continue; |
|---|
| 251 | fi |
|---|
| 252 | # Disable OpenSSL support |
|---|
| 253 | if test "x$ssldir" = "xno" ; then |
|---|
| 254 | SSL_MSG="no (disabled)" |
|---|
| 255 | ENGINE_MSG="no (disabled)" |
|---|
| 256 | break; |
|---|
| 257 | fi |
|---|
| 258 | # Skip directories if they don't exist |
|---|
| 259 | if test ! -d "$ssldir/" ; then |
|---|
| 260 | continue; |
|---|
| 261 | fi |
|---|
| 262 | LIBCRYPTO="-lcrypto" |
|---|
| 263 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 264 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 265 | LIBS="$saved_LIBS $LIBCRYPTO" |
|---|
| 266 | |
|---|
| 267 | if test "x$ssldir" != "x/usr"; then |
|---|
| 268 | LDFLAGS="-L$ssldir/lib $saved_LDFLAGS" |
|---|
| 269 | if test ! -z "$need_dash_r" ; then |
|---|
| 270 | LDFLAGS="-R$ssldir/lib $LDFLAGS" |
|---|
| 271 | fi |
|---|
| 272 | CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS" |
|---|
| 273 | fi |
|---|
| 274 | |
|---|
| 275 | # Basic test to check for compatible version and correct linking |
|---|
| 276 | # *does not* test for RSA - that comes later. |
|---|
| 277 | AC_TRY_RUN( |
|---|
| 278 | [ |
|---|
| 279 | #include <string.h> |
|---|
| 280 | #include <openssl/rand.h> |
|---|
| 281 | int main(void) |
|---|
| 282 | { |
|---|
| 283 | char a[2048]; |
|---|
| 284 | memset(a, 0, sizeof(a)); |
|---|
| 285 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 286 | return(RAND_status() <= 0); |
|---|
| 287 | } |
|---|
| 288 | ], |
|---|
| 289 | [ |
|---|
| 290 | SSL_MSG="yes" |
|---|
| 291 | ], [] |
|---|
| 292 | ) |
|---|
| 293 | |
|---|
| 294 | if test "x$SSL_MSG" != "xyes" |
|---|
| 295 | then |
|---|
| 296 | continue |
|---|
| 297 | fi |
|---|
| 298 | |
|---|
| 299 | # latest openssl version with engine |
|---|
| 300 | # properly integrated? |
|---|
| 301 | AC_MSG_CHECKING([for openssl version]) |
|---|
| 302 | AC_TRY_RUN( |
|---|
| 303 | [ |
|---|
| 304 | #include <stdlib.h> |
|---|
| 305 | #include <string.h> |
|---|
| 306 | #include <openssl/opensslv.h> |
|---|
| 307 | |
|---|
| 308 | int main(void) |
|---|
| 309 | { |
|---|
| 310 | |
|---|
| 311 | if(OPENSSL_VERSION_NUMBER >= 0x0090704fL) { |
|---|
| 312 | exit(0); |
|---|
| 313 | } else { |
|---|
| 314 | exit(1); |
|---|
| 315 | } |
|---|
| 316 | } |
|---|
| 317 | ], |
|---|
| 318 | [ |
|---|
| 319 | AC_MSG_RESULT("good, 0.9.7d or later") |
|---|
| 320 | GOOD_OPENSSL=yes |
|---|
| 321 | ], |
|---|
| 322 | [ |
|---|
| 323 | AC_MSG_RESULT("not so good, 0.9.7d or later woudl be better") |
|---|
| 324 | GOOD_OPENSSL=no |
|---|
| 325 | ] |
|---|
| 326 | ) |
|---|
| 327 | |
|---|
| 328 | if test "x$GOOD_OPENSSL" == "xyes" |
|---|
| 329 | then |
|---|
| 330 | # engine has to be there and working |
|---|
| 331 | LIBS="$saved_LIBS $LIBCRYPTO $LIBDL" |
|---|
| 332 | AC_TRY_RUN( |
|---|
| 333 | [ |
|---|
| 334 | #include <string.h> |
|---|
| 335 | #include <openssl/opensslv.h> |
|---|
| 336 | #include <openssl/engine.h> |
|---|
| 337 | #include <openssl/rand.h> |
|---|
| 338 | int main(void) |
|---|
| 339 | { |
|---|
| 340 | char a[2048]; |
|---|
| 341 | ENGINE *e; |
|---|
| 342 | |
|---|
| 343 | e = ENGINE_new(); |
|---|
| 344 | ENGINE_load_dynamic(); |
|---|
| 345 | if (!e) return 1; |
|---|
| 346 | memset(a, 0, sizeof(a)); |
|---|
| 347 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 348 | return(RAND_status() <= 0); |
|---|
| 349 | } |
|---|
| 350 | ], |
|---|
| 351 | [ |
|---|
| 352 | ENGINE_MSG=yes |
|---|
| 353 | ENGINE_LINK="$LIBCRYPTO" |
|---|
| 354 | ], [ |
|---|
| 355 | # should never happen, |
|---|
| 356 | # every 0.9.7* version has engine |
|---|
| 357 | # support integrated, it can't |
|---|
| 358 | # be missing. |
|---|
| 359 | AC_MSG_ERROR([OpenSSL support broken: openssl >= 0.9.7d without engine detected.]) |
|---|
| 360 | ]) |
|---|
| 361 | break; |
|---|
| 362 | else |
|---|
| 363 | # openssl found, but version less than 0.9.7d |
|---|
| 364 | |
|---|
| 365 | # openssl with engine support? |
|---|
| 366 | LIBCRYPTOA="$ssldir/lib/libcrypto.a $LIBDL" |
|---|
| 367 | LIBS="$saved_LIBS $LIBCRYPTOA" |
|---|
| 368 | AC_TRY_RUN( |
|---|
| 369 | [ |
|---|
| 370 | #include <string.h> |
|---|
| 371 | #include <openssl/opensslv.h> |
|---|
| 372 | #include <openssl/engine.h> |
|---|
| 373 | #include <openssl/rand.h> |
|---|
| 374 | int main(void) |
|---|
| 375 | { |
|---|
| 376 | char a[2048]; |
|---|
| 377 | ENGINE *e; |
|---|
| 378 | |
|---|
| 379 | e = ENGINE_new(); |
|---|
| 380 | ENGINE_load_dynamic(); |
|---|
| 381 | if (!e) return 1; |
|---|
| 382 | memset(a, 0, sizeof(a)); |
|---|
| 383 | RAND_add(a, sizeof(a), sizeof(a)); |
|---|
| 384 | return(RAND_status() <= 0); |
|---|
| 385 | } |
|---|
| 386 | ], |
|---|
| 387 | [ |
|---|
| 388 | ENGINE_MSG=yes |
|---|
| 389 | ENGINE_LINK="$LIBCRYPTOA" |
|---|
| 390 | ], [] |
|---|
| 391 | ) |
|---|
| 392 | break; |
|---|
| 393 | fi |
|---|
| 394 | |
|---|
| 395 | done |
|---|
| 396 | |
|---|
| 397 | if test "x$SSL_MSG" = "xyes" ; then |
|---|
| 398 | ac_cv_openssldir="$ssldir" |
|---|
| 399 | else |
|---|
| 400 | ac_cv_openssldir="no" |
|---|
| 401 | fi |
|---|
| 402 | ], [SSL_MSG=yes]) |
|---|
| 403 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 404 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 405 | LIBS="$saved_LIBS" |
|---|
| 406 | |
|---|
| 407 | if test "x$SSL_MSG" = "xyes" ; then |
|---|
| 408 | AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries]) |
|---|
| 409 | LDFLAGS="-L$ac_cv_openssldir/lib $LDFLAGS" |
|---|
| 410 | if test ! -z "$need_dash_r" ; then |
|---|
| 411 | LDFLAGS="-R$ac_cv_openssldir/lib $LDFLAGS" |
|---|
| 412 | fi |
|---|
| 413 | CPPFLAGS="-I$ac_cv_openssldir/include $saved_CPPFLAGS" |
|---|
| 414 | else |
|---|
| 415 | LIBCRYPTO="" |
|---|
| 416 | LIBCRYPTOA="" |
|---|
| 417 | ENGINE_LINK="" |
|---|
| 418 | fi |
|---|
| 419 | AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes") |
|---|
| 420 | AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes") |
|---|
| 421 | |
|---|
| 422 | AC_SUBST(OPENSSL_LDFLAGS) |
|---|
| 423 | if test "x$ENGINE_MSG" = "xyes" ; then |
|---|
| 424 | for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do |
|---|
| 425 | AC_MSG_CHECKING([whether we can use $openssl_ldflag]) |
|---|
| 426 | saved_CFLAGS=$CFLAGS |
|---|
| 427 | CFLAGS="$CFLAGS $openssl_ldflag" |
|---|
| 428 | AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no") |
|---|
| 429 | CFLAGS=$saved_CFLAGS |
|---|
| 430 | AC_MSG_RESULT($ac_cv_use_openssl_flag) |
|---|
| 431 | if test "$ac_cv_use_openssl_flag" = "yes"; then |
|---|
| 432 | OPENSSL_LDFLAGS="$openssl_ldflag" |
|---|
| 433 | break; |
|---|
| 434 | fi |
|---|
| 435 | done |
|---|
| 436 | fi |
|---|
| 437 | |
|---|
| 438 | AC_ARG_WITH(pam-dir, |
|---|
| 439 | [ --with-pam-dir=PATH Specify path for PAM installation libraries], |
|---|
| 440 | [ |
|---|
| 441 | if test "x$withval" != "xno" ; then |
|---|
| 442 | trypamdir=$withval |
|---|
| 443 | fi |
|---|
| 444 | ] |
|---|
| 445 | ) |
|---|
| 446 | |
|---|
| 447 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 448 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 449 | AC_CACHE_CHECK([for pam directory], ac_cv_pamdir, [ |
|---|
| 450 | for pamdir in $trypamdir "" /usr/local /usr/pkg /opt ; do |
|---|
| 451 | # Skip directories if they don't exist |
|---|
| 452 | if test ! -z "$pamdir" -a ! -d "$pamdir/" ; then |
|---|
| 453 | continue; |
|---|
| 454 | fi |
|---|
| 455 | |
|---|
| 456 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 457 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 458 | if test ! -z "$pamdir" -a "x$pamdir" != "x/usr"; then |
|---|
| 459 | LDFLAGS="-L$pamdir/lib $saved_LDFLAGS" |
|---|
| 460 | if test ! -z "$need_dash_r" ; then |
|---|
| 461 | LDFLAGS="-R$pamdir/lib $LDFLAGS" |
|---|
| 462 | fi |
|---|
| 463 | CPPFLAGS="-I$pamdir/include $saved_CPPFLAGS" |
|---|
| 464 | fi |
|---|
| 465 | break; |
|---|
| 466 | done |
|---|
| 467 | |
|---|
| 468 | if test -z "$pamdir" ; then |
|---|
| 469 | pamdir="(system)" |
|---|
| 470 | fi |
|---|
| 471 | ac_cv_pamdir=$pamdir |
|---|
| 472 | ]) |
|---|
| 473 | |
|---|
| 474 | dnl Check for PAM libs |
|---|
| 475 | PAM_MSG="no" |
|---|
| 476 | no_pam="" |
|---|
| 477 | AC_SUBST(LIBPAM) |
|---|
| 478 | saved_LIBS="$LIBS" |
|---|
| 479 | AC_MSG_CHECKING([PAM support]) |
|---|
| 480 | AC_ARG_WITH(pam, |
|---|
| 481 | [ --with-pam Enable PAM support], |
|---|
| 482 | [ |
|---|
| 483 | if test "x$withval" = "xno" ; then |
|---|
| 484 | AC_MSG_RESULT(disabled) |
|---|
| 485 | no_pam=1 |
|---|
| 486 | fi |
|---|
| 487 | ], |
|---|
| 488 | ) |
|---|
| 489 | if test -z "$no_pam" ; then |
|---|
| 490 | if test "x$ac_cv_header_security_pam_appl_h" = "xyes" -o "x$ac_cv_header_pam_pam_appl_h" = "xyes"; then |
|---|
| 491 | AC_MSG_RESULT(yes) |
|---|
| 492 | PAM_MSG="yes" |
|---|
| 493 | AC_CHECK_LIB(pam, pam_set_item, [LIBPAM="$LIBPAM -lpam"], AC_MSG_ERROR([*** libpam missing])) |
|---|
| 494 | LIBS="$LIBS $LIBPAM" |
|---|
| 495 | AC_CHECK_FUNCS(pam_getenvlist) |
|---|
| 496 | AC_CHECK_FUNCS(pam_putenv) |
|---|
| 497 | disable_shadow=yes |
|---|
| 498 | AC_DEFINE(HAVE_PAM, 1, [Have Pluggable Authentication Modules]) |
|---|
| 499 | else |
|---|
| 500 | AC_MSG_RESULT(no) |
|---|
| 501 | fi |
|---|
| 502 | fi |
|---|
| 503 | LIBS="$saved_LIBS" |
|---|
| 504 | AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes") |
|---|
| 505 | |
|---|
| 506 | dnl Check for SIA libs |
|---|
| 507 | AC_SUBST(LIBSIA) |
|---|
| 508 | SIA_MSG="no" |
|---|
| 509 | no_osfsia="" |
|---|
| 510 | AC_MSG_CHECKING([SIA support]) |
|---|
| 511 | AC_ARG_WITH(osfsia, |
|---|
| 512 | [ --with-osfsia Enable Digital Unix SIA], |
|---|
| 513 | [ |
|---|
| 514 | if test "x$withval" = "xno" ; then |
|---|
| 515 | AC_MSG_RESULT(disabled) |
|---|
| 516 | no_osfsia=1 |
|---|
| 517 | fi |
|---|
| 518 | ], |
|---|
| 519 | ) |
|---|
| 520 | if test -z "$no_osfsia" ; then |
|---|
| 521 | if test -f /etc/sia/matrix.conf; then |
|---|
| 522 | AC_MSG_RESULT(yes) |
|---|
| 523 | AC_DEFINE(HAVE_OSF_SIA, 1, [Have Digital Unix SIA]) |
|---|
| 524 | LIBSIA="$LIBSIA -lsecurity -ldb -lm -laud" |
|---|
| 525 | SIA_MSG="yes" |
|---|
| 526 | else |
|---|
| 527 | AC_MSG_RESULT(no) |
|---|
| 528 | fi |
|---|
| 529 | fi |
|---|
| 530 | |
|---|
| 531 | AM_CONDITIONAL(HAVE_SIA, test "x$SIA_MSG" = "xyes") |
|---|
| 532 | |
|---|
| 533 | PCSC_MSG=no |
|---|
| 534 | pcsc_path=/usr |
|---|
| 535 | AC_SUBST(PCSC_CFLAGS) |
|---|
| 536 | AC_SUBST(PCSC_LIBS) |
|---|
| 537 | |
|---|
| 538 | case "$host" in |
|---|
| 539 | *-*-darwin*) |
|---|
| 540 | PCSC_MSG=yes |
|---|
| 541 | PCSC_CFLAGS="" |
|---|
| 542 | PCSC_LIBS="-Wl,-framework,PCSC" |
|---|
| 543 | ;; |
|---|
| 544 | esac |
|---|
| 545 | |
|---|
| 546 | saved_LIBS="$LIBS" |
|---|
| 547 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 548 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 549 | AC_ARG_WITH(pcsclite, |
|---|
| 550 | [ --with-pcsclite=PATH use PC/SC Lite in PATH], |
|---|
| 551 | [pcsc_path=$withval]) |
|---|
| 552 | if test "x$pcsc_path" = "xno"; then |
|---|
| 553 | PCSC_MSG="no" |
|---|
| 554 | fi |
|---|
| 555 | if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then |
|---|
| 556 | PKG_CHECK_MODULES(PCSC, libpcsclite, [ |
|---|
| 557 | PCSC_MSG="yes" |
|---|
| 558 | AC_MSG_RESULT($PCSC_MSG) |
|---|
| 559 | ],[ |
|---|
| 560 | AC_MSG_CHECKING(for PC/SC Lite support (old style)) |
|---|
| 561 | for pcscdir in "" /pcsc /PCSC; do |
|---|
| 562 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 563 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 564 | LIBS="-lpcsclite $saved_LIBS" |
|---|
| 565 | PCSC_CFLAGS="" |
|---|
| 566 | |
|---|
| 567 | for pcsc_libdir in $pcsc_path/lib$pcscdir \ |
|---|
| 568 | $pcsc_path$pcscdir/lib \ |
|---|
| 569 | $pcsc_path$pcscdir; do |
|---|
| 570 | if test -d $pcsc_libdir; then |
|---|
| 571 | if test -n "${need_dash_r}"; then |
|---|
| 572 | LDFLAGS="-R${pcsc_libdir}/ ${LDFLAGS}" |
|---|
| 573 | fi |
|---|
| 574 | LDFLAGS="-L${pcsc_libdir} ${LDFLAGS}" |
|---|
| 575 | fi |
|---|
| 576 | done |
|---|
| 577 | |
|---|
| 578 | for pcsc_incdir in $pcsc_path/include$pcscdir \ |
|---|
| 579 | $pcsc_path$pcscdir/include \ |
|---|
| 580 | $pcsc_path$pcscdir; do |
|---|
| 581 | if test -d $pcsc_incdir; then |
|---|
| 582 | PCSC_CFLAGS="-I${pcsc_incdir}" |
|---|
| 583 | break; |
|---|
| 584 | fi |
|---|
| 585 | done |
|---|
| 586 | |
|---|
| 587 | CPPFLAGS="${PCSC_CFLAGS} ${CPPFLAGS}" |
|---|
| 588 | AC_TRY_LINK([#include <stdlib.h> |
|---|
| 589 | #include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes) |
|---|
| 590 | if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes"; then |
|---|
| 591 | PCSC_MSG=yes |
|---|
| 592 | break; |
|---|
| 593 | fi |
|---|
| 594 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 595 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 596 | LIBS="$saved_LIBS" |
|---|
| 597 | PCSC_CFLAGS="" |
|---|
| 598 | done |
|---|
| 599 | AC_MSG_RESULT($PCSC_MSG) |
|---|
| 600 | if test "x$PCSC_MSG" = "xyes" ; then |
|---|
| 601 | PCSC_LIBS="-lpcsclite" |
|---|
| 602 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 603 | LIBS="$saved_LIBS" |
|---|
| 604 | fi |
|---|
| 605 | ]) |
|---|
| 606 | fi |
|---|
| 607 | AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes") |
|---|
| 608 | if test "x$PCSC_MSG" = "xyes"; then |
|---|
| 609 | AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation]) |
|---|
| 610 | else |
|---|
| 611 | PCSC_LIBS="" |
|---|
| 612 | PCSC_CFLAGS="" |
|---|
| 613 | fi |
|---|
| 614 | |
|---|
| 615 | if test "x$PCSC_MSG" = "xyes"; then |
|---|
| 616 | CFLAGS="$PCSC_CFLAGS $saved_CFLAGS" |
|---|
| 617 | LIBS="$PCSC_LIBS $saved_LIBS" |
|---|
| 618 | AC_TRY_LINK([ |
|---|
| 619 | #include <stdlib.h> |
|---|
| 620 | #include <winscard.h> |
|---|
| 621 | ], [ |
|---|
| 622 | SCardControl(NULL, NULL, 0, NULL, 0); |
|---|
| 623 | ], [ |
|---|
| 624 | AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite]) |
|---|
| 625 | ]) |
|---|
| 626 | CFLAGS="$saved_CFLAGS" |
|---|
| 627 | LIBS="$saved_LIBS" |
|---|
| 628 | fi |
|---|
| 629 | |
|---|
| 630 | OPENCT_MSG=no |
|---|
| 631 | openct_path=/usr |
|---|
| 632 | AC_SUBST(OPENCT_CFLAGS) |
|---|
| 633 | AC_SUBST(OPENCT_LDFLAGS) |
|---|
| 634 | AC_SUBST(OPENCT_LIBS) |
|---|
| 635 | |
|---|
| 636 | saved_LIBS="$LIBS" |
|---|
| 637 | saved_LDFLAGS="$LDFLAGS" |
|---|
| 638 | saved_CFLAGS="$CFLAGS" |
|---|
| 639 | AC_ARG_WITH(openct, |
|---|
| 640 | [ --with-openct=PATH use OpenCT in PATH], |
|---|
| 641 | [openct_path=$withval]) |
|---|
| 642 | if test "x$openct_path" = "xno"; then |
|---|
| 643 | OPENCT_MSG="no" |
|---|
| 644 | fi |
|---|
| 645 | if test "x$openct_path" != "xno" -a "x$OPENCT_MSG" != "xyes"; then |
|---|
| 646 | PKG_CHECK_MODULES(OPENCT, libopenct, [ |
|---|
| 647 | OPENCT_MSG="yes" |
|---|
| 648 | AC_MSG_RESULT($OPENCT_MSG) |
|---|
| 649 | ], [ |
|---|
| 650 | AC_MSG_CHECKING(for OpenCT support (old style)) |
|---|
| 651 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 652 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 653 | LIBS="$saved_LIBS" |
|---|
| 654 | |
|---|
| 655 | OPENCT_CFLAGS="-I${openct_path}/include" |
|---|
| 656 | OPENCT_LIBS="-lopenct" |
|---|
| 657 | OPENCT_LDFLAGS="" |
|---|
| 658 | if test -n "${need_dash_r}"; then |
|---|
| 659 | OPENCT_LDFLAGS="-R${openct_path}/lib" |
|---|
| 660 | fi |
|---|
| 661 | OPENCT_LDFLAGS="-L${openct_path}/lib $OPENCT_LDFLAGS" |
|---|
| 662 | |
|---|
| 663 | LIBS="$OPENCT_LIBS $saved_LIBS" |
|---|
| 664 | LDFLAGS="$OPENCT_LDFLAGS $saved_LDFLAGS" |
|---|
| 665 | CFLAGS="$OPENCT_CFLAGS $saved_CFLAGS" |
|---|
| 666 | |
|---|
| 667 | AC_TRY_LINK([#include <openct/openct.h>],[ct_reader_connect(0);],OPENCT_MSG=yes,OPENCT_MSG=no) |
|---|
| 668 | AC_MSG_RESULT($OPENCT_MSG) |
|---|
| 669 | |
|---|
| 670 | CFLAGS="$saved_CFLAGS" |
|---|
| 671 | LDFLAGS="$saved_LDFLAGS" |
|---|
| 672 | LIBS="$saved_LIBS" |
|---|
| 673 | ]) |
|---|
| 674 | fi |
|---|
| 675 | |
|---|
| 676 | AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes") |
|---|
| 677 | if test "x$OPENCT_MSG" = "xyes"; then |
|---|
| 678 | AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) |
|---|
| 679 | else |
|---|
| 680 | OPENCT_LDFLAGS="" |
|---|
| 681 | OPENCT_LIBS="" |
|---|
| 682 | OPENCT_CFLAGS="" |
|---|
| 683 | fi |
|---|
| 684 | |
|---|
| 685 | # Check for user-specified random device, otherwise check /dev/urandom |
|---|
| 686 | AC_ARG_WITH(random, |
|---|
| 687 | [ --with-random=FILE read entropy from FILE (default=/dev/urandom)], |
|---|
| 688 | [ |
|---|
| 689 | if test "x$withval" != "xno" ; then |
|---|
| 690 | RANDOM_POOL="$withval"; |
|---|
| 691 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool]) |
|---|
| 692 | fi |
|---|
| 693 | ], |
|---|
| 694 | [ |
|---|
| 695 | # Check for random device |
|---|
| 696 | AC_CHECK_FILE("/dev/urandom", |
|---|
| 697 | [ |
|---|
| 698 | RANDOM_POOL="/dev/urandom"; |
|---|
| 699 | AC_SUBST(RANDOM_POOL) |
|---|
| 700 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool]) |
|---|
| 701 | ] |
|---|
| 702 | ) |
|---|
| 703 | ] |
|---|
| 704 | ) |
|---|
| 705 | |
|---|
| 706 | # Check for PRNGD/EGD pool file |
|---|
| 707 | AC_ARG_WITH(prngd-port, |
|---|
| 708 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT], |
|---|
| 709 | [ |
|---|
| 710 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
|---|
| 711 | PRNGD_PORT="$withval" |
|---|
| 712 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT, [Port number of PRNGD/EGD random number socket]) |
|---|
| 713 | fi |
|---|
| 714 | ] |
|---|
| 715 | ) |
|---|
| 716 | |
|---|
| 717 | # Check for PRNGD/EGD pool file |
|---|
| 718 | AC_ARG_WITH(prngd-socket, |
|---|
| 719 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
|---|
| 720 | [ |
|---|
| 721 | if test "x$withval" != "xno" ; then |
|---|
| 722 | PRNGD_SOCKET="$withval" |
|---|
| 723 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket]) |
|---|
| 724 | fi |
|---|
| 725 | ], |
|---|
| 726 | [ |
|---|
| 727 | # Check for existing socket only if we don't have a random device already |
|---|
| 728 | if test -z "$RANDOM_POOL" ; then |
|---|
| 729 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
|---|
| 730 | # Insert other locations here |
|---|
| 731 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy /tmp/entropy; do |
|---|
| 732 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
|---|
| 733 | PRNGD_SOCKET="$sock" |
|---|
| 734 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket]) |
|---|
| 735 | break; |
|---|
| 736 | fi |
|---|
| 737 | done |
|---|
| 738 | if test ! -z "$PRNGD_SOCKET" ; then |
|---|
| 739 | AC_MSG_RESULT($PRNGD_SOCKET) |
|---|
| 740 | else |
|---|
| 741 | AC_MSG_RESULT(not found) |
|---|
| 742 | fi |
|---|
| 743 | fi |
|---|
| 744 | ] |
|---|
| 745 | ) |
|---|
| 746 | |
|---|
| 747 | ### BEGIN LDAP SPECIFIC OPTIONS |
|---|
| 748 | dnl ldap autoconf magic partly taken from pam_ldap |
|---|
| 749 | |
|---|
| 750 | dnl --enable-ldap option. |
|---|
| 751 | AC_ARG_ENABLE(ldap, |
|---|
| 752 | [ --enable-ldap enable use of LDAP for authentication. [default=yes]], |
|---|
| 753 | , enable_ldap=yes) |
|---|
| 754 | AC_ARG_ENABLE(ldap-ssl, [ --disable-ldap-ssl disable SSL/TSL support for ldap]) |
|---|
| 755 | AC_ARG_WITH(ldap-lib, [ --with-ldap-lib=type select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]]) |
|---|
| 756 | AC_ARG_WITH(ldap-dir, [ --with-ldap-dir=DIR base directory of ldap SDK]) |
|---|
| 757 | |
|---|
| 758 | AC_SUBST(LIBLDAP) |
|---|
| 759 | LDAP_MSG="no" |
|---|
| 760 | if (test x$enable_ldap = xyes); then |
|---|
| 761 | if test -n "$with_ldap_dir"; then |
|---|
| 762 | CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include" |
|---|
| 763 | LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib" |
|---|
| 764 | case "$target_os" in |
|---|
| 765 | solaris*) LDFLAGS="$LDFLAGS -Wl,-R$with_ldap_dir/lib" ;; |
|---|
| 766 | *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;; |
|---|
| 767 | esac |
|---|
| 768 | fi |
|---|
| 769 | |
|---|
| 770 | AC_CHECK_HEADERS(lber.h ldap.h ldap_ssl.h) |
|---|
| 771 | |
|---|
| 772 | dnl check which ldap library we have |
|---|
| 773 | if test -z "$with_ldap_lib"; then |
|---|
| 774 | with_ldap_lib=auto |
|---|
| 775 | fi |
|---|
| 776 | |
|---|
| 777 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then |
|---|
| 778 | AC_CHECK_LIB(lber, ber_init, LIBLDAP="-llber $LIBLDAP" found_lber_lib=yes) |
|---|
| 779 | saved_LIBS="$LIBS" |
|---|
| 780 | LIBS="$LIBS $LIBLDAP" |
|---|
| 781 | AC_CHECK_LIB(ldap, ldap_search, LIBLDAP="-lldap $LIBLDAP" found_ldap_lib=yes) |
|---|
| 782 | AC_CHECK_LIB(ldap, ldap_start_tls_s, LIBLDAP="-lssl $LIBLDAP" need_ssl_lib=yes) |
|---|
| 783 | LIBS="$saved_LIBS" |
|---|
| 784 | fi |
|---|
| 785 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then |
|---|
| 786 | AC_CHECK_LIB(ldap50, ldap_search, LIBLDAP="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 787 | fi |
|---|
| 788 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then |
|---|
| 789 | AC_CHECK_LIB(ldapssl41, ldap_search, LIBLDAP="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 790 | if test -z "$found_ldap_lib"; then |
|---|
| 791 | AC_CHECK_LIB(ldapssl40, ldap_search, LIBLDAP="-lldapssl40 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 792 | fi |
|---|
| 793 | fi |
|---|
| 794 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then |
|---|
| 795 | AC_CHECK_LIB(ldapssl30, ldap_search, LIBLDAP="-lldapssl30 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread) |
|---|
| 796 | fi |
|---|
| 797 | |
|---|
| 798 | if test -n "$found_ldap_lib" -a "x$ac_cv_header_ldap_h" = "xyes"; then |
|---|
| 799 | AC_DEFINE(LDAP_REFERRALS,1,[This is needed for the native Solaris LDAP SDK]) |
|---|
| 800 | AC_DEFINE(HAVE_LDAP, 1, [Use LDAP for authentication etc.]) |
|---|
| 801 | LDAP_MSG="yes" |
|---|
| 802 | |
|---|
| 803 | saved_LIBS="$LIBS" |
|---|
| 804 | LIBS="$LIBS $LIBLDAP" |
|---|
| 805 | AC_CHECK_FUNCS(ldap_init) |
|---|
| 806 | if test "$enable_ldap_ssl" \!= "no"; then |
|---|
| 807 | AC_CHECK_FUNCS(ldapssl_init ldap_start_tls_s ldap_pvt_tls_set_option) |
|---|
| 808 | fi |
|---|
| 809 | LIBS="$saved_LIBS" |
|---|
| 810 | fi |
|---|
| 811 | fi |
|---|
| 812 | AM_CONDITIONAL(HAVE_LDAP, test "x$LDAP_MSG" = "xyes") |
|---|
| 813 | ### END LDAP SPECIFIC OPTIONS |
|---|
| 814 | |
|---|
| 815 | ### BEGIN ASSUAN SPECIFIC OPTIONS |
|---|
| 816 | ASSUAN_MSG="no" |
|---|
| 817 | AC_SUBST(CFLAGS_ASSUAN) |
|---|
| 818 | AC_SUBST(LIBASSUAN) |
|---|
| 819 | LIBASSUAN="-lassuan" |
|---|
| 820 | AC_ARG_WITH(assuan, |
|---|
| 821 | [ --with-assuan=PATH use Assuan libraries in PATH], |
|---|
| 822 | [ |
|---|
| 823 | if test -n "${need_dash_r}"; then |
|---|
| 824 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
|---|
| 825 | else |
|---|
| 826 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
|---|
| 827 | fi |
|---|
| 828 | CFLAGS_ASSUAN="-I${withval}/include ${CFLAGS_ASSUAN}" |
|---|
| 829 | ] |
|---|
| 830 | ) |
|---|
| 831 | |
|---|
| 832 | AC_CHECK_LIB(assuan, assuan_pipe_connect, ASSUAN_MSG="yes", ASSUAN_MSG="no") |
|---|
| 833 | if test "x$ASSUAN_MSG" != "xno" ; then |
|---|
| 834 | saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 835 | CPPFLAGS="$CFLAGS_ASSUAN $CPPFLAGS" |
|---|
| 836 | AC_CHECK_HEADER(assuan.h, ASSUAN_MSG="yes", ASSUAN_MSG="no") |
|---|
| 837 | CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 838 | fi |
|---|
| 839 | AM_CONDITIONAL(HAVE_ASSUAN, test "x$ASSUAN_MSG" = "xyes") |
|---|
| 840 | ### END ASSUAN SPECIFIC OPTIONS |
|---|
| 841 | |
|---|
| 842 | PLUGINDIR="/usr/lib/mozilla/plugins" |
|---|
| 843 | AC_ARG_WITH(plugin-dir, |
|---|
| 844 | [ --with-plugin-dir=PATH install Mozilla plugin to PATH [[/usr/lib/mozilla/plugins]]], |
|---|
| 845 | [ |
|---|
| 846 | PLUGINDIR="$withval" |
|---|
| 847 | ] |
|---|
| 848 | ) |
|---|
| 849 | AC_SUBST(PLUGINDIR) |
|---|
| 850 | |
|---|
| 851 | BUNDLEDIR="${libdir}" |
|---|
| 852 | AC_ARG_WITH(bundle-dir, |
|---|
| 853 | [ --with-bundle-dir=PATH install MacOS X bundles to PATH [[EPREFIX/lib]]], |
|---|
| 854 | [ |
|---|
| 855 | BUNDLEDIR="$withval" |
|---|
| 856 | ] |
|---|
| 857 | ) |
|---|
| 858 | AC_SUBST(BUNDLEDIR) |
|---|
| 859 | |
|---|
| 860 | # Check for PIN entry program used by OpenSC Signer |
|---|
| 861 | PIN_ENTRY="/usr/local/bin/gpinentry" |
|---|
| 862 | AC_ARG_WITH(pin-entry, |
|---|
| 863 | [ --with-pin-entry=PROG Run PROG as PIN-entry for OpenSC Signer], |
|---|
| 864 | [ |
|---|
| 865 | if test ! -z "$withval" -a "x$withval" != "xno" ; then |
|---|
| 866 | PIN_ENTRY="$withval" |
|---|
| 867 | fi |
|---|
| 868 | ] |
|---|
| 869 | ) |
|---|
| 870 | AC_DEFINE_UNQUOTED(PIN_ENTRY, "$PIN_ENTRY", [PIN-entry program for OpenSC Signer]) |
|---|
| 871 | |
|---|
| 872 | dnl Check for SGML processor |
|---|
| 873 | AC_ARG_WITH(docbook, |
|---|
| 874 | [ --without-docbook do no generate html manual (needs docbook)], |
|---|
| 875 | with_docbook=$withval) |
|---|
| 876 | AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc) |
|---|
| 877 | if test "x$XSLTPROC" = "x"; then |
|---|
| 878 | if test "x$with_docbook" = "xyes"; then |
|---|
| 879 | AC_MSG_ERROR([Docbook support requested, but cannot find xsltproc]) |
|---|
| 880 | fi |
|---|
| 881 | with_docbook=no |
|---|
| 882 | fi |
|---|
| 883 | AM_CONDITIONAL(HAVE_DOCBOOK, test "x$with_docbook" = "xyes") |
|---|
| 884 | |
|---|
| 885 | if test "x$prefix" = xNONE; then |
|---|
| 886 | prefix=$ac_default_prefix |
|---|
| 887 | fi |
|---|
| 888 | if test "x$exec_prefix" = xNONE; then |
|---|
| 889 | exec_prefix='${prefix}' |
|---|
| 890 | fi |
|---|
| 891 | |
|---|
| 892 | dnl Enable/disable debugging messages. |
|---|
| 893 | AC_ARG_ENABLE(debug, |
|---|
| 894 | [ --enable-debug enable debug messages. [default=no]], |
|---|
| 895 | , enable_debug=no) |
|---|
| 896 | if (test x$enable_debug = xyes); then |
|---|
| 897 | AC_DEFINE(DEBUG, 1, [Enable debug messages.]) |
|---|
| 898 | fi |
|---|
| 899 | |
|---|
| 900 | CPPFLAGS="-I\${top_builddir}/src/include $CPPFLAGS" |
|---|
| 901 | AM_CONDITIONAL(HAVE_BUNDLES, test "x$with_bundles" = "xyes") |
|---|
| 902 | |
|---|
| 903 | scldap_etc_path=`eval echo ${sysconfdir}` ; scldap_etc_path=`eval echo ${scldap_etc_path}` |
|---|
| 904 | AC_DEFINE_UNQUOTED(SCLDAP_ETC_PATH, "$scldap_etc_path", [etc path for libscldap]) |
|---|
| 905 | scldap_conf_path=`eval echo ${scldap_etc_path}/scldap.conf` |
|---|
| 906 | AC_DEFINE_UNQUOTED(SCLDAP_CONF_PATH, "$scldap_conf_path", [default config file for libscldap]) |
|---|
| 907 | |
|---|
| 908 | opensc_etc_path=`eval echo ${sysconfdir}` ; opensc_etc_path=`eval echo ${opensc_etc_path}` |
|---|
| 909 | AC_DEFINE_UNQUOTED(OPENSC_ETC_PATH, "$opensc_etc_path", [etc path for libopensc]) |
|---|
| 910 | opensc_conf_path=`eval echo ${opensc_etc_path}/opensc.conf` |
|---|
| 911 | AC_DEFINE_UNQUOTED(OPENSC_CONF_PATH, "$opensc_conf_path", [default config file for libopensc]) |
|---|
| 912 | |
|---|
| 913 | AC_SUBST(LIBSCCONF) |
|---|
| 914 | LIBSCCONF="\${top_builddir}/src/scconf/libscconf.la" |
|---|
| 915 | AC_SUBST(LIBSCLDAP) |
|---|
| 916 | if test "x$LDAP_MSG" = "xyes" ; then |
|---|
| 917 | LIBSCLDAP="\${top_builddir}/src/scldap/libscldap.la" |
|---|
| 918 | fi |
|---|
| 919 | AC_SUBST(LIBOPENSC) |
|---|
| 920 | LIBOPENSC="\${top_builddir}/src/libopensc/libopensc.la" |
|---|
| 921 | |
|---|
| 922 | # Pass information about installed OpenSC requirements, so that |
|---|
| 923 | # a proper opensc-config file will be build. |
|---|
| 924 | OPENSC_LIBS="-L${libdir} -lopensc" |
|---|
| 925 | OPENSC_CFLAGS="" |
|---|
| 926 | AC_SUBST(OPENSC_LIBS) |
|---|
| 927 | AC_SUBST(OPENSC_CFLAGS) |
|---|
| 928 | |
|---|
| 929 | pkgdata=`eval echo ${datadir}/${PACKAGE}` ; pkgdata=`eval echo ${pkgdata}` |
|---|
| 930 | AC_SUBST(pkgdata) |
|---|
| 931 | |
|---|
| 932 | AC_OUTPUT([ |
|---|
| 933 | Makefile |
|---|
| 934 | aclocal/Makefile |
|---|
| 935 | docs/Makefile |
|---|
| 936 | docs/pkcs15-profile.5 |
|---|
| 937 | etc/Makefile |
|---|
| 938 | macos/Makefile |
|---|
| 939 | src/Makefile |
|---|
| 940 | src/common/Makefile |
|---|
| 941 | src/include/Makefile |
|---|
| 942 | src/include/opensc/Makefile |
|---|
| 943 | src/include/opensc/rsaref/Makefile |
|---|
| 944 | src/libopensc/Makefile |
|---|
| 945 | src/libopensc/opensc-config |
|---|
| 946 | src/libopensc/libopensc.pc |
|---|
| 947 | src/openscd/Makefile |
|---|
| 948 | src/openssh/Makefile |
|---|
| 949 | src/pam/Makefile |
|---|
| 950 | src/pkcs11/Makefile |
|---|
| 951 | src/pkcs11/rsaref/Makefile |
|---|
| 952 | src/pkcs15init/Makefile |
|---|
| 953 | src/scam/Makefile |
|---|
| 954 | src/scconf/Makefile |
|---|
| 955 | src/scdl/Makefile |
|---|
| 956 | src/scldap/Makefile |
|---|
| 957 | src/scrandom/Makefile |
|---|
| 958 | src/sia/Makefile |
|---|
| 959 | src/signer/Makefile |
|---|
| 960 | src/signer/npinclude/Makefile |
|---|
| 961 | src/sslengines/Makefile |
|---|
| 962 | src/tests/Makefile |
|---|
| 963 | src/tests/regression/Makefile |
|---|
| 964 | src/tools/Makefile |
|---|
| 965 | win32/Makefile |
|---|
| 966 | ]) |
|---|
| 967 | |
|---|
| 968 | if test ! -z "$RANDOM_POOL" ; then |
|---|
| 969 | RAND_MSG="device ($RANDOM_POOL)" |
|---|
| 970 | else |
|---|
| 971 | if test ! -z "$PRNGD_PORT" ; then |
|---|
| 972 | RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)" |
|---|
| 973 | elif test ! -z "$PRNGD_SOCKET" ; then |
|---|
| 974 | RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)" |
|---|
| 975 | else |
|---|
| 976 | RAND_MSG="Builtin kluge" |
|---|
| 977 | BUILTIN_RNG=1 |
|---|
| 978 | fi |
|---|
| 979 | fi |
|---|
| 980 | |
|---|
| 981 | dnl Someone please show me a better way :) |
|---|
| 982 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
|---|
| 983 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
|---|
| 984 | C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}` |
|---|
| 985 | |
|---|
| 986 | echo "" |
|---|
| 987 | echo "OpenSC has been configured with the following options" |
|---|
| 988 | |
|---|
| 989 | echo "" |
|---|
| 990 | echo "User binaries: ${B}" |
|---|
| 991 | echo "Configuration files: ${C}" |
|---|
| 992 | |
|---|
| 993 | echo "" |
|---|
| 994 | echo "Host: ${host}" |
|---|
| 995 | echo "Compiler: ${CC}" |
|---|
| 996 | echo "Compiler flags: ${CFLAGS}" |
|---|
| 997 | echo "Preprocessor flags: ${CPPFLAGS}" |
|---|
| 998 | echo "Linker flags: ${LDFLAGS}" |
|---|
| 999 | echo "Libraries: ${LIBS}" |
|---|
| 1000 | |
|---|
| 1001 | echo "" |
|---|
| 1002 | echo "Random number collection: ${RAND_MSG}" |
|---|
| 1003 | echo "OpenSSL support: ${SSL_MSG}" |
|---|
| 1004 | echo " with engine: ${ENGINE_MSG}" |
|---|
| 1005 | echo "PC/SC support: ${PCSC_MSG}" |
|---|
| 1006 | echo "OpenCT support: ${OPENCT_MSG}" |
|---|
| 1007 | echo "Assuan support: ${ASSUAN_MSG}" |
|---|
| 1008 | echo "LDAP support: ${LDAP_MSG}" |
|---|
| 1009 | echo "PAM support: ${PAM_MSG}" |
|---|
| 1010 | case "$host" in |
|---|
| 1011 | *-*-osf*) |
|---|
| 1012 | echo "SIA support: ${SIA_MSG}" |
|---|
| 1013 | ;; |
|---|
| 1014 | esac |
|---|
| 1015 | echo "" |
|---|
| 1016 | |
|---|
| 1017 | if test "x$ENGINE_MSG" = "xno" -a "x$SSL_MSG" = "xyes"; then |
|---|
| 1018 | echo "OpenSSL was found. But to use the engine you will need" |
|---|
| 1019 | echo "version 0.9.7a or later." |
|---|
| 1020 | fi |
|---|
| 1021 | |
|---|
| 1022 | if test ! -z "$BUILTIN_RNG"; then |
|---|
| 1023 | echo "WARNING: you are using the builtin random number service." |
|---|
| 1024 | echo "The random number service is very simple and is only" |
|---|
| 1025 | echo "intended for testing purposes. Please request your OS" |
|---|
| 1026 | echo "vendor to include /dev/random in future versions of" |
|---|
| 1027 | echo "their OS. Or use PRNGD/EGD instead, your choice." |
|---|
| 1028 | fi |
|---|