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

Patch to link dynamic zsh even if some libs are static



I reported the problem some time ago: our system doesn't have shared
libcurses (linked with libtermcap) and linking fails, because currently
libzsh.so is _not_ linked with $(LIBS).

As long as I cannot make our developers to provide shared versions of all
libs (Kosten Frage ;), here is very small patch to enable compilation
anyway. I added configure parameter '--enable-libhack'. If it is defined,
both zsh and libzsh.so are linked with $(LIBS). (It is not enough to ink
only libzsh.so - I wonder, if it is a bug or a feature?) The parameters
defaults to "no". I did it, because I am not shure about impact on other
systems - otherweise it is enough to just define LIBZSH_LIBS. The patch is
enough to compile ZSH on my system - it seems nobody else have this
problem.

It also includes previous patch I sent - not all systems support "ln -sf"
(ours doesn't).

BTW our compiler defaults to PIC code, so even linked with static library,
libzsh.so should be shared as well. I hope ... ;)

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: borsenkow.msk@xxxxxx
-------------------------------------------------------------------------
================== CUT HERE ==============================
--- zsh-3.1.2/Src/Makefile.in.org	Thu Jul  3 13:45:12 1997
+++ zsh-3.1.2/Src/Makefile.in	Thu Jul  3 12:47:33 1997
@@ -55,6 +55,7 @@
 EXELDFLAGS = @EXELDFLAGS@
 LIBLDFLAGS = @LIBLDFLAGS@
 EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
+LIBZSH_LIBS   = @LIBZSH_LIBS@
 
 INCLUDES = -I.. -I. -I$(srcdir)
 
@@ -177,9 +178,9 @@
 	$(LINK) $(@L@OBJS) $(@L@LIST) $(LIBS)
 
 $(LIBZSH): $(LIBOBJS) $(NSTMP)
-	rm -f $@
-	$(DLLINK) $(LIBOBJS) $(NLIST)
-	ln -sf $(LIBZSH) libzsh.so
+	rm -f $@ libzsh.so
+	$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBZSH_LIBS)
+	ln -s $(LIBZSH) libzsh.so
 
 ansi2knr: ansi2knr.c
 	$(COMPILE) $(srcdir)/ansi2knr.c
--- zsh-3.1.2/configure.in.org	Thu May 29 08:47:33 1997
+++ zsh-3.1.2/configure.in	Thu Jul  3 12:49:53 1997
@@ -184,6 +184,12 @@
 [  --enable-ansi2knr          translate source to K&R C before compiling],
 [ansi2knr="$enableval"], [ansi2knr=default])
 
+dnl If you have only static version of some libraries needed by ZSH
+AC_ARG_ENABLE(libhack,
+[  --enable-libhack           if you have only static version of some libs;
+                               used only if --enable-dynamic=yes],
+[libhack="$enableval"], [libhack=no])
+
 dnl ------------------
 dnl CHECK THE COMPILER
 dnl ------------------
@@ -966,6 +972,9 @@
   RTLD_GLOBAL_OK=$zsh_cv_sys_dynamic_rtld_global
   zsh_SYS_DYNAMIC_EXECSYMS
   if test "$zsh_cv_sys_dynamic_execsyms" != yes; then
+    if test "$libhack" = yes; then
+      LIBZSH_LIBS="$LIBS"
+    fi
     L=L LIBS="$LIBS -L. -lzsh"
   fi
   zsh_SYS_DYNAMIC_STRIP_EXE
@@ -997,6 +1006,7 @@
 AC_SUBST(DLLDFLAGS)dnl
 AC_SUBST(EXTRA_LDFLAGS)dnl
 AC_SUBST(L)dnl
+AC_SUBST(LIBZSH_LIBS)dnl
 AC_SUBST(RTLD_GLOBAL_OK)dnl
 
 AC_OUTPUT(Makefile Src/Makefile Src/Builtins/Makefile Src/Zle/Makefile \




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