~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
AC_PREREQ(2.52)
2
 
AC_COPYRIGHT([Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 
2
AC_COPYRIGHT([Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
3
3
Massachusetts Institute of Technology.
4
4
])
5
5
dnl
74
74
if test -z "$LD" ; then LD=$CC; fi
75
75
AC_ARG_VAR(LD,[linker command [CC]])
76
76
AC_SUBST(LDFLAGS) dnl
77
 
WITH_KRB4 dnl
78
77
KRB5_AC_CHOOSE_ET dnl
79
78
KRB5_AC_CHOOSE_SS dnl
80
79
KRB5_AC_CHOOSE_DB dnl
81
 
dnl allow stuff in tree to access deprecated/private stuff for now
82
 
dnl AC_DEFINE([KRB5_PRIVATE], 1, [Define only if building in-tree])
 
80
dnl allow stuff in tree to access deprecated stuff for now
83
81
dnl AC_DEFINE([KRB5_DEPRECATED], 1, [Define only if building in-tree])
84
82
AC_C_CONST dnl
85
83
WITH_NETLIB dnl
92
90
dnl
93
91
CONFIG_RELTOPDIR=$ac_reltopdir
94
92
AC_SUBST(CONFIG_RELTOPDIR)
95
 
AC_SUBST(subdirs)
96
93
lib_frag=$srcdir/$ac_config_fragdir/lib.in
97
94
AC_SUBST_FILE(lib_frag)
98
95
libobj_frag=$srcdir/$ac_config_fragdir/libobj.in
99
96
AC_SUBST_FILE(libobj_frag)
100
97
libnover_frag=$srcdir/$ac_config_fragdir/libnover.in
101
98
AC_SUBST_FILE(libnover_frag)
 
99
libpriv_frag=$srcdir/$ac_config_fragdir/libpriv.in
 
100
AC_SUBST_FILE(libpriv_frag)
 
101
libnodeps_frag=$srcdir/$ac_config_fragdir/libnodeps.in
 
102
AC_SUBST_FILE(libnodeps_frag)
102
103
dnl
103
104
KRB5_AC_PRAGMA_WEAK_REF
104
105
WITH_LDAP
204
205
      # don't exclude CFLAGS when linking.  *sigh*
205
206
      PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L"
206
207
      ;;
 
208
    solaris2.[1-9])
 
209
      # On Solaris 10 with gcc 3.4.3, the autoconf archive macro doesn't
 
210
      # get the right result.   XXX What about Solaris 9 and earlier?
 
211
      if test "$GCC" = yes ; then
 
212
        PTHREAD_CFLAGS="-D_REENTRANT -pthreads"
 
213
      fi
 
214
      ;;
207
215
    solaris*)
208
216
      # On Solaris 10 with gcc 3.4.3, the autoconf archive macro doesn't
209
217
      # get the right result.
210
218
      if test "$GCC" = yes ; then
211
219
        PTHREAD_CFLAGS="-D_REENTRANT -pthreads"
212
220
      fi
 
221
      # On Solaris 10, the thread support is always available in libc.
 
222
      AC_DEFINE(NO_WEAK_PTHREADS,1,[Define if references to pthread routines should be non-weak.])
213
223
      ;;
214
224
  esac
215
225
  THREAD_SUPPORT=1
399
409
dnl
400
410
AC_REQUIRE([KRB5_SOCKADDR_SA_LEN])dnl
401
411
AC_ARG_ENABLE([ipv6], , AC_MSG_WARN(enable/disable-ipv6 option is deprecated))dnl
402
 
KRB5_AC_CHECK_INET6
403
 
])dnl
404
 
dnl
405
 
