zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: zsh/pcre module building
@ 2003-06-23  4:35 Fr�d�ric L. W. Meunier
  0 siblings, 0 replies; 11+ messages in thread
From: Fr�d�ric L. W. Meunier @ 2003-06-23  4:35 UTC (permalink / raw)
  To: zsh-workers

Any news on

http://www.zsh.org/mla/workers/2002/msg00461.html ?

Thread started
http://www.zsh.org/mla/workers/2002/msg00447.html

Just compiled 4.1.1 (actually, zsh-4_1_1 with Autoconf 2.57):

% ldd /bin/zsh
        libpcre.so.0 => /usr/lib/libpcre.so.0 (0x40019000)
        libdl.so.2 => /lib/libdl.so.2 (0x4002a000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x4002d000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40042000)
        libm.so.6 => /lib/libm.so.6 (0x40081000)
        libc.so.6 => /lib/libc.so.6 (0x400a4000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Probably the same for libcap, which I don't have installed.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: PATCH: zsh/pcre module building
  2002-07-04 17:07     ` Clint Adams
@ 2002-07-05 10:39       ` Borsenkow Andrej
  0 siblings, 0 replies; 11+ messages in thread
From: Borsenkow Andrej @ 2002-07-05 10:39 UTC (permalink / raw)
  To: 'Clint Adams'; +Cc: 'Zsh hackers list'


> 
> > - I hoped to create implementation that would share configure cache
and
> > make is possible to list help from every module's configure script
using
> > top-level configure --help and pass parameters to every module's
> > configure script using top-level configure. Using stock autoconf it
is
> 
> Any progress on this?  Are you using AC_CONFIG_SUBDIRS?

Hmm ... I thought I have sent follow-up but may be I just intended to.

Unfortunately so far I could not think out any alternative
implementation that is more simple than we currently have that makes the
rewrite rather pointless.

AC_CONFIG_SUBDIRS is not suitable (and probably will never be suitable).
It is meant for mostly independent packages with minimal information
passed between them. What is more important, there is no way to pass
information back, i.e. subpackage cannot modify main package
configuration. In our case it means, that if a module decides it has to
be built statically it has no way to notify main zsh about it.

There are some possibilities using libtool + libltdl. The main point is,
libtool, to some extent, allows you to link both static libraries,
shared libraries and DSO objects without changing Makefile, depending on
how objects have been built. It does not have full functionality that we
possibly need but it is possible to patch libtool of course.

Sorry that there was not much progress.

-andrej


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-22 14:24   ` Borsenkow Andrej
  2002-03-23 19:57     ` Bart Schaefer
@ 2002-07-04 17:07     ` Clint Adams
  2002-07-05 10:39       ` Borsenkow Andrej
  1 sibling, 1 reply; 11+ messages in thread
From: Clint Adams @ 2002-07-04 17:07 UTC (permalink / raw)
  To: Borsenkow Andrej; +Cc: Zsh hackers list

> - I hoped to create implementation that would share configure cache and
> make is possible to list help from every module's configure script using
> top-level configure --help and pass parameters to every module's
> configure script using top-level configure. Using stock autoconf it is

Any progress on this?  Are you using AC_CONFIG_SUBDIRS?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-23 19:57     ` Bart Schaefer
@ 2002-03-23 23:47       ` Clint Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Clint Adams @ 2002-03-23 23:47 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Borsenkow Andrej, Zsh hackers list

I didn't mean to neglect this, but I was whisked away on a sudden
impromptu ski trip, and this is possibly my only opportunity to read
e-mail before returning to civilization.

AB> - I hoped to create implementation that would share configure cache and
AB> make is possible to list help from every module's configure script using
AB> top-level configure --help and pass parameters to every module's
AB> configure script using top-level configure.

I think this might be more useful if there were a way to build modules
without the zsh sources (such as a library, header files, and possibly
some site-specific configuration data).
 
Bart> I believe Clint suggested that we do a configure-time test for whether
Bart> this works, and if not then include the shared object's dependencies in
Bart> the top-level link.  But his patch doesn't do that, yet, I think.

No, it doesn't, and I can only theorize on how to test for such a
condition, since I doubt I have access to any such platforms.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-22 14:24   ` Borsenkow Andrej
@ 2002-03-23 19:57     ` Bart Schaefer
  2002-03-23 23:47       ` Clint Adams
  2002-07-04 17:07     ` Clint Adams
  1 sibling, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-03-23 19:57 UTC (permalink / raw)
  To: Borsenkow Andrej, Zsh hackers list

On Mar 22,  5:24pm, Borsenkow Andrej wrote:
} Subject: Re: PATCH: zsh/pcre module building
}
} > So if I comprehend what's going on here correctly, this links the zsh/pcre
} > module against libpcre, but doesn't link the zsh binary against it?
} 
} I have been thinking about it before, just some comments
} 
} - I hoped to create implementation that would share configure cache and
} make is possible to list help from every module's configure script using
} top-level configure --help and pass parameters to every module's
} configure script using top-level configure.

