From: UnixOS2 Archive To: "UnixOS2 Archive" Date: Wed, 31 Jul 2002 04:33:58 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 289 ************************************************** Tuesday 30 July 2002 Number 289 ************************************************** Subjects for today 1 Re: Autoconf for beginners : Andreas Buening 2 Conditionals in the bootstrapping : Maynard" 3 Re: New Autoconf : John Poltorak 4 Re: Testing the build-script for other apps : John Poltorak 5 Re: Conditionals in the bootstrapping : Maynard" 6 Re: Autoconf for beginners : John Poltorak 7 Re: Conditionals in the bootstrapping : Dave Saville" 8 Re: Testing the build-script for other apps : Dave Saville" **= Email 1 ==========================** Date: Wed, 31 Jul 2002 00:55:12 +0200 From: Andreas Buening Subject: Re: Autoconf for beginners John Poltorak wrote: > > I've always been a big fan of the wonders of autoconf+friends without > having any real understanding of how it worked, so I thought I would try > to build a configure script via autoconf from scratch for building > regex.lib. > > How do I go about it? > > The only input files are regex.{c,h}, so I guess I only need a > configure.in and Makefile.in. configure.in and Makefile.am (and maybe aclocal.m4) and some of the helper tools (mkinstalldirs, install-sh, whatever). > Can anyone tell me what needs to go in them? There is a GNU hello package which is basically a full featured demo package that produces a simple printf("hello, world!") executable (with nls, I guess). But nevertheless, autoconf/automake is designed for creating executables, not libraries. This is what libtool is intended for which might not be what you want to do. I don't know how difficult it is to produce a library by autoconf without libtool. > I know it seems like using a sledgehammer to crack a nut, but I would find > it a useful exercise to build such a trivial program. More like a cruise missile. ;-) bye, Andreas -- One OS to rule them all, One OS to find them, One OS to bring them all and in the darkness bind them In the Land of Mordor where the Shadows lie. **= Email 2 ==========================** Date: Wed, 31 Jul 2002 08:16:59 -0500 (CDT) From: "Maynard" Subject: Conditionals in the bootstrapping John, >At the moment, I'm trying to think of a way of adding a check to the >bootstrap script to see whether it is running in a pristine environment >or whether the build sytem is already in place. I've been pondering on this matter myself over several days, and will here contribute some current thoughts, incomplete as they are. -it could be good and useful for the bootstrap script to first test for %uxrt%, %osrt%, and %bldrt% having already been set, and use them if so. -some kind of commandline parameters to any, or all, of the boostrap/build_system scripts would of course be useful if not confusing. Adding flexibility and power carries with it increased complexity and *need* for understanding; however in the case of sequential scripts such as you have currently, the calling files could manage the parameter passing; so that each script file would be aware that it was being run as part of the sequence, rather than as a user standalone. It's probably best and easiest to pass the paramaters in the environment rather than on the command line; but command line actions may also be good, as supplements with higher priority: Example: ux2_inst.cmd could only bother gathering if specifically instructed either on command line or in ENV: at echo off set ux2_inst_commands=%1 %2 %3 echo %ux2_inst_commands% | find /i "gather" if errorlevel 1 goto inst set ux2_gather=1 :inst echo %ux2_inst_commands% | find /i "inst" if errorlevel 1 goto build set ux2_inst=1 :build echo %ux2_inst_commands% | find /i "build" if errorlevel 1 goto check_gather set ux2_build=1 :check_gather if not (%ux2_gather%) == () goto do_gather echo 'Gather skipped because ux2_gather not set' goto check_install :do gather echo Gathering .... rem call gather.cmd :check_install etc. ux2 scripts could decide whether or not to set the variables checked by the scripts which they call. Perhaps ENV should have priority over command line in this case? ---------- At any event, each .cmd file should validate their required variables before proceeding. I'm concerned that part of the general "mess" in the build process is the extreme use of multiple scripts all with prior expectations, some of which are not fully anticipated. What's needed for command processors (shells) is a good analyst program which can inspect the full scripting stream for variable requirements and dependencies. I started on something to run against unixos2/lib, but hit the wall on the regexp and/or sed: grep -h \$ config.site | sed s/\(.*\)\$\(.*\)\/\(.*\)/$\2\// | sort -u Anyway .... for now, -- Maynard **= Email 3 ==========================** Date: Wed, 31 Jul 2002 08:58:47 +0100 From: John Poltorak Subject: Re: New Autoconf On Tue, Jul 30, 2002 at 07:36:08PM -0500, xyzyx wrote: > On Tue, 30 Jul 2002 10:37:07 +0100, John Poltorak wrote: > > > > >There is a new Autoconf at Hobbes:- > ... > >I can't find the original anywhere, so I don't know any way of applying > >patches to see if I can rebuild it from scratch. > > ftp.gnu.org/gnu/autoconf No, that is the current release version. The one on Hobbes is a beta for the next release. > I ran around this maze a few weeks ago, trying to build something that > required the latest autoconf, which of course requires other things > which require other things, all of which are newer/different than the > versions I've got in my system... I eventually hit a wall where I > couldn't get any further, and I gave up. What were you trying to build? Autoconf doesn't require all that much to run AFAICT. > Paul -- John **= Email 4 ==========================** Date: Wed, 31 Jul 2002 09:31:03 +0100 From: John Poltorak Subject: Re: Testing the build-script for other apps On Tue, Jul 30, 2002 at 09:01:37PM +0100, lamikr wrote: > Ok, I have now got the perl up again. Is there any other apps I should > now try to build with bootstap? There are quite a lot of apps which you could try, and I have been testing several myself. > I noticed that without giving any parameters ux2_bootstrap.cmd stopped > after building perl. (ie. no compilation for > bison, etc...) Getting Perl built is only an initial test for the bootstrap process, but a necessary one since it a crucial part of the build system. Once that works OK, as it seems to do you can try building several apps. The problem at the moment is that the boostrap which sets up the environment assumes that you have a pristine environment in place. If you have already run it and you have a build system in place you need to comment out a number of steps and enter the list of apps you want to build into BUILD.LST. At the moment, I'm trying to think of a way of adding a check to the bootstrap script to see whether it is running in a pristine environment or whether the build sytem is already in place. > Mika -- John **= Email 5 ==========================** Date: Wed, 31 Jul 2002 17:03:59 -0500 (CDT) From: "Maynard" Subject: Re: Conditionals in the bootstrapping On Wed, 31 Jul 2002 21:19:55 +0100 (BST), Dave Saville wrote: >>grep -h \$ config.site | sed s/\(.*\)\$\(.*\)\/\(.*\)/$\2\// | sort -u >> > >What sort of wall? :-) I'm pretty new to regexp and sed ;-} The string fed to sed will be of the form (content1)$(variable)/(content2) and I want sed to export only $(variable)/. (content1) ?= \(.*\) need minimal match here, only to first $ $ ?= \$ $ probably doesn't need escaping (variable) ?= \(.*\) / ?= \/ (content2) ?= \(.*\) desired sed output ?= $\2\/ In the end I've no need for the preceeding $ or trailing / A similar function on .cmd files would use % delimiters around (variable) -- Maynard **= Email 6 ==========================** Date: Wed, 31 Jul 2002 20:36:01 +0100 From: John Poltorak Subject: Re: Autoconf for beginners On Wed, Jul 31, 2002 at 12:55:12AM +0200, Andreas Buening wrote: > John Poltorak wrote: > > > > I've always been a big fan of the wonders of autoconf+friends without > > having any real understanding of how it worked, so I thought I would try > > to build a configure script via autoconf from scratch for building > > regex.lib. > > > > How do I go about it? > > > > The only input files are regex.{c,h}, so I guess I only need a > > configure.in and Makefile.in. > > configure.in and Makefile.am (and maybe aclocal.m4) > and some of the helper tools (mkinstalldirs, install-sh, > whatever). > > > > Can anyone tell me what needs to go in them? > > There is a GNU hello package which is basically a full > featured demo package that produces a simple > printf("hello, world!") executable (with nls, I guess). > > But nevertheless, autoconf/automake is designed for creating > executables, not libraries. This is what libtool is intended for > which might not be what you want to do. I don't know how > difficult it is to produce a library by autoconf without libtool. I'd be happy to use libtool if that is the correct way of doing things, but I have no idea how to use it. > > I know it seems like using a sledgehammer to crack a nut, but I would find > > it a useful exercise to build such a trivial program. > > More like a cruise missile. ;-) Yeah, I know but I just want something fits into the normal build sequence of autoconf, configure, make, make install... > bye, > Andreas > > -- > One OS to rule them all, One OS to find them, > One OS to bring them all and in the darkness bind them > In the Land of Mordor where the Shadows lie. -- John **= Email 7 ==========================** Date: Wed, 31 Jul 2002 21:19:55 +0100 (BST) From: "Dave Saville" Subject: Re: Conditionals in the bootstrapping On Wed, 31 Jul 2002 08:16:59 -0500 (CDT), Maynard wrote: >I started on something to run against unixos2/lib, but hit the wall on >the regexp and/or sed: > >grep -h \$ config.site | sed s/\(.*\)\$\(.*\)\/\(.*\)/$\2\// | sort -u > What sort of wall? :-) What exactly are you trying to check for in English? I can have a go assuming what you have above is not doing what you want. -- Regards Dave Saville Please note new email address dave.saville at ntlworld.com **= Email 8 ==========================** Date: Wed, 31 Jul 2002 21:23:27 +0100 (BST) From: "Dave Saville" Subject: Re: Testing the build-script for other apps On Wed, 31 Jul 2002 09:31:03 +0100, John Poltorak wrote: >At the moment, I'm trying to think of a way of adding a check to the >bootstrap script to see whether it is running in a pristine environment >or whether the build sytem is already in place. How about touching a file in various parts of the directory structure as the build progresses. If the file is not there then we have to run that part of the build script if it is present we jump to the next part. -- Regards Dave Saville Please note new email address dave.saville at ntlworld.com