+Thu May 25 22:01:39 1995 Theodore Y. Ts'o (tytso@dcl)
+
+ * aclocal.m4(V5_MAKE_SHARED_LIB, V5_SHARED_LIB_OBJS): Added autoconf
+ rules for creating shared libraries.
+
+ * configure.in: Add support for --enable-shared
+
Thu May 25 11:30:00 1995 Keith Vetter (keithv@fusion.com)
* Makefile.in: don't copy profile.h here but do it in include/makefile.
ADD_DEF(-Dvolatile=)
fi
])dnl
+dnl
+dnl This rule supports the generation of the shared library object files
+dnl
+define(V5_SHARED_LIB_OBJS,[
+if test ${krb5_cv_shlibs_dir}x != x; then
+SHARED_RULE=" \$(CC) ${krb5_cv_shlibs_cflags} \$(CFLAGS) -o ${krb5_cv_shlibs_dir}/\$""*.o -c \$(srcdir)/\$""*.c"
+SHARED_RULE_LOCAL=" \$(CC) ${krb5_cv_shlibs_cflags} \$(CFLAGS) -o ${krb5_cv_shlibs_dir}/\$""*.o -c \$""*.c"
+else
+SHARED_RULE=
+SHARED_RULE_LOCAL=
+fi
+AC_SUBST(SHARED_RULE)
+AC_SUBST(SHARED_RULE_LOCAL)
+])dnl
+dnl
+dnl This rule adds the additional Makefile fragment necessary to actually
+dnl create the shared library
+dnl
+define(V5_MAKE_SHARED_LIB,[
+AC_ARG_ENABLE([shared],
+[ --enable-shared build with shared libraries],[
+HOST_TYPE=$krb5_cv_host
+AC_SUBST(HOST_TYPE)
+SHEXT=$krb5_cv_shlibs_ext
+AC_SUBST(SHEXT)
+DO_MAKE_SHLIB="$1.\$""(SHEXT)"
+AC_DIVERT_PUSH(AC_DIVERSION_MAKEFILE)dnl
+
+all:: $(DO_MAKE_SHLIB)
+
+clean::
+ $(RM) $1.[$](SHEXT)
+
+$1.[$](SHEXT): [$](LIBDONE)
+ [$](SRCTOP)/util/makeshlib [$](HOST_TYPE) [$](CC) [$]@ [$](LIB_SUBDIRS)
+
+AC_DIVERT_POP()dnl
+],[
+DO_MAKE_SHLIB=
+])dnl
+AC_SUBST(DO_MAKE_SHLIB)
+])dnl
WITH_CCOPTS
CONFIG_RULES
AC_SET_BUILDTOP
+AC_MSG_CHECKING([for build host])
+AC_CACHE_VAL(krb5_cv_host, [AC_CANONICAL_HOST
+krb5_cv_host=$host])
+AC_MSG_RESULT($krb5_cv_host)
WITH_KRB5ROOT
WITH_KRB4
WITH_NETLIB
+AC_ARG_ENABLE([shared],
+[ --enable-shared build with shared libraries],[
+case $krb5_cv_host in
+*-*-linux*)
+ echo "Enabling shared libraries for Linux...."
+ krb5_cv_shlibs_cflags=-fPIC
+ krb5_cv_shlibs_ext=so
+ krb5_cv_shlibs_dir=shared
+ ;;
+*-*-solaris*)
+ echo "Enabling shared libraries for Solaris...."
+ krb5_cv_shlibs_cflags=-Kpic
+ krb5_cv_shlibs_ext=so
+ krb5_cv_shlibs_dir=shared
+ ;;
+*)
+ echo " "
+ echo "Shared libraries not supported on $krb5_cv_host"
+ exit 1
+ ;;
+esac],[krb5_cv_shlibs_cflags=
+krb5_cv_shlibs_ext=
+krb5_cv_shlibs_dir=])
AC_ARG_ENABLE([athena],
[ --enable-athena build with MIT Project Athena configuration],,)
if test -z "$KRB4_LIB"; then