[2931] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

krb5-build/599: building shared libraries on FreeBSD

daemon@ATHENA.MIT.EDU (n@nectar.com)
Thu May 28 01:45:45 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: tlyu@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, n@nectar.com
Date: Thu, 28 May 1998 00:37:41 -0500 (CDT)
From: n@nectar.com
To: krb5-bugs@MIT.EDU


>Number:         599
>Category:       krb5-build
>Synopsis:       building shared libraries on FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    tlyu
>State:          open
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Thu May 28 01:38:00 EDT 1998
>Last-Modified:
>Originator:     Jacques Vidrine <n@nectar.com>
>Organization:
Nectar.COM
>Release:        krb5-1.0.5
>Environment:
	
System: FreeBSD cerebus.nectar.com 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Wed May 27 13:42:01 CDT 1998 nectar@cerebus.nectar.com:/a/usr/src/sys/compile/CEREBUS i386


>Description:
The Kerberos V Release 1 distributions do not support building
shared libraries on FreeBSD.
>How-To-Repeat:
Try running ``configure --enable-shared'' on a system running
FreeBSD.
>Fix:
Building shared libraries on FreeBSD is almost exactly the same
as building them on NetBSD (which is supported).

These patches (just copied from the NetBSD portions of the distribution)
allow one to build Kerberos V Release 1 with shared libraries.  I believe
this will work for FreeBSD 2.2.x and FreeBSD 3.0, but I have only 
tested on FreeBSD 3.0.

One will need to run ``reconf'' to get an updated ``configure''
script.

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/mit-krb5/src/configure.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.in
--- configure.in        1998/05/27 20:22:52     1.1.1.1
+++ configure.in        1998/05/28 03:15:50
@@ -21,6 +21,28 @@
 AC_ARG_ENABLE([shared],
 [  --enable-shared         build shared libraries],[
 case $krb5_cv_host in
+*-*-freebsd*)
+       echo "Enabling shared libraries for FreeBSD...."
+       krb5_cv_shlibs_cflags=-fpic
+       krb5_cv_shlibs_ext=so
+       krb5_cv_noshlibs_ext=a
+krb5_cv_shlibs_versioned_filenames=yes # version in filename of library
+       krb5_cv_shlibs_need_nover=no
+       krb5_cv_shlibs_dir=shared
+       krb5_cv_shlibs_ldflag=
+       krb5_cv_noshlibs_ldflag="-static"
+       krb5_cv_shlibs_sym_ufo="-u "
+       krb5_cv_shlibs_dirhead="-Wl,-R -Wl,"
+       krb5_cv_exe_need_dirs=yes
+       krb5_cv_shlibs_use_dirs=yes
+       krb5_cv_shlibs_use_colon_dirs=no
+       krb5_cv_shlibs_tail_comp=
+       krb5_cv_shlibs_enabled=yes
+       krb5_cv_staticlibs_enabled=yes
+       krb5_cv_shlibs_run_ldpath=default
+       krb5_cv_shlibs_run_libpath=no
+       krb5_cv_shlibs_run_rldroot=no
+       ;;
 *-*-netbsd*)
        echo "Enabling shared libraries for NetBSD...."
        krb5_cv_shlibs_cflags=-fpic       
Index: makeshlib.sh
===================================================================
RCS file: /usr/local/cvsroot/mit-krb5/src/util/makeshlib.sh,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 makeshlib.sh
--- makeshlib.sh        1998/05/27 20:24:15     1.1.1.1
+++ makeshlib.sh        1998/05/28 02:04:59
@@ -17,6 +17,18 @@
 VERSION="$1" ; shift

 case $host  in
+*-*-freebsd*)
+       FILES=`for i
+       do
+               sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" -e "s;^$i/shared/\$;;" $i/DONE
+       done`
+       # Hack to deal with the fact that with cc options are different
+       # from ld...
+       ldflags=`echo $ldflags |sed  -e "s/-Wl,//g"`
+       echo ld -Bshareable $ldflags -o $library $FILES $libdirfl $liblist
+       ld -Bshareable $ldflags -o $library $FILES $libdirfl $liblist
+       stat=$?
+       ;;
 *-*-netbsd*)
        FILES=`for i
        do      

>Audit-Trail:
>Unformatted:

home help back first fref pref prev next nref lref last post