AC_DEFUN(KRB5_AC_CHECK_TYPE_WITH_HEADERS,[
406
 
AC_MSG_CHECKING(for type $1)
407
 
changequote(<<,>>)dnl
408
 
varname=`echo $1 | sed 's,[ -],_,g'`
409
 
changequote([,])dnl
410
 
AC_CACHE_VAL(krb5_cv_$varname,[
411
 
AC_TRY_COMPILE([$2],[ $1 foo; ], eval krb5_cv_$varname=yes, eval krb5_cv_$varname=no)])
412
 
eval x="\$krb5_cv_$varname"
413
 
AC_MSG_RESULT($x)
414
 
if eval test "$x" = yes ; then
415
 
  AC_DEFINE_UNQUOTED(HAVE_`echo $varname | tr '[[[a-z]]]' '[[[A-Z]]]'`)
416
 
fi])
417
 
dnl
418
 
dnl
419
 
AC_DEFUN(KRB5_AC_CHECK_SOCKADDR_STORAGE,[
420
 
KRB5_AC_CHECK_TYPE_WITH_HEADERS(struct sockaddr_storage, [
421
 
#ifdef HAVE_SYS_TYPES_H
422
 
#include <sys/types.h>
423
 
#endif
424
 
#include <sys/socket.h>
425
 
#include <netinet/in.h>
426
 
])])dnl
427
 
dnl
428
 
dnl
429
 