That sounds nice, too.

} - linking shared object with dynamic library is not portable. May be it
} works on every modern system nowadays, I do not know. 

I believe Clint suggested that we do a configure-time test for whether
this works, and if not then include the shared object's dependencies in
the top-level link.  But his patch doesn't do that, yet, I think.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-19  1:29 ` Bart Schaefer
@ 2002-03-22 14:24   ` Borsenkow Andrej
  2002-03-23 19:57     ` Bart Schaefer
  2002-07-04 17:07     ` Clint Adams
  0 siblings, 2 replies; 11+ messages in thread
From: Borsenkow Andrej @ 2002-03-22 14:24 UTC (permalink / raw)
  To: Zsh hackers list

В Втр, 19.03.2002, в 04:29, Bart Schaefer написал:
> On Fri, 15 Mar 2002, Clint Adams wrote:
> 
> > Here's a different method to avoid linking the zsh binary against
> > libpcre.
> 
> So if I comprehend what's going on here correctly, this links the zsh/pcre
> module against libpcre, but doesn't link the zsh binary against it?
> 
> This seems like a good thing.  Could it perhaps also be applied to the
> termcap and terminfo modules?
> 

I have been thinking about it before, just some comments

- I hoped to create implementation that would share configure cache and
make is possible to list help from every module's configure script using
top-level configure --help and pass parameters to every module's
configure script using top-level configure. Using stock autoconf it is
possible only with fixed number of sub-scripts; but may be it is enough
(we may distribute zsh in this way and for developers additional script
that would create needed definitions for modules).

- linking shared object with dynamic library is not portable. May be it
works on every modern system nowadays, I do not know. 

-andrej


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-21 20:15   ` Peter Stephenson
@ 2002-03-21 20:37     ` Bart Schaefer
  0 siblings, 0 replies; 11+ messages in thread
From: Bart Schaefer @ 2002-03-21 20:37 UTC (permalink / raw)
  To: Zsh hackers list

On Thu, 21 Mar 2002, Peter Stephenson wrote:

> Borsenkow Andrej wrote:
> > > +	    echo "include ${mddname}.rules"
> >
> > Then please openly state that zsh MUST be compiled with GNU make.
>
> It may need a fairly robust implementation of make, but it certainly
> shouldn't need GNU make.

We're already dealing with a programmatically constructed Makefile.
Instead of `echo "include ${mddname}.rules"' just `cat ${mddname}.rules'
right into the generated file.

If ${mddname}.rules doesn't exist yet, restructure the Makefile-generating
script to create it sooner.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-21 19:14 ` Borsenkow Andrej
@ 2002-03-21 20:15   ` Peter Stephenson
  2002-03-21 20:37     ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Stephenson @ 2002-03-21 20:15 UTC (permalink / raw)
  To: Zsh hackers list

