Re: shared library dependencies (again)



James Henstridge <james daa com au> writes:

> On 28 Apr 2001, Owen Taylor wrote:
> 
> > > The one issue with my build patches is compiling pango modules into
> > > libpango.  In order to have correct dependencies in the modules, libpango
> > > must be built first.  But to compile modules into libpango, the modules
> > > must be built first.  I haven't worked out how to address this.  The patch
> > > makes things work in the case where no modules are compiled into libpango.
> >
> > I'd like to see these changes go in soon. But I think we have to
> > resolve this issueof included modules be resolved first. I admit to
> > being also puzzled as to how to do this.
> 
> I don't think the glib or gtk+ patches have this problem, so could
> probably be checked in.  It should be possible to apply each patch
> independently without breaking anything.
> 
> For pango, I suppose you could have a makefile that gets run before the
> pango subdir looking something like this:
> 
> if INCLUDE_BASIC_X
> pango_basic_x = $(top_builddir)/modules/basic/libpango-basic-x.la
> endif
> ...
> 
> all: $(pango_basic_x) ...
> 
> $(top_builddir)/modules/basic/libpango-basic-x.la:
> 	cd $(top_builddir)/modules/basic && $(MAKE) libpango-basic-x.la
> ...
> 
> It would look pretty horible, but would probably work.

OK, here's what I ended up doing for Pango (based on an idea from
James); configure.in includes the following:

====
for module in $included_modules; do
  [...]
  INCLUDED_RULES="$INCLUDED_RULES
\\\$(top_builddir)/modules/$dir/libpango-$module.la:
	cd \\\$(top_builddir)/modules/$dir && \\\$(MAKE) \\\$(AM_MAKEFLAGS) libpango-$module.la
done

AC_OUTPUT_COMMANDS([
  ac_file=pango/Makefile

  case "$CONFIG_FILES" in
  *$ac_file*)
    echo "Munging $ac_file to include rules for included modules"
    sed '/^ INCLUDED_RULES@$/ {
      r config.included_rules
      d
    }' < $ac_file > $ac_file.new && mv $ac_file.new $ac_file
  esac
  rm -f config.included_rules
],[
  cat > config.included_rules <<EOINCLUDE
$INCLUDED_RULES
EOINCLUDE
])
====

Then pango/Makefile.am has in it @INCLUDED_RULES@ so these rules
get substituted in as part of the configure step. So, when
you build the pango/ subdir, it, for each included module,
CD's into that module and runs make to build the module
by itself.

Regards,
                                        Owen




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