AC_DEFUN(KRB5_AC_CHECK_INET6,[
430
 
AC_REQUIRE([KRB5_AC_CHECK_SOCKADDR_STORAGE])dnl
431
412
AC_MSG_CHECKING(for IPv6 compile-time support)
432
413
AC_CACHE_VAL(krb5_cv_inet6,[
433
414
if test "$ac_cv_func_inet_ntop" != "yes" ; then
519
500
  AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
520
501
done
521
502
])
522
 
dnl
523
 
dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
524
 
dnl
525
 
AC_DEFUN(WITH_KRB4,[
526
 
AC_ARG_WITH([krb4],
527
 
[  --without-krb4          don't include Kerberos V4 backwards compatibility
528
 
  --with-krb4             use V4 libraries included with V5 (default)
529
 
  --with-krb4=KRB4DIR     use preinstalled V4 libraries],
530
 
,
531
 
withval=yes
532
 
)dnl
533
 
if test $withval = no; then
534
 
        AC_MSG_NOTICE(no krb4 support)
535
 
        KRB4_LIB=
536
 
        KRB4_DEPLIB=
537
 
        KRB4_INCLUDES=
538
 
        KRB4_LIBPATH=
539
 
        KRB_ERR_H_DEP=
540
 
        krb5_cv_build_krb4_libs=no
541
 
        krb5_cv_krb4_libdir=
542
 
else
543
 
 AC_DEFINE([KRB5_KRB4_COMPAT], 1, [Define this if building with krb4 compat])
544
 
 if test $withval = yes; then
545
 
        AC_MSG_NOTICE(enabling built in krb4 support)
546
 
        KRB4_DEPLIB='$(TOPLIBD)/libkrb4$(DEPLIBEXT)'
547
 
        KRB4_LIB=-lkrb4
548
 
        KRB4_INCLUDES='-I$(SRCTOP)/include/kerberosIV -I$(BUILDTOP)/include/kerberosIV'
549
 
        KRB4_LIBPATH=
550
 
        KRB_ERR_H_DEP='$(BUILDTOP)/include/kerberosIV/krb_err.h'
551
 
        krb5_cv_build_krb4_libs=yes
552
 
        krb5_cv_krb4_libdir=
553
 
 else
554
 
        AC_MSG_NOTICE(using preinstalled krb4 in $withval)
555
 
        KRB4_LIB="-lkrb"
556
 
dnl     DEPKRB4_LIB="$withval/lib/libkrb.a"
557
 
        KRB4_INCLUDES="-I$withval/include"
558
 
        KRB4_LIBPATH="-L$withval/lib"
559
 
        KRB_ERR_H_DEP=
560
 
        krb5_cv_build_krb4_libs=no
561
 
        krb5_cv_krb4_libdir="$withval/lib"
562
 
 fi
563
 
fi
564
 
AC_SUBST(KRB4_INCLUDES)
565
 
AC_SUBST(KRB4_LIBPATH)
566
 
AC_SUBST(KRB4_LIB)
567
 
AC_SUBST(KRB4_DEPLIB)
568
 
AC_SUBST(KRB_ERR_H_DEP)
569
 
dnl We always compile the des425 library
570
 
DES425_DEPLIB='$(TOPLIBD)/libdes425$(DEPLIBEXT)'
571
 
DES425_LIB=-ldes425
572
 
AC_SUBST(DES425_DEPLIB)
573
 
AC_SUBST(DES425_LIB)
574
 
])dnl
575
 
dnl
576
 
dnl
577
503
AC_DEFUN(KRB5_AC_CHECK_FOR_CFLAGS,[
578
504
AC_BEFORE([$0],[AC_PROG_CC])
 
505
AC_BEFORE([$0],[AC_PROG_CXX])
579
506
krb5_ac_cflags_set=${CFLAGS+set}
 
507
krb5_ac_cxxflags_set=${CXXFLAGS+set}
 
508
krb5_ac_warn_cflags_set=${WARN_CFLAGS+set}
 
509
krb5_ac_warn_cxxflags_set=${WARN_CXXFLAGS+set}
580
510
])
581
511
dnl
 
512
AC_DEFUN(TRY_WARN_CC_FLAG,[dnl
 
513
  cachevar=`echo "krb5_cv_cc_flag_$1" | sed s/[[^a-zA-Z0-9_]]/_/g`
 
514
  AC_CACHE_CHECK([if C compiler supports $1], [$cachevar],
 
515
  [# first try without, then with
 
516
  AC_TRY_COMPILE([], 1;,
 
517
    [old_cflags="$CFLAGS"
 
518
     CFLAGS="$CFLAGS $1"
 
519
     AC_TRY_COMPILE([], 1;, eval $cachevar=yes, eval $cachevar=no)
 
520
     CFLAGS="$old_cflags"],
 
521
    [AC_MSG_ERROR(compiling simple test program with $CFLAGS failed)])])
 
522
  if eval test '"${'$cachevar'}"' = yes; then
 
523
    WARN_CFLAGS="$WARN_CFLAGS $1"
 
524
  fi
 
525
  eval flag_supported='${'$cachevar'}'
 
526
])dnl
 
527
dnl
582
528
AC_DEFUN(WITH_CC,[dnl
583
529
AC_REQUIRE([KRB5_AC_CHECK_FOR_CFLAGS])dnl
584
530
AC_REQUIRE([AC_PROG_CC])dnl
585
 
krb5_cv_prog_gcc=$ac_cv_c_compiler_gnu
 
531
AC_REQUIRE([AC_PROG_CXX])dnl
586
532
if test $ac_cv_c_compiler_gnu = yes ; then
587
533
     HAVE_GCC=yes
588
534
     else HAVE_GCC=
596
542
    krb5_cv_prog_gnu_ld=yes
597
543
  fi
598
544
fi])
599
 
# maybe add -Waggregate-return, or can we assume that actually works by now?
600
 
# -Wno-comment used to be used for SunOS system header <sys/stream.h>
 
545
AC_ARG_WITH([size-optimizations],
 
546
[  --with-size-optimizations enable a few optimizations to reduce code size
 
547
                          possibly at some run-time cost],
 
548
,
 
549
withval=no)
 
550
if test "$withval" = yes; then
 
551
  AC_DEFINE(CONFIG_SMALL,1,[Define to reduce code size even if it means more cpu usage])
 
552
fi
601
553
# -Wno-long-long, if needed, for k5-platform.h without inttypes.h etc.
602
 
extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wcast-qual \
603
 
 -Wcast-align -Wconversion -Wshadow"
 
554
extra_gcc_warn_opts="-Wall -Wcast-qual -Wcast-align -Wshadow"
 
555
# -Wmissing-prototypes
604
556
if test "$GCC" = yes ; then
605
 
  if test "x$krb5_ac_cflags_set" = xset ; then
606
 
    AC_MSG_NOTICE(not adding extra gcc warning flags because CFLAGS was set)
 
557
  # Putting this here means we get -Os after -O2, which works.
 
558
  if test "$with_size_optimizations" = yes && test "x$krb5_ac_cflags_set" != xset; then
 
559
    AC_MSG_NOTICE(adding -Os optimization option)
 
560
    case "$CFLAGS" in
 
561
      "-g -O2") CFLAGS="-g -Os" ;;
 
562
      "-O2")    CFLAGS="-Os" ;;
 
