summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1995-05-26 02:11:28 +0000
committerTheodore Tso <tytso@mit.edu>1995-05-26 02:11:28 +0000
commit6b8cd68823e8d6cecb04e084c8b54e7daacb58bf (patch)
tree590e0ba1633fa769fd43ad2236da3f2a021ad11b /src
parent7677ff2c23e735ed5dafc25a80396bae7c6b1538 (diff)
downloadkrb5-6b8cd68823e8d6cecb04e084c8b54e7daacb58bf.tar.gz
krb5-6b8cd68823e8d6cecb04e084c8b54e7daacb58bf.tar.xz
krb5-6b8cd68823e8d6cecb04e084c8b54e7daacb58bf.zip
Add support for shared libraries
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5883 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/aclocal.m442
-rw-r--r--src/configure.in27
3 files changed, 76 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a4937f903f..57fb18a25d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+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.
diff --git a/src/aclocal.m4 b/src/aclocal.m4
index bfc1d4858a..993288f0f0 100644
--- a/src/aclocal.m4
+++ b/src/aclocal.m4
@@ -647,3 +647,45 @@ if test $krb5_cv_has_ansi_volatile = no; then
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
diff --git a/src/configure.in b/src/configure.in
index 4c9ddb8614..1b6badd943 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -2,9 +2,36 @@ AC_INIT(configure.in)
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