Subject: How Gnucash build fails with Pkgsrc libtool
To: None <tech-pkg@netbsd.org>
From: Masao Uebayashi <uebayasi@pultek.co.jp>
List: tech-pkg
Date: 01/23/2003 11:08:32
Hello,

I finally found what the subject says.  The command line failing (from
Buildlink wrapper log) looks like:

  cc (options) -o .libs/gnucash (objects) (archives) (link paths)

which is generated by two libtools.  There's only a one-line
difference between the commands generated by built-in libtool (without
LIBTOOL_OVERRIDE) and Pkgsrc libtool (with LIBTOOL_OVERRIDE.)

The line is 

  @@ -38,14 +38,15 @@
   -Wl,-R/usr/pkg/lib
   -Wl,-R/usr/pkg/guile/1.4/lib
   -Wl,-R/usr/pkg/lib
   -Wl,-R/usr/pkg/lib
   -Wl,-R/usr/X11R6/lib
   -L/src/TNF/pkgsrc/finance/gnucash.LIBTOOOL_OVERRIDE/work/.buildlink-x11/lib
   -L/src/TNF/pkgsrc/finance/gnucash.LIBTOOOL_OVERRIDE/work/.buildlink/lib
  +gnome/libgncgnome.a
   register/libgncregister.a
   register/gnome/libgncregistergnome.a
   guile/libgncguile.a
   gnome/libgncgnome.a
   calculation/libgnccalc.a
   engine/.libs/libgncengine.so
   -L/src/TNF/pkgsrc/finance/gnucash.LIBTOOOL_OVERRIDE/work/.buildlink/lib

Pkgsrc libtool trims the duplicate archive lines into one, which
results in a link error:

  gnome/libgncgnome.a(dialog-totd.o): In function `gnc_ui_totd_dialog_create':
  dialog-totd.o(.text+0x1d8): undefined reference to `gnc_get_current_tip'
  gnome/libgncgnome.a(dialog-totd.o): In function `totd_previous_cb':
  dialog-totd.o(.text+0x380): undefined reference to `gnc_decrement_tip'
  dialog-totd.o(.text+0x385): undefined reference to `gnc_get_current_tip'
  gnome/libgncgnome.a(dialog-totd.o): In function `totd_next_cb':
  dialog-totd.o(.text+0x3bc): undefined reference to `gnc_increment_tip'
  dialog-totd.o(.text+0x3c1): undefined reference to `gnc_get_current_tip'
  gnome/libgncgnome.a(dialog-totd.o): In function `totd_close_cb':
  dialog-totd.o(.text+0x41a): undefined reference to `gnc_increment_tip'
  gnome/libgncgnome.a(gnc-html.o): In function `gnc_html_load_to_stream':
  gnc-html.o(.text+0xc85): undefined reference to `gncReadFile'
  gnome/libgncgnome.a(top-level.o): In function `gnc_get_remaining_argv':
  top-level.o(.text+0x77): undefined reference to `gnc_scheme_list_to_nulltermcharpp'
  gnome/libgncgnome.a(top-level.o): In function `gnc_set_remaining_argv':
  top-level.o(.text+0x94): undefined reference to `gnc_argvarr_to_scheme_list'
  gnome/libgncgnome.a(top-level.o): In function `gnucash_ui_init':
  top-level.o(.text+0x141): undefined reference to `argv_length'
  top-level.o(.text+0x187): undefined reference to `argv_length'
  top-level.o(.text+0x1d1): undefined reference to `gnc_free_argv'
  gnome/libgncgnome.a(window-help.o): In function `gnc_help_window_new':
  window-help.o(.text+0x1238): undefined reference to `gncFindFile'

meaning gnome/libgncgnome.a and guile/libgncguile.a share a mutual
dependency.

I'll look more closely at Pkgsrc libtool later.  Any help would be
appreciated.

Masao