563
      *)        CFLAGS="$CFLAGS -Os" ;;
 
564
    esac
 
565
  fi
 
566
  if test "x$krb5_ac_warn_cflags_set" = xset ; then
 
567
    AC_MSG_NOTICE(not adding extra gcc warning flags because WARN_CFLAGS was set)
607
568
  else
608
569
    AC_MSG_NOTICE(adding extra warning flags for gcc)
609
 
    CFLAGS="$CFLAGS $extra_gcc_warn_opts"
 
570
    WARN_CFLAGS="$WARN_CFLAGS $extra_gcc_warn_opts -Wmissing-prototypes"
610
571
    if test "`uname -s`" = Darwin ; then
611
572
      AC_MSG_NOTICE(skipping pedantic warnings on Darwin)
612
573
    elif test "`uname -s`" = Linux ; then
613
574
      AC_MSG_NOTICE(skipping pedantic warnings on Linux)
614
575
    else
615
 
      CFLAGS="$CFLAGS -pedantic"
616
 
    fi
 
576
      WARN_CFLAGS="$WARN_CFLAGS -pedantic"
 
577
    fi
 
578
    if test "$ac_cv_cxx_compiler_gnu" = yes; then
 
579
      if test "x$krb5_ac_warn_cxxflags_set" = xset ; then
 
580
        AC_MSG_NOTICE(not adding extra g++ warnings because WARN_CXXFLAGS was set)
 
581
      else
 
582
        AC_MSG_NOTICE(adding extra warning flags for g++)
 
583
        WARN_CXXFLAGS="$WARN_CXXFLAGS $extra_gcc_warn_opts"
 
584
      fi
 
585
    fi
 
586
    # Currently, G++ does not support -Wno-format-zero-length.
 
587
    TRY_WARN_CC_FLAG(-Wno-format-zero-length)
 
588
    # Other flags here may not be supported on some versions of
 
589
    # gcc that people want to use.
 
590
    for flag in overflow strict-overflow missing-format-attribute missing-prototypes return-type missing-braces parentheses switch unused-function unused-label unused-variable unused-value unknown-pragmas sign-compare newline-eof ; do
 
591
      TRY_WARN_CC_FLAG(-W$flag)
 
592
    done
 
593
    #  old-style-definition? generates many, many warnings
 
594
    #
 
595
    # Warnings that we'd like to turn into errors on versions of gcc
 
596
    # that support promoting only specific warnings to errors, but
 
597
    # we'll take as warnings on older compilers.  (If such a warning
 
598
    # is added after the -Werror=foo feature, you can just put
 
599
    # error=foo in the above list, and skip the test for the
 
600
    # warning-only form.)  At least in some versions, -Werror= doesn't
 
601
    # seem to make the conditions actual errors, but still issues
 
602
    # warnings; I guess we'll take what we can get.
 
603
    #
 
604
    # We're currently targeting C89+, not C99, so disallow some
 
605
    # constructs.
 
606
    for flag in declaration-after-statement variadic-macros ; do
 
607
      TRY_WARN_CC_FLAG(-Werror=$flag)
 
608
      if test "$flag_supported" = no; then
 
609
        TRY_WARN_CC_FLAG(-W$flag)
 
610
      fi
 
611
    done
 
612
    #  missing-prototypes? maybe someday
 