Borsenkow Andrej wrote:
> > +	    echo "include ${mddname}.rules"
> 
> Then please openly state that zsh MUST be compiled with GNU make. It is
> already the case (due to complicated makefiles), but this change makes
> it simply incompatible with plain make any more.

It may need a fairly robust implementation of make, but it certainly
shouldn't need GNU make.  The system should work on any recent OS.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-15 18:07 Clint Adams
  2002-03-19  1:29 ` Bart Schaefer
@ 2002-03-21 19:14 ` Borsenkow Andrej
  2002-03-21 20:15   ` Peter Stephenson
  1 sibling, 1 reply; 11+ messages in thread
From: Borsenkow Andrej @ 2002-03-21 19:14 UTC (permalink / raw)
  To: Clint Adams; +Cc: Zsh hackers list

> +	    echo "include ${mddname}.rules"

Then please openly state that zsh MUST be compiled with GNU make. It is
already the case (due to complicated makefiles), but this change makes
it simply incompatible with plain make any more.

-andrej


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH: zsh/pcre module building
  2002-03-15 18:07 Clint Adams
@ 2002-03-19  1:29 ` Bart Schaefer
  2002-03-22 14:24   ` Borsenkow Andrej
  2002-03-21 19:14 ` Borsenkow Andrej
  1 sibling, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-03-19  1:29 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers

On Fri, 15 Mar 2002, Clint Adams wrote:

> Here's a different method to avoid linking the zsh binary against
> libpcre.

So if I comprehend what's going on here correctly, this links the zsh/pcre
module against libpcre, but doesn't link the zsh binary against it?

This seems like a good thing.  Could it perhaps also be applied to the
termcap and terminfo modules?

If you were also to document in Etc/zsh-development-guide how one sets
this up for an arbitary module + libary, I'd say go ahead an commit it.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* PATCH: zsh/pcre module building
@ 2002-03-15 18:07 Clint Adams
  2002-03-19  1:29 ` Bart Schaefer
  2002-03-21 19:14 ` Borsenkow Andrej
  0 siblings, 2 replies; 11+ messages in thread
From: Clint Adams @ 2002-03-15 18:07 UTC (permalink / raw)
  To: zsh-workers

Here's a different method to avoid linking the zsh binary against
libpcre.

The impetus for doing so is that currently, one cannot use zsh as
/bin/sh (or whatever else executes startup scripts) on a system
where it is dynamically linked against libraries on partitions that
are not yet mounted.

I was thinking that for those systems which require all the libraries to
be linked into the main binary, the same .rules files could be included.

Index: zshconfig.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v
retrieving revision 1.25
diff -u -r1.25 zshconfig.ac
--- zshconfig.ac	19 Feb 2002 02:14:08 -0000	1.25
+++ zshconfig.ac	15 Mar 2002 17:43:55 -0000
@@ -487,7 +487,7 @@
 		 limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
 		 locale.h errno.h stdio.h stdlib.h unistd.h sys/capability.h \
 		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
-		 netinet/in_systm.h pcre.h langinfo.h)
+		 netinet/in_systm.h langinfo.h)
 if test $dynamic = yes; then
   AC_CHECK_HEADERS(dlfcn.h)
   AC_CHECK_HEADERS(dl.h)
@@ -655,9 +655,6 @@
 
 AC_CHECK_LIB(socket, socket)
 
-dnl pcre-config should probably be employed here
-AC_SEARCH_LIBS(pcre_compile, pcre)
-
 dnl ---------------------
 dnl CHECK TERMCAP LIBRARY
 dnl ---------------------
@@ -949,7 +946,6 @@
 	       brk sbrk \
 	       pathconf sysconf \
 	       tgetent tigetflag tigetnum tigetstr setupterm \
-	       pcre_compile pcre_study pcre_exec \
 	       nl_langinfo \
 	       erand48)
 AC_FUNC_STRCOLL
