zsh-workers
 help / color / mirror / code / Atom feed
* uuid module out-of-tree
@ 2007-10-11 14:44 Clint Adams
  2007-10-11 15:08 ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2007-10-11 14:44 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

Attached is my latest stab at an out-of-tree module.

This one is simple and links to libuuid from e2fsprogs, using header
files from zsh 4.3.4.

To use, build and load the module, then run 'zuuid' and it will output a
128-bit universally unique ID (per RFC 4122).

config.h and zsh.mdh are munged from a zsh 4.3.4 build, which is
suboptimal.

uuid.mdh (in the tarball, "hand-crafted") includes zsh.mdh, zsh.mdh
includes system.h, and system.h needs config.h .

One thing to do would be to ship some kind of include file for autoconf
so that the out-of-tree module can set all the necessary defines
(such as HAVE_STDARG_H or HAVE_VARARGS_H) needed by system.h

Alternately, the portions of system.h that require config.h but don't
need to be exported for out-of-tree modules could be split out to
a different header or guarded with #ifdefs.

[-- Attachment #2: libuuid-zsh-0.0.tar.gz --]
[-- Type: application/octet-stream, Size: 258410 bytes --]

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

* Re: uuid module out-of-tree
  2007-10-11 14:44 uuid module out-of-tree Clint Adams
@ 2007-10-11 15:08 ` Clint Adams
  2007-10-11 19:23   ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2007-10-11 15:08 UTC (permalink / raw)
  To: zsh-workers

On Thu, Oct 11, 2007 at 10:44:28AM -0400, Clint Adams wrote:
> One thing to do would be to ship some kind of include file for autoconf
> so that the out-of-tree module can set all the necessary defines
> (such as HAVE_STDARG_H or HAVE_VARARGS_H) needed by system.h
> 
> Alternately, the portions of system.h that require config.h but don't
> need to be exported for out-of-tree modules could be split out to
> a different header or guarded with #ifdefs.

With the following aczshoot.m4 function (included from acinclude.m4)

AC_DEFUN(zsh_OOT,
[
AC_CHECK_HEADERS(stdarg.h varargs.h termios.h termio.h)

AC_TYPE_SIGNAL

AC_DEFINE([ZSH_OOT_MODULE], [], [Out-of-tree module])
])

and the following patch, the complete config.h is unnecessary.  The uuid
module doesn't need stdarg.h, varargs.h, termios.h, termio.h, or
RETSIGTYPE, however.  Any thoughts?

diff --git a/Src/system.h b/Src/system.h
index 781a907..022ace2 100644
--- a/Src/system.h
+++ b/Src/system.h
@@ -225,7 +225,7 @@ char *alloca _((size_t));
 #endif
 
 /* This is needed by some old SCO unices */
-#ifndef HAVE_STRUCT_TIMEZONE
+#if !defined(HAVE_STRUCT_TIMEZONE) && !defined(ZSH_OOT_MODULE)
 struct timezone {
     int tz_minuteswest;
     int tz_dsttime;


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

* Re: uuid module out-of-tree
  2007-10-11 15:08 ` Clint Adams
@ 2007-10-11 19:23   ` Peter Stephenson
  2007-10-11 20:28     ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2007-10-11 19:23 UTC (permalink / raw)
  To: zsh-workers

On Thu, 11 Oct 2007 11:08:11 -0400
Clint Adams <clint@zsh.org> wrote:
> On Thu, Oct 11, 2007 at 10:44:28AM -0400, Clint Adams wrote:
> > One thing to do would be to ship some kind of include file for autoconf
> > so that the out-of-tree module can set all the necessary defines
> > (such as HAVE_STDARG_H or HAVE_VARARGS_H) needed by system.h
> > 
> > Alternately, the portions of system.h that require config.h but don't
> > need to be exported for out-of-tree modules could be split out to
> > a different header or guarded with #ifdefs.
> 
> With the following aczshoot.m4 function (included from acinclude.m4)
> 
> AC_DEFUN(zsh_OOT,
> [
> AC_CHECK_HEADERS(stdarg.h varargs.h termios.h termio.h)
> 
> AC_TYPE_SIGNAL
> 
> AC_DEFINE([ZSH_OOT_MODULE], [], [Out-of-tree module])
> ])
> 
> and the following patch, the complete config.h is unnecessary.  The uuid
> module doesn't need stdarg.h, varargs.h, termios.h, termio.h, or
> RETSIGTYPE, however.  Any thoughts?

It looks unobtrusive enough we could do that for now and change it if we
think of something better.  I haven't really go my mind around the
requirements for doing this properly, however.

I think it's worth keeping zcurses in the distribution anyway.  It
would be quite a nice addition to compinstall and zsh-install-newuser
(with a function front-end).

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

* Re: uuid module out-of-tree
  2007-10-11 19:23   ` Peter Stephenson
@ 2007-10-11 20:28     ` Clint Adams
  2007-10-12  8:50       ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Clint Adams @ 2007-10-11 20:28 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On Thu, Oct 11, 2007 at 08:23:01PM +0100, Peter Stephenson wrote:
> It looks unobtrusive enough we could do that for now and change it if we
> think of something better.  I haven't really go my mind around the
> requirements for doing this properly, however.

I'll commit the one-liner to Src/system.h.  Where would be a good place
to ship the .m4 file? Etc/ ? Config/ ? Misc/ ?

> I think it's worth keeping zcurses in the distribution anyway.  It
> would be quite a nice addition to compinstall and zsh-install-newuser
> (with a function front-end).

I agree and hope someone can tell me what I've done wrong with -s.


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

* Re: uuid module out-of-tree
  2007-10-11 20:28     ` Clint Adams
@ 2007-10-12  8:50       ` Peter Stephenson
  2007-10-12 12:43         ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2007-10-12  8:50 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:
> On Thu, Oct 11, 2007 at 08:23:01PM +0100, Peter Stephenson wrote:
> > It looks unobtrusive enough we could do that for now and change it if we
> > think of something better.  I haven't really go my mind around the
> > requirements for doing this properly, however.
> 
> I'll commit the one-liner to Src/system.h.  Where would be a good place
> to ship the .m4 file? Etc/ ? Config/ ? Misc/ ?

Config sounds appropriate.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


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

* Re: uuid module out-of-tree
  2007-10-12  8:50       ` Peter Stephenson
@ 2007-10-12 12:43         ` Clint Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Clint Adams @ 2007-10-12 12:43 UTC (permalink / raw)
  To: zsh-workers

On Fri, Oct 12, 2007 at 09:50:45AM +0100, Peter Stephenson wrote:
> Config sounds appropriate.

Okay, so I will do something like the following when constructing the
headers package (assuming obj/ is the build directory).

        $(INSTALL_FILE) obj/Src/*.epro obj/Src/sigcount.h \
                        Src/hashtable.h Src/prototypes.h \
                        Src/signals.h Src/system.h Src/zsh.h Src/ztype.h \
                        /usr/include/zsh
        $(INSTALL_FILE) Src/makepro.awk /usr/share/zsh-dev
        $(INSTALL_FILE) Config/aczshoot.m4 /usr/share/aclocal/zshoot.m4

I'll tweak the uuid build to use the new file and share some of my thoughts
on goals and progress and such in a bit.

Index: Config/aczshoot.m4
===================================================================
RCS file: Config/aczshoot.m4
diff -N Config/aczshoot.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Config/aczshoot.m4	12 Oct 2007 12:29:48 -0000
@@ -0,0 +1,8 @@
+AC_DEFUN(zsh_OOT,
+[
+AC_CHECK_HEADERS(stdarg.h varargs.h termios.h termio.h)
+
+AC_TYPE_SIGNAL
+
+AC_DEFINE([ZSH_OOT_MODULE], [], [Out-of-tree module])
+])


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

end of thread, other threads:[~2007-10-12 12:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-11 14:44 uuid module out-of-tree Clint Adams
2007-10-11 15:08 ` Clint Adams
2007-10-11 19:23   ` Peter Stephenson
2007-10-11 20:28     ` Clint Adams
2007-10-12  8:50       ` Peter Stephenson
2007-10-12 12:43         ` Clint Adams

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).