613
    #
617
614
  fi
618
615
  if test "`uname -s`" = Darwin ; then
619
616
    # Someday this should be a feature test.
660
657
        ;;
661
658
    esac
662
659
  fi
 
660
  if test "`uname -s`" = SunOS ; then
 
661
    # Using Solaris but not GCC, assume Sunsoft compiler.
 
662
    # We have some error-out-on-warning options available.
 
663
    # Sunsoft 12 compiler defaults to -xc99=all, it appears, so "inline"
 
664
    # works, but it also means that declaration-in-code warnings won't
 
665
    # be issued.
 
666
    # -v -fd -errwarn=E_DECLARATION_IN_CODE ...
 
667
    WARN_CFLAGS="-errtags=yes -errwarn=E_BAD_PTR_INT_COMBINATION -errwarn=E_BAD_PTR_INT_COMB_ARG -errwarn=E_PTR_TO_VOID_IN_ARITHMETIC"
 
668
    WARN_CXXFLAGS="-errtags=yes +w +w2 -xport64"
 
669
  fi
663
670
fi
 
671
AC_SUBST(WARN_CFLAGS)
 
672
AC_SUBST(WARN_CXXFLAGS)
664
673
])dnl
665
674
dnl
666
675
dnl
697
706
dnl        The ac_foreach generates the list of fragments to include
698
707
dnl        or "" if $2 is empty
699
708
AC_DEFUN(_K5_GEN_MAKEFILE,[dnl
700
 
AC_CONFIG_FILES([$1/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:$1/Makefile.in:$srcdir/]K5_TOPDIR[/config/post.in])
 
709
AC_CONFIG_FILES([$1/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:$1/Makefile.in:$1/deps:$srcdir/]K5_TOPDIR[/config/post.in])
701
710
])
702
711
dnl
703
712
dnl K5_GEN_FILE( <ac_output arguments> )
717
726
define(_V5_AC_OUTPUT_MAKEFILE,
718
727
[ifelse($2, , ,AC_CONFIG_FILES($2))
719
728
AC_FOREACH([DIR], [$1],dnl
720
 
 [AC_CONFIG_FILES(DIR[/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:]DIR[/Makefile.in:$srcdir/]K5_TOPDIR[/config/post.in])])
 
729
 [AC_CONFIG_FILES(DIR[/Makefile:$srcdir/]K5_TOPDIR[/config/pre.in:]DIR[/Makefile.in:]DIR[/deps:$srcdir/]K5_TOPDIR[/config/post.in])])
721
730
K5_AC_OUTPUT])dnl
722
731
dnl
723
732
dnl
1119
1128
dnl Pull in the necessary stuff to create the libraries.
1120
1129
 
1121
1130
AC_DEFUN(KRB5_BUILD_LIBRARY,
1122
 
[KRB5_BUILD_LIBRARY_WITH_DEPS
1123
 
# null out SHLIB_EXPFLAGS because we lack any dependencies
1124
 
SHLIB_EXPFLAGS=])
1125
 
 
1126
 
dnl
1127
 
dnl KRB5_BUILD_LIBRARY_STATIC
1128
 
dnl
1129
 
dnl Force static library build.
1130
 
 
1131
 
AC_DEFUN(KRB5_AC_FORCE_STATIC,[dnl
1132
 
AC_BEFORE([$0],[KRB5_LIB_AUX])dnl
1133
 
krb5_force_static=yes])
1134
 
AC_DEFUN(KRB5_BUILD_LIBRARY_STATIC,
1135
 
dnl Use define rather than AC_DEFUN to avoid ordering problems.
1136
 
[AC_REQUIRE([KRB5_AC_FORCE_STATIC])dnl
1137
 
KRB5_BUILD_LIBRARY
1138
 
# If we're only building static libraries, they're for build-time use only,
1139
 
# so don't install.
1140
 
LIBINSTLIST=])
1141
 
 
1142
 
dnl
1143
 