Index: Src/Makemod.in.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makemod.in.in,v
retrieving revision 1.5
diff -u -r1.5 Makemod.in.in
--- Src/Makemod.in.in	20 Dec 2001 23:48:39 -0000	1.5
+++ Src/Makemod.in.in	15 Mar 2002 17:43:58 -0000
@@ -149,7 +149,8 @@
 .PHONY: mostlyclean-here
 
 clean-here:
-	rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp
+	rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp \
+	*.configure *.ach config.cache config.status config.log *.rules
 .PHONY: clean-here
 
 distclean-here:
Index: Src/mkmakemod.sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v
retrieving revision 1.12
diff -u -r1.12 mkmakemod.sh
--- Src/mkmakemod.sh	6 Jun 2001 08:37:22 -0000	1.12
+++ Src/mkmakemod.sh	15 Mar 2002 17:44:00 -0000
@@ -192,7 +192,7 @@
 
 	unset name moddeps nozshdep alwayslink hasexport
 	unset autobins autoinfixconds autoprefixconds autoparams automathfuncs
-	unset objects proto headers hdrdeps otherincs
+	unset objects proto headers hdrdeps otherincs autoconf achfile
 	. $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=
@@ -314,6 +314,19 @@
 	echo "modobjs.${mddname}: \$(MODOBJS_${mddname})"
 	echo "	echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
 	echo
+	if test -n "$autoconf"; then
+	    echo "include ${mddname}.rules"
+	    echo
+	    echo "${mddname}.ach ${mddname}.rules: ${mddname}.configure"
+	    echo "	./${mddname}.configure"
+	    echo
+	    echo "${mddname}.configure: ${mddname}.configure.in ${mddname}.ach.in"
+	    echo "	autoheader ${mddname}.configure.in >pcre.ach.in"
+	    echo "	autoconf ${mddname}.configure.in >pcre.configure"
+	    echo "	chmod +x pcre.configure"
+	    achfile="${mddname}.ach"
+	fi
+
 	if test -z "$alwayslink"; then
 	    case " $all_modules" in *" ${mddname}."*)
 		echo "install.modules-here: install.modules.${mddname}"
@@ -330,7 +343,7 @@
 	    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}) \$(LIBS) \$(EXTRALIBS_${mddname})"
 	    echo
 	fi
 	echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})"
@@ -416,7 +429,7 @@
 	echo "	    echo '#endif /* !have_${q_name}_module */'; \\"
 	echo "	) > \$@"
 	echo
-	echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh"
+	echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh $achfile"
 	sed -e '/^ *: *<< *\\Make *$/,/^Make$/!d' \
 	    -e 's/^ *: *<< *\\Make *$//; /^Make$/d' \
 	    < $top_srcdir/$the_subdir/${mddname}.mdd
Index: Src/Modules/.cvsignore
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/.cvsignore,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 .cvsignore
--- Src/Modules/.cvsignore	1 Dec 1999 18:36:06 -0000	1.1.1.4
+++ Src/Modules/.cvsignore	15 Mar 2002 17:44:00 -0000
@@ -12,3 +12,4 @@
 *.mdhi
 *.mdhs
 *.mdh.tmp
+*.rules
Index: Src/Modules/pcre.ach.in
===================================================================
RCS file: Src/Modules/pcre.ach.in
diff -N Src/Modules/pcre.ach.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Src/Modules/pcre.ach.in	15 Mar 2002 17:44:00 -0000
@@ -0,0 +1,13 @@
+/* pcre.ach.in.  Generated automatically from pcre.configure.in by autoheader 2.13.  */
+
+/* Define if you have the pcre_compile function.  */
+#undef HAVE_PCRE_COMPILE
+
+/* Define if you have the pcre_exec function.  */
+#undef HAVE_PCRE_EXEC
+
+/* Define if you have the pcre_study function.  */
+#undef HAVE_PCRE_STUDY
+
+/* Define if you have the <pcre.h> header file.  */
+#undef HAVE_PCRE_H
Index: Src/Modules/pcre.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v
retrieving revision 1.4
diff -u -r1.4 pcre.c
--- Src/Modules/pcre.c	6 Jul 2001 18:04:39 -0000	1.4
+++ Src/Modules/pcre.c	15 Mar 2002 17:44:00 -0000
@@ -30,6 +30,7 @@
 
 #include "pcre.mdh"
 #include "pcre.pro"
