[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patches to use installed shared libraries



>>>>> "Brian" == Brian May <bam@snoopy.apana.org.au> writes:

    Brian> I have updated my patches (designed to use the existing
    Brian> versions of libreadline, libcom_err, and libss, without
    Brian> installing replacements), and now got everything working,
    Brian> up and past configure:

Sorry to followup on my previous post so soon...

However, I have fixed a number of small issues in my previous patch.

(make sure all **/Makefile.in are rebuilt - for some reason just running
make didn't rebuild it for me.)

There is still one problem:

../../lib/com_err/compile_et asn1_err.et

If I use the supplied copy of compile_et instead of the installed
version, I get these errors:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -I../../lib/roken -I../../lib/roken -g -O2 -o .libs/asn1_print asn1_print.o  ./.libs/libasn1.so -lresolv -lresolv -L/usr/lib -lcom_err ../../lib/vers/.libs/libvers.so -lresolv -lresolv ../../lib/roken/.libs/libroken.so -lresolv -lresolv -lcrypt -ldb -lresolv -lresolv
asn1_print.o: In function `loop':
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:101: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:113: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:134: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:145: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:161: undefined reference to `com_right'
./.libs/libasn1.so: undefined reference to `initialize_error_table_r'
collect2: ld returned 1 exit status
make: *** [asn1_print] Error 1

the installed version compile_et probably should be used instead; Now
I get these errors:

gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -I../../lib/roken -I../../lib/roken -g -O2 -c der_get.c  -fPIC -DPIC -o .libs/der_get.lo
der_get.c: In function `der_get_length':
der_get.c:85: `ASN1_OVERRUN' undeclared (first use in this function)
der_get.c:85: (Each undeclared identifier is reported only once
der_get.c:85: for each function it appears in.)
der_get.c: In function `der_get_tag':
der_get.c:147: `ASN1_OVERRUN' undeclared (first use in this function)
der_get.c: In function `der_match_tag':
der_get.c:169: `ASN1_BAD_ID' undeclared (first use in this function)
der_get.c:171: `ASN1_MISPLACED_FIELD' undeclared (first use in this function)
der_get.c:173: `ASN1_MISSING_FIELD' undeclared (first use in this function)
der_get.c: In function `decode_general_string':
der_get.c:275: `ASN1_OVERRUN' undeclared (first use in this function)
der_get.c: In function `decode_octet_string':
der_get.c:307: `ASN1_OVERRUN' undeclared (first use in this function)
der_get.c: In function `decode_generalized_time':
der_get.c:355: `ASN1_OVERRUN' undeclared (first use in this function)
make: *** [der_get.lo] Error 1

asn1_err.h contains those constants without the leading ASN1_

I hack this include file to have the expected constants, and now I get
the same error again:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -I../../lib/roken -I../../lib/roken -g -O2 -o .libs/asn1_print asn1_print.o  ./.libs/libasn1.so -lresolv -lresolv -L/usr/lib -lcom_err ../../lib/vers/.libs/libvers.so -lresolv -lresolv ../../lib/roken/.libs/libroken.so -lresolv -lresolv -lcrypt -ldb -lresolv -lresolv
asn1_print.o: In function `loop':
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:101: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:113: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:134: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:145: undefined reference to `com_right'
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:161: undefined reference to `com_right'
asn1_print.o: In function `main':
/homes/bam/build/heimdal/lib/asn1/asn1_print.c:225: undefined reference to `initialize_asn1_error_table_r'
collect2: ld returned 1 exit status
make: *** [asn1_print] Error 1

(there are enough references to -lresolv in that command line - sure
it won't get forgotten?)

so, I get the strong impression that the two versions of com_err are
slightly incompatible :-(.


To summarise the problems:

1. ../../lib/com_err/compile_et needs to be replaced by compile_et if
using installed version.

2. installed version of com_err defines constants using different naming
convention.

3. installed version of com_err doesn't have the following function:
com_right - is it required? what does it do? Perhaps it should be
replace with error_message() (which only takes one parameter)?

4. initialize_asn1_error_table_r is not defined (I think the function
is now initialize_asn1_error_table ????).

5. haven't got up to libss yet, it might have problems of its own. I
assume libreadline should be OK.


Any ideas? Should I patch com_err to make it behave in the same manner
as the installed version?


Index: configure.in
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/configure.in,v
retrieving revision 1.1.1.20
diff -c -r1.1.1.20 configure.in
*** configure.in	2000/10/01 23:00:58	1.1.1.20
--- configure.in	2000/10/25 02:30:55
***************
*** 226,231 ****
--- 226,237 ----
  [#include <stdio.h>
   #include <readline.h>],-lreadline,,, READLINE)
  
+ AC_TEST_PACKAGE_NEW(com_err,
+ [#include <et/com_err.h>],-lcom_err,,, COM_ERR)
+ 
+ AC_TEST_PACKAGE_NEW(sl,
+ [#include <et/com_err.h>],-lss,,, SL)
+ 
  AC_TEST_PACKAGE_NEW(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)
  
  KRB_C_BIGENDIAN
***************
*** 553,558 ****
--- 559,566 ----
  AC_FIND_FUNC_NO_LIBS(des_cbc_encrypt, crypto des)
  
  KRB_READLINE
+ KRB_COM_ERR
+ KRB_SL
  
  dnl telnet muck --------------------------------------------------
  
Index: admin/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/admin/Makefile.am,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 Makefile.am
*** admin/Makefile.am	2000/01/07 23:55:16	1.1.1.2
--- admin/Makefile.am	2000/10/25 02:08:16
***************
*** 24,29 ****
  	$(top_builddir)/lib/krb5/libkrb5.la \
  	$(top_builddir)/lib/des/libdes.la \
  	$(top_builddir)/lib/asn1/libasn1.la \
! 	$(top_builddir)/lib/sl/libsl.la \
  	$(LIB_readline) \
  	$(LIB_roken)
--- 24,29 ----
  	$(top_builddir)/lib/krb5/libkrb5.la \
  	$(top_builddir)/lib/des/libdes.la \
  	$(top_builddir)/lib/asn1/libasn1.la \
! 	@LIB_sl@ \
  	$(LIB_readline) \
  	$(LIB_roken)
Index: cf/krb-com_err.m4
===================================================================
RCS file: krb-com_err.m4
diff -N krb-com_err.m4
*** /dev/null	Thu May 18 18:17:41 2000
--- krb-com_err.m4	Wed Oct 25 13:12:08 2000
***************
*** 0 ****
--- 1,25 ----
+ dnl
+ dnl Tests for readline functions
+ dnl
+ 
+ dnl el_init
+ 
+ AC_DEFUN(KRB_COM_ERR,[
+ dnl com_err
+ 
+ ac_foo=no
+ if test "$with_com_err" = yes; then
+ 	:
+ elif test "$ac_cv_func_com_err" = yes; then
+ 	:
+ else
+ 	DIR_com_err="com_err"
+ 	LIB_com_err='$(top_builddir)/lib/com_err/libcom_err.la'
+ fi
+ #if test "$com_err_libdir"; then
+ #	LIB_com_err="-rpath $com_err_libdir $LIB_com_err"
+ #fi
+ AC_DEFINE(HAVE_COM_ERR, 1, 
+ 	[Define if you have a com_err compatible library.])dnl
+ 
+ ])
Index: cf/krb-readline.m4
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/cf/krb-readline.m4,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 krb-readline.m4
*** cf/krb-readline.m4	2000/07/31 03:16:55	1.1.1.1
--- cf/krb-readline.m4	2000/10/25 02:12:19
***************
*** 27,42 ****
  	:
  elif test "$ac_cv_func_el_init" = yes; then
  	ac_foo=yes
  	LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
  else
! 	LIB_readline='$(top_builddir)/lib/editline/libeditline.a'
  fi
  AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
! if test "$readline_libdir"; then
! 	LIB_readline="-rpath $readline_libdir $LIB_readline"
! fi
  LIB_readline="$LIB_readline \$(LIB_tgetent)"
  AC_DEFINE(HAVE_READLINE, 1, 
  	[Define if you have a readline compatible library.])dnl
  
! ])
\ No newline at end of file
--- 27,44 ----
  	:
  elif test "$ac_cv_func_el_init" = yes; then
  	ac_foo=yes
+  	DIR_readline="editline"
  	LIB_readline="\$(top_builddir)/lib/editline/libel_compat.a $LIB_el_init"
  else
!  	DIR_readline="editline"
! 	LIB_readline='$(top_builddir)/lib/editline/libeditline.la'
  fi
  AM_CONDITIONAL(el_compat, test "$ac_foo" = yes)
! #if test "$readline_libdir"; then
! #	LIB_readline="-rpath $readline_libdir $LIB_readline"
! #fi
  LIB_readline="$LIB_readline \$(LIB_tgetent)"
  AC_DEFINE(HAVE_READLINE, 1, 
  	[Define if you have a readline compatible library.])dnl
  
! ])
Index: cf/krb-sl.m4
===================================================================
RCS file: krb-sl.m4
diff -N krb-sl.m4
*** /dev/null	Thu May 18 18:17:41 2000
--- krb-sl.m4	Wed Oct 25 13:11:52 2000
***************
*** 0 ****
--- 1,25 ----
+ dnl
+ dnl Tests for readline functions
+ dnl
+ 
+ dnl el_init
+ 
+ AC_DEFUN(KRB_SL,[
+ dnl com_err
+ 
+ ac_foo=no
+ if test "$with_com_err" = yes; then
+ 	:
+ elif test "$ac_cv_func_com_err" = yes; then
+ 	:
+ else
+ 	DIR_sl="sl"
+ 	LIB_sl='$(top_builddir)/lib/sl/libsl.la'
+ fi
+ #if test "$sl_libdir"; then
+ #	LIB_sl="-rpath $sl_libdir $LIB_sl"
+ #fi
+ AC_DEFINE(HAVE_SL, 1, 
+ 	[Define if you have a sl compatible library.])dnl
+ 
+ ])
Index: cf/test-package.m4
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/cf/test-package.m4,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 test-package.m4
*** cf/test-package.m4	2000/07/31 03:16:55	1.1.1.2
--- cf/test-package.m4	2000/10/24 23:10:32
***************
*** 2,8 ****
  dnl
  dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations, conditional)
  
! AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
  
  AC_DEFUN(AC_TEST_PACKAGE_NEW,[
  AC_ARG_WITH($1,
--- 2,8 ----
  dnl
  dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations, conditional)
  
! AC_DEFUN(AC_TEST_PACKAGE,[MY_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
  
  AC_DEFUN(AC_TEST_PACKAGE_NEW,[
  AC_ARG_WITH($1,
***************
*** 39,45 ****
  header_dirs=
  lib_dirs=
  d='$5'
! for i in $d; do
  	header_dirs="$header_dirs $i/include"
  	lib_dirs="$lib_dirs $i/lib$abilibdirext"
  done
--- 39,45 ----
  header_dirs=
  lib_dirs=
  d='$5'
! for i in $d /usr; do
  	header_dirs="$header_dirs $i/include"
  	lib_dirs="$lib_dirs $i/lib$abilibdirext"
  done
***************
*** 72,77 ****
--- 72,78 ----
  if test "$ires" -a "$lres" -a "$with_$1" != "no"; then
  	$1_includedir="$ires"
  	$1_libdir="$lres"
+ 	DIR_$1=
  	INCLUDE_$1="-I$$1_includedir"
  	LIB_$1="-L$$1_libdir $3"
  	ifval([$6],
***************
*** 80,85 ****
--- 81,87 ----
  	with_$1=yes
  	AC_MSG_RESULT([headers $ires, libraries $lres])
  else
+ 	DIR_$1="$1"
  	INCLUDE_$1=
  	LIB_$1=
  	with_$1=no
***************
*** 88,93 ****
--- 90,96 ----
  dnl ifval([$6],
  dnl 	AM_CONDITIONAL($6, test "$with_$1" = yes)
  dnl 	AM_CONDITIONAL(upcase($1), test "$with_$1" = yes))
+ AC_SUBST(DIR_$1)
  AC_SUBST(INCLUDE_$1)
  AC_SUBST(LIB_$1)
  ])
Index: kadmin/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/kadmin/Makefile.am,v
retrieving revision 1.1.1.8
diff -c -r1.1.1.8 Makefile.am
*** kadmin/Makefile.am	2000/10/01 23:01:08	1.1.1.8
--- kadmin/Makefile.am	2000/10/25 02:08:22
***************
*** 62,68 ****
  kadmin_LDADD = \
  	$(top_builddir)/lib/kadm5/libkadm5clnt.la \
  	$(top_builddir)/lib/kadm5/libkadm5srv.la \
! 	$(top_builddir)/lib/sl/libsl.la \
  	$(LIB_readline) \
  	$(COMMON_LDADD) \
  	$(LIB_dlopen)
--- 62,68 ----
  kadmin_LDADD = \
  	$(top_builddir)/lib/kadm5/libkadm5clnt.la \
  	$(top_builddir)/lib/kadm5/libkadm5srv.la \
! 	@LIB_sl@ \
  	$(LIB_readline) \
  	$(COMMON_LDADD) \
  	$(LIB_dlopen)
Index: lib/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/lib/Makefile.am,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 Makefile.am
*** lib/Makefile.am	2000/07/31 03:16:41	1.1.1.2
--- lib/Makefile.am	2000/10/25 02:09:20
***************
*** 12,16 ****
  dir_dce = kdfs
  endif
  
! SUBDIRS = @DIR_roken@ vers editline com_err sl asn1 des krb5 \
  	kafs hdb kadm5 gssapi auth $(dir_45) $(dir_otp) $(dir_dce)
--- 12,16 ----
  dir_dce = kdfs
  endif
  
! SUBDIRS = @DIR_roken@ vers @DIR_readline@ @DIR_com_err@ @DIR_sl@ asn1 des krb5 \
  	kafs hdb kadm5 gssapi auth $(dir_45) $(dir_otp) $(dir_dce)
Index: lib/asn1/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/lib/asn1/Makefile.am,v
retrieving revision 1.1.1.9
diff -c -r1.1.1.9 Makefile.am
*** lib/asn1/Makefile.am	2000/07/31 03:16:41	1.1.1.9
--- lib/asn1/Makefile.am	2000/10/25 02:29:20
***************
*** 82,92 ****
  	$(BUILT_SOURCES)
  
  asn1_compile_LDADD = \
! 	$(LIB_roken) $(LEXLIB)
  
  check_der_LDADD = \
  	libasn1.la \
! 	../com_err/libcom_err.la \
  	$(LIB_roken)
  
  asn1_print_LDADD = $(check_der_LDADD)
--- 82,92 ----
  	$(BUILT_SOURCES)
  
  asn1_compile_LDADD = \
!         $(LIB_roken) $(LEXLIB)
  
  check_der_LDADD = \
  	libasn1.la \
! 	@LIB_com_err@ \
  	$(LIB_roken)
  
  asn1_print_LDADD = $(check_der_LDADD)
Index: lib/auth/sia/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/lib/auth/sia/Makefile.am,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 Makefile.am
*** lib/auth/sia/Makefile.am	2000/08/29 23:48:01	1.1.1.3
--- lib/auth/sia/Makefile.am	2000/10/25 02:08:37
***************
*** 23,29 ****
  	$(top_builddir)/lib/asn1/.libs/libasn1.a	\
  	$(LIB_krb4)					\
  	$(top_builddir)/lib/des/.libs/libdes.a		\
! 	$(top_builddir)/lib/com_err/.libs/libcom_err.a	\
  	$(top_builddir)/lib/roken/.libs/libroken.a	\
  	$(LIB_getpwnam_r)				\
  	-lc
--- 23,29 ----
  	$(top_builddir)/lib/asn1/.libs/libasn1.a	\
  	$(LIB_krb4)					\
  	$(top_builddir)/lib/des/.libs/libdes.a		\
! 	@LIB_sl@
  	$(top_builddir)/lib/roken/.libs/libroken.a	\
  	$(LIB_getpwnam_r)				\
  	-lc
***************
*** 34,40 ****
  	$(top_builddir)/lib/asn1/.libs/libasn1.so	\
  	$(LIB_krb4)					\
  	$(top_builddir)/lib/des/.libs/libdes.so		\
! 	$(top_builddir)/lib/com_err/.libs/libcom_err.so	\
  	$(top_builddir)/lib/roken/.libs/libroken.so	\
  	$(LIB_getpwnam_r)				\
  	-lc
--- 34,40 ----
  	$(top_builddir)/lib/asn1/.libs/libasn1.so	\
  	$(LIB_krb4)					\
  	$(top_builddir)/lib/des/.libs/libdes.so		\
! 	@LIB_sl@
  	$(top_builddir)/lib/roken/.libs/libroken.so	\
  	$(LIB_getpwnam_r)				\
  	-lc
Index: lib/editline/Makefile.am
===================================================================
RCS file: /homes/bam/cvsroot/debian/heimdal/lib/editline/Makefile.am,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -c -r1.1.1.2 -r1.2
*** lib/editline/Makefile.am	1999/08/06 00:12:42	1.1.1.2
--- lib/editline/Makefile.am	2000/10/08 22:21:05	1.2
***************
*** 4,10 ****
  
  man_MANS = editline.3
  
! lib_LIBRARIES = libeditline.a
  if el_compat
  noinst_LIBRARIES = libel_compat.a
  else
--- 4,11 ----
  
  man_MANS = editline.3
  
! lib_LTLIBRARIES = libeditline.la
! libeditline_la_LDFLAGS = -static
  if el_compat
  noinst_LIBRARIES = libel_compat.a
  else
***************
*** 16,28 ****
  CHECK_LOCAL =
  
  testit_LDADD = \
! 	libeditline.a \
  	$(LIB_tgetent) \
  	$(LIB_roken)
  
  include_HEADERS = editline.h
  
! libeditline_a_SOURCES = complete.c editline.c sysunix.c \
  	editline.h roken_rename.h unix.h
  libel_compat_a_SOURCES = edit_compat.c
  
--- 17,29 ----
  CHECK_LOCAL =
  
  testit_LDADD = \
! 	libeditline.la \
  	$(LIB_tgetent) \
  	$(LIB_roken)
  
  include_HEADERS = editline.h
  
! libeditline_la_SOURCES = complete.c editline.c sysunix.c \
  	editline.h roken_rename.h unix.h
  libel_compat_a_SOURCES = edit_compat.c
  
-- 
Brian May <bam@snoopy.apana.org.au>