dnl KRB5_BUILD_LIBRARY_WITH_DEPS
1144
 
dnl
1145
 
dnl Like KRB5_BUILD_LIBRARY, but adds in explicit dependencies in the
1146
 
dnl generated shared library.
1147
 
 
1148
 
AC_DEFUN(KRB5_BUILD_LIBRARY_WITH_DEPS,
1149
1131
[AC_REQUIRE([KRB5_LIB_AUX])dnl
1150
1132
AC_REQUIRE([AC_PROG_LN_S])dnl
1151
1133
AC_REQUIRE([AC_PROG_RANLIB])dnl
1160
1142
AC_SUBST(LIBLIST)
1161
1143
AC_SUBST(LIBLINKS)
1162
1144
AC_SUBST(MAKE_SHLIB_COMMAND)
 
1145
AC_SUBST(SHLIB_RPATH_FLAGS)
1163
1146
AC_SUBST(SHLIB_EXPFLAGS)
1164
1147
AC_SUBST(SHLIB_EXPORT_FILE_DEP)
1165
1148
AC_SUBST(DYNOBJ_EXPDEPS)
1199
1182
[AC_REQUIRE([KRB5_LIB_AUX])dnl
1200
1183
AC_REQUIRE([KRB5_AC_NEED_LIBGEN])dnl
1201
1184
AC_SUBST(CC_LINK)
 
1185
AC_SUBST(CXX_LINK)
1202
1186
AC_SUBST(RPATH_FLAG)
 
1187
AC_SUBST(PROG_RPATH_FLAGS)
1203
1188
AC_SUBST(DEPLIBEXT)])
1204
1189
 
1205
1190
dnl
1220
1205
AC_DEFUN(KRB5_LIB_AUX,
1221
1206
[AC_REQUIRE([KRB5_LIB_PARAMS])dnl
1222
1207
 
1223
 
# Check whether to build static libraries.
1224
 
dnl AC_HELP_STRING([--enable-static],[build static libraries @<:@disabled for most platforms@:>@])
1225
 
dnl AC_HELP_STRING([--disable-static],[don't build static libraries])
1226
 
AC_ARG_ENABLE([static],, ,
1227
 
[enable_static=$default_static])
1228
 
 
1229
 
if test "$enable_static" = yes; then
 
1208
AC_ARG_ENABLE([static],,
 
1209
[if test "$enableval" != no; then
1230
1210
  AC_MSG_ERROR([Sorry, static libraries do not work in this release.])
1231
 
fi
1232
 
 
1233
 
if test "$enable_static" = no && test "$krb5_force_static" != yes; then
1234
 
        AC_MSG_NOTICE([disabling static libraries])
1235
 
        LIBLINKS=
1236
 
        LIBLIST=
1237
 
        OBJLISTS=
1238
 
else
 
1211
fi])
 
1212
AC_ARG_ENABLE([shared], , 
 
1213
[if test "$enableval" != yes; then
 
1214
  AC_MSG_ERROR([Sorry, this release builds only shared libraries, cannot disable them.])
 
1215
fi])
 
1216
AC_ARG_ENABLE([rpath],
 
1217
AC_HELP_STRING([--disable-rpath],[suppress run path flags in link lines]),
 
1218
[enable_rpath=$enableval],
 
1219
[enable_rpath=yes])
 
1220
 
 
1221
if test "x$enable_rpath" != xyes ; then
 
1222
        # Unset the rpath flag values set by shlib.conf
 
1223
        SHLIB_RPATH_FLAGS=
 
1224
        RPATH_FLAG=
 
1225
        PROG_RPATH_FLAGS=
 
1226
fi
 
1227
 
 
1228
if test "$SHLIBEXT" = ".so-nobuild"; then
 
1229
   AC_MSG_ERROR([Shared libraries are not yet supported on this platform.])
 
1230
fi
 
1231
 
 
1232
DEPLIBEXT=$SHLIBEXT
 
1233
 
 
1234
if test "$krb5_force_static" = "yes"; then
1239
1235
        LIBLIST='lib$(LIBBASE)$(STLIBEXT)'
1240
1236
        LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT)'
1241
1237
        OBJLISTS=OBJS.ST
1242
 
        LIBINSTLIST=install-static
1243
 
        DEPLIBEXT=$STLIBEXT
 
1238
        # This used to be install-static, but now we only follow this
 
1239
        # path for internal libraries we don't want installed, not for
 
1240
        # configure-time requests for installed static libraries.
 
1241
        LIBINSTLIST=
1244
1242
#       CFLAGS="$CFLAGS -D_KDB5_STATIC_LINK"
1245
 
fi
1246
 
 
1247
 
# Check whether to build shared libraries.
1248
 
AC_ARG_ENABLE([shared],
1249
 
dnl AC_HELP_STRING([--enable-shared],[build shared libraries @<:@enabled for most platforms@:>@])
1250
 
dnl AC_HELP_STRING([--disable-shared],[don't build shared libraries])
1251
 
, ,
1252
 
[enable_shared=$default_shared])
1253
 
 
1254
 
if test "$enable_shared" != yes; then
1255
 
  AC_MSG_ERROR([Sorry, this release builds only shared libraries, cannot disable them.])
1256
 
fi
1257
 
 
1258
 
if test "$enable_shared" = yes; then
1259
 
        case "$SHLIBEXT" in
1260
 
        .so-nobuild)
1261
 
                AC_MSG_WARN([shared libraries not supported on this architecture])
1262
 
                RUN_ENV=
1263
 
                CC_LINK="$CC_LINK_STATIC"
1264
 
                ;;
1265
 
        *)
1266
 
                # set this now because some logic below may reset SHLIBEXT
1267
 
                DEPLIBEXT=$SHLIBEXT
1268
 
                if test "$krb5_force_static" = "yes"; then
1269
 
                        AC_MSG_RESULT([Forcing static libraries.])
1270
 
                        # avoid duplicate rules generation for AIX and such
1271
 
                        SHLIBEXT=.so-nobuild
1272
 
                        SHLIBVEXT=.so.v-nobuild
1273
 
                        SHLIBSEXT=.so.s-nobuild
1274
 
                else
1275
 
                        AC_MSG_NOTICE([enabling shared libraries])
1276
 
                        # Clear some stuff in case of AIX, etc.
1277
 
                        if test "$STLIBEXT" = "$SHLIBEXT" ; then
1278
 
                                STLIBEXT=.a-nobuild
1279
 
                                LIBLIST=
1280
 
                                LIBLINKS=
1281
 
                                OBJLISTS=
1282
 
                                LIBINSTLIST=
1283
 
                        fi
1284
 
                        LIBLIST="$LIBLIST "'lib$(LIBBASE)$(SHLIBEXT)'
1285
 
                        LIBLINKS="$LIBLINKS "'$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)'
1286
 
                        case "$SHLIBSEXT" in
1287
 
                        .so.s-nobuild)
1288
 
                                LIBINSTLIST="$LIBINSTLIST install-shared"
1289
 
                                ;;
1290
 
                        *)
1291
 
                                LIBLIST="$LIBLIST "'lib$(LIBBASE)$(SHLIBSEXT)'
1292
 
                                LIBLINKS="$LIBLINKS "'$(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)'
1293
 
                                LIBINSTLIST="$LIBINSTLIST install-shlib-soname"
1294
 
                                ;;
1295
 
                        esac
1296
 
                        OBJLISTS="$OBJLISTS OBJS.SH"
1297
 
                fi
1298
 
                CC_LINK="$CC_LINK_SHARED"
1299
 
                ;;
1300
 
        esac
1301
 
else
1302
 
        RUN_ENV=
1303
 
        CC_LINK="$CC_LINK_STATIC"
 
1243
 
 
1244
        AC_MSG_RESULT([Forcing static libraries.])
 
1245
        # avoid duplicate rules generation for AIX and such
1304
1246
        SHLIBEXT=.so-nobuild
1305
1247
        SHLIBVEXT=.so.v-nobuild
1306
1248
        SHLIBSEXT=.so.s-nobuild
1307
 
fi
 
1249
else
 
1250
        AC_MSG_NOTICE([using shared libraries])
1308
1251
 
1309
 
if test "$build_dynobj" = yes; then
1310
 
        OBJLISTS=`echo $OBJLISTS | sed -e s/OBJS.ST//g -e s/OBJS.SH//g`
1311
 
        OBJLISTS="$OBJLISTS OBJS.SH"
 
1252
        # Clear some stuff in case of AIX, etc.
 
1253
        if test "$STLIBEXT" = "$SHLIBEXT" ; then
 
1254
                STLIBEXT=.a-nobuild
 
1255
        fi
 
1256
        case "$SHLIBSEXT" in
 
1257
        .so.s-nobuild)
 
1258
                SHLIB_HAVE_MINOR_VERS=no
 
1259
                LIBLIST='lib$(LIBBASE)$(SHLIBEXT)'
 
1260
                LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)'
 
