about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-04-19 14:45:41 +0000
committerClint Adams <clint@users.sourceforge.net>2001-04-19 14:45:41 +0000
commita43aa761cdb3fd1051dad474fccf9e500a0d49ea (patch)
tree1035a488b2c17d3314b4cfa08f702ea88c5b46c4 /Src
parente3ff47f8ee64cbeb48ed032939342bde1ac840bc (diff)
downloadzsh-a43aa761cdb3fd1051dad474fccf9e500a0d49ea.tar.gz
zsh-a43aa761cdb3fd1051dad474fccf9e500a0d49ea.tar.xz
zsh-a43aa761cdb3fd1051dad474fccf9e500a0d49ea.zip
14033: reduce unnecessary library linking for modules and main binary
Diffstat (limited to 'Src')
-rw-r--r--Src/Makefile.in4
-rw-r--r--Src/Modules/cap.mdd2
-rw-r--r--Src/Modules/termcap.mdd2
-rw-r--r--Src/Modules/terminfo.mdd2
-rw-r--r--Src/mkmakemod.sh25
-rw-r--r--Src/zsh.mdd2
6 files changed, 33 insertions, 4 deletions
diff --git a/Src/Makefile.in b/Src/Makefile.in
index faa10cbfe..5126a2b7c 100644
--- a/Src/Makefile.in
+++ b/Src/Makefile.in
@@ -82,11 +82,11 @@ EXTRAZSHOBJS = @EXTRAZSHOBJS@
 
 zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export $(EXTRAZSHOBJS)
 	rm -f $@
-	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
+	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS_M) $(LIBS_TERMCAP) $(LIBS_YP) $(LIBS)
 
 $(LIBZSH): $(LIBOBJS) $(NSTMP)
 	rm -f $@
-	$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS)
+	$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS_M) $(LIBS_TERMCAP) $(LIBS)
 
 zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
 	windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o
diff --git a/Src/Modules/cap.mdd b/Src/Modules/cap.mdd
index 4e7ee7216..0393f7f38 100644
--- a/Src/Modules/cap.mdd
+++ b/Src/Modules/cap.mdd
@@ -5,3 +5,5 @@ load=no
 autobins="cap getcap setcap"
 
 objects="cap.o"
+
+extralibs="cap"
diff --git a/Src/Modules/termcap.mdd b/Src/Modules/termcap.mdd
index 17d07aa03..4c33f5690 100644
--- a/Src/Modules/termcap.mdd
+++ b/Src/Modules/termcap.mdd
@@ -15,3 +15,5 @@ load=yes
 autobins="echotc"
 
 objects="termcap.o"
+
+extralibs="termcap"
diff --git a/Src/Modules/terminfo.mdd b/Src/Modules/terminfo.mdd
index da79e9768..0eca9ddfb 100644
--- a/Src/Modules/terminfo.mdd
+++ b/Src/Modules/terminfo.mdd
@@ -16,3 +16,5 @@ autobins="echoti"
 autoparams="terminfo"
 
 objects="terminfo.o"
+
+extralibs="terminfo"
diff --git a/Src/mkmakemod.sh b/Src/mkmakemod.sh
index e80e65819..bb1891e2f 100644
--- a/Src/mkmakemod.sh
+++ b/Src/mkmakemod.sh
@@ -27,6 +27,7 @@
 #   autoprefixconds like autoinfixconds, but for prefix condition codes
 #   autoparams      parameters defined by the module, for autoloading
 #   automathfuncs   math functions defined by the module, for autoloading
+#   extralibs       libraries specific to this module (default none)
 #   objects         .o files making up this module (*must* be defined)
 #   proto           .syms files for this module (default generated from $objects)
 #   headers         extra headers for this module (default none)
@@ -190,7 +191,8 @@ if $first_stage; then
 
 	unset name moddeps nozshdep alwayslink hasexport
 	unset autobins autoinfixconds autoprefixconds autoparams automathfuncs
-	unset objects proto headers hdrdeps otherincs
+	unset extralibs objects proto headers hdrdeps otherincs
+	unset EXTRALIBS
 	. $top_srcdir/$the_subdir/${mddname}.mdd
 	q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
 	test -n "${moddeps+set}" || moddeps=
@@ -199,6 +201,24 @@ if $first_stage; then
 	    proto=`echo $objects '' | sed 's,\.o ,.syms ,g'`
 
 	dobjects=`echo $objects '' | sed 's,\.o ,..o ,g'`
+
+	for lib in $extralibs; do
+	case $lib in
+	m) EXTRALIBS="$EXTRALIBS \$(LIBS_M)"
+	;;
+	cap) EXTRALIBS="$EXTRALIBS \$(LIBS_CAP)"
+	;;
+	socket) EXTRALIBS="$EXTRALIBS \$(LIBS_SOCKET)"
+	;;
+	termcap) EXTRALIBS="$EXTRALIBS \$(LIBS_TERMCAP)"
+	;;
+	terminfo) EXTRALIBS="$EXTRALIBS \$(LIBS_TERMINFO)"
+	;;
+	yp) EXTRALIBS="$EXTRALIBS \$(LIBS_YP)"
+	;;
+	esac
+	done
+
 	modhdeps=
 	mododeps=
 	exportdeps=
@@ -302,6 +322,7 @@ if $first_stage; then
 	echo "NXPIMP_${mddname} ="
 	echo "LINKMODS_${mddname} = $mododeps"
 	echo "NOLINKMODS_${mddname} = "
+	echo "EXTRALIBS_${mddname} = $EXTRALIBS"
 	echo
 	echo "proto.${mddname}: \$(EPRO_${mddname})"
 	echo "\$(SYMS_${mddname}): \$(PROTODEPS)"
@@ -328,7 +349,7 @@ if $first_stage; then
 	    echo
 	    echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) ${mddname}.export $exportdeps \$(@LINKMODS@_${mddname})"
 	    echo '	rm -f $@'
-	    echo "	\$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) \$(LIBS) "
+	    echo "	\$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) $EXTRALIBS \$(LIBS)"
 	    echo
 	fi
 	echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})"
diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index e2b7b91b5..2accfda10 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -17,6 +17,8 @@ signames.o string.o subst.o text.o utils.o watch.o"
 headers="../config.h system.h zsh.h sigcount.h signals.h \
 prototypes.h hashtable.h ztype.h"
 
+extralibs="m termcap yp"
+
 :<<\Make
 @CONFIG_MK@