Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Where to add extra libraries for modules



        I've all but got my perl-in-zsh module working with 4.0.2
again, but I've got an issue with where I should be adding in the
commands to link against the perl libraries.


        There's a perl module `ExtUtils::Embed' that provides commands
`ccopts' and `ldopts' that print out the required compiler flags and
linker options (similar to the gtk+ `gtk-config --libs').  I've got a
zperl.mdd file that's adding stuff to the Makefile like so:


---->8 zperl.mdd 8<----
name=xzperl
link=dynamic
load=no

objects="zperl.o perlxsi.o"

autobins="zperl"

:<<\Make
zperl.$(DL_EXT): $(MODDOBJS_zperl) zperl.export  $(dir_top)/Src/zsh.export $(NOLINKMODS_zperl)
	rm -f $@
	$(DLLINK) $(NXPIMP_zperl) $(NNTRYOPT) $(MODDOBJS_zperl) $(NOLINKMODS_zperl) $(LIBS) \
	   `perl -MExtUtils::Embed -e ldopts`

zperl.$(ANSIOBJ): zperl.c
	$(DLCOMPILE) `perl -MExtUtils::Embed -e ccopts` -o $@ $<

zperl$(ANSIOBJ): zperl.c
	$(COMPILE) `perl -MExtUtils::Embed -e ccopts` -o $@ $<
	@rm -f $(dir_src)/stamp-modobjs

perlxsi.$(ANSIOBJ): perlxsi.c
	$(DLCOMPILE) `perl -MExtUtils::Embed -e ccopts` -o $@ $<

perlxsi$(ANSIOBJ): perlxsi.c
	$(COMPILE) `perl -MExtUtils::Embed -e ccopts` -o $@ $<
	@rm -f $(dir_src)/stamp-modobjs

Make
---->8 zperl.mdd 8<----


        The problem is that the mkmakemod.sh script has already spit
out a rule for `zperl.$(DL_EXT)'.  I realize that I could stick the
ldopts invocation in DLLDFLAGS and/or LDFLAGS in the configure script,
but then that'd be including them for every module.  


        Would it make sense (possibly) to add an `extralibs' paramter
in the .mdd and then have mkmakemod.sh include that in the rule for
module.$(DL_EXT)?


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch@xxxxxxxxxxxx   |  Vincent, you should cease askin'          \ o.O'
770 933-0600 x211(w)  |  scary questions." -- Jules                =(___)=
                      |                                               U



Messages sorted by: Reverse Date, Date, Thread, Author