1261
                LIBINSTLIST="install-shared"
 
1262
                ;;
 
1263
        *)
 
1264
                SHLIB_HAVE_MINOR_VERS=yes
 
1265
                LIBLIST='lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT)'
 
1266
                LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)'
 
1267
                LIBINSTLIST="install-shlib-soname"
 
1268
                ;;
 
1269
        esac
 
1270
        OBJLISTS="OBJS.SH"
1312
1271
fi
 
1272
CC_LINK="$CC_LINK_SHARED"
 
1273
CXX_LINK="$CXX_LINK_SHARED"
 
1274
AC_SUBST(SHLIB_HAVE_MINOR_VERS)
1313
1275
 
1314
1276
if test -z "$LIBLIST"; then
1315
1277
        AC_MSG_ERROR([must enable one of shared or static libraries])
1321
1283
,
1322
1284
[if test "$enableval" = yes; then
1323
1285
  AC_MSG_ERROR([Sorry, profiled libraries do not work in this release.])
1324
 
fi
1325
 
if false; then
1326
 
        case $PFLIBEXT in
1327
 
        .po-nobuild)
1328
 
                AC_MSG_WARN([Profiled libraries not supported on this architecture.])
1329
 
                ;;
1330
 
        *)
1331
 
                AC_MSG_NOTICE([enabling profiled libraries])