+#include "pcre.ach"
 
 /**/
 #if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)
Index: Src/Modules/pcre.configure.in
===================================================================
RCS file: Src/Modules/pcre.configure.in
diff -N Src/Modules/pcre.configure.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Src/Modules/pcre.configure.in	15 Mar 2002 17:44:00 -0000
@@ -0,0 +1,38 @@
+dnl
+dnl  pcre.ac: Configure template for zsh/pcre module.
+dnl  Process this file with autoconf to produce a configure script.
+dnl
+dnl  Copyright (c) 2002 Peter Stephenson
+dnl
+dnl  Permission is hereby granted, without written agreement and without
+dnl  license or royalty fees, to use, copy, modify, and distribute this
+dnl  software and to distribute modified versions of this software for any
+dnl  purpose, provided that the above copyright notice and the following
+dnl  two paragraphs appear in all copies of this software.
+dnl
+dnl  In no event shall Peter Stephenson or the Zsh Development Group be liable
+dnl  to any party for direct, indirect, special, incidental, or consequential
+dnl  damages arising out of the use of this software and its documentation,
+dnl  even if Richard Coleman and the Zsh Development Group have been advised of
+dnl  the possibility of such damage.
+dnl
+dnl  Peter Stephenson and the Zsh Development Group specifically disclaim any
+dnl  warranties, including, but not limited to, the implied warranties of
+dnl  merchantability and fitness for a particular purpose.  The software
+dnl  provided hereunder is on an "as is" basis, and Peter Stephenson and the
+dnl  Zsh Development Group have no obligation to provide maintenance,
+dnl  support, updates, enhancements, or modifications.
+dnl
+
+AC_INIT(pcre.c)
+AC_PREREQ(2.13)
+
+AC_CONFIG_HEADER(pcre.ach)
+
+AC_CHECK_HEADERS(pcre.h)
+
+dnl pcre-config should probably be employed here
+AC_SEARCH_LIBS(pcre_compile, pcre)
+AC_CHECK_FUNCS(pcre_compile pcre_study pcre_exec)
+
+AC_OUTPUT(pcre.rules)
Index: Src/Modules/pcre.mdd
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.mdd,v
retrieving revision 1.2
diff -u -r1.2 pcre.mdd
--- Src/Modules/pcre.mdd	6 Jul 2001 08:32:16 -0000	1.2
+++ Src/Modules/pcre.mdd	15 Mar 2002 17:44:00 -0000
@@ -5,3 +5,5 @@
 autobins="pcre_compile pcre_study pcre_match"
 
 objects="pcre.o"
+
+autoconf=yes
Index: Src/Modules/pcre.rules.in
===================================================================
RCS file: Src/Modules/pcre.rules.in
diff -N Src/Modules/pcre.rules.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Src/Modules/pcre.rules.in	15 Mar 2002 17:44:00 -0000
@@ -0,0 +1 @@
+EXTRALIBS_pcre = @LIBS@


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-06-23  4:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-23  4:35 PATCH: zsh/pcre module building Fr�d�ric L. W. Meunier
  -- strict thread matches above, loose matches on Subject: below --
2002-03-15 18:07 Clint Adams
2002-03-19  1:29 ` Bart Schaefer
2002-03-22 14:24   ` Borsenkow Andrej
2002-03-23 19:57     ` Bart Schaefer
2002-03-23 23:47       ` Clint Adams
2002-07-04 17:07     ` Clint Adams
2002-07-05 10:39       ` Borsenkow Andrej
2002-03-21 19:14 ` Borsenkow Andrej
2002-03-21 20:15   ` Peter Stephenson
2002-03-21 20:37     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).