1332
 
                LIBLIST="$LIBLIST "'lib$(LIBBASE)$(PFLIBEXT)'
1333
 
                LIBLINKS="$LIBLINKS "'$(TOPLIBD)/lib$(LIBBASE)$(PFLIBEXT)'
1334
 
                OBJLISTS="$OBJLISTS OBJS.PF"
1335
 
                LIBINSTLIST="$LIBINSTLIST install-profiled"
1336
 
                ;;
1337
 
        esac
1338
1286
fi])])
1339
1287
 
1340
1288
dnl
1484
1432
ifelse([$3], ,[if test "x$ac_cv_func_$2" = xyes; then])
1485
1433
AC_CACHE_CHECK([if $2 needs a prototype provided], krb5_cv_func_$2_noproto,
1486
1434
AC_TRY_COMPILE([$1],
1487
 
[struct k5foo {int foo; } xx;
 
1435
[#undef $2
 
1436
struct k5foo {int foo; } xx;
1488
1437
extern int $2 (struct k5foo*);
1489
1438
$2(&xx);
1490
1439
],
1810
1759
  : # neither enabled
1811
1760
dnl  AC_MSG_NOTICE(disabling ldap backend module support)
1812
1761
fi
1813
 
AC_SUBST(OPENLDAP_PLUGIN)
1814
1762
])dnl
1815
1763
dnl
1816
1764
dnl If libkeyutils exists (on Linux) include it and use keyring ccache